Skip to content

Add lint unchecked and deprecated warnings to compiler config #94

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ allprojects {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

tasks.withType<JavaCompile> {
options.compilerArgs.add("-Xlint:unchecked")
options.isDeprecation = true
}
}

val testDependencies by configurations.creating {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public static void addMetadataAttributes(
}

public static Map<String, String> metadataToMap(Metadata metadata) {
Map<String, String> mapHeaders = new LinkedHashMap(metadata.keys().size());
Map<String, String> mapHeaders = new LinkedHashMap<>(metadata.keys().size());
for (String key : metadata.keys()) {
if (key.endsWith(Metadata.BINARY_HEADER_SUFFIX)) {
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ public <ReqT, RespT> ServerCall.Listener<ReqT> interceptCall(
FilterProvider.getFilterEvaluator().evaluateRequestHeaders(currentSpan, mapHeaders);
if (filterResult.blockExecution()) {
call.close(Status.PERMISSION_DENIED, new Metadata());
return NoopServerCallListener.INSTANCE;
@SuppressWarnings("unchecked")
ServerCall.Listener<ReqT> noop = NoopServerCallListener.INSTANCE;
return noop;
}

Listener<ReqT> serverCall = next.startCall(new TracingServerCall<>(call, currentSpan), headers);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ public static Object start(
ServletSpanDecorator.addSessionId(currentSpan, httpRequest);

// set request headers
@SuppressWarnings("unchecked")
Enumeration<String> headerNames = httpRequest.getHeaderNames();
Map<String, String> headers = new HashMap<>();
while (headerNames.hasMoreElements()) {
Expand Down