Skip to content

Commit

Permalink
Widen struts.xml search
Browse files Browse the repository at this point in the history
  • Loading branch information
jkschneider committed Mar 1, 2024
1 parent 4fb3418 commit d0c6418
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -41,7 +42,7 @@ public String getDescription() {
@Override
public TreeVisitor<?, ExecutionContext> getVisitor() {
XPathMatcher actionMatcher = new XPathMatcher("//action");
return Preconditions.check(new FindSourceFiles("**/struts.xml"), new XmlIsoVisitor<ExecutionContext>() {
return Preconditions.check(new FindTags("/struts"), new XmlIsoVisitor<ExecutionContext>() {
@Override
public Xml.Tag visitTag(Xml.Tag tag, ExecutionContext ctx) {
if (actionMatcher.matches(getCursor())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ void findActions() {
</action>
</package>
</struts>
""",
spec -> spec.path("struts.xml")
"""
)
)
);
Expand Down

0 comments on commit d0c6418

Please sign in to comment.