Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6507179

javadoc -source 1.3 does not work with jdk6

    XMLWordPrintable

Details

    • b02
    • x86
    • linux

    Backports

      Description

        FULL PRODUCT VERSION :
        betelgeuse@pena ~/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 :
        betelgeuse@pena ~/test/java $ uname -a
        Linux pena 2.6.19-gentoo-r2 #6 SMP Sat Dec 16 23:59:19 EET 2006 i686 Intel(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:
        betelgeuse@pena ~/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)
        betelgeuse@pena ~/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 -
        betelgeuse@pena ~/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 ----------
        betelgeuse@pena ~/test/java $ cat Hello.java
        public class Hello
        {
                private void assert(){;}
                public static void main(String[] args)
                {
                        System.out.println("Hello World!");
                }
        }

        ---------- END SOURCE ----------

        Attachments

          Issue Links

            Activity

              People

                sseligmasunw Scott Seligman (Inactive)
                ndcosta Nelson Dcosta (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: