[tor-commits] [metrics-lib/master] Remove unused methods.

karsten at torproject.org karsten at torproject.org
Thu Nov 21 11:38:07 UTC 2019


commit 067add639b8cd260b1530a50c81e0e1d0a63e9b0
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date:   Thu Nov 21 09:55:12 2019 +0100

    Remove unused methods.
---
 .../torproject/descriptor/impl/ParseHelper.java    | 27 ----------------------
 1 file changed, 27 deletions(-)

diff --git a/src/main/java/org/torproject/descriptor/impl/ParseHelper.java b/src/main/java/org/torproject/descriptor/impl/ParseHelper.java
index 53f011c..cd73278 100644
--- a/src/main/java/org/torproject/descriptor/impl/ParseHelper.java
+++ b/src/main/java/org/torproject/descriptor/impl/ParseHelper.java
@@ -223,26 +223,6 @@ public class ParseHelper {
         ZoneOffset.UTC);
   }
 
-  protected static long parseDateAtIndex(String line, String[] parts,
-      int dateIndex) throws DescriptorParseException {
-    if (dateIndex >= parts.length) {
-      throw new DescriptorParseException("Line '" + line + "' does not "
-          + "contain a date at the expected position.");
-    }
-    long result = -1L;
-    try {
-      DateFormat dateFormat = getDateFormat("yyyy-MM-dd");
-      result = dateFormat.parse(parts[dateIndex]).getTime();
-    } catch (ParseException e) {
-      /* Leave result at -1L. */
-    }
-    if (result < 0L || result / 1000L > (long) Integer.MAX_VALUE) {
-      throw new DescriptorParseException("Illegal date format in line '"
-          + line + "'.");
-    }
-    return result;
-  }
-
   protected static String parseTwentyByteHexString(String line,
       String hexString) throws DescriptorParseException {
     return parseHexString(line, hexString, 40);
@@ -330,18 +310,11 @@ public class ParseHelper {
 
   protected static void verifyThirtyTwoByteBase64String(String line,
       String base64String) throws DescriptorParseException {
-    convertThirtyTwoByteBase64StringToHex(line, base64String);
-  }
-
-  private static String convertThirtyTwoByteBase64StringToHex(String line,
-      String base64String) throws DescriptorParseException {
     if (!thirtyTwoByteBase64Pattern.matcher(base64String).matches()) {
       throw new DescriptorParseException("'" + base64String
           + "' in line '" + line + "' is not a valid base64-encoded "
           + "32-byte value.");
     }
-    return Hex.encodeHexString(Base64.decodeBase64(base64String + "="))
-        .toUpperCase();
   }
 
   protected static String parseCommaSeparatedKeyIntegerValueList(



More information about the tor-commits mailing list