summaryrefslogtreecommitdiff
path: root/java/src/Ice/ObjectAdapterI.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/Ice/ObjectAdapterI.java')
-rw-r--r--java/src/Ice/ObjectAdapterI.java15
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)
{