From 4ffebc6a12a8eb68384e0d8e4d7f2eea9656c3a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Mat=C3=A8rne?= Date: Sun, 28 Jan 2018 12:51:38 +0100 Subject: [PATCH 1/4] user actual version of simian --- check.xml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/check.xml b/check.xml index 83e16a5ad..52f3fb3b4 100644 --- a/check.xml +++ b/check.xml @@ -91,7 +91,7 @@ + From 49eefb1c988e9a12b5cb8e4aa310a18c021b4fec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Mat=C3=A8rne?= Date: Sun, 28 Jan 2018 13:30:28 +0100 Subject: [PATCH 2/4] whatsnew += Log4jListener is deprecated (breaks BWC) --- WHATSNEW | 3 +++ 1 file changed, 3 insertions(+) diff --git a/WHATSNEW b/WHATSNEW index 235e7236b..1430c8d77 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: ----------- From 76933d2e2835b5083f264ce33bdc0f4132c6e68c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Mat=C3=A8rne?= Date: Tue, 30 Jan 2018 06:58:13 +0100 Subject: [PATCH 3/4] update to latest Simian (fixed the multi formatter issue) --- check.xml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/check.xml b/check.xml index 52f3fb3b4..b5a65867f 100644 --- a/check.xml +++ b/check.xml @@ -91,7 +91,7 @@ + Install Simian ${simian.version} @@ -194,6 +195,7 @@ + Run Simian @@ -202,17 +204,7 @@ - From b38faab1cc70bd7529c0ba073f5e53f8f85f7e71 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Fri, 2 Feb 2018 06:19:33 +0100 Subject: [PATCH 4/4] swap constant string and variable in some equals ops this is a stripped down version of #56 as `isEmpty` is not available in Java5. --- .../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(-) diff --git a/src/main/org/apache/tools/ant/helper/ProjectHelper2.java b/src/main/org/apache/tools/ant/helper/ProjectHelper2.java index 6ae2d3236..34dfde30b 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) { diff --git a/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java b/src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java index ebed3a279..4b159f30c 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 { * "project" */ 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) { 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 13b418de3..c55234442 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)) {