Corrected Indentation using formatter. (#1541)
This commit is contained in:
committed by
Grzegorz Piwowarek
parent
e28dfe6a4a
commit
ce589cc7b5
@@ -2,14 +2,6 @@ import com.google.common.util.concurrent.Monitor;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import static com.google.common.util.concurrent.Uninterruptibles.joinUninterruptibly;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNull;
|
||||
|
||||
public class MonitorUnitTests {
|
||||
|
||||
@Test
|
||||
@@ -19,11 +11,11 @@ public class MonitorUnitTests {
|
||||
|
||||
Monitor.Guard gaurdCondition = monitor.newGuard(this::returnTrue);
|
||||
|
||||
if(monitor.enterIf(gaurdCondition)){
|
||||
try{
|
||||
if (monitor.enterIf(gaurdCondition)) {
|
||||
try {
|
||||
System.out.println("Entered in critical section");
|
||||
enteredInCriticalSection = true;
|
||||
}finally {
|
||||
} finally {
|
||||
monitor.leave();
|
||||
}
|
||||
}
|
||||
@@ -39,11 +31,11 @@ public class MonitorUnitTests {
|
||||
|
||||
Monitor.Guard gaurdCondition = monitor.newGuard(this::returnFalse);
|
||||
|
||||
if(monitor.enterIf(gaurdCondition)){
|
||||
try{
|
||||
if (monitor.enterIf(gaurdCondition)) {
|
||||
try {
|
||||
System.out.println("Entered in critical section");
|
||||
enteredInCriticalSection = true;
|
||||
}finally {
|
||||
} finally {
|
||||
monitor.leave();
|
||||
}
|
||||
}
|
||||
@@ -51,11 +43,11 @@ public class MonitorUnitTests {
|
||||
Assert.assertFalse(enteredInCriticalSection);
|
||||
}
|
||||
|
||||
private boolean returnTrue(){
|
||||
private boolean returnTrue() {
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean returnFalse(){
|
||||
private boolean returnFalse() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user