From 0db40aec209afb7afb8d00ece28b3a8ac99bceae Mon Sep 17 00:00:00 2001 From: acolyer Date: Fri, 23 Jan 2004 10:42:24 +0000 Subject: [PATCH] spring cleaning in advance of 1.2 enhancements: removed unused imports, local variables, and private methods (still there, just commented out). --- build/src/$installer$/org/aspectj/Main.java | 8 +-- .../tools/ant/taskdefs/AntBuilder.java | 28 +++++----- .../tools/ant/taskdefs/Checklics.java | 8 +-- .../tools/ant/taskdefs/StripNonBodyHtml.java | 4 +- .../tools/ant/taskdefs/TestBuildModule.java | 2 +- .../internal/tools/build/BuildSpec.java | 4 +- .../aspectj/internal/tools/build/Builder.java | 2 +- .../aspectj/internal/tools/build/Module.java | 2 +- .../internal/tools/build/SampleGatherer.java | 52 +++++++++---------- .../internal/build/BuildModuleTest.java | 2 +- .../aspectj/internal/build/ModulesTest.java | 15 +++--- 11 files changed, 62 insertions(+), 65 deletions(-) diff --git a/build/src/$installer$/org/aspectj/Main.java b/build/src/$installer$/org/aspectj/Main.java index 49ebafc51..d413340d0 100644 --- a/build/src/$installer$/org/aspectj/Main.java +++ b/build/src/$installer$/org/aspectj/Main.java @@ -177,7 +177,7 @@ public class Main { throw new Exception("invalid javaPath: " + javaPath); } // directly set context and run - installer.getInstallPane().setContext(installerContext); + WizardPane.setContext(installerContext); installer.run(); } } catch (Exception e) { @@ -518,7 +518,7 @@ abstract class Installer { } public void moveToPane(WizardPane pane) { - pane.setContext(this.context); + WizardPane.setContext(this.context); Dimension size = frame.getContentPane().getSize(); @@ -1786,11 +1786,11 @@ class JarUnpacker { URL url = getClass().getResource(jarName); InputStream stream = url.openStream(); ZipInputStream zis = new ZipInputStream(stream); - int i = 0; +// int i = 0; ZipEntry entry; while ((entry = zis.getNextEntry()) != null) { - final String name = entry.getName(); +// final String name = entry.getName(); writeEntry(zis, entry, outputDir); // } diff --git a/build/src/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java b/build/src/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java index d665149a2..86208cb51 100644 --- a/build/src/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java +++ b/build/src/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java @@ -336,7 +336,7 @@ public class AntBuilder extends Builder { // -- merge any merge jars List mergeJars = module.getMerges(); - final boolean useManifest = false; +// final boolean useManifest = false; if (0 < mergeJars.size()) { for (Iterator iter = mergeJars.iterator(); iter.hasNext();) { File mergeJar = (File) iter.next(); @@ -550,7 +550,7 @@ class ProductBuilder extends AntBuilder { private static String getProductInstallResourcesSrc(BuildSpec buildSpec) { final String resourcesName = "installer-resources"; // XXXFileLiteral File dir = buildSpec.productDir.getParentFile(); - String result = null; +// String result = null; if (null == dir) { return "../../" + resourcesName; } @@ -735,18 +735,18 @@ class ProductBuilder extends AntBuilder { + "/lib/build/build.jar" ; // XXX } - private Module moduleForReplaceFile(File replaceFile, Modules modules) { - String jarName = moduleAliasFor(replaceFile.getName().toLowerCase()); - if (jarName.endsWith(".jar") || jarName.endsWith(".zip")) { // XXXFileLiteral - jarName = jarName.substring(0, jarName.length()-4); - } else { - throw new IllegalArgumentException("can only replace .[jar|zip]"); - } - boolean assembleAll = jarName.endsWith("-all"); - String name = (!assembleAll ? jarName : jarName.substring(0, jarName.length()-4)); - return modules.getModule(name); - } - +// private Module moduleForReplaceFile(File replaceFile, Modules modules) { +// String jarName = moduleAliasFor(replaceFile.getName().toLowerCase()); +// if (jarName.endsWith(".jar") || jarName.endsWith(".zip")) { // XXXFileLiteral +// jarName = jarName.substring(0, jarName.length()-4); +// } else { +// throw new IllegalArgumentException("can only replace .[jar|zip]"); +// } +// boolean assembleAll = jarName.endsWith("-all"); +// String name = (!assembleAll ? jarName : jarName.substring(0, jarName.length()-4)); +// return modules.getModule(name); +// } +// } diff --git a/build/src/org/aspectj/internal/tools/ant/taskdefs/Checklics.java b/build/src/org/aspectj/internal/tools/ant/taskdefs/Checklics.java index 7b8b61425..f604e4f44 100644 --- a/build/src/org/aspectj/internal/tools/ant/taskdefs/Checklics.java +++ b/build/src/org/aspectj/internal/tools/ant/taskdefs/Checklics.java @@ -237,7 +237,7 @@ public class Checklics extends MatchingTask { /** visit all .java files in all directories... */ private void visitAll(FileVisitor visitor) { - List filelist = new ArrayList(); +// List filelist = new ArrayList(); String[] dirs = sourcepath.list(); for (int i = 0; i < dirs.length; i++) { File dir = project.resolveFile(dirs[i]); @@ -445,7 +445,7 @@ public class Checklics extends MatchingTask { public boolean checkFile(final File file) { clear(); - boolean result = false; +// boolean result = false; BufferedReader input = null; int lineNum = 0; try { @@ -643,8 +643,8 @@ class Header { /** replace the header in file */ public static boolean replaceHeader(File file, HeaderInfo info) { - ArrayList years = new ArrayList(); - int endLine = 0; +// ArrayList years = new ArrayList(); +// int endLine = 0; BufferedReader input = null; PrintWriter output = null; FileWriter outWriter = null; diff --git a/build/src/org/aspectj/internal/tools/ant/taskdefs/StripNonBodyHtml.java b/build/src/org/aspectj/internal/tools/ant/taskdefs/StripNonBodyHtml.java index 70b18c086..f08d0618e 100644 --- a/build/src/org/aspectj/internal/tools/ant/taskdefs/StripNonBodyHtml.java +++ b/build/src/org/aspectj/internal/tools/ant/taskdefs/StripNonBodyHtml.java @@ -137,10 +137,10 @@ public class StripNonBodyHtml extends MatchingTask { } private boolean writeBodyTo(String s, File f) throws IOException { - int start, end; + int start;//, end; try { start = findStart(s); - end = findEnd(s, start); + findEnd(s, start); } catch (ParseException e) { return false; // if we get confused, just don't write the file. } diff --git a/build/src/org/aspectj/internal/tools/ant/taskdefs/TestBuildModule.java b/build/src/org/aspectj/internal/tools/ant/taskdefs/TestBuildModule.java index 076e49894..ceeacee85 100644 --- a/build/src/org/aspectj/internal/tools/ant/taskdefs/TestBuildModule.java +++ b/build/src/org/aspectj/internal/tools/ant/taskdefs/TestBuildModule.java @@ -23,7 +23,7 @@ import org.aspectj.internal.tools.build.Builder; import org.aspectj.internal.tools.build.Util; public class TestBuildModule { - private static boolean REBUILD = false; +// private static boolean REBUILD = false; private static final String SYNTAX = "java {classname} <[product|module]dir>"; public static void main(String[] args) { diff --git a/build/src/org/aspectj/internal/tools/build/BuildSpec.java b/build/src/org/aspectj/internal/tools/build/BuildSpec.java index 208992cbe..692a8e552 100644 --- a/build/src/org/aspectj/internal/tools/build/BuildSpec.java +++ b/build/src/org/aspectj/internal/tools/build/BuildSpec.java @@ -16,7 +16,7 @@ package org.aspectj.internal.tools.build; import java.io.File; -import java.util.Properties; +//import java.util.Properties; /** * Open struct for specifying builds for both modules and products. @@ -156,7 +156,7 @@ public class BuildSpec { public boolean assembleAll; public boolean failonerror; public boolean verbose; - private Properties buildProperties; +// private Properties buildProperties; // building products public File productDir; diff --git a/build/src/org/aspectj/internal/tools/build/Builder.java b/build/src/org/aspectj/internal/tools/build/Builder.java index 1c35072c7..e57a49f52 100644 --- a/build/src/org/aspectj/internal/tools/build/Builder.java +++ b/build/src/org/aspectj/internal/tools/build/Builder.java @@ -245,7 +245,7 @@ public abstract class Builder { final Modules modules = module.getModules(); final Messager handler = this.handler; final boolean log = (verbose && (null != handler)); - final boolean verbose = this.verbose; +// final boolean verbose = this.verbose; if (log) { handler.log( "modules to build: " + Arrays.asList(buildList)); diff --git a/build/src/org/aspectj/internal/tools/build/Module.java b/build/src/org/aspectj/internal/tools/build/Module.java index 6fefdcdba..b2ba39b4b 100644 --- a/build/src/org/aspectj/internal/tools/build/Module.java +++ b/build/src/org/aspectj/internal/tools/build/Module.java @@ -361,7 +361,7 @@ public class Module { String line; XMLEntry entry = new XMLEntry("classpathentry", ATTS); - String lastKind = null; +// String lastKind = null; while (null != (line = reader.readLine())) { // we assume no internal spaces... entry.acceptTokens(line); diff --git a/build/src/org/aspectj/internal/tools/build/SampleGatherer.java b/build/src/org/aspectj/internal/tools/build/SampleGatherer.java index ea198d968..dbc94b7d1 100644 --- a/build/src/org/aspectj/internal/tools/build/SampleGatherer.java +++ b/build/src/org/aspectj/internal/tools/build/SampleGatherer.java @@ -44,26 +44,26 @@ public class SampleGatherer { static final String AUTHOR = "@author"; static final String FLAG = "XXX"; - private static void test(String[] args){ - String[] from = new String[] { "
", "
" }; - String[] to = new String[] { "<pre>", "</pre>" }; - String source = "in this
 day and 
age of
";
-        System.err.println("from " + source);
-        System.err.println("  to " + SampleUtil.replace(source, from, to));
-        source = "
 day and 
"; - System.err.println("from " + source); - System.err.println(" to " + SampleUtil.replace(source, from, to)); - source = "
", "
" }; +// String[] to = new String[] { "<pre>", "</pre>" }; +// String source = "in this
 day and 
age of
";
+//        System.err.println("from " + source);
+//        System.err.println("  to " + SampleUtil.replace(source, from, to));
+//        source = "
 day and 
"; +// System.err.println("from " + source); +// System.err.println(" to " + SampleUtil.replace(source, from, to)); +// source = "