提交 4a053407 authored 作者: Thomas Mueller's avatar Thomas Mueller

Source code switching using //## has been simplified.

上级 ccabdcb9
......@@ -6,7 +6,7 @@
*/
package org.h2.tools;
//## AWT begin ##
//## AWT ##
import java.awt.Button;
import java.awt.Dimension;
import java.awt.Font;
......@@ -44,12 +44,12 @@ import org.h2.util.Utils;
* @author Thomas Mueller, Ridvan Agar
*/
public class Console extends Tool implements
//## AWT begin ##
//## AWT ##
ActionListener, MouseListener, WindowListener,
//## AWT end ##
//*/
ShutdownHandler {
//## AWT begin ##
//## AWT ##
private Frame frame;
private boolean trayIconUsed;
private Font font;
......@@ -57,7 +57,7 @@ ShutdownHandler {
private TextField urlText;
private Object tray;
private Object trayIcon;
//## AWT end ##
//*/
private Server web, tcp, pg;
private boolean isWindows;
private long lastOpen;
......@@ -238,7 +238,7 @@ ShutdownHandler {
}
}
//## AWT begin ##
//## AWT ##
if (toolStart && webRunning && !GraphicsEnvironment.isHeadless()) {
loadFont();
try {
......@@ -249,7 +249,7 @@ ShutdownHandler {
e.printStackTrace();
}
}
//## AWT end ##
//*/
// start browser in any case (even if the server is already running)
// because some people don't look at the output,
......@@ -332,7 +332,7 @@ ShutdownHandler {
pg.stop();
pg = null;
}
//## AWT begin ##
//## AWT ##
if (frame != null) {
frame.dispose();
frame = null;
......@@ -350,11 +350,11 @@ ShutdownHandler {
}
System.gc();
}
//## AWT end ##
//*/
// System.exit(0);
}
//## AWT begin ##
//## AWT ##
private void loadFont() {
if (isWindows) {
font = new Font("Dialog", Font.PLAIN, 11);
......@@ -519,7 +519,7 @@ ShutdownHandler {
}
}
}
//## AWT end ##
//*/
private void openBrowser(String url) {
try {
......@@ -532,7 +532,7 @@ ShutdownHandler {
/**
* INTERNAL
*/
//## AWT begin ##
//## AWT ##
public void actionPerformed(ActionEvent e) {
String command = e.getActionCommand();
if ("exit".equals(command)) {
......@@ -546,59 +546,59 @@ ShutdownHandler {
startBrowser();
}
}
//## AWT end ##
//*/
/**
* INTERNAL
*/
//## AWT begin ##
//## AWT ##
public void mouseClicked(MouseEvent e) {
if (e.getButton() == MouseEvent.BUTTON1) {
startBrowser();
}
}
//## AWT end ##
//*/
/**
* INTERNAL
*/
//## AWT begin ##
//## AWT ##
public void mouseEntered(MouseEvent e) {
// nothing to do
}
//## AWT end ##
//*/
/**
* INTERNAL
*/
//## AWT begin ##
//## AWT ##
public void mouseExited(MouseEvent e) {
// nothing to do
}
//## AWT end ##
//*/
/**
* INTERNAL
*/
//## AWT begin ##
//## AWT ##
public void mousePressed(MouseEvent e) {
// nothing to do
}
//## AWT end ##
//*/
/**
* INTERNAL
*/
//## AWT begin ##
//## AWT ##
public void mouseReleased(MouseEvent e) {
// nothing to do
}
//## AWT end ##
//*/
/**
* INTERNAL
*/
//## AWT begin ##
//## AWT ##
public void windowClosing(WindowEvent e) {
if (trayIconUsed) {
frame.dispose();
......@@ -607,60 +607,60 @@ ShutdownHandler {
shutdown();
}
}
//## AWT end ##
//*/
/**
* INTERNAL
*/
//## AWT begin ##
//## AWT ##
public void windowActivated(WindowEvent e) {
// nothing to do
}
//## AWT end ##
//*/
/**
* INTERNAL
*/
//## AWT begin ##
//## AWT ##
public void windowClosed(WindowEvent e) {
// nothing to do
}
//## AWT end ##
//*/
/**
* INTERNAL
*/
//## AWT begin ##
//## AWT ##
public void windowDeactivated(WindowEvent e) {
// nothing to do
}
//## AWT end ##
//*/
/**
* INTERNAL
*/
//## AWT begin ##
//## AWT ##
public void windowDeiconified(WindowEvent e) {
// nothing to do
}
//## AWT end ##
//*/
/**
* INTERNAL
*/
//## AWT begin ##
//## AWT ##
public void windowIconified(WindowEvent e) {
// nothing to do
}
//## AWT end ##
//*/
/**
* INTERNAL
*/
//## AWT begin ##
//## AWT ##
public void windowOpened(WindowEvent e) {
// nothing to do
}
//## AWT end ##
//*/
}
......@@ -372,7 +372,6 @@ public class TestFunctions extends TestBase implements AggregateFunction {
}
private void testVarArgs() throws SQLException {
//## Java 1.5 begin ##
Connection conn = getConnection("functions");
Statement stat = conn.createStatement();
stat.execute("CREATE ALIAS mean FOR \"" +
......@@ -428,7 +427,6 @@ public class TestFunctions extends TestBase implements AggregateFunction {
assertEquals("BB: 15", rs.getString(3));
assertEquals("CCC: 20", rs.getString(4));
conn.close();
//## Java 1.5 end ##
}
private void testFileRead() throws Exception {
......@@ -983,7 +981,6 @@ public class TestFunctions extends TestBase implements AggregateFunction {
* @param values the values
* @return the mean value
*/
//## Java 1.5 begin ##
public static double mean(double... values) {
double sum = 0;
for (double x : values) {
......@@ -991,7 +988,6 @@ public class TestFunctions extends TestBase implements AggregateFunction {
}
return sum / values.length;
}
//## Java 1.5 end ##
/**
* This method is called via reflection from the database.
......@@ -1000,7 +996,6 @@ public class TestFunctions extends TestBase implements AggregateFunction {
* @param values the values
* @return the mean value
*/
//## Java 1.5 begin ##
public static double mean2(Connection conn, double... values) {
conn.getClass();
double sum = 0;
......@@ -1009,7 +1004,6 @@ public class TestFunctions extends TestBase implements AggregateFunction {
}
return sum / values.length;
}
//## Java 1.5 end ##
/**
* This method is called via reflection from the database.
......@@ -1018,7 +1012,6 @@ public class TestFunctions extends TestBase implements AggregateFunction {
* @param values the values
* @return the text
*/
//## Java 1.5 begin ##
public static String printMean(String prefix, double... values) {
double sum = 0;
for (double x : values) {
......@@ -1026,7 +1019,6 @@ public class TestFunctions extends TestBase implements AggregateFunction {
}
return prefix + ": " + (int) (sum / values.length);
}
//## Java 1.5 end ##
/**
* This method is called via reflection from the database.
......
......@@ -22,9 +22,7 @@ public class AnnotationsTest extends TestBase {
/**
* This object represents a database (actually a connection to the database).
*/
//## Java 1.5 begin ##
private Db db;
//## Java 1.5 end ##
/**
* This method is called when executing this application from the command
......@@ -37,7 +35,6 @@ public class AnnotationsTest extends TestBase {
}
public void test() throws SQLException {
//## Java 1.5 begin ##
db = Db.open("jdbc:h2:mem:", "sa", "sa");
db.insertAll(Product.getList());
db.insertAll(ProductAnnotationOnly.getList());
......@@ -49,7 +46,6 @@ public class AnnotationsTest extends TestBase {
testCreateTableIfRequiredAnnotation();
testColumnInheritanceAnnotation();
db.close();
//## Java 1.5 end ##
}
private void testIndexCreation() throws SQLException {
......
......@@ -6,7 +6,6 @@
*/
package org.h2.test.jaqu;
//## Java 1.5 begin ##
import static org.h2.jaqu.Define.*;
import java.math.BigDecimal;
......@@ -16,12 +15,10 @@ import java.util.List;
import java.sql.Time;
import java.sql.Timestamp;
import org.h2.jaqu.Table;
//## Java 1.5 end ##
/**
* A table containing all possible data types.
*/
//## Java 1.5 begin ##
public class ComplexObject implements Table {
public Integer id;
public Long amount;
......@@ -52,4 +49,3 @@ public class ComplexObject implements Table {
}
}
//## Java 1.5 end ##
......@@ -6,10 +6,8 @@
*/
package org.h2.test.jaqu;
//## Java 1.5 begin ##
import java.util.Arrays;
import java.util.List;
//## Java 1.5 end ##
/**
* A table containing customer data.
......@@ -32,7 +30,6 @@ public class Customer {
return customerId;
}
//## Java 1.5 begin ##
public static List<Customer> getList() {
Customer[] list = {
new Customer("ALFKI", "WA"),
......@@ -40,5 +37,5 @@ public class Customer {
new Customer("ANTON", "CA") };
return Arrays.asList(list);
}
//## Java 1.5 end ##
}
......@@ -25,9 +25,7 @@ public class ModelsTest extends TestBase {
/**
* This object represents a database (actually a connection to the database).
*/
//## Java 1.5 begin ##
private Db db;
//## Java 1.5 end ##
/**
* This method is called when executing this application from the command
......@@ -43,7 +41,6 @@ public class ModelsTest extends TestBase {
}
public void test() {
//## Java 1.5 begin ##
db = Db.open("jdbc:h2:mem:", "sa", "sa");
db.insertAll(Product.getList());
db.insertAll(ProductAnnotationOnly.getList());
......@@ -54,7 +51,6 @@ public class ModelsTest extends TestBase {
testDatabaseUpgrade();
testTableUpgrade();
db.close();
//## Java 1.5 end ##
}
private void testValidateModels() {
......
......@@ -6,7 +6,6 @@
*/
package org.h2.test.jaqu;
//## Java 1.5 begin ##
import static org.h2.jaqu.Define.*;
import java.math.BigDecimal;
......@@ -15,12 +14,10 @@ import java.util.Date;
import java.util.List;
import org.h2.jaqu.Table;
//## Java 1.5 end ##
/**
* A table containing order data.
*/
//## Java 1.5 begin ##
public class Order implements Table {
public String customerId;
......@@ -59,4 +56,3 @@ public class Order implements Table {
}
}
//## Java 1.5 end ##
......@@ -6,19 +6,16 @@
*/
package org.h2.test.jaqu;
//## Java 1.5 begin ##
import java.util.Arrays;
import java.util.List;
import org.h2.jaqu.Table;
import static org.h2.jaqu.Define.*;
//## Java 1.5 end ##
/**
* A table containing product data.
*/
//## Java 1.5 begin ##
public class Product implements Table {
public Integer productId;
......@@ -75,4 +72,3 @@ public class Product implements Table {
}
}
//## Java 1.5 end ##
......@@ -6,7 +6,6 @@
*/
package org.h2.test.jaqu;
//## Java 1.5 begin ##
import java.util.Arrays;
import java.util.List;
import org.h2.jaqu.Table.JQColumn;
......@@ -16,7 +15,6 @@ import org.h2.jaqu.Table.JQTable;
/**
* A table containing product data.
*/
//## Java 1.5 begin ##
@JQTable(name = "AnnotatedProduct", primaryKey = "id")
@JQIndex(standard = "name, cat")
public class ProductAnnotationOnly {
......@@ -81,4 +79,3 @@ public class ProductAnnotationOnly {
}
}
//## Java 1.5 end ##
......@@ -6,7 +6,6 @@
*/
package org.h2.test.jaqu;
//## Java 1.5 begin ##
import java.util.Arrays;
import java.util.List;
import org.h2.jaqu.Table.JQColumn;
......@@ -16,7 +15,6 @@ import org.h2.jaqu.Table.JQTable;
/**
* A table containing product data.
*/
//## Java 1.5 begin ##
@JQTable(annotationsOnly = false)
@JQIndex(standard = "name, cat")
public class ProductMixedAnnotation {
......@@ -81,4 +79,3 @@ public class ProductMixedAnnotation {
}
}
//## Java 1.5 end ##
......@@ -6,17 +6,14 @@
*/
package org.h2.test.jaqu;
//## Java 1.5 begin ##
import java.util.Arrays;
import java.util.List;
import org.h2.jaqu.Table.JQColumn;
import org.h2.jaqu.Table.JQTable;
//## Java 1.5 end ##
/**
* A table containing product data.
*/
//## Java 1.5 begin ##
@JQTable(createIfRequired = false)
public class ProductNoCreateTable {
......@@ -47,4 +44,3 @@ public class ProductNoCreateTable {
}
}
//## Java 1.5 end ##
......@@ -30,9 +30,7 @@ public class SamplesTest extends TestBase {
/**
* This object represents a database (actually a connection to the database).
*/
//## Java 1.5 begin ##
Db db;
//## Java 1.5 end ##
/**
* This method is called when executing this application from the command
......@@ -45,7 +43,6 @@ public class SamplesTest extends TestBase {
}
public void test() {
//## Java 1.5 begin ##
db = Db.open("jdbc:h2:mem:", "sa", "sa");
db.insertAll(Product.getList());
db.insertAll(Customer.getList());
......@@ -81,7 +78,6 @@ public class SamplesTest extends TestBase {
testLimitOffset();
testKeyRetrieval();
db.close();
//## Java 1.5 end ##
}
/**
......@@ -93,7 +89,6 @@ public class SamplesTest extends TestBase {
public Integer id;
}
//## Java 1.5 begin ##
private void testReverseColumns() {
db.executeUpdate("create table TestReverse(id int, name varchar, additional varchar)");
TestReverse t = new TestReverse();
......@@ -104,10 +99,8 @@ public class SamplesTest extends TestBase {
assertEquals(t.name, check.name);
assertEquals(t.id, check.id);
}
//## Java 1.5 end ##
//## Java 1.5 begin ##
private void testWhereSimple2() {
// var soldOutProducts =
......@@ -175,7 +168,6 @@ public class SamplesTest extends TestBase {
assertEquals(products.get(i).productName, productNames.get(i));
}
}
//## Java 1.5 end ##
/**
* A result set class containing the product name and price.
......@@ -186,7 +178,6 @@ public class SamplesTest extends TestBase {
public Double price;
}
//## Java 1.5 begin ##
private void testAnonymousTypes3() {
// var productInfos =
......@@ -216,7 +207,6 @@ public class SamplesTest extends TestBase {
assertEquals(p2.unitPrice, pr.price);
}
}
//## Java 1.5 end ##
/**
* A result set class containing customer data and the order total.
......@@ -230,7 +220,6 @@ public class SamplesTest extends TestBase {
}
}
//## Java 1.5 begin ##
private void testSelectManyCompoundFrom2() {
// var orders =
......@@ -407,7 +396,6 @@ public class SamplesTest extends TestBase {
assertTrue("Failed to add key. Duplicate?", uniqueKeys.add(l));
}
}
//## Java 1.5 end ##
/**
* A result set class containing product groups.
......@@ -420,7 +408,6 @@ public class SamplesTest extends TestBase {
}
}
//## Java 1.5 begin ##
private void testGroup() {
// var orderGroups =
......@@ -446,5 +433,4 @@ public class SamplesTest extends TestBase {
list.toString());
}
//## Java 1.5 end ##
}
......@@ -9,7 +9,6 @@ package org.h2.jaqu;
/**
* An enumeration of compare operations.
*/
//## Java 1.5 begin ##
enum CompareType {
EQUAL("=", true),
BIGGER(">", true),
......@@ -38,5 +37,4 @@ enum CompareType {
}
}
//## Java 1.5 end ##
......@@ -11,7 +11,6 @@ package org.h2.jaqu;
*
* @param <A> the operand type
*/
//## Java 1.5 begin ##
class Condition<A> implements Token {
CompareType compareType;
A x, y;
......@@ -32,4 +31,3 @@ class Condition<A> implements Token {
}
}
}
//## Java 1.5 end ##
......@@ -9,7 +9,6 @@ package org.h2.jaqu;
/**
* An OR or an AND condition.
*/
//## Java 1.5 begin ##
enum ConditionAndOr implements Token {
AND("AND"),
OR("OR");
......@@ -25,4 +24,3 @@ enum ConditionAndOr implements Token {
}
}
//## Java 1.5 end ##
......@@ -6,7 +6,6 @@
*/
package org.h2.jaqu;
//## Java 1.5 begin ##
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
......@@ -25,7 +24,6 @@ import org.h2.jaqu.SQLDialect.DefaultSQLDialect;
import org.h2.jaqu.Table.JQDatabase;
import org.h2.jaqu.Table.JQTable;
import org.h2.jaqu.util.WeakIdentityHashMap;
//## Java 1.5 end ##
import org.h2.util.JdbcUtils;
import org.h2.util.New;
import org.h2.util.StringUtils;
......@@ -33,7 +31,6 @@ import org.h2.util.StringUtils;
/**
* This class represents a connection to a database.
*/
//## Java 1.5 begin ##
public class Db {
/**
......@@ -349,4 +346,3 @@ public class Db {
// }
}
//## Java 1.5 end ##
......@@ -12,7 +12,6 @@ import org.h2.jaqu.Table.IndexType;
* This class provides utility methods to define primary keys, indexes, and set
* the name of the table.
*/
//## Java 1.5 begin ##
public class Define {
private static TableDefinition<?> currentTableDefinition;
......@@ -70,4 +69,3 @@ public class Define {
}
}
//## Java 1.5 end ##
......@@ -6,15 +6,12 @@
*/
package org.h2.jaqu;
//## Java 1.5 begin ##
import org.h2.jaqu.util.ClassUtils;
//## Java 1.5 end ##
/**
* This class provides static methods that represents common SQL functions.
*/
public class Function implements Token {
//## Java 1.5 begin ##
// must be a new instance
private static final Long COUNT_STAR = Long.valueOf(0);
......@@ -148,5 +145,4 @@ public class Function implements Token {
});
}
//## Java 1.5 end ##
}
......@@ -11,7 +11,6 @@ package org.h2.jaqu;
*
* @param <T> the query data type
*/
//## Java 1.5 begin ##
class OrderExpression<T> {
private Query<T> query;
private Object expression;
......@@ -42,4 +41,3 @@ class OrderExpression<T> {
}
}
//## Java 1.5 end ##
......@@ -6,7 +6,6 @@
*/
package org.h2.jaqu;
//## Java 1.5 begin ##
import java.lang.reflect.Field;
import java.sql.Clob;
import java.sql.ResultSet;
......@@ -19,7 +18,6 @@ import java.util.List;
import org.h2.jaqu.bytecode.ClassReader;
import org.h2.jaqu.util.StatementLogger;
import org.h2.jaqu.util.ClassUtils;
//## Java 1.5 end ##
import org.h2.util.JdbcUtils;
import org.h2.util.New;
......@@ -28,7 +26,6 @@ import org.h2.util.New;
*
* @param <T> the return type
*/
//## Java 1.5 begin ##
public class Query<T> {
private Db db;
......@@ -280,14 +277,12 @@ public class Query<T> {
addConditionToken(token);
return new QueryWhere<T>(this);
}
//## Java 1.5 end ##
/**
* Sets the Limit and Offset of a query.
*
* @return the query
*/
//## Java 1.5 begin ##
public Query<T> limit(long limit) {
this.limit = limit;
return this;
......@@ -297,7 +292,6 @@ public class Query<T> {
this.offset = offset;
return this;
}
//## Java 1.5 end ##
/**
* Order by a number of columns.
......@@ -305,7 +299,6 @@ public class Query<T> {
* @param expressions the columns
* @return the query
*/
//## Java 1.5 begin ##
public Query<T> orderBy(Object... expressions) {
for (Object expr : expressions) {
OrderExpression<T> e =
......@@ -408,7 +401,6 @@ public class Query<T> {
}
StatementLogger.select(stat.getSQL());
}
//## Java 1.5 end ##
/**
* Join another table.
......@@ -416,7 +408,6 @@ public class Query<T> {
* @param alias an alias for the table to join
* @return the joined query
*/
//## Java 1.5 begin ##
@SuppressWarnings("unchecked")
public <U> QueryJoin innerJoin(U alias) {
TableDefinition<T> def = (TableDefinition<T>) db.define(alias.getClass());
......@@ -443,4 +434,3 @@ public class Query<T> {
}
}
//## Java 1.5 end ##
......@@ -12,7 +12,6 @@ package org.h2.jaqu;
* @param <T> the return type of the query
* @param <A> the incomplete condition data type
*/
//## Java 1.5 begin ##
public class QueryCondition<T, A> {
private Query<T> query;
......@@ -60,4 +59,3 @@ public class QueryCondition<T, A> {
}
}
//## Java 1.5 end ##
......@@ -9,7 +9,6 @@ package org.h2.jaqu;
/**
* This class represents a query with a join.
*/
//## Java 1.5 begin ##
public class QueryJoin {
private Query<?> query;
......@@ -24,4 +23,3 @@ public class QueryJoin {
return new QueryJoinCondition<A>(query, join, x);
}
}
//## Java 1.5 end ##
......@@ -11,7 +11,6 @@ package org.h2.jaqu;
*
* @param <A> the incomplete condition data type
*/
//## Java 1.5 begin ##
public class QueryJoinCondition<A> {
private Query<?> query;
......@@ -29,4 +28,3 @@ public class QueryJoinCondition<A> {
return query;
}
}
//## Java 1.5 end ##
......@@ -6,16 +6,13 @@
*/
package org.h2.jaqu;
//## Java 1.5 begin ##
import java.util.List;
//## Java 1.5 end ##
/**
* This class represents a query with a condition.
*
* @param <T> the return type
*/
//## Java 1.5 begin ##
public class QueryWhere<T> {
Query<T> query;
......@@ -77,7 +74,6 @@ public class QueryWhere<T> {
return query.selectDistinct();
}
//## Java 1.5 end ##
/**
* Order by a number of columns.
......@@ -85,7 +81,6 @@ public class QueryWhere<T> {
* @param expressions the order by expressions
* @return the query
*/
//## Java 1.5 begin ##
public QueryWhere<T> orderBy(Object... expressions) {
for (Object expr : expressions) {
OrderExpression<T> e =
......@@ -143,4 +138,3 @@ public class QueryWhere<T> {
}
}
//## Java 1.5 end ##
......@@ -6,18 +6,15 @@
*/
package org.h2.jaqu;
//## Java 1.5 begin ##
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
//## Java 1.5 end ##
import org.h2.util.JdbcUtils;
/**
* This class represents a parameterized SQL statement.
*/
//## Java 1.5 begin ##
public class SQLStatement {
private Db db;
private StringBuilder buff = new StringBuilder();
......@@ -112,4 +109,3 @@ public class SQLStatement {
}
}
//## Java 1.5 end ##
......@@ -6,16 +6,13 @@
*/
package org.h2.jaqu;
//## Java 1.5 begin ##
import org.h2.jaqu.TableDefinition.FieldDefinition;
//## Java 1.5 end ##
/**
* This class represents a column of a table in a query.
*
* @param <T> the table data type
*/
//## Java 1.5 begin ##
class SelectColumn<T> {
private SelectTable<T> selectTable;
private FieldDefinition fieldDef;
......@@ -45,4 +42,3 @@ class SelectColumn<T> {
return fieldDef.getValue(selectTable.getCurrent());
}
}
//## Java 1.5 end ##
......@@ -6,18 +6,15 @@
*/
package org.h2.jaqu;
//## Java 1.5 begin ##
import java.util.ArrayList;
import org.h2.jaqu.util.ClassUtils;
import org.h2.util.New;
//## Java 1.5 end ##
/**
* This class represents a table in a query.
*
* @param <T> the table class
*/
//## Java 1.5 begin ##
class SelectTable <T> {
private static int asCounter;
......@@ -101,4 +98,3 @@ class SelectTable <T> {
}
}
//## Java 1.5 end ##
......@@ -6,7 +6,6 @@
*/
package org.h2.jaqu;
//## Java 1.5 begin ##
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.sql.ResultSet;
......@@ -23,7 +22,6 @@ import org.h2.jaqu.Table.JQSchema;
import org.h2.jaqu.Table.JQTable;
import org.h2.jaqu.util.StatementLogger;
import org.h2.jaqu.util.ClassUtils;
//## Java 1.5 end ##
import org.h2.util.New;
import org.h2.util.StatementBuilder;
import org.h2.util.StringUtils;
......@@ -34,26 +32,21 @@ import org.h2.util.StringUtils;
*
* @param <T> the table type
*/
//## Java 1.5 begin ##
class TableDefinition<T> {
//## Java 1.5 end ##
/**
* The meta data of an index.
*/
//## Java 1.5 begin ##
static class IndexDefinition {
IndexType type;
String indexName;
List<String> columnNames;
}
//## Java 1.5 end ##
/**
* The meta data of a field.
*/
//## Java 1.5 begin ##
static class FieldDefinition {
String columnName;
Field field;
......@@ -644,4 +637,3 @@ class TableDefinition<T> {
}
}
//## Java 1.5 end ##
......@@ -13,7 +13,6 @@ import org.h2.jaqu.util.ClassUtils;
*
* @param <A> the incomplete condition data type
*/
//## Java 1.5 begin ##
public class TestCondition<A> {
private A x;
......@@ -101,4 +100,3 @@ public class TestCondition<A> {
}
}
//## Java 1.5 end ##
......@@ -16,7 +16,5 @@ public interface Token {
* @param stat the statement to append the SQL to
* @param query the query to use
*/
//## Java 1.5 begin ##
<T> void appendSQL(SQLStatement stat, Query<T> query);
//## Java 1.5 end ##
}
......@@ -17,8 +17,6 @@ public interface UpdateColumn {
*
* @param stat the statement to append the SQL to
*/
//## Java 1.5 begin ##
void appendSQL(SQLStatement stat);
//## Java 1.5 end ##
}
......@@ -12,7 +12,6 @@ package org.h2.jaqu;
* @param <T> the query type
* @param <A> the new value data type
*/
//## Java 1.5 begin ##
public class UpdateColumnIncrement<T, A> implements UpdateColumn {
private Query<T> query;
......@@ -40,4 +39,3 @@ public class UpdateColumnIncrement<T, A> implements UpdateColumn {
}
}
//## Java 1.5 end ##
......@@ -12,7 +12,6 @@ package org.h2.jaqu;
* @param <T> the query type
* @param <A> the new value data type
*/
//## Java 1.5 begin ##
public class UpdateColumnSet<T, A> implements UpdateColumn {
private Query<T> query;
......@@ -37,4 +36,3 @@ public class UpdateColumnSet<T, A> implements UpdateColumn {
}
}
//## Java 1.5 end ##
......@@ -6,63 +6,26 @@
*/
package org.h2.jaqu.util;
//## Java 1.5 begin ##
import java.io.IOException;
import java.io.Reader;
import java.io.StringWriter;
import java.lang.reflect.Constructor;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.sql.Clob;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.IdentityHashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicLong;
import org.h2.util.IOUtils;
//## Java 1.5 end ##
/**
* Generic utility methods.
*/
public class ClassUtils {
//## Java 1.5 begin ##
private static final AtomicLong COUNTER = new AtomicLong(0);
private static final boolean MAKE_ACCESSIBLE = true;
private static final int BUFFER_BLOCK_SIZE = 4 * 1024;
// public static <T> ArrayList<T> newArrayList() {
// return new ArrayList<T>();
// }
//
// public static <T> ArrayList<T> newArrayList(Collection<T> c) {
// return new ArrayList<T>(c);
// }
//
// public static <T> HashSet<T> newHashSet() {
// return new HashSet<T>();
// }
// public static <T> HashSet<T> newHashSet(Collection<T> list) {
// return new HashSet<T>(list);
// }
//
// public static <A, B> HashMap<A, B> newHashMap() {
// return new HashMap<A, B>();
// }
//
// public static <A, B> Map<A, B> newSynchronizedHashMap() {
// HashMap<A, B> map = newHashMap();
// return Collections.synchronizedMap(map);
// }
public static <A, B> IdentityHashMap<A, B> newIdentityHashMap() {
return new IdentityHashMap<A, B>();
}
......@@ -188,5 +151,4 @@ public class ClassUtils {
return (Class<X>) x.getClass();
}
//## Java 1.5 end ##
}
......@@ -6,12 +6,10 @@
*/
package org.h2.jaqu.util;
//## Java 1.5 begin ##
import java.lang.ref.WeakReference;
import java.util.Collection;
import java.util.Map;
import java.util.Set;
//## Java 1.5 end ##
/**
* This hash map uses weak references, so that elements that are no longer
......@@ -22,7 +20,6 @@ import java.util.Set;
* @param <K> the keys
* @param <V> the value
*/
//## Java 1.5 begin ##
public class WeakIdentityHashMap<K, V> implements Map<K, V> {
private static final int MAX_LOAD = 90;
......@@ -229,4 +226,3 @@ public class WeakIdentityHashMap<K, V> implements Map<K, V> {
}
}
//## Java 1.5 end ##
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论