ASF Bugzilla – Attachment 10135 Details for
Bug 24711
[PATCH] macrodef child elements should use their description attributes in error messages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
handle text description
MacroInstance.java.diffs (text/plain), 2.31 KB, created by
Matt Benson
on 2004-01-28 23:56:02 UTC
(
hide
)
Description:
handle text description
Filename:
MIME Type:
Creator:
Matt Benson
Created:
2004-01-28 23:56:02 UTC
Size:
2.31 KB
patch
obsolete
>--- src/main/org/apache/tools/ant/taskdefs/MacroInstance.java 2004-01-28 17:54:24.000000000 -0600 >+++ macro/MacroInstance.java 2004-01-28 17:47:26.000000000 -0600 >@@ -298,9 +298,13 @@ > Element element = (Element) presentElements.get(tag); > if (element == null) { > if (!templateElement.isOptional()) { >- throw new BuildException( >- "Required nested element " >- + templateElement.getName() + " missing"); >+ String msg = "Required nested element " >+ + templateElement.getName() + " missing"; >+ if (templateElement.getDescription() != null) { >+ msg+= "; description=\"" >+ + templateElement.getDescription() + "\""; >+ } >+ throw new BuildException(msg); > } > continue; > } >@@ -332,8 +336,12 @@ > value = macroSubs(value, localProperties); > } > if (value == null) { >- throw new BuildException( >- "required attribute " + attribute.getName() + " not set"); >+ String msg = "Required attribute " >+ + attribute.getName() + " not set"; >+ if (attribute.getDescription() != null) { >+ msg+= "; description=\"" + attribute.getDescription() + "\""; >+ } >+ throw new BuildException(msg); > } > localProperties.put(attribute.getName(), value); > copyKeys.remove(attribute.getName()); >@@ -344,8 +352,12 @@ > if (macroDef.getText() != null) { > if (text == null) { > if (!macroDef.getText().getOptional()) { >- throw new BuildException( >- "required text missing"); >+ String msg = "Required text missing"; >+ if (macroDef.getText().getDescription() != null) { >+ msg+= "; description=\"" >+ + macroDef.getText().getDescription() + "\""; >+ } >+ throw new BuildException(msg); > } > text = ""; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 24711
:
10067
|
10068
|
10069
|
10132
|
10133
|
10134
| 10135 |
10136
|
10137