-
Notifications
You must be signed in to change notification settings - Fork 1
Evaluator
The Quick Fix (QF) Evaluator feature improves Eclipse’s quick fix dialog by telling you the consequences of each correction proposal, and by adding better proposals.
The QF Evaluator feature helps you make better decisions during an Eclipse quick fix session. In the background, the plug-in evaluates all of the proposals offered for that session. It augments the existing quick fix dialog as shown on the right. The number in parentheses at the beginning of the line is the number of compilation errors you would get if you choose that proposal. The list is sorted with respect to the number of compilation errors the proposals generate. Also each proposal is colored with respect to its effect on the project’s current and future state. Green means the proposal will reduce the overall compilation errors in the project, red means it will increase the number of compilation errors, and black means that it won’t change.
Sometimes the best correction proposal for a given compilation error is offered only at a different location. If so, QF Evaluator adds the global best proposal (GBP) to the list of proposals.
There are two augmentations for global best proposal:
- Real location of the GBP: As explained above, Eclipse does not offer the GBPs for that compilation error. In this example,
QFS_Test.java:4:12
indicates that this GBP is generated by the compilation error on file QFS_Test.java, line 4 and offset 12. - Additional context information for the GBP: Similarly, since the user does not see the actual compilation error for the GBP, when appropriate additional context information is added. In this example, the display string
Change to 'String' (java.lang)
(shown at the top) is changed toChange
'string'
to String (java.lang)
. As a result, the user can realize thatstring
will be replaced toString
without the need to go to the original problem location.
The code presented above contains 5 compilation errors (also 5 QFs). The GBP is changing type declaration of name
from string
to String
. However, Eclipse only offers this proposal at the first compilation error; no good proposal is offered at the other locations. The QF Evaluator adds the GBP at all locations; producing the following popup when the second QF is invoked.