Commit 216154dc authored by Yelli's avatar Yelli Committed by qiaozhanwei
Browse files

fix sonar bug: null check & clean throw exception (#1690)

* fix sonar bug: null check & clean throw exception

* fix sonar bug: null check & clean throw exception
parent a80e9027
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -195,12 +195,11 @@ public class ProcessInstanceService extends BaseDAGService {
            processInstance.setDuration(DateUtils.differSec(processInstance.getStartTime(),processInstance.getEndTime()));
        }

        Set<String> exclusionSet = new HashSet<String>(){{
            add(Constants.CLASS);
            add("locations");
            add("connects");
            add("processInstanceJson");
        }};
        Set<String> exclusionSet = new HashSet<String>();
        exclusionSet.add(Constants.CLASS);
        exclusionSet.add("locations");
        exclusionSet.add("connects");
        exclusionSet.add("processInstanceJson");

        PageInfo pageInfo = new PageInfo<ProcessInstance>(pageNo, pageSize);
        pageInfo.setTotalCount((int) processInstanceList.getTotal());
+3 −4
Original line number Diff line number Diff line
@@ -116,10 +116,9 @@ public class TaskInstanceService extends BaseService {
                page, project.getId(), processInstanceId, searchVal, taskName, statusArray, host, start, end
        );
        PageInfo pageInfo = new PageInfo<ProcessInstance>(pageNo, pageSize);
        Set<String> exclusionSet = new HashSet<String>(){{
            add(Constants.CLASS);
            add("taskJson");
        }};
        Set<String> exclusionSet = new HashSet<>();
        exclusionSet.add(Constants.CLASS);
        exclusionSet.add("taskJson");
        List<TaskInstance> taskInstanceList = taskInstanceIPage.getRecords();
        for(TaskInstance taskInstance : taskInstanceList){
            taskInstance.setDuration(DateUtils.differSec(taskInstance.getStartTime(),
+0 −1
Original line number Diff line number Diff line
@@ -66,7 +66,6 @@ public class ClickHouseDataSource extends BaseDataSource {
                    con.close();
                } catch (SQLException e) {
                    logger.error("ClickHouse datasource try conn close conn error", e);
                    throw e;
                }
            }
        }
+0 −1
Original line number Diff line number Diff line
@@ -66,7 +66,6 @@ public class DB2ServerDataSource extends BaseDataSource {
                    con.close();
                } catch (SQLException e) {
                    logger.error("DB2 Server datasource try conn close conn error", e);
                    throw e;
                }
            }
        }
+0 −1
Original line number Diff line number Diff line
@@ -69,7 +69,6 @@ public class HiveDataSource extends BaseDataSource {
          con.close();
        } catch (SQLException e) {
          logger.error("hive datasource try conn close conn error", e);
          throw e;
        }
      }
    }
Loading