Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-4601

Thrift compiled java: Code too large for try statement

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Java - Compiler
    • Labels:
      None

      Description

       

      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.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              bforbis Brian Forbis
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: