BugĀ 581263 - [compiler][otdre] bogus warning against callout to static
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 507911e..8759007 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
@@ -580,10 +580,13 @@
     		baseSend.accessId = calloutDecl.baseMethodSpec.accessId;
     		baseAccess = baseSend;
     	} else {
-    		if (calloutDecl.baseMethodSpec.isStatic())
+    		if (calloutDecl.baseMethodSpec.isStatic()) {
     			// we thought we should use an instance
     			// but callout-to-static is sent to the base *class*
-    			receiver = gen.baseTypeReference(baseType);
+    			receiver = baseType instanceof DependentTypeBinding && ((DependentTypeBinding) baseType).hasExplicitAnchor()
+    							? gen.baseTypeReference(baseType)
+    							: gen.baseNameReference(baseType);
+    		}
     		switch (calloutDecl.baseMethodSpec.implementationStrategy) {
 				case DIRECT:
 					if (calloutDecl.isCalloutToField()) {
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/CalloutMethodBinding.java b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/CalloutMethodBinding.java
index 7368e32..aa3e174 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/CalloutMethodBinding.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/otjld/org/eclipse/objectteams/otdt/tests/otjld/calloutbinding/CalloutMethodBinding.java
@@ -49,7 +49,15 @@
 	public static Class testClass() {
 		return CalloutMethodBinding.class;
 	}
-    // an abstract role method is callout-bound via -> to a method in the direct base class
+
+	@Override
+	protected Map getCompilerOptions() {
+		Map options = super.getCompilerOptions();
+		options.put(CompilerOptions.OPTION_ReportNonStaticAccessToStatic, CompilerOptions.ERROR);
+		return options;
+	}
+
+	// an abstract role method is callout-bound via -> to a method in the direct base class
     // 3.1.1-otjld-abstract-callout-binding-1
     public void test311_abstractCalloutBinding1() {