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

javadoc requires a trailing / for links where java 7's javadoc didn't

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 9
    • 8
    • tools
    • b10
    • x86_64
    • linux
    • Verified

    Backports

      Description

        FULL PRODUCT VERSION :
        java version "1.8.0"
        Java(TM) SE Runtime Environment (build 1.8.0-b132)
        Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode)


        ADDITIONAL OS VERSION INFORMATION :
        Ubuntu Linux 13.10, x86_64

        A DESCRIPTION OF THE PROBLEM :
        First noticed with gradle while building the javadoc for one of my projects. From the debug file:

        ----
        11:59:45.949 [INFO] [org.gradle.process.internal.DefaultExecHandle] Starting process 'command '/opt/sunjdk/1.8/jdk1.8.0/bin/javadoc''. Working directory: /home/fge/src/perso/largetext Command: /opt/sunjdk/1.8/jdk1.8.0/bin/javadoc @/home/fge/src/perso/largetext/build/tmp/javadoc/javadoc.options
        ----

        The javadoc.options file contains the following:

        ----
        -classpath '/home/fge/src/perso/largetext/build/classes/main:/home/fge/src/perso/largetext/build/resources/main:/home/fge/.gradle/caches/modules-2/files-2.1/com.google.guava/guava/16.0.1/5fa98cd1a63c99a44dd8d3b77e4762b066a5d0c5/guava-16.0.1.jar:/home/fge/.gradle/caches/modules-2/files-2.1/com.google.code.findbugs/jsr305/2.0.1/516c03b21d50a644d538de0f0369c620989cd8f0/jsr305-2.0.1.jar'
        -d '/home/fge/src/perso/largetext/build/docs/javadoc'
        -doctitle 'largetext 0.1-SNAPSHOT API'
        -link 'http://docs.oracle.com/javase/7/docs/api'
        -link 'http://jsr-305.googlecode.com/svn/trunk/javadoc'
        -link 'http://docs.guava-libraries.googlecode.com/git-history/v16.0.1/javadoc'
        -quiet
        -overview 'src/main/java/overview.html'
        -windowtitle 'largetext 0.1-SNAPSHOT API'
        '/home/fge/src/perso/largetext/src/main/java/com/github/fge/largetext/LargeTextFactory.java'
        [ etc etc]
        ---

        But the javadoc process does not find the links. From the debug file again:

        ----
        11:59:47.959 [ERROR] [system.err] javadoc: warning - Error fetching URL: http://docs.oracle.com/javase/7/docs/api
        11:59:48.217 [ERROR] [system.err] javadoc: warning - Error fetching URL: http://jsr-305.googlecode.com/svn/trunk/javadoc
        11:59:48.472 [ERROR] [system.err] javadoc: warning - Error fetching URL: http://docs.guava-libraries.googlecode.com/git-history/v16.0.1/javadoc
        ----

        The workaround is to add trailing slashes to the links, ie:

        http://docs.oracle.com/javase/7/docs/api/

        instead of:

        http://docs.oracle.com/javase/7/docs/api

        Java 7's javadoc didn't have this problem.

        REGRESSION. Last worked in version 7u51

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Write an options file for the javadoc tool; add in it:

        ----
        -link 'http://docs.oracle.com/javase/7/docs/api'
        ----

        and all other relevant options. Launch the javadoc tool with "javadoc @path/to/optionfile".

        See that the command generates a warning on stderr:

        warning - Error fetching URL: http://docs.oracle.com/javase/7/docs/api


        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        The javadoc is generated properly, with external links
        ACTUAL -
        The javadoc tool is unable to find the links

        ERROR MESSAGES/STACK TRACES THAT OCCUR :
        warning - Error fetching URL: http://docs.oracle.com/javase/7/docs/api
        warning - Error fetching URL: http://jsr-305.googlecode.com/svn/trunk/javadoc
        warning - Error fetching URL: http://docs.guava-libraries.googlecode.com/git-history/v16.0.1/javadoc


        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        not relevant here
        ---------- END SOURCE ----------

        CUSTOMER SUBMITTED WORKAROUND :
        Add a trailing / to each link option, ie:

        -link http://docs.oracle.com/javase/7/docs/api/

        instead of:

        -link http://docs.oracle.com/javase/7/docs/api

        Attachments

          Issue Links

            Activity

              People

                ksrini Kumar Srinivasan
                webbuggrp Webbug Group
                Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: