Closed steven-sheehy closed 11 months ago
That is right. And strange.
I'll dig in my history to find why this code is generated. The sample you provided is quite clear. But there my be other cases where it's useful. And if so, this code should only be generated in theses cases...
Ok, I've checked that.
This control is useless in the case you've shown, of course.
But GraphQL allows things that are difficult to adapt in Java.
Here is a sample:
´´´ interface IP { attr : String! } type TP implements IP { attr : String! } interface I2 { a: IP } type T2 implements I2 { a: TP } ´´´
T2 must implement both ´setA(IP)´ and ´setA(TP)´. So you may call ´setA´ with a class of your own, that implement IP but is not an instance of TP.
But I was perhaps too careful.
I'll check if I can ease a little this control.
Étienne
The server model POJO generation triggers javac compiler warnings when
-Xlint:all
is passed to the compiler.The generated Java code seems to have a lot of unnecessary checks that can be removed since the setter already defines the exact type:
I think the following would be equivalent: