Skip to content

Null safety, diamond operator, and lambda cleanup #3352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/org/apache/ibatis/jdbc/AbstractSQL.java
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ private void sqlClause(SafeAppendable builder, String keyword, List<String> part
String last = "________";
for (int i = 0, n = parts.size(); i < n; i++) {
String part = parts.get(i);
if (i > 0 && !part.equals(AND) && !part.equals(OR) && !last.equals(AND) && !last.equals(OR)) {
if (i > 0 && !AND.equals(part) && !OR.equals(part) && !AND.equals(last) && !OR.equals(last)) {
builder.append(conjunction);
}
builder.append(part);
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/org/apache/ibatis/binding/BindingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void shouldSelectBlogWithPostsUsingSubSelect() {
void shouldFindPostsInList() {
try (SqlSession session = sqlSessionFactory.openSession()) {
BoundAuthorMapper mapper = session.getMapper(BoundAuthorMapper.class);
List<Post> posts = mapper.findPostsInList(new ArrayList<Integer>() {
List<Post> posts = mapper.findPostsInList(new ArrayList<>() {
private static final long serialVersionUID = 1L;
{
add(1);
Expand Down Expand Up @@ -430,7 +430,7 @@ void shouldExecuteBoundSelectOneBlogStatementWithConstructorUsingXMLConfig() {
void shouldSelectOneBlogAsMap() {
try (SqlSession session = sqlSessionFactory.openSession()) {
BoundBlogMapper mapper = session.getMapper(BoundBlogMapper.class);
Map<String, Object> blog = mapper.selectBlogAsMap(new HashMap<String, Object>() {
Map<String, Object> blog = mapper.selectBlogAsMap(new HashMap<>() {
private static final long serialVersionUID = 1L;
{
put("id", 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ class DataClass {
List<Future<Object>> futures = new ArrayList<>();
context.put("data", new DataClass());
ExecutorService executor = Executors.newCachedThreadPool();
IntStream.range(0, run).forEach(i -> {
futures.add(executor.submit(() -> OgnlCache.getValue("data.id", context)));
});
IntStream.range(0, run).forEach(i -> futures.add(executor.submit(() -> OgnlCache.getValue("data.id", context))));
for (int i = 0; i < run; i++) {
assertNotNull(futures.get(i).get());
}
Expand Down
Loading