Changeset 17688 in josm
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java
r17679 r17688 529 529 // Use more low-level method to find the installed fonts. 530 530 List<String> fontsAvail = new ArrayList<>(); 531 Path fontPath = FileSystems.getDefault().getPath(getSystemEnv("SYSTEMROOT"), "Fonts"); 531 String systemRoot = getSystemEnv("SYSTEMROOT"); 532 if (systemRoot == null) { 533 return fontsAvail; 534 } 535 Path fontPath = FileSystems.getDefault().getPath(systemRoot, "Fonts"); 532 536 try (DirectoryStream<Path> ds = Files.newDirectoryStream(fontPath)) { 533 537 for (Path p : ds) { -
trunk/test/unit/org/openstreetmap/josm/tools/PlatformHookWindowsTest.java
r17679 r17688 5 5 import static org.junit.jupiter.api.Assertions.assertFalse; 6 6 import static org.junit.jupiter.api.Assertions.assertNotNull; 7 import static org.junit.jupiter.api.Assertions.assertNull;8 7 import static org.junit.jupiter.api.Assertions.assertTrue; 9 8 import static org.junit.jupiter.api.Assertions.fail; … … 13 12 import java.io.File; 14 13 import java.io.IOException; 15 import java.nio.file.FileSystems;16 14 import java.security.KeyStoreException; 17 15 import java.util.Collection; … … 172 170 @Test 173 171 void testGetInstalledFonts() { 174 assumeTrue(FileSystems.getDefault() != null); // weird NPE on Jenkins175 assumeTrue(Utils.getJavaVersion() < 16 || PlatformManager.isPlatformWindows()); // No idea why the test fails with Java 16+ on Linux176 172 Collection<String> fonts = hook.getInstalledFonts(); 177 173 if (PlatformManager.isPlatformWindows()) { 178 174 assertFalse(fonts.isEmpty()); 179 175 } else { 180 ass ertNull(fonts);176 assumeTrue(fonts.isEmpty()); 181 177 } 182 178 }
Note:
See TracChangeset
for help on using the changeset viewer.