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

Formatting / Javadocs

上级 d7f16c93
......@@ -54,7 +54,7 @@ table with an LOB column.
</li>
<li>Add support for ALTER VIEW [ IF EXISTS ]
</li>
<li>Add support for ALTER INDE [ IF EXISTS ]
<li>Add support for ALTER INDEX [ IF EXISTS ]
</li>
<li>Add support for ALTER SEQUENCE [ IF EXISTS ]
</li>
......
......@@ -5615,7 +5615,8 @@ public class Parser {
return command;
} else if (readIf("TYPE")) {
// PostgreSQL compatibility
return parseAlterTableAlterColumnType(schema, tableName, columnName, ifTableExists);
return parseAlterTableAlterColumnType(schema, tableName,
columnName, ifTableExists);
} else if (readIf("SET")) {
if (readIf("DATA")) {
// Derby compatibility
......@@ -5658,7 +5659,8 @@ public class Parser {
command.setSelectivity(readExpression());
return command;
} else {
return parseAlterTableAlterColumnType(schema, tableName, columnName, ifTableExists);
return parseAlterTableAlterColumnType(schema, tableName,
columnName, ifTableExists);
}
}
throw getSyntaxError();
......@@ -5672,21 +5674,24 @@ public class Parser {
return table;
}
private Column columnIfTableExists(Schema schema, String tableName, String columnName, boolean ifTableExists) {
private Column columnIfTableExists(Schema schema, String tableName,
String columnName, boolean ifTableExists) {
Table table = tableIfTableExists(schema, tableName, ifTableExists);
return table == null ? null : table.getColumn(columnName);
}
private Prepared commandIfTableExists(Schema schema, String tableName, boolean ifTableExists, Prepared commandIfTableExists) {
private Prepared commandIfTableExists(Schema schema, String tableName,
boolean ifTableExists, Prepared commandIfTableExists) {
return tableIfTableExists(schema, tableName, ifTableExists) == null
? new NoOperation(session)
: commandIfTableExists;
}
private AlterTableAlterColumn parseAlterTableAlterColumnType(Schema schema, String tableName,
String columnName, boolean ifTableExists) {
private AlterTableAlterColumn parseAlterTableAlterColumnType(Schema schema,
String tableName, String columnName, boolean ifTableExists) {
Column oldColumn = columnIfTableExists(schema, tableName, columnName, ifTableExists);
Column newColumn = parseColumnForTable(columnName, oldColumn == null ? true : oldColumn.isNullable());
Column newColumn = parseColumnForTable(columnName,
oldColumn == null ? true : oldColumn.isNullable());
AlterTableAlterColumn command = new AlterTableAlterColumn(session,
schema);
command.setTableName(tableName);
......@@ -5697,7 +5702,8 @@ public class Parser {
return command;
}
private AlterTableAlterColumn parseAlterTableAddColumn(String tableName, Schema schema, boolean ifTableExists) {
private AlterTableAlterColumn parseAlterTableAddColumn(String tableName,
Schema schema, boolean ifTableExists) {
readIf("COLUMN");
AlterTableAlterColumn command = new AlterTableAlterColumn(session,
schema);
......
......@@ -382,7 +382,7 @@ public class CompareLike extends Condition {
}
patternString = new String(patternChars, 0, patternLength);
/* optimises the common case of LIKE 'foo%' */
// optimizes the common case of LIKE 'foo%'
if (compareMode.getName().equals(CompareMode.OFF) && patternLength > 1) {
int maxMatch = 0;
while (maxMatch < patternLength && patternTypes[maxMatch] == MATCH) {
......
......@@ -177,12 +177,12 @@ public class CipherFactory {
if (list == null) {
return list;
}
List<String> algos = new LinkedList<String>(Arrays.asList(list.split("\\s*,\\s*")));
boolean dhAnonRemoved = algos.remove("DH_anon");
boolean ecdhAnonRemoved = algos.remove("ECDH_anon");
List<String> algorithms = new LinkedList<String>(Arrays.asList(list.split("\\s*,\\s*")));
boolean dhAnonRemoved = algorithms.remove("DH_anon");
boolean ecdhAnonRemoved = algorithms.remove("ECDH_anon");
if (dhAnonRemoved || ecdhAnonRemoved) {
String algosStr = Arrays.toString(algos.toArray(new String[algos.size()]));
return (algos.size() > 0) ? algosStr.substring(1, algosStr.length() - 1): "";
String string = Arrays.toString(algorithms.toArray(new String[algorithms.size()]));
return (algorithms.size() > 0) ? string.substring(1, string.length() - 1): "";
}
return list;
}
......@@ -203,13 +203,13 @@ public class CipherFactory {
* behavior.
*/
public static synchronized void removeAnonFromLegacyAlgorithms() {
String legacyAlgosOrig = getLegacyAlgorithmsSilently();
if (legacyAlgosOrig == null) {
String legacyOriginal = getLegacyAlgorithmsSilently();
if (legacyOriginal == null) {
return;
}
String legacyAlgosNew = removeDhAnonFromCommaSeparatedList(legacyAlgosOrig);
if (!legacyAlgosOrig.equals(legacyAlgosNew)) {
setLegacyAlgorithmsSilently(legacyAlgosNew);
String legacyNew = removeDhAnonFromCommaSeparatedList(legacyOriginal);
if (!legacyOriginal.equals(legacyNew)) {
setLegacyAlgorithmsSilently(legacyNew);
}
}
......@@ -243,12 +243,12 @@ public class CipherFactory {
return defaultLegacyAlgorithms;
}
private static void setLegacyAlgorithmsSilently(String legacyAlgos) {
if (legacyAlgos == null) {
private static void setLegacyAlgorithmsSilently(String legacyAlgorithms) {
if (legacyAlgorithms == null) {
return;
}
try {
Security.setProperty(LEGACY_ALGORITHMS_SECURITY_KEY, legacyAlgos);
Security.setProperty(LEGACY_ALGORITHMS_SECURITY_KEY, legacyAlgorithms);
} catch (SecurityException e) {
// ignore
}
......
......@@ -2994,7 +2994,7 @@ alter view address_view recompile;
alter view if exists address_view recompile;
> ok
alter view if exists doesnt_exist recompile;
alter view if exists does_not_exist recompile;
> ok
select * from ADDRESS_VIEW;
......@@ -10318,31 +10318,31 @@ insert into x(id) values(1);
delete from x;
> update count: 1
alter table if exists y add constraint x_chk check (b = 'a');
alter table if exists y add constraint x_check check (b = 'a');
> ok
alter table if exists x add constraint x_chk check (b = 'a');
alter table if exists x add constraint x_check check (b = 'a');
> ok
alter table if exists x add constraint x_chk check (b = 'a');
alter table if exists x add constraint x_check check (b = 'a');
> exception
insert into x(id, b) values(1, 'b');
> exception
alter table if exists y rename constraint x_chk to x_chk1;
alter table if exists y rename constraint x_check to x_check1;
> ok
alter table if exists x rename constraint x_chk to x_chk1;
alter table if exists x rename constraint x_check to x_check1;
> ok
alter table if exists x rename constraint x_chk to x_chk1;
alter table if exists x rename constraint x_check to x_check1;
> exception
alter table if exists y drop constraint x_chk1;
alter table if exists y drop constraint x_check1;
> ok
alter table if exists x drop constraint x_chk1;
alter table if exists x drop constraint x_check1;
> ok
alter table if exists y rename to z;
......
......@@ -37,7 +37,7 @@ public class TestSecurity extends TestBase {
testAES();
testBlockCiphers();
testRemoveAnonFromLegacyAlgorithms();
//testResetLegacyAlgos();
// testResetLegacyAlgorithms();
}
private static void testConnectWithHash() throws SQLException {
......@@ -255,22 +255,22 @@ public class TestSecurity extends TestBase {
}
private void testRemoveAnonFromLegacyAlgorithms() {
String legacyAlgos = "K_NULL, C_NULL, M_NULL, DHE_DSS_EXPORT" +
String legacyAlgorithms = "K_NULL, C_NULL, M_NULL, DHE_DSS_EXPORT" +
", DHE_RSA_EXPORT, DH_anon_EXPORT, DH_DSS_EXPORT, DH_RSA_EXPORT, RSA_EXPORT" +
", DH_anon, ECDH_anon, RC4_128, RC4_40, DES_CBC, DES40_CBC";
String expectedLegacyAlgosWithoutDhAnon = "K_NULL, C_NULL, M_NULL, DHE_DSS_EXPORT" +
String expectedLegacyWithoutDhAnon = "K_NULL, C_NULL, M_NULL, DHE_DSS_EXPORT" +
", DHE_RSA_EXPORT, DH_anon_EXPORT, DH_DSS_EXPORT, DH_RSA_EXPORT, RSA_EXPORT" +
", RC4_128, RC4_40, DES_CBC, DES40_CBC";
assertEquals(expectedLegacyAlgosWithoutDhAnon,
CipherFactory.removeDhAnonFromCommaSeparatedList(legacyAlgos));
assertEquals(expectedLegacyWithoutDhAnon,
CipherFactory.removeDhAnonFromCommaSeparatedList(legacyAlgorithms));
legacyAlgos = "ECDH_anon, DH_anon_EXPORT, DH_anon";
expectedLegacyAlgosWithoutDhAnon = "DH_anon_EXPORT";
assertEquals(expectedLegacyAlgosWithoutDhAnon,
CipherFactory.removeDhAnonFromCommaSeparatedList(legacyAlgos));
legacyAlgorithms = "ECDH_anon, DH_anon_EXPORT, DH_anon";
expectedLegacyWithoutDhAnon = "DH_anon_EXPORT";
assertEquals(expectedLegacyWithoutDhAnon,
CipherFactory.removeDhAnonFromCommaSeparatedList(legacyAlgorithms));
legacyAlgos = null;
assertNull(CipherFactory.removeDhAnonFromCommaSeparatedList(legacyAlgos));
legacyAlgorithms = null;
assertNull(CipherFactory.removeDhAnonFromCommaSeparatedList(legacyAlgorithms));
}
/**
......@@ -281,7 +281,7 @@ public class TestSecurity extends TestBase {
* to a modification of the global state with hard-to-track consequences.
*/
@SuppressWarnings("unused")
private void testResetLegacyAlgos() {
private void testResetLegacyAlgorithms() {
String legacyAlgorithmsBefore = CipherFactory.getLegacyAlgorithmsSilently();
assertEquals("Failed assumption: jdk.tls.legacyAlgorithms" +
" has been modified from its initial setting",
......
......@@ -719,7 +719,5 @@ xmlhttp xmlnode xmlns xmlstartdoc xmltext xmx xor xrmd xrunhprof xsi xsm xtea xt
xtime xts xvi xyz yacute year years yen yes yet yield yielding yjp ymd york you
young younger youngest your yourself youtube ytd yuml yyfxyy yyyymmdd zeile zen
zepfred zero zeroes zeros zeta zhang zip ziv zloty zone zones zurich zwj zwnj
incl reveal designators templates invoked candidate handshake optimises altered accomplished permanent algos clarify weaken excl alternatively
dita imjcc
\ No newline at end of file
recompiled incl reveal designators templates invoked candidate handshake altered
accomplished permanent clarify weaken excl alternatively dita imjcc optimizes
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论