Skip to content

Commit

Permalink
avoiding more NoSuchMethod exceptions (#6671)
Browse files Browse the repository at this point in the history
refs #6657
  • Loading branch information
krojew authored Jun 3, 2021
1 parent 7c3e267 commit 752c7b5
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion grpc/flatbuffers-java-grpc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion grpc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
4 changes: 2 additions & 2 deletions grpc/tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion java/com/google/flatbuffers/ByteBufferReadWriteBuf.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public ByteBufferReadWriteBuf(ByteBuffer bb) {

@Override
public void clear() {
buffer.clear();
((Buffer) buffer).clear();
}

@Override
Expand Down
8 changes: 4 additions & 4 deletions java/com/google/flatbuffers/FlatBufferBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public FlatBufferBuilder(int initial_size, ByteBufferFactory bb_factory,
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);
Expand Down Expand Up @@ -154,7 +154,7 @@ public FlatBufferBuilder(ByteBuffer existing_bb) {
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();
Expand Down Expand Up @@ -235,7 +235,7 @@ public static boolean isFieldPresent(Table table, int offset) {
*/
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;
Expand Down Expand Up @@ -275,7 +275,7 @@ static ByteBuffer growByteBuffer(ByteBuffer bb, ByteBufferFactory bb_factory) {

((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;
Expand Down
4 changes: 2 additions & 2 deletions java/com/google/flatbuffers/Utf8Old.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public int encodedLength(CharSequence in) {
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);
Expand All @@ -68,7 +68,7 @@ public int encodedLength(CharSequence in) {
throw new IllegalArgumentException("bad character encoding", e);
}
}
cache.lastOutput.flip();
((Buffer) cache.lastOutput).flip();
return cache.lastOutput.remaining();
}

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 752c7b5

Please sign in to comment.