You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Brian Forbis (JIRA)" <ji...@apache.org> on 2018/07/22 15:14:00 UTC

[jira] [Created] (THRIFT-4601) Thrift compiled java: Code too large for try statement

Brian Forbis created THRIFT-4601:
------------------------------------

             Summary: 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


 

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)