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

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



commit 067add639b8cd260b1530a50c81e0e1d0a63e9b0
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
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(

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