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 221499 - Go to type is opening wrong binary and source instead of binary class
Summary: Go to type is opening wrong binary and source instead of binary class
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Navigation (show other bugs)
Version: 7.3
Hardware: PC Windows 7 x64
: P3 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-05 15:43 UTC by crazyjavahacking
Modified: 2012-11-08 02:50 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
mavenProjects (287.52 KB, application/zip)
2012-11-05 15:44 UTC, crazyjavahacking
Details
openingIncorrectEGitBinary (1.34 KB, application/zip)
2012-11-05 15:44 UTC, crazyjavahacking
Details
openingSourceInsteadOfEGitBinary (7.03 MB, application/zip)
2012-11-06 15:55 UTC, crazyjavahacking
Details

Note You need to log in before you can comment on or make changes to this bug.
Description crazyjavahacking 2012-11-05 15:43:46 UTC
Go to type is opening wrong binary (1.) and source instead of binary class (2.)

To reproduce:
1.) open all 3 projects from 'MavenProjects.zip'
2.) open 'openingIncorrectEGitBinary.zip'
3.) CTRL + O and search for IGit*Constants
=> 4 items should be found and the last one (EGit 1.3.6 would open EGit 2.1.0 binary)

4.) close project from 'openingIncorrectEGitBinary.zip' and open 'openingSourceInsteadOfEGitBinary.zip' project
5.) again CTRL + O and search for IGit*Constants
=> 4 items should be found and the last one (EGIt 1.3.6 would open source file)



NetBeans 7.3 Beta 2, JDK 6u34
Comment 1 crazyjavahacking 2012-11-05 15:44:06 UTC
Created attachment 127157 [details]
mavenProjects
Comment 2 crazyjavahacking 2012-11-05 15:44:26 UTC
Created attachment 127159 [details]
openingIncorrectEGitBinary
Comment 3 Tomas Zezula 2012-11-05 16:22:26 UTC
Probably wrong maven classpath.
Comment 4 Tomas Zezula 2012-11-06 09:38:53 UTC
The report is incomplete so I cannot reproduce the problem.
After step 3 I have only 3 item none from EGit 1.3.6 seems a different content of .m2.
Also there is no 'openingSourceInsteadOfEGitBinary.zip'.

The problem is probably the compile classpath reported by the maven. for example for org.eclipse.egit.github.core-2.1.0.jar the compile cp is:

/Users/tom/Downloads/mor/MavenProjects/mavenproject1/target/classes:/Users/tom/.m2/repository/com/google/code/gson/gson/2.1/gson-2.1.jar:/Users/tom/.m2/repository/org/testng/testng/6.7/testng-6.7.jar:/Users/tom/Downloads/mor/MavenProjects/EGit_2_1_0/target/classes:/Users/tom/Downloads/mor/MavenProjects/EGit_2_0_4/target/classes:/Users/tom/.m2/repository/org/yaml/snakeyaml/1.6/snakeyaml-1.6.jar:/Users/tom/Downloads/mor/mavenproject3/target/test-classes:/Users/tom/.m2/repository/org/beanshell/bsh/2.0b4/bsh-2.0b4.jar:/Users/tom/.m2/repository/com/beust/jcommander/1.12/jcommander-1.12.jar:/Users/tom/Downloads/mor/MavenProjects/EGit_2_0_4/target/test-classes:/Users/tom/.m2/repository/junit/junit/4.10/junit-4.10.jar:/Users/tom/Downloads/mor/MavenProjects/mavenproject1/target/test-classes:/Users/tom/Downloads/mor/mavenproject3/target/classes:/Users/tom/Downloads/mor/MavenProjects/EGit_2_1_0/target/test-classes:/Users/tom/.m2/repository/joda-time/joda-time/2.1/joda-time-2.1.jar:/Users/tom/.m2/repository/org/eclipse/mylyn/github/org.eclipse.egit.github.core/2.1.0/org.eclipse.egit.github.core-2.1.0.jar:/Users/tom/.m2/repository/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.jar

which is strange when the type in cp from 2.1.0 shadows the file from 1.3.6 it opens the one from 2.1.0 which is correct. The problem is the mvn provided classpath.
I believe I can narrow the CP to prevent such a problem.
However as there is no reproduceable test case it's hard to say if it's the case.
Comment 5 Tomas Zezula 2012-11-06 10:15:32 UTC
Fixed jet-main 7287144dbcd9
Comment 6 crazyjavahacking 2012-11-06 15:55:04 UTC
Created attachment 127237 [details]
openingSourceInsteadOfEGitBinary
Comment 7 crazyjavahacking 2012-11-06 15:59:52 UTC
Attached forgotten Maven multimodule project.

In step 3 you need to open the nested Maven project called 'nested project'.
Comment 8 Quality Engineering 2012-11-08 02:50:47 UTC
Integrated into 'main-golden', will be available in build *201211080001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/7287144dbcd9
User: Tomas Zezula <tzezula@netbeans.org>
Log: #221499:Go to type is opening wrong binary and source instead of binary class