Skip to content

Commit 24b57f1

Browse files
adjust formatted to lower java version
1 parent f2224b5 commit 24b57f1

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/test/java/com/fasterxml/jackson/dataformat/xml/node/JsonNodeMixedContent403Test.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,23 @@ public class JsonNodeMixedContent403Test extends XmlTestUtil
2020
public void testMixedContentBefore() throws Exception
2121
{
2222
// First, before elements:
23-
assertEquals(JSON_MAPPER.readTree(a2q("{'%s':'before','a':'1','b':'2'}".formatted(XmlTextPropertyNameHolder.PROPERTY_NAME))),
23+
assertEquals(JSON_MAPPER.readTree(a2q(String.format("{'%s':'before','a':'1','b':'2'}", XmlTextPropertyNameHolder.PROPERTY_NAME))),
2424
XML_MAPPER.readTree("<root>before<a>1</a><b>2</b></root>"));
2525
}
2626

2727
@Test
2828
public void testMixedContentBetween() throws Exception
2929
{
3030
// Second, between
31-
assertEquals(JSON_MAPPER.readTree(a2q("{'a':'1','%s':'between','b':'2'}".formatted(XmlTextPropertyNameHolder.PROPERTY_NAME))),
31+
assertEquals(JSON_MAPPER.readTree(a2q(String.format("{'a':'1','%s':'between','b':'2'}", XmlTextPropertyNameHolder.PROPERTY_NAME))),
3232
XML_MAPPER.readTree("<root><a>1</a>between<b>2</b></root>"));
3333
}
3434

3535
@Test
3636
public void testMixedContentAfter() throws Exception
3737
{
3838
// and then after
39-
assertEquals(JSON_MAPPER.readTree(a2q("{'a':'1','b':'2','%s':'after'}".formatted(XmlTextPropertyNameHolder.PROPERTY_NAME))),
39+
assertEquals(JSON_MAPPER.readTree(a2q(String.format("{'a':'1','b':'2','%s':'after'}", XmlTextPropertyNameHolder.PROPERTY_NAME))),
4040
XML_MAPPER.readTree("<root><a>1</a><b>2</b>after</root>"));
4141
}
4242

@@ -45,7 +45,7 @@ public void testMultipleMixedContent() throws Exception
4545
{
4646
// and then after
4747
assertEquals(JSON_MAPPER.readTree(
48-
a2q("{'%s':['first','second','third'],'a':'1','b':'2'}".formatted(XmlTextPropertyNameHolder.PROPERTY_NAME))),
48+
a2q(String.format("{'%s':['first','second','third'],'a':'1','b':'2'}", XmlTextPropertyNameHolder.PROPERTY_NAME))),
4949
XML_MAPPER.readTree("<root>first<a>1</a>second<b>2</b>third</root>"));
5050
}
5151

@@ -58,7 +58,7 @@ public void testMixed226() throws Exception
5858
+" mixed2</a>\n"
5959
+"</root>";
6060
JsonNode fromJson = JSON_MAPPER.readTree(
61-
a2q("{'a':{'%s':['mixed1 ',' mixed2'],'b':'leaf'}}".formatted(XmlTextPropertyNameHolder.PROPERTY_NAME)));
61+
a2q(String.format("{'a':{'%s':['mixed1 ',' mixed2'],'b':'leaf'}}", XmlTextPropertyNameHolder.PROPERTY_NAME)));
6262
assertEquals(fromJson, XML_MAPPER.readTree(XML));
6363
}
6464
}

src/test/java/com/fasterxml/jackson/dataformat/xml/stream/XmlParserTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ public void testXmlAttributes() throws Exception
345345
@Test
346346
public void testMixedContent() throws Exception
347347
{
348-
String exp = a2q("{'%1$s':'first','a':'123','%1$s':'second','b':'456','%1$s':'last'}".formatted(XmlTextPropertyNameHolder.PROPERTY_NAME));
348+
String exp = a2q(String.format("{'%1$s':'first','a':'123','%1$s':'second','b':'456','%1$s':'last'}", XmlTextPropertyNameHolder.PROPERTY_NAME));
349349
String result = _readXmlWriteJson("<root>first<a>123</a>second<b>456</b>last</root>");
350350

351351
//System.err.println("result = \n"+result);

0 commit comments

Comments
 (0)