Community
Participate
Working Groups
Often there are a number of unnecessary warnings and sometimes errors in the builds. This is due to teams not seeing this messages in development because they may not have their settings the same as the build machine and may be ignoring these warnings/errors. Unused imports is an example which teams should set as an error. We should come up with a generic project setting with the types of errors and warnings we want and add it to all WTP projects, so each project is compiled consistently.
We use all the Java JDT Compiler defaults, except for the following. -warn:-serial,raw,typeHiding,unchecked And there are the Java JDT current defaults for warnings: Where the '+' signifies default Warning options: -deprecation + deprecation outside deprecated code -nowarn -warn:none disable all warnings -warn:<warnings separated by ,> enable exactly the listed warnings -warn:+<warnings separated by ,> enable additional warnings -warn:-<warnings separated by ,> disable specific warnings allDeprecation deprecation including inside deprecated code allJavadoc invalid or missing javadoc assertIdentifier + 'assert' used as identifier boxing autoboxing conversion charConcat + char[] in String concat conditionAssign possible accidental boolean assignment constructorName + method with constructor name dep-ann missing @Deprecated annotation deprecation + deprecation outside deprecated code discouraged + use of types matching a discouraged access rule emptyBlock undocumented empty block enumSwitch incomplete enum switch fallthrough possible fall-through case fieldHiding field hiding another variable finalBound type parameter with final bound finally + finally block not completing normally forbidden + use of types matching a forbidden access rule hiding macro for fieldHiding, localHiding, typeHiding and maskedCatchBlock incomplete-switch same as enumSwitch indirectStatic indirect reference to static member intfAnnotation + annotation type used as super interface intfNonInherited + interface non-inherited method compatibility javadoc invalid javadoc localHiding local variable hiding another variable maskedCatchBlock + hidden catch block nls string literal lacking non-nls tag //$NON-NLS-<n>$ noEffectAssign + assignment without effect null potential missing or redundant null check nullDereference missing null check over-ann missing @Override annotation paramAssign assignment to a parameter pkgDefaultMethod + attempt to override package-default method raw + usage of raw type semicolon unnecessary semicolon, empty statement serial + missing serialVersionUID specialParamHiding constructor or setter parameter hiding another field static-access macro for indirectStatic and staticReceiver staticReceiver + non-static reference to static member super overriding a method without making a super invocation suppress + enable @SuppressWarnings synthetic-access same as syntheticAccess syntheticAccess synthetic access for innerclass tasks(<tags separated by |>) tasks identified by tags inside comments typeHiding + type parameter hiding another type unchecked + unchecked type operation unnecessaryElse unnecessary else clause unqualified-field-access same as unqualifiedField unqualifiedField unqualified reference to field unused macro for unusedArgument, unusedImport, unusedLabel, unusedLocal, unusedPrivate and unusedThrown unusedArgument unread method parameter unusedImport + unused import declaration unusedLabel + unused label unusedLocal + unread local variable unusedPrivate + unused private member declaration unusedThrown unused declared thrown exception uselessTypeCheck unnecessary cast/instanceof operation varargsCast + varargs argument need explicit cast warningToken + unhandled warning token in @SuppressWarnings Given this info ... someone want to make a .setting/...jdt.prefs file that flags these as errors? Naturally, projects can do "stricter" settings ... but, this is the minimim expected.
Created attachment 77964 [details] settings to match batch compiler Please give these MINIMUM settings a try, and see if they look right. If so, we could look for a better place for them in CVS ... releng?
I tweaked the settings for: org.eclipse.wst.common.emf org.eclipse.wst.common.emfworkbench.integration org.eclipse.wst.common.frameworks org.eclipse.wst.common.frameworks.ui org.eclipse.wst.common.modulecore But, in all but the first, I had to remove: org.eclipse.jdt.core.compiler.problem.discouragedReference=error
Will close as there's no direct action required here. I'll mark as 'info', but note, JDT options have changed, and undoubtedly will continue to evolve ... so, check latest JDT for correct list.