| Summary: | Platform.getResourceBundle should throw exception instead of returning null | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Nicolas Bros <nicolas.bros> | ||||
| Component: | Runtime | Assignee: | John Arthorne <john.arthorne> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | gdupe, remy.suen, tjwatson | ||||
| Version: | 4.2 | ||||||
| Target Milestone: | 4.2 M5 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
But the API we call is documented to throw an exception, so apparently it doesn't.
* @param bundle the bundle whose resource bundle is being queried
* @return the resource bundle
* @exception MissingResourceException if the resource bundle was not found
* @since 3.0
*/
public static ResourceBundle getResourceBundle(Bundle bundle) throws MissingResourceException {
return InternalPlatform.getDefault().getResourceBundle(bundle);
}
All of our internal callers are expecting MissingResourceException as well. I'll look at fixing this. Fix: http://git.eclipse.org/c/equinox/rt.equinox.bundles.git/commit/?id=8a44f23cc8c3bd7a2fcb884818fe3a8c190d6ec6 Regression test: http://git.eclipse.org/c/platform/eclipse.platform.runtime.git/commit/?id=38f6e7e06da24cb7f848fd24660de1fbe37892d6 (In reply to comment #2) > All of our internal callers are expecting MissingResourceException as well. > I'll look at fixing this. Hmmm, seems this is causing bug371103. |
Created attachment 209801 [details] stacktrace I got the attached NPE when editing a model with the "plugin.properties" file missing in my metamodel's edit plug-in. Platform.getResourceBundle(getBundle()) returns null when there is no plugin.properties file. I think the getString method should check for this case and return an appropriate (more informative) exception, or a default "missing" string instead of doing an NPE at the end.