Skip to content

Useless casts to primitive wrappers in asserts #28

@EgorkaKulikov

Description

@EgorkaKulikov

Consider a test, generated for FloatExamples.primitiveToWrapper

@Test public void testPrimitiveToWrapper_ALessThanZero() throws Throwable { FloatWrapper floatWrapper = new FloatWrapper(); Float actual = floatWrapper.primitiveToWrapper(-1.4E-45f); Float expected = 1.4E-45f; assertEquals(((Float) expected), ((Float) actual), 1.0E-6f); }

Assert statement may be simplified to

assertEquals(expected, actual, 1.0E-6f);
Note: you should be very careful while doing this issue! Extra casts lead to warnings, reduntant casts lead to compilation errors.

Metadata

Metadata

Assignees

Labels

comp-codegenIssue is related to code generatorpriority-top-focusTop priority chosen by dev team

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions