Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 330047 - PluginRegistry.findModel* throws IllegalArgumentExceptions
Summary: PluginRegistry.findModel* throws IllegalArgumentExceptions
Status: VERIFIED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6.2   Edit
Assignee: PDE-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-11 17:16 EST by Andrew Mak CLA
Modified: 2011-01-20 15:51 EST (History)
2 users (show)

See Also:
ankur_sharma: review+


Attachments
patch for PluginRegistry (1.70 KB, patch)
2010-11-12 14:08 EST, Andrew Mak CLA
no flags Details | Diff

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