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 246835 - java classes in resources folder override original jdk classes
Summary: java classes in resources folder override original jdk classes
Status: RESOLVED WONTFIX
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 8.0
Hardware: PC Linux
: P4 normal (vote)
Assignee: Tomas Stupka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-02 20:54 UTC by SimonSilvaLauinger
Modified: 2016-07-07 08:37 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
sample project (2.63 KB, application/zip)
2014-09-02 20:54 UTC, SimonSilvaLauinger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description SimonSilvaLauinger 2014-09-02 20:54:07 UTC
Created attachment 149013 [details]
sample project

I created a maven project which contains interfaces of the original java classes in the folder src/main/resources/java/ (e.g. src/main/resources/java/lang/Iterable.java). Now Netbeans thinks I want to use this files instead of the original java classes. Means that it warns for compiler errors (in this case the Iterable in the resource folder is not generic, but in my source code I use the original generic version).
At my point of view Netbeans should ignore the files in resources/java instead of compiling them and use them like they would be classes in src/main/java.
Before somebody asks: I really need this interfaces at this place, because they represent a subset of Java (JavaCard) which I need as resources in my program.
I added a sample project as attachment to show the bug.
Comment 1 Tomas Stupka 2015-06-15 13:37:25 UTC
reassigning for further evaluation
Comment 2 Svata Dedic 2015-07-23 13:36:35 UTC
Ouch; I believe that Maven does not other choice than put the resources folder onto SOURCE classpath, which is then read by parser/indexer and scanned for presence of .java files ...

The indexer process all text/x-java on the SOURCE classpath, regardless whether the path item is hinted as SOURCES_TYPE_JAVA or SOURCES_TYPE_RESOURCES

Tomasi, could it be the cause ?
Comment 3 Tomas Zezula 2015-07-23 13:39:26 UTC
Yes, the java knows nothing about the SOURCES_TYPE_JAVA or SOURCES_TYPE_RESOURCES hints. It uses ClassPath (sourcepath) and all roots on the source path are processed.
As far as I know the resources are on source path in maven project.
Comment 4 Svata Dedic 2015-08-07 15:37:02 UTC
I believe the issue should be solved (if it should be solved at all) in (maven) projects - so reassinging. IMHO we could just leave it as it is and document it as a known issue.
Comment 5 Martin Balin 2016-07-07 08:37:48 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss