neo09 / gwt-platform

Automatically exported from code.google.com/p/gwt-platform
0 stars 0 forks source link

Build warning in Actions auto generated by @GenDispatch which have no input arguments #209

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use the @GenDispatch annotation to generate an Action which takes no input 
parameters.
2. This will produce a "local variable is never read" warning in the equals 
method.

Example:

in GetSelections.java:

@GenDispatch(isSecure = false)
  public class GetSelections {
    @Out(1)
    ArrayList<int> selections;
  }

in the generated GetSelectionsAction.java:

  @Override
  public boolean equals(Object other) {
    if (other != null && other.getClass().equals(this.getClass())) {
          GetSelectionsAction o = (GetSelectionsAction) other;
      return true
        ;
    }
    return false;
  }

What version of the product are you using? On what operating system?
Version 0.4 on Windows.

Original issue reported on code.google.com by cbrog...@gmail.com on 19 Sep 2010 at 2:28

GoogleCodeExporter commented 9 years ago
Btw, the fix for this is simple. Just don't execute the line:

  out.println("          " + className + " o = (" + className + ") other;");

in generateEquals in com.gwtplatform.annotation.processor.AnnotationHelper when 
fieldElements is empty.

Original comment by cbrog...@gmail.com on 20 Sep 2010 at 6:15

GoogleCodeExporter commented 9 years ago

Original comment by philippe.beaudoin on 20 Sep 2010 at 6:29

GoogleCodeExporter commented 9 years ago
I can merge this fix into the (not yet published) patch for issue 210: 
http://code.google.com/p/gwt-platform/issues/detail?id=210

Original comment by FloOn...@gmail.com on 21 Sep 2010 at 7:46

GoogleCodeExporter commented 9 years ago

Original comment by bren...@doherty.net.nz on 21 Sep 2010 at 11:48

GoogleCodeExporter commented 9 years ago

Original comment by philippe.beaudoin on 22 Sep 2010 at 1:40

GoogleCodeExporter commented 9 years ago

Original comment by FloOn...@gmail.com on 22 Sep 2010 at 11:52

GoogleCodeExporter commented 9 years ago

Original comment by goudreau...@gmail.com on 23 Sep 2010 at 10:20

GoogleCodeExporter commented 9 years ago

Original comment by FloOn...@gmail.com on 27 Sep 2010 at 8:59

GoogleCodeExporter commented 9 years ago
Fixed together with Issue 210 
(http://code.google.com/p/gwt-platform/issues/detail?id=210)

Original comment by FloOn...@gmail.com on 10 Oct 2010 at 4:08