Skip to content

Commit 41bb79f

Browse files
committed
fix #68: check logging method even though they has no parameter
1 parent 234118b commit 41bb79f

File tree

3 files changed

+2
-11
lines changed

3 files changed

+2
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ This changelog follows [Keep a Changelog v1.0.0](https://keepachangelog.com/en/1
66
### Fixed
77

88
- False negative around logging method with `Marker` instances ([#105](https://github.com/KengoTODA/findbugs-slf4j/pull/105))
9+
- False negative around logging method without parameter ([#68](https://github.com/KengoTODA/findbugs-slf4j/pull/68))
910

1011
## 1.4.1 - 2018-06-17
1112
### Changed

bug-pattern/src/main/java/jp/skypencil/findbugs/slf4j/parameter/AbstractDetectorForParameterArray.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,6 @@ public abstract class AbstractDetectorForParameterArray extends OpcodeStackDetec
3838
private static final ImmutableSet<String> TARGET_METHOD_NAMES =
3939
ImmutableSet.of("trace", "debug", "info", "warn", "error");
4040

41-
@StaticConstant
42-
// these methods do not use formatter
43-
private static final ImmutableSet<String> SIGS_WITHOUT_FORMAT =
44-
ImmutableSet.of(
45-
"(Ljava/lang/String;)V",
46-
"(Ljava/lang/String;Ljava/lang/Throwable;)V");
47-
4841
@StaticConstant
4942
private static final Pattern SIGNATURE_PATTERN = Pattern.compile("^\\((.*)\\).*$");
5043

@@ -187,9 +180,6 @@ private String findFormatString(String signature) {
187180
}
188181
}
189182

190-
if (SIGS_WITHOUT_FORMAT.contains(signature)) {
191-
return null;
192-
}
193183
return constant.toString();
194184
}
195185

test-case/src/main/java/pkg/WithLombok.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44

55
public @Slf4j class WithLombok {
66
void method(String name) {
7-
log.info("Hello, {}");
7+
log.info("Hello, {}.", "world");
88
}
99
}

0 commit comments

Comments
 (0)