Eclipse tutoria...login
Eclipse tutorial
author:php.cn  update time:2022-04-13 14:09:28

Eclipse quick fix



Use quick fixes

When you enter letters in the Eclipse editor, the editor performs error analysis on your input.

Java syntax is used in the Java editor to detect errors in the code. When it finds errors or warnings:

  • Use red squiggly lines to highlight errors

  • Use yellow squiggly lines to highlight warnings

  • Display errors and warnings in the Problem view

  • Display small yellow light bulbs and warning and error logos on the vertical ruler

The quick fix dialog box provides solutions. The Quick Fix dialog box can be invoked by:

  • Place the mouse pointer over the wavy line

  • Click on the small light bulb

  • Place the mouse pointer over the highlighted text and select the Quick fix item on the Edit menu or press the shortcut Ctrl + 1

quick_fix_1

on In the figure, getId is highlighted because the Person class does not have a method named getId(). Select "Create method 'getId()' in type 'Person'" in the pop-up fix solution to add the getId() method to the Person class.

You can also right-click the error item in the Problems view, and then select the Quick Repair menu item to display the Quick Repair dialog box, as shown below:

qf

php.cn