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>
<groupId>com.google.flatbuffers</groupId>
<artifactId>flatbuffers-parent</artifactId>
<version>2.0.1</version>
<version>2.0.2</version>
</parent>
<artifactId>flatbuffers-java-grpc</artifactId>
<name>${project.artifactId}</name>

View File

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

View File

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

View File

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

View File

@@ -92,7 +92,7 @@ public class FlatBufferBuilder {
this.bb_factory = bb_factory;
if (existing_bb != null) {
bb = existing_bb;
bb.clear();
((Buffer) bb).clear();
bb.order(ByteOrder.LITTLE_ENDIAN);
} else {
bb = bb_factory.newByteBuffer(initial_size);
@@ -154,7 +154,7 @@ public class FlatBufferBuilder {
public FlatBufferBuilder init(ByteBuffer existing_bb, ByteBufferFactory bb_factory){
this.bb_factory = bb_factory;
bb = existing_bb;
bb.clear();
((Buffer) bb).clear();
bb.order(ByteOrder.LITTLE_ENDIAN);
minalign = 1;
space = bb.capacity();
@@ -235,7 +235,7 @@ public class FlatBufferBuilder {
*/
public void clear(){
space = bb.capacity();
bb.clear();
((Buffer) bb).clear();
minalign = 1;
while(vtable_in_use > 0) vtable[--vtable_in_use] = 0;
vtable_in_use = 0;
@@ -275,7 +275,7 @@ public class FlatBufferBuilder {
((Buffer) bb).position(0);
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);
nbb.put(bb);
return nbb;

View File

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

View File

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