Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code generator updates and fix for a union with a discriminator referencing an enum type. #13

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Commits on May 19, 2018

  1. Re-run the code generator.

    ckenna committed May 19, 2018
    Configuration menu
    Copy the full SHA
    974438c View commit details
    Browse the repository at this point in the history
  2. Special handling for when a union's discriminator field is an enum.

    If a union uses a field as a discriminator but that field is defined as
    an enum type, then we have to reference it by name differently. This is
    because enum names have a different conversion from a QAPI name to a
    Java name. Sometimes, this name cannot easily be derived from the known
    information so far.
    
    Concretely, the following bug introduced this:
    1. The type "SysEmuTarget" is defined as an enum. One of its values is
       "x86_64".
    2. The type "CpuInfoFast" uses a field of the above type as a
       discriminator.
    3. In Java generated code, it was trying to reference SysEmuType.x8664.
       This type did not exist in the enum. It only has "x86_64".
    
    Now we save all enum fields and check if a union is referencing an
    enum explicitly. If it is, then we use the enum name for that field.
    ckenna committed May 19, 2018
    Configuration menu
    Copy the full SHA
    54af2ab View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ace4f50 View commit details
    Browse the repository at this point in the history
  4. Fix tests for new QAPI.

    ckenna committed May 19, 2018
    Configuration menu
    Copy the full SHA
    7e2eb34 View commit details
    Browse the repository at this point in the history