Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Evoy2004-05-13 14:52:25 -0400
committerSean Evoy2004-05-13 14:52:25 -0400
commit437c6840b12db2fc39cd9e6cd59692b557812252 (patch)
tree7cec2ce92cd7350f4ad73a9021594805beb77cd1 /build/org.eclipse.cdt.managedbuilder.core
parent87821eb4fc2cfc7d917d9e9d98bc1ca74282b97c (diff)
downloadorg.eclipse.cdt-437c6840b12db2fc39cd9e6cd59692b557812252.tar.gz
org.eclipse.cdt-437c6840b12db2fc39cd9e6cd59692b557812252.tar.xz
org.eclipse.cdt-437c6840b12db2fc39cd9e6cd59692b557812252.zip
Fix for bug 61505 - closing and opening a project causes "null" to appear in the makefile
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.core')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java38
1 files changed, 20 insertions, 18 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
index 165e4e4129e..d7e7af24d41 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/ToolReference.java
@@ -11,6 +11,7 @@
package org.eclipse.cdt.managedbuilder.internal.core;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
@@ -35,7 +36,7 @@ public class ToolReference implements IToolReference {
private boolean isDirty = false;
private List optionReferences;
private IBuildObject owner;
- private List outputExtensions;
+ private String outputExtensions;
private String outputFlag;
private String outputPrefix;
protected ITool parent;
@@ -85,11 +86,7 @@ public class ToolReference implements IToolReference {
// Get the output extensions the reference produces
if (element.hasAttribute(ITool.OUTPUTS)) {
- String output = element.getAttribute(ITool.OUTPUTS);
- String[] outputs = output.split(DEFAULT_SEPARATOR);
- for (int index = outputs.length - 1; index >= 0; --index) {
- getOutputsList().add(outputs[index].trim());
- }
+ outputExtensions = element.getAttribute(ITool.OUTPUTS);
}
// Get the flag to control output
if (element.hasAttribute(ITool.OUTPUT_FLAG))
@@ -133,10 +130,7 @@ public class ToolReference implements IToolReference {
// Get the overridden output extensions (if any)
String output = element.getAttribute(ITool.OUTPUTS);
if (output != null) {
- String[] outputs = output.split(DEFAULT_SEPARATOR);
- for (int index = outputs.length - 1; index >= 0; --index) {
- getOutputsList().add(outputs[index].trim());
- }
+ outputExtensions = output;
}
// Get the flag to control output
@@ -318,6 +312,18 @@ public class ToolReference implements IToolReference {
}
/* (non-Javadoc)
+ * @return
+ */
+ private List getOutputsList() {
+ ArrayList answer = new ArrayList();
+ if (outputExtensions != null) {
+ String[] exts = outputExtensions.split(DEFAULT_SEPARATOR);
+ answer.addAll(Arrays.asList(exts));
+ }
+ return answer;
+ }
+
+ /* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.IToolReference#getTool()
*/
public ITool getTool() {
@@ -482,13 +488,6 @@ public class ToolReference implements IToolReference {
return parent.getOutputExtension(inputExtension);
}
- private List getOutputsList() {
- if (outputExtensions == null) {
- outputExtensions = new ArrayList();
- }
- return outputExtensions;
- }
-
/* (non-Javadoc)
* @see org.eclipse.cdt.managedbuilder.core.ITool#getOutputFlag()
*/
@@ -561,11 +560,14 @@ public class ToolReference implements IToolReference {
}
// Save the output flag
- if (outputPrefix != null) {
+ if (outputFlag != null) {
element.setAttribute(ITool.OUTPUT_FLAG, getOutputFlag());
}
// Save the outputs
+ if (outputExtensions != null) {
+ element.setAttribute(ITool.OUTPUTS, outputExtensions);
+ }
// Output the option references
Iterator iter = getOptionReferenceList().listIterator();

Back to the top