JDK-8073550 : java* tools: replace obj.getClass hacks with Assert.checkNonNull or Objects.requireNonNull
  • Type: Enhancement
  • Component: tools
  • Sub-Component: javac
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2015-02-20
  • Updated: 2015-06-04
  • Resolved: 2015-02-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b54Fixed
Related Reports
Relates :  
Relates :  
Description
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. 
Comments
Maurizio suggested we use the internal Asserts instead: http://cr.openjdk.java.net/~shade/8073550/webrev.01/
20-02-2015

Webrev: http://cr.openjdk.java.net/~shade/8073550/webrev.00/ I don't know what mail alias to send this webrev to. It would be nice if somebody from langtools team pick this one up.
20-02-2015