JFR: Specification should say long and boolean, not Long or Boolean

XMLWordPrintable

    • Type: CSR
    • Resolution: Unresolved
    • Priority: P3
    • 27
    • Component/s: hotspot
    • None
    • jfr
    • behavioral
    • minimal
    • Java API

      Summary

      Change from Long to long and Boolean to boolean in the packages jdk.jfr and jdk.management.jfr where an event settings or recording option is specified.

      Problem

      Event thresholds are specified in textual form in an annotation, for example:

      @Threshold("20 ms")
      @Throttle("10/s")
      @Name("jdk.SocketRead")
       public class SocktReadEvent extends Event {
       ...
      

      and the specification of Threshold states

       * A {@code String} representation of a positive {@code Long} value followed by an
       * empty space and one of the following units:<br>
      

      but it would better to state "a positive {@code long) value" since the value can't be null. Similar problem exists for the event settings Period, Throttle and CutOff.

      Furthermore, in package description of jdk.jfr where the enabled settings is described,

      Solution

      Change the specification of Threshold, Period and Throttle se they us "long" or "boolean".

      Specification

      src/jdk.jfr/share/classes/jdk/jfr/Period.java b/src/jdk.jfr/share/classes/jdk/jfr/Period.java

           /**
            * Returns the default setting value for a periodic setting.
            * <p>
      -     * String representation of a positive {@code Long} value followed by an empty
      +     * String representation of a positive {@code long} value followed by an empty
            * space and one of the following units:<br>
            * <br>
            * {@code "ns"} (nanoseconds)<br>
      

      src/jdk.jfr/share/classes/jdk/jfr/Threshold.java b/src/jdk.jfr/share/classes/jdk/jfr/Threshold.java

           /**
            * The threshold (for example, {@code "20 ms"}).
            * <p>
      -     * A {@code String} representation of a positive {@code Long} value followed by an
      +     * A {@code String} representation of a positive {@code long} value followed by an
            * empty space and one of the following units:<br>
            * <br>
            * {@code "ns"} (nanoseconds)<br>
      

      src/jdk.jfr/share/classes/jdk/jfr/internal/Cutoff.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/Cutoff.java

           /**
            * Cutoff, for example {@code "20 ms"}.
            * <p>
      -     * String representation of a positive {@code Long} value followed by an empty
      +     * String representation of a positive {@code long} value followed by an empty
            * space and one of the following units<br>
            * <br>
            * {@code "ns"} (nanoseconds)<br>
      

      src/jdk.jfr/share/classes/jdk/jfr/package-info.java b/src/jdk.jfr/share/classes/jdk/jfr/package-info.java

        * <th scope="row">{@code enabled}</th>
        * <td>Specifies whether the event is recorded</td>
        * <td>{@code "true"}</td>
      - * <td>String representation of a {@code Boolean} ({@code "true"} or
      + * <td>String representation of a {@code boolean} ({@code "true"} or
        * {@code "false"})</td>
        * <td>{@code "true"}<br>
        * {@code "false"}</td>
      ...
        * <td>Specifies the duration below which an event is not recorded</td>
        * <td>{@code "0"} (no limit)</td>
        * <td>{@code "0"} if no threshold is used, otherwise a string representation of
      - * a positive {@code Long} followed by a space and one of the following units:
      + * a positive {@code long} followed by a space and one of the following units:
        * <ul style="list-style-type:none">
        * <li>{@code "ns"} (nanoseconds)
        * <li>{@code "us"} (microseconds)
      ...
        * periodic</td>
        * <td>{@code "everyChunk"}</td>
        * <td>{@code "everyChunk"}, if a periodic event should be emitted with every
      - * file rotation, otherwise a string representation of a positive {@code Long}
      + * file rotation, otherwise a string representation of a positive {@code long}
        * value followed by an empty space and one of the following units:
        * <ul style="list-style-type:none">
        * <li>{@code "ns"} (nanoseconds)
      ...
        * <td>Specifies whether the stack trace from the {@link Event#commit()} method
        * is recorded</td>
        * <td>{@code "true"}</td>
      - * <td>String representation of a {@code Boolean} ({@code "true"} or
      + * <td>String representation of a {@code boolean} ({@code "true"} or
        * {@code "false"})</td>
        * <td>{@code "true"},<br>
        * {@code "false"}</td>
      ...
        *   <td>Specifies the maximum rate of events per time unit.</td>
        *   <td>{@code "off"} (no throttling)</td>
        *   <td>
      - *     "off", if events should not be throttled, otherwise a string representation of a positive {@code Long} value followed by forward slash ("/") and one of the following units:
      + *     "off", if events should not be throttled, otherwise a string representation of a positive {@code long} value followed by forward slash ("/") and     one of the following units:
        *     <ul style="list-style-type:none">
        *       <li>{@code "ns"} (nanoseconds)
        *       <li>{@code "us"} (microseconds)
      

      src/jdk.management.jfr/share/classes/jdk/management/jfr/FlightRecorderMXBean.java

        * this parameter is ignored.</td>
        * <td>{@code "0"} (no limit)</td>
        * <td>{@code "0"} if no limit is imposed, otherwise a string
      - * representation of a positive {@code Long} value followed by an empty space
      + * representation of a positive {@code long} value followed by an empty space
        * and one of the following units,<br>
        * <br>
        * {@code "ns"} (nanoseconds)<br>
      ....
        * repository. Only works if
        * {@code disk=true}, otherwise this parameter is ignored.</td>
        * <td>{@code "0"} (no limit)</td>
      - * <td>String representation of a {@code Long} value, must be positive</td>
      + * <td>String representation of a {@code long} value, must be positive</td>
        * <td>{@code "0"}, <br>
        * {@code "1000000000"}</td>
        * </tr>
      ...
        * <th scope="row">{@code dumpOnExit}</th>
        * <td>Dumps recording data to disk on Java Virtual Machine (JVM) exit</td>
        * <td>{@code "false"}</td>
      - * <td>String representation of a {@code Boolean} value, {@code "true"} or
      + * <td>String representation of a {@code boolean} value, {@code "true"} or
        * {@code "false"}</td>
        * <td>{@code "true"},<br>
        * {@code "false"}</td>
      ...
        * <th scope="row">{@code disk}</th>
        * <td>Stores recorded data as it is recorded</td>
        * <td><code>"false"</code></td>
      - * <td>String representation of a {@code Boolean} value, {@code "true"} or
      + * <td>String representation of a {@code boolean} value, {@code "true"} or
        * {@code "false"}</td>
        * <td>{@code "true"},<br>
        * {@code "false"}</td>
      ...
        * <td>Sets how long the recording should be running</td>
        * <td>{@code "0"} (no limit, continuous)</td>
        * <td>{@code "0"} if no limit should be imposed, otherwise a string
      - * representation of a positive {@code Long} followed by an empty space and one
      + * representation of a positive {@code long} followed by an empty space and one
        * of the following units:<br>
        * <br>
        * {@code "ns"} (nanoseconds)<br>
      

            Assignee:
            Erik Gahlin
            Reporter:
            Erik Gahlin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: