diff --git a/src/main/java/org/openrewrite/java/struts/search/FindStrutsActions.java b/src/main/java/org/openrewrite/java/struts/search/FindStrutsActions.java index 83fc31c..6225245 100644 --- a/src/main/java/org/openrewrite/java/struts/search/FindStrutsActions.java +++ b/src/main/java/org/openrewrite/java/struts/search/FindStrutsActions.java @@ -21,6 +21,7 @@ import org.openrewrite.marker.SearchResult; import org.openrewrite.xml.XPathMatcher; import org.openrewrite.xml.XmlIsoVisitor; +import org.openrewrite.xml.search.FindTags; import org.openrewrite.xml.tree.Xml; import java.util.stream.Collectors; @@ -41,7 +42,7 @@ public String getDescription() { @Override public TreeVisitor getVisitor() { XPathMatcher actionMatcher = new XPathMatcher("//action"); - return Preconditions.check(new FindSourceFiles("**/struts.xml"), new XmlIsoVisitor() { + return Preconditions.check(new FindTags("/struts"), new XmlIsoVisitor() { @Override public Xml.Tag visitTag(Xml.Tag tag, ExecutionContext ctx) { if (actionMatcher.matches(getCursor())) { diff --git a/src/test/java/org/openrewrite/java/struts/search/FindStrutsActionTest.java b/src/test/java/org/openrewrite/java/struts/search/FindStrutsActionTest.java index f14d9e5..9ccef2b 100644 --- a/src/test/java/org/openrewrite/java/struts/search/FindStrutsActionTest.java +++ b/src/test/java/org/openrewrite/java/struts/search/FindStrutsActionTest.java @@ -59,8 +59,7 @@ void findActions() { - """, - spec -> spec.path("struts.xml") + """ ) ) );