private String cleanUpCall(String sql) throws FBSQLParseException {
  int startIndex=0;
  int endIndex=sql.length();
  while (startIndex < endIndex && Character.isWhitespace(sql.charAt(startIndex))) {
    startIndex++;
  }
  while (endIndex > startIndex && Character.isWhitespace(sql.charAt(endIndex - 1))) {
    endIndex--;
  }
  if (startIndex < endIndex && sql.charAt(startIndex) == '{' && endIndex > 0 && sql.charAt(endIndex - 1) == '}') {
    startIndex++;
    endIndex--;
  }
  if (startIndex >= endIndex) {
    throw new FBSQLParseException("Escaped call statement was empty.");
  }
  return sql.substring(startIndex,endIndex);
}

private String cleanUpCall ( String sql ) throws FBSQLParseException { int startIndex = 0 ; int endIndex = sql . length ( ) ; while ( startIndex < endIndex && Character . isWhitespace ( sql . charAt ( startIndex ) ) ) { startIndex ++ ; } while ( endIndex > startIndex && Character . isWhitespace ( sql . charAt ( endIndex - 1 ) ) ) { endIndex -- ; } if ( startIndex < endIndex && sql . charAt ( startIndex ) == '{' && endIndex > 0 && sql . charAt ( endIndex - 1 ) == '}' ) { startIndex ++ ; endIndex -- ; } if ( startIndex >= endIndex ) { throw new FBSQLParseException ( "Escaped call statement was empty." ) ; } return sql . substring ( startIndex , endIndex ) ; }
clean the sql statement . this method removes leading and trailing spaces and removes leading and trailing curly braces if any .
