nus-yam/ex-repair huggingface dataset:
Program: 81951
Project: 81951
Buggy source:
/** 
 * Returns the current user information for a given redirect URL. If  {@link #setUserInformationImplClass(String)} has been called with a classname, that class is used to gather the information by calling a (String) constructor. If the impl class name is "", or if the class cannont be instantiated, dummy user info is returned.
 * @param redirectUrl the redirect URL as a String
 * @return a {@link UserInformation} instance
 */
public static UserInformation getCurrentUserInformation(String redirectUrl){
  UserInformation userInfo=null;
  if (!"String_Node_Str".equals(userInformationImplClass)) {
    try {
      userInfo=(UserInformation)Class.forName(userInformationImplClass).getConstructor(String.class).newInstance(redirectUrl);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  if (userInfo == null) {
    userInfo=new UserInformationSimpleImpl(redirectUrl);
  }
  return userInfo;
}

Fixed version (ground truth):
/** 
 * Called by   {@link RequestFactoryServlet#doPost} at the start of each requestreceived. Establishes the current user information for this request, and notes a redirect url to be provided back to the client if the user's bona fides cannot be established. All succeeding calls to {@link #findUserInformation(Long)} made from the same thread will returnthe same UserInfo instance. <p> If  {@link #setUserInformationImplClass(String)} has been called with aclass name, that class is used to gather the information by calling a (String) constructor. If the impl class name is "", or if the class cannont be instantiated, dummy user info is returned.
 * @param redirectUrl the redirect URL as a String
 * @return a {@link UserInformation} instance
 */
public static UserInformation getCurrentUserInformation(String redirectUrl){
  currentUser.remove();
  if (!"String_Node_Str".equals(userInformationImplClass)) {
    try {
      currentUser.set((UserInformation)Class.forName(userInformationImplClass).getConstructor(String.class).newInstance(redirectUrl));
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  if (currentUser.get() == null) {
    currentUser.set(new UserInformationSimpleImpl(redirectUrl));
  }
  return currentUser.get();
}
Program: 81952
Project: 81952
Buggy source:
/** 
 * Log a message on the server.
 * @param serializedLogRecordString a String
 * @return a Void {@link Request}
 */
Request<Void> logMessage(String serializedLogRecordString);

Fixed version (ground truth):
/** 
 * Log a message on the server.
 * @param serializedLogRecordString a json serialized LogRecord, as provided by{@link com.google.gwt.logging.client.JsonLogRecordClientUtil.logRecordAsJsonObject(LogRecord)}
 * @return a Void {@link Request}
 */
Request<Void> logMessage(String serializedLogRecordString);
Program: 81954
Project: 81954
Buggy source:
public <T>NodeInfo<?> getNodeInfo(T value){
  if (value == ROOT_VALUE) {
    return new DefaultNodeInfo<String>(rootDataProvider,cell);
  }
 else   if (value instanceof String) {
    String prefix=(String)value;
    if (prefix.length() > 3) {
      throw new IllegalStateException("String_Node_Str");
    }
    return new DefaultNodeInfo<String>(createDataProvider(prefix),cell);
  }
  throw new IllegalArgumentException("String_Node_Str");
}

Fixed version (ground truth):
public NodeInfo<?> getNodeInfo(Object value){
  ProvidesKey<String> keyProvider=new ProvidesKey<String>(){
    public Object getKey(    String item){
      return Integer.parseInt(item.substring(0,1));
    }
  }
;
  ListDataProvider<String> dataProvider=new ListDataProvider<String>(keyProvider);
  dataProvider.getList().add("String_Node_Str");
  dataProvider.getList().add("String_Node_Str");
  dataProvider.getList().add("String_Node_Str");
  return new DefaultNodeInfo<String>(dataProvider,cell);
}
Program: 81955
Project: 81955
Buggy source:
public boolean isLeaf(Object value){
  if (value == ROOT_VALUE) {
    return false;
  }
 else   if (value instanceof String) {
    String s=(String)value;
    if (s.length() > 4) {
      throw new IllegalStateException("String_Node_Str");
    }
    return ((String)value).length() == 4;
  }
  throw new IllegalArgumentException("String_Node_Str");
}

Fixed version (ground truth):
public boolean isLeaf(Object value){
  return value != null;
}
Program: 81956
Project: 81956
Buggy source:
public static StringBuffer injectResources(StringBuffer selectionScript,ArtifactSet artifacts){
  int startPos=selectionScript.indexOf("String_Node_Str");
  if (startPos != -1) {
    for (    StylesheetReference resource : artifacts.find(StylesheetReference.class)) {
      String text=generateStylesheetInjector(resource.getSrc());
      selectionScript.insert(startPos,text);
      startPos+=text.length();
    }
  }
  startPos=selectionScript.indexOf("String_Node_Str");
  if (startPos != -1) {
    for (    ScriptReference resource : artifacts.find(ScriptReference.class)) {
      String text=generateScriptInjector(resource.getSrc());
      selectionScript.insert(startPos,text);
      startPos+=text.length();
    }
  }
  return selectionScript;
}

Fixed version (ground truth):
/** 
 * Installs stylesheets and scripts
 */
public static StringBuffer injectResources(StringBuffer selectionScript,ArtifactSet artifacts){
  int startPos=selectionScript.indexOf("String_Node_Str");
  if (startPos != -1) {
    for (    StylesheetReference resource : artifacts.find(StylesheetReference.class)) {
      String text=generateStylesheetInjector(resource.getSrc());
      selectionScript.insert(startPos,text);
      startPos+=text.length();
    }
  }
  startPos=selectionScript.indexOf("String_Node_Str");
  if (startPos != -1) {
    for (    ScriptReference resource : artifacts.find(ScriptReference.class)) {
      String text=generateScriptInjector(resource.getSrc());
      selectionScript.insert(startPos,text);
      startPos+=text.length();
    }
  }
  return selectionScript;
}
Program: 81957
Project: 81957
Buggy source:
private PersonEditorWorkflow(DynaTableRequestFactory requestFactory,FavoritesManager manager,PersonProxy person){
  this.requestFactory=requestFactory;
  this.manager=manager;
  this.person=person;
  personEditor=new PersonEditor(requestFactory);
  Binder.BINDER.createAndBindUi(this);
  contents.addDomHandler(new KeyUpHandler(){
    public void onKeyUp(    KeyUpEvent event){
      if (event.getNativeKeyCode() == KeyCodes.KEY_ESCAPE) {
        onCancel(null);
      }
    }
  }
,KeyUpEvent.getType());
}

Fixed version (ground truth):
private PersonEditorWorkflow(DynaTableRequestFactory requestFactory,FavoritesManager manager,PersonProxy person){
  this.requestFactory=requestFactory;
  this.manager=manager;
  this.person=person;
  personEditor=new PersonEditor(requestFactory);
  Binder.BINDER.createAndBindUi(this);
  contents.addDomHandler(new KeyUpHandler(){
    public void onKeyUp(    KeyUpEvent event){
      if (event.getNativeKeyCode() == KeyCodes.KEY_ESCAPE) {
        onCancel(null);
      }
    }
  }
,KeyUpEvent.getType());
  this.favorite.setVisible(false);
}
Program: 81958
Project: 81958
Buggy source:
/** 
 * Construct and display the UI that will be used to edit the current PersonProxy, using the given RequestContext to accumulate the edits.
 */
private void edit(RequestContext requestContext){
  editorDriver=GWT.create(Driver.class);
  editorDriver.initialize(requestFactory,personEditor);
  if (requestContext == null) {
    fetchAndEdit();
    return;
  }
  editorDriver.edit(person,requestContext);
  personEditor.focus();
  favorite.setValue(manager.isFavorite(person),false);
  dialog.center();
}

Fixed version (ground truth):
/** 
 * Construct and display the UI that will be used to edit the current PersonProxy, using the given RequestContext to accumulate the edits.
 */
private void edit(RequestContext requestContext){
  editorDriver=GWT.create(Driver.class);
  editorDriver.initialize(requestFactory,personEditor);
  if (requestContext == null) {
    this.favorite.setVisible(true);
    fetchAndEdit();
    return;
  }
  editorDriver.edit(person,requestContext);
  personEditor.focus();
  favorite.setValue(manager.isFavorite(person),false);
  dialog.center();
}
Program: 81959
Project: 81959
Buggy source:
/** 
 * Generate the primary fragment. The default implementation is based on  {@link #getModulePrefix(TreeLogger,LinkerContext,String,int)} and{@link #getModuleSuffix(TreeLogger,LinkerContext)}.
 */
protected byte[] generatePrimaryFragment(TreeLogger logger,LinkerContext context,CompilationResult result,String[] js) throws UnableToCompleteException {
  TextOutput to=new DefaultTextOutput(context.isOutputCompact());
  to.print(generatePrimaryFragmentString(logger,context,result.getStrongName(),js[0],js.length));
  return Util.getBytes(to.toString());
}

Fixed version (ground truth):
/** 
 * Generate the primary fragment. The default implementation is based on  {@link #getModulePrefix(TreeLogger,LinkerContext,String,int)} and{@link #getModuleSuffix(TreeLogger,LinkerContext)}.
 */
protected byte[] generatePrimaryFragment(TreeLogger logger,LinkerContext context,CompilationResult result,String[] js,ArtifactSet artifacts) throws UnableToCompleteException {
  TextOutput to=new DefaultTextOutput(context.isOutputCompact());
  to.print(generatePrimaryFragmentString(logger,context,result.getStrongName(),js[0],js.length,artifacts));
  return Util.getBytes(to.toString());
}
Program: 81960
Project: 81960
Buggy source:
protected String generatePrimaryFragmentString(TreeLogger logger,LinkerContext context,String strongName,String js,int length) throws UnableToCompleteException {
  StringBuffer b=new StringBuffer();
  b.append(getModulePrefix(logger,context,strongName,length));
  b.append(js);
  b.append(getModuleSuffix(logger,context));
  return wrapPrimaryFragment(logger,context,b.toString());
}

Fixed version (ground truth):
protected String generatePrimaryFragmentString(TreeLogger logger,LinkerContext context,String strongName,String js,int length,ArtifactSet artifacts) throws UnableToCompleteException {
  StringBuffer b=new StringBuffer();
  b.append(getModulePrefix(logger,context,strongName,length));
  b.append(js);
  b.append(getModuleSuffix(logger,context));
  return wrapPrimaryFragment(logger,context,b.toString(),artifacts);
}
Program: 81961
Project: 81961
Buggy source:
@Override public ArtifactSet link(TreeLogger logger,LinkerContext context,ArtifactSet artifacts,boolean onePermutation) throws UnableToCompleteException {
  if (onePermutation) {
    ArtifactSet toReturn=new ArtifactSet(artifacts);
    for (    CompilationResult compilation : toReturn.find(CompilationResult.class)) {
      toReturn.addAll(doEmitCompilation(logger,context,compilation));
    }
    return toReturn;
  }
 else {
    permutationsUtil.setupPermutationsMap(artifacts);
    ArtifactSet toReturn=new ArtifactSet(artifacts);
    EmittedArtifact art=emitSelectionScript(logger,context,artifacts);
    if (art != null) {
      toReturn.add(art);
    }
    maybeOutputPropertyMap(logger,context,toReturn);
    maybeAddHostedModeFile(logger,context,toReturn);
    return toReturn;
  }
}

Fixed version (ground truth):
@Override public ArtifactSet link(TreeLogger logger,LinkerContext context,ArtifactSet artifacts,boolean onePermutation) throws UnableToCompleteException {
  if (onePermutation) {
    ArtifactSet toReturn=new ArtifactSet(artifacts);
    for (    CompilationResult compilation : toReturn.find(CompilationResult.class)) {
      toReturn.addAll(doEmitCompilation(logger,context,compilation,artifacts));
    }
    return toReturn;
  }
 else {
    permutationsUtil.setupPermutationsMap(artifacts);
    ArtifactSet toReturn=new ArtifactSet(artifacts);
    EmittedArtifact art=emitSelectionScript(logger,context,artifacts);
    if (art != null) {
      toReturn.add(art);
    }
    maybeOutputPropertyMap(logger,context,toReturn);
    maybeAddHostedModeFile(logger,context,toReturn);
    return toReturn;
  }
}
Program: 81962
Project: 81962
Buggy source:
protected String wrapPrimaryFragment(TreeLogger logger,LinkerContext context,String script){
  return script;
}

Fixed version (ground truth):
protected String wrapPrimaryFragment(TreeLogger logger,LinkerContext context,String script,ArtifactSet artifacts){
  return script;
}
Program: 81963
Project: 81963
Buggy source:
protected Collection<Artifact<?>> doEmitCompilation(TreeLogger logger,LinkerContext context,CompilationResult result) throws UnableToCompleteException {
  String[] js=result.getJavaScript();
  byte[][] bytes=new byte[js.length][];
  bytes[0]=generatePrimaryFragment(logger,context,result,js);
  for (int i=1; i < js.length; i++) {
    bytes[i]=Util.getBytes(generateDeferredFragment(logger,context,i,js[i]));
  }
  Collection<Artifact<?>> toReturn=new ArrayList<Artifact<?>>();
  toReturn.add(emitBytes(logger,bytes[0],result.getStrongName() + getCompilationExtension(logger,context)));
  for (int i=1; i < js.length; i++) {
    toReturn.add(emitBytes(logger,bytes[i],FRAGMENT_SUBDIR + File.separator + result.getStrongName()+ File.separator+ i+ FRAGMENT_EXTENSION));
  }
  toReturn.addAll(emitSelectionInformation(result.getStrongName(),result));
  return toReturn;
}

Fixed version (ground truth):
protected Collection<Artifact<?>> doEmitCompilation(TreeLogger logger,LinkerContext context,CompilationResult result,ArtifactSet artifacts) throws UnableToCompleteException {
  String[] js=result.getJavaScript();
  byte[][] bytes=new byte[js.length][];
  bytes[0]=generatePrimaryFragment(logger,context,result,js,artifacts);
  for (int i=1; i < js.length; i++) {
    bytes[i]=Util.getBytes(generateDeferredFragment(logger,context,i,js[i]));
  }
  Collection<Artifact<?>> toReturn=new ArrayList<Artifact<?>>();
  toReturn.add(emitBytes(logger,bytes[0],result.getStrongName() + getCompilationExtension(logger,context)));
  for (int i=1; i < js.length; i++) {
    toReturn.add(emitBytes(logger,bytes[i],FRAGMENT_SUBDIR + File.separator + result.getStrongName()+ File.separator+ i+ FRAGMENT_EXTENSION));
  }
  toReturn.addAll(emitSelectionInformation(result.getStrongName(),result));
  return toReturn;
}
Program: 81964
Project: 81964
Buggy source:
@Override protected String wrapPrimaryFragment(TreeLogger logger,LinkerContext context,String script){
  StringBuffer out=new StringBuffer();
  if (shouldIncludeBootstrapInPrimaryFragment(context)) {
    try {
      out.append(generateSelectionScript(logger,context,null));
    }
 catch (    UnableToCompleteException e) {
      logger.log(TreeLogger.ERROR,"String_Node_Str",e);
      e.printStackTrace();
    }
  }
  if (shouldInstallCode(context)) {
    out.append(context.getModuleFunctionName());
    out.append("String_Node_Str");
    out.append(JsToStringGenerationVisitor.javaScriptString(script.toString()));
    out.append("String_Node_Str");
  }
 else {
    out.append(script.toString());
  }
  return out.toString();
}

Fixed version (ground truth):
@Override protected String wrapPrimaryFragment(TreeLogger logger,LinkerContext context,String script,ArtifactSet artifacts){
  StringBuffer out=new StringBuffer();
  if (shouldIncludeBootstrapInPrimaryFragment(context)) {
    try {
      out.append(generateSelectionScript(logger,context,artifacts));
    }
 catch (    UnableToCompleteException e) {
      logger.log(TreeLogger.ERROR,"String_Node_Str",e);
      e.printStackTrace();
    }
  }
  if (shouldInstallCode(context)) {
    out.append(context.getModuleFunctionName());
    out.append("String_Node_Str");
    out.append(JsToStringGenerationVisitor.javaScriptString(script.toString()));
    out.append("String_Node_Str");
  }
 else {
    out.append(script.toString());
  }
  return out.toString();
}
Program: 81965
Project: 81965
Buggy source:
@Override protected void maybeAddHostedModeFile(TreeLogger logger,LinkerContext context,ArtifactSet artifacts) throws UnableToCompleteException {
  String filename=getHostedFilename();
  if ("String_Node_Str".equals(filename)) {
    return;
  }
  long lastModified=System.currentTimeMillis();
  StringBuffer buffer=readFileToStringBuffer("String_Node_Str" + filename,logger);
  String script=generatePrimaryFragmentString(logger,context,"String_Node_Str",buffer.toString(),1);
  EmittedArtifact devArtifact=emitString(logger,script,filename,lastModified);
  artifacts.add(devArtifact);
}

Fixed version (ground truth):
@Override protected void maybeAddHostedModeFile(TreeLogger logger,LinkerContext context,ArtifactSet artifacts) throws UnableToCompleteException {
  String filename=getHostedFilename();
  if ("String_Node_Str".equals(filename)) {
    return;
  }
  long lastModified=System.currentTimeMillis();
  StringBuffer buffer=readFileToStringBuffer("String_Node_Str" + filename,logger);
  String script=generatePrimaryFragmentString(logger,context,"String_Node_Str",buffer.toString(),1,artifacts);
  EmittedArtifact devArtifact=emitString(logger,script,filename,lastModified);
  artifacts.add(devArtifact);
}
Program: 81966
Project: 81966
Buggy source:
@Override protected byte[] generatePrimaryFragment(TreeLogger logger,LinkerContext context,CompilationResult result,String[] js) throws UnableToCompleteException {
  StringBuffer b=new StringBuffer();
  b.append(getModulePrefix(logger,context,result.getStrongName(),js.length));
  b.append(splitPrimaryJavaScript(result.getStatementRanges()[0],js[0],charsPerChunk(context,logger)));
  b.append(getModuleSuffix(logger,context));
  return Util.getBytes(b.toString());
}

Fixed version (ground truth):
@Override protected byte[] generatePrimaryFragment(TreeLogger logger,LinkerContext context,CompilationResult result,String[] js,ArtifactSet artifacts) throws UnableToCompleteException {
  StringBuffer b=new StringBuffer();
  b.append(getModulePrefix(logger,context,result.getStrongName(),js.length));
  b.append(splitPrimaryJavaScript(result.getStatementRanges()[0],js[0],charsPerChunk(context,logger)));
  b.append(getModuleSuffix(logger,context));
  return Util.getBytes(b.toString());
}
Program: 81967
Project: 81967
Buggy source:
@Override protected Collection<Artifact<?>> doEmitCompilation(TreeLogger logger,LinkerContext context,CompilationResult result) throws UnableToCompleteException {
  if (result.getJavaScript().length != 1) {
    logger.branch(TreeLogger.ERROR,"String_Node_Str" + getDescription() + "String_Node_Str",null);
    throw new UnableToCompleteException();
  }
  return super.doEmitCompilation(logger,context,result);
}

Fixed version (ground truth):
@Override protected Collection<Artifact<?>> doEmitCompilation(TreeLogger logger,LinkerContext context,CompilationResult result,ArtifactSet artifacts) throws UnableToCompleteException {
  if (result.getJavaScript().length != 1) {
    logger.branch(TreeLogger.ERROR,"String_Node_Str" + getDescription() + "String_Node_Str",null);
    throw new UnableToCompleteException();
  }
  return super.doEmitCompilation(logger,context,result,artifacts);
}
Program: 81968
Project: 81968
Buggy source:
/** 
 * Constructs a new DatePickerCell that uses the given date/time format and  {@link SafeHtmlRenderer}.
 */
public DatePickerCell(DateTimeFormat format,SafeHtmlRenderer<String> renderer){
  super("String_Node_Str","String_Node_Str");
  if (format == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (renderer == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.format=format;
  this.renderer=renderer;
  this.datePicker=new DatePicker();
  this.panel=new PopupPanel(true,true){
    @Override protected void onPreviewNativeEvent(    NativePreviewEvent event){
      if (Event.ONKEYUP == event.getTypeInt()) {
        if (event.getNativeEvent().getKeyCode() == ESCAPE) {
          panel.hide();
        }
      }
    }
  }
;
  panel.addCloseHandler(new CloseHandler<PopupPanel>(){
    public void onClose(    CloseEvent<PopupPanel> event){
      lastKey=null;
      lastValue=null;
      if (lastParent != null && !event.isAutoClosed()) {
        lastParent.focus();
      }
      lastParent=null;
    }
  }
);
  panel.add(datePicker);
  datePicker.addValueChangeHandler(new ValueChangeHandler<Date>(){
    public void onValueChange(    ValueChangeEvent<Date> event){
      panel.hide();
      Date date=event.getValue();
      setViewData(lastKey,date);
      setValue(lastParent,lastValue,lastKey);
      if (valueUpdater != null) {
        valueUpdater.update(date);
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Constructs a new DatePickerCell that uses the given date/time format and  {@link SafeHtmlRenderer}.
 */
public DatePickerCell(DateTimeFormat format,SafeHtmlRenderer<String> renderer){
  super("String_Node_Str","String_Node_Str");
  if (format == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (renderer == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.format=format;
  this.renderer=renderer;
  this.datePicker=new DatePicker();
  this.panel=new PopupPanel(true,true){
    @Override protected void onPreviewNativeEvent(    NativePreviewEvent event){
      if (Event.ONKEYUP == event.getTypeInt()) {
        if (event.getNativeEvent().getKeyCode() == ESCAPE) {
          panel.hide();
        }
      }
    }
  }
;
  panel.addCloseHandler(new CloseHandler<PopupPanel>(){
    public void onClose(    CloseEvent<PopupPanel> event){
      lastKey=null;
      lastValue=null;
      if (lastParent != null && !event.isAutoClosed()) {
        lastParent.focus();
      }
      lastParent=null;
    }
  }
);
  panel.add(datePicker);
  datePicker.addValueChangeHandler(new ValueChangeHandler<Date>(){
    public void onValueChange(    ValueChangeEvent<Date> event){
      Element cellParent=lastParent;
      Date oldValue=lastValue;
      Object key=lastKey;
      panel.hide();
      Date date=event.getValue();
      setViewData(key,date);
      setValue(cellParent,oldValue,key);
      if (valueUpdater != null) {
        valueUpdater.update(date);
      }
    }
  }
);
}
Program: 81969
Project: 81969
Buggy source:
public void onValueChange(ValueChangeEvent<Date> event){
  panel.hide();
  Date date=event.getValue();
  setViewData(lastKey,date);
  setValue(lastParent,lastValue,lastKey);
  if (valueUpdater != null) {
    valueUpdater.update(date);
  }
}

Fixed version (ground truth):
public void onValueChange(ValueChangeEvent<Date> event){
  Element cellParent=lastParent;
  Date oldValue=lastValue;
  Object key=lastKey;
  panel.hide();
  Date date=event.getValue();
  setViewData(key,date);
  setValue(cellParent,oldValue,key);
  if (valueUpdater != null) {
    valueUpdater.update(date);
  }
}
Program: 81972
Project: 81972
Buggy source:
private AutoBeanType getAutoBeanType(JClassType beanType){
  beanType=ensureBaseType(beanType);
  AutoBeanType toReturn=peers.get(beanType);
  if (toReturn == null) {
    AutoBeanType.Builder builder=new AutoBeanType.Builder();
    builder.setPeerType(beanType);
    builder.setMethods(computeMethods(beanType));
    builder.setInterceptor(findInterceptor(beanType));
    if (noWrapTypes != null) {
      for (      JClassType noWrap : noWrapTypes) {
        if (noWrap.isAssignableFrom(beanType)) {
          builder.setNoWrap(true);
          break;
        }
      }
    }
    toReturn=builder.build();
    peers.put(beanType,toReturn);
  }
  return toReturn;
}

Fixed version (ground truth):
private AutoBeanType getAutoBeanType(JClassType beanType){
  beanType=ModelUtils.ensureBaseType(beanType);
  AutoBeanType toReturn=peers.get(beanType);
  if (toReturn == null) {
    AutoBeanType.Builder builder=new AutoBeanType.Builder();
    builder.setPeerType(beanType);
    builder.setMethods(computeMethods(beanType));
    builder.setInterceptor(findInterceptor(beanType));
    if (noWrapTypes != null) {
      for (      JClassType noWrap : noWrapTypes) {
        if (noWrap.isAssignableFrom(beanType)) {
          builder.setNoWrap(true);
          break;
        }
      }
    }
    toReturn=builder.build();
    peers.put(beanType,toReturn);
  }
  return toReturn;
}
Program: 81973
Project: 81973
Buggy source:
private boolean methodAcceptsAutoBeanAsFirstParam(JClassType beanType,JMethod method){
  JParameter[] params=method.getParameters();
  if (params.length == 0) {
    return false;
  }
  JClassType paramAsClass=params[0].getType().isClassOrInterface();
  if (paramAsClass == null) {
    return false;
  }
  JParameterizedType expectedFirst=oracle.getParameterizedType(autoBeanInterface,new JClassType[]{ensureBaseType(beanType)});
  return expectedFirst.isAssignableTo(paramAsClass);
}

Fixed version (ground truth):
private boolean methodAcceptsAutoBeanAsFirstParam(JClassType beanType,JMethod method){
  JParameter[] params=method.getParameters();
  if (params.length == 0) {
    return false;
  }
  JClassType paramAsClass=params[0].getType().isClassOrInterface();
  if (paramAsClass == null) {
    return false;
  }
  JParameterizedType expectedFirst=oracle.getParameterizedType(autoBeanInterface,new JClassType[]{ModelUtils.ensureBaseType(beanType)});
  return expectedFirst.isAssignableTo(paramAsClass);
}
Program: 81974
Project: 81974
Buggy source:
public AutoBeanType getPeer(JClassType beanType){
  beanType=ensureBaseType(beanType);
  return peers.get(beanType);
}

Fixed version (ground truth):
public AutoBeanType getPeer(JClassType beanType){
  beanType=ModelUtils.ensureBaseType(beanType);
  return peers.get(beanType);
}
Program: 81976
Project: 81976
Buggy source:
public void setQualifiedSourceName(String name){
  toReturn.qualifiedSourceName=name;
}

Fixed version (ground truth):
public void setQualifiedSourceName(String name){
}
Program: 81978
Project: 81978
Buggy source:
/** 
 * Reduce the number of   {@link HasData}s down to the specified level.
 * @param level the level to trim to
 */
private void trimToLevel(int level){
  adjustScrollLock();
  int curLevel=treeNodes.size() - 1;
  while (curLevel > level) {
    TreeNodeImpl<?> removed=treeNodes.remove(curLevel);
    removed.destroy();
    curLevel--;
  }
}

Fixed version (ground truth):
/** 
 * Reduce the number of   {@link HasData}s down to the specified level.
 * @param level the level to trim to
 */
private void trimToLevel(int level){
  adjustScrollLock();
  int curLevel=treeNodes.size() - 1;
  while (curLevel > level) {
    TreeNodeImpl<?> removed=treeNodes.remove(curLevel);
    removed.destroy();
    curLevel--;
  }
  if (level < treeNodes.size()) {
    TreeNodeImpl<?> node=treeNodes.get(level);
    node.display.focusedKey=null;
    node.display.focusedValue=null;
    node.display.isFocusedOpen=false;
  }
}
Program: 81979
Project: 81979
Buggy source:
/** 
 * Test that a tree node is destroyed if its associated data is lost when new data is provided to the node.
 */
public void testTreeNodeDataLost(){
  MockOpenHandler openHandler=new MockOpenHandler();
  MockCloseHandler closeHandler=new MockCloseHandler();
  tree.addOpenHandler(openHandler);
  tree.addCloseHandler(closeHandler);
  TreeNode root=tree.getRootTreeNode();
  TreeNode b=root.setChildOpen(1,true);
  assertEquals(b,openHandler.getLastEventAndClear().getTarget());
  List<String> list=new ArrayList<String>();
  list.add("String_Node_Str");
  list.add("String_Node_Str");
  list.add("String_Node_Str");
  model.rootDataProvider.setList(list);
  assertTrue(b.isDestroyed());
}

Fixed version (ground truth):
/** 
 * Test that a tree node is destroyed if its associated data is lost when new data is provided to the node.
 */
public void testTreeNodeDataLost(){
  MockOpenHandler openHandler=new MockOpenHandler();
  MockCloseHandler closeHandler=new MockCloseHandler();
  tree.addOpenHandler(openHandler);
  tree.addCloseHandler(closeHandler);
  TreeNode root=tree.getRootTreeNode();
  TreeNode b=root.setChildOpen(1,true);
  assertEquals(b,openHandler.getLastEventAndClear().getTarget());
  List<String> list=new ArrayList<String>();
  list.add("String_Node_Str");
  list.add("String_Node_Str");
  list.add("String_Node_Str");
  model.rootDataProvider.setList(list);
  assertTrue(b.isDestroyed());
  assertNotNull(root.setChildOpen(0,true));
}
Program: 81980
Project: 81980
Buggy source:
private void createHeadersAndFooters(){
  if (headersStale) {
    headersStale=false;
    createHeaders(false);
    createHeaders(true);
  }
}

Fixed version (ground truth):
private void createHeadersAndFooters(){
  createHeaders(false);
  createHeaders(true);
}
Program: 81982
Project: 81982
Buggy source:
/** 
 * Remove a column.
 * @param index the column index
 */
public void removeColumn(int index){
  if (index < 0 || index >= columns.size()) {
    throw new IndexOutOfBoundsException("String_Node_Str");
  }
  columns.remove(index);
  headers.remove(index);
  footers.remove(index);
  updateDependsOnSelection();
  headersStale=true;
  if (index <= keyboardSelectedColumn) {
    keyboardSelectedColumn=0;
    if (isInteractive) {
      for (int i=0; i < columns.size(); i++) {
        if (isColumnInteractive(columns.get(i))) {
          keyboardSelectedColumn=i;
          break;
        }
      }
    }
  }
  scheduleRedraw();
}

Fixed version (ground truth):
/** 
 * Remove a column.
 * @param index the column index
 */
public void removeColumn(int index){
  if (index < 0 || index >= columns.size()) {
    throw new IndexOutOfBoundsException("String_Node_Str");
  }
  columns.remove(index);
  headers.remove(index);
  footers.remove(index);
  updateDependsOnSelection();
  if (index <= keyboardSelectedColumn) {
    keyboardSelectedColumn=0;
    if (isInteractive) {
      for (int i=0; i < columns.size(); i++) {
        if (isColumnInteractive(columns.get(i))) {
          keyboardSelectedColumn=i;
          break;
        }
      }
    }
  }
  scheduleRedraw();
}
Program: 81983
Project: 81983
Buggy source:
@Template("String_Node_Str") SafeHtml th(String classes,SafeHtml contents);

Fixed version (ground truth):
@Template("String_Node_Str") SafeHtml th(int colspan,String classes,SafeHtml contents);
Program: 81985
Project: 81985
Buggy source:
public void testFetchEntityWithStringId(){
  delayTestFinish(TEST_DELAY);
  req.simpleBarRequest().findSimpleBarById("String_Node_Str").fire(new Receiver<SimpleBarProxy>(){
    @Override public void onSuccess(    SimpleBarProxy response){
      final EntityProxyId<SimpleBarProxy> stableId=response.stableId();
      req.find(stableId).fire(new Receiver<SimpleBarProxy>(){
        @Override public void onSuccess(        SimpleBarProxy returnedProxy){
          assertEquals(stableId,returnedProxy.stableId());
          assertEquals("String_Node_Str",returnedProxy.getId());
          finishTestAndReset();
        }
      }
);
    }
  }
);
}

Fixed version (ground truth):
public void testFetchEntityWithStringId(){
  delayTestFinish(TEST_DELAY);
  req.simpleBarRequest().findSimpleBarById("String_Node_Str").fire(new Receiver<SimpleBarProxy>(){
    @Override public void onSuccess(    SimpleBarProxy response){
      final EntityProxyId<SimpleBarProxy> stableId=response.stableId();
      req.find(stableId).fire(new Receiver<SimpleBarProxy>(){
        @Override public void onSuccess(        SimpleBarProxy returnedProxy){
          assertEquals(stableId,returnedProxy.stableId());
          finishTestAndReset();
        }
      }
);
    }
  }
);
}
Program: 81986
Project: 81986
Buggy source:
public void testDummyCreateBar(){
  delayTestFinish(5000);
  SimpleBarRequest context=req.simpleBarRequest();
  final SimpleBarProxy foo=context.create(SimpleBarProxy.class);
  Object futureId=foo.getId();
  assertEquals(futureId,foo.getId());
  Request<SimpleBarProxy> fooReq=context.persistAndReturnSelf().using(foo);
  fooReq.fire(new Receiver<SimpleBarProxy>(){
    @Override public void onSuccess(    final SimpleBarProxy returned){
      Object futureId=foo.getId();
      assertEquals(futureId,foo.getId());
      checkStableIdEquals(foo,returned);
      finishTestAndReset();
    }
  }
);
}

Fixed version (ground truth):
public void testDummyCreateBar(){
  delayTestFinish(5000);
  SimpleBarRequest context=req.simpleBarRequest();
  final SimpleBarProxy foo=context.create(SimpleBarProxy.class);
  Request<SimpleBarProxy> fooReq=context.persistAndReturnSelf().using(foo);
  fooReq.fire(new Receiver<SimpleBarProxy>(){
    @Override public void onSuccess(    final SimpleBarProxy returned){
      checkStableIdEquals(foo,returned);
      finishTestAndReset();
    }
  }
);
}
Program: 81987
Project: 81987
Buggy source:
public void testDummyCreateList(){
  delayTestFinish(DELAY_TEST_FINISH);
  SimpleBarRequest context=simpleBarRequest();
  final SimpleBarProxy bar=context.create(SimpleBarProxy.class);
  Object futureId=bar.getId();
  assertEquals(futureId,bar.getId());
  assertTrue(((SimpleEntityProxyId<?>)bar.stableId()).isEphemeral());
  Request<SimpleBarProxy> fooReq=context.returnFirst(Collections.singletonList(bar));
  fooReq.fire(new Receiver<SimpleBarProxy>(){
    @Override public void onSuccess(    final SimpleBarProxy returned){
      Object futureId=bar.getId();
      assertEquals(futureId,bar.getId());
      assertFalse(((SimpleEntityProxyId<?>)bar.stableId()).isEphemeral());
      assertFalse(((SimpleEntityProxyId<?>)returned.stableId()).isEphemeral());
      checkStableIdEquals(bar,returned);
      finishTestAndReset();
    }
  }
);
}

Fixed version (ground truth):
public void testDummyCreateList(){
  delayTestFinish(DELAY_TEST_FINISH);
  SimpleBarRequest context=simpleBarRequest();
  final SimpleBarProxy bar=context.create(SimpleBarProxy.class);
  assertTrue(((SimpleEntityProxyId<?>)bar.stableId()).isEphemeral());
  Request<SimpleBarProxy> fooReq=context.returnFirst(Collections.singletonList(bar));
  fooReq.fire(new Receiver<SimpleBarProxy>(){
    @Override public void onSuccess(    final SimpleBarProxy returned){
      assertFalse(((SimpleEntityProxyId<?>)bar.stableId()).isEphemeral());
      assertFalse(((SimpleEntityProxyId<?>)returned.stableId()).isEphemeral());
      checkStableIdEquals(bar,returned);
      finishTestAndReset();
    }
  }
);
}
Program: 81988
Project: 81988
Buggy source:
public void testDummyCreateBar(){
  delayTestFinish(DELAY_TEST_FINISH);
  SimpleBarRequest context=simpleBarRequest();
  final SimpleBarProxy foo=context.create(SimpleBarProxy.class);
  Object futureId=foo.getId();
  assertEquals(futureId,foo.getId());
  assertTrue(((SimpleEntityProxyId<?>)foo.stableId()).isEphemeral());
  Request<SimpleBarProxy> fooReq=context.persistAndReturnSelf().using(foo);
  fooReq.fire(new Receiver<SimpleBarProxy>(){
    @Override public void onSuccess(    final SimpleBarProxy returned){
      Object futureId=foo.getId();
      assertEquals(futureId,foo.getId());
      assertFalse(((SimpleEntityProxyId<?>)foo.stableId()).isEphemeral());
      checkStableIdEquals(foo,returned);
      finishTestAndReset();
    }
  }
);
}

Fixed version (ground truth):
public void testDummyCreateBar(){
  delayTestFinish(DELAY_TEST_FINISH);
  SimpleBarRequest context=simpleBarRequest();
  final SimpleBarProxy foo=context.create(SimpleBarProxy.class);
  assertTrue(((SimpleEntityProxyId<?>)foo.stableId()).isEphemeral());
  Request<SimpleBarProxy> fooReq=context.persistAndReturnSelf().using(foo);
  fooReq.fire(new Receiver<SimpleBarProxy>(){
    @Override public void onSuccess(    final SimpleBarProxy returned){
      assertFalse(((SimpleEntityProxyId<?>)foo.stableId()).isEphemeral());
      checkStableIdEquals(foo,returned);
      finishTestAndReset();
    }
  }
);
}
Program: 81989
Project: 81989
Buggy source:
private Object getPropertyValueFromRequestCached(JSONArray recordArray,int index,Property<?> dtoProperty) throws JSONException, IllegalAccessException, InvocationTargetException, NoSuchMethodException, InstantiationException {
  Object propertyValue;
  Class<?> leafType=dtoProperty instanceof CollectionProperty<?,?> ? ((CollectionProperty<?,?>)dtoProperty).getLeafType() : dtoProperty.getType();
  if (EntityProxy.class.isAssignableFrom(leafType)) {
    EntityKey propKey=getEntityKey(recordArray.getString(index));
    Object cacheValue=cachedEntityLookup.get(propKey);
    if (cachedEntityLookup.containsKey(propKey)) {
      propertyValue=cacheValue;
    }
 else {
      propertyValue=getPropertyValueFromRequest(recordArray,index,leafType);
    }
  }
 else {
    propertyValue=getPropertyValueFromRequest(recordArray,index,leafType);
  }
  return propertyValue;
}

Fixed version (ground truth):
private Object getPropertyValueFromRequestCached(JSONObject recordObject,Map<String,Property<?>> propertiesInProxy,String key,Property<?> dtoProperty) throws JSONException, IllegalAccessException, InvocationTargetException, NoSuchMethodException, InstantiationException {
  Object propertyValue;
  if (!recordObject.isNull(key) && EntityProxy.class.isAssignableFrom(dtoProperty.getType())) {
    EntityKey propKey=getEntityKey(recordObject.getString(key));
    Object cacheValue=cachedEntityLookup.get(propKey);
    if (cachedEntityLookup.containsKey(propKey)) {
      propertyValue=cacheValue;
    }
 else {
      propertyValue=getPropertyValueFromRequest(recordObject,key,propertiesInProxy.get(key).getType());
    }
  }
 else {
    propertyValue=getPropertyValueFromRequest(recordObject,key,propertiesInProxy.get(key).getType());
  }
  return propertyValue;
}
Program: 81990
Project: 81990
Buggy source:
/** 
 * Returns a JSONObject with at most three keys: CREATE, UPDATE, DELETE. Each value is a JSONArray of JSONObjects.
 */
private JSONObject getSideEffects() throws SecurityException, JSONException, IllegalAccessException, InvocationTargetException, NoSuchMethodException, IllegalArgumentException, InstantiationException {
  JSONObject sideEffects=new JSONObject();
  JSONArray createArray=new JSONArray();
  JSONArray deleteArray=new JSONArray();
  JSONArray updateArray=new JSONArray();
  for (  EntityKey entityKey : involvedKeys) {
    EntityData entityData=afterDvsDataMap.get(entityKey);
    if (entityData == null) {
      continue;
    }
    if (entityKey.isFuture) {
      JSONObject createRecord=getCreateReturnRecord(entityKey,entityData);
      if (createRecord != null) {
        createArray.put(createRecord);
      }
      continue;
    }
    WriteOperation writeOperation=detectDeleteOrUpdate(entityKey,entityData);
    if (writeOperation == WriteOperation.DELETE) {
      JSONObject deleteRecord=new JSONObject();
      deleteRecord.put(Constants.ENCODED_ID_PROPERTY,getSchemaAndId(entityKey.proxyType,entityKey.encodedId));
      deleteArray.put(deleteRecord);
    }
    if (writeOperation == WriteOperation.UPDATE) {
      JSONObject updateRecord=new JSONObject();
      updateRecord.put(Constants.ENCODED_ID_PROPERTY,getSchemaAndId(entityKey.proxyType,entityKey.encodedId));
      updateArray.put(updateRecord);
    }
  }
  if (createArray.length() > 0) {
    sideEffects.put(WriteOperation.PERSIST.name(),createArray);
  }
  if (deleteArray.length() > 0) {
    sideEffects.put(WriteOperation.DELETE.name(),deleteArray);
  }
  if (updateArray.length() > 0) {
    sideEffects.put(WriteOperation.UPDATE.name(),updateArray);
  }
  return sideEffects;
}

Fixed version (ground truth):
/** 
 * Returns a JSONObject with at most three keys: CREATE, UPDATE, DELETE. Each value is a JSONArray of JSONObjects.
 */
private JSONObject getSideEffects() throws SecurityException, JSONException, IllegalAccessException, InvocationTargetException, NoSuchMethodException, IllegalArgumentException, InstantiationException {
}
Program: 81991
Project: 81991
Buggy source:
public Object getJsonObject(Object entityElement,Class<? extends EntityProxy> entityKeyClass,RequestProperty propertyContext) throws JSONException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
  JSONObject jsonObject=new JSONObject();
  if (entityElement == null || !EntityProxy.class.isAssignableFrom(entityKeyClass)) {
    return JSONObject.NULL;
  }
  jsonObject.put(Constants.ENCODED_ID_PROPERTY,isEntityReference(entityElement,entityKeyClass));
  jsonObject.put(Constants.ENCODED_VERSION_PROPERTY,encodePropertyValueFromDataStore(entityElement,Constants.ENTITY_VERSION_PROPERTY,Constants.ENTITY_VERSION_PROPERTY.getName(),propertyContext));
  for (  Property<?> p : allProperties(entityKeyClass)) {
    if (requestedProperty(p,propertyContext)) {
      String propertyName=p.getName();
      jsonObject.put(propertyName,encodePropertyValueFromDataStore(entityElement,p,propertyName,propertyContext));
    }
  }
  return jsonObject;
}

Fixed version (ground truth):
public Object getJsonObject(Object entityElement,Class<? extends EntityProxy> entityKeyClass,RequestProperty propertyContext) throws JSONException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
  if (entityElement == null || !EntityProxy.class.isAssignableFrom(entityKeyClass)) {
    return JSONObject.NULL;
  }
  JSONObject jsonObject=getJsonObjectWithIdAndVersion(isEntityReference(entityElement,entityKeyClass),entityElement,propertyContext);
  for (  Property<?> p : allProperties(entityKeyClass)) {
    if (requestedProperty(p,propertyContext)) {
      String propertyName=p.getName();
      jsonObject.put(propertyName,encodePropertyValueFromDataStore(entityElement,p,propertyName,propertyContext));
    }
  }
  return jsonObject;
}
Program: 81994
Project: 81994
Buggy source:
public void testEndToEnd() throws Exception {
  com.google.gwt.requestfactory.server.SimpleFoo.reset();
  JSONObject foo=fetchVerifyAndGetInitialObject();
  foo.put("String_Node_Str",45);
  foo.put("String_Node_Str","String_Node_Str");
  foo.put("String_Node_Str","String_Node_Str" + 9L);
  foo.put("String_Node_Str",SimpleEnum.BAR.ordinal());
  foo.put("String_Node_Str",false);
  Date now=new Date();
  foo.put("String_Node_Str","String_Node_Str" + now.getTime());
  JSONObject result=getResultFromServer(foo);
  SimpleFoo fooResult=SimpleFoo.findSimpleFooById(999L);
  JSONArray updateArray=result.getJSONObject("String_Node_Str").getJSONArray("String_Node_Str");
  assertEquals(1,updateArray.length());
  assertEquals(1,updateArray.getJSONObject(0).length());
  assertTrue(updateArray.getJSONObject(0).has(Constants.ENCODED_ID_PROPERTY));
  assertFalse(updateArray.getJSONObject(0).has("String_Node_Str"));
  assertEquals(45,(int)fooResult.getIntId());
  assertEquals("String_Node_Str",fooResult.getUserName());
  assertEquals(now,fooResult.getCreated());
  assertEquals(9L,(long)fooResult.getLongField());
  assertEquals(com.google.gwt.requestfactory.shared.SimpleEnum.BAR,fooResult.getEnumField());
  assertEquals(false,(boolean)fooResult.getBoolField());
}

Fixed version (ground truth):
public void testEndToEnd() throws Exception {
  com.google.gwt.requestfactory.server.SimpleFoo.reset();
  JSONObject foo=fetchVerifyAndGetInitialObject();
  foo.put("String_Node_Str",45);
  foo.put("String_Node_Str","String_Node_Str");
  foo.put("String_Node_Str","String_Node_Str" + 9L);
  foo.put("String_Node_Str",SimpleEnum.BAR.ordinal());
  foo.put("String_Node_Str",false);
  Date now=new Date();
  foo.put("String_Node_Str","String_Node_Str" + now.getTime());
  JSONObject result=getResultFromServer(foo);
  SimpleFoo fooResult=SimpleFoo.findSimpleFooById(999L);
  JSONArray updateArray=result.getJSONObject("String_Node_Str").getJSONArray("String_Node_Str");
  assertEquals(1,updateArray.length());
  assertEquals(2,updateArray.getJSONObject(0).length());
  assertTrue(updateArray.getJSONObject(0).has(Constants.ENCODED_ID_PROPERTY));
  assertTrue(updateArray.getJSONObject(0).has(Constants.ENCODED_VERSION_PROPERTY));
  assertFalse(updateArray.getJSONObject(0).has("String_Node_Str"));
  assertEquals(45,(int)fooResult.getIntId());
  assertEquals("String_Node_Str",fooResult.getUserName());
  assertEquals(now,fooResult.getCreated());
  assertEquals(9L,(long)fooResult.getLongField());
  assertEquals(com.google.gwt.requestfactory.shared.SimpleEnum.BAR,fooResult.getEnumField());
  assertEquals(false,(boolean)fooResult.getBoolField());
}
Program: 81995
Project: 81995
Buggy source:
public void persist(){
  if (isNew) {
    setId(Long.toString(nextId++));
    isNew=false;
    get().put(getId(),this);
  }
}

Fixed version (ground truth):
public void persist(){
  if (isNew) {
    setId(Long.toString(nextId++));
    isNew=false;
    get().put(getId(),this);
  }
  version++;
}
Program: 81996
Project: 81996
Buggy source:
public Long countSimpleFooWithUserNameSideEffect(){
  findSimpleFoo(1L).setUserName(userName);
  return countSimpleFoo();
}

Fixed version (ground truth):
public Long countSimpleFooWithUserNameSideEffect(){
  findSimpleFoo(1L).setUserName(userName);
  version++;
  return countSimpleFoo();
}
Program: 81997
Project: 81997
Buggy source:
public void persist(){
  if (isNew) {
    setId(nextId++);
    isNew=false;
    get().put(getId(),this);
  }
}

Fixed version (ground truth):
public void persist(){
  if (isNew) {
    setId(nextId++);
    isNew=false;
    get().put(getId(),this);
  }
  version++;
}
Program: 81998
Project: 81998
Buggy source:
public Long countSimpleFooWithUserNameSideEffect(){
  get().setUserName(userName);
  return 1L;
}

Fixed version (ground truth):
public Long countSimpleFooWithUserNameSideEffect(){
  get().setUserName(userName);
  version++;
  return 1L;
}
Program: 81999
Project: 81999
Buggy source:
public void persist(){
  setId(nextId++ + "String_Node_Str");
}

Fixed version (ground truth):
public void persist(){
  setId(nextId++ + "String_Node_Str");
  version++;
}
Program: 82000
Project: 82000
Buggy source:
public String getSchedule(boolean[] daysFilter){
  return classSchedule.getDescription(daysFilter);
}

Fixed version (ground truth):
public String getSchedule(){
  return getScheduleWithFilter(daysFilters);
}
Program: 82001
Project: 82001
Buggy source:
/** 
 * Get the HTML representation of an image. Visible for testing.
 * @param res the {@link ImageResource} to render as HTML
 * @param valign the vertical alignment
 * @param isPlaceholder if true, do not include the background image
 * @return the rendered HTML
 */
SafeHtml getImageHtml(ImageResource res,VerticalAlignmentConstant valign,boolean isPlaceholder){
  if (isPlaceholder) {
    return template.imagePlaceholder(direction,res.getWidth());
  }
 else {
    String vert=valign == HasVerticalAlignment.ALIGN_MIDDLE ? "String_Node_Str" : valign.getVerticalAlignString();
    return SafeHtmlUtils.fromTrustedString("String_Node_Str" + direction + "String_Node_Str"+ res.getWidth()+ "String_Node_Str"+ res.getURL()+ "String_Node_Str"+ SafeHtmlUtils.htmlEscape(vert)+ "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Get the HTML representation of an image. Visible for testing.
 * @param res the {@link ImageResource} to render as HTML
 * @param valign the vertical alignment
 * @param isPlaceholder if true, do not include the background image
 * @return the rendered HTML
 */
SafeHtml getImageHtml(ImageResource res,VerticalAlignmentConstant valign,boolean isPlaceholder){
  SafeHtml image;
  if (isPlaceholder) {
    image=SafeHtmlUtils.fromTrustedString("String_Node_Str");
  }
 else {
    AbstractImagePrototype proto=AbstractImagePrototype.create(res);
    image=SafeHtmlUtils.fromTrustedString(proto.getHTML());
  }
  if (HasVerticalAlignment.ALIGN_TOP == valign) {
    return template.imageWrapperTop(direction,image);
  }
 else   if (HasVerticalAlignment.ALIGN_BOTTOM == valign) {
    return template.imageWrapperBottom(direction,image);
  }
 else {
    int halfHeight=1 + (int)Math.round(res.getHeight() / 2.0);
    return template.imageWrapperMiddle(direction,halfHeight,image);
  }
}
Program: 82002
Project: 82002
Buggy source:
/** 
 * Construct a new   {@link IconCellDecorator}.
 * @param icon the icon to use
 * @param cell the cell to decorate
 * @param valign the vertical alignment attribute of the contents
 * @param spacing the pixel space between the icon and the cell
 */
public IconCellDecorator(ImageResource icon,Cell<C> cell,VerticalAlignmentConstant valign,int spacing){
  if (template == null) {
    template=GWT.create(Template.class);
  }
  this.cell=cell;
  this.iconHtml=getImageHtml(icon,valign,false);
  this.imageWidth=icon.getWidth() + 6;
  this.placeHolderHtml=getImageHtml(icon,valign,true);
}

Fixed version (ground truth):
/** 
 * Construct a new   {@link IconCellDecorator}.
 * @param icon the icon to use
 * @param cell the cell to decorate
 * @param valign the vertical alignment attribute of the contents
 * @param spacing the pixel space between the icon and the cell
 */
public IconCellDecorator(ImageResource icon,Cell<C> cell,VerticalAlignmentConstant valign,int spacing){
  if (template == null) {
    template=GWT.create(Template.class);
  }
  this.cell=cell;
  this.iconHtml=getImageHtml(icon,valign,false);
  this.imageWidth=icon.getWidth() + spacing;
  this.placeHolderHtml=getImageHtml(icon,valign,true);
}