@Override public boolean isClass() { switch (this.binding.kind()) { case Binding.TYPE_PARAMETER : case Binding.WILDCARD_TYPE : case Binding.INTERSECTION_TYPE : return false; } return this.binding.isClass(); }
public boolean isClass() { switch (this.binding.kind()) { case Binding.TYPE_PARAMETER : case Binding.WILDCARD_TYPE : case Binding.INTERSECTION_TYPE : return false; } return this.binding.isClass(); }
public boolean isClass() { switch (this.binding.kind()) { case Binding.TYPE_PARAMETER : case Binding.WILDCARD_TYPE : case Binding.INTERSECTION_TYPE : return false; } return this.binding.isClass(); }
public boolean isClass() { switch (this.binding.kind()) { case Binding.TYPE_PARAMETER : case Binding.WILDCARD_TYPE : case Binding.INTERSECTION_TYPE : return false; } return this.binding.isClass(); }
public boolean isClass() { switch (this.binding.kind()) { case Binding.TYPE_PARAMETER : case Binding.WILDCARD_TYPE : case Binding.INTERSECTION_TYPE : return false; } return this.binding.isClass(); }
public boolean isClass() { switch (this.binding.kind()) { case Binding.TYPE_PARAMETER : case Binding.WILDCARD_TYPE : case Binding.INTERSECTION_TYPE : return false; } return this.binding.isClass(); }
static boolean isMalformedPair(TypeBinding t1, TypeBinding t2, Scope scope) { // not spec-ed in JLS, but per email communication (2017-09-13) it should be switch (t1.kind()) { case Binding.TYPE: case Binding.GENERIC_TYPE: case Binding.PARAMETERIZED_TYPE: case Binding.RAW_TYPE: if (t1.isClass()) { if (t2.getClass() == TypeVariableBinding.class) { TypeBinding bound = ((TypeVariableBinding) t2).firstBound; if (bound == null || !bound.erasure().isCompatibleWith(t1.erasure())) { // use of erasure is heuristic-based return true; // malformed, because substitution could create a contradiction. } } } } return false; } /**
static boolean isMalformedPair(TypeBinding t1, TypeBinding t2, Scope scope) { // not spec-ed in JLS, but per email communication (2017-09-13) it should be switch (t1.kind()) { case Binding.TYPE: case Binding.GENERIC_TYPE: case Binding.PARAMETERIZED_TYPE: case Binding.RAW_TYPE: if (t1.isClass()) { if (t2.getClass() == TypeVariableBinding.class) { TypeBinding bound = ((TypeVariableBinding) t2).firstBound; if (bound == null || !bound.erasure().isCompatibleWith(t1.erasure())) { // use of erasure is heuristic-based return true; // malformed, because substitution could create a contradiction. } } } } return false; } /**
@Override public IAnnotationBinding[] getAnnotations() { if (this.prototype != null) { return this.prototype.getAnnotations(); } if (this.annotations != null) { return this.annotations; } org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding refType = null; if (this.binding instanceof ParameterizedTypeBinding) { refType = ((ParameterizedTypeBinding) this.binding).genericType(); } else if (this.binding.isAnnotationType() || this.binding.isClass() || this.binding.isEnum() || this.binding.isInterface()) { refType = (org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding) this.binding; } if (refType != null) { return this.annotations = resolveAnnotationBindings(refType.getAnnotations(), false); } return this.annotations = AnnotationBinding.NoAnnotations; } private IAnnotationBinding[] resolveAnnotationBindings(org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding[] internalAnnotations, boolean isTypeUse) {
public IAnnotationBinding[] getAnnotations() { if (this.prototype != null) { return this.prototype.getAnnotations(); } if (this.annotations != null) { return this.annotations; } org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding refType = null; if (this.binding instanceof ParameterizedTypeBinding) { refType = ((ParameterizedTypeBinding) this.binding).genericType(); } else if (this.binding.isAnnotationType() || this.binding.isClass() || this.binding.isEnum() || this.binding.isInterface()) { refType = (org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding) this.binding; } if (refType != null) { return this.annotations = resolveAnnotationBindings(refType.getAnnotations(), false); } return this.annotations = AnnotationBinding.NoAnnotations; } private IAnnotationBinding[] resolveAnnotationBindings(org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding[] internalAnnotations, boolean isTypeUse) {
public IAnnotationBinding[] getAnnotations() { if (this.prototype != null) { return this.prototype.getAnnotations(); } if (this.annotations != null) { return this.annotations; } org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding refType = null; if (this.binding instanceof ParameterizedTypeBinding) { refType = ((ParameterizedTypeBinding) this.binding).genericType(); } else if (this.binding.isAnnotationType() || this.binding.isClass() || this.binding.isEnum() || this.binding.isInterface()) { refType = (org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding) this.binding; } if (refType != null) { return this.annotations = resolveAnnotationBindings(refType.getAnnotations(), false); } return this.annotations = AnnotationBinding.NoAnnotations; } private IAnnotationBinding[] resolveAnnotationBindings(org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding[] internalAnnotations, boolean isTypeUse) {
public IAnnotationBinding[] getAnnotations() { if (this.prototype != null) { return this.prototype.getAnnotations(); } if (this.annotations != null) { return this.annotations; } org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding refType = null; if (this.binding instanceof ParameterizedTypeBinding) { refType = ((ParameterizedTypeBinding) this.binding).genericType(); } else if (this.binding.isAnnotationType() || this.binding.isClass() || this.binding.isEnum() || this.binding.isInterface()) { refType = (org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding) this.binding; } if (refType != null) { return this.annotations = resolveAnnotationBindings(refType.getAnnotations(), false); } return this.annotations = AnnotationBinding.NoAnnotations; } private IAnnotationBinding[] resolveAnnotationBindings(org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding[] internalAnnotations, boolean isTypeUse) {
public IAnnotationBinding[] getAnnotations() { if (this.prototype != null) { return this.prototype.getAnnotations(); } if (this.annotations != null) { return this.annotations; } org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding refType = null; if (this.binding instanceof ParameterizedTypeBinding) { refType = ((ParameterizedTypeBinding) this.binding).genericType(); } else if (this.binding.isAnnotationType() || this.binding.isClass() || this.binding.isEnum() || this.binding.isInterface()) { refType = (org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding) this.binding; } if (refType != null) { return this.annotations = resolveAnnotationBindings(refType.getAnnotations(), false); } return this.annotations = AnnotationBinding.NoAnnotations; } private IAnnotationBinding[] resolveAnnotationBindings(org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding[] internalAnnotations, boolean isTypeUse) {
public static boolean isConsistentIntersection(TypeBinding[] intersectingTypes) { TypeBinding[] ci = new TypeBinding[intersectingTypes.length]; for (int i = 0; i < ci.length; i++) { TypeBinding current = intersectingTypes[i]; ci[i] = (current.isClass() || current.isArrayType()) ? current : current.superclass(); } TypeBinding mostSpecific = ci[0]; for (int i = 1; i < ci.length; i++) { TypeBinding current = ci[i]; // when invoked during type inference we only want to check inconsistency among real types: if (current.isTypeVariable() || current.isWildcard() || !current.isProperType(true)) continue; if (mostSpecific.isSubtypeOf(current)) continue; else if (current.isSubtypeOf(mostSpecific)) mostSpecific = current; else return false; } return true; } }
public static boolean isConsistentIntersection(TypeBinding[] intersectingTypes) { TypeBinding[] ci = new TypeBinding[intersectingTypes.length]; for (int i = 0; i < ci.length; i++) { TypeBinding current = intersectingTypes[i]; ci[i] = (current.isClass() || current.isArrayType()) ? current : current.superclass(); } TypeBinding mostSpecific = ci[0]; for (int i = 1; i < ci.length; i++) { TypeBinding current = ci[i]; // when invoked during type inference we only want to check inconsistency among real types: if (current.isTypeVariable() || current.isWildcard() || !current.isProperType(true)) continue; if (mostSpecific.isSubtypeOf(current)) continue; else if (current.isSubtypeOf(mostSpecific)) mostSpecific = current; else return false; } return true; } }
public static boolean isConsistentIntersection(TypeBinding[] intersectingTypes) { TypeBinding[] ci = new TypeBinding[intersectingTypes.length]; for (int i = 0; i < ci.length; i++) { TypeBinding current = intersectingTypes[i]; ci[i] = (current.isClass() || current.isArrayType()) ? current : current.superclass(); } TypeBinding mostSpecific = ci[0]; for (int i = 1; i < ci.length; i++) { TypeBinding current = ci[i]; // when invoked during type inference we only want to check inconsistency among real types: if (current.isTypeVariable() || current.isWildcard() || !current.isProperType(true)) continue; if (mostSpecific.isSubtypeOf(current)) continue; else if (current.isSubtypeOf(mostSpecific)) mostSpecific = current; else return false; } return true; } }
public static boolean isConsistentIntersection(TypeBinding[] intersectingTypes) { TypeBinding[] ci = new TypeBinding[intersectingTypes.length]; for (int i = 0; i < ci.length; i++) { TypeBinding current = intersectingTypes[i]; ci[i] = (current.isClass() || current.isArrayType()) ? current : current.superclass(); } TypeBinding mostSpecific = ci[0]; for (int i = 1; i < ci.length; i++) { TypeBinding current = ci[i]; // when invoked during type inference we only want to check inconsistency among real types: if (current.isTypeVariable() || current.isWildcard() || !current.isProperType(true)) continue; if (mostSpecific.isSubtypeOf(current)) continue; else if (current.isSubtypeOf(mostSpecific)) mostSpecific = current; else return false; } return true; } }
public static boolean isConsistentIntersection(TypeBinding[] intersectingTypes) { TypeBinding[] ci = new TypeBinding[intersectingTypes.length]; for (int i = 0; i < ci.length; i++) { TypeBinding current = intersectingTypes[i]; ci[i] = (current.isClass() || current.isArrayType()) ? current : current.superclass(); } TypeBinding mostSpecific = ci[0]; for (int i = 1; i < ci.length; i++) { TypeBinding current = ci[i]; // when invoked during type inference we only want to check inconsistency among real types: if (current.isTypeVariable() || current.isWildcard() || !current.isProperType(true)) continue; if (mostSpecific.isSubtypeOf(current, false)) continue; else if (current.isSubtypeOf(mostSpecific, false)) mostSpecific = current; else return false; } return true; } public ModuleBinding module() {