From 9dd807367ba327298c6efe72f285c8221521942a Mon Sep 17 00:00:00 2001
From: timis1 <12120641+timis1@users.noreply.github.com>
Date: Mon, 15 Jan 2024 23:40:59 +0200
Subject: [PATCH] JAVA-30302 Review log statements for projects - Week 52 -
2023 (conti-2) (#15623)
---
apache-httpclient-2/src/test/resources/logback.xml | 6 +++---
.../main/java/com/baeldung/lambda/todo/config/Services.java | 6 +++---
.../groovy/com/baeldung/closures/ClosuresUnitTest.groovy | 6 ++----
.../concurrent/synchronizestatic/none/Employee.java | 3 ++-
.../synchronizestatic/reentrantlock/Employee.java | 3 ++-
.../synchronizestatic/synchronizedblock/Employee.java | 3 ++-
.../synchronizestatic/synchronizedclass/Employee.java | 3 ++-
.../synchronizestatic/synchronizedmethod/Employee.java | 3 ++-
.../src/main/java/com/baeldung/portscanner/PortScanner.java | 2 +-
.../main/java/com/baeldung/java9/process/ProcessUtils.java | 2 +-
.../com/baeldung/processbuilder/ProcessBuilderUnitTest.java | 2 +-
11 files changed, 21 insertions(+), 18 deletions(-)
diff --git a/apache-httpclient-2/src/test/resources/logback.xml b/apache-httpclient-2/src/test/resources/logback.xml
index dc1bbea439..b9e0f5e6bf 100644
--- a/apache-httpclient-2/src/test/resources/logback.xml
+++ b/apache-httpclient-2/src/test/resources/logback.xml
@@ -6,9 +6,9 @@
-
-
-
+
+
+
diff --git a/aws-modules/aws-lambda-modules/todo-reminder-lambda/ToDoFunction/src/main/java/com/baeldung/lambda/todo/config/Services.java b/aws-modules/aws-lambda-modules/todo-reminder-lambda/ToDoFunction/src/main/java/com/baeldung/lambda/todo/config/Services.java
index c1d85012eb..3d3d9b97b6 100644
--- a/aws-modules/aws-lambda-modules/todo-reminder-lambda/ToDoFunction/src/main/java/com/baeldung/lambda/todo/config/Services.java
+++ b/aws-modules/aws-lambda-modules/todo-reminder-lambda/ToDoFunction/src/main/java/com/baeldung/lambda/todo/config/Services.java
@@ -10,7 +10,7 @@ import feign.gson.GsonEncoder;
import feign.slf4j.Slf4jLogger;
import uk.org.webcompere.lightweightconfig.ConfigLoader;
-import static feign.Logger.Level.FULL;
+import static feign.Logger.Level.BASIC;
public class Services extends AbstractModule {
@Override
@@ -20,14 +20,14 @@ public class Services extends AbstractModule {
ToDoApi toDoApi = Feign.builder()
.decoder(new GsonDecoder())
.logger(new Slf4jLogger())
- .logLevel(FULL)
+ .logLevel(BASIC)
.requestInterceptor(new BasicAuthRequestInterceptor(config.getToDoCredentials().getUsername(), config.getToDoCredentials().getPassword()))
.target(ToDoApi.class, config.getToDoEndpoint());
PostApi postApi = Feign.builder()
.encoder(new GsonEncoder())
.logger(new Slf4jLogger())
- .logLevel(FULL)
+ .logLevel(BASIC)
.requestInterceptor(new BasicAuthRequestInterceptor(config.getPostCredentials().getUsername(), config.getPostCredentials().getPassword()))
.target(PostApi.class, config.getPostEndpoint());
diff --git a/core-groovy-modules/core-groovy/src/test/groovy/com/baeldung/closures/ClosuresUnitTest.groovy b/core-groovy-modules/core-groovy/src/test/groovy/com/baeldung/closures/ClosuresUnitTest.groovy
index 32c67e99bc..e2923e5d06 100644
--- a/core-groovy-modules/core-groovy/src/test/groovy/com/baeldung/closures/ClosuresUnitTest.groovy
+++ b/core-groovy-modules/core-groovy/src/test/groovy/com/baeldung/closures/ClosuresUnitTest.groovy
@@ -1,7 +1,5 @@
package com.baeldung.closures
-import spock.lang.Specification
-
class ClosuresUnitTest extends GroovyTestCase {
Closures closures = new Closures()
@@ -64,9 +62,9 @@ class ClosuresUnitTest extends GroovyTestCase {
void testClosureInLists() {
def list = [10, 11, 12, 13, 14, true, false, "BUNTHER"]
- list.each {
+ /*list.each {
println it
- }
+ }*/
assert [13, 14] == list.findAll{ it instanceof Integer && it >= 13}
}
diff --git a/core-java-modules/core-java-concurrency-basic-3/src/main/java/com/baeldung/concurrent/synchronizestatic/none/Employee.java b/core-java-modules/core-java-concurrency-basic-3/src/main/java/com/baeldung/concurrent/synchronizestatic/none/Employee.java
index ba722e15e9..54322bb860 100644
--- a/core-java-modules/core-java-concurrency-basic-3/src/main/java/com/baeldung/concurrent/synchronizestatic/none/Employee.java
+++ b/core-java-modules/core-java-concurrency-basic-3/src/main/java/com/baeldung/concurrent/synchronizestatic/none/Employee.java
@@ -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() {
diff --git a/core-java-modules/core-java-concurrency-basic-3/src/main/java/com/baeldung/concurrent/synchronizestatic/reentrantlock/Employee.java b/core-java-modules/core-java-concurrency-basic-3/src/main/java/com/baeldung/concurrent/synchronizestatic/reentrantlock/Employee.java
index e74013ad0e..9abe70ceab 100644
--- a/core-java-modules/core-java-concurrency-basic-3/src/main/java/com/baeldung/concurrent/synchronizestatic/reentrantlock/Employee.java
+++ b/core-java-modules/core-java-concurrency-basic-3/src/main/java/com/baeldung/concurrent/synchronizestatic/reentrantlock/Employee.java
@@ -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();
diff --git a/core-java-modules/core-java-concurrency-basic-3/src/main/java/com/baeldung/concurrent/synchronizestatic/synchronizedblock/Employee.java b/core-java-modules/core-java-concurrency-basic-3/src/main/java/com/baeldung/concurrent/synchronizestatic/synchronizedblock/Employee.java
index 4cf04e5b06..f6f733b991 100644
--- a/core-java-modules/core-java-concurrency-basic-3/src/main/java/com/baeldung/concurrent/synchronizestatic/synchronizedblock/Employee.java
+++ b/core-java-modules/core-java-concurrency-basic-3/src/main/java/com/baeldung/concurrent/synchronizestatic/synchronizedblock/Employee.java
@@ -21,7 +21,8 @@ public class Employee {
private static void incrementCount() {
synchronized(lock) {
- System.out.println("Count = " + ++count);
+ ++count;
+ // System.out.println("Count = " + ++count);
}
}
diff --git a/core-java-modules/core-java-concurrency-basic-3/src/main/java/com/baeldung/concurrent/synchronizestatic/synchronizedclass/Employee.java b/core-java-modules/core-java-concurrency-basic-3/src/main/java/com/baeldung/concurrent/synchronizestatic/synchronizedclass/Employee.java
index 627040e88c..895827e8bb 100644
--- a/core-java-modules/core-java-concurrency-basic-3/src/main/java/com/baeldung/concurrent/synchronizestatic/synchronizedclass/Employee.java
+++ b/core-java-modules/core-java-concurrency-basic-3/src/main/java/com/baeldung/concurrent/synchronizestatic/synchronizedclass/Employee.java
@@ -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);
}
}
diff --git a/core-java-modules/core-java-concurrency-basic-3/src/main/java/com/baeldung/concurrent/synchronizestatic/synchronizedmethod/Employee.java b/core-java-modules/core-java-concurrency-basic-3/src/main/java/com/baeldung/concurrent/synchronizestatic/synchronizedmethod/Employee.java
index f0a785c427..27bc040070 100644
--- a/core-java-modules/core-java-concurrency-basic-3/src/main/java/com/baeldung/concurrent/synchronizestatic/synchronizedmethod/Employee.java
+++ b/core-java-modules/core-java-concurrency-basic-3/src/main/java/com/baeldung/concurrent/synchronizestatic/synchronizedmethod/Employee.java
@@ -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() {
diff --git a/core-java-modules/core-java-networking-3/src/main/java/com/baeldung/portscanner/PortScanner.java b/core-java-modules/core-java-networking-3/src/main/java/com/baeldung/portscanner/PortScanner.java
index 79a961e3fb..f0a01a6ae2 100644
--- a/core-java-modules/core-java-networking-3/src/main/java/com/baeldung/portscanner/PortScanner.java
+++ b/core-java-modules/core-java-networking-3/src/main/java/com/baeldung/portscanner/PortScanner.java
@@ -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);
}
});
}
diff --git a/core-java-modules/core-java-os/src/main/java/com/baeldung/java9/process/ProcessUtils.java b/core-java-modules/core-java-os/src/main/java/com/baeldung/java9/process/ProcessUtils.java
index 1b952f0c3c..d20436c8bd 100644
--- a/core-java-modules/core-java-os/src/main/java/com/baeldung/java9/process/ProcessUtils.java
+++ b/core-java-modules/core-java-os/src/main/java/com/baeldung/java9/process/ProcessUtils.java
@@ -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;
}
diff --git a/core-java-modules/core-java-os/src/test/java/com/baeldung/processbuilder/ProcessBuilderUnitTest.java b/core-java-modules/core-java-os/src/test/java/com/baeldung/processbuilder/ProcessBuilderUnitTest.java
index d35cf6a665..d6a337bcd8 100644
--- a/core-java-modules/core-java-os/src/test/java/com/baeldung/processbuilder/ProcessBuilderUnitTest.java
+++ b/core-java-modules/core-java-os/src/test/java/com/baeldung/processbuilder/ProcessBuilderUnitTest.java
@@ -50,7 +50,7 @@ public class ProcessBuilderUnitTest {
public void givenProcessBuilder_whenModifyEnvironment_thenSuccess() throws IOException, InterruptedException {
ProcessBuilder processBuilder = new ProcessBuilder();
Map 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");