-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Awkward Map.get() problem during validation
PostPosted: Thu Jun 17, 2010 1:26 pm 
Newbie

Joined: Sun Feb 14, 2010 10:13 am
Posts: 17
Hello

I ran into this really awkward problem in Map.get() (implemented as HashMap proxied by PersistentMap).
I am calling myMap.get(myKey) but always get null, and myMap.keySet().contains(myKey) also returns false, although myKey is contained in it!
I inspected myMap to see if it contains myKey and indeed it is, and it is mapped to a non-null value. I could easily prove it by iterating over the Map:

Code:
public void myCheck() {
   for (MyKey k : myMap.keySet()) {
      System.out.println(myMap.containsKey(k));
   }
}

Although the loop is indeed entered for every k, myMap.contains(k) is never true. the result for my 2-keyed map is:
false
false


even myMap.containsKey(myMap.keySet().iterator().next()) returns false.

How is this even possible?
Perhaps it is a PersistentMap bug?

Please help
Yuval


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.