-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Migrate code away from anonymous class using initializers #10633
Migrate code away from anonymous class using initializers #10633
Conversation
746e099
to
b5eb717
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you.
Does either ErrorProne or Modernizr provide some way to enforce this? |
I can try to imagine legitimate use-case for an initializer in an anonymous class. |
Also adds necessary dependencies to make sure such problems are detected in the module.
While it's possible to create a pre-populated collection using `new CollectionClass() { { ... add elements ... } }`, it is not the idiomatic way to do it.
checkRequest(server.takeRequest(5, TimeUnit.SECONDS), new HashMap<>() {{ | ||
put("Authorization", "Trust Me!"); | ||
put("Cache-Control", "no-cache"); | ||
}}, queryCompleteEvent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i lost queryCompleteEvent
.
i don't understand how CI figured this out, as this test method is not @Test
annotated (#10635), yet it failed (https://github.com/trinodb/trino/runs/4826429554?check_suite_focus=true)
b5eb717
to
a0cdaa0
Compare
While it's possible to create a pre-populated collection using
new CollectionClass() { { ... add elements ... } }
, it is not the idiomaticway to do it.