Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 323246 - IBundleProjectService.setBundleRoot() does not accept null argument
Summary: IBundleProjectService.setBundleRoot() does not accept null argument
Status: VERIFIED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: 3.6.1   Edit
Assignee: PDE-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-20 09:09 EDT by Kaloyan Raev CLA
Modified: 2010-08-30 12:58 EDT (History)
2 users (show)

See Also:
darin.eclipse: review+


Attachments
test case (824 bytes, application/octet-stream)
2010-08-20 09:11 EDT, Kaloyan Raev CLA
no flags Details
patch (967 bytes, patch)
2010-08-20 09:18 EDT, Kaloyan Raev CLA
darin.eclipse: iplog+
Details | Diff
patch to existing test class (2.08 KB, patch)
2010-08-20 10:04 EDT, Darin Wright CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.