Skip to content

Commit d43669b

Browse files
authored
Bump Java Version to 17/25 (#155)
* 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 * partially utilize Java 17 features the benefit of records has not yet been looked at * cleanups
1 parent 7c236fe commit d43669b

File tree

75 files changed

+239
-262
lines changed

Some content is hidden

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

75 files changed

+239
-262
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
@@ -56,7 +56,7 @@ jobs:
5656
needs: [ tests-and-analysis ]
5757
strategy:
5858
matrix:
59-
jdk: [ 11, 17, 21 ]
59+
jdk: [ 17, 21, 25 ]
6060
os: [ ubuntu-latest, windows-latest, macOS-latest ]
6161
runs-on: ${{ matrix.os }}
6262
steps:
@@ -99,7 +99,7 @@ jobs:
9999
uses: actions/setup-java@v3
100100
with:
101101
distribution: 'zulu'
102-
java-version: 11
102+
java-version: 17
103103
- name: Set up cache
104104
uses: actions/cache@v3
105105
with:
@@ -150,7 +150,7 @@ jobs:
150150
uses: actions/setup-java@v3
151151
with:
152152
distribution: 'zulu'
153-
java-version: 11
153+
java-version: 17
154154
- name: Set up cache
155155
uses: actions/cache@v3
156156
with:

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1212

1313
### Changed
1414

15-
* LearnLib now requires Java 11 at runtime.
15+
* LearnLib now requires Java 17 at runtime.
1616
* The `generateTestWords` method of `AbstractTestWordEQOracle` now needs to be public.
1717

1818
### Fixed

README.md

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

4343
For simply using LearnLib you may use the Maven artifacts which are available in the [Maven Central repository][maven-central].
4444
It is also possible to download a bundled [distribution artifact][maven-central-distr] if you want to use LearnLib without Maven support.
45-
Note that LearnLib requires Java 11 (or newer) to build but still supports Java 8 at runtime.
45+
Note that LearnLib requires Java 17 (or newer) to build and run.
4646

4747
#### Building development versions
4848

algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/abstraction/AbstractAbstractionTree.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,7 @@ public Collection<CI> getRepresentativeSymbols() {
132132

133133
@Override
134134
public Collection<Node> getOutgoingEdges(Node node) {
135-
if (node instanceof InnerNode) {
136-
final InnerNode<?, ?> n = (InnerNode<?, ?>) node;
135+
if (node instanceof InnerNode<?, ?> n) {
137136
return Arrays.asList(n.equalsNext, n.otherNext);
138137
}
139138

@@ -155,8 +154,7 @@ public Collection<Node> getNodes() {
155154

156155
while (!nodes.isEmpty()) {
157156
final Node n = nodes.poll();
158-
if (n instanceof InnerNode) {
159-
final InnerNode<?, ?> in = (InnerNode<?, ?>) n;
157+
if (n instanceof InnerNode<?, ?> in) {
160158
result.add(in);
161159
nodes.add(in.equalsNext);
162160
nodes.add(in.otherNext);
@@ -177,11 +175,9 @@ public VisualizationHelper<Node, Node> getVisualizationHelper() {
177175
public boolean getNodeProperties(Node node, Map<String, String> properties) {
178176
super.getNodeProperties(node, properties);
179177

180-
if (node instanceof InnerNode) {
181-
final InnerNode<?, ?> n = (InnerNode<?, ?>) node;
178+
if (node instanceof InnerNode<?, ?> n) {
182179
properties.put(NodeAttrs.LABEL, n.prefix + ", " + n.suffix);
183-
} else if (node instanceof Leaf) {
184-
final Leaf<?, ?> l = (Leaf<?, ?>) node;
180+
} else if (node instanceof Leaf<?, ?> l) {
185181
properties.put(NodeAttrs.LABEL, String.format("Abs.: '%s'%nRep.: '%s'", l.abs, l.rep));
186182
}
187183

@@ -192,8 +188,7 @@ public boolean getNodeProperties(Node node, Map<String, String> properties) {
192188
public boolean getEdgeProperties(Node src, Node edge, Node tgt, Map<String, String> properties) {
193189
super.getEdgeProperties(src, edge, tgt, properties);
194190

195-
if (src instanceof InnerNode) {
196-
final InnerNode<?, ?> n = (InnerNode<?, ?>) src;
191+
if (src instanceof InnerNode<?, ?> n) {
197192
if (n.equalsNext == tgt) {
198193
properties.put(EdgeAttrs.LABEL, "== " + n.out);
199194
} else {

algorithms/active/aaar/src/main/java/de/learnlib/algorithm/aaar/abstraction/Node.java

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

1818
import net.automatalib.word.Word;
1919

20-
class Node {
20+
public class Node {
2121

2222
static class InnerNode<CI, D> extends Node {
2323

algorithms/active/aaar/src/test/java/de/learnlib/algorithm/aaar/explicit/ModuloInitialAbstraction.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,11 @@ public String getAbstractSymbol(CI c) {
4040

4141
@Override
4242
public CI getRepresentative(String a) {
43-
switch (a) {
44-
case "even":
45-
return alphabet.getSymbol(0);
46-
case "odd":
47-
return alphabet.getSymbol(1);
48-
default:
49-
throw new IllegalArgumentException("Unknown symbol: " + a);
50-
}
43+
return switch (a) {
44+
case "even" -> alphabet.getSymbol(0);
45+
case "odd" -> alphabet.getSymbol(1);
46+
default -> throw new IllegalArgumentException("Unknown symbol: " + a);
47+
};
5148
}
5249

5350
@Override

algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/api/ADTExtender.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* Interface for configuration objects that specify how to finalize the temporary splitter given by regular
2525
* counterexample decomposition.
2626
*/
27+
@FunctionalInterface
2728
public interface ADTExtender {
2829

2930
/**

algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/api/LeafSplitter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
* Interface for configuration objects that specify how to split the ADT leaf of a hypothesis state that needs
2323
* refinement.
2424
*/
25+
@FunctionalInterface
2526
public interface LeafSplitter {
2627

2728
/**

algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/api/SubtreeReplacer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
/**
2626
* Interface for configuration objects that specify how nodes of the current ADT should be replaced.
2727
*/
28+
@FunctionalInterface
2829
public interface SubtreeReplacer {
2930

3031
/**

algorithms/active/adt/src/main/java/de/learnlib/algorithm/adt/config/model/ADSCalculator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import net.automatalib.alphabet.Alphabet;
2323
import net.automatalib.automaton.transducer.MealyMachine;
2424

25+
@FunctionalInterface
2526
public interface ADSCalculator {
2627

2728
<S, I, O> Optional<ADTNode<S, I, O>> compute(MealyMachine<S, I, ?, O> hypothesis,

0 commit comments

Comments
 (0)