提交 a086df3e authored 作者: Jacek Ławrynowicz's avatar Jacek Ławrynowicz

DbSchema - simplify ifs while preserving readability

上级 d32a566b
......@@ -58,22 +58,14 @@ public class DbSchema {
DbSchema(DbContents contents, String name, boolean isDefault) {
this.contents = contents;
this.name = name;
this.quotedName = contents.quoteIdentifier(name);
this.quotedName = contents.quoteIdentifier(name);
this.isDefault = isDefault;
if (name == null) {
// firebird
isSystem = true;
} else if ("INFORMATION_SCHEMA".equals(name)) {
isSystem = true;
} else if (!contents.isH2() &&
StringUtils.toUpperEnglish(name).startsWith("INFO")) {
isSystem = true;
} else if (contents.isPostgreSQL() &&
StringUtils.toUpperEnglish(name).startsWith("PG_")) {
isSystem = true;
} else {
isSystem = contents.isDerby() && name.startsWith("SYS");
}
isSystem =
(name == null) // firebird
|| "INFORMATION_SCHEMA".equals(name)
|| (!contents.isH2() && StringUtils.toUpperEnglish(name).startsWith("INFO"))
|| (contents.isPostgreSQL() && StringUtils.toUpperEnglish(name).startsWith("PG_"))
|| (contents.isDerby() && name.startsWith("SYS"));
}
/**
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论