Bug 466097: Converted ast of org.objectteams.Team has no _OT$- methods
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java
index 5240ed2..4eb6fb1 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java
@@ -309,8 +309,11 @@
 			}
 			continue nextProblem;
 		}
+	}
 //{ObjectTeams: also remove marked problems in generated code (no longer need it to match SuppressWarnings):
-		// (see also CompilationUnitProblemFinder#initializeParser)
+	// (see also CompilationUnitProblemFinder#initializeParser)
+	for (int iProblem = 0, length = problemCount; iProblem < length; iProblem++) {
+		CategorizedProblem problem = problems[iProblem];
 		if (problem instanceof DefaultProblem) {
 			DefaultProblem defaultProblem = (DefaultProblem) problem;
 			if (defaultProblem.isInGenerated()) {
@@ -319,8 +322,8 @@
 				removed++;
 			}
 		}
-// SH}
 	}
+// SH}
 	// compact remaining problems
 	if (removed > 0) {
 		for (int i = 0, index = 0; i < problemCount; i++) {
diff --git a/othersrc/JCLMin1.7/src/java/lang/Class.java b/othersrc/JCLMin1.7/src/java/lang/Class.java
index a7667b9..2163dd3 100644
--- a/othersrc/JCLMin1.7/src/java/lang/Class.java
+++ b/othersrc/JCLMin1.7/src/java/lang/Class.java
@@ -1,4 +1,7 @@
 package java.lang;

 

 public class Class<T> {

+	public String getName() { return null; }

+	public boolean isInstance(Object o) { return false; }

+	public boolean isAssignableFrom (Class<?> other) { return false; }

 }

diff --git a/othersrc/JCLMin1.7/src/java/lang/Override.java b/othersrc/JCLMin1.7/src/java/lang/Override.java
new file mode 100644
index 0000000..16932c5
--- /dev/null
+++ b/othersrc/JCLMin1.7/src/java/lang/Override.java
@@ -0,0 +1,11 @@
+package java.lang;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target(ElementType.METHOD)
+@Retention(RetentionPolicy.SOURCE)
+public @interface Override {
+}
\ No newline at end of file
diff --git a/othersrc/JCLMin1.7/src/java/lang/String.java b/othersrc/JCLMin1.7/src/java/lang/String.java
index d8108d4..5fe899f 100644
--- a/othersrc/JCLMin1.7/src/java/lang/String.java
+++ b/othersrc/JCLMin1.7/src/java/lang/String.java
@@ -2,4 +2,6 @@
 

 public class String implements CharSequence {

 	public int length() { return 0; }

+	public boolean endsWith(String postfix) { return false; }

+	public String substring(int start) { return this; }

 }

diff --git a/othersrc/JCLMin1.7/src/java/lang/SuppressWarnings.java b/othersrc/JCLMin1.7/src/java/lang/SuppressWarnings.java
new file mode 100644
index 0000000..f68fa6c
--- /dev/null
+++ b/othersrc/JCLMin1.7/src/java/lang/SuppressWarnings.java
@@ -0,0 +1,11 @@
+package java.lang;
+
+import java.lang.annotation.*;
+import static java.lang.annotation.ElementType.*;
+
+
+@Target({TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE})
+@Retention(RetentionPolicy.SOURCE)
+public @interface SuppressWarnings {
+    String[] value();
+}
\ No newline at end of file
diff --git a/othersrc/JCLMin1.7/src/java/lang/reflect/Array.java b/othersrc/JCLMin1.7/src/java/lang/reflect/Array.java
new file mode 100644
index 0000000..1e5a68b
--- /dev/null
+++ b/othersrc/JCLMin1.7/src/java/lang/reflect/Array.java
@@ -0,0 +1,7 @@
+package java.lang.reflect;
+
+
+public class Array {
+    public static Object newInstance(Class<?> componentType, int length) { return null; }
+
+}
diff --git a/othersrc/JCLMin1.7/src/java/util/ArrayList.java b/othersrc/JCLMin1.7/src/java/util/ArrayList.java
new file mode 100644
index 0000000..61c0d5e
--- /dev/null
+++ b/othersrc/JCLMin1.7/src/java/util/ArrayList.java
@@ -0,0 +1,21 @@
+package java.util;
+
+public class ArrayList<E> implements Collection<E> {
+	
+	public ArrayList(int i) {}
+	public ArrayList() {}
+	
+	public void addAll(Collection<? extends E> other) { }
+	public void add(Object elem) {}
+
+	public E[] toArray() { return null; }
+	public <T> T[] toArray(T[] other) { return null; }
+
+	public int size() { return 0; }
+
+	public Iterator<E> iterator() { return null; }
+
+	@Override
+	public E get(int index) { return null; }
+
+}
diff --git a/othersrc/JCLMin1.7/src/java/util/Collection.java b/othersrc/JCLMin1.7/src/java/util/Collection.java
index 4a3f6c5..586e30d 100644
--- a/othersrc/JCLMin1.7/src/java/util/Collection.java
+++ b/othersrc/JCLMin1.7/src/java/util/Collection.java
@@ -10,10 +10,11 @@
  *******************************************************************************/

 package java.util;

 

-public interface Collection<T> {

-	public Iterator<T> iterator();

+public interface Collection<E> extends Iterable<E> {

+	public Iterator<E> iterator();

 	public int size();

-	public T get(int index);

-	public boolean addAll(Collection<T> c);

-	public T[] toArray(T[] o);

+	public E get(int index);

+	void addAll(Collection<? extends E> other);

+	public <T> T[] toArray(T[] o);

+	public Object[] toArray();

 }

diff --git a/othersrc/JCLMin1.7/src/java/util/Map.java b/othersrc/JCLMin1.7/src/java/util/Map.java
new file mode 100644
index 0000000..31d396e
--- /dev/null
+++ b/othersrc/JCLMin1.7/src/java/util/Map.java
@@ -0,0 +1,7 @@
+package java.util;
+
+public interface Map<K,V> {
+	public interface Entry<K,V> {
+		
+	}
+}
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/JCL/jclMin1.7.jar b/testplugins/org.eclipse.objectteams.otdt.tests/JCL/jclMin1.7.jar
index e0aa34a..3af78e5 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/JCL/jclMin1.7.jar
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/JCL/jclMin1.7.jar
Binary files differ
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/JCL/jclMin1.7src.zip b/testplugins/org.eclipse.objectteams.otdt.tests/JCL/jclMin1.7src.zip
index a825785..de08df3 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/JCL/jclMin1.7src.zip
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/JCL/jclMin1.7src.zip
Binary files differ
diff --git a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/OTReconcilerTests.java b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/OTReconcilerTests.java
index d178902..8f8325a 100644
--- a/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/OTReconcilerTests.java
+++ b/testplugins/org.eclipse.objectteams.otdt.tests/model/org/eclipse/objectteams/otdt/tests/otmodel/OTReconcilerTests.java
@@ -1,7 +1,7 @@
 /**********************************************************************
  * This file is part of "Object Teams Development Tooling"-Software
  * 
- * Copyright 2004, 2010 Fraunhofer Gesellschaft, Munich, Germany,
+ * Copyright 2004, 2015 Fraunhofer Gesellschaft, Munich, Germany,
  * for its Fraunhofer Institute and Computer Architecture and Software
  * Technology (FIRST), Berlin, Germany and Technical University Berlin,
  * Germany.
@@ -10,7 +10,6 @@
  * 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: OTReconcilerTests.java 23494 2010-02-05 23:06:44Z stephan $
  * 
  * Please visit http://www.eclipse.org/objectteams for updates and contact.
  * 
@@ -26,8 +25,6 @@
 import java.net.URL;
 import java.util.Map;
 
-import junit.framework.Test;
-
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IProjectDescription;
 import org.eclipse.core.resources.IncrementalProjectBuilder;
@@ -72,6 +69,8 @@
 import org.eclipse.text.edits.DeleteEdit;
 import org.eclipse.text.edits.InsertEdit;
 
+import junit.framework.Test;
+
 /**
  * Tests for errors shown only in the gutter (CompilationUnitProblemFinder),
  * but not reported by the ImageBuilder.
@@ -1808,4 +1807,77 @@
     		deleteProject("P");
     	}
     }
+
+    // Bug 466097: Converted ast of org.objectteams.Team has no _OT$- methods
+    public void testSetExecutingCallin() throws CoreException, InterruptedException {
+    	try {
+			// Resources creation
+			IJavaProject p = createOTJavaProject("P", new String[] {"src"}, new String[] {"JCL17_LIB"}, "1.7", "bin");
+			IProject project = p.getProject();
+			IProjectDescription prjDesc = project.getDescription();
+			prjDesc.setBuildSpec(OTDTPlugin.createProjectBuildCommands(prjDesc));
+			project.setDescription(prjDesc, null);
+			p.setOption(JavaCore.COMPILER_PB_UNUSED_LOCAL, JavaCore.IGNORE);
+	
+			OTREContainer.initializeOTJProject(project);
+			
+			this.createFolder("/P/src/org/objectteams");
+			this.createFile("P/src/org/objectteams/Team.java", 
+					"package org.objectteams;\n" +
+					"public class Team implements ITeam {\n" +
+					"	public boolean _OT$setExecutingCallin(boolean newFlag) {\n" + 
+					"		boolean oldVal = _OT$isExecutingCallin;\n" + 
+					"		_OT$isExecutingCallin = newFlag;\n" + 
+					"		return oldVal;\n" + 
+					"	}\n" + 
+					"}\n");
+			this.createFolder("/P/src/b");
+			String b1SourceString =	
+				"package b;\n" +
+				"public class B1 {\n" +
+				"	void bm1() {};\n" +
+				"}\n";
+			this.createFile("P/src/b/B1.java", b1SourceString);
+
+			String b2SourceString =	
+					"package b;\n" +
+					"public class B2 {\n" +
+					"	public void bm2() {};\n" +
+					"}\n";
+			this.createFile("P/src/b/B2.java", b2SourceString);
+	
+			this.createFolder("/P/src/p");
+			String team1SourceString =	
+				"package p;\n" +
+				"import base b.B1;\n" +
+				"public team class MyTeam1 {\n" +
+				"	protected class R1 playedBy B1 {\n" +
+				"		void rm1() {}\n" +
+				"		rm1 <- after bm1;\n" +
+				"	}\n" +
+				"}\n";
+			this.createFile("P/src/p/MyTeam1.java", team1SourceString);
+			project.build(IncrementalProjectBuilder.FULL_BUILD, null);
+			p.close();
+			p.open(null);
+
+			String team2SourceString =	
+					"package p;\n" +
+					"import base b.B2;\n" +
+					"public team class MyTeam2 extends MyTeam1 {\n" +
+					"	protected class R2 playedBy B2 {\n" +
+					"		callin void rm2() { base.rm2(); }\n" +
+					"		rm2 <- replace bm2;\n" +
+					"	}\n" +
+					"}\n";
+			this.createFile("/P/src/p/MyTeam2.java", team2SourceString);
+			
+			this.problemRequestor.initialize(team2SourceString.toCharArray());
+			ICompilationUnit unit = getCompilationUnit("/P/src/p/MyTeam2.java").getWorkingCopy(this.wcOwner, null);
+			assertNoProblem((team2SourceString).toCharArray(), unit);
+
+    	} finally {
+    		deleteProject("P");
+    	}
+    }
 }