test_class.declarator: formatterUnderTest
test_class.original_string: DefaultExceptionFormatter formatterUnderTest;
test_class.type: DefaultExceptionFormatter
test_class.var_name: formatterUnderTest
test_class.file: sql12/fw/src/test/java/net/sourceforge/squirrel_sql/fw/util/DefaultExceptionFormatterTest.java
test_class.identifier: DefaultExceptionFormatterTest
test_class.superclass: extends BaseSQuirreLJUnit4TestCase
test_case.body: @Test (expected = IllegalArgumentException.class)
      public final void testNullThrowableFormat() {
          formatterUnderTest.format(null);
      }
test_case.class_method_signature: DefaultExceptionFormatterTest.testNullThrowableFormat()
test_case.full_signature: @Test (expected = IllegalArgumentException.class) public final void testNullThrowableFormat()
test_case.identifier: testNullThrowableFormat
test_case.invocations: format
test_case.modifiers: @Test (expected = IllegalArgumentException.class) public final
test_case.parameters: ()
test_case.return: void
test_case.signature: void testNullThrowableFormat()
focal_class.declarator: s_log =
          LoggerController.createLogger(DefaultExceptionFormatter.class)
focal_class.modifier: private static final
focal_class.original_string: private static final ILogger s_log =
          LoggerController.createLogger(DefaultExceptionFormatter.class);
focal_class.type: ILogger
focal_class.var_name: s_log
focal_class.declarator: customFormatter = null
focal_class.modifier: private
focal_class.original_string: private ExceptionFormatter customFormatter = null;
focal_class.type: ExceptionFormatter
focal_class.var_name: customFormatter
focal_class.file: sql12/fw/src/main/java/net/sourceforge/squirrel_sql/fw/util/DefaultExceptionFormatter.java
focal_class.identifier: DefaultExceptionFormatter
focal_class.interfaces: implements ExceptionFormatter
focal_class.class_method_signature: DefaultExceptionFormatter.format(Throwable th)
focal_class.full_signature: public String format(Throwable th)
focal_class.identifier: format
focal_class.modifiers: public
focal_class.parameters: (Throwable th)
focal_class.return: String
focal_class.signature: String format(Throwable th)
focal_class.class_method_signature: DefaultExceptionFormatter.defaultFormatSQLException(Throwable cause)
focal_class.full_signature: public String defaultFormatSQLException(Throwable cause)
focal_class.identifier: defaultFormatSQLException
focal_class.modifiers: public
focal_class.parameters: (Throwable cause)
focal_class.return: String
focal_class.signature: String defaultFormatSQLException(Throwable cause)
focal_class.class_method_signature: DefaultExceptionFormatter.formatsException(Throwable t)
focal_class.full_signature: public boolean formatsException(Throwable t)
focal_class.identifier: formatsException
focal_class.modifiers: public
focal_class.parameters: (Throwable t)
focal_class.return: boolean
focal_class.signature: boolean formatsException(Throwable t)
focal_class.class_method_signature: DefaultExceptionFormatter.setCustomExceptionFormatter(ExceptionFormatter customFormatter)
focal_class.full_signature: public void setCustomExceptionFormatter(ExceptionFormatter customFormatter)
focal_class.identifier: setCustomExceptionFormatter
focal_class.modifiers: public
focal_class.parameters: (ExceptionFormatter customFormatter)
focal_class.return: void
focal_class.signature: void setCustomExceptionFormatter(ExceptionFormatter customFormatter)
focal_class.class_method_signature: DefaultExceptionFormatter.getDataTruncationMessage(DataTruncation ex)
focal_class.full_signature: private String getDataTruncationMessage(DataTruncation ex)
focal_class.identifier: getDataTruncationMessage
focal_class.modifiers: private
focal_class.parameters: (DataTruncation ex)
focal_class.return: String
focal_class.signature: String getDataTruncationMessage(DataTruncation ex)
focal_class.class_method_signature: DefaultExceptionFormatter.getSQLWarningMessage(SQLWarning ex)
focal_class.full_signature: private String getSQLWarningMessage(SQLWarning ex)
focal_class.identifier: getSQLWarningMessage
focal_class.modifiers: private
focal_class.parameters: (SQLWarning ex)
focal_class.return: String
focal_class.signature: String getSQLWarningMessage(SQLWarning ex)
focal_class.class_method_signature: DefaultExceptionFormatter.getSQLExceptionMessage(SQLException ex)
focal_class.full_signature: private String getSQLExceptionMessage(SQLException ex)
focal_class.identifier: getSQLExceptionMessage
focal_class.modifiers: private
focal_class.parameters: (SQLException ex)
focal_class.return: String
focal_class.signature: String getSQLExceptionMessage(SQLException ex)
focal_class.class_method_signature: DefaultExceptionFormatter.buildMessage(String prefix, SQLException ex)
focal_class.full_signature: private String buildMessage(String prefix, SQLException ex)
focal_class.identifier: buildMessage
focal_class.modifiers: private
focal_class.parameters: (String prefix, SQLException ex)
focal_class.return: String
focal_class.signature: String buildMessage(String prefix, SQLException ex)
focal_method.body: public String format(Throwable th) {
          if (th == null) {
              throw new IllegalArgumentException("format: th cannot be null");
          }
          StringBuilder result = new StringBuilder();
          
          String postError = "";
          Throwable cause = th;
          if (th instanceof SQLExecutionException) {
              postError = ((SQLExecutionException)th).getPostError();
              cause = th.getCause();
          }
          
          String customMessage = null;
          
          if (customFormatter != null && customFormatter.formatsException(cause)) {
              try {
                  customMessage = customFormatter.format(cause);
              } catch (Exception e) {
                  s_log.error( 
                      "Exception occurred while formatting:  "+e.getMessage(), e);
              }
          } 
          
          if (customMessage != null) {
              result.append(customMessage);
          } else {
              result.append(defaultFormatSQLException(cause));
          }
          if (postError != null && !"".equals(postError)) {
              result.append("\n");
              result.append(postError);
          }
  
          return result.toString();
      }
focal_method.class_method_signature: DefaultExceptionFormatter.format(Throwable th)
focal_method.full_signature: public String format(Throwable th)
focal_method.identifier: format
focal_method.invocations: getPostError getCause formatsException format error getMessage append append defaultFormatSQLException equals append append toString
focal_method.modifiers: public
focal_method.parameters: (Throwable th)
focal_method.return: String
focal_method.signature: String format(Throwable th)