Skip to content

Commit cfd3665

Browse files
committed
Fix SEI MET07-J violations (#3602)
* Fix `SEI MET07-J` violations This change: - Deprecates public/protected hiding methods. - Removes package-private hiding methods. - For legacy modules that will disappear in 3.x, just suppresses the warning. Closes #3601 * Try skipping required checks skip-checks: true
1 parent 696f15e commit cfd3665

File tree

5 files changed

+6
-10
lines changed

5 files changed

+6
-10
lines changed

log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/MainMapLookup.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717
package org.apache.logging.log4j.core.lookup;
1818

19+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
1920
import java.util.Map;
2021
import org.apache.logging.log4j.core.LogEvent;
2122
import org.apache.logging.log4j.plugins.Plugin;
@@ -75,6 +76,9 @@ public MainMapLookup(final Map<String, String> map) {
7576
* @param args
7677
* An application's {@code public static main(String[])} arguments.
7778
*/
79+
@SuppressFBWarnings(
80+
value = "HSM_HIDING_METHOD",
81+
justification = "The MapLookup.setMainArguments() method hidden by this one is deprecated.")
7882
public static void setMainArguments(final String... args) {
7983
if (args == null) {
8084
return;

log4j-layout-template-json/src/main/java/org/apache/logging/log4j/layout/template/json/resolver/ExceptionResolver.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -388,10 +388,6 @@ Throwable extractThrowable(final LogEvent logEvent) {
388388
return logEvent.getThrown();
389389
}
390390

391-
static String getName() {
392-
return "exception";
393-
}
394-
395391
@Override
396392
public boolean isResolvable() {
397393
return stackTraceEnabled;

log4j-layout-template-json/src/main/java/org/apache/logging/log4j/layout/template/json/resolver/ExceptionResolverFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public static ExceptionResolverFactory getInstance() {
3838

3939
@Override
4040
public String getName() {
41-
return ExceptionResolver.getName();
41+
return "exception";
4242
}
4343

4444
@Override

log4j-layout-template-json/src/main/java/org/apache/logging/log4j/layout/template/json/resolver/ExceptionRootCauseResolver.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ public final class ExceptionRootCauseResolver extends ExceptionResolver {
3636
super(context, config);
3737
}
3838

39-
static String getName() {
40-
return "exceptionRootCause";
41-
}
42-
4339
@Override
4440
Throwable extractThrowable(final LogEvent logEvent) {
4541
final Throwable thrown = logEvent.getThrown();

log4j-layout-template-json/src/main/java/org/apache/logging/log4j/layout/template/json/resolver/ExceptionRootCauseResolverFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public static ExceptionRootCauseResolverFactory getInstance() {
3838

3939
@Override
4040
public String getName() {
41-
return ExceptionRootCauseResolver.getName();
41+
return "exceptionRootCause";
4242
}
4343

4444
@Override

0 commit comments

Comments
 (0)