You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 09:27:55 UTC

[sling-org-apache-sling-discovery-commons] 03/05: SLING-6992 : switch back to JRE 6 - and with that replace the diamond operator back to concrete parameter types

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.discovery.commons-1.0.22
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-discovery-commons.git

commit 17bb4e7e50b7aabde98fd7202b127e3427855b1f
Author: Stefan Egli <st...@apache.org>
AuthorDate: Mon Jul 3 11:34:52 2017 +0000

    SLING-6992 : switch back to JRE 6 - and with that replace the diamond operator back to concrete parameter types
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/discovery/commons@1800639 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                                        |  2 ++
 .../discovery/commons/providers/spi/base/IdMapService.java     | 10 +++++-----
 .../providers/spi/base/OakBacklogClusterSyncService.java       |  2 +-
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/pom.xml b/pom.xml
index 4f08c06..3f460ad 100644
--- a/pom.xml
+++ b/pom.xml
@@ -45,6 +45,8 @@
       <oak.version>1.4.4</oak.version>
         <!-- by default Slow tests are excluded - use -PincludeSlowTests to include them -->
     	<sling.excluded.surefire.groups>org.apache.sling.commons.testing.junit.categories.Slow</sling.excluded.surefire.groups>
+      <!-- SLING-6992 stick with JRE 6 for now -->
+      <sling.java.version>6</sling.java.version>
     </properties>
 
     <build>
diff --git a/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/IdMapService.java b/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/IdMapService.java
index 1de1dbc..152b32b 100644
--- a/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/IdMapService.java
+++ b/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/IdMapService.java
@@ -74,8 +74,8 @@ public class IdMapService extends AbstractServiceWithBackgroundCheck implements
 
     private long me;
 
-    private final Map<Integer, String> oldIdMapCache = new HashMap<>();
-    private final Map<Integer, String> idMapCache = new HashMap<>();
+    private final Map<Integer, String> oldIdMapCache = new HashMap<Integer, String>();
+    private final Map<Integer, String> idMapCache = new HashMap<Integer, String>();
 
     private long lastCacheInvalidation = -1;
 
@@ -130,7 +130,7 @@ public class IdMapService extends AbstractServiceWithBackgroundCheck implements
             logger.info("registerEventHandler: bundleContext is null - cannot register");
             return;
         }
-        Dictionary<String,Object> properties = new Hashtable<>();
+        Dictionary<String,Object> properties = new Hashtable<String,Object>();
         properties.put(Constants.SERVICE_DESCRIPTION, "IdMap Change Listener.");
         properties.put(Constants.SERVICE_VENDOR, "The Apache Software Foundation");
         String[] topics = new String[] {
@@ -198,7 +198,7 @@ public class IdMapService extends AbstractServiceWithBackgroundCheck implements
             // or when my clusterNodeId is already mapped to another slingId
             // in both cases: clean that up
             boolean foundMe = false;
-            for (String aKey : new HashSet<>(idmap.keySet())) {
+            for (String aKey : new HashSet<String>(idmap.keySet())) {
                 Object value = idmap.get(aKey);
                 if (value instanceof Number) {
                     Number n = (Number)value;
@@ -301,7 +301,7 @@ public class IdMapService extends AbstractServiceWithBackgroundCheck implements
     private Map<Integer, String> readIdMap(ResourceResolver resourceResolver) throws PersistenceException {
         Resource resource = ResourceHelper.getOrCreateResource(resourceResolver, getIdMapPath());
         ValueMap idmapValueMap = resource.adaptTo(ValueMap.class);
-        Map<Integer, String> idmap = new HashMap<>();
+        Map<Integer, String> idmap = new HashMap<Integer, String>();
         for (String slingId : idmapValueMap.keySet()) {
             Object value = idmapValueMap.get(slingId);
             if (value instanceof Number) {
diff --git a/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/OakBacklogClusterSyncService.java b/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/OakBacklogClusterSyncService.java
index f171728..707d8d8 100644
--- a/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/OakBacklogClusterSyncService.java
+++ b/src/main/java/org/apache/sling/discovery/commons/providers/spi/base/OakBacklogClusterSyncService.java
@@ -206,7 +206,7 @@ public class OakBacklogClusterSyncService extends AbstractServiceWithBackgroundC
             }
 
             ClusterView cluster = view.getLocalInstance().getClusterView();
-            Set<String> slingIds = new HashSet<>();
+            Set<String> slingIds = new HashSet<String>();
             for (InstanceDescription instance : cluster.getInstances()) {
                 slingIds.add(instance.getSlingId());
             }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.