You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by jo...@apache.org on 2019/12/04 12:18:45 UTC
[incubator-dolphinscheduler] branch dev-db updated: [checkstyle]
optimize java code checkstyle for LeftCurly rule (#1375)
This is an automated email from the ASF dual-hosted git repository.
journey pushed a commit to branch dev-db
in repository https://gitbox.apache.org/repos/asf/incubator-dolphinscheduler.git
The following commit(s) were added to refs/heads/dev-db by this push:
new 769b053 [checkstyle] optimize java code checkstyle for LeftCurly rule (#1375)
769b053 is described below
commit 769b0537f1a01636f80d10084a7e80ccd396c421
Author: lamber-ken <la...@163.com>
AuthorDate: Wed Dec 4 20:18:37 2019 +0800
[checkstyle] optimize java code checkstyle for LeftCurly rule (#1375)
---
.../ServiceModelToSwagger2MapperImpl.java | 3 +--
.../api/controller/ResourcesController.java | 3 +--
.../api/utils/FourLetterWordMain.java | 6 ++----
.../common/enums/ExecutionStatus.java | 4 +++-
.../common/zk/AbstractZKClient.java | 8 ++++++--
.../common/queue/TaskQueueImplTest.java | 3 +--
.../apache/dolphinscheduler/dao/TaskRecordDao.java | 3 +--
style/checkstyle.xml | 21 +++++++++++++++------
8 files changed, 30 insertions(+), 21 deletions(-)
diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/ServiceModelToSwagger2MapperImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/ServiceModelToSwagger2MapperImpl.java
index c0ceb66..d454b8d 100644
--- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/ServiceModelToSwagger2MapperImpl.java
+++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/configuration/ServiceModelToSwagger2MapperImpl.java
@@ -156,8 +156,7 @@ public class ServiceModelToSwagger2MapperImpl extends ServiceModelToSwagger2Mapp
List<String> list = new ArrayList<String>(tagsSet.size());
Iterator<String> it = from.getTags().iterator();
- while(it.hasNext())
- {
+ while(it.hasNext()){
String tag = it.next();
list.add(StringUtils.isNotBlank(tag) ? messageSource.getMessage(tag, null, tag, locale) : " ");
}
diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java
index 07d235d..c132045 100644
--- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java
+++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java
@@ -451,8 +451,7 @@ public class ResourcesController extends BaseController{
@GetMapping(value = "/udf-func/update-ui")
@ResponseStatus(HttpStatus.OK)
public Result viewUIUdfFunction(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
- @RequestParam("id") int id)
- {
+ @RequestParam("id") int id) {
logger.info("login user {}, query udf{}",
loginUser.getUserName(), id);
try {
diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/FourLetterWordMain.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/FourLetterWordMain.java
index f946afd..d41830e 100644
--- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/FourLetterWordMain.java
+++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/utils/FourLetterWordMain.java
@@ -45,8 +45,7 @@ public class FourLetterWordMain {
* @throws java.io.IOException io exceptions
*/
public static String send4LetterWord(String host, int port, String cmd)
- throws IOException
- {
+ throws IOException {
return send4LetterWord(host, port, cmd, DEFAULT_SOCKET_TIMEOUT);
}
/**
@@ -59,8 +58,7 @@ public class FourLetterWordMain {
* @throws java.io.IOException io exceptions
*/
public static String send4LetterWord(String host, int port, String cmd, int timeout)
- throws IOException
- {
+ throws IOException {
LOG.info("connecting to " + host + " " + port);
Socket sock = new Socket();
InetSocketAddress hostaddress= host != null ? new InetSocketAddress(host, port) :
diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/ExecutionStatus.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/ExecutionStatus.java
index 5a045ea..e86991f 100644
--- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/ExecutionStatus.java
+++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/enums/ExecutionStatus.java
@@ -119,7 +119,9 @@ public enum ExecutionStatus {
* status is cancel
* @return status
*/
- public boolean typeIsCancel(){ return this == KILL || this == STOP ;}
+ public boolean typeIsCancel(){
+ return this == KILL || this == STOP ;
+ }
}
diff --git a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/zk/AbstractZKClient.java b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/zk/AbstractZKClient.java
index 142e4bd..f2861ec 100644
--- a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/zk/AbstractZKClient.java
+++ b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/zk/AbstractZKClient.java
@@ -419,13 +419,17 @@ public abstract class AbstractZKClient {
*
* @return get worker node parent path
*/
- protected String getWorkerZNodeParentPath(){return conf.getString(Constants.ZOOKEEPER_DOLPHINSCHEDULER_WORKERS);};
+ protected String getWorkerZNodeParentPath(){
+ return conf.getString(Constants.ZOOKEEPER_DOLPHINSCHEDULER_WORKERS);
+ }
/**
*
* @return get master node parent path
*/
- protected String getMasterZNodeParentPath(){return conf.getString(Constants.ZOOKEEPER_DOLPHINSCHEDULER_MASTERS);}
+ protected String getMasterZNodeParentPath(){
+ return conf.getString(Constants.ZOOKEEPER_DOLPHINSCHEDULER_MASTERS);
+ }
/**
*
diff --git a/dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/queue/TaskQueueImplTest.java b/dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/queue/TaskQueueImplTest.java
index 1881233..efee627 100644
--- a/dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/queue/TaskQueueImplTest.java
+++ b/dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/queue/TaskQueueImplTest.java
@@ -94,8 +94,7 @@ public class TaskQueueImplTest extends StandaloneZKServerForTest {
public void extremeTest(){
int total = 30 * 10000;
- for(int i = 0; i < total; i++)
- {
+ for(int i = 0; i < total; i++) {
for(int j = 0; j < total; j++) {
//${processInstancePriority}_${processInstanceId}_${taskInstancePriority}_${taskId}
//format ${processInstancePriority}_${processInstanceId}_${taskInstancePriority}_${taskId}
diff --git a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/TaskRecordDao.java b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/TaskRecordDao.java
index e79fc39..e32dea1 100644
--- a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/TaskRecordDao.java
+++ b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/TaskRecordDao.java
@@ -93,8 +93,7 @@ public class TaskRecordDao {
* @param filterMap filterMap
* @return sql string
*/
- private static String getWhereString(Map<String, String> filterMap)
- {
+ private static String getWhereString(Map<String, String> filterMap) {
if(filterMap.size() ==0){
return "";
}
diff --git a/style/checkstyle.xml b/style/checkstyle.xml
index 4201ce8..54188c6 100644
--- a/style/checkstyle.xml
+++ b/style/checkstyle.xml
@@ -37,16 +37,25 @@
</module>
<module name="TreeWalker">
+ <module name="OuterTypeFilename">
+ <property name="severity" value="error"/>
+ </module>
- <module name="OuterTypeFilename"/>
-
- <module name="OneTopLevelClass"/>
+ <module name="OneTopLevelClass">
+ <property name="severity" value="error"/>
+ </module>
- <module name="NoLineWrap"/>
+ <module name="NoLineWrap">
+ <property name="severity" value="error"/>
+ </module>
- <module name="NeedBraces"/>
+ <module name="NeedBraces">
+ <property name="severity" value="error"/>
+ </module>
- <module name="LeftCurly"/>
+ <module name="LeftCurly">
+ <property name="severity" value="error"/>
+ </module>
<module name="AvoidNestedBlocks">
<property name="allowInSwitchCase" value="true"/>