Buggy code:
public final class OldDefinitionConverter { public static final List < String > ADVICE_LOCAL_VAR_NAMES = Arrays . asList ( DEF_VAR_NAME , THIS_JOINPOINT_STATICPART ) ; private XpandExecutionContext _ctx ; private final TypeToBackendType _typeConverter ; private String _definitionName ; private int _localVarCounter = 0 ; public OldDefinitionConverter ( XpandExecutionContext ctx , TypeToBackendType typeConverter ) { } public AroundAdvice create ( Advice a , Set < XpandDefinitionName > referencedDefinitions ) { } public NamedFunction createUnregistered ( XpandDefinition def , Set < XpandDefinitionName > referencedDefinitions ) { } private Function createNormalDefinition ( Definition def , Set < XpandDefinitionName > referencedDefinitions ) { final XpandExecutionContext oldCtx = _ctx ; try { final List < String > paramNames = new ArrayList < String > ( ) ; final List < BackendType > paramTypes = new ArrayList < BackendType > ( ) ; final Type ft = _ctx . getTypeForName ( def . getTargetType ( ) ) ; _ctx = ( ( XpandExecutionContext ) ( _ctx . cloneWithVariable ( new org . eclipse . xtend . expression . Variable ( ExecutionContext . IMPLICIT_VARIABLE , ft ) ) ) ) ; paramNames . add ( THIS ) ; paramTypes . add ( _typeConverter . convertToBackendType ( ft ) ) ; for ( DeclaredParameter dp : def . getParams ( ) ) { final Type pt = _ctx . getTypeForName ( dp . getType ( ) . getValue ( ) ) ; _ctx = ( ( XpandExecutionContext ) ( _ctx . cloneWithVariable ( new org . eclipse . xtend . expression . Variable ( dp . getName ( ) . getValue ( ) , pt ) ) ) ) ; paramNames . add ( dp . getName ( ) . getValue ( ) ) ; paramTypes . add ( _typeConverter . convertToBackendType ( pt ) ) ; } <START_BUG> return new org . eclipse . xtend . backend . functions . SourceDefinedFunction ( new org . eclipse . xtend . backend . common . QualifiedName ( def . getName ( ) ) , paramNames , paramTypes , convertStatementSequence ( def . getBody ( ) , def , referencedDefinitions ) , false , null ) ; <END_BUG> } finally { _ctx = oldCtx ; } } public ExpressionBase convertStatementSequence ( Statement [ ] statements , SyntaxElement oldPos , Set < XpandDefinitionName > referencedDefinitions ) { } public ExpressionBase convertStatement ( Statement stmt , Set < XpandDefinitionName > referencedDefinitions ) { } private ExpressionBase convertErrorStatement ( ErrorStatement stmt ) { } private ExpressionBase convertExpandStatement ( ExpandStatement stmt , Set < XpandDefinitionName > referencedDefinitions ) { } private String createUniqueLocalVarName ( ) { } private ExpressionBase convertExpressionStatement ( ExpressionStatement stmt ) { } private ExpressionBase convertForEachStatement ( ForEachStatement stmt , Set < XpandDefinitionName > referencedDefinitions ) { } private ExpressionBase convertIfStatement ( IfStatement stmt , Set < XpandDefinitionName > referencedDefinitions ) { } private ExpressionBase convertLetStatement ( LetStatement stmt , Set < XpandDefinitionName > referencedDefinitions ) { } private ExpressionBase convertFileStatement ( FileStatement stmt , Set < XpandDefinitionName > referencedDefinitions ) { } private ExpressionBase convertProtectStatement ( ProtectStatement stmt , Set < XpandDefinitionName > referencedDefinitions ) { } private ExpressionBase convertTextStatement ( TextStatement stmt ) { } private SourcePos getSourcePos ( SyntaxElement stmt ) { } private ExpressionBase convertExpression ( Expression expr ) { } private List < Type > getAdviceLocalVarTypes ( TypeSystem ts ) { } }

Fix:
return new org . eclipse . xtend . backend . functions . SourceDefinedFunction ( new org . eclipse . xtend . backend . common . QualifiedName ( def . getFileName ( ) . replaceAll ( "//" , NS_DELIM ) , def . getName ( ) ) , paramNames , paramTypes , convertStatementSequence ( def . getBody ( ) , def , referencedDefinitions ) , false , null ) ;