Annotation Interface WithUtf8Length


@Target(TYPE_USE) @Retention(RUNTIME) public @interface WithUtf8Length
An annotation that applies to String to limit the length of the UTF-8 encoding of the string. In practical terms, this means that strings given this annotation will sometimes have a String.length() of less than min but will never exceed max.

Due to the fact that our String mutator is backed by the byte array mutator, it's difficult to know how many characters we'll get from the byte array we get from libfuzzer. Rather than reuse WithLength for strings which may give the impression that String.length() will return a value between min and max, we use this annotation to help make clear that the string consists of between min and max UTF-8 bytes, not necessarily (UTF-16) characters.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Defines the scope of the annotation.
    int
     
    int
     
  • Element Details

    • min

      int min
      Default:
      0
    • max

      int max
      Default:
      1000
    • constraint

      String constraint
      Defines the scope of the annotation. Possible values are defined in PropertyConstraint.
      Default:
      "JAZZER_PROPERTY_CONSTRAINT_DECLARATION"