Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6507179
Votes 22
Synopsis javadoc -source 1.3 does not work with jdk6
Category java:javadoctool
Reported Against
Release Fixed 6u2(b02), 6-open(b03) (Bug ID:2152483) , 7(b31) (Bug ID:2155621)
State 10-Fix Delivered, bug
Priority: 2-High
Related Bugs
Submit Date 21-DEC-2006
Description
FULL PRODUCT VERSION :
  xxxxx@xxxxx   ~/test/java $ java -version
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
  xxxxx@xxxxx   ~/test/java $ uname -a
Linux pena 2.6.19-gentoo-r2 #6 SMP Sat Dec 16 23:59:19 EET 2006 i686  customer (R) Core(TM)2 CPU          6600  @ 2.40GHz GenuineIntel GNU/Linux

A DESCRIPTION OF THE PROBLEM :
javadoc -source 1.3 does not work any more with 1.6. This behaviour is inconsistent with the help message when running javadoc without -source 1.3 and -source 1.3 used to work correctly in 1.5.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run javadoc -source 1.3 on a code containing assert in a place where a keyword is expected.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
  From 1.5:
  xxxxx@xxxxx   ~/test/java $ java -version
java version "1.5.0_10"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_10-b03)
Java HotSpot(TM) Server VM (build 1.5.0_10-b03, mixed mode)
  xxxxx@xxxxx   ~/test/java $ javadoc -source 1.3 Hello.java
Loading source file Hello.java...
Hello.java:3: warning: as of release 1.4, 'assert' is a keyword, and may not be used as an identifier
(try -source 1.4 or higher to use 'assert' as a keyword)
        private void assert(){;}
                     ^
Constructing Javadoc information...
Standard Doclet version 1.5.0_10
Building tree for all the packages and classes...
Generating Hello.html...
Generating package-frame.html...
Generating package-summary.html...
Generating package-tree.html...
Generating constant-values.html...
Building index for all the packages and classes...
Generating overview-tree.html...
Generating index-all.html...
Generating deprecated-list.html...
Building index for all classes...
Generating allclasses-frame.html...
Generating allclasses-noframe.html...
Generating index.html...
Generating help-doc.html...
Generating stylesheet.css...
1 warning

ACTUAL -
  xxxxx@xxxxx   ~/test/java $ javadoc -source 1.3 Hello.java
Loading source file Hello.java...
Hello.java:3: as of release 1.4, 'assert' is a keyword, and may not be used as an identifier
(use -source 1.3 or lower to use 'assert' as an identifier)
        private void assert(){;}
                     ^
1 error
betelgeuse

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
  xxxxx@xxxxx   ~/test/java $ cat Hello.java
public class Hello
{
        private void assert(){;}
        public static void main(String[] args)
        {
                System.out.println("Hello World!");
        }
}

---------- END SOURCE ----------
Posted Date : 2006-12-21 14:02:08.0
Work Around
N/A
Evaluation
The Source object is being initialized before the "-source" option
has been parsed.

The javadoc tool initializes its Messager (a javac Log) early on:
even before the command line is fully parsed, since it uses the Messager
in several ways during parsing.

Before JDK 6 this was safe, as the Log didn't access the
Source object.  But since JDK 6 it does access it, to determine
if mandatory warnings are in effect.  Thus the Source object
is being initialized earlier now, leading to the problem.
Posted Date : 2007-03-14 02:23:06.0
Comments
  
  Include a link with my name & email   

Submitted On 23-JAN-2007
- source 1.4 is also ignored with 'enum' used as identifier



PLEASE NOTE: JDK6 is formerly known as Project Mustang