Using Quick Fix

To use the Quick Fix feature: Light bulb icons appear on the left-hand side vertical ruler to indicate Quick Fix'able problems. You can then click on one of the the light bulb icons to invoke Quick Fix.

Note: Occasionally, invoking Quick Fix will not suggest any corrections. A message saying 'No suggestions available' will be displayed in such cases.

Using Quick Assist

The Java editor also offers some common code changes even when there's no error or warning in your code. For example, set the caret into the if of the following if-else statement, press Ctrl+1, and select "Change 'if-else' statements to blocks":

    String test(int arg) {
        if (arg > 1000)
            return "big";
        else
            return "small";
    }

Braces are added around the return statements:

    String test(int arg) {
        if (arg > 1000) {
            return "big";
        } else {
            return "small";
        }
    }

Check out the Available Quick Fix proposals and the Available Quick Assist proposals, or just press Ctrl+1 to see what quick fixes or quick assists Eclipse offers in your current context.

Related concepts
Java editor
Available Quick Fix proposals
Available Quick Assist proposals

Related tasks
Using the Java editor

Related reference
Quick Fix