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 44845 - NBM project should define CP for compiled classes
Summary: NBM project should define CP for compiled classes
Status: CLOSED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Project (show other bugs)
Version: 4.x
Hardware: PC All
: P3 blocker (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-14 22:02 UTC by _ tball
Modified: 2006-03-24 10:18 UTC (History)
1 user (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 _ tball 2004-06-14 22:02:48 UTC
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.
Comment 1 Tomas Hurka 2004-06-22 08:41:05 UTC
Moved to new subcomponent java/javacore.
Comment 2 Tomas Hurka 2004-07-09 08:50:21 UTC
It seems to me like problem in apisupport, since ordinary J2SE project works fine.
Comment 3 Jesse Glick 2004-07-09 20:04:05 UTC
[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.
Comment 4 Tomas Zezula 2004-07-12 13:16:31 UTC
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
Comment 5 Jesse Glick 2004-07-12 21:46:31 UTC
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.
Comment 6 Jesse Glick 2004-07-20 16:30:52 UTC
And Tomas Hurka just made some commit in javacore that seems to use
CP.EXECUTE, not CP.SOURCE, for *.class files. ??
Comment 7 Tomas Zezula 2004-07-20 18:07:10 UTC
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.
Comment 8 Tomas Zezula 2004-07-20 18:10:15 UTC
I can fix this issue. I am doing now the same for
DefaultClassPathProvider. Feel free to reassign it to me.
Comment 9 Jesse Glick 2004-07-20 18:49:05 UTC
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.
Comment 10 Tomas Zezula 2004-07-29 12:50:30 UTC
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
Comment 11 Marian Mirilovic 2005-12-20 15:49:15 UTC
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.