Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorSergey Prigogin2015-01-07 00:29:55 +0000
committerSergey Prigogin2015-01-07 00:41:30 +0000
commitce73d736bdc5f13b0dc2a03078c8e5164f920ce9 (patch)
treeffd170e51a770c95438364cf62867961a85692eb /llvm
parent91d2fb6a4bc35d6c89133cd6f98002084b5cb067 (diff)
downloadorg.eclipse.cdt-ce73d736bdc5f13b0dc2a03078c8e5164f920ce9.tar.gz
org.eclipse.cdt-ce73d736bdc5f13b0dc2a03078c8e5164f920ce9.tar.xz
org.eclipse.cdt-ce73d736bdc5f13b0dc2a03078c8e5164f920ce9.zip
Fixed an NPE.
Diffstat (limited to 'llvm')
-rwxr-xr-xllvm/org.eclipse.cdt.managedbuilder.llvm.ui/src/org/eclipse/cdt/managedbuilder/llvm/ui/LlvmEnvironmentVariableSupplier.java29
1 files changed, 14 insertions, 15 deletions
diff --git a/llvm/org.eclipse.cdt.managedbuilder.llvm.ui/src/org/eclipse/cdt/managedbuilder/llvm/ui/LlvmEnvironmentVariableSupplier.java b/llvm/org.eclipse.cdt.managedbuilder.llvm.ui/src/org/eclipse/cdt/managedbuilder/llvm/ui/LlvmEnvironmentVariableSupplier.java
index 2e622779271..fcd34f8395b 100755
--- a/llvm/org.eclipse.cdt.managedbuilder.llvm.ui/src/org/eclipse/cdt/managedbuilder/llvm/ui/LlvmEnvironmentVariableSupplier.java
+++ b/llvm/org.eclipse.cdt.managedbuilder.llvm.ui/src/org/eclipse/cdt/managedbuilder/llvm/ui/LlvmEnvironmentVariableSupplier.java
@@ -32,9 +32,7 @@ import org.eclipse.core.runtime.Path;
*
* @noextend This class is not intended to be subclassed by clients.
*/
-public class LlvmEnvironmentVariableSupplier implements
- IConfigurationEnvironmentVariableSupplier {
-
+public class LlvmEnvironmentVariableSupplier implements IConfigurationEnvironmentVariableSupplier {
//toggle for preference changes
private static boolean preferencesChanged = true;
//LLVM environment variable data structure
@@ -257,7 +255,7 @@ public class LlvmEnvironmentVariableSupplier implements
}
/**
- * Get LLVM executable path.
+ * Returns LLVM executable path.
*
* @param candidatePath Suggestion for LLVM executable path
* @param subPath Additional sub-path for LLVM executable path
@@ -269,12 +267,14 @@ public class LlvmEnvironmentVariableSupplier implements
if (candidatePath.endsWith(Separators.getFileSeparator()) && candidatePath.length() > 1) {
llvmPath = candidatePath.substring(0, candidatePath.length() - 1);
}
- //if subPath exists and is not empty -> append it to candidatePath
- if ((null != subPath) && (subPath.length()!=0)) {
- //form full path
+ // If subPath exists and is not empty -> append it to candidatePath.
+ if (null != subPath && !subPath.isEmpty()) {
+ // Form full path.
llvmPath = candidatePath + Separators.getFileSeparator() + subPath;
}
- //return a full path for LLVM executable if it's valid, otherwise null
+ if (llvmPath == null)
+ return null;
+ // Return a full path for LLVM executable if it's valid, otherwise null.
return getBinDirIfLlvm_ar(llvmPath);
}
@@ -290,16 +290,15 @@ public class LlvmEnvironmentVariableSupplier implements
if (new Path(binPathTemp).toFile().isDirectory()) {
String llvm_executable = "llvm-ar"; //$NON-NLS-1$
File arFileFullPath = null;
- //if OS is Windows -> add .exe to the executable name
+ // If OS is Windows -> add .exe to the executable name.
if (System.getProperty("os.name").toLowerCase().indexOf("win") >= 0) { //$NON-NLS-1$//$NON-NLS-2$
llvm_executable = llvm_executable + ".exe"; //$NON-NLS-1$
}
- //form full executable path
- arFileFullPath = new File(binPathTemp + Separators.getFileSeparator()
- + llvm_executable);
- //check if file exists -> proper LLVM installation exists
+ // Form full executable path
+ arFileFullPath = new File(binPathTemp, llvm_executable);
+ // Check if file exists -> proper LLVM installation exists.
if (arFileFullPath.isFile()) {
- //return path where llvm-ar exists
+ // Return path where llvm-ar exists
return binPathTemp;
}
}
@@ -307,7 +306,7 @@ public class LlvmEnvironmentVariableSupplier implements
}
/**
- * Get stdc++ library path located in MinGW installation.
+ * Returns stdc++ library path located in MinGW installation.
*
* @return stdc++ library path for MinGW
*/

Back to the top