You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the files FenwickTree.java, Matrix.java and SegmentTree.java (all in the folder \src\com\jwetherell\algorithms\data_structures), there are comments saying TODO: This is ugly and how to handle number overflow?. See example below.
These functions do the same things, therefore some refactoring could decrease code repetition. Specifically, a class could be created which holds functions for adding, subtracting, multiplying and comparing the different types BigDecimal, BigInteger, Long, Double, Float and Integer.
Furthermore, there seems to be no branch coverage for using these different types, since all tests just use Integers. Tests for the different types should be added.
We are a group of three students from the Royal Institute of Technology in Stockholm, Sweden. In the course we are currently taking we are suppsed to contribute to an open source project. Could we be assigned this task?
akerfel
changed the title
Refactor: centralize type handling for simple operations such as add and subtract.
Refactor: centralize type handling for simple operations such as add and subtract, and add branch coverage for this
Mar 1, 2022
In the files FenwickTree.java, Matrix.java and SegmentTree.java (all in the folder
\src\com\jwetherell\algorithms\data_structures
), there are comments sayingTODO: This is ugly and how to handle number overflow?
. See example below.These functions do the same things, therefore some refactoring could decrease code repetition. Specifically, a class could be created which holds functions for adding, subtracting, multiplying and comparing the different types BigDecimal, BigInteger, Long, Double, Float and Integer.
Furthermore, there seems to be no branch coverage for using these different types, since all tests just use Integers. Tests for the different types should be added.
The text was updated successfully, but these errors were encountered: