diff --git a/pom.xml b/pom.xml index 6a40b1e4d41..88c809b23fa 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,7 @@ org.mybatis mybatis - 3.5.19-SNAPSHOT + 3.5.20-SNAPSHOT mybatis The MyBatis SQL mapper framework makes it easier to use a relational database with object-oriented @@ -99,7 +99,7 @@ -Xmx2048m -javaagent:${settings.localRepository}/net/bytebuddy/byte-buddy-agent/${byte-buddy.version}/byte-buddy-agent-${byte-buddy.version}.jar - 1735702000 + 1735849813 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 b8102a87dad..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-2024 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. @@ -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); - } - -} 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