Problem
We ran
- org.openrewrite.java.InlineMethodCalls:
methodPattern: org.apache.maven.index.AbstractSearchResponse getTotalHits()
replacement: getTotalHitsCount()
Expected behavior
I expected red.getTotalHitsCount(), not getTotalHitsCount() in locations where originally a method select was present, and is still required.
Example diff
From: indexer-core/src/test/java/org/apache/maven/index/NexusIndexerTest.java
totalHits++;
}
- line = "### TOTAL:" + totalHits + " (response said " + res.getTotalHits() + ")";
+ line = "### TOTAL:" + totalHits + " (response said " + getTotalHitsCount() + ")";
if (print) {
System.out.println(line);
IteratorSearchResponse response = indexer.searchIterator(request);
- assertEquals(2, response.getTotalHits());
+ assertEquals(2, getTotalHitsCount());
for (ArtifactInfo ai : response.getResults()) {
assertEquals("qdox", ai.getGroupId(), "GroupId must match \"qdox\"!");
IteratorSearchResponse response = indexer.searchIterator(request);
- assertEquals(2, response.getTotalHits());
+ assertEquals(2, getTotalHitsCount());
assertTrue(response.getResults().hasNext(), "Iterator has to have next (2 found, 1 filtered out)");
Recipes in example diff:
org.openrewrite.java.InlineMethodCalls
References:
- View original result
- Recipe ID:
org.openrewrite.java.InlineMethodCalls
- Recipe Name:
Inline method calls
- Repository:
apache/maven-indexer/master
- Created at Sun May 03 2026 13:33:58 GMT+0200 (Central European Summer Time)
Problem
We ran
Expected behavior
I expected
red.getTotalHitsCount(), notgetTotalHitsCount()in locations where originally a method select was present, and is still required.Example diff
From:
indexer-core/src/test/java/org/apache/maven/index/NexusIndexerTest.javaRecipes in example diff:
org.openrewrite.java.InlineMethodCallsReferences:
org.openrewrite.java.InlineMethodCallsInline method callsapache/maven-indexer/master