提交 e5b24a3e authored 作者: Thomas Mueller's avatar Thomas Mueller

Formatting / javadocs.

上级 9b215d2e
......@@ -884,7 +884,8 @@ public class Parser {
}
boolean b = session.getAllowLiterals();
try {
// need to temporarily turn this on, in case we are in ALLOW_LITERALS_NUMBERS mode
// need to temporarily enable it, in case we are in
// ALLOW_LITERALS_NUMBERS mode
session.setAllowLiterals(true);
return prepare(session, buff.toString(), paramValues);
} finally {
......
......@@ -251,8 +251,17 @@ public final class CompressLZF implements Compressor {
return outPos;
}
public int compress(ByteBuffer in, int inLen, byte[] out, int outPos) {
int inPos = 0;
/**
* Compress a number of bytes.
*
* @param in the input data
* @param out the output area
* @param outPos the offset at the output array
* @return the end position
*/
public int compress(ByteBuffer in, byte[] out, int outPos) {
int inPos = in.position();
int inLen = in.capacity() - inPos;
if (cachedHashTable == null) {
cachedHashTable = new int[HASH_SIZE];
}
......@@ -397,7 +406,16 @@ public final class CompressLZF implements Compressor {
} while (outPos < outLen);
}
public void expand(ByteBuffer in, int inPos, int inLen, ByteBuffer out, int outPos, int outLen) {
/**
* Expand a number of compressed bytes.
*
* @param in the compressed data
* @param out the output area
*/
public static void expand(ByteBuffer in, ByteBuffer out) {
int inPos = in.position();
int outPos = out.position();
int outLen = out.capacity() - outPos;
// if ((inPos | outPos | outLen) < 0) {
if (inPos < 0 || outPos < 0 || outLen < 0) {
throw new IllegalArgumentException();
......
......@@ -447,8 +447,8 @@ public class ErrorCode {
/**
* The error with code <code>90005</code> is thrown when
* trying to create a trigger and using the combination of SELECT and FOR EACH ROW,
* which we do not support.
* trying to create a trigger and using the combination of SELECT
* and FOR EACH ROW, which we do not support.
*/
public static final int TRIGGER_SELECT_AND_ROW_BASED_NOT_SUPPORTED = 90005;
......
......@@ -355,7 +355,8 @@ public class MVStore {
* It contains the following entries:
*
* <pre>
* map.{name} = {map metadata}
* name.{name} = {mapId}
* map.{mapId} = {map metadata}
* root.{mapId} = {root position}
* chunk.{chunkId} = {chunk metadata}
* </pre>
......
......@@ -460,7 +460,7 @@ class FileNioMemData {
ByteBuffer out = ByteBuffer.allocateDirect(BLOCK_SIZE);
if (d != COMPRESSED_EMPTY_BLOCK) {
synchronized (LZF) {
LZF.expand(d, 0, d.capacity(), out, 0, BLOCK_SIZE);
CompressLZF.expand(d, out);
}
}
data[page] = out;
......@@ -475,7 +475,7 @@ class FileNioMemData {
static void compress(ByteBuffer[] data, int page) {
ByteBuffer d = data[page];
synchronized (LZF) {
int len = LZF.compress(d, BLOCK_SIZE, BUFFER, 0);
int len = LZF.compress(d, BUFFER, 0);
d = ByteBuffer.allocateDirect(len);
d.put(BUFFER, 0, len);
data[page] = d;
......@@ -516,7 +516,7 @@ class FileNioMemData {
expand(data, lastPage);
ByteBuffer d = data[lastPage];
for (int i = (int) (newLength & BLOCK_SIZE_MASK); i < BLOCK_SIZE; i++) {
d.put(i, (byte)0);
d.put(i, (byte) 0);
}
if (compress) {
compressLater(data, lastPage);
......
......@@ -16,7 +16,6 @@ import java.util.Date;
import java.util.Random;
import org.h2.test.TestBase;
import org.h2.util.Utils;
import org.junit.Test;
/**
* Tests reflection utilities.
......@@ -37,7 +36,6 @@ public class TestUtils extends TestBase {
TestBase.createCaller().init().test();
}
@Test
public void test() throws Exception {
testSortTopN();
testSortTopNRandom();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论