jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject [jmeter] branch master updated: Use fully qualified classes instead of importing them for deprecated classes
Date Wed, 25 Nov 2020 17:18:42 GMT
This is an automated email from the ASF dual-hosted git repository.

fschumacher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git


The following commit(s) were added to refs/heads/master by this push:
     new 14a3598  Use fully qualified classes instead of importing them for deprecated classes
14a3598 is described below

commit 14a3598469c05e42e011469f30cc36ea50e20bde
Author: Felix Schumacher <felix.schumacher@internetallee.de>
AuthorDate: Wed Nov 25 18:16:12 2020 +0100

    Use fully qualified classes instead of importing them for deprecated classes
    
    As a follow up to the last commit, which reverted the removal of deprecated
    classes, this commit will make errorprone happy. A better fix would have
    been to suppress the deprecation warnings for the whole class, but this seems
    to be not possible with Java 8.
---
 .../org/apache/jorphan/logging/LoggingManager.java | 17 ++++------
 .../apache/jorphan/logging/Slf4jLogkitLogger.java  | 37 +++++++++++-----------
 2 files changed, 25 insertions(+), 29 deletions(-)

diff --git a/src/jorphan/src/main/java/org/apache/jorphan/logging/LoggingManager.java b/src/jorphan/src/main/java/org/apache/jorphan/logging/LoggingManager.java
index 0bd44cc..50383e1 100644
--- a/src/jorphan/src/main/java/org/apache/jorphan/logging/LoggingManager.java
+++ b/src/jorphan/src/main/java/org/apache/jorphan/logging/LoggingManager.java
@@ -19,9 +19,6 @@ package org.apache.jorphan.logging;
 
 import java.util.Properties;
 
-import org.apache.log.LogTarget;
-import org.apache.log.Logger;
-import org.apache.log.Priority;
 import org.slf4j.LoggerFactory;
 
 /**
@@ -116,7 +113,7 @@ public final class LoggingManager {
      *
      * @return Logger
      */
-    public static Logger getLoggerForClass() {
+    public static org.apache.log.Logger getLoggerForClass() {
         String className = new Exception().getStackTrace()[1].getClassName();
         return new Slf4jLogkitLogger(LoggerFactory.getLogger(className));
     }
@@ -128,7 +125,7 @@ public final class LoggingManager {
      *
      * @return Logger
      */
-    public static Logger getLoggerFor(String category) {
+    public static org.apache.log.Logger getLoggerFor(String category) {
         return new Slf4jLogkitLogger(LoggerFactory.getLogger(category));
     }
 
@@ -141,7 +138,7 @@ public final class LoggingManager {
      * @deprecated since 3.2, use SLF4J for logging
      */
     @Deprecated
-    public static Logger getLoggerForShortName(String category) {
+    public static org.apache.log.Logger getLoggerForShortName(String category) {
         return getLoggerFor(category);
     }
 
@@ -177,7 +174,7 @@ public final class LoggingManager {
      * @deprecated since 3.2, use SLF4J for logging
      */
     @Deprecated
-    public static void setPriority(Priority priority, String category) {
+    public static void setPriority(org.apache.log.Priority priority, String category) {
         // NOP
     }
 
@@ -199,7 +196,7 @@ public final class LoggingManager {
      * @deprecated since 3.2, use SLF4J for logging
      */
     @Deprecated
-    public static void setPriority(Priority priority) {
+    public static void setPriority(org.apache.log.Priority priority) {
         // NOP
     }
 
@@ -211,7 +208,7 @@ public final class LoggingManager {
      * @deprecated since 3.2, use SLF4J for logging
      */
     @Deprecated
-    public static void setTarget(LogTarget target, String category) {
+    public static void setTarget(org.apache.log.LogTarget target, String category) {
         // NOP
     }
 
@@ -222,7 +219,7 @@ public final class LoggingManager {
      * @deprecated since 3.2, use SLF4J for logging
      */
     @Deprecated
-    public static void addLogTargetToRootLogger(LogTarget[] logTargets) {
+    public static void addLogTargetToRootLogger(org.apache.log.LogTarget[] logTargets) {
         // NOP
     }
 }
diff --git a/src/jorphan/src/main/java/org/apache/jorphan/logging/Slf4jLogkitLogger.java b/src/jorphan/src/main/java/org/apache/jorphan/logging/Slf4jLogkitLogger.java
index f3e373c..3e57de9 100644
--- a/src/jorphan/src/main/java/org/apache/jorphan/logging/Slf4jLogkitLogger.java
+++ b/src/jorphan/src/main/java/org/apache/jorphan/logging/Slf4jLogkitLogger.java
@@ -17,7 +17,6 @@
 
 package org.apache.jorphan.logging;
 
-import org.apache.log.Priority;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -109,16 +108,16 @@ class Slf4jLogkitLogger extends org.apache.log.Logger {
     }
 
     @Override
-    public boolean isPriorityEnabled(Priority priority) {
-        if (priority == Priority.FATAL_ERROR) {
+    public boolean isPriorityEnabled(org.apache.log.Priority priority) {
+        if (priority == org.apache.log.Priority.FATAL_ERROR) {
             return slf4jLogger.isErrorEnabled();
-        } else if (priority == Priority.ERROR) {
+        } else if (priority == org.apache.log.Priority.ERROR) {
             return slf4jLogger.isErrorEnabled();
-        } else if (priority == Priority.WARN) {
+        } else if (priority == org.apache.log.Priority.WARN) {
             return slf4jLogger.isWarnEnabled();
-        } else if (priority == Priority.INFO) {
+        } else if (priority == org.apache.log.Priority.INFO) {
             return slf4jLogger.isInfoEnabled();
-        } else if (priority == Priority.DEBUG) {
+        } else if (priority == org.apache.log.Priority.DEBUG) {
             return slf4jLogger.isDebugEnabled();
         }
 
@@ -126,31 +125,31 @@ class Slf4jLogkitLogger extends org.apache.log.Logger {
     }
 
     @Override
-    public void log(Priority priority, String message, Throwable throwable) {
-        if (priority == Priority.FATAL_ERROR) {
+    public void log(org.apache.log.Priority priority, String message, Throwable throwable)
{
+        if (priority == org.apache.log.Priority.FATAL_ERROR) {
             slf4jLogger.error(message, throwable);
-        } else if (priority == Priority.ERROR) {
+        } else if (priority == org.apache.log.Priority.ERROR) {
             slf4jLogger.error(message, throwable);
-        } else if (priority == Priority.WARN) {
+        } else if (priority == org.apache.log.Priority.WARN) {
             slf4jLogger.warn(message, throwable);
-        } else if (priority == Priority.INFO) {
+        } else if (priority == org.apache.log.Priority.INFO) {
             slf4jLogger.info(message, throwable);
-        } else if (priority == Priority.DEBUG) {
+        } else if (priority == org.apache.log.Priority.DEBUG) {
             slf4jLogger.debug(message, throwable);
         }
     }
 
     @Override
-    public void log(Priority priority, String message) {
-        if (priority == Priority.FATAL_ERROR) {
+    public void log(org.apache.log.Priority priority, String message) {
+        if (priority == org.apache.log.Priority.FATAL_ERROR) {
             slf4jLogger.error(message);
-        } else if (priority == Priority.ERROR) {
+        } else if (priority == org.apache.log.Priority.ERROR) {
             slf4jLogger.error(message);
-        } else if (priority == Priority.WARN) {
+        } else if (priority == org.apache.log.Priority.WARN) {
             slf4jLogger.warn(message);
-        } else if (priority == Priority.INFO) {
+        } else if (priority == org.apache.log.Priority.INFO) {
             slf4jLogger.info(message);
-        } else if (priority == Priority.DEBUG) {
+        } else if (priority == org.apache.log.Priority.DEBUG) {
             slf4jLogger.debug(message);
         }
     }


Mime
View raw message