Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
Reviewed
Description
After readField using BytesWritable, the data length should be writable.getLength(), instead of writable.getBytes().length which is the buffer length.
This will cause returned Rename[] is longer than expected and may include some incorrect values (Currently they are Rename#NONE, and have not caused problem but code logic is incorrect).
BytesWritable writable = new BytesWritable(); writable.readFields(in); byte[] bytes = writable.getBytes(); Rename[] options = new Rename[bytes.length]; for (int i = 0; i < bytes.length; i++) { options[i] = Rename.valueOf(bytes[i]); }