gwtproject / gwt

GWT Open Source Project
http://www.gwtproject.org
1.52k stars 373 forks source link

NullPointerException when using RequestContext with Map #8602

Open dankurka opened 9 years ago

dankurka commented 9 years ago

Originally reported on Google Code with ID 8626

Found in GWT Release (e.g. 2.4.0, 2.5.1, trunk): 2.6.0

Encountered on OS / Browser (e.g. WinXP, IE9, FF10): all

Detailed description (please be as specific as possible):

Using java.util.map in a Request (Requestfactory) leads to a nullpointer exception.

Shortest code snippet which demonstrates issue (please indicate where
actual result differs from expected result):

@Service( MyService.class )
public interface MyServiceContext extends RequestContext {
    Request<Map<Integer, Integer>> getMap();
}

[INFO] java.lang.NullPointerException
[INFO] at com.google.web.bindery.requestfactory.gwt.rebind.RequestFactoryGenerator.writeContextImplementations(RequestFactoryGenerator.java:407)
[INFO] at com.google.web.bindery.requestfactory.gwt.rebind.RequestFactoryGenerator.generate(RequestFactoryGenerator.java:203)
[INFO] at com.google.gwt.core.ext.IncrementalGenerator.generateNonIncrementally(IncrementalGenerator.java:40)
[INFO] at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:676)

Workaround if you have one:

Wrap the Map in an EntityProxy or transport ordered Lists.

Links to relevant GWT Developer Forum posts:

https://groups.google.com/forum/#!topic/google-web-toolkit/Pg94PFTnT70

Link to patch posted at http://gwt-review.googlesource.com:

https://gwt-review.googlesource.com/#/c/6622/

Reported by thomas.welspacher on 2014-03-12 09:15:56

dankurka commented 9 years ago

Reported by t.broyer on 2014-03-13 12:01:03

dankurka commented 9 years ago
It's worth pointing out that the NPE happens during execution of the GWT compiler. Also,
the linked up patch (6622) only relates to documentation updates, not specifically
to this bug. Is there already a patch that's directly relevant to this issue? (Just
wondering whether there was some inadvertent copy & paste mix-up.) Would be great if
this got fixed for 2.6.1.

Reported by rcalmbac on 2014-03-18 23:46:12

dankurka commented 9 years ago
No, no patch yet.

It's unlikely to be fixed in 2.6.1 though. Support for Map is a new feature in 2.6.0,
and is just incomplete (only supported as part of proxy properties); and 2.6.1 aims
at fixing regressions and high-priority patches (we wouldn't want 2.6.1 to contain
regressions from 2.6.0).

Reported by t.broyer on 2014-03-20 10:28:55

dankurka commented 9 years ago
Hi, is this issue is planned to be fixed in a next release ?

Furthermore, why do we read this in the documentation if it's not supported ?

| Transportable types
| Map<K,V> where K and V are transportable types

Reported by garnier.raphael on 2014-12-11 07:26:10

dankurka commented 9 years ago
Issue 9050 has been merged into this issue.

Reported by t.broyer on 2015-02-03 09:44:06