Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The only thing I can think of that will cause this is if the state of <code>supportingLocation</code> is somehow being mutated between the <code>get(...)</code> call and the <code>containsKey(...)</code>.</p> <p>Assuming the code snippet you posted is the exact code that's causing problems, the only place this could occur is if one of <code>Location#getZ(...)</code>, <code>Location#hashCode()</code> or <code>Location#equals(Object)</code> mutates the state of Location (or the Location constructor, or one of these methods starts a thread that randomly changes the state of the Location instance, but I think we can rule that out).</p> <p>Could you verify that none of the methods above are changing the state of the <code>supportingLocation</code> instance? While I am not familiar with the <code>Location</code> class itself, I'd venture to guess that a class like that would ideally be immutable.</p> <p>Edit: To clarify, when I say that <code>Location#getZ()</code> etc aren't mutating the Location, what I mean is:</p> <pre><code>Location x = new Location(1,2,3); Location y = new Location(1,2,3); boolean eq1 = x.equals(y); int hash1 = x.hashCode(); x.getZ(); // this should *not* mutate the state of x boolean eq2 = x.equals(y); int hash2 = x.hashCode(); </code></pre> <p>In the end, eq1 should be equal to eq1, and hash1 should be equal to hash2. If this is not the case, getZ() is mutating the state of x (or equals, or hashCode, or worse, those methods are completely off), and will result in the behavior you observed.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload