[tor-commits] [metrics-lib/master] Make a couple JavaDoc fixes.

karsten at torproject.org karsten at torproject.org
Mon Aug 27 12:33:54 UTC 2018


commit 8b4dacfbc061499de0eff2ba7706478574db1fd4
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date:   Tue Aug 21 09:52:26 2018 +0200

    Make a couple JavaDoc fixes.
---
 .../descriptor/DescriptorSourceFactory.java        |  4 ++--
 .../torproject/descriptor/ExtraInfoDescriptor.java |  2 +-
 .../org/torproject/descriptor/LogDescriptor.java   |  4 ++--
 .../descriptor/RelayNetworkStatusConsensus.java    |  4 ++--
 .../descriptor/RelayNetworkStatusVote.java         |  4 ++--
 .../org/torproject/descriptor/TorperfResult.java   | 26 +++++++++++-----------
 .../torproject/descriptor/impl/DescriptorImpl.java | 14 ++++++------
 .../descriptor/index/DescriptorIndexCollector.java |  6 ++---
 .../torproject/descriptor/internal/FileType.java   |  2 +-
 .../descriptor/log/InternalLogDescriptor.java      |  2 +-
 10 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/src/main/java/org/torproject/descriptor/DescriptorSourceFactory.java b/src/main/java/org/torproject/descriptor/DescriptorSourceFactory.java
index 495968c..e755e42 100644
--- a/src/main/java/org/torproject/descriptor/DescriptorSourceFactory.java
+++ b/src/main/java/org/torproject/descriptor/DescriptorSourceFactory.java
@@ -31,10 +31,10 @@ import org.slf4j.LoggerFactory;
  * the following is an example for using a different implementation of the
  * descriptor downloader:</p>
  *
- * <p><code>
+ * <p>{@code
  *  java -Ddescriptor.downloader=my.special.descriptorimpl.Downloader \
  *      my.app.Mainclass
- * </code></p>
+ * }</p>
  *
  * @since 1.0.0
  */
diff --git a/src/main/java/org/torproject/descriptor/ExtraInfoDescriptor.java b/src/main/java/org/torproject/descriptor/ExtraInfoDescriptor.java
index 1ffb418..812d6aa 100644
--- a/src/main/java/org/torproject/descriptor/ExtraInfoDescriptor.java
+++ b/src/main/java/org/torproject/descriptor/ExtraInfoDescriptor.java
@@ -619,7 +619,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
   long getPaddingCountsStatsIntervalLength();
 
   /**
-   * Return padding-counts statistics, or <code>null</code> if no such
+   * Return padding-counts statistics, or {@code null} if no such
    * statistics are included.
    *
    * @since 1.7.0
diff --git a/src/main/java/org/torproject/descriptor/LogDescriptor.java b/src/main/java/org/torproject/descriptor/LogDescriptor.java
index a8448f6..5828441 100644
--- a/src/main/java/org/torproject/descriptor/LogDescriptor.java
+++ b/src/main/java/org/torproject/descriptor/LogDescriptor.java
@@ -13,7 +13,8 @@ import java.util.stream.Stream;
  * <p>Unlike other descriptors, logs can get very large and are typically stored
  * on disk in compressed form. Access to log contents through this
  * interface and its subinterfaces is made available in compressed and
- * decompressed form:
+ * decompressed form:</p>
+ *
  * <ul>
  * <li>The raw descriptor bytes are compressed, because logs contain
  * often redundant information that can achieve high compression rates.
@@ -21,7 +22,6 @@ import java.util.stream.Stream;
  * <li>The uncompressed log contents can be accessed as a stream of bytes.</li>
  * <li>A list of log lines (decompressed) can be retrieved.</li>
  * </ul>
- * </p>
  *
  * @since 2.2.0
  */
diff --git a/src/main/java/org/torproject/descriptor/RelayNetworkStatusConsensus.java b/src/main/java/org/torproject/descriptor/RelayNetworkStatusConsensus.java
index e03f40b..e8ec89f 100644
--- a/src/main/java/org/torproject/descriptor/RelayNetworkStatusConsensus.java
+++ b/src/main/java/org/torproject/descriptor/RelayNetworkStatusConsensus.java
@@ -150,8 +150,8 @@ public interface RelayNetworkStatusConsensus extends Descriptor {
 
   /**
    * Return a list of software packages and their versions together with a
-   * URL and one or more digests in the format <code>PackageName Version
-   * URL DIGESTS</code> that are known by at least three directory
+   * URL and one or more digests in the format {@code PackageName Version
+   * URL DIGESTS} that are known by at least three directory
    * authorities and agreed upon by the majority of directory authorities,
    * or null if the consensus does not contain package information.
    *
diff --git a/src/main/java/org/torproject/descriptor/RelayNetworkStatusVote.java b/src/main/java/org/torproject/descriptor/RelayNetworkStatusVote.java
index a507d8c..9514765 100644
--- a/src/main/java/org/torproject/descriptor/RelayNetworkStatusVote.java
+++ b/src/main/java/org/torproject/descriptor/RelayNetworkStatusVote.java
@@ -138,8 +138,8 @@ public interface RelayNetworkStatusVote extends Descriptor {
 
   /**
    * Return a list of software packages and their versions together with a
-   * URL and one or more digests in the format <code>PackageName Version
-   * URL DIGESTS</code> that are known by this directory authority, or
+   * URL and one or more digests in the format {@code PackageName Version
+   * URL DIGESTS} that are known by this directory authority, or
    * null if this descriptor does not contain package information.
    *
    * @since 1.3.0
diff --git a/src/main/java/org/torproject/descriptor/TorperfResult.java b/src/main/java/org/torproject/descriptor/TorperfResult.java
index c92ae78..add36ff 100644
--- a/src/main/java/org/torproject/descriptor/TorperfResult.java
+++ b/src/main/java/org/torproject/descriptor/TorperfResult.java
@@ -215,8 +215,8 @@ public interface TorperfResult extends Descriptor {
   /**
    * Return the hostname, IP address, and port that the TGen client used to
    * connect to the local tor SOCKS port, formatted as
-   * <code>hostname:ip:port</code>, which may be <code>"NULL:0.0.0.0:0"</code>
-   * if TGen was not able to find this information or <code>null</code> if the
+   * {@code hostname:ip:port}, which may be {@code "NULL:0.0.0.0:0"}
+   * if TGen was not able to find this information or {@code null} if the
    * OnionPerf line didn't contain this information.
    *
    * @since 1.7.0
@@ -226,8 +226,8 @@ public interface TorperfResult extends Descriptor {
   /**
    * Return the hostname, IP address, and port that the TGen client used to
    * connect to the SOCKS proxy server that tor runs, formatted as
-   * <code>hostname:ip:port</code>, which may be <code>"NULL:0.0.0.0:0"</code>
-   * if TGen was not able to find this information or <code>null</code> if the
+   * {@code hostname:ip:port}, which may be {@code "NULL:0.0.0.0:0"}
+   * if TGen was not able to find this information or {@code null} if the
    * OnionPerf line didn't contain this information.
    *
    * @since 1.7.0
@@ -236,9 +236,9 @@ public interface TorperfResult extends Descriptor {
 
   /**
    * Return the hostname, IP address, and port that the TGen client used to
-   * connect to the remote server, formatted as <code>hostname:ip:port</code>,
-   * which may be <code>"NULL:0.0.0.0:0"</code> if TGen was not able to find
-   * this information or <code>null</code> if the OnionPerf line didn't contain
+   * connect to the remote server, formatted as {@code hostname:ip:port},
+   * which may be {@code "NULL:0.0.0.0:0"} if TGen was not able to find
+   * this information or {@code null} if the OnionPerf line didn't contain
    * this information.
    *
    * @since 1.7.0
@@ -246,8 +246,8 @@ public interface TorperfResult extends Descriptor {
   String getEndpointRemote();
 
   /**
-   * Return the client machine hostname, which may be <code>"(NULL)"</code> if
-   * the TGen client was not able to find this information or <code>null</code>
+   * Return the client machine hostname, which may be {@code "(NULL)"} if
+   * the TGen client was not able to find this information or {@code null}
    * if the OnionPerf line didn't contain this information.
    *
    * @since 1.7.0
@@ -255,8 +255,8 @@ public interface TorperfResult extends Descriptor {
   String getHostnameLocal();
 
   /**
-   * Return the server machine hostname, which may be <code>"(NULL)"</code> if
-   * the TGen server was not able to find this information or <code>null</code>
+   * Return the server machine hostname, which may be {@code "(NULL)"} if
+   * the TGen server was not able to find this information or {@code null}
    * if the OnionPerf line didn't contain this information.
    *
    * @since 1.7.0
@@ -266,8 +266,8 @@ public interface TorperfResult extends Descriptor {
   /**
    * Return the public IP address of the OnionPerf host obtained by connecting
    * to well-known servers and finding the IP address in the result, which may
-   * be <code>"unknown"</code> if OnionPerf was not able to find this
-   * information or <code>null</code> if the OnionPerf line didn't contain this
+   * be {@code "unknown"} if OnionPerf was not able to find this
+   * information or {@code null} if the OnionPerf line didn't contain this
    * information.
    *
    * @since 1.7.0
diff --git a/src/main/java/org/torproject/descriptor/impl/DescriptorImpl.java b/src/main/java/org/torproject/descriptor/impl/DescriptorImpl.java
index 70fe7c6..1ae85d6 100644
--- a/src/main/java/org/torproject/descriptor/impl/DescriptorImpl.java
+++ b/src/main/java/org/torproject/descriptor/impl/DescriptorImpl.java
@@ -60,7 +60,7 @@ public abstract class DescriptorImpl implements Descriptor {
   }
 
   /**
-   * Returns a <emph>copy</emph> of the full raw descriptor bytes.
+   * Returns a <em>copy</em> of the full raw descriptor bytes.
    *
    * <p>If possible, subclasses should avoid retrieving raw descriptor bytes and
    * converting them to a String themselves and instead rely on
@@ -74,8 +74,8 @@ public abstract class DescriptorImpl implements Descriptor {
   }
 
   /**
-   * Returns a <emph>copy</emph> of raw descriptor bytes starting at
-   * <code>offset</code> and containing <code>length</code> bytes.
+   * Returns a <em>copy</em> of raw descriptor bytes starting at
+   * {@code offset} and containing {@code length} bytes.
    *
    * <p>If possible, subclasses should avoid retrieving raw descriptor bytes and
    * converting them to a String themselves and instead rely on
@@ -109,7 +109,7 @@ public abstract class DescriptorImpl implements Descriptor {
 
   /**
    * Returns a new {@link Scanner} for parsing the raw descriptor starting at
-   * byte <code>offset</code> containing <code>length</code> bytes using UTF-8
+   * byte {@code offset} containing {@code length} bytes using UTF-8
    * as charset.
    *
    * @param offset The index of the first byte to parse.
@@ -123,7 +123,7 @@ public abstract class DescriptorImpl implements Descriptor {
 
   /**
    * Returns the index within the raw descriptor of the first occurrence of the
-   * given <code>key</code>, or <code>-1</code> if the key is not contained.
+   * given {@code key}, or {@code -1} if the key is not contained.
    *
    * @param key Key to search for.
    * @return Index of the first occurrence, or -1.
@@ -148,8 +148,8 @@ public abstract class DescriptorImpl implements Descriptor {
 
   /**
    * Returns a list of two-element arrays containing offsets and lengths of
-   * descriptors starting with the given <code>key</code> in the raw descriptor
-   * starting at byte <code>offset</code> containing <code>length</code> bytes.
+   * descriptors starting with the given {@code key} in the raw descriptor
+   * starting at byte {@code offset} containing {@code length} bytes.
    *
    * @param key Key to search for.
    * @param offset The index of the first byte to split.
diff --git a/src/main/java/org/torproject/descriptor/index/DescriptorIndexCollector.java b/src/main/java/org/torproject/descriptor/index/DescriptorIndexCollector.java
index 774708f..9e053dc 100644
--- a/src/main/java/org/torproject/descriptor/index/DescriptorIndexCollector.java
+++ b/src/main/java/org/torproject/descriptor/index/DescriptorIndexCollector.java
@@ -34,11 +34,11 @@ public class DescriptorIndexCollector implements DescriptorCollector {
       .getLogger(DescriptorIndexCollector.class);
 
   /**
-   * If <code>collecTorIndexUrlString</code> contains just the
+   * If {@code collecTorIndexUrlString} contains just the
    * base url, e.g. https://some.host.org, the path
-   * <code>/index/index.json</code> will be appended.
+   * {@code /index/index.json} will be appended.
    * If a path is given (even just a final slash, e.g. https://some.host.org/),
-   * the <code>collecTorIndexUrlString</code> will be used as is.
+   * the {@code collecTorIndexUrlString} will be used as is.
    */
   @Override
   public void collectDescriptors(String collecTorIndexUrlString,
diff --git a/src/main/java/org/torproject/descriptor/internal/FileType.java b/src/main/java/org/torproject/descriptor/internal/FileType.java
index 95acf2f..8f42624 100644
--- a/src/main/java/org/torproject/descriptor/internal/FileType.java
+++ b/src/main/java/org/torproject/descriptor/internal/FileType.java
@@ -43,7 +43,7 @@ public enum FileType {
   }
 
   /**
-   * Returns <code>valueOf</code> or the default enum {@link #PLAIN}, i.e.,
+   * Returns {@code valueOf} or the default enum {@link #PLAIN}, i.e.,
    * this method doesn't throw any exceptions and allways returns a valid enum.
    *
    * @since 2.1.0
diff --git a/src/main/java/org/torproject/descriptor/log/InternalLogDescriptor.java b/src/main/java/org/torproject/descriptor/log/InternalLogDescriptor.java
index f77536e..558f02a 100644
--- a/src/main/java/org/torproject/descriptor/log/InternalLogDescriptor.java
+++ b/src/main/java/org/torproject/descriptor/log/InternalLogDescriptor.java
@@ -24,7 +24,7 @@ public interface InternalLogDescriptor extends LogDescriptor {
   void validate() throws DescriptorParseException;
 
   /**
-   * Set the <code>Validator</code> that will perform the validation on log
+   * Set the {@code Validator} that will perform the validation on log
    * lines.
    *
    * <p>Usually set by the implementing class.</p>





More information about the tor-commits mailing list