Replies: 2 comments 4 replies
-
|
What would be the benefit of accepting (and silently ignoring) I would let them fail with a NPE but I don't know how many use-cases that would break. That would of course require to sharpen the JavaDocs and would IMO be a breaking change in the contract. Luckily, the |
Beta Was this translation helpful? Give feedback.
-
Of course. If you concerned about potential NPE, wait with the merge of such a change after we open up for the next release, this gives users a changes to break up this over a full release cycle. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
While manually executing some of our tests, I frequently saw the following exception in the logs:
Which is correct, of course, because I accidentally register a
nullILogListener, which is then being notified. But it doesn't makes much sense to accept
nullvalues when callingaddLogListener()if the implementation doesn't support it.The JavaDoc sadly doesn't say anything about
nulllisteners, so what would be the correct approach here? Ignorenulllisteners when they are being added? Throw aNullPointerExceptioninaddLogListener()? Or perhaps something else?Here the relevant code sections:
eclipse.platform/runtime/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/Log.java
Lines 51 to 55 in 5ccd447
eclipse.platform/runtime/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/Log.java
Lines 104 to 124 in 5ccd447
Beta Was this translation helpful? Give feedback.
All reactions