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 202329 - Clarification of "1.6" vs. "6" in SourceLevelQuery
Summary: Clarification of "1.6" vs. "6" in SourceLevelQuery
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Classpath (show other bugs)
Version: 7.1
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords: API
Depends on:
Blocks:
 
Reported: 2011-09-19 18:36 UTC by Jesse Glick
Modified: 2012-06-08 06:10 UTC (History)
0 users

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 Jesse Glick 2011-09-19 18:36:13 UTC
SourceLevelQuery.getSourceLevel says to see tool docs for acceptable return values; technotes/tools/solaris/javac.html#options gives "6" as a synonym for "1.6", etc. Yet the SOURCE_LEVEL pattern will reject this if supplied by SourceLevelQueryImplementation or SourceLevelQueryImplementation2.Result (whose Javadoc lists the 1.x formats as examples but is otherwise silent on acceptable values).

Since API clients should not have to deal with synonyms, and SPI implementations such as Maven's might be coming across e.g. <source>6</source>, I would propose that SourceLevelQuery accept \d+ versions but quietly prefix them with "1." before returning.

Alternately, document that SLQI must return versions in canonical form, and make impls such as MavenSourceLevelImpl do this conversion.
Comment 1 Tomas Zezula 2012-06-06 14:32:32 UTC
>I would propose that SourceLevelQuery accept \d+ versions but quietly prefix
>them with "1." before returning.
Yes. It's how it should work.
Comment 2 Tomas Zezula 2012-06-07 07:01:45 UTC
Fixed jet-main 3e8c0b35fa3f
Comment 3 Quality Engineering 2012-06-08 06:10:36 UTC
Integrated into 'main-golden', will be available in build *201206080001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/3e8c0b35fa3f
User: Tomas Zezula <tzezula@netbeans.org>
Log: #202329:Clarification of "1.6" vs. "6" in SourceLevelQuery