Java Code Examples for sun.text.IntHashtable#put()

The following examples show how to use sun.text.IntHashtable#put() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Bug4705389.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String args[]) {
   IntHashtable table = new IntHashtable();
   for (int i = 1; i < 132; ++i) {
      table.put(i, 0);
      table.remove(i);
   }
   table.put(132, 0);
}
 
Example 2
Source File: Bug4705389.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String args[]) {
   IntHashtable table = new IntHashtable();
   for (int i = 1; i < 132; ++i) {
      table.put(i, 0);
      table.remove(i);
   }
   table.put(132, 0);
}
 
Example 3
Source File: Bug4705389.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String args[]) {
   IntHashtable table = new IntHashtable();
   for (int i = 1; i < 132; ++i) {
      table.put(i, 0);
      table.remove(i);
   }
   table.put(132, 0);
}
 
Example 4
Source File: Bug4705389.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String args[]) {
   IntHashtable table = new IntHashtable();
   for (int i = 1; i < 132; ++i) {
      table.put(i, 0);
      table.remove(i);
   }
   table.put(132, 0);
}
 
Example 5
Source File: Bug4705389.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public static void main(String args[]) {
   IntHashtable table = new IntHashtable();
   for (int i = 1; i < 132; ++i) {
      table.put(i, 0);
      table.remove(i);
   }
   table.put(132, 0);
}
 
Example 6
Source File: Bug4170614Test.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void testIntHashtable() throws Exception {
    IntHashtable fred = new IntHashtable();
    fred.put(1, 10);
    fred.put(2, 20);
    fred.put(3, 30);

    IntHashtable barney = new IntHashtable();
    barney.put(1, 10);
    barney.put(3, 30);
    barney.put(2, 20);

    IntHashtable homer = new IntHashtable();
    homer.put(3, 30);
    homer.put(1, 10);
    homer.put(7, 900);

    if (fred.equals(barney)) {
        System.out.println("fred.equals(barney)");
    }
    else {
        System.out.println("!fred.equals(barney)");
    }
    System.out.println("fred.hashCode() == " + fred.hashCode());
    System.out.println("barney.hashCode() == " + barney.hashCode());

    if (!fred.equals(barney)) {
        throw new Exception("equals() failed on two hashtables that are equal");
    }

    if (fred.hashCode() != barney.hashCode()) {
       throw new Exception("hashCode() failed on two hashtables that are equal");
    }

    System.out.println();
    if (fred.equals(homer)) {
        System.out.println("fred.equals(homer)");
    }
    else {
        System.out.println("!fred.equals(homer)");
    }
    System.out.println("fred.hashCode() == " + fred.hashCode());
    System.out.println("homer.hashCode() == " + homer.hashCode());

    if (fred.equals(homer)) {
        throw new Exception("equals() failed on two hashtables that are not equal");
    }

    if (fred.hashCode() == homer.hashCode()) {
        throw new Exception("hashCode() failed on two hashtables that are not equal");
    }

    System.out.println();
    System.out.println("testIntHashtable() passed.\n");
}
 
Example 7
Source File: Bug4170614Test.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public static void testIntHashtable() throws Exception {
    IntHashtable fred = new IntHashtable();
    fred.put(1, 10);
    fred.put(2, 20);
    fred.put(3, 30);

    IntHashtable barney = new IntHashtable();
    barney.put(1, 10);
    barney.put(3, 30);
    barney.put(2, 20);

    IntHashtable homer = new IntHashtable();
    homer.put(3, 30);
    homer.put(1, 10);
    homer.put(7, 900);

    if (fred.equals(barney)) {
        System.out.println("fred.equals(barney)");
    }
    else {
        System.out.println("!fred.equals(barney)");
    }
    System.out.println("fred.hashCode() == " + fred.hashCode());
    System.out.println("barney.hashCode() == " + barney.hashCode());

    if (!fred.equals(barney)) {
        throw new Exception("equals() failed on two hashtables that are equal");
    }

    if (fred.hashCode() != barney.hashCode()) {
       throw new Exception("hashCode() failed on two hashtables that are equal");
    }

    System.out.println();
    if (fred.equals(homer)) {
        System.out.println("fred.equals(homer)");
    }
    else {
        System.out.println("!fred.equals(homer)");
    }
    System.out.println("fred.hashCode() == " + fred.hashCode());
    System.out.println("homer.hashCode() == " + homer.hashCode());

    if (fred.equals(homer)) {
        throw new Exception("equals() failed on two hashtables that are not equal");
    }

    if (fred.hashCode() == homer.hashCode()) {
        throw new Exception("hashCode() failed on two hashtables that are not equal");
    }

    System.out.println();
    System.out.println("testIntHashtable() passed.\n");
}
 
Example 8
Source File: Bug4170614Test.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public static void testIntHashtable() throws Exception {
    IntHashtable fred = new IntHashtable();
    fred.put(1, 10);
    fred.put(2, 20);
    fred.put(3, 30);

    IntHashtable barney = new IntHashtable();
    barney.put(1, 10);
    barney.put(3, 30);
    barney.put(2, 20);

    IntHashtable homer = new IntHashtable();
    homer.put(3, 30);
    homer.put(1, 10);
    homer.put(7, 900);

    if (fred.equals(barney)) {
        System.out.println("fred.equals(barney)");
    }
    else {
        System.out.println("!fred.equals(barney)");
    }
    System.out.println("fred.hashCode() == " + fred.hashCode());
    System.out.println("barney.hashCode() == " + barney.hashCode());

    if (!fred.equals(barney)) {
        throw new Exception("equals() failed on two hashtables that are equal");
    }

    if (fred.hashCode() != barney.hashCode()) {
       throw new Exception("hashCode() failed on two hashtables that are equal");
    }

    System.out.println();
    if (fred.equals(homer)) {
        System.out.println("fred.equals(homer)");
    }
    else {
        System.out.println("!fred.equals(homer)");
    }
    System.out.println("fred.hashCode() == " + fred.hashCode());
    System.out.println("homer.hashCode() == " + homer.hashCode());

    if (fred.equals(homer)) {
        throw new Exception("equals() failed on two hashtables that are not equal");
    }

    if (fred.hashCode() == homer.hashCode()) {
        throw new Exception("hashCode() failed on two hashtables that are not equal");
    }

    System.out.println();
    System.out.println("testIntHashtable() passed.\n");
}
 
Example 9
Source File: Bug4170614Test.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public static void testIntHashtable() throws Exception {
    IntHashtable fred = new IntHashtable();
    fred.put(1, 10);
    fred.put(2, 20);
    fred.put(3, 30);

    IntHashtable barney = new IntHashtable();
    barney.put(1, 10);
    barney.put(3, 30);
    barney.put(2, 20);

    IntHashtable homer = new IntHashtable();
    homer.put(3, 30);
    homer.put(1, 10);
    homer.put(7, 900);

    if (fred.equals(barney)) {
        System.out.println("fred.equals(barney)");
    }
    else {
        System.out.println("!fred.equals(barney)");
    }
    System.out.println("fred.hashCode() == " + fred.hashCode());
    System.out.println("barney.hashCode() == " + barney.hashCode());

    if (!fred.equals(barney)) {
        throw new Exception("equals() failed on two hashtables that are equal");
    }

    if (fred.hashCode() != barney.hashCode()) {
       throw new Exception("hashCode() failed on two hashtables that are equal");
    }

    System.out.println();
    if (fred.equals(homer)) {
        System.out.println("fred.equals(homer)");
    }
    else {
        System.out.println("!fred.equals(homer)");
    }
    System.out.println("fred.hashCode() == " + fred.hashCode());
    System.out.println("homer.hashCode() == " + homer.hashCode());

    if (fred.equals(homer)) {
        throw new Exception("equals() failed on two hashtables that are not equal");
    }

    if (fred.hashCode() == homer.hashCode()) {
        throw new Exception("hashCode() failed on two hashtables that are not equal");
    }

    System.out.println();
    System.out.println("testIntHashtable() passed.\n");
}
 
Example 10
Source File: Bug4170614Test.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void testIntHashtable() throws Exception {
    IntHashtable fred = new IntHashtable();
    fred.put(1, 10);
    fred.put(2, 20);
    fred.put(3, 30);

    IntHashtable barney = new IntHashtable();
    barney.put(1, 10);
    barney.put(3, 30);
    barney.put(2, 20);

    IntHashtable homer = new IntHashtable();
    homer.put(3, 30);
    homer.put(1, 10);
    homer.put(7, 900);

    if (fred.equals(barney)) {
        System.out.println("fred.equals(barney)");
    }
    else {
        System.out.println("!fred.equals(barney)");
    }
    System.out.println("fred.hashCode() == " + fred.hashCode());
    System.out.println("barney.hashCode() == " + barney.hashCode());

    if (!fred.equals(barney)) {
        throw new Exception("equals() failed on two hashtables that are equal");
    }

    if (fred.hashCode() != barney.hashCode()) {
       throw new Exception("hashCode() failed on two hashtables that are equal");
    }

    System.out.println();
    if (fred.equals(homer)) {
        System.out.println("fred.equals(homer)");
    }
    else {
        System.out.println("!fred.equals(homer)");
    }
    System.out.println("fred.hashCode() == " + fred.hashCode());
    System.out.println("homer.hashCode() == " + homer.hashCode());

    if (fred.equals(homer)) {
        throw new Exception("equals() failed on two hashtables that are not equal");
    }

    if (fred.hashCode() == homer.hashCode()) {
        throw new Exception("hashCode() failed on two hashtables that are not equal");
    }

    System.out.println();
    System.out.println("testIntHashtable() passed.\n");
}