Program: 102257
Project: 102257
Buggy source:
@Override protected void inputChanged(Object input,Object oldInput){
  if (input == null) {
    return;
  }
  InputStream isRight=null;
  IPath pathRight=null;
  IResource resLeft=null;
  IResource resRight=null;
  DiffNode node=(DiffNode)input;
  ITypedElement teLeft=node.getLeft();
  if (teLeft instanceof ResourceNode) {
    rnLeft=(ResourceNode)teLeft;
    resLeft=rnLeft.getResource();
  }
  ITypedElement teRight=node.getRight();
  if (teRight instanceof ResourceNode) {
    iCompareType=RESOURCE_NODE_TO_RESOURCE_NODE;
    rnRight=(ResourceNode)teRight;
    resRight=rnRight.getResource();
  }
 else   if (teRight instanceof HistoryItem) {
    iCompareType=RESOURCE_NODE_TO_INPUT_STREAM;
    rnRight=null;
    hiRight=(HistoryItem)teRight;
    pathRight=new Path(hiRight.getName());
    try {
      isRight=hiRight.getContents();
    }
 catch (    CoreException ce) {
      UiConstants.Util.log(ce);
    }
  }
  if (iCompareType == RESOURCE_NODE_TO_RESOURCE_NODE) {
    try {
      ModelResource mrLeft=findModelResource(resLeft,true);
      ModelResource mrRight=findModelResource(resRight,true);
      dpProcessor=ModelerComparePlugin.createDifferenceProcessor(mrLeft,mrRight);
    }
 catch (    ModelWorkspaceException mwe) {
      UiConstants.Util.log(mwe);
    }
  }
 else {
    IProject project=resLeft.getProject();
    if ((project != null) && project.isOpen() && ModelerCore.hasModelNature(project)&& (resLeft.getType() == IResource.FILE)) {
      try {
        ModelResource mrLeft=findModelResource(resLeft,true);
        if (mrLeft != null) {
          dpProcessor=ModelerComparePlugin.createDifferenceProcessor(isRight,pathRight,mrLeft,mrLeft.getDescription());
        }
      }
 catch (      ModelWorkspaceException mwe) {
        UiConstants.Util.log(mwe);
      }
    }
  }
  dpProcessor.execute(new NullProgressMonitor());
  drReport=dpProcessor.getDifferenceReport();
  getDifferenceReportsPanel().setTerminologyStyle(getTerminologyStyle(iCompareType));
  getDifferenceReportsPanel().setDifferenceReports(Collections.singletonList(drReport));
  if (iCompareType == RESOURCE_NODE_TO_RESOURCE_NODE) {
    getDifferenceReportsPanel().setObjectNames(getLeftObjectName(),getRightObjectName());
  }
 else   if (iCompareType == RESOURCE_NODE_TO_INPUT_STREAM) {
    getDifferenceReportsPanel().setObjectNames(getRightObjectName(),getLeftObjectName());
  }
}

Fixed version (ground truth):
@Override protected void inputChanged(Object input,Object oldInput){
  if (input == null) {
    return;
  }
  InputStream isRight=null;
  IPath pathRight=null;
  IResource resLeft=null;
  IResource resRight=null;
  DiffNode node=(DiffNode)input;
  ITypedElement teLeft=node.getLeft();
  if (teLeft instanceof ResourceNode) {
    rnLeft=(ResourceNode)teLeft;
    resLeft=rnLeft.getResource();
  }
  ITypedElement teRight=node.getRight();
  if (teRight instanceof ResourceNode) {
    iCompareType=RESOURCE_NODE_TO_RESOURCE_NODE;
    rnRight=(ResourceNode)teRight;
    resRight=rnRight.getResource();
  }
 else   if (teRight instanceof HistoryItem) {
    iCompareType=RESOURCE_NODE_TO_INPUT_STREAM;
    rnRight=null;
    hiRight=(HistoryItem)teRight;
    pathRight=new Path(hiRight.getName());
    try {
      isRight=hiRight.getContents();
    }
 catch (    CoreException ce) {
      UiConstants.Util.log(ce);
    }
  }
  if (iCompareType == RESOURCE_NODE_TO_RESOURCE_NODE) {
    try {
      ModelResource mrLeft=findModelResource(resLeft,true);
      ModelResource mrRight=findModelResource(resRight,true);
      dpProcessor=ModelerComparePlugin.createDifferenceProcessor(mrLeft,mrRight);
    }
 catch (    ModelWorkspaceException mwe) {
      UiConstants.Util.log(mwe);
    }
  }
 else {
    IProject project=null;
    if (resLeft != null) {
      project=resLeft.getProject();
    }
    if ((project != null) && project.isOpen() && ModelerCore.hasModelNature(project)&& (resLeft.getType() == IResource.FILE)) {
      try {
        ModelResource mrLeft=findModelResource(resLeft,true);
        if (mrLeft != null) {
          dpProcessor=ModelerComparePlugin.createDifferenceProcessor(isRight,pathRight,mrLeft,mrLeft.getDescription());
        }
      }
 catch (      ModelWorkspaceException mwe) {
        UiConstants.Util.log(mwe);
      }
    }
  }
  dpProcessor.execute(new NullProgressMonitor());
  drReport=dpProcessor.getDifferenceReport();
  getDifferenceReportsPanel().setTerminologyStyle(getTerminologyStyle(iCompareType));
  getDifferenceReportsPanel().setDifferenceReports(Collections.singletonList(drReport));
  if (iCompareType == RESOURCE_NODE_TO_RESOURCE_NODE) {
    getDifferenceReportsPanel().setObjectNames(getLeftObjectName(),getRightObjectName());
  }
 else   if (iCompareType == RESOURCE_NODE_TO_INPUT_STREAM) {
    getDifferenceReportsPanel().setObjectNames(getRightObjectName(),getLeftObjectName());
  }
}