diff options
author | Bernard Normier <bernard@zeroc.com> | 2014-07-10 16:51:36 -0400 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2014-07-10 16:51:36 -0400 |
commit | 7f767642e79e2775a958781011f13e3d1710c7bd (patch) | |
tree | fdb3eb1f826305d0bf3dd659d70c3930001f80c0 /java/src/Ice/ObjectAdapterI.java | |
parent | ICE-5573 - .NET TimeoutException ignores Dispatcher (diff) | |
download | ice-7f767642e79e2775a958781011f13e3d1710c7bd.tar.bz2 ice-7f767642e79e2775a958781011f13e3d1710c7bd.tar.xz ice-7f767642e79e2775a958781011f13e3d1710c7bd.zip |
Fixed ICE-5379, Object Adapter should reject null servant, in C++, Java, C# and JS
Diffstat (limited to 'java/src/Ice/ObjectAdapterI.java')
-rw-r--r-- | java/src/Ice/ObjectAdapterI.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/java/src/Ice/ObjectAdapterI.java b/java/src/Ice/ObjectAdapterI.java index c8760a558d7..05f79565a9d 100644 --- a/java/src/Ice/ObjectAdapterI.java +++ b/java/src/Ice/ObjectAdapterI.java @@ -423,6 +423,7 @@ public final class ObjectAdapterI implements ObjectAdapter { checkForDeactivation(); checkIdentity(ident); + checkServant(object); // // Create a copy of the Identity argument, in case the caller @@ -456,6 +457,7 @@ public final class ObjectAdapterI implements ObjectAdapter public synchronized void addDefaultServant(Ice.Object servant, String category) { + checkServant(servant); checkForDeactivation(); _servantManager.addDefaultServant(servant, category); @@ -1150,9 +1152,7 @@ public final class ObjectAdapterI implements ObjectAdapter { if(ident.name == null || ident.name.length() == 0) { - IllegalIdentityException e = new IllegalIdentityException(); - e.id = (Identity)ident.clone(); - throw e; + throw new IllegalIdentityException(ident); } if(ident.category == null) @@ -1161,6 +1161,15 @@ public final class ObjectAdapterI implements ObjectAdapter } } + private static void + checkServant(Ice.Object servant) + { + if(servant == null) + { + throw new IllegalServantException("cannot add null servant to Object Adapter"); + } + } + private java.util.List<IceInternal.EndpointI> parseEndpoints(String endpts, boolean oaEndpoints) { |