Changeset 17693 in josm
- Timestamp:
- 2021-03-30T15:42:02+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/testutils/JOSMTestRules.java
r17532 r17693 3 3 4 4 import java.awt.Color; 5 import java.awt.GraphicsEnvironment; 6 import java.awt.Toolkit; 5 7 import java.awt.Window; 6 8 import java.awt.event.WindowEvent; … … 15 17 import java.lang.annotation.RetentionPolicy; 16 18 import java.lang.annotation.Target; 19 import java.lang.reflect.Method; 17 20 import java.nio.charset.StandardCharsets; 18 21 import java.security.GeneralSecurityException; … … 22 25 import java.util.TimeZone; 23 26 import java.util.logging.Handler; 27 import java.util.logging.Level; 24 28 25 29 import org.awaitility.Awaitility; … … 70 74 import org.openstreetmap.josm.tools.Logging; 71 75 import org.openstreetmap.josm.tools.MemoryManagerTest; 76 import org.openstreetmap.josm.tools.PlatformManager; 72 77 import org.openstreetmap.josm.tools.Territories; 78 import org.openstreetmap.josm.tools.Utils; 73 79 import org.openstreetmap.josm.tools.bugreport.ReportedException; 74 80 import org.openstreetmap.josm.tools.date.DateUtils; … … 614 620 } 615 621 622 workaroundJdkBug8159956(); 616 623 new MainApplication(); 617 624 JOSMFixture.initContentPane(); … … 620 627 JOSMFixture.initMainMenu(); 621 628 } 629 } 630 } 631 632 private void workaroundJdkBug8159956() { 633 try { 634 if (PlatformManager.isPlatformWindows() && Utils.getJavaVersion() == 8 && GraphicsEnvironment.isHeadless()) { 635 // https://bugs.openjdk.java.net/browse/JDK-8159956 636 Method initIDs = Toolkit.class.getDeclaredMethod("initIDs"); 637 initIDs.setAccessible(true); 638 initIDs.invoke(Toolkit.getDefaultToolkit()); 639 } 640 } catch (Exception e) { 641 Logging.log(Level.WARNING, "Failed to Toolkit.initIDs", e); 622 642 } 623 643 }
Note:
See TracChangeset
for help on using the changeset viewer.