Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
0.13.0
-
None
-
None
Description
Sometimes, when method names in IDL are particularly long, the compiler is generating Java code which cannot be compiled.
The class corresponding to a service contains two inner classes corresponding to the method and those inner classes contain private inner classes. There is a bit of tautology as the name of the method is present in both levels of inner classes.
For example, when the Thrift IDL looks like this:
namespace java com.acmecorporation.projects.bestproductever service ExtremelyVeryImportantService { string performImportantActionAndReportOnSuccess(1: string action) }
The generated Java code may fail with an error like this:
/home/user/src/thrift-code-example/target/generated-sources/thrift/com/acmecorporation/projects/bestproductever/ExtremelyVeryImportantService.java:[518,19] error: error while writing performImportantActionAndReportOnSuccess_argsStandardSchemeFactory: /home/user/src/thrift-code-example/target/classes/com/acmecorporation/projects/bestproductever/ExtremelyVeryImportantService$performImportantActionAndReportOnSuccess_args$performImportantActionAndReportOnSuccess_argsStandardSchemeFactory.class: File name too long
Naturally, there is more than one reason why the name is too long, but a simple optimisation can be made nevertheless by removing the name of method from the names of inner classes in the innermost level.
Attachments
Issue Links
- links to