Package org.checkerframework.javacutil
Class SystemUtil
java.lang.Object
org.checkerframework.javacutil.SystemUtil
This file contains basic utility functions.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.google.common.base.SplitterA splitter that splits on colons.static final com.google.common.base.SplitterA splitter that splits on commas.static final com.google.common.base.SplitterA splitter that splits on periods.static final intThe major version number of the Java runtime (JRE), such as 17, 21, or 25.static final com.google.common.base.SplitterA splitter that splits onFile.pathSeparator. -
Method Summary
Modifier and TypeMethodDescriptionavailable(InputStream is) CallsInputStream.available(), but returns null instead of throwing an IOException.getPathsProperty(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
-
dotSplitter
public static final com.google.common.base.Splitter dotSplitterA splitter that splits on periods. The result contains no empty strings. -
commaSplitter
public static final com.google.common.base.Splitter commaSplitterA splitter that splits on commas. The result contains no empty strings. -
colonSplitter
public static final com.google.common.base.Splitter colonSplitterA splitter that splits on colons. The result contains no empty strings. -
pathSeparatorSplitter
public static final com.google.common.base.Splitter pathSeparatorSplitterA 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 17, 21, or 25.
-
-
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; might be an empty list
-
available
CallsInputStream.available(), but returns null instead of throwing an IOException.- Parameters:
is- an input stream- Returns:
is.available(), or null if that throws an exception
-
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
-