Uploaded image for project: 'mdsal'
  1. mdsal
  2. MDSAL-742

Sanititize bits type mapping

    XMLWordPrintable

Details

    • Evolve bits mapping

    Description

      We map a "bits" type to a dedicated TypeObject. We already have a ScalarTypeObject specialization which has getValue() method.
      Examining the generated code for a , it creates this atrocity:

          public static MyBits getDefaultInstance(final String defaultValue) {
              List<String> properties = Lists.newArrayList("bitOne",
              "bitTwo",
              "bitZero"
              );
              if (!properties.contains(defaultValue)) {
                  throw new IllegalArgumentException("invalid default parameter");
              }
              int i = 0;
              return new MyBits(
              properties.get(i++).equals(defaultValue) ? Boolean.TRUE : null,
              properties.get(i++).equals(defaultValue) ? Boolean.TRUE : null,
              properties.get(i++).equals(defaultValue) ? Boolean.TRUE : null
              );
          }
      

      There are so many things wrong in this mapping it's not even funny. Let's evolve this thing into something sane in terms of interface modeling, implementation design as well as interactions with runtime.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            rovarga Robert Varga
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: