Changeset 12539 in josm


Ignore:
Timestamp:
2017-07-30T01:00:55+02:00 (7 years ago)
Author:
Don-vip
Message:

PMD - enable naming rules

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoader.java

    r11453 r12539  
    4747     * and for TMS imagery
    4848     */
    49     private static ThreadPoolExecutor DEFAULT_DOWNLOAD_JOB_DISPATCHER = getNewThreadPoolExecutor("TMS-downloader-%d");
    50 
     49    private static final ThreadPoolExecutor DEFAULT_DOWNLOAD_JOB_DISPATCHER = getNewThreadPoolExecutor("TMS-downloader-%d");
    5150
    5251    private ThreadPoolExecutor downloadExecutor = DEFAULT_DOWNLOAD_JOB_DISPATCHER;
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java

    r12481 r12539  
    206206    }
    207207
    208     private static Map<Font, Boolean> IS_GLYPH_VECTOR_DOUBLE_TRANSLATION_BUG = new HashMap<>();
     208    private static final Map<Font, Boolean> IS_GLYPH_VECTOR_DOUBLE_TRANSLATION_BUG = new HashMap<>();
    209209
    210210    /**
  • trunk/src/org/openstreetmap/josm/data/validation/tests/InternetTags.java

    r11129 r12539  
    3030     * List of keys subject to URL validation.
    3131     */
    32     private static String[] URL_KEYS = new String[] {
     32    private static final String[] URL_KEYS = new String[] {
    3333        "url", "source:url",
    3434        "website", "contact:website", "heritage:website", "source:website"
     
    3838     * List of keys subject to email validation.
    3939     */
    40     private static String[] EMAIL_KEYS = new String[] {
     40    private static final String[] EMAIL_KEYS = new String[] {
    4141        "email", "contact:email"
    4242    };
  • trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/StyleElement.java

    r12303 r12539  
    137137     * a JOSM session. Should have a listener listening to preference changes.
    138138     */
    139     private static volatile String DEFAULT_FONT_NAME;
    140     private static volatile Float DEFAULT_FONT_SIZE;
     139    private static volatile String defaultFontName;
     140    private static volatile Float defaultFontSize;
    141141    private static final Object lock = new Object();
    142142
    143143    // thread save access (double-checked locking)
    144144    private static Float getDefaultFontSize() {
    145         Float s = DEFAULT_FONT_SIZE;
     145        Float s = defaultFontSize;
    146146        if (s == null) {
    147147            synchronized (lock) {
    148                 s = DEFAULT_FONT_SIZE;
     148                s = defaultFontSize;
    149149                if (s == null) {
    150                     DEFAULT_FONT_SIZE = s = (float) Main.pref.getInteger("mappaint.fontsize", 8);
     150                    defaultFontSize = s = (float) Main.pref.getInteger("mappaint.fontsize", 8);
    151151                }
    152152            }
     
    156156
    157157    private static String getDefaultFontName() {
    158         String n = DEFAULT_FONT_NAME;
     158        String n = defaultFontName;
    159159        if (n == null) {
    160160            synchronized (lock) {
    161                 n = DEFAULT_FONT_NAME;
     161                n = defaultFontName;
    162162                if (n == null) {
    163                     DEFAULT_FONT_NAME = n = Main.pref.get("mappaint.font", "Droid Sans");
     163                    defaultFontName = n = Main.pref.get("mappaint.font", "Droid Sans");
    164164                }
    165165            }
  • trunk/tools/pmd/josm-ruleset.xml

    r12199 r12539  
    1616  <rule ref="rulesets/java/finalizers.xml"/>
    1717  <rule ref="rulesets/java/imports.xml"/>
    18   <rule ref="rulesets/java/migrating.xml"/>
    19   <rule ref="rulesets/java/naming.xml"/>-->
     18  <rule ref="rulesets/java/migrating.xml"/>-->
     19  <rule ref="rulesets/java/naming.xml">
     20        <exclude name="AbstractNaming"/>
     21        <exclude name="AvoidFieldNameMatchingMethodName"/>
     22        <exclude name="AvoidFieldNameMatchingTypeName"/>
     23        <exclude name="BooleanGetMethodName"/>
     24        <exclude name="LongVariable"/>
     25        <exclude name="ShortClassName"/>
     26        <exclude name="ShortMethodName"/>
     27        <exclude name="ShortVariable"/>
     28        <exclude name="MethodNamingConventions"/>
     29        <exclude name="VariableNamingConventions"/>
     30  </rule>
     31  <rule ref="rulesets/java/naming.xml/ShortMethodName">
     32    <properties>
     33        <property name="violationSuppressXPath" value="//MethodDeclarator[@Image='at' or @Image='ht' or @Image='of' or @Image='ok' or @Image='tr']
     34                | //MethodDeclarator/../../Annotation/MarkerAnnotation/Name[@Image='Deprecated']
     35                | //MethodDeclarator/../../../..[@Image='LambertConformalConic']"/>
     36    </properties>
     37  </rule>
     38  <rule ref="rulesets/java/naming.xml/MethodNamingConventions">
     39    <properties>
     40        <property name="violationSuppressXPath" value="//MethodDeclarator/../../../..[@Image='Functions' or @Image='PseudoClasses' or @Image='Role' or @Image='TaggingPreset']"/>
     41    </properties>
     42  </rule>
     43  <rule ref="rulesets/java/naming.xml/VariableNamingConventions">
     44    <properties>
     45        <property name="violationSuppressXPath" value="//FieldDeclaration[@Public='true']|//FieldDeclaration/../Annotation/MarkerAnnotation/Name[@Image='pref']"/>
     46    </properties>
     47  </rule>
     48  <rule ref="rulesets/java/naming.xml/LongVariable">
     49    <properties>
     50        <property name="minimum" value="44"/>
     51    </properties>
     52  </rule>
    2053  <rule ref="rulesets/java/optimizations.xml">
    2154        <exclude name="LocalVariableCouldBeFinal"/>
Note: See TracChangeset for help on using the changeset viewer.