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

JShell API: Failed to detect override when snippet to be overridden has been changed before

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 11
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • Introduced In Version:
      9
    • Resolved In Build:
      b07
    • CPU:
      generic
    • OS:
      generic

      Description

      Correct behavior:
      bitter_fox@bitterfox-MacBookPro% ~/bin/jdk9/bin/jshell -J-Duser.language=en
      | Welcome to JShell -- Version 9
      | For an introduction type: /help intro

      jshell> void m(Object o) {}
      | created method m(Object)

      jshell> <T> void m(T o) {}
      | replaced method m(T)

      jshell> /l

         2 : <T> void m(T o) {}

      jshell> m("")

      jshell>

      Wrong behavior:
      bitter_fox@bitterfox-MacBookPro% ~/bin/jdk9/bin/jshell -J-Duser.language=en
      | Welcome to JShell -- Version 9
      | For an introduction type: /help intro

      jshell> void m(Object o) {}
      | created method m(Object)

      jshell> void m(Object o1) {}
      | modified method m(Object)

      jshell> <T> void m(T o1) {}
      | created method m(T)

      jshell> /l

         2 : void m(Object o1) {}
         3 : <T> void m(T o1) {}

      jshell> m("")
      | Error:
      | reference to m is ambiguous
      | both method <T>m(T) in and method m(java.lang.Object) in match
      | m("")
      | ^

      jshell>

        Attachments

          Activity

            People

            Assignee:
            shinyafox Shinya Yoshida
            Reporter:
            shinyafox Shinya Yoshida
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: