Ignore:
Timestamp:
2016-03-17T01:50:12+01:00 (8 years ago)
Author:
Don-vip
Message:

sonar - Local variable and method parameter names should comply with a naming convention

Location:
trunk/src/org/openstreetmap/josm/gui/mappaint
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/CSSColors.java

    r7509 r10001  
    99    private static final Map<String, Color> CSS_COLORS = new HashMap<>();
    1010    static {
    11         Object[][] CSSCOLORS_INIT = new Object[][] {
     11        for (Object[] pair : new Object[][] {
    1212            {"aliceblue", 0xf0f8ff},
    1313            {"antiquewhite", 0xfaebd7},
     
    157157            {"yellow", 0xffff00},
    158158            {"yellowgreen", 0x9acd32}
    159         };
    160         for (Object[] pair : CSSCOLORS_INIT) {
     159        }) {
    161160            CSS_COLORS.put((String) pair[0], new Color((Integer) pair[1]));
    162161        }
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java

    r9983 r10001  
    149149            }
    150150
    151             float test_float;
     151            float testFloat;
    152152            try {
    153                 test_float = Float.parseFloat(testString);
     153                testFloat = Float.parseFloat(testString);
    154154            } catch (NumberFormatException e) {
    155155                return false;
    156156            }
    157             float prototype_float = Float.parseFloat(prototypeString);
     157            float prototypeFloat = Float.parseFloat(prototypeString);
    158158
    159159            switch (this) {
    160160            case GREATER_OR_EQUAL:
    161                 return test_float >= prototype_float;
     161                return testFloat >= prototypeFloat;
    162162            case GREATER:
    163                 return test_float > prototype_float;
     163                return testFloat > prototypeFloat;
    164164            case LESS_OR_EQUAL:
    165                 return test_float <= prototype_float;
     165                return testFloat <= prototypeFloat;
    166166            case LESS:
    167                 return test_float < prototype_float;
     167                return testFloat < prototypeFloat;
    168168            default:
    169169                throw new AssertionError();
  • trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/LineElement.java

    r9371 r10001  
    5656        public final float defaultMajorZIndex;
    5757
    58         LineType(String prefix, float default_major_z_index) {
     58        LineType(String prefix, float defaultMajorZindex) {
    5959            this.prefix = prefix;
    60             this.defaultMajorZIndex = default_major_z_index;
    61         }
    62     }
    63 
    64     protected LineElement(Cascade c, float default_major_z_index, BasicStroke line, Color color, BasicStroke dashesLine,
     60            this.defaultMajorZIndex = defaultMajorZindex;
     61        }
     62    }
     63
     64    protected LineElement(Cascade c, float defaultMajorZindex, BasicStroke line, Color color, BasicStroke dashesLine,
    6565            Color dashesBackground, float offset, float realWidth, boolean wayDirectionArrows) {
    66         super(c, default_major_z_index);
     66        super(c, defaultMajorZindex);
    6767        this.line = line;
    6868        this.color = color;
     
    104104    private static LineElement createImpl(Environment env, LineType type) {
    105105        Cascade c = env.mc.getCascade(env.layer);
    106         Cascade c_def = env.mc.getCascade("default");
     106        Cascade cDef = env.mc.getCascade("default");
    107107        Float width;
    108108        switch (type) {
    109109            case NORMAL:
    110                 width = getWidth(c, WIDTH, getWidth(c_def, WIDTH, null));
     110                width = getWidth(c, WIDTH, getWidth(cDef, WIDTH, null));
    111111                break;
    112112            case CASING:
    113113                Float casingWidth = c.get(type.prefix + WIDTH, null, Float.class, true);
    114114                if (casingWidth == null) {
    115                     RelativeFloat rel_casingWidth = c.get(type.prefix + WIDTH, null, RelativeFloat.class, true);
    116                     if (rel_casingWidth != null) {
    117                         casingWidth = rel_casingWidth.val / 2;
     115                    RelativeFloat relCasingWidth = c.get(type.prefix + WIDTH, null, RelativeFloat.class, true);
     116                    if (relCasingWidth != null) {
     117                        casingWidth = relCasingWidth.val / 2;
    118118                    }
    119119                }
    120120                if (casingWidth == null)
    121121                    return null;
    122                 width = getWidth(c, WIDTH, getWidth(c_def, WIDTH, null));
     122                width = getWidth(c, WIDTH, getWidth(cDef, WIDTH, null));
    123123                if (width == null) {
    124124                    width = 0f;
     
    162162            case LEFT_CASING:
    163163            case RIGHT_CASING:
    164                 Float baseWidthOnDefault = getWidth(c_def, WIDTH, null);
     164                Float baseWidthOnDefault = getWidth(cDef, WIDTH, null);
    165165                Float baseWidth = getWidth(c, WIDTH, baseWidthOnDefault);
    166166                if (baseWidth == null || baseWidth < 2f) {
  • trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/NodeElement.java

    r9371 r10001  
    9393            BoxTextElement.SIMPLE_NODE_TEXT_ELEMSTYLE);
    9494
    95     protected NodeElement(Cascade c, MapImage mapImage, Symbol symbol, float default_major_z_index, RotationAngle rotationAngle) {
    96         super(c, default_major_z_index);
     95    protected NodeElement(Cascade c, MapImage mapImage, Symbol symbol, float defaultMajorZindex, RotationAngle rotationAngle) {
     96        super(c, defaultMajorZindex);
    9797        this.mapImage = mapImage;
    9898        this.symbol = symbol;
     
    104104    }
    105105
    106     private static NodeElement create(Environment env, float default_major_z_index, boolean allowDefault) {
     106    private static NodeElement create(Environment env, float defaultMajorZindex, boolean allowDefault) {
    107107        Cascade c = env.mc.getCascade(env.layer);
    108108
     
    138138        if (!allowDefault && symbol == null && mapImage == null) return null;
    139139
    140         return new NodeElement(c, mapImage, symbol, default_major_z_index, rotationAngle);
     140        return new NodeElement(c, mapImage, symbol, defaultMajorZindex, rotationAngle);
    141141    }
    142142
     
    148148            return null;
    149149
    150         Cascade c_def = env.mc.getCascade("default");
    151 
    152         Float widthOnDefault = c_def.get(keys[ICON_WIDTH_IDX], null, Float.class);
     150        Cascade cDef = env.mc.getCascade("default");
     151
     152        Float widthOnDefault = cDef.get(keys[ICON_WIDTH_IDX], null, Float.class);
    153153        if (widthOnDefault != null && widthOnDefault <= 0) {
    154154            widthOnDefault = null;
     
    156156        Float widthF = getWidth(c, keys[ICON_WIDTH_IDX], widthOnDefault);
    157157
    158         Float heightOnDefault = c_def.get(keys[ICON_HEIGHT_IDX], null, Float.class);
     158        Float heightOnDefault = cDef.get(keys[ICON_HEIGHT_IDX], null, Float.class);
    159159        if (heightOnDefault != null && heightOnDefault <= 0) {
    160160            heightOnDefault = null;
     
    189189    private static Symbol createSymbol(Environment env) {
    190190        Cascade c = env.mc.getCascade(env.layer);
    191         Cascade c_def = env.mc.getCascade("default");
     191        Cascade cDef = env.mc.getCascade("default");
    192192
    193193        SymbolShape shape;
     
    216216            return null;
    217217
    218         Float sizeOnDefault = c_def.get("symbol-size", null, Float.class);
     218        Float sizeOnDefault = cDef.get("symbol-size", null, Float.class);
    219219        if (sizeOnDefault != null && sizeOnDefault <= 0) {
    220220            sizeOnDefault = null;
     
    229229            return null;
    230230
    231         Float strokeWidthOnDefault = getWidth(c_def, "symbol-stroke-width", null);
     231        Float strokeWidthOnDefault = getWidth(cDef, "symbol-stroke-width", null);
    232232        Float strokeWidth = getWidth(c, "symbol-stroke-width", strokeWidthOnDefault);
    233233
  • trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/StyleElement.java

    r9371 r10001  
    3535    public boolean defaultSelectedHandling;
    3636
    37     public StyleElement(float major_z_index, float z_index, float object_z_index, boolean isModifier, boolean defaultSelectedHandling) {
    38         this.majorZIndex = major_z_index;
    39         this.zIndex = z_index;
    40         this.objectZIndex = object_z_index;
     37    public StyleElement(float majorZindex, float zIndex, float objectZindex, boolean isModifier, boolean defaultSelectedHandling) {
     38        this.majorZIndex = majorZindex;
     39        this.zIndex = zIndex;
     40        this.objectZIndex = objectZindex;
    4141        this.isModifier = isModifier;
    4242        this.defaultSelectedHandling = defaultSelectedHandling;
    4343    }
    4444
    45     protected StyleElement(Cascade c, float default_major_z_index) {
    46         majorZIndex = c.get(MAJOR_Z_INDEX, default_major_z_index, Float.class);
     45    protected StyleElement(Cascade c, float defaultMajorZindex) {
     46        majorZIndex = c.get(MAJOR_Z_INDEX, defaultMajorZindex, Float.class);
    4747        zIndex = c.get(Z_INDEX, 0f, Float.class);
    4848        objectZIndex = c.get(OBJECT_Z_INDEX, 0f, Float.class);
     
    8686                return (float) MapPaintSettings.INSTANCE.getDefaultSegmentWidth();
    8787            if (relativeTo != null) {
    88                 RelativeFloat width_rel = c.get(key, null, RelativeFloat.class, true);
    89                 if (width_rel != null)
    90                     return relativeTo + width_rel.val;
     88                RelativeFloat widthRel = c.get(key, null, RelativeFloat.class, true);
     89                if (widthRel != null)
     90                    return relativeTo + widthRel.val;
    9191            }
    9292        }
Note: See TracChangeset for help on using the changeset viewer.