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

(bf) ByteBuffer "Access to binary data" section suggests putFloat is void

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Withdrawn
    • Icon: P4 P4
    • 20
    • core-libs
    • None
    • behavioral
    • minimal
    • Correct a documentation error: no risk.
    • Java API
    • SE

      Summary

      Change the ByteBuffer class specification to show that the putFloat methods are not void but return the ByteBuffer instance.

      Problem

      In the Access to binary data section of the ByteBuffer class specification, the putFloat methods are shown as being void when they actually return a ByteBuffer.

      Solution

      In the Access to binary data section of the ByteBuffer specification, change

      void putFloat

      to

      ByteBuffer putFloat

      Specification

      --- a/src/java.base/share/classes/java/nio/X-Buffer.java.template
      +++ b/src/java.base/share/classes/java/nio/X-Buffer.java.template
      @@ -150,10 +150,11 @@ import jdk.internal.util.ArraysSupport;
        * values, for example, this class defines:
        *
        * <blockquote><pre>
      - * float  {@link #getFloat()}
      - * float  {@link #getFloat(int) getFloat(int index)}
      - *  void  {@link #putFloat(float) putFloat(float f)}
      - *  void  {@link #putFloat(int,float) putFloat(int index, float f)}</pre></blockquote>
      + * float      {@link #getFloat()}
      + * float      {@link #getFloat(int) getFloat(int index)}
      + * ByteBuffer {@link #putFloat(float) putFloat(float f)}
      + * ByteBuffer {@link #putFloat(int,float) putFloat(int index, float f)}
      + * </pre></blockquote>
        *
        * <p> Corresponding methods are defined for the types {@code char,
        * short, int, long}, and {@code double}.  The index

            bpb Brian Burkhalter
            alanb Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: