* @param node the type parameter to evaluate
* @return {@code true} if and only if an error code is generated on the passed node
* @see StaticTypeWarningCode#TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND
*/
private boolean checkForTypeParameterSupertypeOfItsBound(TypeParameter node) {
TypeParameterElement element = node.getElement();
// prepare bound
Type bound = element.getBound();
if (bound == null) {
return false;
}
// OK, type parameter is not supertype of its bound
if (!bound.isMoreSpecificThan(element.getType())) {
return false;
}
// report problem
errorReporter.reportErrorForNode(
StaticTypeWarningCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND,
node,
element.getDisplayName());
return true;
}