chkal/pf-issue-test — Issue #63: URL mapping with regexp pattern using OR causes StringIndexOutOfBoundsException
Author: chkal
Created: 2012-03-06 07:26:44+00:00
State: open
Labels: Type-Defect

Originally filed by **jamaweba...@gmail.com** on 2010-10-01T16:33:11

Google Code issue: http://code.google.com/p/prettyfaces/issues/detail?id=63

What steps will reproduce the problem?
1. Mapping defined via regexp pattern using |. See attached snippet
2. Uri matching the snippet entered, eg: index.jsf
3. java.lang.StringIndexOutOfBoundsException: String index out of range: -109
java.lang.String.substring(String.java:1937)
java.lang.String.substring(String.java:1904)
com.ocpsoft.pretty.faces.url.URLPatternParser.parse(URLPatternParser.java:168)
com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:91)

See attached debug from NetBeans with variable tracking in attached jpg.

This issue appears after migrating from ocpsoft-pretty-faces-2.0.4.jar to prettyfaces-jsf2-3.1.0.jar.
The previous version ocpsoft-pretty-faces-2.0.4.jarperformed the mapping without error.