JDK-8139830 : JShell API: Provide kind() overrides and toString() comments
  • Type: Bug
  • Component: tools
  • Sub-Component: jshell
  • Affected Version: 9
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2015-10-19
  • Updated: 2018-03-21
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.
Other
tbd_majorUnresolved
Related Reports
Relates :  
Description
* Please add useful, if vague, comments for toString overrides.

* Provide overrides for methods to give method-specific information in subclasses; for example "kind()". 

I cannot see significant examples of the latter other than kind(), which on leaf classes document the return of a specific Kind.

---


For the Snippet subclasses, many of them say something like:
>
> Snippet for a method definition. The Kind is Snippet.Kind.METHOD. 

The best place to say what Method.Snippet.kind() does is for javadoc for the Method.Snippet.kind() method :-)

I strongly recommend creating overrides of the methods in the implementation expressly for the purposes of hosting the javadoc; e.g.

/**
 * Returns Snippet.Kind.METHOD.
 * @return Snippet.Kind.METHOD
 */
@Override
public Snippet.Kind kind() {return super.kind();}

The javax.lang.model API does this for its interfaces and classes.