JDK-5077317 : Produces faulty Constant Values page if constants contain angle bracket '<'
  • Type: Bug
  • Component: tools
  • Sub-Component: javadoc(tool)
  • Affected Version: 1.4.2
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_2000,windows_xp
  • CPU: x86
  • Submitted: 2004-07-22
  • Updated: 2014-05-05
  • Resolved: 2005-11-12
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availabitlity Release.

To download the current JDK release, click here.
JDK 6
6 b61Fixed
Related Reports
Duplicate :  
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) 
======================================================================

Comments
EVALUATION Adding mustang-test keyword since we are only adding a regression test to verify this bug is already fixed.
2005-10-10

EVALUATION This bug is actually not reproducible. It is already fixed in tiger. However, I don't see a related regression test to prove that we properly escape characters in the constant value page. I will check in a test.
2005-09-14

CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: dragon
2004-10-01

EVALUATION Data bug. Raising to P3. This would cause data on the Constant Values page to be missing, and could foul up (truncate) the rest of the page. ###@###.### 2004-07-22
2004-07-22