Ignore:
Timestamp:
2016-07-23T21:38:02+02:00 (8 years ago)
Author:
Don-vip
Message:

see #11390 - sonar - squid:S1604 - Java 8: Anonymous inner classes containing only one method should become lambdas

File:
1 edited

Legend:

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

    r10604 r10616  
    13741374     */
    13751375    public static Executor newDirectExecutor() {
    1376         return new Executor() {
    1377             @Override
    1378             public void execute(Runnable command) {
    1379                 command.run();
    1380             }
    1381         };
     1376        return command -> command.run();
    13821377    }
    13831378
     
    16201615    public static void setObjectsAccessible(final AccessibleObject ... objects) {
    16211616        if (objects != null && objects.length > 0) {
    1622             AccessController.doPrivileged(new PrivilegedAction<Object>() {
    1623                 @Override
    1624                 public Object run() {
    1625                     for (AccessibleObject o : objects) {
    1626                         o.setAccessible(true);
    1627                     }
    1628                     return null;
     1617            AccessController.doPrivileged((PrivilegedAction<Object>) () -> {
     1618                for (AccessibleObject o : objects) {
     1619                    o.setAccessible(true);
    16291620                }
     1621                return null;
    16301622            });
    16311623        }
Note: See TracChangeset for help on using the changeset viewer.