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

Cleanup

上级 d28ab9aa
/*
* Copyright 2004-2013 H2 Group. Multiple-Licensed under the H2 License,
* Version 1.0, and under the Eclipse Public License, Version 1.0
* (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package org.h2.store; package org.h2.store;
import java.io.IOException; import java.io.IOException;
...@@ -6,6 +12,9 @@ import java.io.Reader; ...@@ -6,6 +12,9 @@ import java.io.Reader;
import org.h2.value.Value; import org.h2.value.Value;
import org.h2.value.ValueLobDb; import org.h2.value.ValueLobDb;
/**
* A mechanism to store and retrieve lob data.
*/
public interface LobStorageInterface { public interface LobStorageInterface {
/** /**
......
...@@ -267,8 +267,8 @@ public class SourceCompiler { ...@@ -267,8 +267,8 @@ public class SourceCompiler {
* unnecessarily. * unnecessarily.
*/ */
private static final class GroovyCompiler { private static final class GroovyCompiler {
private static final Object loader; private static final Object LOADER;
private static final Throwable initfailException; private static final Throwable INIT_FAIL_EXCEPTION;
static { static {
Object tmpLoader = null; Object tmpLoader = null;
...@@ -293,19 +293,19 @@ public class SourceCompiler { ...@@ -293,19 +293,19 @@ public class SourceCompiler {
} catch (Exception ex) { } catch (Exception ex) {
tmpInitfailException = ex; tmpInitfailException = ex;
} }
loader = tmpLoader; LOADER = tmpLoader;
initfailException = tmpInitfailException; INIT_FAIL_EXCEPTION = tmpInitfailException;
} }
public static Class<?> parseClass(String source, String packageAndClassName) { public static Class<?> parseClass(String source, String packageAndClassName) {
if (loader == null) { if (LOADER == null) {
throw new RuntimeException("compile fail: there is no groovy jar on the classpath?", initfailException); throw new RuntimeException("compile fail: there is no groovy jar on the classpath?", INIT_FAIL_EXCEPTION);
} }
try { try {
Object codeSource = Utils.newInstance("groovy.lang.GroovyCodeSource", source, packageAndClassName Object codeSource = Utils.newInstance("groovy.lang.GroovyCodeSource", source, packageAndClassName
+ ".groovy", "UTF-8"); + ".groovy", "UTF-8");
Utils.callMethod(codeSource, "setCachable", false); Utils.callMethod(codeSource, "setCachable", false);
Class<?> clazz = (Class<?>) Utils.callMethod(loader, "parseClass", codeSource); Class<?> clazz = (Class<?>) Utils.callMethod(LOADER, "parseClass", codeSource);
return clazz; return clazz;
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
......
...@@ -17,7 +17,6 @@ import java.util.Random; ...@@ -17,7 +17,6 @@ import java.util.Random;
import org.h2.engine.Constants; import org.h2.engine.Constants;
import org.h2.store.DataHandler; import org.h2.store.DataHandler;
import org.h2.store.FileStore; import org.h2.store.FileStore;
import org.h2.store.LobStorageBackend;
import org.h2.store.LobStorageFrontend; import org.h2.store.LobStorageFrontend;
import org.h2.test.TestBase; import org.h2.test.TestBase;
import org.h2.test.utils.MemoryFootprint; import org.h2.test.utils.MemoryFootprint;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论