Bug 406518 - migrate OT/Equinox to the standard OSGi WeavingHook
- clean up todos, plus more consistent synchronized.
diff --git a/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/internal/osgi/weaving/OTWeavingHook.java b/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/internal/osgi/weaving/OTWeavingHook.java
index 488282d..ac92834 100644
--- a/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/internal/osgi/weaving/OTWeavingHook.java
+++ b/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/internal/osgi/weaving/OTWeavingHook.java
@@ -131,7 +131,7 @@
 				triggerBaseTripWires(bundleName, wovenClass);
 
 				ObjectTeamsTransformer transformer = new ObjectTeamsTransformer();
-				Class<?> classBeingRedefined = null; // TODO
+				Class<?> classBeingRedefined = null; // TODO prepare for otre-dyn
 				ProtectionDomain protectionDomain = wovenClass.getProtectionDomain();
 				byte[] bytes = wovenClass.getBytes();
 				try {
diff --git a/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/internal/osgi/weaving/TeamLoader.java b/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/internal/osgi/weaving/TeamLoader.java
index 9697b42..56525b1 100644
--- a/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/internal/osgi/weaving/TeamLoader.java
+++ b/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/internal/osgi/weaving/TeamLoader.java
@@ -195,7 +195,7 @@
 			if (this.beingDefined.contains(baseclass)) {
 				synchronized (deferredTeams) {
 					WaitingTeamRecord record = new WaitingTeamRecord(team, aspectBinding, activationKind, baseclass);
-					deferredTeams.add(record); // TODO(SH): synchronization, deadlock? performed while holding lock an aspectBinding
+					deferredTeams.add(record);
 				}
 				log(IStatus.INFO, "Defer instantation/activation of team "+teamName);
 				return false;
diff --git a/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/internal/osgi/weaving/Util.java b/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/internal/osgi/weaving/Util.java
index ff85099..3086cec 100644
--- a/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/internal/osgi/weaving/Util.java
+++ b/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/internal/osgi/weaving/Util.java
@@ -20,7 +20,6 @@
  **********************************************************************/
 package org.eclipse.objectteams.internal.osgi.weaving;
 
-import java.util.HashSet;
 import static org.eclipse.core.runtime.IStatus.*;
 
 public class Util 
@@ -52,51 +51,6 @@
 	private static long[] profileTimes= new long[ProfileKind.values().length];
 	private static long systemStartTime= System.nanoTime();
 
-	static HashSet<String> PLATFORM_BUNDLES = null;
-	
-	@SuppressWarnings("nls")
-	private static void checkInit() {
-		if (PLATFORM_BUNDLES == null) {
-			PLATFORM_BUNDLES = new HashSet<String>();
-			// FIXME: reconsider:
-			for (String bundle : new String[] { "org.eclipse.equinox.common",
-												"org.eclipse.update.configurator",
-												"org.eclipse.core.runtime",
-												"org.eclipse.equinox.registry",
-												"org.eclipse.equinox.app",
-												"org.eclipse.equinox.ds",
-												"org.eclipse.equinox.event",
-												"org.eclipse.equinox.util",
-												"org.eclipse.osgi.services",
-												"org.eclipse.core.runtime.compatibility.auth",
-												"org.eclipse.equinox.preferences",
-												"org.eclipse.equinox.simpleconfigurator",
-												"org.eclipse.core.jobs",
-												"org.eclipse.core.runtime.compatibility",
-												"org.eclipse.equinox.p2.core",
-												"org.eclipse.equinox.p2.reconciler.dropins",
-												"org.eclipse.equinox.p2.directorywatcher",
-												"org.eclipse.ecf",
-												"org.eclipse.ecf.identity",
-												"org.eclipse.ecf.filetransfer",
-												"org.eclipse.ecf.provider.filetransfer",
-												"org.eclipse.ecf.provider.filetransfer.httpclient",
-												"org.apache.commons.httpclient",
-												// for Eclipse 4.x:
-												"org.eclipse.swt",
-												"org.eclipse.e4.ui.css.core",
-												"org.eclipse.e4.ui.css.swt.theme",
-												"org.eclipse.core.contenttype"
-				})
-				PLATFORM_BUNDLES.add(bundle);
-		}
-	}
-
-	static boolean isPlatformBundle(String bundleName) {
-		checkInit();
-		return PLATFORM_BUNDLES.contains(bundleName);
-	}
-
 	@SuppressWarnings("nls")
 	public static void profile(long startTime, ProfileKind kind, String msg, Logger logger) 
 	{
diff --git a/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/TransformerPlugin.java b/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/TransformerPlugin.java
index c052d83..2d47ca8 100644
--- a/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/TransformerPlugin.java
+++ b/plugins/org.eclipse.objectteams.otequinox/src/org/eclipse/objectteams/otequinox/TransformerPlugin.java
@@ -144,7 +144,7 @@
 		return result;
 	}
 
-	public static void registerTeamInstance(Team instance) {
+	public static synchronized void registerTeamInstance(Team instance) {
 		plugin.teamInstances.add(instance);
 	}
 	/**