pixee/codemodder-java

Fix Logger Name False Positive

gilday opened this issue · 1 comments

The fix logger name codemod erroneously changes getLogger calls that use the correct type albeit with a qualifying parent class.

For example, the codemod will change the following code in nested class EnrollmentStrategy.Default.

private static final Logger logger = LoggerFactory.getLogger(EnrollmentStrategy.Default.class);

to

private static final Logger logger = LoggerFactory.getLogger(Default.class);

The codemod is only supposed to correct loggers that use the wrong type. In this case, the type is correct, it just happens to be a nested type that includes the parent type.

Screenshot 2024-03-13 at 2 01 55 PM

Wrong repo. I'll re-make for you.