Bug 416781 - reconcile compiler changes from BETA_JAVA8 with OT/J
- issues with new rules for interface methods
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java
index d2485a6..6b822c4 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java
@@ -487,6 +487,9 @@
public final boolean canBeSeenBy(TypeBinding receiverType, InvocationSite invocationSite, Scope scope) {
SourceTypeBinding invocationType = scope.enclosingSourceType();
+//{ObjectTeams: staticness is no problem in synthetic role interfaces:
+ if (!this.declaringClass.isSynthInterface())
+// SH}
if (this.declaringClass.isInterface() && isStatic()) {
// Static interface methods can be explicitly invoked only through the type reference of the declaring interface or implicitly in the interface itself.
if (scope.compilerOptions().sourceLevel < ClassFileConstants.JDK1_8)
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
index 737baf2..1e8295e 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/Scope.java
@@ -1854,6 +1854,10 @@
int foundSize = found.size;
next : for (int c = 0, l = currentMethods.length; c < l; c++) {
MethodBinding current = currentMethods[c];
+//{ObjectTeams: during this search decapsulation trumps inaccessibility:
+ boolean decapsulationAllowed = invocationSite instanceof Expression && ((Expression)invocationSite).getBaseclassDecapsulation().isAllowed();
+ if (!decapsulationAllowed && !current.declaringClass.isSynthInterface())
+// SH}
if (!current.canBeSeenBy(receiverType, invocationSite, this)) continue next;
if (foundSize > 0) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/DependentTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/DependentTypeBinding.java
index c62eb0b..59de08a 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/DependentTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/DependentTypeBinding.java
@@ -399,6 +399,11 @@
public ReferenceBinding rawBaseclass() {
return this.type.rawBaseclass();
}
+
+ @Override
+ public TypeBinding original() {
+ return this.type.original();
+ }
@Override
public void setIsBoundBase(ReferenceBinding roleType) {