Buggy code:
class JavaModel { static JavaModel from ( TypeGraph typeGraph , Element rootElement ) { } private static String extractPackageName ( String fullClassNameAndMaybeMethod ) { } private static String extractFullClassName ( String fullClassNameAndMaybeMethod ) { } private static String extractSimpleClassName ( String fullClassNameAndMaybeMethod ) { } private static String extractMethodName ( String fullClassNameAndMaybeMethod ) { } private static String computeJavaGetterName ( String javaFieldName , String type ) { } private static String computeJavaSetterName ( String javaFieldName ) { } private static String indent ( String input ) { } static class Generator implements TypeVisitor { private final JavaModel javaModel ; private final Element rootElement ; private TypeGraph typeGraph ; private Generator ( JavaModel javaModel , TypeGraph typeGraph , Element rootElement ) { } private static < T > List < T > evalXpath ( Object context , String xpath , Filter < T > filter , Namespace ... namespaces ) { } @ Override public void visitProcedureSignature ( ProcedureSignature type ) { } @ Override public void visitFunctionSignature ( FunctionSignature type ) { } private static void generateParameters ( AbstractSignature type , Element typeElement , String representation , JavaModel . ImportModel importModel , JavaModel . MethodModel methodModel ) { } @ Override public void visitRecord ( RecordType type ) { String name = type . getName ( ) ; Element typeElement = JavaModel . Generator . evalXpath ( rootElement , ( ( "record[@name='" + name ) + "']" ) , element ( ) ) . stream ( ) . collect ( Utils . findOnly ( ) ) . get ( ) ; List < String > representations = typeElement . getAdditionalNamespaces ( ) . stream ( ) . map ( ( n ) -> n . getURI ( ) ) . collect ( Collectors . toList ( ) ) ; for ( String representation : representations ) { String className = representation ; JavaModel . ClassModel classModel = javaModel . classes . computeIfAbsent ( className , ( cn ) -> new JavaModel . ClassModel ( cn , false ) ) ; for ( Map . Entry < String , AbstractType > fieldEntry : type . getFields ( ) . entrySet ( ) ) { String fieldName = fieldEntry . getKey ( ) ; AbstractType fieldType = fieldEntry . getValue ( ) ; String javaTypeStringAndFieldName = JavaModel . Generator . evalXpath ( typeElement , ( ( "field[@name='" + fieldName ) + "']//@ns:type" ) , attribute ( ) , Namespace . getNamespace ( "ns" , representation ) ) . stream ( ) . findFirst ( ) . get ( ) . getValue ( ) . replace ( '[' , '<' ) . replace ( ']' , '>' ) ; int space = javaTypeStringAndFieldName . indexOf ( '<seq2seq4repair_space>' ) ; String javaTypeString = javaTypeStringAndFieldName . substring ( 0 , ( space == ( - 1 ) ? javaTypeStringAndFieldName . length ( ) : space ) ) ; String javaFieldName = ( space == ( - 1 ) ) ? fieldName : javaTypeStringAndFieldName . substring ( ( space + 1 ) ) ; JavaModel . FieldModel fieldModel = classModel . fields . computeIfAbsent ( javaFieldName , ( fn ) -> new JavaModel . FieldModel ( EnumSet . of ( Modifier . PRIVATE ) , fn ) ) ; fieldModel . type = fieldType . accept ( new JavaModel . ComputeJavaType ( classModel . importModel ) , javaTypeString ) ; String javaGetterName = JavaModel . computeJavaGetterName ( javaFieldName , fieldModel . type ) ; JavaModel . MethodModel getterModel = classModel . methods . computeIfAbsent ( javaGetterName , ( mn ) -> new JavaModel . MethodModel ( EnumSet . of ( Modifier . PUBLIC ) , mn , String . format ( "return<seq2seq4repair_space>%s;" , javaFieldName ) ) ) ; String javaSetterName = JavaModel . computeJavaSetterName ( javaFieldName ) ; JavaModel . MethodModel setterModel = classModel . methods . computeIfAbsent ( javaSetterName , ( mn ) -> new JavaModel . MethodModel ( EnumSet . of ( Modifier . PUBLIC ) , mn , String . format ( "this.%1$s<seq2seq4repair_space>=<seq2seq4repair_space>%1$s;" , javaFieldName ) ) ) ; setterModel . parameters . computeIfAbsent ( javaFieldName , ( pn ) -> { JavaModel . ParameterModel pm = new JavaModel . ParameterModel ( pn ) ; <START_BUG> pm . type = fieldModel . type ; <END_BUG> return pm ; } ) ; } } } @ Override public void visitVarray ( VarrayType type ) { } @ Override public void visitNestedTable ( NestedTableType type ) { } @ Override public void visitIndexByTable ( IndexByTableType type ) { } @ Override public void visitPrimitive ( AbstractPrimitiveType type ) { } } static class ComputeJavaAnnotation implements TypeVisitorR < String > { private final JavaModel . ImportModel importModel ; ComputeJavaAnnotation ( JavaModel . ImportModel importModel ) { } @ Override public String visitProcedureSignature ( ProcedureSignature type ) { } @ Override public String visitFunctionSignature ( FunctionSignature type ) { } @ Override public String visitRecord ( RecordType type ) { return "" ; } @ Override public String visitVarray ( VarrayType type ) { } @ Override public String visitNestedTable ( NestedTableType type ) { } @ Override public String visitIndexByTable ( IndexByTableType type ) { } @ Override public String visitPrimitive ( AbstractPrimitiveType type ) { } static String annotationStateToString ( Annotation a ) { } } static class ComputeJavaType implements TypeVisitorAR < String , String > { private final JavaModel . ImportModel importModel ; private final JavaModel . ComputeJavaAnnotation computeJavaAnnotation ; public ComputeJavaType ( JavaModel . ImportModel importModel ) { } private static int findJavaArrayElementDeclarationInsertionPoint ( String elementJavaType ) { } @ Override public String visitProcedureSignature ( ProcedureSignature type , String typeString ) { } @ Override public String visitFunctionSignature ( FunctionSignature type , String typeString ) { } @ Override public String visitRecord ( RecordType type , String typeString ) { } @ Override public String visitVarray ( VarrayType type , String typeString ) { } @ Override public String visitNestedTable ( NestedTableType type , String typeString ) { }

Fix:
pm . type = fieldModel . type . replaceAll ( "<seq2seq4repair_space>?@[A-Za-z0-9_]++(\\([^\\)]*\\))?<seq2seq4repair_space>*+" , "" ) ;