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 164541 - Exception on find usages of method in enum constant
Summary: Exception on find usages of method in enum constant
Status: RESOLVED DUPLICATE of bug 179621
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jan Lahoda
URL:
Keywords:
: 164540 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-05-05 23:33 UTC by _ tboudreau
Modified: 2010-12-21 09:06 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ tboudreau 2009-05-05 23:33:32 UTC
Create the following enum.  Right-click the get method and choose Find Usages.  Click OK in the resulting dialog.  The
exception reported in http://statistics.netbeans.org/analytics/exception.do?id=199213 is thrown. 

The refactoring dialog says the Spring Beans module is the cause, but no idea where to file bugs against it.

100% reproducible.

public enum Foo {
    BAR,
    BOO,
    BAZ {
        public void foo() {
            
        }
    };
}
Comment 1 Dusan Balek 2009-05-06 12:59:05 UTC
The problem is in org.netbeans.modules.spring.beans.refactoring.SpringRefactorings class. It calls
CompilationController.toPhase(ELEMENTS_RESOLVED) and tries to resolve TreePathHandle pointing to a method inside an
anonymous inner class. However, to resolve such TreePathHandle correctly, you need fully attributed AST (including
method bodies). CompilationController.toPhase(RESOLVED) is correct in such case.
Comment 2 Dusan Balek 2009-05-06 13:54:05 UTC
*** Issue 164540 has been marked as a duplicate of this issue. ***
Comment 3 Milan Kuchtiak 2009-05-13 10:53:27 UTC
Fixed, according to dbalek recommendation:

Details:
http://hg.netbeans.org/main/rev/af2c4a60b9bf
Comment 4 _ gtzabari 2009-10-25 20:49:11 UTC
Reproduced in Netbeans 6.8. See http://statistics.netbeans.org/analytics/exception.do?id=286302

If I recall correctly, I CTRL+LMB on a method name and got this exception.
Comment 5 Dusan Balek 2009-10-26 13:37:04 UTC
Gili, are you able to reproduce it on your sources? Thanks.
Comment 6 _ gtzabari 2009-10-29 14:39:59 UTC
dbalek,

I don't understand what you mean. What should I be trying out?
Comment 7 Dusan Balek 2009-10-29 15:07:44 UTC
You have reopened this bug because you were able to reproduce the AssertionError again in NB 6.8. My question is: do you
have the steps to reproduce or was it just random?
Comment 8 _ gtzabari 2009-10-29 17:15:58 UTC
Sorry, it was random. I was under the impression that the report I pointed to contains a log of my actions.
Comment 9 Milan Kuchtiak 2009-10-29 17:40:55 UTC
I cannot reproduce the issue in 6.8.
If you can reproduce, please, describe the use case.
Comment 10 asmotrich 2010-12-08 20:17:01 UTC
Just added the report #450427, it's happening in the latest dev build again. There is another very strange compiler related problem there, still trying to come up with a test case I can send you.
Comment 11 Petr Jiricka 2010-12-16 18:49:03 UTC
Adjusting the category.
Comment 12 Jan Lahoda 2010-12-21 09:06:16 UTC

*** This bug has been marked as a duplicate of bug 179621 ***