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

[tor-commits] [onionoo/master] Remove unthrown exceptions.



commit 54dfc8985ee7da543644762f8011f1323e53e24e
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date:   Mon Aug 20 14:50:52 2018 +0200

    Remove unthrown exceptions.
---
 src/main/java/org/torproject/onionoo/server/ResourceServlet.java    | 2 +-
 src/main/java/org/torproject/onionoo/updater/LookupService.java     | 6 ++----
 .../java/org/torproject/onionoo/server/ResourceServletTest.java     | 4 ++--
 .../torproject/onionoo/updater/NodeDetailsStatusUpdaterTest.java    | 2 +-
 4 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/main/java/org/torproject/onionoo/server/ResourceServlet.java b/src/main/java/org/torproject/onionoo/server/ResourceServlet.java
index afcb867..1c72b9e 100644
--- a/src/main/java/org/torproject/onionoo/server/ResourceServlet.java
+++ b/src/main/java/org/torproject/onionoo/server/ResourceServlet.java
@@ -51,7 +51,7 @@ public class ResourceServlet extends HttpServlet {
 
   @Override
   public void doGet(HttpServletRequest request,
-      HttpServletResponse response) throws IOException, ServletException {
+      HttpServletResponse response) throws IOException {
     HttpServletRequestWrapper requestWrapper =
         new HttpServletRequestWrapper(request);
     HttpServletResponseWrapper responseWrapper =
diff --git a/src/main/java/org/torproject/onionoo/updater/LookupService.java b/src/main/java/org/torproject/onionoo/updater/LookupService.java
index 4bcc754..4af4443 100644
--- a/src/main/java/org/torproject/onionoo/updater/LookupService.java
+++ b/src/main/java/org/torproject/onionoo/updater/LookupService.java
@@ -14,7 +14,6 @@ import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStreamReader;
-import java.nio.charset.CharacterCodingException;
 import java.nio.charset.CharsetDecoder;
 import java.nio.charset.CodingErrorAction;
 import java.nio.charset.StandardCharsets;
@@ -340,14 +339,13 @@ public class LookupService {
   }
 
   private BufferedReader createBufferedReaderFromUtf8File(File utf8File)
-      throws FileNotFoundException, CharacterCodingException {
+      throws FileNotFoundException {
     return this.createBufferedReaderFromFile(utf8File,
         StandardCharsets.UTF_8.newDecoder());
   }
 
   private BufferedReader createBufferedReaderFromIso88591File(
-      File iso88591File) throws FileNotFoundException,
-      CharacterCodingException {
+      File iso88591File) throws FileNotFoundException {
     return this.createBufferedReaderFromFile(iso88591File,
         StandardCharsets.ISO_8859_1.newDecoder());
   }
diff --git a/src/test/java/org/torproject/onionoo/server/ResourceServletTest.java b/src/test/java/org/torproject/onionoo/server/ResourceServletTest.java
index bc01003..0be1635 100644
--- a/src/test/java/org/torproject/onionoo/server/ResourceServletTest.java
+++ b/src/test/java/org/torproject/onionoo/server/ResourceServletTest.java
@@ -87,7 +87,7 @@ public class ResourceServletTest {
 
     private int errorStatusCode;
 
-    protected void sendError(int errorStatusCode) throws IOException {
+    protected void sendError(int errorStatusCode) {
       this.errorStatusCode = errorStatusCode;
     }
 
@@ -385,7 +385,7 @@ public class ResourceServletTest {
   }
 
   @Test(timeout = 100)
-  public void testValidSummaryRelay() throws IOException {
+  public void testValidSummaryRelay() {
     this.runTest("/summary");
     assertEquals("2013-04-24 12:00:00",
         this.summaryDocument.relays_published);
diff --git a/src/test/java/org/torproject/onionoo/updater/NodeDetailsStatusUpdaterTest.java b/src/test/java/org/torproject/onionoo/updater/NodeDetailsStatusUpdaterTest.java
index 1bcc7eb..068c724 100644
--- a/src/test/java/org/torproject/onionoo/updater/NodeDetailsStatusUpdaterTest.java
+++ b/src/test/java/org/torproject/onionoo/updater/NodeDetailsStatusUpdaterTest.java
@@ -33,7 +33,7 @@ public class NodeDetailsStatusUpdaterTest {
   }
 
   @Test
-  public void testExitReset() throws Exception {
+  public void testExitReset() {
     NodeDetailsStatusUpdater ndsu = new NodeDetailsStatusUpdater(null, null);
     DescriptorParser dp = DescriptorSourceFactory.createDescriptorParser();
     String descString = RELAY1 + PUB1 + RELAY2 + POLICY1 + RELAY3;



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