Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 348333 - [debug] IllegalArgumentException from launch configuration w/ no project name
Summary: [debug] IllegalArgumentException from launch configuration w/ no project name
Status: VERIFIED FIXED
Alias: None
Product: Objectteams
Classification: Tools
Component: OTDT (show other bugs)
Version: 0.8   Edit
Hardware: PC Linux
: P2 major (vote)
Target Milestone: 2.0 RC4   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-05 11:54 EDT by Stephan Herrmann CLA
Modified: 2011-06-07 09:31 EDT (History)
0 users

See Also:


Attachments
simple fix (1.17 KB, patch)
2011-06-05 12:19 EDT, Stephan Herrmann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Herrmann CLA 2011-06-05 11:54:54 EDT
When creating a Java Application launch configuration without a proper
selection, the following exception is thrown due to a missing project name:


java.lang.IllegalArgumentException: Path for project must have only one segment.
	at org.eclipse.core.runtime.Assert.isLegal(Assert.java:63)
	at org.eclipse.core.internal.resources.WorkspaceRoot.getProject(WorkspaceRoot.java:184)
	at org.eclipse.objectteams.otdt.internal.debug.adaptor.launching.OTREBlock.hasOTJProject(OTREBlock.java:116)
	at org.eclipse.objectteams.otdt.internal.debug.adaptor.launching.OTREBlock.initializeFrom(OTREBlock.java:96)
	at org.eclipse.objectteams.otdt.internal.debug.adaptor.launching.JDTDebugUILaunchingAdaptor._OT$JavaJRETab$initializeFrom$initializeFrom(JDTDebugUILaunchingAdaptor.java:70)
	at org.eclipse.jdt.debug.ui.launchConfigurations.JavaJRETab._OT$initializeFrom$chain(JavaJRETab.java)
	at org.eclipse.jdt.debug.ui.launchConfigurations.JavaJRETab.initializeFrom(JavaJRETab.java)

Apparently the project name isn't null but "".

This exception is quite annoying because it keeps popping at your face
until a valid project name has been entered or the launch config deleted.
Comment 1 Stephan Herrmann CLA 2011-06-05 12:19:50 EDT
Created attachment 197361 [details]
simple fix

This should fix the issue by also testing Path.isValidSegment(projectName),
which is the declared precondition of getProject(String).
Comment 2 Stephan Herrmann CLA 2011-06-05 12:26:25 EDT
The exception is ugly, the fix is simple, safe and well localized.
Releasing for RC4.
Comment 3 Stephan Herrmann CLA 2011-06-07 09:31:08 EDT
Verified using build 20110607730