From 2e2b74bd03536d694ae8a3ba2e452ca31dc35d70 Mon Sep 17 00:00:00 2001 From: firewave Date: Fri, 3 Jan 2025 16:19:09 +0100 Subject: [PATCH] mitigated build warning about `RandomStringUtils.randomAlphanumeric(int)` being deprecated - fixes #102 --- README.md | 1 + resources/META-INF/plugin.xml | 1 + src/com/github/johnthagen/cppcheck/CppcheckInspection.java | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cc45c7c..3e9d1aa 100644 --- a/README.md +++ b/README.md @@ -144,6 +144,7 @@ Deployment. ## Releases ### 1.6.7 - 20XX-XX-XX +- Mitigated build warning about `RandomStringUtils.randomAlphanumeric(int)` being deprecated. ### 1.6.6 - 2024-01-06 diff --git a/resources/META-INF/plugin.xml b/resources/META-INF/plugin.xml index d99a216..29b5c2b 100644 --- a/resources/META-INF/plugin.xml +++ b/resources/META-INF/plugin.xml @@ -23,6 +23,7 @@ ]]> diff --git a/src/com/github/johnthagen/cppcheck/CppcheckInspection.java b/src/com/github/johnthagen/cppcheck/CppcheckInspection.java index 373ec12..d4b9c3b 100644 --- a/src/com/github/johnthagen/cppcheck/CppcheckInspection.java +++ b/src/com/github/johnthagen/cppcheck/CppcheckInspection.java @@ -92,7 +92,7 @@ public ProblemDescriptor[] checkFile(@NotNull final PsiFile file, File tempFile = null; try { final CppCheckInspectionImpl inspectionImpl = new CppCheckInspectionImpl(verboseLevel); - tempFile = FileUtil.createTempFile(RandomStringUtils.randomAlphanumeric(8) + "_", vFile.getName(), true); + tempFile = FileUtil.createTempFile(RandomStringUtils.insecure().nextAlphanumeric(8) + "_", vFile.getName(), true); FileUtil.writeToFile(tempFile, document.getText()); final String cppcheckOutput = inspectionImpl.executeCommandOnFile(vFile, cppcheckPathFile, prependIncludeDir(cppcheckOptions, vFile),