google / guava

Google core libraries for Java
Apache License 2.0
50.21k stars 10.91k forks source link

Introduce a MinMaxPriorityQueue#builder #2119

Closed JensRantil closed 9 years ago

JensRantil commented 9 years ago

Related: This issue came out of #2118.

Background: Most Guava data structures has a builder() method to instantiate a builder and it seems that's the default way of constructing/finding a builder.

Proposal: Introduce MinMaxPriorityQueue#builder to adhere to the above principle. Currently the API is somewhat unclear how the builder works. Is there a reason why the builder method doesn't exist?

kevinb9n commented 9 years ago

The big problem with MMPQ is that it's very rarely used and most of the time when it is used, a careful reading of the Javadoc would have told the user something better. It's an extremely niche utility, and we're unlikely to spend time improving it futher - sorry.

JanecekPetr commented 9 years ago

While I understand Kevin's point, the fix to this issue would be 15 minutes of thinkng, then one method, and possibly a few tests. An hour, maybe two, an ideal candidate for a lazy Friday afternoon when nothing really productive gets done?

I'm sorry if this sounds inconsiderate, I do not and can not know how much work there is to be done by your team. This shows that you might want to post a status update and an optional roadmap, somewhere public ;).

lowasser commented 9 years ago

To be honest, I'd guess the most likely thing we would like to do with MinMaxPriorityQueue is deprecate it and schedule it for deletion rather than expand it. As Kevin said, most of the time when it is used, there is something better, and in the past we've tended to delete APIs that are used incorrectly more often than not.