Resources
Frequently Checked Styles(FCS)
This page contains a list of some frequent checkstyle errors for CS149 and what in the Style Guide lab they refer to and how to correct them. Press the Green PLUS button (+) to see how to fix the error.
FCS# / ERROR | STYLE GUIDE ITEM | HOW TO FIX |
1) [ERROR] file.java:0: File does not end with a newline. [NewlineAtEndOfFile] |
F. Whitespace |
The very last line of the file cannot have any spaces; If you are using a Windows machine to do this make sure you save with UNIX |
2) [ERROR] file.java:2: |
A1 Comments
|
Make sure you have a Javadoc comment above ie. /** public class MyClass { /** public static void main(String[] args) { } } |
3) [ERROR] file.java:6:
|
E1. Indentation
|
Make sure you indent with spaces not tabs and make public class Demo { //level 0 no indentation |
4) [ERROR] file.java:15:22: |
B5. Names 5. Constant names should be all |
Make sure constants are named like this: using all CAPS with underscore between words. |
5) [ERROR] file.java:41: |
E3. Indentation 3. Statements too long for one |
Make sure if you have lines longer than 80 characters and move +" degree, I'd have $%,.2f!\n", fTemp * 1e6); |