Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
c2b6939a
Commit
c2b6939a
authored
Jul 19, 2019
by
dreis2211
Committed by
Stephane Nicoll
Jul 22, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cover more known Java versions in JavaVersion
See gh-17590
parent
74f0e42c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
6 deletions
+27
-6
JavaVersion.java
...ain/java/org/springframework/boot/system/JavaVersion.java
+27
-6
No files found.
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/system/JavaVersion.java
View file @
c2b6939a
/*
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
9
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.
...
@@ -19,11 +19,12 @@ package org.springframework.boot.system;
...
@@ -19,11 +19,12 @@ package org.springframework.boot.system;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Optional
;
import
org.springframework.util.ClassUtils
;
import
org.springframework.util.ClassUtils
;
/**
/**
*
Supported
Java versions.
*
Known
Java versions.
*
*
* @author Oliver Gierke
* @author Oliver Gierke
* @author Phillip Webb
* @author Phillip Webb
...
@@ -34,20 +35,40 @@ public enum JavaVersion {
...
@@ -34,20 +35,40 @@ public enum JavaVersion {
/**
/**
* Java 1.8.
* Java 1.8.
*/
*/
EIGHT
(
"1.8"
,
"java.util.function.Function
"
),
EIGHT
(
"1.8"
,
Optional
.
class
,
"empty
"
),
/**
/**
* Java 1.9.
* Java 1.9.
*/
*/
NINE
(
"1.9"
,
"java.security.cert.URICertStoreParameters"
);
NINE
(
"1.9"
,
Optional
.
class
,
"stream"
),
/**
* Java 10.
*/
TEN
(
"10"
,
Optional
.
class
,
"orElseThrow"
),
/**
* Java 11.
*/
ELEVEN
(
"11"
,
String
.
class
,
"strip"
),
/**
* Java 12.
*/
TWELVE
(
"12"
,
String
.
class
,
"describeConstable"
),
/**
* Java 13.
*/
THIRTEEN
(
"13"
,
String
.
class
,
"stripIndent"
);
private
final
String
name
;
private
final
String
name
;
private
final
boolean
available
;
private
final
boolean
available
;
JavaVersion
(
String
name
,
String
class
Name
)
{
JavaVersion
(
String
name
,
Class
<?>
clazz
,
String
method
Name
)
{
this
.
name
=
name
;
this
.
name
=
name
;
this
.
available
=
ClassUtils
.
isPresent
(
className
,
getClass
().
getClassLoader
()
);
this
.
available
=
ClassUtils
.
hasMethod
(
clazz
,
methodName
);
}
}
@Override
@Override
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment