提交 d5adc176 authored 作者: Noel Grandin's avatar Noel Grandin

don't allow null values in ConcurrentArrayList

because that can be the only reason for the CI failure I saw:

ERROR: FAIL java.lang.NullPointerException java.lang.NullPointerException ------------------------------
java.lang.NullPointerException
	at org.h2.mvstore.MVMap.openVersion(MVMap.java:1095)
	at org.h2.test.store.TestConcurrent.testConcurrentChangeAndGetVersion(TestConcurrent.java:346)
	at org.h2.test.store.TestConcurrent.test(TestConcurrent.java:56)
	at org.h2.test.TestBase.runTest(TestBase.java:142)
	at org.h2.test.TestAll.addTest(TestAll.java:990)
	at org.h2.test.TestAll.testUnit(TestAll.java:960)
	at org.h2.test.TestAll.runTests(TestAll.java:625)
	at org.h2.test.TestAll.testAll(TestAll.java:563)
	at org.h2.test.TestAll.run(TestAll.java:512)
	at org.h2.test.TestAll.main(TestAll.java:452)
上级 23f072e3
......@@ -49,6 +49,10 @@ public class ConcurrentArrayList<K> {
* @param obj the element
*/
public synchronized void add(K obj) {
if (obj == null) {
throw DataUtils.newIllegalStateException(
DataUtils.ERROR_INTERNAL, "adding null value to list");
}
int len = array.length;
array = Arrays.copyOf(array, len + 1);
array[len] = obj;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论