Ignore:
Timestamp:
27.12.2011 17:30:32 (5 months ago)
Author:
jttt
Message:

Fix #7074 Crash after purging some data

File:
1 edited

Legend:

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

    r4684 r4725  
    819819     * <code>Way wnew = new Way(existingWay)</code> 
    820820     * 
     821     * @param allowWithoutDataset If true, method will return empty list if primitive is not part of the dataset. If false, 
     822     * exception will be thrown in this case 
     823     * 
    821824     * @return a collection of all primitives that reference this primitive. 
    822825     */ 
    823826 
    824     public final List<OsmPrimitive> getReferrers() { 
     827    public final List<OsmPrimitive> getReferrers(boolean allowWithoutDataset) { 
    825828        // Method copied from OsmPrimitive in josm-ng 
    826829        // Returns only referrers that are members of the same dataset (primitive can have some fake references, for example 
    827830        // when way is cloned 
     831 
     832        if (dataSet == null && allowWithoutDataset) 
     833            return Collections.emptyList(); 
     834 
    828835        checkDataset(); 
    829836        Object referrers = this.referrers; 
     
    846853    } 
    847854 
     855    public final List<OsmPrimitive> getReferrers() { 
     856        return getReferrers(false); 
     857    } 
     858 
    848859    /** 
    849860     * <p>Visits {@code visitor} for all referrers.</p> 
     
    966977        if (!isNew() &&  id != other.id) 
    967978            return false; 
    968 //        if (isIncomplete() && ! other.isIncomplete() || !isIncomplete()  && other.isIncomplete()) 
     979        //        if (isIncomplete() && ! other.isIncomplete() || !isIncomplete()  && other.isIncomplete()) 
    969980        if (isIncomplete() ^ other.isIncomplete()) // exclusive or operator for performance (see #7159) 
    970981            return false; 
Note: See TracChangeset for help on using the changeset viewer.