Skip to content

Conversation

@nevi-me
Copy link
Contributor

@nevi-me nevi-me commented Oct 17, 2025

When a table's name is called Table, the Java bindings generated result in an error due to there being 2 Tables. This fixes the issue by fully qualifyng the flatbuffers Table import.

Fixes #8728

When a table's name is called `Table`, the Java bindings generated result in an error due to there being  2 Tables. This fixes the issue by fully qualifyng the flatbuffers Table import.
@github-actions github-actions bot added c++ codegen Involving generating code from schema java labels Oct 17, 2025
@bjornharrtell
Copy link
Collaborator

@nevi-me why the alias _Vector for Vector?

@bjornharrtell bjornharrtell self-requested a review November 24, 2025 07:34
@maxburke
Copy link
Contributor

Same reason; conflicts with user-defined types named Vector

@nevi-me I think this change might be missing our change to the code from idl_gen_java.cpp that does the renaming of Vector to _Vector

bjornharrtell
bjornharrtell previously approved these changes Nov 25, 2025
@bjornharrtell bjornharrtell requested review from aardappel and removed request for aardappel November 25, 2025 08:31
@bjornharrtell
Copy link
Collaborator

@nevi-me this seems to be causing test failures, do you have possiblity to look at it?

@nevi-me
Copy link
Contributor Author

nevi-me commented Nov 25, 2025

@nevi-me this seems to be causing test failures, do you have possiblity to look at it?

I'll take a look today, thanks

@aardappel
Copy link
Collaborator

the renaming to _Vector causes a lot of churn, breaks the API, and makes the API uglier.. not sure that's worth it over resolving a possible name clash that we haven't had complaints about so far.

@maxburke
Copy link
Contributor

maxburke commented Nov 26, 2025

@aardappel Well, rather than complain about it, we're putting together this PR :) It's not a "possible name clash" for us, it's an actual name clash, and we have deployed code where renaming our Vector type is a really expensive change to make.

What would you suggest as an alternative?

@bjornharrtell
Copy link
Collaborator

Why not just fully qualify as with Table?

@aardappel
Copy link
Collaborator

"renaming our Vector type is a really expensive change to make" yes, that's just what I said about making the change on the FlatBuffers side. Except it is 1 user (you) vs potentially many FlatBuffers users affected, depending on how this collision gets fixed.

Maybe first lets understand the problem. How is your custom vector type set up in a way that it collides with these FlatBuffers Vector types, and why is that unavoidable? Agree with @bjornharrtell that in theory this should all be solvable with qualifying.

@maxburke
Copy link
Contributor

Maybe first lets understand the problem. How is your custom vector type set up in a way that it collides with these FlatBuffers Vector types, and why is that unavoidable? Agree with @bjornharrtell that in theory this should all be solvable with qualifying.

It's a table type called Vector. While some compilation errors can be resolved with full qualification the one we error we were unable to resolve is that the subclass cannot be named the same as its parent:

[ERROR] /Users/max/src/ul/ulsdk/java/src/main/java/com/urbanlogiq/ulsdk/types/generated/Vector.java:[78,23] class com.urbanlogiq.ulsdk.types.generated.Vector is already defined in package com.urbanlogiq.ulsdk.types.generated

@bjornharrtell bjornharrtell self-requested a review November 26, 2025 19:13
@bjornharrtell bjornharrtell dismissed their stale review November 26, 2025 19:14

I'm not convinced of rename of Vector.

@jtdavis777
Copy link
Collaborator

it seems there is some overlap with this PR and #8581

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ codegen Involving generating code from schema java

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Java] Schema types named 'Table' clash with the Table import

5 participants