fairyhawk / protostuff

Automatically exported from code.google.com/p/protostuff
Apache License 2.0
0 stars 0 forks source link

Duplicate local variable in generated code for UiBinder #71

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Add ui:field='owner' to any widget in your ui file
--
   <g:FlowPanel>
        <g:HTMLPanel addStyleNames='{style.group}'>
            <table>
...
                <tr>
                    <td class='{style.textlabel}'>Owner:</td>
                    <td><g:InlineLabel ui:field='owner'/></td>
                </tr>
                <tr>
                    <td class='{style.textlabel}'>Points:</td>
                    <td><g:InlineLabel ui:field='points'/></td>
                </tr>
....
            </table>
        </g:HTMLPanel>
--
2. Create class for this ui-file
--
public class MyViewImpl {
...
@UiField InlineLabel owner;
@UiField InlineLabel points;
...
}
--

What is the expected output? What do you see instead?

During compile you will see a following errors:

---
Errors in 'generated://...'
Line 30: Duplicate local variable owner
Line 64: owner.owner cannot be resolved or is not a field
Line 65: owner.points cannot be resolved or is not a field
...
See snapshot /tmp/...

What version of the product are you using? On what operating system?
Version 2.3, Linux

Please provide any additional information below.

In generated file I've seen:
public com.google.gwt.user.client.ui.Widget createAndBindUi(final 
com.example.MyViewImpl owner) {
...
 com.google.gwt.user.client.ui.InlineLabel owner = (com.google.gwt.user.client.ui.InlineLabel)GWT.create(com.google.gwt.user.client.ui.InlineLabel.class);
...
owner.owner = owner;
owner.points = points;
...
}

Original issue reported on code.google.com by stanisla...@gmail.com on 6 Jul 2011 at 4:14

GoogleCodeExporter commented 8 years ago
OOPS, Sorry. Wrong project ;)

Original comment by stanisla...@gmail.com on 6 Jul 2011 at 4:23

GoogleCodeExporter commented 8 years ago
Haha.  Now that's a first :-)

Original comment by david.yu...@gmail.com on 7 Jul 2011 at 2:23