avoiding more NoSuchMethod exceptions (#6671)

refs #6657
This commit is contained in:
Kamil Rojewski
2021-06-03 23:18:45 +02:00
committed by GitHub
parent 7c3e267e1e
commit 752c7b576d
7 changed files with 12 additions and 12 deletions

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.google.flatbuffers</groupId> <groupId>com.google.flatbuffers</groupId>
<artifactId>flatbuffers-parent</artifactId> <artifactId>flatbuffers-parent</artifactId>
<version>2.0.1</version> <version>2.0.2</version>
</parent> </parent>
<artifactId>flatbuffers-java-grpc</artifactId> <artifactId>flatbuffers-java-grpc</artifactId>
<name>${project.artifactId}</name> <name>${project.artifactId}</name>

View File

@@ -4,7 +4,7 @@
<groupId>com.google.flatbuffers</groupId> <groupId>com.google.flatbuffers</groupId>
<artifactId>flatbuffers-parent</artifactId> <artifactId>flatbuffers-parent</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>2.0.1</version> <version>2.0.2</version>
<name>flatbuffers-parent</name> <name>flatbuffers-parent</name>
<description>parent pom for flatbuffers java artifacts</description> <description>parent pom for flatbuffers java artifacts</description>
<properties> <properties>

View File

@@ -4,13 +4,13 @@
<parent> <parent>
<groupId>com.google.flatbuffers</groupId> <groupId>com.google.flatbuffers</groupId>
<artifactId>flatbuffers-parent</artifactId> <artifactId>flatbuffers-parent</artifactId>
<version>2.0.1</version> <version>2.0.2</version>
</parent> </parent>
<artifactId>grpc-test</artifactId> <artifactId>grpc-test</artifactId>
<description>Example/Test project demonstrating usage of flatbuffers with GRPC-Java instead of protobufs <description>Example/Test project demonstrating usage of flatbuffers with GRPC-Java instead of protobufs
</description> </description>
<properties> <properties>
<gRPC.version>2.0.1</gRPC.version> <gRPC.version>2.0.2</gRPC.version>
</properties> </properties>
<dependencies> <dependencies>
<dependency> <dependency>

View File

@@ -15,7 +15,7 @@ public class ByteBufferReadWriteBuf implements ReadWriteBuf {
@Override @Override
public void clear() { public void clear() {
buffer.clear(); ((Buffer) buffer).clear();
} }
@Override @Override

View File

@@ -92,7 +92,7 @@ public class FlatBufferBuilder {
this.bb_factory = bb_factory; this.bb_factory = bb_factory;
if (existing_bb != null) { if (existing_bb != null) {
bb = existing_bb; bb = existing_bb;
bb.clear(); ((Buffer) bb).clear();
bb.order(ByteOrder.LITTLE_ENDIAN); bb.order(ByteOrder.LITTLE_ENDIAN);
} else { } else {
bb = bb_factory.newByteBuffer(initial_size); bb = bb_factory.newByteBuffer(initial_size);
@@ -154,7 +154,7 @@ public class FlatBufferBuilder {
public FlatBufferBuilder init(ByteBuffer existing_bb, ByteBufferFactory bb_factory){ public FlatBufferBuilder init(ByteBuffer existing_bb, ByteBufferFactory bb_factory){
this.bb_factory = bb_factory; this.bb_factory = bb_factory;
bb = existing_bb; bb = existing_bb;
bb.clear(); ((Buffer) bb).clear();
bb.order(ByteOrder.LITTLE_ENDIAN); bb.order(ByteOrder.LITTLE_ENDIAN);
minalign = 1; minalign = 1;
space = bb.capacity(); space = bb.capacity();
@@ -235,7 +235,7 @@ public class FlatBufferBuilder {
*/ */
public void clear(){ public void clear(){
space = bb.capacity(); space = bb.capacity();
bb.clear(); ((Buffer) bb).clear();
minalign = 1; minalign = 1;
while(vtable_in_use > 0) vtable[--vtable_in_use] = 0; while(vtable_in_use > 0) vtable[--vtable_in_use] = 0;
vtable_in_use = 0; vtable_in_use = 0;
@@ -275,7 +275,7 @@ public class FlatBufferBuilder {
((Buffer) bb).position(0); ((Buffer) bb).position(0);
ByteBuffer nbb = bb_factory.newByteBuffer(new_buf_size); ByteBuffer nbb = bb_factory.newByteBuffer(new_buf_size);
new_buf_size = nbb.clear().capacity(); // Ensure the returned buffer is treated as empty new_buf_size = ((Buffer) nbb).clear().capacity(); // Ensure the returned buffer is treated as empty
((Buffer) nbb).position(new_buf_size - old_buf_size); ((Buffer) nbb).position(new_buf_size - old_buf_size);
nbb.put(bb); nbb.put(bb);
return nbb; return nbb;

View File

@@ -56,7 +56,7 @@ public class Utf8Old extends Utf8 {
if (cache.lastOutput == null || cache.lastOutput.capacity() < estimated) { if (cache.lastOutput == null || cache.lastOutput.capacity() < estimated) {
cache.lastOutput = ByteBuffer.allocate(Math.max(128, estimated)); cache.lastOutput = ByteBuffer.allocate(Math.max(128, estimated));
} }
cache.lastOutput.clear(); ((Buffer) cache.lastOutput).clear();
cache.lastInput = in; cache.lastInput = in;
CharBuffer wrap = (in instanceof CharBuffer) ? CharBuffer wrap = (in instanceof CharBuffer) ?
(CharBuffer) in : CharBuffer.wrap(in); (CharBuffer) in : CharBuffer.wrap(in);
@@ -68,7 +68,7 @@ public class Utf8Old extends Utf8 {
throw new IllegalArgumentException("bad character encoding", e); throw new IllegalArgumentException("bad character encoding", e);
} }
} }
cache.lastOutput.flip(); ((Buffer) cache.lastOutput).flip();
return cache.lastOutput.remaining(); return cache.lastOutput.remaining();
} }

View File

@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.google.flatbuffers</groupId> <groupId>com.google.flatbuffers</groupId>
<artifactId>flatbuffers-java</artifactId> <artifactId>flatbuffers-java</artifactId>
<version>2.0.1</version> <version>2.0.2</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>FlatBuffers Java API</name> <name>FlatBuffers Java API</name>
<description> <description>