Super Clone Check compilable UT inputs

This commit is contained in:
alexkravin 2014-12-05 19:49:15 +04:00 committed by Roman Ivanov
parent 8ee92d2ab3
commit 2c7a1ecc10
2 changed files with 6 additions and 6 deletions

View File

@ -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);
}

View File

@ -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;
}