--- old/src/share/classes/sun/rmi/rmic/Main.java Tue Feb 21 21:25:55 2012 +++ new/src/share/classes/sun/rmi/rmic/Main.java Tue Feb 21 21:25:52 2012 @@ -73,14 +73,14 @@ 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; /** @@ -183,7 +183,7 @@ destDir = null; flags = F_WARNINGS; tm = System.currentTimeMillis(); - classes = new Vector(); + classes = new Vector(); nowrite = false; nocompile = false; keepGenerated = false; @@ -191,7 +191,7 @@ if (generatorArgs == null) { return false; } - generators = new Vector(); + generators = new Vector(); // Pre-process command line for @file arguments try { @@ -411,7 +411,7 @@ // 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 { @@ -495,7 +495,7 @@ try { Class[] ctorArgTypes = {OutputStream.class,ClassPath.class,Main.class}; Object[] ctorArgs = {out,classPath,this}; - Constructor constructor = environmentClass.getConstructor(ctorArgTypes); + Constructor constructor = environmentClass.getConstructor(ctorArgTypes); result = (BatchEnvironment) constructor.newInstance(ctorArgs); result.reset(); } @@ -530,7 +530,7 @@ */ for (int i = classes.size()-1; i >= 0; i-- ) { Identifier implClassName = - Identifier.lookup((String)classes.elementAt(i)); + Identifier.lookup(classes.elementAt(i)); /* * Fix bugid 4049354: support using '.' as an inner class @@ -558,7 +558,7 @@ try { ClassDefinition def = decl.getClassDefinition(env); for (int j = 0; j < generators.size(); j++) { - Generator gen = (Generator)generators.elementAt(j); + Generator gen = generators.elementAt(j); gen.generate(env, def, destDir); } } catch (ClassNotFound ex) { @@ -673,7 +673,7 @@ 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); } @@ -682,7 +682,9 @@ /* * Compile a single class. + * Fallthrough is intentional */ + @SuppressWarnings("fallthrough") public boolean compileClass (ClassDeclaration c, ByteArrayOutputStream buf, BatchEnvironment env) @@ -879,6 +881,6 @@ args[1] = (arg1 != null ? arg1.toString() : "null"); args[2] = (arg2 != null ? arg2.toString() : "null"); - return java.text.MessageFormat.format(format, args); + return java.text.MessageFormat.format(format, (Object[]) args); } }