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.
A problem appears when Java and Native projects are nested within each other. Cases (⊃ - contains): 1) Java ⊃ Native -- OK 2) Native ⊃ Java -- issue 3) Java ⊃ Native source folder -- OK 4) Native source folder ⊃ Java -- issue Need to test Native ⊃ Native case. The issue: Java class visibility problem, java find usages doesn't work, etc.
Observed behavior: * issue is always reproducible in "Open Projects" scope * in other scopes (current project, package, ...) issue is reproducible after a couple of refactorings.
5) Native ⊃ Native and 6) Java ⊃ Java seems to work OK
Maybe the problem comes from a method ClassPath.getClassPath(FileObject, String) MakeProjectClassPath claims that he is an owner of inner Java project too.
Another problem appeared while fixing the bug: Determined project scope in case 4 (case 2 -- OK) is not correct for Java. * Alt+F7 to call "find usages" window in inner Java project * Scope: current project it shows enclosing Native project instead of inner Java project fixed in rev/6aa2bfb4145e
Created attachment 144161 [details] Java in Native project (case 2)
About primary problem (see hierarchy in attachment) 1. Cpp project "Cpp_Outer_2" registers it's own ClassPath /home/ilia/NetBeansProjects/Cpp_Outer_2 in MakeProject.registerClassPath(boolean) then 2. ClassPath.getClassPath(FileObject, String) asks every ClassPathProvider if some FileObject belongs to their "some kind of classpath". cnd implementation of this provider checks if "Cpp_Outer_2" cp contains this FileObject. file example: /home/ilia/NetBeansProjects/Cpp_Outer_2/Java_Inner_2/src Apparently this check returns "true" what is not expected. Need to investigate if a class MakeProjectClassPathProvider is needed (it was created because of #215926 bug which may be not actual in 7.4)
Integrated into 'main-silver', will be available in build *201401210001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/6aa2bfb4145e User: Ilia Gromov <ilia@netbeans.org> Log: fixing Bug 240182 - Java vs Native project (Native project files handle priority hides them from Java projects view) - Changed provider priority;
Integrated into 'main-silver', will be available in build *201401220001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/3e2226c0beb7 User: Ilia Gromov <ilia@netbeans.org> Log: reverting changes for Bug 240182 - Java vs Native project (Native project files handle priority hides them from Java projects view)
Integrated into 'main-silver', will be available in build *201402060001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/c2c5973dbe45 User: Ilia Gromov <ilia@netbeans.org> Log: fixed #Bug 240182 - Java vs Native project (Native project files handle priority hides them from Java projects view) - Provider for native projects moved from 98 to 102 priority - New provider with 98 priority, that have a look only on file objects with Cnd MIME type
As it turned out one case don't work correctly after this fix; Native ⊃ Java: 1) Open "Find Usages" 2) Select "Open Projects" scope result -- zero occurrences.
extra fix http://hg.netbeans.org/cnd-main/rev/6aa467827aef
Integrated into 'main-silver', will be available in build *201403010001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/6aa467827aef User: Ilia Gromov <ilia@netbeans.org> Log: additional fix for Bug #240182 - Java vs Native project (Native project files handle priority hides them from Java projects view) - fixed - added some logging
Integrated into 'releases/release80', will be available in build *201404240045* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/8e3f9c110936 User: Ilia Gromov <ilia@netbeans.org> Log: additional fix for Bug #240182 - Java vs Native project (Native project files handle priority hides them from Java projects view) - fixed - added some logging (transplanted from 6aa467827aefd1aaecf8e8959b0805e9cf875385)