Community
Participate
Working Groups
N20050721-0010 class Bug<E> { void method(Object o) { if (o instanceof E[]) { //incorrect: cannot test non-reifiable type E[] es= (E[]) o; } if (o instanceof List<E>[]) { //incorrect too List<E>[] es= (List<E>[]) o; } } }
Created attachment 26297 [details] Proposed fix This patch is passing all existing generic type tests.
Fix is rather to improve TypeBinding#isReifiable() and to also use it in instanceof expression.
Also, the second assignment (to List<E>[] es) should issue an unchecked cast warning. Added GenericTypeTest#test814
Addressed unchecked warning as well. Also added GenericTypeTest#test815-817
Fixed
Verified in I20050920-0010 for 3.2M2
Verified using M20050923-1430 for 3.1.1