Elffuss BraidHub

kikocis/java-driver public

Remove use of MathJax from javadocs, update guava javadoc link

Motivation:

In Java 8 update 121 javadoc is now more strict about including script
tags in comments, headers, etc.  A new option --allow-script-in-comments
was added to allow this, but it does not support older versions of JDK
8.  Limitations in maven make it difficult to selectively inject options
based on JDK update versions.  Since we only use script tags for MathJax
in one method (LatencyAwarePolicy.Builder.withScale) we opted to remove
our use of MathJax and use {@code} instead.

Modifications:

Remove MathJax from javadoc header.

Remove javascript that changed link target based on URL.

Update LatencyAwarePolicy.Builder.withScale to use {@code} instead of
LateX.

Update guava javadoc link.

Result:

Build now works with Java 8 Update 121+.
Changesetb12ffa01555ed0c44d8ef8e1ef39855304f723b90f70e627e214feb858d01a6f
AuthorAndrew Tolbert <andrew.tolbert@datastax.com> · 2017-02-24 11:11 -06:00
CommitterAndrew Tolbert <andrew.tolbert@datastax.com> · 2017-02-24 11:20 -06:00
Parentsad0999b1ea9c

Browse the files at this changeset

2 files changed

modified driver-core/src/main/java/com/datastax/driver/core/policies/LatencyAwarePolicy.java +9 −11
@@ -589,18 +589,16 @@
589589 * Sets the scale to use for the resulting latency aware policy.
590590 * <p/>
591591 * The {@code scale} provides control on how the weight given to older latencies
592- * decreases over time. For a given host, if a new latency \(l\) is received at
593- * time \(t\), and the previously calculated average is \(prev\) calculated at
594- * time \(t'\), then the newly calculated average \(avg\) for that host is calculated
592+ * decreases over time. For a given host, if a new latency {@code l} is received at
593+ * time {@code t}, and the previously calculated average is {@code prev} calculated at
594+ * time {@code t'}, then the newly calculated average {@code avg} for that host is calculated
595595 * thusly:
596- * \[
597- * d = \frac{t - t'}{scale} \\
598- * \alpha = 1 - \left(\frac{\ln(d+1)}{d}\right) \\
599- * avg = \alpha * l + (1-\alpha) * prev
600- * \]
596+ * <pre>{@code d = (t - t') / scale
597+ * alpha = 1 - (ln(d+1) / d)
598+ * avg = alpha * l + (1 - alpha * prev)}</pre>
601599 * Typically, with a {@code scale} of 100 milliseconds (the default), if a new
602- * latency is measured and the previous measure is 10 millisecond old (so \(d=0.1\)),
603- * then \(\alpha\) will be around \(0.05\). In other words, the new latency will
600+ * latency is measured and the previous measure is 10 millisecond old (so {@code d=0.1}),
601+ * then {@code alpha} will be around {@code 0.05}. In other words, the new latency will
604602 * weight 5% of the updated average. A bigger scale will get less weight to new
605603 * measurements (compared to previous ones), a smaller one will give them more weight.
606604 * <p/>
@@ -612,7 +610,7 @@
612610 * @param scale the scale to use.
613611 * @param unit the unit of {@code scale}.
614612 * @return this builder.
615- * @throws IllegalArgumentException if {@code scale &lte; 0}.
613+ * @throws IllegalArgumentException if {@code scale <= 0}.
616614 */
617615 public Builder withScale(long scale, TimeUnit unit) {
618616 if (scale <= 0)
modified pom.xml +1 −15
@@ -228,23 +228,9 @@
228228 <configuration>
229229 <verbose>false</verbose>
230230 <additionalparam>${javadoc.opts}</additionalparam>
231- <!-- I can haz math in my javadoc (see http://zverovich.net/2012/01/14/beautiful-math-in-javadoc.html) -->
232- <header>
233- &lt;script type="text/javascript"
234- src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"&gt;&lt;/script&gt;
235- </header>
236- <!-- open external links in a separate window -->
237- <bottom>
238- &lt;script type="text/javascript"&gt;
239- for(var i in document.links) {
240- var link = document.links[i];
241- if (link.href.indexOf('is-external=true') != -1) link.target = '_blank';
242- }
243- &lt;/script&gt;
244- </bottom>
245231 <links>
246232 <link>https://docs.oracle.com/javase/8/docs/api/</link>
247- <link>http://docs.guava-libraries.googlecode.com/git-history/v16.0.1/javadoc/</link>
233+ <link>http://google.github.io/guava/releases/16.0.1/api/docs/</link>
248234 <link>http://netty.io/4.0/api/</link>
249235 <!-- dependencies from driver-extras -->
250236 <link>http://www.joda.org/joda-time/apidocs/</link>