summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2007-05-31 10:51:06 (EDT)
committer pelder2007-05-31 10:51:06 (EDT)
commite2923ee699865e27c4c84415cc573cf532b8560c (patch)
tree91848dcef262db2f3dd6250cf588c8b7d9997350
parent2483486a97059642df429501cdd1c1a5f936e3d5 (diff)
downloadorg.eclipse.jet-e2923ee699865e27c4c84415cc573cf532b8560c.zip
org.eclipse.jet-e2923ee699865e27c4c84415cc573cf532b8560c.tar.gz
org.eclipse.jet-e2923ee699865e27c4c84415cc573cf532b8560c.tar.bz2
[190222] JET2Platform.runXXX methods do not set severity of returned IStatus objects correctly.
-rw-r--r--plugins/org.eclipse.jet.core/src/org/eclipse/jet/ContextLogEntry.java5
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Platform.java20
2 files changed, 17 insertions, 8 deletions
diff --git a/plugins/org.eclipse.jet.core/src/org/eclipse/jet/ContextLogEntry.java b/plugins/org.eclipse.jet.core/src/org/eclipse/jet/ContextLogEntry.java
index 5e7b8b8..91f71a5 100644
--- a/plugins/org.eclipse.jet.core/src/org/eclipse/jet/ContextLogEntry.java
+++ b/plugins/org.eclipse.jet.core/src/org/eclipse/jet/ContextLogEntry.java
@@ -220,6 +220,11 @@ public final class ContextLogEntry {
if(builder.children.length > 0) {
this.children = new ContextLogEntry[builder.children.length];
System.arraycopy(builder.children, 0, this.children, 0, builder.children.length);
+ } else if(builder.exception != null && builder.exception.getCause() != null) {
+ ContextLogEntry.Builder childEntryBuilder = new ContextLogEntry.Builder(builder.getSeverity());
+ childEntryBuilder.exception(builder.exception.getCause());
+ this.children = new ContextLogEntry[] {childEntryBuilder.build()};
+
} else {
children = EMPTY_ENTRIES_ARRAY;
}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Platform.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Platform.java
index 7e37625..588e401 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Platform.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/JET2Platform.java
@@ -353,20 +353,24 @@ public class JET2Platform
*/
public static IStatus toIStatus(ContextLogEntry logEntry)
{
- int severity = logEntry.getSeverity();
final ContextLogEntry[] children = logEntry.getChildren();
// for (int i = 0; i < children.length; i++)
// {
// severity = Math.max(severity, children[i].getSeverity());
// }
- MultiStatus result = new MultiStatus(JET2Platform.PLUGIN_ID, severity, logEntry.getMessage(), logEntry.getException());
- for (int i = 0; i < children.length; i++)
- {
- result.add(toIStatus(children[i]));
+ if(children.length > 0) {
+ MultiStatus result = new MultiStatus(JET2Platform.PLUGIN_ID, IStatus.OK, logEntry.getMessage(), logEntry.getException());
+ for (int i = 0; i < children.length; i++)
+ {
+ result.add(toIStatus(children[i]));
+ }
+
+
+ return result;
+ } else {
+ int severity = logEntry.getSeverity();
+ return new Status(severity, JET2Platform.PLUGIN_ID, IStatus.OK, logEntry.getMessage(), logEntry.getException());
}
-
-
- return result;
}
/**
* Invoke a JET transform against the passed context