United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-5077317 Produces faulty Constant Values page if constants contain angle bracket '<'
JDK-5077317 : Produces faulty Constant Values page if constants contain angle bracket '<'

Details
Type:
Bug
Submit Date:
2004-07-22
Status:
Resolved
Updated Date:
2005-11-12
Project Name:
JDK
Resolved Date:
2005-11-12
Component:
docs
OS:
windows_xp,windows_2000
Sub-Component:
doclet
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
1.4.2
Fixed Versions:

Related Reports
Duplicate:

Sub Tasks

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

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
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
dragon


                                     
2004-10-01
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
EVALUATION

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



Hardware and Software, Engineered to Work Together