Changeset 12744 in josm
- Timestamp:
- 2017-09-05T21:35:24+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/UserIdentityManager.java
r12743 r12744 50 50 * <li>safely search for objects last touched by the current user based on its user id, not on its user name</li> 51 51 * </ul> 52 * @since xxx(renamed from {@code org.openstreetmap.josm.gui.JosmUserIdentityManager})52 * @since 12743 (renamed from {@code org.openstreetmap.josm.gui.JosmUserIdentityManager}) 53 53 * @since 2689 (creation) 54 54 */ -
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r12726 r12744 812 812 Main.platform.afterPrefStartupHook(); 813 813 814 applyWorkarounds(); 815 814 816 FontsManager.initialize(); 815 817 … … 934 936 Logging.info("Enabled EDT checker, wrongful access to gui from non EDT thread will be printed to console"); 935 937 RepaintManager.setCurrentManager(new CheckThreadViolationRepaintManager()); 938 } 939 } 940 941 static void applyWorkarounds() { 942 // Workaround for JDK-8180379: crash on Windows 10 1703 with Windows L&F and java < 8u141 / 9+172 943 // To remove during Java 9 migration 944 if (System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("windows 10") && 945 platform.getDefaultStyle().equals(LafPreference.LAF.get())) { 946 try { 947 final int currentBuild = Integer.parseInt(PlatformHookWindows.getCurrentBuild()); 948 final int javaVersion = Utils.getJavaVersion(); 949 final int javaUpdate = Utils.getJavaUpdate(); 950 final int javaBuild = Utils.getJavaBuild(); 951 // See https://technet.microsoft.com/en-us/windows/release-info.aspx 952 if (currentBuild >= 15_063 && ((javaVersion == 8 && javaUpdate < 141) 953 || (javaVersion == 9 && javaUpdate == 0 && javaBuild < 173))) { 954 // Workaround from https://bugs.openjdk.java.net/browse/JDK-8179014 955 UIManager.put("FileChooser.useSystemExtensionHiding", Boolean.FALSE); 956 } 957 } catch (NumberFormatException | ReflectiveOperationException e) { 958 Logging.error(e); 959 } 936 960 } 937 961 } -
trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java
r12670 r12744 66 66 67 67 import javax.swing.JOptionPane; 68 import javax.swing.UIManager;69 68 70 69 import org.openstreetmap.josm.Main; 71 70 import org.openstreetmap.josm.data.Preferences; 72 import org.openstreetmap.josm.gui.preferences.display.LafPreference;73 71 import org.openstreetmap.josm.io.CertificateAmendment.CertAmend; 74 72 … … 161 159 public void afterPrefStartupHook() { 162 160 extendFontconfig("fontconfig.properties.src"); 163 // Workaround for JDK-8180379: crash on Windows 10 1703 with Windows L&F and java < 8u152 / 9+171164 // To remove during Java 9 migration165 if (System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("windows 10") &&166 getDefaultStyle().equals(LafPreference.LAF.get())) {167 try {168 final int currentBuild = Integer.parseInt(getCurrentBuild());169 final int javaVersion = Utils.getJavaVersion();170 final int javaUpdate = Utils.getJavaUpdate();171 final int javaBuild = Utils.getJavaBuild();172 // See https://technet.microsoft.com/en-us/windows/release-info.aspx173 if (currentBuild >= 15_063 && ((javaVersion == 8 && javaUpdate < 141)174 || (javaVersion == 9 && javaUpdate == 0 && javaBuild < 173))) {175 // Workaround from https://bugs.openjdk.java.net/browse/JDK-8179014176 UIManager.put("FileChooser.useSystemExtensionHiding", Boolean.FALSE);177 }178 } catch (NumberFormatException | ReflectiveOperationException e) {179 Logging.error(e);180 }181 }182 161 } 183 162 … … 282 261 } 283 262 284 private static String getProductName() throws IllegalAccessException, InvocationTargetException { 263 /** 264 * Returns the Windows product name from registry (example: "Windows 10 Pro") 265 * @return the Windows product name from registry 266 * @throws IllegalAccessException if Java language access control is enforced and the underlying method is inaccessible 267 * @throws InvocationTargetException if the underlying method throws an exception 268 * @since 12744 269 */ 270 public static String getProductName() throws IllegalAccessException, InvocationTargetException { 285 271 return WinRegistry.readString(HKEY_LOCAL_MACHINE, CURRENT_VERSION, "ProductName"); 286 272 } 287 273 288 private static String getReleaseId() throws IllegalAccessException, InvocationTargetException { 274 /** 275 * Returns the Windows release identifier from registry (example: "1703") 276 * @return the Windows release identifier from registry 277 * @throws IllegalAccessException if Java language access control is enforced and the underlying method is inaccessible 278 * @throws InvocationTargetException if the underlying method throws an exception 279 * @since 12744 280 */ 281 public static String getReleaseId() throws IllegalAccessException, InvocationTargetException { 289 282 return WinRegistry.readString(HKEY_LOCAL_MACHINE, CURRENT_VERSION, "ReleaseId"); 290 283 } 291 284 292 private static String getCurrentBuild() throws IllegalAccessException, InvocationTargetException { 285 /** 286 * Returns the Windows current build number from registry (example: "15063") 287 * @return the Windows current build number from registry 288 * @throws IllegalAccessException if Java language access control is enforced and the underlying method is inaccessible 289 * @throws InvocationTargetException if the underlying method throws an exception 290 * @since 12744 291 */ 292 public static String getCurrentBuild() throws IllegalAccessException, InvocationTargetException { 293 293 return WinRegistry.readString(HKEY_LOCAL_MACHINE, CURRENT_VERSION, "CurrentBuild"); 294 294 }
Note:
See TracChangeset
for help on using the changeset viewer.