git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1066963 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -1585,7 +1585,8 @@ public final class IntrospectionHelper { | |||||
| */ | */ | ||||
| private void insertAddTypeMethod(Method method) { | private void insertAddTypeMethod(Method method) { | ||||
| Class argClass = method.getParameterTypes()[0]; | Class argClass = method.getParameterTypes()[0]; | ||||
| for (int c = 0; c < addTypeMethods.size(); ++c) { | |||||
| final int size = addTypeMethods.size(); | |||||
| for (int c = 0; c < size; ++c) { | |||||
| Method current = (Method) addTypeMethods.get(c); | Method current = (Method) addTypeMethods.get(c); | ||||
| if (current.getParameterTypes()[0].equals(argClass)) { | if (current.getParameterTypes()[0].equals(argClass)) { | ||||
| if (method.getName().equals("addConfigured")) { | if (method.getName().equals("addConfigured")) { | ||||
| @@ -1616,7 +1617,8 @@ public final class IntrospectionHelper { | |||||
| Class matchedClass = null; | Class matchedClass = null; | ||||
| Method matchedMethod = null; | Method matchedMethod = null; | ||||
| for (int i = 0; i < methods.size(); ++i) { | |||||
| final int size = methods.size(); | |||||
| for (int i = 0; i < size; ++i) { | |||||
| Method method = (Method) methods.get(i); | Method method = (Method) methods.get(i); | ||||
| Class methodClass = method.getParameterTypes()[0]; | Class methodClass = method.getParameterTypes()[0]; | ||||
| if (methodClass.isAssignableFrom(paramClass)) { | if (methodClass.isAssignableFrom(paramClass)) { | ||||
| @@ -1663,7 +1665,8 @@ public final class IntrospectionHelper { | |||||
| return null; | return null; | ||||
| } | } | ||||
| synchronized (definitions) { | synchronized (definitions) { | ||||
| for (int i = 0; i < definitions.size(); ++i) { | |||||
| final int size = definitions.size(); | |||||
| for (int i = 0; i < size; ++i) { | |||||
| AntTypeDefinition d = (AntTypeDefinition) definitions.get(i); | AntTypeDefinition d = (AntTypeDefinition) definitions.get(i); | ||||
| Class exposedClass = d.getExposedClass(helper.getProject()); | Class exposedClass = d.getExposedClass(helper.getProject()); | ||||
| if (exposedClass == null) { | if (exposedClass == null) { | ||||
| @@ -859,7 +859,8 @@ public class Main implements AntMain { | |||||
| // Add the default listener | // Add the default listener | ||||
| project.addBuildListener(createLogger()); | project.addBuildListener(createLogger()); | ||||
| for (int i = 0; i < listeners.size(); i++) { | |||||
| final int count = listeners.size(); | |||||
| for (int i = 0; i < count; i++) { | |||||
| String className = (String) listeners.elementAt(i); | String className = (String) listeners.elementAt(i); | ||||
| BuildListener listener = | BuildListener listener = | ||||
| (BuildListener) ClasspathUtils.newInstance(className, | (BuildListener) ClasspathUtils.newInstance(className, | ||||
| @@ -1152,8 +1153,9 @@ public class Main implements AntMain { | |||||
| * @return the correct place in the list for the given name | * @return the correct place in the list for the given name | ||||
| */ | */ | ||||
| private static int findTargetPosition(Vector names, String name) { | private static int findTargetPosition(Vector names, String name) { | ||||
| int res = names.size(); | |||||
| for (int i = 0; i < names.size() && res == names.size(); i++) { | |||||
| final int size = names.size(); | |||||
| int res = size; | |||||
| for (int i = 0; i < size && res == size; i++) { | |||||
| if (name.compareTo((String) names.elementAt(i)) < 0) { | if (name.compareTo((String) names.elementAt(i)) < 0) { | ||||
| res = i; | res = i; | ||||
| } | } | ||||
| @@ -1197,7 +1199,8 @@ public class Main implements AntMain { | |||||
| } | } | ||||
| StringBuffer msg = new StringBuffer(); | StringBuffer msg = new StringBuffer(); | ||||
| msg.append(heading + lSep + lSep); | msg.append(heading + lSep + lSep); | ||||
| for (int i = 0; i < names.size(); i++) { | |||||
| final int size = names.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| msg.append(" "); | msg.append(" "); | ||||
| msg.append(names.elementAt(i)); | msg.append(names.elementAt(i)); | ||||
| if (descriptions != null) { | if (descriptions != null) { | ||||
| @@ -383,7 +383,8 @@ public class Target implements TaskContainer { | |||||
| try { | try { | ||||
| // use index-based approach to avoid ConcurrentModificationExceptions; | // use index-based approach to avoid ConcurrentModificationExceptions; | ||||
| // also account for growing target children | // also account for growing target children | ||||
| for (int i = 0; i < children.size(); i++) { | |||||
| final int size = children.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| Object o = children.get(i); | Object o = children.get(i); | ||||
| if (o instanceof Task) { | if (o instanceof Task) { | ||||
| Task task = (Task) o; | Task task = (Task) o; | ||||
| @@ -622,16 +622,17 @@ public class UnknownElement extends Task { | |||||
| return false; | return false; | ||||
| } | } | ||||
| // Are the sub elements the same ? | // Are the sub elements the same ? | ||||
| if (children == null || children.size() == 0) { | |||||
| final int childrenSize = children == null ? 0 : children.size(); | |||||
| if (childrenSize == 0) { | |||||
| return other.children == null || other.children.size() == 0; | return other.children == null || other.children.size() == 0; | ||||
| } | } | ||||
| if (other.children == null) { | if (other.children == null) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| if (children.size() != other.children.size()) { | |||||
| if (childrenSize != other.children.size()) { | |||||
| return false; | return false; | ||||
| } | } | ||||
| for (int i = 0; i < children.size(); ++i) { | |||||
| for (int i = 0; i < childrenSize; ++i) { | |||||
| UnknownElement child = (UnknownElement) children.get(i); | UnknownElement child = (UnknownElement) children.get(i); | ||||
| if (!child.similar(other.children.get(i))) { | if (!child.similar(other.children.get(i))) { | ||||
| return false; | return false; | ||||
| @@ -404,7 +404,8 @@ public abstract class AbstractCvsTask extends Task { | |||||
| } | } | ||||
| try { | try { | ||||
| for (int i = 0; i < vecCommandlines.size(); i++) { | |||||
| final int size = vecCommandlines.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| this.runCommand((Commandline) vecCommandlines.elementAt(i)); | this.runCommand((Commandline) vecCommandlines.elementAt(i)); | ||||
| } | } | ||||
| } finally { | } finally { | ||||
| @@ -464,7 +464,8 @@ public class Copy extends Task { | |||||
| HashMap dirsByBasedir = new HashMap(); | HashMap dirsByBasedir = new HashMap(); | ||||
| HashSet baseDirs = new HashSet(); | HashSet baseDirs = new HashSet(); | ||||
| ArrayList nonFileResources = new ArrayList(); | ArrayList nonFileResources = new ArrayList(); | ||||
| for (int i = 0; i < rcs.size(); i++) { | |||||
| final int size = rcs.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| ResourceCollection rc = (ResourceCollection) rcs.elementAt(i); | ResourceCollection rc = (ResourceCollection) rcs.elementAt(i); | ||||
| // Step (1) - beware of the ZipFileSet | // Step (1) - beware of the ZipFileSet | ||||
| @@ -593,7 +593,8 @@ public class Delete extends MatchingTask { | |||||
| filesets.add(implicit); | filesets.add(implicit); | ||||
| } | } | ||||
| for (int i = 0, size = filesets.size(); i < size; i++) { | |||||
| final int size = filesets.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| FileSet fs = (FileSet) filesets.get(i); | FileSet fs = (FileSet) filesets.get(i); | ||||
| if (fs.getProject() == null) { | if (fs.getProject() == null) { | ||||
| log("Deleting fileset with no project specified;" | log("Deleting fileset with no project specified;" | ||||
| @@ -352,7 +352,8 @@ public class ExecuteOn extends ExecTask { | |||||
| try { | try { | ||||
| Vector fileNames = new Vector(); | Vector fileNames = new Vector(); | ||||
| Vector baseDirs = new Vector(); | Vector baseDirs = new Vector(); | ||||
| for (int i = 0; i < filesets.size(); i++) { | |||||
| final int size = filesets.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| String currentType = type; | String currentType = type; | ||||
| AbstractFileSet fs = (AbstractFileSet) filesets.elementAt(i); | AbstractFileSet fs = (AbstractFileSet) filesets.elementAt(i); | ||||
| if (fs instanceof DirSet) { | if (fs instanceof DirSet) { | ||||
| @@ -258,7 +258,8 @@ public class Expand extends Task { | |||||
| boolean included = false; | boolean included = false; | ||||
| Set includePatterns = new HashSet(); | Set includePatterns = new HashSet(); | ||||
| Set excludePatterns = new HashSet(); | Set excludePatterns = new HashSet(); | ||||
| for (int v = 0, size = patternsets.size(); v < size; v++) { | |||||
| final int size = patternsets.size(); | |||||
| for (int v = 0; v < size; v++) { | |||||
| PatternSet p = (PatternSet) patternsets.elementAt(v); | PatternSet p = (PatternSet) patternsets.elementAt(v); | ||||
| String[] incls = p.getIncludePatterns(getProject()); | String[] incls = p.getIncludePatterns(getProject()); | ||||
| if (incls == null || incls.length == 0) { | if (incls == null || incls.length == 0) { | ||||
| @@ -899,7 +899,8 @@ public class Java extends Task { | |||||
| protected void run(String classname, Vector args) throws BuildException { | protected void run(String classname, Vector args) throws BuildException { | ||||
| CommandlineJava cmdj = new CommandlineJava(); | CommandlineJava cmdj = new CommandlineJava(); | ||||
| cmdj.setClassname(classname); | cmdj.setClassname(classname); | ||||
| for (int i = 0; i < args.size(); i++) { | |||||
| final int size = args.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| cmdj.createArgument().setValue((String) args.elementAt(i)); | cmdj.createArgument().setValue((String) args.elementAt(i)); | ||||
| } | } | ||||
| run(cmdj); | run(cmdj); | ||||
| @@ -1509,7 +1509,8 @@ public class Javadoc extends Task { | |||||
| */ | */ | ||||
| public String getPackages() { | public String getPackages() { | ||||
| StringBuffer p = new StringBuffer(); | StringBuffer p = new StringBuffer(); | ||||
| for (int i = 0; i < packages.size(); i++) { | |||||
| final int size = packages.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| if (i > 0) { | if (i > 0) { | ||||
| p.append(":"); | p.append(":"); | ||||
| } | } | ||||
| @@ -161,10 +161,11 @@ public class MacroDef extends AntlibDefinition { | |||||
| * @return true if they are similar, false otherwise | * @return true if they are similar, false otherwise | ||||
| */ | */ | ||||
| public boolean similar(NestedSequential other) { | public boolean similar(NestedSequential other) { | ||||
| if (nested.size() != other.nested.size()) { | |||||
| final int size = nested.size(); | |||||
| if (size != other.nested.size()) { | |||||
| return false; | return false; | ||||
| } | } | ||||
| for (int i = 0; i < nested.size(); ++i) { | |||||
| for (int i = 0; i < size; ++i) { | |||||
| UnknownElement me = (UnknownElement) nested.get(i); | UnknownElement me = (UnknownElement) nested.get(i); | ||||
| UnknownElement o = (UnknownElement) other.nested.get(i); | UnknownElement o = (UnknownElement) other.nested.get(i); | ||||
| if (!me.similar(o)) { | if (!me.similar(o)) { | ||||
| @@ -185,7 +186,8 @@ public class MacroDef extends AntlibDefinition { | |||||
| ret.setNamespace(""); | ret.setNamespace(""); | ||||
| ret.setQName("sequential"); | ret.setQName("sequential"); | ||||
| new RuntimeConfigurable(ret, "sequential"); | new RuntimeConfigurable(ret, "sequential"); | ||||
| for (int i = 0; i < nestedSequential.getNested().size(); ++i) { | |||||
| final int size = nestedSequential.getNested().size(); | |||||
| for (int i = 0; i < size; ++i) { | |||||
| UnknownElement e = | UnknownElement e = | ||||
| (UnknownElement) nestedSequential.getNested().get(i); | (UnknownElement) nestedSequential.getNested().get(i); | ||||
| ret.addChild(e); | ret.addChild(e); | ||||
| @@ -259,7 +261,8 @@ public class MacroDef extends AntlibDefinition { | |||||
| "the name \"" + attribute.getName() | "the name \"" + attribute.getName() | ||||
| + "\" has already been used by the text element"); | + "\" has already been used by the text element"); | ||||
| } | } | ||||
| for (int i = 0; i < attributes.size(); ++i) { | |||||
| final int size = attributes.size(); | |||||
| for (int i = 0; i < size; ++i) { | |||||
| Attribute att = (Attribute) attributes.get(i); | Attribute att = (Attribute) attributes.get(i); | ||||
| if (att.getName().equals(attribute.getName())) { | if (att.getName().equals(attribute.getName())) { | ||||
| throw new BuildException( | throw new BuildException( | ||||
| @@ -607,7 +607,8 @@ public class Replace extends MatchingTask { | |||||
| */ | */ | ||||
| public void validateReplacefilters() | public void validateReplacefilters() | ||||
| throws BuildException { | throws BuildException { | ||||
| for (int i = 0; i < replacefilters.size(); i++) { | |||||
| final int size = replacefilters.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| Replacefilter element = | Replacefilter element = | ||||
| (Replacefilter) replacefilters.get(i); | (Replacefilter) replacefilters.get(i); | ||||
| element.validate(); | element.validate(); | ||||
| @@ -727,7 +728,8 @@ public class Replace extends MatchingTask { | |||||
| * Flushes all filters. | * Flushes all filters. | ||||
| */ | */ | ||||
| private void flushFilterChain() { | private void flushFilterChain() { | ||||
| for (int i = 0; i < replacefilters.size(); i++) { | |||||
| final int size = replacefilters.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| Replacefilter filter = (Replacefilter) replacefilters.get(i); | Replacefilter filter = (Replacefilter) replacefilters.get(i); | ||||
| filter.flush(); | filter.flush(); | ||||
| } | } | ||||
| @@ -738,7 +740,8 @@ public class Replace extends MatchingTask { | |||||
| * @return true if the filter chain produced new output. | * @return true if the filter chain produced new output. | ||||
| */ | */ | ||||
| private boolean processFilterChain() { | private boolean processFilterChain() { | ||||
| for (int i = 0; i < replacefilters.size(); i++) { | |||||
| final int size = replacefilters.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| Replacefilter filter = (Replacefilter) replacefilters.get(i); | Replacefilter filter = (Replacefilter) replacefilters.get(i); | ||||
| if (!filter.process()) { | if (!filter.process()) { | ||||
| return false; | return false; | ||||
| @@ -755,7 +758,8 @@ public class Replace extends MatchingTask { | |||||
| */ | */ | ||||
| private StringBuffer buildFilterChain(StringBuffer inputBuffer) { | private StringBuffer buildFilterChain(StringBuffer inputBuffer) { | ||||
| StringBuffer buf = inputBuffer; | StringBuffer buf = inputBuffer; | ||||
| for (int i = 0; i < replacefilters.size(); i++) { | |||||
| final int size = replacefilters.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| Replacefilter filter = (Replacefilter) replacefilters.get(i); | Replacefilter filter = (Replacefilter) replacefilters.get(i); | ||||
| filter.setInputBuffer(buf); | filter.setInputBuffer(buf); | ||||
| buf = filter.getOutputBuffer(); | buf = filter.getOutputBuffer(); | ||||
| @@ -768,7 +772,8 @@ public class Replace extends MatchingTask { | |||||
| * @param filename <code>String</code>. | * @param filename <code>String</code>. | ||||
| */ | */ | ||||
| private void logFilterChain(String filename) { | private void logFilterChain(String filename) { | ||||
| for (int i = 0; i < replacefilters.size(); i++) { | |||||
| final int size = replacefilters.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| Replacefilter filter = (Replacefilter) replacefilters.get(i); | Replacefilter filter = (Replacefilter) replacefilters.get(i); | ||||
| log("Replacing in " + filename + ": " + filter.getToken() | log("Replacing in " + filename + ": " + filter.getToken() | ||||
| + " --> " + filter.getReplaceValue(), Project.MSG_VERBOSE); | + " --> " + filter.getReplaceValue(), Project.MSG_VERBOSE); | ||||
| @@ -293,7 +293,8 @@ public class SubAnt extends Task { | |||||
| ant = createAntTask(directory); | ant = createAntTask(directory); | ||||
| String antfilename = file.getAbsolutePath(); | String antfilename = file.getAbsolutePath(); | ||||
| ant.setAntfile(antfilename); | ant.setAntfile(antfilename); | ||||
| for (int i = 0; i < targets.size(); i++) { | |||||
| final int size = targets.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| TargetElement targetElement = (TargetElement) targets.get(i); | TargetElement targetElement = (TargetElement) targets.get(i); | ||||
| ant.addConfiguredTarget(targetElement); | ant.addConfiguredTarget(targetElement); | ||||
| } | } | ||||
| @@ -309,7 +309,8 @@ public class Touch extends Task { | |||||
| // deal with filesets in a special way since the task | // deal with filesets in a special way since the task | ||||
| // originally also used the directories and Union won't return | // originally also used the directories and Union won't return | ||||
| // them. | // them. | ||||
| for (int i = 0; i < filesets.size(); i++) { | |||||
| final int size = filesets.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| FileSet fs = (FileSet) filesets.elementAt(i); | FileSet fs = (FileSet) filesets.elementAt(i); | ||||
| DirectoryScanner ds = fs.getDirectoryScanner(getProject()); | DirectoryScanner ds = fs.getDirectoryScanner(getProject()); | ||||
| File fromDir = fs.getDir(getProject()); | File fromDir = fs.getDir(getProject()); | ||||
| @@ -602,7 +602,8 @@ public class Zip extends MatchingTask { | |||||
| fs.setDir(baseDir); | fs.setDir(baseDir); | ||||
| vfss.addElement(fs); | vfss.addElement(fs); | ||||
| } | } | ||||
| for (int i = 0; i < resources.size(); i++) { | |||||
| final int size = resources.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| ResourceCollection rc = (ResourceCollection) resources.elementAt(i); | ResourceCollection rc = (ResourceCollection) resources.elementAt(i); | ||||
| vfss.addElement(rc); | vfss.addElement(rc); | ||||
| } | } | ||||
| @@ -672,7 +673,8 @@ public class Zip extends MatchingTask { | |||||
| oldFiles.setSrc(renamedFile); | oldFiles.setSrc(renamedFile); | ||||
| oldFiles.setDefaultexcludes(false); | oldFiles.setDefaultexcludes(false); | ||||
| for (int i = 0; i < addedFiles.size(); i++) { | |||||
| final int addSize = addedFiles.size(); | |||||
| for (int i = 0; i < addSize; i++) { | |||||
| PatternSet.NameEntry ne = oldFiles.createExclude(); | PatternSet.NameEntry ne = oldFiles.createExclude(); | ||||
| ne.setName((String) addedFiles.elementAt(i)); | ne.setName((String) addedFiles.elementAt(i)); | ||||
| } | } | ||||
| @@ -823,7 +825,8 @@ public class Zip extends MatchingTask { | |||||
| /** Process groupfilesets */ | /** Process groupfilesets */ | ||||
| private void processGroupFilesets() { | private void processGroupFilesets() { | ||||
| // Add the files found in groupfileset to fileset | // Add the files found in groupfileset to fileset | ||||
| for (int i = 0; i < groupfilesets.size(); i++) { | |||||
| final int size = groupfilesets.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| logWhenWriting("Processing groupfileset ", Project.MSG_VERBOSE); | logWhenWriting("Processing groupfileset ", Project.MSG_VERBOSE); | ||||
| FileSet fs = (FileSet) groupfilesets.elementAt(i); | FileSet fs = (FileSet) groupfilesets.elementAt(i); | ||||
| @@ -241,7 +241,8 @@ public class ChangeLogTask extends AbstractCvsTask { | |||||
| loadUserlist(userList); | loadUserlist(userList); | ||||
| for (int i = 0, size = cvsUsers.size(); i < size; i++) { | |||||
| final int size = cvsUsers.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| final CvsUser user = (CvsUser) cvsUsers.get(i); | final CvsUser user = (CvsUser) cvsUsers.get(i); | ||||
| user.validate(); | user.validate(); | ||||
| userList.put(user.getUserID(), user.getDisplayname()); | userList.put(user.getUserID(), user.getDisplayname()); | ||||
| @@ -289,9 +289,10 @@ public class MimeMailer extends Mailer { | |||||
| private static InternetAddress[] internetAddresses(Vector list) | private static InternetAddress[] internetAddresses(Vector list) | ||||
| throws AddressException, UnsupportedEncodingException { | throws AddressException, UnsupportedEncodingException { | ||||
| InternetAddress[] addrs = new InternetAddress[list.size()]; | |||||
| final int size = list.size(); | |||||
| InternetAddress[] addrs = new InternetAddress[size]; | |||||
| for (int i = 0; i < list.size(); ++i) { | |||||
| for (int i = 0; i < size; ++i) { | |||||
| EmailAddress addr = (EmailAddress) list.elementAt(i); | EmailAddress addr = (EmailAddress) list.elementAt(i); | ||||
| String name = addr.getName(); | String name = addr.getName(); | ||||
| @@ -155,7 +155,8 @@ public class Cab extends MatchingTask { | |||||
| */ | */ | ||||
| protected boolean isUpToDate(Vector files) { | protected boolean isUpToDate(Vector files) { | ||||
| boolean upToDate = true; | boolean upToDate = true; | ||||
| for (int i = 0; i < files.size() && upToDate; i++) { | |||||
| final int size = files.size(); | |||||
| for (int i = 0; i < size && upToDate; i++) { | |||||
| String file = files.elementAt(i).toString(); | String file = files.elementAt(i).toString(); | ||||
| if (FILE_UTILS.resolveFile(baseDir, file).lastModified() | if (FILE_UTILS.resolveFile(baseDir, file).lastModified() | ||||
| > cabFile.lastModified()) { | > cabFile.lastModified()) { | ||||
| @@ -183,7 +184,7 @@ public class Cab extends MatchingTask { | |||||
| try { | try { | ||||
| writer = new BufferedWriter(new FileWriter(listFile)); | writer = new BufferedWriter(new FileWriter(listFile)); | ||||
| int size = files.size(); | |||||
| final int size = files.size(); | |||||
| for (int i = 0; i < size; i++) { | for (int i = 0; i < size; i++) { | ||||
| writer.write('\"' + files.elementAt(i).toString() + '\"'); | writer.write('\"' + files.elementAt(i).toString() + '\"'); | ||||
| writer.newLine(); | writer.newLine(); | ||||
| @@ -407,7 +407,8 @@ public class EchoProperties extends Task { | |||||
| return result; | return result; | ||||
| } | } | ||||
| }; | }; | ||||
| for (int i = 0; i < keyList.size(); i++) { | |||||
| final int size = keyList.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| String name = keyList.get(i).toString(); | String name = keyList.get(i).toString(); | ||||
| String value = allProps.get(name).toString(); | String value = allProps.get(name).toString(); | ||||
| props.setProperty(name, value); | props.setProperty(name, value); | ||||
| @@ -846,7 +846,8 @@ public class NetRexxC extends MatchingTask { | |||||
| String eol = System.getProperty("line.separator"); | String eol = System.getProperty("line.separator"); | ||||
| StringBuffer niceSourceList = new StringBuffer("Files to be compiled:" + eol); | StringBuffer niceSourceList = new StringBuffer("Files to be compiled:" + eol); | ||||
| for (int i = 0; i < compileList.size(); i++) { | |||||
| final int size = compileList.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| niceSourceList.append(" "); | niceSourceList.append(" "); | ||||
| niceSourceList.append(compileList.elementAt(i).toString()); | niceSourceList.append(compileList.elementAt(i).toString()); | ||||
| niceSourceList.append(eol); | niceSourceList.append(eol); | ||||
| @@ -323,7 +323,8 @@ public class TraXLiaison implements XSLTLiaison3, ErrorListener, XSLTLoggerAware | |||||
| if (uriResolver != null) { | if (uriResolver != null) { | ||||
| transformer.setURIResolver(uriResolver); | transformer.setURIResolver(uriResolver); | ||||
| } | } | ||||
| for (int i = 0; i < outputProperties.size(); i++) { | |||||
| final int size = outputProperties.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| final String[] pair = (String[]) outputProperties.elementAt(i); | final String[] pair = (String[]) outputProperties.elementAt(i); | ||||
| transformer.setOutputProperty(pair[0], pair[1]); | transformer.setOutputProperty(pair[0], pair[1]); | ||||
| } | } | ||||
| @@ -419,7 +420,8 @@ public class TraXLiaison implements XSLTLiaison3, ErrorListener, XSLTLoggerAware | |||||
| tfactory.setErrorListener(this); | tfactory.setErrorListener(this); | ||||
| // specific attributes for the transformer | // specific attributes for the transformer | ||||
| for (int i = 0; i < attributes.size(); i++) { | |||||
| final int size = attributes.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| final Object[] pair = (Object[]) attributes.elementAt(i); | final Object[] pair = (Object[]) attributes.elementAt(i); | ||||
| tfactory.setAttribute((String) pair[0], pair[1]); | tfactory.setAttribute((String) pair[0], pair[1]); | ||||
| } | } | ||||
| @@ -310,7 +310,8 @@ public class XMLValidateTask extends Task { | |||||
| } | } | ||||
| } | } | ||||
| for (int i = 0; i < filesets.size(); i++) { | |||||
| final int size = filesets.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| FileSet fs = (FileSet) filesets.elementAt(i); | FileSet fs = (FileSet) filesets.elementAt(i); | ||||
| DirectoryScanner ds = fs.getDirectoryScanner(getProject()); | DirectoryScanner ds = fs.getDirectoryScanner(getProject()); | ||||
| @@ -355,13 +356,15 @@ public class XMLValidateTask extends Task { | |||||
| setFeature(XmlConstants.FEATURE_VALIDATION, true); | setFeature(XmlConstants.FEATURE_VALIDATION, true); | ||||
| } | } | ||||
| // set the feature from the attribute list | // set the feature from the attribute list | ||||
| for (int i = 0; i < attributeList.size(); i++) { | |||||
| final int attSize = attributeList.size(); | |||||
| for (int i = 0; i < attSize; i++) { | |||||
| Attribute feature = (Attribute) attributeList.elementAt(i); | Attribute feature = (Attribute) attributeList.elementAt(i); | ||||
| setFeature(feature.getName(), feature.getValue()); | setFeature(feature.getName(), feature.getValue()); | ||||
| } | } | ||||
| // Sets properties | // Sets properties | ||||
| for (int i = 0; i < propertyList.size(); i++) { | |||||
| final int propSize = propertyList.size(); | |||||
| for (int i = 0; i < propSize; i++) { | |||||
| final Property prop = (Property) propertyList.elementAt(i); | final Property prop = (Property) propertyList.elementAt(i); | ||||
| setProperty(prop.getName(), prop.getValue()); | setProperty(prop.getName(), prop.getValue()); | ||||
| } | } | ||||
| @@ -90,7 +90,8 @@ public class ClassFile { | |||||
| Vector classRefs = new Vector(); | Vector classRefs = new Vector(); | ||||
| for (int i = 0; i < constantPool.size(); ++i) { | |||||
| final int size = constantPool.size(); | |||||
| for (int i = 0; i < size; ++i) { | |||||
| ConstantPoolEntry entry = constantPool.getEntry(i); | ConstantPoolEntry entry = constantPool.getEntry(i); | ||||
| if (entry != null | if (entry != null | ||||
| @@ -165,7 +165,8 @@ public class ConstantPool { | |||||
| public int getClassEntry(String className) { | public int getClassEntry(String className) { | ||||
| int index = -1; | int index = -1; | ||||
| for (int i = 0; i < entries.size() && index == -1; ++i) { | |||||
| final int size = entries.size(); | |||||
| for (int i = 0; i < size && index == -1; ++i) { | |||||
| Object element = entries.elementAt(i); | Object element = entries.elementAt(i); | ||||
| if (element instanceof ClassCPInfo) { | if (element instanceof ClassCPInfo) { | ||||
| @@ -191,7 +192,8 @@ public class ConstantPool { | |||||
| public int getConstantEntry(Object constantValue) { | public int getConstantEntry(Object constantValue) { | ||||
| int index = -1; | int index = -1; | ||||
| for (int i = 0; i < entries.size() && index == -1; ++i) { | |||||
| final int size = entries.size(); | |||||
| for (int i = 0; i < size && index == -1; ++i) { | |||||
| Object element = entries.elementAt(i); | Object element = entries.elementAt(i); | ||||
| if (element instanceof ConstantCPInfo) { | if (element instanceof ConstantCPInfo) { | ||||
| @@ -221,7 +223,8 @@ public class ConstantPool { | |||||
| String methodType) { | String methodType) { | ||||
| int index = -1; | int index = -1; | ||||
| for (int i = 0; i < entries.size() && index == -1; ++i) { | |||||
| final int size = entries.size(); | |||||
| for (int i = 0; i < size && index == -1; ++i) { | |||||
| Object element = entries.elementAt(i); | Object element = entries.elementAt(i); | ||||
| if (element instanceof MethodRefCPInfo) { | if (element instanceof MethodRefCPInfo) { | ||||
| @@ -255,7 +258,8 @@ public class ConstantPool { | |||||
| String interfaceMethodType) { | String interfaceMethodType) { | ||||
| int index = -1; | int index = -1; | ||||
| for (int i = 0; i < entries.size() && index == -1; ++i) { | |||||
| final int size = entries.size(); | |||||
| for (int i = 0; i < size && index == -1; ++i) { | |||||
| Object element = entries.elementAt(i); | Object element = entries.elementAt(i); | ||||
| if (element instanceof InterfaceMethodRefCPInfo) { | if (element instanceof InterfaceMethodRefCPInfo) { | ||||
| @@ -291,7 +295,8 @@ public class ConstantPool { | |||||
| String fieldType) { | String fieldType) { | ||||
| int index = -1; | int index = -1; | ||||
| for (int i = 0; i < entries.size() && index == -1; ++i) { | |||||
| final int size = entries.size(); | |||||
| for (int i = 0; i < size && index == -1; ++i) { | |||||
| Object element = entries.elementAt(i); | Object element = entries.elementAt(i); | ||||
| if (element instanceof FieldRefCPInfo) { | if (element instanceof FieldRefCPInfo) { | ||||
| @@ -320,7 +325,8 @@ public class ConstantPool { | |||||
| public int getNameAndTypeEntry(String name, String type) { | public int getNameAndTypeEntry(String name, String type) { | ||||
| int index = -1; | int index = -1; | ||||
| for (int i = 0; i < entries.size() && index == -1; ++i) { | |||||
| final int size = entries.size(); | |||||
| for (int i = 0; i < size && index == -1; ++i) { | |||||
| Object element = entries.elementAt(i); | Object element = entries.elementAt(i); | ||||
| if (element instanceof NameAndTypeCPInfo) { | if (element instanceof NameAndTypeCPInfo) { | ||||
| @@ -344,7 +350,7 @@ public class ConstantPool { | |||||
| */ | */ | ||||
| public String toString() { | public String toString() { | ||||
| StringBuffer sb = new StringBuffer("\n"); | StringBuffer sb = new StringBuffer("\n"); | ||||
| int size = entries.size(); | |||||
| final int size = entries.size(); | |||||
| for (int i = 0; i < size; ++i) { | for (int i = 0; i < size; ++i) { | ||||
| sb.append("[" + i + "] = " + getEntry(i) + "\n"); | sb.append("[" + i + "] = " + getEntry(i) + "\n"); | ||||
| @@ -495,7 +495,8 @@ public class Translate extends MatchingTask { | |||||
| */ | */ | ||||
| private void translate() throws BuildException { | private void translate() throws BuildException { | ||||
| int filesProcessed = 0; | int filesProcessed = 0; | ||||
| for (int i = 0; i < filesets.size(); i++) { | |||||
| final int size = filesets.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| FileSet fs = (FileSet) filesets.elementAt(i); | FileSet fs = (FileSet) filesets.elementAt(i); | ||||
| DirectoryScanner ds = fs.getDirectoryScanner(getProject()); | DirectoryScanner ds = fs.getDirectoryScanner(getProject()); | ||||
| String[] srcFiles = ds.getIncludedFiles(); | String[] srcFiles = ds.getIncludedFiles(); | ||||
| @@ -290,7 +290,8 @@ public class Image extends MatchingTask { | |||||
| try { | try { | ||||
| input = new FileSeekableStream(file); | input = new FileSeekableStream(file); | ||||
| image = JAI.create("stream", input); | image = JAI.create("stream", input); | ||||
| for (int i = 0; i < instructions.size(); i++) { | |||||
| final int size = instructions.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| Object instr = instructions.elementAt(i); | Object instr = instructions.elementAt(i); | ||||
| if (instr instanceof TransformOperation) { | if (instr instanceof TransformOperation) { | ||||
| image = ((TransformOperation) instr) | image = ((TransformOperation) instr) | ||||
| @@ -374,7 +375,8 @@ public class Image extends MatchingTask { | |||||
| writeCount += processDir(srcDir, files, dest, mapper); | writeCount += processDir(srcDir, files, dest, mapper); | ||||
| } | } | ||||
| // deal with the filesets | // deal with the filesets | ||||
| for (int i = 0; i < filesets.size(); i++) { | |||||
| final int size = filesets.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| final FileSet fs = (FileSet) filesets.elementAt(i); | final FileSet fs = (FileSet) filesets.elementAt(i); | ||||
| final DirectoryScanner ds = | final DirectoryScanner ds = | ||||
| fs.getDirectoryScanner(getProject()); | fs.getDirectoryScanner(getProject()); | ||||
| @@ -167,7 +167,8 @@ public class WLJspc extends MatchingTask { | |||||
| this.scanDir(files); | this.scanDir(files); | ||||
| log("Compiling " + filesToDo.size() + " JSP files"); | log("Compiling " + filesToDo.size() + " JSP files"); | ||||
| for (int i = 0; i < filesToDo.size(); i++) { | |||||
| final int size = filesToDo.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| //XXX | //XXX | ||||
| // All this to get package according to weblogic standards | // All this to get package according to weblogic standards | ||||
| // Can be written better... this is too hacky! | // Can be written better... this is too hacky! | ||||
| @@ -151,7 +151,8 @@ public class FailureRecorder extends ProjectComponent implements JUnitResultForm | |||||
| // check if already registered | // check if already registered | ||||
| boolean alreadyRegistered = false; | boolean alreadyRegistered = false; | ||||
| Vector allListeners = project.getBuildListeners(); | Vector allListeners = project.getBuildListeners(); | ||||
| for (int i = 0; i < allListeners.size(); i++) { | |||||
| final int size = allListeners.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| Object listener = allListeners.get(i); | Object listener = allListeners.get(i); | ||||
| if (listener instanceof FailureRecorder) { | if (listener instanceof FailureRecorder) { | ||||
| alreadyRegistered = true; | alreadyRegistered = true; | ||||
| @@ -352,7 +352,8 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR | |||||
| public void run() { | public void run() { | ||||
| res = new TestResult(); | res = new TestResult(); | ||||
| res.addListener(wrapListener(this)); | res.addListener(wrapListener(this)); | ||||
| for (int i = 0; i < formatters.size(); i++) { | |||||
| final int size = formatters.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| res.addListener(wrapListener((TestListener) formatters.elementAt(i))); | res.addListener(wrapListener((TestListener) formatters.elementAt(i))); | ||||
| } | } | ||||
| @@ -506,7 +507,8 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR | |||||
| fireStartTestSuite(); | fireStartTestSuite(); | ||||
| startTestSuiteSuccess = true; | startTestSuiteSuccess = true; | ||||
| if (exception != null) { // had an exception constructing suite | if (exception != null) { // had an exception constructing suite | ||||
| for (int i = 0; i < formatters.size(); i++) { | |||||
| final int formatterSize = formatters.size(); | |||||
| for (int i = 0; i < formatterSize; i++) { | |||||
| ((TestListener) formatters.elementAt(i)) | ((TestListener) formatters.elementAt(i)) | ||||
| .addError(null, exception); | .addError(null, exception); | ||||
| } | } | ||||
| @@ -705,7 +707,8 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR | |||||
| } | } | ||||
| private void sendOutAndErr(String out, String err) { | private void sendOutAndErr(String out, String err) { | ||||
| for (int i = 0; i < formatters.size(); i++) { | |||||
| final int size = formatters.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| JUnitResultFormatter formatter = | JUnitResultFormatter formatter = | ||||
| ((JUnitResultFormatter) formatters.elementAt(i)); | ((JUnitResultFormatter) formatters.elementAt(i)); | ||||
| @@ -715,14 +718,16 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR | |||||
| } | } | ||||
| private void fireStartTestSuite() { | private void fireStartTestSuite() { | ||||
| for (int i = 0; i < formatters.size(); i++) { | |||||
| final int size = formatters.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| ((JUnitResultFormatter) formatters.elementAt(i)) | ((JUnitResultFormatter) formatters.elementAt(i)) | ||||
| .startTestSuite(junitTest); | .startTestSuite(junitTest); | ||||
| } | } | ||||
| } | } | ||||
| private void fireEndTestSuite() { | private void fireEndTestSuite() { | ||||
| for (int i = 0; i < formatters.size(); i++) { | |||||
| final int size = formatters.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| ((JUnitResultFormatter) formatters.elementAt(i)) | ((JUnitResultFormatter) formatters.elementAt(i)) | ||||
| .endTestSuite(junitTest); | .endTestSuite(junitTest); | ||||
| } | } | ||||
| @@ -946,7 +951,8 @@ public class JUnitTestRunner implements TestListener, JUnitTaskMirror.JUnitTestR | |||||
| registerTestCase(JUnitVersionHelper.getTestCaseName(arg0)); | registerTestCase(JUnitVersionHelper.getTestCaseName(arg0)); | ||||
| } | } | ||||
| }); | }); | ||||
| for (int i = 0; i < fromCmdLine.size(); i++) { | |||||
| final int size = fromCmdLine.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| FormatterElement fe = (FormatterElement) fromCmdLine.elementAt(i); | FormatterElement fe = (FormatterElement) fromCmdLine.elementAt(i); | ||||
| if (multipleTests && fe.getUseFile()) { | if (multipleTests && fe.getUseFile()) { | ||||
| File destFile = | File destFile = | ||||
| @@ -820,7 +820,8 @@ public class FTP extends Task implements FTPTaskConfig { | |||||
| throw new BuildException("could not change working dir to " | throw new BuildException("could not change working dir to " | ||||
| + parent.curpwd); | + parent.curpwd); | ||||
| } | } | ||||
| for (int fcount = 0; fcount < pathElements.size() - 1; fcount++) { | |||||
| final int size = pathElements.size(); | |||||
| for (int fcount = 0; fcount < size - 1; fcount++) { | |||||
| String currentPathElement = (String) pathElements.elementAt(fcount); | String currentPathElement = (String) pathElements.elementAt(fcount); | ||||
| try { | try { | ||||
| boolean result = this.client.changeWorkingDirectory(currentPathElement); | boolean result = this.client.changeWorkingDirectory(currentPathElement); | ||||
| @@ -843,7 +844,7 @@ public class FTP extends Task implements FTPTaskConfig { | |||||
| } | } | ||||
| } | } | ||||
| String lastpathelement = (String) pathElements.elementAt(pathElements.size() - 1); | |||||
| String lastpathelement = (String) pathElements.elementAt(size - 1); | |||||
| FTPFile [] theFiles = listFiles(this.curpwd); | FTPFile [] theFiles = listFiles(this.curpwd); | ||||
| this.ftpFile = getFile(theFiles, lastpathelement); | this.ftpFile = getFile(theFiles, lastpathelement); | ||||
| } | } | ||||
| @@ -946,7 +947,8 @@ public class FTP extends Task implements FTPTaskConfig { | |||||
| Vector pathElements = SelectorUtils.tokenizePath(getAbsolutePath(), remoteFileSep); | Vector pathElements = SelectorUtils.tokenizePath(getAbsolutePath(), remoteFileSep); | ||||
| Vector pathElements2 = SelectorUtils.tokenizePath(currentPath, remoteFileSep); | Vector pathElements2 = SelectorUtils.tokenizePath(currentPath, remoteFileSep); | ||||
| String relPath = currentRelativePath; | String relPath = currentRelativePath; | ||||
| for (int pcount = pathElements2.size(); pcount < pathElements.size(); pcount++) { | |||||
| final int size = pathElements.size(); | |||||
| for (int pcount = pathElements2.size(); pcount < size; pcount++) { | |||||
| String currentElement = (String) pathElements.elementAt(pcount); | String currentElement = (String) pathElements.elementAt(pcount); | ||||
| FTPFile[] theFiles = listFiles(currentPath); | FTPFile[] theFiles = listFiles(currentPath); | ||||
| FTPFile theFile = null; | FTPFile theFile = null; | ||||
| @@ -1838,7 +1840,8 @@ public class FTP extends Task implements FTPTaskConfig { | |||||
| throw new BuildException("at least one fileset must be specified."); | throw new BuildException("at least one fileset must be specified."); | ||||
| } else { | } else { | ||||
| // get files from filesets | // get files from filesets | ||||
| for (int i = 0; i < filesets.size(); i++) { | |||||
| final int size = filesets.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| FileSet fs = (FileSet) filesets.elementAt(i); | FileSet fs = (FileSet) filesets.elementAt(i); | ||||
| if (fs != null) { | if (fs != null) { | ||||
| @@ -722,7 +722,8 @@ public class FTPTaskMirrorImpl implements FTPTaskMirror { | |||||
| throw new BuildException("could not change working dir to " | throw new BuildException("could not change working dir to " | ||||
| + parent.curpwd); | + parent.curpwd); | ||||
| } | } | ||||
| for (int fcount = 0; fcount < pathElements.size() - 1; fcount++) { | |||||
| final int size = pathElements.size(); | |||||
| for (int fcount = 0; fcount < size - 1; fcount++) { | |||||
| String currentPathElement = (String) pathElements.elementAt(fcount); | String currentPathElement = (String) pathElements.elementAt(fcount); | ||||
| try { | try { | ||||
| boolean result = this.client.changeWorkingDirectory(currentPathElement); | boolean result = this.client.changeWorkingDirectory(currentPathElement); | ||||
| @@ -745,7 +746,7 @@ public class FTPTaskMirrorImpl implements FTPTaskMirror { | |||||
| } | } | ||||
| } | } | ||||
| String lastpathelement = (String) pathElements.elementAt(pathElements.size() - 1); | |||||
| String lastpathelement = (String) pathElements.elementAt(size - 1); | |||||
| FTPFile [] theFiles = listFiles(this.curpwd); | FTPFile [] theFiles = listFiles(this.curpwd); | ||||
| this.ftpFile = getFile(theFiles, lastpathelement); | this.ftpFile = getFile(theFiles, lastpathelement); | ||||
| } | } | ||||
| @@ -850,7 +851,8 @@ public class FTPTaskMirrorImpl implements FTPTaskMirror { | |||||
| Vector pathElements2 = SelectorUtils.tokenizePath(currentPath, | Vector pathElements2 = SelectorUtils.tokenizePath(currentPath, | ||||
| task.getSeparator()); | task.getSeparator()); | ||||
| String relPath = currentRelativePath; | String relPath = currentRelativePath; | ||||
| for (int pcount = pathElements2.size(); pcount < pathElements.size(); pcount++) { | |||||
| final int size = pathElements.size(); | |||||
| for (int pcount = pathElements2.size(); pcount < size; pcount++) { | |||||
| String currentElement = (String) pathElements.elementAt(pcount); | String currentElement = (String) pathElements.elementAt(pcount); | ||||
| FTPFile[] theFiles = listFiles(currentPath); | FTPFile[] theFiles = listFiles(currentPath); | ||||
| FTPFile theFile = null; | FTPFile theFile = null; | ||||
| @@ -1227,7 +1229,8 @@ public class FTPTaskMirrorImpl implements FTPTaskMirror { | |||||
| throw new BuildException("at least one fileset must be specified."); | throw new BuildException("at least one fileset must be specified."); | ||||
| } else { | } else { | ||||
| // get files from filesets | // get files from filesets | ||||
| for (int i = 0; i < task.getFilesets().size(); i++) { | |||||
| final int size = task.getFilesets().size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| FileSet fs = (FileSet) task.getFilesets().elementAt(i); | FileSet fs = (FileSet) task.getFilesets().elementAt(i); | ||||
| if (fs != null) { | if (fs != null) { | ||||
| @@ -112,7 +112,8 @@ public class P4Add extends P4Base { | |||||
| StringBuffer filelist = new StringBuffer(); | StringBuffer filelist = new StringBuffer(); | ||||
| for (int i = 0; i < filesets.size(); i++) { | |||||
| final int size = filesets.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| FileSet fs = (FileSet) filesets.elementAt(i); | FileSet fs = (FileSet) filesets.elementAt(i); | ||||
| DirectoryScanner ds = fs.getDirectoryScanner(getProject()); | DirectoryScanner ds = fs.getDirectoryScanner(getProject()); | ||||
| @@ -129,7 +129,8 @@ public class P4Fstat extends P4Base { | |||||
| filelist = new StringBuffer(); | filelist = new StringBuffer(); | ||||
| for (int i = 0; i < filesets.size(); i++) { | |||||
| final int size = filesets.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| FileSet fs = (FileSet) filesets.elementAt(i); | FileSet fs = (FileSet) filesets.elementAt(i); | ||||
| DirectoryScanner ds = fs.getDirectoryScanner(getProject()); | DirectoryScanner ds = fs.getDirectoryScanner(getProject()); | ||||
| @@ -181,7 +182,8 @@ public class P4Fstat extends P4Base { | |||||
| private void printRes(ArrayList ar, String header) { | private void printRes(ArrayList ar, String header) { | ||||
| log(header, Project.MSG_INFO); | log(header, Project.MSG_INFO); | ||||
| for (int i = 0; i < ar.size(); i++) { | |||||
| final int size = ar.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| log((String) ar.get(i), Project.MSG_INFO); | log((String) ar.get(i), Project.MSG_INFO); | ||||
| } | } | ||||
| } | } | ||||
| @@ -119,7 +119,8 @@ public class P4Submit extends P4Base { | |||||
| Vector myarray = new Vector(); | Vector myarray = new Vector(); | ||||
| util.split(myarray, line); | util.split(myarray, line); | ||||
| boolean found = false; | boolean found = false; | ||||
| for (int counter = 0; counter < myarray.size(); counter++) { | |||||
| final int size = myarray.size(); | |||||
| for (int counter = 0; counter < size; counter++) { | |||||
| if (found) { | if (found) { | ||||
| String chnum = (String) myarray.elementAt(counter + 1); | String chnum = (String) myarray.elementAt(counter + 1); | ||||
| int changenumber = Integer.parseInt(chnum); | int changenumber = Integer.parseInt(chnum); | ||||
| @@ -144,7 +144,8 @@ public class ScpFromMessageBySftp extends ScpFromMessage { | |||||
| localFile.mkdirs(); | localFile.mkdirs(); | ||||
| } | } | ||||
| java.util.Vector files = channel.ls(remoteFile); | java.util.Vector files = channel.ls(remoteFile); | ||||
| for (int i = 0; i < files.size(); i++) { | |||||
| final int size = files.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| ChannelSftp.LsEntry le = (ChannelSftp.LsEntry) files.elementAt(i); | ChannelSftp.LsEntry le = (ChannelSftp.LsEntry) files.elementAt(i); | ||||
| String name = le.getFilename(); | String name = le.getFilename(); | ||||
| if (le.getAttrs().isDir()) { | if (le.getAttrs().isDir()) { | ||||
| @@ -509,7 +509,8 @@ public class Symlink extends DispatchTask { | |||||
| */ | */ | ||||
| private HashSet findLinks(Vector v) { | private HashSet findLinks(Vector v) { | ||||
| HashSet result = new HashSet(); | HashSet result = new HashSet(); | ||||
| for (int i = 0; i < v.size(); i++) { | |||||
| final int size = v.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| FileSet fs = (FileSet) v.get(i); | FileSet fs = (FileSet) v.get(i); | ||||
| DirectoryScanner ds = fs.getDirectoryScanner(getProject()); | DirectoryScanner ds = fs.getDirectoryScanner(getProject()); | ||||
| String[][] fnd = new String[][] | String[][] fnd = new String[][] | ||||
| @@ -547,7 +548,8 @@ public class Symlink extends DispatchTask { | |||||
| private Properties loadLinks(Vector v) { | private Properties loadLinks(Vector v) { | ||||
| Properties finalList = new Properties(); | Properties finalList = new Properties(); | ||||
| // loop through the supplied file sets: | // loop through the supplied file sets: | ||||
| for (int i = 0; i < v.size(); i++) { | |||||
| final int size = v.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| FileSet fs = (FileSet) v.elementAt(i); | FileSet fs = (FileSet) v.elementAt(i); | ||||
| DirectoryScanner ds = new DirectoryScanner(); | DirectoryScanner ds = new DirectoryScanner(); | ||||
| fs.setupDirectoryScanner(ds, getProject()); | fs.setupDirectoryScanner(ds, getProject()); | ||||
| @@ -386,7 +386,8 @@ public class Commandline implements Cloneable { | |||||
| * @since Ant 1.6 | * @since Ant 1.6 | ||||
| */ | */ | ||||
| public void addArgumentsToList(ListIterator list) { | public void addArgumentsToList(ListIterator list) { | ||||
| for (int i = 0; i < arguments.size(); i++) { | |||||
| final int size = arguments.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| Argument arg = (Argument) arguments.elementAt(i); | Argument arg = (Argument) arguments.elementAt(i); | ||||
| String[] s = arg.getParts(); | String[] s = arg.getParts(); | ||||
| if (s != null) { | if (s != null) { | ||||
| @@ -78,7 +78,8 @@ public class Description extends DataType { | |||||
| return null; | return null; | ||||
| } | } | ||||
| StringBuffer description = new StringBuffer(); | StringBuffer description = new StringBuffer(); | ||||
| for (int i = 0; i < targets.size(); i++) { | |||||
| final int size = targets.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| Target t = (Target) targets.elementAt(i); | Target t = (Target) targets.elementAt(i); | ||||
| concatDescriptions(project, t, description); | concatDescriptions(project, t, description); | ||||
| } | } | ||||
| @@ -94,7 +95,8 @@ public class Description extends DataType { | |||||
| if (tasks == null) { | if (tasks == null) { | ||||
| return; | return; | ||||
| } | } | ||||
| for (int i = 0; i < tasks.size(); i++) { | |||||
| final int size = tasks.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| Task task = (Task) tasks.elementAt(i); | Task task = (Task) tasks.elementAt(i); | ||||
| if (!(task instanceof UnknownElement)) { | if (!(task instanceof UnknownElement)) { | ||||
| continue; | continue; | ||||
| @@ -223,7 +223,8 @@ public class FilterSet extends DataType implements Cloneable { | |||||
| //silly hack to avoid stack overflow... | //silly hack to avoid stack overflow... | ||||
| if (!readingFiles) { | if (!readingFiles) { | ||||
| readingFiles = true; | readingFiles = true; | ||||
| for (int i = 0, sz = filtersFiles.size(); i < sz; i++) { | |||||
| final int size = filtersFiles.size(); | |||||
| for (int i = 0, sz = size; i < sz; i++) { | |||||
| readFiltersFromFile((File) filtersFiles.get(i)); | readFiltersFromFile((File) filtersFiles.get(i)); | ||||
| } | } | ||||
| filtersFiles.clear(); | filtersFiles.clear(); | ||||
| @@ -104,7 +104,8 @@ public class Arc extends BasicShape implements DrawOperation { | |||||
| } | } | ||||
| for (int i = 0; i < instructions.size(); i++) { | |||||
| final int size = instructions.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| ImageOperation instr = ((ImageOperation) instructions.elementAt(i)); | ImageOperation instr = ((ImageOperation) instructions.elementAt(i)); | ||||
| if (instr instanceof DrawOperation) { | if (instr instanceof DrawOperation) { | ||||
| PlanarImage img = ((DrawOperation) instr).executeDrawOperation(); | PlanarImage img = ((DrawOperation) instr).executeDrawOperation(); | ||||
| @@ -78,7 +78,8 @@ public class Draw extends TransformOperation { | |||||
| BufferedImage bi = image.getAsBufferedImage(); | BufferedImage bi = image.getAsBufferedImage(); | ||||
| Graphics2D graphics = (Graphics2D) bi.getGraphics(); | Graphics2D graphics = (Graphics2D) bi.getGraphics(); | ||||
| for (int i = 0; i < instructions.size(); i++) { | |||||
| final int size = instructions.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| ImageOperation instr = ((ImageOperation) instructions.elementAt(i)); | ImageOperation instr = ((ImageOperation) instructions.elementAt(i)); | ||||
| if (instr instanceof DrawOperation) { | if (instr instanceof DrawOperation) { | ||||
| PlanarImage op = ((DrawOperation) instr).executeDrawOperation(); | PlanarImage op = ((DrawOperation) instr).executeDrawOperation(); | ||||
| @@ -68,7 +68,8 @@ public class Ellipse extends BasicShape implements DrawOperation { | |||||
| } | } | ||||
| for (int i = 0; i < instructions.size(); i++) { | |||||
| final int size = instructions.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| ImageOperation instr = ((ImageOperation) instructions.elementAt(i)); | ImageOperation instr = ((ImageOperation) instructions.elementAt(i)); | ||||
| if (instr instanceof DrawOperation) { | if (instr instanceof DrawOperation) { | ||||
| PlanarImage img = ((DrawOperation) instr).executeDrawOperation(); | PlanarImage img = ((DrawOperation) instr).executeDrawOperation(); | ||||
| @@ -99,7 +99,8 @@ public class Rectangle extends BasicShape implements DrawOperation { | |||||
| } | } | ||||
| for (int i = 0; i < instructions.size(); i++) { | |||||
| final int size = instructions.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| ImageOperation instr = ((ImageOperation) instructions.elementAt(i)); | ImageOperation instr = ((ImageOperation) instructions.elementAt(i)); | ||||
| if (instr instanceof DrawOperation) { | if (instr instanceof DrawOperation) { | ||||
| PlanarImage img = ((DrawOperation) instr).executeDrawOperation(); | PlanarImage img = ((DrawOperation) instr).executeDrawOperation(); | ||||
| @@ -70,7 +70,8 @@ public class Rotate extends TransformOperation implements DrawOperation { | |||||
| public PlanarImage executeTransformOperation(PlanarImage image) { | public PlanarImage executeTransformOperation(PlanarImage image) { | ||||
| BufferedImage bi = null; | BufferedImage bi = null; | ||||
| Graphics2D graphics = null; | Graphics2D graphics = null; | ||||
| for (int i = 0; i < instructions.size(); i++) { | |||||
| final int size = instructions.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| ImageOperation instr = ((ImageOperation) instructions.elementAt(i)); | ImageOperation instr = ((ImageOperation) instructions.elementAt(i)); | ||||
| if (instr instanceof DrawOperation) { | if (instr instanceof DrawOperation) { | ||||
| // If this TransformOperation has DrawOperation children | // If this TransformOperation has DrawOperation children | ||||
| @@ -102,7 +103,8 @@ public class Rotate extends TransformOperation implements DrawOperation { | |||||
| * @return the image. | * @return the image. | ||||
| */ | */ | ||||
| public PlanarImage executeDrawOperation() { | public PlanarImage executeDrawOperation() { | ||||
| for (int i = 0; i < instructions.size(); i++) { | |||||
| final int size = instructions.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| ImageOperation instr = ((ImageOperation) instructions.elementAt(i)); | ImageOperation instr = ((ImageOperation) instructions.elementAt(i)); | ||||
| if (instr instanceof DrawOperation) { | if (instr instanceof DrawOperation) { | ||||
| // If this TransformOperation has DrawOperation children | // If this TransformOperation has DrawOperation children | ||||
| @@ -146,7 +146,8 @@ public class Scale extends TransformOperation implements DrawOperation { | |||||
| /** {@inheritDoc}. */ | /** {@inheritDoc}. */ | ||||
| public PlanarImage executeTransformOperation(PlanarImage image) { | public PlanarImage executeTransformOperation(PlanarImage image) { | ||||
| BufferedImage bi = null; | BufferedImage bi = null; | ||||
| for (int i = 0; i < instructions.size(); i++) { | |||||
| final int size = instructions.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| ImageOperation instr = ((ImageOperation) instructions.elementAt(i)); | ImageOperation instr = ((ImageOperation) instructions.elementAt(i)); | ||||
| if (instr instanceof DrawOperation) { | if (instr instanceof DrawOperation) { | ||||
| return performScale(image); | return performScale(image); | ||||
| @@ -163,7 +164,8 @@ public class Scale extends TransformOperation implements DrawOperation { | |||||
| /** {@inheritDoc}. */ | /** {@inheritDoc}. */ | ||||
| public PlanarImage executeDrawOperation() { | public PlanarImage executeDrawOperation() { | ||||
| for (int i = 0; i < instructions.size(); i++) { | |||||
| final int size = instructions.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| ImageOperation instr = ((ImageOperation) instructions.elementAt(i)); | ImageOperation instr = ((ImageOperation) instructions.elementAt(i)); | ||||
| if (instr instanceof DrawOperation) { | if (instr instanceof DrawOperation) { | ||||
| PlanarImage image = null; | PlanarImage image = null; | ||||
| @@ -753,7 +753,8 @@ public class FileUtils { | |||||
| } | } | ||||
| } | } | ||||
| StringBuffer sb = new StringBuffer(); | StringBuffer sb = new StringBuffer(); | ||||
| for (int i = 0; i < s.size(); i++) { | |||||
| final int size = s.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| if (i > 1) { | if (i > 1) { | ||||
| // not before the filesystem root and not after it, since root | // not before the filesystem root and not after it, since root | ||||
| // already contains one | // already contains one | ||||
| @@ -77,7 +77,8 @@ public class IdentityStack extends Stack { | |||||
| * @see java.util.Vector#indexOf(Object, int) | * @see java.util.Vector#indexOf(Object, int) | ||||
| */ | */ | ||||
| public synchronized int indexOf(Object o, int pos) { | public synchronized int indexOf(Object o, int pos) { | ||||
| for (int i = pos; i < size(); i++) { | |||||
| final int size = size(); | |||||
| for (int i = pos; i < size; i++) { | |||||
| if (get(i) == o) { | if (get(i) == o) { | ||||
| return i; | return i; | ||||
| } | } | ||||
| @@ -207,7 +207,8 @@ public class LayoutPreservingProperties extends Properties { | |||||
| (LayoutPreservingProperties) super.clone(); | (LayoutPreservingProperties) super.clone(); | ||||
| dolly.keyedPairLines = (HashMap) this.keyedPairLines.clone(); | dolly.keyedPairLines = (HashMap) this.keyedPairLines.clone(); | ||||
| dolly.logicalLines = (ArrayList) this.logicalLines.clone(); | dolly.logicalLines = (ArrayList) this.logicalLines.clone(); | ||||
| for (int j = 0; j < dolly.logicalLines.size(); j++) { | |||||
| final int size = dolly.logicalLines.size(); | |||||
| for (int j = 0; j < size; j++) { | |||||
| LogicalLine line = (LogicalLine) dolly.logicalLines.get(j); | LogicalLine line = (LogicalLine) dolly.logicalLines.get(j); | ||||
| if (line instanceof Pair) { | if (line instanceof Pair) { | ||||
| Pair p = (Pair) line; | Pair p = (Pair) line; | ||||
| @@ -328,7 +328,8 @@ public class MailMessage { | |||||
| // "Header fields are NOT required to occur in any particular order, | // "Header fields are NOT required to occur in any particular order, | ||||
| // except that the message body MUST occur AFTER the headers" | // except that the message body MUST occur AFTER the headers" | ||||
| // (the same section specifies a reccommended order, which we ignore) | // (the same section specifies a reccommended order, which we ignore) | ||||
| for (int i = 0; i < headersKeys.size(); i++) { | |||||
| final int size = headersKeys.size(); | |||||
| for (int i = 0; i < size; i++) { | |||||
| String name = (String) headersKeys.elementAt(i); | String name = (String) headersKeys.elementAt(i); | ||||
| String value = (String) headersValues.elementAt(i); | String value = (String) headersValues.elementAt(i); | ||||
| out.println(name + ": " + value); | out.println(name + ": " + value); | ||||