Skip to content

Commit

Permalink
Align abstract method signatures with original Commons Logging API
Browse files Browse the repository at this point in the history
Closes gh-31166

(cherry picked from commit 268043e)
  • Loading branch information
jhoeller committed Sep 11, 2023
1 parent ddcae04 commit 0c3d8d7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 16 deletions.
40 changes: 24 additions & 16 deletions spring-jcl/src/main/java/org/apache/commons/logging/LogFactory.java
Expand Up @@ -77,7 +77,25 @@ public static Log getLog(String name) {
*/
@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() {
}
};
}

/**
Expand Down Expand Up @@ -106,29 +124,19 @@ public Log getInstance(String name) {
// 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) {
Expand Down
Expand Up @@ -74,4 +74,8 @@ public String[] getAttributeNames() {
return this.attributes.keySet().toArray(new String[0]);
}

@Override
public void release() {
}

}

0 comments on commit 0c3d8d7

Please sign in to comment.