Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2016-10-12 12:21:32 -0400
committerThomas Watson2017-06-16 08:38:08 -0400
commit0af49fa8440cd17af48b6a54c5d52f6ea26267c9 (patch)
tree2c2e398c238f2d1b38c4db719fd891b2f3133cf8
parent0965ee422528b80cd11bb690f7d94559c54c0d16 (diff)
downloadrt.equinox.framework-0af49fa8440cd17af48b6a54c5d52f6ea26267c9.tar.gz
rt.equinox.framework-0af49fa8440cd17af48b6a54c5d52f6ea26267c9.tar.xz
rt.equinox.framework-0af49fa8440cd17af48b6a54c5d52f6ea26267c9.zip
Clean up after move to Java 7 in OSGi R7 implementation
Change-Id: I7849a613e5ff92674374924614730a47fa452e37 Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/DTOBuilder.java4
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxBundle.java2
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogReaderServiceFactory.java4
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogReaderServiceImpl.java3
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/LogServiceManager.java2
-rwxr-xr-xbundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/LoggerContextTargetMap.java12
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/PrototypeServiceFactoryUse.java2
7 files changed, 15 insertions, 14 deletions
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/DTOBuilder.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/DTOBuilder.java
index ee034b6a2..de3e3e371 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/DTOBuilder.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/DTOBuilder.java
@@ -208,8 +208,8 @@ public class DTOBuilder {
builder.getBundleWiringNodeDTO(wiring);
}
FrameworkWiringDTO dto = new FrameworkWiringDTO();
- dto.wirings = new HashSet<BundleWiringDTO.NodeDTO>(builder.wiringnodes.values());
- dto.resources = new HashSet<BundleRevisionDTO>(builder.resources.values());
+ dto.wirings = new HashSet<>(builder.wiringnodes.values());
+ dto.resources = new HashSet<>(builder.resources.values());
return dto;
}
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxBundle.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxBundle.java
index 14f9cfe30..e8f203f1c 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxBundle.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/EquinoxBundle.java
@@ -878,7 +878,7 @@ public class EquinoxBundle implements Bundle, BundleReference {
if (FrameworkWiringDTO.class.equals(adapterType)) {
readLock();
try {
- Set<BundleWiring> allWirings = new HashSet<BundleWiring>();
+ Set<BundleWiring> allWirings = new HashSet<>();
for (Module m : module.getContainer().getModules()) {
for (BundleRevision revision : m.getRevisions().getRevisions()) {
BundleWiring wiring = revision.getWiring();
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogReaderServiceFactory.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogReaderServiceFactory.java
index 1d00919a2..bebcf7bc2 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogReaderServiceFactory.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogReaderServiceFactory.java
@@ -36,7 +36,7 @@ public class ExtendedLogReaderServiceFactory implements ServiceFactory<ExtendedL
}
@SuppressWarnings("unchecked")
- private static final Enumeration<?> EMPTY_ENUMERATION = Collections.enumeration(Collections.EMPTY_LIST);
+ private static final Enumeration<LogEntry> EMPTY_ENUMERATION = Collections.enumeration(Collections.EMPTY_LIST);
static final LogFilter NULL_LOGGER_FILTER = new LogFilter() {
public boolean isLoggable(Bundle b, String loggerName, int logLevel) {
@@ -285,7 +285,7 @@ public class ExtendedLogReaderServiceFactory implements ServiceFactory<ExtendedL
}
}
- Enumeration<?> getLog() {
+ Enumeration<LogEntry> getLog() {
if (history == null) {
return EMPTY_ENUMERATION;
}
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogReaderServiceImpl.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogReaderServiceImpl.java
index 8ee48f5d9..210f9cd62 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogReaderServiceImpl.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/ExtendedLogReaderServiceImpl.java
@@ -10,6 +10,7 @@ package org.eclipse.osgi.internal.log;
import java.util.*;
import org.eclipse.equinox.log.ExtendedLogReaderService;
import org.eclipse.equinox.log.LogFilter;
+import org.osgi.service.log.LogEntry;
import org.osgi.service.log.LogListener;
public class ExtendedLogReaderServiceImpl implements ExtendedLogReaderService {
@@ -37,7 +38,7 @@ public class ExtendedLogReaderServiceImpl implements ExtendedLogReaderService {
addLogListener(listener, ExtendedLogReaderServiceFactory.NULL_LOGGER_FILTER);
}
- public Enumeration getLog() {
+ public Enumeration<LogEntry> getLog() {
checkShutdown();
return factory.getLog();
}
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/LogServiceManager.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/LogServiceManager.java
index d14f5ab8e..7994ad4b5 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/LogServiceManager.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/LogServiceManager.java
@@ -56,7 +56,7 @@ public class LogServiceManager implements BundleListener, FrameworkListener, Ser
context.addBundleListener(logServiceFactory);
logReaderServiceRegistration = context.registerService(LOGREADERSERVICE_CLASSES, logReaderServiceFactory, null);
logServiceRegistration = context.registerService(LOGSERVICE_CLASSES, logServiceFactory, null);
- Hashtable<String, Object> loggerAdminProps = new Hashtable<String, Object>();
+ Hashtable<String, Object> loggerAdminProps = new Hashtable<>();
// TODO the constant for log service id will like be defined
loggerAdminProps.put("osgi.log.service.id", logServiceRegistration.getReference().getProperty(Constants.SERVICE_ID)); //$NON-NLS-1$
loggerAdminRegistration = context.registerService(LoggerAdmin.class, logServiceFactory.getLoggerAdmin(), loggerAdminProps);
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/LoggerContextTargetMap.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/LoggerContextTargetMap.java
index ee098c0e5..15234d6ca 100755
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/LoggerContextTargetMap.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/log/LoggerContextTargetMap.java
@@ -17,10 +17,10 @@ import org.osgi.framework.Version;
import org.osgi.service.log.admin.LoggerContext;
public class LoggerContextTargetMap {
- private final Map<Bundle, ExtendedLogServiceImpl> logServices = new HashMap<Bundle, ExtendedLogServiceImpl>();
- private final Map<String, EquinoxLoggerContext> loggerContexts = new HashMap<String, EquinoxLoggerContext>();
- private final Map<Bundle, List<String>> targetToQualifiedNames = new HashMap<Bundle, List<String>>();
- private final Map<String, Collection<Bundle>> qualifiedNameToTargets = new HashMap<String, Collection<Bundle>>();
+ private final Map<Bundle, ExtendedLogServiceImpl> logServices = new HashMap<>();
+ private final Map<String, EquinoxLoggerContext> loggerContexts = new HashMap<>();
+ private final Map<Bundle, List<String>> targetToQualifiedNames = new HashMap<>();
+ private final Map<String, Collection<Bundle>> qualifiedNameToTargets = new HashMap<>();
List<String> add(Bundle b) {
String bsn = b.getSymbolicName();
@@ -31,7 +31,7 @@ public class LoggerContextTargetMap {
String version = v == null ? "" : v.toString(); //$NON-NLS-1$
String location = ExtendedLogServiceFactory.secureAction.getLocation(b);
- List<String> result = new ArrayList<String>(3);
+ List<String> result = new ArrayList<>(3);
StringBuilder sb = new StringBuilder(bsn);
getTargetsInternal(bsn).add(b);
@@ -72,7 +72,7 @@ public class LoggerContextTargetMap {
private Collection<Bundle> getTargetsInternal(String pid) {
Collection<Bundle> targets = qualifiedNameToTargets.get(pid);
if (targets == null) {
- targets = new ArrayList<Bundle>(1);
+ targets = new ArrayList<>(1);
qualifiedNameToTargets.put(pid, targets);
}
return targets;
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/PrototypeServiceFactoryUse.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/PrototypeServiceFactoryUse.java
index 52d935d01..24f68f9a4 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/PrototypeServiceFactoryUse.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/serviceregistry/PrototypeServiceFactoryUse.java
@@ -41,7 +41,7 @@ public class PrototypeServiceFactoryUse<S> extends ServiceFactoryUse<S> {
*/
PrototypeServiceFactoryUse(BundleContextImpl context, ServiceRegistrationImpl<S> registration) {
super(context, registration);
- this.serviceObjects = new IdentityHashMap<S, AtomicInteger>();
+ this.serviceObjects = new IdentityHashMap<>();
}
/**

Back to the top