Some minor cleanups (#627)

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
This commit is contained in:
Bogdan Drutu 2019-10-23 19:48:40 -07:00 committed by GitHub
parent bcc6202531
commit c24e4a9636
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 7 additions and 12 deletions

View File

@ -42,7 +42,7 @@ javadoc {
}) })
for (subproject in subprojects_javadoc) { for (subproject in subprojects_javadoc) {
if (subproject == project) { if (subproject == project) {
continue; continue
} }
source subproject.javadoc.source source subproject.javadoc.source
options.links subproject.javadoc.options.links.toArray(new String[0]) options.links subproject.javadoc.options.links.toArray(new String[0])

View File

@ -26,7 +26,7 @@ import javax.annotation.concurrent.Immutable;
*/ */
@Immutable @Immutable
public class EmptyDistributedContext implements DistributedContext { public class EmptyDistributedContext implements DistributedContext {
private static final Collection<Entry> EMPTY_COLLECTION = Collections.<Entry>emptyList(); private static final Collection<Entry> EMPTY_COLLECTION = Collections.emptyList();
/** /**
* Returns the single instance of the {@link EmptyDistributedContext} class. * Returns the single instance of the {@link EmptyDistributedContext} class.

View File

@ -89,7 +89,7 @@ public abstract class EntryMetadata {
private final int hops; private final int hops;
private EntryTtl(int hops) { EntryTtl(int hops) {
this.hops = hops; this.hops = hops;
} }

View File

@ -203,7 +203,7 @@ public final class Status {
private final int value; private final int value;
private CanonicalCode(int value) { CanonicalCode(int value) {
this.value = value; this.value = value;
} }

View File

@ -232,7 +232,6 @@ public final class TraceFlags {
options = (byte) (options | IS_SAMPLED); options = (byte) (options | IS_SAMPLED);
} else { } else {
options = (byte) (options & ~IS_SAMPLED); options = (byte) (options & ~IS_SAMPLED);
;
} }
return this; return this;
} }

View File

@ -131,7 +131,6 @@ public abstract class Tracestate {
* @return this. * @return this.
* @since 0.1.0 * @since 0.1.0
*/ */
@SuppressWarnings("nullness")
public Builder set(String key, String value) { public Builder set(String key, String value) {
// Initially create the Entry to validate input. // Initially create the Entry to validate input.
Entry entry = Entry.create(key, value); Entry entry = Entry.create(key, value);
@ -158,7 +157,6 @@ public abstract class Tracestate {
* @return this. * @return this.
* @since 0.1.0 * @since 0.1.0
*/ */
@SuppressWarnings("nullness")
public Builder remove(String key) { public Builder remove(String key) {
Utils.checkNotNull(key, "key"); Utils.checkNotNull(key, "key");
if (entries == null) { if (entries == null) {

View File

@ -146,8 +146,7 @@ public class HttpTraceContext implements HttpTextFormat<SpanContext> {
String listMember = listMembers[i]; String listMember = listMembers[i];
int index = listMember.indexOf(TRACESTATE_KEY_VALUE_DELIMITER); int index = listMember.indexOf(TRACESTATE_KEY_VALUE_DELIMITER);
checkArgument(index != -1, "Invalid tracestate list-member format."); checkArgument(index != -1, "Invalid tracestate list-member format.");
tracestateBuilder.set( tracestateBuilder.set(listMember.substring(0, index), listMember.substring(index + 1));
listMember.substring(0, index), listMember.substring(index + 1, listMember.length()));
} }
return SpanContext.create(traceId, spanId, traceFlags, tracestateBuilder.build()); return SpanContext.create(traceId, spanId, traceFlags, tracestateBuilder.build());
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {

View File

@ -54,7 +54,7 @@ protobuf {
// generated Java directories as source folders. // generated Java directories as source folders.
idea { idea {
module { module {
sourceDirs += file("build/generated/source/proto/main/java"); sourceDirs += file("build/generated/source/proto/main/java")
// If you have additional sourceSets and/or codegen plugins, add all of them // If you have additional sourceSets and/or codegen plugins, add all of them
} }
} }

View File

@ -36,7 +36,7 @@ protobuf {
// generated Java directories as source folders. // generated Java directories as source folders.
idea { idea {
module { module {
sourceDirs += file("build/generated/source/proto/main/java"); sourceDirs += file("build/generated/source/proto/main/java")
// If you have additional sourceSets and/or codegen plugins, add all of them // If you have additional sourceSets and/or codegen plugins, add all of them
} }
} }

View File

@ -44,7 +44,6 @@ import org.junit.runner.RunWith;
import org.junit.runners.JUnit4; import org.junit.runners.JUnit4;
/** Unit tests for {@link SpanBuilderSdk}. */ /** Unit tests for {@link SpanBuilderSdk}. */
@SuppressWarnings("deprecation")
@RunWith(JUnit4.class) @RunWith(JUnit4.class)
public class SpanBuilderSdkTest { public class SpanBuilderSdkTest {
private static final String SPAN_NAME = "span_name"; private static final String SPAN_NAME = "span_name";