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 44381 - Make it possible to get source level from CP root
Summary: Make it possible to get source level from CP root
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: PC Linux
: P1 blocker (vote)
Assignee: Tomas Zezula
URL:
Keywords: API
Depends on:
Blocks: 41535
  Show dependency tree
 
Reported: 2004-06-06 15:57 UTC by Martin Matula
Modified: 2007-09-26 09:14 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Proposed patch. (415 bytes, patch)
2004-06-06 15:58 UTC, Martin Matula
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Matula 2004-06-06 15:57:38 UTC
As we discussed before, we need to be able to get
source level for the whole classpath root (since
it does not make sense for files in a single
classpath to have different source roots). This
can be done by simply removing the check (if the
passed file is really a file rather than a folder)
from SourceLevelQuery. Attached patch does it. I
would like to propose its integration.
One issue that still remains to be solved is that
it seems that the query does not work if the cp
root is a jar file.
Comment 1 Martin Matula 2004-06-06 15:58:25 UTC
Created attachment 15500 [details]
Proposed patch.
Comment 2 Martin Matula 2004-06-06 22:33:22 UTC
Changing to RFE as recommended by Jesse.
Comment 3 David Konecny 2004-06-07 13:00:04 UTC
Fixed in:
Checking in src/org/netbeans/api/java/queries/SourceLevelQuery.java
new revision: 1.2; previous revision: 1.1

Re. JAR: you should be using SourceForBinaryQuery to get sources for 
the JAR and on these sources you can again use SourceLevelQuery.
However, this will work only for JAR produced by a project.

For Library JAR this would not work. You would have to bother user to
specify which SourceLevel the sources of the library JAR are. Or if
you are able to detect that from bytecode then Java Library could
implement SourceLevel query for library sources.
Comment 4 Martin Matula 2004-06-07 16:13:00 UTC
I don't care about jars with classfiles, but what about zip files with
sources? (src.zip)
Comment 5 David Konecny 2004-06-08 08:45:22 UTC
Sources for what? Java Library? Java Platform? Or a project?

I was talking about project and library case. And I still do not know
how to do that for library without asking user that question in Java
Library Manager UI.

For platform case it should be easy to do - Java Platform manager
could implement the SourceLevelQuery and answer it for JDK's
jar:file:/.../src.jar!/. Adding Tomas on CC, because that would be
most probably his job.
Comment 6 David Konecny 2004-06-08 09:30:16 UTC
Tomas, please impl the query for platform.
Comment 7 Tomas Zezula 2004-06-09 16:15:43 UTC
Added SLQ for J2SEPlatform
RCS file:
/cvs/java/j2seplatform/src/META-INF/services/org.netbeans.spi.java.queries.SourceLevelQueryImplementation,v
done
Checking in
src/META-INF/services/org.netbeans.spi.java.queries.SourceLevelQueryImplementation;
/cvs/java/j2seplatform/src/META-INF/services/org.netbeans.spi.java.queries.SourceLevelQueryImplementation,v
 <--  org.netbeans.spi.java.queries.SourceLevelQueryImplementation
initial revision: 1.1
done
Processing log script arguments...
More commits to come...
RCS file:
/cvs/java/j2seplatform/src/org/netbeans/modules/java/j2seplatform/platformdefinition/J2SEPlatformSourceLevelQueryImpl.java,v
done
Checking in
src/org/netbeans/modules/java/j2seplatform/platformdefinition/J2SEPlatformSourceLevelQueryImpl.java;
/cvs/java/j2seplatform/src/org/netbeans/modules/java/j2seplatform/platformdefinition/J2SEPlatformSourceLevelQueryImpl.java,v
 <--  J2SEPlatformSourceLevelQueryImpl.java
initial revision: 1.1
done
Comment 8 Tomas Zezula 2004-06-10 13:21:09 UTC
Added SLQ fir J2SELibs:
Checking in
j2seplatform/src/META-INF/services/org.netbeans.spi.java.queries.SourceLevelQueryImplementation;
/cvs/java/j2seplatform/src/META-INF/services/org.netbeans.spi.java.queries.SourceLevelQueryImplementation,v
 <--  org.netbeans.spi.java.queries.SourceLevelQueryImplementation
new revision: 1.2; previous revision: 1.1
done
Processing log script arguments...
More commits to come...
RCS file:
/cvs/java/j2seplatform/src/org/netbeans/modules/java/j2seplatform/libraries/J2SELibrarySourceLevelQueryImpl.java,v
done
Checking in
j2seplatform/src/org/netbeans/modules/java/j2seplatform/libraries/J2SELibrarySourceLevelQueryImpl.java;
/cvs/java/j2seplatform/src/org/netbeans/modules/java/j2seplatform/libraries/J2SELibrarySourceLevelQueryImpl.java,v
 <--  J2SELibrarySourceLevelQueryImpl.java
initial revision: 1.1
done