Browse Source

Throw build exception if name attribute is missing in a patternset

PR: 25982
Obtained from: Jose Alberto Fernandez


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276149 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 21 years ago
parent
commit
e5fc964411
2 changed files with 7 additions and 1 deletions
  1. +2
    -0
      WHATSNEW
  2. +5
    -1
      src/main/org/apache/tools/ant/types/PatternSet.java

+ 2
- 0
WHATSNEW View File

@@ -50,6 +50,8 @@ Fixed bugs:

* MacroDef did not allow attributes named 'description'. Bugzilla Report 27175.

* Throw build exception if name attribute missing from patternset. Bugzill Report 25982.

Other changes:
--------------



+ 5
- 1
src/main/org/apache/tools/ant/types/PatternSet.java View File

@@ -122,7 +122,11 @@ public class PatternSet extends DataType implements Cloneable {
* @return a printable form of this object.
*/
public String toString() {
StringBuffer buf = new StringBuffer(name != null ? name : "");
if (name == null) {
throw new BuildException(
"Missing attribute \"name\" for a pattern");
}
StringBuffer buf = new StringBuffer(name);
if ((ifCond != null) || (unlessCond != null)) {
buf.append(":");
String connector = "";


Loading…
Cancel
Save