Skip to content

Commit c0901d7

Browse files
author
ct
committed
just minor refine.
1 parent da549fd commit c0901d7

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/main/java/org/apache/ibatis/scripting/defaults/DefaultParameterHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2022 the original author or authors.
2+
* Copyright 2009-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

src/main/java/org/apache/ibatis/scripting/xmltags/TrimSqlNode.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,13 @@ public String getSql() {
122122
}
123123

124124
private void applyPrefix(StringBuilder sql, String trimmedUppercaseSql) {
125-
if(prefixApplied) {
125+
if (prefixApplied) {
126126
return;
127127
}
128128
prefixApplied = true;
129129
if (prefixesToOverride != null) {
130-
prefixesToOverride.stream().filter(trimmedUppercaseSql::startsWith)
131-
.findFirst().ifPresent(toRemove-> sql.delete(0, toRemove.trim().length()));
130+
prefixesToOverride.stream().filter(trimmedUppercaseSql::startsWith).findFirst()
131+
.ifPresent(toRemove -> sql.delete(0, toRemove.trim().length()));
132132
}
133133
if (prefix != null) {
134134
sql.insert(0, " ").insert(0, prefix);
@@ -142,12 +142,12 @@ private void applySuffix(StringBuilder sql, String trimmedUppercaseSql) {
142142
suffixApplied = true;
143143
if (suffixesToOverride != null) {
144144
suffixesToOverride.stream()
145-
.filter(toRemove -> trimmedUppercaseSql.endsWith(toRemove) || trimmedUppercaseSql.endsWith(toRemove.trim()))
146-
.findFirst().ifPresent(toRemove -> {
147-
int start = sql.length() - toRemove.trim().length();
148-
int end = sql.length();
149-
sql.delete(start, end);
150-
});
145+
.filter(toRemove -> trimmedUppercaseSql.endsWith(toRemove) || trimmedUppercaseSql.endsWith(toRemove.trim()))
146+
.findFirst().ifPresent(toRemove -> {
147+
int start = sql.length() - toRemove.trim().length();
148+
int end = sql.length();
149+
sql.delete(start, end);
150+
});
151151
}
152152
if (suffix != null) {
153153
sql.append(" ").append(suffix);

src/site/es/xdoc/statement-builders.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
33
4-
Copyright 2009-2022 the original author or authors.
4+
Copyright 2009-2023 the original author or authors.
55
66
Licensed under the Apache License, Version 2.0 (the "License");
77
you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)