Skip to content

Commit e250cce

Browse files
committed
Merge pull request #19511 from nosan
* pr/19511: Polish "Add Java 14 to JavaVersion enumeration" Add Java 14 to JavaVersion enumeration Closes gh-19511
2 parents 4748146 + fc60301 commit e250cce

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/system/JavaVersion.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@
1616

1717
package org.springframework.boot.system;
1818

19+
import java.lang.invoke.MethodHandles;
1920
import java.util.Arrays;
2021
import java.util.Collections;
2122
import java.util.List;
@@ -60,7 +61,12 @@ public enum JavaVersion {
6061
/**
6162
* Java 13.
6263
*/
63-
THIRTEEN("13", String.class, "stripIndent");
64+
THIRTEEN("13", String.class, "stripIndent"),
65+
66+
/**
67+
* Java 14.
68+
*/
69+
FOURTEEN("14", MethodHandles.Lookup.class, "hasFullPrivilegeAccess");
6470

6571
private final String name;
6672

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/system/JavaVersionTests.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -115,4 +115,10 @@ void currentJavaVersionThirteen() {
115115
assertThat(JavaVersion.getJavaVersion()).isEqualTo(JavaVersion.THIRTEEN);
116116
}
117117

118+
@Test
119+
@EnabledOnJre(JRE.JAVA_14)
120+
void currentJavaVersionFourteen() {
121+
assertThat(JavaVersion.getJavaVersion()).isEqualTo(JavaVersion.FOURTEEN);
122+
}
123+
118124
}

0 commit comments

Comments
 (0)