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

Bug 323246

Summary: IBundleProjectService.setBundleRoot() does not accept null argument
Product: [Eclipse Project] PDE Reporter: Kaloyan Raev <kaloyan>
Component: UIAssignee: PDE-UI-Inbox <pde-ui-inbox>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public, darin.eclipse
Version: 3.6Flags: darin.eclipse: review+
Target Milestone: 3.6.1   
Hardware: PC   
OS: Windows Vista   
Whiteboard:
Attachments:
Description Flags
test case
none
patch
darin.eclipse: iplog+
patch to existing test class none

Description Kaloyan Raev CLA 2010-08-20 09:09:31 EDT
In the javadoc of the IBundleProjectService.setBundleRoot() it is written that the bundleRoot argument can be null. In this case the bundle root is the project's root location. 

But if I call setBundle(project, null), then the following exception is thrown:

java.lang.IllegalArgumentException: Path must include project and resource name: /test
	at org.eclipse.core.runtime.Assert.isLegal(Assert.java:63)
	at org.eclipse.core.internal.resources.Workspace.newResource(Workspace.java:1795)
	at org.eclipse.core.internal.resources.Container.getFolder(Container.java:221)
	at org.eclipse.pde.internal.core.project.BundleProjectService.setBundleRoot(BundleProjectService.java:174)
...
Comment 1 Kaloyan Raev CLA 2010-08-20 09:11:03 EDT
Created attachment 177087 [details]
test case

A simple test case attached.
Comment 2 Kaloyan Raev CLA 2010-08-20 09:18:22 EDT
Created attachment 177089 [details]
patch

And a simple patch attached.
Comment 3 Darin Wright CLA 2010-08-20 10:03:55 EDT
Comment on attachment 177089 [details]
patch

Applied fix.
Comment 4 Darin Wright CLA 2010-08-20 10:04:58 EDT
Created attachment 177099 [details]
patch to existing test class
Comment 5 Darin Wright CLA 2010-08-20 10:05:19 EDT
Fixed.
Comment 6 Darin Wright CLA 2010-08-20 10:12:01 EDT
Also fixed in 3.6.1
Comment 7 Curtis Windatt CLA 2010-08-30 12:58:15 EDT
Verified in 3.6.x branch.