Program: 135928
Project: 135928
Buggy source:
private static void setUseMarkers(OpApplNode[] uses,String moduleName,Spec spec){
  Location[] locations=new Location[uses.length];
  for (int i=0; i < locations.length; i++) {
    SyntaxTreeNode stn=(SyntaxTreeNode)uses[i].stn;
switch (stn.getKind()) {
case N_OpApplication:
      stn=(SyntaxTreeNode)stn.heirs()[0];
    break;
case N_InfixExpr:
case N_PostfixExpr:
  stn=(SyntaxTreeNode)stn.heirs()[1];
break;
case N_GeneralId:
break;
default :
System.out.println("String_Node_Str" + stn.getKind() + "String_Node_Str");
}
locations[i]=stn.getLocation();
}
Arrays.sort(locations,new LocationComparator());
UIHelper.jumpToLocation(locations[0]);
spec.setCurrentSelection(0);
IResource resource=ResourceHelper.getResourceByModuleName(spec.getModuleToShow());
if (resource == null) {
System.out.println("String_Node_Str");
return;
}
try {
resource.deleteMarkers(SHOW_USE_MARKER_TYPE,false,99);
spec.setMarkersToShow(null);
IMarker[] markersToShow=new IMarker[locations.length];
for (int i=0; i < markersToShow.length; i++) {
IRegion iregion=AdapterFactory.locationToRegion(locations[i]);
IMarker marker;
marker=resource.createMarker(SHOW_USE_MARKER_TYPE);
Map markerAttributes=new HashMap(2);
markerAttributes.put(IMarker.CHAR_START,new Integer(iregion.getOffset()));
markerAttributes.put(IMarker.CHAR_END,new Integer(iregion.getOffset() + iregion.getLength()));
marker.setAttributes(markerAttributes);
markersToShow[i]=marker;
}
spec.setMarkersToShow(markersToShow);
}
 catch (CoreException e) {
e.printStackTrace();
}
}

Fixed version (ground truth):
private static void setUseMarkers(OpApplNode[] uses,String moduleName,Spec spec){
  Location[] locations=new Location[uses.length];
  for (int i=0; i < locations.length; i++) {
    SyntaxTreeNode stn=(SyntaxTreeNode)uses[i].stn;
switch (stn.getKind()) {
case N_OpApplication:
      stn=(SyntaxTreeNode)stn.heirs()[0];
    break;
case N_InfixExpr:
case N_PostfixExpr:
  stn=(SyntaxTreeNode)stn.heirs()[1];
break;
case N_GeneralId:
if (uses[i].subExpressionOf != null) {
while (stn.getKind() > NULL_ID && stn.heirs() != null && stn.heirs().length > 0) {
  stn=(SyntaxTreeNode)stn.heirs()[0];
}
}
break;
default :
System.out.println("String_Node_Str" + stn.getKind() + "String_Node_Str");
}
locations[i]=stn.getLocation();
}
Arrays.sort(locations,new LocationComparator());
UIHelper.jumpToLocation(locations[0]);
spec.setCurrentSelection(0);
IResource resource=ResourceHelper.getResourceByModuleName(spec.getModuleToShow());
if (resource == null) {
System.out.println("String_Node_Str");
return;
}
try {
resource.deleteMarkers(SHOW_USE_MARKER_TYPE,false,99);
spec.setMarkersToShow(null);
IMarker[] markersToShow=new IMarker[locations.length];
for (int i=0; i < markersToShow.length; i++) {
IRegion iregion=AdapterFactory.locationToRegion(locations[i]);
IMarker marker;
marker=resource.createMarker(SHOW_USE_MARKER_TYPE);
Map markerAttributes=new HashMap(2);
markerAttributes.put(IMarker.CHAR_START,new Integer(iregion.getOffset()));
markerAttributes.put(IMarker.CHAR_END,new Integer(iregion.getOffset() + iregion.getLength()));
marker.setAttributes(markerAttributes);
markersToShow[i]=marker;
}
spec.setMarkersToShow(markersToShow);
}
 catch (CoreException e) {
e.printStackTrace();
}
}