test/jdk/java/util/concurrent/tck/MapImplementation.java
author dl
Tue, 03 Oct 2017 13:45:11 -0700
changeset 47304 3f5f9bc0bdc2
child 58892 35bac2745d04
permissions -rw-r--r--
8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries Reviewed-by: martin, psandoz
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
47304
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
     1
/*
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
     2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
     3
 *
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
     4
 * This code is free software; you can redistribute it and/or modify it
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
     5
 * under the terms of the GNU General Public License version 2 only, as
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
     6
 * published by the Free Software Foundation.
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
     7
 *
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
     8
 * This code is distributed in the hope that it will be useful, but WITHOUT
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
     9
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    10
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    11
 * version 2 for more details (a copy is included in the LICENSE file that
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    12
 * accompanied this code).
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    13
 *
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License version
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    15
 * 2 along with this work; if not, write to the Free Software Foundation,
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    16
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    17
 *
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    18
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    19
 * or visit www.oracle.com if you need additional information or have any
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    20
 * questions.
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    21
 */
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    22
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    23
/*
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    24
 * This file is available under and governed by the GNU General Public
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    25
 * License version 2 only, as published by the Free Software Foundation.
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    26
 * However, the following notice accompanied the original version of this
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    27
 * file:
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    28
 *
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    29
 * Written by Doug Lea and Martin Buchholz with assistance from
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    30
 * members of JCP JSR-166 Expert Group and released to the public
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    31
 * domain, as explained at
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    32
 * http://creativecommons.org/publicdomain/zero/1.0/
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    33
 */
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    34
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    35
import java.util.Map;
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    36
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    37
/** Allows tests to work with different Map implementations. */
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    38
public interface MapImplementation {
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    39
    /** Returns the Map implementation class. */
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    40
    public Class<?> klazz();
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    41
    /** Returns an empty map. */
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    42
    public Map emptyMap();
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    43
    public Object makeKey(int i);
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    44
    public Object makeValue(int i);
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    45
    public boolean isConcurrent();
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    46
    public boolean permitsNullKeys();
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    47
    public boolean permitsNullValues();
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    48
    public boolean supportsSetValue();
3f5f9bc0bdc2 8186171: HashMap: Entry.setValue may not work after Iterator.remove() called for previous entries
dl
parents:
diff changeset
    49
}