JDK-8139832 : JShell API: Diag constructor should not be exposed and fix typo
  • Type: Bug
  • Component: tools
  • Sub-Component: jshell
  • Affected Version: 9
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2015-10-19
  • Updated: 2017-05-17
  • Resolved: 2016-05-02
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 b117Fixed
Related Reports
Relates :  
Description
jdk.jshell.Diag

The default constructor for Diag is unintentionally exposed both to external users and visible in the javadoc (without text).  Changing Diag to an interface is not a good choice since there are package-private concrete and abstract methods on Diag.  Simply explicitly defining the constructor as package-private addresses this issue.

There is also a typo in the javadoc.

Original report below --

The constructor for this class has no javadoc; it look like it might be the default constructor. 

Typo:
> public abstract boolean isError()
>
> Is this diagnostic *and* error (as opposed to a warning or note) 


Should this type be an interface rather than an abstract class? Why do client need to be able to create their own instances of Diag? Basically, why is the constructor public vs package private? 

interface is a good choice because of its relationship to the compiler API Diagnostic

Joe