nus-yam/ex-repair huggingface dataset:
Program: 121402
Project: 121402
Buggy source:
@Override public void run(){
  List<? extends INode> nodes=activeProcess.getGraphicalNodes();
  if (nodes.isEmpty()) {
    return;
  }
  IEditorPart part=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
  if (part.isDirty()) {
    if (part != null && part instanceof AbstractMultiPageTalendEditor) {
      AbstractMultiPageTalendEditor editor=(AbstractMultiPageTalendEditor)part;
      editor.doSave(new NullProgressMonitor());
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  List<? extends INode> nodes=activeProcess.getGraphicalNodes();
  if (nodes.isEmpty()) {
    return;
  }
  IEditorPart part=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
  if (part != null && part.isDirty()) {
    if (part != null && part instanceof AbstractMultiPageTalendEditor) {
      AbstractMultiPageTalendEditor editor=(AbstractMultiPageTalendEditor)part;
      editor.doSave(new NullProgressMonitor());
    }
  }
}
Program: 121405
Project: 121405
Buggy source:
public void endElement(String uri,String localName,String qName) throws SAXException {
  for (  XMLNode node : nodes.getNodesCollection()) {
    if (node.isLooping) {
      if (node.outputText) {
        if (node.hasValue == false) {
          node.addTextValue("String_Node_Str");
        }
        node.hasValue=true;
      }
      if ((node.isAsXML || node.isDot) && (this.currentPath.equals(node.nodePath) || this.currentPath.startsWith(node.nodePath + "String_Node_Str"))) {
        if (node.isAsXML) {
          node.addTextValue("String_Node_Str");
          node.addTextValue(qName);
          node.addTextValue("String_Node_Str");
        }
        if (this.currentPath.equals(node.nodePath)) {
          node.hasValue=true;
        }
      }
    }
    node.outputText=false;
  }
  if (this.currentPath.equals(nodes.getLoopPath())) {
    if (isNotNull(nodes.getNodesCollection(),nodes.size())) {
      Map<String,String> map=new HashMap<String,String>();
      for (      XMLNode node : nodes.getNodesCollection()) {
        map.put(node.originPath,node.getTextValue());
      }
      bufferCache.writeData(map);
    }
    nodes.resetAll();
  }
  this.currentPath=this.currentPath.substring(0,this.currentPath.lastIndexOf("String_Node_Str"));
}

Fixed version (ground truth):
public void endElement(String uri,String localName,String qName) throws SAXException {
  for (  XMLNode node : nodes.getNodesCollection()) {
    if (node.isLooping) {
      if (node.outputText) {
        if (node.hasValue == false) {
          node.addTextValue("String_Node_Str");
        }
        node.hasValue=true;
      }
      if ((node.isAsXML || node.isDot) && (this.currentPath.equals(node.nodePath) || this.currentPath.startsWith(node.nodePath + "String_Node_Str"))) {
        if (node.isAsXML) {
          node.addTextValue("String_Node_Str");
          node.addTextValue(qName);
          node.addTextValue("String_Node_Str");
        }
        if (this.currentPath.equals(node.nodePath)) {
          node.hasValue=true;
        }
      }
    }
    node.outputText=false;
  }
  if (this.currentPath.equals(nodes.getLoopPath())) {
    if (isNotNull(nodes.getNodesCollection(),nodes.size())) {
      Map<String,String> map=new HashMap<String,String>();
      for (      XMLNode node : nodes.getNodesCollection()) {
        map.put(node.originPath,node.getTextValue());
      }
      bufferCache.writeData(map);
      if (stop) {
        throw new EnoughDataException("String_Node_Str");
      }
    }
    nodes.resetAll();
  }
  this.currentPath=this.currentPath.substring(0,this.currentPath.lastIndexOf("String_Node_Str"));
}
Program: 121406
Project: 121406
Buggy source:
public Object call() throws Exception {
  Reader reader=null;
  try {
    DefaultHandler hd=new SimpleSAXLoopHandler(nodes,bcache);
    SAXParser saxParser=null;
    if (!ignoreDTD) {
      saxParser=SAXParserFactory.newInstance().newSAXParser();
    }
 else {
      SAXParserFactory spf=SAXParserFactory.newInstance();
      spf.setFeature("String_Node_Str",false);
      saxParser=spf.newSAXParser();
    }
    saxParser.setProperty("String_Node_Str",hd);
    if (fileURL != null) {
      reader=new UnicodeReader(new java.io.FileInputStream(fileURL),this.charset);
      org.xml.sax.InputSource inSource=new org.xml.sax.InputSource(reader);
      saxParser.parse(inSource,hd);
    }
 else {
      reader=new UnicodeReader(is,this.charset);
      org.xml.sax.InputSource inSource=new org.xml.sax.InputSource(reader);
      saxParser.parse(inSource,hd);
    }
  }
  finally {
    try {
      if (reader != null) {
        reader.close();
      }
    }
  finally {
      bcache.notifyErrorOccurred();
    }
  }
  return null;
}

Fixed version (ground truth):
public Object call() throws Exception {
  Reader reader=null;
  try {
    hd=new SimpleSAXLoopHandler(nodes,bcache);
    SAXParser saxParser=null;
    if (!ignoreDTD) {
      saxParser=SAXParserFactory.newInstance().newSAXParser();
    }
 else {
      SAXParserFactory spf=SAXParserFactory.newInstance();
      spf.setFeature("String_Node_Str",false);
      saxParser=spf.newSAXParser();
    }
    saxParser.setProperty("String_Node_Str",hd);
    if (fileURL != null) {
      reader=new UnicodeReader(new java.io.FileInputStream(fileURL),this.charset);
      org.xml.sax.InputSource inSource=new org.xml.sax.InputSource(reader);
      saxParser.parse(inSource,hd);
    }
 else {
      reader=new UnicodeReader(is,this.charset);
      org.xml.sax.InputSource inSource=new org.xml.sax.InputSource(reader);
      saxParser.parse(inSource,hd);
    }
  }
  finally {
    try {
      if (reader != null) {
        reader.close();
      }
    }
  finally {
      bcache.notifyErrorOccurred();
    }
  }
  return null;
}
Program: 121407
Project: 121407
Buggy source:
private void init(boolean duringLogon){
  removeOldComponentsUserFolder();
  long startTime=System.currentTimeMillis();
  componentList=new HashSet<IComponent>();
  customComponentList=new HashSet<IComponent>();
  skeletonList=new ArrayList<String>();
  userComponentList=new HashSet<IComponent>();
  String installLocation=new Path(Platform.getConfigurationLocation().getURL().getPath()).toFile().getAbsolutePath();
  componentToProviderMap=new HashMap<IComponent,AbstractComponentsProvider>();
  boolean isNeedClean=!cleanDone && TalendCacheUtils.isSetCleanComponentCache();
  cleanDone=true;
  isCreated=hasComponentFile(installLocation) && !isNeedClean;
  ComponentsCache cache=ComponentManager.getComponentCache();
  try {
    if (isCreated) {
      if (cache.getComponentEntryMap().isEmpty()) {
        ComponentsCache loadCache=loadComponentResource(installLocation);
        cache.getComponentEntryMap().putAll(loadCache.getComponentEntryMap());
      }
    }
 else {
      cache.getComponentEntryMap().clear();
    }
  }
 catch (  IOException e) {
    ExceptionHandler.process(e);
    cache.getComponentEntryMap().clear();
    isCreated=false;
  }
  loadComponentsFromComponentsProviderExtension();
  loadComponentsFromExtensions();
  ComponentManager.saveResource();
  TimeMeasure.step("String_Node_Str","String_Node_Str");
  log.debug(componentList.size() + "String_Node_Str" + (System.currentTimeMillis() - startTime)+ "String_Node_Str");
}

Fixed version (ground truth):
private void init(boolean duringLogon){
  removeOldComponentsUserFolder();
  long startTime=System.currentTimeMillis();
  componentList=new HashSet<IComponent>();
  customComponentList=new HashSet<IComponent>();
  skeletonList=new ArrayList<String>();
  userComponentList=new HashSet<IComponent>();
  String installLocation=new Path(Platform.getConfigurationLocation().getURL().getPath()).toFile().getAbsolutePath();
  componentToProviderMap=new HashMap<IComponent,AbstractComponentsProvider>();
  boolean isNeedClean=!cleanDone && TalendCacheUtils.isSetCleanComponentCache();
  cleanDone=true;
  isCreated=hasComponentFile(installLocation) && !isNeedClean;
  ComponentsCache cache=ComponentManager.getComponentCache();
  try {
    if (isCreated) {
      if (cache.getComponentEntryMap().isEmpty()) {
        ComponentsCache loadCache=loadComponentResource(installLocation);
        cache.getComponentEntryMap().putAll(loadCache.getComponentEntryMap());
      }
    }
 else {
      cache.getComponentEntryMap().clear();
    }
  }
 catch (  IOException e) {
    ExceptionHandler.process(e);
    cache.getComponentEntryMap().clear();
    isCreated=false;
  }
  loadComponentsFromComponentsProviderExtension();
  loadComponentsFromExtensions();
  ComponentManager.saveResource();
  log.debug(componentList.size() + "String_Node_Str" + (System.currentTimeMillis() - startTime)+ "String_Node_Str");
}
Program: 121408
Project: 121408
Buggy source:
/** 
 * @see IProgressMonitor#setCanceled
 */
public void setCanceled(boolean b){
  super.setCanceled(b);
  taskName=null;
  runEventLoop();
}

Fixed version (ground truth):
/** 
 * @see IProgressMonitor#setCanceled
 */
@Override public void setCanceled(boolean b){
  super.setCanceled(b);
  taskName=null;
  runEventLoop();
}
Program: 121409
Project: 121409
Buggy source:
/** 
 * @see IProgressMonitor#beginTask
 */
public void beginTask(String name,int totalWork){
  super.beginTask(name,totalWork);
  taskName=name;
  runEventLoop();
}

Fixed version (ground truth):
/** 
 * @see IProgressMonitor#beginTask
 */
@Override public void beginTask(String name,int totalWork){
  super.beginTask(name,totalWork);
  taskName=name;
  runEventLoop();
}
Program: 121410
Project: 121410
Buggy source:
/** 
 * @see IProgressMonitor#isCanceled
 */
public boolean isCanceled(){
  runEventLoop();
  return super.isCanceled();
}

Fixed version (ground truth):
/** 
 * @see IProgressMonitor#isCanceled
 */
@Override public boolean isCanceled(){
  runEventLoop();
  return super.isCanceled();
}
Program: 121411
Project: 121411
Buggy source:
/** 
 * @see IProgressMonitor#subTask
 */
public void subTask(String name){
  if (taskName == null) {
    taskName=name;
  }
  super.subTask(name);
  runEventLoop();
}

Fixed version (ground truth):
/** 
 * @see IProgressMonitor#subTask
 */
@Override public void subTask(String name){
  if (taskName == null) {
    taskName=name;
  }
  super.subTask(name);
  runEventLoop();
}
Program: 121412
Project: 121412
Buggy source:
/** 
 * @see IProgressMonitor#done
 */
public void done(){
  super.done();
  taskName=null;
  runEventLoop();
}

Fixed version (ground truth):
/** 
 * @see IProgressMonitor#done
 */
@Override public void done(){
  super.done();
  taskName=null;
  runEventLoop();
}
Program: 121413
Project: 121413
Buggy source:
/** 
 * Runs an event loop.
 */
private void runEventLoop(){
  long t=System.currentTimeMillis();
  if (t - lastTime < tTHRESH) {
    return;
  }
  lastTime=t;
  Display disp=Display.getDefault();
  if (disp == null) {
    return;
  }
  for (; ; ) {
    try {
      if (!disp.readAndDispatch()) {
        break;
      }
    }
 catch (    SWTException se) {
    }
    if (System.currentTimeMillis() - t > tMAX) {
      break;
    }
  }
}

Fixed version (ground truth):
/** 
 * Runs an event loop.
 */
private void runEventLoop(){
  final long t=System.currentTimeMillis();
  if (t - lastTime < tTHRESH) {
    return;
  }
  lastTime=t;
  if (CommonUIPlugin.isFullyHeadless()) {
    return;
  }
  final Display disp=DisplayUtils.getDisplay();
  if (disp == null) {
    return;
  }
  disp.syncExec(new Runnable(){
    @Override public void run(){
      for (; ; ) {
        try {
          if (!disp.readAndDispatch()) {
            break;
          }
        }
 catch (        SWTException se) {
        }
        if (System.currentTimeMillis() - t > tMAX) {
          break;
        }
      }
    }
  }
);
}
Program: 121414
Project: 121414
Buggy source:
/** 
 * @see IProgressMonitor#setTaskName
 */
public void setTaskName(String name){
  super.setTaskName(name);
  taskName=name;
  runEventLoop();
}

Fixed version (ground truth):
/** 
 * @see IProgressMonitor#setTaskName
 */
@Override public void setTaskName(String name){
  super.setTaskName(name);
  taskName=name;
  runEventLoop();
}
Program: 121415
Project: 121415
Buggy source:
public void clearBlocked(){
  Dialog.getBlockedHandler().clearBlocked();
}

Fixed version (ground truth):
@Override public void clearBlocked(){
  Dialog.getBlockedHandler().clearBlocked();
}
Program: 121416
Project: 121416
Buggy source:
/** 
 * @see IProgressMonitor#worked
 */
public void worked(int work){
  super.worked(work);
  runEventLoop();
}

Fixed version (ground truth):
/** 
 * @see IProgressMonitor#worked
 */
@Override public void worked(int work){
  super.worked(work);
  runEventLoop();
}
Program: 121417
Project: 121417
Buggy source:
/** 
 * @see IProgressMonitor#internalWorked
 */
public void internalWorked(double work){
  super.internalWorked(work);
  runEventLoop();
}

Fixed version (ground truth):
/** 
 * @see IProgressMonitor#internalWorked
 */
@Override public void internalWorked(double work){
  super.internalWorked(work);
  runEventLoop();
}
Program: 121418
Project: 121418
Buggy source:
public void setBlocked(IStatus reason){
  Dialog.getBlockedHandler().showBlocked(this,reason,taskName);
}

Fixed version (ground truth):
@Override public void setBlocked(final IStatus reason){
  if (CommonUIPlugin.isFullyHeadless()) {
    ExceptionHandler.process(reason.getException());
    return;
  }
  final Display disp=DisplayUtils.getDisplay();
  disp.syncExec(new Runnable(){
    @Override public void run(){
      Dialog.getBlockedHandler().showBlocked(CodeGeneratorProgressMonitor.this,reason,taskName);
    }
  }
);
}
Program: 121419
Project: 121419
Buggy source:
public void endElement(String uri,String localName,String qName) throws SAXException {
  for (  XMLNode node : nodes.getNodesCollection()) {
    if (node.isLooping) {
      if (node.outputText) {
        if (node.hasValue == false) {
          node.addTextValue("String_Node_Str");
        }
        node.hasValue=true;
      }
      if ((node.isAsXML || node.isDot) && (this.currentPath.equals(node.nodePath) || this.currentPath.startsWith(node.nodePath + "String_Node_Str"))) {
        if (node.isAsXML) {
          node.addTextValue("String_Node_Str");
          node.addTextValue(qName);
          node.addTextValue("String_Node_Str");
        }
        if (this.currentPath.equals(node.nodePath)) {
          node.hasValue=true;
        }
      }
    }
    node.outputText=false;
  }
  if (this.currentPath.equals(nodes.getLoopPath())) {
    if (isNotNull(nodes.getNodesCollection(),nodes.size())) {
      Map<String,String> map=new HashMap<String,String>();
      for (      XMLNode node : nodes.getNodesCollection()) {
        map.put(node.originPath,node.getTextValue());
      }
      bufferCache.writeData(map);
    }
    nodes.resetAll();
  }
  this.currentPath=this.currentPath.substring(0,this.currentPath.lastIndexOf("String_Node_Str"));
}

Fixed version (ground truth):
public void endElement(String uri,String localName,String qName) throws SAXException {
  for (  XMLNode node : nodes.getNodesCollection()) {
    if (node.isLooping) {
      if (node.outputText) {
        if (node.hasValue == false) {
          node.addTextValue("String_Node_Str");
        }
        node.hasValue=true;
      }
      if ((node.isAsXML || node.isDot) && (this.currentPath.equals(node.nodePath) || this.currentPath.startsWith(node.nodePath + "String_Node_Str"))) {
        if (node.isAsXML) {
          node.addTextValue("String_Node_Str");
          node.addTextValue(qName);
          node.addTextValue("String_Node_Str");
        }
        if (this.currentPath.equals(node.nodePath)) {
          node.hasValue=true;
        }
      }
    }
    node.outputText=false;
  }
  if (this.currentPath.equals(nodes.getLoopPath())) {
    if (isNotNull(nodes.getNodesCollection(),nodes.size())) {
      Map<String,String> map=new HashMap<String,String>();
      for (      XMLNode node : nodes.getNodesCollection()) {
        map.put(node.originPath,node.getTextValue());
      }
      bufferCache.writeData(map);
      if (stop) {
        throw new EnoughDataException("String_Node_Str");
      }
    }
    nodes.resetAll();
  }
  this.currentPath=this.currentPath.substring(0,this.currentPath.lastIndexOf("String_Node_Str"));
}
Program: 121420
Project: 121420
Buggy source:
public Object call() throws Exception {
  Reader reader=null;
  try {
    DefaultHandler hd=new SimpleSAXLoopHandler(nodes,bcache);
    SAXParser saxParser=null;
    if (!ignoreDTD) {
      saxParser=SAXParserFactory.newInstance().newSAXParser();
    }
 else {
      SAXParserFactory spf=SAXParserFactory.newInstance();
      spf.setFeature("String_Node_Str",false);
      saxParser=spf.newSAXParser();
    }
    saxParser.setProperty("String_Node_Str",hd);
    if (fileURL != null) {
      reader=new UnicodeReader(new java.io.FileInputStream(fileURL),this.charset);
      org.xml.sax.InputSource inSource=new org.xml.sax.InputSource(reader);
      saxParser.parse(inSource,hd);
    }
 else {
      reader=new UnicodeReader(is,this.charset);
      org.xml.sax.InputSource inSource=new org.xml.sax.InputSource(reader);
      saxParser.parse(inSource,hd);
    }
  }
  finally {
    try {
      if (reader != null) {
        reader.close();
      }
    }
  finally {
      bcache.notifyErrorOccurred();
    }
  }
  return null;
}

Fixed version (ground truth):
public Object call() throws Exception {
  Reader reader=null;
  try {
    hd=new SimpleSAXLoopHandler(nodes,bcache);
    SAXParser saxParser=null;
    if (!ignoreDTD) {
      saxParser=SAXParserFactory.newInstance().newSAXParser();
    }
 else {
      SAXParserFactory spf=SAXParserFactory.newInstance();
      spf.setFeature("String_Node_Str",false);
      saxParser=spf.newSAXParser();
    }
    saxParser.setProperty("String_Node_Str",hd);
    if (fileURL != null) {
      reader=new UnicodeReader(new java.io.FileInputStream(fileURL),this.charset);
      org.xml.sax.InputSource inSource=new org.xml.sax.InputSource(reader);
      saxParser.parse(inSource,hd);
    }
 else {
      reader=new UnicodeReader(is,this.charset);
      org.xml.sax.InputSource inSource=new org.xml.sax.InputSource(reader);
      saxParser.parse(inSource,hd);
    }
  }
  finally {
    try {
      if (reader != null) {
        reader.close();
      }
    }
  finally {
      bcache.notifyErrorOccurred();
    }
  }
  return null;
}
Program: 121422
Project: 121422
Buggy source:
/** 
 * Set the process on wich we are selecting context.
 * @param process The process.
 */
public void setProcess(final IProcess2 process){
  if (process != null) {
    if (process.equals(this.process)) {
      return;
    }
    this.process=process;
    contextComboViewer.getControl().setEnabled(true);
    getInformationsFromContextManager(process.getContextManager());
    contextListener=new IContextListener(){
      public void contextsChanged(){
        if (!ProcessContextComposite.this.isDisposed()) {
          getInformationsFromContextManager(process.getContextManager());
        }
      }
    }
;
    this.process.getContextManager().addContextListener(contextListener);
    contextComboViewer.addSelectionChangedListener(contextComboListener);
  }
 else {
    if (this.process == null) {
      return;
    }
    if (this.process != null) {
      this.process.getContextManager().removeContextListener(contextListener);
      this.process=null;
    }
    contextComboViewer.getControl().setEnabled(false);
    contextComboViewer.removeSelectionChangedListener(contextComboListener);
    contextComboViewer.setInput(null);
    contextTableViewer.setInput(null);
  }
}

Fixed version (ground truth):
/** 
 * Set the process on wich we are selecting context.
 * @param process The process.
 */
public void setProcess(final IProcess2 process){
  if (process != null) {
    if (process.equals(this.process)) {
      if (checkIsSameContextParameter()) {
        return;
      }
    }
    this.process=process;
    contextComboViewer.getControl().setEnabled(true);
    getInformationsFromContextManager(process.getContextManager());
    contextListener=new IContextListener(){
      public void contextsChanged(){
        if (!ProcessContextComposite.this.isDisposed()) {
          getInformationsFromContextManager(process.getContextManager());
        }
      }
    }
;
    this.process.getContextManager().addContextListener(contextListener);
    contextComboViewer.addSelectionChangedListener(contextComboListener);
  }
 else {
    if (this.process == null) {
      return;
    }
    if (this.process != null) {
      this.process.getContextManager().removeContextListener(contextListener);
      this.process=null;
    }
    contextComboViewer.getControl().setEnabled(false);
    contextComboViewer.removeSelectionChangedListener(contextComboListener);
    contextComboViewer.setInput(null);
    contextTableViewer.setInput(null);
  }
}
Program: 121423
Project: 121423
Buggy source:
@Override protected boolean calculateEnabled(){
  if (getSelectedObjects().isEmpty()) {
    return false;
  }
 else {
    Object s=getSelectedObjects().get(0);
    if (s instanceof List && !((List)s).isEmpty()) {
      List selectedarts=(List)s;
      Object object=selectedarts.get(selectedarts.size() - 1);
      if (object instanceof TreeNodeEditPart) {
        TreeNodeEditPart parentPart=(TreeNodeEditPart)object;
        schemaNode=(TreeNode)parentPart.getModel();
        if (schemaNode.eContainer() instanceof AbstractInOutTree && XmlMapUtil.DOCUMENT.equals(schemaNode.getType())) {
          return true;
        }
      }
    }
  }
  return false;
}

Fixed version (ground truth):
@Override protected boolean calculateEnabled(){
  if (getSelectedObjects().isEmpty()) {
    return false;
  }
 else {
    Object s=getSelectedObjects().get(0);
    if (s instanceof List && !((List)s).isEmpty()) {
      List selectedarts=(List)s;
      Object object=selectedarts.get(selectedarts.size() - 1);
      if (object instanceof TreeNodeEditPart) {
        TreeNodeEditPart parentPart=(TreeNodeEditPart)object;
        schemaNode=(TreeNode)parentPart.getModel();
        if (schemaNode.eContainer() instanceof AbstractInOutTree && XmlMapUtil.DOCUMENT.equals(schemaNode.getType()) && ERepositoryObjectType.METADATA_MDMCONNECTION != null) {
          return true;
        }
      }
    }
  }
  return false;
}
Program: 121424
Project: 121424
Buggy source:
/** 
 * DOC mhirt Comment method "extractTemplateHashCode".
 * @param unit
 * @return
 * @throws MalformedURLException
 * @throws IOException
 */
private static long extractTemplateHashCode(JetBean unit){
  long unitCRC=0;
  URI uri=URI.createURI(unit.getTemplateFullUri());
  uri=CommonPlugin.resolve(uri);
  URL url;
  try {
    url=new URL(uri.toString());
    unitCRC=IOUtils.computeCRConTextFile(url.openStream());
  }
 catch (  Exception e) {
  }
  return unitCRC;
}

Fixed version (ground truth):
/** 
 * DOC mhirt Comment method "extractTemplateHashCode".
 * @param unit
 * @return
 * @throws MalformedURLException
 * @throws IOException
 */
private static long extractTemplateHashCode(JetBean unit){
  long unitCRC=0;
  URI uri=URI.createURI(unit.getTemplateFullUri());
  uri=CommonPlugin.resolve(uri);
  URL url;
  try {
    url=new URL(uri.toString());
    unitCRC=IOUtils.computeCRC(url.openStream());
  }
 catch (  Exception e) {
  }
  return unitCRC;
}
Program: 121425
Project: 121425
Buggy source:
private boolean checkAndUpdateCache(java.io.File file){
  String path=file.getAbsolutePath();
  long currentCRC=0;
  try {
    currentCRC=IOUtils.computeCRConTextFile(new FileInputStream(file));
  }
 catch (  FileNotFoundException e) {
    ExceptionHandler.process(e);
  }
  if (forceSkeletonAlreadyChecked) {
    alreadyCheckedSkeleton.put(path,currentCRC);
    return false;
  }
 else {
    Long lastCheckedCRC=alreadyCheckedSkeleton.get(path);
    boolean isChanged=lastCheckedCRC == null || currentCRC != lastCheckedCRC;
    if (isChanged) {
      alreadyCheckedSkeleton.put(path,currentCRC);
    }
    return isChanged;
  }
}

Fixed version (ground truth):
private boolean checkAndUpdateCache(java.io.File file){
  String path=file.getAbsolutePath();
  long currentCRC=0;
  try {
    currentCRC=IOUtils.computeCRC(new FileInputStream(file));
  }
 catch (  FileNotFoundException e) {
    ExceptionHandler.process(e);
  }
  if (forceSkeletonAlreadyChecked) {
    alreadyCheckedSkeleton.put(path,currentCRC);
    return false;
  }
 else {
    Long lastCheckedCRC=alreadyCheckedSkeleton.get(path);
    boolean isChanged=lastCheckedCRC == null || currentCRC != lastCheckedCRC;
    if (isChanged) {
      alreadyCheckedSkeleton.put(path,currentCRC);
    }
    return isChanged;
  }
}
Program: 121426
Project: 121426
Buggy source:
private void computeProperty(ResourcesManager manager,ItemRecord itemRecord){
  InputStream stream=null;
  try {
    stream=manager.getStream(itemRecord.getPath());
    Resource resource=createResource(itemRecord,itemRecord.getPath(),false);
    resource.load(stream,null);
    itemRecord.setProperty((Property)EcoreUtil.getObjectByType(resource.getContents(),PropertiesPackage.eINSTANCE.getProperty()));
  }
 catch (  IOException e) {
  }
 finally {
    if (stream != null) {
      try {
        stream.close();
      }
 catch (      IOException e) {
      }
    }
  }
}

Fixed version (ground truth):
private void computeProperty(ResourcesManager manager,ItemRecord itemRecord){
  InputStream stream=null;
  try {
    stream=manager.getStream(itemRecord.getPath());
    final Resource resource=createResource(itemRecord,itemRecord.getPath(),false);
    resource.getResourceSet().setURIConverter(new ExtensibleURIConverterImpl(){
      @Override public InputStream createInputStream(      URI uri,      Map<?,?> options) throws IOException {
        InputStream inputStream=null;
        EPackage ePackage=resource.getResourceSet().getPackageRegistry().getEPackage(uri.toString());
        if (ePackage != null || !"String_Node_Str".equals(uri.scheme())) {
          inputStream=super.createInputStream(uri,options);
        }
 else {
          inputStream=null;
        }
        return inputStream;
      }
    }
);
    resource.load(stream,null);
    itemRecord.setProperty((Property)EcoreUtil.getObjectByType(resource.getContents(),PropertiesPackage.eINSTANCE.getProperty()));
  }
 catch (  IOException e) {
  }
 finally {
    if (stream != null) {
      try {
        stream.close();
      }
 catch (      IOException e) {
      }
    }
  }
}
Program: 121430
Project: 121430
Buggy source:
@Override protected void okPressed(){
  IMPORTType type=ComponentFactory.eINSTANCE.createIMPORTType();
  type.setMESSAGE(desText.getText());
  String modelName="String_Node_Str";
  boolean libExists=true;
  ILibraryManagerService libManager=(ILibraryManagerService)GlobalServiceRegister.getDefault().getService(ILibraryManagerService.class);
  if (typeNameRadioButton.getSelection()) {
    modelName=nameText.getText();
    if (libManager.contains(modelName)) {
      final String name=modelName;
      libExists=false;
      Display.getDefault().asyncExec(new Runnable(){
        public void run(){
          MessageDialog.openError(getParentShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str",name));
        }
      }
);
    }
  }
 else {
    file=new File(fileField.getStringValue());
    modelName=file.getName();
  }
  if (libExists) {
    type.setMODULE(modelName);
    type.setREQUIRED(requiredButton.getSelection());
    type.setUrlPath(fileField.getStringValue());
    this.importType=type;
    super.okPressed();
  }
}

Fixed version (ground truth):
@Override protected void okPressed(){
  IMPORTType type=ComponentFactory.eINSTANCE.createIMPORTType();
  type.setMESSAGE(desText.getText());
  String modelName="String_Node_Str";
  boolean libExists=true;
  ILibraryManagerService libManager=(ILibraryManagerService)GlobalServiceRegister.getDefault().getService(ILibraryManagerService.class);
  if (typeNameRadioButton.getSelection()) {
    modelName=nameText.getText();
    if (!libManager.contains(modelName)) {
      final String name=modelName;
      libExists=false;
      Display.getDefault().asyncExec(new Runnable(){
        public void run(){
          MessageDialog.openError(getParentShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str",name));
        }
      }
);
    }
  }
 else {
    file=new File(fileField.getStringValue());
    modelName=file.getName();
  }
  if (libExists) {
    type.setMODULE(modelName);
    type.setREQUIRED(requiredButton.getSelection());
    type.setUrlPath(fileField.getStringValue());
    this.importType=type;
    super.okPressed();
  }
}
Program: 121431
Project: 121431
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  String version=getProperty().getVersion();
  version=VersionUtils.upMinor(version);
  versionText.setText(version);
  newVersion=version;
  updatePageStatus();
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  String version=getProperty().getVersion();
  if (newVersion != null) {
    version=newVersion;
  }
  version=VersionUtils.upMinor(version);
  versionText.setText(version);
  newVersion=version;
  updatePageStatus();
}
Program: 121432
Project: 121432
Buggy source:
private void addListener(){
  createNewVersionButton.addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent e){
    }
    public void widgetSelected(    SelectionEvent e){
      boolean create=createNewVersionButton.getSelection();
      versionModifComposite.setEnabled(create);
      versionListComposite.setEnabled(!create);
      versionMajorBtn.setEnabled(create);
      versionMinorBtn.setEnabled(create);
      createNewVersionJob=create;
      updatePageStatus();
    }
  }
);
  versionMajorBtn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      String version=getProperty().getVersion();
      version=VersionUtils.upMajor(version);
      versionText.setText(version);
      newVersion=version;
      updatePageStatus();
    }
  }
);
  versionMinorBtn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      String version=getProperty().getVersion();
      version=VersionUtils.upMinor(version);
      versionText.setText(version);
      newVersion=version;
      updatePageStatus();
    }
  }
);
}

Fixed version (ground truth):
private void addListener(){
  createNewVersionButton.addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent e){
    }
    public void widgetSelected(    SelectionEvent e){
      boolean create=createNewVersionButton.getSelection();
      versionModifComposite.setEnabled(create);
      versionListComposite.setEnabled(!create);
      versionMajorBtn.setEnabled(create);
      versionMinorBtn.setEnabled(create);
      createNewVersionJob=create;
      updatePageStatus();
    }
  }
);
  versionMajorBtn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      String version=getProperty().getVersion();
      if (newVersion != null) {
        version=newVersion;
      }
      version=VersionUtils.upMajor(version);
      versionText.setText(version);
      newVersion=version;
      updatePageStatus();
    }
  }
);
  versionMinorBtn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      String version=getProperty().getVersion();
      if (newVersion != null) {
        version=newVersion;
      }
      version=VersionUtils.upMinor(version);
      versionText.setText(version);
      newVersion=version;
      updatePageStatus();
    }
  }
);
}
Program: 121435
Project: 121435
Buggy source:
private void computeProperty(ResourcesManager manager,ItemRecord itemRecord){
  InputStream stream=null;
  try {
    stream=manager.getStream(itemRecord.getPath());
    Resource resource=createResource(itemRecord,itemRecord.getPath(),false);
    resource.load(stream,null);
    itemRecord.setProperty((Property)EcoreUtil.getObjectByType(resource.getContents(),PropertiesPackage.eINSTANCE.getProperty()));
  }
 catch (  IOException e) {
  }
 finally {
    if (stream != null) {
      try {
        stream.close();
      }
 catch (      IOException e) {
      }
    }
  }
}

Fixed version (ground truth):
private void computeProperty(ResourcesManager manager,ItemRecord itemRecord){
  InputStream stream=null;
  try {
    stream=manager.getStream(itemRecord.getPath());
    final Resource resource=createResource(itemRecord,itemRecord.getPath(),false);
    resource.getResourceSet().setURIConverter(new ExtensibleURIConverterImpl(){
      @Override public InputStream createInputStream(      URI uri,      Map<?,?> options) throws IOException {
        InputStream inputStream=null;
        EPackage ePackage=resource.getResourceSet().getPackageRegistry().getEPackage(uri.toString());
        if (ePackage != null || !"String_Node_Str".equals(uri.scheme())) {
          inputStream=super.createInputStream(uri,options);
        }
 else {
          inputStream=null;
        }
        return inputStream;
      }
    }
);
    resource.load(stream,null);
    itemRecord.setProperty((Property)EcoreUtil.getObjectByType(resource.getContents(),PropertiesPackage.eINSTANCE.getProperty()));
  }
 catch (  Exception e) {
  }
 finally {
    if (stream != null) {
      try {
        stream.close();
      }
 catch (      IOException e) {
      }
    }
  }
}
Program: 121436
Project: 121436
Buggy source:
@Override public IFile getRoutinesFile(Item item) throws SystemException {
  try {
    if (item instanceof RoutineItem) {
      RoutineItem routineItem=(RoutineItem)item;
      ProjectManager projectManager=ProjectManager.getInstance();
      org.talend.core.model.properties.Project project=projectManager.getProject(routineItem);
      IProject iProject=ResourcesPlugin.getWorkspace().getRoot().getProject(project.getTechnicalLabel());
      String repositoryPath=ERepositoryObjectType.getFolderName(ERepositoryObjectType.ROUTINES);
      String folderPath=RepositoryNodeUtilities.getPath(routineItem.getProperty().getId()).toString();
      String fileName=routineItem.getProperty().getLabel() + "String_Node_Str" + routineItem.getProperty().getVersion()+ JavaUtils.ITEM_EXTENSION;
      String path=null;
      if (folderPath != null && !folderPath.trim().equals("String_Node_Str")) {
        path=repositoryPath + "String_Node_Str" + folderPath+ "String_Node_Str"+ fileName;
      }
 else {
        path=repositoryPath + "String_Node_Str" + fileName;
      }
      IFile file=iProject.getFile(path);
      return file;
    }
  }
 catch (  Exception e) {
    throw new SystemException(e);
  }
  return null;
}

Fixed version (ground truth):
@Override public IFile getRoutinesFile(Item item) throws SystemException {
  try {
    if (item instanceof RoutineItem) {
      RoutineItem routineItem=(RoutineItem)item;
      ProjectManager projectManager=ProjectManager.getInstance();
      org.talend.core.model.properties.Project project=projectManager.getProject(routineItem);
      IProject iProject=ResourcesPlugin.getWorkspace().getRoot().getProject(project.getTechnicalLabel());
      String repositoryPath=ERepositoryObjectType.getFolderName(ERepositoryObjectType.ROUTINES);
      if (item instanceof PigudfItem) {
        repositoryPath=ERepositoryObjectType.getFolderName(ERepositoryObjectType.PIG_UDF);
      }
      String folderPath=RepositoryNodeUtilities.getPath(routineItem.getProperty().getId()).toString();
      String fileName=routineItem.getProperty().getLabel() + "String_Node_Str" + routineItem.getProperty().getVersion()+ JavaUtils.ITEM_EXTENSION;
      String path=null;
      if (folderPath != null && !folderPath.trim().equals("String_Node_Str")) {
        path=repositoryPath + "String_Node_Str" + folderPath+ "String_Node_Str"+ fileName;
      }
 else {
        path=repositoryPath + "String_Node_Str" + fileName;
      }
      IFile file=iProject.getFile(path);
      return file;
    }
  }
 catch (  Exception e) {
    throw new SystemException(e);
  }
  return null;
}
Program: 121449
Project: 121449
Buggy source:
@Override public List<IComponent> getCustomComponents(){
  if (customComponentList == null) {
    init(false);
  }
  return customComponentList;
}

Fixed version (ground truth):
@Override public synchronized List<IComponent> getCustomComponents(){
  if (customComponentList == null) {
    init(false);
  }
  return customComponentList;
}
Program: 121450
Project: 121450
Buggy source:
@Override public Set<IComponent> getComponents(){
  if (componentList == null) {
    init(false);
  }
  return componentList;
}

Fixed version (ground truth):
@Override public synchronized Set<IComponent> getComponents(){
  if (componentList == null) {
    init(false);
  }
  return componentList;
}
Program: 121451
Project: 121451
Buggy source:
public void init(IWorkbench workbench){
}

Fixed version (ground truth):
@Override public void init(IWorkbench workbench){
}
Program: 121452
Project: 121452
Buggy source:
public void createFieldEditors(){
  final Composite parent=getFieldEditorParent();
  filePathTemp=new DirectoryFieldEditor(IComponentPreferenceConstant.USER_COMPONENTS_FOLDER,Messages.getString("String_Node_Str"),parent);
  addField(filePathTemp);
  filePathTemp.getTextControl(parent).addModifyListener(new ModifyListener(){
    String oldPath=getPreferenceStore().getString(IComponentPreferenceConstant.USER_COMPONENTS_FOLDER);
    public void modifyText(    ModifyEvent e){
      String newPath=filePathTemp.getTextControl(parent).getText();
      File file=new File(newPath);
      if (!file.exists()) {
        filePathTemp.showErrorMessage();
        setValid(false);
      }
 else {
        setValid(true);
      }
    }
  }
);
  if (PluginChecker.isPreviewPluginLoaded()) {
    createForDataViewer(parent);
  }
  createForMapper(parent);
  createFortRunJob(parent);
  if (PluginChecker.isJobLetPluginLoaded()) {
    createForJoblet(parent);
  }
  parent.pack();
}

Fixed version (ground truth):
@Override public void createFieldEditors(){
  final Composite parent=getFieldEditorParent();
  filePathTemp=new DirectoryFieldEditor(IComponentPreferenceConstant.USER_COMPONENTS_FOLDER,Messages.getString("String_Node_Str"),parent);
  addField(filePathTemp);
  filePathTemp.getTextControl(parent).addModifyListener(new ModifyListener(){
    String oldPath=getPreferenceStore().getString(IComponentPreferenceConstant.USER_COMPONENTS_FOLDER);
    @Override public void modifyText(    ModifyEvent e){
      String newPath=filePathTemp.getTextControl(parent).getText();
      File file=new File(newPath);
      if (!file.exists()) {
        filePathTemp.showErrorMessage();
        setValid(false);
      }
 else {
        setValid(true);
      }
    }
  }
);
  if (PluginChecker.isPreviewPluginLoaded()) {
    createForDataViewer(parent);
  }
  createForMapper(parent);
  createFortRunJob(parent);
  if (PluginChecker.isJobLetPluginLoaded()) {
    createForJoblet(parent);
  }
  parent.pack();
}
Program: 121453
Project: 121453
Buggy source:
public void run(){
  IComponentsFactory components=ComponentsFactoryProvider.getInstance();
  components.loadUserComponentsFromComponentsProviderExtension();
  CorePlugin.getDefault().getLibrariesService().syncLibraries(monitor);
  monitor.worked(50);
  CorePlugin.getDefault().getLibrariesService().resetModulesNeeded();
  ComponentUtilities.updatePalette();
  ICodeGeneratorService service=(ICodeGeneratorService)GlobalServiceRegister.getDefault().getService(ICodeGeneratorService.class);
  service.refreshTemplates();
  monitor.worked(100);
  monitor.done();
}

Fixed version (ground truth):
@Override public void run(){
  CorePlugin.getDefault().getLibrariesService().resetModulesNeeded();
  monitor.worked(50);
  ICodeGeneratorService service=(ICodeGeneratorService)GlobalServiceRegister.getDefault().getService(ICodeGeneratorService.class);
  Job refreshTemplates=service.refreshTemplates();
  refreshTemplates.addJobChangeListener(new JobChangeAdapter(){
    @Override public void done(    org.eclipse.core.runtime.jobs.IJobChangeEvent event){
      ComponentUtilities.updatePalette();
      monitor.worked(100);
      monitor.done();
    }
  }
);
}
Program: 121454
Project: 121454
Buggy source:
/** 
 * @see org.eclipse.jface.preference.FieldEditor#refreshValidState()
 */
protected void refreshValidState(){
  super.refreshValidState();
}

Fixed version (ground truth):
/** 
 * @see org.eclipse.jface.preference.FieldEditor#refreshValidState()
 */
@Override protected void refreshValidState(){
  super.refreshValidState();
}
Program: 121456
Project: 121456
Buggy source:
public void modifyText(ModifyEvent e){
  String newPath=filePathTemp.getTextControl(parent).getText();
  File file=new File(newPath);
  if (!file.exists()) {
    filePathTemp.showErrorMessage();
    setValid(false);
  }
 else {
    setValid(true);
  }
}

Fixed version (ground truth):
@Override public void modifyText(ModifyEvent e){
  String newPath=filePathTemp.getTextControl(parent).getText();
  File file=new File(newPath);
  if (!file.exists()) {
    filePathTemp.showErrorMessage();
    setValid(false);
  }
 else {
    setValid(true);
  }
}
Program: 121457
Project: 121457
Buggy source:
public void propertyChange(PropertyChangeEvent event){
  if (event.getSource() == filePathTemp) {
  }
 else {
    Object nValue=event.getNewValue();
    if (event.getProperty().equals(FieldEditor.IS_VALID)) {
      boolean newValue=((Boolean)nValue).booleanValue();
      if (newValue) {
        checkState();
      }
 else {
        super.propertyChange(event);
      }
    }
 else {
      super.propertyChange(event);
    }
  }
}

Fixed version (ground truth):
@Override public void propertyChange(PropertyChangeEvent event){
  if (event.getSource() == filePathTemp) {
  }
 else {
    Object nValue=event.getNewValue();
    if (event.getProperty().equals(FieldEditor.IS_VALID)) {
      boolean newValue=((Boolean)nValue).booleanValue();
      if (newValue) {
        checkState();
      }
 else {
        super.propertyChange(event);
      }
    }
 else {
      super.propertyChange(event);
    }
  }
}
Program: 121458
Project: 121458
Buggy source:
/** 
 * Clears the error message from the message line if the error message is the error message from this field editor.
 */
protected void clearErrorMessage(){
  if (canClearErrorMessage()) {
    super.clearErrorMessage();
  }
}

Fixed version (ground truth):
/** 
 * Clears the error message from the message line if the error message is the error message from this field editor.
 */
@Override protected void clearErrorMessage(){
  if (canClearErrorMessage()) {
    super.clearErrorMessage();
  }
}
Program: 121461
Project: 121461
Buggy source:
@Override public void run(final IProgressMonitor monitor) throws CoreException {
  boolean locked=processObject.getRepositoryStatus().equals(ERepositoryStatus.LOCK_BY_USER);
  openAnotherVersion((RepositoryNode)processObject.getRepositoryNode(),!locked);
  try {
    ProxyRepositoryFactory.getInstance().saveProject(ProjectManager.getInstance().getCurrentProject());
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
}

Fixed version (ground truth):
@Override public void run(final IProgressMonitor monitor) throws CoreException {
  if (!alreadyEditedByUser) {
    refreshNewJob();
    try {
      ProxyRepositoryFactory.getInstance().saveProject(ProjectManager.getInstance().getCurrentProject());
    }
 catch (    Exception e) {
      ExceptionHandler.process(e);
    }
  }
  boolean locked=processObject.getRepositoryStatus().equals(ERepositoryStatus.LOCK_BY_USER);
  openAnotherVersion((RepositoryNode)processObject.getRepositoryNode(),!locked);
  try {
    ProxyRepositoryFactory.getInstance().saveProject(ProjectManager.getInstance().getCurrentProject());
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
}
Program: 121463
Project: 121463
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  String version=getProperty().getVersion();
  version=VersionUtils.upMinor(version);
  versionText.setText(version);
  getProperty().setVersion(version);
  updatePageStatus();
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  String version=getProperty().getVersion();
  version=VersionUtils.upMinor(version);
  versionText.setText(version);
  newVersion=version;
  updatePageStatus();
}
Program: 121464
Project: 121464
Buggy source:
private void addListener(){
  createNewVersionButton.addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent e){
    }
    public void widgetSelected(    SelectionEvent e){
      boolean create=createNewVersionButton.getSelection();
      versionModifComposite.setEnabled(create);
      versionListComposite.setEnabled(!create);
      versionMajorBtn.setEnabled(create);
      versionMinorBtn.setEnabled(create);
      createNewVersionJob=create;
      updatePageStatus();
    }
  }
);
  versionMajorBtn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      String version=getProperty().getVersion();
      version=VersionUtils.upMajor(version);
      versionText.setText(version);
      getProperty().setVersion(version);
      updatePageStatus();
    }
  }
);
  versionMinorBtn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      String version=getProperty().getVersion();
      version=VersionUtils.upMinor(version);
      versionText.setText(version);
      getProperty().setVersion(version);
      updatePageStatus();
    }
  }
);
}

Fixed version (ground truth):
private void addListener(){
  createNewVersionButton.addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent e){
    }
    public void widgetSelected(    SelectionEvent e){
      boolean create=createNewVersionButton.getSelection();
      versionModifComposite.setEnabled(create);
      versionListComposite.setEnabled(!create);
      versionMajorBtn.setEnabled(create);
      versionMinorBtn.setEnabled(create);
      createNewVersionJob=create;
      updatePageStatus();
    }
  }
);
  versionMajorBtn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      String version=getProperty().getVersion();
      version=VersionUtils.upMajor(version);
      versionText.setText(version);
      newVersion=version;
      updatePageStatus();
    }
  }
);
  versionMinorBtn.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    SelectionEvent e){
      String version=getProperty().getVersion();
      version=VersionUtils.upMinor(version);
      versionText.setText(version);
      newVersion=version;
      updatePageStatus();
    }
  }
);
}
Program: 121465
Project: 121465
Buggy source:
@Override public boolean performCancel(){
  if (!getProperty().getVersion().equals(getOriginVersion())) {
    restoreVersion();
  }
  return super.performCancel();
}

Fixed version (ground truth):
@Override public boolean performCancel(){
  return super.performCancel();
}