Skip to content

Commit 419ed19

Browse files
committed
XMLOutputFactory#newInstance
1 parent 53fcb4e commit 419ed19

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main/resources/META-INF/rewrite/javax.xml.stream.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ recipeList:
4646
---
4747
type: specs.openrewrite.org/v1beta/recipe
4848
name: org.openrewrite.java.migrate.javax.MigrateXMLOutputFactoryNewInstanceToNewFactory
49-
displayName: Use `javax.xml.stream.XMLOutputFactory#newFactory()`
49+
displayName: Use `javax.xml.stream.XMLOutputFactory#newFactory(String, ClassLoader)`
5050
description: '`javax.xml.stream.XMLOutputFactory#newInstance` has been deprecated Java 7.'
5151
recipeList:
5252
- org.openrewrite.java.ChangeMethodName:
53-
methodPattern: javax.xml.stream.XMLOutputFactory newInstance()
53+
methodPattern: javax.xml.stream.XMLOutputFactory newInstance(String, ClassLoader)
5454
newMethodName: newFactory

src/test/kotlin/org/openrewrite/java/migrate/javax/JavaxXmlStreamAPIsTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class JavaxXmlStreamAPIsTest : JavaRecipeTest {
7777
7878
public class Test {
7979
public void method() {
80-
XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
80+
XMLOutputFactory outputFactory = XMLOutputFactory.newInstance("test", Test.class.getClassLoader());
8181
}
8282
}
8383
""",
@@ -86,7 +86,7 @@ class JavaxXmlStreamAPIsTest : JavaRecipeTest {
8686
8787
public class Test {
8888
public void method() {
89-
XMLOutputFactory outputFactory = XMLOutputFactory.newFactory();
89+
XMLOutputFactory outputFactory = XMLOutputFactory.newFactory("test", Test.class.getClassLoader());
9090
}
9191
}
9292
"""

0 commit comments

Comments
 (0)