Changes to bring 2.2.0, 3.0.0 and 4.0.0 into alignment.#192
Conversation
|
|
||
|
|
||
| ============================================================= | ||
| Google Protobuf License: |
There was a problem hiding this comment.
Protobuf was used to test the UDF-8 code. Now that that has been removed, this license is no longer needed.
|
|
||
| Code locations: | ||
| ------------------------------------------------------------- | ||
| This product contains code for encoding, decoding and testing UTF8: |
There was a problem hiding this comment.
This was a typo, that I just discovered. Zero-allocation-hashing is used for xxHash testing, not UTF8.
| @@ -1,101 +1,102 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
There was a problem hiding this comment.
All format changes, except for the rename of one property.
| @@ -1,22 +1,22 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
There was a problem hiding this comment.
Format changes, removed Protobuf dependency.
| * @param byteOrder the ByteOrder to be used. It must be non-null. | ||
| * @return a new <i>Buffer</i> for read-only operations on the given ByteBuffer. | ||
| */ | ||
| static Buffer wrap(ByteBuffer byteBuffer, ByteOrder byteOrder) { |
There was a problem hiding this comment.
Formatting: For all the public classes under ds/memory/ and for methods with more than one parameter, I have each parameter on a separate line. This is not only more readable, but comparing APIs across similar classes is much easier too.
| */ | ||
| static Memory wrap(byte[] array, int offsetBytes, int lengthBytes, ByteOrder byteOrder) { | ||
| Objects.requireNonNull(array, "array must be non-null"); | ||
| ResourceImpl.checkBounds(offsetBytes, lengthBytes, array.length); |
There was a problem hiding this comment.
These checks are done at the next call.
| Objects.requireNonNull(byteOrder, "byteOrder must be non-null"); | ||
| if (array instanceof byte[]) { | ||
| ResourceImpl.checkBounds(offsetBytes, lengthBytes, ((byte[])array).length); | ||
| } |
There was a problem hiding this comment.
This fixes a subtle bug that is only encountered if the user tries to use the ds/internal/BaseWritableBufferImpl directly -- which is out-of-scope.
| int offsetBytes, | ||
| int lengthBytes, | ||
| ByteOrder byteOrder) { | ||
| return BaseWritableMemoryImpl.wrapHeapArray(array, offsetBytes, lengthBytes, true, byteOrder, null); |
There was a problem hiding this comment.
This fixes a subtle bug that has been there since 2.0.0: The user-specified ByteOrder was overridden with ByteOrder.nativeOrder(). -- This would have affected the BO on subsequent multi-byte method calls only if the user specified a non-native BO.
See comments associated with each file