@@ -184,26 +184,27 @@ private Map<String, String> parseUrl(String url) throws SQLException {
184184 }
185185 properties .put (PARSE_URL_CONN_URL_PROP , uri .getScheme () + "://"
186186 + uri .getRawAuthority ()); // will be parsed again later
187+
187188 if (uri .getPath () != null
188- && !uri .getPath ().isBlank ()
189+ && !uri .getPath ().trim (). isEmpty ()
189190 && !"/" .equals (uri .getPath ()))
190191 {
191192 properties .put (
192193 ClientConfigProperties .DATABASE .getKey (),
193194 uri .getPath ().substring (1 ));
194195 }
195- if (uri .getQuery () != null && !uri .getQuery ().isBlank ()) {
196+ if (uri .getQuery () != null && !uri .getQuery ().trim (). isEmpty ()) {
196197 for (String pair : uri .getRawQuery ().split ("&" )) {
197198 String [] p = pair .split ("=" , 2 );
198199 if (p .length != 2 || p [0 ] == null || p [1 ] == null ) {
199200 throw new SQLException ("Invalid query parameter '" + pair + "'" );
200201 }
201202 String key = URLDecoder .decode (p [0 ], StandardCharsets .UTF_8 );
202- if (key == null || key .isBlank () || !PATTERN_HTTP_TOKEN .matcher (key ).matches ()) {
203+ if (key == null || key .trim (). isEmpty () || !PATTERN_HTTP_TOKEN .matcher (key ).matches ()) {
203204 throw new SQLException ("Invalid query parameter key in pair'" + pair + "'" );
204205 }
205206 String value = URLDecoder .decode (p [1 ], StandardCharsets .UTF_8 );
206- if (value == null || value .isBlank () || "=" .equals (value )) {
207+ if (value == null || value .trim (). isEmpty () || "=" .equals (value )) {
207208 throw new SQLException ("Invalid query parameter value in pair '" + pair + "'" );
208209 }
209210 properties .put (key .trim (), value );
0 commit comments