Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Lippert2008-08-12 12:34:16 +0000
committerMartin Lippert2008-08-12 12:34:16 +0000
commita08488e8d48540003018b4da9cd0ee6cc5e9fc14 (patch)
treebee3d67405a049d0cafd684c7ef653829f559c47
parent3e831c7efa41da4073cf895358eb9e52070bd1ce (diff)
downloadrt.equinox.bundles-a08488e8d48540003018b4da9cd0ee6cc5e9fc14.tar.gz
rt.equinox.bundles-a08488e8d48540003018b4da9cd0ee6cc5e9fc14.tar.xz
rt.equinox.bundles-a08488e8d48540003018b4da9cd0ee6cc5e9fc14.zip
Removed dependency to J9 shared classes types
-rw-r--r--bundles/org.eclipse.equinox.weaving.caching/src/org/eclipse/equinox/weaving/internal/caching/Activator.java24
1 files changed, 18 insertions, 6 deletions
diff --git a/bundles/org.eclipse.equinox.weaving.caching/src/org/eclipse/equinox/weaving/internal/caching/Activator.java b/bundles/org.eclipse.equinox.weaving.caching/src/org/eclipse/equinox/weaving/internal/caching/Activator.java
index 38b6b0955..ce791b975 100644
--- a/bundles/org.eclipse.equinox.weaving.caching/src/org/eclipse/equinox/weaving/internal/caching/Activator.java
+++ b/bundles/org.eclipse.equinox.weaving.caching/src/org/eclipse/equinox/weaving/internal/caching/Activator.java
@@ -11,7 +11,8 @@
package org.eclipse.equinox.weaving.internal.caching;
-import com.ibm.oti.shared.Shared;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
import org.eclipse.equinox.service.weaving.ICachingService;
import org.eclipse.osgi.service.debug.DebugOptions;
@@ -97,13 +98,24 @@ public class Activator implements BundleActivator {
private boolean shouldRegister() {
boolean enabled = true;
try {
- Class.forName("com.ibm.oti.vm.VM"); // if this fails we are not on J9
- final boolean sharing = Shared.isSharingEnabled(); // if not using shared classes we want a different adaptor
-
- if (sharing) {
- enabled = false;
+ Class.forName("com.ibm.oti.vm.VM"); // if this fails we are not on J9 //$NON-NLS-1$
+ final Class<?> sharedClass = Class
+ .forName("com.ibm.oti.shared.Shared"); //$NON-NLS-1$
+ final Method isSharingEnabledMethod = sharedClass.getMethod(
+ "isSharingEnabled", (Class[]) null); //$NON-NLS-1$
+ if (isSharingEnabledMethod != null) {
+ final Boolean sharing = (Boolean) isSharingEnabledMethod
+ .invoke(null, (Object[]) null);
+ if (sharing != null && sharing.booleanValue()) {
+ enabled = false;
+ }
}
} catch (final ClassNotFoundException ex) {
+ } catch (final SecurityException e) {
+ } catch (final NoSuchMethodException e) {
+ } catch (final IllegalArgumentException e) {
+ } catch (final IllegalAccessException e) {
+ } catch (final InvocationTargetException e) {
}
return enabled;

Back to the top