提交 3e2b459c authored 作者: Thomas Mueller's avatar Thomas Mueller

The jarSmall build target no longer includes assertions (SysProperties.CHECK,…

The jarSmall build target no longer includes assertions (SysProperties.CHECK, CHECK2, system properties h2.check and h2.check2).
上级 484f4eb9
......@@ -50,8 +50,10 @@ public abstract class CacheObject implements Comparable<CacheObject> {
public abstract int getMemory();
public void setPos(int pos) {
if (SysProperties.CHECK && (cachePrevious != null || cacheNext != null || cacheChained != null)) {
DbException.throwInternalError("setPos too late");
if (SysProperties.CHECK) {
if (cachePrevious != null || cacheNext != null || cacheChained != null) {
DbException.throwInternalError("setPos too late");
}
}
this.pos = pos;
}
......
......@@ -60,8 +60,10 @@ public class IntArray {
* @return the value
*/
public int get(int index) {
if (SysProperties.CHECK && index >= size) {
throw new ArrayIndexOutOfBoundsException("i=" + index + " size=" + size);
if (SysProperties.CHECK) {
if (index >= size) {
throw new ArrayIndexOutOfBoundsException("i=" + index + " size=" + size);
}
}
return data[index];
}
......@@ -72,8 +74,10 @@ public class IntArray {
* @param index the index
*/
public void remove(int index) {
if (SysProperties.CHECK && index >= size) {
throw new ArrayIndexOutOfBoundsException("i=" + index + " size=" + size);
if (SysProperties.CHECK) {
if (index >= size) {
throw new ArrayIndexOutOfBoundsException("i=" + index + " size=" + size);
}
}
System.arraycopy(data, index + 1, data, index, size - index - 1);
size--;
......
......@@ -459,8 +459,10 @@ public class StringUtils {
buff[j++] = (byte) Integer.parseInt(encoded.substring(i + 1, i + 3), 16);
i += 2;
} else {
if (SysProperties.CHECK && (ch > 127 || ch < ' ')) {
throw new IllegalArgumentException("unexpected char " + (int) ch + " decoding " + encoded);
if (SysProperties.CHECK) {
if (ch > 127 || ch < ' ') {
throw new IllegalArgumentException("Unexpected char " + (int) ch + " decoding " + encoded);
}
}
buff[j++] = (byte) ch;
}
......
......@@ -56,8 +56,10 @@ public class TempFileDeleter {
if (ref != null) {
String f2 = refMap.remove(ref);
if (f2 != null) {
if (SysProperties.CHECK && fileName != null && !f2.equals(fileName)) {
DbException.throwInternalError("f2:" + f2 + " f:" + fileName);
if (SysProperties.CHECK) {
if (fileName != null && !f2.equals(fileName)) {
DbException.throwInternalError("f2:" + f2 + " f:" + fileName);
}
}
fileName = f2;
}
......@@ -106,8 +108,10 @@ public class TempFileDeleter {
IOUtils.trace("TempFileDeleter.stopAutoDelete", fileName, ref);
if (ref != null) {
String f2 = refMap.remove(ref);
if (SysProperties.CHECK && (f2 == null || !f2.equals(fileName))) {
DbException.throwInternalError("f2:" + f2 + " " + (f2 == null ? "" : f2) + " f:" + fileName);
if (SysProperties.CHECK) {
if (f2 == null || !f2.equals(fileName)) {
DbException.throwInternalError("f2:" + f2 + " " + (f2 == null ? "" : f2) + " f:" + fileName);
}
}
}
deleteUnused();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论