Bug 148664 - [spec] IJavaModel#getJavaProject(String) throws IAE for invalid name
Summary: [spec] IJavaModel#getJavaProject(String) throws IAE for invalid name
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: 3.5 M1   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-26 11:16 EDT by Markus Keller CLA
Modified: 2008-08-06 13:46 EDT (History)
2 users (show)

See Also:


Attachments
Proposed change (1.18 KB, patch)
2008-06-12 10:02 EDT, Jerome Lanneluc CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2006-06-26 11:16:19 EDT
I20060620-1010

IJavaModel#getJavaProject(String) throws an IllegalArgumentException for an invalid project name, see IWorkspaceRoot#getProject(String).

#getJavaProject() should either repeat the constraints on the name, or it should accept any name.

Steps to reproduce:
- open Run... dialog
- doubleclick "Junit Plug-in Test"
- select second radio button "Run all tests..."

The empty launch configuration is a bug in debug (fixed in HEAD).
I've added a check to avoid the issue in JDT/UI HEAD.
Comment 1 Frederic Fusier CLA 2007-06-19 06:46:40 EDT
I cannot reproduce the problem using 3.3 RC4 following the described scenario.
Comment 2 Frederic Fusier CLA 2007-06-19 06:49:45 EDT
I meant that there no IAE when I followed the comment 0 scenario. Of course, feel free to reopen if you still think that IJavaModel#getJavaProject(String) should not throw an IllegalArgumentException for an invalid project name...
Comment 3 Markus Keller CLA 2007-06-19 07:09:26 EDT
> I've added a check to avoid the issue in JDT/UI HEAD.

That fix avoids the problem in HEAD, but the method still throws an exception without declaring when. I think you should just copy the Javadoc from IWorkspaceRoot.getProject(String):

	 * The given name must be a valid
	 * path segment as defined by {@link IPath#isValidSegment(String)}.
Comment 4 Jerome Lanneluc CLA 2008-05-07 07:43:25 EDT
Deferring post 3.4
Comment 5 Jerome Lanneluc CLA 2008-06-12 10:02:07 EDT
Created attachment 104682 [details]
Proposed change
Comment 6 Jerome Lanneluc CLA 2008-06-25 07:23:59 EDT
Change released for 3.5M1
Comment 7 Olivier Thomann CLA 2008-08-06 13:46:24 EDT
Verified for 3.5M1 using I20080805-1307