aboutsummaryrefslogtreecommitdiffstats
path: root/bridge
diff options
context:
space:
mode:
Diffstat (limited to 'bridge')
-rw-r--r--bridge/src/org/aspectj/bridge/context/CompilationAndWeavingContext.java10
-rw-r--r--bridge/testsrc/org/aspectj/bridge/context/CompilationAndWeavingContextTest.java2
2 files changed, 8 insertions, 4 deletions
diff --git a/bridge/src/org/aspectj/bridge/context/CompilationAndWeavingContext.java b/bridge/src/org/aspectj/bridge/context/CompilationAndWeavingContext.java
index 208bc696b..f99146864 100644
--- a/bridge/src/org/aspectj/bridge/context/CompilationAndWeavingContext.java
+++ b/bridge/src/org/aspectj/bridge/context/CompilationAndWeavingContext.java
@@ -150,11 +150,11 @@ public class CompilationAndWeavingContext {
explanationStack.push(getFormatter(entry).formatEntry(entry.phaseId,entry.data));
}
StringBuffer sb = new StringBuffer();
- for (Iterator iter = explanationStack.iterator(); iter.hasNext();) {
+ while (!explanationStack.isEmpty()) {
sb.append("when ");
- sb.append(iter.next().toString());
+ sb.append(explanationStack.pop().toString());
sb.append("\n");
- }
+ }
return sb.toString();
}
@@ -215,6 +215,10 @@ public class CompilationAndWeavingContext {
this.phaseId = phase;
this.data = data;
}
+
+ public String toString() {
+ return CompilationAndWeavingContext.getFormatter(this).formatEntry(phaseId, data);
+ }
}
private static class DefaultFormatter implements ContextFormatter {
diff --git a/bridge/testsrc/org/aspectj/bridge/context/CompilationAndWeavingContextTest.java b/bridge/testsrc/org/aspectj/bridge/context/CompilationAndWeavingContextTest.java
index 6e8c73e22..825a52b61 100644
--- a/bridge/testsrc/org/aspectj/bridge/context/CompilationAndWeavingContextTest.java
+++ b/bridge/testsrc/org/aspectj/bridge/context/CompilationAndWeavingContextTest.java
@@ -27,7 +27,7 @@ public class CompilationAndWeavingContextTest extends TestCase {
public void testDoubleEntry() {
CompilationAndWeavingContext.enteringPhase(1,"XYZ");
CompilationAndWeavingContext.enteringPhase(2, "ABC");
- assertEquals("when fiddling XYZ\nwhen mucking about with ABC\n",CompilationAndWeavingContext.getCurrentContext());
+ assertEquals("when mucking about with ABC\nwhen fiddling XYZ\n",CompilationAndWeavingContext.getCurrentContext());
}
public void testEntryEntryExit() {