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

[lworld] Javac should tolerate legacy idioms for equality (LIFE) when applied to values.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: repo-valhalla
    • Fix Version/s: repo-valhalla
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      As of LW1, javac strictly rejects any comparison that may involve a type that can be statically ascertained to be a value type. This is true for both == and != operators. In migrating code, it is believed that we will come across several instances of code that uses the legacy idiom for equality (LIFE) viz:

          if (v1 == v2 || v1.equals(v2)) {
          }

      This ticket is to request that javac tolerate this special pattern and not issue an error.



        Attachments

          Activity

            People

            • Assignee:
              sadayapalam Srikanth Adayapalam
              Reporter:
              sadayapalam Srikanth Adayapalam
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: