ER-099 Use the "synchronized" modifier on methods that implement 'Runnable.run ()'

Severity2
Enabledyes
Waivable
Violation
public class SynchronizedRunnableRunMethodRuleViolationTestCase extends Thread {
	private static org.apache.log4j.Logger logger = org.apache.log4j.Logger.getRootLogger();
	public void run() {
	}
}
Fix
public class SynchronizedRunnableRunMethodRuleFixTestCase extends Thread {
	private static org.apache.log4j.Logger logger = org.apache.log4j.Logger.getRootLogger();
	public synchronized void run() {
	}
}


Hammurapi 3 Copyright © 2004 Hammurapi Group. All Rights Reserved.