mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
SecurityException fixed
This commit is contained in:
@@ -3155,7 +3155,6 @@ class ConcurrentHashMap<K,V> extends AbstractMap<K,V>
|
||||
return true;
|
||||
}
|
||||
|
||||
private static final sun.misc.Unsafe U = sun.misc.Unsafe.getUnsafe();
|
||||
private static final long LOCKSTATE;
|
||||
static {
|
||||
try {
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.util.containers;
|
||||
|
||||
import com.intellij.concurrency.ConcurrentCollectionFactory;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.util.ref.GCUtil;
|
||||
import gnu.trove.TObjectHashingStrategy;
|
||||
@@ -469,4 +470,31 @@ public class ConcurrentMapsTest {
|
||||
assertSame(newVal, map.get(key));
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConcurrentHashMapTreeBinifiesItself() {
|
||||
class Meh {
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
ConcurrentMap<Object, Object> map = ConcurrentCollectionFactory.createMap(new TObjectHashingStrategy<Object>() {
|
||||
@Override
|
||||
public int computeHashCode(Object object) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o1, Object o2) {
|
||||
return o1==o2;
|
||||
}
|
||||
});
|
||||
int N = 1000;
|
||||
for (int i = 0; i < N; i++) {
|
||||
map.put(new Meh(), 0);
|
||||
}
|
||||
assertEquals(N, map.size());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user