JDK-8000935 : Helper method to return enclosed element with a given simple name
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: javax.lang.model
  • Affected Version: 6,7
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2012-10-15
  • Updated: 2023-11-02
Related Reports
Relates :  
Description
From jjg, "It is somewhat surprising, to me, that there is no method on Element or TypeElement to find the enclosed elements with a given simple name.  Yes, you can iterate through all the enclosed elements but that imposes an unnecessary extra cost, when the members are sorted by name internally, at least within javac."

Given the frequency of this operation, it is reasonable to have a helper method to take advantage of implementation-specific features, like elements sorted by name.
Comments
Note that the method likely triggering this enhancement request is being removed from javadoc code.
02-11-2023