JDK-6341023 : Tree API: Tree.Kind should have mapping to interface
  • Type: Enhancement
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2005-10-24
  • Updated: 2010-04-03
  • Resolved: 2006-04-29
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 6
6 b83Fixed
Related Reports
Relates :  
Relates :  
Description
The enum com.sun.source.tree.Tree.Kind should have a method
like this:

public Class<? extends Tree> asInterface();

Conversely, a method like this might also be convenient:

public static Tree.Kind asKind(Class<? extends Tree> clz);

This should also be considered for JSR 269.

See:

http://forums.java.net/jive/thread.jspa?forumID=23&threadID=1779

Comments
EVALUATION mapping is many-1, so forward map is well defined and easy enough; reverse map is not well defined. Given the forward map, it would be easy enough for clients to invert it with whatever semantics they desire when there is more than one kind for an interface class.
31-03-2006

EVALUATION A good idea.
02-12-2005