You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Hiram Chirino (JIRA)" <ji...@apache.org> on 2010/04/23 14:49:25 UTC

[jira] Resolved: (AMQ-2707) activemq-protobuf: AltJavaGenerator generates syntactically incorrect Java for nested Messages

     [ https://issues.apache.org/activemq/browse/AMQ-2707?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hiram Chirino resolved AMQ-2707.
--------------------------------

    Resolution: Fixed

Awesome.  Thanks!  patch applied in rev 937273

> activemq-protobuf: AltJavaGenerator generates syntactically incorrect Java for nested Messages
> ----------------------------------------------------------------------------------------------
>
>                 Key: AMQ-2707
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2707
>             Project: ActiveMQ
>          Issue Type: Bug
>            Reporter: Richard Barnett
>         Attachments: AMQ-2707.zip
>
>
> I built activemq-protobuf from http://svn.apache.org/repos/asf/activemq/activemq-protobuf/trunk/ (r817001).
> I changed the configuration of the activemq-protobuf plugin in the activemq-protobuf-test pom.xml to use type {{alt}}.
> The plugin generates invalid Java for .proto files defining nested messages.
> An example:
> {code:title=Simple.proto}
> package foo;
> message Outer {
>   message Inner {
>     required string x = 1;
>   }
>   required Inner inner = 1;
> }
> {code}
> generates code including a method {{Simple.Outer.OuterBean.readExternal}}:
> {code:title=Simple.java}
> public void readExternal(java.io.DataInput in) throws java.io.IOException {
>   assert frozen==null : org.apache.activemq.protobuf.MessageBufferSupport.FORZEN_ERROR_MESSAGE;
>   bean = this;
>   frozen = null;
>   if( in.readBoolean() ) {
>     Outer.Inner.Outer.InnerBean o = new Outer.Inner.Outer.InnerBean();
>     o.readExternal(in);
>     f_inner = o;
>   } else {
>     f_inner = null;
>   }
> }
> {code}
> which fails to compile; it should refer to {{Outer.Inner.InnerBean}} rather than {{Outer.Inner.Outer.InnerBean}}.
> I'm attaching a zip containing a patch which I've tested with 4 levels of nesting, & some test .proto files.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.