Closed GoogleCodeExporter closed 8 years ago
JarJar was able to work on many of files from the Wicket JAR but always fails
when
attempting to use org/apache/wicket/validation/validator/StringValidator.class
from
the Wicket JAR.
Original comment by jon.for...@gmail.com
on 18 Dec 2007 at 2:45
I've also replicated this with wicket-1.3.0 final, JDK 1.5.0_08-b03, WinXP SP2,
jarjar1.0-rc6.
java.lang.StringIndexOutOfBoundsException: String index out of range: -3
at java.lang.String.substring(String.java:1768)
at com.tonicsystems.jarjar.PackageRemapper.mapPath(PackageRemapper.java:84)
at com.tonicsystems.jarjar.PackageRemapper.mapValue(PackageRemapper.java:101)
at com.tonicsystems.jarjar.asm.commons.RemappingClassAdapter.visitField(
Original comment by matt.r.p...@gmail.com
on 28 Jan 2008 at 12:07
I did a little debugging and found that the Exception is thrown when processing
org.apache.wicket.validation.validator.UrlValidator
The Exception happens when visiting the VALID_CHARS field. In UrlValidator the
field
is defined as
private static final String SPECIAL_CHARS = ";/@&=,.?:+$";
private static final String VALID_CHARS = "[^\\s" + SPECIAL_CHARS + "]";
Inside jarjar, the Exception is thrown from
PackageRemapper.mapPath(PackageRemapper.java:84). The method is called with a
path
value of "[^\s;/@&=,.?:+$]". When it gets to line 84 it tries to do this
s = s.substring(0, s.length() - RESOURCE_SUFFIX.length()) + end;
Here s = "[L\s;" and RESOURCE_SUFFIX = "RESOURCE", so the code throws
StringIndexOutOfBoundsException.
Original comment by matt.r.p...@gmail.com
on 28 Jan 2008 at 2:11
This is fixed in SVN.
Original comment by chris.no...@gmail.com
on 7 Feb 2008 at 1:53
Original issue reported on code.google.com by
jon.for...@gmail.com
on 18 Dec 2007 at 2:39Attachments: