Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
cdbd713
Update net.sourceforge.pmd to v7.21.0
xdev-renovate Feb 3, 2026
78e6f92
Updat to PMD 7.21.0
AB-xdev Feb 4, 2026
076ea0f
Update dependency com.puppycrawl.tools:checkstyle to v13.2.0
xdev-renovate Feb 6, 2026
74eeccb
Merge pull request #246 from xdev-software/renovate/net.sourceforge.pmd
AB-xdev Feb 9, 2026
bff6ff0
Merge pull request #249 from xdev-software/renovate/com.puppycrawl.to…
AB-xdev Feb 9, 2026
76cf223
Disallow classes ending with Helper or Util
AB-xdev Feb 20, 2026
838f350
Avoid using Optional#get
AB-xdev Feb 23, 2026
c98c664
Merge branch 'master' into update-from-template-xdev-software/java-se…
xdev-gh-bot Feb 24, 2026
1ff105e
Merge branch 'master' into update-from-template-xdev-software/java-te…
xdev-gh-bot Feb 24, 2026
bd6498d
Update lycheeverse/lychee-action digest to 8646ba3
xdev-renovate Feb 26, 2026
8b6624e
Update lycheeverse/lychee-action digest to 8646ba3
xdev-renovate Feb 26, 2026
a53730b
Update actions/upload-artifact action to v7
xdev-renovate Feb 27, 2026
0dcf9cf
Update dependency com.puppycrawl.tools:checkstyle to v13.3.0
xdev-renovate Mar 1, 2026
77e37f9
Update dependency net.sourceforge.pmd:pmd-core to v7.22.0 [SECURITY]
xdev-renovate Mar 2, 2026
961291c
Update dependency net.sourceforge.pmd:pmd-java to v7.22.0
xdev-renovate Mar 2, 2026
116c98b
Merge pull request #254 from xdev-software/renovate/com.puppycrawl.to…
AB-xdev Mar 2, 2026
1502f77
Merge pull request #252 from xdev-software/renovate/actions-upload-ar…
AB-xdev Mar 2, 2026
f3b4dc8
Merge pull request #251 from xdev-software/renovate/lycheeverse-lyche…
AB-xdev Mar 2, 2026
7c63532
Merge pull request #253 from xdev-software/renovate/net.sourceforge.pmd
AB-xdev Mar 2, 2026
4a8ede9
Merge pull request #255 from xdev-software/renovate/maven-net.sourcef…
AB-xdev Mar 2, 2026
a06462c
Merge pull request #12 from xdev-software/renovate/lycheeverse-lychee…
AB-xdev Mar 2, 2026
6f9b5b3
Create report-gha-workflow-security-problems.yml
AB-xdev Mar 2, 2026
1fa1c4e
Merge branch 'master' into update-from-template-xdev-software/base-te…
xdev-gh-bot Mar 2, 2026
b24ea85
Merge branch 'master' into update-from-template-xdev-software/java-te…
xdev-gh-bot Mar 2, 2026
42dc90b
Ignore cancelled builds
AB-xdev Mar 6, 2026
bb75d5e
Merge branch 'develop' into update-from-template-merged
xdev-gh-bot Mar 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@
<property name="format" value="^(?!(.*(Map|List|Set))$).+$"/>
<property name="tokens" value="PARAMETER_DEF, VARIABLE_DEF, PATTERN_VARIABLE_DEF, RECORD_COMPONENT_DEF, LAMBDA"/>
</module>
<!-- Name classes correctly and don't use generic name for everything -->
<module name="IllegalIdentifierName">
<property name="format" value="^(?!(.*(Helper|Util))$).+$"/>
<property name="tokens" value=" CLASS_DEF"/>
</module>
<module name="IllegalImport"/>
<module name="InterfaceIsType"/>
<module name="JavadocStyle">
Expand Down
32 changes: 31 additions & 1 deletion .config/pmd/java/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@
<rule ref="category/java/errorprone.xml/CollectionTypeMismatch"/>
<rule ref="category/java/errorprone.xml/ComparisonWithNaN"/>
<rule ref="category/java/errorprone.xml/DoNotCallGarbageCollectionExplicitly"/>
<rule ref="category/java/errorprone.xml/DontImportSun"/>
<rule ref="category/java/errorprone.xml/DontUseFloatTypeForLoopIndices"/>
<rule ref="category/java/errorprone.xml/EqualsNull"/>
<rule ref="category/java/errorprone.xml/IdempotentOperations"/>
Expand All @@ -164,6 +163,7 @@
<rule ref="category/java/errorprone.xml/SingletonClassReturningNewInstance"/>
<rule ref="category/java/errorprone.xml/UnconditionalIfStatement"/>
<rule ref="category/java/errorprone.xml/UnnecessaryCaseChange"/>
<rule ref="category/java/errorprone.xml/UnsupportedJdkApiUsage"/>
<rule ref="category/java/errorprone.xml/UselessPureMethodCall"/>


Expand Down Expand Up @@ -208,6 +208,36 @@
<rule ref="category/java/security.xml"/>


<rule name="AvoidOptionalGet"
language="java"
message="Avoid using Optional#get"
class="net.sourceforge.pmd.lang.rule.xpath.XPathRule"
externalInfoUrl="https://stackoverflow.com/a/49159955">
<description>
`Optional#get` can be interpreted as a getter by developers, however this is not the case as it throws an exception when empty.

It should be replaced by
* doing a mapping directly using `.map` or `.ifPresent`
* using the preferred `.orElseThrow`, `.orElse` or `.or` methods

Java Developer Brian Goetz also writes regarding this topic:

> Java 8 was a huge improvement to the platform, but one of the few mistakes we made was the naming of `Optional.get()`, because the name just invites people to call it without calling `isPresent()`, undermining the whole point of using `Optional` in the first place.
>
> During the Java 9 time frame, we proposed to deprecate `Optional.get()`, but the public response to that was ... let's say cold. As a smaller step, we introduced `orElseThrow()` in 10 (see [JDK-8140281](https://bugs.openjdk.java.net/browse/JDK-8140281)) as a more transparently named synonym for the current pernicious behavior of `get()`. IDEs warn on unconditional use of `get()`, but not on `orElseThrow()`, which is a step forward in teaching people to code better. The question is, in a sense, a "glass half empty" view of the current situation; `get()` is still problematic.
</description>
<priority>3</priority>
<properties>
<property name="xpath">
<value>
<![CDATA[
//MethodCall[pmd-java:matchesSig('java.util.Optional#get()')]
]]>
</value>
</property>
</properties>
</rule>

<rule name="AvoidStringBuilderOrBuffer"
language="java"
message="StringBuilder/StringBuffer should not be used"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/broken-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@a8c4c7cb88f0c7386610c35eb25108e448569cb0 # v2
uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2
with:
fail: false # Don't fail on broken links, create an issue instead

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/check-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
fi

- name: Upload demo files
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
with:
name: demo-files-java-${{ matrix.java }}
path: ${{ env.DEMO_MAVEN_MODULE }}/target/${{ env.DEMO_MAVEN_MODULE }}.jar
Expand Down Expand Up @@ -151,8 +151,8 @@ jobs:
run: ./mvnw -B pmd:aggregate-cpd pmd:cpd-check -P pmd -DskipTests -T2C

- name: Upload report
if: always()
uses: actions/upload-artifact@v6
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v7
with:
name: pmd-report
if-no-files-found: ignore
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/report-gha-workflow-security-problems.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Report workflow security problems

on:
workflow_dispatch:
push:
branches: [ develop ]
paths:
- '.github/workflows/**'

permissions:
issues: write

jobs:
prt:
runs-on: ubuntu-latest
timeout-minutes: 15
# Only run this in our repos (Prevent notification spam by forks)
if: ${{ github.repository_owner == 'xdev-software' }}
steps:
- uses: actions/checkout@v6

- name: Check
id: check
run: |
grep -l 'pull_request_target:' --exclude report-gha-workflow-security-problems.yml *.yml > reported.txt && exit 1 || exit 0
working-directory: .github/workflows

- name: Find already existing issue
id: find-issue
if: ${{ !cancelled() }}
run: |
echo "number=$(gh issue list -l 'bug' -l 'automated' -L 1 -S 'in:title "Incorrectly configure GHA workflow (prt)"' -s 'open' --json 'number' --jq '.[].number')" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ github.token }}

- name: Close issue if everything is fine
if: ${{ success() && steps.find-issue.outputs.number != '' }}
run: gh issue close -r 'not planned' ${{ steps.find-issue.outputs.number }}
env:
GH_TOKEN: ${{ github.token }}

- name: Create report
if: ${{ failure() && steps.check.conclusion == 'failure' }}
run: |
echo 'Detected usage of `pull_request_target`. This event is dangerous and MUST NOT BE USED AT ALL COST!' > reported.md
echo '' >> reported.md
echo '/cc @xdev-software/gha-workflow-security' >> reported.md
echo '' >> reported.md
echo '```' >> reported.md
cat .github/workflows/reported.txt >> reported.md
echo '```' >> reported.md
cat reported.md

- name: Create Issue From File
if: ${{ failure() && steps.check.conclusion == 'failure' }}
uses: peter-evans/create-issue-from-file@fca9117c27cdc29c6c4db3b86c48e4115a786710 # v6
with:
issue-number: ${{ steps.find-issue.outputs.number }}
title: 'Incorrectly configure GHA workflow (prt)'
content-filepath: ./reported.md
labels: bug, automated
6 changes: 3 additions & 3 deletions micro-migration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>13.1.0</version>
<version>13.3.0</version>
</dependency>
</dependencies>
<configuration>
Expand Down Expand Up @@ -286,12 +286,12 @@
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-core</artifactId>
<version>7.20.0</version>
<version>7.22.0</version>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-java</artifactId>
<version>7.20.0</version>
<version>7.22.0</version>
</dependency>
</dependencies>
</plugin>
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>13.1.0</version>
<version>13.3.0</version>
</dependency>
</dependencies>
<configuration>
Expand Down Expand Up @@ -83,12 +83,12 @@
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-core</artifactId>
<version>7.20.0</version>
<version>7.22.0</version>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-java</artifactId>
<version>7.20.0</version>
<version>7.22.0</version>
</dependency>
</dependencies>
</plugin>
Expand Down
Loading