Thursday, March 17, 2016

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

Thank you Michael, I was fighting against this issue for hours

On Thursday, April 19, 2012 at 1:16:48 PM UTC+2, Michael Wiles wrote:
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.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment