The size of File is represented by int:
But in LessThanOperator and GreaterThanOperator convert the values to Double.
|
return Double.compare(attributeValue.doubleValue(), expectedValue.doubleValue()) > 0; |
|
return Double.compare(attributeValue.doubleValue(), expectedValue.doubleValue()) < 0; |
Why not just use Number.intValue() and Integer.compare()? Ideally, those should be long in my opinion, as the file size is represented as long in java.io.File class.
The
sizeofFileis represented byint:ood-interview/file_search/filesearch/filesystem/File.java
Line 11 in 29b9ddc
But in
LessThanOperatorandGreaterThanOperatorconvert the values toDouble.ood-interview/file_search/filesearch/operator/GreaterThanOperator.java
Line 7 in 29b9ddc
ood-interview/file_search/filesearch/operator/LessThanOperator.java
Line 7 in 29b9ddc
Why not just use
Number.intValue()andInteger.compare()? Ideally, those should belongin my opinion, as the file size is represented aslonginjava.io.Fileclass.