synchronization was incorrect

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5594 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Xavier Le Vourch
2007-10-26 17:22:20 +00:00
parent 3f1302fc93
commit 68b3ffb069

View File

@ -91,14 +91,19 @@ public abstract class SimpleAggregatorTst extends RuleTst {
}
public static void addFailure(Failure failure) {
NOTIFIER.fireTestFailure(failure);
synchronized(CustomXmlTestClassMethodsRunner.class) {
NOTIFIER.fireTestFailure(failure);
}
}
@Override
public synchronized void run(RunNotifier n) {
// synchronized so that access to NOTIFIER is safe
NOTIFIER = n;
super.run(n);
public void run(RunNotifier n) {
synchronized(CustomXmlTestClassMethodsRunner.class) {
// synchronized so that access to NOTIFIER is safe: only
// one runner at a time is active
NOTIFIER = n;
super.run(n);
}
}
private static RunNotifier NOTIFIER;