Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 154191

Summary: Support @Nullable and @NotNull Annotation
Product: [Eclipse Project] JDT Reporter: Joachim Sauer <mail>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P3    
Version: 3.3   
Target Milestone: ---   
Hardware: All   
OS: All   
URL: http://www.jetbrains.com/idea/documentation/howto.html
Whiteboard:

Description Joachim Sauer CLA 2006-08-17 06:04:10 EDT
IntelliJ Idea supports the annotations @Nullable and @NotNull on methods to indicate that the methods can or can not return null. This is very usefull for a static code analysis as it can point at programming errors (failures to check for null values).

It would be nice if Eclipse supported those annotations as well. From what I've read from the URL the IDEA team is interested in getting this annotations into the JDK, so it seems to me that they don't mind interoperability in this case.

(Sorry if this is a dupe, I've searched and didn't find any such request, which I find surprising, since it's a very nice feature IMHO and is worthy of discussion at least).
Comment 1 Maxime Daniel CLA 2006-08-22 05:24:43 EDT
I would consider that this bug merely supports the option described in comment #4 of bug 126551.

*** This bug has been marked as a duplicate of 126551 ***
Comment 2 NoName CLA 2007-05-09 09:59:18 EDT
(In reply to comment #1)
> I would consider that this bug merely supports the option described in comment
> #4 of bug 126551.
> 
> *** This bug has been marked as a duplicate of 126551 ***
> 

Can you explain why checkin with annotations is the same as interprocedural analysis (bug 126551) ?

More on annotations:
- JSR 305: Annotations for Software Defect Detection
  http://jcp.org/en/jsr/detail?id=305

- FindBugs: @CheckForNull, @CheckReturnValue, @NonNull, @Nullable
  http://findbugs.sourceforge.net/manual/annotations.html

- ItelliJ IDEA: @Nullable and @NotNull
  http://www.jetbrains.com/idea/documentation/howto.html
Comment 3 Maxime Daniel CLA 2007-05-09 14:39:42 EDT
(In reply to comment #2)
> Can you explain why checkin with annotations is the same as interprocedural
> analysis (bug 126551) ?
My intent was not to suggest that this was the same. In fact, I intended to indicate that any action we might take on this subject (making use of annotations in relationship with null checks) would be considered in the context of the umbrella bug 126551, which is meant to track our inter-procedural analysis at large. Hence we would see this as a 'planning' relationship, rather than a strictly semantic relationship.
Hope this helps (while I am conscious that the current status of bug 126551 may well not satisfy you).
Comment 4 NoName CLA 2007-05-10 06:01:31 EDT
(In reply to comment #3)
> My intent was not to suggest that this was the same. In fact, I intended to
> indicate that any action we might take on this subject (making use of
> annotations in relationship with null checks) would be considered in the
> context of the umbrella bug 126551, which is meant to track our
> inter-procedural analysis at large. Hence we would see this as a 'planning'
> relationship, rather than a strictly semantic relationship.
> Hope this helps (while I am conscious that the current status of bug 126551 may
> well not satisfy you).

Thanks for the explanation. You guessed right, the status of bug 126551 is RESOLVED-WONTFIX. If this BUG is not rejected, is it possible to re-open it ?
Comment 5 Maxime Daniel CLA 2007-05-10 06:51:43 EDT
You could. I am telling you that it will change anything though. I guess that the item may be considered sometime in 3.4 if it gathers enough support.
Comment 6 NoName CLA 2007-05-10 08:19:38 EDT
(In reply to comment #5)
> You could. I am telling you that it will change anything though. I guess that
> the item may be considered sometime in 3.4 if it gathers enough support.

re-opened as bug 186342 .