diff --git a/.config/checkstyle/checkstyle.xml b/.config/checkstyle/checkstyle.xml index 43b5290..df4ba79 100644 --- a/.config/checkstyle/checkstyle.xml +++ b/.config/checkstyle/checkstyle.xml @@ -9,7 +9,7 @@ - + @@ -91,7 +91,7 @@ - + @@ -122,9 +122,7 @@ - - - + diff --git a/.config/pmd/java/ruleset.xml b/.config/pmd/java/ruleset.xml index 341cb3a..c057d1a 100644 --- a/.config/pmd/java/ruleset.xml +++ b/.config/pmd/java/ruleset.xml @@ -17,6 +17,7 @@ + @@ -149,6 +150,7 @@ + @@ -211,11 +213,11 @@ message="StringBuilder/StringBuffer should not be used" class="net.sourceforge.pmd.lang.rule.xpath.XPathRule"> -Usually all cases where `StringBuilder` (or the outdated `StringBuffer`) is used are either due to confusing (legacy) logic or may be replaced by a simpler string concatenation. +Usually all cases where `StringBuilder` (or the outdated `StringBuffer`) is used are either due to confusing (legacy) logic or in situations where it may be easily replaced by a simpler string concatenation. Solution: * Do not use `StringBuffer` because it's thread-safe and usually this is not needed -* If `StringBuilder` is only used in a simple method (like `toString`) and is effectively inlined: Use a simpler string concatenation (`"a" + x + "b"`). This will be optimized by the Java compiler internally. +* If `StringBuilder` is only used in a simple method (like `toString`) and is effectively inlined: Use a simpler string concatenation (`"a" + x + "b"`). This will be [optimized by the Java compiler internally](https://docs.oracle.com/javase/specs/jls/se25/html/jls-15.html#jls-15.18.1). * In all other cases: * Check what is happening and if it makes ANY sense! If for example a CSV file is built here consider using a proper library instead! * Abstract the Strings into a DTO, join them together using a collection (or `StringJoiner`) or use Java's Streaming API instead @@ -237,8 +239,8 @@ Solution: message="Setters of java.lang.System should not be called unless really needed" class="net.sourceforge.pmd.lang.rule.xpath.XPathRule"> -Calling setters of java.lang.System usually indicates bad design and likely causes unexpected behavior. -For example, it may break when multiple Threads are setting the value. +Calling setters of `java.lang.System` usually indicates bad design and likely causes unexpected behavior. +For example, it may break when multiple Threads are working with the same value. It may also overwrite user defined options or properties. Try to pass the value only to the place where it's really needed and use it there accordingly. @@ -350,7 +352,8 @@ You can suppress this warning when you properly sanitized the name. Nearly every known usage of (Java) Object Deserialization has resulted in [a security vulnerability](https://cloud.google.com/blog/topics/threat-intelligence/hunting-deserialization-exploits?hl=en). Vulnerabilities are so common that there are [dedicated projects for exploit payload generation](https://github.com/frohoff/ysoserial). -Java Object Serialization may also fail to deserialize when the underlying classes are changed. +Java Object Serialization may also fail to deserialize properly when the underlying classes are changed. +This can result in unexpected crashes when outdated data is deserialized. Use proven data interchange formats like JSON instead. @@ -372,7 +375,8 @@ Use proven data interchange formats like JSON instead. + class="net.sourceforge.pmd.lang.rule.xpath.XPathRule" + externalInfoUrl="https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML"> Do not use native HTML! Use Vaadin layouts and components to create required structure. If you are 100% sure that you escaped the value properly and you have no better options you can suppress this. diff --git a/.github/workflows/broken-links.yml b/.github/workflows/broken-links.yml index 3a1009c..2675c8b 100644 --- a/.github/workflows/broken-links.yml +++ b/.github/workflows/broken-links.yml @@ -13,13 +13,13 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 15 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - run: mv .github/.lycheeignore .lycheeignore - name: Link Checker id: lychee - uses: lycheeverse/lychee-action@885c65f3dc543b57c898c8099f4e08c8afd178a2 # v2 + uses: lycheeverse/lychee-action@a8c4c7cb88f0c7386610c35eb25108e448569cb0 # v2 with: fail: false # Don't fail on broken links, create an issue instead diff --git a/.github/workflows/check-build.yml b/.github/workflows/check-build.yml index 6a57feb..7cdeae3 100644 --- a/.github/workflows/check-build.yml +++ b/.github/workflows/check-build.yml @@ -28,7 +28,7 @@ jobs: java: [21] distribution: [temurin] steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up JDK uses: actions/setup-java@v5 @@ -78,7 +78,7 @@ jobs: uses: actions/upload-artifact@v5 with: name: plugin-files-java-${{ matrix.java }} - path: build/libs/template-placeholder-*.jar + path: build/distributions/*.zip if-no-files-found: error checkstyle: @@ -90,7 +90,7 @@ jobs: java: [21] distribution: [temurin] steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up JDK uses: actions/setup-java@v5 @@ -120,7 +120,7 @@ jobs: java: [21] distribution: [temurin] steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up JDK uses: actions/setup-java@v5 diff --git a/.github/workflows/check-ide-compatibility.yml b/.github/workflows/check-ide-compatibility.yml index 8f38332..39352c4 100644 --- a/.github/workflows/check-ide-compatibility.yml +++ b/.github/workflows/check-ide-compatibility.yml @@ -41,7 +41,7 @@ jobs: done sudo df -h - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up JDK uses: actions/setup-java@v5 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f0dcd10..cd7c45b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up JDK uses: actions/setup-java@v5 @@ -59,7 +59,7 @@ jobs: outputs: upload_url: ${{ steps.create_release.outputs.upload_url }} steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Configure Git run: | @@ -112,7 +112,7 @@ jobs: needs: [prepare_release] timeout-minutes: 60 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up JDK uses: actions/setup-java@v5 @@ -145,7 +145,7 @@ jobs: needs: [publish] timeout-minutes: 10 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Init Git and pull run: | diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index f6c50a1..6471ce7 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: sparse-checkout: .github/labels.yml diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml index 8459c29..85ac7aa 100644 --- a/.github/workflows/test-deploy.yml +++ b/.github/workflows/test-deploy.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up JDK uses: actions/setup-java@v5 diff --git a/.github/workflows/update-from-template.yml b/.github/workflows/update-from-template.yml index ea209a9..7ef61bb 100644 --- a/.github/workflows/update-from-template.yml +++ b/.github/workflows/update-from-template.yml @@ -36,7 +36,7 @@ jobs: update_branch_merged_commit: ${{ steps.manage-branches.outputs.update_branch_merged_commit }} create_update_branch_merged_pr: ${{ steps.manage-branches.outputs.create_update_branch_merged_pr }} steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: # Required because otherwise there are always changes detected when executing diff/rev-list fetch-depth: 0 @@ -183,7 +183,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: # Required because otherwise there are always changes detected when executing diff/rev-list fetch-depth: 0 diff --git a/.gitignore b/.gitignore index a4a5d62..efa8a8a 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ build/ !.idea/saveactions_settings.xml !.idea/checkstyle-idea.xml !.idea/externalDependencies.xml +!.idea/pmd-x.xml !.idea/PMDPlugin.xml !.idea/inspectionProfiles/ diff --git a/.idea/pmd-x.xml b/.idea/pmd-x.xml new file mode 100644 index 0000000..260e454 --- /dev/null +++ b/.idea/pmd-x.xml @@ -0,0 +1,27 @@ + + + + false + true + true + SUPPORTED_ONLY_WITH_TESTS + + + + \ No newline at end of file diff --git a/build.gradle b/build.gradle index 8ef7d3a..24edd51 100644 --- a/build.gradle +++ b/build.gradle @@ -3,13 +3,13 @@ plugins { id 'idea' id 'checkstyle' id 'pmd' - id 'org.jetbrains.intellij.platform' version '2.10.2' + id 'org.jetbrains.intellij.platform' version '2.10.5' } ext { - checkstyleVersion = '12.1.1' + checkstyleVersion = '12.2.0' - pmdVersion = '7.17.0' + pmdVersion = '7.19.0' } def properties(String key) { @@ -59,7 +59,7 @@ dependencies { checkstyle "com.puppycrawl.tools:checkstyle:${checkstyleVersion}" pmd "net.sourceforge.pmd:pmd-ant:${pmdVersion}", "net.sourceforge.pmd:pmd-java:${pmdVersion}" - testImplementation platform('org.junit:junit-bom:6.0.0'), + testImplementation platform('org.junit:junit-bom:6.0.1'), 'org.junit.jupiter:junit-jupiter', 'org.junit.jupiter:junit-jupiter-engine', 'org.assertj:assertj-core:3.27.6' diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 8bdaf60..f8e1ee3 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2e11132..23449a2 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME