File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
spring-jdbc/src/main/java/org/springframework/jdbc/core Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2018 the original author or authors.
2
+ * Copyright 2002-2020 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -513,12 +513,17 @@ public static void cleanupParameters(Object... paramValues) {
513
513
public static void cleanupParameters (Collection <?> paramValues ) {
514
514
if (paramValues != null ) {
515
515
for (Object inValue : paramValues ) {
516
- if (inValue instanceof DisposableSqlTypeValue ) {
517
- ((DisposableSqlTypeValue ) inValue ).cleanup ();
516
+ // Unwrap SqlParameterValue first...
517
+ if (inValue instanceof SqlParameterValue ) {
518
+ inValue = ((SqlParameterValue ) inValue ).getValue ();
518
519
}
519
- else if (inValue instanceof SqlValue ) {
520
+ // Check for disposable value types
521
+ if (inValue instanceof SqlValue ) {
520
522
((SqlValue ) inValue ).cleanup ();
521
523
}
524
+ else if (inValue instanceof DisposableSqlTypeValue ) {
525
+ ((DisposableSqlTypeValue ) inValue ).cleanup ();
526
+ }
522
527
}
523
528
}
524
529
}
You can’t perform that action at this time.
0 commit comments