Browse Source

Align abstract method signatures with original Commons Logging API

Closes gh-31166
pull/31496/head
Juergen Hoeller 1 year ago
parent
commit
268043e9c9
  1. 40
      spring-jcl/src/main/java/org/apache/commons/logging/LogFactory.java
  2. 4
      spring-jcl/src/main/java/org/apache/commons/logging/LogFactoryService.java

40
spring-jcl/src/main/java/org/apache/commons/logging/LogFactory.java

@ -77,7 +77,25 @@ public abstract class LogFactory { @@ -77,7 +77,25 @@ public abstract class LogFactory {
*/
@Deprecated
public static LogFactory getFactory() {
return new LogFactory() {};
return new LogFactory() {
@Override
public Object getAttribute(String name) {
return null;
}
@Override
public String[] getAttributeNames() {
return new String[0];
}
@Override
public void removeAttribute(String name) {
}
@Override
public void setAttribute(String name, Object value) {
}
@Override
public void release() {
}
};
}
/**
@ -106,29 +124,19 @@ public abstract class LogFactory { @@ -106,29 +124,19 @@ public abstract class LogFactory {
// Just in case some code happens to call uncommon Commons Logging methods...
@Deprecated
public Object getAttribute(String name) {
return null;
}
public abstract Object getAttribute(String name);
@Deprecated
public String[] getAttributeNames() {
return new String[0];
}
public abstract String[] getAttributeNames();
@Deprecated
public void removeAttribute(String name) {
// do nothing
}
public abstract void removeAttribute(String name);
@Deprecated
public void setAttribute(String name, Object value) {
// do nothing
}
public abstract void setAttribute(String name, Object value);
@Deprecated
public void release() {
// do nothing
}
public abstract void release();
@Deprecated
public static void release(ClassLoader classLoader) {

4
spring-jcl/src/main/java/org/apache/commons/logging/LogFactoryService.java

@ -80,4 +80,8 @@ public class LogFactoryService extends LogFactory { @@ -80,4 +80,8 @@ public class LogFactoryService extends LogFactory {
return this.attributes.keySet().toArray(new String[0]);
}
@Override
public void release() {
}
}

Loading…
Cancel
Save