6764569: [PATCH] Fix unused imports in list resource bundles
authorjjg
Mon, 11 Jan 2010 14:09:15 -0800
changeset 4700 d0ef13314ec4
parent 4699 e58edf3542b3
child 4701 39e13c0d8d75
6764569: [PATCH] Fix unused imports in list resource bundles Reviewed-by: ksrini Contributed-by: jesse.glick@sun.com
langtools/make/tools/CompileProperties/CompileProperties.java
langtools/make/tools/CompileProperties/CompilePropertiesTask.java
--- a/langtools/make/tools/CompileProperties/CompileProperties.java	Mon Jan 11 14:05:21 2010 -0800
+++ b/langtools/make/tools/CompileProperties/CompileProperties.java	Mon Jan 11 14:09:15 2010 -0800
@@ -101,7 +101,7 @@
         boolean ok = true;
         /* Original usage */
         if (args.length == 2 && args[0].charAt(0) != '-' ) {
-            ok = createFile(args[0], args[1], "ListResourceBundle");
+            ok = createFile(args[0], args[1], "java.util.ListResourceBundle");
         } else if (args.length == 3) {
             ok = createFile(args[0], args[1], args[2]);
         } else if (args.length == 0) {
@@ -285,9 +285,9 @@
         log.info("    java CompileProperties {-compile path_to_properties_file path_to_java_output_file super_class} -or- -optionsfile filename");
         log.info("");
         log.info("Example:");
-        log.info("    java CompileProperties -compile test.properties test.java ListResourceBundle");
+        log.info("    java CompileProperties -compile test.properties test.java java.util.ListResourceBundle");
         log.info("    java CompileProperties -optionsfile option_file");
-        log.info("option_file contains: -compile test.properties test.java ListResourceBundle");
+        log.info("option_file contains: -compile test.properties test.java java.util.ListResourceBundle");
     }
 
     private static String escape(String theString) {
@@ -379,7 +379,6 @@
 
     private static final String FORMAT =
             "{0}" +
-            "import java.util.ListResourceBundle;\n\n" +
             "public final class {1} extends {2} '{'\n" +
             "    protected final Object[][] getContents() '{'\n" +
             "        return new Object[][] '{'\n" +
--- a/langtools/make/tools/CompileProperties/CompilePropertiesTask.java	Mon Jan 11 14:05:21 2010 -0800
+++ b/langtools/make/tools/CompileProperties/CompilePropertiesTask.java	Mon Jan 11 14:09:15 2010 -0800
@@ -45,6 +45,7 @@
         this.superclass = superclass;
     }
 
+    @Override
     public void execute() {
         CompileProperties.Log log = new CompileProperties.Log() {
             public void error(String msg, Exception e) {
@@ -84,7 +85,7 @@
             log("Generating " + count + " resource files to " + destDir, Project.MSG_INFO);
             CompileProperties cp = new CompileProperties();
             cp.setLog(log);
-            boolean ok = cp.run((String[])mainOpts.toArray(new String[mainOpts.size()]));
+            boolean ok = cp.run(mainOpts.toArray(new String[mainOpts.size()]));
             if (!ok)
                 throw new BuildException("CompileProperties failed.");
         }