# Using Quick Fix

To use the Quick Fix feature:

- You need to have the Window > Preferences > Java > Editor > Report problems as you type checkbox selected.
- In the Java editor, if you see an error or a warning underlined with a squiggly line, position the caret inside the underlined range and do one of the following
  - Press `Ctrl+1` or
  - From the menu bar, select Edit > Quick Fix
- A list of suggested corrections is presented, with a preview displayed when an entry is selected.
- Select an entry form the list and press `Enter`.

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.

Java editor
Available Quick Fix proposals
Available Quick Assist proposals

Using the Java editor

Quick Fix