Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-escaped closing curly brace in RegEx results in initialization error on Android #27467

Closed
manuel2295 opened this issue Sep 25, 2021 · 5 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) in: web Issues in web modules (web, webmvc, webflux, websocket) status: backported An issue that has been backported to maintenance branches type: regression A bug that is also a regression
Milestone

Comments

@manuel2295
Copy link

manuel2295 commented Sep 25, 2021

Affects: <5.2.4.RELEASE>


I am trying to use UriComponentsBuilder.newInstance() in my android application. But I keep getting this exception upon initialization. This happens starting from version 5.2.4.RELEASE.

java.lang.ExceptionInInitializerError
        at org.springframework.web.util.UriComponentsBuilder.newInstance(UriComponentsBuilder.java:172)
 Caused by: java.util.regex.PatternSyntaxException: Syntax error in regexp pattern near index 96
    ^(([^:/?#]+):)?(//(([^@\[/?#]*)@)?(\[[\p{XDigit}:.]*[%\p{Alnum}]*]|[^\[/?#:]*)(:(\d*(?:\{[^/]+?})?))?)?([^?#]*)(\?([^#]*))?(#(.*))?
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Sep 25, 2021
@sbrannen
Copy link
Member

sbrannen commented Oct 1, 2021

This appears to be a regression introduced in #24470 that only affects Android applications.

273812f#diff-b7ee321c4c2864dd3493c171d139fc498e11de4ef18cfc57dee3c6f5a84e3dc7L83

@sbrannen sbrannen added type: regression A bug that is also a regression and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Oct 1, 2021
@sbrannen sbrannen self-assigned this Oct 1, 2021
@sbrannen sbrannen added in: core Issues in core modules (aop, beans, core, context, expression) in: web Issues in web modules (web, webmvc, webflux, websocket) labels Oct 1, 2021
@sbrannen sbrannen added this to the 5.3.11 milestone Oct 1, 2021
@sbrannen sbrannen changed the title ExceptionInInitializerError for org.springframework.web.util.UriComponentsBuilder.newInstance on Android Non-escaped clsoing curly brace in RegEx results in ExceptionInInitializerError on Android Oct 1, 2021
@sbrannen sbrannen changed the title Non-escaped clsoing curly brace in RegEx results in ExceptionInInitializerError on Android Non-escaped clsoing curly brace in RegEx results in initializer error on Android Oct 1, 2021
@sbrannen sbrannen changed the title Non-escaped clsoing curly brace in RegEx results in initializer error on Android Non-escaped closing curly brace in RegEx results in initialization error on Android Oct 1, 2021
@sbrannen sbrannen added the for: backport-to-5.2.x Marks an issue as a candidate for backport to 5.2.x label Oct 1, 2021
@spring-projects-issues spring-projects-issues added status: backported An issue that has been backported to maintenance branches and removed for: backport-to-5.2.x Marks an issue as a candidate for backport to 5.2.x labels Oct 1, 2021
@sbrannen
Copy link
Member

sbrannen commented Oct 1, 2021

Fixed via f0aa4f4

@sbrannen sbrannen closed this as completed Oct 1, 2021
@sbrannen
Copy link
Member

sbrannen commented Oct 1, 2021

@manuel2295,

Congratulations on opening your first GitHub issue ever. 👍

The fix for this regression was applied to Spring Framework 5.2.x in commit 5a5f118 and will be available in upcoming snapshots for 5.2.18.

We would be grateful if you could verify that the fix works for you in 5.2.18.BUILD-SNAPSHOT and post back here with a comment to let us know. Details on how to consume snapshots can be found here.

Thanks

@sbrannen
Copy link
Member

sbrannen commented Oct 1, 2021

Our CI server appears to be down at the moment, so I'm not sure when the snapshot will be published.

@sbrannen
Copy link
Member

sbrannen commented Oct 1, 2021

Snapshots for 5.2.18 have been published now. So feel free to try it out and report back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) in: web Issues in web modules (web, webmvc, webflux, websocket) status: backported An issue that has been backported to maintenance branches type: regression A bug that is also a regression
Projects
None yet
Development

No branches or pull requests

3 participants