From a0e6ffecfded58ef4f59952faf603d71b0ec8f34 Mon Sep 17 00:00:00 2001 From: Willie Scholtz Date: Thu, 2 Jan 2025 11:44:37 +0100 Subject: [PATCH 1/4] Revert #3349 Regression when where node is used without new lines (cherry picked from commit 398fe8e280faa9005f5d2685ff4bc1311219fda5) --- .../scripting/xmltags/XMLScriptBuilder.java | 5 +- .../xmltags/XMLScriptBuilderTest.java | 63 ------------------- 2 files changed, 1 insertion(+), 67 deletions(-) delete mode 100644 src/test/java/org/apache/ibatis/scripting/xmltags/XMLScriptBuilderTest.java diff --git a/src/main/java/org/apache/ibatis/scripting/xmltags/XMLScriptBuilder.java b/src/main/java/org/apache/ibatis/scripting/xmltags/XMLScriptBuilder.java index b8102a87dad..6e9cafc1fb4 100644 --- a/src/main/java/org/apache/ibatis/scripting/xmltags/XMLScriptBuilder.java +++ b/src/main/java/org/apache/ibatis/scripting/xmltags/XMLScriptBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2009-2024 the original author or authors. + * Copyright 2009-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -80,9 +80,6 @@ protected MixedSqlNode parseDynamicTags(XNode node) { XNode child = node.newXNode(children.item(i)); if (child.getNode().getNodeType() == Node.CDATA_SECTION_NODE || child.getNode().getNodeType() == Node.TEXT_NODE) { String data = child.getStringBody(""); - if (data.trim().isEmpty()) { - continue; - } TextSqlNode textSqlNode = new TextSqlNode(data); if (textSqlNode.isDynamic()) { contents.add(textSqlNode); diff --git a/src/test/java/org/apache/ibatis/scripting/xmltags/XMLScriptBuilderTest.java b/src/test/java/org/apache/ibatis/scripting/xmltags/XMLScriptBuilderTest.java deleted file mode 100644 index 7d1ec46c8c6..00000000000 --- a/src/test/java/org/apache/ibatis/scripting/xmltags/XMLScriptBuilderTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2009-2024 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ibatis.scripting.xmltags; - -import static org.assertj.core.api.Assertions.*; -import static org.junit.Assert.assertEquals; - -import java.lang.reflect.Field; -import java.util.List; - -import org.apache.ibatis.mapping.SqlSource; -import org.apache.ibatis.parsing.XPathParser; -import org.apache.ibatis.session.Configuration; -import org.junit.jupiter.api.Test; - -class XMLScriptBuilderTest { - - @Test - void shouldEmptyTextNodesRemoved() throws Exception { - String xml = """ - - """; - SqlSource sqlSource = new XMLScriptBuilder(new Configuration(), new XPathParser(xml).evalNode("/script")) - .parseScriptNode(); - - Field rootSqlNodeFld = DynamicSqlSource.class.getDeclaredField("rootSqlNode"); - rootSqlNodeFld.setAccessible(true); - MixedSqlNode sqlNode = (MixedSqlNode) rootSqlNodeFld.get(sqlSource); - - Field contentsFld = MixedSqlNode.class.getDeclaredField("contents"); - contentsFld.setAccessible(true); - @SuppressWarnings("unchecked") - List contents = (List) contentsFld.get(sqlNode); - - assertEquals(3, contents.size()); - assertThat(contents.get(0)).isInstanceOf(StaticTextSqlNode.class); - assertThat(contents.get(1)).isInstanceOf(IfSqlNode.class); - assertThat(contents.get(2)).isInstanceOf(IfSqlNode.class); - } - -} From 342bc2cf6ad4012b2e034ee41d3744572abb153a Mon Sep 17 00:00:00 2001 From: Jeremy Landis Date: Thu, 2 Jan 2025 15:26:06 -0500 Subject: [PATCH 2/4] [ci] formatting --- .../org/apache/ibatis/scripting/xmltags/ForEachSqlNode.java | 2 +- .../java/org/apache/ibatis/scripting/xmltags/IfSqlNode.java | 2 +- .../org/apache/ibatis/scripting/xmltags/XMLScriptBuilder.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/apache/ibatis/scripting/xmltags/ForEachSqlNode.java b/src/main/java/org/apache/ibatis/scripting/xmltags/ForEachSqlNode.java index 08d46419813..2111f2f4a08 100644 --- a/src/main/java/org/apache/ibatis/scripting/xmltags/ForEachSqlNode.java +++ b/src/main/java/org/apache/ibatis/scripting/xmltags/ForEachSqlNode.java @@ -1,5 +1,5 @@ /* - * Copyright 2009-2023 the original author or authors. + * Copyright 2009-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/apache/ibatis/scripting/xmltags/IfSqlNode.java b/src/main/java/org/apache/ibatis/scripting/xmltags/IfSqlNode.java index bb15cc8a84b..b9b84554659 100644 --- a/src/main/java/org/apache/ibatis/scripting/xmltags/IfSqlNode.java +++ b/src/main/java/org/apache/ibatis/scripting/xmltags/IfSqlNode.java @@ -1,5 +1,5 @@ /* - * Copyright 2009-2022 the original author or authors. + * Copyright 2009-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/apache/ibatis/scripting/xmltags/XMLScriptBuilder.java b/src/main/java/org/apache/ibatis/scripting/xmltags/XMLScriptBuilder.java index 6e9cafc1fb4..e3f1131abde 100644 --- a/src/main/java/org/apache/ibatis/scripting/xmltags/XMLScriptBuilder.java +++ b/src/main/java/org/apache/ibatis/scripting/xmltags/XMLScriptBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2009-2023 the original author or authors. + * Copyright 2009-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From ee0d4f4831ffdd311b0183c202f4ad6492a3f404 Mon Sep 17 00:00:00 2001 From: Jeremy Landis Date: Thu, 2 Jan 2025 15:30:10 -0500 Subject: [PATCH 3/4] [maven-release-plugin] prepare release mybatis-3.5.19 --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 6a40b1e4d41..b16df56cc00 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,7 @@ org.mybatis mybatis - 3.5.19-SNAPSHOT + 3.5.19 mybatis The MyBatis SQL mapper framework makes it easier to use a relational database with object-oriented @@ -43,7 +43,7 @@ scm:git:ssh://git@github.com/mybatis/mybatis-3.git scm:git:ssh://git@github.com/mybatis/mybatis-3.git - HEAD + mybatis-3.5.19 https://github.com/mybatis/mybatis-3 @@ -99,7 +99,7 @@ -Xmx2048m -javaagent:${settings.localRepository}/net/bytebuddy/byte-buddy-agent/${byte-buddy.version}/byte-buddy-agent-${byte-buddy.version}.jar - 1735702000 + 1735849579 From 562819d406d5005094b28a732591040cdadc2d6b Mon Sep 17 00:00:00 2001 From: Jeremy Landis Date: Thu, 2 Jan 2025 15:30:13 -0500 Subject: [PATCH 4/4] [maven-release-plugin] prepare for next development iteration --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index b16df56cc00..88c809b23fa 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,7 @@ org.mybatis mybatis - 3.5.19 + 3.5.20-SNAPSHOT mybatis The MyBatis SQL mapper framework makes it easier to use a relational database with object-oriented @@ -43,7 +43,7 @@ scm:git:ssh://git@github.com/mybatis/mybatis-3.git scm:git:ssh://git@github.com/mybatis/mybatis-3.git - mybatis-3.5.19 + HEAD https://github.com/mybatis/mybatis-3 @@ -99,7 +99,7 @@ -Xmx2048m -javaagent:${settings.localRepository}/net/bytebuddy/byte-buddy-agent/${byte-buddy.version}/byte-buddy-agent-${byte-buddy.version}.jar - 1735849579 + 1735849813 pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy