Commit 7ecd38f7 authored by Yelli's avatar Yelli Committed by Tboy
Browse files

fix sonar bug: change condition & not enough arguments (#1692)

* modify FileUtils.readFile2Str

* #1300 Add right alignment function in sql email content

* cancel formatted for alert_mail_template.ftl

* #747 sql task password Log desensitization

* cancel mail_temple

* edit ExcelUtils

* modify test method name

* #747 sql task password Log desensitization

* #1544 workflow import

* Constants add DATASOURCE_PASSWORD_REGEX

* #747 sql task password Log desensitization

* deal with import project have sub process

* modify export process addTaskNodeParam method name

* add testAddTaskNodeSpecialParam UT

* add ProcessDefinitionServiceTest-ut to pom

* add testImportSubProcess in ProcessDefinitionServiceTest

* add testImportSubProcess in ProcessDefinitionServiceTest

* add testImportProcessDefinition

* fix sonar bug: not enough arguments

* fix sonar bug: change condition & not enough arguments
parent 36e24429
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -489,13 +489,14 @@ public class ProcessInstanceService extends BaseDAGService {
        }
        ProcessInstance processInstance = processDao.findProcessInstanceDetailById(processInstanceId);
        List<TaskInstance> taskInstanceList = processDao.findValidTaskListByProcessId(processInstanceId);
        //process instance priority
        int processInstancePriority = processInstance.getProcessInstancePriority().ordinal();
        if (processInstance == null) {

        if (null == processInstance) {
            putMsg(result, Status.PROCESS_INSTANCE_NOT_EXIST, processInstanceId);
            return result;
        }

        //process instance priority
        int processInstancePriority = processInstance.getProcessInstancePriority().ordinal();
        // delete zk queue
        if (CollectionUtils.isNotEmpty(taskInstanceList)){
            for (TaskInstance taskInstance : taskInstanceList){
+1 −2
Original line number Diff line number Diff line
@@ -118,7 +118,7 @@ public class HadoopUtils implements Closeable {
                                    configuration.set(Constants.FS_DEFAULTFS,defaultFSProp);
                                    fsRelatedProps.forEach((key, value) -> configuration.set(key, value));
                                }else{
                                    logger.error("property:{} can not to be empty, please set!");
                                    logger.error("property:{} can not to be empty, please set!", Constants.FS_DEFAULTFS );
                                    throw new RuntimeException("property:{} can not to be empty, please set!");
                                }
                            }else{
@@ -337,7 +337,6 @@ public class HadoopUtils implements Closeable {
     * @throws Exception errors
     */
    public FileStatus[] listFileStatus(String filePath)throws Exception{
        Path path = new Path(filePath);
        try {
            return fs.listStatus(new Path(filePath));
        } catch (IOException e) {
+8 −7
Original line number Diff line number Diff line
@@ -119,6 +119,13 @@ public class SqlTask extends AbstractTask {
        }

        dataSource= processDao.findDataSourceById(sqlParameters.getDatasource());

        if (null == dataSource){
            logger.error("datasource not exists");
            exitStatusCode = -1;
            return;
        }

        logger.info("datasource name : {} , type : {} , desc : {}  , user_id : {} , parameter : {}",
                dataSource.getName(),
                dataSource.getType(),
@@ -126,12 +133,6 @@ public class SqlTask extends AbstractTask {
                dataSource.getUserId(),
                dataSource.getConnectionParams());

        if (dataSource == null){
            logger.error("datasource not exists");
            exitStatusCode = -1;
            return;
        }

        Connection con = null;
        List<String> createFuncs = null;
        try {
@@ -177,7 +178,7 @@ public class SqlTask extends AbstractTask {
                try {
                    con.close();
                } catch (SQLException e) {
                    throw e;
                    logger.error(e.getMessage(),e);
                }
            }
        }