--- old/src/share/classes/sun/rmi/server/Activation.java Fri Feb 24 14:12:17 2012 +++ new/src/share/classes/sun/rmi/server/Activation.java Fri Feb 24 14:12:14 2012 @@ -138,7 +138,6 @@ /** indicate compatibility with JDK 1.2 version of class */ private static final long serialVersionUID = 2921265612698155191L; - private static final byte MAJOR_VERSION = 1; private static final byte MINOR_VERSION = 0; @@ -298,6 +297,7 @@ private static class SystemRegistryImpl extends RegistryImpl { private static final String NAME = ActivationSystem.class.getName(); + private static final long serialVersionUID = 4877330021609408794L; private final ActivationSystem systemStub; SystemRegistryImpl(int port, @@ -804,9 +804,8 @@ ActivationGroupDesc desc = null; ActivationGroupID groupID = null; long incarnation = 0; - Map objects = - new HashMap(); - Set restartSet = new HashSet(); + Map objects = new HashMap<>(); + Set restartSet = new HashSet<>(); transient ActivationInstantiator group = null; transient int status = NORMAL; @@ -1057,6 +1056,11 @@ } } + /* + * Fallthrough from TERMINATE to TERMINATING + * is intentional + */ + @SuppressWarnings("fallthrough") private void await() { while (true) { switch (status) { @@ -1228,16 +1232,15 @@ PipeWriter.plugTogetherPair (child.getInputStream(), System.out, child.getErrorStream(), System.err); + try (MarshalOutputStream out = + new MarshalOutputStream(child.getOutputStream())) { + out.writeObject(id); + out.writeObject(desc); + out.writeLong(incarnation); + out.flush(); + } - MarshalOutputStream out = - new MarshalOutputStream(child.getOutputStream()); - out.writeObject(id); - out.writeObject(desc); - out.writeLong(incarnation); - out.flush(); - out.close(); - } catch (IOException e) { terminate(); throw new ActivationException( @@ -1352,7 +1355,7 @@ cmdenv = desc.getCommandEnvironment(); // argv is the literal command to exec - List argv = new ArrayList(); + List argv = new ArrayList<>(); // Command name/path argv.add((cmdenv != null && cmdenv.getCommandPath() != null) @@ -1957,7 +1960,7 @@ } String log = null; - List childArgs = new ArrayList(); + List childArgs = new ArrayList<>(); /* * Parse arguments @@ -2031,8 +2034,8 @@ } try { - Class execPolicyClass = - RMIClassLoader.loadClass(execPolicyClassName); + Class execPolicyClass = getRMIClass(execPolicyClassName); + execPolicy = execPolicyClass.newInstance(); execPolicyMethod = execPolicyClass.getMethod("checkExecCommand", @@ -2123,6 +2126,10 @@ } } + @SuppressWarnings("deprecation") + private static Class getRMIClass(String execPolicyClassName) throws Exception { + return RMIClassLoader.loadClass(execPolicyClassName); + } /* * Dijkstra semaphore operations to limit the number of subprocesses * rmid attempts to make at once.