Skip to content

Commit 8567e46

Browse files
committed
Specify JDK version. (#341)
Reverting Java 11 changes (3d8d0e5).
1 parent fa000d3 commit 8567e46

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

build.gradle

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ subprojects {
3939
'equalsverifier': '3.8.2',
4040
'guava': '29.0-jre',
4141
'jackson': '2.13.3',
42+
'jdk': '8',
4243
'jena': '3.17.0',
4344
'jetty': '9.4.14.v20181114',
4445
'jquery': '3.3.1-1',
@@ -66,9 +67,6 @@ subprojects {
6667

6768
check.dependsOn(javadoc)
6869

69-
sourceCompatibility = '1.8'
70-
targetCompatibility = '1.8'
71-
7270
repositories {
7371
mavenCentral()
7472
maven githubPackage.invoke("metafacture")
@@ -86,6 +84,18 @@ subprojects {
8684
toolVersion '8.44'
8785
}
8886

87+
java {
88+
toolchain {
89+
languageVersion = JavaLanguageVersion.of(versions.jdk)
90+
}
91+
}
92+
93+
tasks.withType(JavaExec) {
94+
javaLauncher = javaToolchains.launcherFor {
95+
languageVersion = java.toolchain.languageVersion
96+
}
97+
}
98+
8999
tasks.withType(JavaCompile) {
90100
'all -processing -rawtypes -serial'.split().each {
91101
options.compilerArgs << "-Xlint:${it}"

metafix/src/test/java/org/metafacture/metafix/MetafixMethodTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2310,7 +2310,7 @@ public void copyFieldToSubfieldOfArrayOfObjectsWithExplicitAppend() {
23102310

23112311
@Test
23122312
public void copyFieldToSubfieldOfArrayOfStringsWithIndexImplicitAppend() {
2313-
MetafixTestHelpers.assertProcessException(IndexOutOfBoundsException.class, "Index 0 out of bounds for length 0", () ->
2313+
MetafixTestHelpers.assertProcessException(IndexOutOfBoundsException.class, "Index: 0, Size: 0", () ->
23142314
MetafixTestHelpers.assertFix(streamReceiver, Arrays.asList(
23152315
"set_array('test[]')",
23162316
"copy_field('key', 'test[].1')"
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
^Exception in thread "main" org\.metafacture\.metafix\.FixProcessException: Error while executing Fix expression \(at .*/metafix/src/test/resources/org/metafacture/metafix/integration/record/fromJson/toJson/copy_fieldToArrayOfStringsWithIndex/test\.fix, line 2\): copy_field\("key", "test\[\]\.1"\)$
2-
^Caused by: java\.lang\.IndexOutOfBoundsException: Index 0 out of bounds for length 0$
2+
^Caused by: java\.lang\.IndexOutOfBoundsException: Index: 0, Size: 0$

settings.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
plugins {
2+
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0'
3+
}
4+
15
include 'metafix'
26
include 'metafix-ide'
37
include 'metafix-runner'

0 commit comments

Comments
 (0)