Bug 197531

Summary: [releng] Investigate adding common project level settings for WTP projects
Product: [WebTools] WTP Releng Reporter: John Lanuti <jlanuti>
Component: relengAssignee: David Williams <david_williams>
Status: RESOLVED FIXED QA Contact: David Williams <david_williams>
Severity: enhancement    
Priority: P3 CC: david_williams, thatnitind, valentinbaciu
Version: 3.10Keywords: info
Target Milestone: 3.10.0   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 219377    
Attachments:
Description Flags
settings to match batch compiler none

Description John Lanuti CLA 2007-07-23 15:10:54 EDT
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.
Comment 1 David Williams CLA 2007-09-10 02:41:24 EDT
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. 

Comment 2 David Williams CLA 2007-09-10 03:46:03 EDT
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?
Comment 3 Carl Anderson CLA 2007-10-23 11:00:07 EDT
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
Comment 4 David Williams CLA 2008-02-10 15:22:41 EST
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.