- Timestamp:
- 2017-05-18T21:56:44+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java
r11381 r12204 6 6 import java.io.BufferedReader; 7 7 import java.io.IOException; 8 import java.lang.reflect.Field;9 8 import java.net.CookieHandler; 10 9 import java.net.HttpURLConnection; … … 89 88 public void cancel() { 90 89 canceled = true; 91 if (provider != null) {92 try {93 Field f = provider.getClass().getDeclaredField("connection");94 Utils.setObjectsAccessible(f);95 HttpURLConnection con = (HttpURLConnection) f.get(provider);96 if (con != null) {97 con.disconnect();98 }99 } catch (NoSuchFieldException | SecurityException | IllegalAccessException e) {100 Main.error(e);101 Main.warn(tr("Failed to cancel running OAuth operation"));102 }103 }104 90 synchronized (this) { 105 91 if (connection != null) {
Note:
See TracChangeset
for help on using the changeset viewer.