[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Compiler settings?

From: Robert Simmons <kraythe_at_arcor.de>
Date: 2004-09-25 01:35:14 CEST

I started getting into the subclipse code and when I compiled I got some
6000 warnings! In order to get rid of them I had to tourna botu every
warning off. This seems to be not such a good idea when it comes to code
quality. I realize that fixing the warnings might take some time but I would
be willing to do it in order to firm up the quality of code. I would like to
have most of the compiler options on. There are very few that I don't use in
my own code.


The settings I recommend are:


Methods overridden but not package visible: warning

Methods with a constructor name: error

Non-Static access to a static member: warning

Indirect access to static member: warning

Assignment has no effect: error

Possible accidental Boolean assignment: error

Unqualified access to instance field: warning

Finally does not complete normally: warning

Empty Statement: warning

Undocumented empty block: warning


Access to a non-accessible member of an enclosing type: ignore

Local variable declaration hides field or variable: ignore

Field declaration hides another field or variable: warning

Interface method conflicts with protected 'Object' method: error

Using a char array in concatenation: warning

Usage of deprecated API: warning (both checks off)

Usage of non-externalized strings: warning


Local variable never read: warning

Parameter never read: warning (checkbox off)

Unused imports: warning

Unused or unread private members: warning

Unnecessary else statement: warning

Unnecessary cast or instanceof operation: warning

Hidden catch block: error

Unnecessary declaration of thrown checked exception: ignore


Some might say that this is a trivial issue but I disagree. Its likely that
the imposition of such strict options will cause errors that were buried in
the code to bubble up to the top. Furthermore, the resulting code quality
will be superior.



-- Robert Simmons Jr.

-- Senior Software Architect, Consultant


Author of "Hardcore Java", Published by O'Reilly, ISBN: 0-596-00568-7,

Received on Sat Sep 25 09:35:14 2004

This is an archived mail posted to the Subclipse Dev mailing list.