[
https://issues.apache.org/jira/browse/THRIFT-4601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16552050#comment-16552050
]
Brian Forbis commented on THRIFT-4601:
--------------------------------------
For the record, I ran into this issue with a thrift IDL file that I
auto-generate from a directory of ~ 200 models. This generated a single service
thrift file with ~2000 methods in it.
Generating perl and javascript code from this IDL works fine, however the
compiler would crash on compilation of the java service file.
> Thrift compiled java: Code too large for try statement
> ------------------------------------------------------
>
> Key: THRIFT-4601
> URL: https://issues.apache.org/jira/browse/THRIFT-4601
> Project: Thrift
> Issue Type: Bug
> Components: Java - Compiler
> Reporter: Brian Forbis
> Priority: Minor
>
>
> Java is limited to having 65535 methods per class file. Anything more than
> that would cause the java compiler to crash with errors such as:
> {{error: {{too many constants}}}}
> {{error: code too large for try statement}}
> While this likely means the user needs to refactor their IDL into multiple
> files and have multiple thrift services, the fact that this limitation does
> not exist in other languages can cause this error to come up in surprise when
> a user is generating java code for the first time
> My thoughts are that the thrift compiler should emit warnings when it parses
> an IDL that would not run in certain target languages. This way, even though
> Java might not currently be used, the user would know about this limitation
> ahead of time.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)