- Timestamp:
- 2023-02-08T22:22:05+01:00 (22 months ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/oauth/OAuthParameters.java
r18650 r18651 100 100 final String redirectUri; 101 101 final String baseUrl; 102 if (apiUrl != null && !Config.getUrls().getDefaultOsmApiUrl().equals(apiUrl) ) {102 if (apiUrl != null && !Config.getUrls().getDefaultOsmApiUrl().equals(apiUrl) && !"http://invalid".equals(apiUrl)) { 103 103 clientId = ""; 104 104 clientSecret = ""; -
trunk/src/org/openstreetmap/josm/io/OsmConnection.java
r18650 r18651 11 11 import java.util.Base64; 12 12 import java.util.Objects; 13 import java.util.concurrent.CountDownLatch; 13 14 import java.util.concurrent.TimeUnit; 14 import java.util.concurrent.atomic.AtomicBoolean;15 15 import java.util.function.Consumer; 16 16 … … 214 214 RemoteControl.start(); 215 215 } 216 AtomicBoolean done = new AtomicBoolean();216 CountDownLatch done = new CountDownLatch(1); 217 217 Consumer<IOAuthToken> consumer = authToken -> { 218 218 if (!remoteControlIsRunning) { … … 223 223 OAuthAccessTokenHolder.getInstance().setAccessToken(OsmApi.getOsmApi().getServerUrl(), authToken); 224 224 OAuthAccessTokenHolder.getInstance().save(CredentialsManager.getInstance()); 225 synchronized (done) { 226 done.set(true); 227 done.notifyAll(); 228 } 225 done.countDown(); 229 226 }; 230 227 new OAuth20Authorization().authorize(oAuth20Parameters, … … 235 232 // Only wait at most 5 minutes 236 233 int counter = 0; 237 while ( !done.get()&& counter < 5) {234 while (done.getCount() >= 0 && counter < 5) { 238 235 try { 239 done.wait(TimeUnit.MINUTES.toMillis(1)); 236 if (done.await(1, TimeUnit.MINUTES)) { 237 break; 238 } 240 239 } catch (InterruptedException e) { 241 240 Thread.currentThread().interrupt();
Note:
See TracChangeset
for help on using the changeset viewer.