Invalid generic import and Primitive import while field is required in constructor. · Issue #22 · aludwiko/fluentbuilder · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a unexpected import while generic parameter is in constructor:
package com.example.model;
import java.util.List;
import info.ludwikowski.fluentbuilder.annotation.GenerateBuilder;
@GenerateBuilder
public class Foo {
private String var1;
private List<Bar> var2;
public Foo(String var1, List<Bar> var2) {
this.var1 = var1;
this.var2 = var2;
}
public String getVar1() {
return var1;
}
public List<Bar> getVar2() {
return var2;
}
}
And generic class definition:
package com.example.model;
public class Bar {
private String var1;
public Bar(String var1) {
this.var1 = var1;
}
public String getVar1() {
return var1;
}
}
Invalid builder for Foo is generated:
package com.example.model;
import info.ludwikowski.fluentbuilder.common.AbstractBuilderFactory;
import java.util.List<com.example.model.Bar>;
/**
* Fluent builder for Foo.
* Don't hesitate to put your custom methods here.
*/
public abstract class FooBudowniczy extends AbstrakcyjnyFooBudowniczy<FooBudowniczy> {
public static FooBudowniczy foo(String var1, List<Bar> var2){
return AbstractBuilderFactory.createImplementation(FooBudowniczy.class, var1, var2);
}
}
In import section the generic parameter is redundant: import java.util.List<com.example.model.Bar>;
The text was updated successfully, but these errors were encountered:
In addition, if in constructor there is an argument which is a primitive type, it is also added to imports.
Issue occurs only while running code generation via Processor, on tests all seems to be ok. While running generator via Processor there is another entry point for creating Constructor Mirror.
I will prepare a patch.
athlan
changed the title
Invalid generic import while field is required in constructor
Invalid generic import and Primitive import while field is required in constructor.
Aug 3, 2017
…required in constructor. (#23)
* bump version to 1.1.0.patch-generic-constructor-SNAPSHOT
* Support for generic types in constrcutor. Support for primitive types in constrcutor.
* CR suggestions for PR #23
There is a unexpected import while generic parameter is in constructor:
And generic class definition:
Invalid builder for Foo is generated:
In import section the generic parameter is redundant:
import java.util.List<com.example.model.Bar>;
The text was updated successfully, but these errors were encountered: