Buggy code:
public abstract class NamedParameterUtils { private static final char [ ] PARAMETER_SEPARATORS = new char [ ] { '"' , '\'' , ':' , '&' , ',' , ';' , '(' , ')' , '|' , '=' , '+' , '-' , '*' , '%' , '//' , '\\' , '<' , '>' , '^' } ; private static final String [ ] START_SKIP = new String [ ] { "'" , "\"" , "--" , "//*" } ; private static final String [ ] STOP_SKIP = new String [ ] { "'" , "\"" , "\n" , "*//" } ; public static ParsedSql parseSqlStatement ( final String sql ) { Assert . notNull ( sql , "SQL<seq2seq4repair_space>must<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>null" ) ; Set < String > namedParameters = new HashSet < String > ( ) ; String sqlToUse = sql ; List < NamedParameterUtils . ParameterHolder > parameterList = new ArrayList < NamedParameterUtils . ParameterHolder > ( ) ; char [ ] statement = sql . toCharArray ( ) ; int namedParameterCount = 0 ; int unnamedParameterCount = 0 ; int totalParameterCount = 0 ; int escapes = 0 ; int i = 0 ; while ( i < ( statement . length ) ) { int skipToPosition = NamedParameterUtils . skipCommentsAndQuotes ( statement , i ) ; if ( i != skipToPosition ) { if ( skipToPosition >= ( statement . length ) ) { break ; } i = skipToPosition ; } char c = statement [ i ] ; if ( ( c == ':' ) || ( c == '&' ) ) { int j = i + 1 ; if ( ( ( j < ( statement . length ) ) && ( ( statement [ j ] ) == ':' ) ) && ( c == ':' ) ) { i = i + 2 ; continue ; } String parameter = null ; if ( ( ( j < ( statement . length ) ) && ( c == ':' ) ) && ( ( statement [ j ] ) == '{' ) ) { while ( ( j < ( statement . length ) ) && ( ! ( '}' == ( statement [ j ] ) ) ) ) { j ++ ; <START_BUG> if ( ( ( ':' == ( statement [ j ] ) ) || ( '{' == ( statement [ j ] ) ) ) || ( NamedParameterUtils . isParameterSeparator ( statement [ j ] ) ) ) { <END_BUG> throw new InvalidDataAccessApiUsageException ( ( ( ( ( ( "Parameter<seq2seq4repair_space>name<seq2seq4repair_space>contains<seq2seq4repair_space>invalid<seq2seq4repair_space>character<seq2seq4repair_space>'" + ( statement [ j ] ) ) + "'<seq2seq4repair_space>at<seq2seq4repair_space>position<seq2seq4repair_space>" ) + i ) + "<seq2seq4repair_space>in<seq2seq4repair_space>statement<seq2seq4repair_space>" ) + sql ) ) ; } } if ( j >= ( statement . length ) ) { throw new InvalidDataAccessApiUsageException ( ( ( ( "Non-terminated<seq2seq4repair_space>named<seq2seq4repair_space>parameter<seq2seq4repair_space>declaration<seq2seq4repair_space>at<seq2seq4repair_space>position<seq2seq4repair_space>" + i ) + "<seq2seq4repair_space>in<seq2seq4repair_space>statement<seq2seq4repair_space>" ) + sql ) ) ; } if ( ( j - i ) > 3 ) { parameter = sql . substring ( ( i + 2 ) , j ) ; namedParameterCount = NamedParameterUtils . addNewNamedParameter ( namedParameters , namedParameterCount , parameter ) ; totalParameterCount = NamedParameterUtils . addNamedParameter ( parameterList , totalParameterCount , escapes , i , ( j + 1 ) , parameter ) ; } j ++ ; } else { while ( ( j < ( statement . length ) ) && ( ! ( NamedParameterUtils . isParameterSeparator ( statement [ j ] ) ) ) ) { j ++ ; } if ( ( j - i ) > 1 ) { parameter = sql . substring ( ( i + 1 ) , j ) ; namedParameterCount = NamedParameterUtils . addNewNamedParameter ( namedParameters , namedParameterCount , parameter ) ; totalParameterCount = NamedParameterUtils . addNamedParameter ( parameterList , totalParameterCount , escapes , i , j , parameter ) ; } } i = j - 1 ; } else { if ( c == '\\' ) { int j = i + 1 ; if ( ( j < ( statement . length ) ) && ( ( statement [ j ] ) == ':' ) ) { sqlToUse = ( sqlToUse . substring ( 0 , ( i - escapes ) ) ) + ( sqlToUse . substring ( ( ( i - escapes ) + 1 ) ) ) ; escapes ++ ; i = i + 2 ; continue ; } } if ( c == '?' ) { unnamedParameterCount ++ ; totalParameterCount ++ ; } } i ++ ; } ParsedSql parsedSql = new ParsedSql ( sqlToUse ) ; for ( NamedParameterUtils . ParameterHolder ph : parameterList ) { parsedSql . addNamedParameter ( ph . getParameterName ( ) , ph . getStartIndex ( ) , ph . getEndIndex ( ) ) ; } parsedSql . setNamedParameterCount ( namedParameterCount ) ; parsedSql . setUnnamedParameterCount ( unnamedParameterCount ) ; parsedSql . setTotalParameterCount ( totalParameterCount ) ; return parsedSql ; } private static int addNamedParameter ( List < NamedParameterUtils . ParameterHolder > parameterList , int totalParameterCount , int escapes , int i , int j , String parameter ) { } private static int addNewNamedParameter ( Set < String > namedParameters , int namedParameterCount , String parameter ) { } private static int skipCommentsAndQuotes ( char [ ] statement , int position ) { } public static String substituteNamedParameters ( ParsedSql parsedSql , SqlParameterSource paramSource ) { } public static Object [ ] buildValueArray ( ParsedSql parsedSql , SqlParameterSource paramSource , List < SqlParameter > declaredParams ) { } private static SqlParameter findParameter ( List < SqlParameter > declaredParams , String paramName , int paramIndex ) { } private static boolean isParameterSeparator ( char c ) { } public static int [ ] buildSqlTypeArray ( ParsedSql parsedSql , SqlParameterSource paramSource ) { } public static List < SqlParameter > buildSqlParameterList ( ParsedSql parsedSql , SqlParameterSource paramSource ) { } public static String parseSqlStatementIntoString ( String sql ) { }

Fix:
if ( ( ':' == ( statement [ j ] ) ) || ( '{' == ( statement [ j ] ) ) ) {