summaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>2007-02-14 03:08:45 +0000
committerjlin16 <jlin16@6f19259b-4bc3-4df7-8a09-765794883524>2007-02-14 03:08:45 +0000
commitc0db4cdc640920a99133fc4b6c111e9bd9f9630b (patch)
tree356b617960e8b0955a48ce4c257a3aba53645a66 /Tools
parent84d87a73e9fd4bd3b3b14372240812812aa9112d (diff)
downloadedk2-platforms-c0db4cdc640920a99133fc4b6c111e9bd9f9630b.tar.xz
add check for empty value of definitions.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2391 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'Tools')
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/toolchain/ToolChainId.java57
1 files changed, 38 insertions, 19 deletions
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/toolchain/ToolChainId.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/toolchain/ToolChainId.java
index b331af363e..65e20bd665 100644
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/toolchain/ToolChainId.java
+++ b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/toolchain/ToolChainId.java
@@ -158,53 +158,70 @@ public class ToolChainId {
String rLine = null;
String inLine[] = new String[2];
while ((rLine = reader.readLine()) != null) {
+ rLine = rLine.trim();
if ((rLine.startsWith("ACTIVE_PLATFORM")) && (activePlatform == null)) {
// Only one active platform is permitted!
- inLine = rLine.trim().split("=");
- activePlatform = inLine[1].trim();
+ inLine = rLine.split("=");
+ if (inLine.length > 1) {
+ activePlatform = inLine[1].trim();
+ }
}
if ((rLine.startsWith("TARGET" + " ")) || (rLine.startsWith("TARGET" + "\t"))
|| (rLine.startsWith("TARGET="))) {
// Handle multiple Target Names
if (rLine.contains(",")) {
- inLine = rLine.trim().split("=");
- buildTargets = inLine[1].trim().replaceAll(",", " ");
+ inLine = rLine.split("=");
+ if (inLine.length > 1) {
+ buildTargets = inLine[1].trim().replaceAll(",", " ");
+ }
} else {
inLine = rLine.trim().split("=");
- buildTargets = inLine[1].trim();
+ if (inLine.length > 1) {
+ buildTargets = inLine[1].trim();
+ }
}
}
if (rLine.startsWith("TARGET_ARCH")) {
// Handle multiple Target Architectures
if (rLine.contains(",")) {
- inLine = rLine.trim().split("=");
- targetArchs = inLine[1].trim().replaceAll(",", " ");
+ inLine = rLine.split("=");
+ if (inLine.length > 1) {
+ targetArchs = inLine[1].trim().replaceAll(",", " ");
+ }
} else {
- inLine = rLine.trim().split("=");
- targetArchs = inLine[1].trim();
+ inLine = rLine.split("=");
+ if (inLine.length > 1) {
+ targetArchs = inLine[1].trim();
+ }
}
}
if (rLine.startsWith("TOOL_CHAIN_CONF")) {
// Only one file is permitted
- inLine = rLine.trim().split("=");
- toolDefinitionFile = inLine[1].trim();
+ inLine = rLine.split("=");
+ if (inLine.length > 1) {
+ toolDefinitionFile = inLine[1].trim();
+ }
}
if (rLine.startsWith("TOOL_CHAIN_TAG")) {
// Handle multiple Tool TagNames
if (rLine.contains(",")) {
- inLine = rLine.trim().split("=");
- tagNames = inLine[1].trim().replaceAll(",", " ");
+ inLine = rLine.split("=");
+ if (inLine.length > 1) {
+ tagNames = inLine[1].trim().replaceAll(",", " ");
+ }
} else {
- inLine = rLine.trim().split("=");
- tagNames = inLine[1].trim();
+ inLine = rLine.split("=");
+ if (inLine.length > 1) {
+ tagNames = inLine[1].trim();
+ }
}
}
if (rLine.startsWith("MULTIPLE_THREAD")) {
// Handle Thread Enable flag
- if ((rLine.trim().toLowerCase().contains("enabled"))
- || (rLine.trim().toLowerCase().contains("true"))) {
+ if ((rLine.toLowerCase().contains("enabled"))
+ || (rLine.toLowerCase().contains("true"))) {
threadEnabled = true;
} else {
threadEnabled = false;
@@ -213,8 +230,10 @@ public class ToolChainId {
if (rLine.startsWith("MAX_CONCURRENT_THREAD_NUMBER")) {
// Handle Thread Enable flag
- inLine = rLine.trim().split("=");
- maxThreadCount = Integer.valueOf(inLine[1].trim());
+ inLine = rLine.split("=");
+ if (inLine.length > 1) {
+ maxThreadCount = Integer.valueOf(inLine[1].trim());
+ }
}
}
reader.close();