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

Suppress empty range checkers

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • None
    • Binding codegen

      The following snippet:

      typedef timeticks {
        type uint32;
      }
      

      results in:

          private final Uint32 _value;
      
          private static void check_valueRange(final long value) {
      
          }
      
          @ConstructorParameters("value")
          public Timeticks(Uint32 _value) {
              if (_value != null) {
                  check_valueRange(_value.longValue());
              }
      
              CodeHelpers.requireValue(_value);
      
              this._value = _value;
          } 

      This also happens when the effective range covers the entire type.

      The problem seems to be that BindingGeneratorUtil (i.e. mdsal-binding-generator) does not filter implied ranges, but rather we filter them in RangeGenerator (i.e. mdsal-binding-java-api-generator) – at which point we do not have an easy way to suppress these.

      It would seem we should be able to filter the expressions before we emit Restrictions, and thus make it easy to skip the checks.

            SamoSchneider Samuel Schneider
            rovarga Robert Varga
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: