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

Update AvoidNewHashMapInt to include HashSet #2292

Merged
merged 3 commits into from
Jun 6, 2022
Merged

Conversation

pkoenig10
Copy link
Member

Same as #1773, but for HashSet.

@changelog-app
Copy link

changelog-app bot commented Jun 6, 2022

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Update AvoidNewHashMapInt to warn on uses of new HashSet(int).

Check the box to generate changelog(s)

  • Generate changelog entry

@pkoenig10 pkoenig10 requested a review from carterkozak June 6, 2022 18:51
Copy link
Contributor

@schlosna schlosna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, one spelling nit

Just an FYI there's some pending release Guava & JDK changes for capacity calculation google/guava#5965 & openjdk/jdk@3e39304 , google/guava@6ad621e

There's also JDK HashMap.newHashMap(int) & HashSet.newHashSet(int) equivalents to the Guava Maps.newHashMapWithExpectedSize(int) and Sets.newHashSetWithExpectedSize(int) likely landing in JDK 19 openjdk/jdk#7928 & openjdk/jdk#8302 respectively

…prone/AvoidNewHashMapInt.java

Co-authored-by: David Schlosnagle <davids@palantir.com>
@carterkozak
Copy link
Contributor

I've disqualified myself, @schlosna mind giving this a 👍 as well?

@bulldozer-bot bulldozer-bot bot merged commit 4116881 into develop Jun 6, 2022
@bulldozer-bot bulldozer-bot bot deleted the pkoenig/hashSet branch June 6, 2022 19:36
@svc-autorelease
Copy link
Collaborator

Released 4.140.0

bulldozer-bot bot pushed a commit to palantir/witchcraft-api that referenced this pull request Jun 6, 2022
###### _excavator_ is a bot for automating changes across repositories.

Changes produced by the roomba/latest-baseline-oss check.

# Release Notes
## 4.140.0
| Type | Description | Link |
| ---- | ----------- | ---- |
| Improvement | Update `AvoidNewHashMapInt` to warn on uses of `new HashSet(int)`. | palantir/gradle-baseline#2292 |



To enable or disable this check, please contact the maintainers of Excavator.
This was referenced Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants