Buggy code:
public class ClassScopedMetadataProviderNativeGenerator implements Generator { @ Override public void generate ( GeneratorContext context , SourceWriter writer , MethodReference methodRef ) throws IOException { ClassReader cls = context . getClassSource ( ) . get ( methodRef . getClassName ( ) ) ; MethodReader method = cls . getMethod ( methodRef . getDescriptor ( ) ) ; AnnotationReader providerAnnot = method . getAnnotations ( ) . get ( ClassScopedMetadataProvider . class . getName ( ) ) ; if ( providerAnnot == null ) { return ; } if ( ! ( method . hasModifier ( NATIVE ) ) ) { context . getDiagnostics ( ) . error ( new CallLocation ( methodRef ) , ( "Method<seq2seq4repair_space>{{m0}}<seq2seq4repair_space>is<seq2seq4repair_space>marked<seq2seq4repair_space>with<seq2seq4repair_space>" + "{{c1}}<seq2seq4repair_space>annotation,<seq2seq4repair_space>but<seq2seq4repair_space>it<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>native" ) , methodRef , ClassScopedMetadataProvider . class . getName ( ) ) ; return ; } ValueType generatorType = providerAnnot . getValue ( "value" ) . getJavaClass ( ) ; String generatorClassName = ( ( ValueType . Object ) ( generatorType ) ) . getClassName ( ) ; Class < ? > generatorClass ; try { generatorClass = Class . forName ( generatorClassName , true , context . getClassLoader ( ) ) ; } catch ( ClassNotFoundException e ) { context . getDiagnostics ( ) . error ( new CallLocation ( methodRef ) , "Can't<seq2seq4repair_space>find<seq2seq4repair_space>metadata<seq2seq4repair_space>provider<seq2seq4repair_space>class<seq2seq4repair_space>{{c0}}" , generatorClassName ) ; return ; } Constructor < ? > cons ; try { cons = generatorClass . getConstructor ( ) ; } catch ( NoSuchMethodException e ) { context . getDiagnostics ( ) . error ( new CallLocation ( methodRef ) , ( "Metadata<seq2seq4repair_space>generator<seq2seq4repair_space>{{c0}}<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>have<seq2seq4repair_space>" + "a<seq2seq4repair_space>public<seq2seq4repair_space>no-arg<seq2seq4repair_space>constructor" ) , generatorClassName ) ; return ; } ClassScopedMetadataGenerator generator ; try { generator = ( ( ClassScopedMetadataGenerator ) ( cons . newInstance ( ) ) ) ; } catch ( IllegalAccessException | InstantiationException | InvocationTargetException e ) { context . getDiagnostics ( ) . error ( new CallLocation ( methodRef ) , ( "Error<seq2seq4repair_space>instantiating<seq2seq4repair_space>metadata<seq2seq4repair_space>" + "generator<seq2seq4repair_space>{{c0}}" ) , generatorClassName ) ; return ; } DefaultMetadataGeneratorContext metadataContext = new DefaultMetadataGeneratorContext ( context . getClassSource ( ) , context . getClassLoader ( ) , context . getProperties ( ) , context ) ; Map < String , Resource > resourceMap = generator . generateMetadata ( metadataContext , methodRef ) ; writer . append ( "var<seq2seq4repair_space>p" ) . ws ( ) . append ( "=" ) . ws ( ) . append ( ( ( "\"" + ( Renderer . escapeString ( ( "$$res_" + ( writer . getNaming ( ) . getFullNameFor ( methodRef ) ) ) ) ) ) + "\"" ) ) . append ( ";" ) . softNewLine ( ) ; for ( Map . Entry < String , Resource > entry : resourceMap . entrySet ( ) ) { writer . appendClass ( entry . getKey ( ) ) . append ( "[p]" ) . ws ( ) . append ( "=" ) . ws ( ) ; ResourceWriterHelper . write ( writer , entry . getValue ( ) ) ; writer . append ( ";" ) . softNewLine ( ) ; } writer . appendMethodBody ( methodRef ) . ws ( ) . append ( '=' ) . ws ( ) . append ( "function(cls)" ) . ws ( ) . append ( "{" ) . softNewLine ( ) . indent ( ) ; writer . append ( "return<seq2seq4repair_space>cls.hasOwnProperty(p)" ) . ws ( ) . append ( "?" ) . ws ( ) . append ( "cls[p]" ) . ws ( ) . append ( ":" ) . ws ( ) . append ( "null;" ) . softNewLine ( ) ; <START_BUG> writer . outdent ( ) . append ( "}" ) . softNewLine ( ) ; <END_BUG> writer . append ( "return<seq2seq4repair_space>" ) . appendMethodBody ( methodRef ) . append ( "(" ) . append ( context . getParameterName ( 1 ) ) . append ( ");" ) . softNewLine ( ) ; } }

Fix:
writer . outdent ( ) . append ( "};" ) . softNewLine ( ) ;