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

Small changes.

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