aboutsummaryrefslogtreecommitdiffstats
path: root/bridge
diff options
context:
space:
mode:
authoracolyer <acolyer>2005-09-26 19:11:55 +0000
committeracolyer <acolyer>2005-09-26 19:11:55 +0000
commit20cafd486b5f5181153fadc4179c2cf313c931a5 (patch)
treed39d479a80e60ce4ddffcede0ceeb8fa3707a0ee /bridge
parentcf077b3b71ae47a556e230eb40dfa158abd4d037 (diff)
downloadaspectj-20cafd486b5f5181153fadc4179c2cf313c931a5.tar.gz
aspectj-20cafd486b5f5181153fadc4179c2cf313c931a5.zip
a few more tweaks to fix for pr108123 and pr106500 - better diagnostics and exceptions, plus support for -Xdev:Pinpoint
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() {