Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
Patch Available
Description
A file called "Constants.java" is generated per thrift file that includes any constants. This should be documented somewhere because if you have multiple thrift files sharing the same namespace there will be clashes.
(there is no "documentation" component so feel free to adjust those)
Attachments
Attachments
Issue Links
- blocks
-
THRIFT-2065 Not valid constants filename in Java
- Closed
- is related to
-
THRIFT-3838 Java - Add option to configure constants filename
- Open
I think really instead of documentation the Java generator shouldn't be clobbering constants defined in separate thrift files.
To the best of my understanding, most users are defining all constants in one file for each namespace so this doesn't become an issue. Documented or not, it still doesn't seem like a reasonable constraint for how you're allowed to define constants.
I have this patched in my local copy to just generate a separate .java file containing constants for each program (.thrift file) that contains them. This might not be an ideal solution for everyone but it's how I worked around it.
Any other suggestions?