提交 189775e1 authored 作者: Thomas Mueller's avatar Thomas Mueller

Checkstyle.

上级 4bd2e81a
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<!-- <!--
This configuration file was written by the eclipse-cs plugin configuration editor This configuration file was written by the eclipse-cs plugin configuration editor
--> -->
...@@ -6,7 +8,6 @@ ...@@ -6,7 +8,6 @@
Checkstyle-Configuration: MyCheckstyle Checkstyle-Configuration: MyCheckstyle
Description: none Description: none
--> -->
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<module name="Checker"> <module name="Checker">
<property name="severity" value="warning"/> <property name="severity" value="warning"/>
<module name="TreeWalker"> <module name="TreeWalker">
...@@ -31,10 +32,11 @@ ...@@ -31,10 +32,11 @@
</module> </module>
<module name="NoWhitespaceBefore"/> <module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"> <module name="OperatorWrap">
<property name="tokens" value="BAND,BOR,BSR,BXOR,COLON,DIV,EQUAL,GE,GT,LAND,LE,LITERAL_INSTANCEOF,LOR,LT,MINUS,MOD,NOT_EQUAL,SL,SR,STAR"/> <property name="severity" value="ignore"/>
<property name="tokens" value="BAND,BOR,BSR,BXOR,COLON,DIV,EQUAL,GE,GT,LAND,LE,LITERAL_INSTANCEOF,LT,MINUS,MOD,NOT_EQUAL,SL,SR,STAR"/>
<metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
</module> </module>
<module name="ParenPad"/> <module name="ParenPad"/>
<module name="TabCharacter"/>
<module name="WhitespaceAfter"/> <module name="WhitespaceAfter"/>
<module name="WhitespaceAround"> <module name="WhitespaceAround">
<property name="tokens" value="ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,BXOR_ASSIGN,DIV_ASSIGN,EQUAL,GE,GT,LAND,LE,LITERAL_ASSERT,LITERAL_CATCH,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,LITERAL_RETURN,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE,LOR,LT,MINUS,MINUS_ASSIGN,MOD,MOD_ASSIGN,NOT_EQUAL,PLUS_ASSIGN,SL,SLIST,SL_ASSIGN,SR,SR_ASSIGN,STAR,STAR_ASSIGN,LITERAL_ASSERT,TYPE_EXTENSION_AND,WILDCARD_TYPE"/> <property name="tokens" value="ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,BXOR_ASSIGN,DIV_ASSIGN,EQUAL,GE,GT,LAND,LE,LITERAL_ASSERT,LITERAL_CATCH,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,LITERAL_RETURN,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE,LOR,LT,MINUS,MINUS_ASSIGN,MOD,MOD_ASSIGN,NOT_EQUAL,PLUS_ASSIGN,SL,SLIST,SL_ASSIGN,SR,SR_ASSIGN,STAR,STAR_ASSIGN,LITERAL_ASSERT,TYPE_EXTENSION_AND,WILDCARD_TYPE"/>
...@@ -62,11 +64,11 @@ ...@@ -62,11 +64,11 @@
<module name="ArrayTypeStyle"/> <module name="ArrayTypeStyle"/>
<module name="GenericIllegalRegexp"> <module name="GenericIllegalRegexp">
<property name="severity" value="ignore"/> <property name="severity" value="ignore"/>
<property name="format" value="\s+$"/> <metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
<property name="message" value="Line has trailing spaces."/>
</module> </module>
<module name="TodoComment"> <module name="TodoComment">
<property name="severity" value="ignore"/> <property name="severity" value="ignore"/>
<metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
</module> </module>
<module name="UpperEll"/> <module name="UpperEll"/>
<module name="JavadocType"/> <module name="JavadocType"/>
...@@ -80,12 +82,18 @@ ...@@ -80,12 +82,18 @@
<module name="SuperClone"/> <module name="SuperClone"/>
<module name="UnnecessaryParentheses"/> <module name="UnnecessaryParentheses"/>
<module name="TrailingComment"/> <module name="TrailingComment"/>
<module name="PackageHtml">
<property name="severity" value="ignore"/>
<metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
</module> </module>
<module name="NewlineAtEndOfFile"> </module>
<module name="FileTabCharacter">
<property name="severity" value="ignore"/> <property name="severity" value="ignore"/>
<metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
</module> </module>
<module name="Translation"/> <module name="NewlineAtEndOfFile">
<module name="PackageHtml">
<property name="severity" value="ignore"/> <property name="severity" value="ignore"/>
<metadata name="net.sf.eclipsecs.core.lastEnabledSeverity" value="inherit"/>
</module> </module>
<module name="Translation"/>
</module> </module>
...@@ -28,8 +28,8 @@ public class AlterSchemaRename extends DefineCommand { ...@@ -28,8 +28,8 @@ public class AlterSchemaRename extends DefineCommand {
super(session); super(session);
} }
public void setOldSchema(Schema Schema) { public void setOldSchema(Schema schema) {
oldSchema = Schema; oldSchema = schema;
} }
public void setNewName(String name) { public void setNewName(String name) {
......
...@@ -167,9 +167,11 @@ public class CreateView extends SchemaCommand { ...@@ -167,9 +167,11 @@ public class CreateView extends SchemaCommand {
} }
} }
// Class that holds a snapshot of dependent view information. /**
// We can't just work with TableViews directly because they become invalid * Class that holds a snapshot of dependent view information. We can't just
// when we drop the parent view. * work with TableViews directly because they become invalid when we drop
* the parent view.
*/
private class DependentView { private class DependentView {
String viewName; String viewName;
String createSql; String createSql;
......
...@@ -37,7 +37,7 @@ public class DbUpgrade { ...@@ -37,7 +37,7 @@ public class DbUpgrade {
* @param info The connection Properties * @param info The connection Properties
* @throws SQLException * @throws SQLException
*/ */
public synchronized static void upgrade(String url, Properties info) throws SQLException { public static synchronized void upgrade(String url, Properties info) throws SQLException {
if (nonPageStoreToCurrentEnabled) { if (nonPageStoreToCurrentEnabled) {
upgradeFromNonPageStore(url, info); upgradeFromNonPageStore(url, info);
} }
......
...@@ -23,8 +23,8 @@ import org.h2.util.Utils; ...@@ -23,8 +23,8 @@ import org.h2.util.Utils;
*/ */
public class DbUpgradeNonPageStoreToCurrent { public class DbUpgradeNonPageStoreToCurrent {
private static boolean scriptInTmpDir = false; private static boolean scriptInTmpDir;
private static boolean deleteOldDb = false; private static boolean deleteOldDb;
private String url; private String url;
private Properties info; private Properties info;
......
...@@ -15,7 +15,6 @@ import java.io.ObjectOutputStream; ...@@ -15,7 +15,6 @@ import java.io.ObjectOutputStream;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.lang.reflect.Modifier; import java.lang.reflect.Modifier;
import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
...@@ -625,7 +624,7 @@ public class Utils { ...@@ -625,7 +624,7 @@ public class Utils {
private static int match(Class<?>[] params, Object[] values) { private static int match(Class<?>[] params, Object[] values) {
if (params.length == values.length) { if (params.length == values.length) {
int points = 1; int points = 1;
for (int i=0; i<params.length; i++) { for (int i = 0; i < params.length; i++) {
Class<?> pc = getNonPrimitiveClass(params[i]); Class<?> pc = getNonPrimitiveClass(params[i]);
Class<?> vc = values[i].getClass(); Class<?> vc = values[i].getClass();
if (pc == vc) { if (pc == vc) {
......
...@@ -52,12 +52,12 @@ public class TestMultiDimension extends TestBase { ...@@ -52,12 +52,12 @@ public class TestMultiDimension extends TestBase {
assertEquals(5, m.interleave(3, 0)); assertEquals(5, m.interleave(3, 0));
assertEquals(5, m.interleave(new int[]{3, 0})); assertEquals(5, m.interleave(new int[]{3, 0}));
assertEquals(10, m.interleave(0, 3)); assertEquals(10, m.interleave(0, 3));
assertEquals(10, m.interleave(new int[]{0, 3})); assertEquals(10, m.interleave(new int[] { 0, 3 }));
long v = ((long) Integer.MAX_VALUE | ((long) Integer.MAX_VALUE << 31L)); long v = (long) Integer.MAX_VALUE | ((long) Integer.MAX_VALUE << 31L);
assertEquals(v, m.interleave(Integer.MAX_VALUE, Integer.MAX_VALUE)); assertEquals(v, m.interleave(Integer.MAX_VALUE, Integer.MAX_VALUE));
assertEquals(v, m.interleave(new int[] {Integer.MAX_VALUE, Integer.MAX_VALUE })); assertEquals(v, m.interleave(new int[] { Integer.MAX_VALUE, Integer.MAX_VALUE }));
Random random = new Random(1); Random random = new Random(1);
for (int i=0; i<1000; i++) { for (int i = 0; i < 1000; i++) {
int x = random.nextInt(Integer.MAX_VALUE), y = random.nextInt(Integer.MAX_VALUE); int x = random.nextInt(Integer.MAX_VALUE), y = random.nextInt(Integer.MAX_VALUE);
v = m.interleave(new int[] {x, y}); v = m.interleave(new int[] {x, y});
long v2 = m.interleave(x, y); long v2 = m.interleave(x, y);
......
...@@ -104,7 +104,7 @@ public class TestNestedJoins extends TestBase { ...@@ -104,7 +104,7 @@ public class TestNestedJoins extends TestBase {
} }
} }
Random random = new Random(1); Random random = new Random(1);
for (int i=0; i<10000; i++) { for (int i = 0; i < 10000; i++) {
StringBuilder buff = new StringBuilder(); StringBuilder buff = new StringBuilder();
int t = 1 + random.nextInt(9); int t = 1 + random.nextInt(9);
buff.append("select "); buff.append("select ");
...@@ -223,7 +223,7 @@ public class TestNestedJoins extends TestBase { ...@@ -223,7 +223,7 @@ public class TestNestedJoins extends TestBase {
ArrayList<String> list = New.arrayList(); ArrayList<String> list = New.arrayList();
while (rs.next()) { while (rs.next()) {
StringBuilder buff = new StringBuilder(); StringBuilder buff = new StringBuilder();
for (int i=0; i<rs.getMetaData().getColumnCount(); i++) { for (int i = 0; i < rs.getMetaData().getColumnCount(); i++) {
if (i > 0) { if (i > 0) {
buff.append(" "); buff.append(" ");
} }
......
...@@ -38,7 +38,7 @@ public class TestUndoLogLarge { ...@@ -38,7 +38,7 @@ public class TestUndoLogLarge {
PreparedStatement prep = conn.prepareStatement( PreparedStatement prep = conn.prepareStatement(
"insert into test(name) values(space(1024*1024))"); "insert into test(name) values(space(1024*1024))");
long time = System.currentTimeMillis(); long time = System.currentTimeMillis();
for (int i=0; i<2500; i++) { for (int i = 0; i < 2500; i++) {
prep.execute(); prep.execute();
long now = System.currentTimeMillis(); long now = System.currentTimeMillis();
if (now > time + 5000) { if (now > time + 5000) {
......
...@@ -20,7 +20,7 @@ public class UpgradeCreator { ...@@ -20,7 +20,7 @@ public class UpgradeCreator {
* *
* @param args the command line parameters * @param args the command line parameters
*/ */
private static String[] TEXT_FILE_EXTENSIONS = { ".java", ".xml", ".bat", ".sh", ".txt", ".html", ".csv" }; private static final String[] TEXT_FILE_EXTENSIONS = { ".java", ".xml", ".bat", ".sh", ".txt", ".html", ".csv" };
/** /**
* This method is called when executing this application from the command * This method is called when executing this application from the command
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论