lkishalmi commented on code in PR #7341:
URL: https://github.com/apache/netbeans/pull/7341#discussion_r1582498692
##########
java/gradle.java/src/org/netbeans/modules/gradle/java/spi/support/JavaToolchainSupport.java:
##########
@@ -67,11 +73,21 @@ public static JavaToolchainSupport getDefault() {
* @return the {@linkplain JavaPlatform} representing the given directory.
*/
public JavaPlatform platformByHome(File home) {
- return platformCache.computeIfAbsent(home, this::detectPlatform);
+ JavaPlatform ret = platformCache.get(home);
+ if (ret == null) {
+ ret = detectPlatform(home);
+ if (ret.isValid()) {
+ platformCache.put(home, ret);
+ }
+ }
+ return ret;
}
private JavaPlatform detectPlatform(File home) {
FileObject h = FileUtil.toFileObject(home);
+ if (h == null) {
+ return new BrokenJavaPlatform(toolchainName(home));
+ }
Review Comment:
Kind of true. Re-implemented returning `null` instead of returning an
invalid platform.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists