Buggy code:
public class XtendBatchCompiler { private static final class SeverityFilter implements Predicate < Issue > { private static final XtendBatchCompiler . SeverityFilter WARNING = new XtendBatchCompiler . SeverityFilter ( Severity . WARNING ) ; private static final XtendBatchCompiler . SeverityFilter ERROR = new XtendBatchCompiler . SeverityFilter ( Severity . ERROR ) ; private Severity severity ; private SeverityFilter ( Severity severity ) { } @ Override public boolean apply ( Issue issue ) { } } private static final Logger log = Logger . getLogger ( XtendBatchCompiler . class . getName ( ) ) ; protected static final FileFilter ACCEPT_ALL_FILTER = new FileFilter ( ) { @ Override public boolean accept ( File pathname ) { } } ; protected Provider < ResourceSet > resourceSetProvider ; @ Inject protected Provider < JavaIoFileSystemAccess > javaIoFileSystemAccessProvider ; @ Inject protected FileExtensionProvider fileExtensionProvider ; @ Inject protected Provider < ResourceSetBasedResourceDescriptions > resourceSetDescriptionsProvider ; @ Inject private IGenerator generator ; @ Inject private IndexedJvmTypeAccess indexedJvmTypeAccess ; @ Inject private ProcessorInstanceForJvmTypeProvider annotationProcessorFactory ; @ Inject private Runtime encodingProvider ; @ Inject private Manager resourceDescriptionManager ; @ Inject private RuntimeWorkspaceConfigProvider workspaceConfigProvider ; @ Inject private CompilerPhases compilerPhases ; @ Inject private IStubGenerator stubGenerator ; protected Writer outputWriter ; protected Writer errorWriter ; protected String sourcePath ; protected String classPath ; protected String bootClassPath ; protected boolean useCurrentClassLoaderAsParent ; protected String outputPath ; protected String fileEncoding ; protected String complianceLevel = "1.6" ; protected boolean verbose = false ; protected String tempDirectory = System . getProperty ( "java.io.tmpdir" ) ; protected boolean deleteTempDirectory = true ; protected List < File > tempFolders = Lists . newArrayList ( ) ; protected boolean writeTraceFiles = true ; protected boolean writeStorageFiles = false ; protected ClassLoader currentClassLoader = getClass ( ) . getClassLoader ( ) ; private URI baseURI ; public void setCurrentClassLoader ( ClassLoader currentClassLoader ) { } public void setUseCurrentClassLoaderAsParent ( boolean useCurrentClassLoaderAsParent ) { } public String getTempDirectory ( ) { } public void setTempDirectory ( String tempDirectory ) { } public boolean isWriteTraceFiles ( ) { } public void setWriteTraceFiles ( boolean writeTraceFiles ) { } public boolean isWriteStorageFiles ( ) { } public void setWriteStorageFiles ( boolean writeStorageFiles ) { } @ Inject public void setResourceSetProvider ( Provider < ResourceSet > resourceSetProvider ) { } public boolean isDeleteTempDirectory ( ) { } public void setDeleteTempDirectory ( boolean deletetempDirectory ) { } public Writer getOutputWriter ( ) { } public void setOutputWriter ( Writer ouputWriter ) { } public Writer getErrorWriter ( ) { } public void setErrorWriter ( Writer errorWriter ) { } public void setClassPath ( String classPath ) { } public void setBootClassPath ( String bootClassPath ) { } public void setBasePath ( String basePath ) { } public void setOutputPath ( String outputPath ) { } public void setSourcePath ( String sourcePath ) { } protected String getComplianceLevel ( ) { } public void setComplianceLevel ( String complianceLevel ) { } public void setVerbose ( boolean verbose ) { } protected boolean isVerbose ( ) { } public String getFileEncoding ( ) { } public void setFileEncoding ( String encoding ) { } public boolean configureWorkspace ( ) { } private File getOutputPathFile ( ) { } private List < File > getSourcePathFileList ( ) { } private File determineCommonRoot ( File outputFile , List < File > sourceFileList ) { } public boolean compile ( ) { } protected ResourceSet loadXtendFiles ( final ResourceSet resourceSet ) { } @ Deprecated protected ResourceSet loadXtendFiles ( ) { } protected File createStubs ( ResourceSet resourceSet ) { } protected boolean preCompileStubs ( File tmpSourceDirectory , File classDirectory ) { } protected boolean preCompileJava ( File tmpSourceDirectory , File classDirectory ) { } protected boolean preCompile ( File classDirectory , Iterable < String > sourcePathDirectories , Iterable < String > classPathEntries ) { } protected List < Issue > validate ( ResourceSet resourceSet ) { } protected boolean isSourceFile ( Resource resource ) { } @ Deprecated protected void installJvmTypeProvider ( ResourceSet resourceSet , File tmpClassDirectory ) { } protected void installJvmTypeProvider ( ResourceSet resourceSet , File tmpClassDirectory , boolean skipIndexLookup ) { } private void internalInstallJvmTypeProvider ( ResourceSet resourceSet , File tmpClassDirectory , boolean skipIndexLookup ) { } protected void reportIssues ( Iterable < Issue > issues ) { for ( Issue issue : issues ) { StringBuilder issueBuilder = createIssueMessage ( issue ) ; if ( ( Severity . ERROR ) == ( issue . getSeverity ( ) ) ) { <START_BUG> XtendBatchCompiler . log . error ( issueBuilder . toString ( ) ) ; <END_BUG> } else if ( ( Severity . WARNING ) == ( issue . getSeverity ( ) ) ) { XtendBatchCompiler . log . warn ( issueBuilder . toString ( ) ) ; } } } private StringBuilder createIssueMessage ( Issue issue ) { } protected void generateJavaFiles ( ResourceSet resourceSet ) { } protected ResourceSetBasedResourceDescriptions getResourceDescriptions ( ResourceSet resourceSet ) { } protected XtendFile getXtendFile ( Resource resource ) { } protected List < String > getClassPathEntries ( ) { } protected List < String > getBootClassPathEntries ( ) { } protected List < String > getSourcePathDirectories ( ) { } protected List < String > getDirectories ( String path ) { } protected File createTempDir ( String prefix ) { } protected void deleteTmpFolders ( ) { } protected static boolean cleanFolder ( File parentFolder , FileFilter filter , boolean continueOnError , boolean deleteParentFolder ) { } }

Fix:
new PrintWriter ( getErrorWriter ( ) ) . append ( issueBuilder . toString ( ) ) ;