提交 80976a77 authored 作者: Thomas Mueller's avatar Thomas Mueller

Small changes.

上级 dc1ae239
......@@ -395,7 +395,7 @@ public class SysProperties {
* defensive copy himself before storing, or ensure that the value object is
* immutable.
*/
public static boolean SERIALIZE_JAVA_OBJECT = Utils.getProperty("h2.serializeJavaObject", true);
public static boolean serializeJavaObject = Utils.getProperty("h2.serializeJavaObject", true);
private static final String H2_BASE_DIR = "h2.baseDir";
......
......@@ -1754,7 +1754,7 @@ public class JdbcConnection extends TraceObject implements Connection {
break;
}
case Value.JAVA_OBJECT:
if (SysProperties.SERIALIZE_JAVA_OBJECT) {
if (SysProperties.serializeJavaObject) {
o = Utils.deserialize(v.getBytesNoCopy());
break;
}
......
......@@ -995,7 +995,7 @@ public class TableFilter implements ColumnResolver {
/**
* A visitor for table filters.
*/
public static interface TableFilterVisitor {
public interface TableFilterVisitor {
/**
* This method is called for each nested or joined table filter.
......
......@@ -54,7 +54,7 @@ public class Csv implements SimpleRowSource {
private boolean caseSensitiveColumnNames;
private boolean preserveWhitespace;
private boolean writeColumnHeader = true;
private char lineComment = 0;
private char lineComment;
private String lineSeparator = SysProperties.LINE_SEPARATOR;
private String nullString = "";
......
......@@ -578,7 +578,7 @@ public class DataType {
break;
}
case Value.JAVA_OBJECT: {
if (SysProperties.SERIALIZE_JAVA_OBJECT) {
if (SysProperties.serializeJavaObject) {
byte[] buff = rs.getBytes(columnIndex);
v = buff == null ? ValueNull.INSTANCE : ValueJavaObject.getNoCopy(null, buff);
} else {
......@@ -1065,7 +1065,7 @@ public class DataType {
return new JdbcClob(conn, v, 0);
}
if (v.getType() == Value.JAVA_OBJECT) {
Object o = SysProperties.SERIALIZE_JAVA_OBJECT ? Utils.deserialize(v.getBytes()) : v.getObject();
Object o = SysProperties.serializeJavaObject ? Utils.deserialize(v.getBytes()) : v.getObject();
if (paramClass.isAssignableFrom(o.getClass())) {
return o;
}
......
......@@ -37,7 +37,7 @@ public class ValueJavaObject extends ValueBytes {
return EMPTY;
}
ValueJavaObject obj;
if (SysProperties.SERIALIZE_JAVA_OBJECT) {
if (SysProperties.serializeJavaObject) {
if (b == null) {
b = Utils.serialize(javaObject);
}
......@@ -62,7 +62,7 @@ public class ValueJavaObject extends ValueBytes {
/**
* Value which serializes java object only for I/O operations.
* Used when property {@link SysProperties#SERIALIZE_JAVA_OBJECT} is disabled.
* Used when property {@link SysProperties#serializeJavaObject} is disabled.
*
* @author Sergi Vladykin
*/
......
......@@ -6,14 +6,13 @@
*/
package org.h2.test.jaqu;
import static org.h2.jaqu.Define.*;
import static org.h2.jaqu.Define.primaryKey;
import java.math.BigDecimal;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.sql.Time;
import java.sql.Timestamp;
import org.h2.jaqu.Table;
/**
......
......@@ -6,13 +6,12 @@
*/
package org.h2.test.jaqu;
import static org.h2.jaqu.Define.*;
import static org.h2.jaqu.Define.primaryKey;
import static org.h2.jaqu.Define.tableName;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import org.h2.jaqu.Table;
/**
......
......@@ -6,13 +6,14 @@
*/
package org.h2.test.jaqu;
import static org.h2.jaqu.Define.index;
import static org.h2.jaqu.Define.maxLength;
import static org.h2.jaqu.Define.primaryKey;
import static org.h2.jaqu.Define.tableName;
import java.util.Arrays;
import java.util.List;
import org.h2.jaqu.Table;
import static org.h2.jaqu.Define.*;
/**
* A table containing product data.
*/
......
......@@ -46,7 +46,7 @@ public class TestJavaObject extends TestBase {
@Override
public void test() throws Exception {
SysProperties.SERIALIZE_JAVA_OBJECT = false;
SysProperties.serializeJavaObject = false;
try {
trace("Test Java Object");
doTest(new MyObj(1), new MyObj(2), false);
......@@ -59,7 +59,7 @@ public class TestJavaObject extends TestBase {
doTest(new Time(System.currentTimeMillis() + 1000), new Date(System.currentTimeMillis()), false);
doTest(new Time(System.currentTimeMillis() + 1000), new Timestamp(System.currentTimeMillis()), false);
} finally {
SysProperties.SERIALIZE_JAVA_OBJECT = true;
SysProperties.serializeJavaObject = true;
}
}
......
......@@ -42,10 +42,11 @@ public class TestDropTableLarge {
PreparedStatement prep2 = conn.prepareStatement(
"insert into test2(name) values(space(255))");
for (int i = 0; i < 50000; i++) {
if (i % 7 != 0)
if (i % 7 != 0) {
prep1.execute();
else
} else {
prep2.execute();
}
}
Profiler prof = new Profiler();
prof.startCollecting();
......
......@@ -49,7 +49,7 @@ public class FileContentHash {
System.out.println("Usage: java " + getClass().getName() + " <dir>");
return;
}
for (int i=0; i<args.length; i++) {
for (int i = 0; i < args.length; i++) {
Info info = hash(args[i]);
System.out.println("size: " + info.size);
}
......
......@@ -518,6 +518,7 @@ class StringExpr extends ExprBase {
}
public void setType(Type type) {
// ignore
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论