Vararg version of set method added to domain object causes request factory validator to fail

61 views
Skip to first unread message

Michael Wiles

unread,
Apr 19, 2012, 7:16:48 AM4/19/12
to google-we...@googlegroups.com
I have a proxy with:

    public void setPlatforms(List<String> platforms);

and the domain object has:
    public void setPlatforms(List<String> platforms);

This works fine, now add to the Domain object a var args version of the method:

    public void setPlatforms(String ... platforms);

Request Factory Validator fails with the following stack trace:

[INFO] diagnostic error: java.lang.NullPointerException
at com.sun.tools.javac.code.Types$14.visitClassType(Types.java:1301)
at com.sun.tools.javac.code.Types$14.visitClassType(Types.java:1284)
at com.sun.tools.javac.code.Type$ClassType.accept(Type.java:554)
at com.sun.tools.javac.code.Types$DefaultTypeVisitor.visit(Types.java:3203)
at com.sun.tools.javac.code.Types.asSuper(Types.java:1281)
at com.sun.tools.javac.code.Types$14.visitClassType(Types.java:1297)
at com.sun.tools.javac.code.Types$14.visitClassType(Types.java:1284)
at com.sun.tools.javac.code.Type$ClassType.accept(Type.java:554)
at com.sun.tools.javac.code.Types$DefaultTypeVisitor.visit(Types.java:3203)
at com.sun.tools.javac.code.Types.asSuper(Types.java:1281)
at com.sun.tools.javac.code.Types$5.visitClassType(Types.java:409)
at com.sun.tools.javac.code.Types$5.visitClassType(Types.java:336)
at com.sun.tools.javac.code.Type$ClassType.accept(Type.java:554)
at com.sun.tools.javac.code.Types$DefaultTypeVisitor.visit(Types.java:3203)
at com.sun.tools.javac.code.Types.isSubtype(Types.java:332)
at com.sun.tools.javac.code.Types.isSubtype(Types.java:316)
at com.sun.tools.javac.model.JavacTypes.isSubtype(JavacTypes.java:80)
at com.google.web.bindery.requestfactory.apt.DomainChecker$MethodFinder.visitExecutable(DomainChecker.java:97)
at com.google.web.bindery.requestfactory.apt.DomainChecker$MethodFinder.visitExecutable(DomainChecker.java:48)
at com.sun.tools.javac.code.Symbol$MethodSymbol.accept(Symbol.java:1227)
at javax.lang.model.util.ElementScanner6.scan(ElementScanner6.java:122)
at com.google.web.bindery.requestfactory.apt.ScannerBase.scan(ScannerBase.java:63)
at com.google.web.bindery.requestfactory.apt.ScannerBase.scanAllInheritedMethods(ScannerBase.java:126)
at com.google.web.bindery.requestfactory.apt.DomainChecker$MethodFinder.visitType(DomainChecker.java:118)
at com.google.web.bindery.requestfactory.apt.DomainChecker$MethodFinder.visitType(DomainChecker.java:48)
at com.sun.tools.javac.code.Symbol$ClassSymbol.accept(Symbol.java:832)
at javax.lang.model.util.ElementScanner6.scan(ElementScanner6.java:122)
at com.google.web.bindery.requestfactory.apt.ScannerBase.scan(ScannerBase.java:63)
at com.google.web.bindery.requestfactory.apt.DomainChecker.visitExecutable(DomainChecker.java:164)
at com.google.web.bindery.requestfactory.apt.DomainChecker.visitExecutable(DomainChecker.java:42)
at com.sun.tools.javac.code.Symbol$MethodSymbol.accept(Symbol.java:1227)
at javax.lang.model.util.ElementScanner6.scan(ElementScanner6.java:122)
at com.google.web.bindery.requestfactory.apt.ScannerBase.scan(ScannerBase.java:63)
at com.google.web.bindery.requestfactory.apt.ScannerBase.scanAllInheritedMethods(ScannerBase.java:126)
at com.google.web.bindery.requestfactory.apt.DomainChecker.visitType(DomainChecker.java:263)
at com.google.web.bindery.requestfactory.apt.DomainChecker.visitType(DomainChecker.java:42)
at com.sun.tools.javac.code.Symbol$ClassSymbol.accept(Symbol.java:832)
at javax.lang.model.util.ElementScanner6.scan(ElementScanner6.java:122)
at com.google.web.bindery.requestfactory.apt.ScannerBase.scan(ScannerBase.java:63)
at com.google.web.bindery.requestfactory.apt.State.executeJobs(State.java:248)
at com.google.web.bindery.requestfactory.apt.RfValidator.process(RfValidator.java:83)

Anyone else had this issue? I guess it's an easy work around as I just remove the varargs method from the domain object - it's not crazy essential for obvious reasons.

GWT 2.4.0, Sun JDK 1.6.0, Using maven to run the annotation processor.

Is it worth logging a bug? Should at least record that this doesn't work as it had me stuck for a few days.

Tiago

unread,
Jan 17, 2013, 8:47:46 AM1/17/13
to google-we...@googlegroups.com
I just had this exact same issue. Thank you for posting it here, it was relatively easy to find this thread through Google. Otherwise I'd lose a lot of time!

It might be worthy logging a bug...

Nicolas Perez

unread,
Mar 18, 2016, 3:00:00 AM3/18/16
to GWT Users
Thank you Michael, I was fighting against this issue for hours
Reply all
Reply to author
Forward
0 new messages