Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
0460e6d
Merge pull request #250 from xdev-software/master
AB-xdev Jan 28, 2026
0f3f209
Update dependency com.puppycrawl.tools:checkstyle to v13.1.0
xdev-renovate Feb 1, 2026
b782259
Update dependency org.apache.maven.plugins:maven-compiler-plugin to v…
xdev-renovate Feb 2, 2026
a9bb760
Merge pull request #247 from xdev-software/renovate/com.puppycrawl.to…
AB-xdev Feb 2, 2026
11f5359
Merge pull request #248 from xdev-software/renovate/org.apache.maven.…
AB-xdev Feb 2, 2026
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
435f8cb
Merge branch 'develop' into update-from-template-merged
xdev-gh-bot Feb 9, 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
84c6691
Merge branch 'develop' into update-from-template-merged
xdev-gh-bot Feb 16, 2026
12129e7
Update dependency org.junit.jupiter:junit-jupiter to v6.0.3
xdev-renovate Feb 16, 2026
06b437b
Update org.seleniumhq.selenium to v4.41.0
xdev-renovate Feb 20, 2026
76cf223
Disallow classes ending with Helper or Util
AB-xdev Feb 20, 2026
d08b9e3
Update dependency org.apache.maven.plugins:maven-surefire-plugin to v…
xdev-renovate Feb 22, 2026
838f350
Avoid using Optional#get
AB-xdev Feb 23, 2026
498103c
Report browsername when not found
AB-xdev Feb 24, 2026
78e4b73
Merge pull request #254 from xdev-software/renovate/org.junit.jupiter…
AB-xdev Feb 24, 2026
8f534e3
Merge pull request #255 from xdev-software/renovate/org.seleniumhq.se…
AB-xdev Feb 24, 2026
4914d86
Merge pull request #256 from xdev-software/renovate/org.apache.maven.…
AB-xdev Feb 24, 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
1bd10de
Merge branch 'develop' into update-from-template-merged
xdev-gh-bot Feb 24, 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
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.0.0</version>
<version>13.2.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.21.0</version>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-java</artifactId>
<version>7.20.0</version>
<version>7.21.0</version>
</dependency>
</dependencies>
</plugin>
Expand Down
4 changes: 2 additions & 2 deletions testcontainers-selenium-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-dependencies-bom</artifactId>
<version>4.40.0</version>
<version>4.41.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -108,7 +108,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.14.1</version>
<version>3.15.0</version>
<configuration>
<release>${maven.compiler.release}</release>
<compilerArgs>
Expand Down
22 changes: 11 additions & 11 deletions testcontainers-selenium/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-api</artifactId>
<version>4.40.0</version>
<version>4.41.0</version>
<scope>provided</scope>
</dependency>

<!-- Tests -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>6.0.2</version>
<version>6.0.3</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -90,7 +90,7 @@
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-remote-driver</artifactId>
<version>4.40.0</version>
<version>4.41.0</version>
<scope>test</scope>
<exclusions>
<!-- Tracing is not needed -->
Expand All @@ -108,13 +108,13 @@
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-support</artifactId>
<version>4.40.0</version>
<version>4.41.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-firefox-driver</artifactId>
<version>4.40.0</version>
<version>4.41.0</version>
<scope>test</scope>
<exclusions>
<!-- No unused, beta-grade, RUST blobs -->
Expand All @@ -127,7 +127,7 @@
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-chrome-driver</artifactId>
<version>4.40.0</version>
<version>4.41.0</version>
<scope>test</scope>
<exclusions>
<!-- No unused, beta-grade, RUST blobs -->
Expand Down Expand Up @@ -187,7 +187,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.14.1</version>
<version>3.15.0</version>
<configuration>
<release>${maven.compiler.release}</release>
<compilerArgs>
Expand Down Expand Up @@ -231,7 +231,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.4</version>
<version>3.5.5</version>
<configuration>
<skipTests>${skipTests}</skipTests>
</configuration>
Expand Down Expand Up @@ -320,7 +320,7 @@
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>13.0.0</version>
<version>13.2.0</version>
</dependency>
</dependencies>
<configuration>
Expand Down Expand Up @@ -358,12 +358,12 @@
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-core</artifactId>
<version>7.20.0</version>
<version>7.21.0</version>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-java</artifactId>
<version>7.20.0</version>
<version>7.21.0</version>
</dependency>
</dependencies>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,14 @@ protected static DockerImageName getStandardImageForCapabilities(
final String seleniumVersion,
final Map<String, DockerImageName> browserDockerImages)
{
return Optional.ofNullable(browserDockerImages.get(Optional.ofNullable(capabilities)
.map(Capabilities::getBrowserName)
.orElse(BrowserType.CHROME)))
final String browserName = Optional.ofNullable(capabilities)
.map(Capabilities::getBrowserName)
.orElse(BrowserType.CHROME);
return Optional.ofNullable(browserDockerImages.get(browserName))
.map(image -> image.withTag(seleniumVersion))
.orElseThrow(() -> new UnsupportedOperationException(
"Unsupported Browser name; Supported: " + String.join(", ", BROWSER_DOCKER_IMAGES.keySet())
"Unsupported Browser name " + browserName + "; "
+ "Supported: " + String.join(", ", BROWSER_DOCKER_IMAGES.keySet())
));
}

Expand Down