Package org.checkerframework.javacutil
Class SystemUtil
java.lang.Object
org.checkerframework.javacutil.SystemUtil
This file contains basic utility functions.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.google.common.base.Splitter
A splitter that splits on colons.static final com.google.common.base.Splitter
A splitter that splits on commas.static final com.google.common.base.Splitter
A splitter that splits on periods.static final int
The major version number of the Java runtime (JRE), such as 8, 11, or 17.static final com.google.common.base.Splitter
A splitter that splits onFile.pathSeparator
. -
Method Summary
Modifier and TypeMethodDescriptiongetPathsProperty
(String propName) LikeSystem.getProperty
, but splits on the path separator and never returns null.Returns the release value passed to the compiler or null if release was not passed.Returns the pathname to the tools.jar file, or null if it does not exist.
-
Field Details
-
DOT_SPLITTER
public static final com.google.common.base.Splitter DOT_SPLITTERA splitter that splits on periods. The result contains no empty strings. -
COMMA_SPLITTER
public static final com.google.common.base.Splitter COMMA_SPLITTERA splitter that splits on commas. The result contains no empty strings. -
COLON_SPLITTER
public static final com.google.common.base.Splitter COLON_SPLITTERA splitter that splits on colons. The result contains no empty strings. -
PATH_SEPARATOR_SPLITTER
public static final com.google.common.base.Splitter PATH_SEPARATOR_SPLITTERA splitter that splits onFile.pathSeparator
. The result contains no empty strings. -
jreVersion
public static final int jreVersionThe major version number of the Java runtime (JRE), such as 8, 11, or 17.
-
-
Method Details
-
getPathsProperty
LikeSystem.getProperty
, but splits on the path separator and never returns null.- Parameters:
propName
- a system property name- Returns:
- the paths in the system property; may be an empty array
-
getReleaseValue
Returns the release value passed to the compiler or null if release was not passed.- Parameters:
env
- the ProcessingEnvironment- Returns:
- the release value or null if none was passed
-
getToolsJar
Returns the pathname to the tools.jar file, or null if it does not exist. Returns null on Java 9 and later.- Returns:
- the pathname to the tools.jar file, or null
-