Changeset 11932 in josm


Ignore:
Timestamp:
2017-04-16T20:54:54+02:00 (6 months ago)
Author:
Don-vip
Message:

sonar - squid:S1941 - Variables should not be declared before they are relevant

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

Legend:

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

    r11384 r11932  
    612612    @Override
    613613    public void apply(MultiCascade mc, OsmPrimitive osm, double scale, boolean pretendWayIsClosed) {
    614         Environment env = new Environment(osm, mc, null, this);
    615614        MapCSSRuleIndex matchingRuleIndex;
    616615        if (osm instanceof Node) {
     
    634633        }
    635634
     635        Environment env = new Environment(osm, mc, null, this);
    636636        // the declaration indices are sorted, so it suffices to save the last used index
    637637        int lastDeclUsed = -1;
  • trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/NodeElement.java

    r11797 r11932  
    7979
    8080    private static NodeElement create(Environment env, float defaultMajorZindex, boolean allowDefault) {
    81         Cascade c = env.mc.getCascade(env.layer);
    82 
    8381        MapImage mapImage = createIcon(env);
    8482        Symbol symbol = null;
     
    8785        }
    8886
    89         RotationAngle rotationAngle = createRotationAngle(env);
    90 
    9187        // optimization: if we neither have a symbol, nor a mapImage
    9288        // we don't have to check for the remaining style properties and we don't
     
    9490        if (!allowDefault && symbol == null && mapImage == null) return null;
    9591
     92        Cascade c = env.mc.getCascade(env.layer);
     93        RotationAngle rotationAngle = createRotationAngle(env);
    9694        return new NodeElement(c, mapImage, symbol, defaultMajorZindex, rotationAngle);
    9795    }
  • trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/TextElement.java

    r11748 r11932  
    3333     */
    3434    public static TextElement create(final Environment env) {
    35         final Cascade c = env.mc.getCascade(env.layer);
    36 
    3735        TextLabel text = TextLabel.create(env, PaintColors.TEXT.get(), false);
    3836        if (text == null)
    3937            return null;
     38        final Cascade c = env.mc.getCascade(env.layer);
    4039        return new TextElement(c, text);
    4140    }
Note: See TracChangeset for help on using the changeset viewer.