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.

Bug 208611 - NullPointerException: #120577: Cannot resolve ElementHandle[kind=CLASS; sigs=org.glassfish.jersey.server.Application$2 ]; file: /home/m_potociar/sandbox/java.net/jersey/core-server/src/main/java/org/g
Summary: NullPointerException: #120577: Cannot resolve ElementHandle[kind=CLASS; sigs=...
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Compiler (show other bugs)
Version: 7.1
Hardware: All All
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
: 209932 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-02-19 13:25 UTC by m_potociar
Modified: 2015-09-17 11:24 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 185201


Attachments
stacktrace (2.55 KB, text/plain)
2012-02-19 13:25 UTC, m_potociar
Details
stacktrace (2.59 KB, text/plain)
2012-06-18 20:55 UTC, Andrew Krasny
Details
Reproducible testcase (14.73 KB, application/x-zip-compressed)
2013-07-26 15:38 UTC, Jan Lahoda
Details

Note You need to log in before you can comment on or make changes to this bug.
Description m_potociar 2012-02-19 13:25:25 UTC
This bug was originally marked as duplicate of bug 120577, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE 7.1 (Build 201112071828)
VM: Java HotSpot(TM) 64-Bit Server VM, 22.0-b10, Java(TM) SE Runtime Environment, 1.7.0_02-b13
OS: Linux

Stacktrace: 
java.lang.NullPointerException: #120577: Cannot resolve ElementHandle[kind=CLASS; sigs=org.glassfish.jersey.server.Application$2 ]; file: /home/m_potociar/sandbox/java.net/jersey/core-server/src/main/java/org/glassfish/jersey/server/Application.java@8b1e7dd6:25db187
   at org.netbeans.modules.refactoring.java.RetoucheUtils.getOverridingMethods(RetoucheUtils.java:231)
   at org.netbeans.modules.refactoring.java.plugins.RenameRefactoringPlugin$2.run(RenameRefactoringPlugin.java:427)
   at org.netbeans.modules.refactoring.java.plugins.RenameRefactoringPlugin$2.run(RenameRefactoringPlugin.java:394)
   at org.netbeans.api.java.source.JavaSource$MultiTask.run(JavaSource.java:482)
   at org.netbeans.modules.parsing.impl.TaskProcessor.callUserTask(TaskProcessor.java:643)
   at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:154)
Comment 1 m_potociar 2012-02-19 13:25:28 UTC
Created attachment 115917 [details]
stacktrace
Comment 2 Jan Becicka 2012-04-05 11:19:22 UTC
*** Bug 209932 has been marked as a duplicate of this bug. ***
Comment 3 Jan Becicka 2012-04-16 10:08:48 UTC
WARNING [org.netbeans.modules.j2ee.metadata.model.api.support.annotation.PersistentObjectManager]: typesChanged: type ElementHandle[kind=CLASS; sigs=org.glassfish.jersey.server.Application$3 ] has dissapeared

element handle cannot be resolved. See http://statistics.netbeans.org/exceptions/messageslog?id=561205
Comment 4 Exceptions Reporter 2012-05-29 07:53:45 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=185201
Comment 5 Andrew Krasny 2012-06-18 20:55:42 UTC
Created attachment 121008 [details]
stacktrace
Comment 6 Jan Lahoda 2013-07-26 15:38:01 UTC
Created attachment 137867 [details]
Reproducible testcase

The problem appears to be that a client gets an ElementHandle from the index, which refers to an anonymous (or local) class, and this handle cannot be resolved. This appear to be caused by the Repair, which strips method bodies when the class' header is broken, which prevents the anonymous (and local) classes from being generated. But the index already contains references to them and returns them when someone asks.

To reproduce with the attach project:
1. unpack, open in the IDE, open both pkg208611.Broken and pkg208611.I in the editor
2. go to I and observe there is no implemented-by badge, and the log shows:
INFO [org.netbeans.api.java.source.ElementHandle]: Cannot resolve: ElementHandle[kind=CLASS; sigs=pkg208611.Broken$1 ]
3. go to Broken, and fix its superclass, go back to I: now the implemented-by badge appears and leads to Broken. But I think it should be present even in step 2.

Note:
http://hg.netbeans.org/jet-main/rev/c8a4bea8da78
Comment 7 Martin Balin 2015-09-17 11:24:11 UTC
Report from old NetBeans version. Due to code changes since it was reported likely not reproducible now. Feel free to reopen if happens in 8.0.2 or 8.1.