6764569: [PATCH] Fix unused imports in list resource bundles

Mon, 11 Jan 2010 14:09:15 -0800

author
jjg
date
Mon, 11 Jan 2010 14:09:15 -0800
changeset 465
f983c1dca202
parent 464
d02e99d31cc0
child 466
ca6bc36b2305

6764569: [PATCH] Fix unused imports in list resource bundles
Reviewed-by: ksrini
Contributed-by: jesse.glick@sun.com

make/tools/CompileProperties/CompileProperties.java file | annotate | diff | comparison | revisions
make/tools/CompileProperties/CompilePropertiesTask.java file | annotate | diff | comparison | revisions
     1.1 --- a/make/tools/CompileProperties/CompileProperties.java	Mon Jan 11 14:05:21 2010 -0800
     1.2 +++ b/make/tools/CompileProperties/CompileProperties.java	Mon Jan 11 14:09:15 2010 -0800
     1.3 @@ -101,7 +101,7 @@
     1.4          boolean ok = true;
     1.5          /* Original usage */
     1.6          if (args.length == 2 && args[0].charAt(0) != '-' ) {
     1.7 -            ok = createFile(args[0], args[1], "ListResourceBundle");
     1.8 +            ok = createFile(args[0], args[1], "java.util.ListResourceBundle");
     1.9          } else if (args.length == 3) {
    1.10              ok = createFile(args[0], args[1], args[2]);
    1.11          } else if (args.length == 0) {
    1.12 @@ -285,9 +285,9 @@
    1.13          log.info("    java CompileProperties {-compile path_to_properties_file path_to_java_output_file super_class} -or- -optionsfile filename");
    1.14          log.info("");
    1.15          log.info("Example:");
    1.16 -        log.info("    java CompileProperties -compile test.properties test.java ListResourceBundle");
    1.17 +        log.info("    java CompileProperties -compile test.properties test.java java.util.ListResourceBundle");
    1.18          log.info("    java CompileProperties -optionsfile option_file");
    1.19 -        log.info("option_file contains: -compile test.properties test.java ListResourceBundle");
    1.20 +        log.info("option_file contains: -compile test.properties test.java java.util.ListResourceBundle");
    1.21      }
    1.22  
    1.23      private static String escape(String theString) {
    1.24 @@ -379,7 +379,6 @@
    1.25  
    1.26      private static final String FORMAT =
    1.27              "{0}" +
    1.28 -            "import java.util.ListResourceBundle;\n\n" +
    1.29              "public final class {1} extends {2} '{'\n" +
    1.30              "    protected final Object[][] getContents() '{'\n" +
    1.31              "        return new Object[][] '{'\n" +
     2.1 --- a/make/tools/CompileProperties/CompilePropertiesTask.java	Mon Jan 11 14:05:21 2010 -0800
     2.2 +++ b/make/tools/CompileProperties/CompilePropertiesTask.java	Mon Jan 11 14:09:15 2010 -0800
     2.3 @@ -45,6 +45,7 @@
     2.4          this.superclass = superclass;
     2.5      }
     2.6  
     2.7 +    @Override
     2.8      public void execute() {
     2.9          CompileProperties.Log log = new CompileProperties.Log() {
    2.10              public void error(String msg, Exception e) {
    2.11 @@ -84,7 +85,7 @@
    2.12              log("Generating " + count + " resource files to " + destDir, Project.MSG_INFO);
    2.13              CompileProperties cp = new CompileProperties();
    2.14              cp.setLog(log);
    2.15 -            boolean ok = cp.run((String[])mainOpts.toArray(new String[mainOpts.size()]));
    2.16 +            boolean ok = cp.run(mainOpts.toArray(new String[mainOpts.size()]));
    2.17              if (!ok)
    2.18                  throw new BuildException("CompileProperties failed.");
    2.19          }

mercurial