如何判断返回值是否是指定的泛型.
public static <T> T getTest(String path, Class<T> cls) { T t = (T)getBBBB(path); //TODO 想去掉此警告,“Type safety: Unchecked cast from Object to T” return t; } /** * 这个是API接口,无法更改 */ public static Object getBBBBB(String path) { }