diff options
Diffstat (limited to 'org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java')
-rw-r--r-- | org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java index 6f3333c4e..184b9a4b6 100644 --- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java +++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TypeVariableBinding.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2018 IBM Corporation and others. + * Copyright (c) 2000, 2019 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -43,6 +43,7 @@ *******************************************************************************/ package org.eclipse.jdt.internal.compiler.lookup; +import java.util.Arrays; import java.util.Set; import org.eclipse.jdt.core.compiler.CharOperation; @@ -1100,6 +1101,17 @@ public class TypeVariableBinding extends ReferenceBinding { return this.superclass; // java/lang/Object } + public TypeBinding[] allUpperBounds() { + if (this.superclass == null) + return this.superInterfaces; + if (this.superInterfaces == null || this.superInterfaces.length == 0) + return new TypeBinding[] { this.superclass }; + int nInterfaces = this.superInterfaces.length; + TypeBinding[] all = Arrays.copyOf(this.superInterfaces, nInterfaces+1); + all[nInterfaces] = this.superclass; + return all; + } + public void evaluateNullAnnotations(Scope scope, TypeParameter parameter) { long nullTagBits = NullAnnotationMatching.validNullTagBits(this.tagBits); if (this.firstBound != null && this.firstBound.isValidBinding()) { |