Skip to content

Commit f534932

Browse files
authored
Bump Java Version to 17/25 (LearnLib#97)
* initial refactorings for Java 25 compatibility spotbugs + pmd-plugin still need new releases that work on Java 25 * update CI config * JDK builds pass updates to the analysis plugins required some adjustments * utilize Java 17 features * fix documentation * cleanups * fix visibility issues * potential fix for breaking GUI tests * example: fix GUI tests * cleanups * jung: do not run GUI tests for now * Revert "jung: do not run GUI tests for now" This reverts commit 6a66454. * jung: found workaround for crashing JVM * jacoco: correctly track coverage in GUI tests * Revert "jung: found workaround for crashing JVM" This reverts commit d997040. * Reapply "jung: do not run GUI tests for now" This reverts commit 176cece. * jung: add note
1 parent 0248299 commit f534932

File tree

125 files changed

+436
-705
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+436
-705
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
name: "Tests and Analysis (JDK: ${{ matrix.jdk }})"
1313
strategy:
1414
matrix:
15-
jdk: [ 11, 17, 21 ]
15+
jdk: [ 17, 21, 25 ]
1616
runs-on: ubuntu-latest
1717
steps:
1818
- name: Checkout
@@ -45,7 +45,7 @@ jobs:
4545
needs: [ tests-and-analysis ]
4646
strategy:
4747
matrix:
48-
jdk: [ 11, 17, 21 ]
48+
jdk: [ 17, 21, 25 ]
4949
os: [ ubuntu-latest, windows-latest, macos-13, macos-latest ]
5050
runs-on: ${{ matrix.os }}
5151
steps:
@@ -77,7 +77,7 @@ jobs:
7777
uses: actions/setup-java@v4
7878
with:
7979
distribution: 'zulu'
80-
java-version: 11
80+
java-version: 17
8181
- name: Set up cache
8282
uses: actions/cache@v4
8383
with:
@@ -117,7 +117,7 @@ jobs:
117117
uses: actions/setup-java@v4
118118
with:
119119
distribution: 'zulu'
120-
java-version: 11
120+
java-version: 17
121121
- name: Set up cache
122122
uses: actions/cache@v4
123123
with:

CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,26 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1313

1414
### Changed
1515

16-
* AutomataLib now requires Java 11 at runtime.
16+
* AutomataLib now requires Java 17 at runtime.
17+
* The following classes have been refactored to `record`s:
18+
* `BricsTransitionProperty`
19+
* `TransitionEdge{,.Property}`
20+
* `ProbabilisticOutput`
21+
* `LTSminVersion`
22+
* The following class hierarchies have been made `sealed`:
23+
* `CommonAttrs`
24+
* `CommonStyles`
1725
* `ProcessUtil#invokeProcess` now handles consumers for stdout and stderr separately.
1826

1927
### Removed
2028

2129
* `IOUtil#copy(Reader, Writer)` has been removed. Use `Reader#transferTo(Writer)` instead.
2230
* `JVMUtil` has been removed. Use `Runtime.version().feature()` for its previously (only) provided method.
2331

32+
### Fixed
33+
34+
* `SPAConverter.ConversionResult` is now publicly accessible.
35+
2436

2537
## [0.12.1] - 2025-03-11
2638

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Contributions -- whether it is in the form of new features, better documentation
3131

3232
For simply using AutomataLib you may use the Maven artifacts which are available in the [Maven Central repository][maven-central].
3333
It is also possible to download a bundled [distribution artifact][maven-central-distr] if you want to use AutomataLib without Maven support.
34-
Note that AutomataLib requires Java 11 (or newer) to build and run.
34+
Note that AutomataLib requires Java 17 (or newer) to build and run.
3535

3636
#### Building development versions
3737

adapters/brics/src/main/java/net/automatalib/brics/BricsTransitionProperty.java

Lines changed: 6 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,16 @@
1616
package net.automatalib.brics;
1717

1818
import dk.brics.automaton.Transition;
19-
import org.checkerframework.checker.nullness.qual.Nullable;
2019

2120
/**
2221
* The properties of an edge in a Brics automaton.
22+
*
23+
* @param min
24+
* lower bound of the character range.
25+
* @param max
26+
* upper bound of the character range.
2327
*/
24-
public class BricsTransitionProperty {
25-
26-
private final char min;
27-
private final char max;
28+
public record BricsTransitionProperty(char min, char max) {
2829

2930
/**
3031
* Constructor. Constructs the property from a Brics {@link Transition}.
@@ -36,41 +37,6 @@ public BricsTransitionProperty(Transition trans) {
3637
this(trans.getMin(), trans.getMax());
3738
}
3839

39-
/**
40-
* Constructor.
41-
*
42-
* @param min
43-
* lower bound of the character range.
44-
* @param max
45-
* upper bound of the character range.
46-
*/
47-
public BricsTransitionProperty(char min, char max) {
48-
this.min = min;
49-
this.max = max;
50-
}
51-
52-
/**
53-
* Retrieves the lower bound of the character range.
54-
*
55-
* @return the lower bound of the character range
56-
*
57-
* @see Transition#getMin()
58-
*/
59-
public char getMin() {
60-
return min;
61-
}
62-
63-
/**
64-
* Retrieves the upper bound of the character range.
65-
*
66-
* @return the upper bound of the character range
67-
*
68-
* @see Transition#getMax()
69-
*/
70-
public char getMax() {
71-
return max;
72-
}
73-
7440
@Override
7541
public String toString() {
7642
return toString(min, max);
@@ -84,25 +50,4 @@ public static String toString(char min, char max) {
8450
}
8551
return sb.toString();
8652
}
87-
88-
@Override
89-
public final boolean equals(@Nullable Object o) {
90-
if (this == o) {
91-
return true;
92-
}
93-
if (!(o instanceof BricsTransitionProperty)) {
94-
return false;
95-
}
96-
97-
final BricsTransitionProperty that = (BricsTransitionProperty) o;
98-
return min == that.min && max == that.max;
99-
}
100-
101-
@Override
102-
public final int hashCode() {
103-
int result = 1;
104-
result = 31 * result + Character.hashCode(min);
105-
result = 31 * result + Character.hashCode(max);
106-
return result;
107-
}
10853
}

api/src/main/java/net/automatalib/alphabet/Alphabet.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ default boolean containsSymbol(I symbol) {
125125
* if {@code this} alphabet does not implement {@link GrowingAlphabet}
126126
*/
127127
default GrowingAlphabet<I> asGrowingAlphabetOrThrowException() {
128-
if (this instanceof GrowingAlphabet) {
129-
return (GrowingAlphabet<I>) this;
128+
if (this instanceof GrowingAlphabet<I> result) {
129+
return result;
130130
} else {
131131
throw new GrowingAlphabetNotSupportedException(this);
132132
}

api/src/main/java/net/automatalib/alphabet/SupportsGrowingAlphabet.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* @param <I>
2424
* input alphabet type
2525
*/
26+
@FunctionalInterface
2627
public interface SupportsGrowingAlphabet<I> {
2728

2829
/**

api/src/main/java/net/automatalib/automaton/concept/FiniteRepresentation.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* {@link SimpleAutomaton}). For example, push-down systems can have infinitely many states but may be representable
2424
* with a finite amount of locations.
2525
*/
26+
@FunctionalInterface
2627
public interface FiniteRepresentation {
2728

2829
/**

api/src/main/java/net/automatalib/automaton/concept/InputAlphabetHolder.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import net.automatalib.alphabet.Alphabet;
1919

20+
@FunctionalInterface
2021
public interface InputAlphabetHolder<I> {
2122

2223
Alphabet<I> getInputAlphabet();

api/src/main/java/net/automatalib/automaton/concept/Output.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,16 @@
2828
* @param <D>
2929
* output domain type
3030
*/
31+
@FunctionalInterface
3132
public interface Output<I, D> {
3233

3334
D computeOutput(Iterable<? extends I> input);
3435

3536
static <T> WordBuilder<T> getBuilderFor(Iterable<?> iterable) {
36-
if (iterable instanceof Word) {
37-
return new WordBuilder<>(((Word<?>) iterable).length());
38-
} else if (iterable instanceof Collection) {
39-
return new WordBuilder<>(((Collection<?>) iterable).size());
37+
if (iterable instanceof Word<?> w) {
38+
return new WordBuilder<>(w.length());
39+
} else if (iterable instanceof Collection<?> c) {
40+
return new WordBuilder<>(c.size());
4041
} else {
4142
return new WordBuilder<>();
4243
}

api/src/main/java/net/automatalib/automaton/concept/Probabilistic.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
package net.automatalib.automaton.concept;
1717

18+
@FunctionalInterface
1819
public interface Probabilistic<T> {
1920

2021
float getTransitionProbability(T transition);

0 commit comments

Comments
 (0)