[ https://issues.apache.org/jira/browse/LUCENE-10182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17430408#comment-17430408 ]
Uwe Schindler commented on LUCENE-10182: ---------------------------------------- Hi, I think we should not backport the changes. The last Lucene/Solr 8.11 release is on the go already, so it is not worth the trouble. The code may be untested, but that does not mean there's a bug in productive code. What I figured out when reading through the patch again: In TestRamUsageEstimator, the order of assertEquals is wrong: The expected value should come first (what RamUsageTester returns) and the value which we want to verify (the RamUsageEstimator static overload) should be second parameter. But that's just nitpicking. If you want to fix, make a PR. So I would close this issue now. > TestRamUsageEstimator asserts trivial equality > ---------------------------------------------- > > Key: LUCENE-10182 > URL: https://issues.apache.org/jira/browse/LUCENE-10182 > Project: Lucene - Core > Issue Type: Improvement > Reporter: Stefan Vodita > Assignee: Uwe Schindler > Priority: Major > Fix For: main (9.0) > > Time Spent: 20m > Remaining Estimate: 0h > > {{TestRamUsageEstimator.testStaticOverloads}} has serveral lines like: > {code:java} > assertEquals(sizeOf(array), sizeOf((Object) array)); > {code} > Both calls to {{sizeOf()}} fall back on {{RamUsageTester.sizeOf}}, making the > 2 calls identical. Instead, we would want one of the calls to go to > {{RamUsageEstimator.sizeOf}}. > > This issue came up while working on LUCENE-10129. A possible solution, as per > [~uschindler]'s suggestion, would be to remove the static import > {code:java} > import static org.apache.lucene.util.RamUsageTester.sizeOf; > {code} > Instead, we could be explicit on which method we are calling, like: > {code:java} > assertEquals(RamUsageEstimator.sizeOf(array), RamUsageTester.sizeOf(array)); > {code} > This could be replicated for other potentially confusing cases in the test > class. -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org