Java Reference
In-Depth Information
Yellow —Warnings found. One or more warnings, such as an unused
import or variable, have been detected. The source will probably compile
but may warrant further investigation.
Red —Errors found. The code won't compile due to errors in Java syntax
or invalid references. Note that if you haven't configured your project cor-
rectly, such as adding all your dependent libraries to the classpath (see
chapter 4), IDEA may incorrectly report some valid calls as errors.
Pay attention to the document status indicator, and keep it green! It's always a
good idea to reexamine your source code if it has been flagged with any warnings,
because they could indicate a missing or incorrect assignment elsewhere. IDEA
has saved us many times with this feature.
3.4.3
Navigating between problems in the current file
The Go To | Next Highlighted Error ( F2 ) and Go To | Previous Highlighted
Error ( Shift+F2 ) commands allow you to navigate through all the errors (and
warnings) in the current file. When you reach the end of the file, you loop back
around to the first problem from the top. This is a convenient mechanism for
finding, reviewing, and editing all your code problems at once.
3.4.4
Controlling the reparse delay
To c o n f i g u r e IDEA 's error-handling options, bring up the Errors section of the
IDE Settings , as shown in figure 3.6. The first configurable option in the Errors
settings is the Autoreparse delay option. This value indicates the number of mil-
liseconds IDEA waits to check for errors after you stop typing. The default value
should be adequate, but you can adjust it as you see fit. Remember, though, that if
you set this value too low, IDEA will begin flagging errors aggressively, possibly
even before you even finish typing a keyword. Your circumstances may vary, but
we recommend setting this to around 1000ms (which means it only starts mark-
ing things as errors once you take a real pause).
3.4.5
Configuring IDEA's warning levels
Under the Errors settings, you can see a list of the different types of problems
that IDEA looks for in your code. All the problems listed in these settings are tech-
nically just warnings, because they pertain to code that is syntactically correct and
will compile. The purpose of the Errors settings is to give you the opportunity to
treat certain warnings as more serious or less serious. You can do this by adjusting
each condition's warning level designation in its drop-down list:
 
 
 
 
 
 
 
 
 
Search WWH ::




Custom Search