From 11696a340b797bc8e022d9af54d1384685f8e3e5 Mon Sep 17 00:00:00 2001 From: Prathamesh Mane Date: Fri, 18 Aug 2023 12:34:35 +0200 Subject: [PATCH] Optimized boolean transformations --- .../AppDefinitionCollectionResource.java | 3 +-- ...HistoricTaskInstanceCollectionResource.java | 2 +- .../DeadLetterJobCollectionResource.java | 12 ++++++------ .../HistoryJobCollectionResource.java | 8 ++++---- .../api/management/JobCollectionResource.java | 16 ++++++++-------- .../SuspendedJobCollectionResource.java | 16 ++++++++-------- .../management/TimerJobCollectionResource.java | 12 ++++++------ .../CaseDefinitionCollectionResource.java | 3 +-- .../caze/CaseInstanceCollectionResource.java | 4 ++-- .../EventSubscriptionCollectionResource.java | 12 ++++++------ .../repository/DecisionCollectionResource.java | 3 +-- .../DecisionTableCollectionResource.java | 4 +--- .../ChannelDefinitionCollectionResource.java | 3 +-- .../EventDefinitionCollectionResource.java | 3 +-- ...HistoricTaskInstanceCollectionResource.java | 2 +- .../management/BatchCollectionResource.java | 2 +- .../DeadLetterJobCollectionResource.java | 14 +++++++------- .../HistoryJobCollectionResource.java | 8 ++++---- .../api/management/JobCollectionResource.java | 18 +++++++++--------- .../SuspendedJobCollectionResource.java | 18 +++++++++--------- .../management/TimerJobCollectionResource.java | 14 +++++++------- .../repository/ModelCollectionResource.java | 6 +++--- .../ProcessDefinitionCollectionResource.java | 14 +++++--------- .../EventSubscriptionCollectionResource.java | 12 ++++++------ .../process/ExecutionCollectionResource.java | 2 +- .../ProcessInstanceCollectionResource.java | 10 +++++----- 26 files changed, 105 insertions(+), 116 deletions(-) diff --git a/modules/flowable-app-engine-rest/src/main/java/org/flowable/app/rest/service/api/repository/AppDefinitionCollectionResource.java b/modules/flowable-app-engine-rest/src/main/java/org/flowable/app/rest/service/api/repository/AppDefinitionCollectionResource.java index b5ece09cb20..ebb1f6600a7 100644 --- a/modules/flowable-app-engine-rest/src/main/java/org/flowable/app/rest/service/api/repository/AppDefinitionCollectionResource.java +++ b/modules/flowable-app-engine-rest/src/main/java/org/flowable/app/rest/service/api/repository/AppDefinitionCollectionResource.java @@ -156,8 +156,7 @@ public DataResponse getForms(@ApiParam(hidden = true) @Re } } if (allRequestParams.containsKey("latest")) { - boolean latest = Boolean.parseBoolean(allRequestParams.get("latest")); - if (latest) { + if (Boolean.parseBoolean(allRequestParams.get("latest"))) { appDefinitionQuery.latestVersion(); } } diff --git a/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/task/HistoricTaskInstanceCollectionResource.java b/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/task/HistoricTaskInstanceCollectionResource.java index 57039928057..2d81709fee6 100644 --- a/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/task/HistoricTaskInstanceCollectionResource.java +++ b/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/history/task/HistoricTaskInstanceCollectionResource.java @@ -275,7 +275,7 @@ public DataResponse getHistoricProcessInstances(@A queryRequest.setTaskCandidateGroup(allRequestParams.get("taskCandidateGroup")); } - if (allRequestParams.containsKey("ignoreTaskAssignee") && Boolean.valueOf(allRequestParams.get("ignoreTaskAssignee"))) { + if (allRequestParams.containsKey("ignoreTaskAssignee") && Boolean.parseBoolean(allRequestParams.get("ignoreTaskAssignee"))) { queryRequest.setIgnoreTaskAssignee(true); } diff --git a/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/management/DeadLetterJobCollectionResource.java b/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/management/DeadLetterJobCollectionResource.java index 85db7e39c97..950f3596dd7 100644 --- a/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/management/DeadLetterJobCollectionResource.java +++ b/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/management/DeadLetterJobCollectionResource.java @@ -95,7 +95,7 @@ public DataResponse getJobs(@ApiParam(hidden = true) @RequestParam query.scopeId(allRequestParams.get("caseInstanceId")); query.scopeType(ScopeTypes.CMMN); } - if (allRequestParams.containsKey("withoutScopeId") && Boolean.valueOf(allRequestParams.get("withoutScopeId"))) { + if (allRequestParams.containsKey("withoutScopeId") && Boolean.parseBoolean(allRequestParams.get("withoutScopeId"))) { query.withoutScopeId(); } if (allRequestParams.containsKey("planItemInstanceId")) { @@ -122,11 +122,11 @@ public DataResponse getJobs(@ApiParam(hidden = true) @RequestParam if (allRequestParams.containsKey("messagesOnly")) { throw new FlowableIllegalArgumentException("Only one of 'timersOnly' or 'messagesOnly' can be provided."); } - if (Boolean.valueOf(allRequestParams.get("timersOnly"))) { + if (Boolean.parseBoolean(allRequestParams.get("timersOnly"))) { query.timers(); } } - if (allRequestParams.containsKey("messagesOnly") && Boolean.valueOf(allRequestParams.get("messagesOnly"))) { + if (allRequestParams.containsKey("messagesOnly") && Boolean.parseBoolean(allRequestParams.get("messagesOnly"))) { query.messages(); } if (allRequestParams.containsKey("dueBefore")) { @@ -135,7 +135,7 @@ public DataResponse getJobs(@ApiParam(hidden = true) @RequestParam if (allRequestParams.containsKey("dueAfter")) { query.duedateHigherThan(RequestUtil.getDate(allRequestParams, "dueAfter")); } - if (allRequestParams.containsKey("withException") && Boolean.valueOf(allRequestParams.get("withException"))) { + if (allRequestParams.containsKey("withException") && Boolean.parseBoolean(allRequestParams.get("withException"))) { query.withException(); } if (allRequestParams.containsKey("exceptionMessage")) { @@ -147,13 +147,13 @@ public DataResponse getJobs(@ApiParam(hidden = true) @RequestParam if (allRequestParams.containsKey("tenantIdLike")) { query.jobTenantIdLike(allRequestParams.get("tenantIdLike")); } - if (allRequestParams.containsKey("withoutTenantId") && Boolean.valueOf(allRequestParams.get("withoutTenantId"))) { + if (allRequestParams.containsKey("withoutTenantId") && Boolean.parseBoolean(allRequestParams.get("withoutTenantId"))) { query.jobWithoutTenantId(); } if (allRequestParams.containsKey("scopeType")) { query.scopeType(allRequestParams.get("scopeType")); } - if (allRequestParams.containsKey("withoutProcessInstanceId") && Boolean.valueOf(allRequestParams.get("withoutProcessInstanceId"))) { + if (allRequestParams.containsKey("withoutProcessInstanceId") && Boolean.parseBoolean(allRequestParams.get("withoutProcessInstanceId"))) { query.withoutProcessInstanceId(); } diff --git a/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/management/HistoryJobCollectionResource.java b/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/management/HistoryJobCollectionResource.java index 5fb054b325e..a04facc9d4e 100644 --- a/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/management/HistoryJobCollectionResource.java +++ b/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/management/HistoryJobCollectionResource.java @@ -81,7 +81,7 @@ public DataResponse getHistoryJobs(@ApiParam(hidden = true) query.jobId(allRequestParams.get("scopeType")); } if (allRequestParams.containsKey("withException")) { - if (Boolean.valueOf(allRequestParams.get("withException"))) { + if (Boolean.parseBoolean(allRequestParams.get("withException"))) { query.withException(); } } @@ -92,12 +92,12 @@ public DataResponse getHistoryJobs(@ApiParam(hidden = true) query.lockOwner(allRequestParams.get("lockOwner")); } if (allRequestParams.containsKey("locked")) { - if (Boolean.valueOf(allRequestParams.get("locked"))) { + if (Boolean.parseBoolean(allRequestParams.get("locked"))) { query.locked(); } } if (allRequestParams.containsKey("unlocked")) { - if (Boolean.valueOf(allRequestParams.get("unlocked"))) { + if (Boolean.parseBoolean(allRequestParams.get("unlocked"))) { query.unlocked(); } } @@ -108,7 +108,7 @@ public DataResponse getHistoryJobs(@ApiParam(hidden = true) query.jobTenantIdLike(allRequestParams.get("tenantIdLike")); } if (allRequestParams.containsKey("withoutTenantId")) { - if (Boolean.valueOf(allRequestParams.get("withoutTenantId"))) { + if (Boolean.parseBoolean(allRequestParams.get("withoutTenantId"))) { query.jobWithoutTenantId(); } } diff --git a/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/management/JobCollectionResource.java b/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/management/JobCollectionResource.java index ce03e15b825..608d03c32ff 100644 --- a/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/management/JobCollectionResource.java +++ b/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/management/JobCollectionResource.java @@ -113,7 +113,7 @@ public DataResponse getJobs(@ApiParam(hidden = true) @RequestParam query.scopeId(allRequestParams.get("caseInstanceId")); query.scopeType(ScopeTypes.CMMN); } - if (allRequestParams.containsKey("withoutScopeId") && Boolean.valueOf(allRequestParams.get("withoutScopeId"))) { + if (allRequestParams.containsKey("withoutScopeId") && Boolean.parseBoolean(allRequestParams.get("withoutScopeId"))) { query.withoutScopeId(); } if (allRequestParams.containsKey("planItemInstanceId")) { @@ -137,11 +137,11 @@ public DataResponse getJobs(@ApiParam(hidden = true) @RequestParam if (allRequestParams.containsKey("messagesOnly")) { throw new FlowableIllegalArgumentException("Only one of 'timersOnly' or 'messagesOnly' can be provided."); } - if (Boolean.valueOf(allRequestParams.get("timersOnly"))) { + if (Boolean.parseBoolean(allRequestParams.get("timersOnly"))) { query.timers(); } } - if (allRequestParams.containsKey("messagesOnly") && Boolean.valueOf(allRequestParams.get("messagesOnly"))) { + if (allRequestParams.containsKey("messagesOnly") && Boolean.parseBoolean(allRequestParams.get("messagesOnly"))) { query.messages(); } if (allRequestParams.containsKey("dueBefore")) { @@ -150,7 +150,7 @@ public DataResponse getJobs(@ApiParam(hidden = true) @RequestParam if (allRequestParams.containsKey("dueAfter")) { query.duedateHigherThan(RequestUtil.getDate(allRequestParams, "dueAfter")); } - if (allRequestParams.containsKey("withException") && Boolean.valueOf(allRequestParams.get("withException"))) { + if (allRequestParams.containsKey("withException") && Boolean.parseBoolean(allRequestParams.get("withException"))) { query.withException(); } if (allRequestParams.containsKey("exceptionMessage")) { @@ -162,19 +162,19 @@ public DataResponse getJobs(@ApiParam(hidden = true) @RequestParam if (allRequestParams.containsKey("tenantIdLike")) { query.jobTenantIdLike(allRequestParams.get("tenantIdLike")); } - if (allRequestParams.containsKey("withoutTenantId") && Boolean.valueOf(allRequestParams.get("withoutTenantId"))) { + if (allRequestParams.containsKey("withoutTenantId") && Boolean.parseBoolean(allRequestParams.get("withoutTenantId"))) { query.jobWithoutTenantId(); } - if (allRequestParams.containsKey("locked") && Boolean.valueOf(allRequestParams.get("locked"))) { + if (allRequestParams.containsKey("locked") && Boolean.parseBoolean(allRequestParams.get("locked"))) { query.locked(); } - if (allRequestParams.containsKey("unlocked") && Boolean.valueOf(allRequestParams.get("unlocked"))) { + if (allRequestParams.containsKey("unlocked") && Boolean.parseBoolean(allRequestParams.get("unlocked"))) { query.unlocked(); } if (allRequestParams.containsKey("scopeType")) { query.scopeType(allRequestParams.get("scopeType")); } - if (allRequestParams.containsKey("withoutProcessInstanceId") && Boolean.valueOf(allRequestParams.get("withoutProcessInstanceId"))) { + if (allRequestParams.containsKey("withoutProcessInstanceId") && Boolean.parseBoolean(allRequestParams.get("withoutProcessInstanceId"))) { query.withoutProcessInstanceId(); } diff --git a/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/management/SuspendedJobCollectionResource.java b/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/management/SuspendedJobCollectionResource.java index 66728ea17f2..fe409cf1cbb 100644 --- a/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/management/SuspendedJobCollectionResource.java +++ b/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/management/SuspendedJobCollectionResource.java @@ -96,7 +96,7 @@ public DataResponse getJobs(@ApiParam(hidden = true) @RequestParam query.scopeId(allRequestParams.get("caseInstanceId")); query.scopeType(ScopeTypes.CMMN); } - if (allRequestParams.containsKey("withoutScopeId") && Boolean.valueOf(allRequestParams.get("withoutScopeId"))) { + if (allRequestParams.containsKey("withoutScopeId") && Boolean.parseBoolean(allRequestParams.get("withoutScopeId"))) { query.withoutScopeId(); } if (allRequestParams.containsKey("planItemInstanceId")) { @@ -123,11 +123,11 @@ public DataResponse getJobs(@ApiParam(hidden = true) @RequestParam if (allRequestParams.containsKey("messagesOnly")) { throw new FlowableIllegalArgumentException("Only one of 'timersOnly' or 'messagesOnly' can be provided."); } - if (Boolean.valueOf(allRequestParams.get("timersOnly"))) { + if (Boolean.parseBoolean(allRequestParams.get("timersOnly"))) { query.timers(); } } - if (allRequestParams.containsKey("messagesOnly") && Boolean.valueOf(allRequestParams.get("messagesOnly"))) { + if (allRequestParams.containsKey("messagesOnly") && Boolean.parseBoolean(allRequestParams.get("messagesOnly"))) { query.messages(); } if (allRequestParams.containsKey("dueBefore")) { @@ -136,13 +136,13 @@ public DataResponse getJobs(@ApiParam(hidden = true) @RequestParam if (allRequestParams.containsKey("dueAfter")) { query.duedateHigherThan(RequestUtil.getDate(allRequestParams, "dueAfter")); } - if (allRequestParams.containsKey("withException") && Boolean.valueOf(allRequestParams.get("withException"))) { + if (allRequestParams.containsKey("withException") && Boolean.parseBoolean(allRequestParams.get("withException"))) { query.withException(); } - if (allRequestParams.containsKey("withRetriesLeft") && Boolean.valueOf(allRequestParams.get("withRetriesLeft"))) { + if (allRequestParams.containsKey("withRetriesLeft") && Boolean.parseBoolean(allRequestParams.get("withRetriesLeft"))) { query.withRetriesLeft(); } - if (allRequestParams.containsKey("noRetriesLeft") && Boolean.valueOf(allRequestParams.get("noRetriesLeft"))) { + if (allRequestParams.containsKey("noRetriesLeft") && Boolean.parseBoolean(allRequestParams.get("noRetriesLeft"))) { query.noRetriesLeft(); } if (allRequestParams.containsKey("exceptionMessage")) { @@ -154,13 +154,13 @@ public DataResponse getJobs(@ApiParam(hidden = true) @RequestParam if (allRequestParams.containsKey("tenantIdLike")) { query.jobTenantIdLike(allRequestParams.get("tenantIdLike")); } - if (allRequestParams.containsKey("withoutTenantId") && Boolean.valueOf(allRequestParams.get("withoutTenantId"))) { + if (allRequestParams.containsKey("withoutTenantId") && Boolean.parseBoolean(allRequestParams.get("withoutTenantId"))) { query.jobWithoutTenantId(); } if (allRequestParams.containsKey("scopeType")) { query.scopeType(allRequestParams.get("scopeType")); } - if (allRequestParams.containsKey("withoutProcessInstanceId") && Boolean.valueOf(allRequestParams.get("withoutProcessInstanceId"))) { + if (allRequestParams.containsKey("withoutProcessInstanceId") && Boolean.parseBoolean(allRequestParams.get("withoutProcessInstanceId"))) { query.withoutProcessInstanceId(); } diff --git a/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/management/TimerJobCollectionResource.java b/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/management/TimerJobCollectionResource.java index 13508bdd992..b7c66bb978d 100644 --- a/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/management/TimerJobCollectionResource.java +++ b/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/management/TimerJobCollectionResource.java @@ -96,7 +96,7 @@ public DataResponse getJobs(@ApiParam(hidden = true) @RequestParam query.scopeId(allRequestParams.get("caseInstanceId")); query.scopeType(ScopeTypes.CMMN); } - if (allRequestParams.containsKey("withoutScopeId") && Boolean.valueOf(allRequestParams.get("withoutScopeId"))) { + if (allRequestParams.containsKey("withoutScopeId") && Boolean.parseBoolean(allRequestParams.get("withoutScopeId"))) { query.withoutScopeId(); } if (allRequestParams.containsKey("planItemInstanceId")) { @@ -123,11 +123,11 @@ public DataResponse getJobs(@ApiParam(hidden = true) @RequestParam if (allRequestParams.containsKey("messagesOnly")) { throw new FlowableIllegalArgumentException("Only one of 'timersOnly' or 'messagesOnly' can be provided."); } - if (Boolean.valueOf(allRequestParams.get("timersOnly"))) { + if (Boolean.parseBoolean(allRequestParams.get("timersOnly"))) { query.timers(); } } - if (allRequestParams.containsKey("messagesOnly") && Boolean.valueOf(allRequestParams.get("messagesOnly"))) { + if (allRequestParams.containsKey("messagesOnly") && Boolean.parseBoolean(allRequestParams.get("messagesOnly"))) { query.messages(); } if (allRequestParams.containsKey("dueBefore")) { @@ -136,7 +136,7 @@ public DataResponse getJobs(@ApiParam(hidden = true) @RequestParam if (allRequestParams.containsKey("dueAfter")) { query.duedateHigherThan(RequestUtil.getDate(allRequestParams, "dueAfter")); } - if (allRequestParams.containsKey("withException") && Boolean.valueOf(allRequestParams.get("withException"))) { + if (allRequestParams.containsKey("withException") && Boolean.parseBoolean(allRequestParams.get("withException"))) { query.withException(); } if (allRequestParams.containsKey("exceptionMessage")) { @@ -148,13 +148,13 @@ public DataResponse getJobs(@ApiParam(hidden = true) @RequestParam if (allRequestParams.containsKey("tenantIdLike")) { query.jobTenantIdLike(allRequestParams.get("tenantIdLike")); } - if (allRequestParams.containsKey("withoutTenantId") && Boolean.valueOf(allRequestParams.get("withoutTenantId"))) { + if (allRequestParams.containsKey("withoutTenantId") && Boolean.parseBoolean(allRequestParams.get("withoutTenantId"))) { query.jobWithoutTenantId(); } if (allRequestParams.containsKey("scopeType")) { query.scopeType(allRequestParams.get("scopeType")); } - if (allRequestParams.containsKey("withoutProcessInstanceId") && Boolean.valueOf(allRequestParams.get("withoutProcessInstanceId"))) { + if (allRequestParams.containsKey("withoutProcessInstanceId") && Boolean.parseBoolean(allRequestParams.get("withoutProcessInstanceId"))) { query.withoutProcessInstanceId(); } diff --git a/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/repository/CaseDefinitionCollectionResource.java b/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/repository/CaseDefinitionCollectionResource.java index 2f6d99f51a5..d2867a9fc87 100644 --- a/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/repository/CaseDefinitionCollectionResource.java +++ b/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/repository/CaseDefinitionCollectionResource.java @@ -130,8 +130,7 @@ public DataResponse getProcessDefinitions(@ApiParam(hidd caseDefinitionQuery.caseDefinitionVersion(Integer.valueOf(allRequestParams.get("version"))); } if (allRequestParams.containsKey("latest")) { - Boolean latest = Boolean.valueOf(allRequestParams.get("latest")); - if (latest != null && latest) { + if (Boolean.parseBoolean(allRequestParams.get("latest"))) { caseDefinitionQuery.latestVersion(); } } diff --git a/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/caze/CaseInstanceCollectionResource.java b/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/caze/CaseInstanceCollectionResource.java index 07b65fa7dfe..6b79c813de9 100644 --- a/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/caze/CaseInstanceCollectionResource.java +++ b/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/caze/CaseInstanceCollectionResource.java @@ -203,7 +203,7 @@ public DataResponse getCaseInstances(@ApiParam(hidden = tr } if (allRequestParams.containsKey("withoutTenantId")) { - if (Boolean.valueOf(allRequestParams.get("withoutTenantId"))) { + if (Boolean.parseBoolean(allRequestParams.get("withoutTenantId"))) { queryRequest.setWithoutTenantId(Boolean.TRUE); } } @@ -297,7 +297,7 @@ public CaseInstanceResponse createCaseInstance(@RequestBody CaseInstanceCreateRe if (request.isTenantSet()) { caseInstanceBuilder.tenantId(request.getTenantId()); } - if (request.getOverrideDefinitionTenantId() != null && request.getOverrideDefinitionTenantId().length() > 0) { + if (request.getOverrideDefinitionTenantId() != null && !request.getOverrideDefinitionTenantId().isEmpty()) { caseInstanceBuilder.overrideCaseDefinitionTenantId(request.getOverrideDefinitionTenantId()); } if (startVariables != null) { diff --git a/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/caze/EventSubscriptionCollectionResource.java b/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/caze/EventSubscriptionCollectionResource.java index 5c309311f2c..7ee69dd46be 100644 --- a/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/caze/EventSubscriptionCollectionResource.java +++ b/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/runtime/caze/EventSubscriptionCollectionResource.java @@ -97,19 +97,19 @@ public DataResponse getEventSubscriptions(@ApiParam(h if (allRequestParams.containsKey("caseInstanceId")) { query.caseInstanceId(allRequestParams.get("caseInstanceId")); } - if (allRequestParams.containsKey("withoutScopeId") && Boolean.valueOf(allRequestParams.get("withoutScopeId"))) { + if (allRequestParams.containsKey("withoutScopeId") && Boolean.parseBoolean(allRequestParams.get("withoutScopeId"))) { query.withoutScopeId(); } if (allRequestParams.containsKey("caseDefinitionId")) { query.caseDefinitionId(allRequestParams.get("caseDefinitionId")); } - if (allRequestParams.containsKey("withoutProcessInstanceId") && Boolean.valueOf(allRequestParams.get("withoutProcessInstanceId"))) { + if (allRequestParams.containsKey("withoutProcessInstanceId") && Boolean.parseBoolean(allRequestParams.get("withoutProcessInstanceId"))) { query.withoutProcessInstanceId(); } - if (allRequestParams.containsKey("withoutProcessDefinitionId") && Boolean.valueOf(allRequestParams.get("withoutProcessDefinitionId"))) { + if (allRequestParams.containsKey("withoutProcessDefinitionId") && Boolean.parseBoolean(allRequestParams.get("withoutProcessDefinitionId"))) { query.withoutProcessDefinitionId(); } - if (allRequestParams.containsKey("withoutScopeDefinitionId") && Boolean.valueOf(allRequestParams.get("withoutScopeDefinitionId"))) { + if (allRequestParams.containsKey("withoutScopeDefinitionId") && Boolean.parseBoolean(allRequestParams.get("withoutScopeDefinitionId"))) { query.withoutScopeDefinitionId(); } if (allRequestParams.containsKey("planItemInstanceId")) { @@ -124,13 +124,13 @@ public DataResponse getEventSubscriptions(@ApiParam(h if (allRequestParams.containsKey("tenantId")) { query.tenantId(allRequestParams.get("tenantId")); } - if (allRequestParams.containsKey("withoutTenantId") && Boolean.valueOf(allRequestParams.get("withoutTenantId"))) { + if (allRequestParams.containsKey("withoutTenantId") && Boolean.parseBoolean(allRequestParams.get("withoutTenantId"))) { query.withoutTenantId(); } if (allRequestParams.containsKey("configuration")) { query.configuration(allRequestParams.get("configuration")); } - if (allRequestParams.containsKey("withoutConfiguration") && Boolean.valueOf(allRequestParams.get("withoutConfiguration"))) { + if (allRequestParams.containsKey("withoutConfiguration") && Boolean.parseBoolean(allRequestParams.get("withoutConfiguration"))) { query.withoutConfiguration(); } diff --git a/modules/flowable-dmn-rest/src/main/java/org/flowable/dmn/rest/service/api/repository/DecisionCollectionResource.java b/modules/flowable-dmn-rest/src/main/java/org/flowable/dmn/rest/service/api/repository/DecisionCollectionResource.java index d203fc11dae..4c605982628 100644 --- a/modules/flowable-dmn-rest/src/main/java/org/flowable/dmn/rest/service/api/repository/DecisionCollectionResource.java +++ b/modules/flowable-dmn-rest/src/main/java/org/flowable/dmn/rest/service/api/repository/DecisionCollectionResource.java @@ -128,8 +128,7 @@ public DataResponse getDecisions(@ApiParam(hidden = true) @Req } if (allRequestParams.containsKey("latest")) { - Boolean latest = Boolean.valueOf(allRequestParams.get("latest")); - if (latest != null && latest) { + if (Boolean.parseBoolean(allRequestParams.get("latest"))) { definitionQuery.latestVersion(); } } diff --git a/modules/flowable-dmn-rest/src/main/java/org/flowable/dmn/rest/service/api/repository/DecisionTableCollectionResource.java b/modules/flowable-dmn-rest/src/main/java/org/flowable/dmn/rest/service/api/repository/DecisionTableCollectionResource.java index c8dafb6c36e..35738097a1d 100644 --- a/modules/flowable-dmn-rest/src/main/java/org/flowable/dmn/rest/service/api/repository/DecisionTableCollectionResource.java +++ b/modules/flowable-dmn-rest/src/main/java/org/flowable/dmn/rest/service/api/repository/DecisionTableCollectionResource.java @@ -125,10 +125,8 @@ public DataResponse getDecisionTables(@ApiParam(hidden = true) if (allRequestParams.containsKey("version")) { definitionQuery.decisionVersion(Integer.valueOf(allRequestParams.get("version"))); } - if (allRequestParams.containsKey("latest")) { - Boolean latest = Boolean.valueOf(allRequestParams.get("latest")); - if (latest != null && latest) { + if (Boolean.parseBoolean(allRequestParams.get("latest"))) { definitionQuery.latestVersion(); } } diff --git a/modules/flowable-event-registry-rest/src/main/java/org/flowable/eventregistry/rest/service/api/repository/ChannelDefinitionCollectionResource.java b/modules/flowable-event-registry-rest/src/main/java/org/flowable/eventregistry/rest/service/api/repository/ChannelDefinitionCollectionResource.java index 7d62234b3a2..6ffdee99f5e 100644 --- a/modules/flowable-event-registry-rest/src/main/java/org/flowable/eventregistry/rest/service/api/repository/ChannelDefinitionCollectionResource.java +++ b/modules/flowable-event-registry-rest/src/main/java/org/flowable/eventregistry/rest/service/api/repository/ChannelDefinitionCollectionResource.java @@ -148,8 +148,7 @@ public DataResponse getChannelDefinitions(@ApiParam(h channelDefinitionQuery.channelVersion(Integer.valueOf(allRequestParams.get("version"))); } if (allRequestParams.containsKey("latest")) { - Boolean latest = Boolean.valueOf(allRequestParams.get("latest")); - if (latest != null && latest) { + if (Boolean.parseBoolean(allRequestParams.get("latest"))) { channelDefinitionQuery.latestVersion(); } } diff --git a/modules/flowable-event-registry-rest/src/main/java/org/flowable/eventregistry/rest/service/api/repository/EventDefinitionCollectionResource.java b/modules/flowable-event-registry-rest/src/main/java/org/flowable/eventregistry/rest/service/api/repository/EventDefinitionCollectionResource.java index 9d460f61895..1d803aa7933 100644 --- a/modules/flowable-event-registry-rest/src/main/java/org/flowable/eventregistry/rest/service/api/repository/EventDefinitionCollectionResource.java +++ b/modules/flowable-event-registry-rest/src/main/java/org/flowable/eventregistry/rest/service/api/repository/EventDefinitionCollectionResource.java @@ -131,8 +131,7 @@ public DataResponse getEventDefinitions(@ApiParam(hidde eventDefinitionQuery.eventVersion(Integer.valueOf(allRequestParams.get("version"))); } if (allRequestParams.containsKey("latest")) { - Boolean latest = Boolean.valueOf(allRequestParams.get("latest")); - if (latest != null && latest) { + if (Boolean.parseBoolean(allRequestParams.get("latest"))) { eventDefinitionQuery.latestVersion(); } } diff --git a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricTaskInstanceCollectionResource.java b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricTaskInstanceCollectionResource.java index d85a89a3dba..ee06e7e9c46 100644 --- a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricTaskInstanceCollectionResource.java +++ b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/history/HistoricTaskInstanceCollectionResource.java @@ -310,7 +310,7 @@ public DataResponse getHistoricProcessInstances(@A queryRequest.setTaskCandidateGroup(allRequestParams.get("taskCandidateGroup")); } - if (allRequestParams.containsKey("ignoreTaskAssignee") && Boolean.valueOf(allRequestParams.get("ignoreTaskAssignee"))) { + if (allRequestParams.containsKey("ignoreTaskAssignee") && Boolean.parseBoolean(allRequestParams.get("ignoreTaskAssignee"))) { queryRequest.setIgnoreTaskAssignee(true); } diff --git a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/management/BatchCollectionResource.java b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/management/BatchCollectionResource.java index 19df0ed7bd9..779aa0bfee5 100644 --- a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/management/BatchCollectionResource.java +++ b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/management/BatchCollectionResource.java @@ -108,7 +108,7 @@ public DataResponse getBatches(@ApiParam(hidden = true) @RequestP query.tenantIdLike(allRequestParams.get("tenantIdLike")); } if (allRequestParams.containsKey("withoutTenantId")) { - if (Boolean.valueOf(allRequestParams.get("withoutTenantId"))) { + if (Boolean.parseBoolean(allRequestParams.get("withoutTenantId"))) { query.withoutTenantId(); } } diff --git a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/management/DeadLetterJobCollectionResource.java b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/management/DeadLetterJobCollectionResource.java index 8f9d5eec965..1af678e66b0 100644 --- a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/management/DeadLetterJobCollectionResource.java +++ b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/management/DeadLetterJobCollectionResource.java @@ -93,7 +93,7 @@ public DataResponse getJobs(@ApiParam(hidden = true) @RequestParam if (allRequestParams.containsKey("processInstanceId")) { query.processInstanceId(allRequestParams.get("processInstanceId")); } - if (allRequestParams.containsKey("withoutProcessInstanceId") && Boolean.valueOf(allRequestParams.get("withoutProcessInstanceId"))) { + if (allRequestParams.containsKey("withoutProcessInstanceId") && Boolean.parseBoolean(allRequestParams.get("withoutProcessInstanceId"))) { query.withoutProcessInstanceId(); } if (allRequestParams.containsKey("executionId")) { @@ -115,11 +115,11 @@ public DataResponse getJobs(@ApiParam(hidden = true) @RequestParam if (allRequestParams.containsKey("messagesOnly")) { throw new FlowableIllegalArgumentException("Only one of 'timersOnly' or 'messagesOnly' can be provided."); } - if (Boolean.valueOf(allRequestParams.get("timersOnly"))) { + if (Boolean.parseBoolean(allRequestParams.get("timersOnly"))) { query.timers(); } } - if (allRequestParams.containsKey("messagesOnly") && Boolean.valueOf(allRequestParams.get("messagesOnly"))) { + if (allRequestParams.containsKey("messagesOnly") && Boolean.parseBoolean(allRequestParams.get("messagesOnly"))) { query.messages(); } if (allRequestParams.containsKey("dueBefore")) { @@ -128,7 +128,7 @@ public DataResponse getJobs(@ApiParam(hidden = true) @RequestParam if (allRequestParams.containsKey("dueAfter")) { query.duedateHigherThan(RequestUtil.getDate(allRequestParams, "dueAfter")); } - if (allRequestParams.containsKey("withException") && Boolean.valueOf(allRequestParams.get("withException"))) { + if (allRequestParams.containsKey("withException") && Boolean.parseBoolean(allRequestParams.get("withException"))) { query.withException(); } if (allRequestParams.containsKey("exceptionMessage")) { @@ -140,13 +140,13 @@ public DataResponse getJobs(@ApiParam(hidden = true) @RequestParam if (allRequestParams.containsKey("tenantIdLike")) { query.jobTenantIdLike(allRequestParams.get("tenantIdLike")); } - if (allRequestParams.containsKey("withoutTenantId") && Boolean.valueOf(allRequestParams.get("withoutTenantId"))) { + if (allRequestParams.containsKey("withoutTenantId") && Boolean.parseBoolean(allRequestParams.get("withoutTenantId"))) { query.jobWithoutTenantId(); } - if (allRequestParams.containsKey("withoutScopeType") && Boolean.valueOf(allRequestParams.get("withoutScopeType"))) { + if (allRequestParams.containsKey("withoutScopeType") && Boolean.parseBoolean(allRequestParams.get("withoutScopeType"))) { query.withoutScopeType(); } - if (allRequestParams.containsKey("withoutScopeId") && Boolean.valueOf(allRequestParams.get("withoutScopeId"))) { + if (allRequestParams.containsKey("withoutScopeId") && Boolean.parseBoolean(allRequestParams.get("withoutScopeId"))) { query.withoutScopeId(); } diff --git a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/management/HistoryJobCollectionResource.java b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/management/HistoryJobCollectionResource.java index c1c8f5f56c9..adce44d4ef1 100644 --- a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/management/HistoryJobCollectionResource.java +++ b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/management/HistoryJobCollectionResource.java @@ -81,7 +81,7 @@ public DataResponse getHistoryJobs(@ApiParam(hidden = true) query.jobId(allRequestParams.get("scopeType")); } if (allRequestParams.containsKey("withException")) { - if (Boolean.valueOf(allRequestParams.get("withException"))) { + if (Boolean.parseBoolean(allRequestParams.get("withException"))) { query.withException(); } } @@ -92,12 +92,12 @@ public DataResponse getHistoryJobs(@ApiParam(hidden = true) query.lockOwner(allRequestParams.get("lockOwner")); } if (allRequestParams.containsKey("locked")) { - if (Boolean.valueOf(allRequestParams.get("locked"))) { + if (Boolean.parseBoolean(allRequestParams.get("locked"))) { query.locked(); } } if (allRequestParams.containsKey("unlocked")) { - if (Boolean.valueOf(allRequestParams.get("unlocked"))) { + if (Boolean.parseBoolean(allRequestParams.get("unlocked"))) { query.unlocked(); } } @@ -108,7 +108,7 @@ public DataResponse getHistoryJobs(@ApiParam(hidden = true) query.jobTenantIdLike(allRequestParams.get("tenantIdLike")); } if (allRequestParams.containsKey("withoutTenantId")) { - if (Boolean.valueOf(allRequestParams.get("withoutTenantId"))) { + if (Boolean.parseBoolean(allRequestParams.get("withoutTenantId"))) { query.jobWithoutTenantId(); } } diff --git a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/management/JobCollectionResource.java b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/management/JobCollectionResource.java index 69eee9dcf93..8ec4da0775a 100644 --- a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/management/JobCollectionResource.java +++ b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/management/JobCollectionResource.java @@ -110,7 +110,7 @@ public DataResponse getJobs(@ApiParam(hidden = true) @RequestParam if (allRequestParams.containsKey("processInstanceId")) { query.processInstanceId(allRequestParams.get("processInstanceId")); } - if (allRequestParams.containsKey("withoutProcessInstanceId") && Boolean.valueOf(allRequestParams.get("withoutProcessInstanceId"))) { + if (allRequestParams.containsKey("withoutProcessInstanceId") && Boolean.parseBoolean(allRequestParams.get("withoutProcessInstanceId"))) { query.withoutProcessInstanceId(); } if (allRequestParams.containsKey("executionId")) { @@ -129,11 +129,11 @@ public DataResponse getJobs(@ApiParam(hidden = true) @RequestParam if (allRequestParams.containsKey("messagesOnly")) { throw new FlowableIllegalArgumentException("Only one of 'timersOnly' or 'messagesOnly' can be provided."); } - if (Boolean.valueOf(allRequestParams.get("timersOnly"))) { + if (Boolean.parseBoolean(allRequestParams.get("timersOnly"))) { query.timers(); } } - if (allRequestParams.containsKey("messagesOnly") && Boolean.valueOf(allRequestParams.get("messagesOnly"))) { + if (allRequestParams.containsKey("messagesOnly") && Boolean.parseBoolean(allRequestParams.get("messagesOnly"))) { query.messages(); } if (allRequestParams.containsKey("dueBefore")) { @@ -142,7 +142,7 @@ public DataResponse getJobs(@ApiParam(hidden = true) @RequestParam if (allRequestParams.containsKey("dueAfter")) { query.duedateHigherThan(RequestUtil.getDate(allRequestParams, "dueAfter")); } - if (allRequestParams.containsKey("withException") && Boolean.valueOf(allRequestParams.get("withException"))) { + if (allRequestParams.containsKey("withException") && Boolean.parseBoolean(allRequestParams.get("withException"))) { query.withException(); } if (allRequestParams.containsKey("exceptionMessage")) { @@ -154,19 +154,19 @@ public DataResponse getJobs(@ApiParam(hidden = true) @RequestParam if (allRequestParams.containsKey("tenantIdLike")) { query.jobTenantIdLike(allRequestParams.get("tenantIdLike")); } - if (allRequestParams.containsKey("withoutTenantId") && Boolean.valueOf(allRequestParams.get("withoutTenantId"))) { + if (allRequestParams.containsKey("withoutTenantId") && Boolean.parseBoolean(allRequestParams.get("withoutTenantId"))) { query.jobWithoutTenantId(); } - if (allRequestParams.containsKey("locked") && Boolean.valueOf(allRequestParams.get("locked"))) { + if (allRequestParams.containsKey("locked") && Boolean.parseBoolean(allRequestParams.get("locked"))) { query.locked(); } - if (allRequestParams.containsKey("unlocked") && Boolean.valueOf(allRequestParams.get("unlocked"))) { + if (allRequestParams.containsKey("unlocked") && Boolean.parseBoolean(allRequestParams.get("unlocked"))) { query.unlocked(); } - if (allRequestParams.containsKey("withoutScopeType") && Boolean.valueOf(allRequestParams.get("withoutScopeType"))) { + if (allRequestParams.containsKey("withoutScopeType") && Boolean.parseBoolean(allRequestParams.get("withoutScopeType"))) { query.withoutScopeType(); } - if (allRequestParams.containsKey("withoutScopeId") && Boolean.valueOf(allRequestParams.get("withoutScopeId"))) { + if (allRequestParams.containsKey("withoutScopeId") && Boolean.parseBoolean(allRequestParams.get("withoutScopeId"))) { query.withoutScopeId(); } diff --git a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/management/SuspendedJobCollectionResource.java b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/management/SuspendedJobCollectionResource.java index 77cf00f0bbe..0e1aebd34f2 100644 --- a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/management/SuspendedJobCollectionResource.java +++ b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/management/SuspendedJobCollectionResource.java @@ -94,7 +94,7 @@ public DataResponse getJobs(@ApiParam(hidden = true) @RequestParam if (allRequestParams.containsKey("processInstanceId")) { query.processInstanceId(allRequestParams.get("processInstanceId")); } - if (allRequestParams.containsKey("withoutProcessInstanceId") && Boolean.valueOf(allRequestParams.get("withoutProcessInstanceId"))) { + if (allRequestParams.containsKey("withoutProcessInstanceId") && Boolean.parseBoolean(allRequestParams.get("withoutProcessInstanceId"))) { query.withoutProcessInstanceId(); } if (allRequestParams.containsKey("executionId")) { @@ -116,11 +116,11 @@ public DataResponse getJobs(@ApiParam(hidden = true) @RequestParam if (allRequestParams.containsKey("messagesOnly")) { throw new FlowableIllegalArgumentException("Only one of 'timersOnly' or 'messagesOnly' can be provided."); } - if (Boolean.valueOf(allRequestParams.get("timersOnly"))) { + if (Boolean.parseBoolean(allRequestParams.get("timersOnly"))) { query.timers(); } } - if (allRequestParams.containsKey("messagesOnly") && Boolean.valueOf(allRequestParams.get("messagesOnly"))) { + if (allRequestParams.containsKey("messagesOnly") && Boolean.parseBoolean(allRequestParams.get("messagesOnly"))) { query.messages(); } if (allRequestParams.containsKey("dueBefore")) { @@ -129,13 +129,13 @@ public DataResponse getJobs(@ApiParam(hidden = true) @RequestParam if (allRequestParams.containsKey("dueAfter")) { query.duedateHigherThan(RequestUtil.getDate(allRequestParams, "dueAfter")); } - if (allRequestParams.containsKey("withException") && Boolean.valueOf(allRequestParams.get("withException"))) { + if (allRequestParams.containsKey("withException") && Boolean.parseBoolean(allRequestParams.get("withException"))) { query.withException(); } - if (allRequestParams.containsKey("withRetriesLeft") && Boolean.valueOf(allRequestParams.get("withRetriesLeft"))) { + if (allRequestParams.containsKey("withRetriesLeft") && Boolean.parseBoolean(allRequestParams.get("withRetriesLeft"))) { query.withRetriesLeft(); } - if (allRequestParams.containsKey("noRetriesLeft") && Boolean.valueOf(allRequestParams.get("noRetriesLeft"))) { + if (allRequestParams.containsKey("noRetriesLeft") && Boolean.parseBoolean(allRequestParams.get("noRetriesLeft"))) { query.noRetriesLeft(); } if (allRequestParams.containsKey("exceptionMessage")) { @@ -147,13 +147,13 @@ public DataResponse getJobs(@ApiParam(hidden = true) @RequestParam if (allRequestParams.containsKey("tenantIdLike")) { query.jobTenantIdLike(allRequestParams.get("tenantIdLike")); } - if (allRequestParams.containsKey("withoutTenantId") && Boolean.valueOf(allRequestParams.get("withoutTenantId"))) { + if (allRequestParams.containsKey("withoutTenantId") && Boolean.parseBoolean(allRequestParams.get("withoutTenantId"))) { query.jobWithoutTenantId(); } - if (allRequestParams.containsKey("withoutScopeType") && Boolean.valueOf(allRequestParams.get("withoutScopeType"))) { + if (allRequestParams.containsKey("withoutScopeType") && Boolean.parseBoolean(allRequestParams.get("withoutScopeType"))) { query.withoutScopeType(); } - if (allRequestParams.containsKey("withoutScopeId") && Boolean.valueOf(allRequestParams.get("withoutScopeId"))) { + if (allRequestParams.containsKey("withoutScopeId") && Boolean.parseBoolean(allRequestParams.get("withoutScopeId"))) { query.withoutScopeId(); } diff --git a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/management/TimerJobCollectionResource.java b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/management/TimerJobCollectionResource.java index 62e7cf28c88..73fdb153835 100644 --- a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/management/TimerJobCollectionResource.java +++ b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/management/TimerJobCollectionResource.java @@ -94,7 +94,7 @@ public DataResponse getJobs(@ApiParam(hidden = true) @RequestParam if (allRequestParams.containsKey("processInstanceId")) { query.processInstanceId(allRequestParams.get("processInstanceId")); } - if (allRequestParams.containsKey("withoutProcessInstanceId") && Boolean.valueOf(allRequestParams.get("withoutProcessInstanceId"))) { + if (allRequestParams.containsKey("withoutProcessInstanceId") && Boolean.parseBoolean(allRequestParams.get("withoutProcessInstanceId"))) { query.withoutProcessInstanceId(); } if (allRequestParams.containsKey("executionId")) { @@ -116,11 +116,11 @@ public DataResponse getJobs(@ApiParam(hidden = true) @RequestParam if (allRequestParams.containsKey("messagesOnly")) { throw new FlowableIllegalArgumentException("Only one of 'timersOnly' or 'messagesOnly' can be provided."); } - if (Boolean.valueOf(allRequestParams.get("timersOnly"))) { + if (Boolean.parseBoolean(allRequestParams.get("timersOnly"))) { query.timers(); } } - if (allRequestParams.containsKey("messagesOnly") && Boolean.valueOf(allRequestParams.get("messagesOnly"))) { + if (allRequestParams.containsKey("messagesOnly") && Boolean.parseBoolean(allRequestParams.get("messagesOnly"))) { query.messages(); } if (allRequestParams.containsKey("dueBefore")) { @@ -129,7 +129,7 @@ public DataResponse getJobs(@ApiParam(hidden = true) @RequestParam if (allRequestParams.containsKey("dueAfter")) { query.duedateHigherThan(RequestUtil.getDate(allRequestParams, "dueAfter")); } - if (allRequestParams.containsKey("withException") && Boolean.valueOf(allRequestParams.get("withException"))) { + if (allRequestParams.containsKey("withException") && Boolean.parseBoolean(allRequestParams.get("withException"))) { query.withException(); } if (allRequestParams.containsKey("exceptionMessage")) { @@ -141,13 +141,13 @@ public DataResponse getJobs(@ApiParam(hidden = true) @RequestParam if (allRequestParams.containsKey("tenantIdLike")) { query.jobTenantIdLike(allRequestParams.get("tenantIdLike")); } - if (allRequestParams.containsKey("withoutTenantId") && Boolean.valueOf(allRequestParams.get("withoutTenantId"))) { + if (allRequestParams.containsKey("withoutTenantId") && Boolean.parseBoolean(allRequestParams.get("withoutTenantId"))) { query.jobWithoutTenantId(); } - if (allRequestParams.containsKey("withoutScopeType") && Boolean.valueOf(allRequestParams.get("withoutScopeType"))) { + if (allRequestParams.containsKey("withoutScopeType") && Boolean.parseBoolean(allRequestParams.get("withoutScopeType"))) { query.withoutScopeType(); } - if (allRequestParams.containsKey("withoutScopeId") && Boolean.valueOf(allRequestParams.get("withoutScopeId"))) { + if (allRequestParams.containsKey("withoutScopeId") && Boolean.parseBoolean(allRequestParams.get("withoutScopeId"))) { query.withoutScopeId(); } diff --git a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/repository/ModelCollectionResource.java b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/repository/ModelCollectionResource.java index 1af269ffa23..4e5df64a8e4 100644 --- a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/repository/ModelCollectionResource.java +++ b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/repository/ModelCollectionResource.java @@ -111,7 +111,7 @@ public DataResponse getModels(@ApiParam(hidden = true) @RequestPa modelQuery.modelVersion(Integer.valueOf(allRequestParams.get("version"))); } if (allRequestParams.containsKey("latestVersion")) { - boolean isLatestVersion = Boolean.valueOf(allRequestParams.get("latestVersion")); + boolean isLatestVersion = Boolean.parseBoolean(allRequestParams.get("latestVersion")); if (isLatestVersion) { modelQuery.latestVersion(); } @@ -120,7 +120,7 @@ public DataResponse getModels(@ApiParam(hidden = true) @RequestPa modelQuery.deploymentId(allRequestParams.get("deploymentId")); } if (allRequestParams.containsKey("deployed")) { - boolean isDeployed = Boolean.valueOf(allRequestParams.get("deployed")); + boolean isDeployed = Boolean.parseBoolean(allRequestParams.get("deployed")); if (isDeployed) { modelQuery.deployed(); } else { @@ -134,7 +134,7 @@ public DataResponse getModels(@ApiParam(hidden = true) @RequestPa modelQuery.modelTenantIdLike(allRequestParams.get("tenantIdLike")); } if (allRequestParams.containsKey("withoutTenantId")) { - boolean withoutTenantId = Boolean.valueOf(allRequestParams.get("withoutTenantId")); + boolean withoutTenantId = Boolean.parseBoolean(allRequestParams.get("withoutTenantId")); if (withoutTenantId) { modelQuery.modelWithoutTenantId(); } diff --git a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/repository/ProcessDefinitionCollectionResource.java b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/repository/ProcessDefinitionCollectionResource.java index 2f6be57d851..5f070f478ad 100644 --- a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/repository/ProcessDefinitionCollectionResource.java +++ b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/repository/ProcessDefinitionCollectionResource.java @@ -130,18 +130,14 @@ public DataResponse getProcessDefinitions(@ApiParam(h processDefinitionQuery.processDefinitionVersion(Integer.valueOf(allRequestParams.get("version"))); } if (allRequestParams.containsKey("suspended")) { - Boolean suspended = Boolean.valueOf(allRequestParams.get("suspended")); - if (suspended != null) { - if (suspended) { - processDefinitionQuery.suspended(); - } else { - processDefinitionQuery.active(); - } + if (Boolean.parseBoolean(allRequestParams.get("suspended"))) { + processDefinitionQuery.suspended(); + } else { + processDefinitionQuery.active(); } } if (allRequestParams.containsKey("latest")) { - Boolean latest = Boolean.valueOf(allRequestParams.get("latest")); - if (latest != null && latest) { + if (Boolean.parseBoolean(allRequestParams.get("latest"))) { processDefinitionQuery.latestVersion(); } } diff --git a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/EventSubscriptionCollectionResource.java b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/EventSubscriptionCollectionResource.java index a268f1e9419..af8ff013db0 100644 --- a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/EventSubscriptionCollectionResource.java +++ b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/EventSubscriptionCollectionResource.java @@ -103,19 +103,19 @@ public DataResponse getEventSubscriptions(@ApiParam(h if (allRequestParams.containsKey("processInstanceId")) { query.processInstanceId(allRequestParams.get("processInstanceId")); } - if (allRequestParams.containsKey("withoutProcessInstanceId") && Boolean.valueOf(allRequestParams.get("withoutProcessInstanceId"))) { + if (allRequestParams.containsKey("withoutProcessInstanceId") && Boolean.parseBoolean(allRequestParams.get("withoutProcessInstanceId"))) { query.withoutProcessInstanceId(); } if (allRequestParams.containsKey("processDefinitionId")) { query.processDefinitionId(allRequestParams.get("processDefinitionId")); } - if (allRequestParams.containsKey("withoutProcessDefinitionId") && Boolean.valueOf(allRequestParams.get("withoutProcessDefinitionId"))) { + if (allRequestParams.containsKey("withoutProcessDefinitionId") && Boolean.parseBoolean(allRequestParams.get("withoutProcessDefinitionId"))) { query.withoutProcessDefinitionId(); } if (allRequestParams.containsKey("scopeId")) { query.scopeId(allRequestParams.get("scopeId")); } - if (allRequestParams.containsKey("withoutScopeId") && Boolean.valueOf(allRequestParams.get("withoutScopeId"))) { + if (allRequestParams.containsKey("withoutScopeId") && Boolean.parseBoolean(allRequestParams.get("withoutScopeId"))) { query.withoutScopeId(); } if (allRequestParams.containsKey("subScopeId")) { @@ -124,7 +124,7 @@ public DataResponse getEventSubscriptions(@ApiParam(h if (allRequestParams.containsKey("scopeDefinitionId")) { query.scopeDefinitionId(allRequestParams.get("scopeDefinitionId")); } - if (allRequestParams.containsKey("withoutScopeDefinitionId") && Boolean.valueOf(allRequestParams.get("withoutScopeDefinitionId"))) { + if (allRequestParams.containsKey("withoutScopeDefinitionId") && Boolean.parseBoolean(allRequestParams.get("withoutScopeDefinitionId"))) { query.withoutScopeDefinitionId(); } if (allRequestParams.containsKey("createdBefore")) { @@ -136,13 +136,13 @@ public DataResponse getEventSubscriptions(@ApiParam(h if (allRequestParams.containsKey("tenantId")) { query.tenantId(allRequestParams.get("tenantId")); } - if (allRequestParams.containsKey("withoutTenantId") && Boolean.valueOf(allRequestParams.get("withoutTenantId"))) { + if (allRequestParams.containsKey("withoutTenantId") && Boolean.parseBoolean(allRequestParams.get("withoutTenantId"))) { query.withoutTenantId(); } if (allRequestParams.containsKey("configuration")) { query.configuration(allRequestParams.get("configuration")); } - if (allRequestParams.containsKey("withoutConfiguration") && Boolean.valueOf(allRequestParams.get("withoutConfiguration"))) { + if (allRequestParams.containsKey("withoutConfiguration") && Boolean.parseBoolean(allRequestParams.get("withoutConfiguration"))) { query.withoutConfiguration(); } diff --git a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ExecutionCollectionResource.java b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ExecutionCollectionResource.java index e69e10fdd19..25a71450d49 100644 --- a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ExecutionCollectionResource.java +++ b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ExecutionCollectionResource.java @@ -111,7 +111,7 @@ public DataResponse getProcessInstances(@ApiParam(hidden = tr } if (allRequestParams.containsKey("withoutTenantId")) { - if (Boolean.valueOf(allRequestParams.get("withoutTenantId"))) { + if (Boolean.parseBoolean(allRequestParams.get("withoutTenantId"))) { queryRequest.setWithoutTenantId(Boolean.TRUE); } } diff --git a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ProcessInstanceCollectionResource.java b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ProcessInstanceCollectionResource.java index f36bb12ec99..f9b0f1a3779 100644 --- a/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ProcessInstanceCollectionResource.java +++ b/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/runtime/process/ProcessInstanceCollectionResource.java @@ -206,7 +206,7 @@ public DataResponse getProcessInstances(@ApiParam(hidde } if (allRequestParams.containsKey("withoutTenantId")) { - if (Boolean.valueOf(allRequestParams.get("withoutTenantId"))) { + if (Boolean.parseBoolean(allRequestParams.get("withoutTenantId"))) { queryRequest.setWithoutTenantId(Boolean.TRUE); } } @@ -249,7 +249,7 @@ public ProcessInstanceResponse createProcessInstance(@RequestBody ProcessInstanc Map startVariables = null; Map transientVariables = null; Map startFormVariables = null; - if (request.getStartFormVariables() != null && request.getStartFormVariables().size()>0) { + if (request.getStartFormVariables() != null && !request.getStartFormVariables().isEmpty()) { startFormVariables = new HashMap<>(); for (RestVariable variable : request.getStartFormVariables()) { if (variable.getName() == null) { @@ -260,7 +260,7 @@ public ProcessInstanceResponse createProcessInstance(@RequestBody ProcessInstanc } else { - if (request.getVariables() != null && request.getVariables().size()>0) { + if (request.getVariables() != null && !request.getVariables().isEmpty()) { startVariables = new HashMap<>(); for (RestVariable variable : request.getVariables()) { if (variable.getName() == null) { @@ -270,7 +270,7 @@ public ProcessInstanceResponse createProcessInstance(@RequestBody ProcessInstanc } } - if (request.getTransientVariables() != null && request.getTransientVariables().size()>0) { + if (request.getTransientVariables() != null && !request.getTransientVariables().isEmpty()) { transientVariables = new HashMap<>(); for (RestVariable variable : request.getTransientVariables()) { if (variable.getName() == null) { @@ -304,7 +304,7 @@ public ProcessInstanceResponse createProcessInstance(@RequestBody ProcessInstanc if (request.isTenantSet()) { processInstanceBuilder.tenantId(request.getTenantId()); } - if (request.getOverrideDefinitionTenantId() != null && request.getOverrideDefinitionTenantId().length() > 0) { + if (request.getOverrideDefinitionTenantId() != null && !request.getOverrideDefinitionTenantId().isEmpty()) { processInstanceBuilder.overrideProcessDefinitionTenantId(request.getOverrideDefinitionTenantId()); } if (startFormVariables != null) {