Program: 111253
Project: 111253
Buggy source:
@Test public void testJsonExportAndImportErrors() throws Exception {
  AesCtrHmacAeadKeyManager keyManager=new AesCtrHmacAeadKeyManager();
  try {
    byte[] json="String_Node_Str".getBytes();
    AesCtrHmacAeadKey key=(AesCtrHmacAeadKey)keyManager.jsonToKey(json);
    fail("String_Node_Str");
  }
 catch (  GeneralSecurityException e) {
    assertExceptionContains(e,"String_Node_Str");
    assertExceptionContains(e,"String_Node_Str");
  }
  try {
    byte[] json="String_Node_Str".getBytes();
    AesCtrHmacAeadKeyFormat format=(AesCtrHmacAeadKeyFormat)keyManager.jsonToKeyFormat(json);
    fail("String_Node_Str");
  }
 catch (  GeneralSecurityException e) {
    assertExceptionContains(e,"String_Node_Str");
    assertExceptionContains(e,"String_Node_Str");
  }
  try {
    byte[] json=("String_Node_Str").getBytes();
    AesCtrHmacAeadKey key=(AesCtrHmacAeadKey)keyManager.jsonToKey(json);
    fail("String_Node_Str");
  }
 catch (  GeneralSecurityException e) {
    assertExceptionContains(e,"String_Node_Str");
    assertExceptionContains(e,"String_Node_Str");
  }
  try {
    byte[] json=("String_Node_Str").getBytes();
    AesCtrHmacAeadKeyFormat format=(AesCtrHmacAeadKeyFormat)keyManager.jsonToKeyFormat(json);
    fail("String_Node_Str");
  }
 catch (  GeneralSecurityException e) {
    assertExceptionContains(e,"String_Node_Str");
    assertExceptionContains(e,"String_Node_Str");
  }
  try {
    byte[] json=("String_Node_Str" + "String_Node_Str").getBytes();
    AesCtrHmacAeadKey key=(AesCtrHmacAeadKey)keyManager.jsonToKey(json);
    fail("String_Node_Str");
  }
 catch (  GeneralSecurityException e) {
    assertExceptionContains(e,"String_Node_Str");
    assertExceptionContains(e,"String_Node_Str");
  }
  try {
    byte[] json=("String_Node_Str" + "String_Node_Str").getBytes();
    AesCtrHmacAeadKeyFormat format=(AesCtrHmacAeadKeyFormat)keyManager.jsonToKeyFormat(json);
    fail("String_Node_Str");
  }
 catch (  GeneralSecurityException e) {
    assertExceptionContains(e,"String_Node_Str");
    assertExceptionContains(e,"String_Node_Str");
  }
  try {
    AesCtrHmacAeadKey key=AesCtrHmacAeadKey.newBuilder().setVersion(42).build();
    byte[] json=keyManager.keyToJson(key.toByteString());
    fail("String_Node_Str");
  }
 catch (  GeneralSecurityException e) {
  }
  try {
    AesCtrHmacAeadKeyFormat format=AesCtrHmacAeadKeyFormat.newBuilder().setAesCtrKeyFormat(AesCtrKeyFormat.newBuilder().setKeySize(42).build()).build();
    byte[] json=keyManager.keyFormatToJson(format.toByteString());
    fail("String_Node_Str");
  }
 catch (  GeneralSecurityException e) {
  }
  try {
    KeyData key=KeyData.newBuilder().setTypeUrl("String_Node_Str").setValue(ByteString.copyFromUtf8("String_Node_Str")).build();
    byte[] json=keyManager.keyToJson(key.toByteString());
    fail("String_Node_Str");
  }
 catch (  GeneralSecurityException e) {
    assertExceptionContains(e,"String_Node_Str");
  }
  try {
    KeyData format=KeyData.newBuilder().setTypeUrl("String_Node_Str").setValue(ByteString.copyFromUtf8("String_Node_Str")).build();
    byte[] json=keyManager.keyFormatToJson(format.toByteString());
    fail("String_Node_Str");
  }
 catch (  GeneralSecurityException e) {
    assertExceptionContains(e,"String_Node_Str");
  }
}

Fixed version (ground truth):
@Test @SuppressWarnings("String_Node_Str") public void testJsonExportAndImportErrors() throws Exception {
  AesCtrHmacAeadKeyManager keyManager=new AesCtrHmacAeadKeyManager();
  try {
    byte[] json="String_Node_Str".getBytes(Util.UTF_8);
    AesCtrHmacAeadKey key=(AesCtrHmacAeadKey)keyManager.jsonToKey(json);
    fail("String_Node_Str");
  }
 catch (  GeneralSecurityException e) {
    assertExceptionContains(e,"String_Node_Str");
    assertExceptionContains(e,"String_Node_Str");
  }
  try {
    byte[] json="String_Node_Str".getBytes(Util.UTF_8);
    AesCtrHmacAeadKeyFormat format=(AesCtrHmacAeadKeyFormat)keyManager.jsonToKeyFormat(json);
    fail("String_Node_Str");
  }
 catch (  GeneralSecurityException e) {
    assertExceptionContains(e,"String_Node_Str");
    assertExceptionContains(e,"String_Node_Str");
  }
  try {
    byte[] json=("String_Node_Str").getBytes(Util.UTF_8);
    AesCtrHmacAeadKey key=(AesCtrHmacAeadKey)keyManager.jsonToKey(json);
    fail("String_Node_Str");
  }
 catch (  GeneralSecurityException e) {
    assertExceptionContains(e,"String_Node_Str");
    assertExceptionContains(e,"String_Node_Str");
  }
  try {
    byte[] json=("String_Node_Str").getBytes(Util.UTF_8);
    AesCtrHmacAeadKeyFormat format=(AesCtrHmacAeadKeyFormat)keyManager.jsonToKeyFormat(json);
    fail("String_Node_Str");
  }
 catch (  GeneralSecurityException e) {
    assertExceptionContains(e,"String_Node_Str");
    assertExceptionContains(e,"String_Node_Str");
  }
  try {
    byte[] json=("String_Node_Str" + "String_Node_Str").getBytes(Util.UTF_8);
    AesCtrHmacAeadKey key=(AesCtrHmacAeadKey)keyManager.jsonToKey(json);
    fail("String_Node_Str");
  }
 catch (  GeneralSecurityException e) {
    assertExceptionContains(e,"String_Node_Str");
    assertExceptionContains(e,"String_Node_Str");
  }
  try {
    byte[] json=("String_Node_Str" + "String_Node_Str").getBytes(Util.UTF_8);
    AesCtrHmacAeadKeyFormat format=(AesCtrHmacAeadKeyFormat)keyManager.jsonToKeyFormat(json);
    fail("String_Node_Str");
  }
 catch (  GeneralSecurityException e) {
    assertExceptionContains(e,"String_Node_Str");
    assertExceptionContains(e,"String_Node_Str");
  }
  try {
    AesCtrHmacAeadKey key=AesCtrHmacAeadKey.newBuilder().setVersion(42).build();
    byte[] json=keyManager.keyToJson(key.toByteString());
    fail("String_Node_Str");
  }
 catch (  GeneralSecurityException e) {
  }
  try {
    AesCtrHmacAeadKeyFormat format=AesCtrHmacAeadKeyFormat.newBuilder().setAesCtrKeyFormat(AesCtrKeyFormat.newBuilder().setKeySize(42).build()).build();
    byte[] json=keyManager.keyFormatToJson(format.toByteString());
    fail("String_Node_Str");
  }
 catch (  GeneralSecurityException e) {
  }
  try {
    KeyData key=KeyData.newBuilder().setTypeUrl("String_Node_Str").setValue(ByteString.copyFromUtf8("String_Node_Str")).build();
    byte[] json=keyManager.keyToJson(key.toByteString());
    fail("String_Node_Str");
  }
 catch (  GeneralSecurityException e) {
    assertExceptionContains(e,"String_Node_Str");
  }
  try {
    KeyData format=KeyData.newBuilder().setTypeUrl("String_Node_Str").setValue(ByteString.copyFromUtf8("String_Node_Str")).build();
    byte[] json=keyManager.keyFormatToJson(format.toByteString());
    fail("String_Node_Str");
  }
 catch (  GeneralSecurityException e) {
    assertExceptionContains(e,"String_Node_Str");
  }
}