diff options
author | Alexander Kurtakov | 2018-10-08 19:38:49 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2018-10-08 19:38:49 +0000 |
commit | 9499bb4a14b4d7b6df0c6f474067163633e3887c (patch) | |
tree | 3faa5deb8786fc92204e81ec1e7e06d5e6c5a045 | |
parent | a182b92092ce0333eb66e32893ce1d3de70e4e8e (diff) | |
download | rt.equinox.bundles-9499bb4a14b4d7b6df0c6f474067163633e3887c.tar.gz rt.equinox.bundles-9499bb4a14b4d7b6df0c6f474067163633e3887c.tar.xz rt.equinox.bundles-9499bb4a14b4d7b6df0c6f474067163633e3887c.zip |
Move o.e.equinox.event to Java 1.7I20181008-1800
And modernize code accordingly.
Change-Id: I7078b758af441c9bebd1b3fdd870ffaacfb670e8
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
13 files changed, 63 insertions, 62 deletions
diff --git a/bundles/org.eclipse.equinox.event/.classpath b/bundles/org.eclipse.equinox.event/.classpath index 472ee29b1..098194ca4 100644 --- a/bundles/org.eclipse.equinox.event/.classpath +++ b/bundles/org.eclipse.equinox.event/.classpath @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> - <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> + <classpathentry kind="src" path="src"/> <classpathentry kind="output" path="bin"/> </classpath> diff --git a/bundles/org.eclipse.equinox.event/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.event/.settings/org.eclipse.jdt.core.prefs index 8e0e9d5db..f5b5ce83c 100644 --- a/bundles/org.eclipse.equinox.event/.settings/org.eclipse.jdt.core.prefs +++ b/bundles/org.eclipse.equinox.event/.settings/org.eclipse.jdt.core.prefs @@ -9,18 +9,23 @@ org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled 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.nonnull.secondary= org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault +org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary= org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable +org.eclipse.jdt.core.compiler.annotation.nullable.secondary= 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.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.compliance=1.7 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.doc.comment.support=enabled org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000 +org.eclipse.jdt.core.compiler.problem.APILeak=warning org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.autoboxing=ignore @@ -32,7 +37,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod= org.eclipse.jdt.core.compiler.problem.discouragedReference=error org.eclipse.jdt.core.compiler.problem.emptyStatement=warning org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore +org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled org.eclipse.jdt.core.compiler.problem.fieldHiding=warning @@ -49,7 +54,7 @@ org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=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=ignore @@ -58,7 +63,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +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 @@ -66,19 +71,21 @@ 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.nonnullTypeVariableFromLegacyInvocation=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.pessimisticNullAnalysisForFreeTypeVariables=warning org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning 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.redundantSpecificationOfTypeArguments=warning org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore @@ -88,19 +95,25 @@ 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=warning +org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning 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=warning org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled +org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled +org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedImport=error org.eclipse.jdt.core.compiler.problem.unusedLabel=warning org.eclipse.jdt.core.compiler.problem.unusedLocal=warning @@ -113,7 +126,8 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error 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.release=disabled +org.eclipse.jdt.core.compiler.source=1.7 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 diff --git a/bundles/org.eclipse.equinox.event/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.event/META-INF/MANIFEST.MF index bfca277da..c498b4efe 100644 --- a/bundles/org.eclipse.equinox.event/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.event/META-INF/MANIFEST.MF @@ -1,6 +1,6 @@ Bundle-ManifestVersion: 2 Bundle-Name: %bundleName -Bundle-Version: 1.4.400.qualifier +Bundle-Version: 1.5.0.qualifier Bundle-SymbolicName: org.eclipse.equinox.event Bundle-Activator: org.eclipse.equinox.internal.event.Activator Import-Package: org.eclipse.osgi.framework.eventmgr;version="1.1.0", @@ -13,7 +13,7 @@ Export-Package: org.eclipse.equinox.internal.event;x-internal:=true, org.eclipse.equinox.internal.event.mapper;x-internal:=true Bundle-Vendor: %bundleVendor Bundle-Localization: plugin -Bundle-RequiredExecutionEnvironment: J2SE-1.5 +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Service-Component: OSGI-INF/component.xml Bundle-ActivationPolicy: lazy Provide-Capability: diff --git a/bundles/org.eclipse.equinox.event/pom.xml b/bundles/org.eclipse.equinox.event/pom.xml index 135e21999..af9a11640 100644 --- a/bundles/org.eclipse.equinox.event/pom.xml +++ b/bundles/org.eclipse.equinox.event/pom.xml @@ -19,6 +19,6 @@ </parent> <groupId>org.eclipse.equinox</groupId> <artifactId>org.eclipse.equinox.event</artifactId> - <version>1.4.400-SNAPSHOT</version> + <version>1.5.0-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> </project> diff --git a/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/Activator.java b/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/Activator.java index cd06fabda..5b28e4ec4 100644 --- a/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/Activator.java +++ b/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/Activator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2010 IBM Corporation and others. + * Copyright (c) 2005, 2018 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -22,6 +22,7 @@ public class Activator implements BundleActivator { private ServiceRegistration<EventAdmin> eventAdminService; private EventComponent eventAdmin; + @Override public void start(BundleContext bundleContext) throws InvalidSyntaxException { if (Boolean.valueOf(bundleContext.getProperty(PROP_USE_DS)).booleanValue()) return; // If this property is set we assume DS is being used. @@ -40,6 +41,7 @@ public class Activator implements BundleActivator { eventAdminService = bundleContext.registerService(EventAdmin.class, eventAdmin, null); } + @Override public void stop(BundleContext bundleContext) { if (eventAdmin != null) { eventAdminService.unregister(); diff --git a/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/EventAdminImpl.java b/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/EventAdminImpl.java index 95e063ba0..03020585d 100644 --- a/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/EventAdminImpl.java +++ b/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/EventAdminImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2010 IBM Corporation and others. + * Copyright (c) 2005, 2018 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -65,18 +65,12 @@ public class EventAdminImpl implements EventAdmin { log.close(); } - /** - * @param event - * @see org.osgi.service.event.EventAdmin#postEvent(org.osgi.service.event.Event) - */ + @Override public void postEvent(Event event) { dispatchEvent(event, true); } - /** - * @param event - * @see org.osgi.service.event.EventAdmin#sendEvent(org.osgi.service.event.Event) - */ + @Override public void sendEvent(Event event) { dispatchEvent(event, false); } @@ -122,12 +116,12 @@ public class EventAdminImpl implements EventAdmin { SecurityManager sm = System.getSecurityManager(); Permission perm = (sm == null) ? null : new TopicPermission(topic, TopicPermission.SUBSCRIBE); - Map<EventHandlerWrapper, Permission> listeners = new CopyOnWriteIdentityMap<EventHandlerWrapper, Permission>(); + Map<EventHandlerWrapper, Permission> listeners = new CopyOnWriteIdentityMap<>(); for (EventHandlerWrapper wrapper : eventHandlers) listeners.put(wrapper, perm); // Create the listener queue for this event delivery - ListenerQueue<EventHandlerWrapper, Permission, Event> listenerQueue = new ListenerQueue<EventHandlerWrapper, Permission, Event>(currentManager); + ListenerQueue<EventHandlerWrapper, Permission, Event> listenerQueue = new ListenerQueue<>(currentManager); // Add the listeners to the queue and associate them with the event // dispatcher listenerQueue.queueListeners(listeners.entrySet(), handlers); diff --git a/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/EventComponent.java b/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/EventComponent.java index 6b5f37101..e7efe8d59 100644 --- a/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/EventComponent.java +++ b/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/EventComponent.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2014 IBM Corporation and others. + * Copyright (c) 2009, 2018 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -34,10 +34,12 @@ public class EventComponent implements EventAdmin { eventAdmin.stop(); } + @Override public void postEvent(Event event) { eventAdmin.postEvent(event); } + @Override public void sendEvent(Event event) { eventAdmin.sendEvent(event); } diff --git a/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/EventHandlerTracker.java b/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/EventHandlerTracker.java index b5ae39fea..9784fc108 100644 --- a/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/EventHandlerTracker.java +++ b/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/EventHandlerTracker.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2017 IBM Corporation and others. + * Copyright (c) 2007, 2018 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -36,11 +36,12 @@ public class EventHandlerTracker extends ServiceTracker<EventHandler, EventHandl public EventHandlerTracker(BundleContext context, LogTracker log) { super(context, EventHandler.class.getName(), null); this.log = log; - globalWildcard = new ArrayList<EventHandlerWrapper>(); - partialWildcard = new HashMap<String, List<EventHandlerWrapper>>(); - topicName = new HashMap<String, List<EventHandlerWrapper>>(); + globalWildcard = new ArrayList<>(); + partialWildcard = new HashMap<>(); + topicName = new HashMap<>(); } + @Override public EventHandlerWrapper addingService(ServiceReference<EventHandler> reference) { EventHandlerWrapper wrapper = new EventHandlerWrapper(reference, context, log); synchronized (this) { @@ -51,6 +52,7 @@ public class EventHandlerTracker extends ServiceTracker<EventHandler, EventHandl return wrapper; } + @Override public void modifiedService(ServiceReference<EventHandler> reference, EventHandlerWrapper service) { synchronized (this) { unbucket(service); @@ -63,6 +65,7 @@ public class EventHandlerTracker extends ServiceTracker<EventHandler, EventHandl service.flush(); // needs to be called outside sync region } + @Override public void removedService(ServiceReference<EventHandler> reference, EventHandlerWrapper service) { synchronized (this) { unbucket(service); @@ -91,7 +94,7 @@ public class EventHandlerTracker extends ServiceTracker<EventHandler, EventHandl String key = topic.substring(0, topic.length() - 2); // Strip off "/*" from the end List<EventHandlerWrapper> wrappers = partialWildcard.get(key); if (wrappers == null) { - wrappers = new ArrayList<EventHandlerWrapper>(); + wrappers = new ArrayList<>(); partialWildcard.put(key, wrappers); } wrappers.add(wrapper); @@ -100,7 +103,7 @@ public class EventHandlerTracker extends ServiceTracker<EventHandler, EventHandl else { List<EventHandlerWrapper> wrappers = topicName.get(topic); if (wrappers == null) { - wrappers = new ArrayList<EventHandlerWrapper>(); + wrappers = new ArrayList<>(); topicName.put(topic, wrappers); } wrappers.add(wrapper); @@ -156,7 +159,7 @@ public class EventHandlerTracker extends ServiceTracker<EventHandler, EventHandl */ public synchronized Set<EventHandlerWrapper> getHandlers(final String topic) { // Use a set to remove duplicates - Set<EventHandlerWrapper> handlers = new HashSet<EventHandlerWrapper>(); + Set<EventHandlerWrapper> handlers = new HashSet<>(); // Add the "*" handlers handlers.addAll(globalWildcard); @@ -195,6 +198,7 @@ public class EventHandlerTracker extends ServiceTracker<EventHandler, EventHandl * @see org.eclipse.osgi.framework.eventmgr.EventDispatcher#dispatchEvent(java.lang.Object, * java.lang.Object, int, java.lang.Object) */ + @Override public void dispatchEvent(EventHandlerWrapper eventListener, Permission listenerObject, int eventAction, Event eventObject) { eventListener.handleEvent(eventObject, listenerObject); } diff --git a/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/EventHandlerWrapper.java b/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/EventHandlerWrapper.java index a9f877960..197f5440f 100644 --- a/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/EventHandlerWrapper.java +++ b/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/EventHandlerWrapper.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2017 IBM Corporation and others. + * Copyright (c) 2007, 2018 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -132,6 +132,7 @@ public class EventHandlerWrapper { EventHandler tempHandler = null; try { tempHandler = AccessController.doPrivileged(new PrivilegedAction<EventHandler>() { + @Override public EventHandler run() { return context.getService(reference); } diff --git a/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/mapper/BundleEventAdapter.java b/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/mapper/BundleEventAdapter.java index 14ca79bfd..1b0b2f065 100644 --- a/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/mapper/BundleEventAdapter.java +++ b/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/mapper/BundleEventAdapter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2010 IBM Corporation. + * Copyright (c) 2005, 2018 IBM Corporation. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -40,10 +40,7 @@ public class BundleEventAdapter extends EventAdapter { this.event = event; } - /** - * @return event - * @see org.eclipse.equinox.internal.event.mapper.EventAdapter#convert() - */ + @Override public Event convert() { String typename = null; switch (event.getType()) { @@ -73,7 +70,7 @@ public class BundleEventAdapter extends EventAdapter { typename = Integer.toString(event.getType()); } String topic = HEADER + Constants.TOPIC_SEPARATOR + typename; - Map<String, Object> properties = new HashMap<String, Object>(); + Map<String, Object> properties = new HashMap<>(); Bundle bundle = event.getBundle(); if (bundle == null) { throw new RuntimeException("BundleEvent.getBundle() returns null"); //$NON-NLS-1$ diff --git a/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/mapper/EventRedeliverer.java b/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/mapper/EventRedeliverer.java index ba26cf30f..4d69855b2 100644 --- a/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/mapper/EventRedeliverer.java +++ b/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/mapper/EventRedeliverer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2014 IBM Corporation and others. + * Copyright (c) 2005, 2018 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -48,26 +48,17 @@ public class EventRedeliverer implements FrameworkListener, BundleListener, Serv bc.addServiceListener(this); } - /** - * @param event - * @see org.osgi.framework.FrameworkListener#frameworkEvent(org.osgi.framework.FrameworkEvent) - */ + @Override public void frameworkEvent(FrameworkEvent event) { new FrameworkEventAdapter(event, eventAdmin).redeliver(); } - /** - * @param event - * @see org.osgi.framework.BundleListener#bundleChanged(org.osgi.framework.BundleEvent) - */ + @Override public void bundleChanged(BundleEvent event) { new BundleEventAdapter(event, eventAdmin).redeliver(); } - /** - * @param event - * @see org.osgi.framework.ServiceListener#serviceChanged(org.osgi.framework.ServiceEvent) - */ + @Override public void serviceChanged(ServiceEvent event) { new ServiceEventAdapter(event, eventAdmin).redeliver(); } diff --git a/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/mapper/FrameworkEventAdapter.java b/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/mapper/FrameworkEventAdapter.java index 42724be53..d38920049 100644 --- a/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/mapper/FrameworkEventAdapter.java +++ b/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/mapper/FrameworkEventAdapter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2010 IBM Corporation. + * Copyright (c) 2005, 2018 IBM Corporation. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -38,9 +38,7 @@ public class FrameworkEventAdapter extends EventAdapter { this.event = event; } - /** - * @see org.eclipse.equinox.internal.event.mapper.EventAdapter#convert() - */ + @Override public Event convert() { String typename = null; switch (event.getType()) { @@ -60,7 +58,7 @@ public class FrameworkEventAdapter extends EventAdapter { return null; } String topic = HEADER + Constants.TOPIC_SEPARATOR + typename; - Map<String, Object> properties = new HashMap<String, Object>(); + Map<String, Object> properties = new HashMap<>(); Bundle bundle = event.getBundle(); if (bundle != null) { putBundleProperties(properties, bundle); diff --git a/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/mapper/ServiceEventAdapter.java b/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/mapper/ServiceEventAdapter.java index e005bf86f..9ca34c62f 100644 --- a/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/mapper/ServiceEventAdapter.java +++ b/bundles/org.eclipse.equinox.event/src/org/eclipse/equinox/internal/event/mapper/ServiceEventAdapter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2010 IBM Corporation. + * Copyright (c) 2005, 2018 IBM Corporation. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -37,9 +37,7 @@ public class ServiceEventAdapter extends EventAdapter { this.event = event; } - /** - * @see org.eclipse.equinox.internal.event.mapper.EventAdapter#convert() - */ + @Override public Event convert() { String typename = null; switch (event.getType()) { @@ -56,7 +54,7 @@ public class ServiceEventAdapter extends EventAdapter { return null; } String topic = HEADER + Constants.TOPIC_SEPARATOR + typename; - Map<String, Object> properties = new HashMap<String, Object>(); + Map<String, Object> properties = new HashMap<>(); ServiceReference<?> ref = event.getServiceReference(); if (ref != null) { putServiceReferenceProperties(properties, ref); |