Ignore:
Timestamp:
2015-06-20T23:42:21+02:00 (9 years ago)
Author:
Don-vip
Message:

checkstyle: enable relevant whitespace checks and fix them

Location:
trunk/src/org/openstreetmap/josm/tools/template_engine
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/template_engine/ContextSwitchTemplate.java

    r8509 r8510  
    4242    private abstract class ContextProvider extends Match {
    4343        protected Match condition;
     44
    4445        abstract List<OsmPrimitive> getPrimitives(OsmPrimitive root);
    4546    }
     
    5152            this.childCondition = child;
    5253        }
    53         @Override
    54         public boolean match(OsmPrimitive osm) {
    55             throw new UnsupportedOperationException();
    56         }
     54
     55        @Override
     56        public boolean match(OsmPrimitive osm) {
     57            throw new UnsupportedOperationException();
     58        }
     59
    5760        @Override
    5861        List<OsmPrimitive> getPrimitives(OsmPrimitive root) {
     
    194197
    195198            if (lhs instanceof ContextProvider && rhs instanceof ContextProvider)
    196                 return new AndSet((ContextProvider)lhs, (ContextProvider)rhs);
     199                return new AndSet((ContextProvider) lhs, (ContextProvider) rhs);
    197200            else if (lhs instanceof ContextProvider) {
    198201                ContextProvider cp = (ContextProvider) lhs;
     
    218221
    219222            if (lhs instanceof ContextProvider && rhs instanceof ContextProvider)
    220                 return new OrSet((ContextProvider)lhs, (ContextProvider)rhs);
     223                return new OrSet((ContextProvider) lhs, (ContextProvider) rhs);
    221224            else if (lhs instanceof ContextProvider)
    222225                throw new ParseError(
  • trunk/src/org/openstreetmap/josm/tools/template_engine/TemplateEngineDataProvider.java

    r7937 r8510  
    88public interface TemplateEngineDataProvider {
    99    Collection<String> getTemplateKeys();
     10
    1011    Object getTemplateValue(String name, boolean special);
     12
    1113    boolean evaluateCondition(Match condition);
    1214}
  • trunk/src/org/openstreetmap/josm/tools/template_engine/TemplateEntry.java

    r7937 r8510  
    44public interface TemplateEntry {
    55    void appendText(StringBuilder result, TemplateEngineDataProvider dataProvider);
     6
    67    boolean isValid(TemplateEngineDataProvider dataProvider);
    78}
  • trunk/src/org/openstreetmap/josm/tools/template_engine/Tokenizer.java

    r7937 r8510  
    3636        @Override
    3737        public String toString() {
    38             return type + (text != null?" " + text:"");
     38            return type + (text != null ? " " + text : "");
    3939        }
    4040    }
     
    8585                return new Token(TokenType.CONDITION_START, position);
    8686            } else
    87                 throw ParseError.unexpectedChar('{', (char)c, position);
     87                throw ParseError.unexpectedChar('{', (char) c, position);
    8888        case '!':
    8989            getChar();
     
    9292                return new Token(TokenType.CONTEXT_SWITCH_START, position);
    9393            } else
    94                 throw ParseError.unexpectedChar('{', (char)c, position);
     94                throw ParseError.unexpectedChar('{', (char) c, position);
    9595        case '}':
    9696            getChar();
     
    103103            return new Token(TokenType.APOSTROPHE, position);
    104104        default:
    105             while (c != -1 && !specialCharaters.contains((char)c)) {
     105            while (c != -1 && !specialCharaters.contains((char) c)) {
    106106                if (c == '\\') {
    107107                    getChar();
     
    110110                    }
    111111                }
    112                 text.append((char)c);
     112                text.append((char) c);
    113113                getChar();
    114114            }
     
    132132                getChar();
    133133            }
    134             result.append((char)c);
     134            result.append((char) c);
    135135            getChar();
    136136        }
    137137        return new Token(TokenType.TEXT, position, result.toString());
    138138    }
    139 
    140139}
Note: See TracChangeset for help on using the changeset viewer.