mkarneim / pojobuilder

A Java Code Generator for Pojo Builders
Other
334 stars 44 forks source link

Class-level annotation with one constructor no longer works #135

Closed drekbour closed 7 years ago

drekbour commented 7 years ago

I've just noticed that PB has lost the ability to put @GeneratePojoBuilder at the class level where this is one constructor only. This is a common Value Object pattern so really should be supported as @GPB cannot be used as a meta-annotation

@GeneratePojoBuilder
public class ABC{
  private final String x;
  public ABC(String x) {
    this.x = x;
  }
  public String getX(){
    return x;
  }
}

PB 3.5.0 says:

Error:(58, 33) java: constructor ABC in class com.abc.ABC cannot be applied to given types; required: java.lang.String found: no arguments reason: actual and formal argument lists differ in length

mkarneim commented 7 years ago

Alright, this is in the queue.