Changeset 10309 in josm
- Timestamp:
- 2016-06-02T00:26:31+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r10040 r10309 132 132 */ 133 133 public DataSet() { 134 /* 135 * Transparently register as projection change lister. No need to explicitly remove the 136 * the listener, projection change listeners are managed as WeakReferences. 137 */ 134 // Transparently register as projection change listener. No need to explicitly remove 135 // the listener, projection change listeners are managed as WeakReferences. 138 136 Main.addProjectionChangeListener(this); 139 137 } … … 879 877 getReadLock().lock(); 880 878 try { 881 DataSet ds = new DataSet(); 879 DataSet ds = (DataSet) super.clone(); 880 Main.addProjectionChangeListener(ds); 882 881 Map<OsmPrimitive, OsmPrimitive> primMap = new HashMap<>(); 883 882 for (Node n : nodes) { … … 917 916 ds.version = version; 918 917 return ds; 918 } catch (CloneNotSupportedException e) { 919 throw new IllegalStateException(e); 919 920 } finally { 920 921 getReadLock().unlock(); -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageEntry.java
r10212 r10309 312 312 @Override 313 313 public ImageEntry clone() { 314 Object c; 315 try { 316 c = super.clone(); 314 try { 315 return (ImageEntry) super.clone(); 317 316 } catch (CloneNotSupportedException e) { 318 throw new RuntimeException(e); 319 } 320 return (ImageEntry) c; 317 throw new IllegalStateException(e); 318 } 321 319 } 322 320 -
trunk/src/org/openstreetmap/josm/gui/mappaint/Cascade.java
r10300 r10309 197 197 @Override 198 198 public Cascade clone() { 199 @SuppressWarnings("unchecked") 200 Map<String, Object> clonedProp = (Map<String, Object>) ((HashMap) this.prop).clone(); 201 Cascade c = new Cascade(); 202 c.prop = clonedProp; 203 return c; 199 try { 200 Cascade c = (Cascade) super.clone(); 201 @SuppressWarnings({ "unchecked", "rawtypes" }) 202 Map<String, Object> clonedProp = (Map<String, Object>) ((HashMap) this.prop).clone(); 203 c.prop = clonedProp; 204 return c; 205 } catch (CloneNotSupportedException e) { 206 throw new IllegalStateException(e); 207 } 204 208 } 205 209 -
trunk/src/org/openstreetmap/josm/tools/CopyList.java
r9997 r10309 18 18 * @param <E> the type of elements in this list 19 19 */ 20 public final class CopyList<E> extends AbstractList<E> implements RandomAccess , Cloneable{20 public final class CopyList<E> extends AbstractList<E> implements RandomAccess { 21 21 private E[] array; 22 22 private int size; … … 113 113 114 114 // helpers: 115 /**116 * Returns another independent copy-on-write copy of this <tt>List</tt>117 * instance. Neither the elements nor the backing storage are copied.118 *119 * @return a clone of this <tt>CopyList</tt> instance120 */121 @Override122 public Object clone() {123 return new CopyList<>(array, size);124 }125 115 126 116 private void rangeCheck(int index) {
Note:
See TracChangeset
for help on using the changeset viewer.