src/share/classes/sun/rmi/transport/ObjectTable.java

Print this page

        

@@ -173,17 +173,12 @@
 
         if (DGCImpl.dgcLog.isLoggable(Log.VERBOSE)) {
             DGCImpl.dgcLog.log(Log.VERBOSE, "add object " + oe);
         }
 
-        Remote impl = target.getImpl();
-        if (impl == null) {
-            throw new ExportException(
-                "internal error: attempt to export collected object");
-        }
-
         synchronized (tableLock) {
+            if (target.getImpl() != null) {
             if (objTable.containsKey(oe)) {
                 throw new ExportException(
                     "internal error: ObjID already in use");
             } else if (implTable.containsKey(weakImpl)) {
                 throw new ExportException("object already exported");

@@ -194,10 +189,11 @@
 
             if (!target.isPermanent()) {
                 incrementKeepAliveCount();
             }
         }
+        }
     }
 
     /**
      * Remove target from object table.
      *