Announcement

Collapse
No announcement yet.

map problem in debug and run mode

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • map problem in debug and run mode

    Hi there,
    I have a rather odd problem inside eclipse with Maps, or HashMaps.
    The mappings (key-value pairs) are put one after another to the HashMap. But not all the mappings are really put into the HashMap by the system, there is always one missing. If I change the key, the mapping is accepted again to the HashMap but another map is omited then.

    It seems completely random and inexplicable to me, but the error is persistent.
    This happens both in debug and run mode inside eclipse.

    Here a little code snippet as example (here with a list of HashMaps):

    List<HashMap> map = new ArrayList<HashMap>();
    // This operation returns a List of HashMaps
    map = dao.getMap();
    HashMap firstMap = map.get(0);

    String type = (String)firstMap.get("NAME");

    The very first mapping here is NOT in the HashMap! It should be because it is returned by the Database, this I can check.

    7 mappings are returned by the db, but only 6 are accessible through the Map.get() operation...

    Any ideas? Thank you!

  • #2
    Was könnte der Grund für ein engl. Posting sein?

    Frührere Beiträge entsprachen der Forensprache

    Das Java-Problem sollte in Java Teil des Forum gelöst werden

    Davon abgesehen, wie sieht die DAO aus?

    EDIT
    Welche 7 Wertepaare erwartest du aus der DB?
    Zuletzt editiert von Christian Marquardt; 24.02.2009, 19:51.
    Christian

    Comment


    • #3
      Nunja, scheint ja nicht wichtig zu sein...
      Christian

      Comment


      • #4
        Ich entschuldige mich für meine Sprachwahl...

        Dieser Beitrag ist im eclipse forum gepostet, da ich mir irgendwie nicht vorstellen kann, daß die Ursache für so einen "Bug" JAVA zu suchen wäre. Ich poste es aber gerne auch da.

        Die DAO geht über Ibatis welche ein resultClass java.util.Map zurückgibt.
        in etwa so: List<HashMap> map = sqlMap.queryForList("getTheStuff");

        Der Bug ist aber unabhängig von der DAO. Auch wenn ich eine HashMap "manuell" zusammenbaue, sind einzelne key-value-Paare nicht vorhanden.

        Comment


        • #5
          daß die Ursache für so einen "Bug" JAVA zu suchen wäre.
          Na auch nicht in Eclipse. Eclipse ist nur der Editor. Die Klassen werden mit deinem installierten JRE oder JDK compiliert und ausgeführt. Da ist kein Platz für einen Fehler seitens Eclipse.
          Christian

          Comment

          Working...
          X