vy commented on code in PR #1964:
URL: https://github.com/apache/logging-log4j2/pull/1964#discussion_r1390722031
##########
log4j-api/src/main/java/org/apache/logging/log4j/util/Constants.java:
##########
@@ -22,24 +22,20 @@
* @since 2.6.2
*/
public final class Constants {
+ private static final LazyBoolean WEB_APP = new LazyBoolean(() ->
isWebApp(PropertiesUtil.getProperties()));
Review Comment:
@jvz, mind helping me to understand what these changes have to do with Java
17 support, please?
##########
log4j-core/src/main/java/org/apache/logging/log4j/core/util/Constants.java:
##########
@@ -76,8 +76,10 @@ public final class Constants {
* {@code true} if we think we are running in a web container, based on
the boolean value of system property
* "log4j2.is.webapp", or (if this system property is not set) whether the
{@code javax.servlet.Servlet} class
* is present in the classpath.
+ * @deprecated use {@link
org.apache.logging.log4j.util.Constants#isWebApp()}
*/
- public static final boolean IS_WEB_APP =
org.apache.logging.log4j.util.Constants.IS_WEB_APP;
+ @Deprecated
Review Comment:
Why are we adding deprecated fields?
##########
log4j-core-its/src/test/java/org/apache/logging/log4j/core/async/perftest/ResponseTimeTest.java:
##########
@@ -141,7 +141,7 @@ public static void main(final String[] args) throws
Exception {
runLatencyTest(logger, WARMUP_DURATION_MILLIS, WARMUP_COUNT,
loadMessagesPerSec, idleStrategy,
warmupServiceTmHistograms, warmupResponseTmHistograms,
threadCount);
System.out.println("-----------------Warmup done. load=" +
loadMessagesPerSec);
- if (!Constants.ENABLE_DIRECT_ENCODERS ||
!Constants.ENABLE_THREADLOCALS) {
+ if (!Constants.ENABLE_DIRECT_ENCODERS ||
!org.apache.logging.log4j.util.Constants.isUseThreadLocals()) {
Review Comment:
Why is this `Constants` class exempt to the `LazyBoolean` refactoring?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]