| Summary: | ManifestLocalization.EmptyResource throws NPE on ResourceBundle#containsKey() | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Equinox | Reporter: | Thomas Schindl <tom.schindl> | ||||
| Component: | Framework | Assignee: | Thomas Watson <tjwatson> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | tjwatson | ||||
| Version: | 3.7 | ||||||
| Target Milestone: | Juno M2 | ||||||
| Hardware: | PC | ||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Thanks for the patch Tom. Instead of creating a new inner class I prefer to use: return Collections.enumeration(Collections.EMPTY_LIST); wrong milestone. I meant Juno :) (In reply to comment #2) > Instead of creating a new inner class I prefer to use: > > return Collections.enumeration(Collections.EMPTY_LIST); Fine too - it was my first implementation too but this generates a warning and Collections.emptyList() is only available since 1.5 and IIRC 1.5 stuff is not supposed to be used, not? I could naturally add a suppress warning so if you want me to recreate the patch with the above I'm fine with it. (In reply to comment #4) > (In reply to comment #2) > > Instead of creating a new inner class I prefer to use: > > > > return Collections.enumeration(Collections.EMPTY_LIST); > > Fine too - it was my first implementation too but this generates a warning and > Collections.emptyList() is only available since 1.5 and IIRC 1.5 stuff is not > supposed to be used, not? > > I could naturally add a suppress warning so if you want me to recreate the > patch with the above I'm fine with it. No need to create a patch I will use the above line with a suppress warning flag. Thanks. |
Created attachment 201719 [details] patch to return empty enumeration The problem is that ResourceBundle#getKeys() contract is not honored appropriately because the method doesn't spec that a return value of null is allowed. Here's the exception from my application: java.lang.NullPointerException at java.util.ResourceBundle.handleKeySet(ResourceBundle.java:1715) at java.util.ResourceBundle.containsKey(ResourceBundle.java:1669) at com.bizerba.retail.validation.model.validation.internal.ModelValidationProvider$1.getMessage(ModelValidationProvider.java:105)