Skip to content

Commit 321d72c

Browse files
Merge pull request #1411 from ie3-institute/df/#1408-java21
Update to Java21
2 parents 4b36a4b + ae52e7a commit 321d72c

File tree

8 files changed

+7
-38
lines changed

8 files changed

+7
-38
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
uses: actions/setup-java@v4
3535
with:
3636
distribution: 'temurin'
37-
java-version: 17
37+
java-version: 21
3838

3939
- name: Setup Gradle
4040
uses: gradle/actions/setup-gradle@v4

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ plugins {
1616

1717
ext {
1818
//version (changing these should be considered thoroughly!)
19-
javaVersion = JavaVersion.VERSION_17
19+
javaVersion = JavaVersion.VERSION_21
2020
groovyVersion = "4.0"
2121
groovyBinaryVersion = "4.0.28"
2222

docs/readthedocs/gettingstarted.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ If you feel, something is missing, please contact us!
55

66
## Requirements
77

8-
Java > v 17
8+
PowerSystemDataModel requires Java to be at least Version 21.
99

1010
## Where to get
1111

src/main/java/edu/ie3/datamodel/io/factory/timeseries/SqlIdCoordinateFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
public class SqlIdCoordinateFactory extends IdCoordinateFactory {
2121
private static final String COORDINATE_ID = "id";
2222
private static final String COORDINATE = "coordinate";
23-
private final WKBReader reader = new WKBReader();
2423

2524
@Override
2625
protected IdCoordinateInput buildModel(SimpleFactoryData data) {
2726
try {
2827
int coordinateId = data.getInt(COORDINATE_ID);
2928
byte[] byteArr = WKBReader.hexToBytes(data.getField(COORDINATE));
29+
WKBReader reader = new WKBReader();
3030

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

src/main/java/edu/ie3/datamodel/io/naming/DefaultDirectoryHierarchy.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -172,18 +172,6 @@ public void createDirs(boolean withOptionals) throws IOException {
172172
}
173173
}
174174

175-
/**
176-
* Gives the {@link #baseDirectory}).
177-
*
178-
* @return An Option to the base directory as a string
179-
* @deprecated Use {@link edu.ie3.datamodel.io.connectors.CsvFileConnector} instead
180-
*/
181-
@Deprecated(since = "3.0", forRemoval = true)
182-
@Override
183-
public Optional<Path> getBaseDirectory() {
184-
return Optional.of(this.baseDirectory);
185-
}
186-
187175
/**
188176
* Gives the correct sub directory (w.r.t. {@link #baseDirectory}) for the provided class.
189177
*

src/main/java/edu/ie3/datamodel/io/naming/FileHierarchy.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,4 @@ public interface FileHierarchy {
2323
* @return An Option to the regarding sub directory as a string
2424
*/
2525
Optional<Path> getSubDirectory(Class<? extends Entity> cls);
26-
27-
/**
28-
* Determines the base directory.
29-
*
30-
* @return An option to the base directory
31-
* @deprecated Use {@link edu.ie3.datamodel.io.connectors.CsvFileConnector} instead
32-
*/
33-
@Deprecated(since = "3.0", forRemoval = true)
34-
Optional<Path> getBaseDirectory();
3526
}

src/main/java/edu/ie3/datamodel/io/naming/FlatDirectoryHierarchy.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,4 @@ public class FlatDirectoryHierarchy implements FileHierarchy {
2222
public Optional<Path> getSubDirectory(Class<? extends Entity> cls) {
2323
return Optional.empty();
2424
}
25-
26-
/**
27-
* Gives the baseDirectory, which is Empty.
28-
*
29-
* @return An Option to the base directory as a string
30-
* @deprecated Use {@link edu.ie3.datamodel.io.connectors.CsvFileConnector} instead
31-
*/
32-
@Deprecated(since = "3.0", forRemoval = true)
33-
@Override
34-
public Optional<Path> getBaseDirectory() {
35-
return Optional.empty();
36-
}
3725
}

src/test/groovy/edu/ie3/datamodel/io/naming/DefaultDirectoryHierarchyTest.groovy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
package edu.ie3.datamodel.io.naming
77

88
import edu.ie3.datamodel.exceptions.FileException
9+
import edu.ie3.datamodel.io.connectors.CsvFileConnector
910
import edu.ie3.datamodel.io.naming.DefaultDirectoryHierarchy
1011
import edu.ie3.util.io.FileIOUtils
1112
import org.apache.commons.io.FilenameUtils
@@ -39,13 +40,14 @@ class DefaultDirectoryHierarchyTest extends Specification {
3940
given:
4041
def gridName = "test_grid"
4142
def basePath = basePathString(gridName)
43+
def connector = new CsvFileConnector(basePath)
4244

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

4648
then:
4749
try {
48-
dfh.baseDirectory.get() == basePath
50+
connector.baseDirectory == basePath
4951
dfh.subDirectories.size() == 9
5052
dfh.subDirectories.get(basePath.resolve(Path.of("input", "grid"))) == true
5153
dfh.subDirectories.get(basePath.resolve(Path.of("input", "participants"))) == true

0 commit comments

Comments
 (0)