Skip to content

Update to Java21 #1411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Aug 7, 2025
Merged
Show file tree
Hide file tree
Changes from 8 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 @@ -34,7 +34,7 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
java-version: 21

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ plugins {

ext {
//version (changing these should be considered thoroughly!)
javaVersion = JavaVersion.VERSION_17
javaVersion = JavaVersion.VERSION_21
groovyVersion = "4.0"
groovyBinaryVersion = "4.0.28"

Expand Down
2 changes: 1 addition & 1 deletion docs/readthedocs/gettingstarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ If you feel, something is missing, please contact us!

## Requirements

Java > v 17
Java > v 21

## Where to get

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
public class SqlIdCoordinateFactory extends IdCoordinateFactory {
private static final String COORDINATE_ID = "id";
private static final String COORDINATE = "coordinate";
private final WKBReader reader = new WKBReader();

@Override
protected IdCoordinateInput buildModel(SimpleFactoryData data) {
try {
int coordinateId = data.getInt(COORDINATE_ID);
byte[] byteArr = WKBReader.hexToBytes(data.getField(COORDINATE));
WKBReader reader = new WKBReader();

Coordinate coordinate = reader.read(byteArr).getCoordinate();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,18 +172,6 @@ public void createDirs(boolean withOptionals) throws IOException {
}
}

/**
* Gives the {@link #baseDirectory}).
*
* @return An Option to the base directory as a string
* @deprecated Use {@link edu.ie3.datamodel.io.connectors.CsvFileConnector} instead
*/
@Deprecated(since = "3.0", forRemoval = true)
@Override
public Optional<Path> getBaseDirectory() {
return Optional.of(this.baseDirectory);
}

/**
* Gives the correct sub directory (w.r.t. {@link #baseDirectory}) for the provided class.
*
Expand Down
9 changes: 0 additions & 9 deletions src/main/java/edu/ie3/datamodel/io/naming/FileHierarchy.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,4 @@ public interface FileHierarchy {
* @return An Option to the regarding sub directory as a string
*/
Optional<Path> getSubDirectory(Class<? extends Entity> cls);

/**
* Determines the base directory.
*
* @return An option to the base directory
* @deprecated Use {@link edu.ie3.datamodel.io.connectors.CsvFileConnector} instead
*/
@Deprecated(since = "3.0", forRemoval = true)
Optional<Path> getBaseDirectory();
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,4 @@ public class FlatDirectoryHierarchy implements FileHierarchy {
public Optional<Path> getSubDirectory(Class<? extends Entity> cls) {
return Optional.empty();
}

/**
* Gives the baseDirectory, which is Empty.
*
* @return An Option to the base directory as a string
* @deprecated Use {@link edu.ie3.datamodel.io.connectors.CsvFileConnector} instead
*/
@Deprecated(since = "3.0", forRemoval = true)
@Override
public Optional<Path> getBaseDirectory() {
return Optional.empty();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
package edu.ie3.datamodel.io.naming

import edu.ie3.datamodel.exceptions.FileException
import edu.ie3.datamodel.io.connectors.CsvFileConnector
import edu.ie3.datamodel.io.naming.DefaultDirectoryHierarchy
import edu.ie3.util.io.FileIOUtils
import org.apache.commons.io.FilenameUtils
Expand Down Expand Up @@ -39,13 +40,14 @@ class DefaultDirectoryHierarchyTest extends Specification {
given:
def gridName = "test_grid"
def basePath = basePathString(gridName)
def connector = new CsvFileConnector(basePath)

when:
def dfh = new DefaultDirectoryHierarchy(tmpDirectory, gridName)

then:
try {
dfh.baseDirectory.get() == basePath
connector.baseDirectory == basePath
dfh.subDirectories.size() == 9
dfh.subDirectories.get(basePath.resolve(Path.of("input", "grid"))) == true
dfh.subDirectories.get(basePath.resolve(Path.of("input", "participants"))) == true
Expand Down