Description of the problem / feature request:
I have following code,
private static final Set<String> SUPPORTED_METHODS = Set.of(
HttpMethods.GET, HttpMethods.POST, HttpMethods.PUT, HttpMethods.DELETE,
HttpMethods.HEAD, HttpMethods.OPTIONS, HttpMethods.TRACE
);
I have enabled ImmutableMemberCollection in my gradle file.
On error-prone version 2.5.1, this works fine.
But when I upgrade to 2.6.0, I get following error.
error: [ImmutableMemberCollection] If you don't intend to mutate a member collection prefer using Immutable types.
public final class OkHttpTransport extends HttpTransport {
^
(see https://errorprone.info/bugpattern/ImmutableMemberCollection)
Did you mean 'private static final ImmutableSet<String> SUPPORTED_METHODS = ImmutableSet.copyOf(Set.of('?
1 error
Feature requests: what underlying problem are you trying to solve with this feature?
Set.of already returns an immutable collection, so error-prone should detect this and not throw an error.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
public final class MyClass {
private static final Set<String> MY_STRINGS = Set.of("a", "b", "c");
}
What version of Error Prone are you using?
2.6.0
Have you found anything relevant by searching the web?
Nothing in particular.
Description of the problem / feature request:
I have following code,
I have enabled
ImmutableMemberCollectionin my gradle file.On error-prone version 2.5.1, this works fine.
But when I upgrade to 2.6.0, I get following error.
Feature requests: what underlying problem are you trying to solve with this feature?
Set.ofalready returns an immutable collection, so error-prone should detect this and not throw an error.Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
What version of Error Prone are you using?
2.6.0
Have you found anything relevant by searching the web?
Nothing in particular.