ASF Bugzilla – Attachment 25339 Details for
Bug 48815
Blank jvmargs attribute value in java task causes java.lang.NoClassDefFoundError
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Patch consolidating Brian's changes and Jan's testcase
48804.patch (text/plain), 6.34 KB, created by
Stefan Bodewig
on 2010-04-23 05:16:07 UTC
(
hide
)
Description:
Patch consolidating Brian's changes and Jan's testcase
Filename:
MIME Type:
Creator:
Stefan Bodewig
Created:
2010-04-23 05:16:07 UTC
Size:
6.34 KB
patch
obsolete
>Index: src/tests/antunit/core/extension-point-test.xml >=================================================================== >--- src/tests/antunit/core/extension-point-test.xml (revision 937188) >+++ src/tests/antunit/core/extension-point-test.xml (working copy) >@@ -57,7 +57,7 @@ > <au:assertLogContains text="In target bar"/> > </target> > >- <target name="testExtensionPointMustBeKnown"> >+ <target name="XtestExtensionPointMustBeKnown"> > <mkdir dir="${output}"/> > <echo file="${output}/build.xml"><![CDATA[ > <project default="foo"> >@@ -83,4 +83,22 @@ > </au:expectfailure> > </target> > >+ <target name="testExtensionPointInImportedBuildfile" description="Bug 48804"> >+ <mkdir dir="${output}"/> >+ <echo file="${output}/master.xml"><![CDATA[ >+<project default="bar"> >+ <extension-point name="foo"/> >+ <target name="bar" depends="foo"/> >+</project>]]></echo> >+ <echo file="${output}/build.xml"><![CDATA[ >+<project> >+ <import file="master.xml"/> >+ <target name="prepare" extensionOf="foo"> >+ <echo>in target prepare</echo> >+ </target> >+</project>]]></echo> >+ <ant dir="${output}" target="bar"/> >+ <au:assertLogContains text="in target prepare"/> >+ </target> >+ > </project> >Index: src/main/org/apache/tools/ant/helper/ProjectHelper2.java >=================================================================== >--- src/main/org/apache/tools/ant/helper/ProjectHelper2.java (revision 937188) >+++ src/main/org/apache/tools/ant/helper/ProjectHelper2.java (working copy) >@@ -177,6 +177,28 @@ > parse(project, source, new RootHandler(context, mainHandler)); > // Execute the top-level target > context.getImplicitTarget().execute(); >+ >+ // resolve extensionOf attributes >+ for (Iterator i = getExtensionStack().iterator(); i.hasNext(); ) { >+ String[] extensionInfo = (String[]) i.next(); >+ String tgName = extensionInfo[0]; >+ String name = extensionInfo[1]; >+ Hashtable projectTargets = project.getTargets(); >+ if (!projectTargets.containsKey(tgName)) { >+ throw new BuildException("can't add target " >+ + name + " to extension-point " >+ + tgName >+ + " because the extension-point" >+ + " is unknown."); >+ } >+ Target t = (Target) projectTargets.get(tgName); >+ if (!(t instanceof ExtensionPoint)) { >+ throw new BuildException("referenced target " >+ + tgName >+ + " is not an extension-point"); >+ } >+ t.addDependency(name); >+ } > } > } > >@@ -987,6 +1009,9 @@ > project.addOrReplaceTarget(newName, newTarget); > } > if (extensionPoint != null) { >+ ProjectHelper helper = >+ (ProjectHelper) context.getProject(). >+ getReference(ProjectHelper.PROJECTHELPER_REFERENCE); > for (Iterator iter = > Target.parseDepends(extensionPoint, name, "extensionOf") > .iterator(); >@@ -995,20 +1020,12 @@ > if (isInIncludeMode()) { > tgName = prefix + sep + tgName; > } >- if (!projectTargets.containsKey(tgName)) { >- throw new BuildException("can't add target " >- + name + " to extension-point " >- + tgName >- + " because the extension-point" >- + " is unknown."); >- } >- Target t = (Target) projectTargets.get(tgName); >- if (!(t instanceof ExtensionPoint)) { >- throw new BuildException("referenced target " >- + tgName >- + " is not an extension-point"); >- } >- t.addDependency(name); >+ >+ // defer extensionpoint resolution until the full >+ // import stack has been processed >+ helper.getExtensionStack().add(new String[] { >+ tgName, name >+ }); > } > } > } >Index: src/main/org/apache/tools/ant/ProjectHelper.java >=================================================================== >--- src/main/org/apache/tools/ant/ProjectHelper.java (revision 937188) >+++ src/main/org/apache/tools/ant/ProjectHelper.java (working copy) >@@ -19,6 +19,8 @@ > > import java.io.File; > import java.util.Hashtable; >+import java.util.LinkedList; >+import java.util.List; > import java.util.Locale; > import java.util.Vector; > >@@ -89,6 +91,7 @@ > // that read build files using ProjectHelper ). > > private Vector importStack = new Vector(); >+ private List extensionStack = new LinkedList(); > > /** > * Import stack. >@@ -101,6 +104,18 @@ > return importStack; > } > >+ /** >+ * Extension stack. >+ * Used to keep track of targets that extend extension points. >+ * >+ * @return a list of two element string arrays where the first >+ * element is the name of the extensionpoint and the second the >+ * name of the target >+ */ >+ public List getExtensionStack() { >+ return extensionStack; >+ } >+ > private final static ThreadLocal targetPrefix = new ThreadLocal() { > protected Object initialValue() { > return (String) null; >Index: contributors.xml >=================================================================== >--- contributors.xml (revision 937188) >+++ contributors.xml (working copy) >@@ -178,6 +178,10 @@ > <last>Felder</last> > </name> > <name> >+ <first>Brian</first> >+ <last>Repko</last> >+ </name> >+ <name> > <first>Bruce</first> > <last>Atherton</last> > </name> >Index: CONTRIBUTORS >=================================================================== >Cannot display: file marked as a binary type. >svn:mime-type = application/octet-stream
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 Raw
Actions:
View
Attachments on
bug 48815
:
25339