Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 202329 - Clarification of "1.6" vs. "6" in SourceLevelQuery
Clarification of "1.6" vs. "6" in SourceLevelQuery
Product: java
Classification: Unclassified
Component: Classpath
All All
: P3 (vote)
: 7.2
Assigned To: Tomas Zezula
Depends on:
  Show dependency treegraph
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


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 (upload may still be in progress)
User: Tomas Zezula <>
Log: #202329:Clarification of "1.6" vs. "6" in SourceLevelQuery

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo