Ignore:
Timestamp:
2009-09-06T23:07:33+02:00 (17 years ago)
Author:
Gubaer
Message:

new: rewrite of CombineWay action
new: conflict resolution dialog for CombineWay, including conflicts for different relation memberships
cleanup: cleanup in OsmReader, reduces memory footprint and reduces parsing time
cleanup: made most of the public fields in OsmPrimitive @deprecated, added accessors and changed the code
cleanup: replaced usages of @deprecated constructors for ExtendedDialog
fixed #3208: Combine ways brokes relation order

WARNING: this changeset touches a lot of code all over the code base. "latest" might become slightly unstable in the next days. Also experience incompatibility issues with plugins in the next few days.

File:
1 edited

Legend:

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

    r2025 r2070  
    77import java.io.PushbackReader;
    88import java.io.StringReader;
     9import java.util.List;
    910import java.util.Map.Entry;
    1011import java.util.regex.Matcher;
     
    8283        public Id(long id) {this.id = id;}
    8384        @Override public boolean match(OsmPrimitive osm) {
    84             return osm.id == id;
     85            return osm.getId() == id;
    8586        }
    8687        @Override public String toString() {return "id="+id;}
     
    329330            }
    330331            if (osm.user != null) {
    331                 String name = osm.user.name;
     332                String name = osm.user.getName();
    332333                // is not Java 1.5
    333334                //String name = java.text.Normalizer.normalize(name, java.text.Normalizer.Form.NFC);
     
    364365    private static class UserMatch extends Match {
    365366        private User user;
    366         public UserMatch(String user) { this.user = User.get(user); }
    367         @Override public boolean match(OsmPrimitive osm) {
    368             return osm.user == user;
    369         }
    370         @Override public String toString() { return "user=" + user.name; }
     367        public UserMatch(String user) {
     368            List<User> users = User.getByName(user);
     369            if (!users.isEmpty()) {
     370                // selecting an arbitrary user
     371                this.user = users.get(0);
     372            } else {
     373                user = null;
     374            }
     375        }
     376        @Override public boolean match(OsmPrimitive osm) {
     377            if (osm.user == null && user == null) return true;
     378            if (osm.user == null) return false;
     379            return osm.user.equals(user);
     380        }
     381        @Override public String toString() {
     382            return "user=" + user == null ? "" : user.getName();
     383        }
    371384    }
    372385
Note: See TracChangeset for help on using the changeset viewer.