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 227717 - Dependent root is not found for freeform projects with separate claspath for each src folder
Summary: Dependent root is not found for freeform projects with separate claspath for ...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 7.3.1
Hardware: All All
: P3 normal with 5 votes (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-20 12:49 UTC by Ralph Ruijs
Modified: 2015-09-15 01:24 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 Ralph Ruijs 2013-03-20 12:49:55 UTC
When using a freeform project with "Separate Classpath for Each Source Package Folder" selected in the project properties, the method SourceUtils.getDependentRoots(sourceRoot, false); will not return the dependent source root from the same project.

See #226803 for a sample project and more information.
Comment 1 locutus 2015-08-28 15:13:04 UTC
Please fix this bug ASAP for next release because its impossible to configure a working JUnit-Source-Package in a freeform project without running into issues drawbacks.
I tried to reconfigure our freeform project using same classpath for all source folder as workaround but that deleted the JUnit-Package-Folder declaration.

So currently I have to choose between a working JUnit integration (including navigation option "Go to Test/Tested class") or a refactorable integration of JUnits sources with working refactoring options e.g. "find usage".

Product Version: NetBeans IDE 8.0.2 (Build 201411181905)
Updates: NetBeans IDE is updated to version NetBeans 8.0.2 Patch 2
Java: 1.7.0_21; Java HotSpot(TM) 64-Bit Server VM 23.21-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_21-b11
System: Windows 7 version 6.1 running on amd64; Cp1252; de_DE (nb)
User directory: C:\NetBeansProfiles\8.0
Cache directory: D:\NetBeansScratch\8.0
Comment 2 Tomas Zezula 2015-09-10 14:57:37 UTC
Looking at the project https://netbeans.org/bugzilla/attachment.cgi?id=131984 from the issue #226803 the project is clearly wrongly configured. It mixes source path with class path.
I will verify if fixing the project will resolve the problem.
Comment 3 Tomas Zezula 2015-09-10 15:45:56 UTC
Also there is a message about the misconfigured project in the log:

INFO [org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater]: The root file:/Users/tom/Downloads/test-project/modules/shared/src/ is registered for both classpath/compile and [classpath/source]

Here is a link to wiki how to correctly configure the FreeForm project:
http://wiki.netbeans.org/FaqScanningAndIndexingPerformanceHints#Configure_your_freeform_projects_correctly
Comment 4 Tomas Zezula 2015-09-10 16:20:12 UTC
Fixing the freeform project set up resolved the problem, so the issue is invalid.
Please refer to the wiki page from my previous comment.
On the other side it's quite common issue in freeform to mix source path with class path.

Maybe the freeform should do something like this:
When user does not specify the output of source roots some artificial one will be created by freeform (invisible to user) and when user adds the source root to classpath the freeform internally translates it to the artificial output root.
This will make the broken freeform correct java project from javac point of view.
Comment 5 Tomas Zezula 2015-09-14 06:16:00 UTC
fixed jet-main 75e6f1f83f3f.

I've added internal freeform project classpaths reconfiguration when the project is wrongly configured as described in my previous comment. This reconfiguration fixes the problem when the freeform mixes -sourcepath with -classpath, which is quite common for freeforms with separate compilation units. However it's preferable to correctly configure the freeform output folders and put the output folder on classpath as described in the wiki.
Comment 6 Quality Engineering 2015-09-15 01:24:43 UTC
Integrated into 'main-silver', will be available in build *201509150002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/75e6f1f83f3f
User: Tomas Zezula <tzezula@netbeans.org>
Log: #227717:Dependent root is not found for freeform projects with separate claspath for each src folder