Skip to content

Conversation

@GuusLieben
Copy link
Member

@GuusLieben GuusLieben commented Dec 20, 2025

Type of Change

  • Chore (changes to the build process or auxiliary tools)

Description

With the release of Java 25, which is the latest LTS release at the time of writing, Hartshorn will drop Java 21 as its main JDK target. As such, this PR migrates our tooling to Java 25, and fixes minor issues with compact source files (related to constructorless classes in unnamed packages).

A known limitation of compact source files is the fact that they do not reside within a named package. As such, we cannot perform automatic package scanning unless explicitly declared. The main class itself will always be included, including any bindings it declares.

A valid compact source file may look like the sample below, which is adapted from the Java Launchpad sample starter:

import ...;

void main(String[] args) {
    HartshornApplication.createApplication(args).initialize(configuration -> {
        configuration.scanPackages(packages -> {
            packages.add("org.dockbox.sample.java");
        });
    });
}

@Singleton
public ApplicationStarter applicationStarter() {
    return applicationContext -> {
        GreetingAction greetingAction = applicationContext.get(GreetingAction.class);
        greetingAction.greet();
    };
}

Checklist

  • I have performed a self-review of my own code
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have rebased my branch on top of the latest develop branch

@GuusLieben GuusLieben added this to the 0.7.0 milestone Dec 20, 2025
@GuusLieben GuusLieben self-assigned this Dec 20, 2025
@GuusLieben GuusLieben force-pushed the chore/java-25-lts-update branch from 0477875 to f385f13 Compare December 20, 2025 18:30
@GuusLieben GuusLieben force-pushed the chore/java-25-lts-update branch from 82da5ce to 1b38a5e Compare December 23, 2025 17:56
Since JUnit 6 all Autocloseable values in the extension context are
automatically closed, so we don't need to manually close anymore
@GuusLieben GuusLieben force-pushed the chore/java-25-lts-update branch 2 times, most recently from 003b633 to 93e3431 Compare December 24, 2025 10:47
@GuusLieben GuusLieben force-pushed the chore/java-25-lts-update branch from 93e3431 to 9fae88e Compare December 24, 2025 10:51
.map(ServiceLoader.Provider::get)
.collect(Collectors.toSet());
Iterator<T> it = serviceLoader.iterator();
while (true) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #1153

@GuusLieben GuusLieben merged commit 6b873f3 into develop/0.7.0 Dec 24, 2025
9 checks passed
@GuusLieben GuusLieben deleted the chore/java-25-lts-update branch December 24, 2025 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants