diff --git a/src/share/classes/sun/rmi/rmic/BatchEnvironment.java b/src/share/classes/sun/rmi/rmic/BatchEnvironment.java index 396d54d25484ac3be37057d01fdd9ba462756b42..3eff0bbbb93f3c72403ab76e4bb7517c6dbc80df 100644 --- a/src/share/classes/sun/rmi/rmic/BatchEnvironment.java +++ b/src/share/classes/sun/rmi/rmic/BatchEnvironment.java @@ -160,7 +160,7 @@ public class BatchEnvironment extends sun.tools.javac.BatchEnvironment { } /** list of generated source files created in this environment */ - private Vector generatedFiles = new Vector<>(); + private Vector generatedFiles = new Vector(); /** * Remember a generated source file generated so that it @@ -177,9 +177,9 @@ public class BatchEnvironment extends sun.tools.javac.BatchEnvironment { */ public void deleteGeneratedFiles() { synchronized(generatedFiles) { - Enumeration enumeration = generatedFiles.elements(); + Enumeration enumeration = generatedFiles.elements(); while (enumeration.hasMoreElements()) { - File file = enumeration.nextElement(); + File file = (File) enumeration.nextElement(); file.delete(); } generatedFiles.removeAllElements(); diff --git a/src/share/classes/sun/rmi/rmic/Main.java b/src/share/classes/sun/rmi/rmic/Main.java index 54890c57291233c20d858ff9c38b895553f39385..562e3892ae937d8f2fddea7212ca85f20e792bd9 100644 --- a/src/share/classes/sun/rmi/rmic/Main.java +++ b/src/share/classes/sun/rmi/rmic/Main.java @@ -73,15 +73,14 @@ public class Main implements sun.rmi.rmic.Constants { File destDir; int flags; long tm; - Vector classes; + Vector classes; boolean nowrite; boolean nocompile; boolean keepGenerated; boolean status; String[] generatorArgs; - Vector generators; - Class environmentClass = - BatchEnvironment.class; + Vector generators; + Class environmentClass = BatchEnvironment.class; boolean iiopGeneration = false; /** @@ -184,7 +183,7 @@ public class Main implements sun.rmi.rmic.Constants { destDir = null; flags = F_WARNINGS; tm = System.currentTimeMillis(); - classes = new Vector<>(); + classes = new Vector(); nowrite = false; nocompile = false; keepGenerated = false; @@ -192,7 +191,7 @@ public class Main implements sun.rmi.rmic.Constants { if (generatorArgs == null) { return false; } - generators = new Vector<>(); + generators = new Vector(); // Pre-process command line for @file arguments try { @@ -412,7 +411,7 @@ public class Main implements sun.rmi.rmic.Constants { // Get the environment required by this generator... - Class envClass = BatchEnvironment.class; + Class envClass = BatchEnvironment.class; String env = getString("generator.env." + arg); if (env != null) { try { @@ -424,7 +423,7 @@ public class Main implements sun.rmi.rmic.Constants { // Yes, so switch to the new one... - environmentClass = BatchEnvironment.class.asSubclass(environmentClass); + environmentClass = envClass; } else { @@ -496,9 +495,8 @@ public class Main implements sun.rmi.rmic.Constants { try { Class[] ctorArgTypes = {OutputStream.class,ClassPath.class,Main.class}; Object[] ctorArgs = {out,classPath,this}; - Constructor constructor = - environmentClass.getConstructor(ctorArgTypes); - result = constructor.newInstance(ctorArgs); + Constructor constructor = environmentClass.getConstructor(ctorArgTypes); + result = (BatchEnvironment) constructor.newInstance(ctorArgs); result.reset(); } catch (Exception e) { @@ -532,7 +530,7 @@ public class Main implements sun.rmi.rmic.Constants { */ for (int i = classes.size()-1; i >= 0; i-- ) { Identifier implClassName = - Identifier.lookup(classes.elementAt(i)); + Identifier.lookup((String)classes.elementAt(i)); /* * Fix bugid 4049354: support using '.' as an inner class @@ -560,7 +558,7 @@ public class Main implements sun.rmi.rmic.Constants { try { ClassDefinition def = decl.getClassDefinition(env); for (int j = 0; j < generators.size(); j++) { - Generator gen = generators.elementAt(j); + Generator gen = (Generator)generators.elementAt(j); gen.generate(env, def, destDir); } } catch (ClassNotFound ex) { @@ -675,7 +673,7 @@ public class Main implements sun.rmi.rmic.Constants { do { done = true; - for (Enumeration e = env.getClasses() ; e.hasMoreElements() ; ) { + for (Enumeration e = env.getClasses() ; e.hasMoreElements() ; ) { ClassDeclaration c = (ClassDeclaration)e.nextElement(); done = compileClass(c,buf,env); } @@ -684,9 +682,7 @@ public class Main implements sun.rmi.rmic.Constants { /* * Compile a single class. - * Fallthrough is intentional */ - @SuppressWarnings("fallthrough") public boolean compileClass (ClassDeclaration c, ByteArrayOutputStream buf, BatchEnvironment env) @@ -883,6 +879,6 @@ public class Main implements sun.rmi.rmic.Constants { args[1] = (arg1 != null ? arg1.toString() : "null"); args[2] = (arg2 != null ? arg2.toString() : "null"); - return java.text.MessageFormat.format(format, (Object[]) args); + return java.text.MessageFormat.format(format, args); } } diff --git a/src/share/classes/sun/rmi/rmic/RMIGenerator.java b/src/share/classes/sun/rmi/rmic/RMIGenerator.java index 4839036608563c84decc9808b1ac32a67c28a0c9..043ca87901a60dd1af1257f4a2f4fdd8f675face 100644 --- a/src/share/classes/sun/rmi/rmic/RMIGenerator.java +++ b/src/share/classes/sun/rmi/rmic/RMIGenerator.java @@ -61,7 +61,7 @@ import com.sun.corba.se.impl.util.Utility; */ public class RMIGenerator implements RMIConstants, Generator { - private static final Hashtable versionOptions = new Hashtable<>(); + private static final Hashtable versionOptions = new Hashtable(); static { versionOptions.put("-v1.1", new Integer(STUB_VERSION_1_1)); versionOptions.put("-vcompat", new Integer(STUB_VERSION_FAT)); @@ -96,7 +96,7 @@ public class RMIGenerator implements RMIConstants, Generator { return false; } explicitVersion = arg; - version = versionOptions.get(arg); + version = ((Integer) versionOptions.get(arg)).intValue(); argv[i] = null; } } @@ -519,7 +519,7 @@ public class RMIGenerator implements RMIConstants, Generator { * follows a previous catch of it or of one of its superclasses. * The following method invocation takes care of these details. */ - Vector catchList = computeUniqueCatchList(exceptions); + Vector catchList = computeUniqueCatchList(exceptions); /* * If we need to catch any particular exceptions (i.e. this method @@ -615,10 +615,10 @@ public class RMIGenerator implements RMIConstants, Generator { * UnexpectedException, and end the try block. */ if (catchList.size() > 0) { - for (Enumeration enumeration = catchList.elements(); + for (Enumeration enumeration = catchList.elements(); enumeration.hasMoreElements();) { - ClassDefinition def = enumeration.nextElement(); + ClassDefinition def = (ClassDefinition) enumeration.nextElement(); p.pOlnI("} catch (" + def.getName() + " e) {"); p.pln("throw e;"); } @@ -650,8 +650,8 @@ public class RMIGenerator implements RMIConstants, Generator { * of its superclasses is in the throws clause of the method, indicating * that no exceptions need to be caught. */ - private Vector computeUniqueCatchList(ClassDeclaration[] exceptions) { - Vector uniqueList = new Vector<>(); // unique exceptions to catch + private Vector computeUniqueCatchList(ClassDeclaration[] exceptions) { + Vector uniqueList = new Vector(); // unique exceptions to catch uniqueList.addElement(defRuntimeException); uniqueList.addElement(defRemoteException); @@ -682,7 +682,8 @@ public class RMIGenerator implements RMIConstants, Generator { * exceptions that need to be caught: */ for (int j = 0; j < uniqueList.size();) { - ClassDefinition def = uniqueList.elementAt(j); + ClassDefinition def = + (ClassDefinition) uniqueList.elementAt(j); if (def.superClassOf(env, decl)) { /* * If a superclass of this exception is already on diff --git a/src/share/classes/sun/rmi/rmic/newrmic/Main.java b/src/share/classes/sun/rmi/rmic/newrmic/Main.java index 1e59be43605b82df729e41e379c8e4310d77fecb..d80213680c670ac2d9b544743bb75740847abf1c 100644 --- a/src/share/classes/sun/rmi/rmic/newrmic/Main.java +++ b/src/share/classes/sun/rmi/rmic/newrmic/Main.java @@ -455,7 +455,7 @@ public class Main { BatchEnvironment env; try { Constructor cons = - batch.envClass.getConstructor(new Class[] { RootDoc.class }); + batch.envClass.getConstructor(new Class[] { RootDoc.class }); env = cons.newInstance(rootDoc); } catch (NoSuchMethodException e) { throw new AssertionError(e); diff --git a/src/share/classes/sun/rmi/rmic/newrmic/Resources.java b/src/share/classes/sun/rmi/rmic/newrmic/Resources.java index 6b3ba17f5ee3a53c5a4baafa3ecb2495b19f3044..f8ea7fc28c8960f3eab1e96009b75e12ff54024c 100644 --- a/src/share/classes/sun/rmi/rmic/newrmic/Resources.java +++ b/src/share/classes/sun/rmi/rmic/newrmic/Resources.java @@ -69,7 +69,7 @@ public final class Resources { format = "missing resource key: key = \"" + key + "\", " + "arguments = \"{0}\", \"{1}\", \"{2}\""; } - return MessageFormat.format(format, (Object[]) args); + return MessageFormat.format(format, args); } /**