I'm just about to submit my assignment to Sun. (I haven't had to ask any questions up to now due to the quality of responses already posted to the forum ) and I'm getting a lot of errors when I run checkstyle. I've been able to resolve the vast majority of these. However, I am getting the following 2 errors and I would be very grateful if somebody could let me know if they can be ignored or not.
1. "Using the '.*' form of import should be avoided - java.awt.*." I know that I'm getting this message because I'm importing a package using the *. However, the reason I'm doing this is that in some of my source code files, I'm using more than 3 classes from the relevant package. Does it sound reasonable to just explain this in my choices.txt?
2. "Name 'magicCookieLocation' must match pattern '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'." . The code been complained about here is the following:
Even if I change the name magicCookieLocation to magiccookielocation, it still doesn't work
Any suggestions would be very much appreciated. While these are just minor issues, I need to get them resolved. This is because of the high percentage required to pass and because projects submitted are subject to some form of automatic validation before an examiner even looks at them.
I'm just about to submit my assignment to Sun. (I haven't had to ask any questions up to now due to the quality of responses already posted to the forum)
1/ I used Eclipse as IDE to develop my assignment and I always used the "Organize Imports" function. Result: every import is being listed in the source file, no shortcut notation like java.awt.* is used. I don't know if there are any "rules" about this issue, but I think you should use one or the other consistently throughout all your code files
2/ magicCookieLocation is a constant and constants should be declared in upper case, different parts seperated by an underscore. So if you rename to MAGIC_COOKIE_LOCATION the warning will disappear.
I didn't use any of these tools to check my code style. When you use a decent IDE (like Eclipse) and you are familiar with the most code conventions you are good to go. Afterwards I used some of these tools to check my code and my experiences can be read here.