JDK-4754020 : The @value tag is broken when used more than once in a single javadoc comment.
  • Type: Enhancement
  • Component: tools
  • Sub-Component: javadoc(tool)
  • Affected Version: 1.4.1
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2002-09-26
  • Updated: 2014-05-05
  • Resolved: 2002-09-27
Related Reports
Duplicate :  
Description

Name: rmT116609			Date: 09/26/2002


FULL PRODUCT VERSION :
java version "1.4.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21)
Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)

Microsoft Windows 2000 [Version 5.00.2195]

DESCRIPTION OF THE PROBLEM :
The @value tag is broken when used more than once in a single Javadoc comment.

Generating Javadoc for the following:

/**
 * STRING_1={@value #STRING_1} STRING_2={@value #STRING_2}
 */
static final String STRING_1 = "String1";

/**
 * STRING_2={@value #STRING_2} STRING_1={@value #STRING_1}
 */
static final String STRING_2 = "String2";

..produces the following output:

 STRING_1="String1" STRING_2="String1"
 STRING_2="String2" STRING_1="String2"

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Use two @value to render more than one constant in a single Javadoc comment.
2. Generate the Javadoc.


EXPECTED VERSUS ACTUAL BEHAVIOR :
Expected:
STRING_1="String1" STRING_2="String2"
STRING_2="String2" STRING_1="String1"

Actual:
STRING_1="String1" STRING_2="String1"
STRING_2="String2" STRING_1="String2"

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
public class TestOfJavaDoc {

	/**
	 * STRING_1={@value #STRING_1} STRING_2={@value #STRING_2}
	 */
	public static final String STRING_1 = "String1";

	/**
	 * STRING_2={@value #STRING_2} STRING_1={@value #STRING_1}
	 */
	public static final String STRING_2 = "String2";

}

---------- END SOURCE ----------
(Review ID: 158905) 
======================================================================

Comments
EVALUATION {@value} does not as yet take an argument. Once it does, your examples should work. Demoted this from priority 4 to 3, changing from a bug to an RFE. I plan to close this out as a duplicate of 4753737: Allow {@value} to take field name arg and be used in any doc comment unless the submitter has something they want to add. We mistakenly documented in "What's New in Javadoc 1.4.0" that {@value name} was implemented. However, this is documentation is corrected on the website and in 1.4.1. ###@###.### 2002-09-26 Having not heard from the submitter, closing out as a dupe of 4753737. ###@###.### 2002-09-27
26-09-2002