ibauersachs / dnssecjava

A DNSSEC validating stub resolver for Java.
Other
43 stars 15 forks source link

PatternSyntaxException: Look-behind pattern matches must have a bounded maximum length #5

Closed schildbach closed 8 years ago

schildbach commented 8 years ago

I'm seeing this on version 1.1:

java.util.regex.PatternSyntaxException: Look-behind pattern matches must have a bounded maximum length near index 13:
(?<=\G.{255})
             ^
    at java.util.regex.Pattern.compileImpl(Native Method) ~[na:0.0]
    at java.util.regex.Pattern.compile(Pattern.java:407) ~[na:0.0]
    at java.util.regex.Pattern.<init>(Pattern.java:390) ~[na:0.0]
    at java.util.regex.Pattern.compile(Pattern.java:381) ~[na:0.0]
    at java.lang.String.split(String.java:1832) ~[na:0.0]
    at java.lang.String.split(String.java:1813) ~[na:0.0]
    at org.jitsi.dnssec.validator.ValidatingResolver.send(ValidatingResolver.java:1240) ~[na:0.0]
    at com.netki.dnssec.DNSSECResolver.resolve(DNSSECResolver.java:122) ~[na:0.0]
    at com.netki.WalletNameResolver.resolve(WalletNameResolver.java:149) ~[na:0.0]
ibauersachs commented 8 years ago

I can't reproduce that. Are you able to share the domain name where this happened? Otherwise I need to change the splitting to a plain old substringy loop with messy calculations...

schildbach commented 8 years ago

It doesn't depend on the data. It's an error with the pattern itself. But it seems as if this error only occurs on older Android versions (in this case: 4.3).

Related stackoverflow: http://stackoverflow.com/questions/19808875/look-behind-pattern-matches-must-have-a-bounded-maximum-length-near-index

schildbach commented 8 years ago

Your regexp seems to require Java7.

http://stackoverflow.com/questions/24256204/unknown-look-behind-group-near-index-in-java

ibauersachs commented 8 years ago

Works on Java 6 too. But I'll change it to a loop (will take me a week or so, unless you beat me with a PR).

ibauersachs commented 8 years ago

Changed in 7218e7287ee75b2b594924cafdf27c78da932595 and released as v1.1.1 on Central.

schildbach commented 8 years ago

Great, thanks!