JAVA-30302 Review log statements for projects - Week 52 - 2023 (conti-2) (#15623)
This commit is contained in:
+2
-1
@@ -18,7 +18,8 @@ public class Employee {
|
||||
}
|
||||
|
||||
private static void incrementCount() {
|
||||
System.out.println("Count = " + ++count);
|
||||
++count;
|
||||
// System.out.println("Count = " + ++count);
|
||||
}
|
||||
|
||||
public static Integer getCount() {
|
||||
|
||||
+2
-1
@@ -24,7 +24,8 @@ public class Employee {
|
||||
private static void incrementCount() {
|
||||
lock.lock();
|
||||
try {
|
||||
System.out.println("Count = " + ++count);
|
||||
++count;
|
||||
// System.out.println("Count = " + ++count);
|
||||
}
|
||||
finally {
|
||||
lock.unlock();
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@ public class Employee {
|
||||
|
||||
private static void incrementCount() {
|
||||
synchronized(lock) {
|
||||
System.out.println("Count = " + ++count);
|
||||
++count;
|
||||
// System.out.println("Count = " + ++count);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -19,7 +19,8 @@ public class Employee
|
||||
|
||||
private static void incrementCount() {
|
||||
synchronized(Employee.class) {
|
||||
System.out.println("Count = " + ++count);
|
||||
++count;
|
||||
// System.out.println("Count = " + ++count);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -18,7 +18,8 @@ public class Employee {
|
||||
}
|
||||
|
||||
private static synchronized void incrementCount() {
|
||||
System.out.println("Count = " + ++count);
|
||||
++count;
|
||||
// System.out.println("Count = " + ++count);
|
||||
}
|
||||
|
||||
public static synchronized int getCount() {
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ public class PortScanner {
|
||||
openPorts.add(currentPort);
|
||||
System.out.println(ip + " ,port open: " + currentPort);
|
||||
} catch (IOException e) {
|
||||
System.err.println(e);
|
||||
// System.err.println(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ public class ProcessUtils {
|
||||
|
||||
public static String getClassPath() {
|
||||
String cp = System.getProperty("java.class.path");
|
||||
System.out.println("ClassPath is " + cp);
|
||||
// System.out.println("ClassPath is " + cp);
|
||||
return cp;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ public class ProcessBuilderUnitTest {
|
||||
public void givenProcessBuilder_whenModifyEnvironment_thenSuccess() throws IOException, InterruptedException {
|
||||
ProcessBuilder processBuilder = new ProcessBuilder();
|
||||
Map<String, String> environment = processBuilder.environment();
|
||||
environment.forEach((key, value) -> System.out.println(key + value));
|
||||
// environment.forEach((key, value) -> System.out.println(key + value));
|
||||
|
||||
environment.put("GREETING", "Hola Mundo");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user