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.
In the current build, selecting the Files pane in the Explorer and browsing a build directory shows all class files as having errors, although nothing is reported to the log. For example, open the classfile project, display its files, then open build/classes/org/netbeans/modules/classfile to see that all the files have red X's. Opening any of them shows an "Error" child node.
Moved to new subcomponent java/javacore.
It seems to me like problem in apisupport, since ordinary J2SE project works fine.
[Is this really P2? Sounds like a P3 to me.] Yes, it is necessary for the ClassPathProvider to return some information about *.class files as well as *.java for them to be parsable. Exactly what information is required, I am not sure; j2seproject returns some but it is not apparent what is being used. For example, I think SOURCE has to point to the root of the compiled classes dir, despite the name which implies that it only applies to source files. Whether COMPILE, BOOT, and EXECUTE are used, I don't know. Tomas, please update the Javadoc for ClassPath to specify which CP types are required or recommended for *.class files in order to be able to browse their structure without errors (and describe exactly what the contents should be), then reassign to me to implement in the NBM project type.
For compiled classes the ClassPathProvider has to return the ClassPath.EXEC pointing to the output dir, ClassPath.COMPILE the same as for sources and ClassPath.BOOT also the same as for sources. The ClassPath.SOURCE should be null. Checking in src/org/netbeans/spi/java/classpath/package.html; /cvs/java/api/src/org/netbeans/spi/java/classpath/package.html,v <-- package.html new revision: 1.3; previous revision: 1.2 done
Well j2seproject's ClassPathProviderImpl.getSourcepath returns non-null for *.class files. So is it necessary or not? If yes, fix the docs; if no, remove that impl. Further, CPPI.getCompileTimeClasspath returns null for *.class files.
And Tomas Hurka just made some commit in javacore that seems to use CP.EXECUTE, not CP.SOURCE, for *.class files. ??
For clazz module it is not necessary to return ClassPath.SOURCE. At least I hope so, if it will caouse problem it is a bug in clazz module. The doc is OK, I will remove the Source from j2se ClassPathProvider. Yes, Tomas has corrected the JMManager.java to behave according to documentation.
I can fix this issue. I am doing now the same for DefaultClassPathProvider. Feel free to reassign it to me.
OK, just make sure there is unit test coverage in apisupport/project for it. I don't really mind writing the code if I know for sure what it is supposed to return.
Checking in project/src/org/netbeans/modules/apisupport/project/ClassPathProviderImpl.java; /cvs/apisupport/project/src/org/netbeans/modules/apisupport/project/ClassPathProviderImpl.java,v <-- ClassPathProviderImpl.java new revision: 1.31; previous revision: 1.30 done Processing log script arguments... More commits to come... Checking in project/test/unit/src/org/netbeans/modules/apisupport/project/ClassPathProviderImplTest.java; /cvs/apisupport/project/test/unit/src/org/netbeans/modules/apisupport/project/ClassPathProviderImplTest.java,v <-- ClassPathProviderImplTest.java new revision: 1.4; previous revision: 1.3 done
This issue was solved long time ago. Because nobody has reopened it neither added comments, we are verifying/closing it now. If you are still able to reproduce the problem, please reopen. Thanks in advance.