Skip to content

Commit f8883b4

Browse files
committed
improve warning message for weird ones (that have no *.class)
1 parent 0ac5f4f commit f8883b4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/com/mergebase/log4j/Log4JDetector.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ private static void findLog4jRecursive(
231231
boolean isLog4j2_12_2 = false;
232232
boolean isLog4j2_12_2_override = false;
233233
byte[] pomProperties = null;
234+
String pomPath = null;
234235
ZipEntry ze;
235236
while (true) {
236237
try {
@@ -323,6 +324,7 @@ public void close() {
323324
} else {
324325
if (pathLower.endsWith(POM_PROPERTIES)) {
325326
pomProperties = bytes;
327+
pomPath = "!/" + path;
326328
} else if (pathLower.endsWith(FILE_OLD_LOG4J)) {
327329
isLog4J1_X = true;
328330
} else if (pathLower.endsWith(FILE_LOG4J_1)) {
@@ -364,7 +366,7 @@ public void close() {
364366
if (conditionsChecked) {
365367
if (!log4jProbe[0] || !log4jProbe[1] || !log4jProbe[2] || !log4jProbe[3] || !log4jProbe[4]) {
366368
if (pomProperties != null) {
367-
System.err.println("-- Warning: " + zipPath + " does not contain Log4J bytecode, but claims it does.");
369+
System.err.println("-- Warning: " + zipPath + " does not contain Log4J bytecode, but claims it does (" + pomPath + ")");
368370
ByteArrayInputStream byteIn = new ByteArrayInputStream(pomProperties);
369371
Properties p = new Properties();
370372
try {

0 commit comments

Comments
 (0)