Skip to content

Commit a3e3680

Browse files
committed
Synchronise JoinPointImpl methods dealing with Stack<AroundClosure>
If we do not synchronise, we will run into problems with nested around-aspects in combination with proceeding asynchronously (in another thread). Fixes eclipse-aspectj#128. Signed-off-by: Alexander Kriegisch <[email protected]>
1 parent 102e061 commit a3e3680

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

runtime/src/main/java/org/aspectj/runtime/reflect/JoinPointImpl.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public final String toLongString() {
146146
this.arc = arc;
147147
}
148148

149-
public void stack$AroundClosure(AroundClosure arc) {
149+
public synchronized void stack$AroundClosure(AroundClosure arc) {
150150
// If input parameter arc is null this is the 'unlink' call from AroundClosure
151151
if (arcs == null) {
152152
arcs = new Stack<>();
@@ -158,7 +158,7 @@ public final String toLongString() {
158158
}
159159
}
160160

161-
public Object proceed() throws Throwable {
161+
public synchronized Object proceed() throws Throwable {
162162
// when called from a before advice, but be a no-op
163163
if (arcs == null) {
164164
if (arc == null) {
@@ -171,7 +171,7 @@ public Object proceed() throws Throwable {
171171
}
172172
}
173173

174-
public Object proceed(Object[] adviceBindings) throws Throwable {
174+
public synchronized Object proceed(Object[] adviceBindings) throws Throwable {
175175
// when called from a before advice, but be a no-op
176176
AroundClosure ac = null;
177177
if (arcs == null) {

0 commit comments

Comments
 (0)