diff options
author | Bogdan Drutu <bdrutu@google.com> | 2017-11-03 09:25:12 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-03 09:25:12 +1100 |
commit | 6cb4dd2cc949a2602783321da179cb11afb7fc7a (patch) | |
tree | a9d81d79091ae9b6e9d8f4bae236625daefd7fe2 /api/src/main/java | |
parent | 078349906aa2a6041ab5799f23e30ab0a6a99c07 (diff) | |
download | opencensus-java-6cb4dd2cc949a2602783321da179cb11afb7fc7a.tar.gz |
Add gradle plugin for google java format. Enforce all files to be formatted. (#771)
* Add gradle plugin for google java format. Enforce all files to be formatted.
* Fix javadoc comments.
* update to google-java-formatter 1.5
* Fix comments and run formatter only for java8.
* Formatter works only on java8.
Diffstat (limited to 'api/src/main/java')
22 files changed, 125 insertions, 166 deletions
diff --git a/api/src/main/java/io/opencensus/common/Duration.java b/api/src/main/java/io/opencensus/common/Duration.java index 77ba3db7..b4b59a57 100644 --- a/api/src/main/java/io/opencensus/common/Duration.java +++ b/api/src/main/java/io/opencensus/common/Duration.java @@ -92,8 +92,8 @@ public abstract class Duration implements Comparable<Duration> { * Compares this {@code Duration} to the specified {@code Duration}. * * @param otherDuration the other {@code Duration} to compare to, not {@code null}. - * @return the comparator value: zero if equal, negative if this duration is smaller - * than otherDuration, positive if larger. + * @return the comparator value: zero if equal, negative if this duration is smaller than + * otherDuration, positive if larger. * @throws NullPointerException if otherDuration is {@code null}. */ @Override diff --git a/api/src/main/java/io/opencensus/common/ExperimentalApi.java b/api/src/main/java/io/opencensus/common/ExperimentalApi.java index 266da4e9..9906cbff 100644 --- a/api/src/main/java/io/opencensus/common/ExperimentalApi.java +++ b/api/src/main/java/io/opencensus/common/ExperimentalApi.java @@ -27,26 +27,26 @@ import java.lang.annotation.Target; * backward-compatibility. * * <p>Usage guidelines: + * * <ol> - * <li>This annotation is used only on public API. Internal interfaces should not use it.</li> - * <li>After OpenCensus has gained API stability, this annotation can only be added to new API. - * Adding it to an existing API is considered API-breaking.</li> - * <li>Removing this annotation from an API gives it stable status.</li> + * <li>This annotation is used only on public API. Internal interfaces should not use it. + * <li>After OpenCensus has gained API stability, this annotation can only be added to new API. + * Adding it to an existing API is considered API-breaking. + * <li>Removing this annotation from an API gives it stable status. * </ol> */ @Internal @Retention(RetentionPolicy.SOURCE) @Target({ - ElementType.ANNOTATION_TYPE, - ElementType.CONSTRUCTOR, - ElementType.FIELD, - ElementType.METHOD, - ElementType.PACKAGE, - ElementType.TYPE}) + ElementType.ANNOTATION_TYPE, + ElementType.CONSTRUCTOR, + ElementType.FIELD, + ElementType.METHOD, + ElementType.PACKAGE, + ElementType.TYPE +}) @Documented public @interface ExperimentalApi { - /** - * Context information such as links to discussion thread, tracking issue etc. - */ + /** Context information such as links to discussion thread, tracking issue etc. */ String value() default ""; -}
\ No newline at end of file +} diff --git a/api/src/main/java/io/opencensus/common/OpenCensusLibraryInformation.java b/api/src/main/java/io/opencensus/common/OpenCensusLibraryInformation.java index 1b1c75e4..aa5d69d5 100644 --- a/api/src/main/java/io/opencensus/common/OpenCensusLibraryInformation.java +++ b/api/src/main/java/io/opencensus/common/OpenCensusLibraryInformation.java @@ -16,14 +16,10 @@ package io.opencensus.common; -/** - * Class holder for all common constants (such as the version) for the OpenCensus Java library. - */ +/** Class holder for all common constants (such as the version) for the OpenCensus Java library. */ @ExperimentalApi public final class OpenCensusLibraryInformation { - /** - * The current version of the OpenCensus Java library. - */ - public static final String VERSION = "0.9.0-SNAPSHOT"; // CURRENT_OPENCENSUS_VERSION + /** The current version of the OpenCensus Java library. */ + public static final String VERSION = "0.9.0-SNAPSHOT"; // CURRENT_OPENCENSUS_VERSION } diff --git a/api/src/main/java/io/opencensus/common/Timestamp.java b/api/src/main/java/io/opencensus/common/Timestamp.java index 0fa7c800..b62a1102 100644 --- a/api/src/main/java/io/opencensus/common/Timestamp.java +++ b/api/src/main/java/io/opencensus/common/Timestamp.java @@ -138,8 +138,8 @@ public abstract class Timestamp implements Comparable<Timestamp> { * Compares this {@code Timestamp} to the specified {@code Timestamp}. * * @param otherTimestamp the other {@code Timestamp} to compare to, not {@code null}. - * @return the comparator value: zero if equal, negative if this timestamp happens - * before otherTimestamp, positive if after. + * @return the comparator value: zero if equal, negative if this timestamp happens before + * otherTimestamp, positive if after. * @throws NullPointerException if otherTimestamp is {@code null}. */ @Override diff --git a/api/src/main/java/io/opencensus/internal/NoopScope.java b/api/src/main/java/io/opencensus/internal/NoopScope.java index 1edac98e..f4a8da07 100644 --- a/api/src/main/java/io/opencensus/internal/NoopScope.java +++ b/api/src/main/java/io/opencensus/internal/NoopScope.java @@ -18,9 +18,7 @@ package io.opencensus.internal; import io.opencensus.common.Scope; -/** - * A {@link Scope} that does nothing when it is created or closed. - */ +/** A {@link Scope} that does nothing when it is created or closed. */ public final class NoopScope implements Scope { private static final Scope INSTANCE = new NoopScope(); diff --git a/api/src/main/java/io/opencensus/stats/Aggregation.java b/api/src/main/java/io/opencensus/stats/Aggregation.java index f12517c8..90341af4 100644 --- a/api/src/main/java/io/opencensus/stats/Aggregation.java +++ b/api/src/main/java/io/opencensus/stats/Aggregation.java @@ -23,10 +23,11 @@ import io.opencensus.common.Function; import javax.annotation.concurrent.Immutable; /** - * {@link Aggregation} is the process of combining a certain set of {@code MeasureValue}s - * for a given {@code Measure} into an {@link AggregationData}. + * {@link Aggregation} is the process of combining a certain set of {@code MeasureValue}s for a + * given {@code Measure} into an {@link AggregationData}. * * <p>{@link Aggregation} currently supports 4 types of basic aggregation: + * * <ul> * <li>Sum * <li>Count @@ -40,12 +41,9 @@ import javax.annotation.concurrent.Immutable; @Immutable public abstract class Aggregation { - private Aggregation() { - } + private Aggregation() {} - /** - * Applies the given match function to the underlying data type. - */ + /** Applies the given match function to the underlying data type. */ public abstract <T> T match( Function<? super Sum, T> p0, Function<? super Count, T> p1, @@ -58,8 +56,7 @@ public abstract class Aggregation { @AutoValue public abstract static class Sum extends Aggregation { - Sum() { - } + Sum() {} private static final Sum INSTANCE = new AutoValue_Aggregation_Sum(); @@ -88,8 +85,7 @@ public abstract class Aggregation { @AutoValue public abstract static class Count extends Aggregation { - Count() { - } + Count() {} private static final Count INSTANCE = new AutoValue_Aggregation_Count(); @@ -118,8 +114,7 @@ public abstract class Aggregation { @AutoValue public abstract static class Mean extends Aggregation { - Mean() { - } + Mean() {} private static final Mean INSTANCE = new AutoValue_Aggregation_Mean(); @@ -144,15 +139,14 @@ public abstract class Aggregation { } /** - * Calculate distribution stats on aggregated {@code MeasureValue}s. Distribution includes - * mean, count, histogram, min, max and sum of squared deviations. + * Calculate distribution stats on aggregated {@code MeasureValue}s. Distribution includes mean, + * count, histogram, min, max and sum of squared deviations. */ @Immutable @AutoValue public abstract static class Distribution extends Aggregation { - Distribution() { - } + Distribution() {} /** * Construct a {@code Distribution}. diff --git a/api/src/main/java/io/opencensus/stats/AggregationData.java b/api/src/main/java/io/opencensus/stats/AggregationData.java index b91d0d19..d5cacfc5 100644 --- a/api/src/main/java/io/opencensus/stats/AggregationData.java +++ b/api/src/main/java/io/opencensus/stats/AggregationData.java @@ -27,10 +27,11 @@ import java.util.List; import javax.annotation.concurrent.Immutable; /** - * {@link AggregationData} is the result of applying a given {@link Aggregation} to a set of - * {@code MeasureValue}s. + * {@link AggregationData} is the result of applying a given {@link Aggregation} to a set of {@code + * MeasureValue}s. * * <p>{@link AggregationData} currently supports 5 types of basic aggregation values: + * * <ul> * <li>SumDataDouble * <li>SumDataLong @@ -39,18 +40,15 @@ import javax.annotation.concurrent.Immutable; * <li>DistributionData * </ul> * - * <p>{@link ViewData} will contain one {@link AggregationData}, corresponding to its - * {@link Aggregation} definition in {@link View}. + * <p>{@link ViewData} will contain one {@link AggregationData}, corresponding to its {@link + * Aggregation} definition in {@link View}. */ @Immutable public abstract class AggregationData { - private AggregationData() { - } + private AggregationData() {} - /** - * Applies the given match function to the underlying data type. - */ + /** Applies the given match function to the underlying data type. */ public abstract <T> T match( Function<? super SumDataDouble, T> p0, Function<? super SumDataLong, T> p1, @@ -64,8 +62,7 @@ public abstract class AggregationData { @AutoValue public abstract static class SumDataDouble extends AggregationData { - SumDataDouble() { - } + SumDataDouble() {} /** * Creates a {@code SumDataDouble}. @@ -101,8 +98,7 @@ public abstract class AggregationData { @AutoValue public abstract static class SumDataLong extends AggregationData { - SumDataLong() { - } + SumDataLong() {} /** * Creates a {@code SumDataLong}. @@ -138,8 +134,7 @@ public abstract class AggregationData { @AutoValue public abstract static class CountData extends AggregationData { - CountData() { - } + CountData() {} /** * Creates a {@code CountData}. @@ -175,8 +170,7 @@ public abstract class AggregationData { @AutoValue public abstract static class MeanData extends AggregationData { - MeanData() { - } + MeanData() {} /** * Creates a {@code MeanData}. @@ -223,8 +217,7 @@ public abstract class AggregationData { @AutoValue public abstract static class DistributionData extends AggregationData { - DistributionData() { - } + DistributionData() {} /** * Creates a {@code DistributionData}. @@ -238,7 +231,11 @@ public abstract class AggregationData { * @return a {@code DistributionData}. */ public static DistributionData create( - double mean, long count, double min, double max, double sumOfSquaredDeviations, + double mean, + long count, + double min, + double max, + double sumOfSquaredDeviations, List<Long> bucketCounts) { if (min != Double.POSITIVE_INFINITY || max != Double.NEGATIVE_INFINITY) { checkArgument(min <= max, "max should be greater or equal to min."); diff --git a/api/src/main/java/io/opencensus/stats/BucketBoundaries.java b/api/src/main/java/io/opencensus/stats/BucketBoundaries.java index b9a808f4..8af83a4e 100644 --- a/api/src/main/java/io/opencensus/stats/BucketBoundaries.java +++ b/api/src/main/java/io/opencensus/stats/BucketBoundaries.java @@ -38,7 +38,7 @@ public abstract class BucketBoundaries { */ public static final BucketBoundaries create(List<Double> bucketBoundaries) { checkNotNull(bucketBoundaries, "bucketBoundaries list should not be null."); - List<Double> bucketBoundariesCopy = new ArrayList<Double>(bucketBoundaries); // Deep copy. + List<Double> bucketBoundariesCopy = new ArrayList<Double>(bucketBoundaries); // Deep copy. // Check if sorted. if (bucketBoundariesCopy.size() > 1) { double lower = bucketBoundariesCopy.get(0); @@ -52,6 +52,8 @@ public abstract class BucketBoundaries { } /** + * Returns a list of histogram bucket boundaries. + * * @return a list of histogram bucket boundaries. */ public abstract List<Double> getBoundaries(); diff --git a/api/src/main/java/io/opencensus/stats/Measure.java b/api/src/main/java/io/opencensus/stats/Measure.java index 062a35bf..52fadfa0 100644 --- a/api/src/main/java/io/opencensus/stats/Measure.java +++ b/api/src/main/java/io/opencensus/stats/Measure.java @@ -30,9 +30,7 @@ public abstract class Measure { @VisibleForTesting static final int NAME_MAX_LENGTH = 255; - /** - * Applies the given match function to the underlying data type. - */ + /** Applies the given match function to the underlying data type. */ public abstract <T> T match( Function<? super MeasureDouble, T> p0, Function<? super MeasureLong, T> p1, @@ -46,35 +44,35 @@ public abstract class Measure { */ public abstract String getName(); - /** - * Detailed description of the measure, used in documentation. - */ + /** Detailed description of the measure, used in documentation. */ public abstract String getDescription(); /** * The units in which {@link Measure} values are measured. * * <p>The suggested grammar for a unit is as follows: - * Expression = Component { "." Component } { "/" Component } ; - * Component = [ PREFIX ] UNIT [ Annotation ] | Annotation | "1" ; - * Annotation = "{" NAME "}" ; - * For example, string “MBy{transmitted}/ms” stands for megabytes per milliseconds, and the + * + * <ul> + * <li>Expression = Component { "." Component } {"/" Component }; + * <li>Component = [ PREFIX ] UNIT [ Annotation ] | Annotation | "1"; + * <li>Annotation = "{" NAME "}" ; + * </ul> + * + * <p>For example, string “MBy{transmitted}/ms” stands for megabytes per milliseconds, and the * annotation transmitted inside {} is just a comment of the unit. */ // TODO(songya): determine whether we want to check the grammar on string unit. public abstract String getUnit(); // Prevents this class from being subclassed anywhere else. - private Measure() { - } + private Measure() {} /** {@link Measure} with {@code Double} typed values. */ @Immutable @AutoValue public abstract static class MeasureDouble extends Measure { - MeasureDouble() { - } + MeasureDouble() {} /** * Constructs a new {@link MeasureDouble}. @@ -85,9 +83,11 @@ public abstract class Measure { * @return a {@code MeasureDouble}. */ public static MeasureDouble create(String name, String description, String unit) { - checkArgument(StringUtil.isPrintableString(name) && name.length() <= NAME_MAX_LENGTH, + checkArgument( + StringUtil.isPrintableString(name) && name.length() <= NAME_MAX_LENGTH, "Name should be a ASCII string with a length no greater than " - + NAME_MAX_LENGTH + " characters."); + + NAME_MAX_LENGTH + + " characters."); return new AutoValue_Measure_MeasureDouble(name, description, unit); } @@ -114,8 +114,7 @@ public abstract class Measure { @AutoValue public abstract static class MeasureLong extends Measure { - MeasureLong() { - } + MeasureLong() {} /** * Constructs a new {@link MeasureLong}. @@ -126,9 +125,11 @@ public abstract class Measure { * @return a {@code MeasureLong}. */ public static MeasureLong create(String name, String description, String unit) { - checkArgument(StringUtil.isPrintableString(name) && name.length() <= NAME_MAX_LENGTH, + checkArgument( + StringUtil.isPrintableString(name) && name.length() <= NAME_MAX_LENGTH, "Name should be a ASCII string with a length no greater than " - + NAME_MAX_LENGTH + " characters."); + + NAME_MAX_LENGTH + + " characters."); return new AutoValue_Measure_MeasureLong(name, description, unit); } diff --git a/api/src/main/java/io/opencensus/stats/Measurement.java b/api/src/main/java/io/opencensus/stats/Measurement.java index 10fc5888..1bb746d8 100644 --- a/api/src/main/java/io/opencensus/stats/Measurement.java +++ b/api/src/main/java/io/opencensus/stats/Measurement.java @@ -26,22 +26,17 @@ import javax.annotation.concurrent.Immutable; @Immutable public abstract class Measurement { - /** - * Applies the given match function to the underlying data type. - */ + /** Applies the given match function to the underlying data type. */ public abstract <T> T match( Function<? super MeasurementDouble, T> p0, Function<? super MeasurementLong, T> p1, Function<? super Measurement, T> defaultFunction); - /** - * Extracts the measured {@link Measure}. - */ + /** Extracts the measured {@link Measure}. */ public abstract Measure getMeasure(); // Prevents this class from being subclassed anywhere else. - private Measurement() { - } + private Measurement() {} /** {@code Double} typed {@link Measurement}. */ @Immutable @@ -49,9 +44,7 @@ public abstract class Measurement { public abstract static class MeasurementDouble extends Measurement { MeasurementDouble() {} - /** - * Constructs a new {@link MeasurementDouble}. - */ + /** Constructs a new {@link MeasurementDouble}. */ public static MeasurementDouble create(MeasureDouble measure, double value) { return new AutoValue_Measurement_MeasurementDouble(measure, value); } @@ -76,9 +69,7 @@ public abstract class Measurement { public abstract static class MeasurementLong extends Measurement { MeasurementLong() {} - /** - * Constructs a new {@link MeasurementLong}. - */ + /** Constructs a new {@link MeasurementLong}. */ public static MeasurementLong create(MeasureLong measure, long value) { return new AutoValue_Measurement_MeasurementLong(measure, value); } diff --git a/api/src/main/java/io/opencensus/stats/View.java b/api/src/main/java/io/opencensus/stats/View.java index 26b1177f..c4b152e0 100644 --- a/api/src/main/java/io/opencensus/stats/View.java +++ b/api/src/main/java/io/opencensus/stats/View.java @@ -31,8 +31,8 @@ import java.util.List; import javax.annotation.concurrent.Immutable; /** - * A View specifies an aggregation and a set of tag keys. The aggregation will be broken - * down by the unique set of matching tag values for each measure. + * A View specifies an aggregation and a set of tag keys. The aggregation will be broken down by the + * unique set of matching tag values for each measure. */ @Immutable @AutoValue @@ -40,27 +40,18 @@ public abstract class View { @VisibleForTesting static final int NAME_MAX_LENGTH = 256; - View() { - } + View() {} - /** - * Name of view. Must be unique. - */ + /** Name of view. Must be unique. */ public abstract Name getName(); - /** - * More detailed description, for documentation purposes. - */ + /** More detailed description, for documentation purposes. */ public abstract String getDescription(); - /** - * Measure type of this view. - */ + /** Measure type of this view. */ public abstract Measure getMeasure(); - /** - * The {@link Aggregation} associated with this {@link View}. - */ + /** The {@link Aggregation} associated with this {@link View}. */ public abstract Aggregation getAggregation(); /** @@ -97,8 +88,7 @@ public abstract class View { Aggregation aggregation, List<TagKey> columns, AggregationWindow window) { - checkArgument(new HashSet<TagKey>(columns).size() == columns.size(), - "Columns have duplicate."); + checkArgument(new HashSet<TagKey>(columns).size() == columns.size(), "Columns have duplicate."); return new AutoValue_View( name, @@ -109,9 +99,7 @@ public abstract class View { window); } - /** - * The name of a {@code View}. - */ + /** The name of a {@code View}. */ // This type should be used as the key when associating data with Views. @Immutable @AutoValue @@ -127,8 +115,8 @@ public abstract class View { public abstract String asString(); /** - * Creates a {@code View.Name} from a {@code String}. Should be a ASCII string with a length - * no greater than 256 characters. + * Creates a {@code View.Name} from a {@code String}. Should be a ASCII string with a length no + * greater than 256 characters. * * <p>Suggested format for name: {@code <web_host>/<path>}. * @@ -136,7 +124,8 @@ public abstract class View { * @return a {@code View.Name} with the given name {@code String}. */ public static Name create(String name) { - checkArgument(StringUtil.isPrintableString(name) && name.length() <= NAME_MAX_LENGTH, + checkArgument( + StringUtil.isPrintableString(name) && name.length() <= NAME_MAX_LENGTH, "Name should be a ASCII string with a length no greater than 256 characters."); return new AutoValue_View_Name(name); } @@ -148,9 +137,7 @@ public abstract class View { private AggregationWindow() {} - /** - * Applies the given match function to the underlying data type. - */ + /** Applies the given match function to the underlying data type. */ public abstract <T> T match( Function<? super Cumulative, T> p0, Function<? super Interval, T> p1, @@ -182,7 +169,7 @@ public abstract class View { Function<? super Cumulative, T> p0, Function<? super Interval, T> p1, Function<? super AggregationWindow, T> defaultFunction) { - return p0.apply(this); + return p0.apply(this); } } @@ -202,7 +189,6 @@ public abstract class View { */ public abstract Duration getDuration(); - /** * Constructs an interval {@code AggregationWindow} that has a finite explicit {@code * Duration}. @@ -222,7 +208,7 @@ public abstract class View { Function<? super Cumulative, T> p0, Function<? super Interval, T> p1, Function<? super AggregationWindow, T> defaultFunction) { - return p1.apply(this); + return p1.apply(this); } } } diff --git a/api/src/main/java/io/opencensus/stats/ViewData.java b/api/src/main/java/io/opencensus/stats/ViewData.java index 007022e7..458b1f1a 100644 --- a/api/src/main/java/io/opencensus/stats/ViewData.java +++ b/api/src/main/java/io/opencensus/stats/ViewData.java @@ -41,8 +41,8 @@ public abstract class ViewData { public abstract View getView(); /** - * The {@link AggregationData} grouped by combination of tag values, associated with this - * {@link ViewData}. + * The {@link AggregationData} grouped by combination of tag values, associated with this {@link + * ViewData}. */ public abstract Map<List<TagValue>, AggregationData> getAggregationMap(); @@ -91,11 +91,9 @@ public abstract class ViewData { Functions.<Void>throwIllegalArgumentException()); Map<List<TagValue>, AggregationData> deepCopy = Maps.newHashMap(); - for (Entry<? extends List<TagValue>, ? extends AggregationData> entry : map - .entrySet()) { + for (Entry<? extends List<TagValue>, ? extends AggregationData> entry : map.entrySet()) { deepCopy.put( - Collections.unmodifiableList(new ArrayList<TagValue>(entry.getKey())), - entry.getValue()); + Collections.unmodifiableList(new ArrayList<TagValue>(entry.getKey())), entry.getValue()); } return new AutoValue_ViewData(view, Collections.unmodifiableMap(deepCopy), windowData); diff --git a/api/src/main/java/io/opencensus/stats/ViewManager.java b/api/src/main/java/io/opencensus/stats/ViewManager.java index 908221c6..f98e8058 100644 --- a/api/src/main/java/io/opencensus/stats/ViewManager.java +++ b/api/src/main/java/io/opencensus/stats/ViewManager.java @@ -19,13 +19,13 @@ package io.opencensus.stats; import javax.annotation.Nullable; /** - * Provides facilities to register {@link View}s for collecting stats and retrieving - * stats data as a {@link ViewData}. + * Provides facilities to register {@link View}s for collecting stats and retrieving stats data as a + * {@link ViewData}. */ public abstract class ViewManager { /** - * Pull model for stats. Registers a {@link View} that will collect data to be accessed - * via {@link #getView(View.Name)}. + * Pull model for stats. Registers a {@link View} that will collect data to be accessed via {@link + * #getView(View.Name)}. * * @param view the {@code View} to be registered. */ diff --git a/api/src/main/java/io/opencensus/tags/InternalUtils.java b/api/src/main/java/io/opencensus/tags/InternalUtils.java index c55ca7d4..734fcf98 100644 --- a/api/src/main/java/io/opencensus/tags/InternalUtils.java +++ b/api/src/main/java/io/opencensus/tags/InternalUtils.java @@ -18,9 +18,7 @@ package io.opencensus.tags; import java.util.Iterator; -/** - * Internal tagging utilities. - */ +/** Internal tagging utilities. */ @io.opencensus.common.Internal public final class InternalUtils { private InternalUtils() {} diff --git a/api/src/main/java/io/opencensus/tags/package-info.java b/api/src/main/java/io/opencensus/tags/package-info.java index e18c68d1..eb19ee77 100644 --- a/api/src/main/java/io/opencensus/tags/package-info.java +++ b/api/src/main/java/io/opencensus/tags/package-info.java @@ -22,8 +22,8 @@ * io.opencensus.stats} package labels all stats with the current tags. * * <p>{@link io.opencensus.tags.Tag Tags} are key-value pairs. The {@link io.opencensus.tags.TagKey - * keys} and {@link io.opencensus.tags.TagValue values} are wrapped {@code String}s. They are - * stored as a map in a {@link io.opencensus.tags.TagContext}. + * keys} and {@link io.opencensus.tags.TagValue values} are wrapped {@code String}s. They are stored + * as a map in a {@link io.opencensus.tags.TagContext}. * * <p>Note that tags are independent of the tracing data that is propagated in the {@code * io.grpc.Context}, such as trace ID. diff --git a/api/src/main/java/io/opencensus/trace/CurrentSpanUtils.java b/api/src/main/java/io/opencensus/trace/CurrentSpanUtils.java index ab8282de..dbbe3a33 100644 --- a/api/src/main/java/io/opencensus/trace/CurrentSpanUtils.java +++ b/api/src/main/java/io/opencensus/trace/CurrentSpanUtils.java @@ -20,9 +20,7 @@ import io.grpc.Context; import io.opencensus.common.Scope; import io.opencensus.trace.unsafe.ContextUtils; -/** - * Util methods/functionality to interact with the {@link Span} in the {@link io.grpc.Context}. - */ +/** Util methods/functionality to interact with the {@link Span} in the {@link io.grpc.Context}. */ final class CurrentSpanUtils { // No instance of this class. private CurrentSpanUtils() {} diff --git a/api/src/main/java/io/opencensus/trace/Sampler.java b/api/src/main/java/io/opencensus/trace/Sampler.java index 429ffe92..e30b5fdd 100644 --- a/api/src/main/java/io/opencensus/trace/Sampler.java +++ b/api/src/main/java/io/opencensus/trace/Sampler.java @@ -44,8 +44,8 @@ public abstract class Sampler { List<Span> parentLinks); /** - * Returns the description of this {@code Sampler}. This may be displayed on debug pages or in - * the logs. + * Returns the description of this {@code Sampler}. This may be displayed on debug pages or in the + * logs. * * <p>Example: "ProbabilitySampler{0.000100}" * diff --git a/api/src/main/java/io/opencensus/trace/Span.java b/api/src/main/java/io/opencensus/trace/Span.java index b58a1fde..3ede6686 100644 --- a/api/src/main/java/io/opencensus/trace/Span.java +++ b/api/src/main/java/io/opencensus/trace/Span.java @@ -77,8 +77,8 @@ public abstract class Span { } /** - * Sets an attribute to the {@code Span}. If the {@code Span} previously contained a mapping - * for the key, the old value is replaced by the specified value. + * Sets an attribute to the {@code Span}. If the {@code Span} previously contained a mapping for + * the key, the old value is replaced by the specified value. * * @param key the key for this attribute. * @param value the value for this attribute. @@ -103,7 +103,6 @@ public abstract class Span { addAttributes(attributes); } - /** * @deprecated Use {@link #putAttributes(Map)} * @param attributes the attributes that will be added and associated with the {@code Span}. diff --git a/api/src/main/java/io/opencensus/trace/TraceComponent.java b/api/src/main/java/io/opencensus/trace/TraceComponent.java index 4472ba26..e1806490 100644 --- a/api/src/main/java/io/opencensus/trace/TraceComponent.java +++ b/api/src/main/java/io/opencensus/trace/TraceComponent.java @@ -23,8 +23,8 @@ import io.opencensus.trace.export.ExportComponent; import io.opencensus.trace.propagation.PropagationComponent; /** - * Class that holds the implementation instances for {@link Tracer}, {@link - * PropagationComponent}, {@link Clock}, {@link ExportComponent} and {@link TraceConfig}. + * Class that holds the implementation instances for {@link Tracer}, {@link PropagationComponent}, + * {@link Clock}, {@link ExportComponent} and {@link TraceConfig}. * * <p>Unless otherwise noted all methods (on component) results are cacheable. */ @@ -40,8 +40,8 @@ public abstract class TraceComponent { public abstract Tracer getTracer(); /** - * Returns the {@link PropagationComponent} with the provided implementation. If no - * implementation is provided then no-op implementation will be used. + * Returns the {@link PropagationComponent} with the provided implementation. If no implementation + * is provided then no-op implementation will be used. * * @return the {@code PropagationComponent} implementation. */ diff --git a/api/src/main/java/io/opencensus/trace/TraceOptions.java b/api/src/main/java/io/opencensus/trace/TraceOptions.java index 35181e28..fc594853 100644 --- a/api/src/main/java/io/opencensus/trace/TraceOptions.java +++ b/api/src/main/java/io/opencensus/trace/TraceOptions.java @@ -200,7 +200,8 @@ public final class TraceOptions { if (isSampled) { options = (byte) (options | IS_SAMPLED); } else { - options = (byte) (options & ~IS_SAMPLED);; + options = (byte) (options & ~IS_SAMPLED); + ; } return this; } diff --git a/api/src/main/java/io/opencensus/trace/export/ExportComponent.java b/api/src/main/java/io/opencensus/trace/export/ExportComponent.java index abf5c531..9b7e1664 100644 --- a/api/src/main/java/io/opencensus/trace/export/ExportComponent.java +++ b/api/src/main/java/io/opencensus/trace/export/ExportComponent.java @@ -20,8 +20,8 @@ import io.opencensus.trace.TraceOptions; import javax.annotation.Nullable; /** - * Class that holds the implementation instances for {@link SpanExporter}, {@link - * RunningSpanStore} and {@link SampledSpanStore}. + * Class that holds the implementation instances for {@link SpanExporter}, {@link RunningSpanStore} + * and {@link SampledSpanStore}. * * <p>Unless otherwise noted all methods (on component) results are cacheable. */ @@ -48,8 +48,8 @@ public abstract class ExportComponent { public abstract SpanExporter getSpanExporter(); /** - * Returns the {@link RunningSpanStore} that can be used to get useful debugging information - * about all the current active spans. + * Returns the {@link RunningSpanStore} that can be used to get useful debugging information about + * all the current active spans. * * @return the {@code RunningSpanStore} or {@code null} if not supported. */ diff --git a/api/src/main/java/io/opencensus/trace/propagation/PropagationComponent.java b/api/src/main/java/io/opencensus/trace/propagation/PropagationComponent.java index e8abda76..7dfa8202 100644 --- a/api/src/main/java/io/opencensus/trace/propagation/PropagationComponent.java +++ b/api/src/main/java/io/opencensus/trace/propagation/PropagationComponent.java @@ -17,16 +17,16 @@ package io.opencensus.trace.propagation; /** - * Container class for all the supported propagation formats. Currently supports only Binary - * format see {@link BinaryFormat} but more formats will be added. + * Container class for all the supported propagation formats. Currently supports only Binary format + * see {@link BinaryFormat} but more formats will be added. */ public abstract class PropagationComponent { private static final PropagationComponent NOOP_PROPAGATION_COMPONENT = new NoopPropagationComponent(); /** - * Returns the {@link BinaryFormat} with the provided implementations. If no implementation - * is provided then no-op implementation will be used. + * Returns the {@link BinaryFormat} with the provided implementations. If no implementation is + * provided then no-op implementation will be used. * * @return the {@code BinaryFormat} implementation. */ |