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

Java is inconsistent checking for required fields

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.2
    • None
    • None
    • Patch Available

    Description

      In several places, the java generator does things like

      // Most existing Thrift code does not use isset or optional/required,
      // so we treat "default" fields as required.
      bool is_optional = (*m_iter)->get_req() == t_field::T_OPTIONAL;

      but it doesn't do so consistently. This replaces the remaining == REQUIRED checks with != OPTIONAL to also include fields in the DEFAULT state.

      Attachments

        Issue Links

          Activity

            People

              jbellis Jonathan Ellis
              jbellis Jonathan Ellis
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: