type arguments containment: ensure arrays are contained in type parameters with Serializable, Cloneable or Object bounds (IDEA-165295)

This commit is contained in:
Anna.Kozlova
2016-12-13 17:46:28 +01:00
parent 8426d14481
commit c376fa7e97
3 changed files with 21 additions and 3 deletions
@@ -0,0 +1,8 @@
import java.io.Serializable;
abstract class Box<<warning descr="Type parameter 'T' is never used">T</warning> extends Serializable> {
public static <V extends Serializable> Box<V> get(ByteArrayBox byteArrayBox) {
return <warning descr="Unchecked cast: 'ByteArrayBox' to 'Box<V>'">(Box<V>) byteArrayBox</warning>;
}
}
final class ByteArrayBox extends Box<byte[]> {}