Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 159203 - No Null pointer access hint like Eclispe in the Netbeans editor
No Null pointer access hint like Eclispe in the Netbeans editor
Status: RESOLVED WORKSFORME
Product: editor
Classification: Unclassified
Component: Hints & Annotations
6.x
All All
: P3 (vote)
: TBD
Assigned To: Jan Lahoda
issues@editor
http://crazyjavahacking.org/the-story...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-02-26 12:20 UTC by desmond_kirrane
Modified: 2013-01-02 17:19 UTC (History)
4 users (show)

See Also:
Issue Type: ENHANCEMENT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description desmond_kirrane 2009-02-26 12:20:19 UTC
If you try the below code the Editor doesn't give you a hint like Eclispe does.
In Eclispe you will get the hint "Null pointer access: The variable statement can only be null at this location"     

java.sql.Statement statement = null;
try {
    statement.executeUpdate("<sql statement>");
} catch (SQLException ex) {
    throw ex;
}

I hint is very usefull because the code still builds and you won't hit a NPE until you use the code.
Comment 1 muzPayne 2011-10-15 19:45:04 UTC
Started working on as part of the First Patch Program...
Comment 2 Jan Lahoda 2011-10-15 20:55:13 UTC
I am glad to here that!

There is a sketchy prototype implementation in:
http://hg.netbeans.org/main/contrib/file/tip/javahints/src/org/netbeans/modules/javahints/NPECheck.java
which sometimes produces false positives (warnings that are not appropriate) and is quite slow because it tries to read @CheckForNull from project metadata (was done before the common annotations has been introduced, and can probably be removed now). Tests for the prototype are here:
http://hg.netbeans.org/main/contrib/file/tip/javahints/test/unit/src/org/netbeans/modules/javahints/NPECheckTest.java
Comment 3 markiewb 2012-12-27 16:33:02 UTC
What is the current state?
Comment 4 Geertjan Wielenga 2012-12-27 16:38:47 UTC
You will now in 7.3 get a hint saying "Dereferencing null pointer".

More info: https://blogs.oracle.com/geertjan/entry/netbeans_ide_7_3_knows
Comment 5 markiewb 2012-12-27 16:44:19 UTC
(In reply to comment #4)
> You will now in 7.3 get a hint saying "Dereferencing null pointer".
> 
> More info: https://blogs.oracle.com/geertjan/entry/netbeans_ide_7_3_knows

Thank you Geertjan. Why is this issue not marked as resolved?
Comment 6 Geertjan Wielenga 2012-12-27 16:46:00 UTC
It probably should be.
Comment 7 markiewb 2013-01-02 17:19:50 UTC
(In reply to comment #6)
> It probably should be.

So am resolving this issue as worksforme.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo