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 113765 - NB6 daily build is unable to find some classes on source classpath
Summary: NB6 daily build is unable to find some classes on source classpath
Status: RESOLVED INVALID
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-24 19:52 UTC by kcr
Modified: 2007-09-26 09:14 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Test project (1.43 KB, application/octet-stream)
2007-08-28 12:36 UTC, Tomas Zezula
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kcr 2007-08-24 19:52:31 UTC
When I tried the 6.0-200708211200 daily build, it complained of not being able to find one of my classes in our
free-form project. This class is generated by our custom ant script at build time, so we don't include it in the source
package folder of our project. We *do* include it in the source classpath folder (even this was unnecessary in NB5.5).
However, it still cannot find the class.

This is a regression from 6.0m10, which works for us.

To reproduce this, unzip the attached directory and load the "j3d-core" project. You will notice the red "error" icon.
When you navigate to the javax.media.j3d.VirtualUniverse class, you will see that VersionInfo cannot be found. The
object code for this class is in j3dcore.jar, which is one of the output targets of the project. The source code is in
j3d-core/build/default/debug/gen/classes which is included in the source classpath.
Comment 1 kcr 2007-08-24 19:59:53 UTC
Since the project is too big to attach (10 Mbytes compressed), here is a pointer to it:

http://download.java.net/media/java3d/bugs/nb-bugs/113765.zip
Comment 2 kcr 2007-08-24 20:06:22 UTC
As a workaround, if we put the source directory containing the auto-generated VersionInfo.java file into the "source
package folders" then it works.
Comment 3 Tomas Zezula 2007-08-28 10:12:59 UTC
The workaround is the right solution, the reported behavior is a fix. You cannot have java source files on the
classpath, the java compiler does not list the source file in the classpath, you have to have them in the source path.
See:
https://openjdk.dev.java.net/source/browse/openjdk/jdk/trunk/j2se/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java?rev=247&view=markup
fillIn(PackageSymbol p) where the completer lists only classfiles from classpath if there is at least one source folder
given on source path. 

I will also add an test containing src folder with Main class which imports Library stored in lib folder, the lib folder
is on the classpath. The project is uncompilable (ant compile) if there is no class file of Library.java in the lib
root. NetBeans reports the same errors as the java compiler.

When you add the folder to source path it works fine, in the current build there is some problem with freeform project
causing several errors to appear after this change until ide restart, I've reported it in issue #113953.
Comment 4 Tomas Zezula 2007-08-28 12:36:13 UTC
Created attachment 47602 [details]
Test project