bodewig 2004/11/15 06:52:27 Modified: src/main/org/apache/tools/ant/listener AnsiColorLogger.java src/main/org/apache/tools/ant/taskdefs/optional PropertyFile.java ReplaceRegExp.java src/main/org/apache/tools/ant/taskdefs/optional/ccm CCMReconfigure.java src/main/org/apache/tools/ant/taskdefs/optional/clearcase ClearCase.java src/main/org/apache/tools/ant/taskdefs/optional/ejb GenericDeploymentTool.java JonasDeploymentTool.java src/main/org/apache/tools/ant/taskdefs/optional/extension JarLibManifestTask.java src/main/org/apache/tools/ant/taskdefs/optional/javacc JJDoc.java JJTree.java JavaCC.java src/main/org/apache/tools/ant/taskdefs/optional/junit JUnitTask.java src/main/org/apache/tools/ant/taskdefs/optional/metamata AbstractMetamataTask.java MParse.java Log: More Jikes warnings Revision Changes Path 1.13 +3 -3 ant/src/main/org/apache/tools/ant/listener/AnsiColorLogger.java Index: AnsiColorLogger.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/listener/AnsiColorLogger.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- AnsiColorLogger.java 9 Mar 2004 16:48:03 -0000 1.12 +++ AnsiColorLogger.java 15 Nov 2004 14:52:26 -0000 1.13 @@ -164,13 +164,13 @@ prop.load(in); } - String err = prop.getProperty("AnsiColorLogger.ERROR_COLOR"); + String errC = prop.getProperty("AnsiColorLogger.ERROR_COLOR"); String warn = prop.getProperty("AnsiColorLogger.WARNING_COLOR"); String info = prop.getProperty("AnsiColorLogger.INFO_COLOR"); String verbose = prop.getProperty("AnsiColorLogger.VERBOSE_COLOR"); String debug = prop.getProperty("AnsiColorLogger.DEBUG_COLOR"); - if (err != null) { - errColor = PREFIX + err + SUFFIX; + if (errC != null) { + errColor = PREFIX + errC + SUFFIX; } if (warn != null) { warnColor = PREFIX + warn + SUFFIX; 1.37 +9 -9 ant/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java Index: PropertyFile.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/PropertyFile.java,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- PropertyFile.java 9 Mar 2004 16:48:15 -0000 1.36 +++ PropertyFile.java 15 Nov 2004 14:52:27 -0000 1.37 @@ -397,7 +397,7 @@ */ private void executeInteger(String oldValue) throws BuildException { int currentValue = DEFAULT_INT_VALUE; - int newValue = DEFAULT_INT_VALUE; + int newV = DEFAULT_INT_VALUE; DecimalFormat fmt = (pattern != null) ? new DecimalFormat(pattern) @@ -416,7 +416,7 @@ } if (operation == Operation.EQUALS_OPER) { - newValue = currentValue; + newV = currentValue; } else { int operationValue = 1; if (value != null) { @@ -430,13 +430,13 @@ } if (operation == Operation.INCREMENT_OPER) { - newValue = currentValue + operationValue; + newV = currentValue + operationValue; } else if (operation == Operation.DECREMENT_OPER) { - newValue = currentValue - operationValue; + newV = currentValue - operationValue; } } - this.newValue = fmt.format(newValue); + this.newValue = fmt.format(newV); } /** @@ -447,7 +447,7 @@ * not contained in the property file. */ private void executeString(String oldValue) throws BuildException { - String newValue = DEFAULT_STRING_VALUE; + String newV = DEFAULT_STRING_VALUE; String currentValue = getCurrentValue(oldValue); @@ -456,11 +456,11 @@ } if (operation == Operation.EQUALS_OPER) { - newValue = currentValue; + newV = currentValue; } else if (operation == Operation.INCREMENT_OPER) { - newValue = currentValue + value; + newV = currentValue + value; } - this.newValue = newValue; + this.newValue = newV; } /** 1.37 +1 -1 ant/src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java Index: ReplaceRegExp.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- ReplaceRegExp.java 9 Mar 2004 16:48:15 -0000 1.36 +++ ReplaceRegExp.java 15 Nov 2004 14:52:27 -0000 1.37 @@ -422,7 +422,7 @@ pw.flush(); } else { - String buf = fileUtils.readFully(br); + String buf = FileUtils.readFully(br); if (buf == null) { buf = ""; } 1.18 +3 -3 ant/src/main/org/apache/tools/ant/taskdefs/optional/ccm/CCMReconfigure.java Index: CCMReconfigure.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/ccm/CCMReconfigure.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- CCMReconfigure.java 9 Mar 2004 16:48:16 -0000 1.17 +++ CCMReconfigure.java 15 Nov 2004 14:52:27 -0000 1.18 @@ -28,7 +28,7 @@ */ public class CCMReconfigure extends Continuus { - private String project = null; + private String ccmProject = null; private boolean recurse = false; private boolean verbose = false; @@ -89,7 +89,7 @@ * @return value of project. */ public String getCcmProject() { - return project; + return ccmProject; } /** @@ -97,7 +97,7 @@ * @param v Value to assign to project. */ public void setCcmProject(String v) { - this.project = v; + this.ccmProject = v; } 1.20 +2 -2 ant/src/main/org/apache/tools/ant/taskdefs/optional/clearcase/ClearCase.java Index: ClearCase.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/clearcase/ClearCase.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- ClearCase.java 9 Mar 2004 16:48:16 -0000 1.19 +++ ClearCase.java 15 Nov 2004 14:52:27 -0000 1.20 @@ -54,7 +54,7 @@ * @param dir the directory containing the cleartool executable */ public final void setClearToolDir(String dir) { - mClearToolDir = getProject().translatePath(dir); + mClearToolDir = Project.translatePath(dir); } /** @@ -149,7 +149,7 @@ Commandline.Argument arg = exe.createArg(); exe.setExecutable(cmdline.getExecutable()); - arg.setLine(cmdline.toString(cmdline.getArguments())); + arg.setLine(Commandline.toString(cmdline.getArguments())); exe.setOutputproperty(outV); exe.execute(); // System.out.println( "runS: " + outV + " : " + aProj.getProperty( outV )); 1.52 +4 -4 ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java Index: GenericDeploymentTool.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java,v retrieving revision 1.51 retrieving revision 1.52 diff -u -r1.51 -r1.52 --- GenericDeploymentTool.java 9 Mar 2004 16:48:20 -0000 1.51 +++ GenericDeploymentTool.java 15 Nov 2004 14:52:27 -0000 1.52 @@ -354,16 +354,16 @@ } protected DescriptorHandler getDescriptorHandler(File srcDir) { - DescriptorHandler handler = new DescriptorHandler(getTask(), srcDir); + DescriptorHandler h = new DescriptorHandler(getTask(), srcDir); - registerKnownDTDs(handler); + registerKnownDTDs(h); // register any DTDs supplied by the user for (Iterator i = getConfig().dtdLocations.iterator(); i.hasNext();) { EjbJar.DTDLocation dtdLocation = (EjbJar.DTDLocation) i.next(); - handler.registerDTD(dtdLocation.getPublicId(), dtdLocation.getLocation()); + h.registerDTD(dtdLocation.getPublicId(), dtdLocation.getLocation()); } - return handler; + return h; } /** 1.17 +5 -5 ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JonasDeploymentTool.java Index: JonasDeploymentTool.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JonasDeploymentTool.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- JonasDeploymentTool.java 12 Nov 2004 11:07:12 -0000 1.16 +++ JonasDeploymentTool.java 15 Nov 2004 14:52:27 -0000 1.17 @@ -392,7 +392,7 @@ // examples = /org/objectweb/fooAppli/foo/Foo-ejb-jar.xml // examples = /org/objectweb/fooAppli/foo/Foo.xml (JOnAS convention) - String jonasDescriptorName; // JOnAS-specific DD + String jonasDN; // JOnAS-specific DD boolean jonasConvention = false; // true if the JOnAS convention is used for the DD String path; // Directory path of the EJB descriptor String fileName; // EJB descriptor file name @@ -439,15 +439,15 @@ remainder = descriptorName.substring(endOfBaseName + 1); if (jonasConvention) { - jonasDescriptorName = path + "jonas-" + baseName + ".xml"; + jonasDN = path + "jonas-" + baseName + ".xml"; } else { - jonasDescriptorName = path + baseName + "jonas-" + remainder; + jonasDN = path + baseName + "jonas-" + remainder; } log("Standard EJB descriptor name: " + descriptorName, Project.MSG_VERBOSE); - log("JOnAS-specific descriptor name: " + jonasDescriptorName, Project.MSG_VERBOSE); + log("JOnAS-specific descriptor name: " + jonasDN, Project.MSG_VERBOSE); - return jonasDescriptorName; + return jonasDN; } protected String getJarBaseName(String descriptorFileName) { 1.10 +2 -2 ant/src/main/org/apache/tools/ant/taskdefs/optional/extension/JarLibManifestTask.java Index: JarLibManifestTask.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/extension/JarLibManifestTask.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- JarLibManifestTask.java 9 Mar 2004 16:48:24 -0000 1.9 +++ JarLibManifestTask.java 15 Nov 2004 14:52:27 -0000 1.10 @@ -256,9 +256,9 @@ throws BuildException { final int size = extensions.size(); for (int i = 0; i < size; i++) { - final Extension extension = (Extension) extensions.get(i); + final Extension ext = (Extension) extensions.get(i); final String prefix = listPrefix + i + "-"; - Extension.addExtension(extension, prefix, attributes); + Extension.addExtension(ext, prefix, attributes); } } 1.11 +10 -10 ant/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJDoc.java Index: JJDoc.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJDoc.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- JJDoc.java 30 Jul 2004 10:55:34 -0000 1.10 +++ JJDoc.java 15 Nov 2004 14:52:27 -0000 1.11 @@ -51,7 +51,7 @@ private static final String DEFAULT_SUFFIX_TEXT = ".txt"; // required attributes - private File target = null; + private File targetFile = null; private File javaccHome = null; private CommandlineJava cmdl = new CommandlineJava(); @@ -85,7 +85,7 @@ * The javacc grammar file to process. */ public void setTarget(File target) { - this.target = target; + this.targetFile = target; } /** @@ -110,8 +110,8 @@ .setValue("-" + name + ":" + value.toString()); } - if (target == null || !target.isFile()) { - throw new BuildException("Invalid target: " + target); + if (targetFile == null || !targetFile.isFile()) { + throw new BuildException("Invalid target: " + targetFile); } if (outputFile != null) { @@ -120,17 +120,17 @@ } // use the directory containing the target as the output directory - File javaFile = new File(createOutputFileName(target, outputFile, + File javaFile = new File(createOutputFileName(targetFile, outputFile, plainText)); if (javaFile.exists() - && target.lastModified() < javaFile.lastModified()) { - log("Target is already built - skipping (" + target + ")", + && targetFile.lastModified() < javaFile.lastModified()) { + log("Target is already built - skipping (" + targetFile + ")", Project.MSG_VERBOSE); return; } - cmdl.createArgument().setValue(target.getAbsolutePath()); + cmdl.createArgument().setValue(targetFile.getAbsolutePath()); final Path classpath = cmdl.createClasspath(getProject()); final File javaccJar = JavaCC.getArchiveFile(javaccHome); @@ -161,10 +161,10 @@ } } - private String createOutputFileName(File target, String optionalOutputFile, + private String createOutputFileName(File targetFile, String optionalOutputFile, boolean plainText) { String suffix = DEFAULT_SUFFIX_HTML; - String javaccFile = target.getAbsolutePath().replace('\\', '/'); + String javaccFile = targetFile.getAbsolutePath().replace('\\', '/'); if (plainText) { suffix = DEFAULT_SUFFIX_TEXT; 1.34 +12 -12 ant/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJTree.java Index: JJTree.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJTree.java,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- JJTree.java 30 Jul 2004 10:55:34 -0000 1.33 +++ JJTree.java 15 Nov 2004 14:52:27 -0000 1.34 @@ -60,7 +60,7 @@ // required attributes private File outputDirectory = null; - private File target = null; + private File targetFile = null; private File javaccHome = null; private CommandlineJava cmdl = new CommandlineJava(); @@ -164,8 +164,8 @@ /** * The jjtree grammar file to process. */ - public void setTarget(File target) { - this.target = target; + public void setTarget(File targetFile) { + this.targetFile = targetFile; } /** @@ -189,8 +189,8 @@ cmdl.createArgument().setValue("-" + name + ":" + value.toString()); } - if (target == null || !target.isFile()) { - throw new BuildException("Invalid target: " + target); + if (targetFile == null || !targetFile.isFile()) { + throw new BuildException("Invalid target: " + targetFile); } File javaFile = null; @@ -202,7 +202,7 @@ cmdl.createArgument().setValue("-OUTPUT_DIRECTORY:" + getDefaultOutputDirectory()); - javaFile = new File(createOutputFileName(target, outputFile, + javaFile = new File(createOutputFileName(targetFile, outputFile, null)); } else { if (!outputDirectory.isDirectory()) { @@ -216,14 +216,14 @@ + outputDirectory.getAbsolutePath() .replace('\\', '/')); - javaFile = new File(createOutputFileName(target, outputFile, + javaFile = new File(createOutputFileName(targetFile, outputFile, outputDirectory .getPath())); } if (javaFile.exists() - && target.lastModified() < javaFile.lastModified()) { - log("Target is already built - skipping (" + target + ")", + && targetFile.lastModified() < javaFile.lastModified()) { + log("Target is already built - skipping (" + targetFile + ")", Project.MSG_VERBOSE); return; } @@ -233,7 +233,7 @@ + outputFile.replace('\\', '/')); } - cmdl.createArgument().setValue(target.getAbsolutePath()); + cmdl.createArgument().setValue(targetFile.getAbsolutePath()); final Path classpath = cmdl.createClasspath(getProject()); final File javaccJar = JavaCC.getArchiveFile(javaccHome); @@ -264,11 +264,11 @@ } } - private String createOutputFileName(File target, String optionalOutputFile, + private String createOutputFileName(File targetFile, String optionalOutputFile, String outputDirectory) { optionalOutputFile = validateOutputFile(optionalOutputFile, outputDirectory); - String jjtreeFile = target.getAbsolutePath().replace('\\', '/'); + String jjtreeFile = targetFile.getAbsolutePath().replace('\\', '/'); if ((optionalOutputFile == null) || optionalOutputFile.equals("")) { int filePos = jjtreeFile.lastIndexOf("/"); 1.32 +10 -10 ant/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JavaCC.java Index: JavaCC.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JavaCC.java,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- JavaCC.java 30 Jul 2004 10:55:34 -0000 1.31 +++ JavaCC.java 15 Nov 2004 14:52:27 -0000 1.32 @@ -67,7 +67,7 @@ // required attributes private File outputDirectory = null; - private File target = null; + private File targetFile = null; private File javaccHome = null; private CommandlineJava cmdl = new CommandlineJava(); @@ -262,8 +262,8 @@ /** * The grammar file to process. */ - public void setTarget(File target) { - this.target = target; + public void setTarget(File targetFile) { + this.targetFile = targetFile; } /** @@ -288,13 +288,13 @@ } // check the target is a file - if (target == null || !target.isFile()) { - throw new BuildException("Invalid target: " + target); + if (targetFile == null || !targetFile.isFile()) { + throw new BuildException("Invalid target: " + targetFile); } // use the directory containing the target as the output directory if (outputDirectory == null) { - outputDirectory = new File(target.getParent()); + outputDirectory = new File(targetFile.getParent()); } else if (!outputDirectory.isDirectory()) { throw new BuildException("Outputdir not a directory."); } @@ -302,12 +302,12 @@ + outputDirectory.getAbsolutePath()); // determine if the generated java file is up-to-date - final File javaFile = getOutputJavaFile(outputDirectory, target); - if (javaFile.exists() && target.lastModified() < javaFile.lastModified()) { - log("Target is already built - skipping (" + target + ")", Project.MSG_VERBOSE); + final File javaFile = getOutputJavaFile(outputDirectory, targetFile); + if (javaFile.exists() && targetFile.lastModified() < javaFile.lastModified()) { + log("Target is already built - skipping (" + targetFile + ")", Project.MSG_VERBOSE); return; } - cmdl.createArgument().setValue(target.getAbsolutePath()); + cmdl.createArgument().setValue(targetFile.getAbsolutePath()); final Path classpath = cmdl.createClasspath(getProject()); final File javaccJar = JavaCC.getArchiveFile(javaccHome); 1.110 +6 -6 ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java Index: JUnitTask.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java,v retrieving revision 1.109 retrieving revision 1.110 diff -u -r1.109 -r1.110 --- JUnitTask.java 13 Oct 2004 10:23:30 -0000 1.109 +++ JUnitTask.java 15 Nov 2004 14:52:27 -0000 1.110 @@ -334,11 +334,11 @@ * @return boolean equivalent of the value */ public boolean asBoolean() { - String value = getValue(); - return "true".equals(value) - || "on".equals(value) - || "yes".equals(value) - || "withOutAndErr".equals(value); + String v = getValue(); + return "true".equals(v) + || "on".equals(v) + || "yes".equals(v) + || "withOutAndErr".equals(v); } } 1.22 +2 -2 ant/src/main/org/apache/tools/ant/taskdefs/optional/metamata/AbstractMetamataTask.java Index: AbstractMetamataTask.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/metamata/AbstractMetamataTask.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- AbstractMetamataTask.java 9 Mar 2004 16:48:31 -0000 1.21 +++ AbstractMetamataTask.java 15 Nov 2004 14:52:27 -0000 1.22 @@ -174,8 +174,8 @@ // set the classpath as the jar file File jar = getMetamataJar(metamataHome); - final Path classPath = cmdl.createClasspath(getProject()); - classPath.createPathElement().setLocation(jar); + final Path cp = cmdl.createClasspath(getProject()); + cp.createPathElement().setLocation(jar); // set the metamata.home property final Commandline.Argument vmArgs = cmdl.createVmArgument(); 1.26 +15 -15 ant/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MParse.java Index: MParse.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MParse.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- MParse.java 9 Mar 2004 16:48:31 -0000 1.25 +++ MParse.java 15 Nov 2004 14:52:27 -0000 1.26 @@ -43,15 +43,15 @@ */ public class MParse extends AbstractMetamataTask { - private File target = null; + private File targetFile = null; private boolean verbose = false; private boolean debugparser = false; private boolean debugscanner = false; private boolean cleanup = false; /** The .jj file to process; required. */ - public void setTarget(File target) { - this.target = target; + public void setTarget(File targetFile) { + this.targetFile = targetFile; } /** set verbose mode */ @@ -106,9 +106,9 @@ // set the classpath as the jar files File[] jars = getMetamataLibs(); - final Path classPath = cmdl.createClasspath(getProject()); + final Path cp = cmdl.createClasspath(getProject()); for (int i = 0; i < jars.length; i++) { - classPath.createPathElement().setLocation(jars[i]); + cp.createPathElement().setLocation(jars[i]); } // set the metamata.home property @@ -132,12 +132,12 @@ protected void _execute(ExecuteStreamHandler handler) throws BuildException { // target has been checked as a .jj, see if there is a matching // java file and if it is needed to run to process the grammar - String pathname = target.getAbsolutePath(); + String pathname = targetFile.getAbsolutePath(); int pos = pathname.length() - ".jj".length(); pathname = pathname.substring(0, pos) + ".java"; File javaFile = new File(pathname); - if (javaFile.exists() && target.lastModified() < javaFile.lastModified()) { - getProject().log("Target is already build - skipping (" + target + ")"); + if (javaFile.exists() && targetFile.lastModified() < javaFile.lastModified()) { + getProject().log("Target is already build - skipping (" + targetFile + ")"); return; } @@ -160,10 +160,10 @@ optionsFile = null; } if (cleanup) { - String name = target.getName(); + String name = targetFile.getName(); int pos = name.length() - ".jj".length(); name = "__jj" + name.substring(0, pos) + ".sunjj"; - final File sunjj = new File(target.getParent(), name); + final File sunjj = new File(targetFile.getParent(), name); if (sunjj.exists()) { getProject().log("Removing stale file: " + sunjj.getName()); sunjj.delete(); @@ -210,11 +210,11 @@ } // check that the target is ok and resolve it. - if (target == null || !target.isFile() - || !target.getName().endsWith(".jj")) { - throw new BuildException("Invalid target: " + target); + if (targetFile == null || !targetFile.isFile() + || !targetFile.getName().endsWith(".jj")) { + throw new BuildException("Invalid target: " + targetFile); } - target = getProject().resolveFile(target.getPath()); + targetFile = getProject().resolveFile(targetFile.getPath()); } /** @@ -240,7 +240,7 @@ options.addElement("-sourcepath"); options.addElement(sourcePath.toString()); } - options.addElement(target.getAbsolutePath()); + options.addElement(targetFile.getAbsolutePath()); return options; }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]