Buggy code:
public class QueryBuilder implements EngineElementBuilder { public Pattern build ( final RuleBuildContext context , final QueryDescr queryDescr ) { ObjectType queryObjectType = ClassObjectType . DroolsQuery_ObjectType ; final Pattern pattern = new Pattern ( context . getNextPatternId ( ) , 0 , queryObjectType , null ) ; final InternalReadAccessor extractor = PatternBuilder . getFieldReadAccessor ( context , queryDescr , queryObjectType , "name" , null , true ) ; final QueryNameConstraint constraint = new QueryNameConstraint ( extractor , queryDescr . getName ( ) ) ; PatternBuilder . registerReadAccessor ( context , queryObjectType , "name" , constraint ) ; pattern . addConstraint ( constraint ) ; ObjectType argsObjectType = ClassObjectType . DroolsQuery_ObjectType ; InternalReadAccessor arrayExtractor = PatternBuilder . getFieldReadAccessor ( context , queryDescr , argsObjectType , "elements" , null , true ) ; QueryImpl query = ( ( QueryImpl ) ( context . getRule ( ) ) ) ; String [ ] params ; String [ ] types ; int numParams = queryDescr . getParameters ( ) . length ; if ( query . isAbductive ( ) ) { params = Arrays . copyOf ( queryDescr . getParameters ( ) , ( ( queryDescr . getParameters ( ) . length ) + 1 ) ) ; types = Arrays . copyOf ( queryDescr . getParameterTypes ( ) , ( ( queryDescr . getParameterTypes ( ) . length ) + 1 ) ) ; } else { params = queryDescr . getParameters ( ) ; types = queryDescr . getParameterTypes ( ) ; } Declaration [ ] declarations = new Declaration [ params . length ] ; if ( query . isAbductive ( ) ) { AnnotationDescr ann = queryDescr . getAnnotation ( Abductive . class . getSimpleName ( ) ) ; String returnName = ann . getValue ( "target" ) ; try { Class < ? > returnKlass = context . getPkg ( ) . getTypeResolver ( ) . resolveType ( returnName . replace ( ".class" , "" ) ) ; ClassObjectType objectType = new ClassObjectType ( returnKlass , false ) ; objectType = context . getPkg ( ) . getClassFieldAccessorStore ( ) . getClassObjectType ( objectType , ( ( AbductiveQuery ) ( query ) ) ) ; params [ numParams ] = "" ; types [ numParams ] = returnKlass . getName ( ) ; ( ( AbductiveQuery ) ( query ) ) . setReturnType ( objectType , params ) ; } catch ( ClassNotFoundException e ) { context . addError ( new org . drools . compiler . compiler . DescrBuildError ( context . getParentDescr ( ) , queryDescr , e , ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>resolve<seq2seq4repair_space>abducible<seq2seq4repair_space>type<seq2seq4repair_space>:<seq2seq4repair_space>" + returnName ) ) ) ; } catch ( NoSuchMethodException e ) { <START_BUG> context . addError ( new org . drools . compiler . compiler . DescrBuildError ( context . getParentDescr ( ) , queryDescr , e , ( ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>resolve<seq2seq4repair_space>abducible<seq2seq4repair_space>constructor<seq2seq4repair_space>for<seq2seq4repair_space>type<seq2seq4repair_space>:<seq2seq4repair_space>" + returnName ) + "<seq2seq4repair_space>with<seq2seq4repair_space>types<seq2seq4repair_space>" ) + types ) ) ) ; <END_BUG> } } int i = 0 ; try { for ( i = 0 ; i < ( params . length ) ; i ++ ) { Declaration declr = pattern . addDeclaration ( params [ i ] ) ; ArrayElementReader reader = new ArrayElementReader ( arrayExtractor , i , context . getDialect ( ) . getTypeResolver ( ) . resolveType ( types [ i ] ) ) ; PatternBuilder . registerReadAccessor ( context , argsObjectType , "elements" , reader ) ; declr . setReadAccessor ( reader ) ; declarations [ i ] = declr ; } query . setParameters ( declarations ) ; } catch ( ClassNotFoundException e ) { context . addError ( new org . drools . compiler . compiler . DescrBuildError ( context . getParentDescr ( ) , queryDescr , e , ( ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>resolve<seq2seq4repair_space>type<seq2seq4repair_space>'" + ( types [ i ] ) ) + "<seq2seq4repair_space>for<seq2seq4repair_space>parameter" ) + ( params [ i ] ) ) ) ) ; } context . setPrefixPattern ( pattern ) ; return pattern ; } }

Fix:
context . addError ( new org . drools . compiler . compiler . DescrBuildError ( context . getParentDescr ( ) , queryDescr , e , ( ( ( "Unable<seq2seq4repair_space>to<seq2seq4repair_space>resolve<seq2seq4repair_space>abducible<seq2seq4repair_space>constructor<seq2seq4repair_space>for<seq2seq4repair_space>type<seq2seq4repair_space>:<seq2seq4repair_space>" + returnName ) + "<seq2seq4repair_space>with<seq2seq4repair_space>types<seq2seq4repair_space>" ) + ( Arrays . toString ( types ) ) ) ) ) ;