Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7510677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:17:44+00:00 2026-05-29T23:17:44+00:00

I stumbled across the issue with TObjectDoubleHashMap of trove. The version 2.0.2 doesn’t override

  • 0

I stumbled across the issue with TObjectDoubleHashMap of trove. The version 2.0.2 doesn’t override the hashCode method.

More recent versions of trove (3.0.0) include the hashCode.

Note, that the equals method is overriden in both versions.

Why wasn’t the hashCode method overriden in the version 2? Maybe the contract for overriding hashCode/equals was introduced after the trove maps were written originally? Or is it simply a violation of the contract and a bug that was fixed later? I’d be very surprised if it’s a bug and not a feature, because how come the class that mostly deals with hashing not override hashCode when it has equals

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T23:17:45+00:00Added an answer on May 29, 2026 at 11:17 pm

    Maybe the contract for overriding hashCode/equals was introduced after the trove maps were written originally?

    No. That was present way back. I believe at least as early as 1.1, but I can’t find anything earlier than 1.3 docs.

    Or is it simply a violation of the contract and a bug?

    Yes. It is a violation of the contract. Note that java.util.Map has its own extra equality/hashCode contract above and beyond java.lang.Object, which is knowingly violated by IdentityHashMap and a few others.

    From the javadoc:

    public boolean equals(Object o)
    

    Compares the specified object with this map for equality. Returns true if the given object is also a map and the two Maps represent the same mappings. More formally, two maps t1 and t2 represent the same mappings if t1.entrySet().equals(t2.entrySet()). This ensures that the equals method works properly across different implementations of the Map interface.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have recently stumbled across an issue where the WPF ListView control seems to
I seem to have stumbled across a really weird issue when posting a static
I am using iframes in my page, and have stumbled across a weird issue.
Trying the Eric Meyer Reset I stumbled across an issue concerning the font-size:100% declaration
I have stumbled across the following issue: Using IIS6, I was trying to run
I've stumbled across an issue that I'm not entirely sure how to resolve. I
I was playing around with boost::function when I stumbled across the following issue. typedef
Stumbled across the ∴ operator in some of the rvm install scripts and couldn't
I stumbled across this code and am too proud to go and ask the
I stumbled across my rather ancient photo objects disks, and sadly found out the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.