Community
Participate
Working Groups
We at Code Recommenders just got bitten (Bug 528985) by what I think is a bug in JDT (Photon M4): We assume that SelectionRequestor.getElements() runs a zero-element array rather than a one-element array with a "null" entry when the selection could not be resolved. So far, this has been the case (Null Object pattern for the win). With a module selection, however, this assumption failed us. IMHO, the following method in SelectionRequestor misses a null-check: @Override public void acceptModule(char[] moduleName, char[] uniqueKey, int start, int end) { IModuleDescription module = resolveModule(moduleName); addElement(module); } AFAICT, all other calls to addElements in SelectionRequestor take great care not to pass a null argument.
Makes sense. Bonus question: would you be able to provide an example we could use for a JUnit test? BTW: I guess when adding the null check we may also want to add the other stanza that other accept methods do: debug logging.
(In reply to Stephan Herrmann from comment #1) > Makes sense. > > Bonus question: would you be able to provide an example we could use for a > JUnit test? I'm afraid not, at least not easily: The code that trips over this is a listener on the current selection (Bug 528985 comment 1); in some cases the user clicks on a module declaration and the module cannot be resolved. Then, null gets inserted. module org.exam|ple { } // | denotes the cursor. > BTW: I guess when adding the null check we may also want to add the other > stanza that other accept methods do: debug logging. Sounds good.
bulk move out of 4.8
Bulk move out of 4.9
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.