All pastes #394060 Raw Edit

Farrier

public java v1 · immutable
·published 2007-03-14 00:55 UTC
rendered paste body
public final class ThudChat {  public static void main(String[] args) {    java.util.Hashtable h = new java.util.Hashtable();    h.put("a1", "1"); // Keys MUST be noncontiguous for the bug to show    h.put("b1", "2");    h.put("a2", "3");    h.put("b2", "4");    h.put("a3", "5");    h.put("b3", "6"); // In the debugger, this seems to overwrite the first entry    // All the following is different ways of printing the output, and can be    // ignored. All the info displays fine, so there's no bug in the hashtable,    // just in the display of the debugger, which at this point is showing five    // elements in the hashtable's internal table, instead of six.    System.out.println(h.size()+"");    System.out.println("---enum---");    java.util.Enumeration e = h.keys();    while (e.hasMoreElements()) {      System.out.println((String)(e.nextElement()));    }    System.out.println("---get---");    System.out.println(h.get("a1")); // Keys MUST be noncontiguous for the bug to show    System.out.println(h.get("b1"));    System.out.println(h.get("a2"));    System.out.println(h.get("b2"));    System.out.println(h.get("a3"));    System.out.println(h.get("b3"));    System.out.println("---end---");  }}