[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [metrics-lib/master] Remove unnecessary return statements.



commit 25998e1539c42d0628d799678af7f339dfdb190b
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date:   Tue Aug 21 11:47:45 2018 +0200

    Remove unnecessary return statements.
---
 .../java/org/torproject/descriptor/impl/BridgePoolAssignmentImpl.java | 1 -
 .../java/org/torproject/descriptor/impl/DescriptorReaderImpl.java     | 1 -
 .../java/org/torproject/descriptor/impl/ExtraInfoDescriptorImpl.java  | 1 -
 src/main/java/org/torproject/descriptor/impl/MicrodescriptorImpl.java | 1 -
 .../java/org/torproject/descriptor/impl/ServerDescriptorImpl.java     | 1 -
 .../java/org/torproject/descriptor/DescriptorSourceFactoryTest.java   | 4 +---
 6 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/src/main/java/org/torproject/descriptor/impl/BridgePoolAssignmentImpl.java b/src/main/java/org/torproject/descriptor/impl/BridgePoolAssignmentImpl.java
index 58fc872..80e126d 100644
--- a/src/main/java/org/torproject/descriptor/impl/BridgePoolAssignmentImpl.java
+++ b/src/main/java/org/torproject/descriptor/impl/BridgePoolAssignmentImpl.java
@@ -23,7 +23,6 @@ public class BridgePoolAssignmentImpl extends DescriptorImpl
     this.checkExactlyOnceKeys(EnumSet.of(Key.BRIDGE_POOL_ASSIGNMENT));
     this.checkFirstKey(Key.BRIDGE_POOL_ASSIGNMENT);
     this.clearParsedKeys();
-    return;
   }
 
   private void parseDescriptorBytes() throws DescriptorParseException {
diff --git a/src/main/java/org/torproject/descriptor/impl/DescriptorReaderImpl.java b/src/main/java/org/torproject/descriptor/impl/DescriptorReaderImpl.java
index 46d17ef..bbe467e 100644
--- a/src/main/java/org/torproject/descriptor/impl/DescriptorReaderImpl.java
+++ b/src/main/java/org/torproject/descriptor/impl/DescriptorReaderImpl.java
@@ -187,7 +187,6 @@ public class DescriptorReaderImpl implements DescriptorReader {
         }
       } catch (IOException | NumberFormatException e) {
         log.warn("Trouble reading given history file {}.", historyFile, e);
-        return;
       }
     }
 
diff --git a/src/main/java/org/torproject/descriptor/impl/ExtraInfoDescriptorImpl.java b/src/main/java/org/torproject/descriptor/impl/ExtraInfoDescriptorImpl.java
index 7590d47..7053ced 100644
--- a/src/main/java/org/torproject/descriptor/impl/ExtraInfoDescriptorImpl.java
+++ b/src/main/java/org/torproject/descriptor/impl/ExtraInfoDescriptorImpl.java
@@ -70,7 +70,6 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl
     this.checkKeysDependOn(bridgeStatsKeys, Key.BRIDGE_STATS_END);
     this.checkFirstKey(Key.EXTRA_INFO);
     this.clearParsedKeys();
-    return;
   }
 
   private void parseDescriptorBytes() throws DescriptorParseException {
diff --git a/src/main/java/org/torproject/descriptor/impl/MicrodescriptorImpl.java b/src/main/java/org/torproject/descriptor/impl/MicrodescriptorImpl.java
index 44c25a2..dc9795c 100644
--- a/src/main/java/org/torproject/descriptor/impl/MicrodescriptorImpl.java
+++ b/src/main/java/org/torproject/descriptor/impl/MicrodescriptorImpl.java
@@ -30,7 +30,6 @@ public class MicrodescriptorImpl extends DescriptorImpl
     this.checkAtMostOnceKeys(atMostOnceKeys);
     this.checkFirstKey(Key.ONION_KEY);
     this.clearParsedKeys();
-    return;
   }
 
   private void parseDescriptorBytes() throws DescriptorParseException {
diff --git a/src/main/java/org/torproject/descriptor/impl/ServerDescriptorImpl.java b/src/main/java/org/torproject/descriptor/impl/ServerDescriptorImpl.java
index c06fb6e..3df90cc 100644
--- a/src/main/java/org/torproject/descriptor/impl/ServerDescriptorImpl.java
+++ b/src/main/java/org/torproject/descriptor/impl/ServerDescriptorImpl.java
@@ -49,7 +49,6 @@ public abstract class ServerDescriptorImpl extends DescriptorImpl
           + "'reject' must be contained at least once.");
     }
     this.clearParsedKeys();
-    return;
   }
 
   private void parseDescriptorBytes() throws DescriptorParseException {
diff --git a/src/test/java/org/torproject/descriptor/DescriptorSourceFactoryTest.java b/src/test/java/org/torproject/descriptor/DescriptorSourceFactoryTest.java
index d9549e5..de906db 100644
--- a/src/test/java/org/torproject/descriptor/DescriptorSourceFactoryTest.java
+++ b/src/test/java/org/torproject/descriptor/DescriptorSourceFactoryTest.java
@@ -64,9 +64,7 @@ public class DescriptorSourceFactoryTest {
       retrieve.setAccessible(true);
       retrieve.invoke(null, "unknown.property");
     } catch (InvocationTargetException ite) {
-      if (ite.getCause() instanceof RuntimeException) {
-        return;
-      } else {
+      if (!(ite.getCause() instanceof RuntimeException)) {
         fail("Cause was " + ite.getCause()
             + ", but expected InvocationTargetException.");
       }



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits