Browse Source

remove modifying exception code for unknown<attribute/element>exception

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276891 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 20 years ago
parent
commit
fc4482c260
4 changed files with 4 additions and 46 deletions
  1. +2
    -3
      src/main/org/apache/tools/ant/RuntimeConfigurable.java
  2. +2
    -3
      src/main/org/apache/tools/ant/UnknownElement.java
  3. +0
    -17
      src/main/org/apache/tools/ant/UnsupportedAttributeException.java
  4. +0
    -23
      src/main/org/apache/tools/ant/UnsupportedElementException.java

+ 2
- 3
src/main/org/apache/tools/ant/RuntimeConfigurable.java View File

@@ -371,12 +371,11 @@ public class RuntimeConfigurable implements Serializable {
} else if (getElementTag() == null) {
throw be;
} else {
be.setMessage(
throw new BuildException(
getElementTag()
+ " doesn't support the \""
+ be.getAttribute()
+ "\" attribute");
throw be;
+ "\" attribute", be);
}
} catch (BuildException be) {
if (name.equals("id")) {


+ 2
- 3
src/main/org/apache/tools/ant/UnknownElement.java View File

@@ -342,11 +342,10 @@ public class UnknownElement extends Task {
}
}
} catch (UnsupportedElementException ex) {
ex.setMessage(
throw new BuildException(
parentWrapper.getElementTag()
+ " doesn't support the nested \"" + ex.getElement()
+ "\" element.");
throw ex;
+ "\" element.", ex);
}
}
}


+ 0
- 17
src/main/org/apache/tools/ant/UnsupportedAttributeException.java View File

@@ -23,7 +23,6 @@ package org.apache.tools.ant;
*/
public class UnsupportedAttributeException extends BuildException {

private String myMessage;
private String attribute;

/**
@@ -34,7 +33,6 @@ public class UnsupportedAttributeException extends BuildException {
public UnsupportedAttributeException(String msg, String attribute) {
super(msg);
this.attribute = attribute;
this.myMessage = msg;
}

/**
@@ -46,19 +44,4 @@ public class UnsupportedAttributeException extends BuildException {
return attribute;
}

/**
* Override throwable#getMessage
* @return the message
*/
public String getMessage() {
return myMessage;
}

/**
* Set the message
* @param message a new message
*/
public void setMessage(String message) {
this.myMessage = message;
}
}

+ 0
- 23
src/main/org/apache/tools/ant/UnsupportedElementException.java View File

@@ -32,7 +32,6 @@ package org.apache.tools.ant;
*/
public class UnsupportedElementException extends BuildException {

private String myMessage = null;
private String element;

/**
@@ -53,26 +52,4 @@ public class UnsupportedElementException extends BuildException {
public String getElement() {
return element;
}

/**
* Override throwable#getMessage
* @return the message
*/
public String getMessage() {
if (myMessage == null) {
return super.getMessage();
} else {
return myMessage;
}
}

/**
* Set the message (If not set already)
* @param message a new message
*/
public void setMessage(String message) {
if (this.myMessage == null) {
this.myMessage = message;
}
}
}

Loading…
Cancel
Save