test_class.declarator: SURROGATE_PAIR = Character.toChars(0x1f4a9)
test_class.modifier: private static
test_class.original_string: private static char[] SURROGATE_PAIR = Character.toChars(0x1f4a9);
test_class.type: char[]
test_class.var_name: SURROGATE_PAIR
test_class.file: oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/util/UTF8EncoderTest.java
test_class.identifier: UTF8EncoderTest
test_case.body: @Test
      public void encodeInValid() {
  
          // a a-umlaut euro plane-1-char, second char in surrogate pair missing
          String test = "a \u00E4 \u20ac " + SURROGATE_PAIR[0];
  
          try {
              UTF8Encoder.encodeAsByteArray(test);
              fail("expected encoding to fail");
          } catch (IOException expected) {
              // expected
          }
      }
test_case.class_method_signature: UTF8EncoderTest.encodeInValid()
test_case.full_signature: @Test public void encodeInValid()
test_case.identifier: encodeInValid
test_case.invocations: encodeAsByteArray fail
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void encodeInValid()
focal_class.declarator: CSE = new ThreadLocal<CharsetEncoder>() {
          @Override
          protected CharsetEncoder initialValue() {
              CharsetEncoder e = StandardCharsets.UTF_8.newEncoder();
              e.onUnmappableCharacter(CodingErrorAction.REPORT);
              e.onMalformedInput(CodingErrorAction.REPORT);
              return e;
          }
      }
focal_class.modifier: private static
focal_class.original_string: private static ThreadLocal<CharsetEncoder> CSE = new ThreadLocal<CharsetEncoder>() {
          @Override
          protected CharsetEncoder initialValue() {
              CharsetEncoder e = StandardCharsets.UTF_8.newEncoder();
              e.onUnmappableCharacter(CodingErrorAction.REPORT);
              e.onMalformedInput(CodingErrorAction.REPORT);
              return e;
          }
      };
focal_class.type: ThreadLocal<CharsetEncoder>
focal_class.var_name: CSE
focal_class.file: oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/util/UTF8Encoder.java
focal_class.identifier: UTF8Encoder
focal_class.class_method_signature: UTF8Encoder.UTF8Encoder()
focal_class.full_signature: private  UTF8Encoder()
focal_class.identifier: UTF8Encoder
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  UTF8Encoder()
focal_class.class_method_signature: UTF8Encoder.encodeAsByteArray(String input)
focal_class.full_signature: public static byte[] encodeAsByteArray(String input)
focal_class.identifier: encodeAsByteArray
focal_class.modifiers: public static
focal_class.parameters: (String input)
focal_class.return: byte[]
focal_class.signature: byte[] encodeAsByteArray(String input)
focal_class.class_method_signature: UTF8Encoder.canEncode(CharSequence input)
focal_class.full_signature: public static boolean canEncode(CharSequence input)
focal_class.identifier: canEncode
focal_class.modifiers: public static
focal_class.parameters: (CharSequence input)
focal_class.return: boolean
focal_class.signature: boolean canEncode(CharSequence input)
focal_class.class_method_signature: UTF8Encoder.bytes(ByteBuffer b)
focal_class.full_signature: private static byte[] bytes(ByteBuffer b)
focal_class.identifier: bytes
focal_class.modifiers: private static
focal_class.parameters: (ByteBuffer b)
focal_class.return: byte[]
focal_class.signature: byte[] bytes(ByteBuffer b)
focal_method.body: public static byte[] encodeAsByteArray(String input) throws IOException {
          CharsetEncoder e = CSE.get();
          e.reset();
          return bytes(e.encode(CharBuffer.wrap(input.toCharArray())));
      }
focal_method.class_method_signature: UTF8Encoder.encodeAsByteArray(String input)
focal_method.full_signature: public static byte[] encodeAsByteArray(String input)
focal_method.identifier: encodeAsByteArray
focal_method.invocations: get reset bytes encode wrap toCharArray
focal_method.modifiers: public static
focal_method.parameters: (String input)
focal_method.return: byte[]
focal_method.signature: byte[] encodeAsByteArray(String input)