You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2018/02/02 05:22:16 UTC
[1/6] ant git commit: user actual version of simian
Repository: ant
Updated Branches:
refs/heads/master 14bd7590f -> 32d178ffe
user actual version of simian
Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/4ffebc6a
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/4ffebc6a
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/4ffebc6a
Branch: refs/heads/master
Commit: 4ffebc6a12a8eb68384e0d8e4d7f2eea9656c3a0
Parents: 5892ab0
Author: Jan Matèrne <jh...@apache.org>
Authored: Sun Jan 28 12:51:38 2018 +0100
Committer: Jan Matèrne <jh...@apache.org>
Committed: Sun Jan 28 12:55:28 2018 +0100
----------------------------------------------------------------------
check.xml | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ant/blob/4ffebc6a/check.xml
----------------------------------------------------------------------
diff --git a/check.xml b/check.xml
index 83e16a5..52f3fb3 100644
--- a/check.xml
+++ b/check.xml
@@ -91,7 +91,7 @@
<!-- Simian -->
<property name="simian.version"
- value="2.4.0"
+ value="2.5.8"
description="Which Version of Simian to use"/>
<property name="simian.uri"
value="http://www.harukizaemon.com/simian/simian-${simian.version}.tar.gz"
@@ -202,7 +202,17 @@
<mkdir dir="${simian.report.dir}"/>
<simian failureProperty="simian.duplicates.found">
<fileset dir="${java.dir}" />
+ <!--
+ Having both formatters defined results in a
+ java.lang.UnsupportedOperationException
+ at java.util.AbstractList.add(Unknown Source)
+ at java.util.AbstractList.add(Unknown Source)
+ at com.harukizaemon.simian.CompositeAuditListener.add(Unknown Source)
+ at com.harukizaemon.simian.SimianTask.A(Unknown Source)
+ at com.harukizaemon.simian.SimianTask.B(Unknown Source)
+ at com.harukizaemon.simian.SimianTask.execute(Unknown Source)
<formatter type="plain" toFile="${simian.report.dir}/simian-log.txt"/>
+ -->
<formatter type="xml" toFile="${simian.report.dir}/simian-log.xml"/>
</simian>
<xslt in="${simian.report.dir}/simian-log.xml" style="${simian.lib.dir}/simian.xsl" out="${simian.report.dir}/simian.html"/>
[5/6] ant git commit: swap constant string and variable in some
equals ops
Posted by bo...@apache.org.
swap constant string and variable in some equals ops
this is a stripped down version of #56 as `isEmpty` is not available
in Java5.
Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/b38faab1
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/b38faab1
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/b38faab1
Branch: refs/heads/master
Commit: b38faab1cc70bd7529c0ba073f5e53f8f85f7e71
Parents: 76933d2
Author: Stefan Bodewig <bo...@apache.org>
Authored: Fri Feb 2 06:19:33 2018 +0100
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Fri Feb 2 06:19:33 2018 +0100
----------------------------------------------------------------------
.../apache/tools/ant/helper/ProjectHelper2.java | 26 ++++++++++----------
.../tools/ant/helper/ProjectHelperImpl.java | 26 ++++++++++----------
.../tools/ant/taskdefs/optional/net/FTP.java | 4 +--
3 files changed, 28 insertions(+), 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ant/blob/b38faab1/src/main/org/apache/tools/ant/helper/ProjectHelper2.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/helper/ProjectHelper2.java b/src/main/org/apache/tools/ant/helper/ProjectHelper2.java
index 6ae2d32..34dfde3 100644
--- a/src/main/org/apache/tools/ant/helper/ProjectHelper2.java
+++ b/src/main/org/apache/tools/ant/helper/ProjectHelper2.java
@@ -656,7 +656,7 @@ public class ProjectHelper2 extends ProjectHelper {
*/
public AntHandler onStartChild(String uri, String name, String qname, Attributes attrs,
AntXMLContext context) throws SAXParseException {
- if (name.equals("project")
+ if ("project".equals(name)
&& (uri.equals("") || uri.equals(ANT_CORE_URI))) {
return ProjectHelper2.projectHandler;
}
@@ -721,13 +721,13 @@ public class ProjectHelper2 extends ProjectHelper {
String key = attrs.getLocalName(i);
String value = attrs.getValue(i);
- if (key.equals("default")) {
+ if ("default".equals(key)) {
if (value != null && !value.equals("")) {
if (!context.isIgnoringProjectTag()) {
project.setDefault(value);
}
}
- } else if (key.equals("name")) {
+ } else if ("name".equals(key)) {
if (value != null) {
context.setCurrentProjectName(value);
nameAttributeSet = true;
@@ -742,14 +742,14 @@ public class ProjectHelper2 extends ProjectHelper {
}
}
}
- } else if (key.equals("id")) {
+ } else if ("id".equals(key)) {
if (value != null) {
// What's the difference between id and name ?
if (!context.isIgnoringProjectTag()) {
project.addReference(value, project);
}
}
- } else if (key.equals("basedir")) {
+ } else if ("basedir".equals(key)) {
if (!context.isIgnoringProjectTag()) {
baseDir = value;
}
@@ -904,26 +904,26 @@ public class ProjectHelper2 extends ProjectHelper {
String key = attrs.getLocalName(i);
String value = attrs.getValue(i);
- if (key.equals("name")) {
+ if ("name".equals(key)) {
name = value;
if ("".equals(name)) {
throw new BuildException("name attribute must " + "not be empty");
}
- } else if (key.equals("depends")) {
+ } else if ("depends".equals(key)) {
depends = value;
- } else if (key.equals("if")) {
+ } else if ("if".equals(key)) {
target.setIf(value);
- } else if (key.equals("unless")) {
+ } else if ("unless".equals(key)) {
target.setUnless(value);
- } else if (key.equals("id")) {
+ } else if ("id".equals(key)) {
if (value != null && !value.equals("")) {
context.getProject().addReference(value, target);
}
- } else if (key.equals("description")) {
+ } else if ("description".equals(key)) {
target.setDescription(value);
- } else if (key.equals("extensionOf")) {
+ } else if ("extensionOf".equals(key)) {
extensionPoint = value;
- } else if (key.equals("onMissingExtensionPoint")) {
+ } else if ("onMissingExtensionPoint".equals(key)) {
try {
extensionPointMissing = OnMissingExtensionPoint.valueOf(value);
} catch (IllegalArgumentException e) {
http://git-wip-us.apache.org/repos/asf/ant/blob/b38faab1/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java b/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java
index ebed3a2..4b159f3 100644
--- a/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java
+++ b/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java
@@ -327,7 +327,7 @@ public class ProjectHelperImpl extends ProjectHelper {
* <code>"project"</code>
*/
public void startElement(String tag, AttributeList attrs) throws SAXParseException {
- if (tag.equals("project")) {
+ if ("project".equals(tag)) {
new ProjectHandler(helperImpl, this).init(tag, attrs);
} else {
throw new SAXParseException("Config file is not of expected " + "XML type",
@@ -388,13 +388,13 @@ public class ProjectHelperImpl extends ProjectHelper {
String key = attrs.getName(i);
String value = attrs.getValue(i);
- if (key.equals("default")) {
+ if ("default".equals(key)) {
def = value;
- } else if (key.equals("name")) {
+ } else if ("name".equals(key)) {
name = value;
- } else if (key.equals("id")) {
+ } else if ("id".equals(key)) {
id = value;
- } else if (key.equals("basedir")) {
+ } else if ("basedir".equals(key)) {
baseDir = value;
} else {
throw new SAXParseException(
@@ -454,7 +454,7 @@ public class ProjectHelperImpl extends ProjectHelper {
* or a data type definition
*/
public void startElement(String name, AttributeList attrs) throws SAXParseException {
- if (name.equals("target")) {
+ if ("target".equals(name)) {
handleTarget(name, attrs);
} else {
handleElement(helperImpl, this, helperImpl.implicitTarget, name, attrs);
@@ -524,21 +524,21 @@ public class ProjectHelperImpl extends ProjectHelper {
String key = attrs.getName(i);
String value = attrs.getValue(i);
- if (key.equals("name")) {
+ if ("name".equals(key)) {
name = value;
if (name.equals("")) {
throw new BuildException("name attribute must not" + " be empty",
new Location(helperImpl.locator));
}
- } else if (key.equals("depends")) {
+ } else if ("depends".equals(key)) {
depends = value;
- } else if (key.equals("if")) {
+ } else if ("if".equals(key)) {
ifCond = value;
- } else if (key.equals("unless")) {
+ } else if ("unless".equals(key)) {
unlessCond = value;
- } else if (key.equals("id")) {
+ } else if ("id".equals(key)) {
id = value;
- } else if (key.equals("description")) {
+ } else if ("description".equals(key)) {
description = value;
} else {
throw new SAXParseException("Unexpected attribute \"" + key + "\"",
@@ -599,7 +599,7 @@ public class ProjectHelperImpl extends ProjectHelper {
*/
private static void handleElement(ProjectHelperImpl helperImpl, DocumentHandler parent,
Target target, String elementName, AttributeList attrs) throws SAXParseException {
- if (elementName.equals("description")) {
+ if ("description".equals(elementName)) {
// created for side effect
new DescriptionHandler(helperImpl, parent); //NOSONAR
} else if (helperImpl.project.getDataTypeDefinitions().get(elementName) != null) {
http://git-wip-us.apache.org/repos/asf/ant/blob/b38faab1/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java b/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java
index 13b418d..c552344 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java
@@ -508,8 +508,8 @@ public class FTP extends Task implements FTPTaskConfig {
for (int i = 0; i < newfiles.length; i++) {
FTPFile file = newfiles[i];
if (file != null
- && !file.getName().equals(".")
- && !file.getName().equals("..")) {
+ && !".".equals(file.getName())
+ && !"..".equals(file.getName())) {
String name = vpath + file.getName();
scannedDirs.put(name, new FTPFileProxy(file));
if (isFunctioningAsDirectory(ftp, dir, file)) {
[2/6] ant git commit: whatsnew += Log4jListener is deprecated (breaks
BWC)
Posted by bo...@apache.org.
whatsnew += Log4jListener is deprecated (breaks BWC)
Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/49eefb1c
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/49eefb1c
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/49eefb1c
Branch: refs/heads/master
Commit: 49eefb1c988e9a12b5cb8e4aa310a18c021b4fec
Parents: 4ffebc6
Author: Jan Matèrne <jh...@apache.org>
Authored: Sun Jan 28 13:30:28 2018 +0100
Committer: Jan Matèrne <jh...@apache.org>
Committed: Sun Jan 28 13:31:38 2018 +0100
----------------------------------------------------------------------
WHATSNEW | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ant/blob/49eefb1c/WHATSNEW
----------------------------------------------------------------------
diff --git a/WHATSNEW b/WHATSNEW
index 235e723..1430c8d 100644
--- a/WHATSNEW
+++ b/WHATSNEW
@@ -1,6 +1,9 @@
Changes from Ant 1.9.9 TO Ant 1.9.10
====================================
+ * The Log4jListener is marked as deprecated as the required log4j library
+ (in version 1.x) is not maintained any more.
+
Fixed bugs:
-----------
[3/6] ant git commit: update to latest Simian (fixed the multi
formatter issue)
Posted by bo...@apache.org.
update to latest Simian (fixed the multi formatter issue)
Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/76933d2e
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/76933d2e
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/76933d2e
Branch: refs/heads/master
Commit: 76933d2e2835b5083f264ce33bdc0f4132c6e68c
Parents: 49eefb1
Author: Jan Matèrne <jh...@apache.org>
Authored: Tue Jan 30 06:58:13 2018 +0100
Committer: Jan Matèrne <jh...@apache.org>
Committed: Tue Jan 30 06:59:31 2018 +0100
----------------------------------------------------------------------
check.xml | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ant/blob/76933d2e/check.xml
----------------------------------------------------------------------
diff --git a/check.xml b/check.xml
index 52f3fb3..b5a6586 100644
--- a/check.xml
+++ b/check.xml
@@ -91,7 +91,7 @@
<!-- Simian -->
<property name="simian.version"
- value="2.5.8"
+ value="2.5.9"
description="Which Version of Simian to use"/>
<property name="simian.uri"
value="http://www.harukizaemon.com/simian/simian-${simian.version}.tar.gz"
@@ -182,6 +182,7 @@
<target name="simiancheck" description="--> runs the check for duplicates">
<available property="simian.jar.present" file="${simian.lib.dir}/simian-${simian.version}.jar"/>
<sequential unless:set="simian.jar.present">
+ <echo>Install Simian ${simian.version}</echo>
<mkdir dir="${simian.lib.dir}"/>
<get src="${simian.uri}" dest="${simian.lib.dir}"/>
<gunzip src="${simian.lib.dir}/simian-${simian.version}.tar.gz" dest="${simian.lib.dir}/simian-${simian.version}.tar"/>
@@ -194,6 +195,7 @@
</untar>
</sequential>
+ <echo>Run Simian</echo>
<taskdef resource="simiantask.properties">
<classpath>
<fileset dir="${simian.lib.dir}" includes="*.jar"/>
@@ -202,17 +204,7 @@
<mkdir dir="${simian.report.dir}"/>
<simian failureProperty="simian.duplicates.found">
<fileset dir="${java.dir}" />
- <!--
- Having both formatters defined results in a
- java.lang.UnsupportedOperationException
- at java.util.AbstractList.add(Unknown Source)
- at java.util.AbstractList.add(Unknown Source)
- at com.harukizaemon.simian.CompositeAuditListener.add(Unknown Source)
- at com.harukizaemon.simian.SimianTask.A(Unknown Source)
- at com.harukizaemon.simian.SimianTask.B(Unknown Source)
- at com.harukizaemon.simian.SimianTask.execute(Unknown Source)
<formatter type="plain" toFile="${simian.report.dir}/simian-log.txt"/>
- -->
<formatter type="xml" toFile="${simian.report.dir}/simian-log.xml"/>
</simian>
<xslt in="${simian.report.dir}/simian-log.xml" style="${simian.lib.dir}/simian.xsl" out="${simian.report.dir}/simian.html"/>
[6/6] ant git commit: Merge branch '1.9.x'
Posted by bo...@apache.org.
Merge branch '1.9.x'
closes #56
Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/32d178ff
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/32d178ff
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/32d178ff
Branch: refs/heads/master
Commit: 32d178ffe2ee813f2cc4b7860f64f9232c6aa161
Parents: 02e32f7 b38faab
Author: Stefan Bodewig <bo...@apache.org>
Authored: Fri Feb 2 06:21:54 2018 +0100
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Fri Feb 2 06:21:54 2018 +0100
----------------------------------------------------------------------
----------------------------------------------------------------------
[4/6] ant git commit: Use equals method of a string literal to
prevent NPE and isEmpty() method instead of comparing a String object with an
empty string.
Posted by bo...@apache.org.
Use equals method of a string literal to prevent NPE and isEmpty() method instead of comparing a String object with an empty string.
Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/02e32f76
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/02e32f76
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/02e32f76
Branch: refs/heads/master
Commit: 02e32f76ca0730eb46649d4e0c59c1945355221f
Parents: 14bd759
Author: reudismam <re...@gmail.com>
Authored: Thu Feb 1 14:03:19 2018 -0300
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Fri Feb 2 06:10:43 2018 +0100
----------------------------------------------------------------------
.../apache/tools/ant/helper/ProjectHelper2.java | 44 ++++++++++----------
.../tools/ant/helper/ProjectHelperImpl.java | 32 +++++++-------
.../optional/ejb/JonasDeploymentTool.java | 4 +-
.../tools/ant/taskdefs/optional/net/FTP.java | 8 ++--
4 files changed, 44 insertions(+), 44 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ant/blob/02e32f76/src/main/org/apache/tools/ant/helper/ProjectHelper2.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/helper/ProjectHelper2.java b/src/main/org/apache/tools/ant/helper/ProjectHelper2.java
index 268869d..61a696c 100644
--- a/src/main/org/apache/tools/ant/helper/ProjectHelper2.java
+++ b/src/main/org/apache/tools/ant/helper/ProjectHelper2.java
@@ -667,8 +667,8 @@ public class ProjectHelper2 extends ProjectHelper {
@Override
public AntHandler onStartChild(String uri, String name, String qname, Attributes attrs,
AntXMLContext context) throws SAXParseException {
- if (name.equals("project")
- && (uri.equals("") || uri.equals(ANT_CORE_URI))) {
+ if ("project".equals(name)
+ && (uri.isEmpty() || uri.equals(ANT_CORE_URI))) {
return ProjectHelper2.projectHandler;
}
if (name.equals(qname)) {
@@ -727,19 +727,19 @@ public class ProjectHelper2 extends ProjectHelper {
for (int i = 0; i < attrs.getLength(); i++) {
String attrUri = attrs.getURI(i);
- if (attrUri != null && !attrUri.equals("") && !attrUri.equals(uri)) {
+ if (attrUri != null && !attrUri.isEmpty() && !attrUri.equals(uri)) {
continue; // Ignore attributes from unknown uris
}
String key = attrs.getLocalName(i);
String value = attrs.getValue(i);
- if (key.equals("default")) {
- if (value != null && !value.equals("")) {
+ if ("default".equals(key)) {
+ if (value != null && !value.isEmpty()) {
if (!context.isIgnoringProjectTag()) {
project.setDefault(value);
}
}
- } else if (key.equals("name")) {
+ } else if ("name".equals(key)) {
if (value != null) {
context.setCurrentProjectName(value);
nameAttributeSet = true;
@@ -754,14 +754,14 @@ public class ProjectHelper2 extends ProjectHelper {
}
}
}
- } else if (key.equals("id")) {
+ } else if ("id".equals(key)) {
if (value != null) {
// What's the difference between id and name ?
if (!context.isIgnoringProjectTag()) {
project.addReference(value, project);
}
}
- } else if (key.equals("basedir")) {
+ } else if ("basedir".equals(key)) {
if (!context.isIgnoringProjectTag()) {
baseDir = value;
}
@@ -864,8 +864,8 @@ public class ProjectHelper2 extends ProjectHelper {
@Override
public AntHandler onStartChild(String uri, String name, String qname, Attributes attrs,
AntXMLContext context) throws SAXParseException {
- return (name.equals("target") || name.equals("extension-point"))
- && (uri.equals("") || uri.equals(ANT_CORE_URI))
+ return ("target".equals(name) || "extension-point".equals(name))
+ && (uri.isEmpty() || uri.equals(ANT_CORE_URI))
? ProjectHelper2.targetHandler : ProjectHelper2.elementHandler;
}
}
@@ -912,32 +912,32 @@ public class ProjectHelper2 extends ProjectHelper {
for (int i = 0; i < attrs.getLength(); i++) {
String attrUri = attrs.getURI(i);
- if (attrUri != null && !attrUri.equals("") && !attrUri.equals(uri)) {
+ if (attrUri != null && !attrUri.isEmpty() && !attrUri.equals(uri)) {
continue; // Ignore attributes from unknown uris
}
String key = attrs.getLocalName(i);
String value = attrs.getValue(i);
- if (key.equals("name")) {
+ if ("name".equals(key)) {
name = value;
- if ("".equals(name)) {
+ if (name.isEmpty()) {
throw new BuildException("name attribute must " + "not be empty");
}
- } else if (key.equals("depends")) {
+ } else if ("depends".equals(key)) {
depends = value;
- } else if (key.equals("if")) {
+ } else if ("if".equals(key)) {
target.setIf(value);
- } else if (key.equals("unless")) {
+ } else if ("unless".equals(key)) {
target.setUnless(value);
- } else if (key.equals("id")) {
- if (value != null && !value.equals("")) {
+ } else if ("id".equals(key)) {
+ if (value != null && !value.isEmpty()) {
context.getProject().addReference(value, target);
}
- } else if (key.equals("description")) {
+ } else if ("description".equals(key)) {
target.setDescription(value);
- } else if (key.equals("extensionOf")) {
+ } else if ("extensionOf".equals(key)) {
extensionPoint = value;
- } else if (key.equals("onMissingExtensionPoint")) {
+ } else if ("onMissingExtensionPoint".equals(key)) {
try {
extensionPointMissing = OnMissingExtensionPoint.valueOf(value);
} catch (IllegalArgumentException e) {
@@ -1167,7 +1167,7 @@ public class ProjectHelper2 extends ProjectHelper {
for (int i = 0; i < attrs.getLength(); i++) {
String name = attrs.getLocalName(i);
String attrUri = attrs.getURI(i);
- if (attrUri != null && !attrUri.equals("") && !attrUri.equals(uri)) {
+ if (attrUri != null && !attrUri.isEmpty() && !attrUri.equals(uri)) {
name = attrUri + ":" + attrs.getQName(i);
}
String value = attrs.getValue(i);
http://git-wip-us.apache.org/repos/asf/ant/blob/02e32f76/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java b/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java
index bb7a8bb..4b824ba 100644
--- a/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java
+++ b/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java
@@ -328,7 +328,7 @@ public class ProjectHelperImpl extends ProjectHelper {
* <code>"project"</code>
*/
public void startElement(String tag, AttributeList attrs) throws SAXParseException {
- if (tag.equals("project")) {
+ if ("project".equals(tag)) {
new ProjectHandler(helperImpl, this).init(tag, attrs);
} else {
throw new SAXParseException("Config file is not of expected " + "XML type",
@@ -389,13 +389,13 @@ public class ProjectHelperImpl extends ProjectHelper {
String key = attrs.getName(i);
String value = attrs.getValue(i);
- if (key.equals("default")) {
+ if ("default".equals(key)) {
def = value;
- } else if (key.equals("name")) {
+ } else if ("name".equals(key)) {
name = value;
- } else if (key.equals("id")) {
+ } else if ("id".equals(key)) {
id = value;
- } else if (key.equals("basedir")) {
+ } else if ("basedir".equals(key)) {
baseDir = value;
} else {
throw new SAXParseException(
@@ -404,7 +404,7 @@ public class ProjectHelperImpl extends ProjectHelper {
}
}
- if (def != null && !def.equals("")) {
+ if (def != null && !def.isEmpty()) {
helperImpl.project.setDefault(def);
} else {
throw new BuildException("The default attribute is required");
@@ -455,7 +455,7 @@ public class ProjectHelperImpl extends ProjectHelper {
* or a data type definition
*/
public void startElement(String name, AttributeList attrs) throws SAXParseException {
- if (name.equals("target")) {
+ if ("target".equals(name)) {
handleTarget(name, attrs);
} else {
handleElement(helperImpl, this, helperImpl.implicitTarget, name, attrs);
@@ -525,21 +525,21 @@ public class ProjectHelperImpl extends ProjectHelper {
String key = attrs.getName(i);
String value = attrs.getValue(i);
- if (key.equals("name")) {
+ if ("name".equals(key)) {
name = value;
- if (name.equals("")) {
+ if (name.isEmpty()) {
throw new BuildException("name attribute must not" + " be empty",
new Location(helperImpl.locator));
}
- } else if (key.equals("depends")) {
+ } else if ("depends".equals(key)) {
depends = value;
- } else if (key.equals("if")) {
+ } else if ("if".equals(key)) {
ifCond = value;
- } else if (key.equals("unless")) {
+ } else if ("unless".equals(key)) {
unlessCond = value;
- } else if (key.equals("id")) {
+ } else if ("id".equals(key)) {
id = value;
- } else if (key.equals("description")) {
+ } else if ("description".equals(key)) {
description = value;
} else {
throw new SAXParseException("Unexpected attribute \"" + key + "\"",
@@ -563,7 +563,7 @@ public class ProjectHelperImpl extends ProjectHelper {
target.setDescription(description);
helperImpl.project.addTarget(name, target);
- if (id != null && !id.equals("")) {
+ if (id != null && !id.isEmpty()) {
helperImpl.project.addReference(id, target);
}
@@ -600,7 +600,7 @@ public class ProjectHelperImpl extends ProjectHelper {
*/
private static void handleElement(ProjectHelperImpl helperImpl, DocumentHandler parent,
Target target, String elementName, AttributeList attrs) throws SAXParseException {
- if (elementName.equals("description")) {
+ if ("description".equals(elementName)) {
// created for side effect
new DescriptionHandler(helperImpl, parent); //NOSONAR
} else if (helperImpl.project.getDataTypeDefinitions().get(elementName) != null) {
http://git-wip-us.apache.org/repos/asf/ant/blob/02e32f76/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JonasDeploymentTool.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JonasDeploymentTool.java b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JonasDeploymentTool.java
index 9547fc6..4f98379 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JonasDeploymentTool.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JonasDeploymentTool.java
@@ -615,13 +615,13 @@ public class JonasDeploymentTool extends GenericDeploymentTool {
}
// javacopts
- if (javacopts != null && !javacopts.equals("")) {
+ if (javacopts != null && !javacopts.isEmpty()) {
genicTask.createArg().setValue("-javacopts");
genicTask.createArg().setLine(javacopts);
}
// rmicopts
- if (rmicopts != null && !rmicopts.equals("")) {
+ if (rmicopts != null && !rmicopts.isEmpty()) {
genicTask.createArg().setValue("-rmicopts");
genicTask.createArg().setLine(rmicopts);
}
http://git-wip-us.apache.org/repos/asf/ant/blob/02e32f76/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java b/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java
index 669c497..9aa1b49 100644
--- a/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java
+++ b/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java
@@ -506,7 +506,7 @@ public class FTP extends Task implements FTPTaskConfig {
return;
}
String completePath = null;
- if (!vpath.equals("")) {
+ if (!vpath.isEmpty()) {
completePath = rootPath + remoteFileSep
+ vpath.replace(File.separatorChar, remoteFileSep.charAt(0));
} else {
@@ -521,8 +521,8 @@ public class FTP extends Task implements FTPTaskConfig {
for (int i = 0; i < newfiles.length; i++) {
FTPFile file = newfiles[i];
if (file != null
- && !file.getName().equals(".")
- && !file.getName().equals("..")) {
+ && !".".equals(file.getName())
+ && !"..".equals(file.getName())) {
String name = vpath + file.getName();
scannedDirs.put(name, new FTPFileProxy(file));
if (isFunctioningAsDirectory(ftp, dir, file)) {
@@ -1536,7 +1536,7 @@ public class FTP extends Task implements FTPTaskConfig {
* @see org.apache.commons.net.ftp.FTPClientConfig
*/
public void setServerLanguageCodeConfig(LanguageCode serverLanguageCode) {
- if (serverLanguageCode != null && !serverLanguageCode.getValue().equals("")) {
+ if (serverLanguageCode != null && !serverLanguageCode.getValue().isEmpty()) {
this.serverLanguageCodeConfig = serverLanguageCode;
configurationHasBeenSet();
}