nus-yam/ex-repair huggingface dataset:
Program: 81911
Project: 81911
Buggy source:
/** 
 * Run the given proxy through a ProxySerializer and verify that the before-and-after values match.
 */
protected <T extends BaseProxy>T checkSerialization(T proxy){
  AutoBean<T> originalBean=AutoBeanUtils.getAutoBean(proxy);
  SimpleProxyId<T> id=BaseProxyCategory.stableId(originalBean);
  DefaultProxyStore store=new DefaultProxyStore();
  ProxySerializer s=req.getSerializer(store);
  String key=s.serialize(proxy);
  assertNotNull(key);
  store=new DefaultProxyStore(store.encode());
  s=req.getSerializer(store);
  T restored=s.deserialize(id.getProxyClass(),key);
  AutoBean<BaseProxy> restoredBean=AutoBeanUtils.getAutoBean(restored);
  assertNotSame(proxy,restored);
  assertTrue(AutoBeanUtils.deepEquals(originalBean,restoredBean));
  if (proxy instanceof EntityProxy && !id.isEphemeral()) {
    assertEquals(((EntityProxy)proxy).stableId(),((EntityProxy)restored).stableId());
  }
  restoredBean.setTag(Constants.STABLE_ID,originalBean.getTag(Constants.STABLE_ID));
  return restored;
}

Fixed version (ground truth):
/** 
 * Run the given proxy through a ProxySerializer and verify that the before-and-after values match.
 */
protected <T extends BaseProxy>T checkSerialization(T proxy){
  AutoBean<T> originalBean=AutoBeanUtils.getAutoBean(proxy);
  SimpleProxyId<T> id=BaseProxyCategory.stableId(originalBean);
  DefaultProxyStore store=new DefaultProxyStore();
  ProxySerializer s=req.getSerializer(store);
  String key=s.serialize(proxy);
  assertNotNull(key);
  store=new DefaultProxyStore(store.encode());
  s=req.getSerializer(store);
  T restored=s.deserialize(id.getProxyClass(),key);
  AutoBean<? extends BaseProxy> restoredBean=AutoBeanUtils.getAutoBean(restored);
  assertNotSame(proxy,restored);
  assertTrue(AutoBeanUtils.deepEquals(originalBean,restoredBean));
  if (proxy instanceof EntityProxy && !id.isEphemeral()) {
    assertEquals(((EntityProxy)proxy).stableId(),((EntityProxy)restored).stableId());
  }
  restoredBean.setTag(Constants.STABLE_ID,originalBean.getTag(Constants.STABLE_ID));
  return restored;
}
Program: 81912
Project: 81912
Buggy source:
public int compareTo(Timestamp o){
  int delta=(int)(getTime() - o.getTime());
  return delta == 0 ? getNanos() - o.getNanos() : delta;
}

Fixed version (ground truth):
public int compareTo(Timestamp o){
  int sign=Long.signum(getTime() - o.getTime());
  return sign == 0 ? getNanos() - o.getNanos() : sign;
}
Program: 81913
Project: 81913
Buggy source:
public int compareTo(Date other){
  long thisTime=getTime();
  long otherTime=other.getTime();
  if (thisTime < otherTime) {
    return -1;
  }
 else   if (thisTime > otherTime) {
    return 1;
  }
 else {
    return 0;
  }
}

Fixed version (ground truth):
public int compareTo(Date other){
  return Long.signum(getTime() - other.getTime());
}
Program: 81914
Project: 81914
Buggy source:
private void writeEmptyMethod(String mangledMethodName,Method method){
}

Fixed version (ground truth):
private void writeEmptyMethod(String mangledMethodName,Method declMethod){
  MethodVisitor mv=super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_ABSTRACT,mangledMethodName,declMethod.getDescriptor(),null,null);
  mv.visitEnd();
}
Program: 81915
Project: 81915
Buggy source:
@Override public void visitEnd(){
  if (inSingleJsoImplInterfaceType) {
    for (    Map.Entry<String,List<Method>> entry : toImplement(currentTypeName).entrySet()) {
      for (      Method method : entry.getValue()) {
        writeEmptyMethod(entry.getKey(),method);
      }
    }
  }
  super.visitEnd();
}

Fixed version (ground truth):
@Override public void visitEnd(){
  if (inSingleJsoImplInterfaceType) {
    for (    String mangledName : toImplement(currentTypeName)) {
      for (      Method method : jsoData.getDeclarations(mangledName)) {
        writeEmptyMethod(mangledName,method);
      }
    }
  }
  super.visitEnd();
}
Program: 81916
Project: 81916
Buggy source:
/** 
 * Given a resource name of a class, find all mangled method names that must be implemented.
 */
private SortedMap<String,List<Method>> toImplement(String typeName){
  String name=typeName.replace('/','_');
  String prefix=name + "String_Node_Str";
  String suffix=name + "String_Node_Str";
  SortedMap<String,List<Method>> toReturn=new TreeMap<String,List<Method>>();
  for (  String mangledName : jsoData.getMangledNames().subSet(prefix,suffix)) {
    toReturn.put(mangledName,jsoData.getImplementations(mangledName));
  }
  toReturn.keySet().removeAll(implementedMethods);
  return toReturn;
}

Fixed version (ground truth):
/** 
 * Given a resource name of a class, find all mangled method names that must be implemented.
 */
private SortedSet<String> toImplement(String typeName){
  String name=typeName.replace('/','_');
  String prefix=name + "String_Node_Str";
  String suffix=name + "String_Node_Str";
  SortedSet<String> toReturn=new TreeSet<String>();
  for (  String mangledName : jsoData.getMangledNames().subSet(prefix,suffix)) {
    if (!implementedMethods.contains(mangledName)) {
      toReturn.add(mangledName);
    }
  }
  return toReturn;
}
Program: 81917
Project: 81917
Buggy source:
/** 
 * For regular Java objects that implement a SingleJsoImpl interface, write instance trampoline dispatchers for mangled method names to the implementing method.
 */
private void writeTrampoline(String stubIntr){
  for (  Map.Entry<String,List<Method>> entry : toImplement(stubIntr).entrySet()) {
    for (    Method method : entry.getValue()) {
      String mangledName=entry.getKey();
      String descriptor="String_Node_Str" + method.getDescriptor().substring(1 + method.getArgumentTypes()[0].getDescriptor().length());
      String localName=method.getName().substring(0,method.getName().length() - 1);
      Method toCall=new Method(localName,descriptor);
      MethodVisitor mv=super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_SYNTHETIC,mangledName,descriptor,null,null);
      if (mv != null) {
        mv.visitCode();
        int var=1;
        int size=1;
        mv.visitVarInsn(Opcodes.ALOAD,0);
        for (        Type t : toCall.getArgumentTypes()) {
          size+=t.getSize();
          mv.visitVarInsn(t.getOpcode(Opcodes.ILOAD),var);
          var+=t.getSize();
        }
        size=Math.max(size,toCall.getReturnType().getSize());
        mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL,currentTypeName,toCall.getName(),toCall.getDescriptor());
        mv.visitInsn(toCall.getReturnType().getOpcode(Opcodes.IRETURN));
        mv.visitMaxs(size,var);
        mv.visitEnd();
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * For regular Java objects that implement a SingleJsoImpl interface, write instance trampoline dispatchers for mangled method names to the implementing method.
 */
private void writeTrampoline(String stubIntr){
  for (  String mangledName : toImplement(stubIntr)) {
    for (    Method method : jsoData.getDeclarations(mangledName)) {
      Method toCall=new Method(method.getName(),method.getDescriptor());
      MethodVisitor mv=super.visitMethod(Opcodes.ACC_PUBLIC | Opcodes.ACC_SYNTHETIC,mangledName,method.getDescriptor(),null,null);
      if (mv != null) {
        mv.visitCode();
        int var=1;
        int size=1;
        mv.visitVarInsn(Opcodes.ALOAD,0);
        for (        Type t : toCall.getArgumentTypes()) {
          size+=t.getSize();
          mv.visitVarInsn(t.getOpcode(Opcodes.ILOAD),var);
          var+=t.getSize();
        }
        size=Math.max(size,toCall.getReturnType().getSize());
        mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL,currentTypeName,toCall.getName(),toCall.getDescriptor());
        mv.visitInsn(toCall.getReturnType().getOpcode(Opcodes.IRETURN));
        mv.visitMaxs(size,var);
        mv.visitEnd();
      }
    }
  }
}
Program: 81918
Project: 81918
Buggy source:
public static PlainJsoWithInterface create(){
  return JavaScriptObject.createArray().cast();
}

Fixed version (ground truth):
static Element create(){
  return (Element)JavaScriptObject.createObject();
}
Program: 81919
Project: 81919
Buggy source:
@Override protected Element getKeyboardSelectedElement(){
  int rowIndex=getKeyboardSelectedRow();
  if (childContainer.getChildCount() > rowIndex) {
    return childContainer.getChild(rowIndex).cast();
  }
  return null;
}

Fixed version (ground truth):
@Override protected Element getKeyboardSelectedElement(){
  int rowIndex=getKeyboardSelectedRow();
  if (rowIndex >= 0 && childContainer.getChildCount() > rowIndex) {
    return childContainer.getChild(rowIndex).cast();
  }
  return null;
}
Program: 81920
Project: 81920
Buggy source:
@Override protected Element getKeyboardSelectedElement(){
  int rowIndex=getKeyboardSelectedRow();
  NodeList<TableRowElement> rows=tbody.getRows();
  if (rowIndex < rows.getLength() && columns.size() > 0) {
    TableRowElement tr=rows.getItem(rowIndex);
    TableCellElement td=tr.getCells().getItem(keyboardSelectedColumn);
    return getCellParent(td);
  }
  return null;
}

Fixed version (ground truth):
@Override protected Element getKeyboardSelectedElement(){
  int rowIndex=getKeyboardSelectedRow();
  NodeList<TableRowElement> rows=tbody.getRows();
  if (rowIndex >= 0 && rowIndex < rows.getLength() && columns.size() > 0) {
    TableRowElement tr=rows.getItem(rowIndex);
    TableCellElement td=tr.getCells().getItem(keyboardSelectedColumn);
    return getCellParent(td);
  }
  return null;
}
Program: 81921
Project: 81921
Buggy source:
public Double parse(CharSequence object) throws ParseException {
  if ("String_Node_Str".equals(object.toString())) {
    return null;
  }
  try {
    return Math.rint(NumberFormat.getDecimalFormat().parse(object.toString()));
  }
 catch (  NumberFormatException e) {
    throw new ParseException(e.getMessage(),0);
  }
}

Fixed version (ground truth):
public Double parse(CharSequence object) throws ParseException {
  if ("String_Node_Str".equals(object.toString())) {
    return null;
  }
  try {
    return NumberFormat.getDecimalFormat().parse(object.toString());
  }
 catch (  NumberFormatException e) {
    throw new ParseException(e.getMessage(),0);
  }
}
Program: 81923
Project: 81923
Buggy source:
private boolean classImplementsMethod(JClassType cls,JMethod meth){
  while (cls != null) {
    JMethod found=cls.findMethod(meth.getName(),methodParamTypes(meth));
    if ((found != null) && !found.isAbstract()) {
      return true;
    }
    cls=cls.getSuperclass();
  }
  return false;
}

Fixed version (ground truth):
private boolean classImplementsMethod(JClassType cls,JMethod meth){
  while (cls != null) {
    JMethod found=cls.findMethod(meth.getName(),meth.getParameterTypes());
    if ((found != null) && !found.isAbstract()) {
      return true;
    }
    cls=cls.getSuperclass();
  }
  return false;
}
Program: 81924
Project: 81924
Buggy source:
/** 
 * Updates the list of jsoSingleImpl types from recently-added types.
 */
private void computeSingleJsoImplData(JClassType... newTypes){
  JClassType jsoType=findType(JSO_CLASS);
  if (jsoType == null) {
    return;
  }
  for (  JClassType type : newTypes) {
    if (!jsoType.isAssignableFrom(type)) {
      continue;
    }
    for (    JClassType intf : JClassType.getFlattenedSuperTypeHierarchy(type)) {
      if (intf.isInterface() == null) {
        continue;
      }
      if (intf.getOverridableMethods().length == 0) {
        jsoSingleImpls.put(intf,jsoType);
        continue;
      }
      JClassType previousType=jsoSingleImpls.get(intf);
      if (previousType == null) {
        jsoSingleImpls.put(intf,type);
      }
 else       if (type.isAssignableFrom(previousType)) {
        jsoSingleImpls.put(intf,type);
      }
 else       if (type.isAssignableTo(previousType)) {
      }
 else {
        JClassType impl=findFullyImplementingBase(intf,type,previousType);
        if (impl != null) {
          jsoSingleImpls.put(intf,impl);
        }
 else {
          throw new InternalCompilerException("String_Node_Str" + previousType.getName() + "String_Node_Str"+ intf.getName()+ "String_Node_Str"+ type.getName()+ "String_Node_Str"+ "String_Node_Str");
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Updates the list of jsoSingleImpl types from recently-added types.
 */
private void computeSingleJsoImplData(JClassType... newTypes){
  JClassType jsoType=findType(JSO_CLASS);
  if (jsoType == null) {
    return;
  }
  for (  JClassType type : newTypes) {
    if (!jsoType.isAssignableFrom(type)) {
      continue;
    }
    for (    JClassType intf : JClassType.getFlattenedSuperTypeHierarchy(type)) {
      if (intf instanceof JParameterizedType) {
        intf=((JParameterizedType)intf).getBaseType();
      }
      if (intf.isInterface() == null) {
        continue;
      }
      if (intf.getOverridableMethods().length == 0) {
        jsoSingleImpls.put(intf,jsoType);
        continue;
      }
      JClassType previousType=jsoSingleImpls.get(intf);
      if (previousType == null) {
        jsoSingleImpls.put(intf,type);
      }
 else       if (type.isAssignableFrom(previousType)) {
        jsoSingleImpls.put(intf,type);
      }
 else       if (type.isAssignableTo(previousType)) {
      }
 else {
        JClassType impl=findFullyImplementingBase(intf,type,previousType);
        if (impl != null) {
          jsoSingleImpls.put(intf,impl);
        }
 else {
          throw new InternalCompilerException("String_Node_Str" + previousType.getName() + "String_Node_Str"+ intf.getName()+ "String_Node_Str"+ type.getName()+ "String_Node_Str"+ "String_Node_Str");
        }
      }
    }
  }
}
Program: 81925
Project: 81925
Buggy source:
/** 
 * Commit the current value.
 * @param parent the parent element
 * @param viewData the {@link ViewData} object
 * @param valueUpdater the {@link ValueUpdater}
 */
private void commit(Element parent,ViewData viewData,ValueUpdater<String> valueUpdater){
  String value=updateViewData(parent,viewData,false);
  clearInput(getInputElement(parent));
  setValue(parent,value,viewData);
  valueUpdater.update(value);
}

Fixed version (ground truth):
/** 
 * Commit the current value.
 * @param parent the parent element
 * @param viewData the {@link ViewData} object
 * @param valueUpdater the {@link ValueUpdater}
 */
private void commit(Element parent,ViewData viewData,ValueUpdater<String> valueUpdater){
  String value=updateViewData(parent,viewData,false);
  clearInput(getInputElement(parent));
  setValue(parent,value,viewData);
  if (valueUpdater != null) {
    valueUpdater.update(value);
  }
}
Program: 81926
Project: 81926
Buggy source:
/** 
 * Navigate to a deeper node.
 */
private void keyboardNavigateDeep(){
  if (isKeyboardSelectionDisabled()) {
    return;
  }
  if (level < treeNodes.size() - 1) {
    TreeNodeImpl<?> treeNode=treeNodes.get(level + 1);
    treeNode.display.getPresenter().setKeyboardSelectedRow(treeNode.display.getKeyboardSelectedRow(),true);
  }
}

Fixed version (ground truth):
/** 
 * Navigate to a deeper node.
 */
private void keyboardNavigateDeep(){
  if (isKeyboardSelectionDisabled()) {
    return;
  }
  if (level < treeNodes.size() - 1) {
    TreeNodeImpl<?> treeNode=treeNodes.get(level + 1);
    treeNode.display.getPresenter().setKeyboardSelectedRow(treeNode.display.getKeyboardSelectedRow(),true,true);
  }
}
Program: 81927
Project: 81927
Buggy source:
public TreeNode setChildOpen(int index,boolean open,boolean fireEvents){
  assertNotDestroyed();
  checkChildBounds(index);
  if (open) {
    display.getPresenter().setKeyboardSelectedRow(index,false);
    return updateChildState(display,fireEvents);
  }
 else {
    if (index == display.getKeyboardSelectedRow()) {
      display.getPresenter().clearKeyboardSelectedRowValue();
      updateChildState(display,fireEvents);
    }
    return null;
  }
}

Fixed version (ground truth):
public TreeNode setChildOpen(int index,boolean open,boolean fireEvents){
  assertNotDestroyed();
  checkChildBounds(index);
  if (open) {
    display.getPresenter().setKeyboardSelectedRow(index,false,true);
    return updateChildState(display,fireEvents);
  }
 else {
    if (index == display.getKeyboardSelectedRow()) {
      display.getPresenter().clearKeyboardSelectedRowValue();
      updateChildState(display,fireEvents);
    }
    return null;
  }
}
Program: 81928
Project: 81928
Buggy source:
@Override protected void renderRowValues(SafeHtmlBuilder sb,List<T> values,int start,SelectionModel<? super T> selectionModel){
  String keyboardSelectedItem="String_Node_Str" + style.cellListKeyboardSelectedItem();
  String selectedItem="String_Node_Str" + style.cellListSelectedItem();
  String evenItem=style.cellListEvenItem();
  String oddItem=style.cellListOddItem();
  int keyboardSelectedRow=getKeyboardSelectedRow() + getPageStart();
  int length=values.size();
  int end=start + length;
  for (int i=start; i < end; i++) {
    T value=values.get(i - start);
    boolean isSelected=selectionModel == null ? false : selectionModel.isSelected(value);
    StringBuilder classesBuilder=new StringBuilder();
    classesBuilder.append(i % 2 == 0 ? evenItem : oddItem);
    if (isSelected) {
      classesBuilder.append(selectedItem);
    }
    SafeHtmlBuilder cellBuilder=new SafeHtmlBuilder();
    cell.render(value,null,cellBuilder);
    if (i == keyboardSelectedRow) {
      if (isFocused) {
        classesBuilder.append(keyboardSelectedItem);
      }
      char accessKey=getAccessKey();
      if (accessKey != 0) {
        sb.append(TEMPLATE.divFocusableWithKey(i,classesBuilder.toString(),getTabIndex(),accessKey,cellBuilder.toSafeHtml()));
      }
 else {
        sb.append(TEMPLATE.divFocusable(i,classesBuilder.toString(),getTabIndex(),cellBuilder.toSafeHtml()));
      }
    }
 else {
      sb.append(TEMPLATE.div(i,classesBuilder.toString(),cellBuilder.toSafeHtml()));
    }
  }
}

Fixed version (ground truth):
@Override protected void renderRowValues(SafeHtmlBuilder sb,List<T> values,int start,SelectionModel<? super T> selectionModel){
  String keyboardSelectedItem="String_Node_Str" + style.cellListKeyboardSelectedItem();
  String selectedItem="String_Node_Str" + style.cellListSelectedItem();
  String evenItem=style.cellListEvenItem();
  String oddItem=style.cellListOddItem();
  int keyboardSelectedRow=getKeyboardSelectedRow() + getPageStart();
  int length=values.size();
  int end=start + length;
  for (int i=start; i < end; i++) {
    T value=values.get(i - start);
    boolean isSelected=selectionModel == null ? false : selectionModel.isSelected(value);
    StringBuilder classesBuilder=new StringBuilder();
    classesBuilder.append(i % 2 == 0 ? evenItem : oddItem);
    if (isSelected) {
      classesBuilder.append(selectedItem);
    }
    SafeHtmlBuilder cellBuilder=new SafeHtmlBuilder();
    cell.render(value,getValueKey(value),cellBuilder);
    if (i == keyboardSelectedRow) {
      if (isFocused) {
        classesBuilder.append(keyboardSelectedItem);
      }
      char accessKey=getAccessKey();
      if (accessKey != 0) {
        sb.append(TEMPLATE.divFocusableWithKey(i,classesBuilder.toString(),getTabIndex(),accessKey,cellBuilder.toSafeHtml()));
      }
 else {
        sb.append(TEMPLATE.divFocusable(i,classesBuilder.toString(),getTabIndex(),cellBuilder.toSafeHtml()));
      }
    }
 else {
      sb.append(TEMPLATE.div(i,classesBuilder.toString(),cellBuilder.toSafeHtml()));
    }
  }
}
Program: 81929
Project: 81929
Buggy source:
@SuppressWarnings("String_Node_Str") @Override protected void onBrowserEvent2(Event event){
  EventTarget eventTarget=event.getEventTarget();
  if (!Element.is(eventTarget)) {
    return;
  }
  final Element target=event.getEventTarget().cast();
  String idxString="String_Node_Str";
  Element cellTarget=target;
  while ((cellTarget != null) && ((idxString=cellTarget.getAttribute("String_Node_Str")).length() == 0)) {
    cellTarget=cellTarget.getParentElement();
  }
  if (idxString.length() > 0) {
    String eventType=event.getType();
    boolean isClick="String_Node_Str".equals(eventType);
    int idx=Integer.parseInt(idxString);
    int indexOnPage=idx - getPageStart();
    if (!isRowWithinBounds(indexOnPage)) {
      return;
    }
    boolean isSelectionHandled=cell.handlesSelection() || KeyboardSelectionPolicy.BOUND_TO_SELECTION == getKeyboardSelectionPolicy();
    Element cellParent=getCellParent(cellTarget);
    T value=getVisibleItem(indexOnPage);
    CellPreviewEvent<T> previewEvent=CellPreviewEvent.fire(this,event,this,indexOnPage,value,cellIsEditing,isSelectionHandled);
    if (isClick && !cellIsEditing && !isSelectionHandled) {
      doSelection(event,value,indexOnPage);
    }
    if (isClick && getPresenter().getKeyboardSelectedRowInView() != indexOnPage) {
      boolean isFocusable=CellBasedWidgetImpl.get().isFocusable(target);
      isFocused=isFocused || isFocusable;
      getPresenter().setKeyboardSelectedRow(indexOnPage,!isFocusable);
    }
    if (!previewEvent.isCanceled()) {
      fireEventToCell(event,cellParent,value);
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override protected void onBrowserEvent2(Event event){
  EventTarget eventTarget=event.getEventTarget();
  if (!Element.is(eventTarget)) {
    return;
  }
  final Element target=event.getEventTarget().cast();
  String idxString="String_Node_Str";
  Element cellTarget=target;
  while ((cellTarget != null) && ((idxString=cellTarget.getAttribute("String_Node_Str")).length() == 0)) {
    cellTarget=cellTarget.getParentElement();
  }
  if (idxString.length() > 0) {
    String eventType=event.getType();
    boolean isClick="String_Node_Str".equals(eventType);
    int idx=Integer.parseInt(idxString);
    int indexOnPage=idx - getPageStart();
    if (!isRowWithinBounds(indexOnPage)) {
      return;
    }
    boolean isSelectionHandled=cell.handlesSelection() || KeyboardSelectionPolicy.BOUND_TO_SELECTION == getKeyboardSelectionPolicy();
    Element cellParent=getCellParent(cellTarget);
    T value=getVisibleItem(indexOnPage);
    CellPreviewEvent<T> previewEvent=CellPreviewEvent.fire(this,event,this,indexOnPage,value,cellIsEditing,isSelectionHandled);
    if (isClick && !cellIsEditing && !isSelectionHandled) {
      doSelection(event,value,indexOnPage);
    }
    if (isClick) {
      boolean isFocusable=CellBasedWidgetImpl.get().isFocusable(target);
      isFocused=isFocused || isFocusable;
      getPresenter().setKeyboardSelectedRow(indexOnPage,!isFocusable,false);
    }
    if (!previewEvent.isCanceled()) {
      fireEventToCell(event,cellParent,value);
    }
  }
}
Program: 81930
Project: 81930
Buggy source:
@Override protected void setKeyboardSelected(int index,boolean selected,boolean stealFocus){
  if (!isRowWithinBounds(index)) {
    return;
  }
  Element elem=getRowElement(index);
  if (!selected || isFocused || stealFocus) {
    setStyleName(elem,style.cellListKeyboardSelectedItem(),selected);
  }
  setFocusable(elem,selected);
  if (selected && stealFocus) {
    elem.focus();
    onFocus();
  }
}

Fixed version (ground truth):
@Override protected void setKeyboardSelected(int index,boolean selected,boolean stealFocus){
  if (!isRowWithinBounds(index)) {
    return;
  }
  Element elem=getRowElement(index);
  if (!selected || isFocused || stealFocus) {
    setStyleName(elem,style.cellListKeyboardSelectedItem(),selected);
  }
  setFocusable(elem,selected);
  if (selected && stealFocus && !cellIsEditing) {
    elem.focus();
    onFocus();
  }
}
Program: 81932
Project: 81932
Buggy source:
private boolean handleKey(Event event){
  HasDataPresenter<T> presenter=getPresenter();
  int oldRow=getKeyboardSelectedRow();
  boolean isRtl=LocaleInfo.getCurrentLocale().isRTL();
  int keyCodeLineEnd=isRtl ? KeyCodes.KEY_LEFT : KeyCodes.KEY_RIGHT;
  int keyCodeLineStart=isRtl ? KeyCodes.KEY_RIGHT : KeyCodes.KEY_LEFT;
  int keyCode=event.getKeyCode();
  if (keyCode == keyCodeLineEnd) {
    int nextColumn=findInteractiveColumn(keyboardSelectedColumn,false);
    if (nextColumn <= keyboardSelectedColumn) {
      if (presenter.hasKeyboardNext()) {
        keyboardSelectedColumn=nextColumn;
        presenter.keyboardNext();
        event.preventDefault();
        return true;
      }
    }
 else {
      keyboardSelectedColumn=nextColumn;
      getPresenter().setKeyboardSelectedRow(oldRow,true);
      event.preventDefault();
      return true;
    }
  }
 else   if (keyCode == keyCodeLineStart) {
    int prevColumn=findInteractiveColumn(keyboardSelectedColumn,true);
    if (prevColumn >= keyboardSelectedColumn) {
      if (presenter.hasKeyboardPrev()) {
        keyboardSelectedColumn=prevColumn;
        presenter.keyboardPrev();
        event.preventDefault();
        return true;
      }
    }
 else {
      keyboardSelectedColumn=prevColumn;
      getPresenter().setKeyboardSelectedRow(oldRow,true);
      event.preventDefault();
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean handleKey(Event event){
  HasDataPresenter<T> presenter=getPresenter();
  int oldRow=getKeyboardSelectedRow();
  boolean isRtl=LocaleInfo.getCurrentLocale().isRTL();
  int keyCodeLineEnd=isRtl ? KeyCodes.KEY_LEFT : KeyCodes.KEY_RIGHT;
  int keyCodeLineStart=isRtl ? KeyCodes.KEY_RIGHT : KeyCodes.KEY_LEFT;
  int keyCode=event.getKeyCode();
  if (keyCode == keyCodeLineEnd) {
    int nextColumn=findInteractiveColumn(keyboardSelectedColumn,false);
    if (nextColumn <= keyboardSelectedColumn) {
      if (presenter.hasKeyboardNext()) {
        keyboardSelectedColumn=nextColumn;
        presenter.keyboardNext();
        event.preventDefault();
        return true;
      }
    }
 else {
      keyboardSelectedColumn=nextColumn;
      getPresenter().setKeyboardSelectedRow(oldRow,true,true);
      event.preventDefault();
      return true;
    }
  }
 else   if (keyCode == keyCodeLineStart) {
    int prevColumn=findInteractiveColumn(keyboardSelectedColumn,true);
    if (prevColumn >= keyboardSelectedColumn) {
      if (presenter.hasKeyboardPrev()) {
        keyboardSelectedColumn=prevColumn;
        presenter.keyboardPrev();
        event.preventDefault();
        return true;
      }
    }
 else {
      keyboardSelectedColumn=prevColumn;
      getPresenter().setKeyboardSelectedRow(oldRow,true,true);
      event.preventDefault();
      return true;
    }
  }
  return false;
}
Program: 81933
Project: 81933
Buggy source:
@Override protected void setKeyboardSelected(int index,boolean selected,boolean stealFocus){
  if (KeyboardSelectionPolicy.DISABLED == getKeyboardSelectionPolicy() || !isRowWithinBounds(index) || columns.size() == 0) {
    return;
  }
  TableRowElement tr=getRowElement(index);
  String cellStyle=style.cellTableKeyboardSelectedCell();
  boolean updatedSelection=!selected || isFocused || stealFocus;
  setRowStyleName(tr,style.cellTableKeyboardSelectedRow(),style.cellTableKeyboardSelectedRowCell(),selected);
  NodeList<TableCellElement> cells=tr.getCells();
  for (int i=0; i < cells.getLength(); i++) {
    TableCellElement td=cells.getItem(i);
    setStyleName(td,cellStyle,updatedSelection && selected && i == keyboardSelectedColumn);
    final com.google.gwt.user.client.Element cellParent=getCellParent(td).cast();
    setFocusable(cellParent,selected && i == keyboardSelectedColumn);
  }
  if (selected && stealFocus) {
    TableCellElement td=tr.getCells().getItem(keyboardSelectedColumn);
    final com.google.gwt.user.client.Element cellParent=getCellParent(td).cast();
    CellBasedWidgetImpl.get().resetFocus(new Scheduler.ScheduledCommand(){
      public void execute(){
        cellParent.focus();
      }
    }
);
  }
}

Fixed version (ground truth):
@Override protected void setKeyboardSelected(int index,boolean selected,boolean stealFocus){
  if (KeyboardSelectionPolicy.DISABLED == getKeyboardSelectionPolicy() || !isRowWithinBounds(index) || columns.size() == 0) {
    return;
  }
  TableRowElement tr=getRowElement(index);
  String cellStyle=style.cellTableKeyboardSelectedCell();
  boolean updatedSelection=!selected || isFocused || stealFocus;
  setRowStyleName(tr,style.cellTableKeyboardSelectedRow(),style.cellTableKeyboardSelectedRowCell(),selected);
  NodeList<TableCellElement> cells=tr.getCells();
  for (int i=0; i < cells.getLength(); i++) {
    TableCellElement td=cells.getItem(i);
    setStyleName(td,cellStyle,updatedSelection && selected && i == keyboardSelectedColumn);
    final com.google.gwt.user.client.Element cellParent=getCellParent(td).cast();
    setFocusable(cellParent,selected && i == keyboardSelectedColumn);
  }
  if (selected && stealFocus && !cellIsEditing) {
    TableCellElement td=tr.getCells().getItem(keyboardSelectedColumn);
    final com.google.gwt.user.client.Element cellParent=getCellParent(td).cast();
    CellBasedWidgetImpl.get().resetFocus(new Scheduler.ScheduledCommand(){
      public void execute(){
        cellParent.focus();
      }
    }
);
  }
}
Program: 81934
Project: 81934
Buggy source:
/** 
 * Select or deselect this node with the keyboard.
 * @param selected true if selected, false if not
 * @param stealFocus true to steal focus
 */
void setKeyboardSelected(boolean selected,boolean stealFocus){
  if (tree.isKeyboardSelectionDisabled()) {
    return;
  }
  if (!selected || tree.isFocused || stealFocus) {
    setKeyboardSelectedStyle(selected);
  }
  Element cellParent=getCellParent();
  if (!selected) {
    cellParent.setTabIndex(-1);
    cellParent.removeAttribute("String_Node_Str");
    cellParent.removeAttribute("String_Node_Str");
  }
 else {
    FocusImpl focusImpl=FocusImpl.getFocusImplForWidget();
    com.google.gwt.user.client.Element cellElem=cellParent.cast();
    focusImpl.setTabIndex(cellElem,tree.getTabIndex());
    char accessKey=tree.getAccessKey();
    if (accessKey != 0) {
      focusImpl.setAccessKey(cellElem,accessKey);
    }
    if (stealFocus) {
      cellElem.focus();
    }
  }
  if (KeyboardSelectionPolicy.BOUND_TO_SELECTION == tree.getKeyboardSelectionPolicy()) {
    setSelected(selected);
  }
}

Fixed version (ground truth):
/** 
 * Select or deselect this node with the keyboard.
 * @param selected true if selected, false if not
 * @param stealFocus true to steal focus
 */
void setKeyboardSelected(boolean selected,boolean stealFocus){
  if (tree.isKeyboardSelectionDisabled()) {
    return;
  }
  if (!selected || tree.isFocused || stealFocus) {
    setKeyboardSelectedStyle(selected);
  }
  Element cellParent=getCellParent();
  if (!selected) {
    cellParent.setTabIndex(-1);
    cellParent.removeAttribute("String_Node_Str");
    cellParent.removeAttribute("String_Node_Str");
  }
 else {
    FocusImpl focusImpl=FocusImpl.getFocusImplForWidget();
    com.google.gwt.user.client.Element cellElem=cellParent.cast();
    focusImpl.setTabIndex(cellElem,tree.getTabIndex());
    char accessKey=tree.getAccessKey();
    if (accessKey != 0) {
      focusImpl.setAccessKey(cellElem,accessKey);
    }
    if (stealFocus && !tree.cellIsEditing) {
      cellElem.focus();
    }
  }
  if (KeyboardSelectionPolicy.BOUND_TO_SELECTION == tree.getKeyboardSelectionPolicy()) {
    setSelected(selected);
  }
}
Program: 81935
Project: 81935
Buggy source:
/** 
 * Move keyboard selection to the absolute 0th row.
 */
public void keyboardHome(){
  if (!keyboardPagingPolicy.isLimitedToRange()) {
    setKeyboardSelectedRow(-getPageStart(),true);
  }
}

Fixed version (ground truth):
/** 
 * Move keyboard selection to the absolute 0th row.
 */
public void keyboardHome(){
  if (!keyboardPagingPolicy.isLimitedToRange()) {
    setKeyboardSelectedRow(-getPageStart(),true,false);
  }
}
Program: 81936
Project: 81936
Buggy source:
/** 
 * Move keyboard selection to the next row.
 */
public void keyboardNext(){
  if (hasKeyboardNext()) {
    setKeyboardSelectedRow(getKeyboardSelectedRow() + 1,true);
  }
}

Fixed version (ground truth):
/** 
 * Move keyboard selection to the next row.
 */
public void keyboardNext(){
  if (hasKeyboardNext()) {
    setKeyboardSelectedRow(getKeyboardSelectedRow() + 1,true,false);
  }
}
Program: 81937
Project: 81937
Buggy source:
/** 
 * Move keyboard selection to the last row.
 */
public void keyboardEnd(){
  if (!keyboardPagingPolicy.isLimitedToRange()) {
    setKeyboardSelectedRow(getRowCount() - 1,true);
  }
}

Fixed version (ground truth):
/** 
 * Move keyboard selection to the last row.
 */
public void keyboardEnd(){
  if (!keyboardPagingPolicy.isLimitedToRange()) {
    setKeyboardSelectedRow(getRowCount() - 1,true,false);
  }
}
Program: 81939
Project: 81939
Buggy source:
/** 
 * Move keyboard selection to the previous row.
 */
public void keyboardPrev(){
  if (hasKeyboardPrev()) {
    setKeyboardSelectedRow(getKeyboardSelectedRow() - 1,true);
  }
}

Fixed version (ground truth):
/** 
 * Move keyboard selection to the previous row.
 */
public void keyboardPrev(){
  if (hasKeyboardPrev()) {
    setKeyboardSelectedRow(getKeyboardSelectedRow() - 1,true,false);
  }
}
Program: 81940
Project: 81940
Buggy source:
/** 
 * Move keyboard selection to the next page.
 */
public void keyboardNextPage(){
  if (KeyboardPagingPolicy.CHANGE_PAGE == keyboardPagingPolicy) {
    setKeyboardSelectedRow(getPageSize(),true);
  }
 else   if (KeyboardPagingPolicy.INCREASE_RANGE == keyboardPagingPolicy) {
    setKeyboardSelectedRow(getKeyboardSelectedRow() + PAGE_INCREMENT,true);
  }
}

Fixed version (ground truth):
/** 
 * Move keyboard selection to the next page.
 */
public void keyboardNextPage(){
  if (KeyboardPagingPolicy.CHANGE_PAGE == keyboardPagingPolicy) {
    setKeyboardSelectedRow(getPageSize(),true,false);
  }
 else   if (KeyboardPagingPolicy.INCREASE_RANGE == keyboardPagingPolicy) {
    setKeyboardSelectedRow(getKeyboardSelectedRow() + PAGE_INCREMENT,true,false);
  }
}
Program: 81941
Project: 81941
Buggy source:
/** 
 * Move keyboard selection to the previous page.
 */
public void keyboardPrevPage(){
  if (KeyboardPagingPolicy.CHANGE_PAGE == keyboardPagingPolicy) {
    setKeyboardSelectedRow(-getPageSize(),true);
  }
 else   if (KeyboardPagingPolicy.INCREASE_RANGE == keyboardPagingPolicy) {
    setKeyboardSelectedRow(getKeyboardSelectedRow() - PAGE_INCREMENT,true);
  }
}

Fixed version (ground truth):
/** 
 * Move keyboard selection to the previous page.
 */
public void keyboardPrevPage(){
  if (KeyboardPagingPolicy.CHANGE_PAGE == keyboardPagingPolicy) {
    setKeyboardSelectedRow(-getPageSize(),true,false);
  }
 else   if (KeyboardPagingPolicy.INCREASE_RANGE == keyboardPagingPolicy) {
    setKeyboardSelectedRow(getKeyboardSelectedRow() - PAGE_INCREMENT,true,false);
  }
}
Program: 81942
Project: 81942
Buggy source:
public Object getKey(T item){
  return keyProvider == null ? item : keyProvider.getKey(item);
}

Fixed version (ground truth):
public Object getKey(T item){
  return (keyProvider == null || item == null) ? item : keyProvider.getKey(item);
}
Program: 81943
Project: 81943
Buggy source:
public void setSelected(T object,boolean selected){
  newSelectedObject=object;
  newSelected=selected;
  newSelectedPending=true;
  scheduleSelectionChangeEvent();
}

Fixed version (ground truth):
public void setSelected(T object,boolean selected){
  if (!selected) {
    Object oldKey=newSelectedPending ? getKey(newSelectedObject) : curKey;
    Object newKey=getKey(object);
    if (!equalsOrBothNull(oldKey,newKey)) {
      return;
    }
  }
  newSelectedObject=object;
  newSelected=selected;
  newSelectedPending=true;
  scheduleSelectionChangeEvent();
}
Program: 81944
Project: 81944
Buggy source:
private void resolveChanges(){
  if (!newSelectedPending) {
    return;
  }
  Object key=(newSelectedObject == null) ? null : getKey(newSelectedObject);
  boolean sameKey=curKey == null ? key == null : curKey.equals(key);
  boolean changed=false;
  if (newSelected) {
    changed=!sameKey;
    curSelection=newSelectedObject;
    curKey=key;
  }
 else   if (sameKey) {
    changed=true;
    curSelection=null;
    curKey=null;
  }
  newSelectedObject=null;
  newSelectedPending=false;
  if (changed) {
    SelectionChangeEvent.fire(this);
  }
}

Fixed version (ground truth):
private void resolveChanges(){
  if (!newSelectedPending) {
    return;
  }
  Object key=getKey(newSelectedObject);
  boolean sameKey=equalsOrBothNull(curKey,key);
  boolean changed=false;
  if (newSelected) {
    changed=!sameKey;
    curSelection=newSelectedObject;
    curKey=key;
  }
 else   if (sameKey) {
    changed=true;
    curSelection=null;
    curKey=null;
  }
  newSelectedObject=null;
  newSelectedPending=false;
  if (changed) {
    SelectionChangeEvent.fire(this);
  }
}
Program: 81945
Project: 81945
Buggy source:
private void registerParsers(){
  addElementParser("String_Node_Str","String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
}

Fixed version (ground truth):
private void registerParsers(){
  addElementParser("String_Node_Str","String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
}
Program: 81946
Project: 81946
Buggy source:
private void registerParsers(){
  addElementParser("String_Node_Str","String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
}

Fixed version (ground truth):
private void registerParsers(){
  addElementParser("String_Node_Str","String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
}
Program: 81947
Project: 81947
Buggy source:
/** 
 * Logs a message.
 * @param logRecordJson a log record in JSON format.
 * @throws RemoteLoggingException if logging fails
 */
public static void logMessage(String logRecordJson) throws RemoteLoggingException {
  String strongName=RequestFactoryServlet.getThreadLocalRequest().getHeader(RpcRequestBuilder.STRONG_NAME_HEADER);
  RemoteLoggingServiceUtil.logOnServer(logRecordJson,strongName,deobfuscator,null);
}

Fixed version (ground truth):
/** 
 * Logs a message.
 * @param serializedLogRecordString a json serialized LogRecord, as provided by{@link com.google.gwt.logging.client.JsonLogRecordClientUtil.logRecordAsJsonObject(LogRecord)}
 * @throws RemoteLoggingException if logging fails
 */
public static void logMessage(String logRecordJson) throws RemoteLoggingException {
  HttpServletRequest threadLocalRequest=RequestFactoryServlet.getThreadLocalRequest();
  String strongName=null;
  if (threadLocalRequest != null) {
    threadLocalRequest.getHeader(RpcRequestBuilder.STRONG_NAME_HEADER);
  }
  RemoteLoggingServiceUtil.logOnServer(logRecordJson,strongName,deobfuscator,null);
}
Program: 81948
Project: 81948
Buggy source:
/** 
 * Given the binary name of a domain type, return the BaseProxy type that is assignable to   {@code clientType}. This method allows multiple proxy types to be assigned to a domain type for use in different contexts (e.g. API slices). If there are multiple client types mapped to  {@code domainTypeBinaryName} and assignable to {@code clientTypeBinaryName}, the first matching type will be returned.
 */
String getEntityProxyTypeName(String domainTypeBinaryName,String clientTypeBinaryName){
  Type key=Type.getObjectType(BinaryName.toInternalName(domainTypeBinaryName));
  List<Type> found=domainToClientType.get(key);
  if (found == null || found.isEmpty()) {
    return null;
  }
  if (found.size() == 1) {
    return found.get(0).getClassName();
  }
  Type assignableTo=Type.getObjectType(BinaryName.toInternalName(clientTypeBinaryName));
  for (  Type t : found) {
    if (isAssignable(parentLogger,assignableTo,t)) {
      return t.getClassName();
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Given the binary name of a domain type, return the BaseProxy type that is assignable to   {@code clientType}. This method allows multiple proxy types to be assigned to a domain type for use in different contexts (e.g. API slices). If there are multiple client types mapped to  {@code domainTypeBinaryName} and assignable to {@code clientTypeBinaryName}, the first matching type will be returned.
 */
String getEntityProxyTypeName(String domainTypeBinaryName,String clientTypeBinaryName){
  Type key=Type.getObjectType(BinaryName.toInternalName(domainTypeBinaryName));
  List<Type> found=domainToClientType.get(key);
  if (found == null || found.isEmpty()) {
    List<Type> types=getSupertypes(parentLogger,key);
    for (    Type type : types) {
      if (objectType.equals(type)) {
        break;
      }
      found=domainToClientType.get(type);
      if (found != null && !found.isEmpty()) {
        break;
      }
    }
  }
  if (found == null || found.isEmpty()) {
    return null;
  }
  Type typeToReturn=null;
  if (found.size() == 1) {
    typeToReturn=found.get(0);
  }
 else {
    Type assignableTo=Type.getObjectType(BinaryName.toInternalName(clientTypeBinaryName));
    for (    Type t : found) {
      if (isAssignable(parentLogger,assignableTo,t)) {
        typeToReturn=t;
        break;
      }
    }
  }
  return typeToReturn == null ? null : typeToReturn.getClassName();
}
Program: 81949
Project: 81949
Buggy source:
public List<Type> exec(Type type){
  RequestFactoryInterfaceValidator.this.visit(logger,type.getInternalName(),this);
  return supertypes;
}

Fixed version (ground truth):
public List<Type> exec(Type type){
  RequestFactoryInterfaceValidator.this.visit(logger,type.getInternalName(),this);
  return supers;
}
Program: 81950
Project: 81950
Buggy source:
/** 
 * Examines a generic RequestContext method declaration and determines the expected domain return type. This implementation is limited in that it will not attempt to resolve type bounds since that would essentially require implementing TypeOracle. In the case where the type bound cannot be resolved, this method will return Object's type.
 */
private Type getReturnType(ErrorContext logger,RFMethod method){
  logger=logger.setMethod(method);
  final String[] returnType={"String_Node_Str"};
  String signature=method.getSignature();
  final int expectedCount;
  if (method.getReturnType().equals(instanceRequestIntf)) {
    expectedCount=2;
  }
 else   if (method.getReturnType().equals(requestIntf)) {
    expectedCount=1;
  }
 else {
    logger.spam("String_Node_Str" + signature);
    return Type.getObjectType(returnType[0]);
  }
  new SignatureReader(signature).accept(new SignatureAdapter(){
    @Override public SignatureVisitor visitReturnType(){
      return new SignatureAdapter(){
        int count;
        @Override public SignatureVisitor visitTypeArgument(        char wildcard){
          if (++count == expectedCount) {
            return new SignatureAdapter(){
              @Override public void visitClassType(              String name){
                returnType[0]=name;
              }
            }
;
          }
          return super.visitTypeArgument(wildcard);
        }
      }
;
    }
  }
);
  logger.spam("String_Node_Str" + returnType[0]);
  return Type.getObjectType(returnType[0]);
}

Fixed version (ground truth):
/** 
 * Examines a generic RequestContext method declaration and determines the expected domain return type. This implementation is limited in that it will not attempt to resolve type bounds since that would essentially require implementing TypeOracle. In the case where the type bound cannot be resolved, this method will return Object's type.
 */
private Type getReturnType(ErrorContext logger,RFMethod method){
  logger=logger.setMethod(method);
  final String[] returnType={objectType.getInternalName()};
  String signature=method.getSignature();
  final int expectedCount;
  if (method.getReturnType().equals(instanceRequestIntf)) {
    expectedCount=2;
  }
 else   if (method.getReturnType().equals(requestIntf)) {
    expectedCount=1;
  }
 else {
    logger.spam("String_Node_Str" + signature);
    return Type.getObjectType(returnType[0]);
  }
  new SignatureReader(signature).accept(new SignatureAdapter(){
    @Override public SignatureVisitor visitReturnType(){
      return new SignatureAdapter(){
        int count;
        @Override public SignatureVisitor visitTypeArgument(        char wildcard){
          if (++count == expectedCount) {
            return new SignatureAdapter(){
              @Override public void visitClassType(              String name){
                returnType[0]=name;
              }
            }
;
          }
          return super.visitTypeArgument(wildcard);
        }
      }
;
    }
  }
);
  logger.spam("String_Node_Str" + returnType[0]);
  return Type.getObjectType(returnType[0]);
}