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 2017/03/15 16:50:37 UTC

ant git commit: Make GenerateKey.DistinguishedName.toString more robust

Repository: ant
Updated Branches:
  refs/heads/1.9.x 54f5c5fbb -> 5ef86aed6


Make GenerateKey.DistinguishedName.toString more robust

https://bz.apache.org/bugzilla/show_bug.cgi?id=60767


Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/5ef86aed
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/5ef86aed
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/5ef86aed

Branch: refs/heads/1.9.x
Commit: 5ef86aed605c8d3ca4b376eab74e255166f7bf4d
Parents: 54f5c5f
Author: Stefan Bodewig <bo...@apache.org>
Authored: Wed Mar 15 17:49:31 2017 +0100
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Wed Mar 15 17:49:31 2017 +0100

----------------------------------------------------------------------
 WHATSNEW                                                |  7 +++++++
 src/main/org/apache/tools/ant/taskdefs/GenerateKey.java | 12 +++++++++---
 2 files changed, 16 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant/blob/5ef86aed/WHATSNEW
----------------------------------------------------------------------
diff --git a/WHATSNEW b/WHATSNEW
index 2c10b1e..ae2cb15 100644
--- a/WHATSNEW
+++ b/WHATSNEW
@@ -8,6 +8,13 @@ Other changes:
    values always get quoted.
    Github Pull Request #32
 
+Fixed bugs:
+-----------
+
+ * <genkey>'s <dname> child now skips <param>s that lack a key or
+   value.
+   Bugzilla Report 60767
+
 Changes from Ant 1.9.8 TO Ant 1.9.9
 ===================================
 

http://git-wip-us.apache.org/repos/asf/ant/blob/5ef86aed/src/main/org/apache/tools/ant/taskdefs/GenerateKey.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/taskdefs/GenerateKey.java b/src/main/org/apache/tools/ant/taskdefs/GenerateKey.java
index 69e719c..c26ac36 100644
--- a/src/main/org/apache/tools/ant/taskdefs/GenerateKey.java
+++ b/src/main/org/apache/tools/ant/taskdefs/GenerateKey.java
@@ -73,6 +73,10 @@ public class GenerateKey extends Task {
         public String getValue() {
             return value;
         }
+
+        public boolean isComplete() {
+            return name != null && value != null;
+        }
     }
 
     /**
@@ -119,9 +123,11 @@ public class GenerateKey extends Task {
                 firstPass = false;
 
                 final DnameParam param = (DnameParam) params.elementAt(i);
-                sb.append(encode(param.getName()));
-                sb.append('=');
-                sb.append(encode(param.getValue()));
+                if (param.isComplete()) {
+                    sb.append(encode(param.getName()));
+                    sb.append('=');
+                    sb.append(encode(param.getValue()));
+                }
             }
 
             return sb.toString();