From 40e7343ce3dee47a31b53bb7af78532473351965 Mon Sep 17 00:00:00 2001 From: Alexey Ushakov Date: Mon, 30 Nov 2015 01:43:43 +0300 Subject: [PATCH] IDEA-57233 Editor font antialising/appearance problems on Linux Corrected jdk bundle check for non-standard jdk bundles on mac --- .../testSrc/com/intellij/util/JdkBundleTest.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/platform/platform-tests/testSrc/com/intellij/util/JdkBundleTest.java b/platform/platform-tests/testSrc/com/intellij/util/JdkBundleTest.java index 541d77509904..af2b532fc126 100644 --- a/platform/platform-tests/testSrc/com/intellij/util/JdkBundleTest.java +++ b/platform/platform-tests/testSrc/com/intellij/util/JdkBundleTest.java @@ -38,7 +38,8 @@ public class JdkBundleTest { File bootJDK = SystemInfo.isMac ? homeJDK.getParentFile().getParentFile() : homeJDK; String verStr = System.getProperty("java.version"); - JdkBundle bundle = (SystemInfo.isMac && !new File(bootJDK, "Contents/Home").exists()) + boolean macNonStandardJDK = SystemInfo.isMac && !new File(bootJDK, "Contents/Home").exists(); + JdkBundle bundle = macNonStandardJDK ? JdkBundle.createBundle(homeJDK, "", true, true) : // the test is run under jdk with non-standard layout JdkBundle.createBundle(bootJDK, true, true); @@ -47,7 +48,7 @@ public class JdkBundleTest { assertTrue(bundle.isBoot()); assertTrue(bundle.isBundled()); - assertTrue(FileUtil.filesEqual(bundle.getBundleAsFile(), bootJDK)); + assertTrue(FileUtil.filesEqual(bundle.getBundleAsFile(), macNonStandardJDK ? homeJDK : bootJDK)); Pair verUpdate = bundle.getVersionUpdate(); assertNotNull(verUpdate); @@ -65,15 +66,15 @@ public class JdkBundleTest { File bootJDK = SystemInfo.isMac ? homeJDK.getParentFile().getParentFile() : homeJDK; String verStr = System.getProperty("java.version"); - JdkBundle bundle = (SystemInfo.isMac && !new File(bootJDK, "Contents/Home").exists()) - ? JdkBundle.createBoot(false) : // the test is run under jdk with non-standard layout + boolean macNonStandardJDK = SystemInfo.isMac && !new File(bootJDK, "Contents/Home").exists(); + JdkBundle bundle = macNonStandardJDK ? JdkBundle.createBoot(false) : // the test is run under jdk with non-standard layout JdkBundle.createBoot(); assertNotNull(bundle); assertTrue(bundle.isBoot()); assertFalse(bundle.isBundled()); - assertTrue(FileUtil.filesEqual(bundle.getBundleAsFile(), bootJDK)); + assertTrue(FileUtil.filesEqual(bundle.getBundleAsFile(), macNonStandardJDK ? homeJDK : bootJDK)); Pair verUpdate = bundle.getVersionUpdate(); assertNotNull(verUpdate);