Skip to content
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

Fix compilation in Java 9 #3638

Merged
merged 2 commits into from
Mar 29, 2018
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
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,17 @@ script:
- ./gradlew check :grpc-all:jacocoTestReport

after_success:
- if \[ "$TRAVIS_OS_NAME" = linux \]; then ./gradlew :grpc-all:coveralls; fi
# Upload to coveralls once, instead of for each job in the matrix
- if \[\[ "$TRAVIS_JOB_NUMBER" == *.1 \]\]; then ./gradlew :grpc-all:coveralls; fi
- bash <(curl -s https://codecov.io/bash)

os:
- linux

jdk:
- oraclejdk8
- oraclejdk9

notifications:
email: false

Expand Down
1 change: 1 addition & 0 deletions benchmarks/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ dependencies {
libraries.netty_tcnative,
libraries.netty_epoll,
libraries.math
compileOnly libraries.javax_annotation
}

compileJava {
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ subprojects {
gson: "com.google.code.gson:gson:2.7",
guava: "com.google.guava:guava:${guavaVersion}",
hpack: 'com.twitter:hpack:0.10.1',
javax_annotation: 'javax.annotation:javax.annotation-api:1.2',
jsr305: 'com.google.code.findbugs:jsr305:3.0.0',
oauth_client: 'com.google.auth:google-auth-library-oauth2-http:0.9.0',
google_api_protos: 'com.google.api.grpc:proto-google-common-protos:1.0.0',
Expand Down
17 changes: 13 additions & 4 deletions core/src/test/java/io/grpc/AttributesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,20 @@ public void empty() {
}

@Test
@SuppressWarnings("BoxedPrimitiveConstructor")
public void valueEquality() {
Attributes.Key<Integer> key = Attributes.Key.of("ints");
Integer v1 = new Integer(100000);
Integer v2 = new Integer(100000);
class EqualObject {
@Override public boolean equals(Object o) {
return o instanceof EqualObject;
}

@Override public int hashCode() {
return 42;
}
}

Attributes.Key<EqualObject> key = Attributes.Key.of("ints");
EqualObject v1 = new EqualObject();
EqualObject v2 = new EqualObject();

assertNotSame(v1, v2);
assertEquals(v1, v2);
Expand Down
1 change: 1 addition & 0 deletions examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ dependencies {
compile "io.grpc:grpc-netty:${grpcVersion}"
compile "io.grpc:grpc-protobuf:${grpcVersion}"
compile "io.grpc:grpc-stub:${grpcVersion}"
compileOnly "javax.annotation:javax.annotation-api:1.2"

// Used for TLS in HelloWorldServerTls
compile "io.netty:netty-tcnative-boringssl-static:${nettyTcNativeVersion}"
Expand Down
1 change: 1 addition & 0 deletions grpclb/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ dependencies {
project(':grpc-protobuf'),
project(':grpc-stub'),
libraries.protobuf
compileOnly libraries.javax_annotation
testCompile libraries.truth,
project(':grpc-core').sourceSets.test.output
}
Expand Down
1 change: 1 addition & 0 deletions interop-testing/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ dependencies {
libraries.mockito,
libraries.oauth_client,
libraries.truth
compileOnly libraries.javax_annotation
runtime libraries.opencensus_impl,
libraries.netty_tcnative
testCompile project(':grpc-context').sourceSets.test.output
Expand Down
1 change: 1 addition & 0 deletions services/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ dependencies {
// we'll always be more up-to-date
exclude group: 'io.grpc', module: 'grpc-context'
}
compileOnly libraries.javax_annotation
testCompile project(':grpc-testing'),
libraries.netty_epoll // for DomainSocketAddress
signature "org.codehaus.mojo.signature:java16:1.1@signature"
Expand Down
1 change: 1 addition & 0 deletions testing-proto/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ buildscript {
dependencies {
compile project(':grpc-protobuf'),
project(':grpc-stub')
compileOnly libraries.javax_annotation
testCompile libraries.truth
}

Expand Down