Buggy code:
public class CovReport extends CovBase { private String format = null ; private File tofile = null ; private String type = null ; private Integer percent = null ; private String filters = null ; private File snapshot = null ; private Path sourcePath = null ; private boolean includeSource = true ; private Path coveragePath = null ; private CovReport . Reference reference = null ; public static class ReportFormat extends EnumeratedAttribute { public String [ ] getValues ( ) { } } public void setFormat ( CovReport . ReportFormat value ) { } public static class ReportType extends EnumeratedAttribute { public String [ ] getValues ( ) { } } public void setType ( CovReport . ReportType value ) { } public void setIncludesource ( boolean value ) { } public void setPercent ( Integer value ) { } public void setFilters ( String values ) { } public Path createSourcepath ( ) { } public void setSnapshot ( File value ) { } public void setTofile ( File value ) { } public Path createCoveragepath ( ) { } public CovReport . Reference createReference ( ) { } public CovReport ( ) { } protected void checkOptions ( ) throws BuildException { } public void execute ( ) throws BuildException { } protected String [ ] getParameters ( ) { } public class Reference { protected Path classPath ; protected ReportFilters filters ; public Path createClasspath ( ) { } public ReportFilters createFilters ( ) { } protected void createEnhancedXMLReport ( ) throws BuildException { if ( ( classPath ) == null ) { throw new BuildException ( "Need<seq2seq4repair_space>a<seq2seq4repair_space>'classpath'<seq2seq4repair_space>element." ) ; } String [ ] paths = classPath . list ( ) ; if ( ( paths . length ) == 0 ) { throw new BuildException ( "Coverage<seq2seq4repair_space>path<seq2seq4repair_space>is<seq2seq4repair_space>invalid.<seq2seq4repair_space>It<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>contain<seq2seq4repair_space>any<seq2seq4repair_space>existing<seq2seq4repair_space>path." ) ; } if ( ( ( filters ) == null ) || ( ( filters . size ( ) ) == 0 ) ) { createFilters ( ) ; log ( "Adding<seq2seq4repair_space>default<seq2seq4repair_space>include<seq2seq4repair_space>filter<seq2seq4repair_space>to<seq2seq4repair_space>*.*()" , MSG_VERBOSE ) ; ReportFilters . Include include = new ReportFilters . Include ( ) ; filters . addInclude ( include ) ; } try { log ( "Creating<seq2seq4repair_space>enhanced<seq2seq4repair_space>XML<seq2seq4repair_space>report" , MSG_VERBOSE ) ; XMLReport report = new XMLReport ( CovReport . this , tofile ) ; report . setReportFilters ( filters ) ; report . setJProbehome ( new File ( getHome ( ) . getParent ( ) ) ) ; Document doc = report . createDocument ( paths ) ; TransformerFactory tfactory = TransformerFactory . newInstance ( ) ; Transformer transformer = tfactory . newTransformer ( ) ; transformer . setOutputProperty ( OutputKeys . INDENT , "yes" ) ; transformer . setOutputProperty ( OutputKeys . METHOD , "xml" ) ; Source src = new DOMSource ( doc ) ; <START_BUG> Result res = new StreamResult ( ( "file://////" + ( tofile . toString ( ) ) ) ) ; <END_BUG> transformer . transform ( src , res ) ; } catch ( Exception e ) { throw new BuildException ( ( ( "Error<seq2seq4repair_space>while<seq2seq4repair_space>performing<seq2seq4repair_space>enhanced<seq2seq4repair_space>XML<seq2seq4repair_space>" + "report<seq2seq4repair_space>from<seq2seq4repair_space>file<seq2seq4repair_space>" ) + ( tofile ) ) , e ) ; } } } }

Fix:
Result res = new StreamResult ( tofile ) ;