Buggy code:
public class JavaCLGenerator extends JNAerator { static Pattern nameExtPatt = Pattern . compile ( "(.*?)\\.(\\w+)" ) ; public JavaCLGenerator ( JNAeratorConfig config ) { } Map < String , Set < String > > macrosByFile = new HashMap < String , Set < String > > ( ) ; public SourceFiles parseSources ( Feedback feedback , TypeConversion typeConverter ) throws IOException , LexerException { } static Set < String > openclPrimitives = new HashSet < String > ( ) ; @ Override public Result createResult ( final ClassOutputter outputter , Feedback feedback ) { return new Result ( config , outputter , feedback ) { @ Override public void init ( ) { typeConverter = new TypeConversion ( this ) { @ Override public void initTypes ( ) { super . initTypes ( ) ; } @ Override public boolean isObjCppPrimitive ( String s ) { int len ; if ( ( s == null ) || ( ( len = s . length ( ) ) == 0 ) ) return false ; if ( super . isObjCppPrimitive ( s ) ) return true ; if ( ( len > 1 ) && ( Character . isDigit ( s . charAt ( ( len - 1 ) ) ) ) ) { String ss = s . substring ( 0 , ( len - 1 ) ) ; if ( ( ss . charAt ( 0 ) ) == 'u' ) ss = ss . substring ( 1 ) ; if ( super . isObjCppPrimitive ( ss ) ) return true ; } return JavaCLGenerator . openclPrimitives . contains ( s ) ; } } ; declarationsConverter = new DeclarationsConverter ( this ) { @ Override <START_BUG> public void convertFunction ( Function function , Signatures signatures , boolean isCallback , DeclarationsHolder out , Identifier libraryClassName ) { <END_BUG> if ( isCallback ) return ; if ( ! ( functionsAccepter . adapt ( function ) ) ) return ; List < Arg > args = function . getArgs ( ) ; List < Arg > convArgs = new ArrayList < Arg > ( args . size ( ) ) ; String queueName = "commandQueue" ; convArgs . add ( new Arg ( queueName , typeRef ( CLQueue . class ) ) ) ; List < Expression > convArgExpr = new ArrayList < Expression > ( args . size ( ) ) ; List < Statement > extraStatements = new ArrayList < Statement > ( ) ; int iArg = 1 ; for ( Arg arg : args ) { TypeRef tr = arg . createMutatedType ( ) ; if ( tr == null ) return ; try { tr = typeConverter . resolveTypeDef ( tr , libraryClassName , true , false ) ; List < Modifier > mods = arg . harvestModifiers ( ) ; TypeRef convTr ; String argName = ( ( arg . getName ( ) ) == null ) ? "arg" + iArg : arg . getName ( ) ; Expression argExpr ; if ( __local . isContainedBy ( mods ) ) { argName += "LocalByteSize" ; convTr = typeRef ( LocalSize . class ) ; argExpr = varRef ( argName ) ; } else { JavaCLGenerator . Conversion conv = convertTypeToJavaCL ( result , argName , tr , PrimitiveOrBufferParameter , null ) ; convTr = conv . outerJavaTypeRef ; argExpr = conv . convertedExpr ; extraStatements . addAll ( conv . extraStatements ) ; } convArgs . add ( new Arg ( argName , convTr ) ) ; convArgExpr . add ( argExpr ) ; } catch ( UnsupportedConversionException ex ) { out . addDeclaration ( skipDeclaration ( function , ex . toString ( ) ) ) ; } iArg ++ ; } String globalWSName = "globalWorkSizes" ; String localWSName = "localWorkSizes" ; String eventsName = "eventsToWaitFor" ; convArgs . add ( new Arg ( globalWSName , typeRef ( int [ ] . class ) ) ) ; convArgs . add ( new Arg ( localWSName , typeRef ( int [ ] . class ) ) ) ; convArgs . add ( new Arg ( eventsName , typeRef ( CLEvent . class ) ) . setVarArg ( true ) ) ; String functionName = function . getName ( ) . toString ( ) ; String kernelVarName = functionName + "_kernel" ; if ( signatures . variablesSignatures . add ( kernelVarName ) ) out . addDeclaration ( new com . ochafik . lang . jnaerator . parser . VariablesDeclaration ( typeRef ( CLKernel . class ) , new Declarator . DirectDeclarator ( kernelVarName ) ) ) ; Function method = new Function ( Type . JavaMethod , ident ( functionName ) , typeRef ( CLEvent . class ) ) ; method . addModifiers ( Public , Synchronized ) ; method . addThrown ( typeRef ( CLBuildException . class ) ) ; method . setArgs ( convArgs ) ; List < Statement > statements = new ArrayList < Statement > ( ) ; statements . add ( new Statement . If ( expr ( varRef ( kernelVarName ) , IsEqual , new Expression . NullExpression ( ) ) , stat ( expr ( varRef ( kernelVarName ) , Equal , methodCall ( "createKernel" , new Expression . Constant ( Expression . Constant . Type . String , functionName , null ) ) ) ) , null ) ) ; statements . addAll ( extraStatements ) ; statements . add ( stat ( methodCall ( varRef ( kernelVarName ) , Dot , "setArgs" , convArgExpr . toArray ( new Expression [ convArgExpr . size ( ) ] ) ) ) ) ; statements . add ( new Statement . Return ( methodCall ( varRef ( kernelVarName ) , Dot , "enqueueNDRange" , varRef ( queueName ) , varRef ( globalWSName ) , varRef ( localWSName ) , varRef ( eventsName ) ) ) ) ;

Fix:
public void convertFunction ( Function function , Signatures signatures , boolean isCallback , DeclarationsHolder out , Identifier libraryClassName , int iConstructor ) {