redhat-developer / redhat-developer/vscode-java

ctor code snippet in nested class generates invalid constructor

Open
#2,467 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

code action codegen
Dominant language
TypeScript
Stars
2.3k
Forks
546
Avg merge
20h 1m
Merged PRs (30d)
11

Description

ctor code snippet used in nested class is generating constructor for encapsulating public class.

Environment
  • Operating System: Win 11
  • JDK version: openjdk 11.0.12 2021-07-20
  • Visual Studio Code version: 1.67.2
  • Java extension version: v1.6.0
public class CoinChange {
    private class CacheKey {
// ctor invoked, generates this invalid constructor:
        public CoinChange() {
            super();
        }
    }
}

invalid-ctor

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the ctor snippet in the nested CacheKey example using the reported Java extension setup. Trace the constructor-generation entry point for nested classes; done means the generated constructor targets CacheKey rather than the enclosing CoinChange class and produces valid Java.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, typescript, vscode
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.