Package org.apache.calcite.util
Class Unsafe
java.lang.Object
org.apache.calcite.util.Unsafe
Contains methods that call JDK methods that the
forbidden
APIs checker does not approve of.
This class is excluded from the check, so methods called via this class will not fail the build.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidclear(StringWriter sw) Clears the contents of aStringWriter.static voidCallsObject.notifyAll().static StringregexpReplace(String s, Pattern pattern, String replacement, int pos, int occurrence) Helper for the SQLREGEXP_REPLACEfunction.static voidsystemExit(int status) CallsSystem.exit(int).static voidCallsObject.wait().
-
Method Details
-
systemExit
public static void systemExit(int status) CallsSystem.exit(int). -
notifyAll
CallsObject.notifyAll(). -
wait
CallsObject.wait().- Throws:
InterruptedException
-
clear
Clears the contents of aStringWriter. -
regexpReplace
public static String regexpReplace(String s, Pattern pattern, String replacement, int pos, int occurrence) Helper for the SQLREGEXP_REPLACEfunction.It is marked "unsafe" because it uses
StringBuffer; Versions ofMatcher.appendReplacement(StringBuffer, String)andMatcher.appendTail(StringBuffer)that useStringBuilderare not available until JDK 9.
-