Menu

#863 CloneMethodMustImplementClonable and inherited cloneable

open
nobody
None
5
2012-10-07
2009-04-07
No

Assume the following code

public class MyDateFormat extends SimpleDateFormat {
@Override
public final Object clone() {
final Object clone = super.clone();
// special clone handling
return clone;
}
}

By extending SimpleDateFormat, the Clonable interface is in the "implements" List.

Nevertheless PMD gives me the warning CloneMethodMustImplementCloneable. It seems that only the implements List of the class itself is checked.

Discussion


Log in to post a comment.