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

Java 9 Convenience Factory Methods for Collections #46

Closed
gaul opened this issue Jan 26, 2016 · 3 comments
Closed

Java 9 Convenience Factory Methods for Collections #46

gaul opened this issue Jan 26, 2016 · 3 comments

Comments

@gaul
Copy link
Owner

gaul commented Jan 26, 2016

Evaluate closer to Java 9 release:

http://openjdk.java.net/jeps/269

@gaul gaul closed this as completed in fed226a Jan 17, 2017
@Stephan202
Copy link
Contributor

Hi @andrewgaul. Just saw fed226a. We have a code base in which Guava's Immutable* types are extensively passed around. In particular, many a field and return type is explicitly immutable. This has merit far beyond the convenience that the static factory methods on these types provide. As such I'm not sure that the violations added in the aforementioned commit make sense, at least as a default; they don't make Guava's variants obsolete or outdated. WDYT?

@gaul
Copy link
Owner Author

gaul commented Jan 23, 2017

@Stephan202 The ImmutableMap vs. Map deprecation trick is a neat trick although I have not used it in my projects. Do you think the exclusion patterns added in #55 allow you sufficient control over these violations in your projects? I agree that some violations have arguable value although I think modernizer should improve its configuration to allow users to select what they want and add more violations if needed, e.g., #22.

@Stephan202
Copy link
Contributor

Stephan202 commented Jan 28, 2017

@andrewgaul Thanks, I tested the #55 feature using version 1.5.0 of the plugin with the exclusion pattern org/joda/time/.* (because we're "midway" in our migration from Joda to java.time) and this works as expected. My concern about Immutable* usage would then call for an exclusion pattern of the form com/google/common/collect/Immutable\w+\.of:.* (or something like that, didn't test it).

As for #22: that looks interesting too. I might have some use cases for that, but will play around with it some other time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants