A RetroSearch Logo

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

Search Query:

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

[java] UnnecessaryFinalModifier final in private method · Issue #421 · pmd/pmd · GitHub

As private methods cannot be overridden in subclasses a private method is always final I think and discussed here:
https://stackoverflow.com/questions/23161362/why-can-private-method-be-final

if so - possible test code for /pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/unnecessary/xml/UnnecessaryFinalModifier.xml:

<test-code>
    <description>Unnecessary final of private method</description>
    <expected-problems>1</expected-problems>
    <code><![CDATA[
public class TestClass {
	private final int getValue() {
		return 0;
	}
}
    ]]></code>
</test-code>

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