Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
New
Description
TestRamUsageEstimator.testStaticOverloads has serveral lines like:
assertEquals(sizeOf(array), sizeOf((Object) array));
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
import static org.apache.lucene.util.RamUsageTester.sizeOf;
Instead, we could be explicit on which method we are calling, like:
assertEquals(RamUsageEstimator.sizeOf(array), RamUsageTester.sizeOf(array));
This could be replicated for other potentially confusing cases in the test class.