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

Produces faulty Constant Values page if constants contain angle bracket '<'

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b61
    • CPU:
      x86
    • OS:
      windows_2000, windows_xp

      Description

      Name: rmT116609 Date: 07/22/2004


      FULL PRODUCT VERSION :
      java version "1.4.2"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
      Java HotSpot(TM) Server VM (build 1.4.2-b28, mixed mode)

      java version "1.5.0-beta2"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta2-b51)
      Java HotSpot(TM) Client VM (build 1.5.0-beta2-b51, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows 2000 [Version 5.00.2195]

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Using javadoc with standard doclet.

      A DESCRIPTION OF THE PROBLEM :
      Using javadoc on sources which include constant values produce faulty "Constant Values Page" html code under specific conditions. It seems that String constants values including "<" or ">" are copied into the html page let browser interpret them partly as html tag.
      For example will the constant declaration:
      public static final String DEMO_STRING = "<Hello World>"
      be shown in the Constant Value Page as DEMO_STRING= ""
      Furthermore will the constant declaration:
      public static final String DEMO_STRING = "<table>Hello World"
      disturb the allignment of the page in the browser.
      As it seems to me, there could be many more strange effects be generated with constants including "<" or ">".


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Just declare an string constant in a class including "<" like DEMO ="y<abs(x)" and let javadoc tool produce with the standard doclet the html pages. View the resulting "Constant Field Values" page , the constant value for DEMO looks like "y
      The rest of the constant value is cut off.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The constant value "y<abs(x)" should be displayed in the browser.
      ACTUAL -
      The result in the browser is "y

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      /*
       * DemoClass.java
       */
      package de.prowaznik;
      public class DemoClass {
         /** Test constant. */
         public static final String DEMO= "y<abs(x)";
         /** Connection URL for the JDBC Driver. */
         public static final String THIS_IS_OK= "y < abs(x)";

         public DemoClass() {
         }
      }

      ---------- END SOURCE ----------
      (Incident Review ID: 286161)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jhosunw Jamie Ho (Inactive)
              Reporter:
              rmandalasunw Ranjith Mandala (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: