Skip to content

Commit 70b75c6

Browse files
authored
Merge pull request #527 from xdev-software/develop
Release
2 parents 3086b70 + 61c10b1 commit 70b75c6

File tree

14 files changed

+111
-39
lines changed

14 files changed

+111
-39
lines changed

.config/checkstyle/checkstyle.xml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
<module name="TreeWalker">
5353
<!-- Checks - sorted alphabetically -->
5454
<module name="ArrayTypeStyle"/>
55+
<module name="AvoidDoubleBraceInitialization"/>
5556
<module name="AvoidStarImport"/>
5657
<module name="ConstantName"/>
5758
<module name="DefaultComesLast"/>
@@ -68,6 +69,11 @@
6869
<module name="FinalParameters"/>
6970
<module name="GenericWhitespace"/>
7071
<module name="HideUtilityClassConstructor"/>
72+
<module name="IllegalCatch">
73+
<!-- https://docs.pmd-code.org/pmd-doc-7.11.0/pmd_rules_java_errorprone.html#avoidcatchingnpe -->
74+
<!-- https://docs.pmd-code.org/pmd-doc-7.11.0/pmd_rules_java_errorprone.html#avoidcatchingthrowable -->
75+
<property name="illegalClassNames" value="Error,Throwable,NullPointerException,java.lang.Error,java.lang.Throwable,java.lang.NullPointerException"/>
76+
</module>
7177
<module name="IllegalImport"/>
7278
<module name="InterfaceIsType"/>
7379
<module name="JavadocStyle">
@@ -93,7 +99,6 @@
9399
<module name="MethodParamPad"/>
94100
<module name="MissingDeprecated"/>
95101
<module name="MissingOverride"/>
96-
<module name="MissingSwitchDefault"/>
97102
<module name="ModifierOrder"/>
98103
<module name="NeedBraces"/>
99104
<module name="NoClone"/>
@@ -122,7 +127,13 @@
122127
</module>
123128
<module name="TypecastParenPad"/>
124129
<module name="TypeName"/>
130+
<module name="UnnecessaryParentheses"/>
131+
<module name="UnnecessarySemicolonAfterOuterTypeDeclaration"/>
132+
<module name="UnnecessarySemicolonAfterTypeMemberDeclaration"/>
133+
<module name="UnnecessarySemicolonInEnumeration"/>
134+
<module name="UnnecessarySemicolonInTryWithResources"/>
125135
<module name="UnusedImports"/>
136+
<module name="UnusedLocalVariable"/>
126137
<module name="UpperEll"/>
127138
<module name="VisibilityModifier">
128139
<property name="packageAllowed" value="true"/>

.config/pmd/ruleset.xml

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,38 @@
1010

1111
<!-- Only rules that don't overlap with CheckStyle! -->
1212

13+
<rule ref="category/java/bestpractices.xml/AvoidPrintStackTrace"/>
14+
<rule ref="category/java/bestpractices.xml/AvoidStringBufferField"/>
1315
<rule ref="category/java/bestpractices.xml/AvoidUsingHardCodedIP"/>
16+
<rule ref="category/java/bestpractices.xml/ConstantsInInterface"/>
17+
<rule ref="category/java/bestpractices.xml/ExhaustiveSwitchHasDefault"/>
18+
<rule ref="category/java/bestpractices.xml/LiteralsFirstInComparisons"/>
19+
<!-- CheckStyle can't handle this switch behavior -> delegated to PMD -->
20+
<rule ref="category/java/bestpractices.xml/NonExhaustiveSwitch"/>
21+
<rule ref="category/java/bestpractices.xml/OneDeclarationPerLine">
22+
<properties>
23+
<property name="strictMode" value="true"/>
24+
</properties>
25+
</rule>
1426
<rule ref="category/java/bestpractices.xml/PreserveStackTrace"/>
27+
<rule ref="category/java/bestpractices.xml/SimplifiableTestAssertion"/>
28+
<rule ref="category/java/bestpractices.xml/SystemPrintln"/>
29+
<rule ref="category/java/bestpractices.xml/UnusedAssignment"/>
30+
<rule ref="category/java/bestpractices.xml/UnusedFormalParameter"/>
31+
<rule ref="category/java/bestpractices.xml/UnusedPrivateField"/>
32+
<rule ref="category/java/bestpractices.xml/UnusedPrivateMethod"/>
1533
<rule ref="category/java/bestpractices.xml/UseCollectionIsEmpty"/>
34+
<rule ref="category/java/bestpractices.xml/UseEnumCollections"/>
1635
<rule ref="category/java/bestpractices.xml/UseStandardCharsets"/>
36+
<rule ref="category/java/bestpractices.xml/UseTryWithResources"/>
1737

1838
<!-- Native code is platform dependent; Loading external native libs might pose a security threat -->
1939
<rule ref="category/java/codestyle.xml/AvoidUsingNativeCode"/>
2040
<rule ref="category/java/codestyle.xml/IdenticalCatchBranches"/>
41+
<rule ref="category/java/codestyle.xml/LambdaCanBeMethodReference"/>
2142
<rule ref="category/java/codestyle.xml/NoPackage"/>
2243
<rule ref="category/java/codestyle.xml/PrematureDeclaration"/>
44+
<rule ref="category/java/codestyle.xml/UnnecessarySemicolon"/>
2345

2446
<rule ref="category/java/design.xml">
2547
<!-- Sometimes abstract classes have just fields -->
@@ -76,9 +98,6 @@
7698

7799
<!-- Limit too low -->
78100
<exclude name="UseObjectForClearerAPI"/>
79-
80-
<!-- Handled by checkstyle -->
81-
<exclude name="UseUtilityClass"/>
82101
</rule>
83102

84103
<rule ref="category/java/design.xml/AvoidDeeplyNestedIfStmts">
@@ -114,17 +133,33 @@
114133
</properties>
115134
</rule>
116135

136+
<rule ref="category/java/errorprone.xml/AssignmentToNonFinalStatic"/>
137+
<rule ref="category/java/errorprone.xml/AvoidDecimalLiteralsInBigDecimalConstructor"/>
138+
<rule ref="category/java/errorprone.xml/AvoidMultipleUnaryOperators"/>
117139
<rule ref="category/java/errorprone.xml/AvoidUsingOctalValues"/>
118140
<rule ref="category/java/errorprone.xml/BrokenNullCheck"/>
119141
<rule ref="category/java/errorprone.xml/ComparisonWithNaN"/>
120142
<rule ref="category/java/errorprone.xml/DoNotCallGarbageCollectionExplicitly"/>
121143
<rule ref="category/java/errorprone.xml/DontImportSun"/>
144+
<rule ref="category/java/errorprone.xml/DontUseFloatTypeForLoopIndices"/>
145+
<rule ref="category/java/errorprone.xml/EqualsNull"/>
146+
<rule ref="category/java/errorprone.xml/IdempotentOperations"/>
147+
<rule ref="category/java/errorprone.xml/ImplicitSwitchFallThrough"/>
148+
<rule ref="category/java/errorprone.xml/InstantiationToGetClass"/>
149+
<rule ref="category/java/errorprone.xml/InvalidLogMessageFormat"/>
150+
<rule ref="category/java/errorprone.xml/JumbledIncrementer"/>
122151
<rule ref="category/java/errorprone.xml/MisplacedNullCheck"/>
152+
<rule ref="category/java/errorprone.xml/MoreThanOneLogger"/>
153+
<rule ref="category/java/errorprone.xml/NonStaticInitializer"/>
154+
<rule ref="category/java/errorprone.xml/ReturnFromFinallyBlock"/>
155+
<rule ref="category/java/errorprone.xml/SingletonClassReturningNewInstance"/>
156+
<rule ref="category/java/errorprone.xml/UnconditionalIfStatement"/>
123157
<rule ref="category/java/errorprone.xml/UnnecessaryCaseChange"/>
158+
<rule ref="category/java/errorprone.xml/UselessOperationOnImmutable"/>
124159

125160

126161
<rule ref="category/java/multithreading.xml">
127-
<!-- Just bloats code -->
162+
<!-- Just bloats code; improved in JEP-491/Java 24+ -->
128163
<exclude name="AvoidSynchronizedAtMethodLevel"/>
129164

130165
<!-- NOPE -->
@@ -159,4 +194,25 @@
159194
</rule>
160195

161196
<rule ref="category/java/security.xml"/>
197+
198+
<rule name="VaadinNativeHTMLUnsafe"
199+
language="java"
200+
message="Unescaped native HTML is unsafe and will result in XSS vulnerabilities"
201+
class="net.sourceforge.pmd.lang.rule.xpath.XPathRule" >
202+
<description>
203+
Do not used native HTML! Use Vaadin layouts and components to create required structure.
204+
If you are 100% sure that you escaped the value properly and you have no better options you can suppress this.
205+
</description>
206+
<priority>2</priority>
207+
<properties>
208+
<property name="xpath">
209+
<value>
210+
<![CDATA[
211+
//ConstructorCall[pmd-java:typeIs('com.vaadin.flow.component.Html')] |
212+
//MethodCall[@MethodName='setAttribute' and //ImportDeclaration[starts-with(@PackageName,'com.vaadin')]]/ArgumentList/StringLiteral[1][contains(lower-case(@Image),'html')]
213+
]]>
214+
</value>
215+
</property>
216+
</properties>
217+
</rule>
162218
</ruleset>

.github/workflows/broken-links.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
- name: Link Checker
2121
id: lychee
22-
uses: lycheeverse/lychee-action@v2
22+
uses: lycheeverse/lychee-action@1d97d84f0bc547f7b25f4c2170d87d810dc2fb2c # v2
2323
with:
2424
fail: false # Don't fail on broken links, create an issue instead
2525

@@ -38,7 +38,7 @@ jobs:
3838

3939
- name: Create Issue From File
4040
if: env.lychee_exit_code != 0
41-
uses: peter-evans/create-issue-from-file@v5
41+
uses: peter-evans/create-issue-from-file@e8ef132d6df98ed982188e460ebb3b5d4ef3a9cd # v5
4242
with:
4343
issue-number: ${{ steps.find-issue.outputs.number }}
4444
title: Link Checker Report

.github/workflows/check-build.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,4 @@ jobs:
127127
name: pmd-report
128128
if-no-files-found: ignore
129129
path: |
130-
target/site/*.html
131-
target/site/css/**
132-
target/site/images/logos/maven-feather.png
133-
target/site/images/external.png
130+
target/reports/**

.github/workflows/release.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
cache: 'maven'
2727

2828
- name: Build with Maven
29-
run: ./mvnw -B clean package -Pproduction
29+
run: ./mvnw -B clean package -Pproduction -T2C
3030

3131
- name: Check for uncommited changes
3232
run: |
@@ -64,7 +64,7 @@ jobs:
6464
run: |
6565
mvnwPath=$(readlink -f ./mvnw)
6666
modules=("") # root
67-
modules+=($(grep -ozP '(?<=module>)[^<]+' 'pom.xml' | tr -d '\0'))
67+
modules+=($(grep -oP '(?<=<module>)[^<]+' 'pom.xml'))
6868
for i in "${modules[@]}"
6969
do
7070
echo "Processing $i/pom.xml"
@@ -89,7 +89,7 @@ jobs:
8989
9090
- name: Create Release
9191
id: create_release
92-
uses: shogo82148/actions-create-release@v1
92+
uses: shogo82148/actions-create-release@e5f206451d4ace2da9916d01f1aef279997f8659 # v1
9393
with:
9494
tag_name: v${{ steps.version.outputs.release }}
9595
release_name: v${{ steps.version.outputs.release }}
@@ -124,7 +124,7 @@ jobs:
124124
git config --global user.name "GitHub Actions"
125125
git pull
126126
127-
- name: Set up JDK Apache Maven Central
127+
- name: Set up JDK OSSRH
128128
uses: actions/setup-java@v4
129129
with: # running setup-java again overwrites the settings.xml
130130
java-version: '17'
@@ -135,7 +135,7 @@ jobs:
135135
gpg-passphrase: MAVEN_GPG_PASSPHRASE
136136
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
137137

138-
- name: Publish to Apache Maven Central
138+
- name: Publish to OSSRH
139139
run: ../mvnw -B deploy -Possrh -DskipTests
140140
env:
141141
MAVEN_CENTRAL_USERNAME: ${{ secrets.S01_OSS_SONATYPE_MAVEN_USERNAME }}
@@ -168,7 +168,7 @@ jobs:
168168
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
169169

170170
- name: Deploy to Github pages
171-
uses: peaceiris/actions-gh-pages@v4
171+
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4
172172
with:
173173
github_token: ${{ secrets.GITHUB_TOKEN }}
174174
publish_dir: ./${{ env.PRIMARY_MAVEN_MODULE }}/target/site
@@ -191,7 +191,7 @@ jobs:
191191
run: |
192192
mvnwPath=$(readlink -f ./mvnw)
193193
modules=("") # root
194-
modules+=($(grep -ozP '(?<=module>)[^<]+' 'pom.xml' | tr -d '\0'))
194+
modules+=($(grep -oP '(?<=<module>)[^<]+' 'pom.xml'))
195195
for i in "${modules[@]}"
196196
do
197197
echo "Processing $i/pom.xml"

.github/workflows/sync-labels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ jobs:
2020
with:
2121
sparse-checkout: .github/labels.yml
2222

23-
- uses: EndBug/label-sync@v2
23+
- uses: EndBug/label-sync@52074158190acb45f3077f9099fea818aa43f97a # v2
2424
with:
2525
config-file: .github/labels.yml

.github/workflows/update-from-template.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ jobs:
202202
GH_TOKEN: ${{ secrets.UPDATE_FROM_TEMPLATE_PAT }}
203203
run: |
204204
not_failed_conclusion="skipped|neutral|success"
205-
not_relevant_app_slug="dependabot|github-pages|sonarcloud"
205+
not_relevant_app_slug="dependabot|github-pages|sonarqubecloud"
206206
207207
echo "Waiting for checks to start..."
208208
sleep 40s
@@ -212,7 +212,7 @@ jobs:
212212
213213
echo "Checking if update-branch-merged exists"
214214
git fetch
215-
if [[ $(git rev-parse origin/${{ env.UPDATE_BRANCH_MERGED }}) ]]; then
215+
if [[ $(git ls-remote --heads origin refs/heads/${{ env.UPDATE_BRANCH_MERGED }}) ]]; then
216216
echo "Branch still exists; Continuing..."
217217
else
218218
echo "Branch origin/${{ env.UPDATE_BRANCH_MERGED }} is missing"

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 4.6.1
2+
* Updated dependencies
3+
14
## 4.6.0
25
* Changed all occurrences of ``Integer`` and ``Double`` to ``Number`` for improved compatibility with Leaflet's API
36
* Updated OpenStreetMap's Tile-Server address to ``tile.openstreetmap.org`` [openstreetmap/operations#737](https://github.com/openstreetmap/operations/issues/737)

pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
<licenses>
2828
<license>
29-
<name>Apache License, Version 2.0</name>
29+
<name>Apache-2.0</name>
3030
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
3131
<distribution>repo</distribution>
3232
</license>
@@ -45,7 +45,7 @@
4545
<dependency>
4646
<groupId>com.puppycrawl.tools</groupId>
4747
<artifactId>checkstyle</artifactId>
48-
<version>10.21.2</version>
48+
<version>10.23.0</version>
4949
</dependency>
5050
</dependencies>
5151
<configuration>
@@ -82,12 +82,12 @@
8282
<dependency>
8383
<groupId>net.sourceforge.pmd</groupId>
8484
<artifactId>pmd-core</artifactId>
85-
<version>7.10.0</version>
85+
<version>7.12.0</version>
8686
</dependency>
8787
<dependency>
8888
<groupId>net.sourceforge.pmd</groupId>
8989
<artifactId>pmd-java</artifactId>
90-
<version>7.10.0</version>
90+
<version>7.12.0</version>
9191
</dependency>
9292
</dependencies>
9393
</plugin>

vaadin-maps-leaflet-flow-demo/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
<mainClass>software.xdev.vaadin.Application</mainClass>
3030

3131
<!-- Dependency-Versions -->
32-
<vaadin.version>24.6.5</vaadin.version>
32+
<vaadin.version>24.7.2</vaadin.version>
3333

34-
<org.springframework.boot.version>3.4.2</org.springframework.boot.version>
34+
<org.springframework.boot.version>3.4.4</org.springframework.boot.version>
3535
</properties>
3636

3737
<dependencyManagement>
@@ -126,7 +126,7 @@
126126
<plugin>
127127
<groupId>org.apache.maven.plugins</groupId>
128128
<artifactId>maven-compiler-plugin</artifactId>
129-
<version>3.13.0</version>
129+
<version>3.14.0</version>
130130
<configuration>
131131
<release>${maven.compiler.release}</release>
132132
<compilerArgs>

vaadin-maps-leaflet-flow-demo/src/main/java/software/xdev/vaadin/Application.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import com.vaadin.flow.spring.annotation.EnableVaadin;
1010

1111

12+
@SuppressWarnings({"checkstyle:HideUtilityClassConstructor", "PMD.UseUtilityClass"})
1213
@SpringBootApplication
1314
@EnableVaadin
1415
@Push

vaadin-maps-leaflet-flow-demo/src/main/java/software/xdev/vaadin/maps/leaflet/flow/demo/MultiLayerWithPyramidDemo.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ public class MultiLayerWithPyramidDemo extends HorizontalLayout
8484

8585
private LLayerGroup activeLayerGroup;
8686

87+
@SuppressWarnings("PMD.UnusedAssignment") // FP activeLayerGroup is used
8788
public MultiLayerWithPyramidDemo()
8889
{
8990
// Let the view use 100% of the site

vaadin-maps-leaflet-flow-demo/src/main/resources/application.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
vaadin:
22
allowed-packages: software/xdev,com/vaadin/flow
3+
devmode:
4+
usageStatistics:
5+
enabled: false
36

47
spring:
58
devtools:

0 commit comments

Comments
 (0)