Skip to content
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ For protobuf-based codegen integrated with the Maven build system, you can use
<artifactId>protobuf-maven-plugin</artifactId>
<version>0.6.1</version>
<configuration>
<protocArtifact>com.google.protobuf:protoc:3.22.3:exe:${os.detected.classifier}</protocArtifact>
<protocArtifact>com.google.protobuf:protoc:3.23.4:exe:${os.detected.classifier}</protocArtifact>
<pluginId>grpc-java</pluginId>
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.56.0:exe:${os.detected.classifier}</pluginArtifact>
</configuration>
Expand Down Expand Up @@ -157,7 +157,7 @@ plugins {

protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.22.3"
artifact = "com.google.protobuf:protoc:3.23.4"
}
plugins {
grpc {
Expand Down Expand Up @@ -190,7 +190,7 @@ plugins {

protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.22.3"
artifact = "com.google.protobuf:protoc:3.23.4"
}
plugins {
grpc {
Expand Down
2 changes: 1 addition & 1 deletion api/src/context/java/io/grpc/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ public boolean isCurrent() {
* <p>Calling {@code cancel(null)} is the same as calling {@link #close}.
*
* @return {@code true} if this context cancelled the context and notified listeners,
* {@code false} if the context was already cancelled.
* {@code false} if the context was already cancelled.
*/
@CanIgnoreReturnValue
public boolean cancel(Throwable cause) {
Expand Down
2 changes: 1 addition & 1 deletion api/src/main/java/io/grpc/ManagedChannelBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -571,10 +571,10 @@ public T proxyDetector(ProxyDetector proxyDetector) {
* return o;
* }}</pre>
*
* @return this
* @throws IllegalArgumentException When the given serviceConfig is invalid or the current version
* of grpc library can not parse it gracefully. The state of the builder is unchanged if
* an exception is thrown.
* @return this
* @since 1.20.0
*/
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/5189")
Expand Down
30 changes: 15 additions & 15 deletions api/src/main/java/io/grpc/ServerInterceptors.java
Original file line number Diff line number Diff line change
Expand Up @@ -291,23 +291,23 @@ public ServerCall.Listener<WReqT> startCall(
final Metadata headers) {
final ServerCall<OReqT, ORespT> unwrappedCall =
new PartialForwardingServerCall<OReqT, ORespT>() {
@Override
protected ServerCall<WReqT, WRespT> delegate() {
return call;
}
@Override
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have to leave this as is - diamond notation does not work with anonymous classes in java 8.

protected ServerCall<WReqT, WRespT> delegate() {
return call;
}

@Override
public void sendMessage(ORespT message) {
final InputStream is = originalMethod.streamResponse(message);
final WRespT wrappedMessage = wrappedMethod.parseResponse(is);
delegate().sendMessage(wrappedMessage);
}
@Override
public void sendMessage(ORespT message) {
final InputStream is = originalMethod.streamResponse(message);
final WRespT wrappedMessage = wrappedMethod.parseResponse(is);
delegate().sendMessage(wrappedMessage);
}

@Override
public MethodDescriptor<OReqT, ORespT> getMethodDescriptor() {
return originalMethod;
}
};
@Override
public MethodDescriptor<OReqT, ORespT> getMethodDescriptor() {
return originalMethod;
}
};

final ServerCall.Listener<OReqT> originalListener = originalHandler
.startCall(unwrappedCall, headers);
Expand Down
2 changes: 1 addition & 1 deletion api/src/test/java/io/grpc/ForwardingServerCallTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void setUp() {
protected ServerCall<Integer, Integer> delegate() {
return serverCall;
}
};
};
}

@Test
Expand Down
37 changes: 19 additions & 18 deletions api/src/test/java/io/grpc/MetadataTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ public class MetadataTest {

private static final Metadata.BinaryMarshaller<Fish> FISH_MARSHALLER =
new Metadata.BinaryMarshaller<Fish>() {
@Override
public byte[] toBytes(Fish fish) {
return fish.name.getBytes(UTF_8);
}
@Override
public byte[] toBytes(Fish fish) {
return fish.name.getBytes(UTF_8);
}

@Override
public Fish parseBytes(byte[] serialized) {
return new Fish(new String(serialized, UTF_8));
}
};
@Override
public Fish parseBytes(byte[] serialized) {
return new Fish(new String(serialized, UTF_8));
}
};

private static class FishStreamMarsaller implements Metadata.BinaryStreamMarshaller<Fish> {
@Override
Expand Down Expand Up @@ -100,16 +100,16 @@ public int read() throws IOException {

private static final Metadata.BinaryStreamMarshaller<Fish> IMMUTABLE_FISH_MARSHALLER =
new Metadata.BinaryStreamMarshaller<Fish>() {
@Override
public InputStream toStream(Fish fish) {
return new FakeFishStream(fish);
}
@Override
public InputStream toStream(Fish fish) {
return new FakeFishStream(fish);
}

@Override
public Fish parseStream(InputStream stream) {
return ((FakeFishStream) stream).fish;
}
};
@Override
public Fish parseStream(InputStream stream) {
return ((FakeFishStream) stream).fish;
}
};

private static final String LANCE = "lance";
private static final byte[] LANCE_BYTES = LANCE.getBytes(US_ASCII);
Expand Down Expand Up @@ -313,6 +313,7 @@ public void verifyToString_usingBinary() {
}

@Test
@SuppressWarnings("StringCaseLocaleUsage") // System locale is exactly what we're testing.
public void testKeyCaseHandling() {
Locale originalLocale = Locale.getDefault();
Locale.setDefault(new Locale("tr", "TR"));
Expand Down
6 changes: 2 additions & 4 deletions api/src/test/java/io/grpc/StatusRuntimeExceptionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,13 @@ public void extendPreservesStack() {
@Test
public void extendAndOverridePreservesStack() {
final StackTraceElement element = new StackTraceElement("a", "b", "c", 4);
StatusRuntimeException exception =
new StatusRuntimeException(Status.CANCELLED, new Metadata()) {

StatusRuntimeException error = new StatusRuntimeException(Status.CANCELLED, new Metadata()) {
@Override
public synchronized Throwable fillInStackTrace() {
setStackTrace(new StackTraceElement[]{element});
return this;
}
};
assertThat(exception.getStackTrace()).asList().containsExactly(element);
assertThat(error.getStackTrace()).asList().containsExactly(element);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public enum MessageSize {
SMALL(10), MEDIUM(1024), LARGE(65536), JUMBO(1048576);

private final int bytes;

MessageSize(int bytes) {
this.bytes = bytes;
}
Expand All @@ -94,6 +95,7 @@ public enum FlowWindowSize {
SMALL(16383), MEDIUM(65535), LARGE(1048575), JUMBO(8388607);

private final int bytes;

FlowWindowSize(int bytes) {
this.bytes = bytes;
}
Expand Down
10 changes: 8 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ subprojects {

checkstyle {
configDirectory = file("$rootDir/buildscripts")
toolVersion = libs.checkstyle.get().version
toolVersion = JavaVersion.current().isJava11Compatible() ? libs.checkstyle.get().version : libs.checkstylejava8.get().version

ignoreFailures = false
if (rootProject.hasProperty("checkstyle.ignoreFailures")) {
ignoreFailures = rootProject.properties["checkstyle.ignoreFailures"].toBoolean()
Expand Down Expand Up @@ -245,6 +246,11 @@ subprojects {
options.errorprone.check("JavaUtilDate", CheckSeverity.OFF)
// The warning fails to provide a source location
options.errorprone.check("MissingSummary", CheckSeverity.OFF)

// TODO(https://github.com/grpc/grpc-java/issues/10372): remove when fixed.
if (JavaVersion.current().isJava11Compatible()) {
options.errorprone.check("StringCaseLocaleUsage", CheckSeverity.OFF)
}
}
tasks.named("compileTestJava").configure {
// LinkedList doesn't hurt much in tests and has lots of usages
Expand Down Expand Up @@ -573,7 +579,7 @@ tasks.register('checkForUpdates') {
if (oldResolved != newResolved) {
def oldId = oldResolved.id.componentIdentifier
def newId = newResolved.id.componentIdentifier
println("${newId.group}:${newId.module} ${oldId.version} -> ${newId.version}")
println("libs.${name} = ${newId.group}:${newId.module} ${oldId.version} -> ${newId.version}")
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion buildscripts/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
<property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
</module>
<module name="JavadocMethod">
<property name="scope" value="public"/>
<property name="accessModifiers" value="public"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
<!-- TOOD(ejona): Too restrictive for tests
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/io/grpc/internal/DelayedClientCall.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ private ScheduledFuture<?> scheduleDeadlineIfNeeded(
buf.append(String.format(Locale.US, ".%09d", nanos));
buf.append("s. ");

/** Cancels the call if deadline exceeded prior to the real call being set. */
/* Cancels the call if deadline exceeded prior to the real call being set. */
class DeadlineExceededRunnable implements Runnable {
@Override
public void run() {
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/io/grpc/internal/MessageDeframer.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ private enum State {
*
* @param listener listener for deframer events.
* @param decompressor the compression used if a compressed frame is encountered, with
* {@code NONE} meaning unsupported
* {@code NONE} meaning unsupported
* @param maxMessageSize the maximum allowed size for received messages.
*/
public MessageDeframer(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public void authRequired() throws Exception {
anyString(),
anyString(),
AdditionalMatchers.or(anyString(), ArgumentMatchers.<String>any())))
.thenReturn(auth);
.thenReturn(auth);
when(proxySelector.select(any(URI.class))).thenReturn(ImmutableList.of(proxy));

ProxiedSocketAddress detected = proxyDetector.proxyFor(destination);
Expand Down
20 changes: 10 additions & 10 deletions core/src/test/java/io/grpc/internal/TransportFrameUtilTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ public class TransportFrameUtilTest {

private static final BinaryMarshaller<String> UTF8_STRING_MARSHALLER =
new BinaryMarshaller<String>() {
@Override
public byte[] toBytes(String value) {
return value.getBytes(UTF_8);
}

@Override
public String parseBytes(byte[] serialized) {
return new String(serialized, UTF_8);
}
};
@Override
public byte[] toBytes(String value) {
return value.getBytes(UTF_8);
}

@Override
public String parseBytes(byte[] serialized) {
return new String(serialized, UTF_8);
}
};

private static final Metadata.Key<String> PLAIN_STRING =
Metadata.Key.of("plainstring", ASCII_STRING_MARSHALLER);
Expand Down
2 changes: 1 addition & 1 deletion examples/android/clientcache/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ android {
}

protobuf {
protoc { artifact = 'com.google.protobuf:protoc:3.22.3' }
protoc { artifact = 'com.google.protobuf:protoc:3.23.4' }
plugins {
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.58.0-SNAPSHOT' // CURRENT_GRPC_VERSION
}
Expand Down
2 changes: 1 addition & 1 deletion examples/android/helloworld/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ android {
}

protobuf {
protoc { artifact = 'com.google.protobuf:protoc:3.22.3' }
protoc { artifact = 'com.google.protobuf:protoc:3.23.4' }
plugins {
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.58.0-SNAPSHOT' // CURRENT_GRPC_VERSION
}
Expand Down
2 changes: 1 addition & 1 deletion examples/android/routeguide/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ android {
}

protobuf {
protoc { artifact = 'com.google.protobuf:protoc:3.22.3' }
protoc { artifact = 'com.google.protobuf:protoc:3.23.4' }
plugins {
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.58.0-SNAPSHOT' // CURRENT_GRPC_VERSION
}
Expand Down
2 changes: 1 addition & 1 deletion examples/android/strictmode/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ android {
}

protobuf {
protoc { artifact = 'com.google.protobuf:protoc:3.22.3' }
protoc { artifact = 'com.google.protobuf:protoc:3.23.4' }
plugins {
grpc { artifact = 'io.grpc:protoc-gen-grpc-java:1.58.0-SNAPSHOT' // CURRENT_GRPC_VERSION
}
Expand Down
2 changes: 1 addition & 1 deletion examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ targetCompatibility = 1.8
// Feel free to delete the comment at the next line. It is just for safely
// updating the version in our release process.
def grpcVersion = '1.58.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def protobufVersion = '3.22.3'
def protobufVersion = '3.23.4'
def protocVersion = protobufVersion

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion examples/example-alts/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ targetCompatibility = 1.8
// Feel free to delete the comment at the next line. It is just for safely
// updating the version in our release process.
def grpcVersion = '1.58.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def protocVersion = '3.22.3'
def protocVersion = '3.23.4'

dependencies {
// grpc-alts transitively depends on grpc-netty-shaded, grpc-protobuf, and grpc-stub
Expand Down
2 changes: 1 addition & 1 deletion examples/example-debug/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ targetCompatibility = 1.8
// Feel free to delete the comment at the next line. It is just for safely
// updating the version in our release process.
def grpcVersion = '1.58.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def protobufVersion = '3.22.3'
def protobufVersion = '3.23.4'

dependencies {
implementation "io.grpc:grpc-protobuf:${grpcVersion}"
Expand Down
2 changes: 1 addition & 1 deletion examples/example-debug/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<grpc.version>1.58.0-SNAPSHOT</grpc.version><!-- CURRENT_GRPC_VERSION -->
<protoc.version>3.22.3</protoc.version>
<protoc.version>3.23.4</protoc.version>
<!-- required for jdk9 -->
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
Expand Down
2 changes: 1 addition & 1 deletion examples/example-gauth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ targetCompatibility = 1.8
// Feel free to delete the comment at the next line. It is just for safely
// updating the version in our release process.
def grpcVersion = '1.58.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def protobufVersion = '3.22.3'
def protobufVersion = '3.23.4'
def protocVersion = protobufVersion


Expand Down
2 changes: 1 addition & 1 deletion examples/example-gauth/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<grpc.version>1.58.0-SNAPSHOT</grpc.version><!-- CURRENT_GRPC_VERSION -->
<protobuf.version>3.22.3</protobuf.version>
<protobuf.version>3.23.4</protobuf.version>
<!-- required for jdk9 -->
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
Expand Down
2 changes: 1 addition & 1 deletion examples/example-gcp-observability/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ targetCompatibility = 1.8
// Feel free to delete the comment at the next line. It is just for safely
// updating the version in our release process.
def grpcVersion = '1.58.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def protocVersion = '3.22.3'
def protocVersion = '3.23.4'

dependencies {
implementation "io.grpc:grpc-protobuf:${grpcVersion}"
Expand Down
2 changes: 1 addition & 1 deletion examples/example-hostname/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ targetCompatibility = 1.8
// Feel free to delete the comment at the next line. It is just for safely
// updating the version in our release process.
def grpcVersion = '1.58.0-SNAPSHOT' // CURRENT_GRPC_VERSION
def protobufVersion = '3.22.3'
def protobufVersion = '3.23.4'

dependencies {
implementation "io.grpc:grpc-protobuf:${grpcVersion}"
Expand Down
Loading