Community
Participate
Working Groups
Build ID: I20080617-2000 (3.4.0) Steps To Reproduce: 1. Please see that there are no warnings in class Bug. 2. Disable LINE 11 by commenting it out. 3. Enable LINE 12 by uncommenting it. See the bogus warning. ---------------- Bug.java -------------------- import static java.beans.Introspector.getBeanInfo; import java.beans.PropertyDescriptor; import java.lang.reflect.*; import java.util.List; class Bug { void method() throws Exception{ for(PropertyDescriptor prop:getBeanInfo( Bug.class).getPropertyDescriptors()){ final Method get= prop.getReadMethod(); final Type type; //LINE 11 //Type type=null; //LINE 12 final ParameterizedType kind; if(null!=get&&(type=get.getGenericReturnType())instanceof ParameterizedType&& List.class==(kind=(ParameterizedType)type).getRawType()&&Bug.class==kind.getActualTypeArguments()[0]) return; } } }
I run into the same problem. Here's the code snippet: Object obj = null; if ((obj = "") instanceof String) { }
*** This bug has been marked as a duplicate of bug 305590 ***
Verified for 3.7M6 using build I20110301-1537