--- old/src/share/classes/sun/rmi/transport/ObjectTable.java Wed Apr 13 11:43:05 2011 +++ new/src/share/classes/sun/rmi/transport/ObjectTable.java Wed Apr 13 11:43:04 2011 @@ -175,25 +175,21 @@ 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 (objTable.containsKey(oe)) { - throw new ExportException( - "internal error: ObjID already in use"); - } else if (implTable.containsKey(weakImpl)) { - throw new ExportException("object already exported"); - } + 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"); + } - objTable.put(oe, target); - implTable.put(weakImpl, target); + objTable.put(oe, target); + implTable.put(weakImpl, target); - if (!target.isPermanent()) { - incrementKeepAliveCount(); + if (!target.isPermanent()) { + incrementKeepAliveCount(); + } } } }