[
https://issues.apache.org/jira/browse/AVRO-261?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12830470#action_12830470
]
Philip Zeyliger commented on AVRO-261:
--------------------------------------
A few problems with the current patch:
LockableIArrayList isn't:
{noformat}
@Test
public void testLockStuff() {
LockableArrayList<Integer> x = new LockableArrayList<Integer>();
x.add(13);
x.lock();
Iterator<Integer> y = x.iterator();
y.next();
y.remove(); // this doesn't fail
// this isn't true
assertEquals(1, x.size());
}
{noformat}
Yes, Java's List interface is porous left and right. If there are serious
objections to depending on another jar (and I get that), let's just lift
Google's ImmutableList implementation (it's apache-licensed).
Also, this patch breaks GenAvro. GenAvro.java is generated by JavaCC, so if
you changed that locally, the change didn't get propagated.
-- Philip
> Allow Schemas to be immutable
> -----------------------------
>
> Key: AVRO-261
> URL: https://issues.apache.org/jira/browse/AVRO-261
> Project: Avro
> Issue Type: New Feature
> Components: java
> Reporter: Kevin Oliver
> Assignee: Thiruvalluvan M. G.
> Priority: Minor
> Attachments: AVRO-261.patch, AVRO-261.patch
>
>
> It would be nice if there was the ability to have an immutable Schema in
> java.
> Without this, it makes sharing schemas risky. Also, with this, we could
> (lazily) cache the hashCode which is a fairly expensive operation today,
> especially on something like a record.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.