Buggy code:
public static String quantoCoreExecutable = "quanto-core" ; private LoggingInputStream dbgInputStream ; private LoggingOutputStream dbgOutputStream ; private RequestWriter writer ; private ProtocolReader reader ; private Process backend ; private int nextRequestId = 1 ; public ProtocolManager ( ) throws CoreException { } public void startCore ( ) throws CoreException { } private CoreCommunicationException writeFailure ( Throwable e ) { } private CoreCommunicationException readFailure ( Throwable e ) { } private static class ProcessCleanupThread extends Thread { private Process process ; public ProcessCleanupThread ( Process process ) { } @ Override public void run ( ) { } } public void killCore ( ) { } private String generateRequestId ( ) { } private CommandException errorResponseToException ( String code , String message ) { } private Response getResponse ( Response . MessageType expectedType ) throws CoreException { } private void getOkResponse ( ) throws CoreException { } private String getNameResponse ( ) throws CoreException { } private String [ ] getNameListResponse ( ) throws CoreException { } private byte [ ] getRawDataResponse ( ) throws CoreException { } private String getXmlResponse ( ) throws CoreException { } private int getCountResponse ( ) throws CoreException { } public String consoleCommand ( String command ) throws CoreException { } public String [ ] consoleCommandList ( ) throws CoreException { } public String [ ] consoleHelp ( String command ) throws CoreException { } public void changeTheory ( String theory ) throws CoreException { } public String currentTheory ( ) throws CoreException { } public String [ ] listGraphs ( ) throws CoreException { } public String loadEmptyGraph ( ) throws CoreException { } public String loadEmptyGraph ( String suggestedName ) throws CoreException { } public String loadGraphFromFile ( String fileName ) throws CoreException { } public String loadGraphFromData ( String suggestedName , byte [ ] data ) throws CoreException { } public String copyGraph ( String graph ) throws CoreException { } public void copySubgraphAndOverwrite ( String from , String to , Collection < String > vertexNames ) throws CoreException { } public void saveGraphToFile ( String graph , String filename ) throws CoreException { } public String renameGraph ( String from , String to ) throws CoreException { } public void discardGraph ( String graph ) throws CoreException { } public byte [ ] saveGraphToData ( String graph ) throws CoreException { } public enum GraphExportFormat { HilbertTerm , Mathematica , Matlab , Tikz ; } public String exportGraph ( String graph , ProtocolManager . GraphExportFormat format ) throws CoreException { } public String exportGraphAsXml ( String graph ) throws CoreException { } public String [ ] listVertices ( String graph ) throws CoreException { } public String graphUserData ( String graph , String dataName ) throws CoreException { } public String [ ] listEdges ( String graph ) throws CoreException { } public String [ ] listBangBoxes ( String graph ) throws CoreException { } public String vertexDataAsXml ( String graph , String vertex ) throws CoreException { } public String vertexUserData ( String graph , String vertex , String dataName ) throws CoreException { } public String edgeDataAsXml ( String graph , String edge ) throws CoreException { } public String edgeUserData ( String graph , String edge ) throws CoreException { } public String [ ] bangBoxVertices ( String graph , String bangBox ) throws CoreException { } public String bangBoxUserData ( String graph , String bangBox ) throws CoreException { } public void undo ( String graph ) throws CoreException { } public void redo ( String graph ) throws CoreException { } <START_BUG> public void insertGraph ( String target , String source ) throws CoreException { <END_BUG> if ( ( backend ) == null ) { throw new IllegalStateException ( "The<seq2seq4repair_space>core<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>running" ) ; } try { writer . addHeader ( "GMI" , generateRequestId ( ) ) ; writer . addStringArg ( target ) ; writer . addStringArg ( source ) ; writer . closeMessage ( ) ; } catch ( IOException ex ) { throw writeFailure ( ex ) ; } getOkResponse ( ) ; } public void setGraphUserData ( String graph , String dataName , String data ) throws CoreException { } public String addVertex ( String graph , String vertexType ) throws CoreException { } public String [ ] renameVertex ( String graph , String from , String to ) throws CoreException { } public void deleteVertices ( String graph , Collection < String > vertices ) throws CoreException { } public void setVertexData ( String graph , String vertex , String data ) throws CoreException { } public void setVertexUserData ( String graph , String vertex , String dataName , String data ) throws CoreException { } public String addEdge ( String graph , String edgeType , boolean directed , String sourceVertex , String targetVertex ) throws CoreException { } public String renameEdge ( String graph , String from , String to ) throws CoreException { } public void deleteEdges ( String graph , Collection < String > edges ) throws CoreException { } public void setEdgeData ( String graph , String edge , String data ) throws CoreException { } public void setEdgeUserData ( String graph , String edge , String data ) throws CoreException { } public String addBangBox ( String graph , Collection < String > vertices ) throws CoreException { } public void renameBangBox ( String graph , String from , String to ) throws CoreException { } public void dropBangBoxes ( String graph , Collection < String > bangBoxes ) throws CoreException { } public void killBangBoxes ( String graph , Collection < String > bangBoxes ) throws CoreException { } public String duplicateBangBox ( String graph , String bangBox ) throws CoreException { } public String mergeBangBoxes ( String graph , Collection < String > bangBoxes ) throws CoreException { } public void bangVertices ( String graph , String bangBox , Collection < String > vertices ) throws CoreException { }

Fix:
public void insertGraph ( String source , String target ) throws CoreException {