Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/JDTDebugUILaunchingAdaptor.java52
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/JDTLaunchingAdaptor.java57
-rw-r--r--plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/IOTLaunchConstants.java2
-rw-r--r--plugins/org.eclipse.objectteams.otdt/META-INF/MANIFEST.MF6
-rw-r--r--plugins/org.eclipse.objectteams.otdt/plugin.xml7
-rw-r--r--plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTDTPlugin.java11
-rw-r--r--plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTREContainer.java29
-rw-r--r--plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTRuntimeClasspathProvider.java111
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.hook/.classpath1
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.runtime/.classpath2
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.runtime/META-INF/MANIFEST.MF10
-rw-r--r--plugins/org.eclipse.objectteams.otequinox.runtime/build.properties1
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.debug.tests/.classpath1
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.debug.tests/META-INF/MANIFEST.MF6
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/AbstractOTDTDebugTest.java8
-rw-r--r--testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/ClassAttributeReader.java53
16 files changed, 101 insertions, 256 deletions
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/JDTDebugUILaunchingAdaptor.java b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/JDTDebugUILaunchingAdaptor.java
index a7fbbf822..fcf39e718 100644
--- a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/JDTDebugUILaunchingAdaptor.java
+++ b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/JDTDebugUILaunchingAdaptor.java
@@ -16,14 +16,7 @@
**********************************************************************/
package org.eclipse.objectteams.otdt.internal.debug.adaptor.launching;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.jdt.internal.debug.ui.jres.JREsComboBlock;
-import org.eclipse.objectteams.otdt.debug.IOTLaunchConstants;
-import org.eclipse.objectteams.otdt.ui.OTDTUIPlugin;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
@@ -48,13 +41,10 @@ import base org.eclipse.jdt.debug.ui.launchConfigurations.JavaJRETab;
public team class JDTDebugUILaunchingAdaptor {
/**
- * Adds the "use JPLIS" option to an OTREBlock, and also connects the OTREBlock to its base.
+ * Connects the OTREBlock to its base.
*/
protected class JavaJRETab extends OTREBlock playedBy JavaJRETab {
-
- Button _jplisToggleButton;
- boolean _useJPLIS = true;
-
+
// === Imports (callout) : ===
@SuppressWarnings("decapsulation")
Control getJREControl() -> get JREsComboBlock fJREBlock
@@ -69,41 +59,21 @@ public team class JDTDebugUILaunchingAdaptor {
@SuppressWarnings("decapsulation")
void updateLaunchConfigurationDialog() -> void updateLaunchConfigurationDialog();
+ // === Triggers (callin) : ===
+
// build the GUI:
Group createOTRESection(Composite parent) <- after void createControl(Composite parent);
public Group createOTRESection(Composite parent) {
Composite enclosingComposite = (Composite) this.getJREControl();
Group group = super.createOTRESection(enclosingComposite, true/*useSWTFactory*/);
- this._jplisToggleButton = createCheckButton(group, OTDTUIPlugin.getResourceString("OTJavaMainTab.jplis_checkbox_label")); //$NON-NLS-1$
- this._jplisToggleButton.addSelectionListener(new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent e)
- {
- JavaJRETab.this._useJPLIS = JavaJRETab.this._jplisToggleButton.getSelection();
- setDirty(true);
- updateLaunchConfigurationDialog();
- }
- });
return group;
}
-
+
// read stored value:
- void initializeFrom(ILaunchConfiguration config) <- after void initializeFrom(ILaunchConfiguration config);
-
- protected void tryInitializeFrom(ILaunchConfiguration config, boolean hasOTJProject) throws CoreException {
- super.tryInitializeFrom(config, hasOTJProject);
- this._jplisToggleButton.setEnabled(hasOTJProject);
- this._useJPLIS = config.getAttribute(IOTLaunchConstants.ATTR_USE_JPLIS, this._useJPLIS);
- this._jplisToggleButton.setSelection(this._useJPLIS);
- }
-
+ initializeFrom <- after initializeFrom;
+
// apply value change:
- void performApply(ILaunchConfigurationWorkingCopy config)
- <- after void performApply(ILaunchConfigurationWorkingCopy config);
- public void performApply(ILaunchConfigurationWorkingCopy config) {
- super.performApply(config);
- config.setAttribute(IOTLaunchConstants.ATTR_USE_JPLIS, this._useJPLIS);
- }
+ performApply <- after performApply;
}
/** Add an OTRE block to the "Connect" tab for remote debugging. */
@@ -128,9 +98,11 @@ public team class JDTDebugUILaunchingAdaptor {
Group group = super.createOTRESection(enclosingComposite, true/*useSWTFactory*/);
return group;
}
+
+ // read stored value:
+ initializeFrom <- after initializeFrom;
// hook the trigger for passing the ot-launch attribute:
- void performApply(ILaunchConfigurationWorkingCopy config)
- <- after void performApply(ILaunchConfigurationWorkingCopy config);
+ performApply <- after performApply;
}
}
diff --git a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/JDTLaunchingAdaptor.java b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/JDTLaunchingAdaptor.java
index 7290f2f7e..e8d3d5d49 100644
--- a/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/JDTLaunchingAdaptor.java
+++ b/plugins/org.eclipse.objectteams.otdt.debug.adaptor/src/org/eclipse/objectteams/otdt/internal/debug/adaptor/launching/JDTLaunchingAdaptor.java
@@ -40,7 +40,7 @@ import base org.eclipse.jdt.launching.StandardClasspathProvider;
/**
* This team observes java launches and potentially modifies them for OT/J capabilities.
* <ul>
- * <li>Add BCEL and JMangler to the classpath (role {@link ClasspathExtender})
+ * <li>Add BCEL and otre_min to the classpath (role {@link ClasspathExtender})
* <li>Maintain an OTVMRunnerAdaptor for adapting vm- and program args (role {@link JDTLaunchingAdaptor.AbstractJavaLaunchConfigurationDelegate}).
* </ul>
* Role {@link JDTLaunchingAdaptor.JavaLaunchDelegate} only binds the above behavior into Java launches.
@@ -53,7 +53,7 @@ import base org.eclipse.jdt.launching.StandardClasspathProvider;
public team class JDTLaunchingAdaptor {
/**
- * This role extends the classpath with BCEL and JMangler paths if OT/J is enabled for the launch.
+ * This role extends the classpath with BCEL and otre_min paths if OT/J is enabled for the launch.
*/
protected class ClasspathExtender playedBy StandardClasspathProvider {
@@ -64,13 +64,12 @@ public team class JDTLaunchingAdaptor {
{
IRuntimeClasspathEntry[] origEntries = base.computeUnresolvedClasspath(config);
- boolean useJMangler = isNormalOTJLaunch(config);
- if (!useJMangler && !isJPLISOTJLaunch(config))
+ if (!isJPLISOTJLaunch(config))
return origEntries;
- // add BCEL, JMangler-core and JMangler-start (classpath / bootclasspath)
+ // add BCEL and otre_min (classpath / bootclasspath)
int oldLength = origEntries.length;
- IRuntimeClasspathEntry[] otRuntimeEntries = computePathsToAdd(origEntries, useJMangler);
+ IRuntimeClasspathEntry[] otRuntimeEntries = computePathsToAdd(origEntries);
// merge results:
IRuntimeClasspathEntry[] result = new IRuntimeClasspathEntry[oldLength + otRuntimeEntries.length];
@@ -79,17 +78,15 @@ public team class JDTLaunchingAdaptor {
return result;
}
- static IRuntimeClasspathEntry[] computePathsToAdd( IRuntimeClasspathEntry[] origEntries, boolean useJMangler )
+ static IRuntimeClasspathEntry[] computePathsToAdd( IRuntimeClasspathEntry[] origEntries)
{
boolean hasBCEL = false;
- boolean hasJManglerCore = false;
- boolean hasJManglerStart = false;
boolean hasOTRE_min = false;
for (int i = 0; i < origEntries.length; i++)
{
IRuntimeClasspathEntry entry = origEntries[i];
- if (OTREContainer.BCEL_JAR.equals(entry.getPath()))
+ if (OTREContainer.BCEL_PATH.equals(entry.getPath()))
hasBCEL = true;
else if (OTREContainer.OTRE_JAR_PATH.equals(entry.getPath().toString()))
hasOTRE_min = true;
@@ -99,20 +96,11 @@ public team class JDTLaunchingAdaptor {
IRuntimeClasspathEntry entry;
if (!hasBCEL) {
- entry = JavaRuntime.newArchiveRuntimeClasspathEntry(OTREContainer.BCEL_JAR);
- entry.setClasspathProperty(IRuntimeClasspathEntry.BOOTSTRAP_CLASSES);
+ entry = JavaRuntime.newArchiveRuntimeClasspathEntry(OTREContainer.BCEL_PATH);
result.add(entry);
}
-
- if (!hasJManglerCore && useJMangler) {
- throw new RuntimeException("JMangler is no longer supported");
- }
-
- if (!hasJManglerStart && useJMangler) {
- throw new RuntimeException("JMangler is no longer supported");
- }
-
- if (!hasOTRE_min && !useJMangler) {
+
+ if (!hasOTRE_min) {
entry = JavaRuntime.newArchiveRuntimeClasspathEntry(OTREContainer.OTRE_MIN_JAR_PATH);
entry.setClasspathProperty(IRuntimeClasspathEntry.BOOTSTRAP_CLASSES);
result.add(entry);
@@ -131,7 +119,6 @@ public team class JDTLaunchingAdaptor {
IJavaProject getJavaProject(ILaunchConfiguration arg0) -> IJavaProject getJavaProject(ILaunchConfiguration arg0);
OTVMRunnerAdaptor fAdaptor;
- boolean useJMangler = false;
String fOriginalMain;
// --- Initiate adaptations: (this callin actually applies to sub-base-classes)
@@ -140,8 +127,7 @@ public team class JDTLaunchingAdaptor {
void prepareLaunch(ILaunchConfiguration config, String mode, ILaunch launch) throws CoreException
{
this.fOriginalMain = null; // reset potential left over from previous launching
- this.useJMangler = isNormalOTJLaunch(config);
- if (!this.useJMangler && !isJPLISOTJLaunch(config)) {
+ if (!isJPLISOTJLaunch(config)) {
this.fAdaptor = null;
return;
}
@@ -152,15 +138,6 @@ public team class JDTLaunchingAdaptor {
TeamBreakpointInstaller.installTeamBreakpoints(getJavaProject(config));
}
- // --- Main Type Name: ---
- String verifyMainTypeName(ILaunchConfiguration config)
- <- replace String verifyMainTypeName(ILaunchConfiguration config)
- when (this.useJMangler);
-
- callin String verifyMainTypeName(ILaunchConfiguration config) throws CoreException {
- throw new RuntimeException("JMangler is no longer supported");
- }
-
// --- VM Arguments: ---
String getVMArguments(ILaunchConfiguration configuration)
<- replace String getVMArguments(ILaunchConfiguration configuration)
@@ -182,22 +159,10 @@ public team class JDTLaunchingAdaptor {
return this.fOriginalMain + ' ' + programArguments;
}
}
-
- static boolean isNormalOTJLaunch(ILaunchConfiguration config) {
- // FIXME(SH): see https://bugs.eclipse.org/302976
- try {
- return config.getAttribute(OTDebugPlugin.OT_LAUNCH, false) // OT/J ?
- && false//&& !config.getAttribute(IOTLaunchConstants.ATTR_USE_JPLIS, false) // not JPLIS ?
- && (config.getAttribute(IPDEUIConstants.LAUNCHER_PDE_VERSION, (String)null) == null); // not PDE ?
- } catch (CoreException e) {
- return false; // don't apply adaptations to bogus config
- }
- }
static boolean isJPLISOTJLaunch(ILaunchConfiguration config) {
try {
return config.getAttribute(OTDebugPlugin.OT_LAUNCH, false) // OT/J ?
- //&& config.getAttribute(IOTLaunchConstants.ATTR_USE_JPLIS, false) // JPLIS ?
&& (config.getAttribute(IPDEUIConstants.LAUNCHER_PDE_VERSION, (String)null) == null); // not PDE ?
} catch (CoreException e) {
return false; // don't apply adaptations to bogus config
diff --git a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/IOTLaunchConstants.java b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/IOTLaunchConstants.java
index 26cbed332..62a0e3834 100644
--- a/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/IOTLaunchConstants.java
+++ b/plugins/org.eclipse.objectteams.otdt.debug/src/org/eclipse/objectteams/otdt/debug/IOTLaunchConstants.java
@@ -38,6 +38,4 @@ public interface IOTLaunchConstants {
*/
public static final String ATTR_TEAMCONFIG_ACTIVE = uniquePrefix + ".TEAMCONFIG_ACTIVE_ATTR"; //$NON-NLS-1$
- public static final String ATTR_USE_JPLIS = uniquePrefix + ".USE_JPLIS"; //$NON-NLS-1$
-
}
diff --git a/plugins/org.eclipse.objectteams.otdt/META-INF/MANIFEST.MF b/plugins/org.eclipse.objectteams.otdt/META-INF/MANIFEST.MF
index ad3f620ad..3480eb357 100644
--- a/plugins/org.eclipse.objectteams.otdt/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.objectteams.otdt/META-INF/MANIFEST.MF
@@ -8,10 +8,12 @@ Bundle-Vendor: The TOPPrax consortium
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
org.eclipse.core.resources,
- org.eclipse.jdt.core;bundle-version="[3.5.1.v_OTDT_r140,4.0.0)",
+ org.eclipse.jdt.core;bundle-version="[3.6.0.v_OTDT_r070,4.0.0)",
org.eclipse.jdt.launching,
org.eclipse.debug.core,
- org.eclipse.objectteams.otequinox.branding
+ org.eclipse.osgi,
+ org.eclipse.objectteams.otequinox.branding,
+ org.eclipse.objectteams.runtime;bundle-version="[0.7.0,0.8.0)"
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: otdtcoreext.jar
Export-Package: org.eclipse.objectteams.otdt.core.ext
diff --git a/plugins/org.eclipse.objectteams.otdt/plugin.xml b/plugins/org.eclipse.objectteams.otdt/plugin.xml
index e2cd84c74..b88a55fdf 100644
--- a/plugins/org.eclipse.objectteams.otdt/plugin.xml
+++ b/plugins/org.eclipse.objectteams.otdt/plugin.xml
@@ -53,11 +53,4 @@
id="OTRE"
class="org.eclipse.objectteams.otdt.core.ext.OTREContainerInitializer"/>
</extension>
-
- <extension point="org.eclipse.jdt.launching.classpathProviders">
- <classpathProvider
- id="org.eclipse.objectteams.otdt.OTRuntimeClasspathProvider"
- class="org.eclipse.objectteams.otdt.core.ext.OTRuntimeClasspathProvider">
- </classpathProvider>
- </extension>
</plugin>
diff --git a/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTDTPlugin.java b/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTDTPlugin.java
index 198a62886..38f15562b 100644
--- a/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTDTPlugin.java
+++ b/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTDTPlugin.java
@@ -29,6 +29,7 @@ import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.objectteams.otdt.core.exceptions.ExceptionHandler;
+import org.osgi.framework.BundleContext;
/**
@@ -108,6 +109,16 @@ public class OTDTPlugin extends Plugin
return _singleton;
}
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ try {
+ OTREContainer.findBCEL(context);
+ } catch (RuntimeException re) {
+ this.getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, "Cannot initialize BCEL location", re));
+ }
+ }
+
public static String[] createProjectNatures(IProjectDescription prjDesc)
{
String[] natures = prjDesc.getNatureIds();
diff --git a/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTREContainer.java b/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTREContainer.java
index eb8e03fbb..98663d016 100644
--- a/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTREContainer.java
+++ b/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTREContainer.java
@@ -20,8 +20,11 @@
**********************************************************************/
package org.eclipse.objectteams.otdt.core.ext;
+import java.io.IOException;
+
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
@@ -31,6 +34,10 @@ import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.packageadmin.PackageAdmin;
/**
* This class serves the "OTRE" classpath container.
@@ -41,7 +48,6 @@ public class OTREContainer implements IClasspathContainer
{
public static final String OTRE_CONTAINER_NAME = "OTRE"; //$NON-NLS-1$
public static final String OTRE_JAR_FILENAME = "otre.jar"; //$NON-NLS-1$
- public static final String BCEL_JAR_FILENAME = "BCEL.jar"; //$NON-NLS-1$
public static final String OTRE_MIN_JAR_FILENAME = "otre_min.jar"; //$NON-NLS-1$
public static final String OTRE_AGENT_JAR_FILENAME = "otre_agent.jar"; //$NON-NLS-1$
@@ -49,9 +55,13 @@ public class OTREContainer implements IClasspathContainer
// these are served from the current plugin:
public static final IPath OTRE_MIN_JAR_PATH = OTDTPlugin.getResolvedVariablePath(OTDTPlugin.OTDT_INSTALLDIR, "lib/"+OTRE_MIN_JAR_FILENAME); //$NON-NLS-1$
public static final IPath OTRE_AGENT_JAR_PATH = OTDTPlugin.getResolvedVariablePath(OTDTPlugin.OTDT_INSTALLDIR, "lib/"+OTRE_AGENT_JAR_FILENAME); //$NON-NLS-1$
- // these are served from org.eclipse.objectteams.runtime/lib:
+ // this is served from org.eclipse.objectteams.runtime/lib:
public static final String OTRE_JAR_PATH = OTDTPlugin.OTRUNTIME_LIBDIR + '/' + OTRE_JAR_FILENAME; //$NON-NLS-1$
- public static final IPath BCEL_JAR = OTDTPlugin.getResolvedVariablePath(OTDTPlugin.OTRUNTIME_LIBDIR, BCEL_JAR_FILENAME); //$NON-NLS-1$
+
+ public static IPath BCEL_PATH; // will be initialized in {@link findBCEL(BundleContext)}
+ // data for initializing the above BCEL_PATH:
+ private static final String BCEL_BUNDLE_NAME = "org.apache.bcel"; //$NON-NLS-1$
+ private static final String BCEL_VERSION_RANGE = "[5.2.0,5.3.0)"; //$NON-NLS-1$
private IClasspathEntry[] _cpEntries;
@@ -156,4 +166,17 @@ public class OTREContainer implements IClasspathContainer
throw new CoreException( reason );
}
}
+
+ /** Fetch the location of the bcel bundle into BCEL_PATH. */
+ static void findBCEL(BundleContext context) throws IOException {
+ ServiceReference ref= context.getServiceReference(PackageAdmin.class.getName());
+ if (ref == null)
+ throw new IllegalStateException("Cannot connect to PackageAdmin");
+ PackageAdmin packageAdmin = (PackageAdmin)context.getService(ref);
+ for (Bundle bundle : packageAdmin.getBundles(BCEL_BUNDLE_NAME, BCEL_VERSION_RANGE)) {
+ BCEL_PATH = new Path(FileLocator.toFileURL(bundle.getEntry("/")).getFile());
+ return;
+ }
+ throw new RuntimeException("bundle org.apache.bcel not found");
+ }
}
diff --git a/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTRuntimeClasspathProvider.java b/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTRuntimeClasspathProvider.java
deleted file mode 100644
index faf6a5655..000000000
--- a/plugins/org.eclipse.objectteams.otdt/src/org/eclipse/objectteams/otdt/core/ext/OTRuntimeClasspathProvider.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/**********************************************************************
- * This file is part of "Object Teams Development Tooling"-Software
- *
- * Copyright 2003, 2010 Fraunhofer Gesellschaft, Munich, Germany,
- * for its Fraunhofer Institute for Computer Architecture and Software
- * Technology (FIRST), Berlin, Germany and Technical University Berlin,
- * Germany.
- *
- * 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: OTRuntimeClasspathProvider.java 21932 2009-07-30 16:53:44Z stephan $
- *
- * Please visit http://www.eclipse.org/objectteams for updates and contact.
- *
- * Contributors:
- * Fraunhofer FIRST - Initial API and implementation
- * Technical University Berlin - Initial API and implementation
- **********************************************************************/
-package org.eclipse.objectteams.otdt.core.ext;
-
-import java.util.LinkedList;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.jdt.launching.StandardClasspathProvider;
-
-
-/**
- * @author gis
- * @version $Id: OTRuntimeClasspathProvider.java 21932 2009-07-30 16:53:44Z stephan $
- */
-public class OTRuntimeClasspathProvider extends StandardClasspathProvider
-{
- public static final String PROVIDER_ID = "org.eclipse.objectteams.otdt.OTRuntimeClasspathProvider"; //$NON-NLS-1$
-
- public IRuntimeClasspathEntry[] computeUnresolvedClasspath(ILaunchConfiguration configuration) throws CoreException
- {
- // add BCEL, JMangler-core and JMangler-start (classpath / bootclasspath)
- IRuntimeClasspathEntry[] origEntries = super.computeUnresolvedClasspath(configuration);
-
- int oldLength = origEntries.length;
- IRuntimeClasspathEntry[] otRuntimeEntries = computePathsToAdd(origEntries);
- IRuntimeClasspathEntry[] result = new IRuntimeClasspathEntry[oldLength + otRuntimeEntries.length];
- System.arraycopy(origEntries, 0, result, 0, oldLength);
-
- // add the missing OT runtime paths to the result
- for (int i = 0; i < otRuntimeEntries.length; i++)
- {
- result[oldLength + i] = otRuntimeEntries[i];
- }
-
-// IJavaProject project = JavaRuntime.getJavaProject(configuration);
-// if (project == null) {
-// // no project - use JRE's libraries by default
-
- return result;
- }
-
- private static IRuntimeClasspathEntry[] computePathsToAdd( IRuntimeClasspathEntry[] origEntries )
- {
- boolean hasBCEL = false;
- boolean hasJManglerCore = false;
- boolean hasJManglerStart = false;
-
- for (int i = 0; i < origEntries.length; i++)
- {
- IRuntimeClasspathEntry entry = origEntries[i];
- if (OTREContainer.BCEL_JAR.equals(entry.getPath()))
- hasBCEL = true;
- }
-
- List<IRuntimeClasspathEntry> result = new LinkedList<IRuntimeClasspathEntry>();
- IRuntimeClasspathEntry entry;
-
-//TODO (carp): make these class paths variable classpaths and compute the absolute path later
-// Also fix getVariablePath() then.
- if (!hasBCEL)
- {
- entry = JavaRuntime.newArchiveRuntimeClasspathEntry(OTREContainer.BCEL_JAR);
- entry.setClasspathProperty(IRuntimeClasspathEntry.BOOTSTRAP_CLASSES);
- result.add(entry);
- }
-
- if (!hasJManglerCore)
- {
- throw new RuntimeException("JMangler is no longer supported");
- }
-
- if (!hasJManglerStart)
- {
- throw new RuntimeException("JMangler is no longer supported");
- }
-
- return result.toArray(new IRuntimeClasspathEntry[result.size()]);
- }
-
- public IRuntimeClasspathEntry[] resolveClasspath(
- IRuntimeClasspathEntry[] entries,
- ILaunchConfiguration configuration)
- throws CoreException
- {
- IRuntimeClasspathEntry[] result = super.resolveClasspath(entries, configuration);
- return result;
- }
-
-}
diff --git a/plugins/org.eclipse.objectteams.otequinox.hook/.classpath b/plugins/org.eclipse.objectteams.otequinox.hook/.classpath
index 18ffe9570..304e86186 100644
--- a/plugins/org.eclipse.objectteams.otequinox.hook/.classpath
+++ b/plugins/org.eclipse.objectteams.otequinox.hook/.classpath
@@ -3,6 +3,5 @@
<classpathentry kind="src" path="src"/>
<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="lib" path="/org.eclipse.objectteams.otequinox.runtime"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/plugins/org.eclipse.objectteams.otequinox.runtime/.classpath b/plugins/org.eclipse.objectteams.otequinox.runtime/.classpath
index 3826cef1d..836ff97fb 100644
--- a/plugins/org.eclipse.objectteams.otequinox.runtime/.classpath
+++ b/plugins/org.eclipse.objectteams.otequinox.runtime/.classpath
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry exported="true" kind="lib" path="lib/BCEL.jar" sourcepath="/bcel-5.2/src/java"/>
<classpathentry exported="true" kind="lib" path="lib/otre.jar"/>
+ <classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/plugins/org.eclipse.objectteams.otequinox.runtime/META-INF/MANIFEST.MF b/plugins/org.eclipse.objectteams.otequinox.runtime/META-INF/MANIFEST.MF
index 6762f33bc..df7977291 100644
--- a/plugins/org.eclipse.objectteams.otequinox.runtime/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.objectteams.otequinox.runtime/META-INF/MANIFEST.MF
@@ -7,11 +7,7 @@ Bundle-Vendor: Eclipse Object Teams Project
Export-Package: org.objectteams,
org.eclipse.objectteams.otre,
org.eclipse.objectteams.otre.jplis,
- org.eclipse.objectteams.otre.util,
- org.apache.bcel,
- org.apache.bcel.classfile,
- org.apache.bcel.generic,
- org.apache.bcel.util
+ org.eclipse.objectteams.otre.util
Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-ClassPath: lib/BCEL.jar,
- lib/otre.jar
+Bundle-ClassPath: lib/otre.jar
+Require-Bundle: org.apache.bcel;bundle-version="[5.2.0,5.3.0)"
diff --git a/plugins/org.eclipse.objectteams.otequinox.runtime/build.properties b/plugins/org.eclipse.objectteams.otequinox.runtime/build.properties
index 434d732c6..1772bf41c 100644
--- a/plugins/org.eclipse.objectteams.otequinox.runtime/build.properties
+++ b/plugins/org.eclipse.objectteams.otequinox.runtime/build.properties
@@ -1,5 +1,4 @@
bin.includes = META-INF/,\
- lib/BCEL.jar,\
lib/otre.jar
src.includes = build.properties,\
README.txt,\
diff --git a/testplugins/org.eclipse.objectteams.otdt.debug.tests/.classpath b/testplugins/org.eclipse.objectteams.otdt.debug.tests/.classpath
index da1d7bcd5..065ac06e1 100644
--- a/testplugins/org.eclipse.objectteams.otdt.debug.tests/.classpath
+++ b/testplugins/org.eclipse.objectteams.otdt.debug.tests/.classpath
@@ -3,6 +3,5 @@
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="lib" path="/home/stephan/workspaces/otdt-helios/org.objectteams.runtime/otj/lib/jmangler/use/BCEL.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/testplugins/org.eclipse.objectteams.otdt.debug.tests/META-INF/MANIFEST.MF b/testplugins/org.eclipse.objectteams.otdt.debug.tests/META-INF/MANIFEST.MF
index c407dddc2..9b149add3 100644
--- a/testplugins/org.eclipse.objectteams.otdt.debug.tests/META-INF/MANIFEST.MF
+++ b/testplugins/org.eclipse.objectteams.otdt.debug.tests/META-INF/MANIFEST.MF
@@ -3,11 +3,11 @@ Bundle-ManifestVersion: 2
Bundle-Name: OTDT DebugTest Plug-in
Bundle-SymbolicName: org.eclipse.objectteams.otdt.debug.tests;singleton:=true
Bundle-Version: 1.3.0
-Bundle-ClassPath: otdt-debugtests.jar,
- BCEL.jar
+Bundle-ClassPath: otdt-debugtests.jar
Bundle-Activator: org.eclipse.objectteams.otdt.debug.tests.DebugTestsPlugin
Bundle-Vendor: Fraunhofer FIRST
-Require-Bundle: org.eclipse.ui,
+Require-Bundle: org.apache.bcel,
+ org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.jdt.debug.tests,
org.eclipse.jdt.debug,
diff --git a/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/AbstractOTDTDebugTest.java b/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/AbstractOTDTDebugTest.java
index fb189c095..3a389e522 100644
--- a/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/AbstractOTDTDebugTest.java
+++ b/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/AbstractOTDTDebugTest.java
@@ -104,8 +104,6 @@ import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.Position;
import org.eclipse.jface.util.SafeRunnable;
-import org.eclipse.objectteams.otdt.core.ext.OTRuntimeClasspathProvider;
-import org.eclipse.objectteams.otdt.debug.OTDebugPlugin;
import org.eclipse.objectteams.otdt.debug.ui.internal.actions.OTToggleBreakpointAdapter;
import org.eclipse.ui.console.IConsole;
import org.eclipse.ui.console.IHyperlink;
@@ -1397,12 +1395,6 @@ public abstract class AbstractOTDTDebugTest extends TestCase implements IEvalua
ILaunchConfigurationWorkingCopy config = type.newInstance(getJavaProject().getProject().getFolder("launchConfigurations"), mainTypeName);
config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, mainTypeName);
config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, getJavaProject().getElementName());
-//{ObjectTeams: make it an OT/J launch:
- if (OTDebugPlugin.OT_LAUNCH_CONFIGURATION_TYPE.equals(launchType)) {
- config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER, OTRuntimeClasspathProvider.PROVIDER_ID);
- config.setAttribute(OTDebugPlugin.OT_LAUNCH, true);
- }
-// SH}
// use 'java' instead of 'javaw' to launch tests (javaw is problematic
// on JDK1.4.2)
Map map = new HashMap(1);
diff --git a/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/ClassAttributeReader.java b/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/ClassAttributeReader.java
index 9bf88d996..76d77ef8e 100644
--- a/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/ClassAttributeReader.java
+++ b/testplugins/org.eclipse.objectteams.otdt.debug.tests/src/org/eclipse/objectteams/otdt/debug/tests/ClassAttributeReader.java
@@ -29,14 +29,15 @@ import java.util.Vector;
import org.eclipse.core.runtime.IPath;
-import de.fub.bytecode.Repository;
-import de.fub.bytecode.classfile.Attribute;
-import de.fub.bytecode.classfile.ClassParser;
-import de.fub.bytecode.classfile.ConstantPool;
-import de.fub.bytecode.classfile.ConstantUtf8;
-import de.fub.bytecode.classfile.JavaClass;
-import de.fub.bytecode.classfile.Method;
-import de.fub.bytecode.classfile.Unknown;
+import org.apache.bcel.Repository;
+import org.apache.bcel.classfile.Attribute;
+import org.apache.bcel.classfile.ClassFormatException;
+import org.apache.bcel.classfile.ClassParser;
+import org.apache.bcel.classfile.ConstantPool;
+import org.apache.bcel.classfile.ConstantUtf8;
+import org.apache.bcel.classfile.JavaClass;
+import org.apache.bcel.classfile.Method;
+import org.apache.bcel.classfile.Unknown;
/**
* @author ike
@@ -59,22 +60,28 @@ public class ClassAttributeReader
public ClassAttributeReader(IPath classFilePath)
{
- if ((_javaclass = Repository.lookupClass(classFilePath.toOSString())) == null)
- try
- {
+ try {
+ if ((_javaclass = Repository.lookupClass(classFilePath.toOSString())) == null) {
_javaclass = new ClassParser(classFilePath.toOSString()).parse(); // May throw
- readAndStoreAttributes();
- }
- catch (ClassFormatError e)
- {
- _error = e.getMessage();
- e.printStackTrace();
- }
- catch (IOException e)
- {
- _error = e.getMessage();
- e.printStackTrace();
- }
+ readAndStoreAttributes();
+ }
+ }
+ catch (ClassFormatError e)
+ {
+ _error = e.getMessage();
+ e.printStackTrace();
+ }
+ catch (IOException e)
+ {
+ _error = e.getMessage();
+ e.printStackTrace();
+ } catch (ClassFormatException e) {
+ _error = e.getMessage();
+ e.printStackTrace();
+ } catch (ClassNotFoundException e) {
+ _error = e.getMessage();
+ e.printStackTrace();
+ }
}
public String getError()

Back to the top