--- old/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsDefender.java 2019-01-31 19:15:56.044890600 -0800 +++ new/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsDefender.java 2019-01-31 19:15:54.815767700 -0800 @@ -25,14 +25,13 @@ package jdk.jpackage.internal; -import jdk.jpackage.internal.Platform; import java.util.List; final class WindowsDefender { private WindowsDefender() {} - static final boolean isThereAPotentialWindowsDefenderIssue() { + static final boolean isThereAPotentialWindowsDefenderIssue(String dir) { boolean result = false; if (Platform.getPlatform() == Platform.WINDOWS && @@ -41,7 +40,7 @@ // If DisableRealtimeMonitoring is not enabled then there // may be a problem. if (!WindowsRegistry.readDisableRealtimeMonitoring() && - !isTempDirectoryInExclusionPath()) { + !isDirectoryInExclusionPath(dir)) { result = true; } } @@ -49,15 +48,13 @@ return result; } - private static boolean isTempDirectoryInExclusionPath() { + private static boolean isDirectoryInExclusionPath(String dir) { boolean result = false; // If the user temp directory is not found in the exclusion // list then there may be a problem. List paths = WindowsRegistry.readExclusionsPaths(); - String tempDirectory = getUserTempDirectory(); - for (String s : paths) { - if (s.equals(tempDirectory)) { + if (WindowsRegistry.comparePaths(s, dir)) { result = true; break; }