[ 
https://issues.apache.org/jira/browse/THRIFT-5329?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18112882#comment-18112882
 ] 

Sylwester Lachiewicz commented on THRIFT-5329:
----------------------------------------------

Record correction: this ticket has never been worked on. The only commit citing 
it, [6c5f5c8a9|https://github.com/apache/thrift/commit/6c5f5c8a9], is an 
unrelated netstd change (THttpTransport constructor) with the wrong key in its 
subject, and PR #2299 was closed unmerged. Leaving the ticket open as a valid, 
untouched request.

> Shorten names of inner classes in Java code generated by the compiler
> ---------------------------------------------------------------------
>
>                 Key: THRIFT-5329
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5329
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Java - Compiler
>    Affects Versions: 0.13.0
>            Reporter: Denys Rtveliashvili
>            Priority: Minor
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> 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:
> {code:java}
> namespace java com.acmecorporation.projects.bestproductever
> service ExtremelyVeryImportantService {
>   string performImportantActionAndReportOnSuccess(1: string action)
> }
> {code}
>  
> The generated Java code may fail with an error like this:
> {noformat}
> /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{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
(v8.20.10#820010)

Reply via email to