Program: 75020
Project: 75020
Buggy source:
protected void _update(){
  if (!_needRefactoring)   return;
  IFile file=(IFile)getEditorInput().getAdapter(IFile.class);
  IFile previewFile=((IFileEditorInput)_preview.getEditorInput()).getFile();
  PipedOutputStream outputStream=new PipedOutputStream();
  OutputStreamWriter writer=new OutputStreamWriter(outputStream);
  try {
    Environment.createFolders(previewFile.getParent());
    IPreferenceStore store=EclipsePlugin.getDefault().getPreferenceStore();
    boolean overwrite=store.getBoolean(PreferenceConstants.BACKTRACK_OVERWRITE);
    if (!overwrite && previewFile.exists() && previewFile.isLocal(0)) {
      OutputConsole.outputError("String_Node_Str" + previewFile.getLocation().toOSString() + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
      return;
    }
    PipedInputStream inputStream=new PipedInputStream(outputStream);
    CompilationUnit compilationUnit=_getCompilationUnit();
    new RefactoredOutputThread(previewFile,inputStream).start();
    String[] classPaths=null;
    String[] PTClassPaths=Environment.getClassPaths(null);
    String[] extraClassPaths=new String[0];
    if (file.getProject() != null)     extraClassPaths=new String[]{file.getProject().getLocation().toOSString()};
    if (!Environment.setupTransformerArguments(_container.getShell(),false,true)) {
      OutputConsole.outputError("String_Node_Str");
      return;
    }
    BusyIndicator.showWhile(Display.getCurrent(),new TransformerRunnable(file.getName(),compilationUnit,writer,Environment.combineArrays(PTClassPaths,extraClassPaths),new String[]{}));
    _needRefactoring=false;
  }
 catch (  Exception e) {
    OutputConsole.outputError(e.getMessage());
  }
 finally {
    try {
      writer.close();
      _preview.setInput(new FileEditorInput(previewFile));
    }
 catch (    Exception e) {
      OutputConsole.outputError(e.getMessage());
    }
  }
}

Fixed version (ground truth):
protected void _update(){
  if (!_needRefactoring)   return;
  String PTII=Environment.getPtolemyHome(_container.getShell());
  if (PTII == null)   return;
  String root=Environment.getRefactoringRoot(_container.getShell());
  if (root == null)   return;
  IPreferenceStore store=EclipsePlugin.getDefault().getPreferenceStore();
  IFile file=(IFile)getEditorInput().getAdapter(IFile.class);
  IFile previewFile=((IFileEditorInput)_preview.getEditorInput()).getFile();
  PipedOutputStream outputStream=new PipedOutputStream();
  OutputStreamWriter writer=new OutputStreamWriter(outputStream);
  try {
    Environment.createFolders(previewFile.getParent());
    boolean overwrite=store.getBoolean(PreferenceConstants.BACKTRACK_OVERWRITE);
    if (!overwrite && previewFile.exists() && previewFile.isLocal(0)) {
      OutputConsole.outputError("String_Node_Str" + previewFile.getLocation().toOSString() + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
      return;
    }
    PipedInputStream inputStream=new PipedInputStream(outputStream);
    CompilationUnit compilationUnit=_getCompilationUnit();
    new RefactoredOutputThread(previewFile,inputStream).start();
    String[] classPaths=null;
    String[] PTClassPaths=Environment.getClassPaths(null);
    String[] extraClassPaths=new String[0];
    if (file.getProject() != null)     extraClassPaths=new String[]{file.getProject().getLocation().toOSString()};
    String extraClassPathsInOptions=store.getString(PreferenceConstants.BACKTRACK_EXTRA_CLASSPATHS);
    if (!extraClassPathsInOptions.equals("String_Node_Str"))     extraClassPaths=Strings.combineArrays(extraClassPaths,Strings.decodeFileNames(extraClassPathsInOptions));
    if (!Environment.setupTransformerArguments(_container.getShell(),false,true)) {
      OutputConsole.outputError("String_Node_Str");
      return;
    }
    BusyIndicator.showWhile(Display.getCurrent(),new TransformerRunnable(file.getName(),compilationUnit,writer,Strings.combineArrays(PTClassPaths,extraClassPaths),new String[]{}));
    _needRefactoring=false;
  }
 catch (  Exception e) {
    OutputConsole.outputError(e.getMessage());
  }
 finally {
    try {
      writer.close();
      _preview.setInput(new FileEditorInput(previewFile));
    }
 catch (    Exception e) {
      OutputConsole.outputError(e.getMessage());
    }
  }
}