aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] cschneider closed pull request #3: Cleanup code
Date Thu, 03 Jan 2019 10:51:51 GMT
cschneider closed pull request #3: Cleanup code
URL: https://github.com/apache/aries-journaled-events/pull/3
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/org.apache.aries.events.memory/src/main/java/org/apache/aries/events/memory/InMemoryMessaging.java
b/org.apache.aries.events.memory/src/main/java/org/apache/aries/events/memory/InMemoryMessaging.java
index b888272..e2639fe 100644
--- a/org.apache.aries.events.memory/src/main/java/org/apache/aries/events/memory/InMemoryMessaging.java
+++ b/org.apache.aries.events.memory/src/main/java/org/apache/aries/events/memory/InMemoryMessaging.java
@@ -54,12 +54,12 @@ public Message newMessage(byte[] payload, Map<String, String> props)
{
 
     @Override
     public Position positionFromString(String position) {
-        long offset = new Long(position).longValue();
+        long offset = Long.parseLong(position);
         return new MemoryPosition(offset);
     }
 
     private Topic getOrCreate(String topicName) {
-        return topics.computeIfAbsent(topicName, topicName2 -> new Topic(topicName2));
+        return topics.computeIfAbsent(topicName, Topic::new);
     }
 
 }
diff --git a/org.apache.aries.events.memory/src/main/java/org/apache/aries/events/memory/MemoryPosition.java
b/org.apache.aries.events.memory/src/main/java/org/apache/aries/events/memory/MemoryPosition.java
index 694c42d..b2b8ae5 100644
--- a/org.apache.aries.events.memory/src/main/java/org/apache/aries/events/memory/MemoryPosition.java
+++ b/org.apache.aries.events.memory/src/main/java/org/apache/aries/events/memory/MemoryPosition.java
@@ -33,6 +33,6 @@ public long getOffset() {
 
     @Override
     public String toString() {
-        return new Long(offset).toString();
+        return Long.toString(offset);
     }
 }
diff --git a/org.apache.aries.events.memory/src/main/java/org/apache/aries/events/memory/Topic.java
b/org.apache.aries.events.memory/src/main/java/org/apache/aries/events/memory/Topic.java
index 02bea04..917c989 100644
--- a/org.apache.aries.events.memory/src/main/java/org/apache/aries/events/memory/Topic.java
+++ b/org.apache.aries.events.memory/src/main/java/org/apache/aries/events/memory/Topic.java
@@ -17,9 +17,7 @@
  */
 package org.apache.aries.events.memory;
 
-import java.util.HashSet;
 import java.util.Map.Entry;
-import java.util.Set;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
@@ -38,7 +36,6 @@
 
     private String topicName;
     private Journal<Message> journal;
-    private Set<Subscription> subscriptions = new HashSet<>();
 
     public Topic(String topicName) {
         this.topicName = topicName;
@@ -116,7 +113,6 @@ public void close() {
             } catch (InterruptedException e) {
                 // Ignore
             }
-            subscriptions.remove(this);
         }
 
     }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message