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

Bug 330047

Summary: PluginRegistry.findModel* throws IllegalArgumentExceptions
Product: [Eclipse Project] PDE Reporter: Andrew Mak <makandre>
Component: UIAssignee: PDE-UI-Inbox <pde-ui-inbox>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ankur_sharma, curtis.windatt.public
Version: 3.6.2Flags: ankur_sharma: review+
Target Milestone: 3.6.2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
patch for PluginRegistry none

Description Andrew Mak CLA 2010-11-11 17:16:27 EST
We are using the PluginRegistry.findModel* API functions, and noticed that if there is a plug-in with a bad version string in the workspace, these methods will throw IllegalArgumentExceptions.

From stacktrace we can see the exception is coming from the Version() constructor when it is passed the bad version string.


java.lang.IllegalArgumentException: invalid format
	at org.osgi.framework.Version.<init>(Version.java:140)
	at org.eclipse.pde.core.plugin.PluginRegistry.getMax(PluginRegistry.java:346)
	at org.eclipse.pde.core.plugin.PluginRegistry.findModel(PluginRegistry.java:324)

java.lang.IllegalArgumentException: invalid format
	at org.osgi.framework.Version.<init>(Version.java:140)
	at org.eclipse.pde.core.plugin.PluginRegistry.findModels(PluginRegistry.java:381)
	at org.eclipse.pde.core.plugin.PluginRegistry.findModel(PluginRegistry.java:324)
Comment 1 Curtis Windatt CLA 2010-11-12 10:18:58 EST
A contributed patch would be awesome.
Comment 2 Andrew Mak CLA 2010-11-12 14:08:36 EST
Created attachment 183029 [details]
patch for PluginRegistry
Comment 3 Andrew Mak CLA 2010-11-12 14:50:08 EST
Would be nice if this can go in 3.6.2, thanks!
Comment 4 Curtis Windatt CLA 2010-11-15 10:39:43 EST
Patch looks good.  We can probably put it in for 3.6.2.
Comment 5 Curtis Windatt CLA 2010-11-19 12:08:52 EST
Fixed in HEAD.  Leaving open for 3.6.2 consideration.
Comment 6 Curtis Windatt CLA 2010-12-10 13:01:30 EST
Fixed in 3.6 maintenance branch.  Updated pde core version to 3.6.2

Ankur, please verify.
Comment 7 Ankur Sharma CLA 2011-01-10 04:02:24 EST
+1

Good for 3.6.2