Skip to content

Commit

Permalink
Use new java version features
Browse files Browse the repository at this point in the history
  • Loading branch information
a.yazychyan committed Jan 3, 2022
1 parent 0b8c815 commit 727b14b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ public void setValues(PreparedStatement ps) throws SQLException {
if (this.args != null && this.argTypes != null) {
for (int i = 0; i < this.args.length; i++) {
Object arg = this.args[i];
if (arg instanceof Collection && this.argTypes[i] != Types.ARRAY) {
Collection<?> entries = (Collection<?>) arg;
if (arg instanceof Collection<?> entries && this.argTypes[i] != Types.ARRAY) {
for (Object entry : entries) {
if (entry instanceof Object[] valueArray) {
for (Object argValue : valueArray) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,7 @@ public void setValues(PreparedStatement ps) throws SQLException {
}
declaredParameter = declaredParameters.get(i);
}
if (in instanceof Iterable && declaredParameter.getSqlType() != Types.ARRAY) {
Iterable<?> entries = (Iterable<?>) in;
if (in instanceof Iterable<?> entries && declaredParameter.getSqlType() != Types.ARRAY) {
for (Object entry : entries) {
if (entry instanceof Object[] valueArray) {
for (Object argValue : valueArray) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,7 @@ public String nextStringValue() throws DataAccessException {
String s = Long.toString(getNextKey());
int len = s.length();
if (len < this.paddingLength) {
StringBuilder sb = new StringBuilder(this.paddingLength);
for (int i = 0; i < this.paddingLength - len; i++) {
sb.append('0');
}
sb.append(s);
s = sb.toString();
s = "0".repeat(this.paddingLength - len) + s;
}
return s;
}
Expand Down

0 comments on commit 727b14b

Please sign in to comment.