[
https://issues.apache.org/jira/browse/AVRO-1642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14720286#comment-14720286
]
Sean Busbey commented on AVRO-1642:
-----------------------------------
You can feel free to start working on this now. Once I get jira permissions
straightened out I'll assign it to you.
I think "doesn't make a constructor" is a better and easier to work with
failure than "generates invalid bytecodes", so +1 on the approach. We should be
sure to generate a warning of some kind when this happens though, since it will
likely be surprising for users adding their 256th field.
Can we start with coming up with a test that fails? I imagine that even if the
sun compiler on linux generates invalid byte code it should fail when
attempting to load the class.
> JVM Spec Violation 255 Parameter Limit Exceeded
> ------------------------------------------------
>
> Key: AVRO-1642
> URL: https://issues.apache.org/jira/browse/AVRO-1642
> Project: Avro
> Issue Type: Bug
> Components: java
> Affects Versions: 1.7.7
> Environment: Windows/Linux all Java
> Reporter: Bryce Alcock
> Priority: Critical
> Labels: build, maven
>
> The JVM Spec indicates that:
> {quote}The number of method parameters is limited to 255 by the definition of
> a method descriptor (ยง4.3.3), where the limit includes one unit for this in
> the case of instance or interface method invocations. Note that a method
> descriptor is defined in terms of a notion of method parameter length in
> which a parameter of type long or double contributes two units to the length,
> so parameters of these types further reduce the limit. {quote}
> Avro Generated Java code with say more than 255 fields will create a
> constructor that is not valid and won't compile.
> Simple test is to create a 256 field avro schema, use the avro-maven auto
> code gen plugin, and try to compile the resulting class.
> DON'T use linux when doing this use windows, my suspicion is that Linux JavaC
> generates invalid byte code but does not complain.
> Windows will correctly complain indicating that you are a violator of the JVM
> specification.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)