initial commit in accordance with CQ 3784
diff --git a/plugins/org.eclipse.objectteams.otdt.apt/.classpath b/plugins/org.eclipse.objectteams.otdt.apt/.classpath
new file mode 100644
index 0000000..a44caa7
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.apt/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="OTRE"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.objectteams.otdt.apt/.project b/plugins/org.eclipse.objectteams.otdt.apt/.project
new file mode 100644
index 0000000..5fe09fa
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.apt/.project
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.eclipse.objectteams.otdt.apt</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.objectteams.otdt.builder.OTJBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.objectteams.otdt.OTJavaNature</nature>
+	</natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.objectteams.otdt.apt/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.objectteams.otdt.apt/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..9eeb571
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.apt/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,19 @@
+#Wed Mar 04 21:29:01 CET 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
+org.objectteams.otdt.compiler.option.joinpoint_queries=disabled
+org.objectteams.otdt.compiler.option.scoped_keywords=enabled
+org.objectteams.otdt.compiler.problem.abstract_potential_relevant_role=warning
+org.objectteams.otdt.compiler.problem.basecall=warning
+org.objectteams.otdt.compiler.problem.binding_conventions=warning
+org.objectteams.otdt.compiler.problem.decapsulation=warning
+org.objectteams.otdt.compiler.problem.deprecated_path_syntax=warning
+org.objectteams.otdt.compiler.problem.fragile_callin=warning
+org.objectteams.otdt.compiler.problem.inferred_callout=warning
+org.objectteams.otdt.compiler.problem.potential_ambiguous_playedby=warning
+org.objectteams.otdt.compiler.problem.unsafe_role_instantiation=warning
+org.objectteams.otdt.compiler.problem.weave_into_system_class=warning
diff --git a/plugins/org.eclipse.objectteams.otdt.apt/META-INF/MANIFEST.MF b/plugins/org.eclipse.objectteams.otdt.apt/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..9679f6b
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.apt/META-INF/MANIFEST.MF
@@ -0,0 +1,11 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Adaptor for the JDT/APT
+Bundle-SymbolicName: org.eclipse.objectteams.otdt.apt;singleton:=true
+Bundle-Version: 1.4.0.qualifier
+Bundle-Vendor: objectteams.org
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Require-Bundle: org.eclipse.objectteams.otequinox;bundle-version="[1.2.6,2.0.0)",
+ org.eclipse.osgi;bundle-version="[3.4.2,4.0.0)",
+ org.eclipse.jdt.core;bundle-version="[3.5.0.v_OTDT_r130,4.0.0)"
+Bundle-ActivationPolicy: lazy
diff --git a/plugins/org.eclipse.objectteams.otdt.apt/build.properties b/plugins/org.eclipse.objectteams.otdt.apt/build.properties
new file mode 100644
index 0000000..e9863e2
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.apt/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml
diff --git a/plugins/org.eclipse.objectteams.otdt.apt/plugin.xml b/plugins/org.eclipse.objectteams.otdt.apt/plugin.xml
new file mode 100644
index 0000000..2a82377
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.apt/plugin.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+   <extension
+         point="org.eclipse.objectteams.otequinox.aspectBindings">
+      <aspectBinding
+            icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif">
+         <basePlugin
+               icon="platform:/plugin/org.eclipse.pde.ui/icons/obj16/plugin_obj.gif"
+               id="org.eclipse.jdt.core">
+               <requiredFragment 
+               		id="org.eclipse.jdt.compiler.apt">
+               </requiredFragment>
+         </basePlugin>
+         <team
+               activation="ALL_THREADS"
+               class="org.eclipse.objectteams.otdt.apt.VisitorsAdaptor"
+               icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
+         </team>
+      </aspectBinding>
+   </extension>
+
+</plugin>
diff --git a/plugins/org.eclipse.objectteams.otdt.apt/src/org/eclipse/objectteams/otdt/apt/VisitorsAdaptor.java b/plugins/org.eclipse.objectteams.otdt.apt/src/org/eclipse/objectteams/otdt/apt/VisitorsAdaptor.java
new file mode 100644
index 0000000..02ca6df
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otdt.apt/src/org/eclipse/objectteams/otdt/apt/VisitorsAdaptor.java
@@ -0,0 +1,82 @@
+/**********************************************************************
+ * This file is part of "Object Teams Development Tooling"-Software
+ * 
+ * Copyright 2009 Stephan Herrmann
+ * 
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * $Id: VisitorsAdaptor.java 23449 2010-02-04 20:26:45Z stephan $
+ *
+ * Please visit http://www.eclipse.org/objectteams for updates and contact.
+ **********************************************************************/
+package org.eclipse.objectteams.otdt.apt;
+
+import org.eclipse.jdt.internal.compiler.ast.Annotation;
+import org.eclipse.jdt.internal.compiler.ast.Argument;
+import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
+import org.eclipse.jdt.internal.compiler.lookup.AptSourceLocalVariableBinding;
+import org.eclipse.jdt.internal.compiler.lookup.Binding;
+import org.eclipse.jdt.internal.compiler.lookup.BlockScope;
+import org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
+import org.eclipse.jdt.internal.compiler.lookup.Scope;
+import org.eclipse.objectteams.otdt.internal.core.compiler.ast.AbstractMethodMappingDeclaration;
+import org.eclipse.objectteams.otdt.internal.core.compiler.control.Dependencies;
+import org.eclipse.objectteams.otdt.internal.core.compiler.control.ITranslationStates;
+import org.eclipse.objectteams.otdt.internal.core.compiler.model.RoleModel;
+
+import base org.eclipse.jdt.internal.compiler.apt.dispatch.AnnotationDiscoveryVisitor;
+
+/**
+ * This class adapts visitors used in annotation processing that need to be aware of
+ * OT extensions of the compiler ast - 
+ * currently only {@link org.eclipse.jdt.internal.compiler.apt.dispatch.AnnotationDiscoveryVisitor}.
+ * 
+ * @author stephan
+ * @since 1.2.7
+ */
+@SuppressWarnings("restriction")
+public team class VisitorsAdaptor {
+	protected class AnnotationDiscoveryVisitor playedBy AnnotationDiscoveryVisitor {
+
+		@SuppressWarnings("decapsulation")
+		void resolveAnnotations(BlockScope arg0, Annotation[] arg1, Binding arg2)
+			-> void resolveAnnotations(BlockScope arg0, Annotation[] arg1, Binding arg2);
+
+
+		boolean visit(Argument argument, BlockScope scope) 
+			<- replace boolean visit(Argument argument, BlockScope scope);
+
+
+		@SuppressWarnings("basecall")
+		callin boolean visit(Argument argument, BlockScope scope) {
+			if (scope.kind == Scope.BINDING_SCOPE) { // don't blindly assume that we're inside a method
+				Annotation[] annotations = argument.annotations;
+				// the payload (orig uses cast to AbstractMethodDeclaration):
+				AbstractMethodMappingDeclaration mapping = (AbstractMethodMappingDeclaration) scope.referenceContext();
+				RoleModel roleModel = scope.referenceType().getRoleModel();
+				if (roleModel != null)
+					Dependencies.ensureRoleState(roleModel, ITranslationStates.STATE_MAPPINGS_RESOLVED); // needed for accessing the method binding.
+				MethodBinding binding = mapping.getRoleMethod(); 
+				//
+				if (binding != null) {
+					TypeDeclaration typeDeclaration = scope.referenceType();
+					typeDeclaration.binding.resolveTypesFor(binding);
+					if (argument.binding != null) {
+						argument.binding = new AptSourceLocalVariableBinding(argument.binding, binding);
+					}
+				}
+				if (annotations != null) {
+					this.resolveAnnotations(
+							scope,
+							annotations,
+							argument.binding);
+				}
+				return false;
+			} else {
+				return base.visit(argument, scope);
+			}
+		}
+	}
+}