Ignore:
Timestamp:
2016-05-16T04:05:58+02:00 (4 years ago)
Author:
Don-vip
Message:

findbugs: DP_DO_INSIDE_DO_PRIVILEGED + UWF_UNWRITTEN_FIELD + RC_REF_COMPARISON + OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE

Location:
trunk/src/org/openstreetmap/josm/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/Diff.java

    r10179 r10223  
    386386    }
    387387
    388     private boolean inhibit;
    389 
    390388    /**
    391389     * Adjust inserts/deletes of blank lines to join changes as much as possible.
    392390     */
    393391    private void shift_boundaries() {
    394         if (inhibit)
    395             return;
    396392        filevec[0].shift_boundaries(filevec[1]);
    397393        filevec[1].shift_boundaries(filevec[0]);
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r10066 r10223  
    2626import java.io.InputStreamReader;
    2727import java.io.UnsupportedEncodingException;
     28import java.lang.reflect.AccessibleObject;
    2829import java.net.MalformedURLException;
    2930import java.net.URL;
     
    3435import java.nio.file.Path;
    3536import java.nio.file.StandardCopyOption;
     37import java.security.AccessController;
    3638import java.security.MessageDigest;
    3739import java.security.NoSuchAlgorithmException;
     40import java.security.PrivilegedAction;
    3841import java.text.Bidi;
    3942import java.text.MessageFormat;
     
    15371540    }
    15381541
     1542    /**
     1543     * Sets {@code AccessibleObject}(s) accessible.
     1544     * @param objects objects
     1545     * @see AccessibleObject#setAccessible
     1546     * @since 10223
     1547     */
     1548    public static void setObjectsAccessible(final AccessibleObject ... objects) {
     1549        if (objects != null && objects.length > 0) {
     1550            AccessController.doPrivileged(new PrivilegedAction<Object>() {
     1551                @Override
     1552                public Object run() {
     1553                    for (AccessibleObject o : objects) {
     1554                        o.setAccessible(true);
     1555                    }
     1556                    return null;
     1557                }
     1558            });
     1559        }
     1560    }
    15391561}
Note: See TracChangeset for help on using the changeset viewer.