Skip to content
This repository was archived by the owner on Dec 23, 2023. It is now read-only.

Commit 26232c4

Browse files
author
Bogdan Drutu
authored
Update errorprone, google cloud java, grpc versions. (#931)
1 parent 64d0583 commit 26232c4

File tree

11 files changed

+48
-25
lines changed

11 files changed

+48
-25
lines changed

api/src/main/java/io/opencensus/trace/SpanBuilder.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ public abstract class SpanBuilder {
221221
*/
222222
@MustBeClosed
223223
public final Scope startScopedSpan() {
224-
return CurrentSpanUtils.withSpan(startSpan(), true);
224+
return CurrentSpanUtils.withSpan(startSpan(), /* endSpan= */ true);
225225
}
226226

227227
/**
@@ -251,7 +251,7 @@ public final Scope startScopedSpan() {
251251
*/
252252
public final void startSpanAndRun(final Runnable runnable) {
253253
final Span span = startSpan();
254-
CurrentSpanUtils.withSpan(span, true, runnable).run();
254+
CurrentSpanUtils.withSpan(span, /* endSpan= */ true, runnable).run();
255255
}
256256

257257
/**
@@ -283,7 +283,7 @@ public final void startSpanAndRun(final Runnable runnable) {
283283
*/
284284
public final <V> V startSpanAndCall(Callable<V> callable) throws Exception {
285285
final Span span = startSpan();
286-
return CurrentSpanUtils.withSpan(span, true, callable).call();
286+
return CurrentSpanUtils.withSpan(span, /* endSpan= */ true, callable).call();
287287
}
288288

289289
static final class NoopSpanBuilder extends SpanBuilder {

api/src/main/java/io/opencensus/trace/Tracer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public final Span getCurrentSpan() {
148148
*/
149149
@MustBeClosed
150150
public final Scope withSpan(Span span) {
151-
return CurrentSpanUtils.withSpan(checkNotNull(span, "span"), false);
151+
return CurrentSpanUtils.withSpan(checkNotNull(span, "span"), /* endSpan= */ false);
152152
}
153153

154154
/**
@@ -213,7 +213,7 @@ public final Scope withSpan(Span span) {
213213
* @since 0.11.0
214214
*/
215215
public final Runnable withSpan(Span span, Runnable runnable) {
216-
return CurrentSpanUtils.withSpan(span, false, runnable);
216+
return CurrentSpanUtils.withSpan(span, /* endSpan= */ false, runnable);
217217
}
218218

219219
/**
@@ -278,7 +278,7 @@ public final Runnable withSpan(Span span, Runnable runnable) {
278278
* @since 0.11.0
279279
*/
280280
public final <C> Callable<C> withSpan(Span span, final Callable<C> callable) {
281-
return CurrentSpanUtils.withSpan(span, false, callable);
281+
return CurrentSpanUtils.withSpan(span, /* endSpan= */ false, callable);
282282
}
283283

284284
/**

api/src/test/java/io/opencensus/tags/TagContextTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public void testToString() {
8484
}
8585

8686
private static final class SimpleTagContext extends TagContext {
87-
private final List<Tag> tags;
87+
@Nullable private final List<Tag> tags;
8888

8989
// This Error Prone warning doesn't seem correct, because the constructor is just calling
9090
// another constructor.

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ subprojects {
133133
ext {
134134
autoValueVersion = '1.4'
135135
findBugsVersion = '3.0.1'
136-
errorProneVersion = '2.1.2'
137-
grpcVersion = '1.8.0'
136+
errorProneVersion = '2.2.0'
137+
grpcVersion = '1.9.0'
138138
guavaVersion = '19.0'
139139
googleAuthVersion = '0.9.0'
140-
googleCloudVersion = '0.30.0-beta'
140+
googleCloudVersion = '0.32.0-beta'
141141
signalfxVersion = '0.0.39'
142142
zipkinReporterVersion = '2.0.0'
143143

contrib/zpages/src/main/java/io/opencensus/contrib/zpages/ZPageHttpHandler.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package io.opencensus.contrib.zpages;
1818

1919
import com.google.common.annotations.VisibleForTesting;
20+
import com.google.common.base.Splitter;
2021
import com.sun.net.httpserver.HttpExchange;
2122
import com.sun.net.httpserver.HttpHandler;
2223
import io.opencensus.common.Scope;
@@ -28,6 +29,7 @@
2829
import java.util.Arrays;
2930
import java.util.Collections;
3031
import java.util.HashMap;
32+
import java.util.List;
3133
import java.util.Map;
3234

3335
/** An {@link HttpHandler} that can be used to render HTML pages using any {@code ZPageHandler}. */
@@ -73,12 +75,12 @@ static Map<String, String> uriQueryToMap(URI uri) {
7375
return Collections.emptyMap();
7476
}
7577
Map<String, String> result = new HashMap<String, String>();
76-
for (String param : query.split("&")) {
77-
String[] pair = param.split("=");
78-
if (pair.length > 1) {
79-
result.put(pair[0], pair[1]);
78+
for (String param : Splitter.on("&").split(query)) {
79+
List<String> splits = Splitter.on("=").splitToList(param);
80+
if (splits.size() > 1) {
81+
result.put(splits.get(0), splits.get(1));
8082
} else {
81-
result.put(pair[0], "");
83+
result.put(splits.get(0), "");
8284
}
8385
}
8486
return result;

exporters/trace/stackdriver/src/test/java/io/opencensus/exporter/trace/stackdriver/StackdriverV2ExporterHandlerProtoTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public void generateSpan() {
131131
SpanData.create(
132132
spanContext,
133133
parentSpanId,
134-
true,
134+
/* hasRemoteParent= */ true,
135135
SPAN_NAME,
136136
startTimestamp,
137137
attributes,

gradle/errorprone/experimental_errors

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ errorProneExperimentalErrors = \
2222
-Xep:NumericEquality:ERROR,\
2323
-Xep:ParameterPackage:ERROR,\
2424
-Xep:ProtoStringFieldReferenceEquality:ERROR,\
25-
-Xep:QualifierOrScopeOnInjectMethod:ERROR,\
25+
-Xep:RestrictTo:ERROR,\
2626
-Xep:StaticOrDefaultInterfaceMethod:ERROR,\
2727
-Xep:UnlockMethod:ERROR

gradle/errorprone/experimental_suggestions

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
# FieldMissingNullable is turned off due to
2-
# https://github.com/google/error-prone/issues/823.
1+
# FieldMissingNullable is marked as WARN
2+
# detects errors in autovalue generated code.
33

44
# ReturnMissingNullable is turned off because it
55
# conflicts with Checker Framework null analysis.
66

77
errorProneExperimentalSuggestions = \
8+
-Xep:BooleanParameter:ERROR,\
89
-Xep:ConstantField:ERROR,\
910
-Xep:EmptySetMultibindingContributions:ERROR,\
10-
-Xep:FieldMissingNullable:OFF,\
11+
-Xep:FieldMissingNullable:WARN,\
12+
-Xep:LambdaFunctionalInterface:ERROR,\
1113
-Xep:MethodCanBeStatic:ERROR,\
1214
-Xep:MixedArrayDimensions:ERROR,\
1315
-Xep:MultiVariableDeclaration:ERROR,\
@@ -20,7 +22,9 @@ errorProneExperimentalSuggestions = \
2022
-Xep:PrivateConstructorForUtilityClass:ERROR,\
2123
-Xep:RemoveUnusedImports:ERROR,\
2224
-Xep:ReturnMissingNullable:OFF,\
25+
-Xep:SwitchDefault:ERROR,\
2326
-Xep:ThrowsUncheckedException:ERROR,\
27+
-Xep:TypeParameterNaming:ERROR,\
2428
-Xep:UngroupedOverloads:ERROR,\
2529
-Xep:UnnecessarySetDefault:ERROR,\
2630
-Xep:UnnecessaryStaticImport:ERROR,\

gradle/errorprone/experimental_warnings

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ errorProneExperimentalWarnings = \
22
-Xep:AssertFalse:ERROR,\
33
-Xep:AssistedInjectAndInjectOnConstructors:ERROR,\
44
-Xep:BigDecimalLiteralDouble:ERROR,\
5+
-Xep:BinderIdentityRestoredDangerously:ERROR,\
56
-Xep:BindingToUnqualifiedCommonType:ERROR,\
67
-Xep:ConstructorInvokesOverridable:ERROR,\
78
-Xep:ConstructorLeaksThis:ERROR,\
89
-Xep:EmptyTopLevelDeclaration:ERROR,\
910
-Xep:ExpectedExceptionChecker:ERROR,\
11+
-Xep:FunctionalInterfaceClash:ERROR,\
1012
-Xep:HardCodedSdCardPath:ERROR,\
1113
-Xep:InconsistentOverloads:ERROR,\
1214
-Xep:MissingDefault:ERROR,\
@@ -18,6 +20,7 @@ errorProneExperimentalWarnings = \
1820
-Xep:RedundantThrows:ERROR,\
1921
-Xep:StaticQualifiedUsingExpression:ERROR,\
2022
-Xep:StringEquality:ERROR,\
23+
-Xep:StringSplit:ERROR,\
2124
-Xep:TestExceptionChecker:ERROR,\
2225
-Xep:UnnecessaryDefaultInEnumSwitch:ERROR,\
2326
-Xep:Var:OFF

gradle/errorprone/warnings

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# NarrowingCompoundAssignment is marked as WARN
2+
# detects errors in autovalue generated code.
3+
14
errorProneWarnings = \
25
-Xep:AmbiguousMethodReference:ERROR,\
36
-Xep:ArgumentSelectionDefectChecker:ERROR,\
@@ -8,22 +11,26 @@ errorProneWarnings = \
811
-Xep:BoxedPrimitiveConstructor:ERROR,\
912
-Xep:CannotMockFinalClass:ERROR,\
1013
-Xep:CanonicalDuration:ERROR,\
14+
-Xep:CatchFail:ERROR,\
1115
-Xep:ClassCanBeStatic:ERROR,\
1216
-Xep:ClassNewInstance:ERROR,\
1317
-Xep:CollectionToArraySafeParameter:ERROR,\
1418
-Xep:CollectorShouldNotUseState:ERROR,\
1519
-Xep:ComparableAndComparator:ERROR,\
20+
-Xep:DateFormatConstant:ERROR,\
1621
-Xep:DefaultCharset:ERROR,\
1722
-Xep:DoubleCheckedLocking:ERROR,\
1823
-Xep:EqualsHashCode:ERROR,\
1924
-Xep:EqualsIncompatibleType:ERROR,\
25+
-Xep:FallThrough:ERROR,\
2026
-Xep:Finally:ERROR,\
27+
-Xep:FloatCast:ERROR,\
2128
-Xep:FloatingPointLiteralPrecision:ERROR,\
2229
-Xep:FragmentInjection:ERROR,\
2330
-Xep:FragmentNotInstantiable:ERROR,\
24-
-Xep:FunctionalInterfaceClash:ERROR,\
2531
-Xep:FutureReturnValueIgnored:ERROR,\
2632
-Xep:GetClassOnEnum:ERROR,\
33+
-Xep:HidingField:ERROR,\
2734
-Xep:ImmutableAnnotationChecker:ERROR,\
2835
-Xep:ImmutableEnumChecker:ERROR,\
2936
-Xep:IncompatibleModifiers:ERROR,\
@@ -39,11 +46,12 @@ errorProneWarnings = \
3946
-Xep:JavaLangClash:ERROR,\
4047
-Xep:JdkObsolete:ERROR,\
4148
-Xep:LogicalAssignment:ERROR,\
49+
-Xep:MissingCasesInEnumSwitch:ERROR,\
4250
-Xep:MissingFail:ERROR,\
4351
-Xep:MissingOverride:ERROR,\
52+
-Xep:ModifyCollectionInEnhancedForLoop:ERROR,\
4453
-Xep:MultipleParallelOrSequentialCalls:ERROR,\
4554
-Xep:MutableConstantField:ERROR,\
46-
-Xep:NamedParameters:ERROR,\
4755
-Xep:NarrowingCompoundAssignment:WARN,\
4856
-Xep:NestedInstanceOfConditions:ERROR,\
4957
-Xep:NonAtomicVolatileUpdate:ERROR,\
@@ -59,17 +67,22 @@ errorProneWarnings = \
5967
-Xep:ParameterName:ERROR,\
6068
-Xep:PreconditionsInvalidPlaceholder:ERROR,\
6169
-Xep:ProtoFieldPreconditionsCheckNotNull:ERROR,\
70+
-Xep:QualifierOrScopeOnInjectMethod:ERROR,\
71+
-Xep:ReachabilityFenceUsage:ERROR,\
6272
-Xep:ReferenceEquality:ERROR,\
6373
-Xep:RequiredModifiers:ERROR,\
6474
-Xep:ShortCircuitBoolean:ERROR,\
65-
-Xep:SimpleDateFormatConstant:ERROR,\
6675
-Xep:StaticGuardedByInstance:ERROR,\
76+
-Xep:StringSplitter:ERROR,\
6777
-Xep:SynchronizeOnNonFinalField:ERROR,\
6878
-Xep:ThreadJoinLoop:ERROR,\
79+
-Xep:ThreadLocalUsage:ERROR,\
80+
-Xep:ThreeLetterTimeZoneID:ERROR,\
6981
-Xep:TruthConstantAsserts:ERROR,\
7082
-Xep:TypeParameterShadowing:ERROR,\
7183
-Xep:TypeParameterUnusedInFormals:ERROR,\
7284
-Xep:URLEqualsHashCode:ERROR,\
85+
-Xep:UnsafeFinalization:ERROR,\
7386
-Xep:UnsynchronizedOverridesSynchronized:ERROR,\
7487
-Xep:UseCorrectAssertInTests:ERROR,\
7588
-Xep:WaitNotInLoop:ERROR,\

0 commit comments

Comments
 (0)