Program: 82889
Project: 82889
Buggy source:
/** 
 * Test method for  {@link com.google.gwt.core.ext.typeinfo.JParameterizedType#isAssignableFrom(JClassType)}.
 */
@Override public void testIsAssignableFrom() throws NotFoundException {
  JParameterizedType testType=getTestType();
  JClassType rawType=testType.getRawType();
  assertTrue(testType.isAssignableFrom(rawType));
  TypeOracle oracle=moduleContext.getOracle();
  JGenericType genericList=(JGenericType)oracle.getType(List.class.getName());
  JWildcardType unboundWildcard=oracle.getWildcardType(true,oracle.getJavaLangObject());
  JWildcardType numUpperBoundWildcard=oracle.getWildcardType(true,oracle.getType(Number.class.getName()));
  JParameterizedType unboundList=oracle.getParameterizedType(genericList,new JClassType[]{unboundWildcard});
  JParameterizedType listOfExtendsNumber=oracle.getParameterizedType(genericList,new JClassType[]{numUpperBoundWildcard});
  assertTrue(unboundList.isAssignableFrom(listOfExtendsNumber));
  assertFalse(unboundList.isAssignableTo(listOfExtendsNumber));
  assertFalse(listOfExtendsNumber.isAssignableFrom(unboundList));
  assertTrue(listOfExtendsNumber.isAssignableTo(unboundList));
  JWildcardType intUpperBoundWildcard=oracle.getWildcardType(true,integerType);
  JParameterizedType listOfExtendsInteger=oracle.getParameterizedType(genericList,new JClassType[]{intUpperBoundWildcard});
  assertTrue(listOfExtendsNumber.isAssignableFrom(listOfExtendsInteger));
  assertFalse(listOfExtendsNumber.isAssignableTo(listOfExtendsInteger));
  assertFalse(listOfExtendsInteger.isAssignableFrom(listOfExtendsNumber));
  assertTrue(listOfExtendsInteger.isAssignableTo(listOfExtendsNumber));
  JWildcardType numLowerBoundWildcard=oracle.getWildcardType(false,oracle.getType(Number.class.getName()));
  JWildcardType intLowerBoundWildcard=oracle.getWildcardType(false,integerType);
  JParameterizedType listOfSuperNumber=oracle.getParameterizedType(genericList,new JClassType[]{numLowerBoundWildcard});
  JParameterizedType listOfSuperInteger=oracle.getParameterizedType(genericList,new JClassType[]{intLowerBoundWildcard});
  assertTrue(listOfSuperInteger.isAssignableFrom(listOfSuperNumber));
  assertFalse(listOfSuperInteger.isAssignableTo(listOfSuperNumber));
  assertFalse(listOfSuperNumber.isAssignableFrom(listOfSuperInteger));
  assertTrue(listOfSuperNumber.isAssignableTo(listOfSuperInteger));
  JParameterizedType listOfObject=oracle.getParameterizedType(genericList,new JClassType[]{oracle.getJavaLangObject()});
  JClassType stringType=oracle.getType(String.class.getName());
  JParameterizedType listOfString=oracle.getParameterizedType(genericList,new JClassType[]{stringType});
  assertFalse(listOfObject.isAssignableFrom(listOfString));
  assertFalse(listOfString.isAssignableFrom(listOfObject));
  JParameterizedType listOfListOfString=oracle.getParameterizedType(genericList,new JClassType[]{listOfString});
  JGenericType genericVector=oracle.getType(Vector.class.getName()).isGenericType();
  JParameterizedType vectorOfString=oracle.getParameterizedType(genericVector,new JClassType[]{stringType});
  JParameterizedType listOfVectorOfString=oracle.getParameterizedType(genericList,new JClassType[]{vectorOfString});
  assertFalse(listOfListOfString.isAssignableFrom(listOfVectorOfString));
  assertFalse(listOfVectorOfString.isAssignableFrom(listOfListOfString));
  JClassType listOfRawList=oracle.getParameterizedType(genericList,new JClassType[]{genericList.getRawType()});
  assertFalse(listOfRawList.isAssignableFrom(listOfListOfString));
  assertFalse(listOfListOfString.isAssignableFrom(listOfRawList));
  JGenericType genericClass=oracle.getType(GenericClass.class.getName()).isGenericType();
  JParameterizedType parameterizedGenericClass=oracle.getParameterizedType(genericClass,new JClassType[]{stringType});
  JClassType extendsRawGenericClass=oracle.getType(ExtendsRawGenericClass.class.getName());
  assertTrue(parameterizedGenericClass.isAssignableFrom(extendsRawGenericClass));
  assertFalse(extendsRawGenericClass.isAssignableFrom(parameterizedGenericClass));
  JClassType listOfListOfExtendsNumber=oracle.getParameterizedType(genericList,new JClassType[]{listOfExtendsNumber});
  JClassType listOfListOfExtendsInteger=oracle.getParameterizedType(genericList,new JClassType[]{listOfExtendsInteger});
  assertFalse(listOfListOfExtendsNumber.isAssignableFrom(listOfListOfExtendsInteger));
  JClassType listOfInteger=oracle.getParameterizedType(genericList,new JClassType[]{integerType});
  assertTrue(listOfExtendsNumber.isAssignableFrom(listOfInteger));
  assertFalse(listOfExtendsNumber.isAssignableFrom(listOfObject));
  assertFalse(listOfSuperNumber.isAssignableFrom(listOfInteger));
  assertTrue(listOfSuperNumber.isAssignableFrom(listOfObject));
}

Fixed version (ground truth):
/** 
 * Test method for  {@link com.google.gwt.core.ext.typeinfo.JParameterizedType#isAssignableFrom(JClassType)}.
 */
@Override public void testIsAssignableFrom() throws NotFoundException {
  JParameterizedType testType=getTestType();
  JClassType rawType=testType.getRawType();
  assertTrue(testType.isAssignableFrom(rawType));
  TypeOracle oracle=moduleContext.getOracle();
  JGenericType genericList=(JGenericType)oracle.getType(List.class.getName());
  JWildcardType unboundWildcard=oracle.getWildcardType(BoundType.EXTENDS,oracle.getJavaLangObject());
  JWildcardType numUpperBoundWildcard=oracle.getWildcardType(BoundType.EXTENDS,oracle.getType(Number.class.getName()));
  JParameterizedType unboundList=oracle.getParameterizedType(genericList,new JClassType[]{unboundWildcard});
  JParameterizedType listOfExtendsNumber=oracle.getParameterizedType(genericList,new JClassType[]{numUpperBoundWildcard});
  assertTrue(unboundList.isAssignableFrom(listOfExtendsNumber));
  assertFalse(unboundList.isAssignableTo(listOfExtendsNumber));
  assertFalse(listOfExtendsNumber.isAssignableFrom(unboundList));
  assertTrue(listOfExtendsNumber.isAssignableTo(unboundList));
  JWildcardType intUpperBoundWildcard=oracle.getWildcardType(BoundType.EXTENDS,integerType);
  JParameterizedType listOfExtendsInteger=oracle.getParameterizedType(genericList,new JClassType[]{intUpperBoundWildcard});
  assertTrue(listOfExtendsNumber.isAssignableFrom(listOfExtendsInteger));
  assertFalse(listOfExtendsNumber.isAssignableTo(listOfExtendsInteger));
  assertFalse(listOfExtendsInteger.isAssignableFrom(listOfExtendsNumber));
  assertTrue(listOfExtendsInteger.isAssignableTo(listOfExtendsNumber));
  JWildcardType numLowerBoundWildcard=oracle.getWildcardType(BoundType.SUPER,oracle.getType(Number.class.getName()));
  JWildcardType intLowerBoundWildcard=oracle.getWildcardType(BoundType.SUPER,integerType);
  JParameterizedType listOfSuperNumber=oracle.getParameterizedType(genericList,new JClassType[]{numLowerBoundWildcard});
  JParameterizedType listOfSuperInteger=oracle.getParameterizedType(genericList,new JClassType[]{intLowerBoundWildcard});
  assertTrue(listOfSuperInteger.isAssignableFrom(listOfSuperNumber));
  assertFalse(listOfSuperInteger.isAssignableTo(listOfSuperNumber));
  assertFalse(listOfSuperNumber.isAssignableFrom(listOfSuperInteger));
  assertTrue(listOfSuperNumber.isAssignableTo(listOfSuperInteger));
  JParameterizedType listOfObject=oracle.getParameterizedType(genericList,new JClassType[]{oracle.getJavaLangObject()});
  JClassType stringType=oracle.getType(String.class.getName());
  JParameterizedType listOfString=oracle.getParameterizedType(genericList,new JClassType[]{stringType});
  assertFalse(listOfObject.isAssignableFrom(listOfString));
  assertFalse(listOfString.isAssignableFrom(listOfObject));
  JParameterizedType listOfListOfString=oracle.getParameterizedType(genericList,new JClassType[]{listOfString});
  JGenericType genericVector=oracle.getType(Vector.class.getName()).isGenericType();
  JParameterizedType vectorOfString=oracle.getParameterizedType(genericVector,new JClassType[]{stringType});
  JParameterizedType listOfVectorOfString=oracle.getParameterizedType(genericList,new JClassType[]{vectorOfString});
  assertFalse(listOfListOfString.isAssignableFrom(listOfVectorOfString));
  assertFalse(listOfVectorOfString.isAssignableFrom(listOfListOfString));
  JClassType listOfRawList=oracle.getParameterizedType(genericList,new JClassType[]{genericList.getRawType()});
  assertFalse(listOfRawList.isAssignableFrom(listOfListOfString));
  assertFalse(listOfListOfString.isAssignableFrom(listOfRawList));
  JGenericType genericClass=oracle.getType(GenericClass.class.getName()).isGenericType();
  JParameterizedType parameterizedGenericClass=oracle.getParameterizedType(genericClass,new JClassType[]{stringType});
  JClassType extendsRawGenericClass=oracle.getType(ExtendsRawGenericClass.class.getName());
  assertTrue(parameterizedGenericClass.isAssignableFrom(extendsRawGenericClass));
  assertFalse(extendsRawGenericClass.isAssignableFrom(parameterizedGenericClass));
  JClassType listOfListOfExtendsNumber=oracle.getParameterizedType(genericList,new JClassType[]{listOfExtendsNumber});
  JClassType listOfListOfExtendsInteger=oracle.getParameterizedType(genericList,new JClassType[]{listOfExtendsInteger});
  assertFalse(listOfListOfExtendsNumber.isAssignableFrom(listOfListOfExtendsInteger));
  JClassType listOfInteger=oracle.getParameterizedType(genericList,new JClassType[]{integerType});
  assertTrue(listOfExtendsNumber.isAssignableFrom(listOfInteger));
  assertFalse(listOfExtendsNumber.isAssignableFrom(listOfObject));
  assertFalse(listOfSuperNumber.isAssignableFrom(listOfInteger));
  assertTrue(listOfSuperNumber.isAssignableFrom(listOfObject));
}