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 240182 - Java vs Native project (Native project files handle priority hides them from Java projects view)
Summary: Java vs Native project (Native project files handle priority hides them from ...
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Project (show other bugs)
Version: 7.4
Hardware: PC Linux
: P3 normal (vote)
Assignee: ilia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-10 08:37 UTC by ilia
Modified: 2014-04-24 02:03 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Java in Native project (case 2) (1.79 KB, text/plain)
2014-01-20 16:37 UTC, ilia
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ilia 2014-01-10 08:37:41 UTC
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.
Comment 1 ilia 2014-01-16 07:20:37 UTC
Observed behavior:
* issue is always reproducible in "Open Projects" scope
* in other scopes (current project, package, ...) issue is reproducible 
  after a couple of refactorings.
Comment 2 ilia 2014-01-16 09:09:15 UTC
5) Native ⊃ Native
    and
6) Java ⊃ Java

seems to work OK
Comment 3 ilia 2014-01-20 11:15:13 UTC
Maybe the problem comes from a method
ClassPath.getClassPath(FileObject, String)

MakeProjectClassPath claims that he is an owner of inner Java project too.
Comment 4 ilia 2014-01-20 15:52:52 UTC
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
Comment 5 ilia 2014-01-20 16:37:27 UTC
Created attachment 144161 [details]
Java in Native project (case 2)
Comment 6 ilia 2014-01-20 16:58:35 UTC
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)
Comment 7 Quality Engineering 2014-01-21 02:57:45 UTC
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;
Comment 8 Quality Engineering 2014-01-22 02:34:45 UTC
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)
Comment 9 Quality Engineering 2014-02-06 02:50:06 UTC
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
Comment 10 ilia 2014-02-28 13:47:07 UTC
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.
Comment 11 Vladimir Voskresensky 2014-02-28 16:05:04 UTC
extra fix
http://hg.netbeans.org/cnd-main/rev/6aa467827aef
Comment 12 Quality Engineering 2014-03-01 06:14:19 UTC
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
Comment 13 Quality Engineering 2014-04-24 02:03:57 UTC
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)