CloneNotSupportedException should be thrown if clone() is not supported. But if clone is supported and that exception can never happen, then there is no reason to make the caller catch it. Adding "throws" to method signature is like adding "throws NullPointerException" to every method. In other words, PMD is suggesting to make the code worse.
Note that this applies also when overriding other methods. Even if the super class is throwing the exception, there is no reason why sub class should throw it also if that exception can never happen.
@Override
public B clone()
{
try
{
B b = (B) super.clone();
b.a = this.a;
return b;
}
catch( CloneNotSupportedException e )
{
throw new AssertionError( "This should never happen" );
}
}
Fixing this might also fix #732