Ignore:
Timestamp:
2018-01-08T02:45:59+01:00 (6 years ago)
Author:
Don-vip
Message:

fix #15742 - check downloaded plugin is valid *before* we delete any existing one (patch by ris)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/TestUtils.java

    r13079 r13300  
    188188
    189189    /**
     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    /**
    190206     * Returns an instance of {@link AbstractProgressMonitor} which keeps track of the monitor state,
    191207     * but does not show the progress.
Note: See TracChangeset for help on using the changeset viewer.