The termination handling logic in the readLine method conflicts with the annotation description (line 343) · Issue #348 · vigna/fastutil · GitHub
More Web Proxy on the site http://driver.im/
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
The comment clearly states that the terminator should not be included in the returned array, but the code adds CR or LF to the array when LF is not matched.
For example, when the user does not specify LF as the terminator, the code will still write LF characters to the array, which violates the design intent and may result in data errors.
The text was updated successfully, but these errors were encountered:
I think you're misreading the code.
Yes, the input has been restricted to LineTerminator; This
5F39
logic should be targeted at the CR_LF scenario.
I scanned the code statically using the Sophie tool. I have also discovered two other suspicious points. Can I discuss them with you?
Arrays.mergeSort(final int from, final int to, final IntComparator c, final Swapper swapper)
Using recursive implementation may result in stack overflow. When dealing with very large arrays, the recursion depth may exceed the default stack size of the Java Virtual Machine
Function.getOrDefault(final Object key, final V defaultValue)
The default implementation of the containsKey method (line 146) always returns true, which can cause the getOrDefault method (line 130) to fail to correctly determine whether the key actually exists. When get (key) returns null, even if the key does not exist, containsKey returning true will result in an incorrect return of null instead of defaultValue. This violates the standard behavior of Map.getOrDefault and is a functional logic error.
fastutil/src/it/unimi/dsi/fastutil/io/FastBufferedInputStream.java
Line 343 in ff5c6c5
The comment clearly states that the terminator should not be included in the returned array, but the code adds CR or LF to the array when LF is not matched.
For example, when the user does not specify LF as the terminator, the code will still write LF characters to the array, which violates the design intent and may result in data errors.
The text was updated successfully, but these errors were encountered: