test_class.file: commons/core/src/test/java/org/openehealth/ipf/commons/core/modules/api/ValidationExceptionTest.java
test_class.identifier: ValidationExceptionTest
test_case.body: @Test
      public void testMessages() {
          String s;
          String message = "exception message 12345";
          Throwable[] causes;
  
          // ----------------- 
          causes = new Throwable[] {new RuntimeException("12345"), new RuntimeException("abcd") };
          
          s = new ValidationException(message, causes).getMessage();
          assertTrue(s.startsWith(message));
          assertTrue(s.contains("\n12345"));
          assertTrue(s.contains("\nabcd"));
          
          s = new ValidationException(causes).getMessage();
          assertTrue(s.startsWith("12345\n"));
          assertTrue(s.endsWith("\nabcd"));
  
          // -----------------
          causes = new Throwable[] { new RuntimeException(), new RuntimeException() };
  
          s = new ValidationException(message, causes).getMessage();
          assertTrue(s.startsWith(message));
          assertTrue(s.indexOf("java.lang.RuntimeException") != s.lastIndexOf("java.lang.RuntimeException")); 
          
          s = new ValidationException(causes).getMessage();
          assertEquals("java.lang.RuntimeException\njava.lang.RuntimeException", s); 
  
          // -----------------
          causes = new Throwable[] { new RuntimeException(), new RuntimeException("67890") };
  
          s = new ValidationException(message, causes).getMessage();
          assertTrue(s.startsWith(message));
          assertTrue(s.contains("\njava.lang.RuntimeException"));
          assertTrue(s.contains("\n67890"));
  
          s = new ValidationException(causes).getMessage();
          assertTrue(s.startsWith("java.lang.RuntimeException\n"));
          assertTrue(s.endsWith("\n67890"));
  
          // -----------------
          causes = new Throwable[] {};
          s = new ValidationException(message, causes).getMessage();
          assertEquals(s, message);
  
          s = new ValidationException(causes).getMessage();
          assertEquals(s, ValidationException.class.getName());
  
          // -----------------
          causes = null;
          s = new ValidationException(message, causes).getMessage();
          assertEquals(s, message);
  
          s = new ValidationException(causes).getMessage();
          assertEquals(s, ValidationException.class.getName());
      
          // -----------------
          Throwable cause = null;
          s = new ValidationException(message, cause).getMessage();
          assertEquals(s, message);
  
          s = new ValidationException(cause).getMessage();
          assertEquals(s, ValidationException.class.getName());
      }
test_case.class_method_signature: ValidationExceptionTest.testMessages()
test_case.full_signature: @Test public void testMessages()
test_case.identifier: testMessages
test_case.invocations: getMessage assertTrue startsWith assertTrue contains assertTrue contains getMessage assertTrue startsWith assertTrue endsWith getMessage assertTrue startsWith assertTrue indexOf lastIndexOf getMessage assertEquals getMessage assertTrue startsWith assertTrue contains assertTrue contains getMessage assertTrue startsWith assertTrue endsWith getMessage assertEquals getMessage assertEquals getName getMessage assertEquals getMessage assertEquals getName getMessage assertEquals getMessage assertEquals getName
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testMessages()
focal_class.declarator: causes
focal_class.modifier: private
focal_class.original_string: private Throwable[] causes;
focal_class.type: Throwable[]
focal_class.var_name: causes
focal_class.file: commons/core/src/main/java/org/openehealth/ipf/commons/core/modules/api/ValidationException.java
focal_class.identifier: ValidationException
focal_class.class_method_signature: ValidationException.ValidationException(Throwable cause)
focal_class.full_signature: public  ValidationException(Throwable cause)
focal_class.identifier: ValidationException
focal_class.modifiers: public
focal_class.parameters: (Throwable cause)
focal_class.signature:  ValidationException(Throwable cause)
focal_class.class_method_signature: ValidationException.ValidationException(String message, Throwable cause)
focal_class.full_signature: public  ValidationException(String message, Throwable cause)
focal_class.identifier: ValidationException
focal_class.modifiers: public
focal_class.parameters: (String message, Throwable cause)
focal_class.signature:  ValidationException(String message, Throwable cause)
focal_class.class_method_signature: ValidationException.ValidationException(String message, Throwable[] causes)
focal_class.full_signature: public  ValidationException(String message, Throwable[] causes)
focal_class.identifier: ValidationException
focal_class.modifiers: public
focal_class.parameters: (String message, Throwable[] causes)
focal_class.signature:  ValidationException(String message, Throwable[] causes)
focal_class.class_method_signature: ValidationException.ValidationException(String message, List<? extends Throwable> causes)
focal_class.full_signature: public  ValidationException(String message, List<? extends Throwable> causes)
focal_class.identifier: ValidationException
focal_class.modifiers: public
focal_class.parameters: (String message, List<? extends Throwable> causes)
focal_class.signature:  ValidationException(String message, List<? extends Throwable> causes)
focal_class.class_method_signature: ValidationException.ValidationException(String message)
focal_class.full_signature: public  ValidationException(String message)
focal_class.identifier: ValidationException
focal_class.modifiers: public
focal_class.parameters: (String message)
focal_class.signature:  ValidationException(String message)
focal_class.class_method_signature: ValidationException.ValidationException(Throwable[] causes)
focal_class.full_signature: public  ValidationException(Throwable[] causes)
focal_class.identifier: ValidationException
focal_class.modifiers: public
focal_class.parameters: (Throwable[] causes)
focal_class.signature:  ValidationException(Throwable[] causes)
focal_class.class_method_signature: ValidationException.ValidationException(List<? extends Throwable> causes)
focal_class.full_signature: public  ValidationException(List<? extends Throwable> causes)
focal_class.identifier: ValidationException
focal_class.modifiers: public
focal_class.parameters: (List<? extends Throwable> causes)
focal_class.signature:  ValidationException(List<? extends Throwable> causes)
focal_class.class_method_signature: ValidationException.getCauses()
focal_class.full_signature: public Throwable[] getCauses()
focal_class.identifier: getCauses
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Throwable[]
focal_class.signature: Throwable[] getCauses()
focal_class.class_method_signature: ValidationException.getMessage()
focal_class.full_signature: @Override public String getMessage()
focal_class.identifier: getMessage
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getMessage()
focal_class.superclass: extends RuntimeException
focal_method.body: @Override
      public String getMessage() {
          StringBuilder sb = new StringBuilder();
          
          String msg = super.getMessage();
          if(msg != null) {
              sb.append(msg).append('\n');
          }
  
          if(causes != null) {
              for(Throwable t : causes) {
                  if(t != null) {
                      msg = t.getMessage();
                      sb.append((msg == null) ? t.getClass().getName() : msg).append('\n');
                  }
              }
          }
  
          int len = sb.length(); 
          return (len == 0) ? getClass().getName() : sb.deleteCharAt(len - 1).toString();
      }
focal_method.class_method_signature: ValidationException.getMessage()
focal_method.full_signature: @Override public String getMessage()
focal_method.identifier: getMessage
focal_method.invocations: getMessage append append getMessage append append getName getClass length getName getClass toString deleteCharAt
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: String
focal_method.signature: String getMessage()