public class SpecificCompilerWorkarounds extends Object
| Modifier and Type | Method and Description |
|---|---|
static TypeMirror |
erasure(Types types,
TypeMirror t)
Returns the erasure of a type.
|
static boolean |
isSubType(Types types,
TypeMirror t1,
TypeMirror t2)
Tests whether one type is a subtype of another.
|
static TypeElement |
replaceTypeElementIfNecessary(Elements elementUtils,
TypeElement element)
When running during Eclipse Incremental Compilation, we might get a TypeElement that has an UnresolvedTypeBinding
and which is not automatically resolved.
|
public static boolean isSubType(Types types, TypeMirror t1, TypeMirror t2)
Work-around for a bug related to sub-typing in the Eclipse JSR 269 implementation.
types - the type utilst1 - the first typet2 - the second typetrue if and only if the first type is a subtype of the secondIllegalArgumentException - if given an executable or package typepublic static TypeMirror erasure(Types types, TypeMirror t)
Performs an additional test on the given type to check if it is not void. Calling
Types.erasure(TypeMirror) with a void kind type will create a ClassCastException in Eclipse JDT. See the
JLS, section 4.6 Type Erasure, for reference.
types - the type utilst - the type to be erasedIllegalArgumentException - if given a package typepublic static TypeElement replaceTypeElementIfNecessary(Elements elementUtils, TypeElement element)
elementUtils - element utilselement - the original elementCopyright © 2012-2015. All Rights Reserved.