Changeset 13300 in josm for trunk/test/unit/org/openstreetmap/josm/TestUtils.java
- Timestamp:
- 2018-01-08T02:45:59+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/TestUtils.java
r13079 r13300 188 188 189 189 /** 190 * Sets a private static field value. 191 * @param cls object class 192 * @param fieldName private field name 193 * @param value replacement value 194 * @throws ReflectiveOperationException if a reflection operation error occurs 195 */ 196 public static void setPrivateStaticField(Class<?> cls, String fieldName, final Object value) throws ReflectiveOperationException { 197 Field f = cls.getDeclaredField(fieldName); 198 AccessController.doPrivileged((PrivilegedAction<Void>) () -> { 199 f.setAccessible(true); 200 return null; 201 }); 202 f.set(null, value); 203 } 204 205 /** 190 206 * Returns an instance of {@link AbstractProgressMonitor} which keeps track of the monitor state, 191 207 * but does not show the progress.
Note:
See TracChangeset
for help on using the changeset viewer.