if (matcher.matches()) {
if (matcher.find()) {
    private void log(Object arg, Throwable t) {        String message = arg.toString();                // Skip uninteresting operations        if (message.startsWith("FETCH")) {            return;        }        // Parse the SQL statement and timing info        String sql = null;        int duration = -1;        Matcher matcher = PAT_PREPARE.matcher(message);        if (matcher.matches()) {            String connectionId = matcher.group(1);            String statementId = matcher.group(2);            sql = matcher.group(3);            putSql(connectionId, statementId, sql);            return;        } else {            matcher = PAT_EXECUTE.matcher(message);            if (matcher.find()) {                duration = Integer.parseInt(matcher.group(1));                String connectionId = matcher.group(2);                String statementId = matcher.group(3);                sql = removeSql(connectionId, statementId);            } else {                matcher = PAT_QUERY.matcher(message);                if (matcher.matches()) {                    duration = Integer.parseInt(matcher.group(1));                    sql = matcher.group(2);                } else {                    matcher = PAT_SLOW.matcher(message);                    if (matcher.matches()) {                        int slowDuration = Integer.parseInt(matcher.group(1));                        ZimbraPerf.writeSlowQuery(matcher.group(2), slowDuration);                        ZimbraLog.perf.debug(arg);                        return;                    }                }            }        }        // Log the SQL and write timing data if necessary.  This code        // gets triggered if either sqltrace or sqlperf is on, so we        // need to check if the logger is enabled before logging anything.        if (sql != null) {            if (ZimbraLog.perf.isDebugEnabled()) {                ZimbraPerf.updateDbStats(sql, duration);            }                        // Skip uninteresting messages            if (sql.startsWith("SET autocommit") ||                sql.startsWith("SET SESSION") ||                sql.startsWith("SELECT 1")) {                return;            }            if (ZimbraLog.sqltrace.isDebugEnabled()) {                ZimbraLog.sqltrace.debug(sql + ", duration: " + duration);            }                        return;        }        ZimbraLog.sqltrace.debug(arg, t);    }