More tests & fixes re Bug 331877 -  [compiler][generics] implicit inheritance must apply substitution for type variables from outer scope:
- support generic substitution even of static methods iff following the tsuper link
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding.java
index 6c86ca4..8a1904f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ParameterizedMethodBinding.java
@@ -44,7 +44,12 @@
 		final TypeVariableBinding[] originalVariables = originalMethod.typeVariables;
 		Substitution substitution = null;
 		final int length = originalVariables.length;
-		final boolean isStatic = originalMethod.isStatic();
+//{ObjectTeams: along the tsuper-link staticness is ignored as methods can still be overridden:
+/* orig:
+		final boolean isStatic = originalMethod.isStatic(); 
+  :giro */
+		final boolean isStatic = originalMethod.isStatic() && (parameterizedDeclaringClass.tagBits & TagBits.IsViewAsTSuper) == 0;
+// SH}
 		if (length == 0) {
 			this.typeVariables = Binding.NO_TYPE_VARIABLES;
 			if (!isStatic) substitution = parameterizedDeclaringClass;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java
index 4aedb82..9b4826d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/TagBits.java
@@ -130,6 +130,9 @@
 	long HasNonPrivateConstructor = ASTNode.Bit53L;
 
 //{ObjectTeams:
+	// is parameterized type instantiated via tsuper-link?
+	long IsViewAsTSuper = ASTNode.Bit57L;					// for role type bindings
+	
     // is it a wrapped role type?
     long IsWrappedRole = ASTNode.Bit58L;					// for role type bindings
     // have types been wrapped in the signature
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/RoleModel.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/RoleModel.java
index 0a09d66..34b6dd8 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/RoleModel.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/model/RoleModel.java
@@ -1045,6 +1045,7 @@
         	LookupEnvironment env = Config.getLookupEnvironment();
         	if (env != null) {
         		tsuperRole = env.createParameterizedType(tsuperRole, null, superTeamBinding);
+        		tsuperRole.tagBits |= TagBits.IsViewAsTSuper;
         	}
         }
         boolean tsuperAlreadyPresent = false;