Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Inglis2003-08-18 13:34:23 -0400
committerDavid Inglis2003-08-18 13:34:23 -0400
commit0f45720f3d0437001dd104e9fa8a5f43e43ee5a1 (patch)
tree26e53b451eb1cad1ac9a95a8437759efa1b89f19 /core/org.eclipse.cdt.core/build
parentdec8f5f092433e25af868565c9636f8401621283 (diff)
downloadorg.eclipse.cdt-0f45720f3d0437001dd104e9fa8a5f43e43ee5a1.tar.gz
org.eclipse.cdt-0f45720f3d0437001dd104e9fa8a5f43e43ee5a1.tar.xz
org.eclipse.cdt-0f45720f3d0437001dd104e9fa8a5f43e43ee5a1.zip
patch from sean see changelog
Diffstat (limited to 'core/org.eclipse.cdt.core/build')
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/ManagedBuildInfo.java19
-rw-r--r--core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Tool.java5
2 files changed, 19 insertions, 5 deletions
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/ManagedBuildInfo.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/ManagedBuildInfo.java
index b2c6090d12..2b4addc6bc 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/ManagedBuildInfo.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/ManagedBuildInfo.java
@@ -186,12 +186,15 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
* @see org.eclipse.cdt.core.build.managed.IResourceBuildInfo#getToolFlags(java.lang.String)
*/
public String getFlagsForTarget(String extension) {
+ // Treat null extensions as an empty string
+ String ext = extension == null ? new String() : extension;
+
// Get all the tools for the current config
IConfiguration config = getDefaultConfiguration(getDefaultTarget());
ITool[] tools = config.getTools();
for (int index = 0; index < tools.length; index++) {
ITool tool = tools[index];
- if (tool.producesFileType(extension)) {
+ if (tool.producesFileType(ext)) {
String flags = new String();
try {
flags = tool.getToolFlags();
@@ -306,13 +309,16 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getOutputFlag()
*/
public String getOutputFlag(String outputExt) {
+ // Treat null extension as an empty string
+ String ext = outputExt == null ? new String() : outputExt;
+
// Get all the tools for the current config
String flags = new String();
IConfiguration config = getDefaultConfiguration(getDefaultTarget());
ITool[] tools = config.getTools();
for (int index = 0; index < tools.length; index++) {
ITool tool = tools[index];
- if (tool.producesFileType(outputExt)) {
+ if (tool.producesFileType(ext)) {
flags = tool.getOutputFlag();
}
}
@@ -323,13 +329,16 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
* @see org.eclipse.cdt.core.build.managed.IManagedBuildInfo#getOutputPrefix(java.lang.String)
*/
public String getOutputPrefix(String outputExtension) {
+ // Treat null extensions as empty string
+ String ext = outputExtension == null ? new String() : outputExtension;
+
// Get all the tools for the current config
String flags = new String();
IConfiguration config = getDefaultConfiguration(getDefaultTarget());
ITool[] tools = config.getTools();
for (int index = 0; index < tools.length; index++) {
ITool tool = tools[index];
- if (tool.producesFileType(outputExtension)) {
+ if (tool.producesFileType(ext)) {
flags = tool.getOutputPrefix();
}
}
@@ -373,12 +382,14 @@ public class ManagedBuildInfo implements IManagedBuildInfo, IScannerInfo {
* @see org.eclipse.cdt.core.build.managed.IResourceBuildInfo#getToolInvocation(java.lang.String)
*/
public String getToolForTarget(String extension) {
+ // Treat a null argument as an empty string
+ String ext = extension == null ? new String() : extension;
// Get all the tools for the current config
IConfiguration config = getDefaultConfiguration(getDefaultTarget());
ITool[] tools = config.getTools();
for (int index = 0; index < tools.length; index++) {
ITool tool = tools[index];
- if (tool.producesFileType(extension)) {
+ if (tool.producesFileType(ext)) {
return tool.getToolCommand();
}
}
diff --git a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Tool.java b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Tool.java
index 488e1fb8d9..3ed5bf404c 100644
--- a/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Tool.java
+++ b/core/org.eclipse.cdt.core/build/org/eclipse/cdt/internal/core/build/managed/Tool.java
@@ -127,6 +127,9 @@ public class Tool extends BuildObject implements ITool, IOptionCategory {
* @see org.eclipse.cdt.core.build.managed.ITool#handlesFileType(java.lang.String)
*/
public boolean buildsFileType(String extension) {
+ if (extension == null) {
+ return false;
+ }
return getInputExtensions().contains(extension);
}
@@ -350,7 +353,7 @@ public class Tool extends BuildObject implements ITool, IOptionCategory {
* @see org.eclipse.cdt.core.build.managed.ITool#producesFileType(java.lang.String)
*/
public boolean producesFileType(String outputExtension) {
- return outputExtension.equals(this.outputExtension);
+ return this.outputExtension.equals(outputExtension);
}
}

Back to the top