PageRenderTime 40ms CodeModel.GetById 35ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/asl/lib/checkstyle/config/BlochEffectiveJava.xml

http://mp-rechnungs-und-kundenverwaltung.googlecode.com/
XML | 117 lines | 35 code | 21 blank | 61 comment | 0 complexity | f14936e7bf5d5964e3066d3953dd9ed8 MD5 | raw file
  1<?xml version="1.0"?>
  2<!DOCTYPE module PUBLIC
  3    "-//Puppy Crawl//DTD Check Configuration 1.1//EN"
  4    "http://www.puppycrawl.com/dtds/configuration_1_1.dtd">
  5
  6<!--
  7
  8  A Checkstyle configuration that checks against the recommendations
  9  in Joshua Bloch, Effective Java (highliy recommended read!)
 10
 11  This file does NOT duplicate the checks for whitespace settings,
 12  placement of curly braces, etc.  Only the rules that are explicitly
 13  mentioned in the book are enforced.
 14
 15  Currently the amount of rules that can be automatically checked by
 16  Checkstyle is not very large, but adding more checks of this quality
 17  is a high priority goal for the development team.
 18
 19-->
 20
 21<module name="Checker">
 22
 23  <module name="TreeWalker">
 24
 25    <!-- Item 4 - Avoid creating duplicate objects -->
 26    <module name="IllegalInstantiation">
 27      <property name="classes" value="java.lang.Boolean, java.lang.String"/>
 28    </module>
 29
 30    <!-- Item 6 - Avoid finalizers -->
 31    <!-- this will not find violations that contain linebreaks -->
 32    <!--
 33    <module name="GenericIllegalRegexp">
 34      <property name="format"
 35                value="((public)|(protected))\s+void\s+finalize\(\s*\)"/>
 36    </module>
 37    -->
 38
 39    <!-- Item 8 - Always override hashCode when you override equals -->
 40    <module name="EqualsHashCode"/>
 41
 42    <!-- Item 12 - Make all fields private -->
 43    <module name="VisibilityModifier"/>
 44
 45    <!-- Item 15 - Design and document for inheritance or else prohibit it -->
 46    <!-- the module actually implements a very strict rule, it would be
 47         interesting to know whether Joshua meant what checkstyle implements.
 48         We feel this implementation is well suited as a warning,
 49         i.e. if you get error messages from this check you should be
 50         able to name a good reason to implement your code the way you do it,
 51         especially if you are designing a library and not an application. -->
 52    <module name="DesignForExtension">
 53      <property name="severity" value="warning"/>
 54    </module>
 55
 56    <!-- Item 17 - Use interfaces only to define types -->
 57    <module name="InterfaceIsType"/>
 58
 59    <!-- Item 25 - Design method signatures carefully -->
 60    <!-- Avoid long parameter lists -->
 61    <module name="ParameterNumber">
 62      <property name="max" value="3"/>
 63    </module>
 64
 65    <!-- Item 26 - Use overloading judiciously -->
 66    <!-- rfe #659735 -->
 67
 68    <!-- Item 27 - Return zero-length array, not nulls -->
 69    <!-- no rfe yet -->
 70
 71    <!-- Item 28 - Write doc comments for all exposed API elements -->
 72    <!--
 73    <module name="JavadocType">
 74      <property name="scope" value="protected"/>
 75    </module>
 76    <module name="JavadocMethod">
 77      <property name="scope" value="protected"/>
 78    </module>
 79    <module name="JavadocVariable">
 80      <property name="scope" value="protected"/>
 81    </module>
 82    -->
 83
 84    <!-- Item 29 - Minimize the scope of local variables -->
 85    <!-- no rfe yet -->
 86
 87
 88    <!-- Item 38 - Adhere to generally accepted naming conventions -->
 89    <module name="PackageName">
 90      <!-- no uppercase letters, between 2 and 8 characters -->
 91      <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]{1,7})*$"/>
 92    </module>
 93    <module name="TypeName"/>
 94    <module name="ConstantName"/>
 95    <module name="LocalFinalVariableName"/>
 96    <module name="LocalVariableName"/>
 97    <module name="MemberName"/>
 98    <module name="MethodName"/>
 99    <module name="ParameterName"/>
100    <module name="StaticVariableName"/>
101
102    <!-- Item 47 - Don't ignore exceptions -->
103    <module name="EmptyBlock">
104      <property name="tokens" value="LITERAL_CATCH"/>
105      <!-- require a comment, change to stmt to require a statement -->
106      <property name="option" value="text"/>
107    </module>
108
109    <!-- Item 50 - Never invoke wait outside a loop -->
110    <!-- rfe #712798 -->
111
112    <!-- Item 57 - Provide a readResolve method when necessary -->
113    <!-- no rfe yet -->
114
115  </module>
116
117</module>