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

15.25: Clarify treatment of generic method invocations in numeric conditionals

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P5
    • 9
    • 8
    • specification

    Description

      The following rule and clarification is used to determine whether a conditional is a boolean conditional:

      "A method invocation expression (§15.12) for which the chosen most specific method (§15.12.2.5) has return type boolean or Boolean."

      "Note that, for a generic method, this is the type before instantiating the method's type arguments."

      The note about generic methods is missing from the same rule for numeric conditionals:

      "A method invocation expression (§15.12) for which the chosen most specific method (§15.12.2.5) has a return type that is convertible to a numeric type."

      Granted, the clarification would be redundant, but as it stands, the lack of a clarifying note makes it seem like maybe the numeric case is supposed to be treated differently.

      Attachments

        Activity

          People

            abuckley Alex Buckley
            dlsmith Dan Smith
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: