diff options
author | Thomas Watson | 2013-10-12 03:18:00 +0000 |
---|---|---|
committer | Thomas Watson | 2013-10-12 03:18:00 +0000 |
commit | 1135d902a444d3c0ce9d2e700e6fb61b835d2684 (patch) | |
tree | a143e633d207587b7a2edb1d53c92e981de0b9d8 /bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/WeavingAdaptor.java | |
parent | 6c370a0677db44cc748cc411d915f1e6e8f6b78d (diff) | |
download | rt.equinox.bundles-1135d902a444d3c0ce9d2e700e6fb61b835d2684.tar.gz rt.equinox.bundles-1135d902a444d3c0ce9d2e700e6fb61b835d2684.tar.xz rt.equinox.bundles-1135d902a444d3c0ce9d2e700e6fb61b835d2684.zip |
Revert "Bug 418663 - [weaving.hook] Get rid of compile warnings in official build"
This reverts commit 6c370a0677db44cc748cc411d915f1e6e8f6b78d.
Diffstat (limited to 'bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/WeavingAdaptor.java')
-rw-r--r-- | bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/WeavingAdaptor.java | 70 |
1 files changed, 33 insertions, 37 deletions
diff --git a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/WeavingAdaptor.java b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/WeavingAdaptor.java index 8d5ba6fb2..79b5a0842 100644 --- a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/WeavingAdaptor.java +++ b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/WeavingAdaptor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2013 IBM Corporation and others. + * Copyright (c) 2006, 2009 IBM Corporation and others. * 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 @@ -33,20 +33,20 @@ import org.osgi.framework.wiring.BundleRevision; public class WeavingAdaptor implements IWeavingAdaptor { - private static class ThreadLocalSet extends ThreadLocal<Set<Object>> { + private static class ThreadLocalSet extends ThreadLocal { public boolean contains(final Object obj) { - final Set<Object> set = get(); + final Set set = (Set) get(); return set.contains(obj); } @Override - protected Set<Object> initialValue() { - return new HashSet<Object>(); + protected Object initialValue() { + return new HashSet(); } public void put(final Object obj) { - final Set<Object> set = get(); + final Set set = (Set) get(); if (set.contains(obj)) { throw new RuntimeException(obj.toString()); } @@ -54,7 +54,7 @@ public class WeavingAdaptor implements IWeavingAdaptor { } public void remove(final Object obj) { - final Set<?> set = get(); + final Set set = (Set) get(); if (!set.contains(obj)) { throw new RuntimeException(obj.toString()); } @@ -90,30 +90,28 @@ public class WeavingAdaptor implements IWeavingAdaptor { this.symbolicName = generation.getRevision().getSymbolicName(); this.moduleLoader = classLoader; if (Debug.DEBUG_GENERAL) - Debug.println("- WeavingAdaptor.WeavingAdaptor() bundle=" //$NON-NLS-1$ + Debug.println("- WeavingAdaptor.WeavingAdaptor() bundle=" + symbolicName); } - @Override public CacheEntry findClass(final String name, final URL sourceFileURL) { if (Debug.DEBUG_CACHE) - Debug.println("> WeavingAdaptor.findClass() bundle=" + symbolicName //$NON-NLS-1$ - + ", url=" + sourceFileURL + ", name=" + name); //$NON-NLS-1$ //$NON-NLS-2$ + Debug.println("> WeavingAdaptor.findClass() bundle=" + symbolicName + + ", url=" + sourceFileURL + ", name=" + name); CacheEntry cacheEntry = null; initialize(); if (cachingService != null) { cacheEntry = cachingService - .findStoredClass("", sourceFileURL, name); //$NON-NLS-1$ + .findStoredClass("", sourceFileURL, name); } if (Debug.DEBUG_CACHE) - Debug.println("< WeavingAdaptor.findClass() cacheEntry=" //$NON-NLS-1$ + Debug.println("< WeavingAdaptor.findClass() cacheEntry=" + cacheEntry); return cacheEntry; } - @Override public void initialize() { synchronized (this) { if (initialized) return; @@ -123,13 +121,14 @@ public class WeavingAdaptor implements IWeavingAdaptor { identifyRecursionSet.put(this); if (Debug.DEBUG_GENERAL) - Debug.println("> WeavingAdaptor.initialize() bundle=" //$NON-NLS-1$ - + symbolicName + ", moduleLoader=" + moduleLoader); //$NON-NLS-1$ + Debug.println("> WeavingAdaptor.initialize() bundle=" + + symbolicName + ", moduleLoader=" + moduleLoader); - if (symbolicName.startsWith("org.aspectj")) { //$NON-NLS-1$ + if (symbolicName.startsWith("org.aspectj")) { if (Debug.DEBUG_GENERAL) - Debug.println("- WeavingAdaptor.initialize() symbolicName=" //$NON-NLS-1$ - + symbolicName + ", moduleLoader=" //$NON-NLS-1$ + Debug.println("- WeavingAdaptor.initialize() symbolicName=" + + symbolicName + + ", moduleLoader=" + moduleLoader); } else if (moduleLoader != null) { weavingService = factory.getWeavingService(moduleLoader); @@ -139,8 +138,8 @@ public class WeavingAdaptor implements IWeavingAdaptor { final Bundle host = factory.getHost(bundle); if (Debug.DEBUG_GENERAL) - Debug.println("- WeavingAdaptor.initialize() symbolicName=" //$NON-NLS-1$ - + symbolicName + ", host=" + host); //$NON-NLS-1$ + Debug.println("- WeavingAdaptor.initialize() symbolicName=" + + symbolicName + ", host=" + host); final Generation hostGeneration = (Generation) ((ModuleRevision) host .adapt(BundleRevision.class)).getRevisionInfo(); @@ -157,33 +156,31 @@ public class WeavingAdaptor implements IWeavingAdaptor { } } else { if (Debug.DEBUG_GENERAL) - Debug.println("W WeavingAdaptor.initialize() symbolicName=" //$NON-NLS-1$ - + symbolicName + ", baseLoader=" + moduleLoader); //$NON-NLS-1$ + Debug.println("W WeavingAdaptor.initialize() symbolicName=" + + symbolicName + ", baseLoader=" + moduleLoader); } initialized = true; identifyRecursionSet.remove(this); } if (Debug.DEBUG_GENERAL) - Debug.println("< WeavingAdaptor.initialize() weavingService=" //$NON-NLS-1$ - + (weavingService != null) + ", cachingService=" //$NON-NLS-1$ + Debug.println("< WeavingAdaptor.initialize() weavingService=" + + (weavingService != null) + ", cachingService=" + (cachingService != null)); } } - @Override public boolean isInitialized() { return initialized; } - @Override public boolean storeClass(final String name, final URL sourceFileURL, - final Class<?> clazz, final byte[] classbytes) { + final Class clazz, final byte[] classbytes) { if (Debug.DEBUG_CACHE) Debug.println("> WeavingAdaptor.storeClass() bundle=" //$NON-NLS-1$ - + symbolicName + ", url=" + sourceFileURL //$NON-NLS-1$ - + ", name=" //$NON-NLS-1$ - + name + ", clazz=" + clazz); //$NON-NLS-1$ + + symbolicName + ", url=" + sourceFileURL + + ", name=" + + name + ", clazz=" + clazz); boolean stored = false; initialize(); @@ -197,7 +194,7 @@ public class WeavingAdaptor implements IWeavingAdaptor { final Map<String, byte[]> generatedClasses = weavingService .getGeneratedClassesFor(name); - stored = cachingService.storeClassAndGeneratedClasses("", //$NON-NLS-1$ + stored = cachingService.storeClassAndGeneratedClasses("", sourceFileURL, clazz, classbytes, generatedClasses); } else { weavingService.flushGeneratedClasses(moduleLoader); @@ -221,14 +218,13 @@ public class WeavingAdaptor implements IWeavingAdaptor { @Override public String toString() { - return "WeavingAdaptor[" + symbolicName + "]"; //$NON-NLS-1$ //$NON-NLS-2$ + return "WeavingAdaptor[" + symbolicName + "]"; } - @Override public byte[] weaveClass(final String name, final byte[] bytes) { if (Debug.DEBUG_WEAVE) - Debug.println("> WeavingAdaptor.weaveClass() bundle=" //$NON-NLS-1$ - + symbolicName + ", name=" + name + ", bytes=" //$NON-NLS-1$ //$NON-NLS-2$ + Debug.println("> WeavingAdaptor.weaveClass() bundle=" + + symbolicName + ", name=" + name + ", bytes=" + bytes.length); byte[] newBytes = null; @@ -242,7 +238,7 @@ public class WeavingAdaptor implements IWeavingAdaptor { } if (Debug.DEBUG_WEAVE) - Debug.println("< WeavingAdaptor.weaveClass() newBytes=" + newBytes); //$NON-NLS-1$ + Debug.println("< WeavingAdaptor.weaveClass() newBytes=" + newBytes); return newBytes; } |