Skip to content

Commit d66a60a

Browse files
Fix crash for empty properties on the url
1 parent 360ee52 commit d66a60a

File tree

1 file changed

+4
-1
lines changed
  • java/flight/flight-jdbc-driver/src/main/java/org/apache/arrow/driver/jdbc/utils

1 file changed

+4
-1
lines changed

java/flight/flight-jdbc-driver/src/main/java/org/apache/arrow/driver/jdbc/utils/UrlParser.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ public static Map<String, String> parse(String url, String separator) {
3737
for (String keyValue : keyValues) {
3838
int separatorKey = keyValue.indexOf("="); // Find the first equal sign to split key and value.
3939
String key = keyValue.substring(0, separatorKey);
40-
String value = keyValue.substring(separatorKey + 1);
40+
String value = "";
41+
if (!keyValue.endsWith("=")) { // Avoid crashes for empty values.
42+
value = keyValue.substring(separatorKey + 1);
43+
}
4144
resultMap.put(key, value);
4245
}
4346

0 commit comments

Comments
 (0)