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

javadoc inline tag {@value} should be available everywhere

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 5.0
    • 1.4.0, 1.4.1
    • tools
    • tiger
    • generic, x86
    • other, linux, windows_2000



      Name: nt126004 Date: 10/16/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)

      A DESCRIPTION OF THE PROBLEM :
      It is only possible to use the javadoc inline tag @value
      inside the documentation of the constant field. It should be
      possible to use it everywhere and extend the syntax of this
      tag to

      {@value package.class#member label}

      The idea is to have the constant values available in every javadoc comment.
      This is just for convenience

      Example:

      public static final String SCRIPT_START = "<script>";
      public static final String SCRIPT_END = "</script>";


      Currently with the actual version, you have to navigate two times, click on
      the link for this method and click on the values link of the constant,
      like this:

      /**
       * Evaluates scripts given in the specified script string.
       * Every script included in {@link #SCRIPT_START} and
       * {@link #SCRIPT_END} is evaluated and the result is inserted
       * in the string.
       */
      public String evalScripts(String script) {
      }


      Method doc I suggest

      Just include the value (with a link to the constant)

      /**
       * Evaluates scripts given in the specified script string.
       * Every script included in {@value #SCRIPT_START} and
       * {@value #SCRIPT_END} is evaluated and the result is inserted
       * in the string.
       */
      public String evalScripts(String script) {

      }

      (Review ID: 164665)
      ======================================================================
      Here is an example from duplicate 4753737:

      /**
       * Names the property file.
       */
      public static final String NAME_OF_PROPERTY_FILE = "db2.properties";

      /**
       * This method reads the properties out of {@value NAME_OF_PROPERTY_FILE}
       */
       public void readProperties() {
       ...
       }

      /**
       * This method writes the properties into {@value NAME_OF_PROPERTY_FILE}
       */
       public void writeProperties() {
       ...
       }

      So if I need to change the value of the constant to
      "cloudscape.properties" I wouldn't have to redo all the Javadoc
      comments. (I came to this while doing a lot of Search/Replace)!

            jhosunw Jamie Ho (Inactive)
            nthompsosunw Nathanael Thompson (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: