• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem with Map

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
I have a strange question. I am adding a Map object to another Map . But one of key , value pair is missing.

pageDataMap = buildPageDataMap(request);

Map formData = new HashMap();
formData.putAll( pageDataMap );

what could be the possible reason for this ?
I would like to thank you for your answer.

regards
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What data is missing? How do you know it's missing?
 
vv sreeram
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
I am using wsad .I was debugging it . In the earlier step a key with a multiple values was added which is missing after adding to the HashMap.

Thank You
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by vv sreeram:
...what could be the possible reason for this?


Keys must be unique. Are you using the same key twice?
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also, what class are your keys? Does this class override equals() and hashCode()? Both these methods are used by a HashMap, and if there are any bugs in the implementation of these methods, they can cause strange behavior of the Map. If the class of your keys is one of the standard Java library classes (e.g. a String or Integer, to take two particularly common examples) then there's probably no problem, but if it's a class someone has created themselves, you might want to study the equals() and hashCode() methods to make sure they work correctly.
 
vv sreeram
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
The key is unique. The value is a String array. Thank you for your reply .


regards
 
reply
    Bookmark Topic Watch Topic
  • New Topic