This closes #61 pull request at github/apache/ant repomaster
| @@ -850,7 +850,7 @@ public class ComponentHelper { | |||||
| } | } | ||||
| checkedNamespaces.add(uri); | checkedNamespaces.add(uri); | ||||
| if (antTypeTable.size() == 0) { | |||||
| if (antTypeTable.isEmpty()) { | |||||
| // Project instance doesn't know the tasks and types | // Project instance doesn't know the tasks and types | ||||
| // defined in defaults.properties, likely created by the | // defined in defaults.properties, likely created by the | ||||
| // user - without those definitions it cannot parse antlib | // user - without those definitions it cannot parse antlib | ||||
| @@ -840,7 +840,7 @@ public class Main implements AntMain { | |||||
| } | } | ||||
| // make sure that we have a target to execute | // make sure that we have a target to execute | ||||
| if (targets.size() == 0) { | |||||
| if (targets.isEmpty()) { | |||||
| if (project.getDefaultTarget() != null) { | if (project.getDefaultTarget() != null) { | ||||
| targets.addElement(project.getDefaultTarget()); | targets.addElement(project.getDefaultTarget()); | ||||
| } | } | ||||
| @@ -377,7 +377,7 @@ public class AntXMLContext { | |||||
| */ | */ | ||||
| public void endPrefixMapping(String prefix) { | public void endPrefixMapping(String prefix) { | ||||
| List<String> list = prefixMapping.get(prefix); | List<String> list = prefixMapping.get(prefix); | ||||
| if (list == null || list.size() == 0) { | |||||
| if (list == null || list.isEmpty()) { | |||||
| return; // Should not happen | return; // Should not happen | ||||
| } | } | ||||
| list.remove(list.size() - 1); | list.remove(list.size() - 1); | ||||
| @@ -391,7 +391,7 @@ public class AntXMLContext { | |||||
| */ | */ | ||||
| public String getPrefixMapping(String prefix) { | public String getPrefixMapping(String prefix) { | ||||
| List<String> list = prefixMapping.get(prefix); | List<String> list = prefixMapping.get(prefix); | ||||
| if (list == null || list.size() == 0) { | |||||
| if (list == null || list.isEmpty()) { | |||||
| return null; | return null; | ||||
| } | } | ||||
| return (String) list.get(list.size() - 1); | return (String) list.get(list.size() - 1); | ||||
| @@ -468,7 +468,7 @@ public class CvsTagDiff extends AbstractCvsTask { | |||||
| * @exception BuildException if a parameter is not correctly set | * @exception BuildException if a parameter is not correctly set | ||||
| */ | */ | ||||
| private void validate() throws BuildException { | private void validate() throws BuildException { | ||||
| if (null == mypackage && getModules().size() == 0) { | |||||
| if (null == mypackage && getModules().isEmpty()) { | |||||
| throw new BuildException("Package/module must be set."); | throw new BuildException("Package/module must be set."); | ||||
| } | } | ||||
| @@ -288,7 +288,7 @@ public class XMLValidateTask extends Task { | |||||
| public void execute() throws BuildException { | public void execute() throws BuildException { | ||||
| try { | try { | ||||
| int fileProcessed = 0; | int fileProcessed = 0; | ||||
| if (file == null && (filesets.size() == 0)) { | |||||
| if (file == null && (filesets.isEmpty())) { | |||||
| throw new BuildException( | throw new BuildException( | ||||
| "Specify at least one source - " + "a file or a fileset."); | "Specify at least one source - " + "a file or a fileset."); | ||||
| } | } | ||||
| @@ -739,7 +739,7 @@ public class IntrospectionHelperTest { | |||||
| public void addConfigured(Map m) { | public void addConfigured(Map m) { | ||||
| // Valid extension point | // Valid extension point | ||||
| assertTrue(m.size() == 0); | |||||
| assertTrue(m.isEmpty()); | |||||
| } | } | ||||
| public void addConfigured(Hashtable h) { | public void addConfigured(Hashtable h) { | ||||