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

java* tools: replace obj.getClass hacks with Assert.checkNonNull or Objects.requireNonNull

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • None
    • tools
    • b54
    • Not verified

        This issue is similar to JDK-8073479, but applies to langtools.

        A few places in our class library use the weird trick of using object.getClass() to check for nullity.
        While this make seem a smart move, it actually confuses people into believing this is an approved
        practice of null checking.

        With JDK 7, we have Objects.requireNonNull that provide the proper null checking, and declare the
        intent properly.

              mcimadamore Maurizio Cimadamore
              shade Aleksey Shipilev
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: