This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | NullPointerException at org.netbeans.modules.java.hints.jackpot.impl.Utilities$NbSPIImpl.createUniversalCPInfo | ||
---|---|---|---|
Product: | java | Reporter: | alesak <alesak> |
Component: | Hints | Assignee: | Jan Lahoda <jlahoda> |
Status: | VERIFIED FIXED | ||
Severity: | normal | CC: | alesak, jiriprox, mmirilovic, tzezula |
Priority: | P1 | ||
Version: | 7.1 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | 183121 |
Attachments: |
stacktrace
Binary patch for testing messages.log Project in which the problem might be reproduced. |
Description
alesak
2011-11-23 12:42:53 UTC
Created attachment 113465 [details]
stacktrace
It is very annoying as it happens every single time I touch any line in Java source code and some hint should appear but instead I'm getting this NPE. Created attachment 113525 [details]
Binary patch for testing
Not quite sure what went wrong - it would be very helpful if you could install the attached patch, run the IDE and attach the messages.log, which will contain debugging data. The NPE should not happen with the patch. To install the patch, create: java/modules/patches/org-netbeans-modules-java-hints directory inside you NB installation (java/modules should already exist, the other two need to be created) and place the jar attached above there. Thank you very much. Created attachment 113526 [details]
messages.log
here is the log with patch installed (You were right NPE is gone)
I did not reproduce manually, but it is probably sufficient to use a custom hint like this (place in META-INF/upgrade/x.hint in a source root): $coll.size() == 0 :: $coll instanceof java.util.Collection && elementKindMatches($coll, ElementKind.INTERFACE) =>$coll.isEmpty() ;; have a J2ME/CLDC platform installed and have a code like: List l = ... boolean b = l.size() == 0; Fix: http://hg.netbeans.org/jet-main/rev/45eeccaa7cde I think it would be useful to port this for 7.1. Any objections? (In reply to comment #6) > I think it would be useful to port this for 7.1. Any objections? I agree Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/45eeccaa7cde User: Jan Lahoda <jlahoda@netbeans.org> Log: #205475: preventing NPE: should not touch non-J2SE platforms, platforms are not required to specify a version. Created attachment 113556 [details]
Project in which the problem might be reproduced.
I believe that the problem might be reproducible using this project - unpack, open it and open javaapplication5.JavaApplication5. It will be necessary to have a CLDC platform installed in the running IDE (i.e. a J2ME support enabled and configured).
Jirka, could you please try to verify (I think the above project should show the project is there is a CLDC platform installed/registered). Tomas, could you please review the patch? Thanks. Seems fine to me. verified in trunk Integrated into 'releases' Changeset: http://hg.netbeans.org/releases/rev/f7c225c624e3 User: Jan Lahoda <jlahoda@netbeans.org> Log: #205475: preventing NPE: should not touch non-J2SE platforms, platforms are not required to specify a version. verified |