thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Denys Rtveliashvili (Jira)" <>
Subject [jira] [Created] (THRIFT-5329) Shorten names of inner classes in Java code generated by the compiler
Date Sun, 03 Jan 2021 14:04:00 GMT
Denys Rtveliashvili created THRIFT-5329:

             Summary: Shorten names of inner classes in Java code generated by the compiler
                 Key: THRIFT-5329
             Project: Thrift
          Issue Type: Improvement
          Components: Java - Compiler
    Affects Versions: 0.13.0
            Reporter: Denys Rtveliashvili

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:
error: error while writing performImportantActionAndReportOnSuccess_argsStandardSchemeFactory:
File name too long{noformat}
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.

This message was sent by Atlassian Jira

View raw message