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 191518 - "Find usages" does not work on generated classes in maven-based projects
Summary: "Find usages" does not work on generated classes in maven-based projects
Status: RESOLVED DUPLICATE of bug 190852
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.0
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: Milos Kleint
URL:
Keywords:
Depends on:
Blocks: 192647
  Show dependency tree
 
Reported: 2010-11-01 13:57 UTC by m_potociar
Modified: 2012-04-23 11:40 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Generated sources in Project pane (23.02 KB, image/png)
2010-11-02 10:20 UTC, m_potociar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description m_potociar 2010-11-01 13:57:09 UTC
When searching for a usage of a static method that belongs to a generated class in a maven-based project, NB returns "0 occurrences" although the method is obviously used from a class in the same project (currently opened in NB). 

(Interestingly, reverse navigation <shift+cmd+B> from the place of the method usage to the actual method definition in the generated class works just fine.)
Comment 1 Jan Becicka 2010-11-02 08:53:28 UTC
I have no idea, what is "generated class". How this class was generated and where? Is it on project class path?
Comment 2 m_potociar 2010-11-02 10:20:15 UTC
Created attachment 102754 [details]
Generated sources in Project pane
Comment 3 m_potociar 2010-11-02 10:26:44 UTC
Generated class is a class that is (obviously) generated from some other data file. This particular class is being generated from a .properties file, but that's irrelevant IMHO.

The class appears in the maven project (in the Project tab) under "Generated classes" - see attached snapshot.

How to reproduce:
=================
1. Checkout the project: 
cvs -d :pserver:guest@cvs.dev.java.net:/cvs co -AP -d project wsit/wsit/ws-rx/wsmc-impl

2. cd project

3. mvn clean install (requires maven 2.2.1; must not use maven 3.0)

4. Open project in NB

5. Open LocalizationMessages class (<Ctrl+O> or can be found under "Generated sources")

6. Navigate to public static String WSMC_0102_NO_SOAP_HEADERS() method

7. Try to find usages (expected result: 0 ccurrences)

8. Open com.sun.xml.ws.rx.mc.runtime.McClientTube class

9. Check that the method is actually used in the processRequest(...) method, line 142

10. Try to navigate from that method to the method definition in LM class (expected result: go to definition navigation works)
Comment 4 Jan Becicka 2010-11-02 10:38:19 UTC
It looks like generated classes are not on source path. Find usages works only with classes on source path...
Comment 5 Jesse Glick 2011-03-11 15:24:01 UTC
Probably a duplicate of bug #190852.
Comment 6 Jesse Glick 2012-02-21 14:22:34 UTC
Related to bug #192647.
Comment 7 Milos Kleint 2012-04-04 09:57:06 UTC
(In reply to comment #3)

> How to reproduce:
> =================
> 1. Checkout the project: 
> cvs -d :pserver:guest@cvs.dev.java.net:/cvs co -AP -d project
> wsit/wsit/ws-rx/wsmc-impl
> 

current sources are in svn at https://svn.java.net/svn/wsit~svn


> 2. cd project
> 
> 3. mvn clean install (requires maven 2.2.1; must not use maven 3.0)

Seems to be no longer the case, built fine with 3.0.x

> 
> 4. Open project in NB
> 
> 5. Open LocalizationMessages class (<Ctrl+O> or can be found under "Generated
> sources")
> 
> 6. Navigate to public static String WSMC_0102_NO_SOAP_HEADERS() method
> 
> 7. Try to find usages (expected result: 0 ccurrences)

in both 7.1.1 and current dev, I do get 1 occurence shown..

> 
> 8. Open com.sun.xml.ws.rx.mc.runtime.McClientTube class
> 
> 9. Check that the method is actually used in the processRequest(...) method,
> line 142
> 
> 10. Try to navigate from that method to the method definition in LM class
> (expected result: go to definition navigation works)

again in both 7.1.1 and current dev, this appears to be working.


the issue's platform is macosx, I've tried on the same platform.
Comment 8 Milos Kleint 2012-04-23 11:40:34 UTC
tried again today with latest dev build and clean userdir, again cannot reproduce, all behaves as it should.

closing as duplicate of 190852 as hinted by jglick. (other option is worksforme, but the issues look close enough)

please try in the upcoming 7.2 beta or latest dev build and reopen if the issue persists for you, thank you.

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