Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding18.java')
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding18.java23
1 files changed, 8 insertions, 15 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding18.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding18.java
index 2dc50f4c69..447df46720 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding18.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CaptureBinding18.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013, 2014 GK Software AG.
+ * Copyright (c) 2013, 2019 GK Software AG.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -155,22 +155,15 @@ public class CaptureBinding18 extends CaptureBinding {
rightIntersectingTypes = ((IntersectionTypeBinding18) otherType).intersectingTypes;
}
if (rightIntersectingTypes != null) {
- int numRequired = rightIntersectingTypes.length;
- TypeBinding[] required = new TypeBinding[numRequired];
- System.arraycopy(rightIntersectingTypes, 0, required, 0, numRequired);
- for (int i = 0; i < length; i++) {
- TypeBinding provided = this.upperBounds[i];
- for (int j = 0; j < required.length; j++) {
- if (required[j] == null) continue;
- if (provided.isCompatibleWith(required[j], captureScope)) {
- required[j] = null;
- if (--numRequired == 0)
- return true;
- break;
- }
+ nextRequired:
+ for (TypeBinding required : rightIntersectingTypes) {
+ for (TypeBinding provided : this.upperBounds) {
+ if (provided.isCompatibleWith(required, captureScope))
+ continue nextRequired;
}
+ return false;
}
- return false;
+ return true;
}
for (int i = 0; i < length; i++) {

Back to the top