Affects PMD Version:
6.21.0
Rule:
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