github-advanced-security[bot] commented on code in PR #17523:
URL: 
https://github.com/apache/dolphinscheduler/pull/17523#discussion_r2361554604


##########
dolphinscheduler-task-executor/src/main/java/org/apache/dolphinscheduler/task/executor/container/AbstractTaskExecutorContainer.java:
##########
@@ -145,4 +149,26 @@
         }
     }
 
+    /**
+     * Delete task exec Directory if set development.state=false in 
common.properties explicit
+     * otherwise keep it for debug reason.
+     */
+    private void deleteExecPathIfProduction(ITaskExecutor taskExecutor) {
+        boolean isDev = PropertyUtils.getBoolean(Constants.DEVELOPMENT_STATE, 
true);
+        if (!isDev) {
+            try {
+                final TaskExecutionContext ctx = 
taskExecutor.getTaskExecutionContext();
+                final String execPath = (ctx != null ? ctx.getExecutePath() : 
"");
+                if (!"".equals(execPath)) {

Review Comment:
   ## Inefficient empty string test
   
   Inefficient comparison to empty string, check for zero length instead.
   
   [Show more 
details](https://github.com/apache/dolphinscheduler/security/code-scanning/5536)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to