diff -r ffda9b0b6626 dlight.nativeexecution/src/org/netbeans/modules/nativeexecution/api/util/HostInfoUtils.java --- a/dlight.nativeexecution/src/org/netbeans/modules/nativeexecution/api/util/HostInfoUtils.java Wed Mar 09 12:37:00 2011 +0300 +++ b/dlight.nativeexecution/src/org/netbeans/modules/nativeexecution/api/util/HostInfoUtils.java Wed Mar 09 17:19:27 2011 +0300 @@ -115,7 +115,7 @@ fileExists = npb.call().waitFor() == 0; } - return fileExists; + return fileExists; } public static String searchFile(ExecutionEnvironment execEnv, @@ -233,6 +233,10 @@ } } + /* package */ static void resetHostsData(final ExecutionEnvironment env) { + cache.remove(env); + } + /** * For testing purposes only! */ diff -r ffda9b0b6626 dlight.nativeexecution/src/org/netbeans/modules/nativeexecution/api/util/WindowsSupport.java --- a/dlight.nativeexecution/src/org/netbeans/modules/nativeexecution/api/util/WindowsSupport.java Wed Mar 09 12:37:00 2011 +0300 +++ b/dlight.nativeexecution/src/org/netbeans/modules/nativeexecution/api/util/WindowsSupport.java Wed Mar 09 17:19:27 2011 +0300 @@ -47,15 +47,19 @@ import java.io.OutputStreamWriter; import java.nio.charset.Charset; import java.util.List; +import java.util.concurrent.CancellationException; import java.util.logging.Level; import java.util.regex.Matcher; import java.util.regex.Pattern; +import org.netbeans.modules.nativeexecution.api.ExecutionEnvironment; +import org.netbeans.modules.nativeexecution.api.ExecutionEnvironmentFactory; import org.netbeans.modules.nativeexecution.api.util.ShellValidationSupport.ShellValidationStatus; import org.netbeans.modules.nativeexecution.support.Logger; import org.netbeans.modules.nativeexecution.api.util.Shell.ShellType; import org.netbeans.modules.nativeexecution.support.windows.PathConverter; import org.netbeans.modules.nativeexecution.support.windows.PathConverter.PathType; import org.netbeans.modules.nativeexecution.support.windows.SimpleConverter; +import org.openide.util.Exceptions; import org.openide.util.Utilities; /** @@ -96,14 +100,29 @@ init(null); } - public void init(String searchDir) { + public synchronized void init(String searchDir) { if (!isWindows) { return; } pathConverter = new SimpleConverter(); + + final ExecutionEnvironment env = ExecutionEnvironmentFactory.getLocal(); + boolean resetHIU = HostInfoUtils.isHostInfoAvailable(env) ? true : false; + activeShell = findShell(searchDir); initCharset(); + + if (resetHIU) { + HostInfoUtils.resetHostsData(env); + try { + HostInfoUtils.getHostInfo(env); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } catch (CancellationException ex) { + Exceptions.printStackTrace(ex); + } + } } private Shell findShell(String searchDir) {