Improve whitespace handling in oracle jdbc url parser (#12512)

This commit is contained in:
Lauri Tulmin 2024-10-24 20:58:30 +03:00 committed by GitHub
parent e3dc096ac3
commit ca44975c3b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View File

@ -530,10 +530,12 @@ public enum JdbcConnectionUrlParser {
},
ORACLE_AT() {
private final Pattern descriptionPattern = Pattern.compile("@\\s*\\(\\s*description");
@Override
@CanIgnoreReturnValue
DbInfo.Builder doParse(String jdbcUrl, DbInfo.Builder builder) {
if (jdbcUrl.contains("@(description")) {
if (descriptionPattern.matcher(jdbcUrl).find()) {
return ORACLE_AT_DESCRIPTION.doParse(jdbcUrl, builder);
}
String user;
@ -565,7 +567,7 @@ public enum JdbcConnectionUrlParser {
/**
* This parser can locate incorrect data if multiple addresses are defined but not everything is
* defined in the first block. (It would locate data from subsequent address blocks.
* defined in the first block. It would locate data from subsequent address blocks.
*/
ORACLE_AT_DESCRIPTION() {
private final Pattern hostPattern = Pattern.compile("\\(\\s*host\\s*=\\s*([^ )]+)\\s*\\)");