Buggy code:
abstract class OperationsImpl { final UndoAwareMolecularModelManager m3 ; final Set < OWLObjectProperty > importantRelations ; final BeforeSaveModelValidator beforeSaveValidator ; final ExternalLookupService externalLookupService ; final CurieHandler curieHandler ; final Set < IRI > dataPropertyIRIs ; final String defaultModelState ; final boolean useModuleReasoner ; OperationsImpl ( UndoAwareMolecularModelManager models , Set < OWLObjectProperty > importantRelations , ExternalLookupService externalLookupService , String defaultModelState , boolean useModuleReasoner ) { } abstract boolean enforceExternalValidate ( ) { } abstract boolean checkLiteralIdentifiers ( ) { } abstract boolean validateBeforeSave ( ) { } static class BatchHandlerValues { final Set < OWLNamedIndividual > relevantIndividuals = new HashSet < > ( ) ; boolean renderBulk = false ; boolean nonMeta = false ; ModelContainer model = null ; Map < String , OWLNamedIndividual > individualVariable = new HashMap < > ( ) ; public boolean notVariable ( String id ) { } public OWLNamedIndividual getVariableValue ( String id ) throws UnknownIdentifierException { } public void addVariableValue ( String id , OWLNamedIndividual i ) throws UnknownIdentifierException { } } private OWLNamedIndividual getIndividual ( String id , OperationsImpl . BatchHandlerValues values ) throws UnknownIdentifierException { } String handleRequestForIndividual ( M3Request request , Operation operation , String userId , UndoMetadata token , OperationsImpl . BatchHandlerValues values ) throws Exception { } private void handleRemovedAnnotationIRIs ( Set < IRI > iriSets , ModelContainer model , UndoMetadata token ) { } private OWLClassExpression parseM3Expression ( JsonOwlObject expression , OperationsImpl . BatchHandlerValues values ) throws UnknownIdentifierException , MissingParameterException , OWLException { } private OWLObjectProperty getProperty ( String id , OperationsImpl . BatchHandlerValues values ) throws UnknownIdentifierException { } String handleRequestForEdge ( M3Request request , Operation operation , String userId , UndoMetadata token , OperationsImpl . BatchHandlerValues values ) throws Exception { } String handleRequestForModel ( M3Request request , M3BatchResponse response , Operation operation , String userId , UndoMetadata token , OperationsImpl . BatchHandlerValues values ) throws Exception { } private void getCurrentUndoRedoForModel ( M3BatchResponse response , IRI modelId , String userId ) { } private void initMetaResponse ( M3BatchResponse response ) { } void getMeta ( M3BatchResponse response , String userId ) throws IOException , OWLException { } private void export ( M3BatchResponse response , ModelContainer model , String userId ) throws UnknownIdentifierException , OWLOntologyStorageException { } private void exportLegacy ( M3BatchResponse response , ModelContainer model , String format , String userId ) throws IOException , OWLOntologyCreationException { final GafExportTool exportTool = GafExportTool . getInstance ( ) ; <START_BUG> String exportModel = exportTool . exportModelLegacy ( model , useModuleReasoner , format ) ; <END_BUG> initMetaResponse ( response ) ; response . data . exportModel = exportModel ; } private static OWLAnnotation create ( OWLDataFactory f , AnnotationShorthand s , String literal ) { } private static OWLAnnotation create ( OWLDataFactory f , AnnotationShorthand s , OWLAnnotationValue v ) { } public ModelContainer checkModelId ( ModelContainer model , M3Request request ) throws UnknownIdentifierException , OperationsImpl . MultipleModelIdsParameterException , MissingParameterException { } private Set < OWLAnnotation > extract ( JsonAnnotation [ ] values , String userId , OperationsImpl . BatchHandlerValues batchValues , ModelContainer model ) throws UnknownIdentifierException { } private Map < OWLDataProperty , Set < OWLLiteral > > extractDataProperties ( JsonAnnotation [ ] values , ModelContainer model ) { } private void addGeneratedAnnotations ( String userId , Set < OWLAnnotation > annotations , OWLDataFactory f ) { } private Set < OWLAnnotation > addDefaultModelState ( Set < OWLAnnotation > existing , OWLDataFactory f ) { } private void addDateAnnotation ( Set < OWLAnnotation > annotations , OWLDataFactory f ) { } private OWLAnnotation createDateAnnotation ( OWLDataFactory f ) { } private void updateDate ( ModelContainer model , OWLNamedIndividual individual , UndoMetadata token , UndoAwareMolecularModelManager m3 ) throws UnknownIdentifierException { } private void updateAnnotationsForDelete ( DeleteInformation info , ModelContainer model , String userId , UndoMetadata token , UndoAwareMolecularModelManager m3 ) throws UnknownIdentifierException { } private void updateDate ( ModelContainer model , OWLObjectProperty predicate , OWLNamedIndividual subject , OWLNamedIndividual object , UndoMetadata token , UndoAwareMolecularModelManager m3 ) throws UnknownIdentifierException { } private void updateModelAnnotations ( ModelContainer model , String userId , UndoMetadata token , MolecularModelManager < UndoMetadata > m3 ) throws UnknownIdentifierException { } protected String generateDateString ( ) { } private Set < OWLAnnotation > createGeneratedAnnotations ( ModelContainer model , String userId ) { } static class MultipleModelIdsParameterException extends Exception { private static final long serialVersionUID = 4362299465121954598L ; MultipleModelIdsParameterException ( String message ) { } } }

Fix:
String exportModel = exportTool . exportModelLegacy ( model , curieHandler , useModuleReasoner , format ) ;