Skip to content

Commit

Permalink
Optimized code (#99)
Browse files Browse the repository at this point in the history
* optimized code

* optimized code

* optimized code

* optimized code

---------

Co-authored-by: liujianjun.ljj <liujianjun.ljj@antgroup.com>
  • Loading branch information
EvenLjj and liujianjun.ljj authored Aug 21, 2023
1 parent ff04ffa commit 39b1dcb
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ else if (object instanceof byte[]) {
*/
public void writeCustomObject(Object object)
throws IOException {
throw new IOException("unexpected object: " + object);
throw new IOException("unexpected object: " + object.getClass().getName());
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/caucho/hessian/io/AbstractDeserializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public Object readObject(AbstractHessianInput in)
String className = getClass().getName();

if (obj != null)
throw error(className + ": unexpected object " + obj.getClass().getName() + " (" + obj + ")");
throw error(className + ": unexpected object " + obj.getClass().getName());
else
throw error(className + ": unexpected null value");
}
Expand All @@ -92,7 +92,7 @@ public Object readMap(AbstractHessianInput in)
String className = getClass().getName();

if (obj != null)
throw error(className + ": unexpected object " + obj.getClass().getName() + " (" + obj + ")");
throw error(className + ": unexpected object " + obj.getClass().getName());
else
throw error(className + ": unexpected null value");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public Object readObject(AbstractHessianInput in)
Object obj = in.readObject();

if (obj != null)
throw error("expected list at " + obj.getClass().getName() + " (" + obj + ")");
throw error("expected list at " + obj.getClass().getName());
else
throw error("expected list at null");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public Object readObject(AbstractHessianInput in)
Object obj = in.readObject();

if (obj != null)
throw error("expected map/object at " + obj.getClass().getName() + " (" + obj + ")");
throw error("expected map/object at " + obj.getClass().getName());
else
throw error("expected map/object at null");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ else if (object instanceof byte[]) {
*/
public void writeCustomObject(Object object)
throws IOException {
throw new IOException("unexpected object: " + object);
throw new IOException("unexpected object: " + object.getClass().getName());
}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/caucho/hessian/server/HessianSkeleton.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ public HessianSkeleton(Object service, Class apiClass)
_service = service;

if (!apiClass.isAssignableFrom(service.getClass()))
throw new IllegalArgumentException("Service " + service + " must be an instance of " + apiClass.getName());
throw new IllegalArgumentException("Service " + service.getClass().getName() + " must be an instance of " +
apiClass.getName());
}

/**
Expand Down

0 comments on commit 39b1dcb

Please sign in to comment.