Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ on:

jobs:
ci:
uses: killbill/gh-actions-shared/.github/workflows/ci.yml@main
uses: killbill/gh-actions-shared/.github/workflows/ci.yml@java21
with:
test-profile-matrix: '[ "travis", "mysql", "postgresql", "jdbi", "config-magic" ]'
2 changes: 1 addition & 1 deletion .github/workflows/cloudsmith_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
cloudsmith_release:
uses: killbill/gh-actions-shared/.github/workflows/cloudsmith_release.yml@main
uses: killbill/gh-actions-shared/.github/workflows/cloudsmith_release.yml@java21
with:
group_id: org.kill-bill.commons
secrets:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ on:

jobs:
analyze:
uses: killbill/gh-actions-shared/.github/workflows/codeql-analysis.yml@main
uses: killbill/gh-actions-shared/.github/workflows/codeql-analysis.yml@java21
2 changes: 1 addition & 1 deletion .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
snapshot:
uses: killbill/gh-actions-shared/.github/workflows/snapshot.yml@main
uses: killbill/gh-actions-shared/.github/workflows/snapshot.yml@java21
secrets:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
2 changes: 1 addition & 1 deletion .github/workflows/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ on:

jobs:
sync:
uses: killbill/gh-actions-shared/.github/workflows/sync.yml@main
uses: killbill/gh-actions-shared/.github/workflows/sync.yml@java21
secrets:
CREATE_PULL_REQUEST_SSH_KEY: ${{ secrets.CREATE_PULL_REQUEST_SSH_KEY }}
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
import java.io.ObjectInput;
import java.io.ObjectOutput;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlIDREF;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlIDREF;

import org.killbill.xmlloader.ValidationErrors;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
import java.io.ObjectInput;
import java.io.ObjectOutput;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlID;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlID;

import org.killbill.xmlloader.ValidationErrors;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
import java.io.ObjectInput;
import java.io.ObjectOutput;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlID;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlID;

import org.killbill.xmlloader.ValidationErrors;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
import java.util.NoSuchElementException;
import java.util.stream.Stream;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlID;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlElementWrapper;
import jakarta.xml.bind.annotation.XmlID;

import org.killbill.xmlloader.ValidationErrors;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
import java.util.NoSuchElementException;
import java.util.stream.Stream;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlElementWrapper;
import jakarta.xml.bind.annotation.XmlRootElement;

import org.killbill.xmlloader.ValidationErrors;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
import java.io.ObjectInput;
import java.io.ObjectOutput;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlIDREF;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlIDREF;

import org.killbill.xmlloader.ValidationErrors;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

import org.killbill.xmlloader.ValidatingConfig;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;

@XmlAccessorType(XmlAccessType.NONE)
public abstract class StateMachineValidatingConfig<Context> extends ValidatingConfig<Context> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
@Test(singleThreaded = true)
public class TestExecutors {

// JDK 21 changed Thread.toString() to include the numeric thread id and extra metadata.
// These tests only care that the executor thread name is present, not the JVM-specific prefix.
private static final String TEST_EXECUTOR_THREAD_PATTERN = "Thread\\[[^\\]]*TestLoggingExecutor-[^\\]]+\\]";

private void registerAppenders(final Logger loggingLogger, final Logger failsafeLogger, final WriterAppender dummyAppender) {
dummyAppender.setImmediateFlush(true);
loggingLogger.setLevel(Level.DEBUG);
Expand Down Expand Up @@ -103,8 +107,10 @@ public void run() {

final String actual = bos.toString();

assertPattern(actual, Pattern.compile("ERROR - Thread\\[TestLoggingExecutor-[^\\]]+\\] ended abnormally with an exception\r?\njava.lang.RuntimeException: Fail!\r?\n"));
assertPattern(actual, Pattern.compile("DEBUG - Thread\\[TestLoggingExecutor-[^\\]]+\\] finished executing$"));
// Match the log severity/message/exception content while tolerating both pre-JDK-21 and
// JDK-21+ thread string formats.
assertPattern(actual, exceptionLogPattern("ERROR", "ended abnormally with an exception", "java.lang.RuntimeException: Fail!"));
assertPattern(actual, finishedExecutingPattern());
}

private void errorTest(final ExecutorService executorService) throws Exception {
Expand All @@ -124,8 +130,10 @@ public void run() {

final String actual = bos.toString();

assertPattern(actual, Pattern.compile("ERROR - Thread\\[TestLoggingExecutor-[^\\]]+\\] ended abnormally with an exception\r?\njava.lang.OutOfMemoryError: Poof!\r?\n"));
assertPattern(actual, Pattern.compile("DEBUG - Thread\\[TestLoggingExecutor-[^\\]]+\\] finished executing$"));
// Keep this assertion focused on the wrapped error logging rather than the exact
// Thread.toString() rendering chosen by the current JDK.
assertPattern(actual, exceptionLogPattern("ERROR", "ended abnormally with an exception", "java.lang.OutOfMemoryError: Poof!"));
assertPattern(actual, finishedExecutingPattern());
}

private void callableTest(final ExecutorService executorService) throws Exception {
Expand Down Expand Up @@ -168,9 +176,11 @@ public Void call() throws Exception {

final String actual = bos.toString();

assertPattern(actual, Pattern.compile("DEBUG - Thread\\[TestLoggingExecutor-[^\\]]+\\] ended with an exception\r?\njava.lang.Exception: Oops!\r?\n"));
assertPattern(actual, Pattern.compile("ERROR - Thread\\[TestLoggingExecutor-[^\\]]+\\] ended with an exception\r?\njava.lang.OutOfMemoryError: Uh oh!\r?\n"));
assertPattern(actual, Pattern.compile("DEBUG - Thread\\[TestLoggingExecutor-[^\\]]+\\] finished executing$"));
// Callable logging uses DEBUG for checked exceptions and ERROR for Errors; the helper keeps
// that semantic assertion stable across JDK thread formatting changes.
assertPattern(actual, exceptionLogPattern("DEBUG", "ended with an exception", "java.lang.Exception: Oops!"));
assertPattern(actual, exceptionLogPattern("ERROR", "ended with an exception", "java.lang.OutOfMemoryError: Uh oh!"));
assertPattern(actual, finishedExecutingPattern());
}

private void scheduledTest(final ScheduledExecutorService executorService) throws Exception {
Expand Down Expand Up @@ -239,12 +249,26 @@ public void run() {

final String actual = bos.toString();

assertPattern(actual, Pattern.compile("ERROR - Thread\\[TestLoggingExecutor-[^\\]]+\\] ended abnormally with an exception\r?\njava.lang.RuntimeException: D'oh!\r?\n"));
assertPattern(actual, Pattern.compile("ERROR - Thread\\[TestLoggingExecutor-[^\\]]+\\] ended abnormally with an exception\r?\njava.lang.OutOfMemoryError: Zoinks!\r?\n"));
assertPattern(actual, Pattern.compile("ERROR - Thread\\[TestLoggingExecutor-[^\\]]+\\] ended abnormally with an exception\r?\njava.lang.RuntimeException: Eep!\r?\n"));
assertPattern(actual, Pattern.compile("ERROR - Thread\\[TestLoggingExecutor-[^\\]]+\\] ended abnormally with an exception\r?\njava.lang.OutOfMemoryError: Zounds!\r?\n"));
assertPattern(actual, Pattern.compile("ERROR - Thread\\[TestLoggingExecutor-[^\\]]+\\] ended abnormally with an exception\r?\njava.lang.RuntimeException: Egad!\r?\n"));
assertPattern(actual, Pattern.compile("DEBUG - Thread\\[TestLoggingExecutor-[^\\]]+\\] finished executing$"));
// Scheduled executors emit several wrapped failures; use the shared helper so each
// assertion still verifies the exact throwable/message without depending on thread ids.
assertPattern(actual, exceptionLogPattern("ERROR", "ended abnormally with an exception", "java.lang.RuntimeException: D'oh!"));
assertPattern(actual, exceptionLogPattern("ERROR", "ended abnormally with an exception", "java.lang.OutOfMemoryError: Zoinks!"));
assertPattern(actual, exceptionLogPattern("ERROR", "ended abnormally with an exception", "java.lang.RuntimeException: Eep!"));
assertPattern(actual, exceptionLogPattern("ERROR", "ended abnormally with an exception", "java.lang.OutOfMemoryError: Zounds!"));
assertPattern(actual, exceptionLogPattern("ERROR", "ended abnormally with an exception", "java.lang.RuntimeException: Egad!"));
assertPattern(actual, finishedExecutingPattern());
}

// Build the regex from the stable log semantics and allow either legacy or JDK 21+ thread
// renderings; \R keeps the assertion platform-neutral for line endings too.
private Pattern exceptionLogPattern(final String level, final String message, final String throwable) {
return Pattern.compile(Pattern.quote(level + " - ") + TEST_EXECUTOR_THREAD_PATTERN + Pattern.quote(" " + message) + "\\R" + Pattern.quote(throwable) + "\\R");
}

// Same rationale as exceptionLogPattern: verify the message, but ignore JVM-specific thread
// formatting details that changed in Java 21.
private Pattern finishedExecutingPattern() {
return Pattern.compile(Pattern.quote("DEBUG - ") + TEST_EXECUTOR_THREAD_PATTERN + Pattern.quote(" finished executing") + "$");
}

private void assertPattern(final String actual, final Pattern expected) {
Expand Down
2 changes: 1 addition & 1 deletion config-magic/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<!-- Don't run JUnit tests -->
<groups />
<groups/>
</configuration>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class DataAmount {
public final class DataAmount {

private static final Pattern SPLIT = Pattern.compile("^(\\d+)\\s*([a-zA-Z]+)$");
private static final Pattern NUM_ONLY = Pattern.compile("^(\\d+)$");
Expand Down
2 changes: 1 addition & 1 deletion config-magic/src/main/java/org/skife/config/TimeSpan.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class TimeSpan {
public final class TimeSpan {

private static final Pattern SPLIT = Pattern.compile("^(\\d+)\\s?(\\w+)$");
private static final HashMap<String, TimeUnit> UNITS = new HashMap<String, TimeUnit>();
Expand Down
4 changes: 2 additions & 2 deletions jdbi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
</exclusions>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<groupId>jakarta.inject</groupId>
<artifactId>jakarta.inject-api</artifactId>
</dependency>
<dependency>
<groupId>joda-time</groupId>
Expand Down
26 changes: 26 additions & 0 deletions jdbi/spotbugs-exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,30 @@
<Bug pattern="DM_STRING_CTOR" />
</Match>

<Match>
<!--
Vendored jDBI helper types eagerly validate mapper, template, and SQL-object metadata in
their constructors and intentionally fail fast when that reflective/configuration setup is
invalid. SpotBugs reports these as CT_CONSTRUCTOR_THROW on Java 21, but changing the
constructor behavior would be invasive framework work across the forked jDBI surface.
-->
<Class name="~(org\.killbill\.commons\.jdbi\.ReusableStringTemplate3StatementLocator|org\.killbill\.commons\.jdbi\.mapper\.LowerToCamelBeanMapper|org\.skife\.jdbi\.v2\.BeanMapper|org\.skife\.jdbi\.v2\.BeanPropertyArguments|org\.skife\.jdbi\.v2\.BuiltInArgumentFactory\\$P|org\.skife\.jdbi\.v2\.Cleanables|org\.skife\.jdbi\.v2\.DBI|org\.skife\.jdbi\.v2\.GeneratedKeys|org\.skife\.jdbi\.v2\.InferredMapperFactory|org\.skife\.jdbi\.v2\.ReflectionBeanMapper|org\.skife\.jdbi\.v2\.ResultSetResultIterator|org\.skife\.jdbi\.v2\.sqlobject\.BatchHandler|org\.skife\.jdbi\.v2\.sqlobject\.CallHandler|org\.skife\.jdbi\.v2\.sqlobject\.CustomizingStatementHandler|org\.skife\.jdbi\.v2\.sqlobject\.ResultReturnThing\\$SingleValueResultReturnThing|org\.skife\.jdbi\.v2\.sqlobject\.UpdateHandler|org\.skife\.jdbi\.v2\.sqlobject\.customizers\.RegisterContainerMapper\\$MyCustomizer|org\.skife\.jdbi\.v2\.sqlobject\.stringtemplate\.StringTemplate3StatementLocator)" />
<Bug pattern="CT_CONSTRUCTOR_THROW" />
</Match>

<Match>
<Class name="org.skife.jdbi.v2.BuiltInArgumentFactory$P" />
<Bug pattern="CT_CONSTRUCTOR_THROW" />
</Match>

<Match>
<Class name="org.skife.jdbi.v2.sqlobject.ResultReturnThing$SingleValueResultReturnThing" />
<Bug pattern="CT_CONSTRUCTOR_THROW" />
</Match>

<Match>
<Class name="org.skife.jdbi.v2.sqlobject.customizers.RegisterContainerMapper$MyCustomizer" />
<Bug pattern="CT_CONSTRUCTOR_THROW" />
</Match>

</FindBugsFilter>
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
import java.util.Set;

import javax.annotation.Nullable;
import javax.inject.Inject;
import javax.inject.Provider;
import jakarta.inject.Inject;
import jakarta.inject.Provider;
import javax.sql.DataSource;

import org.killbill.commons.jdbi.argument.DateTimeArgumentFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
import java.util.concurrent.TimeUnit;

import javax.annotation.Nullable;
import javax.inject.Inject;
import javax.inject.Provider;
import jakarta.inject.Inject;
import jakarta.inject.Provider;
import javax.sql.DataSource;

import org.killbill.commons.embeddeddb.EmbeddedDB;
Expand Down
Loading
Loading