Ignore:
Timestamp:
2016-07-23T20:04:31+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/io/OsmConnection.java

    r10308 r10615  
    1313import java.nio.charset.StandardCharsets;
    1414import java.util.Objects;
    15 import java.util.concurrent.Callable;
    1615import java.util.concurrent.FutureTask;
    1716
     
    129128                throw new MissingOAuthAccessTokenException();
    130129            }
    131             final Runnable authTask = new FutureTask<>(new Callable<OAuthAuthorizationWizard>() {
    132                 @Override
    133                 public OAuthAuthorizationWizard call() throws Exception {
    134                     // Concerning Utils.newDirectExecutor: Main.worker cannot be used since this connection is already
    135                     // executed via Main.worker. The OAuth connections would block otherwise.
    136                     final OAuthAuthorizationWizard wizard = new OAuthAuthorizationWizard(
    137                             Main.parent, apiUrl.toExternalForm(), Utils.newDirectExecutor());
    138                     wizard.showDialog();
    139                     OAuthAccessTokenHolder.getInstance().setSaveToPreferences(true);
    140                     OAuthAccessTokenHolder.getInstance().save(Main.pref, CredentialsManager.getInstance());
    141                     return wizard;
    142                 }
     130            final Runnable authTask = new FutureTask<>(() -> {
     131                // Concerning Utils.newDirectExecutor: Main.worker cannot be used since this connection is already
     132                // executed via Main.worker. The OAuth connections would block otherwise.
     133                final OAuthAuthorizationWizard wizard = new OAuthAuthorizationWizard(
     134                        Main.parent, apiUrl.toExternalForm(), Utils.newDirectExecutor());
     135                wizard.showDialog();
     136                OAuthAccessTokenHolder.getInstance().setSaveToPreferences(true);
     137                OAuthAccessTokenHolder.getInstance().save(Main.pref, CredentialsManager.getInstance());
     138                return wizard;
    143139            });
    144140            // exception handling differs from implementation at GuiHelper.runInEDTAndWait()
Note: See TracChangeset for help on using the changeset viewer.