| @@ -510,7 +510,7 @@ public class AntClassLoader extends ClassLoader implements SubBuildListener, Clo | |||||
| pathMap.put(absPathPlusTimeAndLength, classpath); | pathMap.put(absPathPlusTimeAndLength, classpath); | ||||
| } | } | ||||
| if (!"".equals(classpath)) { | |||||
| if (!classpath.isEmpty()) { | |||||
| final URL baseURL = FILE_UTILS.getFileURL(pathComponent); | final URL baseURL = FILE_UTILS.getFileURL(pathComponent); | ||||
| final StringTokenizer st = new StringTokenizer(classpath); | final StringTokenizer st = new StringTokenizer(classpath); | ||||
| while (st.hasMoreTokens()) { | while (st.hasMoreTokens()) { | ||||
| @@ -836,7 +836,7 @@ public class ComponentHelper { | |||||
| */ | */ | ||||
| private synchronized void checkNamespace(String componentName) { | private synchronized void checkNamespace(String componentName) { | ||||
| String uri = ProjectHelper.extractUriFromComponentName(componentName); | String uri = ProjectHelper.extractUriFromComponentName(componentName); | ||||
| if ("".equals(uri)) { | |||||
| if (uri.isEmpty()) { | |||||
| uri = ProjectHelper.ANT_CORE_URI; | uri = ProjectHelper.ANT_CORE_URI; | ||||
| } | } | ||||
| if (!uri.startsWith(ProjectHelper.ANTLIB_URI)) { | if (!uri.startsWith(ProjectHelper.ANTLIB_URI)) { | ||||
| @@ -380,7 +380,7 @@ public final class IntrospectionHelper { | |||||
| final String uriPlusPrefix = ProjectHelper.extractUriFromComponentName(attributeName); | final String uriPlusPrefix = ProjectHelper.extractUriFromComponentName(attributeName); | ||||
| final String uri = ProjectHelper.extractUriFromComponentName(uriPlusPrefix); | final String uri = ProjectHelper.extractUriFromComponentName(uriPlusPrefix); | ||||
| final String localName = ProjectHelper.extractNameFromComponentName(attributeName); | final String localName = ProjectHelper.extractNameFromComponentName(attributeName); | ||||
| final String qName = "".equals(uri) ? localName : uri + ":" + localName; | |||||
| final String qName = uri.isEmpty() ? localName : uri + ":" + localName; | |||||
| dc.setDynamicAttribute(uri, localName, qName, value.toString()); | dc.setDynamicAttribute(uri, localName, qName, value.toString()); | ||||
| return; | return; | ||||
| } | } | ||||
| @@ -1181,7 +1181,7 @@ public class Main implements AntMain { | |||||
| for (final Target currentTarget : ptargets.values()) { | for (final Target currentTarget : ptargets.values()) { | ||||
| final String targetName = currentTarget.getName(); | final String targetName = currentTarget.getName(); | ||||
| if ("".equals(targetName)) { | |||||
| if (targetName.isEmpty()) { | |||||
| continue; | continue; | ||||
| } | } | ||||
| final String targetDescription = currentTarget.getDescription(); | final String targetDescription = currentTarget.getDescription(); | ||||
| @@ -301,7 +301,7 @@ public class Target implements TaskContainer { | |||||
| * @since 1.6.2 | * @since 1.6.2 | ||||
| */ | */ | ||||
| public String getIf() { | public String getIf() { | ||||
| return "".equals(ifString) ? null : ifString; | |||||
| return ifString.isEmpty() ? null : ifString; | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -354,7 +354,7 @@ public class Target implements TaskContainer { | |||||
| * @since 1.6.2 | * @since 1.6.2 | ||||
| */ | */ | ||||
| public String getUnless() { | public String getUnless() { | ||||
| return "".equals(unlessString) ? null : unlessString; | |||||
| return unlessString.isEmpty() ? null : unlessString; | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -1060,7 +1060,7 @@ public class ProjectHelper2 extends ProjectHelper { | |||||
| } | } | ||||
| String projectName = context.getCurrentProjectName(); | String projectName = context.getCurrentProjectName(); | ||||
| if ("".equals(projectName)) { | |||||
| if (projectName != null && projectName.isEmpty()) { | |||||
| projectName = null; | projectName = null; | ||||
| } | } | ||||
| @@ -67,6 +67,6 @@ public class MultipleChoiceInputRequest extends InputRequest { | |||||
| @Override | @Override | ||||
| public boolean isInputValid() { | public boolean isInputValid() { | ||||
| return choices.contains(getInput()) | return choices.contains(getInput()) | ||||
| || ("".equals(getInput()) && getDefaultValue() != null); | |||||
| || (getInput().isEmpty() && getDefaultValue() != null); | |||||
| } | } | ||||
| } | } | ||||
| @@ -223,7 +223,7 @@ public abstract class ArchiveFileSet extends FileSet { | |||||
| */ | */ | ||||
| public void setPrefix(String prefix) { | public void setPrefix(String prefix) { | ||||
| checkArchiveAttributesAllowed(); | checkArchiveAttributesAllowed(); | ||||
| if (!"".equals(prefix) && !"".equals(fullpath)) { | |||||
| if (!prefix.isEmpty() && !fullpath.isEmpty()) { | |||||
| throw new BuildException(ERROR_PATH_AND_PREFIX); | throw new BuildException(ERROR_PATH_AND_PREFIX); | ||||
| } | } | ||||
| this.prefix = prefix; | this.prefix = prefix; | ||||
| @@ -250,7 +250,7 @@ public abstract class ArchiveFileSet extends FileSet { | |||||
| */ | */ | ||||
| public void setFullpath(String fullpath) { | public void setFullpath(String fullpath) { | ||||
| checkArchiveAttributesAllowed(); | checkArchiveAttributesAllowed(); | ||||
| if (!"".equals(prefix) && !"".equals(fullpath)) { | |||||
| if (!prefix.isEmpty() && !fullpath.isEmpty()) { | |||||
| throw new BuildException(ERROR_PATH_AND_PREFIX); | throw new BuildException(ERROR_PATH_AND_PREFIX); | ||||
| } | } | ||||
| this.fullpath = fullpath; | this.fullpath = fullpath; | ||||
| @@ -277,7 +277,7 @@ public abstract class ArchiveScanner extends DirectoryScanner { | |||||
| if (src == null) { | if (src == null) { | ||||
| return super.getResource(name); | return super.getResource(name); | ||||
| } | } | ||||
| if ("".equals(name)) { | |||||
| if (name.isEmpty()) { | |||||
| // special case in ZIPs, we do not want this thing included | // special case in ZIPs, we do not want this thing included | ||||
| return new Resource("", true, Long.MAX_VALUE, true); | return new Resource("", true, Long.MAX_VALUE, true); | ||||
| } | } | ||||
| @@ -333,7 +333,7 @@ public class Permissions { | |||||
| final StringTokenizer tk = new StringTokenizer(actions, ","); | final StringTokenizer tk = new StringTokenizer(actions, ","); | ||||
| while (tk.hasMoreTokens()) { | while (tk.hasMoreTokens()) { | ||||
| final String item = tk.nextToken().trim(); | final String item = tk.nextToken().trim(); | ||||
| if (!"".equals(item)) { | |||||
| if (!item.isEmpty()) { | |||||
| result.add(item); | result.add(item); | ||||
| } | } | ||||
| } | } | ||||
| @@ -183,7 +183,7 @@ public class URLResource extends Resource implements URLProvider { | |||||
| return getCheckedRef().getName(); | return getCheckedRef().getName(); | ||||
| } | } | ||||
| String name = getURL().getFile(); | String name = getURL().getFile(); | ||||
| return "".equals(name) ? name : name.substring(1); | |||||
| return name.isEmpty() ? name : name.substring(1); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -315,7 +315,7 @@ public class DOMElementWriter { | |||||
| nsPrefixMap.put(uri, prefix); | nsPrefixMap.put(uri, prefix); | ||||
| addNSDefinition(element, uri); | addNSDefinition(element, uri); | ||||
| } | } | ||||
| if (!"".equals(prefix)) { | |||||
| if (!prefix.isEmpty()) { | |||||
| out.write(prefix); | out.write(prefix); | ||||
| out.write(":"); | out.write(":"); | ||||
| } | } | ||||
| @@ -350,7 +350,7 @@ public class DOMElementWriter { | |||||
| for (String uri : uris) { | for (String uri : uris) { | ||||
| String prefix = nsPrefixMap.get(uri); | String prefix = nsPrefixMap.get(uri); | ||||
| out.write(" xmlns"); | out.write(" xmlns"); | ||||
| if (!"".equals(prefix)) { | |||||
| if (!prefix.isEmpty()) { | |||||
| out.write(":"); | out.write(":"); | ||||
| out.write(prefix); | out.write(prefix); | ||||
| } | } | ||||
| @@ -77,7 +77,7 @@ public class XMLFragment extends ProjectComponent implements DynamicElementNS { | |||||
| @Override | @Override | ||||
| public Object createDynamicElement(String uri, String name, String qName) { | public Object createDynamicElement(String uri, String name, String qName) { | ||||
| Element e; | Element e; | ||||
| if ("".equals(uri)) { | |||||
| if (uri.isEmpty()) { | |||||
| e = doc.createElement(name); | e = doc.createElement(name); | ||||
| } else { | } else { | ||||
| e = doc.createElementNS(uri, qName); | e = doc.createElementNS(uri, qName); | ||||
| @@ -128,7 +128,7 @@ public class XMLFragment extends ProjectComponent implements DynamicElementNS { | |||||
| @Override | @Override | ||||
| public void setDynamicAttribute( | public void setDynamicAttribute( | ||||
| String uri, String name, String qName, String value) { | String uri, String name, String qName, String value) { | ||||
| if ("".equals(uri)) { | |||||
| if (uri.isEmpty()) { | |||||
| e.setAttribute(name, value); | e.setAttribute(name, value); | ||||
| } else { | } else { | ||||
| e.setAttributeNS(uri, qName, value); | e.setAttributeNS(uri, qName, value); | ||||
| @@ -145,7 +145,7 @@ public class XMLFragment extends ProjectComponent implements DynamicElementNS { | |||||
| @Override | @Override | ||||
| public Object createDynamicElement(String uri, String name, String qName) { | public Object createDynamicElement(String uri, String name, String qName) { | ||||
| Element e2 = null; | Element e2 = null; | ||||
| if ("".equals(uri)) { | |||||
| if (uri.isEmpty()) { | |||||
| e2 = doc.createElement(name); | e2 = doc.createElement(name); | ||||
| } else { | } else { | ||||
| e2 = doc.createElementNS(uri, qName); | e2 = doc.createElementNS(uri, qName); | ||||
| @@ -488,7 +488,7 @@ public class DefaultCompilerAdapterTest { | |||||
| sth.setJavac(javac); | sth.setJavac(javac); | ||||
| Commandline cmd = new Commandline(); | Commandline cmd = new Commandline(); | ||||
| sth.setupModernJavacCommandlineSwitches(cmd); | sth.setupModernJavacCommandlineSwitches(cmd); | ||||
| if ("".equals(expectedLog)) { | |||||
| if (expectedLog.isEmpty()) { | |||||
| assertEquals("", javac.getLog()); | assertEquals("", javac.getLog()); | ||||
| } else { | } else { | ||||
| String l = javac.getLog(); | String l = javac.getLog(); | ||||