GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — [java] InvalidLogMessageFormat FP with StringFormattedMessage and ParameterizedMessage · Issue #3133 · pmd/pmd Closed DescriptionAffects PMD Version: 6.31 Rule: InvalidLogMessageFormat Please provide the rule name and a link to the rule documentation: Description: Case 1. shows Please, check them. Code Sample demonstrating the issue: import org.slf4j.Logger; import org.slf4j.LoggerFactory; class TestInvalidLogMessageFormat{ Logger log = new LogggerFactory(TestInvalidLogMessageFormat.class); public void testPMD(){ log.debug("param %s", "1"); } } Detection message: Case 2. protected void logProblem(String type, Object val) { if (lastWasProblem && currentProblemLoggedAsWarning) { ... } else { ... if (!lastWasProblem) { if (expiryTime <= nowTime) { ... if (log.isDebugEnabled() && val instanceof Throwable) { /*whistled*/ log.debug("Trace for "+type+" reading "+getBriefDescription()+": "+val, (Throwable)val); } } ... } else { if (expiryTime <= nowTime) { ... if (log.isDebugEnabled() && val instanceof Throwable) { /*whistled*/ log.debug("Trace for "+type+" reading "+getBriefDescription()+": "+val, (Throwable)val); } } else { if (log.isDebugEnabled()) { /*whistled*/ log.debug("Recurring {} reading {} in {} (still in grace period): {}", new Object[] {type, this, getBriefDescription(), val}); } } } } } brooklyn-server/core/src/main/java/org/apache/brooklyn/core/feed/AttributePollHandler.java:167: InvalidLogMessageFormat: Too many arguments, expected 0 argument but have 1 Expected outcome: Running PMD through: [CLI] Activity
MetadataMetadataAssigneesLabelsa:false-positivePMD flags a piece of code that is not problematic TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |