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 void
clear
(StringWriter sw) Clears the contents of aStringWriter
.static void
CallsObject.notifyAll()
.static String
regexpReplace
(String s, Pattern pattern, String replacement, int pos, int occurrence) Helper for the SQLREGEXP_REPLACE
function.static void
systemExit
(int status) CallsSystem.exit(int)
.static void
CallsObject.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_REPLACE
function.It is marked "unsafe" because it uses
StringBuffer
; Versions ofMatcher.appendReplacement(StringBuffer, String)
andMatcher.appendTail(StringBuffer)
that useStringBuilder
are not available until JDK 9.
-