Cleanup re  Bug 318084 -  [compiler] cannot callin-bind a callout-defined method
mainly: removing/renaming states.
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java
index a24cab3..8f4797a 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MessageSend.java
@@ -922,7 +922,7 @@
 		if (this.actualReceiverType instanceof ReferenceBinding) // funny thing: receiver could be array..
 			Dependencies.ensureBindingState(
 	            (ReferenceBinding)this.actualReceiverType,
-	            ITranslationStates.STATE_MAPPINGS_TRANSFORMED); // creates bindings for shorthand callout
+	            ITranslationStates.STATE_METHODS_CREATED); // creates bindings for possible target methods (incl. shorthand callout) 
 	} finally {
 		// it is essential that we setup an anchor mapping in any case.
 		result = AnchorMapping.setupNewMapping(receiverForAnchorMapping(scope), this.arguments, scope);
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java
index 4279433..786f341 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ReferenceBinding.java
@@ -327,7 +327,7 @@
 //{ObjectTeams: clients should see some generated methods, too:
 	try {
 		if (isRole())
-			Dependencies.ensureBindingState(this, ITranslationStates.STATE_MAPPINGS_TRANSFORMED);
+			Dependencies.ensureBindingState(this, ITranslationStates.STATE_METHODS_CREATED);
 	} catch (Throwable t) {}
 // SH}
 	return methods();
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/Dependencies.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/Dependencies.java
index ae43437..bae7ee5 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/Dependencies.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/Dependencies.java
@@ -566,8 +566,8 @@
                     success = establishStatementsTransformed(model);
                     done = NESTED_TEAMS;
                     break;
-                case STATE_MAPPINGS_TRANSFORMED:
-                	success = establishMethodMappingsTransformed(model);
+                case STATE_CALLINS_TRANSFORMED:
+                	success = establishCallinsTransformed(model);
                 	done = NONE;
                 	break;
                 case STATE_LATE_ELEMENTS_COPIED:
@@ -703,8 +703,7 @@
     			//case STATE_ROLE_INIT_METHODS:
     			case STATE_ROLE_HIERARCHY_ANALYZED:
     			case STATE_FULL_LIFTING:
-    			case STATE_MAPPINGS_RESOLVED:
-    			case STATE_MAPPINGS_TRANSFORMED:
+    			case STATE_CALLINS_TRANSFORMED:
                 case STATE_METHODS_VERIFIED:
     			case STATE_RESOLVED:
     				model.setState(nextState);
@@ -752,11 +751,8 @@
                 case STATE_TYPES_ADJUSTED:
                     success &= establishTypesAdjusted(model);
                     break;
-				case STATE_MAPPINGS_RESOLVED:
-					success &= establishMethodMappingsResolved(model);
-					break;
-                case STATE_MAPPINGS_TRANSFORMED:
-                	success &= establishMethodMappingsTransformed(model);
+                case STATE_CALLINS_TRANSFORMED:
+                	success &= establishCallinsTransformed(model);
                 	break;
                 case STATE_LATE_ELEMENTS_COPIED:
                 	success &= establishLateElementsCopied(model);
@@ -989,8 +985,7 @@
                 case STATE_FULL_LIFTING:
                 case STATE_METHODS_CREATED:
                 case STATE_TYPES_ADJUSTED:
-                case STATE_MAPPINGS_RESOLVED:
-				case STATE_MAPPINGS_TRANSFORMED:
+				case STATE_CALLINS_TRANSFORMED:
 				case STATE_LATE_ATTRIBUTES_EVALUATED:
 				case STATE_LATE_ELEMENTS_COPIED:
                 case STATE_BYTE_CODE_PREPARED:
@@ -1605,86 +1600,18 @@
             if (   subRole.isClass()       // interfaces have not constructores, don't bother.
             	&& !subRole.isLocalType()) // local types need no creators, are only copied along with their containing method
             {
-            	boolean needMethodBodies = needMethodBodies(teamType);
-                MethodBinding[] methodBindings = subRole.methods();
-                if (methodBindings != null)
-                {
-                    for (int i=0; i<methodBindings.length; i++)
-                    {
-                        if (methodBindings[i].isConstructor()) {
-                            AbstractMethodDeclaration creator =
-                                CopyInheritance.createCreationMethod(
-                                        teamType,
-                                        clazz,
-                                        null, // ConstructorDeclaration
-                                        methodBindings[i],
-										needMethodBodies);
-                            if (   creator != null
-                            	&& !creator.ignoreFurtherInvestigation)
-                            {
-                                subTeam.resolveGeneratedMethod(creator.binding);
-                                // this also wraps the signature using wrapTypesInMethodDeclSignature
-                            }
-                        }
-                    }
-                }
-                // no steps 2.+3.
+            	createCreators(clazz, teamType, subRole, subTeam);
             }
+            // no steps 2.+3.
         }
         // Next translations only for source types (no role nested types)
         if (   subRoleDecl != null
         	&& subRole.isDirectRole())
         {
             // 1. create creation methods from constructors (AST version)
-            if (subRole.isClass())
-            { // interfaces have not constructores, don't bother.
+            if (subRole.isClass())  // interfaces have not constructores, don't bother.
+            	createCtorsAndCreators(clazz, teamType, subRoleDecl, subTeam);
 
-            	// ensure we have all constructors from tsuper (incl. default ctor)
-            	for (ReferenceBinding tsuperRole : clazz.getTSuperRoleBindings())
-            		ensureBindingState(tsuperRole, ITranslationStates.STATE_METHODS_CREATED);
-            	CopyInheritance.copyGeneratedFeatures(clazz);
-
-            	boolean needMethodBodies = needMethodBodies(subRoleDecl);
-                AbstractMethodDeclaration[] methodDeclarations = subRoleDecl.methods;
-                // may need to create default constructor first:
-                boolean hasConstructor = false;
-                if (methodDeclarations != null)
-	                for (int i=0; i<methodDeclarations.length; i++)
-	                	if (methodDeclarations[i].isConstructor() && !TSuperHelper.isTSuper(methodDeclarations[i].binding)) {
-	                		hasConstructor = true; 
-	                		break; 
-	                	}
-                if (!hasConstructor) {
-                	ConstructorDeclaration defCtor = subRoleDecl.createDefaultConstructor(needMethodBodies, false);
-                	AstEdit.addMethod(subRoleDecl, defCtor);
-                	CopyInheritance.connectDefaultCtor(clazz, defCtor.binding);
-                	methodDeclarations = subRoleDecl.methods;
-                }
-                // now the creation methods for all constructors:
-                if (methodDeclarations != null)
-                {
-                    for (int i=0; i<methodDeclarations.length; i++)
-                    {
-                        if (methodDeclarations[i].isConstructor()) {
-                            ConstructorDeclaration constructor =
-                                (ConstructorDeclaration)methodDeclarations[i];
-                            MethodDeclaration creator =
-                                CopyInheritance.createCreationMethod(
-                                        teamType,
-                                        clazz,
-                                        constructor,
-										constructor.binding, needMethodBodies);
-                            if (   creator != null
-                            	&& !creator.ignoreFurtherInvestigation)
-                            {
-                            	CopyInheritance.createCreatorIfcPart(subTeam, creator);
-                                subTeam.resolveGeneratedMethod(creator.binding);
-                                // this also wraps the signature using wrapTypesInMethodDeclSignature
-                            }
-                        }
-                    }
-                }
-            }
             // 2. create getTeam methods:
            	if (subRoleDecl.isInterface()) {
                 	// process class and ifc at the same time, because otherwise an error
@@ -1699,18 +1626,16 @@
                 RoleSplitter.setupInterfaceForExtends(clazz.getTeamModel().getAst(), subRoleDecl, clazz.getInterfaceAst());
         }
 
-        // 4. cast methods (independent of the source/binary difference):
+        // 4. cast and getClass methods (independent of the source/binary difference):
         if (   subRole.isInterface()
         		&& (subRoleDecl == null || needMethodBodies(subRoleDecl)))
         {
         	TypeDeclaration sourceType = subRoleDecl != null ? subRoleDecl : teamType;
-        	int start = sourceType.sourceStart;
-        	int end   = sourceType.sourceEnd;
         	TypeDeclaration classPart = clazz.getClassPartAst();
         	if (classPart != null)
         		StandardElementGenerator.createCastMethod(clazz.getTeamModel(), classPart, /*dims*/ 0); // FIXME dimensions
         	else // difference is only in source positions used.
-        		StandardElementGenerator.getCastMethod(clazz.getTeamModel(), subRole, teamType.scope, /*dims*/ 0, false, start, end); // FIXME dimensions
+        		StandardElementGenerator.getCastMethod(clazz.getTeamModel(), subRole, teamType.scope, /*dims*/ 0, false, sourceType.sourceStart, sourceType.sourceEnd); // FIXME dimensions
         	if (subRole.isPublic())
         		RoleClassLiteralAccess.ensureGetClassMethod(teamType.getTeamModel(), clazz);
         }
@@ -1720,12 +1645,128 @@
         
 		// 6. resolve method mappings and create callout methods:
 		resolveMethodMappings(clazz);
-		transformCallouts(clazz);
+		CalloutImplementor.transformCallouts(clazz);
 
         clazz.setState(STATE_METHODS_CREATED);
         return true;
     }
 
+    // detail of STATE_METHODS_CREATED (binary case):
+	private static void createCreators(RoleModel clazz, TypeDeclaration teamType, ReferenceBinding subRole, SourceTypeBinding subTeam) 
+	{
+		boolean needMethodBodies = needMethodBodies(teamType);
+		MethodBinding[] methodBindings = subRole.methods();
+		if (methodBindings != null)
+		{
+		    for (int i=0; i<methodBindings.length; i++)
+		    {
+		        if (methodBindings[i].isConstructor()) {
+		            AbstractMethodDeclaration creator =
+		                CopyInheritance.createCreationMethod(
+		                        teamType,
+		                        clazz,
+		                        null, // ConstructorDeclaration
+		                        methodBindings[i],
+								needMethodBodies);
+		            if (   creator != null
+		            	&& !creator.ignoreFurtherInvestigation)
+		            {
+		                subTeam.resolveGeneratedMethod(creator.binding);
+		                // this also wraps the signature using wrapTypesInMethodDeclSignature
+		            }
+		        }
+		    }
+		}
+	}
+
+	// detail of STATE_METHODS_CREATED (AST case):
+	private static void createCtorsAndCreators(RoleModel clazz, TypeDeclaration teamType, TypeDeclaration subRoleDecl, SourceTypeBinding subTeam) 
+	{
+		// ensure we have all constructors from tsuper (incl. default ctor)
+		for (ReferenceBinding tsuperRole : clazz.getTSuperRoleBindings())
+			ensureBindingState(tsuperRole, ITranslationStates.STATE_METHODS_CREATED);
+		CopyInheritance.copyGeneratedFeatures(clazz);
+
+		boolean needMethodBodies = needMethodBodies(subRoleDecl);
+		AbstractMethodDeclaration[] methodDeclarations = subRoleDecl.methods;
+		// may need to create default constructor first:
+		boolean hasConstructor = false;
+		if (methodDeclarations != null)
+		    for (int i=0; i<methodDeclarations.length; i++)
+		    	if (methodDeclarations[i].isConstructor() && !TSuperHelper.isTSuper(methodDeclarations[i].binding)) {
+		    		hasConstructor = true; 
+		    		break; 
+		    	}
+		if (!hasConstructor) {
+			ConstructorDeclaration defCtor = subRoleDecl.createDefaultConstructor(needMethodBodies, false);
+			AstEdit.addMethod(subRoleDecl, defCtor);
+			CopyInheritance.connectDefaultCtor(clazz, defCtor.binding);
+			methodDeclarations = subRoleDecl.methods;
+		}
+		// now the creation methods for all constructors:
+		if (methodDeclarations != null)
+		{
+		    for (int i=0; i<methodDeclarations.length; i++)
+		    {
+		        if (methodDeclarations[i].isConstructor()) {
+		            ConstructorDeclaration constructor =
+		                (ConstructorDeclaration)methodDeclarations[i];
+		            MethodDeclaration creator =
+		                CopyInheritance.createCreationMethod(
+		                        teamType,
+		                        clazz,
+		                        constructor,
+								constructor.binding, needMethodBodies);
+		            if (   creator != null
+		            	&& !creator.ignoreFurtherInvestigation)
+		            {
+		            	CopyInheritance.createCreatorIfcPart(subTeam, creator);
+		                subTeam.resolveGeneratedMethod(creator.binding);
+		                // this also wraps the signature using wrapTypesInMethodDeclSignature
+		            }
+		        }
+		    }
+		}
+	}
+
+	// detail of STATE_METHODS_CREATED:
+	private static void resolveMethodMappings(RoleModel role) 
+	{
+		ReferenceBinding roleBinding = role.getBinding();
+
+		TypeDeclaration roleDecl = role.getAst();
+		if (   roleDecl != null
+			&& Config.getConfig().verifyMethods)
+		{
+			boolean hasBaseclassProblem = role.hasBaseclassProblem();
+			
+			if (!hasBaseclassProblem) {
+				ReferenceBinding baseclass = role.getBaseTypeBinding();
+				if (baseclass != null && !role._playedByEnclosing)
+					// some methods accessible to callout/callin might be added during
+					// callout transformation.
+					ensureBindingState(baseclass, STATE_METHODS_CREATED);
+			}
+			ReferenceBinding[] tsuperRoles = role.getTSuperRoleBindings();
+			for (int i = 0; i < tsuperRoles.length; i++) {
+				// need the generated wrappers to determine abstractness of methods
+				ensureBindingState(tsuperRoles[i], STATE_METHODS_CREATED);
+			}
+			// same reason as for tsuper roles:
+			if (roleBinding.superclass() != null)
+				ensureBindingState(roleBinding.superclass(), STATE_METHODS_CREATED);
+
+			// make sure tsuper wrappers are copied to current role:
+			CopyInheritance.copyGeneratedFeatures(role);
+			
+			// actually need to proceed even with no base class, because
+			// method mappings without baseclass are reported within resolve() below:
+			MethodMappingResolver resolver = new MethodMappingResolver(role);
+			resolver.resolve(!hasBaseclassProblem && needMethodBodies(roleDecl));
+		}
+	}
+
+
 	/* **** STATE_TYPES_ADJUSTED (OT/J) ****
 	 * - wrap types in signatures using RoleTypeBinding
 	 * - signature weakening
@@ -1864,71 +1905,15 @@
         return true;
     }
 
-    /* **** STATE_MAPPINGS_RESOLVED (OT/J) ****
-     * Resolve method mappings (except for their argument mappings).
-     *
-     * GENERATE:
-     * - binding for each callout implementing an inherited method
-     */
-
-    /**
-     * Resolve method-mapping (method-specs)
-     * @param role
-     * @return success
-     */
-	private static boolean establishMethodMappingsResolved(RoleModel role)
-	{
-		// FIXME(SH): remove this state
-		role.setState(ITranslationStates.STATE_MAPPINGS_RESOLVED);
-		return true;
-	}
-	
-	private static void resolveMethodMappings(RoleModel role) 
-	{
-		ReferenceBinding roleBinding = role.getBinding();
-
-		TypeDeclaration roleDecl = role.getAst();
-		if (   roleDecl != null
-			&& Config.getConfig().verifyMethods)
-		{
-			boolean hasBaseclassProblem = role.hasBaseclassProblem();
-			
-			if (!hasBaseclassProblem) {
-				ReferenceBinding baseclass = role.getBaseTypeBinding();
-				if (baseclass != null && !role._playedByEnclosing)
-					// some methods accessible to callout/callin might be added during
-					// callout transformation.
-					ensureBindingState(baseclass, STATE_METHODS_CREATED);
-			}
-			ReferenceBinding[] tsuperRoles = role.getTSuperRoleBindings();
-			for (int i = 0; i < tsuperRoles.length; i++) {
-				// need the generated wrappers to determine abstractness of methods
-				ensureBindingState(tsuperRoles[i], STATE_METHODS_CREATED);
-			}
-			// same reason as for tsuper roles:
-			if (roleBinding.superclass() != null)
-				ensureBindingState(roleBinding.superclass(), STATE_METHODS_CREATED);
-
-			// make sure tsuper wrappers are copied to current role:
-			CopyInheritance.copyGeneratedFeatures(role);
-			
-			// actually need to proceed even with no base class, because
-			// method mappings without baseclass are reported within resolve() below:
-			MethodMappingResolver resolver = new MethodMappingResolver(role);
-			resolver.resolve(!hasBaseclassProblem && needMethodBodies(roleDecl));
-		}
-	}
-
-    /* **** STATE_MAPPINGS_TRANSFORMED (OT/J) ***
-     * Generate the wrappers for callin/callout bindings.
+    /* **** STATE_CALLINS_TRANSFORMED (OT/J) ***
+     * Generate the wrappers for callin bindings.
      *
      * GENERATES:
-     * - callout wrappers
      * - callin wrappers incl. corresponding attributes
      * COPIES from super/tsuper:
      * - CallinMethodMappingsAttribute and StaticReplaceBindingsAttribute
      */
-	private static boolean establishMethodMappingsTransformed(TeamModel aTeam)
+	private static boolean establishCallinsTransformed(TeamModel aTeam)
 	{
 		CopyInheritance.copyAttribute(aTeam);
 //{OTDyn:
@@ -1937,26 +1922,11 @@
     		callinImplementor.transformTeam(aTeam);
     	}
 // SH}
-		aTeam.setState(STATE_MAPPINGS_TRANSFORMED);
+		aTeam.setState(STATE_CALLINS_TRANSFORMED);
 		return true;
 	}
 
-	private static boolean transformCallouts(RoleModel role) {
-		// FIXME(SH): move to CalloutImplementor
-		boolean success = true;
-		TypeDeclaration roleDecl = role.getAst();
-		if (roleDecl != null && !roleDecl.isPurelyCopied) { // no source level bindings present any way
-	    	boolean needMethodBodies = needMethodBodies(roleDecl) && !role.hasBaseclassProblem() && !role.isIgnoreFurtherInvestigation();
-	    	if (!roleDecl.binding.isSynthInterface()) {
-	    		// synth interfaces have no callouts anyway ;-)
-	            CalloutImplementor calloutImplementor = new CalloutImplementor(role);
-	            success &= calloutImplementor.transform(needMethodBodies);
-	    	}
-		}
-    	return success;
-	}
-
-	private static boolean establishMethodMappingsTransformed(RoleModel role)
+	private static boolean establishCallinsTransformed(RoleModel role)
 	{
         boolean success = true;
         TypeDeclaration roleDecl = role.getAst();
@@ -1991,7 +1961,7 @@
         }
 		// less preconditions for copying these attributes:
         CopyInheritance.copyAttribute(role);
-		role.setState(STATE_MAPPINGS_TRANSFORMED);
+		role.setState(STATE_CALLINS_TRANSFORMED);
 		return success;
 	}
 
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/ITranslationStates.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/ITranslationStates.java
index 3d90128..93ee0e9 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/ITranslationStates.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/ITranslationStates.java
@@ -21,8 +21,6 @@
 package org.eclipse.objectteams.otdt.internal.core.compiler.control;
 
 /**
- * MIGRATION_STATE: complete.
- *
  * Constants for the translation states of classes.
  * @author stephan
  * @version $Id: ITranslationStates.java 23416 2010-02-03 19:59:31Z stephan $
@@ -54,20 +52,19 @@
     public static final int STATE_METHODS_CREATED         = 15;//RoleTypeBinding, CopyInheritance
     public static final int STATE_TYPES_ADJUSTED          = 16;//RoleTypeBinding, CopyInheritance
     public static final int STATE_STATEMENTS_TRANSFORMED  = 17;//TransformStatementsVisitor
-    public static final int STATE_MAPPINGS_RESOLVED  	  = 18;//ResolveMethodMappings
-    public static final int STATE_MAPPINGS_TRANSFORMED    = 19;//MethodMappingImplementor
-    public static final int STATE_LATE_ATTRIBUTES_EVALUATED= 20; // ModelElement, TypeModel
-    public static final int STATE_METHODS_VERIFIED        = 21;//Scope
-    public static final int STATE_RESOLVED                = 22;//AST
-    public static final int STATE_LATE_ELEMENTS_COPIED    = 23;//CopyInheritance
-    public static final int STATE_CODE_ANALYZED           = 24;//AST
-    public static final int STATE_BYTE_CODE_PREPARED      = 25;//Dependencies
-    public static final int STATE_BYTE_CODE_GENERATED     = 26;//AST
+    public static final int STATE_CALLINS_TRANSFORMED     = 18;//CallinImplementor[Dyn]
+    public static final int STATE_LATE_ATTRIBUTES_EVALUATED= 19; // ModelElement, TypeModel
+    public static final int STATE_METHODS_VERIFIED        = 20;//Scope
+    public static final int STATE_RESOLVED                = 21;//AST
+    public static final int STATE_LATE_ELEMENTS_COPIED    = 22;//CopyInheritance
+    public static final int STATE_CODE_ANALYZED           = 23;//AST
+    public static final int STATE_BYTE_CODE_PREPARED      = 24;//Dependencies
+    public static final int STATE_BYTE_CODE_GENERATED     = 25;//AST
     /**
      * Note, that this state does not trigger intermediate steps, in fact never use it
      * with ensureState() but directly invoke Dependencies.cleanup!
      */
-    public static final int STATE_FINAL                   = 27;
+    public static final int STATE_FINAL                   = 26;
 
 	@SuppressWarnings("nls")
 	public static final String[] STATE_NAMES =
@@ -90,8 +87,7 @@
         "methods created",
         "types adjusted",
         "statements transformed",
-        "method mappings resolved",
-        "method mappings transformed",
+        "callins transformed",
         "late attributes evaluated",
         "methods verified",
         "resolved",
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/StateHelper.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/StateHelper.java
index 3e470a6..715c177 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/StateHelper.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/control/StateHelper.java
@@ -52,8 +52,7 @@
 		case STATE_FAULT_IN_TYPES:
 		case STATE_METHODS_CREATED:
 		case STATE_STATEMENTS_TRANSFORMED: // detects and marks local types
-		case STATE_MAPPINGS_RESOLVED:
-		case STATE_MAPPINGS_TRANSFORMED:
+		case STATE_CALLINS_TRANSFORMED:
 		case STATE_METHODS_VERIFIED:
 		case STATE_RESOLVED:
 	    case STATE_CODE_ANALYZED:
@@ -236,7 +235,7 @@
 	 *  (role- and team-models of type plus enclosing team).
 	 * @param type
 	 * @param state state according to ITranslationStates
-	 * @param sub-step according to LookupEnvironment
+	 * @param step sub-step according to LookupEnvironment
 	 */
 	public static boolean startProcessing(TypeDeclaration type, int state, int step)
 	{
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CalloutImplementor.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CalloutImplementor.java
index 46c84f4..211f6e2 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CalloutImplementor.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/mappings/CalloutImplementor.java
@@ -123,18 +123,29 @@
 
 	private RoleModel _role;
 
+	/**
+	 * Generates a callout method for every callout mapping in the given RoleModel.
+	 * @return false if errors had been reported during transformation, true else.
+	 */
+	public static boolean transformCallouts(RoleModel role) {
+		boolean success = true;
+		TypeDeclaration roleDecl = role.getAst();
+		if (roleDecl != null && !roleDecl.isPurelyCopied && !roleDecl.binding.isSynthInterface()) { // no source level bindings present any way
+	    	boolean needMethodBodies = Dependencies.needMethodBodies(roleDecl) && !role.hasBaseclassProblem() && !role.isIgnoreFurtherInvestigation();
+    		// synth interfaces have no callouts anyway ;-)
+            CalloutImplementor calloutImplementor = new CalloutImplementor(role);
+            success &= calloutImplementor.transform(needMethodBodies);
+		}
+		return success;
+	}
+
 	public CalloutImplementor(RoleModel role)
 	{
 		this._role = role;
 	    this.bindingDirection = TerminalTokens.TokenNameBINDOUT;
 	}
 
-	/**
-	 * Generates a callout method for every callout mapping in the given
-	 * RoleModel.
-	 * @return false if errors had been reported during transformation, true else.
-	 */
-	public boolean transform(boolean needMethodBodies)
+	private boolean transform(boolean needMethodBodies)
 	{
 		AbstractMethodMappingDeclaration[] methodMappings =
 			this._role.getAst().callinCallouts;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/copyinheritance/CopyInheritance.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/copyinheritance/CopyInheritance.java
index 24b1240..1c03efa 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/copyinheritance/CopyInheritance.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/statemachine/copyinheritance/CopyInheritance.java
@@ -391,7 +391,7 @@
 						rofi= sourceRole.getRealClass();
 						if (rofi != null && rofi.isInterface())
 							// observed an infinite loop, probably caused by rofi remaining unchanged by getRealClass above. Want to see why.
-							throw new InternalCompilerError("Role has no class-part");  
+							throw new InternalCompilerError("Role has no class-part");   //$NON-NLS-1$
 					} else {
 						rofi= null; // terminate loop
 					}
@@ -732,7 +732,7 @@
     	if (subRole != null) {
 	    	ReferenceBinding[] tsuperRoles = subRole.getTSuperRoleBindings();
 	    	for (int i = 0; i < tsuperRoles.length; i++) {
-	    		Dependencies.ensureBindingState(tsuperRoles[i], ITranslationStates.STATE_MAPPINGS_TRANSFORMED);
+	    		Dependencies.ensureBindingState(tsuperRoles[i], ITranslationStates.STATE_CALLINS_TRANSFORMED);
 	    		subRole.copyAttributeFrom(tsuperRoles[i].roleModel, IOTConstants.CALLIN_METHOD_MAPPINGS);
 			}
     	}
@@ -754,7 +754,7 @@
 	    		&& superTeam.isTeam()
 	    		&& !TypeAnalyzer.isOrgObjectteamsTeam(superTeam))
 	    	{
-	            Dependencies.ensureBindingState(superTeam, STATE_MAPPINGS_TRANSFORMED);
+	            Dependencies.ensureBindingState(superTeam, STATE_CALLINS_TRANSFORMED);
 	    		subTeam.copyAttributeFrom(superTeam.getTeamModel(), IOTConstants.STATIC_REPLACE_BINDINGS);
 	    		//subTeam.copyAttributeFrom(superTeam.getTeamModel(), OTDynCallinBindingsAttribute.ATTRIBUTE_NAME);
 	    		OTSpecialAccessAttribute attrib = (OTSpecialAccessAttribute)superTeam.getTeamModel().getAttribute(IOTConstants.OTSPECIAL_ACCESS);
@@ -1917,7 +1917,6 @@
         	return;
         if (roleIfcDecl.binding.erasure() != superRole.erasure()) // no need to treat our ifc-part
         {
-	        //Dependencies.ensureBindingState(superRole, STATE_METHODS_CREATED);
 	        Dependencies.ensureBindingState(superRole, STATE_TYPES_ADJUSTED);
 	        MethodBinding[] superMethods = superRole.methods();
 	        if (superMethods != null)