changeset: 300640:621133c27772 tag: tip user: Vladimir Voskresensky date: Tue Sep 20 15:01:02 2016 +0300 summary: fixing bug #246881 - Code assistance fails to locate header files mounted with NFS diff --git a/cnd.utils/src/org/netbeans/modules/cnd/utils/cache/CndFileUtils.java b/cnd.utils/src/org/netbeans/modules/cnd/utils/cache/CndFileUtils.java --- a/cnd.utils/src/org/netbeans/modules/cnd/utils/cache/CndFileUtils.java +++ b/cnd.utils/src/org/netbeans/modules/cnd/utils/cache/CndFileUtils.java @@ -86,6 +86,7 @@ * @author Vladimir Voskresensky */ public final class CndFileUtils { + private static final String TRUE_CASE_SENSITIVE_SYSTEM_PROP = "cnd.case.sensitive"; // NOI18N private static final boolean TRUE_CASE_SENSITIVE_SYSTEM; private static final FileChangeListener FSL = new FSListener(); private static final FSProblemListener FSPL = new FSProblemListener(); @@ -128,14 +129,21 @@ static { boolean caseSenstive; - try { - File tmpFile = File.createTempFile("CaseSensitiveFile", ".check"); // NOI18N - String absPath = tmpFile.getAbsolutePath(); - absPath = absPath.toUpperCase(); - caseSenstive = !new File(absPath).exists(); - tmpFile.delete(); - } catch (IOException ex) { - caseSenstive = Utilities.isUnix() && !Utilities.isMac(); + String strVal = System.getProperty(TRUE_CASE_SENSITIVE_SYSTEM_PROP); + if (strVal == null) { + // calculate + try { + File tmpFile = File.createTempFile("CaseSensitiveFile", ".check"); // NOI18N + String absPath = tmpFile.getAbsolutePath(); + absPath = absPath.toUpperCase(); + caseSenstive = !new File(absPath).exists(); + tmpFile.delete(); + } catch (IOException ex) { + caseSenstive = Utilities.isUnix() && !Utilities.isMac(); + } + } else { + // rely on user's choice + caseSenstive = Boolean.parseBoolean(strVal); } TRUE_CASE_SENSITIVE_SYSTEM = caseSenstive; CndFileSystemProvider.addFileChangeListener(FSL);