Super Clone Check compilable UT inputs
This commit is contained in:
parent
8ee92d2ab3
commit
2c7a1ecc10
|
|
@ -33,7 +33,7 @@ public class SuperCloneCheckTest
|
|||
final String[] expected = {
|
||||
"27:19: Method 'clone' should call 'super.clone'.",
|
||||
"35:19: Method 'clone' should call 'super.clone'.",
|
||||
"60:23: Method 'clone' should call 'super.clone'.",
|
||||
"60:48: Method 'clone' should call 'super.clone'.",
|
||||
};
|
||||
verify(checkConfig, getPath("coding/InputClone.java"), expected);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,17 +47,17 @@ class InnerClone
|
|||
|
||||
// This could not pass as valid semantically but tests that
|
||||
// type arguments are ignored when checking super calls
|
||||
class CloneWithTypeArguments
|
||||
class CloneWithTypeArguments<T>
|
||||
{
|
||||
public <T> Object clone()
|
||||
public CloneWithTypeArguments<T> clone() throws CloneNotSupportedException
|
||||
{
|
||||
return super.<T>clone();
|
||||
return (CloneWithTypeArguments<T>) super.<T>clone();
|
||||
}
|
||||
}
|
||||
|
||||
class CloneWithTypeArgumentsAndNoSuper
|
||||
class CloneWithTypeArgumentsAndNoSuper<T>
|
||||
{
|
||||
public <T> Object clone()
|
||||
public CloneWithTypeArgumentsAndNoSuper<T> clone()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue