Changeset 10222 in josm for trunk/test/unit/org/openstreetmap/josm/actions/CreateCircleActionTest.java
- Timestamp:
- 2016-05-15T21:14:06+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/actions/CreateCircleActionTest.java
r9661 r10222 9 9 import java.lang.reflect.Field; 10 10 import java.lang.reflect.Method; 11 import java.security.AccessController; 12 import java.security.PrivilegedAction; 11 13 import java.util.ArrayList; 12 14 import java.util.Arrays; … … 56 58 public void addSelected(OsmPrimitive p, DataSet ds) { 57 59 try { 58 Method method = ds.getClass()60 final Method method = ds.getClass() 59 61 .getDeclaredMethod("addSelected", 60 62 new Class<?>[] {Collection.class, boolean.class}); 61 method.setAccessible(true); 63 AccessController.doPrivileged(new PrivilegedAction<Object>() { 64 @Override 65 public Object run() { 66 method.setAccessible(true); 67 return null; 68 } 69 }); 62 70 method.invoke(ds, Collections.singleton(p), false); 63 } catch ( Exception e) {71 } catch (ReflectiveOperationException e) { 64 72 e.printStackTrace(); 65 73 fail("Can't add OsmPrimitive to dataset: " + e.getMessage()); … … 162 170 rlCache.setAccessible(true); 163 171 ConstantTrafficHand trafficHand = new ConstantTrafficHand(true); 164 rlCache.set(null, new GeoPropertyIndex< Boolean>(trafficHand, 24));165 } catch ( Exception e) {172 rlCache.set(null, new GeoPropertyIndex<>(trafficHand, 24)); 173 } catch (ReflectiveOperationException e) { 166 174 e.printStackTrace(); 167 175 fail("Impossible to mock left/right hand database: " + e.getMessage());
Note:
See TracChangeset
for help on using the changeset viewer.