]
Darran Lofthouse updated ELY-1078:
----------------------------------
Fix Version/s: 1.1.0.Beta49
(was: 1.1.0.Beta48)
Elytron MatchRule.toString() method throws
StringIndexOutOfBoundsException
--------------------------------------------------------------------------
Key: ELY-1078
URL:
https://issues.jboss.org/browse/ELY-1078
Project: WildFly Elytron
Issue Type: Bug
Affects Versions: 1.1.0.Beta36
Reporter: Ondrej Lukas
Assignee: Darran Lofthouse
Priority: Critical
Fix For: 1.1.0.Beta49
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:
{code}
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)
...
{code}