- Timestamp:
- 2011-12-27T17:30:32+01:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r4684 r4725 819 819 * <code>Way wnew = new Way(existingWay)</code> 820 820 * 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 * 821 824 * @return a collection of all primitives that reference this primitive. 822 825 */ 823 826 824 public final List<OsmPrimitive> getReferrers( ) {827 public final List<OsmPrimitive> getReferrers(boolean allowWithoutDataset) { 825 828 // Method copied from OsmPrimitive in josm-ng 826 829 // Returns only referrers that are members of the same dataset (primitive can have some fake references, for example 827 830 // when way is cloned 831 832 if (dataSet == null && allowWithoutDataset) 833 return Collections.emptyList(); 834 828 835 checkDataset(); 829 836 Object referrers = this.referrers; … … 846 853 } 847 854 855 public final List<OsmPrimitive> getReferrers() { 856 return getReferrers(false); 857 } 858 848 859 /** 849 860 * <p>Visits {@code visitor} for all referrers.</p> … … 966 977 if (!isNew() && id != other.id) 967 978 return false; 968 // if (isIncomplete() && ! other.isIncomplete() || !isIncomplete() && other.isIncomplete())979 // if (isIncomplete() && ! other.isIncomplete() || !isIncomplete() && other.isIncomplete()) 969 980 if (isIncomplete() ^ other.isIncomplete()) // exclusive or operator for performance (see #7159) 970 981 return false; -
trunk/src/org/openstreetmap/josm/tools/template_engine/ContextSwitchTemplate.java
r4724 r4725 68 68 List<OsmPrimitive> result = new ArrayList<OsmPrimitive>(); 69 69 for (OsmPrimitive child: children) { 70 for (OsmPrimitive parent: child.getReferrers( )) {70 for (OsmPrimitive parent: child.getReferrers(true)) { 71 71 if (condition == null || condition.match(parent)) { 72 72 result.add(parent);
Note:
See TracChangeset
for help on using the changeset viewer.