nus-yam/ex-repair huggingface dataset:
Program: 82644
Project: 82644
Buggy source:
/** 
 * Gets the month and year formatter.
 * @return the month and year formatter
 */
protected DateTimeFormat getMonthAndYearFormatter(){
  return monthAndYearFormatter;
}

Fixed version (ground truth):
/** 
 * Gets the month and year formatter.
 * @return the month and year formatter
 */
protected DateTimeFormat getMonthAndYearFormatter(){
  return DateTimeFormat.getFormat("String_Node_Str");
}
Program: 82645
Project: 82645
Buggy source:
/** 
 * Gets the date of month formatter.
 * @return the day of month formatter
 */
protected DateTimeFormat getDayOfMonthFormatter(){
  return dayOfMonthFormatter;
}

Fixed version (ground truth):
/** 
 * Gets the date of month formatter.
 * @return the day of month formatter
 */
protected DateTimeFormat getDayOfMonthFormatter(){
  return DateTimeFormat.getFormat("String_Node_Str");
}
Program: 82647
Project: 82647
Buggy source:
private void generateOnLoadMethod(PrintWriter srcWriter){
  srcWriter.println("String_Node_Str");
  srcWriter.println(ASYNC_FRAGMENT_LOADER + "String_Node_Str" + entryNumber+ "String_Node_Str");
  srcWriter.println("String_Node_Str");
  srcWriter.println("String_Node_Str" + getLoaderSimpleName() + "String_Node_Str");
  srcWriter.println(ASYNC_FRAGMENT_LOADER + "String_Node_Str" + entryNumber+ "String_Node_Str");
  srcWriter.println("String_Node_Str");
  srcWriter.println("String_Node_Str");
}

Fixed version (ground truth):
private void generateOnLoadMethod(PrintWriter srcWriter){
  srcWriter.println("String_Node_Str");
  srcWriter.println("String_Node_Str");
  srcWriter.println("String_Node_Str" + getLoaderSimpleName() + "String_Node_Str");
  srcWriter.println(ASYNC_FRAGMENT_LOADER + "String_Node_Str" + entryNumber+ "String_Node_Str");
  srcWriter.println(ASYNC_FRAGMENT_LOADER + "String_Node_Str" + entryNumber+ "String_Node_Str");
  srcWriter.println("String_Node_Str");
  srcWriter.println(ASYNC_FRAGMENT_LOADER + "String_Node_Str" + entryNumber+ "String_Node_Str");
  srcWriter.println("String_Node_Str");
}
Program: 82648
Project: 82648
Buggy source:
/** 
 * Create an event object suitable for submitting to the lightweight metrics framework.
 */
private static native JavaScriptObject createStatsEvent(String eventGroup,String type);

Fixed version (ground truth):
private static native JavaScriptObject createStatsEvent(String eventGroup,String type,Integer fragment,Integer size);
Program: 82649
Project: 82649
Buggy source:
/** 
 * Logs an event with the GWT lightweight metrics framework.
 */
public static void logEventProgress(String eventGroup,String type){
  @SuppressWarnings("String_Node_Str") boolean toss=isStatsAvailable() && stats(createStatsEvent(eventGroup,type));
}

Fixed version (ground truth):
/** 
 * Log an event with the lightweight metrics framework. The <code>fragment</code> and <code>size</code> objects are allowed to be <code>null</code>.
 */
private static void logEventProgress(String eventGroup,String type,Integer fragment,Integer size){
  @SuppressWarnings("String_Node_Str") boolean toss=isStatsAvailable() && stats(createStatsEvent(eventGroup,type,fragment,size));
}
Program: 82650
Project: 82650
Buggy source:
/** 
 * Inform the loader that the "leftovers" fragment has loaded.
 */
public static void leftoversFragmentHasLoaded(){
  leftoversLoaded=true;
  leftoversLoading=false;
  while (!waitingForLeftovers.isEmpty()) {
    inject(waitingForLeftovers.remove());
  }
}

Fixed version (ground truth):
/** 
 * Inform the loader that the "leftovers" fragment has loaded.
 */
public static void leftoversFragmentHasLoaded(){
  leftoversLoaded=true;
  leftoversLoading=false;
  logEventProgress(LwmLabels.LEFTOVERS_DOWNLOAD,LwmLabels.END,leftoversFragmentNumber(),null);
  while (!waitingForLeftovers.isEmpty()) {
    inject(waitingForLeftovers.remove());
  }
}
Program: 82651
Project: 82651
Buggy source:
/** 
 * Inform the loader that the code for an entry point has now finished loading.
 * @param entry The entry whose code fragment is now loaded.
 */
public static void fragmentHasLoaded(int entry){
  if (base < 0) {
    base=entry;
    baseLoading=false;
    leftoversLoading=true;
    startLoadingFragment(numEntries + 2 * (entry - 1) + 1);
  }
}

Fixed version (ground truth):
/** 
 * Inform the loader that the code for an entry point has now finished loading.
 * @param entry The entry whose code fragment is now loaded.
 */
public static void fragmentHasLoaded(int entry){
  int fragment=base >= 0 ? entry : baseFragmentNumber(entry);
  logEventProgress(LwmLabels.downloadGroup(entry),LwmLabels.END,fragment,null);
  if (base < 0) {
    base=entry;
    baseLoading=false;
    leftoversLoading=true;
    logEventProgress(LwmLabels.LEFTOVERS_DOWNLOAD,LwmLabels.BEGIN,leftoversFragmentNumber(),null);
    startLoadingFragment(leftoversFragmentNumber());
  }
}
Program: 82652
Project: 82652
Buggy source:
/** 
 * Loads the specified split point.
 * @param splitPoint the fragment to load
 */
public static void inject(int splitPoint){
  if (leftoversLoaded) {
    startLoadingFragment(splitPoint);
    return;
  }
  if (baseLoading || leftoversLoading) {
    waitingForLeftovers.add(splitPoint);
    return;
  }
  baseLoading=true;
  startLoadingFragment(numEntries + 2 * (splitPoint - 1));
}

Fixed version (ground truth):
/** 
 * Loads the specified split point.
 * @param splitPoint the fragment to load
 */
public static void inject(int splitPoint){
  if (leftoversLoaded) {
    logEventProgress(LwmLabels.downloadGroup(splitPoint),LwmLabels.BEGIN,splitPoint,null);
    startLoadingFragment(splitPoint);
    return;
  }
  if (baseLoading || leftoversLoading) {
    waitingForLeftovers.add(splitPoint);
    return;
  }
  baseLoading=true;
  logEventProgress(LwmLabels.downloadGroup(splitPoint),LwmLabels.BEGIN,baseFragmentNumber(splitPoint),null);
  startLoadingFragment(baseFragmentNumber(splitPoint));
}
Program: 82653
Project: 82653
Buggy source:
private static void startLoadingFragment(int fragment){
  logEventProgress("String_Node_Str" + fragment,"String_Node_Str");
  gwtStartLoadingFragment(fragment);
}

Fixed version (ground truth):
private static void startLoadingFragment(int fragment){
  gwtStartLoadingFragment(fragment);
}
Program: 82654
Project: 82654
Buggy source:
/** 
 * Compare two methods based on name and original argument types  {@link JMethod#getOriginalParamTypes()}. Note that nothing special is done here regarding methods with type parameters in their argument lists. The caller must be careful that this level of matching is sufficient.
 */
private static boolean methodsDoMatch(JMethod method1,JMethod method2){
  if (method1.isStatic() || method2.isStatic()) {
    return false;
  }
  if (!method1.getName().equals(method2.getName())) {
    return false;
  }
  List<JType> params1=method1.getOriginalParamTypes();
  List<JType> params2=method2.getOriginalParamTypes();
  int params1size=params1.size();
  if (params1size != params2.size()) {
    return false;
  }
  for (int i=0; i < params1size; ++i) {
    if (params1.get(i) != params2.get(i)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Compare two methods based on name and original argument types  {@link JMethod#getOriginalParamTypes()}. Note that nothing special is done here regarding methods with type parameters in their argument lists. The caller must be careful that this level of matching is sufficient.
 */
public static boolean methodsDoMatch(JMethod method1,JMethod method2){
  if (method1.isStatic() || method2.isStatic()) {
    return false;
  }
  if (!method1.getName().equals(method2.getName())) {
    return false;
  }
  List<JType> params1=method1.getOriginalParamTypes();
  List<JType> params2=method2.getOriginalParamTypes();
  int params1size=params1.size();
  if (params1size != params2.size()) {
    return false;
  }
  for (int i=0; i < params1size; ++i) {
    if (params1.get(i) != params2.get(i)) {
      return false;
    }
  }
  return true;
}
Program: 82655
Project: 82655
Buggy source:
@Override protected synchronized Class<?> findClass(String className) throws ClassNotFoundException {
  if (className == null) {
    throw new ClassNotFoundException("String_Node_Str",new NullPointerException());
  }
  if (isInStandardJavaPackage(className)) {
    throw new ClassNotFoundException(className);
  }
  if (BRIDGE_CLASS_NAMES.containsKey(className)) {
    return BRIDGE_CLASS_NAMES.get(className);
  }
  byte[] classBytes=findClassBytes(className);
  if (classBytes == null) {
    throw new ClassNotFoundException(className);
  }
  Class<?> newClass=defineClass(className,classBytes,0,classBytes.length);
  if (className.equals(JavaScriptHost.class.getName())) {
    javaScriptHostClass=newClass;
    updateJavaScriptHost();
  }
  if (!classRewriter.isJsoIntf(className)) {
    CompiledClass compiledClass=compilationState.getClassFileMap().get(canonicalizeClassName(className));
    if (compiledClass != null) {
      toInject.push(compiledClass);
    }
  }
  if (!isInjectingClass) {
    try {
      isInjectingClass=true;
      while (toInject.size() > 0) {
        injectJsniFor(toInject.remove(0));
      }
    }
  finally {
      isInjectingClass=false;
    }
  }
  if (className.equals("String_Node_Str")) {
    gwtClass=newClass;
    updateGwtClass();
  }
  return newClass;
}

Fixed version (ground truth):
@Override protected synchronized Class<?> findClass(String className) throws ClassNotFoundException {
  if (className == null) {
    throw new ClassNotFoundException("String_Node_Str",new NullPointerException());
  }
  if (isInStandardJavaPackage(className)) {
    throw new ClassNotFoundException(className);
  }
  if (BRIDGE_CLASS_NAMES.containsKey(className)) {
    return BRIDGE_CLASS_NAMES.get(className);
  }
  byte[] classBytes=findClassBytes(className);
  if (classBytes == null) {
    throw new ClassNotFoundException(className);
  }
  boolean localInjection;
  if (!isInjectingClass) {
    localInjection=isInjectingClass=true;
  }
 else {
    localInjection=false;
  }
  Class<?> newClass=defineClass(className,classBytes,0,classBytes.length);
  if (className.equals(JavaScriptHost.class.getName())) {
    javaScriptHostClass=newClass;
    updateJavaScriptHost();
  }
  if (!classRewriter.isJsoIntf(className)) {
    CompiledClass compiledClass=compilationState.getClassFileMap().get(canonicalizeClassName(className));
    if (compiledClass != null) {
      toInject.push(compiledClass);
    }
  }
  if (localInjection) {
    try {
      while (toInject.size() > 0) {
        injectJsniFor(toInject.remove(0));
      }
    }
  finally {
      isInjectingClass=false;
    }
  }
  if (className.equals("String_Node_Str")) {
    gwtClass=newClass;
    updateGwtClass();
  }
  return newClass;
}
Program: 82656
Project: 82656
Buggy source:
public void testStaticAccess(){
  Foo.field=3;
  assertEquals(3,Foo.field--);
  assertEquals("String_Node_Str",Foo.staticValue());
  assertEquals("String_Node_Str",Foo.staticNative());
  Bar.field=10;
  assertEquals(11,++Bar.field);
  assertEquals("String_Node_Str",Bar.staticValue());
  assertEquals("String_Node_Str",Bar.staticNative());
}

Fixed version (ground truth):
public void testStaticAccess(){
  Foo.field=3;
  assertEquals(3,Foo.field--);
  assertEquals("String_Node_Str",Foo.staticValue());
  assertEquals("String_Node_Str",Foo.staticNative());
  assertEquals("String_Node_Str",Foo.staticNativeToSub());
  Bar.field=10;
  assertEquals(11,++Bar.field);
  assertEquals("String_Node_Str",Bar.staticValue());
  assertEquals("String_Node_Str",Bar.staticNative());
}
Program: 82657
Project: 82657
Buggy source:
public void onMouseUp(Widget sender,int x,int y){
  dragging=false;
  DOM.releaseCapture(caption.getElement());
}

Fixed version (ground truth):
public void onMouseUp(Widget sender,int x,int y){
  dragging=false;
  DOM.releaseCapture(getElement());
}
Program: 82658
Project: 82658
Buggy source:
public void onMouseDown(Widget sender,int x,int y){
  dragging=true;
  DOM.setCapture(caption.getElement());
  dragStartX=x;
  dragStartY=y;
}

Fixed version (ground truth):
public void onMouseDown(Widget sender,int x,int y){
  dragging=true;
  DOM.setCapture(getElement());
  dragStartX=x;
  dragStartY=y;
}
Program: 82659
Project: 82659
Buggy source:
/** 
 * Creates an empty dialog box specifying its "auto-hide" property. It should not be shown until its child widget has been added using  {@link #add(Widget)}.
 * @param autoHide <code>true</code> if the dialog should be automaticallyhidden when the user clicks outside of it
 * @param modal <code>true</code> if keyboard and mouse events for widgetsnot contained by the dialog should be ignored
 */
public DialogBox(boolean autoHide,boolean modal){
  super(autoHide,modal,"String_Node_Str");
  Element td=getCellElement(0,1);
  DOM.appendChild(td,caption.getElement());
  adopt(caption);
  caption.setStyleName("String_Node_Str");
  caption.addMouseListener(this);
  setStyleName(DEFAULT_STYLENAME);
}

Fixed version (ground truth):
/** 
 * Creates an empty dialog box specifying its "auto-hide" property. It should not be shown until its child widget has been added using  {@link #add(Widget)}.
 * @param autoHide <code>true</code> if the dialog should be automaticallyhidden when the user clicks outside of it
 * @param modal <code>true</code> if keyboard and mouse events for widgetsnot contained by the dialog should be ignored
 */
public DialogBox(boolean autoHide,boolean modal){
  super(autoHide,modal,"String_Node_Str");
  Element td=getCellElement(0,1);
  DOM.appendChild(td,caption.getElement());
  adopt(caption);
  caption.setStyleName("String_Node_Str");
  mouseListeners.add(this);
  setStyleName(DEFAULT_STYLENAME);
  sinkEvents(Event.MOUSEEVENTS);
}
Program: 82660
Project: 82660
Buggy source:
public native int getBodyOffsetTop();

Fixed version (ground truth):
@Override public native int getBodyOffsetTop();
Program: 82661
Project: 82661
Buggy source:
public native int getBodyOffsetLeft();

Fixed version (ground truth):
@Override public native int getBodyOffsetLeft();
Program: 82662
Project: 82662
Buggy source:
@Override protected void nativeUpdate(String historyToken){
  if (isOldSafari) {
    nativeUpdateImpl(historyToken);
  }
 else {
    super.nativeUpdate(historyToken);
  }
}

Fixed version (ground truth):
@Override protected void nativeUpdate(String historyToken){
  if (isOldSafari) {
    oldNativeUpdate(historyToken);
  }
 else {
    newNativeUpdate(historyToken);
  }
}
Program: 82663
Project: 82663
Buggy source:
public void onHistoryChanged(String historyToken){
  if (historyToken == null) {
    fail("String_Node_Str");
  }
  assertEquals(token,historyToken);
  finishTest();
}

Fixed version (ground truth):
public void onHistoryChanged(String historyToken){
  counter.add(new Object());
  assertFalse("String_Node_Str",isBorked());
}
Program: 82664
Project: 82664
Buggy source:
public DefaultMuseum(){
  addIssue(new Issue1245());
  addIssue(new Issue1772());
  addIssue(new Issue1897());
  addIssue(new Issue1932());
  addIssue(new Issue2261());
  addIssue(new Issue2290());
  addIssue(new Issue2307());
  addIssue(new Issue2321());
  addIssue(new Issue2331());
  addIssue(new Issue2338());
  addIssue(new Issue2339());
  addIssue(new Issue2390());
  addIssue(new Issue1169());
  addIssue(new Issue2392());
  addIssue(new Issue2443());
  addIssue(new TestFireEvents());
}

Fixed version (ground truth):
public DefaultMuseum(){
  addIssue(new Issue1245());
  addIssue(new Issue1772());
  addIssue(new Issue1897());
  addIssue(new Issue1932());
  addIssue(new Issue2261());
  addIssue(new Issue2290());
  addIssue(new Issue2307());
  addIssue(new Issue2321());
  addIssue(new Issue2331());
  addIssue(new Issue2338());
  addIssue(new Issue2339());
  addIssue(new Issue2390());
  addIssue(new Issue1169());
  addIssue(new Issue2392());
  addIssue(new Issue2443());
  addIssue(new Issue2553());
  addIssue(new TreeVisuals());
  addIssue(new TestFireEvents());
}
Program: 82665
Project: 82665
Buggy source:
@Override void initializeClonableElements(){
  super.initializeClonableElements();
  if (GWT.isClient()) {
    DOM.setElementPropertyInt(BASE_INTERNAL_ELEM,"String_Node_Str",0);
    DOM.setElementPropertyInt(BASE_INTERNAL_ELEM,"String_Node_Str",0);
    BASE_INTERNAL_ELEM.getStyle().setPropertyPx("String_Node_Str",3);
    DOM.setStyleAttribute(BASE_BARE_ELEM,"String_Node_Str","String_Node_Str");
    DOM.setStyleAttribute(BASE_BARE_ELEM,"String_Node_Str","String_Node_Str");
  }
}

Fixed version (ground truth):
@Override void initializeClonableElements(){
  super.initializeClonableElements();
  if (GWT.isClient()) {
    DOM.setStyleAttribute(BASE_BARE_ELEM,"String_Node_Str","String_Node_Str");
    DOM.setStyleAttribute(BASE_BARE_ELEM,"String_Node_Str","String_Node_Str");
  }
}
Program: 82666
Project: 82666
Buggy source:
/** 
 * Called only from   {@link TreeItem}: Shows the leaf image on a tree item.
 * @param treeItem the tree item
 */
void showLeafImage(TreeItem treeItem){
  if (useLeafImages) {
    showImage(treeItem,images.treeLeaf());
  }
 else {
    DOM.setStyleAttribute(treeItem.getElement(),"String_Node_Str",indentValue);
  }
}

Fixed version (ground truth):
/** 
 * Called only from   {@link TreeItem}: Shows the leaf image on a tree item.
 * @param treeItem the tree item
 */
void showLeafImage(TreeItem treeItem){
  if (useLeafImages || treeItem.isFullNode()) {
    showImage(treeItem,images.treeLeaf());
  }
 else {
    DOM.setStyleAttribute(treeItem.getElement(),"String_Node_Str",indentValue);
  }
}
Program: 82667
Project: 82667
Buggy source:
Element getImageHolderElement(){
  if (imageHolder == null) {
    convertToFullNode();
  }
  return imageHolder;
}

Fixed version (ground truth):
Element getImageHolderElement(){
  if (!isFullNode()) {
    convertToFullNode();
  }
  return imageHolder;
}
Program: 82668
Project: 82668
Buggy source:
/** 
 * Gets the text currently selected within this text box.
 * @return the selected text, or an empty string if none is selected
 */
public String getSelectedText(){
  int start=getCursorPos(), length=getSelectionLength();
  return getText().substring(start,start + length);
}

Fixed version (ground truth):
/** 
 * Gets the text currently selected within this text box.
 * @return the selected text, or an empty string if none is selected
 */
public String getSelectedText(){
  int start=getCursorPos();
  if (start < 0) {
    return "String_Node_Str";
  }
  int length=getSelectionLength();
  return getText().substring(start,start + length);
}
Program: 82669
Project: 82669
Buggy source:
/** 
 * Sets the cursor position.
 * @param pos the new cursor position
 */
public void setCursorPos(int pos){
  setSelectionRange(pos,0);
}

Fixed version (ground truth):
/** 
 * Sets the cursor position. This will only work when the widget is attached to the document and not hidden.
 * @param pos the new cursor position
 */
public void setCursorPos(int pos){
  setSelectionRange(pos,0);
}
Program: 82670
Project: 82670
Buggy source:
/** 
 * Selects all of the text in the box. This will only work when the widget is attached to the document.
 */
public void selectAll(){
  int length=getText().length();
  if (length > 0) {
    setSelectionRange(0,length);
  }
}

Fixed version (ground truth):
/** 
 * Selects all of the text in the box. This will only work when the widget is attached to the document and not hidden.
 */
public void selectAll(){
  int length=getText().length();
  if (length > 0) {
    setSelectionRange(0,length);
  }
}
Program: 82671
Project: 82671
Buggy source:
/** 
 * Sets the range of text to be selected. This will only work when the widget is attached to the document.
 * @param pos the position of the first character to be selected
 * @param length the number of characters to be selected
 */
public void setSelectionRange(int pos,int length){
  if (!isAttached()) {
    return;
  }
  if (length < 0) {
    throw new IndexOutOfBoundsException("String_Node_Str" + length);
  }
  if ((pos < 0) || (length + pos > getText().length())) {
    throw new IndexOutOfBoundsException("String_Node_Str" + pos + "String_Node_Str"+ (pos + length)+ "String_Node_Str"+ getText().length());
  }
  impl.setSelectionRange(getElement(),pos,length);
}

Fixed version (ground truth):
/** 
 * Sets the range of text to be selected. This will only work when the widget is attached to the document and not hidden.
 * @param pos the position of the first character to be selected
 * @param length the number of characters to be selected
 */
public void setSelectionRange(int pos,int length){
  if (!isAttached()) {
    return;
  }
  if (length < 0) {
    throw new IndexOutOfBoundsException("String_Node_Str" + length);
  }
  if ((pos < 0) || (length + pos > getText().length())) {
    throw new IndexOutOfBoundsException("String_Node_Str" + pos + "String_Node_Str"+ (pos + length)+ "String_Node_Str"+ getText().length());
  }
  impl.setSelectionRange(getElement(),pos,length);
}
Program: 82672
Project: 82672
Buggy source:
/** 
 * Tests various text selection methods in text area.
 */
public void disabledTestSelection(){
  TextBoxBase area=createTextBoxBase();
  assertEquals("String_Node_Str",area.getSelectedText());
  area.selectAll();
  assertEquals(0,area.getSelectionLength());
  try {
    area.setSelectionRange(0,1);
    fail("String_Node_Str");
  }
 catch (  IndexOutOfBoundsException e) {
  }
  RootPanel.get().add(area);
  area.setText("String_Node_Str");
  area.selectAll();
  assertEquals(1,area.getSelectionLength());
  area.setText("String_Node_Str");
  assertEquals(0,area.getSelectionLength());
  area.setText("String_Node_Str");
  area.setSelectionRange(2,2);
  assertEquals(2,area.getCursorPos());
  area.setSelectionRange(0,0);
}

Fixed version (ground truth):
/** 
 * Tests various text selection methods in text area.
 */
public void disabledTestSelection(){
  TextBoxBase area=createTextBoxBase();
  assertEquals("String_Node_Str",area.getSelectedText());
  area.selectAll();
  assertEquals(0,area.getSelectionLength());
  try {
    area.setSelectionRange(0,1);
    fail("String_Node_Str");
  }
 catch (  IndexOutOfBoundsException e) {
  }
  RootPanel.get().add(area);
  area.setText("String_Node_Str");
  area.selectAll();
  assertEquals(1,area.getSelectionLength());
  area.setText("String_Node_Str");
  assertEquals(0,area.getSelectionLength());
  area.setText("String_Node_Str");
  area.setSelectionRange(2,2);
  assertEquals(2,area.getCursorPos());
  area.setSelectionRange(0,0);
{
    TextBoxBase area2=createTextBoxBase();
    area2.setVisible(false);
    RootPanel.get().add(area2);
    area.selectAll();
  }
}
Program: 82673
Project: 82673
Buggy source:
/** 
 * Attempts to get a named deferred binding property. Throws <code>BadPropertyValueException</code> if the property is either undefined or has a value that is unsupported.
 * @param logger the current logger
 * @param propertyName the name of the property
 * @return a value for the property
 */
String getPropertyValue(TreeLogger logger,String propertyName) throws BadPropertyValueException ;

Fixed version (ground truth):
/** 
 * Attempts to get a named deferred binding property. Throws <code>BadPropertyValueException</code> if the property is either undefined or has a value that is unsupported. The result of invoking this method with the same <code>propertyName</code> must be stable.
 * @param logger the current logger
 * @param propertyName the name of the property
 * @return a value for the property
 */
String getPropertyValue(TreeLogger logger,String propertyName) throws BadPropertyValueException ;
Program: 82674
Project: 82674
Buggy source:
/** 
 * Attempts to get a named deferred binding property and returns the list of possible values. Throws <code>BadPropertyValueException</code> if the property is undefined.
 * @param logger the current logger
 * @param propertyName the name of the property
 * @return the possible values for the property
 */
String[] getPropertyValueSet(TreeLogger logger,String propertyName) throws BadPropertyValueException ;

Fixed version (ground truth):
/** 
 * Attempts to get a named deferred binding property and returns the list of possible values. Throws <code>BadPropertyValueException</code> if the property is undefined. The result of invoking this method with the same <code>propertyName</code> must be stable.
 * @param logger the current logger
 * @param propertyName the name of the property
 * @return the possible values for the property
 */
String[] getPropertyValueSet(TreeLogger logger,String propertyName) throws BadPropertyValueException ;
Program: 82675
Project: 82675
Buggy source:
public DistillerRebindPermutationOracle(ArtifactSet generatorArtifacts,PropertyPermutations perms){
  rebindOracles=new CompilationRebindOracle[perms.size()];
  Property[] orderedProps=perms.getOrderedProperties();
  for (int i=0; i < rebindOracles.length; ++i) {
    String[] orderedPropValues=perms.getOrderedPropertyValues(i);
    StaticPropertyOracle propOracle=new StaticPropertyOracle(orderedProps,orderedPropValues);
    rebindOracles[i]=new CompilationRebindOracle(generatorArtifacts,propOracle);
  }
}

Fixed version (ground truth):
public DistillerRebindPermutationOracle(ArtifactSet generatorArtifacts,PropertyPermutations perms){
  propertyOracles=new StaticPropertyOracle[perms.size()];
  rebindOracles=new RebindOracle[perms.size()];
  Property[] orderedProps=perms.getOrderedProperties();
  for (int i=0; i < rebindOracles.length; ++i) {
    String[] orderedPropValues=perms.getOrderedPropertyValues(i);
    propertyOracles[i]=new StaticPropertyOracle(orderedProps,orderedPropValues);
    rebindOracles[i]=new StandardRebindOracle(compilationState,propertyOracles[i],module,rules,genDir,generatorResourcesDir,generatorArtifacts);
  }
}
Program: 82676
Project: 82676
Buggy source:
public String[] getAllPossibleRebindAnswers(TreeLogger logger,String requestTypeName) throws UnableToCompleteException {
  String msg="String_Node_Str" + requestTypeName + "String_Node_Str";
  logger=logger.branch(TreeLogger.DEBUG,msg,null);
  Set<String> answers=new HashSet<String>();
  for (  CompilationRebindOracle rebindOracle : rebindOracles) {
    String resultTypeName=rebindOracle.rebind(logger,requestTypeName);
    answers.add(resultTypeName);
  }
  return Util.toArray(String.class,answers);
}

Fixed version (ground truth):
public String[] getAllPossibleRebindAnswers(TreeLogger logger,String requestTypeName) throws UnableToCompleteException {
  String msg="String_Node_Str" + requestTypeName + "String_Node_Str";
  logger=logger.branch(TreeLogger.DEBUG,msg,null);
  Set<String> answers=new HashSet<String>();
  for (  RebindOracle rebindOracle : rebindOracles) {
    String resultTypeName=rebindOracle.rebind(logger,requestTypeName);
    answers.add(resultTypeName);
  }
  return Util.toArray(String.class,answers);
}
Program: 82677
Project: 82677
Buggy source:
public CompilationRebindOracle getRebindOracle(int permNumber){
  return rebindOracles[permNumber];
}

Fixed version (ground truth):
public RebindOracle getRebindOracle(int permNumber){
  return rebindOracles[permNumber];
}
Program: 82678
Project: 82678
Buggy source:
private void compilePermutations(TreeLogger logger,JavaToJavaScriptCompiler jjs,DistillerRebindPermutationOracle rpo,StandardLinkerContext linkerContext) throws UnableToCompleteException {
  int permCount=rpo.getPermuationCount();
  PerfLogger.start("String_Node_Str" + permCount + "String_Node_Str");
  Permutation[] perms=new Permutation[permCount];
  for (int i=0; i < permCount; ++i) {
    CompilationRebindOracle rebindOracle=rpo.getRebindOracle(i);
    perms[i]=new Permutation(i,rebindOracle,rebindOracle.getPropertyOracle());
  }
  PermutationCompiler permCompiler=new PermutationCompiler(logger,jjs,perms);
  permCompiler.go(linkerContext);
}

Fixed version (ground truth):
private void compilePermutations(TreeLogger logger,JavaToJavaScriptCompiler jjs,DistillerRebindPermutationOracle rpo,StandardLinkerContext linkerContext) throws UnableToCompleteException {
  int permCount=rpo.getPermuationCount();
  PerfLogger.start("String_Node_Str" + permCount + "String_Node_Str");
  Permutation[] perms=new Permutation[permCount];
  for (int i=0; i < permCount; ++i) {
    perms[i]=new Permutation(i,rpo.getRebindOracle(i),rpo.getPropertyOracle(i));
  }
  PermutationCompiler permCompiler=new PermutationCompiler(logger,jjs,perms);
  permCompiler.go(linkerContext);
}
Program: 82679
Project: 82679
Buggy source:
public StaticPropertyOracle getPropertyOracle(){
  return propOracle;
}

Fixed version (ground truth):
public StaticPropertyOracle getPropertyOracle(int permNumber){
  return propertyOracles[permNumber];
}
Program: 82680
Project: 82680
Buggy source:
public String rebind(TreeLogger logger,String typeName) throws UnableToCompleteException {
  logger=Messages.TRACE_TOPLEVEL_REBIND.branch(logger,typeName,null);
  Rebinder rebinder=new Rebinder();
  String result=rebinder.rebind(logger,typeName);
  Messages.TRACE_TOPLEVEL_REBIND_RESULT.log(logger,result,null);
  return result;
}

Fixed version (ground truth):
public String rebind(TreeLogger logger,String typeName) throws UnableToCompleteException {
  String result=cache.get(typeName);
  if (result == null) {
    logger=Messages.TRACE_TOPLEVEL_REBIND.branch(logger,typeName,null);
    Rebinder rebinder=new Rebinder();
    result=rebinder.rebind(logger,typeName);
    cache.put(typeName,result);
    Messages.TRACE_TOPLEVEL_REBIND_RESULT.log(logger,result,null);
  }
  return result;
}
Program: 82681
Project: 82681
Buggy source:
public void visitLocalVariable(final String name,final String desc,final String signature,final Label start,final Label end,final int index){
  if (signature != null) {
    if (localVarType == null) {
      localVarType=new ByteVector();
    }
    ++localVarTypeCount;
    localVarType.putShort(start.position).putShort(end.position - start.position).putShort(cw.newUTF8(name)).putShort(cw.newUTF8(signature)).putShort(index);
  }
  if (localVar == null) {
    localVar=new ByteVector();
  }
  ++localVarCount;
  localVar.putShort(start.position).putShort(end.position - start.position).putShort(cw.newUTF8(name)).putShort(cw.newUTF8(desc)).putShort(index);
  if (compute != NOTHING) {
    char c=desc.charAt(0);
    int n=index + (c == 'J' || c == 'D' ? 2 : 1);
    if (n > maxLocals) {
      maxLocals=n;
    }
  }
}

Fixed version (ground truth):
public void visitLocalVariable(final String name,final String desc,final String signature,final Label start,final Label end,final int index){
  if (((start.status & labels.RESOLVED) != 0) && ((end.status & labels.RESOLVED) != 0)) {
    if (signature != null) {
      if (localVarType == null) {
        localVarType=new ByteVector();
      }
      ++localVarTypeCount;
      localVarType.putShort(start.position).putShort(end.position - start.position).putShort(cw.newUTF8(name)).putShort(cw.newUTF8(signature)).putShort(index);
    }
    if (localVar == null) {
      localVar=new ByteVector();
    }
    ++localVarCount;
    localVar.putShort(start.position).putShort(end.position - start.position).putShort(cw.newUTF8(name)).putShort(cw.newUTF8(desc)).putShort(index);
  }
  if (compute != NOTHING) {
    char c=desc.charAt(0);
    int n=index + (c == 'J' || c == 'D' ? 2 : 1);
    if (n > maxLocals) {
      maxLocals=n;
    }
  }
}
Program: 82682
Project: 82682
Buggy source:
/** 
 * Embed a script on the outer window and use it to initialize an event.
 * @param initFunc the string representation of the init function
 * @param funcName the name to assign to the init function
 * @param cmd the command to execute the init function
 */
private static void initHandler(String initFunc,String funcName,Command cmd){
  if (GWT.isClient()) {
    maybeInitializeCloseHandlers();
    initFunc=initFunc.replaceFirst("String_Node_Str","String_Node_Str" + funcName);
    ScriptElement scriptElem=Document.get().createScriptElement(initFunc);
    Document.get().getBody().appendChild(scriptElem);
    cmd.execute();
    RootPanel.getBodyElement().removeChild(scriptElem);
  }
}

Fixed version (ground truth):
/** 
 * Initialize an event on the outer window.
 * @param initFunc the string representation of the init function
 * @param funcName the name to assign to the init function
 * @param cmd the command to execute the init function
 */
private static void initHandler(String initFunc,String funcName,Command cmd){
  if (GWT.isClient()) {
    maybeInitializeCloseHandlers();
    impl.initHandler(initFunc,funcName,cmd);
  }
}
Program: 82683
Project: 82683
Buggy source:
public static String getStackTraceAsString(Throwable e){
  StringBuffer message=new StringBuffer();
  Throwable currentCause=e;
  String causedBy="String_Node_Str";
  HashSet<Throwable> seenCauses=new HashSet<Throwable>();
  while (currentCause != null && !seenCauses.contains(currentCause)) {
    seenCauses.add(currentCause);
    message.append(causedBy);
    causedBy="String_Node_Str";
    message.append(currentCause.getClass().getName());
    message.append("String_Node_Str" + currentCause.getMessage());
    StackTraceElement[] stackElems=currentCause.getStackTrace();
    if (stackElems != null) {
      for (int i=0; i < stackElems.length; ++i) {
        message.append("String_Node_Str");
        message.append(stackElems[i].toString());
      }
    }
    currentCause=currentCause.getCause();
  }
  return message.toString();
}

Fixed version (ground truth):
public static String getStackTraceAsString(Throwable e){
  if (e == null || e instanceof UnableToCompleteException) {
    return null;
  }
  StringBuffer message=new StringBuffer();
  Throwable currentCause=e;
  String causedBy="String_Node_Str";
  HashSet<Throwable> seenCauses=new HashSet<Throwable>();
  while (currentCause != null && !seenCauses.contains(currentCause)) {
    seenCauses.add(currentCause);
    message.append(causedBy);
    causedBy="String_Node_Str";
    message.append(currentCause.getClass().getName());
    message.append("String_Node_Str" + currentCause.getMessage());
    StackTraceElement[] stackElems=currentCause.getStackTrace();
    if (stackElems != null) {
      for (int i=0; i < stackElems.length; ++i) {
        message.append("String_Node_Str");
        message.append(stackElems[i].toString());
      }
    }
    currentCause=currentCause.getCause();
  }
  return message.toString();
}
Program: 82684
Project: 82684
Buggy source:
public LogEvent(TreeItemLogger logger,boolean isBranchCommit,int index,Type type,String message,Throwable caught,HelpInfo helpInfo){
  this.logger=logger;
  this.isBranchCommit=isBranchCommit;
  this.index=index;
  this.type=type;
  this.message=message;
  this.caught=caught;
  this.helpInfo=helpInfo;
}

Fixed version (ground truth):
public LogEvent(TreeItemLogger logger,boolean isBranchCommit,int index,Type type,String message,Throwable caught,HelpInfo helpInfo){
  this.exceptionDetail=AbstractTreeLogger.getStackTraceAsString(caught);
  this.exceptionName=AbstractTreeLogger.getExceptionName(caught);
  this.logger=logger;
  this.isBranchCommit=isBranchCommit;
  this.index=index;
  this.type=type;
  this.message=message;
  this.helpInfo=helpInfo;
}
Program: 82685
Project: 82685
Buggy source:
/** 
 * Creates a tree item in a way that is sensitive to the log event and its position in the tree.
 */
private TreeItem createTreeItem(Tree tree){
  TreeItem treeItem=null;
  if (isBranchCommit) {
    TreeItemLogger parentLogger=(TreeItemLogger)logger.getParentLogger();
    if (parentLogger.lazyTreeItem == null) {
      treeItem=new TreeItem(tree,SWT.NONE);
      logger.lazyTreeItem=treeItem;
    }
 else     if (!parentLogger.lazyTreeItem.isDisposed()) {
      treeItem=new TreeItem(parentLogger.lazyTreeItem,SWT.NONE);
      logger.lazyTreeItem=treeItem;
    }
 else {
      parentLogger.markLoggerDead();
      return null;
    }
  }
 else {
    if (logger.lazyTreeItem == null) {
      treeItem=new TreeItem(tree,SWT.NONE);
    }
 else     if (!logger.lazyTreeItem.isDisposed()) {
      treeItem=new TreeItem(logger.lazyTreeItem,SWT.NONE);
    }
 else {
      logger.markLoggerDead();
      return null;
    }
  }
  String label=message;
  if (label == null) {
    if (caught != null) {
      label=caught.getMessage();
      if (label == null || label.trim().length() == 0) {
        label=caught.toString();
      }
    }
  }
  treeItem.setText(label);
  if (helpInfo != null) {
    URL url=helpInfo.getURL();
    if (url != null) {
      TreeItem helpItem=new TreeItem(treeItem,SWT.NONE);
      helpItem.setImage(imageLink);
      helpItem.setText("String_Node_Str" + url.toString());
      helpItem.setForeground(helpItem.getDisplay().getSystemColor(SWT.COLOR_BLUE));
      helpItem.setData(helpInfo);
      treeItem.setExpanded(true);
    }
  }
  treeItem.setData(this);
  return treeItem;
}

Fixed version (ground truth):
/** 
 * Creates a tree item in a way that is sensitive to the log event and its position in the tree.
 */
private TreeItem createTreeItem(Tree tree){
  TreeItem treeItem=null;
  if (isBranchCommit) {
    TreeItemLogger parentLogger=(TreeItemLogger)logger.getParentLogger();
    if (parentLogger.lazyTreeItem == null) {
      treeItem=new TreeItem(tree,SWT.NONE);
      logger.lazyTreeItem=treeItem;
    }
 else     if (!parentLogger.lazyTreeItem.isDisposed()) {
      treeItem=new TreeItem(parentLogger.lazyTreeItem,SWT.NONE);
      logger.lazyTreeItem=treeItem;
    }
 else {
      parentLogger.markLoggerDead();
      return null;
    }
  }
 else {
    if (logger.lazyTreeItem == null) {
      treeItem=new TreeItem(tree,SWT.NONE);
    }
 else     if (!logger.lazyTreeItem.isDisposed()) {
      treeItem=new TreeItem(logger.lazyTreeItem,SWT.NONE);
    }
 else {
      logger.markLoggerDead();
      return null;
    }
  }
  String label=message;
  if (label == null) {
    assert(exceptionName != null);
    label=exceptionName;
  }
  treeItem.setText(label);
  if (helpInfo != null) {
    URL url=helpInfo.getURL();
    if (url != null) {
      TreeItem helpItem=new TreeItem(treeItem,SWT.NONE);
      helpItem.setImage(imageLink);
      helpItem.setText("String_Node_Str" + url.toString());
      helpItem.setForeground(helpItem.getDisplay().getSystemColor(SWT.COLOR_BLUE));
      helpItem.setData(helpInfo);
      treeItem.setExpanded(true);
    }
  }
  treeItem.setData(this);
  return treeItem;
}
Program: 82686
Project: 82686
Buggy source:
private void syncDetailsPane(TreeItem item){
  TreeItemLogger.LogEvent logEvent=null;
  Object testLogEvent=item.getData();
  if (testLogEvent instanceof TreeItemLogger.LogEvent) {
    logEvent=(LogEvent)testLogEvent;
  }
  StringBuffer sb=new StringBuffer();
  if (logEvent != null && logEvent.type != null) {
    sb.append("String_Node_Str");
    sb.append(logEvent.type.getLabel());
    sb.append("String_Node_Str");
  }
  sb.append(item.getText());
  sb.append("String_Node_Str");
  if (logEvent != null && logEvent.caught != null) {
    if (!(logEvent.caught instanceof UnableToCompleteException)) {
      String stackTrace=AbstractTreeLogger.getStackTraceAsString(logEvent.caught);
      sb.append(stackTrace);
    }
  }
  details.setText(sb.toString());
}

Fixed version (ground truth):
private void syncDetailsPane(TreeItem item){
  TreeItemLogger.LogEvent logEvent=null;
  Object testLogEvent=item.getData();
  if (testLogEvent instanceof TreeItemLogger.LogEvent) {
    logEvent=(LogEvent)testLogEvent;
  }
  StringBuffer sb=new StringBuffer();
  if (logEvent != null && logEvent.type != null) {
    sb.append("String_Node_Str");
    sb.append(logEvent.type.getLabel());
    sb.append("String_Node_Str");
  }
  sb.append(item.getText());
  sb.append("String_Node_Str");
  if (logEvent != null && logEvent.exceptionDetail != null) {
    sb.append(logEvent.exceptionDetail);
  }
  details.setText(sb.toString());
}
Program: 82687
Project: 82687
Buggy source:
private static void maybeInitializeHandlers(){
  if (GWT.isClient() && !handlersAreInitialized) {
    ScriptElement scriptElem=Document.get().createScriptElement();
    scriptElem.setText(getInitHandlerMethodString());
    Document.get().getBody().appendChild(scriptElem);
    init();
    RootPanel.getBodyElement().removeChild(scriptElem);
    handlersAreInitialized=true;
  }
}

Fixed version (ground truth):
private static void maybeInitializeHandlers(){
  if (GWT.isClient() && !handlersAreInitialized) {
    handlersAreInitialized=true;
    ScriptElement scriptElem=Document.get().createScriptElement();
    String initFunc=getInitHandlerMethodString().replaceFirst("String_Node_Str","String_Node_Str");
    scriptElem.setText(initFunc);
    Document.get().getBody().appendChild(scriptElem);
    init();
    RootPanel.getBodyElement().removeChild(scriptElem);
  }
}
Program: 82688
Project: 82688
Buggy source:
public DefaultMuseum(){
  addIssue(new Issue1245());
  addIssue(new Issue1897());
  addIssue(new Issue2261());
  addIssue(new Issue2290());
  addIssue(new Issue2307());
  addIssue(new Issue2321());
  addIssue(new Issue2331());
  addIssue(new Issue2338());
  addIssue(new Issue2339());
  addIssue(new Issue2392());
  addIssue(new Issue2443());
  addIssue(new TestFireEvents());
}

Fixed version (ground truth):
public DefaultMuseum(){
  addIssue(new Issue1245());
  addIssue(new Issue1772());
  addIssue(new Issue1897());
  addIssue(new Issue2261());
  addIssue(new Issue2290());
  addIssue(new Issue2307());
  addIssue(new Issue2321());
  addIssue(new Issue2331());
  addIssue(new Issue2338());
  addIssue(new Issue2339());
  addIssue(new Issue2392());
  addIssue(new Issue2443());
  addIssue(new TestFireEvents());
}
Program: 82689
Project: 82689
Buggy source:
/** 
 * Initializes the split panel.
 * @param mainElem the root element for the split panel
 * @param splitElem the element that acts as the splitter
 * @param headElem the element to contain the top or left most widget
 * @param tailElem the element to contain the bottom or right most widget
 */
SplitPanel(Element mainElem,Element splitElem,Element headElem,Element tailElem){
  setElement(mainElem);
  this.splitElem=splitElem;
  elements[0]=headElem;
  elements[1]=tailElem;
  sinkEvents(Event.MOUSEEVENTS);
}

Fixed version (ground truth):
/** 
 * Initializes the split panel.
 * @param mainElem the root element for the split panel
 * @param splitElem the element that acts as the splitter
 * @param headElem the element to contain the top or left most widget
 * @param tailElem the element to contain the bottom or right most widget
 */
SplitPanel(Element mainElem,Element splitElem,Element headElem,Element tailElem){
  setElement(mainElem);
  this.splitElem=splitElem;
  elements[0]=headElem;
  elements[1]=tailElem;
  sinkEvents(Event.MOUSEEVENTS | Event.ONLOSECAPTURE);
  if (glassElem == null) {
    glassElem=DOM.createDiv();
    glassElem.getStyle().setProperty("String_Node_Str","String_Node_Str");
    glassElem.getStyle().setProperty("String_Node_Str","String_Node_Str");
    glassElem.getStyle().setProperty("String_Node_Str","String_Node_Str");
    glassElem.getStyle().setProperty("String_Node_Str","String_Node_Str");
    glassElem.getStyle().setProperty("String_Node_Str","String_Node_Str");
    glassElem.getStyle().setProperty("String_Node_Str","String_Node_Str");
    glassElem.getStyle().setProperty("String_Node_Str","String_Node_Str");
    glassElem.getStyle().setProperty("String_Node_Str","String_Node_Str");
    glassElem.getStyle().setProperty("String_Node_Str","String_Node_Str");
  }
}
Program: 82690
Project: 82690
Buggy source:
private void startResizingFrom(int x,int y){
  isResizing=true;
  onSplitterResizeStarted(x,y);
}

Fixed version (ground truth):
private void startResizingFrom(int x,int y){
  isResizing=true;
  onSplitterResizeStarted(x,y);
  int height=RootPanel.getBodyElement().getScrollHeight() - 1;
  int width=RootPanel.getBodyElement().getScrollWidth() - 1;
  glassElem.getStyle().setProperty("String_Node_Str",height + "String_Node_Str");
  glassElem.getStyle().setProperty("String_Node_Str",width + "String_Node_Str");
  RootPanel.getBodyElement().appendChild(glassElem);
}
Program: 82691
Project: 82691
Buggy source:
private void stopResizing(){
  isResizing=false;
}

Fixed version (ground truth):
private void stopResizing(){
  isResizing=false;
  RootPanel.getBodyElement().removeChild(glassElem);
}
Program: 82693
Project: 82693
Buggy source:
public void onWindowResized(int width,int height){
  if (width == windowWidth) {
    return;
  }
  windowWidth=width;
  int menuWidth=mainMenu.getOffsetWidth();
  int contentWidth=width - menuWidth - 30;
  int contentWidthInner=contentWidth - 10;
  bottomPanel.setCellWidth(mainMenu,menuWidth + "String_Node_Str");
  bottomPanel.setCellWidth(contentLayout,contentWidth + "String_Node_Str");
  contentLayout.getCellFormatter().setWidth(0,0,contentWidthInner + "String_Node_Str");
  contentLayout.getCellFormatter().setWidth(1,0,contentWidthInner + "String_Node_Str");
}

Fixed version (ground truth):
public void onWindowResized(int width,int height){
  if (width == windowWidth) {
    return;
  }
  windowWidth=width;
  onWindowResizedImpl(width);
}
Program: 82694
Project: 82694
Buggy source:
@Override public void run(){
  styleTester.setVisible(false);
  styleTester.setVisible(true);
  if (styleTester.getOffsetWidth() > 0) {
    RootPanel.getBodyElement().getStyle().setProperty("String_Node_Str","String_Node_Str");
    RootPanel.getBodyElement().getStyle().setProperty("String_Node_Str","String_Node_Str");
  }
 else {
    schedule(25);
  }
}

Fixed version (ground truth):
@Override public void run(){
  styleTester.setVisible(false);
  styleTester.setVisible(true);
  if (styleTester.getOffsetWidth() > 0) {
    RootPanel.getBodyElement().getStyle().setProperty("String_Node_Str","String_Node_Str");
    RootPanel.getBodyElement().getStyle().setProperty("String_Node_Str","String_Node_Str");
    app.onWindowResizedImpl(Window.getClientWidth());
  }
 else {
    schedule(25);
  }
}