Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8244681 Add a warning for possibly lossy conversion in compound assignments
  3. JDK-8293797

Release Note: Javac Warns about Type Casts in Compound Assignments with Possible Lossy Conversions

    XMLWordPrintable

Details

    • b16

    Description

      New lint option `lossy-conversions` has been added to `javac` to warn about type casts in compound assignments with possible lossy conversions.
      If the type of the right-hand operand of a compound assignment is not assignment compatible with the type of the variable, a cast is implied and possible lossy conversion may occur.

      The new warnings can be suppressed using `@SuppressWarnings("lossy-conversions")`.

      Attachments

        Activity

          People

            asotona Adam Sotona
            asotona Adam Sotona
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: