costin 2002/12/16 21:47:16
Modified: src/main/org/apache/tools/ant/helper ProjectHelper2.java
Log:
Fix for the lowercase problem. Sorry for the delay, I didn't have access to
email this weekend.
The code may still have a small problem - but the original had similar
issues. I'll try to move the fix in UE later this week.
I think getting to a consistent behavior is quite important - I wouldn't
mind having all elements converted to lowercase, and I don't remember
and design and explicit decision to have some lowercased and some not.
If you still see problems - switch back to the original PH.
Revision Changes Path
1.3 +23 -5
jakarta-ant/src/main/org/apache/tools/ant/helper/ProjectHelper2.java
Index: ProjectHelper2.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/helper/ProjectHelper2.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ProjectHelper2.java 13 Dec 2002 21:56:52 -0000 1.2
+++ ProjectHelper2.java 17 Dec 2002 05:47:16 -0000 1.3
@@ -64,6 +64,7 @@
import java.util.Hashtable;
import java.util.Vector;
import java.util.Stack;
+import java.util.Locale;
import org.xml.sax.Locator;
import org.xml.sax.InputSource;
@@ -806,7 +807,29 @@
{
RuntimeConfigurable parentWrapper=context.currentWrapper();
RuntimeConfigurable wrapper=null;
+ Object parent=null;
+
+ if( parentWrapper!=null ) {
+ parent=parentWrapper.getProxy();
+ }
+ if( parent != null ) {
+ // nested elements. Backward compatibilitiy - only nested
elements
+ // are lower cased in the original processor
+ qname=qname.toLowerCase( Locale.US );
+ // XXX What about nested elements that are inside
TaskContainers ?
+ // We can't know that that we need lowercase until we know
+ // parent is not a TaskContainer. Maybe this test should
+ // be done in UnknownElement.
+
+ // Note: the original code seems to have a similar problem:
the lowercase
+ // conversion happens only inside ProjectHelper, if we know
that the
+ // parent is not TaskContainer. If the parent is not known -
UE are used
+ // and AFAIK there is no code to deal with that, so the
conversion will be
+ // different based on context ( if the enclosing task is
taskdefed in target
+ // or known at top level ).
+ }
+
/* UnknownElement is used for tasks and data types - with
delayed eval */
UnknownElement task= new UnknownElement(qname);
@@ -822,11 +845,6 @@
task.setOwningTarget(context.currentTarget);
context.configureId(task, attrs);
-
- Object parent=null;
- if( parentWrapper!=null ) {
- parent=parentWrapper.getProxy();
- }
if( parent != null ) {
// Nested element
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>