You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "Stefan Vodita (Jira)" <ji...@apache.org> on 2021/10/15 21:51:00 UTC

[jira] [Commented] (LUCENE-10182) TestRamUsageEstimator asserts trivial equality

    [ https://issues.apache.org/jira/browse/LUCENE-10182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17429494#comment-17429494 ] 

Stefan Vodita commented on LUCENE-10182:
----------------------------------------

[This PR|https://github.com/apache/lucene/pull/386] implements the solution described above.

> 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
>            Priority: Major
>
> {{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-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org