Ignore:
Timestamp:
2016-05-30T01:17:28+02:00 (9 years ago)
Author:
Don-vip
Message:

sonar - Performance - Method passes constant String of length 1 to character overridden method + add unit tests/javadoc

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

Legend:

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

    r10200 r10300  
    130130            } catch (NumberFormatException e) {
    131131                if (Main.isDebugEnabled()) {
    132                     Main.debug("'"+o+"' cannot be converted to float");
     132                    Main.debug('\'' + (String) o + "' cannot be converted to float");
    133133                }
    134134            }
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java

    r10245 r10300  
    743743        private final Expression e;
    744744
     745        /**
     746         * Constructs a new {@code ExpressionFactory}
     747         * @param e expression
     748         */
    745749        public ExpressionCondition(Expression e) {
    746750            this.e = e;
     
    755759        @Override
    756760        public String toString() {
    757             return "[" + e + ']';
     761            return '[' + e.toString() + ']';
    758762        }
    759763    }
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/LiteralExpression.java

    r8846 r10300  
    99/**
    1010 * Simple literal value, that does not depend on other expressions.
     11 * @since 5705
    1112 */
    1213public class LiteralExpression implements Expression {
    1314    private final Object literal;
    1415
     16    /**
     17     * Constructs a new {@code LiteralExpression}.
     18     * @param literal literal
     19     */
    1520    public LiteralExpression(Object literal) {
    1621        CheckParameterUtil.ensureParameterNotNull(literal);
     
    2833            return Arrays.toString((float[]) literal);
    2934        }
    30         return "<" + literal + '>';
     35        return '<' + literal.toString() + '>';
    3136    }
    3237}
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java

    r10033 r10300  
    435435        @Override
    436436        public String toString() {
    437             return left + " " + (ChildOrParentSelectorType.PARENT.equals(type) ? '<' : '>') + link + ' ' + right;
     437            return left.toString() + ' ' + (ChildOrParentSelectorType.PARENT.equals(type) ? '<' : '>') + link + ' ' + right;
    438438        }
    439439    }
  • trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/LabelCompositionStrategy.java

    r9371 r10300  
    269269        @Override
    270270        public String toString() {
    271             return "{" + getClass().getSimpleName() +'}';
     271            return '{' + getClass().getSimpleName() + '}';
    272272        }
    273273
Note: See TracChangeset for help on using the changeset viewer.