rigd-loxia / builder-generator

Yet another builder generator. Primary style of this generator will be fluent wither, although other styles will be supported in the future. There is support for builder chaining.
Apache License 2.0
2 stars 2 forks source link

second level inner class generates faulty code. #27

Closed Zegveld closed 11 months ago

Zegveld commented 11 months ago

If you would have a class within a class within a class then the resulting builder does not compile.

reproduction:

@Builder
public class OuterClass {
  InnerClass inner; // skipping getters/setters/constructors
  static class InnerClass {
      InnerInnerClass innerInner; // skipping getters/setters/constructors
      static class InnerInnerClass {
          String someField; // skipping getters/setters/constructors
      }
  }
}

The resulting builder of the inner class now contains something like:

        private OuterClass.InnerClassBuilder.InnerInnerClassBuilder<InnerClassBuilder<PARENT>> innerInnerBuilder;

which should be:

        private OuterClassBuilder.InnerClassBuilder.InnerInnerClassBuilder<InnerClassBuilder<PARENT>> innerInnerBuilder;