nus-yam/ex-repair huggingface dataset:
Program: 91680
Project: 91680
Buggy source:
public void updateClasspath(IProject project,IProgressMonitor monitor){
  IJavaProject javaProject=JavaCore.create(project);
  if (javaProject != null) {
    try {
      IClasspathEntry containerEntry=getMavenContainerEntry(javaProject);
      IPath path=containerEntry != null ? containerEntry.getPath() : new Path(CONTAINER_ID);
      IClasspathEntry[] classpath=getClasspath(project,monitor);
      IClasspathContainer container=new MavenClasspathContainer(path,classpath);
      JavaCore.setClasspathContainer(container.getPath(),new IJavaProject[]{javaProject},new IClasspathContainer[]{container},monitor);
      forcePackageExplorerRefresh(javaProject);
      saveContainerState(project,container);
    }
 catch (    CoreException ex) {
      log.error(ex.getMessage(),ex);
    }
  }
}

Fixed version (ground truth):
public void updateClasspath(IProject project,IProgressMonitor monitor){
  IJavaProject javaProject=JavaCore.create(project);
  if (javaProject != null) {
    try {
      IClasspathEntry containerEntry=getMavenContainerEntry(javaProject);
      IPath path=containerEntry != null ? containerEntry.getPath() : new Path(CONTAINER_ID);
      IClasspathEntry[] classpath=getClasspath(project,monitor);
      IClasspathContainer container=new MavenClasspathContainer(path,classpath);
      JavaCore.setClasspathContainer(container.getPath(),new IJavaProject[]{javaProject},new IClasspathContainer[]{container},monitor);
      saveContainerState(project,container);
    }
 catch (    CoreException ex) {
      log.error(ex.getMessage(),ex);
    }
  }
}
Program: 91681
Project: 91681
Buggy source:
protected AbstractProjectScanner<MavenProjectInfo> getProjectScanner(){
  File root=workspaceRoot.getLocation().toFile();
  MavenModelManager modelManager=MavenPlugin.getMavenModelManager();
  if (showLocation) {
    String location=rootDirectoryCombo.getText().trim();
    if (location.length() > 0) {
      return new LocalProjectScanner(root,location,false,modelManager);
    }
  }
 else   if (locations != null && !locations.isEmpty()) {
    return new LocalProjectScanner(root,locations,true,modelManager);
  }
  return new AbstractProjectScanner<MavenProjectInfo>(){
    @Override public String getDescription(){
      return "String_Node_Str";
    }
    @Override public void run(    IProgressMonitor monitor) throws InterruptedException {
    }
  }
;
}

Fixed version (ground truth):
protected AbstractProjectScanner<MavenProjectInfo> getProjectScanner(){
  File root=workspaceRoot.getLocation().toFile();
  MavenModelManager modelManager=MavenPlugin.getMavenModelManager();
  if (showLocation) {
    String location=rootDirectoryCombo.getText().trim();
    if (location.length() > 0) {
      return new LocalProjectScanner(root,location,false,modelManager);
    }
  }
 else   if (locations != null && !locations.isEmpty()) {
    return new LocalProjectScanner(root,locations,false,modelManager);
  }
  return new AbstractProjectScanner<MavenProjectInfo>(){
    @Override public String getDescription(){
      return "String_Node_Str";
    }
    @Override public void run(    IProgressMonitor monitor) throws InterruptedException {
    }
  }
;
}
Program: 91682
Project: 91682
Buggy source:
public ActionMessageProblemInfo(String message,int severity,MojoExecutionKey mojoExecutionKey,SourceLocation markerLocation){
  super(message,severity,markerLocation);
  this.mojoExecutionKey=mojoExecutionKey;
}

Fixed version (ground truth):
public ActionMessageProblemInfo(String message,int severity,MojoExecutionKey mojoExecutionKey,SourceLocation markerLocation,boolean pomMapping){
  super(message,severity,mojoExecutionKey,markerLocation);
  this.pomMapping=pomMapping;
}
Program: 91683
Project: 91683
Buggy source:
private static List<PluginExecutionMetadata> applyParametersFilter(MavenSession session,List<PluginExecutionMetadata> metadatas,MavenProject mavenProject,MojoExecution execution) throws CoreException {
  IMaven maven=MavenPlugin.getMaven();
  List<PluginExecutionMetadata> result=new ArrayList<PluginExecutionMetadata>();
  all_metadatas:   for (  PluginExecutionMetadata metadata : metadatas) {
    Map<String,String> parameters=metadata.getFilter().getParameters();
    if (!parameters.isEmpty()) {
      for (      String name : parameters.keySet()) {
        String value=parameters.get(name);
        MojoExecution setupExecution=maven.setupMojoExecution(session,mavenProject,execution);
        if (!eq(value,maven.getMojoParameterValue(session,setupExecution,name,String.class))) {
          continue all_metadatas;
        }
      }
    }
    result.add(metadata);
  }
  return result;
}

Fixed version (ground truth):
private static List<PluginExecutionMetadata> applyParametersFilter(MavenSession session,List<PluginExecutionMetadata> metadatas,MavenProject mavenProject,MojoExecution execution) throws CoreException {
  IMaven maven=MavenPlugin.getMaven();
  List<PluginExecutionMetadata> result=new ArrayList<PluginExecutionMetadata>();
  all_metadatas:   for (  PluginExecutionMetadata metadata : metadatas) {
    @SuppressWarnings("String_Node_Str") Map<String,String> parameters=metadata.getFilter().getParameters();
    if (!parameters.isEmpty()) {
      for (      String name : parameters.keySet()) {
        String value=parameters.get(name);
        MojoExecution setupExecution=maven.setupMojoExecution(session,mavenProject,execution);
        if (!eq(value,maven.getMojoParameterValue(session,setupExecution,name,String.class))) {
          continue all_metadatas;
        }
      }
    }
    result.add(metadata);
  }
  return result;
}
Program: 91685
Project: 91685
Buggy source:
public void processMarker(IMarker marker) throws CoreException {
  super.processMarker(marker);
  marker.setAttribute(IMavenConstants.MARKER_ATTR_EDITOR_HINT,IMavenConstants.EDITOR_HINT_NOT_COVERED_MOJO_EXECUTION);
  marker.setAttribute(IMavenConstants.MARKER_ATTR_GROUP_ID,mojoExecutionKey.getGroupId());
  marker.setAttribute(IMavenConstants.MARKER_ATTR_ARTIFACT_ID,mojoExecutionKey.getArtifactId());
  marker.setAttribute(IMavenConstants.MARKER_ATTR_EXECUTION_ID,mojoExecutionKey.getExecutionId());
  marker.setAttribute(IMavenConstants.MARKER_ATTR_GOAL,mojoExecutionKey.getGoal());
  marker.setAttribute(IMavenConstants.MARKER_ATTR_VERSION,mojoExecutionKey.getVersion());
  marker.setAttribute(IMavenConstants.MARKER_ATTR_LIFECYCLE_PHASE,mojoExecutionKey.getLifecyclePhase());
}

Fixed version (ground truth):
public void processMarker(IMarker marker) throws CoreException {
  super.processMarker(marker);
  marker.setAttribute(IMavenConstants.MARKER_ATTR_EDITOR_HINT,IMavenConstants.EDITOR_HINT_NOT_COVERED_MOJO_EXECUTION);
}
Program: 91686
Project: 91686
Buggy source:
public NotCoveredMojoExecution(MojoExecutionKey mojoExecutionKey,SourceLocation markerLocation){
  super(NLS.bind(Messages.LifecycleConfigurationPluginExecutionNotCovered,mojoExecutionKey.toString()),markerLocation);
  this.mojoExecutionKey=mojoExecutionKey;
}

Fixed version (ground truth):
public NotCoveredMojoExecution(MojoExecutionKey mojoExecutionKey,SourceLocation markerLocation){
  super(NLS.bind(Messages.LifecycleConfigurationPluginExecutionNotCovered,mojoExecutionKey.toString()),mojoExecutionKey,markerLocation);
}
Program: 91688
Project: 91688
Buggy source:
public static IHyperlink createHyperlink(final MarkerRegion mark){
  return new IHyperlink(){
    public IRegion getHyperlinkRegion(){
      return new Region(mark.getOffset(),mark.getLength());
    }
    public String getTypeLabel(){
      return "String_Node_Str";
    }
    public String getHyperlinkText(){
      return NLS.bind("String_Node_Str",mark.getAnnotation().getText());
    }
    public void open(){
      IMarker marker=mark.getAnnotation().getMarker();
      String loc=marker.getAttribute(IMavenConstants.MARKER_CAUSE_RESOURCE_PATH,null);
      if (loc != null) {
        IFileStore fileStore=EFS.getLocalFileSystem().getStore(new Path(loc));
        int row=marker.getAttribute(IMavenConstants.MARKER_CAUSE_LINE_NUMBER,0);
        int column=marker.getAttribute(IMavenConstants.MARKER_CAUSE_COLUMN_START,0);
        String name=marker.getAttribute(IMavenConstants.MARKER_CAUSE_RESOURCE_ID,null);
        String hint=marker.getAttribute(IMavenConstants.MARKER_ATTR_EDITOR_HINT,null);
        if (IMavenConstants.EDITOR_HINT_NOT_COVERED_MOJO_EXECUTION.equals(hint)) {
        }
        openXmlEditor(fileStore,row,column,name);
      }
    }
  }
;
}

Fixed version (ground truth):
public static IHyperlink createHyperlink(final MarkerRegion mark){
  return new IHyperlink(){
    public IRegion getHyperlinkRegion(){
      return new Region(mark.getOffset(),mark.getLength());
    }
    public String getTypeLabel(){
      return "String_Node_Str";
    }
    public String getHyperlinkText(){
      return NLS.bind("String_Node_Str",mark.getAnnotation().getText());
    }
    public void open(){
      IMarker marker=mark.getAnnotation().getMarker();
      String loc=marker.getAttribute(IMavenConstants.MARKER_CAUSE_RESOURCE_PATH,null);
      if (loc != null) {
        IFileStore fileStore=EFS.getLocalFileSystem().getStore(new Path(loc));
        int row=marker.getAttribute(IMavenConstants.MARKER_CAUSE_LINE_NUMBER,0);
        int column=marker.getAttribute(IMavenConstants.MARKER_CAUSE_COLUMN_START,0);
        String name=marker.getAttribute(IMavenConstants.MARKER_CAUSE_RESOURCE_ID,null);
        openXmlEditor(fileStore,row,column,name);
      }
    }
  }
;
}
Program: 91690
Project: 91690
Buggy source:
protected void okPressed(){
  ISelection selection=codebaseViewer.getSelection();
  if (selection instanceof IStructuredSelection) {
    Object[] obj=((IStructuredSelection)selection).toArray();
    IProject[] projects=new IProject[obj.length];
    for (int i=0; i < obj.length; i++) {
      projects[i]=(IProject)obj[i];
    }
    selectedProjects=projects;
  }
  isOffline=offline.getSelection();
  isForceUpdate=forceUpdate.getSelection();
  super.okPressed();
}

Fixed version (ground truth):
protected void okPressed(){
  Object[] obj=codebaseViewer.getCheckedElements();
  IProject[] projects=new IProject[obj.length];
  for (int i=0; i < obj.length; i++) {
    projects[i]=(IProject)obj[i];
  }
  selectedProjects=projects;
  isOffline=offline.getSelection();
  isForceUpdate=forceUpdate.getSelection();
  super.okPressed();
}
Program: 91691
Project: 91691
Buggy source:
protected MavenExecutionRequest getConfiguredExecutionRequest(DependencyResolutionContext context,IProjectRegistry state,IFile pom,ResolverConfiguration resolverConfiguration) throws CoreException {
  MavenExecutionRequest mavenRequest=DefaultMavenExecutionRequest.copy(context.getExecutionRequest());
  configureExecutionRequest(mavenRequest,state,pom,resolverConfiguration);
  getMaven().populateDefaults(mavenRequest);
  mavenRequest.setOffline(context.getRequest().isOffline());
  mavenRequest.setUpdateSnapshots(context.isForce(pom));
  return mavenRequest;
}

Fixed version (ground truth):
protected MavenExecutionRequest getConfiguredExecutionRequest(DependencyResolutionContext context,IProjectRegistry state,IFile pom,ResolverConfiguration resolverConfiguration) throws CoreException {
  MavenExecutionRequest mavenRequest=DefaultMavenExecutionRequest.copy(context.getExecutionRequest());
  configureExecutionRequest(mavenRequest,state,pom,resolverConfiguration);
  getMaven().populateDefaults(mavenRequest);
  mavenRequest.setOffline(context.getRequest().isOffline());
  mavenRequest.setUpdateSnapshots(context.isForce(pom) && context.getRequest().isUpdateSnapshots());
  return mavenRequest;
}
Program: 91692
Project: 91692
Buggy source:
public static void persist(IMavenProjectFacade facade,IProgressMonitor monitor){
  try {
    LifecycleMappingConfiguration configuration=newLifecycleMappingConfiguration(facade,monitor);
    if (configuration == null) {
      return;
    }
    File configFile=getConfigurationFile(facade.getProject());
    ObjectOutputStream oos=new ObjectOutputStream(new FileOutputStream(configFile));
    try {
      oos.writeObject(configuration);
      oos.flush();
    }
  finally {
      IOUtil.close(oos);
    }
  }
 catch (  CoreException ex) {
    log.warn("String_Node_Str",facade.toString(),ex);
  }
catch (  IOException ex) {
    log.warn("String_Node_Str",facade.toString(),ex);
  }
}

Fixed version (ground truth):
private static void persist(IProject project,LifecycleMappingConfiguration configuration){
  try {
    File configFile=getConfigurationFile(project);
    ObjectOutputStream oos=new ObjectOutputStream(new FileOutputStream(configFile));
    try {
      oos.writeObject(configuration);
      oos.flush();
    }
  finally {
      IOUtil.close(oos);
    }
  }
 catch (  IOException ex) {
    log.warn("String_Node_Str",project.toString(),ex);
  }
}
Program: 91694
Project: 91694
Buggy source:
private static IMarker findMarker(String type,String message,Integer lineNumber,String resourceRelativePath,List<IMarker> markers) throws Exception {
  for (  IMarker marker : markers) {
    if (type != null && !type.equals(marker.getType())) {
      continue;
    }
    if (!marker.getAttribute(IMarker.MESSAGE,"String_Node_Str").startsWith(message)) {
      continue;
    }
    if (lineNumber != null && !lineNumber.equals(marker.getAttribute(IMarker.LINE_NUMBER))) {
      continue;
    }
    if (type != null && type.startsWith(IMavenConstants.MARKER_ID)) {
      Assert.assertEquals("String_Node_Str" + toString(marker),false,marker.getAttribute(IMarker.TRANSIENT));
    }
    if (resourceRelativePath == null) {
      resourceRelativePath="String_Node_Str";
    }
    Assert.assertEquals("String_Node_Str" + toString(marker),resourceRelativePath,marker.getResource().getProjectRelativePath().toString());
    return marker;
  }
  return null;
}

Fixed version (ground truth):
private static IMarker findMarker(String type,String message,Integer lineNumber,String resourceRelativePath,List<IMarker> markers) throws Exception {
  for (  IMarker marker : markers) {
    if (type != null && !type.equals(marker.getType())) {
      continue;
    }
    if (message != null && !marker.getAttribute(IMarker.MESSAGE,"String_Node_Str").startsWith(message)) {
      continue;
    }
    if (lineNumber != null && !lineNumber.equals(marker.getAttribute(IMarker.LINE_NUMBER))) {
      continue;
    }
    if (type != null && type.startsWith(IMavenConstants.MARKER_ID)) {
      Assert.assertEquals("String_Node_Str" + toString(marker),false,marker.getAttribute(IMarker.TRANSIENT));
    }
    if (resourceRelativePath == null) {
      resourceRelativePath="String_Node_Str";
    }
    Assert.assertEquals("String_Node_Str" + toString(marker),resourceRelativePath,marker.getResource().getProjectRelativePath().toString());
    return marker;
  }
  return null;
}
Program: 91695
Project: 91695
Buggy source:
private boolean warnIncompleteMapping(){
  if (!skipIncompleteWarning()) {
    MessageDialogWithToggle dialog=MessageDialogWithToggle.open(MessageDialog.CONFIRM,getShell(),Messages.MavenImportWizard_titleIncompleteMapping,Messages.MavenImportWizard_messageIncompleteMapping,"String_Node_Str",false,null,null,SWT.SHEET);
    M2EUIPluginActivator.getDefault().getPreferenceStore().setValue(MavenPreferenceConstants.P_WARN_INCOMPLETE_MAPPING,dialog.getToggleState());
    return dialog.getReturnCode() == Window.OK;
  }
  return true;
}

Fixed version (ground truth):
private boolean warnIncompleteMapping(){
  if (!skipIncompleteWarning()) {
    MessageDialogWithToggle dialog=MessageDialogWithToggle.open(MessageDialog.CONFIRM,getShell(),Messages.MavenImportWizard_titleIncompleteMapping,Messages.MavenImportWizard_messageIncompleteMapping,"String_Node_Str",false,null,null,SWT.SHEET);
    if (dialog.getReturnCode() == Window.OK) {
      M2EUIPluginActivator.getDefault().getPreferenceStore().setValue(MavenPreferenceConstants.P_WARN_INCOMPLETE_MAPPING,dialog.getToggleState());
      return true;
    }
    return false;
  }
  return true;
}
Program: 91697
Project: 91697
Buggy source:
private Collection<MavenProject> getDescendants(){
  List<MavenProject> descendants=new ArrayList<MavenProject>();
  boolean add=true;
  for (  MavenProject project : getHierarchy()) {
    if (project == exclusionPoint) {
      add=!add;
    }
 else     if (add) {
      descendants.add(project);
    }
  }
  return descendants;
}

Fixed version (ground truth):
private Collection<MavenProject> getDescendants(){
  List<MavenProject> descendants=new ArrayList<MavenProject>();
  for (  MavenProject project : getHierarchy()) {
    if (project == exclusionPoint) {
      break;
    }
 else {
      descendants.add(project);
    }
  }
  return descendants;
}
Program: 91698
Project: 91698
Buggy source:
public boolean implement(List<IMavenDiscoveryProposal> proposals,IRunnableWithProgress postInstallHook,IRunnableContext context,Collection<String> projectsToConfigure){
  try {
    MavenDiscoveryInstallOperation runner=new MavenDiscoveryInstallOperation(toCatalogItems(proposals),postInstallHook,true,projectsToConfigure);
    context.run(true,true,runner);
    int openInstallWizard=MavenDiscoveryUi.openInstallWizard(runner.getOperation(),true);
    return openInstallWizard == Window.OK;
  }
 catch (  InvocationTargetException e) {
    IStatus status=new Status(IStatus.ERROR,DiscoveryActivator.PLUGIN_ID,NLS.bind(Messages.ConnectorDiscoveryWizard_installProblems,new Object[]{e.getCause().getMessage()}),e.getCause());
    StatusManager.getManager().handle(status,StatusManager.SHOW | StatusManager.BLOCK | StatusManager.LOG);
    return false;
  }
catch (  InterruptedException e) {
    return false;
  }
}

Fixed version (ground truth):
public boolean implement(List<IMavenDiscoveryProposal> proposals,IRunnableWithProgress postInstallHook,IRunnableContext context,Collection<String> projectsToConfigure){
  try {
    MavenDiscoveryInstallOperation runner=new MavenDiscoveryInstallOperation(toCatalogItems(proposals),postInstallHook,true,false,projectsToConfigure);
    context.run(true,true,runner);
    int openInstallWizard=MavenDiscoveryUi.openInstallWizard(runner.getOperation(),true);
    return openInstallWizard == Window.OK;
  }
 catch (  InvocationTargetException e) {
    IStatus status=new Status(IStatus.ERROR,DiscoveryActivator.PLUGIN_ID,NLS.bind(Messages.ConnectorDiscoveryWizard_installProblems,new Object[]{e.getCause().getMessage()}),e.getCause());
    StatusManager.getManager().handle(status,StatusManager.SHOW | StatusManager.BLOCK | StatusManager.LOG);
    return false;
  }
catch (  InterruptedException e) {
    return false;
  }
}
Program: 91699
Project: 91699
Buggy source:
private RestartInstallOperation createAndResolve(IProgressMonitor monitor,final IInstallableUnit[] ius,URI[] repositories,boolean requireRestart) throws CoreException {
  SubMonitor mon=SubMonitor.convert(monitor,ius.length);
  try {
    RestartInstallOperation op=new RestartInstallOperation(session,Arrays.asList(ius),postInstallHook,projectsToConfigure,requireRestart ? ProvisioningJob.RESTART_ONLY : ProvisioningJob.RESTART_NONE);
    IStatus operationStatus=op.resolveModal(mon);
    if (operationStatus.getSeverity() > IStatus.WARNING) {
      throw new CoreException(operationStatus);
    }
    return op;
  }
  finally {
    mon.done();
  }
}

Fixed version (ground truth):
private RestartInstallOperation createAndResolve(IProgressMonitor monitor,final IInstallableUnit[] ius,URI[] repositories,boolean requireRestart) throws CoreException {
  SubMonitor mon=SubMonitor.convert(monitor,ius.length);
  try {
    RestartInstallOperation op=new RestartInstallOperation(session,Arrays.asList(ius),postInstallHook,projectsToConfigure,requireRestart ? ProvisioningJob.RESTART_ONLY : ProvisioningJob.RESTART_NONE);
    if (shouldResolve) {
      IStatus operationStatus=op.resolveModal(mon);
      if (operationStatus.getSeverity() > IStatus.WARNING) {
        throw new CoreException(operationStatus);
      }
    }
    return op;
  }
  finally {
    mon.done();
  }
}
Program: 91700
Project: 91700
Buggy source:
public MavenDiscoveryInstallOperation(List<CatalogItem> installableConnectors,IRunnableWithProgress postInstallHook,boolean restart,Collection<String> projectsToConfigure){
  this.installableConnectors=installableConnectors;
  this.postInstallHook=postInstallHook;
  this.restart=restart;
  this.session=ProvisioningUI.getDefaultUI().getSession();
  this.projectsToConfigure=projectsToConfigure;
}

Fixed version (ground truth):
public MavenDiscoveryInstallOperation(List<CatalogItem> installableConnectors,IRunnableWithProgress postInstallHook,boolean restart,boolean shouldResolve,Collection<String> projectsToConfigure){
  this.installableConnectors=installableConnectors;
  this.postInstallHook=postInstallHook;
  this.restart=restart;
  this.session=ProvisioningUI.getDefaultUI().getSession();
  this.shouldResolve=shouldResolve;
  this.projectsToConfigure=projectsToConfigure;
}
Program: 91701
Project: 91701
Buggy source:
public void process(Document document){
  Element depElement=PomHelper.findDependency(document,dependency);
  if (depElement != null) {
    Element exclusionsElement=getChild(depElement,EXCLUSIONS);
    Element exclusionElement=createElement(exclusionsElement,EXCLUSION);
    createElementWithText(exclusionElement,ARTIFACT_ID,exclusion.getArtifactId());
    createElementWithText(exclusionElement,GROUP_ID,exclusion.getGroupId());
    format(exclusionElement);
  }
}

Fixed version (ground truth):
public void process(Document document){
  Element depElement=PomHelper.findDependency(document,dependency);
  if (depElement != null) {
    Element exclusionsElement=getChild(depElement,EXCLUSIONS);
    if (null == PomEdits.findChild(exclusionsElement,EXCLUSION,childEquals(GROUP_ID,exclusion.getGroupId()),childEquals(ARTIFACT_ID,exclusion.getArtifactId()))) {
      Element exclusionElement=createElement(exclusionsElement,EXCLUSION);
      createElementWithText(exclusionElement,ARTIFACT_ID,exclusion.getArtifactId());
      createElementWithText(exclusionElement,GROUP_ID,exclusion.getGroupId());
      format(exclusionElement);
    }
  }
 else {
    log.debug("String_Node_Str" + dependency + "String_Node_Str"+ exclusion.toString());
  }
}
Program: 91703
Project: 91703
Buggy source:
private void updateState(){
  ExcludeArtifactRefactoring refactoring=(ExcludeArtifactRefactoring)getRefactoring();
  if (hierarchy.getSelection()) {
    MavenProject project=fromSelection(pomHierarchy.getSelection());
    setPageComplete(project != null && project.getFile() != null);
    if (project != null && project.getFile() == null) {
      setStatus("String_Node_Str");
    }
 else {
      setStatus(null);
      refactoring.setExclusionPoint(fromSelection(pomHierarchy.getSelection()));
    }
  }
 else {
    setStatus(null);
    refactoring.setExclusionPoint(facade.getMavenProject());
  }
}

Fixed version (ground truth):
private void updateState(){
  ExcludeArtifactRefactoring refactoring=(ExcludeArtifactRefactoring)getRefactoring();
  if (hierarchy.getSelection()) {
    MavenProject project=fromSelection(pomHierarchy.getSelection());
    updateStatusBar(project);
    refactoring.setExclusionPoint(project);
  }
 else {
    updateStatusBar(facade.getMavenProject());
    refactoring.setExclusionPoint(facade.getMavenProject());
  }
}
Program: 91704
Project: 91704
Buggy source:
private void setStatus(String msg){
  if (msg == null) {
    label.setImage(null);
    label.setText("String_Node_Str");
  }
 else {
    label.setText(msg);
    label.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK));
  }
}

Fixed version (ground truth):
private void setStatus(String msg){
  if (msg == null) {
    status.setImage(null);
    status.setText("String_Node_Str");
  }
 else {
    status.setText(msg);
    status.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK));
  }
}
Program: 91705
Project: 91705
Buggy source:
public void createControl(Composite parent){
  Composite composite=new Composite(parent,SWT.NULL);
  setControl(composite);
  composite.setLayout(new GridLayout(1,false));
  currentPom=new Button(composite,SWT.RADIO);
  currentPom.setLayoutData(new GridData(SWT.LEFT,SWT.CENTER,false,false));
  currentPom.setText("String_Node_Str");
  currentPom.setSelection(true);
  currentPom.addSelectionListener(this);
  hierarchy=new Button(composite,SWT.RADIO);
  hierarchy.setLayoutData(new GridData(SWT.LEFT,SWT.TOP,false,false));
  hierarchy.setText("String_Node_Str");
  hierarchy.addSelectionListener(this);
  pomHierarchy=new PomHierarchyComposite(composite,SWT.BORDER);
  GridData gd_pomHierarchy=new GridData(SWT.FILL,SWT.FILL,true,true);
  gd_pomHierarchy.horizontalIndent=15;
  pomHierarchy.setLayoutData(gd_pomHierarchy);
  pomHierarchy.setEnabled(false);
  pomHierarchy.addSelectionChangedListener(this);
  label=new CLabel(composite,SWT.NONE);
  label.setLayoutData(new GridData(SWT.LEFT,SWT.CENTER,true,false));
  Display.getCurrent().asyncExec(new Runnable(){
    public void run(){
      pomHierarchy.computeHeirarchy(facade,getContainer());
      ((ExcludeArtifactRefactoring)getRefactoring()).setHierarchy(pomHierarchy.getHierarchy());
    }
  }
);
}

Fixed version (ground truth):
public void createControl(Composite parent){
  Composite composite=new Composite(parent,SWT.NULL);
  setControl(composite);
  composite.setLayout(new GridLayout(1,false));
  Label label=new Label(composite,SWT.NONE);
  label.setLayoutData(new GridData(SWT.LEFT,SWT.TOP,true,false));
  label.setText("String_Node_Str");
  currentPom=new Button(composite,SWT.RADIO);
  GridData gd_currentPom=new GridData(SWT.LEFT,SWT.CENTER,false,false,1,1);
  gd_currentPom.horizontalIndent=15;
  currentPom.setLayoutData(gd_currentPom);
  currentPom.setText(facade.getArtifactKey().toString());
  currentPom.setSelection(true);
  currentPom.addSelectionListener(this);
  hierarchy=new Button(composite,SWT.RADIO);
  GridData gd_hierarchy=new GridData(SWT.LEFT,SWT.TOP,false,false);
  gd_hierarchy.horizontalIndent=15;
  hierarchy.setLayoutData(gd_hierarchy);
  hierarchy.setText("String_Node_Str");
  hierarchy.addSelectionListener(this);
  pomHierarchy=new PomHierarchyComposite(composite,SWT.BORDER);
  GridData gd_pomHierarchy=new GridData(SWT.FILL,SWT.FILL,true,true);
  gd_pomHierarchy.horizontalIndent=35;
  pomHierarchy.setLayoutData(gd_pomHierarchy);
  pomHierarchy.setEnabled(false);
  pomHierarchy.addSelectionChangedListener(this);
  status=new CLabel(composite,SWT.NONE);
  status.setLayoutData(new GridData(SWT.FILL,SWT.BOTTOM,true,false));
  Display.getCurrent().asyncExec(new Runnable(){
    public void run(){
      pomHierarchy.computeHeirarchy(facade,getContainer());
      ((ExcludeArtifactRefactoring)getRefactoring()).setHierarchy(pomHierarchy.getHierarchy());
    }
  }
);
}
Program: 91707
Project: 91707
Buggy source:
private static List<PluginExecutionMetadata> applyParametersFilter(MavenSession session,List<PluginExecutionMetadata> metadatas,MavenProject mavenProject,MojoExecution execution){
  IMaven maven=MavenPlugin.getDefault().getMaven();
  List<PluginExecutionMetadata> result=new ArrayList<PluginExecutionMetadata>();
  all_metadatas:   for (  PluginExecutionMetadata metadata : metadatas) {
    Map<String,String> parameters=metadata.getFilter().getParameters();
    if (!parameters.isEmpty()) {
      for (      String name : parameters.keySet()) {
        String value=parameters.get(name);
        try {
          MojoExecution setupExecution=maven.setupMojoExecution(session,mavenProject,execution);
          if (!eq(value,maven.getMojoParameterValue(session,setupExecution,name,String.class))) {
            continue all_metadatas;
          }
        }
 catch (        CoreException ex) {
          log.warn("String_Node_Str",new Object[]{name,execution.toString(),ex});
          continue all_metadatas;
        }
      }
    }
    result.add(metadata);
  }
  return result;
}

Fixed version (ground truth):
private static List<PluginExecutionMetadata> applyParametersFilter(MavenSession session,List<PluginExecutionMetadata> metadatas,MavenProject mavenProject,MojoExecution execution) throws CoreException {
  IMaven maven=MavenPlugin.getDefault().getMaven();
  List<PluginExecutionMetadata> result=new ArrayList<PluginExecutionMetadata>();
  all_metadatas:   for (  PluginExecutionMetadata metadata : metadatas) {
    Map<String,String> parameters=metadata.getFilter().getParameters();
    if (!parameters.isEmpty()) {
      for (      String name : parameters.keySet()) {
        String value=parameters.get(name);
        MojoExecution setupExecution=maven.setupMojoExecution(session,mavenProject,execution);
        if (!eq(value,maven.getMojoParameterValue(session,setupExecution,name,String.class))) {
          continue all_metadatas;
        }
      }
    }
    result.add(metadata);
  }
  return result;
}
Program: 91708
Project: 91708
Buggy source:
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  projectScanner.run(monitor);
  ((MavenImportWizard)getWizard()).scanProjects(getProjects(projectScanner.getProjects()),monitor);
}

Fixed version (ground truth):
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  projectScanner.run(monitor);
  try {
    ((MavenImportWizard)getWizard()).scanProjects(getProjects(projectScanner.getProjects()),monitor);
  }
 catch (  InvocationTargetException x) {
    analyzingExc[0]=x;
  }
}
Program: 91711
Project: 91711
Buggy source:
public void addMarkers(IResource pomFile,String type,MavenExecutionResult result){
  SourceLocation defaultSourceLocation=new SourceLocation(1,0,0);
  List<MavenProblemInfo> allProblems=new ArrayList<MavenProblemInfo>();
  allProblems.addAll(toMavenProblemInfos(defaultSourceLocation,result.getExceptions()));
  MavenProject mavenProject=result.getProject();
  DependencyResolutionResult resolutionResult=result.getDependencyResolutionResult();
  if (resolutionResult != null) {
    allProblems.addAll(toMavenProblemInfos(defaultSourceLocation,resolutionResult.getCollectionErrors()));
    for (    org.sonatype.aether.graph.Dependency dependency : resolutionResult.getUnresolvedDependencies()) {
      List<Exception> exceptions=resolutionResult.getResolutionErrors(dependency);
      if (exceptions != null && exceptions.size() > 0) {
        SourceLocation sourceLocation=SourceLocationHelper.findLocation(mavenProject,dependency);
        allProblems.addAll(toMavenProblemInfos(sourceLocation,exceptions));
      }
    }
  }
  if (mavenProject != null) {
    addMissingArtifactProblemInfos(mavenProject,defaultSourceLocation,allProblems);
  }
  addErrorMarkers(pomFile,type,allProblems);
}

Fixed version (ground truth):
public void addMarkers(IResource pomFile,String type,MavenExecutionResult result){
  SourceLocation defaultSourceLocation=new SourceLocation(1,0,0);
  List<MavenProblemInfo> allProblems=new ArrayList<MavenProblemInfo>();
  MavenProject mavenProject=result.getProject();
  allProblems.addAll(toMavenProblemInfos(mavenProject,defaultSourceLocation,result.getExceptions()));
  DependencyResolutionResult resolutionResult=result.getDependencyResolutionResult();
  if (resolutionResult != null) {
    allProblems.addAll(toMavenProblemInfos(mavenProject,defaultSourceLocation,resolutionResult.getCollectionErrors()));
    for (    org.sonatype.aether.graph.Dependency dependency : resolutionResult.getUnresolvedDependencies()) {
      List<Exception> exceptions=resolutionResult.getResolutionErrors(dependency);
      if (exceptions != null && exceptions.size() > 0) {
        SourceLocation sourceLocation=SourceLocationHelper.findLocation(mavenProject,dependency);
        allProblems.addAll(toMavenProblemInfos(mavenProject,sourceLocation,exceptions));
      }
    }
  }
  if (mavenProject != null) {
    addMissingArtifactProblemInfos(mavenProject,defaultSourceLocation,allProblems);
  }
  addErrorMarkers(pomFile,type,allProblems);
}
Program: 91712
Project: 91712
Buggy source:
private String[] parseBundleClasspath(Bundle bundle){
  String[] result=new String[]{"String_Node_Str"};
  String header=bundle.getHeaders().get(Constants.BUNDLE_CLASSPATH);
  ManifestElement[] classpathEntries=null;
  try {
    classpathEntries=ManifestElement.parseHeader(Constants.BUNDLE_CLASSPATH,header);
  }
 catch (  BundleException ex) {
    log.warn("String_Node_Str",bundle.toString(),ex);
  }
  if (classpathEntries != null) {
    result=new String[classpathEntries.length];
    for (int i=0; i < classpathEntries.length; i++) {
      result[i]=classpathEntries[i].getValue();
    }
  }
  return result;
}

Fixed version (ground truth):
private String[] parseBundleClasspath(Bundle bundle){
  String[] result=new String[]{"String_Node_Str"};
  String header=(String)bundle.getHeaders().get(Constants.BUNDLE_CLASSPATH);
  ManifestElement[] classpathEntries=null;
  try {
    classpathEntries=ManifestElement.parseHeader(Constants.BUNDLE_CLASSPATH,header);
  }
 catch (  BundleException ex) {
    log.warn("String_Node_Str",bundle.toString(),ex);
  }
  if (classpathEntries != null) {
    result=new String[classpathEntries.length];
    for (int i=0; i < classpathEntries.length; i++) {
      result[i]=classpathEntries[i].getValue();
    }
  }
  return result;
}
Program: 91713
Project: 91713
Buggy source:
public static void decorateMarker(IMarker marker){
  BundleContext context=MavenPlugin.getDefault().getBundleContext();
  ServiceReference ref=context.getServiceReference(IMarkerLocationService.class);
  IMarkerLocationService service=(IMarkerLocationService)context.getService(ref);
  if (service != null) {
    try {
      service.findLocationForMarker(marker);
    }
  finally {
      context.ungetService(ref);
    }
  }
}

Fixed version (ground truth):
public static void decorateMarker(IMarker marker){
  BundleContext context=MavenPlugin.getDefault().getBundleContext();
  ServiceReference ref=context.getServiceReference(IMarkerLocationService.class.getName());
  IMarkerLocationService service=(IMarkerLocationService)context.getService(ref);
  if (service != null) {
    try {
      service.findLocationForMarker(marker);
    }
  finally {
      context.ungetService(ref);
    }
  }
}
Program: 91714
Project: 91714
Buggy source:
/** 
 * @param markerManager
 * @param pom
 * @param mavenProject
 * @param markerPomLoadingId
 */
public static void addEditorHintMarkers(IMavenMarkerManager markerManager,IFile pom,MavenProject mavenProject,String type){
  BundleContext context=MavenPlugin.getDefault().getBundleContext();
  ServiceReference ref=context.getServiceReference(IEditorMarkerService.class);
  IEditorMarkerService service=(IEditorMarkerService)context.getService(ref);
  if (service != null) {
    try {
      service.addEditorHintMarkers(markerManager,pom,mavenProject,type);
    }
  finally {
      context.ungetService(ref);
    }
  }
}

Fixed version (ground truth):
public static void addEditorHintMarkers(IMavenMarkerManager markerManager,IFile pom,MavenProject mavenProject,String type){
  BundleContext context=MavenPlugin.getDefault().getBundleContext();
  ServiceReference ref=context.getServiceReference(IEditorMarkerService.class.getName());
  IEditorMarkerService service=(IEditorMarkerService)context.getService(ref);
  if (service != null) {
    try {
      service.addEditorHintMarkers(markerManager,pom,mavenProject,type);
    }
  finally {
      context.ungetService(ref);
    }
  }
}
Program: 91715
Project: 91715
Buggy source:
public static void decorateMarker(IMarker marker){
  BundleContext context=MavenPlugin.getDefault().getBundleContext();
  ServiceReference<IMarkerLocationService> ref=context.getServiceReference(IMarkerLocationService.class);
  IMarkerLocationService service=context.getService(ref);
  if (service != null) {
    try {
      service.findLocationForMarker(marker);
    }
  finally {
      context.ungetService(ref);
    }
  }
}

Fixed version (ground truth):
public static void decorateMarker(IMarker marker){
  BundleContext context=MavenPlugin.getDefault().getBundleContext();
  ServiceReference ref=context.getServiceReference(IMarkerLocationService.class);
  IMarkerLocationService service=(IMarkerLocationService)context.getService(ref);
  if (service != null) {
    try {
      service.findLocationForMarker(marker);
    }
  finally {
      context.ungetService(ref);
    }
  }
}
Program: 91716
Project: 91716
Buggy source:
/** 
 * @param markerManager
 * @param pom
 * @param mavenProject
 * @param markerPomLoadingId
 */
public static void addEditorHintMarkers(IMavenMarkerManager markerManager,IFile pom,MavenProject mavenProject,String type){
  BundleContext context=MavenPlugin.getDefault().getBundleContext();
  ServiceReference<IEditorMarkerService> ref=context.getServiceReference(IEditorMarkerService.class);
  IEditorMarkerService service=context.getService(ref);
  if (service != null) {
    try {
      service.addEditorHintMarkers(markerManager,pom,mavenProject,type);
    }
  finally {
      context.ungetService(ref);
    }
  }
}

Fixed version (ground truth):
/** 
 * @param markerManager
 * @param pom
 * @param mavenProject
 * @param markerPomLoadingId
 */
public static void addEditorHintMarkers(IMavenMarkerManager markerManager,IFile pom,MavenProject mavenProject,String type){
  BundleContext context=MavenPlugin.getDefault().getBundleContext();
  ServiceReference ref=context.getServiceReference(IEditorMarkerService.class);
  IEditorMarkerService service=(IEditorMarkerService)context.getService(ref);
  if (service != null) {
    try {
      service.addEditorHintMarkers(markerManager,pom,mavenProject,type);
    }
  finally {
      context.ungetService(ref);
    }
  }
}
Program: 91717
Project: 91717
Buggy source:
private Command createCommand(Dependency dependency,String value,Object feature,String defaultValue){
  return SetCommand.create(editingDomain,dependency,feature,value.length() == 0 || value.equals(defaultValue) ? SetCommand.UNSET_VALUE : value);
}

Fixed version (ground truth):
private Command createCommand(EditingDomain domain,Dependency dependency,String value,Object feature,String defaultValue){
  return SetCommand.create(domain,dependency,feature,value.length() == 0 || value.equals(defaultValue) ? SetCommand.UNSET_VALUE : value);
}
Program: 91719
Project: 91719
Buggy source:
private void wipeChunks(){
  File regionFile=worldData.regionFile(currentRegion);
  if (!regionFile.canWrite()) {
    regionFile.setWritable(true);
    if (!regionFile.canWrite()) {
      sendMessage("String_Node_Str" + regionFile.getName());
      return;
    }
  }
  int offsetX=CoordXZ.regionToChunk(regionX);
  int offsetZ=CoordXZ.regionToChunk(regionZ);
  long wipePos=0;
  try {
    RandomAccessFile unChunk=new RandomAccessFile(regionFile,"String_Node_Str");
    for (    CoordXZ wipe : trimChunks) {
      wipePos=4 * ((wipe.x - offsetX) + ((wipe.z - offsetZ) * 32));
      unChunk.seek(wipePos);
      unChunk.writeInt(0);
    }
    unChunk.close();
    reportTrimmedChunks+=trimChunks.size();
  }
 catch (  FileNotFoundException ex) {
    sendMessage("String_Node_Str" + regionFile.getName());
  }
catch (  IOException ex) {
    sendMessage("String_Node_Str" + regionFile.getName());
  }
  counter+=trimChunks.size();
}

Fixed version (ground truth):
private void wipeChunks(){
  File regionFile=worldData.regionFile(currentRegion);
  if (!regionFile.canWrite()) {
    regionFile.setWritable(true);
    if (!regionFile.canWrite()) {
      sendMessage("String_Node_Str" + regionFile.getName());
      return;
    }
  }
  int offsetX=CoordXZ.regionToChunk(regionX);
  int offsetZ=CoordXZ.regionToChunk(regionZ);
  long wipePos=0;
  int chunkCount=0;
  try {
    RandomAccessFile unChunk=new RandomAccessFile(regionFile,"String_Node_Str");
    for (    CoordXZ wipe : trimChunks) {
      if (!worldData.doesChunkExist(wipe.x,wipe.z))       continue;
      wipePos=4 * ((wipe.x - offsetX) + ((wipe.z - offsetZ) * 32));
      unChunk.seek(wipePos);
      unChunk.writeInt(0);
      chunkCount++;
    }
    unChunk.close();
    reportTrimmedChunks+=chunkCount;
  }
 catch (  FileNotFoundException ex) {
    sendMessage("String_Node_Str" + regionFile.getName());
  }
catch (  IOException ex) {
    sendMessage("String_Node_Str" + regionFile.getName());
  }
  counter+=trimChunks.size();
}
Program: 91720
Project: 91720
Buggy source:
@Override public void run(){
  vehicle.setPassenger(player);
}

Fixed version (ground truth):
@Override public void run(){
  handlingPlayers.remove(playerName.toLowerCase());
  if (vehicle == null || player == null)   return;
  vehicle.setPassenger(player);
}
Program: 91721
Project: 91721
Buggy source:
private static void setPassengerDelayed(final Entity vehicle,final Player player,long delay){
  Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(WorldBorder.plugin,new Runnable(){
    @Override public void run(){
      vehicle.setPassenger(player);
    }
  }
,delay);
}

Fixed version (ground truth):
private static void setPassengerDelayed(final Entity vehicle,final Player player,final String playerName,long delay){
  Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(WorldBorder.plugin,new Runnable(){
    @Override public void run(){
      handlingPlayers.remove(playerName.toLowerCase());
      if (vehicle == null || player == null)       return;
      vehicle.setPassenger(player);
    }
  }
,delay);
}
Program: 91722
Project: 91722
Buggy source:
@EventHandler(priority=EventPriority.LOWEST,ignoreCancelled=true) public void onPlayerTeleport(PlayerTeleportEvent event){
  if (Config.KnockBack() == 0.0)   return;
  Location newLoc=BorderCheckTask.checkPlayer(event.getPlayer(),event.getTo(),true,true);
  if (newLoc != null)   event.setTo(newLoc);
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.LOWEST,ignoreCancelled=true) public void onPlayerTeleport(PlayerTeleportEvent event){
  if (Config.KnockBack() == 0.0)   return;
  if (Config.Debug())   Config.LogWarn("String_Node_Str" + event.getCause().toString());
  Location newLoc=BorderCheckTask.checkPlayer(event.getPlayer(),event.getTo(),true,true);
  if (newLoc != null)   event.setTo(newLoc);
}
Program: 91723
Project: 91723
Buggy source:
public static Location checkPlayer(Player player,Location targetLoc,boolean returnLocationOnly){
  if (player == null || !player.isOnline())   return null;
  Location loc=(targetLoc == null) ? player.getLocation() : targetLoc;
  if (loc == null)   return null;
  World world=loc.getWorld();
  if (world == null)   return null;
  BorderData border=Config.Border(world.getName());
  if (border == null)   return null;
  if (border.insideBorder(loc.getX(),loc.getZ(),Config.ShapeRound()))   return null;
  Location newLoc=newLocation(player,loc,border);
  if (Config.whooshEffect()) {
    world.playEffect(loc,Effect.ENDER_SIGNAL,0);
    world.playEffect(loc,Effect.ENDER_SIGNAL,0);
    world.playEffect(loc,Effect.SMOKE,4);
    world.playEffect(loc,Effect.SMOKE,4);
    world.playEffect(loc,Effect.SMOKE,4);
    world.playEffect(loc,Effect.GHAST_SHOOT,0);
  }
  if (returnLocationOnly)   return newLoc;
  if (!player.isInsideVehicle())   player.teleport(newLoc);
 else {
    Vehicle ride=player.getVehicle();
    if (ride != null) {
      double vertOffset=ride.getLocation().getY() - loc.getY();
      newLoc.setY(newLoc.getY() + vertOffset);
      ride.setVelocity(new Vector(0,0,0));
      ride.teleport(newLoc);
    }
 else {
      player.leaveVehicle();
      player.teleport(newLoc);
    }
  }
  return null;
}

Fixed version (ground truth):
public static Location checkPlayer(Player player,Location targetLoc,boolean returnLocationOnly){
  if (player == null || !player.isOnline())   return null;
  Location loc=(targetLoc == null) ? player.getLocation().clone() : targetLoc;
  if (loc == null)   return null;
  World world=loc.getWorld();
  if (world == null)   return null;
  BorderData border=Config.Border(world.getName());
  if (border == null)   return null;
  if (border.insideBorder(loc.getX(),loc.getZ(),Config.ShapeRound()))   return null;
  Location newLoc=newLocation(player,loc,border);
  if (Config.whooshEffect()) {
    world.playEffect(loc,Effect.ENDER_SIGNAL,0);
    world.playEffect(loc,Effect.ENDER_SIGNAL,0);
    world.playEffect(loc,Effect.SMOKE,4);
    world.playEffect(loc,Effect.SMOKE,4);
    world.playEffect(loc,Effect.SMOKE,4);
    world.playEffect(loc,Effect.GHAST_SHOOT,0);
  }
  if (returnLocationOnly)   return newLoc;
  if (!player.isInsideVehicle())   player.teleport(newLoc);
 else {
    Vehicle ride=(Vehicle)player.getVehicle();
    if (ride != null) {
      double vertOffset=ride.getLocation().getY() - loc.getY();
      newLoc.setY(newLoc.getY() + vertOffset);
      ride.setVelocity(new Vector(0,0,0));
      ride.teleport(newLoc);
    }
 else {
      player.leaveVehicle();
      player.teleport(newLoc);
    }
  }
  return null;
}
Program: 91724
Project: 91724
Buggy source:
public static Location checkPlayer(Player player,Location targetLoc,boolean returnLocationOnly){
  if (player == null || !player.isOnline())   return null;
  Location loc=(targetLoc == null) ? player.getLocation().clone() : targetLoc;
  if (loc == null)   return null;
  World world=loc.getWorld();
  if (world == null)   return null;
  BorderData border=Config.Border(world.getName());
  if (border == null)   return null;
  if (border.insideBorder(loc.getX(),loc.getZ(),Config.ShapeRound()))   return null;
  Location newLoc=newLocation(player,loc,border);
  if (Config.whooshEffect()) {
    world.playEffect(loc,Effect.ENDER_SIGNAL,0);
    world.playEffect(loc,Effect.ENDER_SIGNAL,0);
    world.playEffect(loc,Effect.SMOKE,4);
    world.playEffect(loc,Effect.SMOKE,4);
    world.playEffect(loc,Effect.SMOKE,4);
    world.playEffect(loc,Effect.GHAST_SHOOT,0);
  }
  if (returnLocationOnly)   return newLoc;
  if (!player.isInsideVehicle())   player.teleport(newLoc);
 else {
    Vehicle ride=(Vehicle)player.getVehicle();
    if (ride != null) {
      double vertOffset=ride.getLocation().getY() - loc.getY();
      newLoc.setY(newLoc.getY() + vertOffset);
      ride.setVelocity(new Vector(0,0,0));
      ride.teleport(newLoc);
    }
 else {
      player.leaveVehicle();
      player.teleport(newLoc);
    }
  }
  return null;
}

Fixed version (ground truth):
public static Location checkPlayer(Player player,Location targetLoc,boolean returnLocationOnly){
  if (player == null || !player.isOnline())   return null;
  Location loc=(targetLoc == null) ? player.getLocation().clone() : targetLoc;
  if (loc == null)   return null;
  World world=loc.getWorld();
  if (world == null)   return null;
  BorderData border=Config.Border(world.getName());
  if (border == null)   return null;
  if (border.insideBorder(loc.getX(),loc.getZ(),Config.ShapeRound()))   return null;
  Location newLoc=newLocation(player,loc,border);
  if (Config.whooshEffect()) {
    world.playEffect(loc,Effect.ENDER_SIGNAL,0);
    world.playEffect(loc,Effect.ENDER_SIGNAL,0);
    world.playEffect(loc,Effect.SMOKE,4);
    world.playEffect(loc,Effect.SMOKE,4);
    world.playEffect(loc,Effect.SMOKE,4);
    world.playEffect(loc,Effect.GHAST_SHOOT,0);
  }
  if (returnLocationOnly)   return newLoc;
  if (!player.isInsideVehicle())   player.teleport(newLoc);
 else {
    Entity ride=player.getVehicle();
    if (ride != null) {
      double vertOffset=ride.getLocation().getY() - loc.getY();
      newLoc.setY(newLoc.getY() + vertOffset);
      ride.setVelocity(new Vector(0,0,0));
      ride.teleport(newLoc);
    }
 else {
      player.leaveVehicle();
      player.teleport(newLoc);
    }
  }
  return null;
}
Program: 91725
Project: 91725
Buggy source:
private void unloadChunks(){
  for (  CoordXZ unload : trimChunks) {
    world.unloadChunk(unload.x,unload.z,false,false);
  }
  counter+=trimChunks.size();
}

Fixed version (ground truth):
private void unloadChunks(){
  for (  CoordXZ unload : trimChunks) {
    if (world.isChunkLoaded(unload.x,unload.z))     world.unloadChunk(unload.x,unload.z,false,false);
  }
  counter+=trimChunks.size();
}