Skip to content

Commit 0d0681c

Browse files
committed
Move package-provate constant to satisfy Java 8
1 parent 2034a52 commit 0d0681c

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/main/java/org/apache/commons/lang3/JavaVersion.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
*/
1717
package org.apache.commons.lang3;
1818

19-
import java.util.regex.Pattern;
20-
2119
import org.apache.commons.lang3.math.NumberUtils;
2220

2321
/**
@@ -199,11 +197,6 @@ public enum JavaVersion {
199197
*/
200198
JAVA_RECENT(maxVersion(), Float.toString(maxVersion()));
201199

202-
/**
203-
* The regex to split version pattern.
204-
*/
205-
private static final Pattern VERSION_SPLIT_PATTERN = Pattern.compile("\\.");
206-
207200
/**
208201
* Transforms the given string with a Java version number to the
209202
* corresponding constant of this enumeration class. This method is used
@@ -307,7 +300,7 @@ private static float maxVersion() {
307300
}
308301

309302
static String[] split(final String value) {
310-
return VERSION_SPLIT_PATTERN.split(value);
303+
return RegExUtils.VERSION_SPLIT_PATTERN.split(value);
311304
}
312305

313306
/**

src/main/java/org/apache/commons/lang3/RegExUtils.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@
2828
*/
2929
public class RegExUtils {
3030

31+
/**
32+
* The pattern to split version strings.
33+
*/
34+
static final Pattern VERSION_SPLIT_PATTERN = Pattern.compile("\\.");
35+
3136
/**
3237
* Compiles the given regular expression into a pattern with the {@link Pattern#DOTALL} flag.
3338
*

0 commit comments

Comments
 (0)