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

isSupportedOption("--allow-script-in-comments") returns wrong value

XMLWordPrintable

      FULL PRODUCT VERSION :
      Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
      Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      Linux artemis 4.9.10-100.fc24.x86_64 #1 SMP Wed Feb 15 18:35:50 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

      A DESCRIPTION OF THE PROBLEM :
      ToolProvider.getSystemDocumentationTool().isSupportedOption("--allow-script-in-comments")
      returns -1, should be 0 for this java version.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      System.out.println(System.getProperty("java.version"));
      System.out.println(ToolProvider.getSystemDocumentationTool()
      .isSupportedOption("--allow-script-in-comments"));


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      1.8.0_121
      0
      ACTUAL -
      1.8.0_121
      -1


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      /**
       *
       */
      package test;

      import javax.tools.ToolProvider;

      /**
       * @author mnl
       *
       */
      public class Test {

      /**
      * @param args
      */
      public static void main(String[] args) {
      System.out.println(System.getProperty("java.version"));
      System.out.println(ToolProvider.getSystemDocumentationTool()
      .isSupportedOption("--allow-script-in-comments"));

      }

      }

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

      CUSTOMER SUBMITTED WORKAROUND :
      Class.forName('com.sun.tools.doclets.formats.html.ConfigurationImpl')
                           .newInstance().optionLength('--allow-script-in-comments') seems to work

        1. Test.java
          0.3 kB
          Fairoz Matte

            jjg Jonathan Gibbons
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: