Class Unsafe


  • public class Unsafe
    extends java.lang.Object
    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.

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Unsafe()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void clear​(java.io.StringWriter sw)
      Clears the contents of a StringWriter.
      static void notifyAll​(java.lang.Object o)
      Calls Object.notifyAll().
      static java.lang.String regexpReplace​(java.lang.String s, java.util.regex.Pattern pattern, java.lang.String replacement, int pos, int occurrence)
      Helper for the SQL REGEXP_REPLACE function.
      static void systemExit​(int status)
      Calls System.exit(int).
      static void wait​(java.lang.Object o)
      Calls Object.wait().
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Unsafe

        private Unsafe()
    • Method Detail

      • systemExit

        public static void systemExit​(int status)
        Calls System.exit(int).
      • notifyAll

        public static void notifyAll​(java.lang.Object o)
        Calls Object.notifyAll().
      • wait

        public static void wait​(java.lang.Object o)
                         throws java.lang.InterruptedException
        Calls Object.wait().
        Throws:
        java.lang.InterruptedException
      • clear

        public static void clear​(java.io.StringWriter sw)
        Clears the contents of a StringWriter.
      • regexpReplace

        public static java.lang.String regexpReplace​(java.lang.String s,
                                                     java.util.regex.Pattern pattern,
                                                     java.lang.String replacement,
                                                     int pos,
                                                     int occurrence)
        Helper for the SQL REGEXP_REPLACE function.

        It is marked "unsafe" because it uses StringBuffer; Versions of Matcher.appendReplacement(StringBuffer, String) and Matcher.appendTail(StringBuffer) that use StringBuilder are not available until JDK 9.