提交 062e11dc authored 作者: Thomas Mueller Graf's avatar Thomas Mueller Graf

Formatting

上级 486fe1a0
...@@ -1663,7 +1663,7 @@ public class ErrorCode { ...@@ -1663,7 +1663,7 @@ public class ErrorCode {
* DROP TABLE INFORMATION_SCHEMA.SETTINGS; * DROP TABLE INFORMATION_SCHEMA.SETTINGS;
* </pre> * </pre>
*/ */
public static final int CANNOT_DROP_TABLE_1 = 90118; public static final int CANNOT_DROP_TABLE_1 = 90118;
/** /**
* The error with code <code>90119</code> is thrown when * The error with code <code>90119</code> is thrown when
...@@ -1908,7 +1908,6 @@ public class ErrorCode { ...@@ -1908,7 +1908,6 @@ public class ErrorCode {
*/ */
public static final int RESULT_SET_READONLY = 90140; public static final int RESULT_SET_READONLY = 90140;
/** /**
* The error with code <code>90141</code> is thrown when * The error with code <code>90141</code> is thrown when
* trying to change the java object serializer while there was already data * trying to change the java object serializer while there was already data
......
...@@ -45,7 +45,7 @@ public class RuleFixed implements Rule { ...@@ -45,7 +45,7 @@ public class RuleFixed implements Rule {
String query = sentence.getQuery(); String query = sentence.getQuery();
String s = query; String s = query;
boolean removeTrailingSpaces = false; boolean removeTrailingSpaces = false;
switch(type) { switch (type) {
case YMD: case YMD:
while (s.length() > 0 && "0123456789-".indexOf(s.charAt(0)) >= 0) { while (s.length() > 0 && "0123456789-".indexOf(s.charAt(0)) >= 0) {
s = s.substring(1); s = s.substring(1);
......
...@@ -49,7 +49,7 @@ public class AlterTableSet extends SchemaCommand { ...@@ -49,7 +49,7 @@ public class AlterTableSet extends SchemaCommand {
Table table = getSchema().getTableOrView(session, tableName); Table table = getSchema().getTableOrView(session, tableName);
session.getUser().checkRight(table, Right.ALL); session.getUser().checkRight(table, Right.ALL);
table.lock(session, true, true); table.lock(session, true, true);
switch(type) { switch (type) {
case CommandInterface.ALTER_TABLE_SET_REFERENTIAL_INTEGRITY: case CommandInterface.ALTER_TABLE_SET_REFERENTIAL_INTEGRITY:
table.setCheckForeignKeyConstraints(session, value, value ? table.setCheckForeignKeyConstraints(session, value, value ?
checkExisting : false); checkExisting : false);
......
...@@ -46,7 +46,7 @@ public class Call extends Prepared { ...@@ -46,7 +46,7 @@ public class Call extends Prepared {
public int update() { public int update() {
Value v = expression.getValue(session); Value v = expression.getValue(session);
int type = v.getType(); int type = v.getType();
switch(type) { switch (type) {
case Value.RESULT_SET: case Value.RESULT_SET:
// this will throw an exception // this will throw an exception
// methods returning a result set may not be called like this. // methods returning a result set may not be called like this.
......
...@@ -1269,7 +1269,7 @@ public class Select extends Query { ...@@ -1269,7 +1269,7 @@ public class Select extends Query {
@Override @Override
public boolean isEverything(ExpressionVisitor visitor) { public boolean isEverything(ExpressionVisitor visitor) {
switch(visitor.getType()) { switch (visitor.getType()) {
case ExpressionVisitor.DETERMINISTIC: { case ExpressionVisitor.DETERMINISTIC: {
if (isForUpdate) { if (isForUpdate) {
return false; return false;
......
...@@ -31,7 +31,7 @@ public class Comment extends DbObjectBase { ...@@ -31,7 +31,7 @@ public class Comment extends DbObjectBase {
} }
private static String getTypeName(int type) { private static String getTypeName(int type) {
switch(type) { switch (type) {
case DbObject.CONSTANT: case DbObject.CONSTANT:
return "CONSTANT"; return "CONSTANT";
case DbObject.CONSTRAINT: case DbObject.CONSTRAINT:
......
...@@ -104,7 +104,7 @@ public class MetaRecord implements Comparable<MetaRecord> { ...@@ -104,7 +104,7 @@ public class MetaRecord implements Comparable<MetaRecord> {
* @return the sort index * @return the sort index
*/ */
private int getCreateOrder() { private int getCreateOrder() {
switch(objectType) { switch (objectType) {
case DbObject.SETTING: case DbObject.SETTING:
return 0; return 0;
case DbObject.USER: case DbObject.USER:
......
...@@ -541,7 +541,7 @@ public class Function extends Expression implements FunctionCall { ...@@ -541,7 +541,7 @@ public class Function extends Expression implements FunctionCall {
if (info == null) { if (info == null) {
return null; return null;
} }
switch(info.type) { switch (info.type) {
case TABLE: case TABLE:
case TABLE_DISTINCT: case TABLE_DISTINCT:
return new TableFunction(database, info, Long.MAX_VALUE); return new TableFunction(database, info, Long.MAX_VALUE);
...@@ -1401,7 +1401,7 @@ public class Function extends Expression implements FunctionCall { ...@@ -1401,7 +1401,7 @@ public class Function extends Expression implements FunctionCall {
v2 == null ? null : v2.getInt())); v2 == null ? null : v2.getInt()));
break; break;
case TO_CHAR: case TO_CHAR:
switch(v0.getType()){ switch (v0.getType()){
case Value.TIME: case Value.TIME:
case Value.DATE: case Value.DATE:
case Value.TIMESTAMP: case Value.TIMESTAMP:
......
...@@ -84,7 +84,7 @@ public class JavaAggregate extends Expression { ...@@ -84,7 +84,7 @@ public class JavaAggregate extends Expression {
@Override @Override
public boolean isEverything(ExpressionVisitor visitor) { public boolean isEverything(ExpressionVisitor visitor) {
switch(visitor.getType()) { switch (visitor.getType()) {
case ExpressionVisitor.DETERMINISTIC: case ExpressionVisitor.DETERMINISTIC:
// TODO optimization: some functions are deterministic, but we don't // TODO optimization: some functions are deterministic, but we don't
// know (no setting for that) // know (no setting for that)
......
...@@ -134,7 +134,7 @@ public class JavaFunction extends Expression implements FunctionCall { ...@@ -134,7 +134,7 @@ public class JavaFunction extends Expression implements FunctionCall {
@Override @Override
public boolean isEverything(ExpressionVisitor visitor) { public boolean isEverything(ExpressionVisitor visitor) {
switch(visitor.getType()) { switch (visitor.getType()) {
case ExpressionVisitor.DETERMINISTIC: case ExpressionVisitor.DETERMINISTIC:
if (!isDeterministic()) { if (!isDeterministic()) {
return false; return false;
......
...@@ -147,7 +147,7 @@ public class Parameter extends Expression implements ParameterInterface { ...@@ -147,7 +147,7 @@ public class Parameter extends Expression implements ParameterInterface {
@Override @Override
public boolean isEverything(ExpressionVisitor visitor) { public boolean isEverything(ExpressionVisitor visitor) {
switch(visitor.getType()) { switch (visitor.getType()) {
case ExpressionVisitor.EVALUATABLE: case ExpressionVisitor.EVALUATABLE:
// the parameter _will_be_ evaluatable at execute time // the parameter _will_be_ evaluatable at execute time
case ExpressionVisitor.SET_MAX_DATA_MODIFICATION_ID: case ExpressionVisitor.SET_MAX_DATA_MODIFICATION_ID:
......
...@@ -76,7 +76,7 @@ public class Rownum extends Expression { ...@@ -76,7 +76,7 @@ public class Rownum extends Expression {
@Override @Override
public boolean isEverything(ExpressionVisitor visitor) { public boolean isEverything(ExpressionVisitor visitor) {
switch(visitor.getType()) { switch (visitor.getType()) {
case ExpressionVisitor.QUERY_COMPARABLE: case ExpressionVisitor.QUERY_COMPARABLE:
case ExpressionVisitor.OPTIMIZABLE_MIN_MAX_COUNT_ALL: case ExpressionVisitor.OPTIMIZABLE_MIN_MAX_COUNT_ALL:
case ExpressionVisitor.DETERMINISTIC: case ExpressionVisitor.DETERMINISTIC:
......
...@@ -79,7 +79,7 @@ public class SequenceValue extends Expression { ...@@ -79,7 +79,7 @@ public class SequenceValue extends Expression {
@Override @Override
public boolean isEverything(ExpressionVisitor visitor) { public boolean isEverything(ExpressionVisitor visitor) {
switch(visitor.getType()) { switch (visitor.getType()) {
case ExpressionVisitor.EVALUATABLE: case ExpressionVisitor.EVALUATABLE:
case ExpressionVisitor.OPTIMIZABLE_MIN_MAX_COUNT_ALL: case ExpressionVisitor.OPTIMIZABLE_MIN_MAX_COUNT_ALL:
case ExpressionVisitor.NOT_FROM_RESOLVER: case ExpressionVisitor.NOT_FROM_RESOLVER:
......
...@@ -63,7 +63,7 @@ public class Variable extends Expression { ...@@ -63,7 +63,7 @@ public class Variable extends Expression {
@Override @Override
public boolean isEverything(ExpressionVisitor visitor) { public boolean isEverything(ExpressionVisitor visitor) {
switch(visitor.getType()) { switch (visitor.getType()) {
case ExpressionVisitor.EVALUATABLE: case ExpressionVisitor.EVALUATABLE:
// the value will be evaluated at execute time // the value will be evaluated at execute time
case ExpressionVisitor.SET_MAX_DATA_MODIFICATION_ID: case ExpressionVisitor.SET_MAX_DATA_MODIFICATION_ID:
......
...@@ -700,7 +700,7 @@ public class JdbcConnection extends TraceObject implements Connection { ...@@ -700,7 +700,7 @@ public class JdbcConnection extends TraceObject implements Connection {
debugCodeCall("setTransactionIsolation", level); debugCodeCall("setTransactionIsolation", level);
checkClosed(); checkClosed();
int lockMode; int lockMode;
switch(level) { switch (level) {
case Connection.TRANSACTION_READ_UNCOMMITTED: case Connection.TRANSACTION_READ_UNCOMMITTED:
lockMode = Constants.LOCK_MODE_OFF; lockMode = Constants.LOCK_MODE_OFF;
break; break;
...@@ -786,7 +786,7 @@ public class JdbcConnection extends TraceObject implements Connection { ...@@ -786,7 +786,7 @@ public class JdbcConnection extends TraceObject implements Connection {
int lockMode = result.currentRow()[0].getInt(); int lockMode = result.currentRow()[0].getInt();
result.close(); result.close();
int transactionIsolationLevel; int transactionIsolationLevel;
switch(lockMode) { switch (lockMode) {
case Constants.LOCK_MODE_OFF: case Constants.LOCK_MODE_OFF:
transactionIsolationLevel = Connection.TRANSACTION_READ_UNCOMMITTED; transactionIsolationLevel = Connection.TRANSACTION_READ_UNCOMMITTED;
break; break;
...@@ -1194,7 +1194,7 @@ public class JdbcConnection extends TraceObject implements Connection { ...@@ -1194,7 +1194,7 @@ public class JdbcConnection extends TraceObject implements Connection {
private static int translateGetEnd(String sql, int i, char c) { private static int translateGetEnd(String sql, int i, char c) {
int len = sql.length(); int len = sql.length();
switch(c) { switch (c) {
case '$': { case '$': {
if (i < len - 1 && sql.charAt(i + 1) == '$' && if (i < len - 1 && sql.charAt(i + 1) == '$' &&
(i == 0 || sql.charAt(i - 1) <= ' ')) { (i == 0 || sql.charAt(i - 1) <= ' ')) {
......
...@@ -447,7 +447,7 @@ public class MVTableEngine implements TableEngine { ...@@ -447,7 +447,7 @@ public class MVTableEngine implements TableEngine {
@Override @Override
public String getState() { public String getState() {
switch(state) { switch (state) {
case IN_DOUBT: case IN_DOUBT:
return "IN_DOUBT"; return "IN_DOUBT";
case COMMIT: case COMMIT:
......
...@@ -37,7 +37,7 @@ public class PageStoreInDoubtTransaction implements InDoubtTransaction { ...@@ -37,7 +37,7 @@ public class PageStoreInDoubtTransaction implements InDoubtTransaction {
@Override @Override
public void setState(int state) { public void setState(int state) {
switch(state) { switch (state) {
case COMMIT: case COMMIT:
store.setInDoubtTransactionState(sessionId, pos, true); store.setInDoubtTransactionState(sessionId, pos, true);
break; break;
...@@ -52,7 +52,7 @@ public class PageStoreInDoubtTransaction implements InDoubtTransaction { ...@@ -52,7 +52,7 @@ public class PageStoreInDoubtTransaction implements InDoubtTransaction {
@Override @Override
public String getState() { public String getState() {
switch(state) { switch (state) {
case IN_DOUBT: case IN_DOUBT:
return "IN_DOUBT"; return "IN_DOUBT";
case COMMIT: case COMMIT:
......
...@@ -128,7 +128,7 @@ public class MetaTable extends Table { ...@@ -128,7 +128,7 @@ public class MetaTable extends Table {
this.type = type; this.type = type;
Column[] cols; Column[] cols;
String indexColumnName = null; String indexColumnName = null;
switch(type) { switch (type) {
case TABLES: case TABLES:
setObjectName("TABLES"); setObjectName("TABLES");
cols = createColumns( cols = createColumns(
...@@ -1854,7 +1854,7 @@ public class MetaTable extends Table { ...@@ -1854,7 +1854,7 @@ public class MetaTable extends Table {
} }
private static int getRefAction(int action) { private static int getRefAction(int action) {
switch(action) { switch (action) {
case ConstraintReferential.CASCADE: case ConstraintReferential.CASCADE:
return DatabaseMetaData.importedKeyCascade; return DatabaseMetaData.importedKeyCascade;
case ConstraintReferential.RESTRICT: case ConstraintReferential.RESTRICT:
......
...@@ -322,7 +322,7 @@ public class RegularTable extends TableBase { ...@@ -322,7 +322,7 @@ public class RegularTable extends TableBase {
if (first.sortType != SortOrder.ASCENDING) { if (first.sortType != SortOrder.ASCENDING) {
return -1; return -1;
} }
switch(first.column.getType()) { switch (first.column.getType()) {
case Value.BYTE: case Value.BYTE:
case Value.SHORT: case Value.SHORT:
case Value.INT: case Value.INT:
......
...@@ -493,7 +493,7 @@ public class DataType { ...@@ -493,7 +493,7 @@ public class DataType {
int columnIndex, int type) { int columnIndex, int type) {
try { try {
Value v; Value v;
switch(type) { switch (type) {
case Value.NULL: { case Value.NULL: {
return ValueNull.INSTANCE; return ValueNull.INSTANCE;
} }
...@@ -679,7 +679,7 @@ public class DataType { ...@@ -679,7 +679,7 @@ public class DataType {
* @return the class name * @return the class name
*/ */
public static String getTypeClassName(int type) { public static String getTypeClassName(int type) {
switch(type) { switch (type) {
case Value.BOOLEAN: case Value.BOOLEAN:
// "java.lang.Boolean"; // "java.lang.Boolean";
return Boolean.class.getName(); return Boolean.class.getName();
...@@ -815,7 +815,7 @@ public class DataType { ...@@ -815,7 +815,7 @@ public class DataType {
* @return the value type * @return the value type
*/ */
public static int convertSQLTypeToValueType(int sqlType) { public static int convertSQLTypeToValueType(int sqlType) {
switch(sqlType) { switch (sqlType) {
case Types.CHAR: case Types.CHAR:
case Types.NCHAR: case Types.NCHAR:
return Value.STRING_FIXED; return Value.STRING_FIXED;
......
...@@ -535,7 +535,7 @@ public class Transfer { ...@@ -535,7 +535,7 @@ public class Transfer {
*/ */
public Value readValue() throws IOException { public Value readValue() throws IOException {
int type = readInt(); int type = readInt();
switch(type) { switch (type) {
case Value.NULL: case Value.NULL:
return ValueNull.INSTANCE; return ValueNull.INSTANCE;
case Value.BYTES: case Value.BYTES:
......
...@@ -264,7 +264,7 @@ public abstract class Value { ...@@ -264,7 +264,7 @@ public abstract class Value {
* @return the order number * @return the order number
*/ */
static int getOrder(int type) { static int getOrder(int type) {
switch(type) { switch (type) {
case UNKNOWN: case UNKNOWN:
return 1; return 1;
case NULL: case NULL:
...@@ -748,7 +748,7 @@ public abstract class Value { ...@@ -748,7 +748,7 @@ public abstract class Value {
break; break;
} }
case BYTES: { case BYTES: {
switch(getType()) { switch (getType()) {
case JAVA_OBJECT: case JAVA_OBJECT:
case BLOB: case BLOB:
return ValueBytes.getNoCopy(getBytesNoCopy()); return ValueBytes.getNoCopy(getBytesNoCopy());
...@@ -790,7 +790,7 @@ public abstract class Value { ...@@ -790,7 +790,7 @@ public abstract class Value {
break; break;
} }
case JAVA_OBJECT: { case JAVA_OBJECT: {
switch(getType()) { switch (getType()) {
case BYTES: case BYTES:
case BLOB: case BLOB:
return ValueJavaObject.getNoCopy( return ValueJavaObject.getNoCopy(
...@@ -799,7 +799,7 @@ public abstract class Value { ...@@ -799,7 +799,7 @@ public abstract class Value {
break; break;
} }
case BLOB: { case BLOB: {
switch(getType()) { switch (getType()) {
case BYTES: case BYTES:
return ValueLobDb.createSmallLob( return ValueLobDb.createSmallLob(
Value.BLOB, getBytesNoCopy()); Value.BLOB, getBytesNoCopy());
...@@ -807,13 +807,13 @@ public abstract class Value { ...@@ -807,13 +807,13 @@ public abstract class Value {
break; break;
} }
case UUID: { case UUID: {
switch(getType()) { switch (getType()) {
case BYTES: case BYTES:
return ValueUuid.get(getBytesNoCopy()); return ValueUuid.get(getBytesNoCopy());
} }
} }
case GEOMETRY: case GEOMETRY:
switch(getType()) { switch (getType()) {
case BYTES: case BYTES:
return ValueGeometry.get(getBytesNoCopy()); return ValueGeometry.get(getBytesNoCopy());
case JAVA_OBJECT: case JAVA_OBJECT:
......
...@@ -297,7 +297,7 @@ public class TestIndex extends TestBase { ...@@ -297,7 +297,7 @@ public class TestIndex extends TestBase {
for (int i = 0; i < len; i++) { for (int i = 0; i < len; i++) {
int x = rand.nextInt(len); int x = rand.nextInt(len);
String sql = ""; String sql = "";
switch(rand.nextInt(3)) { switch (rand.nextInt(3)) {
case 0: case 0:
sql = "delete from testA where id = " + x; sql = "delete from testA where id = " + x;
break; break;
......
...@@ -144,7 +144,7 @@ public class TestNativeSQL extends TestBase { ...@@ -144,7 +144,7 @@ public class TestNativeSQL extends TestBase {
StringBuilder buff = new StringBuilder("{oj }"); StringBuilder buff = new StringBuilder("{oj }");
for (int j = random.nextInt(10); j > 0; j--) { for (int j = random.nextInt(10); j > 0; j--) {
String s; String s;
switch(random.nextInt(7)) { switch (random.nextInt(7)) {
case 0: case 0:
buff.append(" $$"); buff.append(" $$");
s = "{}\'\"-/* a\n"; s = "{}\'\"-/* a\n";
......
...@@ -51,7 +51,7 @@ public class TestMultiThreaded extends TestBase { ...@@ -51,7 +51,7 @@ public class TestMultiThreaded extends TestBase {
ResultSet rs; ResultSet rs;
try { try {
while (!stop) { while (!stop) {
switch(random.nextInt(6)) { switch (random.nextInt(6)) {
case 0: case 0:
// insert a row for this connection // insert a row for this connection
traceThread("insert " + id + " count: " + count); traceThread("insert " + id + " count: " + count);
......
...@@ -683,7 +683,7 @@ public class TestFileSystem extends TestBase { ...@@ -683,7 +683,7 @@ public class TestFileSystem extends TestBase {
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
trace("op " + i); trace("op " + i);
int pos = random.nextInt(10000); int pos = random.nextInt(10000);
switch(random.nextInt(7)) { switch (random.nextInt(7)) {
case 0: { case 0: {
pos = (int) Math.min(pos, ra.length()); pos = (int) Math.min(pos, ra.length());
trace("seek " + pos); trace("seek " + pos);
......
...@@ -94,7 +94,7 @@ public class BnfRailroad implements BnfVisitor { ...@@ -94,7 +94,7 @@ public class BnfRailroad implements BnfVisitor {
* @return the HTML text * @return the HTML text
*/ */
static String getHtmlText(int type) { static String getHtmlText(int type) {
switch(type) { switch (type) {
case RuleFixed.YMD: case RuleFixed.YMD:
return "2000-01-01"; return "2000-01-01";
case RuleFixed.HMS: case RuleFixed.HMS:
......
...@@ -77,7 +77,7 @@ public class ResourceDoclet { ...@@ -77,7 +77,7 @@ public class ResourceDoclet {
boolean inColumn = false; boolean inColumn = false;
while (p.hasNext()) { while (p.hasNext()) {
String s; String s;
switch(p.next()) { switch (p.next()) {
case XMLParser.END_ELEMENT: case XMLParser.END_ELEMENT:
s = p.getName(); s = p.getName();
if ("p".equals(s) || "tr".equals(s) || "br".equals(s)) { if ("p".equals(s) || "tr".equals(s) || "br".equals(s)) {
......
...@@ -281,7 +281,7 @@ public class ClassReader { ...@@ -281,7 +281,7 @@ public class ClassReader {
endOfMethod = false; endOfMethod = false;
condition = false; condition = false;
nextPc = 0; nextPc = 0;
switch(opCode) { switch (opCode) {
case 0: case 0:
op = "nop"; op = "nop";
break; break;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论