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

checkstyle: enable relevant whitespace checks and fix them

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java

    r8495 r8510  
    8989            // TODO: check for keyword collisions
    9090            if (factory instanceof SimpleMatchFactory) {
    91                 simpleMatchFactoryMap.put(keyword, (SimpleMatchFactory)factory);
     91                simpleMatchFactoryMap.put(keyword, (SimpleMatchFactory) factory);
    9292            } else if (factory instanceof UnaryMatchFactory) {
    93                 unaryMatchFactoryMap.put(keyword, (UnaryMatchFactory)factory);
     93                unaryMatchFactoryMap.put(keyword, (UnaryMatchFactory) factory);
    9494            } else if (factory instanceof BinaryMatchFactory) {
    95                 binaryMatchFactoryMap.put(keyword, (BinaryMatchFactory)factory);
     95                binaryMatchFactoryMap.put(keyword, (BinaryMatchFactory) factory);
    9696            } else
    9797                throw new AssertionError("Unknown match factory");
     
    326326            super(match);
    327327        }
     328
    328329        @Override
    329330        public boolean match(OsmPrimitive osm) {
    330331            return !match.match(osm);
    331332        }
     333
    332334        @Override
    333335        public String toString() {
    334336            return "!" + match;
    335337        }
     338
    336339        public Match getMatch() {
    337340            return match;
     
    350353            this.defaultValue = defaultValue;
    351354        }
     355
    352356        @Override
    353357        public boolean match(OsmPrimitive osm) {
     
    367371            super(lhs, rhs);
    368372        }
     373
    369374        @Override
    370375        public boolean match(OsmPrimitive osm) {
    371376            return lhs.match(osm) && rhs.match(osm);
    372377        }
     378
    373379        @Override
    374380        public String toString() {
     
    384390            super(lhs, rhs);
    385391        }
     392
    386393        @Override
    387394        public boolean match(OsmPrimitive osm) {
    388395            return lhs.match(osm) || rhs.match(osm);
    389396        }
     397
    390398        @Override
    391399        public String toString() {
     
    401409            super(lhs, rhs);
    402410        }
     411
    403412        @Override
    404413        public boolean match(OsmPrimitive osm) {
    405414            return lhs.match(osm) ^ rhs.match(osm);
    406415        }
     416
    407417        @Override
    408418        public String toString() {
     
    418428            super(range);
    419429        }
     430
    420431        public Id(PushbackTokenizer tokenizer) throws ParseError {
    421432            this(tokenizer.readRange(tr("Range of primitive ids expected")));
    422433        }
     434
    423435        @Override
    424436        protected Long getNumber(OsmPrimitive osm) {
    425437            return osm.isNew() ? 0 : osm.getUniqueId();
    426438        }
     439
    427440        @Override
    428441        protected String getString() {
     
    438451            super(range);
    439452        }
     453
    440454        public ChangesetId(PushbackTokenizer tokenizer) throws ParseError {
    441455            this(tokenizer.readRange(tr("Range of changeset ids expected")));
    442456        }
     457
    443458        @Override
    444459        protected Long getNumber(OsmPrimitive osm) {
    445460            return (long) osm.getChangesetId();
    446461        }
     462
    447463        @Override
    448464        protected String getString() {
     
    458474            super(range);
    459475        }
     476
    460477        public Version(PushbackTokenizer tokenizer) throws ParseError {
    461478            this(tokenizer.readRange(tr("Range of versions expected")));
    462479        }
     480
    463481        @Override
    464482        protected Long getNumber(OsmPrimitive osm) {
    465483            return (long) osm.getVersion();
    466484        }
     485
    467486        @Override
    468487        protected String getString() {
     
    551570                } else {
    552571                    mv = osm.get(key);
    553                     if(!caseSensitive && mv == null) {
     572                    if (!caseSensitive && mv == null) {
    554573                        for (String k: osm.keySet()) {
    555                             if(key.equalsIgnoreCase(k)) {
     574                            if (key.equalsIgnoreCase(k)) {
    556575                                mv = osm.get(k);
    557576                                break;
     
    574593            return false;
    575594        }
     595
    576596        @Override
    577597        public String toString() {
     
    628648                throw new ParseError(tr("Key cannot be empty when tag operator is used. Sample use: key=value"));
    629649            this.key = key;
    630             this.value = value == null?"":value;
     650            this.value = value == null ? "" : value;
    631651            if ("".equals(this.value) && "*".equals(key)) {
    632652                mode = Mode.NONE;
     
    800820            return false;
    801821        }
     822
    802823        @Override
    803824        public String toString() {
     
    808829    private static class ExactType extends Match {
    809830        private final OsmPrimitiveType type;
     831
    810832        public ExactType(String type) throws ParseError {
    811833            this.type = OsmPrimitiveType.from(type);
     
    814836                        type));
    815837        }
     838
    816839        @Override
    817840        public boolean match(OsmPrimitive osm) {
    818841            return type.equals(osm.getType());
    819842        }
     843
    820844        @Override
    821845        public String toString() {
     
    829853    private static class UserMatch extends Match {
    830854        private String user;
     855
    831856        public UserMatch(String user) {
    832857            if ("anonymous".equals(user)) {
     
    856881    private static class RoleMatch extends Match {
    857882        private String role;
     883
    858884        public RoleMatch(String role) {
    859885            if (role == null) {
     
    871897                        if (m.getMember() == osm) {
    872898                            String testRole = m.getRole();
    873                             if(role.equals(testRole == null ? "" : testRole))
     899                            if (role.equals(testRole == null ? "" : testRole))
    874900                                return true;
    875901                        }
     
    10681094            return "timestamp";
    10691095        }
    1070 
    10711096    }
    10721097
     
    10791104            return osm.isNew();
    10801105        }
     1106
    10811107        @Override
    10821108        public String toString() {
     
    10931119            return osm.isModified() || osm.isNewOrUndeleted();
    10941120        }
     1121
    10951122        @Override
    10961123        public String toString() {
     
    11071134            return Main.main.getCurrentDataSet().isSelected(osm);
    11081135        }
     1136
    11091137        @Override
    11101138        public String toString() {
     
    11231151            return osm.isIncomplete();
    11241152        }
     1153
    11251154        @Override
    11261155        public String toString() {
     
    11391168            return !osm.isTagged() && !osm.isIncomplete();
    11401169        }
     1170
    11411171        @Override
    11421172        public String toString() {
     
    11531183            return osm instanceof Way && ((Way) osm).isClosed();
    11541184        }
     1185
    11551186        @Override
    11561187        public String toString() {
     
    11661197            super(m);
    11671198        }
     1199
    11681200        @Override
    11691201        public boolean match(OsmPrimitive osm) {
     
    11711203
    11721204            if (osm instanceof Way) {
    1173                 for (Node n : ((Way)osm).getNodes()) {
     1205                for (Node n : ((Way) osm).getNodes()) {
    11741206                    isParent |= match.match(n);
    11751207                }
    11761208            } else if (osm instanceof Relation) {
    1177                 for (RelationMember member : ((Relation)osm).getMembers()) {
     1209                for (RelationMember member : ((Relation) osm).getMembers()) {
    11781210                    isParent |= match.match(member.getMember());
    11791211                }
     
    11811213            return isParent;
    11821214        }
     1215
    11831216        @Override
    11841217        public String toString() {
     
    12041237            return isChild;
    12051238        }
     1239
    12061240        @Override
    12071241        public String toString() {
     
    12711305    private abstract static class InArea extends Match {
    12721306
    1273         protected abstract Bounds getBounds();
    12741307        protected final boolean all;
    12751308
     
    12801313            this.all = all;
    12811314        }
     1315
     1316        protected abstract Bounds getBounds();
    12821317
    12831318        @Override
     
    13371372            super(msg);
    13381373        }
     1374
    13391375        public ParseError(String msg, Throwable cause) {
    13401376            super(msg, cause);
    13411377        }
     1378
    13421379        public ParseError(Token expected, Token found) {
    13431380            this(tr("Unexpected token. Expected {0}, found {1}", expected, found));
Note: See TracChangeset for help on using the changeset viewer.