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

<TAB>-completion in jshell fails to expose synthetic bridge methods

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 21
    • 19, 20
    • tools
    • None
    • b05

      `j.l.StringBuilder`'s documentation mentions the public method `setLength()`. This method is declared in superclass `AbstractStringBuilder`, a package-protected abstract class, and does not appear in `StringBuilder` source code.
      The javac compiler generates a public synthetic bridge method for `setLength()` in `StringBuilder`.
      However, jshell fails to show it on <TAB>-completion. For a reader of the javadoc of the class, this is quite surprising.

      | Welcome to JShell -- Version 19.0.1
      | For an introduction type: /help intro

      jshell> var sb = new StringBuilder()
      sb ==>

      jshell> sb.<TAB>
      append( appendCodePoint( compareTo( delete(
      deleteCharAt( equals( getClass() hashCode()
      indexOf( insert( isEmpty() lastIndexOf(
      notify() notifyAll() replace( reverse()
      toString() wait(
      jshell> sb.

            asotona Adam Sotona
            rgiulietti Raffaello Giulietti
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: