Got:
- LOGGER.debug(String.format("Could not parse the FileAnnotation %s into any known FileAnnotationType. It was %s!", annotation, annotation.getSubtype()));
+ LOGGER.debug("Could not parse the FileAnnotation %s into any known FileAnnotationType. It was %s!".formatted(annotation, annotation.getSubtype()))
Expected:
LOGGER.debug("Could not parse the FileAnnotation {} into any known FileAnnotationType. It was {}.", annotation, annotation.getSubtype());
Similarly,
- LOGGER.warn("Unexpected attribute '%s' for <%s>".formatted(key, tagName));
+ LOGGER.warn("Unexpected attribute '{}' for <{}>", key, tagName);
I checked https://github.com/openrewrite/rewrite-logging-frameworks/blob/main/src/test/java/org/openrewrite/java/logging/ParameterizedLoggingTest.java - and there is no test for String.format and .formatted.
Got:
Expected:
Similarly,
I checked https://github.com/openrewrite/rewrite-logging-frameworks/blob/main/src/test/java/org/openrewrite/java/logging/ParameterizedLoggingTest.java - and there is no test for
String.formatand.formatted.