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

Formatting

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