Skip to content

Commit 585e02d

Browse files
authored
Bump minimal Java version to 11 (#90)
* initial refactoring * update doc * cleanups * simplify CF config * fix errors when building javadoc jars * remove IOUtil#copy * further cleanups * typo
1 parent 407dc29 commit 585e02d

File tree

35 files changed

+89
-141
lines changed

35 files changed

+89
-141
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

77
[Full changelog](https://github.com/LearnLib/automatalib/compare/automatalib-0.12.1...HEAD)
88

9+
### Changed
10+
11+
* AutomataLib now requires Java 11 at runtime.
12+
13+
### Removed
14+
15+
* `IOUtil#copy(Reader, Writer)` has been removed. Use `Reader#transferTo(Writer)` instead.
16+
917

1018
## [0.12.1] - 2025-03-11
1119

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 but still supports Java 8 at runtime.
34+
Note that AutomataLib requires Java 11 (or newer) to build and run.
3535

3636
#### Building development versions
3737

adapters/brics/pom.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,18 @@ limitations under the License.
9292
</excludes>
9393
</configuration>
9494
</plugin>
95+
<plugin>
96+
<groupId>org.apache.maven.plugins</groupId>
97+
<artifactId>maven-javadoc-plugin</artifactId>
98+
<configuration>
99+
<!-- The plugin doesn't like dependencies with missing module names so build with JPMS disabled -->
100+
<legacyMode>true</legacyMode>
101+
<disableSourcepathUsage>true</disableSourcepathUsage>
102+
<sourceFileExcludes>
103+
<sourceFileExclude>**\/module-info.java</sourceFileExclude>
104+
</sourceFileExcludes>
105+
</configuration>
106+
</plugin>
95107
</plugins>
96108
</build>
97109
</project>

api/src/main/java/net/automatalib/automaton/vpa/SEVPAGraphView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public L getTarget(SevpaViewEdge<L, I> edge) {
8888

8989
@Override
9090
public VisualizationHelper<L, SevpaViewEdge<L, I>> getVisualizationHelper() {
91-
return new DefaultVisualizationHelper<L, SevpaViewEdge<L, I>>() {
91+
return new DefaultVisualizationHelper<>() {
9292

9393
@Override
9494
protected Collection<L> initialNodes() {

api/src/main/java/net/automatalib/graph/ads/RecursiveADSNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ default N getTarget(N edge) {
132132

133133
@Override
134134
default VisualizationHelper<N, N> getVisualizationHelper() {
135-
return new VisualizationHelper<N, N>() {
135+
return new VisualizationHelper<>() {
136136

137137
@Override
138138
public boolean getNodeProperties(N node, Map<String, String> properties) {

build-parent/pom.xml

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -233,17 +233,10 @@ limitations under the License.
233233
<goal>compile</goal>
234234
</goals>
235235
<configuration>
236-
<release>11</release>
237236
<failOnWarning>true</failOnWarning>
238237
<fork>true</fork>
239-
<!--
240-
Setting a different output directly can fail the build when using other annotation
241-
processors as well. However, with using the same output directory, we pack Java 11
242-
code in the jars which will fail other analysis tools. Currently, checkerframework
243-
cannot be run with our other analysis steps...
244-
-->
245-
<!--outputDirectory>${project.build.directory}/checkerframework</outputDirectory-->
246-
<annotationProcessorPaths>
238+
<outputDirectory>${project.build.directory}/checkerframework</outputDirectory>
239+
<annotationProcessorPaths combine.children="append">
247240
<path>
248241
<groupId>org.checkerframework</groupId>
249242
<artifactId>checker</artifactId>
@@ -252,6 +245,8 @@ limitations under the License.
252245
</annotationProcessorPaths>
253246
<annotationProcessors>
254247
<annotationProcessor>org.checkerframework.checker.nullness.NullnessChecker</annotationProcessor>
248+
<!-- by having to explicitly list the CF checkers, we also need to list otherwise automatically picked-up processors -->
249+
<annotationProcessor>de.learnlib.tooling.processor.edsl.EDSLProcessor</annotationProcessor>
255250
</annotationProcessors>
256251
<compilerArgs>
257252
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
@@ -284,14 +279,8 @@ limitations under the License.
284279
<configuration>
285280
<failOnWarning>true</failOnWarning>
286281
<fork>true</fork>
287-
<!--
288-
Setting a different output directly can fail the build when using other annotation
289-
processors as well. However, with using the same output directory, we pack Java 11
290-
code in the jars which will fail other analysis tools. Currently, checkerframework
291-
cannot be run with our other analysis steps...
292-
-->
293-
<!--outputDirectory>${project.build.directory}/checkerframework</outputDirectory-->
294-
<annotationProcessorPaths>
282+
<outputDirectory>${project.build.directory}/checkerframework</outputDirectory>
283+
<annotationProcessorPaths combine.children="append">
295284
<path>
296285
<groupId>org.checkerframework</groupId>
297286
<artifactId>checker</artifactId>

commons/util/src/main/java/net/automatalib/common/util/IOUtil.java

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -301,25 +301,6 @@ private static boolean isBufferedOutputStream(OutputStream os) {
301301
return os instanceof BufferedOutputStream || os instanceof ByteArrayOutputStream;
302302
}
303303

304-
/**
305-
* Copies the contents of the given reader into the given writer.
306-
*
307-
* @param in
308-
* the reader to read data from
309-
* @param out
310-
* the writer to write data to
311-
*
312-
* @throws IOException
313-
* if reading from or writing to the respective reader / writer throws this exception
314-
*/
315-
public static void copy(Reader in, Writer out) throws IOException {
316-
final char[] buf = new char[DEFAULT_BUFFER_SIZE];
317-
int read;
318-
while ((read = in.read(buf)) >= 0) {
319-
out.write(buf, 0, read);
320-
}
321-
}
322-
323304
/**
324305
* Reads the data from the given reader and returns its contents as a string.
325306
*
@@ -333,7 +314,7 @@ public static void copy(Reader in, Writer out) throws IOException {
333314
*/
334315
public static String toString(Reader r) throws IOException {
335316
final StringWriter w = new StringWriter();
336-
copy(r, w);
317+
r.transferTo(w);
337318
return w.toString();
338319
}
339320
}

commons/util/src/main/java/net/automatalib/common/util/collection/IteratorUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ public static <T> Set<T> set(Iterator<T> iterator, int expectedSize) {
224224
* @return the iterator
225225
*/
226226
public static <T> Iterator<T> singleton(T element) {
227-
return new Iterator<T>() {
227+
return new Iterator<>() {
228228

229229
private boolean hasNext = true;
230230

commons/util/src/main/java/net/automatalib/common/util/nid/DynamicList.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public void clear() {
140140

141141
@Override
142142
public Iterator<T> iterator() {
143-
return new Iterator<T>() {
143+
return new Iterator<>() {
144144

145145
int index;
146146

commons/util/src/main/java/net/automatalib/common/util/process/ProcessUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ private static void writeProcessInput(Process process, @Nullable Reader input) t
285285
if (input != null) {
286286
try (OutputStream processInput = process.getOutputStream();
287287
Writer writer = IOUtil.asBufferedUTF8Writer(processInput)) {
288-
IOUtil.copy(input, writer);
288+
input.transferTo(writer);
289289
}
290290
}
291291
}

0 commit comments

Comments
 (0)