A RetroSearch Logo

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

Search Query:

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

[java] ProperCloneImplementation not valid for final class · Issue #2410 · pmd/pmd · GitHub

Affects PMD Version:

6.21.0

Rule:

ProperCloneImplementation

Description:

The rule ProperCloneImplementation flags a problem on clone(). However, it is my opinion that this is perfectly valid since MyClass is declared final. Is my opinion correct or does it need corrected?

The documentation should be enhanced to state that declaring the class as final is sufficient.

Code Sample demonstrating the issue:

public final class MyClass implements Cloneable
{
   public MyClass clone()
   {
      return new MyClass();
   }

Expected outcome:

PMD is showing a false-positive

Running PMD through:

Eclipse


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