A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/3468 below:

[java] UnusedPrivateMethod false positive when outer class calls private static method on inner class · Issue #3468 · pmd/pmd · GitHub

Affects PMD Version: >=6.33.0

Rule: UnusedPrivateMethod

Description: Outer class calling a private method of a static inner class. -> False positive ('unused private method') on the inner class method.

Looks like this was introduced by #3157.

Code Sample demonstrating the issue:

public class OuterClass {

	public void foo() {
		InnerClass.doSomething();
	}

	static class InnerClass {
		private static void doSomething() {
		}
	}
}

Expected outcome: No PMD messages

PMD reports a violation at line 8, but that's wrong. That's a false positive.

Running PMD through: Maven | eclipse-pmd


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4