for (int i = 0; i < matchList.length; i++) { if (matchList[i].startsWith("parm[")) { if (appendParameterNameAndValue(matchList[i], event, eventParametersToMatch)) { sql.append(String.format("INNER JOIN event_parameters as ep%d on ep%d.eventid = n.eventid and ep%d.name=? and ep%d.value=? ", i, i, i, i));