Changeset 3056 in josm


Ignore:
Timestamp:
2010-02-27T17:04:37+01:00 (15 years ago)
Author:
jttt
Message:

Revert fix for #4612

Location:
trunk
Files:
2 edited

Legend:

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

    r3042 r3056  
    955955        // Returns only referrers that are members of the same dataset (primitive can have some fake references, for example
    956956        // when way is cloned
     957        checkDataset();
    957958        List<OsmPrimitive> result = new ArrayList<OsmPrimitive>();
    958959        if (referrers != null) {
  • trunk/test/unit/org/openstreetmap/josm/data/osm/OsmPrimitiveTest.java

    r2407 r3056  
    110110    }
    111111
     112    @Test
     113    public void nodeFromMultipleDatasets() {
     114        // n has two referrers - w1 and w2. But only w1 is returned because it is in the same dataset as n
     115        Node n = new Node();
     116
     117        Way w1 = new Way();
     118        w1.addNode(n);
     119        dataSet.addPrimitive(n);
     120        dataSet.addPrimitive(w1);
     121        new Way(w1);
     122
     123        Assert.assertEquals(n.getReferrers().size(), 1);
     124        Assert.assertEquals(n.getReferrers().get(0), w1);
     125    }
     126
     127    @Test(expected=DataIntegrityProblemException.class)
     128    public void checkMustBeInDatasate() {
     129        Node n = new Node();
     130        n.getReferrers();
     131    }
     132
    112133}
Note: See TracChangeset for help on using the changeset viewer.