milleruntime commented on PR #2777:
URL: https://github.com/apache/accumulo/pull/2777#issuecomment-1155517364
I wrote a simple test that writes and reads the Authorizations object and it
passes on main. I think changing the serialization breaks the API either way:
<pre>
fields marked transient:
Exception in toString(): java.lang.NullPointerException: Cannot invoke
"java.util.Set.iterator()" because "this.auths" is null
Dropped serializable:
java.io.NotSerializableException:
org.apache.accumulo.core.security.Authorizations
</pre>
Here is the test I added to AuthorizationsTest:
<pre>
@Test
public void testSerializable() throws Exception {
ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
ObjectOutputStream outputStream = new ObjectOutputStream(bytesOut);
Authorizations auths = new Authorizations("foo");
outputStream.writeObject(auths);
outputStream.flush();
ByteArrayInputStream bytesIn = new
ByteArrayInputStream(bytesOut.toByteArray());
ObjectInputStream inputStream = new ObjectInputStream(bytesIn);
Authorizations readObject = (Authorizations) inputStream.readObject();
assertEquals(auths, readObject);
}
</pre>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]