git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276891 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -371,12 +371,11 @@ public class RuntimeConfigurable implements Serializable { | |||||
| } else if (getElementTag() == null) { | } else if (getElementTag() == null) { | ||||
| throw be; | throw be; | ||||
| } else { | } else { | ||||
| be.setMessage( | |||||
| throw new BuildException( | |||||
| getElementTag() | getElementTag() | ||||
| + " doesn't support the \"" | + " doesn't support the \"" | ||||
| + be.getAttribute() | + be.getAttribute() | ||||
| + "\" attribute"); | |||||
| throw be; | |||||
| + "\" attribute", be); | |||||
| } | } | ||||
| } catch (BuildException be) { | } catch (BuildException be) { | ||||
| if (name.equals("id")) { | if (name.equals("id")) { | ||||
| @@ -342,11 +342,10 @@ public class UnknownElement extends Task { | |||||
| } | } | ||||
| } | } | ||||
| } catch (UnsupportedElementException ex) { | } catch (UnsupportedElementException ex) { | ||||
| ex.setMessage( | |||||
| throw new BuildException( | |||||
| parentWrapper.getElementTag() | parentWrapper.getElementTag() | ||||
| + " doesn't support the nested \"" + ex.getElement() | + " doesn't support the nested \"" + ex.getElement() | ||||
| + "\" element."); | |||||
| throw ex; | |||||
| + "\" element.", ex); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -23,7 +23,6 @@ package org.apache.tools.ant; | |||||
| */ | */ | ||||
| public class UnsupportedAttributeException extends BuildException { | public class UnsupportedAttributeException extends BuildException { | ||||
| private String myMessage; | |||||
| private String attribute; | private String attribute; | ||||
| /** | /** | ||||
| @@ -34,7 +33,6 @@ public class UnsupportedAttributeException extends BuildException { | |||||
| public UnsupportedAttributeException(String msg, String attribute) { | public UnsupportedAttributeException(String msg, String attribute) { | ||||
| super(msg); | super(msg); | ||||
| this.attribute = attribute; | this.attribute = attribute; | ||||
| this.myMessage = msg; | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -46,19 +44,4 @@ public class UnsupportedAttributeException extends BuildException { | |||||
| return attribute; | 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; | |||||
| } | |||||
| } | } | ||||
| @@ -32,7 +32,6 @@ package org.apache.tools.ant; | |||||
| */ | */ | ||||
| public class UnsupportedElementException extends BuildException { | public class UnsupportedElementException extends BuildException { | ||||
| private String myMessage = null; | |||||
| private String element; | private String element; | ||||
| /** | /** | ||||
| @@ -53,26 +52,4 @@ public class UnsupportedElementException extends BuildException { | |||||
| public String getElement() { | public String getElement() { | ||||
| return element; | 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; | |||||
| } | |||||
| } | |||||
| } | } | ||||