Uploaded image for project: 'WildFly Elytron'
  1. WildFly Elytron
  2. ELY-1078

Elytron MatchRule.toString() method throws StringIndexOutOfBoundsException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 1.1.0.Beta37
    • 1.1.0.Beta36
    • None
    • None

      In case when implementation of asString(StringBuilder b) for MatchRule does not change length of passed parameter (which is 0) then 'java.lang.StringIndexOutOfBoundsException: String index out of range: -1' is thrown for calling MatchRule.toString() due to calling StringBuilder.setLength(-1).

      e.g. MatchRule ALL in implementation asString(StringBuilder b) just returns passed parameter, which results to mentioned exception.

      Thrown exception:

      java.lang.StringIndexOutOfBoundsException: String index out of range: -1
      	at java.lang.AbstractStringBuilder.setLength(AbstractStringBuilder.java:180)
      	at java.lang.StringBuilder.setLength(StringBuilder.java:76)
      	at org.wildfly.security.auth.client.MatchRule.toString(MatchRule.java:581)
          ...
      

              darran.lofthouse@redhat.com Darran Lofthouse
              olukas Ondrej Lukas (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: