You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2017/01/17 11:50:22 UTC
svn commit: r1779174 [2/4] - in
/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis: io/ math/
measure/ setup/ util/ util/collection/ util/iso/ util/logging/
util/resources/ xml/
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/math/Statistics.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/math/Statistics.java?rev=1779174&r1=1779173&r2=1779174&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/math/Statistics.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/math/Statistics.java [UTF-8] Tue Jan 17 11:50:21 2017
@@ -16,6 +16,7 @@
*/
package org.apache.sis.math;
+import java.util.Objects;
import java.io.Serializable;
import org.opengis.util.InternationalString;
import org.apache.sis.util.ArgumentChecks;
@@ -27,7 +28,6 @@ import static java.lang.Double.isNaN;
import static java.lang.Double.doubleToLongBits;
// Branch-dependent imports
-import java.util.Objects;
import java.util.function.LongConsumer;
import java.util.function.DoubleConsumer;
@@ -157,9 +157,9 @@ public class Statistics implements Doubl
* If differences or discrete derivatives are wanted, use the {@link #forSeries forSeries(\u2026)}
* method instead.</p>
*
- * @param name The phenomenon for which this object is collecting statistics, or {@code null}
- * if none. If non-null, then this name will be shown as column header in the table
- * formatted by {@link StatisticsFormat}.
+ * @param name the phenomenon for which this object is collecting statistics, or {@code null}
+ * if none. If non-null, then this name will be shown as column header in the table
+ * formatted by {@link StatisticsFormat}.
*/
public Statistics(final CharSequence name) {
this.name = Types.toInternationalString(name);
@@ -196,12 +196,12 @@ public class Statistics implements Doubl
*
*
*
- * @param name The phenomenon for which this object is collecting statistics, or {@code null}
+ * @param name the phenomenon for which this object is collecting statistics, or {@code null}
* if none. If non-null, then this name will be shown as column header in the table
* formatted by {@link StatisticsFormat}.
- * @param differenceNames The names of the statistics on differences.
+ * @param differenceNames the names of the statistics on differences.
* The given array can not be null, but can contain null elements.
- * @return The newly constructed, initially empty, set of statistics.
+ * @return the newly constructed, initially empty, set of statistics.
*
* @see #differences()
*/
@@ -220,7 +220,7 @@ public class Statistics implements Doubl
* If non-null, then this name will be shown as column header in the table formatted
* by {@link StatisticsFormat}.
*
- * @return The phenomenon for which this object is collecting statistics, or {@code null} if none.
+ * @return the phenomenon for which this object is collecting statistics, or {@code null} if none.
*/
public InternationalString name() {
return name;
@@ -247,7 +247,7 @@ public class Statistics implements Doubl
* {@link Double#NaN NaN} values increment the {@linkplain #countNaN() NaN count},
* but are otherwise ignored.
*
- * @param sample The sample value (may be NaN).
+ * @param sample the sample value (may be NaN).
*
* @see #accept(long)
* @see #combine(Statistics)
@@ -265,13 +265,16 @@ public class Statistics implements Doubl
* Implementation of {@link #accept(double)} for real (non-NaN) numbers.
*/
private void real(double sample) {
- // Two next lines use !(a >= b) instead than
- // (a < b) in order to take NaN in account.
+ /*
+ * Two next lines use !(a >= b) instead than
+ * (a < b) in order to take NaN in account.
+ */
if (!(minimum <= sample)) minimum = sample;
if (!(maximum >= sample)) maximum = sample;
-
- // According algebraic laws, lowBits should always been zero. But it is
- // not when using floating points with limited precision. Do not simplify!
+ /*
+ * According algebraic laws, 'lowBits' should always been zero. But it is
+ * not when using floating points with limited precision. Do not simplify!
+ */
double y = sample + lowBits;
lowBits = y + (sum - (sum += y));
@@ -287,7 +290,7 @@ public class Statistics implements Doubl
* For very large integer values (greater than 2<sup>52</sup> in magnitude),
* this method may be more accurate than the {@link #accept(double)} version.
*
- * @param sample The sample value.
+ * @param sample the sample value.
*
* @see #accept(double)
* @see #combine(Statistics)
@@ -302,7 +305,7 @@ public class Statistics implements Doubl
* Invoking this method is equivalent (except for rounding errors) to invoking
* {@link #accept(double) accept(\u2026)} for all samples that were added to {@code stats}.
*
- * @param stats The statistics to be added to {@code this}.
+ * @param stats the statistics to be added to {@code this}.
*/
public void combine(final Statistics stats) {
ArgumentChecks.ensureNonNull("stats", stats);
@@ -331,7 +334,7 @@ public class Statistics implements Doubl
* sample values. See {@link #differences()} or {@link #forSeries forSeries(\u2026)} for more
* information.</p>
*
- * @param factor The factor by which to multiply the statistics.
+ * @param factor the factor by which to multiply the statistics.
*/
public void scale(double factor) {
ArgumentChecks.ensureFinite("factor", factor);
@@ -356,16 +359,16 @@ public class Statistics implements Doubl
* {@code NaN} samples are ignored in all other statistical computation.
* This method count them for information purpose only.
*
- * @return The number of NaN values.
+ * @return the number of NaN values.
*/
public int countNaN() {
- return max(countNaN, 0); // The Delta subclass initializes countNaN to -1.
+ return max(countNaN, 0); // The Delta subclass initializes countNaN to -1.
}
/**
* Returns the number of samples, excluding {@link Double#NaN NaN} values.
*
- * @return The number of sample values, excluding NaN.
+ * @return the number of sample values, excluding NaN.
*/
public int count() {
return count;
@@ -374,7 +377,7 @@ public class Statistics implements Doubl
/**
* Returns the minimum sample value, or {@link Double#NaN NaN} if none.
*
- * @return The minimum sample value, or NaN if none.
+ * @return the minimum sample value, or NaN if none.
*/
public double minimum() {
return minimum;
@@ -383,7 +386,7 @@ public class Statistics implements Doubl
/**
* Returns the maximum sample value, or {@link Double#NaN NaN} if none.
*
- * @return The maximum sample value, or NaN if none.
+ * @return the maximum sample value, or NaN if none.
*/
public double maximum() {
return maximum;
@@ -393,7 +396,7 @@ public class Statistics implements Doubl
* Equivalents to <code>{@link #maximum() maximum} - {@link #minimum() minimum}</code>.
* If no samples were added, then returns {@link Double#NaN NaN}.
*
- * @return The span of sample values, or NaN if none.
+ * @return the span of sample values, or NaN if none.
*/
public double span() {
return maximum - minimum;
@@ -402,7 +405,7 @@ public class Statistics implements Doubl
/**
* Returns the sum, or 0 if none.
*
- * @return The sum, or 0 if none.
+ * @return the sum, or 0 if none.
*/
public double sum() {
return sum;
@@ -411,7 +414,7 @@ public class Statistics implements Doubl
/**
* Returns the mean value, or {@link Double#NaN NaN} if none.
*
- * @return The mean value, or NaN if none.
+ * @return the mean value, or NaN if none.
*/
public double mean() {
return sum / count;
@@ -420,7 +423,7 @@ public class Statistics implements Doubl
/**
* Returns the root mean square, or {@link Double#NaN NaN} if none.
*
- * @return The root mean square, or NaN if none.
+ * @return the root mean square, or NaN if none.
*/
public double rms() {
return sqrt(squareSum / count);
@@ -448,10 +451,9 @@ public class Statistics implements Doubl
* <tr><td>3.0</td><td>99.9%</td><td>100%</td></tr>
* </table>
*
- * @param allPopulation
- * {@code true} if sample values given to {@code accept(\u2026)} methods were the totality
- * of the population under study, or {@code false} if they were only a sampling.
- * @return The standard deviation.
+ * @param allPopulation {@code true} if sample values given to {@code accept(\u2026)} methods were the totality
+ * of the population under study, or {@code false} if they were only a sampling.
+ * @return the standard deviation.
*/
public double standardDeviation(final boolean allPopulation) {
return sqrt((squareSum - sum*sum/count) / (allPopulation ? count : count-1));
@@ -479,7 +481,7 @@ public class Statistics implements Doubl
* More generally, calls to this method can be chained up to {@code differenceNames.length} times for
* fetching second or higher order derivatives, as in the above example.
*
- * @return The statistics on the differences between consecutive sample values,
+ * @return the statistics on the differences between consecutive sample values,
* or {@code null} if not calculated by this object.
*
* @see #forSeries(CharSequence, CharSequence[])
@@ -502,7 +504,7 @@ public class Statistics implements Doubl
* Standard deviation: 6.489
* }
*
- * @return A string representation of this statistics object.
+ * @return a string representation of this statistics object.
*
* @see StatisticsFormat
*/
@@ -514,7 +516,7 @@ public class Statistics implements Doubl
/**
* Returns a clone of this statistics.
*
- * @return A clone of this statistics.
+ * @return a clone of this statistics.
*/
@Override
public Statistics clone() {
@@ -541,7 +543,7 @@ public class Statistics implements Doubl
/**
* Compares this statistics with the specified object for equality.
*
- * @param object The object to compare with.
+ * @param object the object to compare with.
* @return {@code true} if both objects are equal.
*/
@Override
@@ -611,13 +613,13 @@ public class Statistics implements Doubl
* consecutive sample values. Other kinds of {@link Statistics} object could be
* chained as well.
*
- * @param name The phenomenon for which this object is collecting statistics, or {@code null}.
- * @param delta The object where to stores delta statistics.
+ * @param name the phenomenon for which this object is collecting statistics, or {@code null}.
+ * @param delta the object where to stores delta statistics.
*/
WithDelta(final CharSequence name, final Statistics delta) {
super(name);
this.delta = delta;
- delta.decrementCountNaN(); // Do not count the first NaN, which will always be the first value.
+ delta.decrementCountNaN(); // Do not count the first NaN, which will always be the first value.
}
/**
@@ -627,7 +629,7 @@ public class Statistics implements Doubl
public void reset() {
super.reset();
delta.reset();
- delta.decrementCountNaN(); // Do not count the first NaN, which will always be the first value.
+ delta.decrementCountNaN(); // Do not count the first NaN, which will always be the first value.
last = NaN;
lastAsLong = 0;
}
@@ -654,12 +656,16 @@ public class Statistics implements Doubl
public void accept(final long sample) {
super.accept(sample);
if (last == (double) lastAsLong) {
- // 'lastAsLong' may have more precision than 'last' since the cast to the
- // 'double' type may loose some digits. Invoke the 'delta.accept(long)' version.
+ /*
+ * 'lastAsLong' may have more precision than 'last' since the cast to the
+ * 'double' type may loose some digits. Invoke the 'delta.accept(long)' version.
+ */
delta.accept(sample - lastAsLong);
} else {
- // The sample value is either fractional, outside 'long' range,
- // infinity or NaN. Invoke the 'delta.accept(double)' version.
+ /*
+ * The sample value is either fractional, outside 'long' range,
+ * infinity or NaN. Invoke the 'delta.accept(double)' version.
+ */
delta.accept(sample - last);
}
last = sample;
@@ -669,8 +675,7 @@ public class Statistics implements Doubl
/**
* Update statistics with all samples from the specified {@code stats}.
*
- * @throws ClassCastException If {@code stats} is not an instance of
- * {@code Statistics.Delta}.
+ * @throws ClassCastException if {@code stats} is not an instance of {@code Statistics.Delta}.
*/
@Override
public void combine(final Statistics stats) throws ClassCastException {
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/math/StatisticsFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/math/StatisticsFormat.java?rev=1779174&r1=1779173&r2=1779174&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/math/StatisticsFormat.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/math/StatisticsFormat.java [UTF-8] Tue Jan 17 11:50:21 2017
@@ -51,6 +51,7 @@ import static java.lang.Math.*;
* @version 0.3
* @module
*/
+@SuppressWarnings("CloneableClassWithoutClone") // Because this class does not contain field that need to be cloned.
public class StatisticsFormat extends TabularFormat<Statistics> {
/**
* For cross-version compatibility.
@@ -90,7 +91,7 @@ public class StatisticsFormat extends Ta
/**
* Returns an instance for the current system default locale.
*
- * @return A statistics format instance for the current default locale.
+ * @return a statistics format instance for the current default locale.
*/
public static StatisticsFormat getInstance() {
return new StatisticsFormat(
@@ -101,8 +102,8 @@ public class StatisticsFormat extends Ta
/**
* Returns an instance for the given locale.
*
- * @param locale The locale for which to get a {@code StatisticsFormat} instance.
- * @return A statistics format instance for the given locale.
+ * @param locale the locale for which to get a {@code StatisticsFormat} instance.
+ * @return a statistics format instance for the given locale.
*/
public static StatisticsFormat getInstance(final Locale locale) {
return new StatisticsFormat(locale, locale, null);
@@ -112,10 +113,10 @@ public class StatisticsFormat extends Ta
* Constructs a new format for the given numeric and header locales.
* The timezone is used only if the values added to the {@link Statistics} are dates.
*
- * @param locale The locale to use for numbers, dates and angles formatting,
- * or {@code null} for the {@linkplain Locale#ROOT root locale}.
- * @param headerLocale The locale for row and column headers. Usually same as {@code locale}.
- * @param timezone The timezone, or {@code null} for UTC.
+ * @param locale the locale to use for numbers, dates and angles formatting,
+ * or {@code null} for the {@linkplain Locale#ROOT root locale}.
+ * @param headerLocale the locale for row and column headers. Usually same as {@code locale}.
+ * @param timezone the timezone, or {@code null} for UTC.
*/
public StatisticsFormat(final Locale locale, final Locale headerLocale, final TimeZone timezone) {
super(locale, timezone);
@@ -131,8 +132,8 @@ public class StatisticsFormat extends Ta
* used for all values below the header row.</li>
* </ul>
*
- * @param category The category for which a locale is desired.
- * @return The locale for the given category (never {@code null}).
+ * @param category the category for which a locale is desired.
+ * @return the locale for the given category (never {@code null}).
*
* @since 0.4
*/
@@ -172,8 +173,8 @@ public class StatisticsFormat extends Ta
* Sets whether this formatter shall consider that the statistics where computed using
* the totality of the populations under study. The default value is {@code false}.
*
- * @param allPopulation {@code true} if the statistics to format where computed
- * using the totality of the populations under study.
+ * @param allPopulation {@code true} if the statistics to format where computed using
+ * the totality of the populations under study.
*
* @see Statistics#standardDeviation(boolean)
*/
@@ -185,7 +186,7 @@ public class StatisticsFormat extends Ta
* Returns the "width" of the border to drawn around the table, in number of lines.
* The default width is 0, which stands for no border.
*
- * @return The border "width" in number of lines.
+ * @return the border "width" in number of lines.
*/
public int getBorderWidth() {
return borderWidth;
@@ -201,7 +202,7 @@ public class StatisticsFormat extends Ta
* <li>2 for double lines ({@code \u2551},{@code \u2550})</li>
* </ul>
*
- * @param borderWidth The border width, in number of lines.
+ * @param borderWidth the border width, in number of lines.
*/
public void setBorderWidth(final int borderWidth) {
ArgumentChecks.ensureBetween("borderWidth", 0, 2, borderWidth);
@@ -211,8 +212,8 @@ public class StatisticsFormat extends Ta
/**
* Not yet implemented.
*
- * @return Currently never return.
- * @throws ParseException Currently never thrown.
+ * @return currently never return.
+ * @throws ParseException currently never thrown.
*/
@Override
public Statistics parse(CharSequence text, ParsePosition pos) throws ParseException {
@@ -228,10 +229,10 @@ public class StatisticsFormat extends Ta
* <li>{@link #format(Statistics[], Appendable)}</li>
* </ul>
*
- * @param object The object to format.
- * @param toAppendTo Where to format the object.
- * @param pos Ignored in current implementation.
- * @return The given buffer, returned for convenience.
+ * @param object the object to format.
+ * @param toAppendTo where to format the object.
+ * @param pos ignored in current implementation.
+ * @return the given buffer, returned for convenience.
*/
@Override
public StringBuffer format(final Object object, final StringBuffer toAppendTo, final FieldPosition pos) {
@@ -251,9 +252,9 @@ public class StatisticsFormat extends Ta
* If statistics on {@linkplain Statistics#differences() differences}
* are associated to the given object, they will be formatted too.
*
- * @param stats The statistics to format.
- * @param toAppendTo Where to format the statistics.
- * @throws IOException If an error occurred while writing to the given appendable.
+ * @param stats the statistics to format.
+ * @param toAppendTo where to format the statistics.
+ * @throws IOException if an error occurred while writing to the given appendable.
*/
@Override
public void format(Statistics stats, final Appendable toAppendTo) throws IOException {
@@ -270,9 +271,9 @@ public class StatisticsFormat extends Ta
* for the statistics on {@linkplain Statistics#differences() differences} - if
* such statistics are wanted, they must be included in the given array.
*
- * @param stats The statistics to format.
- * @param toAppendTo Where to format the statistics.
- * @throws IOException If an error occurred while writing to the given appendable.
+ * @param stats the statistics to format.
+ * @param toAppendTo where to format the statistics.
+ * @throws IOException if an error occurred while writing to the given appendable.
*/
public void format(final Statistics[] stats, final Appendable toAppendTo) throws IOException {
/*
@@ -326,7 +327,7 @@ public class StatisticsFormat extends Ta
*/
final Format format = getFormat(Double.class);
if (format instanceof DecimalFormat) {
- ((DecimalFormat) format).applyPattern("#0"); // Also disable scientific notation.
+ ((DecimalFormat) format).applyPattern("#0"); // Also disable scientific notation.
} else if (format instanceof NumberFormat) {
setFractionDigits((NumberFormat) format, 0);
}
@@ -400,8 +401,8 @@ public class StatisticsFormat extends Ta
* their standard deviation. It can be used for reasonable default formatting when the user
* didn't specify an explicit one.
*
- * @param format The formatter to configure.
- * @param stats The statistics for which to configure the formatter.
+ * @param format the formatter to configure.
+ * @param stats the statistics for which to configure the formatter.
*/
private void configure(final Format format, final Statistics stats) {
final double minimum = stats.minimum();
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/AngleFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/AngleFormat.java?rev=1779174&r1=1779173&r2=1779174&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/AngleFormat.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/AngleFormat.java [UTF-8] Tue Jan 17 11:50:21 2017
@@ -431,8 +431,8 @@ public class AngleFormat extends Format
* Constructs a new {@code AngleFormat} using the specified pattern and locale.
*
* @param pattern the pattern to use for parsing and formatting angles.
- * See class description for an explanation of pattern syntax.
- * @param locale Locale to use.
+ * See class description for an explanation of pattern syntax.
+ * @param locale the locale to use.
* @throws IllegalArgumentException if the specified pattern is illegal.
*/
public AngleFormat(final String pattern, final Locale locale) throws IllegalArgumentException {
@@ -698,7 +698,7 @@ public class AngleFormat extends Format
buffer.appendCodePoint(symbols[OPTIONAL_FIELD]);
}
if (width <= 0) {
- break; // The "if" case above has been executed for writing the fractional part, so we are done.
+ break; // The "if" case above has been executed for writing the fractional part, so we are done.
}
/*
* This is the main part of the loop, before the final fractional part handled in the above "if" case.
@@ -940,9 +940,11 @@ public class AngleFormat extends Format
minutes = 0;
degrees += Math.signum(angle);
}
- // Note: a previous version was doing a unconditional addition to the 'degrees' variable,
- // in the form 'degrees += correction'. However -0.0 + 0 == +0.0, while we really need to
- // preserve the sign of negative zero. See [SIS-120].
+ /*
+ * Note: a previous version was doing a unconditional addition to the 'degrees' variable,
+ * in the form 'degrees += correction'. However -0.0 + 0 == +0.0, while we really need to
+ * preserve the sign of negative zero. See [SIS-120].
+ */
}
/*
* Avoid formatting values like 12.01�N as 12�36\u2033N because of the risk of confusion.
@@ -1038,9 +1040,11 @@ public class AngleFormat extends Format
if (hasMore) {
userObject = Math.toIntExact(Math.round(value));
} else {
- // Use Float instead of Double because we don't want to give a false impression of accuracy
- // (when formatting the seconds field, at least the 10 last bits of the 'double' value are
- // non-significant).
+ /*
+ * Use Float instead of Double because we don't want to give a false impression of accuracy
+ * (when formatting the seconds field, at least the 10 last bits of the 'double' value are
+ * non-significant).
+ */
userObject = (float) value;
}
it.addFieldLimit(Field.forCode(field), userObject, startPosition);
@@ -1593,7 +1597,7 @@ BigBoss: switch (skipSuffix(source, p
double facteur = pow10(secondsFieldWidth);
if (degreesSuffix == null && minutesFieldWidth != 0 && isNaN(minutes)) {
///////////////////
- //// DDDMMSS.s ////
+ // DDDMMSS.s //
///////////////////
seconds = degrees;
minutes = truncate(degrees / facteur);
@@ -1603,7 +1607,7 @@ BigBoss: switch (skipSuffix(source, p
minutes -= degrees * facteur;
} else {
////////////////////
- //// DDD�MMSS.s ////
+ // DDD�MMSS.s //
////////////////////
seconds = minutes;
minutes = truncate(minutes / facteur);
@@ -1611,7 +1615,7 @@ BigBoss: switch (skipSuffix(source, p
}
} else if (degreesSuffix == null && minutesFieldWidth != 0 && isNaN(minutes)) {
/////////////////
- //// DDDMM.m ////
+ // DDDMM.m //
/////////////////
final double facteur = pow10(minutesFieldWidth);
minutes = degrees;
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/ElevationAngle.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/ElevationAngle.java?rev=1779174&r1=1779173&r2=1779174&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/ElevationAngle.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/ElevationAngle.java [UTF-8] Tue Jan 17 11:50:21 2017
@@ -16,7 +16,7 @@
*/
package org.apache.sis.measure;
-import org.opengis.referencing.cs.AxisDirection; // For javadoc
+import org.opengis.referencing.cs.AxisDirection; // For javadoc
/**
@@ -60,7 +60,7 @@ public final class ElevationAngle extend
/**
* Constructs a new elevation angle with the specified angular value.
*
- * @param \u03b5 Elevation angle value in decimal degrees.
+ * @param \u03b5 elevation angle value in decimal degrees.
*/
public ElevationAngle(final double \u03b5) {
super(\u03b5);
@@ -71,7 +71,7 @@ public final class ElevationAngle extend
* represented by the string. The string should represent an angle in either fractional degrees
* (e.g. 45.5�) or degrees with minutes and seconds (e.g. 45�30').
*
- * @param string A string to be converted to an {@code ElevationAngle}.
+ * @param string a string to be converted to an {@code ElevationAngle}.
* @throws NumberFormatException if the string does not contain a parsable angle,
* or represents an elevation angle.
*/
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/FormatField.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/FormatField.java?rev=1779174&r1=1779173&r2=1779174&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/FormatField.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/FormatField.java [UTF-8] Tue Jan 17 11:50:21 2017
@@ -50,8 +50,8 @@ class FormatField extends Format.Field {
/**
* Creates a new field of the given name.
*
- * @param name The name, which shall be identical to the name of the public static constant.
- * @param field The numeric identifier of this field.
+ * @param name the name, which shall be identical to the name of the public static constant.
+ * @param field the numeric identifier of this field.
*/
FormatField(final String name, final int field) {
super(name);
@@ -61,7 +61,7 @@ class FormatField extends Format.Field {
/**
* Invoked on deserialization for resolving this instance to one of the predefined constants.
*
- * @return One of the predefined constants.
+ * @return one of the predefined constants.
* @throws InvalidObjectException if this instance can not be resolved.
*/
@Override
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/FormattedCharacterIterator.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/FormattedCharacterIterator.java?rev=1779174&r1=1779173&r2=1779174&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/FormattedCharacterIterator.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/FormattedCharacterIterator.java [UTF-8] Tue Jan 17 11:50:21 2017
@@ -51,6 +51,7 @@ import org.apache.sis.internal.simple.Si
* @version 0.3
* @module
*/
+@SuppressWarnings("CloneableClassWithoutClone") // Not needed - see comment about clone() at the end of this file.
final class FormattedCharacterIterator extends SimpleCharacterIterator implements AttributedCharacterIterator {
/**
* For cross-version compatibility.
@@ -80,7 +81,7 @@ final class FormattedCharacterIterator e
* <li>{@link #limit} is 3.</li>
* </ul>
*/
- private static final class Entry {
+ private static final class Entry implements Serializable {
/**
* For cross-version compatibility.
*/
@@ -106,6 +107,7 @@ final class FormattedCharacterIterator e
* Creates a new entry for the given value, together with the range of index where
* the field value has been formatted. See class javadoc for more information.
*/
+ @SuppressWarnings("ThisEscapedInObjectConstruction")
Entry(final Attribute field, final Object value, final int start, final int limit,
final Map<Attribute,Entry> attributes)
{
@@ -151,7 +153,7 @@ final class FormattedCharacterIterator e
/**
* Creates a new character iterator for the given character sequence.
*
- * @param text The formatted text. Can be a {@link StringBuilder} to be filled later.
+ * @param text the formatted text. Can be a {@link StringBuilder} to be filled later.
*/
FormattedCharacterIterator(final CharSequence text) {
super(text);
@@ -164,20 +166,22 @@ final class FormattedCharacterIterator e
* {@linkplain #text} length, exclusive.
*/
final void addFieldLimit(final Attribute field, final Object value, final int start) {
- // The Entry constructor adds itself to the attributes map.
- // The returned intance is used only for assertions checks.
+ /*
+ * The Entry constructor adds itself to the attributes map.
+ * The returned intance is used only for assertions checks.
+ */
Entry e = new Entry(field, value, start, upper = text.length(), attributes);
- assert ((e = e.previous) == null) || (start >= e.limit); // Check for non-overlapping fields.
+ assert ((e = e.previous) == null) || (start >= e.limit); // Check for non-overlapping fields.
}
/**
* Appends all characters and attributes from the given iterator.
*
- * @param toAppendTo Shall be the same instance than {@link #text}.
+ * @param toAppendTo shall be the same instance than {@link #text}.
*/
final void append(final AttributedCharacterIterator it, final StringBuffer toAppendTo) {
final int offset = toAppendTo.length();
- int currentRunLimit = 0; // Next index where to check for attributes.
+ int currentRunLimit = 0; // Next index where to check for attributes.
for (char c=it.first(); c!=DONE; c=it.next()) {
toAppendTo.append(c);
if (it.getIndex() == currentRunLimit) {
@@ -185,9 +189,9 @@ final class FormattedCharacterIterator e
for (final Map.Entry<Attribute,Object> entry : it.getAttributes().entrySet()) {
final Attribute attribute = entry.getKey();
if (it.getRunLimit(attribute) == currentRunLimit) {
- new Entry(attribute, entry.getValue(), // Constructeur adds itself to the map.
- offset + it.getRunStart(attribute),
- offset + currentRunLimit, attributes);
+ final Entry e = new Entry(attribute, entry.getValue(), // Constructeur adds itself to the map.
+ offset + it.getRunStart(attribute),
+ offset + currentRunLimit, attributes);
}
}
}
@@ -199,9 +203,9 @@ final class FormattedCharacterIterator e
* Ensures that the {@link #start}, {@link #limit} and {@link #attributes} fields
* are valid for the current index position and the given attribute.
*
- * @param attribute The attribute which shall have the same value in the run range.
- * @param entries The entries on which to iterate for computing the run range.
- * Mandatory if {@code attribute} is {@code null}.
+ * @param attribute the attribute which shall have the same value in the run range.
+ * @param entries the entries on which to iterate for computing the run range.
+ * Mandatory if {@code attribute} is {@code null}.
*/
private void update(final Attribute attribute, Collection<Entry> entries) {
final int index = getIndex();
@@ -405,7 +409,7 @@ final class FormattedCharacterIterator e
@Override
public Object getAttribute(final Attribute attribute) {
final int index = getIndex();
- for (Entry e=attributes.get(attribute); e!=null; e=e.previous) {
+ for (Entry e = attributes.get(attribute); e != null; e = e.previous) {
if (index >= e.start && index < e.limit) {
return e.value;
}
@@ -417,6 +421,7 @@ final class FormattedCharacterIterator e
* Returns the keys of all attributes defined in the iterator text range.
*/
@Override
+ @SuppressWarnings("ReturnOfCollectionOrArrayField") // Safe because immutable.
public Set<Attribute> getAllAttributeKeys() {
if (attributeKeys == null) {
attributeKeys = Collections.unmodifiableSet(attributes.keySet());
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/Latitude.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/Latitude.java?rev=1779174&r1=1779173&r2=1779174&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/Latitude.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/Latitude.java [UTF-8] Tue Jan 17 11:50:21 2017
@@ -76,7 +76,7 @@ public final class Latitude extends Angl
/**
* Construct a new latitude with the specified angular value.
*
- * @param \u03c6 Latitude value in decimal degrees.
+ * @param \u03c6 latitude value in decimal degrees.
*/
public Latitude(final double \u03c6) {
super(\u03c6);
@@ -92,7 +92,7 @@ public final class Latitude extends Angl
* locale. Developers should consider using {@link AngleFormat} for end-user applications
* instead than this constructor.</p>
*
- * @param string A string to be converted to a {@code Latitude}.
+ * @param string a string to be converted to a {@code Latitude}.
* @throws NumberFormatException if the string does not contain a parsable angle,
* or represents a longitude angle.
*
@@ -132,8 +132,8 @@ public final class Latitude extends Angl
* <li>�0 are returned unchanged (i.e. the sign of negative and positive zero is preserved)</li>
* </ul>
*
- * @param \u03c6 The latitude value in decimal degrees.
- * @return The given value clamped to the [-90 \u2026 90]� range, or NaN if the given value was NaN.
+ * @param \u03c6 the latitude value in decimal degrees.
+ * @return the given value clamped to the [-90 \u2026 90]� range, or NaN if the given value was NaN.
*
* @see Longitude#normalize(double)
*
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/Longitude.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/Longitude.java?rev=1779174&r1=1779173&r2=1779174&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/Longitude.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/Longitude.java [UTF-8] Tue Jan 17 11:50:21 2017
@@ -62,7 +62,7 @@ public final class Longitude extends Ang
* Construct a new longitude with the specified angular value.
* This constructor does <strong>not</strong> {@linkplain #normalize(double) normalize} the given value.
*
- * @param \u03bb Longitude value in decimal degrees.
+ * @param \u03bb longitude value in decimal degrees.
*/
public Longitude(final double \u03bb) {
super(\u03bb);
@@ -78,7 +78,7 @@ public final class Longitude extends Ang
* locale. Developers should consider using {@link AngleFormat} for end-user applications
* instead than this constructor.</p>
*
- * @param string A string to be converted to a {@code Longitude}.
+ * @param string a string to be converted to a {@code Longitude}.
* @throws NumberFormatException if the string does not contain a parsable angle,
* or represents a longitude angle.
*
@@ -112,8 +112,8 @@ public final class Longitude extends Ang
*
* Note that the given value should not be greater than 4�10\u2078 degrees if a centimetric precision is desired.
*
- * @param \u03bb The longitude value in decimal degrees.
- * @return The given value normalized to the [-180 \u2026 180)� range, or NaN if the given value was NaN of infinite.
+ * @param \u03bb the longitude value in decimal degrees.
+ * @return the given value normalized to the [-180 \u2026 180)� range, or NaN if the given value was NaN of infinite.
*
* @see Latitude#clamp(double)
*
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/NumberRange.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/NumberRange.java?rev=1779174&r1=1779173&r2=1779174&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/NumberRange.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/NumberRange.java [UTF-8] Tue Jan 17 11:50:21 2017
@@ -608,7 +608,7 @@ public class NumberRange<E extends Numbe
* then delegates to {@link #intersect(Range)}.
*
* @param range the range to add to this range.
- * @return The union of this range with the given range.
+ * @return the union of this range with the given range.
* @throws IllegalArgumentException if the given range can not be converted to a valid type
* through widening conversion, or if the units of measurement are not convertible.
*/
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/Range.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/Range.java?rev=1779174&r1=1779173&r2=1779174&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/Range.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/Range.java [UTF-8] Tue Jan 17 11:50:21 2017
@@ -16,6 +16,7 @@
*/
package org.apache.sis.measure;
+import java.util.Objects;
import java.util.Formatter;
import java.util.Formattable;
import java.util.FormattableFlags;
@@ -27,9 +28,6 @@ import org.apache.sis.util.ArgumentCheck
import org.apache.sis.util.Emptiable;
import org.apache.sis.util.Numbers;
-// Branch-dependent imports
-import java.util.Objects;
-
/**
* A set of minimum and maximum values of a certain class, allowing
@@ -79,7 +77,7 @@ import java.util.Objects;
* and thus inherently thread-safe. Other subclasses may or may not be immutable, at implementation choice.
* But implementors are encouraged to make sure that all subclasses remain immutable for more predictable behavior.
*
- * @param <E> The type of range elements, typically a {@link Number} subclass or {@link java.util.Date}.
+ * @param <E> the type of range elements, typically a {@link Number} subclass or {@link java.util.Date}.
*
* @author Joe White
* @author Martin Desruisseaux (Geomatys)
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/ValueRange.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/ValueRange.java?rev=1779174&r1=1779173&r2=1779174&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/ValueRange.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/measure/ValueRange.java [UTF-8] Tue Jan 17 11:50:21 2017
@@ -83,7 +83,7 @@ public @interface ValueRange {
* {@linkplain Double#NEGATIVE_INFINITY negative infinity}, which means that
* there is no minimal value.
*
- * @return The minimal value.
+ * @return the minimal value.
*/
double minimum() default Double.NEGATIVE_INFINITY;
@@ -100,7 +100,7 @@ public @interface ValueRange {
* {@linkplain Double#POSITIVE_INFINITY positive infinity}, which means that
* there is no maximal value.
*
- * @return The maximal value.
+ * @return the maximal value.
*/
double maximum() default Double.POSITIVE_INFINITY;
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/setup/InstallationResources.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/setup/InstallationResources.java?rev=1779174&r1=1779173&r2=1779174&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/setup/InstallationResources.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/setup/InstallationResources.java [UTF-8] Tue Jan 17 11:50:21 2017
@@ -76,7 +76,7 @@ public abstract class InstallationResour
* This method may return an empty set if this {@code InstallationResources} instance did not find the
* resources (for example because of files not found) or does not have the permission to distribute them.
*
- * @return Identifiers of resources that this instance can distribute.
+ * @return identifiers of resources that this instance can distribute.
*/
public abstract Set<String> getAuthorities();
@@ -89,10 +89,10 @@ public abstract class InstallationResour
* <a href="http://www.epsg.org/TermsOfUse">http://www.epsg.org/TermsOfUse</a> page.
* </div>
*
- * @param authority One of the values returned by {@link #getAuthorities()}.
- * @param locale The preferred locale for the terms of use.
- * @param mimeType Either {@code "text/plain"} or {@code "text/html"}.
- * @return The terms of use in plain text or HTML, or {@code null} if none.
+ * @param authority one of the values returned by {@link #getAuthorities()}.
+ * @param locale the preferred locale for the terms of use.
+ * @param mimeType either {@code "text/plain"} or {@code "text/html"}.
+ * @return the terms of use in plain text or HTML, or {@code null} if none.
* @throws IllegalArgumentException if the given {@code authority} argument is not one of the expected values.
* @throws IOException if an error occurred while reading the license file.
*/
@@ -108,8 +108,8 @@ public abstract class InstallationResour
* followed by a script that creates foreigner keys.
* </div>
*
- * @param authority One of the values returned by {@link #getAuthorities()}.
- * @return The names of all resources of the given authority that are distributed by this instance.
+ * @param authority one of the values returned by {@link #getAuthorities()}.
+ * @return the names of all resources of the given authority that are distributed by this instance.
* @throws IllegalArgumentException if the given {@code authority} argument is not one of the expected values.
* @throws IOException if fetching the resource names required an I/O operation and that operation failed.
*/
@@ -120,10 +120,10 @@ public abstract class InstallationResour
* The resource may be a SQL script or any other resources readable as a text.
* The returned {@link BufferedReader} instance shall be closed by the caller.
*
- * @param authority One of the values returned by {@link #getAuthorities()}.
- * @param resource Index of the script to open, from 0 inclusive to
+ * @param authority one of the values returned by {@link #getAuthorities()}.
+ * @param resource index of the script to open, from 0 inclusive to
* <code>{@linkplain #getResourceNames(String) getResourceNames}(authority).length</code> exclusive.
- * @return A reader for the installation script content.
+ * @return a reader for the installation script content.
* @throws IllegalArgumentException if the given {@code authority} argument is not one of the expected values.
* @throws IndexOutOfBoundsException if the given {@code resource} argument is out of bounds.
* @throws IOException if an error occurred while creating the reader.
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/ArgumentChecks.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/ArgumentChecks.java?rev=1779174&r1=1779173&r2=1779174&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/ArgumentChecks.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/ArgumentChecks.java [UTF-8] Tue Jan 17 11:50:21 2017
@@ -16,7 +16,7 @@
*/
package org.apache.sis.util;
-import java.util.Map; // For javadoc
+import java.util.Map; // For javadoc
import org.opengis.referencing.cs.CoordinateSystem;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.opengis.geometry.Envelope;
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/ArraysExt.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/ArraysExt.java?rev=1779174&r1=1779173&r2=1779174&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/ArraysExt.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/ArraysExt.java [UTF-8] Tue Jan 17 11:50:21 2017
@@ -17,12 +17,10 @@
package org.apache.sis.util;
import java.util.Arrays;
+import java.util.Objects;
import java.util.Comparator;
import java.lang.reflect.Array;
-// Branch-dependent imports
-import java.util.Objects;
-
/**
* Static methods for simple operations on arrays and array elements.
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/CharSequences.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/CharSequences.java?rev=1779174&r1=1779173&r2=1779174&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/CharSequences.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/CharSequences.java [UTF-8] Tue Jan 17 11:50:21 2017
@@ -91,16 +91,6 @@ public final class CharSequences extends
* of length 4. Strings are constructed only when first needed.
*/
private static final String[] SPACES = new String[10];
- static {
- // Our 'spaces(int)' method will invoke 'substring' on the longuest string in an attempt
- // to share the same char[] array. Note however that array sharing has been removed from
- // JDK8, which copy every char[] arrays anyway. Consequently the JDK8 branch will abandon
- // this strategy and build the char[] array on the fly.
- final int last = SPACES.length - 1;
- final char[] spaces = new char[last+1];
- Arrays.fill(spaces, ' ');
- SPACES[last] = new String(spaces).intern();
- }
/**
* Do not allow instantiation of this class.
@@ -141,10 +131,12 @@ public final class CharSequences extends
return "";
}
if (length < SPACES.length) {
- String s = SPACES[length-1];
+ String s = SPACES[length - 1];
if (s == null) {
- s = SPACES[SPACES.length - 1].substring(0, length).intern();
- SPACES[length-1] = s;
+ final char[] spaces = new char[length];
+ Arrays.fill(spaces, ' ');
+ s = new String(spaces).intern();
+ SPACES[length - 1] = s;
}
return s;
}
@@ -956,7 +948,7 @@ search: for (; fromIndex <= toIndex;
* but is overloaded for the {@code String} type because of its frequent use.</p>
*
* @param text the text from which to remove leading and trailing whitespaces, or {@code null}.
- * @return A string with leading and trailing whitespaces removed, or {@code null} is the given
+ * @return a string with leading and trailing whitespaces removed, or {@code null} is the given
* text was null.
*/
public static String trimWhitespaces(String text) {
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java?rev=1779174&r1=1779173&r2=1779174&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Classes.java [UTF-8] Tue Jan 17 11:50:21 2017
@@ -212,8 +212,10 @@ public final class Classes extends Stati
* Check if we have an array, then check the (component) class.
*/
if (type instanceof ParameterizedType) {
- // Example: replace ParameterDescriptor<?> by ParameterDescriptor
- // before we test if (type instanceof Class<?>).
+ /*
+ * Example: replace ParameterDescriptor<?> by ParameterDescriptor
+ * before we test if (type instanceof Class<?>).
+ */
type = ((ParameterizedType) type).getRawType();
}
int dimension = 0;
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/CorruptedObjectException.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/CorruptedObjectException.java?rev=1779174&r1=1779173&r2=1779174&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/CorruptedObjectException.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/CorruptedObjectException.java [UTF-8] Tue Jan 17 11:50:21 2017
@@ -78,7 +78,7 @@ public class CorruptedObjectException ex
/**
* Constructs a new exception with the specified detail message.
*
- * @param message The detail message, or {@code null} if none.
+ * @param message the detail message, or {@code null} if none.
*/
public CorruptedObjectException(final String message) {
super(message);
@@ -87,7 +87,7 @@ public class CorruptedObjectException ex
/**
* Constructs a new exception with the name of the given object.
*
- * @param object The corrupted object, or {@code null} if unknown.
+ * @param object the corrupted object, or {@code null} if unknown.
*
* @since 0.6
*/
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Locales.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Locales.java?rev=1779174&r1=1779173&r2=1779174&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Locales.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Locales.java [UTF-8] Tue Jan 17 11:50:21 2017
@@ -159,7 +159,7 @@ public final class Locales extends Stati
* ({@link #SIS}). In the later case, this method returns only the languages for which
* localized resources are provided in the {@code org.apache.sis.util.resources} package.
*
- * @return The list of supported languages.
+ * @return the list of supported languages.
*/
public Locale[] getAvailableLanguages() {
if (this == ALL) {
@@ -176,7 +176,7 @@ public final class Locales extends Stati
* ({@link #SIS}). In the later case, this method returns only the locales for which
* localized resources are provided in the {@code org.apache.sis.util.resources} package.
*
- * @return The list of supported locales.
+ * @return the list of supported locales.
*/
public Locale[] getAvailableLocales() {
if (this == ALL) {
@@ -207,8 +207,8 @@ filter: for (final Locale locale : local
* The instances returned by this method have no {@linkplain Locale#getCountry() country}
* and no {@linkplain Locale#getVariant() variant} information.
*
- * @param locales The locales from which to get the languages.
- * @return The languages, without country or variant information.
+ * @param locales the locales from which to get the languages.
+ * @return the languages, without country or variant information.
*/
private static Locale[] getLanguages(final Locale... locales) {
final Set<String> codes = new LinkedHashSet<>(hashMapCapacity(locales.length));
@@ -232,9 +232,9 @@ filter: for (final Locale locale : local
* and country codes use 2 or 3 letters. This method tries to convert 3-letters codes to 2-letters code on a
* <cite>best effort</cite> basis.</p>
*
- * @param code The language code, optionally followed by country code and variant.
- * @return The language for the given code (never {@code null}).
- * @throws IllformedLocaleException If the given code is not valid.
+ * @param code the language code, optionally followed by country code and variant.
+ * @return the language for the given code (never {@code null}).
+ * @throws IllformedLocaleException if the given code is not valid.
*
* @see Locale#forLanguageTag(String)
*/
@@ -253,10 +253,10 @@ filter: for (final Locale locale : local
* For example a dictionary may define the {@code "remarks"} property by values associated to the
* {@code "remarks_en"} and {@code "remarks_fr"} keys, for English and French locales respectively.</div>
*
- * @param code The language code, which may be followed by country code.
- * @param fromIndex Index of the first character to parse.
- * @return The language for the given code (never {@code null}).
- * @throws IllformedLocaleException If the given code is not valid.
+ * @param code the language code, which may be followed by country code.
+ * @param fromIndex index of the first character to parse.
+ * @return the language for the given code (never {@code null}).
+ * @throws IllformedLocaleException if the given code is not valid.
*
* @see Locale#forLanguageTag(String)
* @see org.apache.sis.util.iso.Types#toInternationalString(Map, String)
@@ -301,9 +301,9 @@ filter: for (final Locale locale : local
* Converts a 3-letters ISO code to a 2-letters one.
* If the given code is not recognized, then this method returns {@code code} unmodified.
*
- * @param code The 3-letters code.
- * @param type Either {@link #LANGUAGE} or {@link #COUNTRY}.
- * @return The 2-letters code, or {@code null} if none.
+ * @param code the 3-letters code.
+ * @param type either {@link #LANGUAGE} or {@link #COUNTRY}.
+ * @return the 2-letters code, or {@code null} if none.
*/
private static String toISO2(final String code, final short type) {
final short alpha3 = toNumber(code, type);
@@ -330,9 +330,9 @@ filter: for (final Locale locale : local
* <p>This method does not use the sign bit. Callers can use it for differentiating language codes
* from country codes, using the {@link #LANGUAGE} or {@link #COUNTRY} bit masks.</p>
*
- * @param code The 1-, 2- or 3- letters alpha code to convert.
- * @param n Initial bit pattern, either {@link #LANGUAGE} or {@link #COUNTRY}.
- * @return A number for the given code, or 0 if a non alpha characters were found.
+ * @param code the 1-, 2- or 3- letters alpha code to convert.
+ * @param n initial bit pattern, either {@link #LANGUAGE} or {@link #COUNTRY}.
+ * @return a number for the given code, or 0 if a non alpha characters were found.
*/
private static short toNumber(final String code, short n) {
final int length = code.length();
@@ -355,8 +355,8 @@ filter: for (final Locale locale : local
* Returns a unique instance of the given locale, if one is available.
* Otherwise returns the {@code locale} unchanged.
*
- * @param locale The locale to canonicalize.
- * @return A unique instance of the given locale, or {@code locale} if the given locale is not cached.
+ * @param locale the locale to canonicalize.
+ * @return a unique instance of the given locale, or {@code locale} if the given locale is not cached.
*/
public static Locale unique(final Locale locale) {
final Locale candidate = POOL.get(locale);
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/NullArgumentException.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/NullArgumentException.java?rev=1779174&r1=1779173&r2=1779174&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/NullArgumentException.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/NullArgumentException.java [UTF-8] Tue Jan 17 11:50:21 2017
@@ -51,7 +51,7 @@ public class NullArgumentException exten
/**
* Constructs an exception with the specified detail message.
*
- * @param message The detail message.
+ * @param message the detail message.
*/
public NullArgumentException(final String message) {
super(message);
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Numbers.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Numbers.java?rev=1779174&r1=1779173&r2=1779174&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Numbers.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Numbers.java [UTF-8] Tue Jan 17 11:50:21 2017
@@ -713,8 +713,8 @@ public final class Numbers extends Stati
* {@link #SHORT}, {@link #BYTE}, {@link #CHARACTER}, {@link #BOOLEAN}, or {@link #OTHER}
* constants for the given type. This is a commodity for usage in {@code switch} statements.
*
- * @param type A type (usually either a primitive type or its wrapper).
- * @return The constant for the given type, or {@link #OTHER} if unknown.
+ * @param type a type (usually either a primitive type or its wrapper).
+ * @return the constant for the given type, or {@link #OTHER} if unknown.
*/
public static byte getEnumConstant(final Class<?> type) {
final Numbers mapping = MAPPING.get(type);
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/ObjectConverter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/ObjectConverter.java?rev=1779174&r1=1779173&r2=1779174&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/ObjectConverter.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/ObjectConverter.java [UTF-8] Tue Jan 17 11:50:21 2017
@@ -106,7 +106,7 @@ public interface ObjectConverter<S,T> ex
* source value, then this properties set can not contain the {@link FunctionProperty#INJECTIVE}
* value. See class javadoc for more discussion.
*
- * @return The manners in which source values are mapped to target values.
+ * @return the manners in which source values are mapped to target values.
* May be an empty set, but never null.
*/
Set<FunctionProperty> properties();
@@ -114,14 +114,14 @@ public interface ObjectConverter<S,T> ex
/**
* Returns the type of objects to convert.
*
- * @return The type of objects to convert.
+ * @return the type of objects to convert.
*/
Class<S> getSourceClass();
/**
* Returns the type of converted objects.
*
- * @return The type of converted objects.
+ * @return the type of converted objects.
*/
Class<T> getTargetClass();
@@ -131,17 +131,16 @@ public interface ObjectConverter<S,T> ex
* throws an exception, at implementation choice. Note that this choice may affect the set of
* function {@linkplain #properties() properties} - see the class Javadoc for more discussion.
*
- * @param object The object to convert, or {@code null}.
- * @return The converted object, or {@code null}.
- * @throws UnconvertibleObjectException If the given object is not an element of the function domain.
+ * @param object the object to convert, or {@code null}.
+ * @return the converted object, or {@code null}.
+ * @throws UnconvertibleObjectException if the given object is not an element of the function domain.
*/
@Override
T apply(S object) throws UnconvertibleObjectException;
/**
- * Returns a converter capable to convert instances of <var>T</var> back to instances of
- * <var>S</var>. Before to invoke this method, callers can verify if this converter is
- * invertible as below:
+ * Returns a converter capable to convert instances of <var>T</var> back to instances of <var>S</var>.
+ * Before to invoke this method, callers can verify if this converter is invertible as below:
*
* {@preformat java
* if (converter.properties().contains(FunctionProperty.INVERTIBLE)) {
@@ -149,8 +148,8 @@ public interface ObjectConverter<S,T> ex
* }
* }
*
- * @return A converter for converting instances of <var>T</var> back to instances of <var>S</var>.
- * @throws UnsupportedOperationException If this converter is not invertible.
+ * @return a converter for converting instances of <var>T</var> back to instances of <var>S</var>.
+ * @throws UnsupportedOperationException if this converter is not invertible.
*
* @see FunctionProperty#INVERTIBLE
*/
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/StringBuilders.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/StringBuilders.java?rev=1779174&r1=1779173&r2=1779174&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/StringBuilders.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/StringBuilders.java [UTF-8] Tue Jan 17 11:50:21 2017
@@ -283,8 +283,10 @@ public final class StringBuilders extend
if (n == 2) {
buffer.deleteCharAt(i + 1); // Remove the low surrogate of a surrogate pair.
}
- // Nothing special to do about codepoint here, since 'c' is in
- // the basic plane (verified by the r < ASCII.length() check).
+ /*
+ * Nothing special to do about codepoint here, since 'c' is in
+ * the basic plane (verified by the r < ASCII.length() check).
+ */
buffer.setCharAt(i, cr);
}
}
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/UnconvertibleObjectException.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/UnconvertibleObjectException.java?rev=1779174&r1=1779173&r2=1779174&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/UnconvertibleObjectException.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/UnconvertibleObjectException.java [UTF-8] Tue Jan 17 11:50:21 2017
@@ -47,7 +47,7 @@ public class UnconvertibleObjectExceptio
/**
* Constructs a new exception with the specified detail message.
*
- * @param message The detail message, or {@code null} if none.
+ * @param message the detail message, or {@code null} if none.
*/
public UnconvertibleObjectException(final String message) {
super(message);
@@ -56,8 +56,8 @@ public class UnconvertibleObjectExceptio
/**
* Constructs a new exception with the specified detail message and cause.
*
- * @param message The detail message, or {@code null} if none.
- * @param cause The cause, or {@code null} if none.
+ * @param message the detail message, or {@code null} if none.
+ * @param cause the cause, or {@code null} if none.
*/
public UnconvertibleObjectException(final String message, final Throwable cause) {
super(message, cause);
@@ -66,7 +66,7 @@ public class UnconvertibleObjectExceptio
/**
* Constructs a new exception with the specified cause.
*
- * @param cause The cause, or {@code null} if none.
+ * @param cause the cause, or {@code null} if none.
*/
public UnconvertibleObjectException(final Throwable cause) {
super(cause);
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/UnknownNameException.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/UnknownNameException.java?rev=1779174&r1=1779173&r2=1779174&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/UnknownNameException.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/UnknownNameException.java [UTF-8] Tue Jan 17 11:50:21 2017
@@ -47,7 +47,7 @@ public class UnknownNameException extend
/**
* Constructs a new exception with the specified detail message.
*
- * @param message The detail message, or {@code null} if none.
+ * @param message the detail message, or {@code null} if none.
*/
public UnknownNameException(final String message) {
super(message);
@@ -56,8 +56,8 @@ public class UnknownNameException extend
/**
* Constructs a new exception with the specified detail message and cause.
*
- * @param message The detail message, or {@code null} if none.
- * @param cause The cause, or {@code null} if none.
+ * @param message the detail message, or {@code null} if none.
+ * @param cause the cause, or {@code null} if none.
*/
public UnknownNameException(final String message, final Throwable cause) {
super(message, cause);
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/UnsupportedImplementationException.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/UnsupportedImplementationException.java?rev=1779174&r1=1779173&r2=1779174&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/UnsupportedImplementationException.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/UnsupportedImplementationException.java [UTF-8] Tue Jan 17 11:50:21 2017
@@ -39,7 +39,7 @@ public class UnsupportedImplementationEx
/**
* Constructs an exception with the specified detail message.
*
- * @param message The detail message, or {@code null} if none.
+ * @param message the detail message, or {@code null} if none.
*/
public UnsupportedImplementationException(final String message) {
super(message);
@@ -48,7 +48,7 @@ public class UnsupportedImplementationEx
/**
* Constructs an exception with an error message formatted for the specified class.
*
- * @param classe The unexpected implementation class.
+ * @param classe the unexpected implementation class.
*/
public UnsupportedImplementationException(final Class<?> classe) {
super(Errors.format(Errors.Keys.UnsupportedImplementation_1, classe));
@@ -58,8 +58,8 @@ public class UnsupportedImplementationEx
* Constructs an exception with an error message formatted for the specified class
* and a cause.
*
- * @param classe The unexpected implementation class.
- * @param cause The cause for the exception, or {@code null} if none.
+ * @param classe the unexpected implementation class.
+ * @param cause the cause for the exception, or {@code null} if none.
*/
public UnsupportedImplementationException(final Class<?> classe, final Exception cause) {
super(Errors.format(Errors.Keys.UnsupportedImplementation_1, classe), cause);
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Workaround.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Workaround.java?rev=1779174&r1=1779173&r2=1779174&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Workaround.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/Workaround.java [UTF-8] Tue Jan 17 11:50:21 2017
@@ -47,7 +47,7 @@ public @interface Workaround {
* A string identifying the library having a bug or limitation.
* Examples: {@code "JDK"}, {@code "NetCDF"}, {@code "JUnit"}, {@code "SIS"}.
*
- * @return An identifier of the library having a bug or limitation.
+ * @return an identifier of the library having a bug or limitation.
*/
String library();
@@ -55,7 +55,7 @@ public @interface Workaround {
* The last library version on which the bug has been verified.
* The bug may have existed before, and may still exist later.
*
- * @return The library version on which the bug has been observed.
+ * @return the library version on which the bug has been observed.
*/
String version();
}
Modified: sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/Cache.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/Cache.java?rev=1779174&r1=1779173&r2=1779174&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/Cache.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/collection/Cache.java [UTF-8] Tue Jan 17 11:50:21 2017
@@ -129,8 +129,8 @@ import java.util.function.Supplier;
* then creating <var>B</var> is not allowed to implies (directly or indirectly) the creation of
* <var>A</var>. If this rule is not meet, deadlock may occur randomly.
*
- * @param <K> The type of key objects.
- * @param <V> The type of value objects.
+ * @param <K> the type of key objects.
+ * @param <V> the type of value objects.
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.3
@@ -204,9 +204,9 @@ public class Cache<K,V> extends Abstract
* of the {@linkplain #cost cost} of all values) before to replace eldest strong references by
* {@linkplain Reference weak or soft references}.</p>
*
- * @param initialCapacity the initial capacity.
- * @param costLimit The maximum number of objects to keep by strong reference.
- * @param soft If {@code true}, use {@link SoftReference} instead of {@link WeakReference}.
+ * @param initialCapacity the initial capacity.
+ * @param costLimit the maximum number of objects to keep by strong reference.
+ * @param soft if {@code true}, use {@link SoftReference} instead of {@link WeakReference}.
*/
public Cache(int initialCapacity, final long costLimit, final boolean soft) {
ArgumentChecks.ensureStrictlyPositive("initialCapacity", initialCapacity);
@@ -224,8 +224,10 @@ public class Cache<K,V> extends Abstract
@Override
public void clear() {
map.clear();
- // Do not update "costs" and "totalCost". Instead let adjustReferences(...)
- // do its job, which needs to be done in a different thread.
+ /*
+ * Do not update "costs" and "totalCost". Instead let adjustReferences(\u2026)
+ * do its job, which needs to be done in a different thread.
+ */
}
/**
@@ -243,7 +245,7 @@ public class Cache<K,V> extends Abstract
* {@linkplain SoftReference soft} or {@linkplain WeakReference weak} references, and the
* values under computation at the time this method is invoked.
*
- * @return The number of elements currently cached.
+ * @return the number of elements currently cached.
*/
@Override
public int size() {
@@ -253,7 +255,7 @@ public class Cache<K,V> extends Abstract
/**
* Returns {@code true} if this map contains the specified key.
*
- * @param key The key to check for existence.
+ * @param key the key to check for existence.
* @return {@code true} if the given key still exist in this cache.
*/
@Override
@@ -290,9 +292,9 @@ public class Cache<K,V> extends Abstract
/**
* Puts the given value in cache.
*
- * @param key The key for which to set a value.
- * @param value The value to store.
- * @return The value previously stored at the given key, or {@code null} if none.
+ * @param key the key for which to set a value.
+ * @param value the value to store.
+ * @return the value previously stored at the given key, or {@code null} if none.
*/
@Override
public V put(final K key, final V value) {
@@ -313,8 +315,8 @@ public class Cache<K,V> extends Abstract
/**
* Removes the value associated to the given key in the cache.
*
- * @param key The key of the value to removed.
- * @return The value that were associated to the given key, or {@code null} if none.
+ * @param key the key of the value to removed.
+ * @return the value that were associated to the given key, or {@code null} if none.
*/
@Override
public V remove(final Object key) {
@@ -326,8 +328,8 @@ public class Cache<K,V> extends Abstract
* {@link #peek} except that it blocks if the value is currently under computation in an
* other thread.
*
- * @param key The key of the value to get.
- * @return The value associated to the given key, or {@code null} if none.
+ * @param key the key of the value to get.
+ * @return the value associated to the given key, or {@code null} if none.
*/
@Override
public V get(final Object key) {
@@ -339,12 +341,10 @@ public class Cache<K,V> extends Abstract
* is returned immediately. Otherwise the {@code creator.call()} method is invoked and
* its result is saved in this cache for future reuse.
*
- * @param key The key for which to get the cached or created value.
- * @param creator A method for creating a value, to be invoked only if no value are
- * cached for the given key.
- * @return The value for the given key, which may have been created as a result of this
- * method call.
- * @throws Exception If an exception occurred during the execution of {@code creator.call()}.
+ * @param key the key for which to get the cached or created value.
+ * @param creator a method for creating a value, to be invoked only if no value are cached for the given key.
+ * @return the value for the given key, which may have been created as a result of this method call.
+ * @throws Exception if an exception occurred during the execution of {@code creator.call()}.
*/
public V getOrCreate(final K key, final Callable<? extends V> creator) throws Exception {
V value = peek(key);
@@ -367,14 +367,16 @@ public class Cache<K,V> extends Abstract
* This method is similar to {@link #get(Object)} except that it doesn't block if the value is
* in process of being computed in an other thread; it returns {@code null} in such case.
*
- * @param key The key for which to get the cached value.
- * @return The cached value for the given key, or {@code null} if there is none.
+ * @param key the key for which to get the cached value.
+ * @return the cached value for the given key, or {@code null} if there is none.
*/
public V peek(final K key) {
final Object value = map.get(key);
if (value instanceof Handler<?>) {
- // The value is under computation. We will not wait for it since it is
- // not the purpose of this method (we should use lock(key) for that).
+ /*
+ * The value is under computation. We will not wait for it since it is
+ * not the purpose of this method (we should use lock(key) for that).
+ */
return null;
}
if (value instanceof Reference<?>) {
@@ -431,8 +433,8 @@ public class Cache<K,V> extends Abstract
* }
* }
*
- * @param key The key for the entry to lock.
- * @return A handler to use for unlocking and storing the result.
+ * @param key the key for the entry to lock.
+ * @return a handler to use for unlocking and storing the result.
*/
public Handler<V> lock(final K key) {
final Work handler = new Work(key);
@@ -556,7 +558,7 @@ public class Cache<K,V> extends Abstract
*
* See the {@link Cache} javadoc for a more complete example.
*
- * @param <V> The type of value objects.
+ * @param <V> the type of value objects.
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.3
@@ -569,7 +571,7 @@ public class Cache<K,V> extends Abstract
* This method should be invoked after the {@code Handler} creation in case a value
* has been computed in an other thread.
*
- * @return The value from the cache, or {@code null} if none.
+ * @return the value from the cache, or {@code null} if none.
*/
V peek();
@@ -578,11 +580,11 @@ public class Cache<K,V> extends Abstract
* <strong>must</strong> be invoked in a {@code finally} block, no matter
* what the result is.
*
- * @param result The result to store in the cache, or {@code null} for removing
+ * @param result the result to store in the cache, or {@code null} for removing
* the entry from the cache. If an entry is removed, a new computation
* will be attempted the next time a handler is created for the same key.
*
- * @throws IllegalStateException May be thrown if this method is not invoked in
+ * @throws IllegalStateException may be thrown if this method is not invoked in
* the pattern described in class javadoc, or if a key collision occurs.
*/
void putAndUnlock(V result) throws IllegalStateException;
@@ -688,7 +690,7 @@ public class Cache<K,V> extends Abstract
/**
* Stores the result and release the lock.
*
- * @throws IllegalStateException If the current thread does not hold the lock.
+ * @throws IllegalStateException if the current thread does not hold the lock.
*/
@Override
public void putAndUnlock(final V result) throws IllegalStateException {
@@ -764,7 +766,7 @@ public class Cache<K,V> extends Abstract
*/
final void adjustReferences(final K key, final V value) {
int cost = cost(value);
- synchronized (costs) { // Should not be needed, but done as a safety.
+ synchronized (costs) { // Should not be needed, but done as a safety.
final Integer old = costs.put(key, cost);
if (old != null) {
cost -= old;
@@ -787,7 +789,7 @@ public class Cache<K,V> extends Abstract
final Reference<V> ref = soft ? new Soft<>(map, oldKey, (V) oldValue)
: new Weak<>(map, oldKey, (V) oldValue);
if (!map.replace(oldKey, oldValue, ref)) {
- ref.clear(); // Prevents the reference to be enqueued.
+ ref.clear(); // Prevents the reference to be enqueued.
}
}
it.remove();
@@ -817,8 +819,10 @@ public class Cache<K,V> extends Abstract
/** Removes the reference from the map. */
@Override public void dispose() {
map.remove(key, this);
- // There is nothing to remove from the cost map, since the later
- // contains only the keys of objects hold by strong reference.
+ /*
+ * There is nothing to remove from the cost map, since the later
+ * contains only the keys of objects hold by strong reference.
+ */
}
}
@@ -840,8 +844,10 @@ public class Cache<K,V> extends Abstract
/** Removes the reference from the map. */
@Override public void dispose() {
map.remove(key, this);
- // There is nothing to remove from the cost map, since the later
- // contains only the keys of objects hold by strong reference.
+ /*
+ * There is nothing to remove from the cost map, since the later
+ * contains only the keys of objects hold by strong reference.
+ */
}
}
@@ -849,7 +855,7 @@ public class Cache<K,V> extends Abstract
* Returns the set of keys in this cache. The returned set is subjects to the same caution
* than the ones documented in the {@link ConcurrentHashMap#keySet()} method.
*
- * @return The set of keys in this cache.
+ * @return the set of keys in this cache.
*/
@Override
public Set<K> keySet() {
@@ -862,7 +868,7 @@ public class Cache<K,V> extends Abstract
* it doesn't support removal of elements (including through the {@link Iterator#remove}
* method call).
*
- * @return A view of the entries contained in this map.
+ * @return a view of the entries contained in this map.
*/
@Override
public Set<Entry<K,V>> entrySet() {
@@ -909,8 +915,8 @@ public class Cache<K,V> extends Abstract
* in all cases. Subclasses should override this method if they have some easy way to measure
* the relative cost of value objects.
*
- * @param value The object for which to get an estimation of its cost.
- * @return The estimated cost of the given object.
+ * @param value the object for which to get an estimation of its cost.
+ * @return the estimated cost of the given object.
*
* @see java.lang.instrument.Instrumentation#getObjectSize(Object)
*/