Fix indentation issues
This commit is contained in:
parent
159461815d
commit
573df300b0
|
@ -13,8 +13,7 @@ public class Employee {
|
||||||
String name;
|
String name;
|
||||||
String title;
|
String title;
|
||||||
|
|
||||||
public Employee(int id, String name, String title)
|
public Employee(int id, String name, String title) {
|
||||||
{
|
|
||||||
incrementCount();
|
incrementCount();
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
|
|
@ -10,8 +10,7 @@ public class Employee {
|
||||||
String name;
|
String name;
|
||||||
String title;
|
String title;
|
||||||
|
|
||||||
public Employee(int id, String name, String title)
|
public Employee(int id, String name, String title) {
|
||||||
{
|
|
||||||
incrementCount();
|
incrementCount();
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
|
|
@ -14,8 +14,7 @@ public class Employee {
|
||||||
String name;
|
String name;
|
||||||
String title;
|
String title;
|
||||||
|
|
||||||
public Employee(int id, String name, String title)
|
public Employee(int id, String name, String title) {
|
||||||
{
|
|
||||||
incrementCount();
|
incrementCount();
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
|
|
@ -12,8 +12,7 @@ public class Employee {
|
||||||
String name;
|
String name;
|
||||||
String title;
|
String title;
|
||||||
|
|
||||||
public Employee(int id, String name, String title)
|
public Employee(int id, String name, String title) {
|
||||||
{
|
|
||||||
incrementCount();
|
incrementCount();
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
|
|
@ -10,8 +10,7 @@ public class Employee
|
||||||
String name;
|
String name;
|
||||||
String title;
|
String title;
|
||||||
|
|
||||||
public Employee(int id, String name, String title)
|
public Employee(int id, String name, String title) {
|
||||||
{
|
|
||||||
incrementCount();
|
incrementCount();
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
|
|
@ -11,8 +11,7 @@ import java.util.concurrent.Executors;
|
||||||
* package. When not synchronized the out will not be sequential;
|
* package. When not synchronized the out will not be sequential;
|
||||||
* when it is synchronized the output will be in sequential.
|
* when it is synchronized the output will be in sequential.
|
||||||
*/
|
*/
|
||||||
public class SychronizeStaticDataUnitTest
|
public class SychronizeStaticDataUnitTest {
|
||||||
{
|
|
||||||
private final Executor pool = Executors.newFixedThreadPool(4);
|
private final Executor pool = Executors.newFixedThreadPool(4);
|
||||||
|
|
||||||
private final int numberToTest = 100;
|
private final int numberToTest = 100;
|
||||||
|
@ -24,10 +23,9 @@ public class SychronizeStaticDataUnitTest
|
||||||
|
|
||||||
for(int i = 0; i < numberToTest; i++) {
|
for(int i = 0; i < numberToTest; i++) {
|
||||||
int finalI = i;
|
int finalI = i;
|
||||||
pool.execute(() ->
|
pool.execute(() -> {
|
||||||
{
|
new com.baeldung.concurrent.synchronizestatic.none.Employee(finalI, "John", "Smith");
|
||||||
new com.baeldung.concurrent.synchronizestatic.none.Employee(finalI, "John", "Smith");
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,10 +36,9 @@ public class SychronizeStaticDataUnitTest
|
||||||
|
|
||||||
for(int i = 0; i < numberToTest; i++) {
|
for(int i = 0; i < numberToTest; i++) {
|
||||||
int finalI = i;
|
int finalI = i;
|
||||||
pool.execute(() ->
|
pool.execute(() -> {
|
||||||
{
|
new com.baeldung.concurrent.synchronizestatic.synchronizedmethod.Employee(finalI, "John", "Smith");
|
||||||
new com.baeldung.concurrent.synchronizestatic.synchronizedmethod.Employee(finalI, "John", "Smith");
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,10 +49,9 @@ public class SychronizeStaticDataUnitTest
|
||||||
|
|
||||||
for(int i = 0; i < numberToTest; i++) {
|
for(int i = 0; i < numberToTest; i++) {
|
||||||
int finalI = i;
|
int finalI = i;
|
||||||
pool.execute(() ->
|
pool.execute(() -> {
|
||||||
{
|
new com.baeldung.concurrent.synchronizestatic.synchronizedclass.Employee(finalI, "John", "Smith");
|
||||||
new com.baeldung.concurrent.synchronizestatic.synchronizedclass.Employee(finalI, "John", "Smith");
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,10 +62,9 @@ public class SychronizeStaticDataUnitTest
|
||||||
|
|
||||||
for(int i = 0; i < numberToTest; i++) {
|
for(int i = 0; i < numberToTest; i++) {
|
||||||
int finalI = i;
|
int finalI = i;
|
||||||
pool.execute(() ->
|
pool.execute(() -> {
|
||||||
{
|
new com.baeldung.concurrent.synchronizestatic.synchronizedblock.Employee(finalI, "John", "Smith");
|
||||||
new com.baeldung.concurrent.synchronizestatic.synchronizedblock.Employee(finalI, "John", "Smith");
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,10 +82,9 @@ public class SychronizeStaticDataUnitTest
|
||||||
|
|
||||||
for(int i = 0; i < numberToTest; i++) {
|
for(int i = 0; i < numberToTest; i++) {
|
||||||
int finalI = i;
|
int finalI = i;
|
||||||
pool.execute(() ->
|
pool.execute(() -> {
|
||||||
{
|
new com.baeldung.concurrent.synchronizestatic.reentrantlock.Employee(finalI, "John", "Smith");
|
||||||
new com.baeldung.concurrent.synchronizestatic.reentrantlock.Employee(finalI, "John", "Smith");
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue