Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipse-pmc] API Change Request: modification of null-related problem IDs in org.eclipse.jdt.core.IProblem

API Change Request

We would like to change the null related problem IDs published in
org.eclipse.jdt.core.IProblem as follows:

- deprecate:
      int LocalVariableCannotBeNull
      int LocalVariableCanOnlyBeNull
      int LocalVariableMayBeNull

- suppress (added last week for bug 170704):
      int LocalVariableRedundantCheckOnNull

- add:
      int NullLocalVariableReference
      int PotentialNullLocalVariableReference
      int RedundantNullCheckOnNullLocalVariable
      int NullLocalVariableComparisonYieldsFalse
      int RedundantLocalVariableNullAssignment
      int NullLocalVariableInstanceofYieldsFalse
      int RedundantNullCheckOnNonNullLocalVariable
      int NonNullLocalVariableComparisonYieldsFalse

RISKS

Users who rely upon the existing problems won't get them any more.
Note: JDT UI is aware of this and willing to migrate if that request is
approved.

BENEFITS

The proposed change conditions our ability to replace technical messages
like 'The variable o can only be null...' by more user-friendly messages
that more clearly relate the cause (the variable can only be null) to the
effects:
o = null; o.toString(); // Null pointer access: The variable o can only be
null at this location

o = null; if (o == null) { // Redundant null check: The variable o can only
be null at this location

o = null; if (o != null) { // Null comparison always yields false: The
variable o can only be null at this location

etc.


Associated bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=175570


Maxime DANIEL
Developer, Eclipse JDT Core
IBM Paris Laboratory
69, rue de la Vecquerie
44600 Saint-Nazaire
maxime_daniel@xxxxxxxxxx / +33 (0) 2 51 16 40 13 / tl 87 40 13 / FAX - 40
01 / Mob. +33 (0) 6 84 63 99 62
' It takes nine months to make a baby, and it takes focused concentration
to make great breakthroughs.' - Stever Robbins - in HBS Working Knowledge,
Jan 2005
'The easiest way to predict the future is to invent it.' - Alan Kay



Back to the top