flatbuffers icon indicating copy to clipboard operation
flatbuffers copied to clipboard

[Java] incompatible types: possible lossy conversion from long to int

Open battre opened this issue 3 years ago • 3 comments

When trying to build FlatBuffers tests (revision https://github.com/google/flatbuffers/commit/0fe13cb28ce5a3fb81f654b21cb37c9821194962) for Java in Chrome, I get the following error message which looks to me like a plausible bug in the Java code generator:

../../third_party/flatbuffers/src/tests/MyGame/Example/StructOfStructs.java:55: error:
incompatible types: possible lossy conversion from long to int
     int _a_id = _o.getA().getId();
                                ^

While the revision is not the most recent one, the code still exists at https://github.com/google/flatbuffers/blob/master/tests/MyGame/Example/StructOfStructs.java

battre avatar Oct 20 '22 18:10 battre

I created MyGame/Example/StructOfStructs.java with flatc -j and it looks very different from what's checked in. Maybe the file is out of sync?

battre avatar Oct 20 '22 18:10 battre

In the current master branch the out-of-sync problem seems to be resolved.

battre avatar Oct 20 '22 19:10 battre

Is this all done?

dbaileychess avatar Oct 29 '22 17:10 dbaileychess

Yes.

battre avatar Nov 02 '22 11:11 battre