vscode-java-code-generator icon indicating copy to clipboard operation
vscode-java-code-generator copied to clipboard

Does not work with nested, inner class

Open rajinder-yadav opened this issue 4 years ago • 2 comments

Plugin version: 7.0.1 Platform: Linux

The wrong ctor is created when trying to create for inner class Product, also the indentation are off, see code below.

Other issues

  1. I am not able to generate getter, setter,
  2. wrong equals and hashCode is generated for inner class
  3. wrong toString generated for inner class

public class Cart {

  long id;
  long count;
  String user;

  class Product {

    long id;
    String name;
    String description;
    double price;


  public Cart(long id, long count, String user) {
    this.id = id;
    this.count = count;
    this.user = user;
  }


  }

}

rajinder-yadav avatar Jan 10 '21 23:01 rajinder-yadav

Stumbled upon this too, this is an important feature that is lacking. There are a lot of scenarios, e.g., patterns dictated by some widely used APIs that require inner classes to be declared. Not being able to generate constructors in such instances is a major drawback.

lorenz9314 avatar Jun 14 '22 06:06 lorenz9314

ditto

Gome510 avatar Dec 29 '22 21:12 Gome510