From 68b3ffb069b7712cb56d1dd25415e95985a8f9ca Mon Sep 17 00:00:00 2001 From: Xavier Le Vourch Date: Fri, 26 Oct 2007 17:22:20 +0000 Subject: [PATCH] synchronization was incorrect git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5594 51baf565-9d33-0410-a72c-fc3788e3496d --- .../pmd/testframework/SimpleAggregatorTst.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/pmd/regress/test/net/sourceforge/pmd/testframework/SimpleAggregatorTst.java b/pmd/regress/test/net/sourceforge/pmd/testframework/SimpleAggregatorTst.java index a08d683a26..8d01219ac7 100644 --- a/pmd/regress/test/net/sourceforge/pmd/testframework/SimpleAggregatorTst.java +++ b/pmd/regress/test/net/sourceforge/pmd/testframework/SimpleAggregatorTst.java @@ -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;