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

DbSchema - simplify ifs while preserving readability

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