Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 314550

Summary: PDE headless build fails with java.lang.UnsupportedOperationException as of 3.6 RC1
Product: [Eclipse Project] PDE Reporter: Daniel Belina <belina>
Component: BuildAssignee: pde-build-inbox <pde-build-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: aniefer, darin.eclipse, dj.houghton, pascal
Version: 4.0Flags: dj.houghton: review+
darin.eclipse: review+
pascal: review+
Target Milestone: 3.6 RC3   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
patch none

Description Daniel Belina CLA 2010-05-26 14:27:39 EDT
Build Identifier: I20100520-0800

I have a headless PDE build launching via antRunner.  As of IES 3.6 RC1, it fails with the following exception:

Caused by: /home/belina/sandbox/WASX/WSC/ws/code/wct/packager/package.xml:59: java.lang.UnsupportedOperationException
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:116)
	at org.apache.tools.ant.Task.perform(Task.java:348)
	at org.apache.tools.ant.Target.execute(Target.java:357)
	at org.apache.tools.ant.Target.performTasks(Target.java:385)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
	at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
	at org.eclipse.ant.internal.core.ant.EclipseSingleCheckExecutor.executeTargets(EclipseSingleCheckExecutor.java:30)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
	at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
	... 35 more
Caused by: java.lang.UnsupportedOperationException
	at java.util.AbstractCollection.add(AbstractCollection.java:68)
	at org.eclipse.pde.internal.build.packager.PackageConfigScriptGenerator.setPackagingPropertiesLocation(PackageConfigScriptGenerator.java:174)
	at org.eclipse.pde.internal.build.packager.PackageScriptGenerator.basicGenerateAssembleConfigFileTargetCall(PackageScriptGenerator.java:57)
	at org.eclipse.pde.internal.build.AssembleScriptGenerator.generateMainTarget(AssembleScriptGenerator.java:124)
	at org.eclipse.pde.internal.build.AssembleScriptGenerator.generate(AssembleScriptGenerator.java:55)
	at org.eclipse.pde.internal.build.packager.PackagerGenerator.generatePackageScripts(PackagerGenerator.java:56)
	at org.eclipse.pde.internal.build.BuildScriptGenerator.generateFeatures(BuildScriptGenerator.java:253)
	at org.eclipse.pde.internal.build.BuildScriptGenerator.generate(BuildScriptGenerator.java:112)
	at org.eclipse.pde.internal.build.tasks.PackagerTask.execute(PackagerTask.java:90)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
	at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:600)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
	... 43 more

The packager.xml line in question is:
<eclipse.assembler featureList="${featureList}" workingDirectory="${workingDirectory}" configInfo="${config}" baseLocation="${tempDirectory}/${featurePaths}" packagePropertyFile="${packagingPropertyFile}" deltaPack="${deltaPack}"/>

This was previously working on IES 3.6 M7 and earlier builds.  The package.xml I'm making use of was unchanged between runs using the M7 and RC1 builds.

In the org.eclipse.pde.build_3.6.0.v20100512 directory is a file named pdebuild.jar.  Replacing that jar file with the version from IES 3.6 M7 allows the build to complete successfully.

Reproducible: Always

Steps to Reproduce:
This occurs in a local build environment for an IBM WebSphere tool, so I'm not sure how to provide steps to reproduce.  I can provide any additional information requested if the information in the Details section is not sufficient.
Comment 1 Andrew Niefer CLA 2010-05-26 15:19:36 EDT
Created attachment 170077 [details]
patch

Caused by changes for bug 282260.

 That change was to store the rootProviders list for ourselves and pass an empty collection up to the parent.  In the past, the rootProvider list on the parent class would have been empty, but it would have been modifiable.  This matters because old style re-packaging scripts (using scripts/package.xml) can contribute root files during the packaging phase.

So we can't pass Collections.EMPTY_SET to the parent.  

Also, when #getArchiveRootFileProviders() is called, we need to pass in the parent's root collection that may have had things added to it.
Comment 2 Andrew Niefer CLA 2010-05-26 17:05:42 EDT
Thanks Daniel for reporting this before it was too late.