问题
I often see a yellow start near the methods, and some percentage in Eclipse Luna's intelligent code completion:
What does this star and the percentage mean?
回答1:
Both the star and the percentage are added by the Intelligent Code Completion.
These suggestions are based on context and code analysis (data mined) of similar situations. The percentage is presumably an indication for the confidence of that suggestion.
Protected methods (which was the explanation suggested by Ted Hopp) are in fact indicated by a yellow diamond with rounded corners, similar to the icon in the outline view.
回答2:
From the Eclipse Luna documentation, it appears to mean that it is a protected method.
回答3:
A number of code completion engines come equipped with Eclipse Mars edition onwards. They are provided by by eclipse.org Code Recommenders.
Normally eclipse orders members alphabetically. However, Code recommender engines will override the alphabetical listing and place commonly used icons near the top. For example println()
would be presented near the top with a yellow star after you type System.out.
and toString()
would appear near the top with a yellow star after typing String obj.
The starred items will be followed by an alphabetical list of members which either could not be identified by the engines or identified as being unlikely to be applicable.
Percentages indicate the likelihood of the suggestion being applicable based upon code from other users who have used your components in their code.
The yellow star indicates that the suggestion has been provided from code recommenders based upon mined data.
来源:https://stackoverflow.com/questions/26622374/what-is-a-method-with-a-star-icon-in-eclipse