ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlboud...@apache.org
Subject svn commit: r1587677 - in /ant/easyant/core/trunk/src/main/java/org/apache: easyant/core/ easyant/core/ant/helper/ easyant/man/ easyant/tasks/ easyant/tasks/findclasspath/ ivy/core/cache/
Date Tue, 15 Apr 2014 18:37:07 GMT
Author: jlboudart
Date: Tue Apr 15 18:37:06 2014
New Revision: 1587677

URL: http://svn.apache.org/r1587677
Log:
code cleaning

Added:
    ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/EncryptPassword.java
    ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/ListTargetsAndExtensionPoints.java
Modified:
    ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntEngine.java
    ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/ant/helper/EasyAntProjectHelper.java
    ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/Describe.java
    ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/ListExtensionPoints.java
    ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/ListParameters.java
    ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/ListProps.java
    ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/ListTargets.java
    ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/SearchModule.java
    ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/findclasspath/FindClasspathTask.java
    ant/easyant/core/trunk/src/main/java/org/apache/ivy/core/cache/EasyAntRepositoryCacheManager.java

Modified: ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntEngine.java
URL: http://svn.apache.org/viewvc/ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntEngine.java?rev=1587677&r1=1587676&r2=1587677&view=diff
==============================================================================
--- ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntEngine.java (original)
+++ ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/EasyAntEngine.java Tue Apr
15 18:37:06 2014
@@ -611,7 +611,7 @@ public class EasyAntEngine {
                 System.setErr(new PrintStream(new DemuxOutputStream(project, true)));
 
                 // make sure that we have a target to execute
-                if (configuration.getTargets().size() == 0 && project.getDefaultTarget()
!= null) {
+                if (configuration.getTargets().isEmpty() && project.getDefaultTarget()
!= null) {
                     configuration.getTargets().add(project.getDefaultTarget());
                 }
                 project.executeTargets(new Vector(configuration.getTargets()));

Modified: ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/ant/helper/EasyAntProjectHelper.java
URL: http://svn.apache.org/viewvc/ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/ant/helper/EasyAntProjectHelper.java?rev=1587677&r1=1587676&r2=1587677&view=diff
==============================================================================
--- ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/ant/helper/EasyAntProjectHelper.java
(original)
+++ ant/easyant/core/trunk/src/main/java/org/apache/easyant/core/ant/helper/EasyAntProjectHelper.java
Tue Apr 15 18:37:06 2014
@@ -280,7 +280,7 @@ public class EasyAntProjectHelper extend
 
         private String getTargetPrefix(AntXMLContext context) {
             String configuredValue = getCurrentTargetPrefix();
-            if (configuredValue != null && configuredValue.length() == 0) {
+            if (configuredValue != null && configuredValue.isEmpty()) {
                 configuredValue = null;
             }
             if (configuredValue != null) {

Modified: ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/Describe.java
URL: http://svn.apache.org/viewvc/ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/Describe.java?rev=1587677&r1=1587676&r2=1587677&view=diff
==============================================================================
--- ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/Describe.java (original)
+++ ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/Describe.java Tue Apr 15 18:37:06
2014
@@ -42,7 +42,7 @@ public class Describe extends EasyantOpt
 
     public void execute() {
         String target = getValue();
-        if (target == null || target.length() == 0) {
+        if (target == null || target.isEmpty()) {
             throw new IllegalArgumentException("No parameter specified for -describe parameter.");
         }
 

Added: ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/EncryptPassword.java
URL: http://svn.apache.org/viewvc/ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/EncryptPassword.java?rev=1587677&view=auto
==============================================================================
--- ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/EncryptPassword.java (added)
+++ ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/EncryptPassword.java Tue Apr
15 18:37:06 2014
@@ -0,0 +1,16 @@
+package org.apache.easyant.man;
+
+
+public class EncryptPassword extends EasyantOption {
+    
+    public EncryptPassword() {
+        super("encrypt",true,"encrypt password");
+        setStopBuild(true);
+    }
+
+    @Override
+    public void execute() {
+        getProject().log("encryptedpassword for " + getValue());
+    }
+
+}

Modified: ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/ListExtensionPoints.java
URL: http://svn.apache.org/viewvc/ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/ListExtensionPoints.java?rev=1587677&r1=1587676&r2=1587677&view=diff
==============================================================================
--- ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/ListExtensionPoints.java (original)
+++ ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/ListExtensionPoints.java Tue
Apr 15 18:37:06 2014
@@ -42,7 +42,7 @@ public class ListExtensionPoints extends
                 LINE_SEP + "--- Available ExtensionPoints for current project: " + getProject().getName()
+ " ---"
                         + LINE_SEP);
         String container = getValue();
-        if (container == null || container.trim().length() == 0) {
+        if (container == null || container.trim().isEmpty()) {
             getProject().log(LINE_SEP + "No plugin specified. Listing all extension points
available in the project.");
 
             List<ExtensionPointReport> extensionPoints = getEareport().getExtensionPointReports();

Modified: ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/ListParameters.java
URL: http://svn.apache.org/viewvc/ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/ListParameters.java?rev=1587677&r1=1587676&r2=1587677&view=diff
==============================================================================
--- ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/ListParameters.java (original)
+++ ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/ListParameters.java Tue Apr
15 18:37:06 2014
@@ -44,7 +44,7 @@ public class ListParameters extends Easy
          * those parameters will be displayed by this class.
          */
         String plugin = getValue();
-        if (plugin == null || plugin.trim().length() == 0) {
+        if (plugin == null || plugin.trim().isEmpty()) {
 
             getProject().log(LINE_SEP + "No plugin specified. Listing all parameters available
in the project.");
             List<ParameterReport> parameterReports = getEareport().getParameterReports();

Modified: ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/ListProps.java
URL: http://svn.apache.org/viewvc/ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/ListProps.java?rev=1587677&r1=1587676&r2=1587677&view=diff
==============================================================================
--- ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/ListProps.java (original)
+++ ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/ListProps.java Tue Apr 15
18:37:06 2014
@@ -46,7 +46,7 @@ public class ListProps extends EasyantOp
          * those properties will be displayed by this class.
          */
         String plugin = getValue();
-        if (plugin == null || plugin.trim().length() == 0) {
+        if (plugin == null || plugin.trim().isEmpty()) {
 
             getProject().log(LINE_SEP + "No plugin specified. Listing all properties available
in the project.");
 

Modified: ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/ListTargets.java
URL: http://svn.apache.org/viewvc/ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/ListTargets.java?rev=1587677&r1=1587676&r2=1587677&view=diff
==============================================================================
--- ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/ListTargets.java (original)
+++ ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/ListTargets.java Tue Apr 15
18:37:06 2014
@@ -59,7 +59,7 @@ public class ListTargets extends Easyant
         getProject().log(
                 LINE_SEP + "--- Available Targets for current project: " + getProject().getName()
+ " ---" + LINE_SEP);
         String container = getValue();
-        if (container == null || container.trim().length() == 0) {
+        if (container == null || container.trim().isEmpty()) {
             getProject().log(
                     LINE_SEP + "No ExtensionPoint / Plugin specified. Listing all targets
available in the project.");
 
@@ -100,12 +100,11 @@ public class ListTargets extends Easyant
      *            list of targets to print
      */
     private void printTargets(List<TargetReport> targets) {
-        if (targets.size() == 0) {
+        if (targets.isEmpty()) {
             getProject().log("\tNo targets found.");
             return;
         }
-        for (int i = 0; i < targets.size(); i++) {
-            TargetReport targetRep = targets.get(i);
+        for (TargetReport targetRep : targets) {
             getProject().log("\tTarget: " + targetRep.getName());
             getProject().log(
                     "\t\tExtension-Point: "

Added: ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/ListTargetsAndExtensionPoints.java
URL: http://svn.apache.org/viewvc/ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/ListTargetsAndExtensionPoints.java?rev=1587677&view=auto
==============================================================================
--- ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/ListTargetsAndExtensionPoints.java
(added)
+++ ant/easyant/core/trunk/src/main/java/org/apache/easyant/man/ListTargetsAndExtensionPoints.java
Tue Apr 15 18:37:06 2014
@@ -0,0 +1,29 @@
+package org.apache.easyant.man;
+
+import java.util.Iterator;
+import java.util.Map;
+
+import org.apache.easyant.core.ant.ProjectUtils;
+import org.apache.tools.ant.Target;
+
+public class ListTargetsAndExtensionPoints extends EasyantOption {
+
+    public ListTargetsAndExtensionPoints() {
+        super("listAllTargets", "list all targets and extension points");
+        setStopBuild(true);
+    }
+    
+    @Override
+    public void execute() {
+        StringBuilder sb = new StringBuilder();
+        Map<String, Target> targets = ProjectUtils.removeDuplicateTargets(getProject().getTargets());
+        for (Iterator iterator = targets.keySet().iterator(); iterator.hasNext();) {
+            String targetName = (String) iterator.next();
+            sb.append(targetName).append(" " );
+            
+        }
+        getProject().log("All targets :" + sb.toString());
+        getProject().getTargets().toString();
+    }
+
+}

Modified: ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/SearchModule.java
URL: http://svn.apache.org/viewvc/ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/SearchModule.java?rev=1587677&r1=1587676&r2=1587677&view=diff
==============================================================================
--- ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/SearchModule.java (original)
+++ ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/SearchModule.java Tue Apr
15 18:37:06 2014
@@ -129,7 +129,7 @@ public class SearchModule extends IvyTas
         h.handleInput(request);
 
         String value = request.getInput();
-        if ((value == null || value.trim().length() == 0) && defaultvalue != null)
{
+        if ((value == null || value.trim().isEmpty()) && defaultvalue != null) {
             value = defaultvalue;
         }
         return value;

Modified: ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/findclasspath/FindClasspathTask.java
URL: http://svn.apache.org/viewvc/ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/findclasspath/FindClasspathTask.java?rev=1587677&r1=1587676&r2=1587677&view=diff
==============================================================================
--- ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/findclasspath/FindClasspathTask.java
(original)
+++ ant/easyant/core/trunk/src/main/java/org/apache/easyant/tasks/findclasspath/FindClasspathTask.java
Tue Apr 15 18:37:06 2014
@@ -38,7 +38,7 @@ public class FindClasspathTask extends A
 
     public void execute() throws BuildException {
         // define the default strategy if there is no nested strategy
-        if (getStrategies().size() == 0) {
+        if (getStrategies().isEmpty()) {
             add(createStrategy(new ProjectDependencyStrategy()));
             add(createStrategy(new BasicConfigurationStrategy()));
         }

Modified: ant/easyant/core/trunk/src/main/java/org/apache/ivy/core/cache/EasyAntRepositoryCacheManager.java
URL: http://svn.apache.org/viewvc/ant/easyant/core/trunk/src/main/java/org/apache/ivy/core/cache/EasyAntRepositoryCacheManager.java?rev=1587677&r1=1587676&r2=1587677&view=diff
==============================================================================
--- ant/easyant/core/trunk/src/main/java/org/apache/ivy/core/cache/EasyAntRepositoryCacheManager.java
(original)
+++ ant/easyant/core/trunk/src/main/java/org/apache/ivy/core/cache/EasyAntRepositoryCacheManager.java
Tue Apr 15 18:37:06 2014
@@ -296,7 +296,7 @@ public class EasyAntRepositoryCacheManag
 
     private int getGroupIntValue(java.util.regex.Matcher m, int groupNumber) {
         String g = m.group(groupNumber);
-        return g == null || g.length() == 0 ? 0 : Integer.parseInt(g);
+        return g == null || g.isEmpty() ? 0 : Integer.parseInt(g);
     }
 
     /**



Mime
View raw message