Bug 344350 - [runtime][bcel] NPE in 
InstructionList.getInstructionHandles()
Revert to initial bundle structure 
(after the reason for my detour was identified as bug 369880)
diff --git a/plugins/org.eclipse.objectteams.otequinox.hook/bcelpatch/org.apache.bcel.generic.BranchHandle.class b/plugins/org.eclipse.objectteams.otequinox.hook/bcelpatch/org.apache.bcel.generic.BranchHandle.class
new file mode 100644
index 0000000..6ac249e
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.hook/bcelpatch/org.apache.bcel.generic.BranchHandle.class
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otequinox.hook/bcelpatch/org.apache.bcel.generic.InstructionHandle.class b/plugins/org.eclipse.objectteams.otequinox.hook/bcelpatch/org.apache.bcel.generic.InstructionHandle.class
new file mode 100644
index 0000000..52432e5
--- /dev/null
+++ b/plugins/org.eclipse.objectteams.otequinox.hook/bcelpatch/org.apache.bcel.generic.InstructionHandle.class
Binary files differ
diff --git a/plugins/org.eclipse.objectteams.otequinox.hook/build.properties b/plugins/org.eclipse.objectteams.otequinox.hook/build.properties
index 293aa98..3ccfbe8 100644
--- a/plugins/org.eclipse.objectteams.otequinox.hook/build.properties
+++ b/plugins/org.eclipse.objectteams.otequinox.hook/build.properties
@@ -2,7 +2,8 @@
 bin.includes = .,\
                META-INF/,\
                plugin.properties,\
-               about.html
+               about.html,\
+               bcelpatch/
 jars.compile.order = .
 source.. = src/
 javacProjectSettings = true
diff --git a/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/TransformerHook.java b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/TransformerHook.java
index 1adba08..4b4e5a2 100644
--- a/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/TransformerHook.java
+++ b/plugins/org.eclipse.objectteams.otequinox.hook/src/org/eclipse/objectteams/otequinox/internal/hook/TransformerHook.java
@@ -113,7 +113,7 @@
 	// As an OSGI extension bundle, we can't depend on the transformer plugin, so we have to hardcode this
 	public static final String  TRANSFORMER_PLUGIN_ID           = "org.eclipse.objectteams.otequinox";
 	
-	private static final String OTRE_ID           				= "org.eclipse.objectteams.runtime";
+	private static final String TRANSFORMER_HOOK_ID           = "org.eclipse.objectteams.otequinox.hook";
 	private static final String WORKSPACE_INITIALIZER_PLUGIN_ID = "org.eclipse.objectteams.otdt.earlyui";
 	private static final String OTDT_QUALIFIER = "OTDT";
 
@@ -122,6 +122,7 @@
 	
 	// this one requires hot-fixing:
 	private static final String BCEL_PLUGIN_ID = "org.apache.bcel";
+	private static final String BCEL_PATH_DIR = "bcelpatch/";
 
 	// specific action may be required when this class is loaded:
 	private static final String ORG_OBJECTTEAMS_TEAM = "org.objectteams.Team";
@@ -434,10 +435,8 @@
 			}
 		}
 		if (shouldPatch) {
-			Bundle otre = this.packageAdmin.getBundles(OTRE_ID, null)[0];
-			URL entry = otre.getEntry(name.replace('.', '/')+".class"); // binary bundle: search in the jar root
-			if (entry == null)
-				entry = otre.getEntry("bin/"+name.replace('.', '/')+".class"); // workspace bundle: search in the bin folder
+			Bundle transformer = this.packageAdmin.getBundles(TRANSFORMER_HOOK_ID, null)[0];
+			URL entry = transformer.getEntry(BCEL_PATH_DIR+name+".class");
 			InputStream stream = null;
 			try {
 				stream = entry.openStream();
diff --git a/plugins/org.eclipse.objectteams.runtime/.classpath b/plugins/org.eclipse.objectteams.runtime/.classpath
index 39f1864..bd0e74a 100644
--- a/plugins/org.eclipse.objectteams.runtime/.classpath
+++ b/plugins/org.eclipse.objectteams.runtime/.classpath
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
 	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="src" path="bcelpatchsrc"/>
+	<classpathentry kind="src" output="bcelpatchbin" path="bcelpatchsrc"/>
 	<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="output" path="bin"/>
diff --git a/plugins/org.eclipse.objectteams.runtime/build.properties b/plugins/org.eclipse.objectteams.runtime/build.properties
index 7f3be6c..a32c830 100644
--- a/plugins/org.eclipse.objectteams.runtime/build.properties
+++ b/plugins/org.eclipse.objectteams.runtime/build.properties
@@ -1,7 +1,6 @@
 customBuildCallbacks=customBuildCallbacks.xml
 customBuildCallbacks.inheritall=true
-source.. = src/,\
-			bcelpatchsrc
+source.. = src/
 output.. = bin/
 bin.includes = META-INF/,\
                .,\