Changeset 765 in josm for trunk/src


Ignore:
Timestamp:
2008-08-11T11:30:47+02:00 (16 years ago)
Author:
stoecker
Message:

Fixed memory overflow, prevent looped relations. Closes #1356.

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/Relation.java

    r755 r765  
    5959        }
    6060
    61     @Override public String toString() {
    62         return "{Relation id="+id+" version="+version+" members="+Arrays.toString(members.toArray())+"}";
    63     }
     61        @Override public String toString() {
     62                // return "{Relation id="+id+" version="+version+" members="+Arrays.toString(members.toArray())+"}";
     63                // adding memvbers in string increases memory usage a lot and overflows for looped relations
     64                return "{Relation id="+id+" version="+version+"}";
     65        }
    6466
    6567        @Override public boolean realEqual(OsmPrimitive osm, boolean semanticOnly) {
    6668                return osm instanceof Relation ? super.realEqual(osm, semanticOnly) && members.equals(((Relation)osm).members) : false;
    67     }
     69        }
    6870
    6971        public int compareTo(OsmPrimitive o) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/RelationEditor.java

    r758 r765  
    303303                        boolean skip = false;
    304304                        for (RelationMember rm : clone.members) {
    305                                 if (rm.member == p)
     305                                if (rm.member == p || p == relation)
    306306                                {
    307307                                        skip = true;
Note: See TracChangeset for help on using the changeset viewer.