Commit a5a3a020 authored by Dmytro Nosan's avatar Dmytro Nosan Committed by Stephane Nicoll

Add Java 14 to JavaVersion enumeration

See gh-19511
parent 47481464
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
package org.springframework.boot.system; package org.springframework.boot.system;
import java.lang.invoke.MethodHandles;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
...@@ -60,7 +61,11 @@ public enum JavaVersion { ...@@ -60,7 +61,11 @@ public enum JavaVersion {
/** /**
* Java 13. * Java 13.
*/ */
THIRTEEN("13", String.class, "stripIndent"); THIRTEEN("13", String.class, "stripIndent"),
/**
* Java 14.
*/
FOURTEEN("14", MethodHandles.Lookup.class, "hasFullPrivilegeAccess");
private final String name; private final String name;
......
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -115,4 +115,10 @@ class JavaVersionTests { ...@@ -115,4 +115,10 @@ class JavaVersionTests {
assertThat(JavaVersion.getJavaVersion()).isEqualTo(JavaVersion.THIRTEEN); assertThat(JavaVersion.getJavaVersion()).isEqualTo(JavaVersion.THIRTEEN);
} }
@Test
@EnabledOnJre(JRE.JAVA_14)
void currentJavaVersionFourteen() {
assertThat(JavaVersion.getJavaVersion()).isEqualTo(JavaVersion.FOURTEEN);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment