{"record":{"id":"681307aee1cefab8","repo":"apache/dolphinscheduler","slug":"source-path-and-destination-path-cannot-be-the-sam","errorCode":null,"errorMessage":"Source path and destination path cannot be the same: ${srcAbsolutePath}","messagePattern":"Source path and destination path cannot be the same: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-storage-plugin/dolphinscheduler-storage-api/src/main/java/org/apache/dolphinscheduler/plugin/storage/api/local/LocalStorageOperator.java","lineNumber":93,"sourceCode":"    public boolean exists(String resourceAbsolutePath) {\n        return Files.exists(Paths.get(resourceAbsolutePath));\n    }\n\n    @SneakyThrows\n    @Override\n    public void delete(String resourceAbsolutePath, boolean recursive) {\n        if (recursive) {\n            FileUtils.deleteQuietly(new File(resourceAbsolutePath));\n        } else {\n            Files.deleteIfExists(Paths.get(resourceAbsolutePath));\n        }\n    }\n\n    @SneakyThrows\n    @Override\n    public void copy(String srcAbsolutePath, String dstAbsolutePath, boolean deleteSource, boolean overwrite) {\n        if (srcAbsolutePath.equals(dstAbsolutePath)) {\n            throw new IllegalArgumentException(\n                    \"Source path and destination path cannot be the same: \" + srcAbsolutePath);\n        }\n\n        if (!exists(srcAbsolutePath)) {\n            throw new FileNotFoundException(\"Source path does not exist: \" + srcAbsolutePath);\n        }\n\n        if (exists(dstAbsolutePath)) {\n            if (!overwrite) {\n                throw new FileAlreadyExistsException(\"Destination path already exists: \" + dstAbsolutePath);\n            }\n            delete(dstAbsolutePath, true);\n        }\n\n        final File srcFile = new File(srcAbsolutePath);\n        final File dstFile = new File(dstAbsolutePath);\n        if (FileUtils.isDirectory(srcFile)) {\n            FileUtils.copyDirectoryToDirectory(srcFile, dstFile);","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-storage-plugin/dolphinscheduler-storage-api/src/main/java/org/apache/dolphinscheduler/plugin/storage/api/local/LocalStorageOperator.java#L75-L111","documentation":"A self-copy guard inside copy(): the source and destination absolute paths are string-equal, which would make the copy operation a no-op at best or destroy the source when deleteSource=true. The offending input is srcAbsolutePath (identical to dstAbsolutePath); typical triggers are renaming/moving a resource onto itself or a UI edit that kept the same target path.","triggerScenarios":"Thrown at dolphinscheduler-storage-plugin/dolphinscheduler-storage-api/src/main/java/org/apache/dolphinscheduler/plugin/storage/api/local/LocalStorageOperator.java:93 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Skip the copy when src equals dst instead of erroring, if self-copy is semantically acceptable","Validate in the resource rename/move API that the destination differs from the source","Compare canonical paths to catch equivalent paths with different spellings"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}