Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

org.openrewrite.staticanalysis.NoDoubleBraceInitialization drops constructor collection parameter #356

Open
blipper opened this issue Oct 10, 2024 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@blipper
Copy link
Contributor

blipper commented Oct 10, 2024

class A {
    void foo() {
   Map<String, String> a = Map.of("foo", "bar");
   Map<String, String> b = new HashMap<>(a) {{
        put("irrelevantKey", "irrelevantValue");
    }};
}
}

What did you expect to see?

class A {
    void foo() {
   Map<String, String> a = Map.of("foo", "bar");
   Map<String, String> b = new HashMap<>(a);
   b.put("irrelevantKey", "irrelevantValue");
}
}

What did you see instead?

class A {
    void foo() {
   Map<String, String> a = Map.of("foo", "bar");
   Map<String, String> b = new HashMap<>();
   b.put("irrelevantKey", "irrelevantValue");
}
}

What is the full stack trace of any errors you encountered?

stacktrace output here

Are you interested in contributing a fix to OpenRewrite?

@blipper blipper added the bug Something isn't working label Oct 10, 2024
@timtebeek timtebeek moved this to Backlog in OpenRewrite Oct 11, 2024
@timtebeek timtebeek added the good first issue Good for newcomers label Oct 11, 2024
@timtebeek timtebeek changed the title org.openrewrite.staticanalysis.NoDoubleBraceInitialization drops constructor collection parameter org.openrewrite.staticanalysis.NoDoubleBraceInitialization drops constructor collection parameter Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
Status: Backlog
Development

No branches or pull requests

2 participants