|
24 | 24 | import java.nio.file.Path; |
25 | 25 | import java.util.HashMap; |
26 | 26 | import java.util.List; |
| 27 | +import java.util.Locale; |
27 | 28 | import java.util.Map; |
28 | 29 | import java.util.Objects; |
29 | 30 | import java.util.Properties; |
@@ -208,7 +209,7 @@ private static String macOsFix(String binaryPath) { |
208 | 209 | } |
209 | 210 |
|
210 | 211 | private static boolean isMacOs() { |
211 | | - return System.getProperty("os.name").toLowerCase().contains("mac"); |
| 212 | + return System.getProperty("os.name").toLowerCase(Locale.ROOT).contains("mac"); |
212 | 213 | } |
213 | 214 |
|
214 | 215 | private String format(IdeaStepFormatterCleanupResources ideaStepFormatterCleanupResources, String unix, File file) throws Exception { |
@@ -244,10 +245,14 @@ private File createIdeaPropertiesFile() { |
244 | 245 | return ideaProps.toFile(); // only create if it does not exist |
245 | 246 | } |
246 | 247 |
|
247 | | - ThrowingEx.run(() -> Files.createDirectories(ideaProps.getParent())); |
| 248 | + Path parent = ideaProps.getParent(); |
| 249 | + if (parent == null) { |
| 250 | + throw new IllegalStateException(String.format("Parent directory for IDEA properties file %s cannot be null", ideaProps)); |
| 251 | + } |
| 252 | + ThrowingEx.run(() -> Files.createDirectories(parent)); |
248 | 253 |
|
249 | | - Path configPath = ideaProps.getParent().resolve("config"); |
250 | | - Path systemPath = ideaProps.getParent().resolve("system"); |
| 254 | + Path configPath = parent.resolve("config"); |
| 255 | + Path systemPath = parent.resolve("system"); |
251 | 256 |
|
252 | 257 | Properties properties = new Properties(); |
253 | 258 | properties.putAll(ideaProperties); |
|
0 commit comments