Buggy code:
for ( CallParameterMetaData meta : this . metaDataProvider . getCallParameterMetaData ( ) ) { if ( ( meta . getParameterType ( ) ) != ( DatabaseMetaData . procedureColumnReturn ) ) { metaDataParameterNames . add ( meta . getParameterName ( ) . toLowerCase ( ) ) ; } } for ( SqlParameter parameter : parameters ) { if ( parameter . isResultsParameter ( ) ) { declaredReturnParameters . add ( parameter ) ; } else { String parameterNameToMatch = this . metaDataProvider . parameterNameToUse ( parameter . getName ( ) ) . toLowerCase ( ) ; declaredParameters . put ( parameterNameToMatch , parameter ) ; if ( parameter instanceof SqlOutParameter ) { outParameterNames . add ( parameter . getName ( ) ) ; if ( ( isFunction ( ) ) && ( ! ( metaDataParameterNames . contains ( parameterNameToMatch ) ) ) ) { if ( ! returnDeclared ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( ( ( "Using<seq2seq4repair_space>declared<seq2seq4repair_space>out<seq2seq4repair_space>parameter<seq2seq4repair_space>'" + ( parameter . getName ( ) ) ) + "'<seq2seq4repair_space>for<seq2seq4repair_space>function<seq2seq4repair_space>return<seq2seq4repair_space>value" ) ) ; } setFunctionReturnName ( parameter . getName ( ) ) ; returnDeclared = true ; } } } } } setOutParameterNames ( outParameterNames ) ; List < SqlParameter > workParameters = new ArrayList < SqlParameter > ( ) ; workParameters . addAll ( declaredReturnParameters ) ; if ( ! ( this . metaDataProvider . isProcedureColumnMetaDataUsed ( ) ) ) { workParameters . addAll ( declaredParameters . values ( ) ) ; return workParameters ; } Map < String , String > limitedInParamNamesMap = new HashMap < String , String > ( this . limitedInParameterNames . size ( ) ) ; for ( String limitedParameterName : this . limitedInParameterNames ) { limitedInParamNamesMap . put ( this . metaDataProvider . parameterNameToUse ( limitedParameterName ) . toLowerCase ( ) , limitedParameterName ) ; } for ( CallParameterMetaData meta : this . metaDataProvider . getCallParameterMetaData ( ) ) { String parNameToCheck = null ; if ( ( meta . getParameterName ( ) ) != null ) { parNameToCheck = this . metaDataProvider . parameterNameToUse ( meta . getParameterName ( ) ) . toLowerCase ( ) ; } String parNameToUse = this . metaDataProvider . parameterNameToUse ( meta . getParameterName ( ) ) ; if ( ( declaredParameters . containsKey ( parNameToCheck ) ) || ( ( ( meta . getParameterType ( ) ) == ( DatabaseMetaData . procedureColumnReturn ) ) && returnDeclared ) ) { SqlParameter parameter ; if ( ( meta . getParameterType ( ) ) == ( DatabaseMetaData . procedureColumnReturn ) ) { parameter = declaredParameters . get ( getFunctionReturnName ( ) ) ; if ( ( parameter == null ) && ( ( getOutParameterNames ( ) . size ( ) ) > 0 ) ) { parameter = declaredParameters . get ( getOutParameterNames ( ) . get ( 0 ) . toLowerCase ( ) ) ; } if ( parameter == null ) { throw new InvalidDataAccessApiUsageException ( ( ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>locate<seq2seq4repair_space>declared<seq2seq4repair_space>parameter<seq2seq4repair_space>for<seq2seq4repair_space>function<seq2seq4repair_space>return<seq2seq4repair_space>value<seq2seq4repair_space>-<seq2seq4repair_space>" + "<seq2seq4repair_space>add<seq2seq4repair_space>a<seq2seq4repair_space>SqlOutParameter<seq2seq4repair_space>with<seq2seq4repair_space>name<seq2seq4repair_space>\"" ) + ( getFunctionReturnName ( ) ) ) + "\"" ) ) ; } else { setFunctionReturnName ( parameter . getName ( ) ) ; } } else { parameter = declaredParameters . get ( parNameToCheck ) ; } if ( parameter != null ) { workParameters . add ( parameter ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( ( "Using<seq2seq4repair_space>declared<seq2seq4repair_space>parameter<seq2seq4repair_space>for:<seq2seq4repair_space>" + ( parNameToUse == null ? getFunctionReturnName ( ) : parNameToUse ) ) ) ; } } } else { if ( ( meta . getParameterType ( ) ) == ( DatabaseMetaData . procedureColumnReturn ) ) { if ( ( ( ! ( isFunction ( ) ) ) && ( ! ( isReturnValueRequired ( ) ) ) ) && ( this . metaDataProvider . byPassReturnParameter ( meta . getParameterName ( ) ) ) ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( ( "Bypassing<seq2seq4repair_space>metadata<seq2seq4repair_space>return<seq2seq4repair_space>parameter<seq2seq4repair_space>for:<seq2seq4repair_space>" + ( meta . getParameterName ( ) ) ) ) ; } } else { String returnNameToUse = ( StringUtils . hasLength ( meta . getParameterName ( ) ) ) ? parNameToUse : getFunctionReturnName ( ) ; <START_BUG> workParameters . add ( new SqlOutParameter ( returnNameToUse , meta . getSqlType ( ) ) ) ; <END_BUG> if ( isFunction ( ) ) { setFunctionReturnName ( returnNameToUse ) ; outParameterNames . add ( returnNameToUse ) ; } if ( logger . isDebugEnabled ( ) ) { logger . debug ( ( "Added<seq2seq4repair_space>metadata<seq2seq4repair_space>return<seq2seq4repair_space>parameter<seq2seq4repair_space>for:<seq2seq4repair_space>" + returnNameToUse ) ) ; } } } else { if ( ( meta . getParameterType ( ) ) == ( DatabaseMetaData . procedureColumnOut ) ) { workParameters . add ( this . metaDataProvider . createDefaultOutParameter ( parNameToUse , meta ) ) ; outParameterNames . add ( parNameToUse ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( ( "Added<seq2seq4repair_space>metadata<seq2seq4repair_space>out<seq2seq4repair_space>parameter<seq2seq4repair_space>for:<seq2seq4repair_space>" + parNameToUse ) ) ; } } else if ( ( meta . getParameterType ( ) ) == ( DatabaseMetaData . procedureColumnInOut ) ) { workParameters . add ( this . metaDataProvider . createDefaultInOutParameter ( parNameToUse , meta ) ) ; outParameterNames . add ( parNameToUse ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( ( "Added<seq2seq4repair_space>metadata<seq2seq4repair_space>in<seq2seq4repair_space>out<seq2seq4repair_space>parameter<seq2seq4repair_space>for:<seq2seq4repair_space>" + parNameToUse ) ) ; } } else { if ( ( this . limitedInParameterNames . isEmpty ( ) ) || ( limitedInParamNamesMap . containsKey ( parNameToUse . toLowerCase ( ) ) ) ) { workParameters . add ( this . metaDataProvider . createDefaultInParameter ( parNameToUse , meta ) ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( ( "Added<seq2seq4repair_space>metadata<seq2seq4repair_space>in<seq2seq4repair_space>parameter<seq2seq4repair_space>for:<seq2seq4repair_space>" + parNameToUse ) ) ; } } else { if ( logger . isDebugEnabled ( ) ) { logger . debug ( ( ( ( "Limited<seq2seq4repair_space>set<seq2seq4repair_space>of<seq2seq4repair_space>parameters<seq2seq4repair_space>" + ( limitedInParamNamesMap . keySet ( ) ) ) + "<seq2seq4repair_space>skipped<seq2seq4repair_space>parameter<seq2seq4repair_space>for:<seq2seq4repair_space>" ) + parNameToUse ) ) ; } } }

Fix:
workParameters . add ( this . metaDataProvider . createDefaultOutParameter ( returnNameToUse , meta ) ) ;