aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Ross2013-10-10 08:53:09 (EDT)
committerJohn Ross2013-10-11 09:16:14 (EDT)
commit6c370a0677db44cc748cc411d915f1e6e8f6b78d (patch)
treef41c873fd6aff931d72bda7367a1eee9754d0ef9
parent3de7b6377daf9bcdd6e99d50c14bcb7586225014 (diff)
downloadrt.equinox.bundles-6c370a0677db44cc748cc411d915f1e6e8f6b78d.zip
rt.equinox.bundles-6c370a0677db44cc748cc411d915f1e6e8f6b78d.tar.gz
rt.equinox.bundles-6c370a0677db44cc748cc411d915f1e6e8f6b78d.tar.bz2
Bug 418663 - [weaving.hook] Get rid of compile warnings in official build
Update jdt core prefs to org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled. Change BREE from 1.4 to 1.6. Genericize the code to remove all warnings related to generics. Add @Override annotations where necessary. Fix non-externalized string literals. Update copyrights.
-rw-r--r--bundles/org.eclipse.equinox.weaving.hook/.classpath2
-rw-r--r--bundles/org.eclipse.equinox.weaving.hook/.settings/org.eclipse.jdt.core.prefs42
-rw-r--r--bundles/org.eclipse.equinox.weaving.hook/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/service/weaving/Supplementer.java38
-rw-r--r--bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/Debug.java4
-rw-r--r--bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/IWeavingAdaptor.java4
-rw-r--r--bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/WeavingAdaptor.java70
-rw-r--r--bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/WeavingAdaptorFactory.java52
8 files changed, 125 insertions, 89 deletions
diff --git a/bundles/org.eclipse.equinox.weaving.hook/.classpath b/bundles/org.eclipse.equinox.weaving.hook/.classpath
index a070cdd..33db7ef 100644
--- a/bundles/org.eclipse.equinox.weaving.hook/.classpath
+++ b/bundles/org.eclipse.equinox.weaving.hook/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <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.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry excluding="org/aspectj/weaver/osgi/hooks/AspectJBundleWatcherHook.java|org/aspectj/weaver/osgi/hooks/AspectJBundleFileWrapperFactoryHook.java|org/aspectj/weaver/osgi/hooks/AspectJHookConfigurator.java|org/aspectj/weaver/osgi/hooks/AspectJClassLoadingHook.java|org/aspectj/weaver/osgi/hooks/AspectJClassLoadingStatsHook.java|org/aspectj/osgi/hooks/AspectJHookConfigurator.java|org/aspectj/osgi/hooks/AspectJClassLoadingHook.java|org/aspectj/osgi/hooks/AspectJBundleFileWrapperFactoryHook.java|org/aspectj/osgi/hooks/AspectJBundleWatcherHook.java|org/aspectj/osgi/hooks/AspectJClassLoadingStatsHook.java" kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
diff --git a/bundles/org.eclipse.equinox.weaving.hook/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.weaving.hook/.settings/org.eclipse.jdt.core.prefs
index 2c10e2d..592b02b 100644
--- a/bundles/org.eclipse.equinox.weaving.hook/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.equinox.weaving.hook/.settings/org.eclipse.jdt.core.prefs
@@ -1,9 +1,14 @@
-#Sun Oct 19 17:27:55 CEST 2008
eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@@ -11,12 +16,15 @@ org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
@@ -24,6 +32,7 @@ org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
@@ -34,7 +43,10 @@ org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected
@@ -43,24 +55,39 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
@@ -73,14 +100,16 @@ org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverridin
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
@@ -152,9 +181,12 @@ org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
diff --git a/bundles/org.eclipse.equinox.weaving.hook/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.weaving.hook/META-INF/MANIFEST.MF
index 3b1c168..dd12064 100644
--- a/bundles/org.eclipse.equinox.weaving.hook/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.weaving.hook/META-INF/MANIFEST.MF
@@ -7,4 +7,4 @@ Fragment-Host: org.eclipse.osgi;bundle-version="[3.10.0,4.0.0)"
Export-Package: org.eclipse.equinox.service.weaving,
org.eclipse.equinox.weaving.adaptors;x-friends:="org.eclipse.equinox.weaving.tests",
org.eclipse.equinox.weaving.hooks;x-friends:="org.eclipse.equinox.weaving.tests"
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/service/weaving/Supplementer.java b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/service/weaving/Supplementer.java
index 20ec8b7..40cee89 100644
--- a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/service/weaving/Supplementer.java
+++ b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/service/weaving/Supplementer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2009 Martin Lippert and others.
+ * Copyright (c) 2008, 2013 Martin Lippert 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
@@ -77,6 +77,24 @@ public class Supplementer {
this.supplementedBundles.add(supplementedBundle);
}
+ //knibb
+ //test if two Strings are equal
+ //with wild card support - only supports strings ending in *
+ private boolean equals_wild(final String input, final String match) {
+ if (input.equals(match)) {
+ //its a match so just return true
+ return true;
+ }
+ if (input.endsWith("*") == false) { //$NON-NLS-1$
+ //no wildcards are being used here
+ return false;
+ }
+ final String wild_in = input.substring(0, input.length() - 1);
+ if (match.startsWith(wild_in)) return true;
+
+ return false;
+ }
+
/**
* Gives information about which bundles are currently supplemented by this
* supplementer
@@ -212,22 +230,4 @@ public class Supplementer {
this.supplementedBundles.remove(supplementedBundle);
}
- //knibb
- //test if two Strings are equal
- //with wild card support - only supports strings ending in *
- private boolean equals_wild(final String input, final String match) {
- if (input.equals(match)) {
- //its a match so just return true
- return true;
- }
- if (input.endsWith("*") == false) {
- //no wildcards are being used here
- return false;
- }
- final String wild_in = input.substring(0, input.length() - 1);
- if (match.startsWith(wild_in)) return true;
-
- return false;
- }
-
}
diff --git a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/Debug.java b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/Debug.java
index e3d281c..b0b71d3 100644
--- a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/Debug.java
+++ b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/Debug.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 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
@@ -57,7 +57,7 @@ public class Debug {
DEBUG_BUNDLE = options.getBooleanOption(OPTION_DEBUG_BUNDLE, false);
DEBUG_WEAVE = options.getBooleanOption(OPTION_DEBUG_WEAVE, false);
DEBUG_CACHE = options.getBooleanOption(OPTION_DEBUG_CACHE, false);
- DEBUG_BUNDLENAME = options.getOption(OPTION_DEBUG_BUNDLENAME, "");
+ DEBUG_BUNDLENAME = options.getOption(OPTION_DEBUG_BUNDLENAME, ""); //$NON-NLS-1$
DEBUG_SUPPLEMENTS = options.getBooleanOption(
OPTION_DEBUG_SUPPLEMENTS, false);
}
diff --git a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/IWeavingAdaptor.java b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/IWeavingAdaptor.java
index 9c5bb66..44f05b7 100644
--- a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/IWeavingAdaptor.java
+++ b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/IWeavingAdaptor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 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
@@ -24,7 +24,7 @@ public interface IWeavingAdaptor {
public boolean isInitialized();
- public boolean storeClass(String name, URL sourceFileURL, Class clazz,
+ public boolean storeClass(String name, URL sourceFileURL, Class<?> clazz,
byte[] classbytes);
public byte[] weaveClass(String name, byte[] bytes);
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 79b5a08..8d5ba6f 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, 2009 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 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 {
+ private static class ThreadLocalSet extends ThreadLocal<Set<Object>> {
public boolean contains(final Object obj) {
- final Set set = (Set) get();
+ final Set<Object> set = get();
return set.contains(obj);
}
@Override
- protected Object initialValue() {
- return new HashSet();
+ protected Set<Object> initialValue() {
+ return new HashSet<Object>();
}
public void put(final Object obj) {
- final Set set = (Set) get();
+ final Set<Object> 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 = (Set) get();
+ final Set<?> set = get();
if (!set.contains(obj)) {
throw new RuntimeException(obj.toString());
}
@@ -90,28 +90,30 @@ public class WeavingAdaptor implements IWeavingAdaptor {
this.symbolicName = generation.getRevision().getSymbolicName();
this.moduleLoader = classLoader;
if (Debug.DEBUG_GENERAL)
- Debug.println("- WeavingAdaptor.WeavingAdaptor() bundle="
+ Debug.println("- WeavingAdaptor.WeavingAdaptor() bundle=" //$NON-NLS-1$
+ symbolicName);
}
+ @Override
public CacheEntry findClass(final String name, final URL sourceFileURL) {
if (Debug.DEBUG_CACHE)
- Debug.println("> WeavingAdaptor.findClass() bundle=" + symbolicName
- + ", url=" + sourceFileURL + ", name=" + name);
+ Debug.println("> WeavingAdaptor.findClass() bundle=" + symbolicName //$NON-NLS-1$
+ + ", url=" + sourceFileURL + ", name=" + name); //$NON-NLS-1$ //$NON-NLS-2$
CacheEntry cacheEntry = null;
initialize();
if (cachingService != null) {
cacheEntry = cachingService
- .findStoredClass("", sourceFileURL, name);
+ .findStoredClass("", sourceFileURL, name); //$NON-NLS-1$
}
if (Debug.DEBUG_CACHE)
- Debug.println("< WeavingAdaptor.findClass() cacheEntry="
+ Debug.println("< WeavingAdaptor.findClass() cacheEntry=" //$NON-NLS-1$
+ cacheEntry);
return cacheEntry;
}
+ @Override
public void initialize() {
synchronized (this) {
if (initialized) return;
@@ -121,14 +123,13 @@ public class WeavingAdaptor implements IWeavingAdaptor {
identifyRecursionSet.put(this);
if (Debug.DEBUG_GENERAL)
- Debug.println("> WeavingAdaptor.initialize() bundle="
- + symbolicName + ", moduleLoader=" + moduleLoader);
+ Debug.println("> WeavingAdaptor.initialize() bundle=" //$NON-NLS-1$
+ + symbolicName + ", moduleLoader=" + moduleLoader); //$NON-NLS-1$
- if (symbolicName.startsWith("org.aspectj")) {
+ if (symbolicName.startsWith("org.aspectj")) { //$NON-NLS-1$
if (Debug.DEBUG_GENERAL)
- Debug.println("- WeavingAdaptor.initialize() symbolicName="
- + symbolicName
- + ", moduleLoader="
+ Debug.println("- WeavingAdaptor.initialize() symbolicName=" //$NON-NLS-1$
+ + symbolicName + ", moduleLoader=" //$NON-NLS-1$
+ moduleLoader);
} else if (moduleLoader != null) {
weavingService = factory.getWeavingService(moduleLoader);
@@ -138,8 +139,8 @@ public class WeavingAdaptor implements IWeavingAdaptor {
final Bundle host = factory.getHost(bundle);
if (Debug.DEBUG_GENERAL)
- Debug.println("- WeavingAdaptor.initialize() symbolicName="
- + symbolicName + ", host=" + host);
+ Debug.println("- WeavingAdaptor.initialize() symbolicName=" //$NON-NLS-1$
+ + symbolicName + ", host=" + host); //$NON-NLS-1$
final Generation hostGeneration = (Generation) ((ModuleRevision) host
.adapt(BundleRevision.class)).getRevisionInfo();
@@ -156,31 +157,33 @@ public class WeavingAdaptor implements IWeavingAdaptor {
}
} else {
if (Debug.DEBUG_GENERAL)
- Debug.println("W WeavingAdaptor.initialize() symbolicName="
- + symbolicName + ", baseLoader=" + moduleLoader);
+ Debug.println("W WeavingAdaptor.initialize() symbolicName=" //$NON-NLS-1$
+ + symbolicName + ", baseLoader=" + moduleLoader); //$NON-NLS-1$
}
initialized = true;
identifyRecursionSet.remove(this);
}
if (Debug.DEBUG_GENERAL)
- Debug.println("< WeavingAdaptor.initialize() weavingService="
- + (weavingService != null) + ", cachingService="
+ Debug.println("< WeavingAdaptor.initialize() weavingService=" //$NON-NLS-1$
+ + (weavingService != null) + ", cachingService=" //$NON-NLS-1$
+ (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
- + ", name="
- + name + ", clazz=" + clazz);
+ + symbolicName + ", url=" + sourceFileURL //$NON-NLS-1$
+ + ", name=" //$NON-NLS-1$
+ + name + ", clazz=" + clazz); //$NON-NLS-1$
boolean stored = false;
initialize();
@@ -194,7 +197,7 @@ public class WeavingAdaptor implements IWeavingAdaptor {
final Map<String, byte[]> generatedClasses = weavingService
.getGeneratedClassesFor(name);
- stored = cachingService.storeClassAndGeneratedClasses("",
+ stored = cachingService.storeClassAndGeneratedClasses("", //$NON-NLS-1$
sourceFileURL, clazz, classbytes, generatedClasses);
} else {
weavingService.flushGeneratedClasses(moduleLoader);
@@ -218,13 +221,14 @@ public class WeavingAdaptor implements IWeavingAdaptor {
@Override
public String toString() {
- return "WeavingAdaptor[" + symbolicName + "]";
+ return "WeavingAdaptor[" + symbolicName + "]"; //$NON-NLS-1$ //$NON-NLS-2$
}
+ @Override
public byte[] weaveClass(final String name, final byte[] bytes) {
if (Debug.DEBUG_WEAVE)
- Debug.println("> WeavingAdaptor.weaveClass() bundle="
- + symbolicName + ", name=" + name + ", bytes="
+ Debug.println("> WeavingAdaptor.weaveClass() bundle=" //$NON-NLS-1$
+ + symbolicName + ", name=" + name + ", bytes=" //$NON-NLS-1$ //$NON-NLS-2$
+ bytes.length);
byte[] newBytes = null;
@@ -238,7 +242,7 @@ public class WeavingAdaptor implements IWeavingAdaptor {
}
if (Debug.DEBUG_WEAVE)
- Debug.println("< WeavingAdaptor.weaveClass() newBytes=" + newBytes);
+ Debug.println("< WeavingAdaptor.weaveClass() newBytes=" + newBytes); //$NON-NLS-1$
return newBytes;
}
diff --git a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/WeavingAdaptorFactory.java b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/WeavingAdaptorFactory.java
index 064e80d..fbd427e 100644
--- a/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/WeavingAdaptorFactory.java
+++ b/bundles/org.eclipse.equinox.weaving.hook/src/org/eclipse/equinox/weaving/adaptors/WeavingAdaptorFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2012 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 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
@@ -50,7 +50,7 @@ public class WeavingAdaptorFactory {
"org.eclipse.equinox.simpleconfigurator", //$NON-NLS-1$
"org.eclipse.equinox.common" }); //$NON-NLS-1$
- private ServiceTracker cachingServiceFactoryTracker;
+ private ServiceTracker<ICachingServiceFactory, ICachingServiceFactory> cachingServiceFactoryTracker;
private PackageAdmin packageAdminService;
@@ -58,7 +58,7 @@ public class WeavingAdaptorFactory {
private ISupplementerRegistry supplementerRegistry;
- private ServiceTracker weavingServiceFactoryTracker;
+ private ServiceTracker<IWeavingServiceFactory, IWeavingServiceFactory> weavingServiceFactoryTracker;
private ServiceListener weavingServiceListener;
@@ -88,12 +88,12 @@ public class WeavingAdaptorFactory {
Debug.println("> WeavingAdaptorFactory.getCachingService() bundle=" //$NON-NLS-1$
+ bundle + ", weavingService=" + weavingService); //$NON-NLS-1$
ICachingService service = null;
- String key = "";
+ String key = ""; //$NON-NLS-1$
if (weavingService != null) {
key = weavingService.getKey();
}
- final ICachingServiceFactory cachingServiceFactory = (ICachingServiceFactory) cachingServiceFactoryTracker
+ final ICachingServiceFactory cachingServiceFactory = cachingServiceFactoryTracker
.getService();
if (cachingServiceFactory != null) {
service = cachingServiceFactory.createCachingService(loader,
@@ -101,7 +101,7 @@ public class WeavingAdaptorFactory {
}
if (Debug.DEBUG_CACHE)
Debug.println("< WeavingAdaptorFactory.getCachingService() service=" //$NON-NLS-1$
- + service + ", key='" + key + "'"); //$NON-NLS-1$
+ + service + ", key='" + key + "'"); //$NON-NLS-1$ //$NON-NLS-2$
return service;
}
@@ -129,7 +129,7 @@ public class WeavingAdaptorFactory {
IWeavingService weavingService = null;
if (!IGNORE_WEAVING_SERVICE_BUNDLES.contains(bundle.getSymbolicName())) {
- final IWeavingServiceFactory weavingServiceFactory = (IWeavingServiceFactory) weavingServiceFactoryTracker
+ final IWeavingServiceFactory weavingServiceFactory = weavingServiceFactoryTracker
.getService();
if (weavingServiceFactory != null) {
weavingService = weavingServiceFactory.createWeavingService(
@@ -158,8 +158,8 @@ public class WeavingAdaptorFactory {
initializeStartLevelService(context);
// Service tracker for weaving service
- weavingServiceFactoryTracker = new ServiceTracker(context,
- IWeavingServiceFactory.class.getName(), null);
+ weavingServiceFactoryTracker = new ServiceTracker<IWeavingServiceFactory, IWeavingServiceFactory>(
+ context, IWeavingServiceFactory.class, null);
weavingServiceFactoryTracker.open();
if (Debug.DEBUG_WEAVE)
Debug.println("> Opened service tracker for weaving service."); //$NON-NLS-1$
@@ -167,6 +167,7 @@ public class WeavingAdaptorFactory {
// Service listener for weaving service
weavingServiceListener = new ServiceListener() {
+ @Override
public void serviceChanged(final ServiceEvent event) {
if (event.getType() == ServiceEvent.REGISTERED) {
final List<Bundle> bundlesToRefresh = new ArrayList<Bundle>();
@@ -217,50 +218,49 @@ public class WeavingAdaptorFactory {
// if (System.getProperty(WEAVING_SERVICE_DYNAMICS_PROPERTY, "false")
// .equals("true")) {
try {
- context.addServiceListener(weavingServiceListener, "("
- + Constants.OBJECTCLASS + "="
- + IWeavingServiceFactory.class.getName() + ")");
+ context.addServiceListener(weavingServiceListener, "(" //$NON-NLS-1$
+ + Constants.OBJECTCLASS + "=" //$NON-NLS-1$
+ + IWeavingServiceFactory.class.getName() + ")"); //$NON-NLS-1$
} catch (final InvalidSyntaxException e) { // This is correct!
}
- // }
// Service tracker for caching service
- cachingServiceFactoryTracker = new ServiceTracker(context,
- ICachingServiceFactory.class.getName(), null);
+ cachingServiceFactoryTracker = new ServiceTracker<ICachingServiceFactory, ICachingServiceFactory>(
+ context, ICachingServiceFactory.class, null);
cachingServiceFactoryTracker.open();
if (Debug.DEBUG_CACHE)
- Debug.println("> Opened service tracker for caching service.");
+ Debug.println("> Opened service tracker for caching service."); //$NON-NLS-1$
}
private void initializePackageAdminService(final BundleContext context) {
if (Debug.DEBUG_GENERAL)
- Debug.println("> AdaptorFactory.initializePackageAdminService() context="
+ Debug.println("> AdaptorFactory.initializePackageAdminService() context=" //$NON-NLS-1$
+ context);
- final ServiceReference ref = context
- .getServiceReference(PackageAdmin.class.getName());
+ final ServiceReference<PackageAdmin> ref = context
+ .getServiceReference(PackageAdmin.class);
if (ref != null) {
- packageAdminService = (PackageAdmin) context.getService(ref);
+ packageAdminService = context.getService(ref);
}
if (Debug.DEBUG_GENERAL)
- Debug.println("< AdaptorFactory.initializePackageAdminService() "
+ Debug.println("< AdaptorFactory.initializePackageAdminService() " //$NON-NLS-1$
+ packageAdminService);
}
private void initializeStartLevelService(final BundleContext context) {
if (Debug.DEBUG_GENERAL)
- Debug.println("> AdaptorFactory.initializeStartLevelService() context="
+ Debug.println("> AdaptorFactory.initializeStartLevelService() context=" //$NON-NLS-1$
+ context);
- final ServiceReference ref = context
- .getServiceReference(StartLevel.class.getName());
+ final ServiceReference<StartLevel> ref = context
+ .getServiceReference(StartLevel.class);
if (ref != null) {
- startLevelService = (StartLevel) context.getService(ref);
+ startLevelService = context.getService(ref);
}
if (Debug.DEBUG_GENERAL)
- Debug.println("< AdaptorFactory.initializeStartLevelService() "
+ Debug.println("< AdaptorFactory.initializeStartLevelService() " //$NON-NLS-1$
+ startLevelService);
}
}