git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@565093 13f79535-47bb-0310-9956-ffa450edef68master
@@ -370,7 +370,7 @@ public class FilterSet extends DataType implements Cloneable { | |||||
} | } | ||||
} catch (Exception ex) { | } catch (Exception ex) { | ||||
throw new BuildException("Could not read filters from file: " | throw new BuildException("Could not read filters from file: " | ||||
+ filtersFile,ex); | |||||
+ filtersFile, ex); | |||||
} finally { | } finally { | ||||
FileUtils.close(in); | FileUtils.close(in); | ||||
} | } | ||||
@@ -143,7 +143,7 @@ public class PatternSet extends DataType implements Cloneable { | |||||
} | } | ||||
} | } | ||||
private static class InvertedPatternSet extends PatternSet { | |||||
private static final class InvertedPatternSet extends PatternSet { | |||||
private InvertedPatternSet(PatternSet p) { | private InvertedPatternSet(PatternSet p) { | ||||
setProject(p.getProject()); | setProject(p.getProject()); | ||||
addConfiguredPatternset(p); | addConfiguredPatternset(p); | ||||
@@ -503,7 +503,7 @@ public class PatternSet extends DataType implements Cloneable { | |||||
/** | /** | ||||
* Add an inverted patternset. | * Add an inverted patternset. | ||||
* | |||||
* @param p the pattern to invert and add. | |||||
*/ | */ | ||||
public void addConfiguredInvert(PatternSet p) { | public void addConfiguredInvert(PatternSet p) { | ||||
addConfiguredPatternset(new InvertedPatternSet(p)); | addConfiguredPatternset(new InvertedPatternSet(p)); | ||||
@@ -53,7 +53,7 @@ public class Permissions { | |||||
private boolean delegateToOldSM; | private boolean delegateToOldSM; | ||||
// Mandatory constructor for permission object. | // Mandatory constructor for permission object. | ||||
private static final Class[] PARAMS = { String.class, String.class }; | |||||
private static final Class[] PARAMS = {String.class, String.class}; | |||||
/** | /** | ||||
* Create a set of Permissions. Equivalent to calling | * Create a set of Permissions. Equivalent to calling | ||||
@@ -27,7 +27,6 @@ import java.util.zip.ZipException; | |||||
import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
import org.apache.tools.ant.types.resources.FileResource; | import org.apache.tools.ant.types.resources.FileResource; | ||||
import org.apache.tools.ant.types.resources.ZipResource; | import org.apache.tools.ant.types.resources.ZipResource; | ||||
import org.apache.tools.ant.util.FileUtils; | |||||
import org.apache.tools.zip.ZipEntry; | import org.apache.tools.zip.ZipEntry; | ||||
import org.apache.tools.zip.ZipFile; | import org.apache.tools.zip.ZipFile; | ||||
@@ -42,7 +42,9 @@ public class Last extends SizeLimitCollection { | |||||
int i = count; | int i = count; | ||||
Iterator iter = rc.iterator(); | Iterator iter = rc.iterator(); | ||||
int size = rc.size(); | int size = rc.size(); | ||||
for (; i < size; i++) iter.next(); | |||||
for (; i < size; i++) { | |||||
iter.next(); | |||||
} | |||||
ArrayList al = new ArrayList(count); | ArrayList al = new ArrayList(count); | ||||
for (; iter.hasNext(); i++) { | for (; iter.hasNext(); i++) { | ||||
@@ -124,6 +124,9 @@ public final class SelectorUtils { | |||||
strIdxStart++; | strIdxStart++; | ||||
} | } | ||||
// CheckStyle:SimplifyBooleanReturnCheck OFF | |||||
// Check turned off as the code needs the comments for the various | |||||
// code paths. | |||||
if (strIdxStart > strIdxEnd) { | if (strIdxStart > strIdxEnd) { | ||||
// String is exhausted | // String is exhausted | ||||
return true; | return true; | ||||
@@ -102,7 +102,8 @@ public class ClasspathUtils { | |||||
* classloader behaviour) | * classloader behaviour) | ||||
* @return The class loader | * @return The class loader | ||||
*/ | */ | ||||
public static ClassLoader getClassLoaderForPath(Project p, Reference ref, boolean reverseLoader) { | |||||
public static ClassLoader getClassLoaderForPath( | |||||
Project p, Reference ref, boolean reverseLoader) { | |||||
String pathId = ref.getRefId(); | String pathId = ref.getRefId(); | ||||
Object path = p.getReference(pathId); | Object path = p.getReference(pathId); | ||||
if (!(path instanceof Path)) { | if (!(path instanceof Path)) { | ||||
@@ -423,8 +424,11 @@ public class ClasspathUtils { | |||||
* @return a loader identifier. | * @return a loader identifier. | ||||
*/ | */ | ||||
public String getClassLoadId() { | public String getClassLoadId() { | ||||
return loaderId == null && classpathId != null ? MagicNames.REFID_CLASSPATH_LOADER_PREFIX | |||||
+ classpathId : loaderId; | |||||
if (loaderId == null && classpathId != null) { | |||||
return MagicNames.REFID_CLASSPATH_LOADER_PREFIX + classpathId; | |||||
} else { | |||||
return loaderId; | |||||
} | |||||
} | } | ||||
/** | /** | ||||
@@ -18,7 +18,6 @@ | |||||
package org.apache.tools.ant.util; | package org.apache.tools.ant.util; | ||||
import java.util.StringTokenizer; | import java.util.StringTokenizer; | ||||
import java.util.Arrays; | |||||
/** | /** | ||||
* Utility class to contain version numbers in "Dewey Decimal" | * Utility class to contain version numbers in "Dewey Decimal" | ||||
@@ -59,7 +59,7 @@ public class ScriptRunnerHelper { | |||||
if (text != null) { | if (text != null) { | ||||
runner.addText(text); | runner.addText(text); | ||||
} | } | ||||
if (resources !=null) { | |||||
if (resources != null) { | |||||
runner.loadResources(resources); | runner.loadResources(resources); | ||||
} | } | ||||
if (setBeans) { | if (setBeans) { | ||||