Bug 315428 - [refactoring] Renaming base features does not update
inferred callouts
- actual fix is a small tweak in MethodLocator
- includes test refactoring and clean-up
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java
index 4856319..6a10ced 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java
@@ -57,10 +57,12 @@
 import org.eclipse.jdt.internal.compiler.util.SimpleSet;
 import org.eclipse.jdt.internal.core.search.BasicSearchEngine;
 import org.eclipse.objectteams.otdt.internal.core.compiler.ast.BaseCallMessageSend;
+import org.eclipse.objectteams.otdt.internal.core.compiler.ast.CalloutMappingDeclaration;
 import org.eclipse.objectteams.otdt.internal.core.compiler.ast.MethodSpec;
 import org.eclipse.objectteams.otdt.internal.core.compiler.ast.MethodSpec.ImplementationStrategy;
 import org.eclipse.objectteams.otdt.internal.core.compiler.ast.TSuperMessageSend;
 import org.eclipse.objectteams.otdt.internal.core.compiler.lookup.SyntheticBaseCallSurrogate;
+import org.eclipse.objectteams.otdt.internal.core.compiler.model.MethodModel;
 import org.eclipse.objectteams.otdt.internal.core.compiler.model.RoleModel;
 import org.eclipse.objectteams.otdt.internal.core.compiler.statemachine.transformer.MethodSignatureEnhancer;
 
@@ -926,6 +928,11 @@
 	int declaringLevel;
 	if (isVirtualInvoke(method, messageSend) && (messageSend.actualReceiverType instanceof ReferenceBinding)) {
 		ReferenceBinding methodReceiverType = (ReferenceBinding) messageSend.actualReceiverType;
+//{ObjectTeams: for inferred callout pretend we would directly access the base method:
+		CalloutMappingDeclaration callout = MethodModel.getImplementingInferredCallout(messageSend.binding);
+		if (callout != null)
+			methodReceiverType = callout.getImplementationMethodSpec().getDeclaringClass();
+// SH}
 		declaringLevel = resolveLevelAsSubtype(this.pattern.declaringSimpleName, this.pattern.declaringQualification, methodReceiverType, method.selector, method.parameters, methodReceiverType.qualifiedPackageName(), method.isDefault());
 		if (declaringLevel == IMPOSSIBLE_MATCH) {
 			if (method.declaringClass == null || this.allSuperDeclaringTypeNames == null) {
@@ -948,7 +955,12 @@
 		declaringLevel = resolveLevelForType(this.pattern.declaringSimpleName, this.pattern.declaringQualification, method.declaringClass); 
   :giro */
 		char[] patternDeclaringQualification = this.pattern.getDeclaringQualification();
-		declaringLevel = resolveLevelForType(this.pattern.declaringSimpleName, patternDeclaringQualification, method.declaringClass);
+		ReferenceBinding declaringClass = method.declaringClass;
+		// also account for inferred callouts (see also above):
+		CalloutMappingDeclaration callout = MethodModel.getImplementingInferredCallout(messageSend.binding);
+		if (callout != null)
+			declaringClass = callout.getImplementationMethodSpec().getDeclaringClass();
+		declaringLevel = resolveLevelForType(this.pattern.declaringSimpleName, patternDeclaringQualification, declaringClass);
 // SH}
 	}
 	return (methodLevel & MATCH_LEVEL_MASK) > (declaringLevel & MATCH_LEVEL_MASK) ? declaringLevel : methodLevel; // return the weaker match
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/RefactoringTest.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/RefactoringTest.java
index 12e562e..04e3bf8 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/RefactoringTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/RefactoringTest.java
@@ -34,6 +34,7 @@
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Assert;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.jdt.core.ICompilationUnit;
@@ -414,7 +415,30 @@
                 + " disabled (" + explanation + ")");

     }

 

-    //-----------------------

+    protected ICompilationUnit[] createCUs(String[] cuNames) throws Exception {
+		ICompilationUnit[] cus = new ICompilationUnit[cuNames.length];
+	
+		for (int idx = 0; idx < cuNames.length; idx++) {
+			Assert.isNotNull(cuNames[idx]);
+			cus[idx] = createCUfromTestFile(getPackageP(), cuNames[idx]);
+		}
+		return cus;
+	}
+
+	protected String createInputTestFileName(ICompilationUnit[] cus, int idx) {
+		return getInputTestFileName(getSimpleNameOfCu(cus[idx].getElementName()));
+	}
+
+	protected String createOutputTestFileName(ICompilationUnit[] cus, int idx) {
+		return getOutputTestFileName(getSimpleNameOfCu(cus[idx].getElementName()));
+	}
+
+	private String getSimpleNameOfCu(String compUnit) {
+		int dot = compUnit.lastIndexOf('.');
+		return compUnit.substring(0, dot);
+	}
+
+	//-----------------------

     public static InputStream getStream(String content)

     {

         return new StringBufferInputStream(content);

diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractcallin/ExtractCallinTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractcallin/ExtractCallinTests.java
index 084eeb7..c69ea40 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractcallin/ExtractCallinTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/extractcallin/ExtractCallinTests.java
@@ -23,7 +23,6 @@
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
-import org.eclipse.core.runtime.Assert;
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.jdt.core.ICompilationUnit;
 import org.eclipse.jdt.core.IMethod;
@@ -58,16 +57,6 @@
 		return REFACTORING_PATH;
 	}
 
-	private ICompilationUnit[] createCUs(String[] cuNames) throws Exception {
-		ICompilationUnit[] cus = new ICompilationUnit[cuNames.length];
-
-		for (int idx = 0; idx < cuNames.length; idx++) {
-			Assert.isNotNull(cuNames[idx]);
-			cus[idx] = createCUfromTestFile(getPackageP(), cuNames[idx]);
-		}
-		return cus;
-	}
-
 	private ExtractCallinRefactoring createExtractCallinRefactoring(IMethod baseMethod, IType role, int mappingKind) {
 		ExtractCallinRefactoring refactoring = new ExtractCallinRefactoring(baseMethod, role, mappingKind);
 		return refactoring;
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/inlinecallin/InlineCallinTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/inlinecallin/InlineCallinTests.java
index dfe51e2..602421a 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/inlinecallin/InlineCallinTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/inlinecallin/InlineCallinTests.java
@@ -23,7 +23,6 @@
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
-import org.eclipse.core.runtime.Assert;
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.jdt.core.ICompilationUnit;
 import org.eclipse.jdt.core.IJavaProject;
@@ -64,16 +63,6 @@
 		return REFACTORING_PATH;
 	}
 
-	private ICompilationUnit[] createCUs(String[] cuNames) throws Exception {
-		ICompilationUnit[] cus = new ICompilationUnit[cuNames.length];
-
-		for (int idx = 0; idx < cuNames.length; idx++) {
-			Assert.isNotNull(cuNames[idx]);
-			cus[idx] = createCUfromTestFile(getPackageP(), cuNames[idx]);
-		}
-		return cus;
-	}
-
 	private static InlineCallinRefactoring createInlineCallinRefactoring(IMethod roleMethod, ICallinMapping[] callinMappings, IMethod[] baseMethods)
 			throws JavaModelException {
 		IJavaProject project = null;
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveInstanceMethodTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveInstanceMethodTests.java
index a336af2..090cd9c 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveInstanceMethodTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/move/MoveInstanceMethodTests.java
@@ -360,7 +360,7 @@
 		}

     }	

 

-    private ICompilationUnit[] createCUs(String[] qualifiedNames)

+    protected ICompilationUnit[] createCUs(String[] qualifiedNames)

     	throws Exception

     {

         ICompilationUnit[] cus = new ICompilationUnit[qualifiedNames.length];

diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/pullup/PullUpTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/pullup/PullUpTests.java
index d402621..54069b2 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/pullup/PullUpTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/pullup/PullUpTests.java
@@ -27,7 +27,6 @@
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
-import org.eclipse.core.runtime.Assert;
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.jdt.core.ICompilationUnit;
 import org.eclipse.jdt.core.IField;
@@ -73,16 +72,6 @@
 		return REFACTORING_PATH;
 	}
 
-	private ICompilationUnit[] createCUs(String[] cuNames) throws Exception {
-		ICompilationUnit[] cus = new ICompilationUnit[cuNames.length];
-
-		for (int idx = 0; idx < cuNames.length; idx++) {
-			Assert.isNotNull(cuNames[idx]);
-			cus[idx] = createCUfromTestFile(getPackageP(), cuNames[idx]);
-		}
-		return cus;
-	}
-
 	private void setTargetClass(PullUpRefactoringProcessor processor, int targetClassIndex) throws JavaModelException {
 		IType[] possibleClasses = getPossibleTargetClasses(processor);
 		processor.setDestinationType(getPossibleTargetClasses(processor)[possibleClasses.length - 1 - targetClassIndex]);
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/pushdown/PushDownTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/pushdown/PushDownTests.java
index 123a2fc..dd05e10 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/pushdown/PushDownTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/pushdown/PushDownTests.java
@@ -23,7 +23,6 @@
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
-import org.eclipse.core.runtime.Assert;
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.jdt.core.ICompilationUnit;
 import org.eclipse.jdt.core.IField;
@@ -134,17 +133,6 @@
 		return null;
 	}
 	
-	private ICompilationUnit[] createCUs(String[] cuNames) throws Exception {
-		ICompilationUnit[] cus = new ICompilationUnit[cuNames.length];
-
-		for (int idx = 0; idx < cuNames.length; idx++) {
-			Assert.isNotNull(cuNames[idx]);
-			cus[idx] = createCUfromTestFile(getPackageP(), cuNames[idx]);
-		}
-		return cus;
-	}
-	
-	
 	//--------------------------------------------------------
 	public void testPushDownMethodToImplicitSubclass() throws Exception {
 		performPushDown_pass(new String[] { "TSuper", "T", "B" }, new String[] { "rm" }, new String[][] { new String[0] }, new String[] {}, "R");
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameMethodInInterfaceTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameMethodInInterfaceTests.java
index 43074bb..ff66fe5 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameMethodInInterfaceTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameMethodInInterfaceTests.java
@@ -196,7 +196,7 @@
         }
     }
 
-    private ICompilationUnit[] createCUs(String[] qualifiedNames)
+    protected ICompilationUnit[] createCUs(String[] qualifiedNames)
 		throws Exception
 	{
 	    ICompilationUnit[] cus = new ICompilationUnit[qualifiedNames.length];
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenamePrivateFieldTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenamePrivateFieldTests.java
index 42f2c88..bdabb24 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenamePrivateFieldTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenamePrivateFieldTests.java
@@ -29,6 +29,7 @@
 
 import org.eclipse.core.runtime.Assert;
 import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jdt.core.IAnnotatable;
 import org.eclipse.jdt.core.ICompilationUnit;
 import org.eclipse.jdt.core.IField;
 import org.eclipse.jdt.core.IType;
@@ -37,6 +38,7 @@
 import org.eclipse.ltk.core.refactoring.RefactoringStatus;
 import org.eclipse.ltk.core.refactoring.participants.RenameArguments;
 import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
+import org.eclipse.objectteams.otdt.core.ext.OTDTPlugin;
 import org.eclipse.objectteams.otdt.ui.tests.refactoring.MySetup;
 import org.eclipse.objectteams.otdt.ui.tests.refactoring.RefactoringTest;
 import org.eclipse.jdt.internal.corext.refactoring.rename.RenameFieldProcessor;
@@ -45,9 +47,10 @@
  * @author jwl
  *
  */
+@SuppressWarnings("restriction")
 public class RenamePrivateFieldTests extends RefactoringTest
 {
-	private static final Class	clazz            = RenamePrivateFieldTests.class;
+	private static final Class<RenamePrivateFieldTests>	clazz            = RenamePrivateFieldTests.class;
 	private static final String	REFACTORING_PATH = "RenamePrivateField/";
 
 	private Object _prefixPref;
@@ -72,15 +75,18 @@
 		return REFACTORING_PATH;
 	}
 
+	@SuppressWarnings({ "rawtypes", "unchecked" })
 	protected void setUp() throws Exception
 	{
 		super.setUp();
 		Hashtable options = JavaCore.getOptions();
 		_prefixPref = options.get(JavaCore.CODEASSIST_FIELD_PREFIXES);
 		options.put(JavaCore.CODEASSIST_FIELD_PREFIXES, getPrefixes());
+		options.put(OTDTPlugin.OT_COMPILER_INFERRED_CALLOUT, JavaCore.WARNING);
 		JavaCore.setOptions(options);
 	}
 
+	@SuppressWarnings({ "unchecked", "rawtypes" })
 	protected void tearDown() throws Exception
 	{
 		super.tearDown();
@@ -94,29 +100,7 @@
 		return "_";
 	}
 
-    private void performRenamingFtoG_failing(
-            String[] cuNames, 
-            String selectionCuName, 
-            String declaringTypeName)
-        throws Exception
-    {
-    	performRenaming_failing(cuNames, selectionCuName, declaringTypeName, "f", "g");
-    }
-
-    private void performRenaming_failing(
-            String[] cuNames,
-            String selectionCuName,
-            String declaringTypeName,
-            String fieldName,
-            String newFieldName)
-        throws Exception
-    {
-    	performRenameRefactoring_failing(
-                cuNames, selectionCuName, declaringTypeName, fieldName, newFieldName, false, false);
-    }
-
-
-	private void performRenameRefactoring_failing(
+    private void performRenameRefactoring_failing(
             String[] cuNames,
             String selectionCuName,
             String declaringTypeName,
@@ -184,22 +168,19 @@
 		String newGetterName = processor.getNewGetterName();
 		String newSetterName = processor.getNewSetterName();
 
-		int numbers = 1;
-		List elements = new ArrayList();
+		List<IAnnotatable> elements = new ArrayList<IAnnotatable>();
 		elements.add(field);
-		List args = new ArrayList();
+		List<RenameArguments> args = new ArrayList<RenameArguments>();
 		args.add(new RenameArguments(newFieldName, updateReferences));
 		if (renameGetter && expectedGetterRenameEnabled)
 		{
 			elements.add(processor.getGetter());
 			args.add(new RenameArguments(newGetterName, updateReferences));
-			numbers++;
 		}
 		if (renameSetter && expectedSetterRenameEnabled)
 		{
 			elements.add(processor.getSetter());
 			args.add(new RenameArguments(newSetterName, updateReferences));
-			numbers++;
 		}
 //		String[] renameHandles = ParticipantTesting.createHandles(elements
 //				.toArray());
@@ -254,48 +235,7 @@
         return -1;
     }
 
-    private String createInputTestFileName(ICompilationUnit[] cus, int idx)
-    {
-        return getInputTestFileName(getSimpleNameOfCu(
-                cus[idx].getElementName()));
-    }
-
-    private String createOutputTestFileName(ICompilationUnit[] cus,
-                                                int idx)
-    {
-        return getOutputTestFileName(getSimpleNameOfCu(cus[idx].
-                getElementName()));
-    }
-
-    private String getSimpleNameOfCu(String compUnit)
-    {
-        int dot = compUnit.lastIndexOf('.');
-        return compUnit.substring(0, dot);
-    }
-    
-    private String getUnqualifiedMemberTypeName(String qualifiedMemberType)
-    {
-    	int dot = qualifiedMemberType.indexOf('.');
-        if (dot != -1)
-        {
-        	return qualifiedMemberType.substring(dot+1);
-        }
-        return qualifiedMemberType;
-    }
-
-    private ICompilationUnit[] createCUs(String[] cuNames) throws Exception
-    {
-        ICompilationUnit[] cus = new ICompilationUnit[cuNames.length];
-    
-        for (int idx = 0; idx < cuNames.length; idx++)
-        {
-            Assert.isNotNull(cuNames[idx]);
-            cus[idx] = createCUfromTestFile(getPackageP(), cuNames[idx]);
-        }
-        return cus;
-    }
-
-	//--------- tests ----------
+    //--------- tests ----------
     public void testRenameFieldInTeamclass() throws Exception
 	{
         performRenamingFtoG_passing(new String[]{"T"}, "T", true);
@@ -390,6 +330,16 @@
                 new String[]{"B", "T"}, "B", "name", "surname",
                 true, false, false, false, false, false);
     }
+    // referenced by inferred callout (fully inferred)
+	public void testUpdateReferenceInCalloutToField5() throws Exception
+	{
+        performRenamingFtoG_passing(new String[]{"B", "T"}, "B", true);
+	}
+    // referenced by inferred callout (explicit use of inferred accessor)
+	public void testUpdateReferenceInCalloutToField6() throws Exception
+	{
+        performRenamingFtoG_passing(new String[]{"B", "T"}, "B", true);
+	}
     
     //passing
     public void testRenameGetterAndSetter1() throws Exception
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenamePrivateMethodTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenamePrivateMethodTests.java
index 8fa6f0a..2036b0c 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenamePrivateMethodTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenamePrivateMethodTests.java
@@ -27,7 +27,6 @@
 import org.eclipse.jdt.core.ICompilationUnit;
 import org.eclipse.jdt.core.IMethod;
 import org.eclipse.jdt.core.IType;
-import org.eclipse.core.runtime.Assert;
 import org.eclipse.ltk.core.refactoring.RefactoringCore;
 import org.eclipse.ltk.core.refactoring.RefactoringStatus;
 import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
@@ -43,6 +42,7 @@
  *  
  * @author brcan
  */
+@SuppressWarnings("restriction")
 public class RenamePrivateMethodTests extends RefactoringTest
 {
 	private static final String REFACTORING_PATH = "RenamePrivateMethod/";
@@ -92,11 +92,6 @@
 		assertNotNull("precondition was supposed to fail", result);
 	}
 	
-	private void performRenaming_failing() throws Exception
-	{
-		performRenameRefactoring_failing("m", "k", new String[0]);
-	}
-
 	private void performRenaming_passing(
 	        String cuNames[],
 	        String declaringTypeName) throws Exception
@@ -164,35 +159,7 @@
         }
 	}
 
-    private ICompilationUnit[] createCUs(String[] cuNames) throws Exception
-    {
-        ICompilationUnit[] cus = new ICompilationUnit[cuNames.length];
-	
-	    for (int idx = 0; idx < cuNames.length; idx++)
-	    {
-	        Assert.isNotNull(cuNames[idx]);
-	        cus[idx] = createCUfromTestFile(getPackageP(), cuNames[idx]);
-	    }
-	    return cus;
-	}
-
-    private String createInputTestFileName(ICompilationUnit[] cus, int idx)
-    {
-        return getInputTestFileName(getSimpleNameOfCu(cus[idx].getElementName()));
-    }
-
-    private String createOutputTestFileName(ICompilationUnit[] cus, int idx)
-    {
-        return getOutputTestFileName(getSimpleNameOfCu(cus[idx].getElementName()));
-    }
-
-    private String getSimpleNameOfCu(String compUnit)
-    {
-        int dot = compUnit.lastIndexOf('.');
-        return compUnit.substring(0, dot);
-    }
-
-	/******* tests ******************/
+    /******* tests ******************/
 	
     public void testUpdateReferenceInCalloutBinding1() throws Exception
     {
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameStaticMethodTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameStaticMethodTests.java
index 9fa880e..11d0164 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameStaticMethodTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameStaticMethodTests.java
@@ -37,6 +37,7 @@
  * 
  * @author brcan
  */
+@SuppressWarnings("restriction")
 public class RenameStaticMethodTests extends RefactoringTest
 {
     private static final String REFACTORING_PATH = "RenameStaticMethod/";
@@ -164,6 +165,46 @@
             cu.delete(true, null);
         }
     }
+	private void performRenameRefactoring_passing(String[] cuNames, String declaringTypeName, String methodName, String newMethodName, String[] signatures,
+			boolean shouldPass, boolean updateReferences) throws Exception {
+		ICompilationUnit[] cus = createCUs(cuNames);
+		IType declaringType = getType(cus[0], declaringTypeName);
+		IMethod method = declaringType.getMethod(methodName, signatures);
+		RenameMethodProcessor processor = createProcessor(method);
+		RenameRefactoring ref = createRefactoring(processor);
+		processor.setUpdateReferences(updateReferences);
+		processor.setNewElementName(newMethodName);
+		RefactoringStatus status = performRefactoring(ref);
+
+		assertEquals("was supposed to pass!", null, status);
+		if (!shouldPass) {
+			for (int idx = 0; idx < cus.length; idx++) {
+				assertTrue("incorrect renaming because of java model!", !getFileContents(createOutputTestFileName(cus, idx)).equals(cus[idx].getSource()));
+			}
+			return;
+		}
+
+		for (int idx = 0; idx < cus.length; idx++) {
+			String expectedRenaming = getFileContents(createOutputTestFileName(cus, idx));
+			String actualRenaming = cus[idx].getSource();
+			assertEqualLines("incorrect renaming!", expectedRenaming, actualRenaming);
+		}
+		assertTrue("anythingToUndo", RefactoringCore.getUndoManager().anythingToUndo());
+		assertTrue("! anythingToRedo", !RefactoringCore.getUndoManager().anythingToRedo());
+
+		RefactoringCore.getUndoManager().performUndo(null, new NullProgressMonitor());
+
+		for (int idx = 0; idx < cus.length; idx++) {
+			assertEqualLines("invalid undo!", getFileContents(createInputTestFileName(cus, idx)), cus[idx].getSource());
+		}
+		assertTrue("! anythingToUndo", !RefactoringCore.getUndoManager().anythingToUndo());
+		assertTrue("anythingToRedo", RefactoringCore.getUndoManager().anythingToRedo());
+
+		RefactoringCore.getUndoManager().performRedo(null, new NullProgressMonitor());
+		for (int idx = 0; idx < cus.length; idx++) {
+			assertEqualLines("invalid redo", getFileContents(createOutputTestFileName(cus, idx)), cus[idx].getSource());
+		}
+	}
 
     /********** tests **********/
 // test method template
@@ -293,4 +334,8 @@
 			packageB.delete(true, new NullProgressMonitor());
 		}
 	}
+	
+	public void testUpdateReferenceToBaseMethodInCalloutBinding1() throws Exception {
+		performRenameRefactoring_passing(new String[] { "B", "T" }, "B", "getAmount", "getQuantity", new String[0], true, true);
+	}
 }
\ No newline at end of file
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameTypeTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameTypeTests.java
index ce515af..89f1f4e 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameTypeTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameTypeTests.java
@@ -217,18 +217,7 @@
 		}
     }
     
-    private String getSimpleNameOfCu(String compUnit)
-    {
-        int dot = compUnit.lastIndexOf('.');
-        return compUnit.substring(0, dot);
-    }
-    
-    private String createOutputTestFileName(ICompilationUnit[] cus, int idx)
-    {
-        return getOutputTestFileName(getSimpleNameOfCu(cus[idx].getElementName()));
-    }
-
-    private ICompilationUnit[] createCUs(String[] cuNames) throws Exception
+    protected ICompilationUnit[] createCUs(String[] cuNames) throws Exception
     {
         ICompilationUnit[] cus = new ICompilationUnit[cuNames.length];
 
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameVirtualMethodInClassTests.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameVirtualMethodInClassTests.java
index 1fb7482..1fb3456 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameVirtualMethodInClassTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/src/org/eclipse/objectteams/otdt/ui/tests/refactoring/rename/RenameVirtualMethodInClassTests.java
@@ -20,19 +20,22 @@
  **********************************************************************/
 package org.eclipse.objectteams.otdt.ui.tests.refactoring.rename;
 
+import java.util.Hashtable;
+
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
-import org.eclipse.core.runtime.Assert;
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.jdt.core.ICompilationUnit;
 import org.eclipse.jdt.core.IMethod;
 import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaCore;
 import org.eclipse.jdt.internal.corext.refactoring.rename.RenameMethodProcessor;
 import org.eclipse.jdt.internal.corext.refactoring.rename.RenameVirtualMethodProcessor;
 import org.eclipse.ltk.core.refactoring.RefactoringCore;
 import org.eclipse.ltk.core.refactoring.RefactoringStatus;
 import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
+import org.eclipse.objectteams.otdt.core.ext.OTDTPlugin;
 import org.eclipse.objectteams.otdt.ui.tests.refactoring.MySetup;
 import org.eclipse.objectteams.otdt.ui.tests.refactoring.RefactoringTest;
 
@@ -40,6 +43,7 @@
  * @author brcan
  * 
  */
+@SuppressWarnings("restriction")
 public class RenameVirtualMethodInClassTests extends RefactoringTest {
 	private static final String REFACTORING_PATH = "RenameVirtualMethodInClass/";
 
@@ -55,6 +59,15 @@
 		return new MySetup(test);
 	}
 
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	protected void setUp() throws Exception
+	{
+		super.setUp();
+		Hashtable options = JavaCore.getOptions();
+		options.put(OTDTPlugin.OT_COMPILER_INFERRED_CALLOUT, JavaCore.WARNING);
+		JavaCore.setOptions(options);
+	}
+
 	protected String getRefactoringPath() {
 		return REFACTORING_PATH;
 	}
@@ -134,29 +147,6 @@
 		}
 	}
 
-	private String createInputTestFileName(ICompilationUnit[] cus, int idx) {
-		return getInputTestFileName(getSimpleNameOfCu(cus[idx].getElementName()));
-	}
-
-	private String createOutputTestFileName(ICompilationUnit[] cus, int idx) {
-		return getOutputTestFileName(getSimpleNameOfCu(cus[idx].getElementName()));
-	}
-
-	private String getSimpleNameOfCu(String compUnit) {
-		int dot = compUnit.lastIndexOf('.');
-		return compUnit.substring(0, dot);
-	}
-
-	private ICompilationUnit[] createCUs(String[] cuNames) throws Exception {
-		ICompilationUnit[] cus = new ICompilationUnit[cuNames.length];
-
-		for (int idx = 0; idx < cuNames.length; idx++) {
-			Assert.isNotNull(cuNames[idx]);
-			cus[idx] = createCUfromTestFile(getPackageP(), cuNames[idx]);
-		}
-		return cus;
-	}
-
 	/********** tests **********/
 
 	public void testUpdateDeclarationOfOverridingRoleMethod() throws Exception {
@@ -183,6 +173,10 @@
 		performRenameRefactoring_passing(new String[] { "B", "T" }, "B", "getAmount", "getQuantity", new String[0], true, true);
 	}
 
+	public void testUpdateReferenceToBaseMethodInCalloutBinding3() throws Exception {
+		performRenameRefactoring_passing(new String[] { "B", "T" }, "B", "getAmount", "getQuantity", new String[0], true, true);
+	}
+
 	public void testUpdateReferenceToBaseMethodInExplicitlyOverriddenCalloutBinding() throws Exception {
 		performRenaming_passing(new String[] { "B", "T" }, "B");
 	}
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenamePrivateField/testUpdateReferenceInCalloutToField5/in/B.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenamePrivateField/testUpdateReferenceInCalloutToField5/in/B.java
new file mode 100644
index 0000000..df40b06
--- /dev/null
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenamePrivateField/testUpdateReferenceInCalloutToField5/in/B.java
@@ -0,0 +1,6 @@
+package p;

+

+public class B

+{

+	private String f;

+}
\ No newline at end of file
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenamePrivateField/testUpdateReferenceInCalloutToField5/in/T.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenamePrivateField/testUpdateReferenceInCalloutToField5/in/T.java
new file mode 100644
index 0000000..22628d9
--- /dev/null
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenamePrivateField/testUpdateReferenceInCalloutToField5/in/T.java
@@ -0,0 +1,11 @@
+package p;

+

+public team class T

+{

+	public class R playedBy B

+	{

+		String test() {

+			return this.f;

+		}

+	}

+}
\ No newline at end of file
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenamePrivateField/testUpdateReferenceInCalloutToField5/out/B.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenamePrivateField/testUpdateReferenceInCalloutToField5/out/B.java
new file mode 100644
index 0000000..e1d2c4d
--- /dev/null
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenamePrivateField/testUpdateReferenceInCalloutToField5/out/B.java
@@ -0,0 +1,6 @@
+package p;

+

+public class B

+{

+	private String g;

+}
\ No newline at end of file
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenamePrivateField/testUpdateReferenceInCalloutToField5/out/T.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenamePrivateField/testUpdateReferenceInCalloutToField5/out/T.java
new file mode 100644
index 0000000..17a65c4
--- /dev/null
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenamePrivateField/testUpdateReferenceInCalloutToField5/out/T.java
@@ -0,0 +1,11 @@
+package p;

+

+public team class T

+{

+	public class R playedBy B

+	{

+		String test() {

+			return this.g;

+		}

+	}

+}
\ No newline at end of file
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenamePrivateField/testUpdateReferenceInCalloutToField6/in/B.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenamePrivateField/testUpdateReferenceInCalloutToField6/in/B.java
new file mode 100644
index 0000000..df40b06
--- /dev/null
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenamePrivateField/testUpdateReferenceInCalloutToField6/in/B.java
@@ -0,0 +1,6 @@
+package p;

+

+public class B

+{

+	private String f;

+}
\ No newline at end of file
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenamePrivateField/testUpdateReferenceInCalloutToField6/in/T.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenamePrivateField/testUpdateReferenceInCalloutToField6/in/T.java
new file mode 100644
index 0000000..4b0dd24
--- /dev/null
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenamePrivateField/testUpdateReferenceInCalloutToField6/in/T.java
@@ -0,0 +1,12 @@
+package p;

+

+public team class T

+{

+	public class R playedBy B

+	{

+		String getF() -> get String f;

+		String test() {

+			return getF();

+		}

+	}

+}
\ No newline at end of file
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenamePrivateField/testUpdateReferenceInCalloutToField6/out/B.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenamePrivateField/testUpdateReferenceInCalloutToField6/out/B.java
new file mode 100644
index 0000000..e1d2c4d
--- /dev/null
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenamePrivateField/testUpdateReferenceInCalloutToField6/out/B.java
@@ -0,0 +1,6 @@
+package p;

+

+public class B

+{

+	private String g;

+}
\ No newline at end of file
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenamePrivateField/testUpdateReferenceInCalloutToField6/out/T.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenamePrivateField/testUpdateReferenceInCalloutToField6/out/T.java
new file mode 100644
index 0000000..05e615b
--- /dev/null
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenamePrivateField/testUpdateReferenceInCalloutToField6/out/T.java
@@ -0,0 +1,12 @@
+package p;

+

+public team class T

+{

+	public class R playedBy B

+	{

+		String getF() -> get String g;

+		String test() {

+			return getF();

+		}

+	}

+}
\ No newline at end of file
diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenameStaticMethod/testUpdateReferenceToBaseMethodInCalloutBinding1/in/B.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenameStaticMethod/testUpdateReferenceToBaseMethodInCalloutBinding1/in/B.java
new file mode 100644
index 0000000..c59df01
--- /dev/null
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenameStaticMethod/testUpdateReferenceToBaseMethodInCalloutBinding1/in/B.java
@@ -0,0 +1,11 @@
+package p;

+//renaming B.getAmount to getQuantity

+public class B

+{

+    private static final int COUNT = 10;

+    

+    public static int getAmount()

+    {

+        return COUNT;

+    }

+}

diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenameStaticMethod/testUpdateReferenceToBaseMethodInCalloutBinding1/in/T.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenameStaticMethod/testUpdateReferenceToBaseMethodInCalloutBinding1/in/T.java
new file mode 100644
index 0000000..8730925
--- /dev/null
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenameStaticMethod/testUpdateReferenceToBaseMethodInCalloutBinding1/in/T.java
@@ -0,0 +1,12 @@
+package p;

+//renaming B.getAmount to getQuantity

+public team class T

+{

+	int number;

+    public class R playedBy B

+    {

+        static void init() {

+        	number = getAmount();

+        }

+    }

+}

diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenameStaticMethod/testUpdateReferenceToBaseMethodInCalloutBinding1/out/B.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenameStaticMethod/testUpdateReferenceToBaseMethodInCalloutBinding1/out/B.java
new file mode 100644
index 0000000..c5fcaf1
--- /dev/null
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenameStaticMethod/testUpdateReferenceToBaseMethodInCalloutBinding1/out/B.java
@@ -0,0 +1,11 @@
+package p;

+//renaming B.getAmount to getQuantity

+public class B

+{

+    private static final int COUNT = 10;

+    

+    public static int getQuantity()

+    {

+        return COUNT;

+    }

+}

diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenameStaticMethod/testUpdateReferenceToBaseMethodInCalloutBinding1/out/T.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenameStaticMethod/testUpdateReferenceToBaseMethodInCalloutBinding1/out/T.java
new file mode 100644
index 0000000..79ffaa3
--- /dev/null
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenameStaticMethod/testUpdateReferenceToBaseMethodInCalloutBinding1/out/T.java
@@ -0,0 +1,12 @@
+package p;

+//renaming B.getAmount to getQuantity

+public team class T

+{

+	int number;

+    public class R playedBy B

+    {

+        static void init() {

+        	number = getQuantity();

+        }

+    }

+}

diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenameVirtualMethodInClass/testUpdateReferenceToBaseMethodInCalloutBinding2/in/T.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenameVirtualMethodInClass/testUpdateReferenceToBaseMethodInCalloutBinding2/in/T.java
index 8394b06..f7c2da6 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenameVirtualMethodInClass/testUpdateReferenceToBaseMethodInCalloutBinding2/in/T.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenameVirtualMethodInClass/testUpdateReferenceToBaseMethodInCalloutBinding2/in/T.java
@@ -1,5 +1,5 @@
 package p;

-//renaming B.m to k

+//renaming B.getAmount to getQuantity

 public team class T

 {

     public class R playedBy B

diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenameVirtualMethodInClass/testUpdateReferenceToBaseMethodInCalloutBinding2/out/T.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenameVirtualMethodInClass/testUpdateReferenceToBaseMethodInCalloutBinding2/out/T.java
index 9a1f502..ee4ccb8 100644
--- a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenameVirtualMethodInClass/testUpdateReferenceToBaseMethodInCalloutBinding2/out/T.java
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenameVirtualMethodInClass/testUpdateReferenceToBaseMethodInCalloutBinding2/out/T.java
@@ -1,5 +1,5 @@
 package p;

-//renaming B.m to k

+//renaming B.getAmount to getQuantity

 public team class T

 {

     public class R playedBy B

diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenameVirtualMethodInClass/testUpdateReferenceToBaseMethodInCalloutBinding3/in/B.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenameVirtualMethodInClass/testUpdateReferenceToBaseMethodInCalloutBinding3/in/B.java
new file mode 100644
index 0000000..bd81788
--- /dev/null
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenameVirtualMethodInClass/testUpdateReferenceToBaseMethodInCalloutBinding3/in/B.java
@@ -0,0 +1,11 @@
+package p;

+//renaming B.m to k

+public class B

+{

+    private static final int COUNT = 10;

+    

+    public int getAmount()

+    {

+        return COUNT;

+    }

+}

diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenameVirtualMethodInClass/testUpdateReferenceToBaseMethodInCalloutBinding3/in/T.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenameVirtualMethodInClass/testUpdateReferenceToBaseMethodInCalloutBinding3/in/T.java
new file mode 100644
index 0000000..83bf76e
--- /dev/null
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenameVirtualMethodInClass/testUpdateReferenceToBaseMethodInCalloutBinding3/in/T.java
@@ -0,0 +1,9 @@
+package p;

+//renaming B.getAmount to getQuantity

+public team class T

+{

+    public class R playedBy B

+    {

+        int number = getAmount();

+    }

+}

diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenameVirtualMethodInClass/testUpdateReferenceToBaseMethodInCalloutBinding3/out/B.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenameVirtualMethodInClass/testUpdateReferenceToBaseMethodInCalloutBinding3/out/B.java
new file mode 100644
index 0000000..c0b5a11
--- /dev/null
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenameVirtualMethodInClass/testUpdateReferenceToBaseMethodInCalloutBinding3/out/B.java
@@ -0,0 +1,11 @@
+package p;

+//renaming B.m to k

+public class B

+{

+    private static final int COUNT = 10;

+    

+    public int getQuantity()

+    {

+        return COUNT;

+    }

+}

diff --git a/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenameVirtualMethodInClass/testUpdateReferenceToBaseMethodInCalloutBinding3/out/T.java b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenameVirtualMethodInClass/testUpdateReferenceToBaseMethodInCalloutBinding3/out/T.java
new file mode 100644
index 0000000..b9979e3
--- /dev/null
+++ b/testplugins/org.eclipse.objectteams.otdt.ui.tests.refactoring/testdata/RenameVirtualMethodInClass/testUpdateReferenceToBaseMethodInCalloutBinding3/out/T.java
@@ -0,0 +1,9 @@
+package p;

+//renaming B.getAmount to getQuantity

+public team class T

+{

+    public class R playedBy B

+    {

+        int number = getQuantity();

+    }

+}