Ignore:
Timestamp:
2016-05-30T01:17:28+02:00 (8 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/mapcss
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • 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    }
Note: See TracChangeset for help on using the changeset viewer.