nus-yam/ex-repair huggingface dataset:
Program: 160229
Project: 160229
Buggy source:
@Override public double getDouble(String key){
  if (properties != null) {
    Object obj=properties.get(key);
    if (obj != null && obj instanceof Number)     return ((Number)obj).doubleValue();
 else     return 0.0;
  }
 else   return root == null ? 0.0 : root.get(key).asDouble();
}

Fixed version (ground truth):
@Override public double getDouble(String key){
  if (properties != null) {
    Object obj=properties.get(key);
    if (obj != null && obj instanceof Number)     return ((Number)obj).doubleValue();
 else     return 0.0;
  }
 else {
    if (root == null)     return 0.0;
 else {
      FLValue flvalue=root.get(key);
      if (flvalue.getType() == kFLNumber)       return flvalue.asDouble();
 else       return 0.0;
    }
  }
}
Program: 160230
Project: 160230
Buggy source:
@Override public List<Object> getArray(String key){
  if (properties != null)   return (List<Object>)properties.get(key);
 else   return root == null ? null : root.get(key).asArray();
}

Fixed version (ground truth):
@Override public List<Object> getArray(String key){
  if (properties != null) {
    Object obj=properties.get(key);
    if (obj != null && obj instanceof List<?>)     return (List<Object>)obj;
 else     return null;
  }
 else {
    if (root == null)     return null;
 else {
      FLValue flvalue=root.get(key);
      if (flvalue.getType() == kFLArray)       return flvalue.asArray();
 else       return null;
    }
  }
}
Program: 160231
Project: 160231
Buggy source:
@Override public float getFloat(String key){
  if (properties != null)   return (float)properties.get(key);
 else   return root == null ? 0.0F : root.get(key).asFloat();
}

Fixed version (ground truth):
@Override public float getFloat(String key){
  if (properties != null) {
    Object obj=properties.get(key);
    if (obj != null && obj instanceof Number)     return ((Number)obj).floatValue();
 else     return 0.0F;
  }
 else {
    if (root == null)     return 0.0F;
 else {
      FLValue flvalue=root.get(key);
      if (flvalue.getType() == kFLNumber)       return flvalue.asFloat();
 else       return 0.0F;
    }
  }
}
Program: 160232
Project: 160232
Buggy source:
@Override public boolean getBoolean(String key){
  if (properties != null)   return (boolean)properties.get(key);
 else   return root == null ? false : root.get(key).asBool();
}

Fixed version (ground truth):
@Override public boolean getBoolean(String key){
  if (properties != null) {
    Object obj=properties.get(key);
    if (obj != null && obj instanceof Boolean)     return ((Boolean)obj).booleanValue();
 else     if (obj != null && obj instanceof String)     return Boolean.valueOf((String)obj);
 else     return false;
  }
 else {
    if (root == null)     return false;
 else {
      FLValue flvalue=root.get(key);
      if (flvalue.getType() == kFLBoolean)       return flvalue.asBool();
 else       return false;
    }
  }
}
Program: 160233
Project: 160233
Buggy source:
@Override public Date getDate(String key){
  if (properties != null)   return DateUtils.fromJson((String)properties.get(key));
 else   return root == null ? null : DateUtils.fromJson(root.get(key).asString());
}

Fixed version (ground truth):
@Override public Date getDate(String key){
  if (properties != null) {
    Object obj=properties.get(key);
    if (obj != null && obj instanceof String)     return DateUtils.fromJson((String)obj);
 else     return null;
  }
 else {
    if (root == null)     return null;
 else {
      FLValue flvalue=root.get(key);
      if (flvalue.getType() == kFLString)       return DateUtils.fromJson(flvalue.asString());
 else       return null;
    }
  }
}
Program: 160234
Project: 160234
Buggy source:
@Override public String getString(String key){
  if (properties != null)   return (String)properties.get(key);
 else   return root == null ? null : root.get(key).asString();
}

Fixed version (ground truth):
@Override public String getString(String key){
  if (properties != null) {
    Object obj=properties.get(key);
    if (obj != null && obj instanceof String)     return (String)obj;
 else     return null;
  }
 else {
    if (root == null)     return null;
 else {
      FLValue flvalue=root.get(key);
      if (flvalue.getType() == kFLString)       return flvalue.asString();
 else       return null;
    }
  }
}
Program: 160235
Project: 160235
Buggy source:
@Override public int getInt(String key){
  if (properties != null)   return (int)properties.get(key);
 else   return root == null ? 0 : root.get(key).asInt();
}

Fixed version (ground truth):
@Override public int getInt(String key){
  if (properties != null) {
    Object obj=properties.get(key);
    if (obj != null && obj instanceof Number)     return ((Number)obj).intValue();
 else     return 0;
  }
 else {
    if (root == null)     return 0;
 else {
      FLValue flvalue=root.get(key);
      if (flvalue.getType() == kFLNumber)       return flvalue.asInt();
 else       return 0;
    }
  }
}
Program: 160239
Project: 160239
Buggy source:
public void testGetDocumentWithLargeJSON(){
  Map<String,Object> props=new HashMap<String,Object>();
  props.put("String_Node_Str","String_Node_Str");
  char[] chars=new char[(int)(2.1 * 1024 * 1024)];
  Arrays.fill(chars,'a');
  String str=new String(chars);
  props.put("String_Node_Str",str);
  Document doc=createDocumentWithProperties(database,props);
  assertNotNull(doc);
  Document docFetched=database.getDocument(doc.getId());
  Map<String,Object> fetchedProps=docFetched.getCurrentRevision().getProperties();
  assertEquals(fetchedProps.get("String_Node_Str"),str);
}

Fixed version (ground truth):
public void testGetDocumentWithLargeJSON(){
  Map<String,Object> props=new HashMap<String,Object>();
  props.put("String_Node_Str","String_Node_Str");
  final String content;
{
    char[] chars=new char[2 * 1024 * 1024 + 10 * 1024];
    Arrays.fill(chars,'a');
    content=new String(chars);
    chars=null;
  }
  props.put("String_Node_Str",content);
  Document doc=createDocumentWithProperties(database,props);
  assertNotNull(doc);
  Document docFetched=database.getDocument(doc.getId());
  Map<String,Object> fetchedProps=docFetched.getCurrentRevision().getProperties();
  assertEquals(fetchedProps.get("String_Node_Str"),content);
}
Program: 160240
Project: 160240
Buggy source:
public void testAndroid2MLimit() throws Exception {
  char[] chars=new char[3 * 1024 * 1024];
  Arrays.fill(chars,'a');
  final String content=new String(chars);
  Map<String,Object> props=new HashMap<String,Object>();
  props.put("String_Node_Str",content);
  Document doc=database.createDocument();
  assertNotNull(doc.putProperties(props));
  String docId=doc.getId();
  database.close();
  database=manager.getDatabase(DEFAULT_TEST_DB);
  doc=database.getDocument(docId);
  assertNotNull(doc);
  Map<String,Object> properties=doc.getProperties();
  assertNotNull(properties);
  assertEquals(content,properties.get("String_Node_Str"));
}

Fixed version (ground truth):
public void testAndroid2MLimit() throws Exception {
  final String content;
{
    char[] chars=new char[2 * 1024 * 1024 + 10 * 1024];
    Arrays.fill(chars,'a');
    content=new String(chars);
    chars=null;
  }
  Map<String,Object> props=new HashMap<String,Object>();
  props.put("String_Node_Str",content);
  Document doc=database.createDocument();
  assertNotNull(doc.putProperties(props));
  String docId=doc.getId();
  database.close();
  database=manager.getDatabase(DEFAULT_TEST_DB);
  doc=database.getDocument(docId);
  assertNotNull(doc);
  Map<String,Object> properties=doc.getProperties();
  assertNotNull(properties);
  assertEquals(content,properties.get("String_Node_Str"));
}
Program: 160241
Project: 160241
Buggy source:
public void testGetDocumentWithLargeJSON(){
  Map<String,Object> props=new HashMap<String,Object>();
  props.put("String_Node_Str","String_Node_Str");
  char[] chars=new char[3 * 1024 * 1024];
  Arrays.fill(chars,'a');
  String str=new String(chars);
  props.put("String_Node_Str",str);
  Document doc=createDocumentWithProperties(database,props);
  assertNotNull(doc);
  Document docFetched=database.getDocument(doc.getId());
  Map<String,Object> fetchedProps=docFetched.getCurrentRevision().getProperties();
  assertEquals(fetchedProps.get("String_Node_Str"),str);
}

Fixed version (ground truth):
public void testGetDocumentWithLargeJSON(){
  Map<String,Object> props=new HashMap<String,Object>();
  props.put("String_Node_Str","String_Node_Str");
  char[] chars=new char[(int)(2.1 * 1024 * 1024)];
  Arrays.fill(chars,'a');
  String str=new String(chars);
  props.put("String_Node_Str",str);
  Document doc=createDocumentWithProperties(database,props);
  assertNotNull(doc);
  Document docFetched=database.getDocument(doc.getId());
  Map<String,Object> fetchedProps=docFetched.getCurrentRevision().getProperties();
  assertEquals(fetchedProps.get("String_Node_Str"),str);
}
Program: 160243
Project: 160243
Buggy source:
public void setSticky(boolean isSticky){
  this.isSticky=isSticky;
}

Fixed version (ground truth):
public void setSticky(boolean sticky){
  this.sticky=sticky;
}
Program: 160244
Project: 160244
Buggy source:
@Override public boolean isSticky(){
  return this.isSticky;
}

Fixed version (ground truth):
@Override public boolean isSticky(){
  return this.sticky;
}
Program: 160245
Project: 160245
Buggy source:
public MockResponse generateMockResponse(RecordedRequest request){
  try {
    MockResponse mockResponse=new MockResponse();
    mockResponse.setBody("String_Node_Str");
    mockResponse.setStatus("String_Node_Str");
    return mockResponse;
  }
 catch (  Exception e) {
    e.printStackTrace();
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public MockResponse generateMockResponse(RecordedRequest request){
  Map<String,Object> respDict=new HashMap<String,Object>();
  respDict.put("String_Node_Str",0);
  respDict.put("String_Node_Str",mockDocs.size());
  List<Object> rows=new ArrayList<Object>();
  for (  MockDocumentGet.MockDocument mockDoc : mockDocs) {
    Map<String,Object> doc=new HashMap<String,Object>();
    doc.put("String_Node_Str",mockDoc.getDocId());
    doc.put("String_Node_Str",mockDoc.getDocId());
    Map<String,Object> value=new HashMap<String,Object>();
    value.put("String_Node_Str",mockDoc.getDocRev());
    doc.put("String_Node_Str",value);
    if (false) {
      doc.put("String_Node_Str",mockDoc.getJsonMap());
    }
    rows.add(doc);
  }
  respDict.put("String_Node_Str",rows);
  try {
    MockResponse mockResponse=new MockResponse();
    mockResponse.setBody(Manager.getObjectMapper().writeValueAsString(respDict));
    mockResponse.setStatus("String_Node_Str");
    return mockResponse;
  }
 catch (  Exception e) {
    e.printStackTrace();
    throw new RuntimeException(e);
  }
}
Program: 160246
Project: 160246
Buggy source:
@Override public boolean isSticky(){
  return false;
}

Fixed version (ground truth):
@Override public boolean isSticky(){
  return sticky;
}
Program: 160247
Project: 160247
Buggy source:
protected void addMockDocuments(List<MockDocumentGet.MockDocument> mockDocs){
  for (  MockDocumentGet.MockDocument mockDoc : mockDocs) {
    MockDocumentGet mockDocumentGet=new MockDocumentGet(mockDoc);
    dispatcher.enqueueResponse(mockDoc.getDocPathRegex(),mockDocumentGet.generateMockResponse());
  }
}

Fixed version (ground truth):
protected void addMockDocuments(List<MockDocumentGet.MockDocument> mockDocs){
  for (  MockDocumentGet.MockDocument mockDoc : mockDocs) {
    MockDocumentGet mockDocumentGet=new MockDocumentGet(mockDoc);
    dispatcher.enqueueResponse(mockDoc.getDocPathRegex(),mockDocumentGet.generateMockResponse());
  }
  MockDocumentAllDocs allDocs=new MockDocumentAllDocs(mockDocs);
  allDocs.setSticky(true);
  dispatcher.enqueueResponse(MockHelper.PATH_REGEX_ALL_DOCS,allDocs);
}
Program: 160248
Project: 160248
Buggy source:
public void setSticky(boolean isSticky){
  this.isSticky=isSticky;
}

Fixed version (ground truth):
public void setSticky(boolean sticky){
  this.sticky=sticky;
}
Program: 160249
Project: 160249
Buggy source:
@Override public boolean isSticky(){
  return this.isSticky;
}

Fixed version (ground truth):
@Override public boolean isSticky(){
  return this.sticky;
}
Program: 160250
Project: 160250
Buggy source:
public void failingTestDocumentPropertiesAreImmutable() throws Exception {
  String jsonString="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  Map map=(Map)Manager.getObjectMapper().readValue(jsonString,Object.class);
  Document doc=createDocumentWithProperties(database,map);
  boolean firstLevelImmutable=false;
  Map<String,Object> props=doc.getProperties();
  try {
    props.put("String_Node_Str","String_Node_Str");
  }
 catch (  UnsupportedOperationException e) {
    firstLevelImmutable=true;
  }
  assertTrue(firstLevelImmutable);
  boolean secondLevelImmutable=false;
  Map wikiProps=(Map)props.get("String_Node_Str");
  try {
    wikiProps.put("String_Node_Str","String_Node_Str");
  }
 catch (  UnsupportedOperationException e) {
    secondLevelImmutable=true;
  }
  assertTrue(secondLevelImmutable);
  boolean thirdLevelImmutable=false;
  Map evolutionProps=(Map)wikiProps.get("String_Node_Str");
  try {
    evolutionProps.put("String_Node_Str","String_Node_Str");
  }
 catch (  UnsupportedOperationException e) {
    thirdLevelImmutable=true;
  }
  assertTrue(thirdLevelImmutable);
}

Fixed version (ground truth):
/** 
 * Note: If nested dictionary or array is immutable, user needs to deep copy which is not convenient. For Java, returning Map object is user friendly. We will not fix this issue.
 */
public void failingTestDocumentPropertiesAreImmutable() throws Exception {
  String jsonString="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  Map map=(Map)Manager.getObjectMapper().readValue(jsonString,Object.class);
  Document doc=createDocumentWithProperties(database,map);
  boolean firstLevelImmutable=false;
  Map<String,Object> props=doc.getProperties();
  try {
    props.put("String_Node_Str","String_Node_Str");
  }
 catch (  UnsupportedOperationException e) {
    firstLevelImmutable=true;
  }
  assertTrue(firstLevelImmutable);
  boolean secondLevelImmutable=false;
  Map wikiProps=(Map)props.get("String_Node_Str");
  try {
    wikiProps.put("String_Node_Str","String_Node_Str");
  }
 catch (  UnsupportedOperationException e) {
    secondLevelImmutable=true;
  }
  assertTrue(secondLevelImmutable);
  boolean thirdLevelImmutable=false;
  Map evolutionProps=(Map)wikiProps.get("String_Node_Str");
  try {
    evolutionProps.put("String_Node_Str","String_Node_Str");
  }
 catch (  UnsupportedOperationException e) {
    thirdLevelImmutable=true;
  }
  assertTrue(thirdLevelImmutable);
}
Program: 160252
Project: 160252
Buggy source:
public void failingTestProvidedMapChangesAreSafe() throws Exception {
  Map<String,Object> originalProps=new HashMap<String,Object>();
  Document doc=createDocumentWithProperties(database,originalProps);
  Map<String,Object> nestedProps=new HashMap<String,Object>();
  nestedProps.put("String_Node_Str","String_Node_Str");
  UnsavedRevision rev=doc.createRevision();
  rev.getProperties().put("String_Node_Str",nestedProps);
  rev.save();
  nestedProps.put("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",((Map)doc.getProperty("String_Node_Str")).get("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * NOTE: ** Might Not Be Fixed  Immutability of nested dictionaries might cause performance issue. It is not sure if it worth to fix this.
 */
public void failingTestProvidedMapChangesAreSafe() throws Exception {
  Map<String,Object> originalProps=new HashMap<String,Object>();
  Document doc=createDocumentWithProperties(database,originalProps);
  Map<String,Object> nestedProps=new HashMap<String,Object>();
  nestedProps.put("String_Node_Str","String_Node_Str");
  UnsavedRevision rev=doc.createRevision();
  rev.getProperties().put("String_Node_Str",nestedProps);
  rev.save();
  nestedProps.put("String_Node_Str","String_Node_Str");
  assertEquals("String_Node_Str",((Map)doc.getProperty("String_Node_Str")).get("String_Node_Str"));
}
Program: 160253
Project: 160253
Buggy source:
public void setSticky(boolean isSticky){
  this.isSticky=isSticky;
}

Fixed version (ground truth):
public void setSticky(boolean sticky){
  this.sticky=sticky;
}
Program: 160254
Project: 160254
Buggy source:
@Override public boolean isSticky(){
  return this.isSticky;
}

Fixed version (ground truth):
@Override public boolean isSticky(){
  return this.sticky;
}
Program: 160255
Project: 160255
Buggy source:
public MockResponse generateMockResponse(RecordedRequest request){
  try {
    MockResponse mockResponse=new MockResponse();
    mockResponse.setBody("String_Node_Str");
    mockResponse.setStatus("String_Node_Str");
    return mockResponse;
  }
 catch (  Exception e) {
    e.printStackTrace();
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
public MockResponse generateMockResponse(RecordedRequest request){
  Map<String,Object> respDict=new HashMap<String,Object>();
  respDict.put("String_Node_Str",0);
  respDict.put("String_Node_Str",mockDocs.size());
  List<Object> rows=new ArrayList<Object>();
  for (  MockDocumentGet.MockDocument mockDoc : mockDocs) {
    Map<String,Object> doc=new HashMap<String,Object>();
    doc.put("String_Node_Str",mockDoc.getDocId());
    doc.put("String_Node_Str",mockDoc.getDocId());
    Map<String,Object> value=new HashMap<String,Object>();
    value.put("String_Node_Str",mockDoc.getDocRev());
    doc.put("String_Node_Str",value);
    if (false) {
      doc.put("String_Node_Str",mockDoc.getJsonMap());
    }
    rows.add(doc);
  }
  respDict.put("String_Node_Str",rows);
  try {
    MockResponse mockResponse=new MockResponse();
    mockResponse.setBody(Manager.getObjectMapper().writeValueAsString(respDict));
    mockResponse.setStatus("String_Node_Str");
    return mockResponse;
  }
 catch (  Exception e) {
    e.printStackTrace();
    throw new RuntimeException(e);
  }
}
Program: 160256
Project: 160256
Buggy source:
@Override public boolean isSticky(){
  return false;
}

Fixed version (ground truth):
@Override public boolean isSticky(){
  return sticky;
}
Program: 160257
Project: 160257
Buggy source:
protected void addMockDocuments(List<MockDocumentGet.MockDocument> mockDocs){
  for (  MockDocumentGet.MockDocument mockDoc : mockDocs) {
    MockDocumentGet mockDocumentGet=new MockDocumentGet(mockDoc);
    dispatcher.enqueueResponse(mockDoc.getDocPathRegex(),mockDocumentGet.generateMockResponse());
  }
}

Fixed version (ground truth):
protected void addMockDocuments(List<MockDocumentGet.MockDocument> mockDocs){
  for (  MockDocumentGet.MockDocument mockDoc : mockDocs) {
    MockDocumentGet mockDocumentGet=new MockDocumentGet(mockDoc);
    dispatcher.enqueueResponse(mockDoc.getDocPathRegex(),mockDocumentGet.generateMockResponse());
  }
  MockDocumentAllDocs allDocs=new MockDocumentAllDocs(mockDocs);
  allDocs.setSticky(true);
  dispatcher.enqueueResponse(MockHelper.PATH_REGEX_ALL_DOCS,allDocs);
}
Program: 160258
Project: 160258
Buggy source:
public void setSticky(boolean isSticky){
  this.isSticky=isSticky;
}

Fixed version (ground truth):
public void setSticky(boolean sticky){
  this.sticky=sticky;
}
Program: 160259
Project: 160259
Buggy source:
@Override public boolean isSticky(){
  return this.isSticky;
}

Fixed version (ground truth):
@Override public boolean isSticky(){
  return this.sticky;
}
Program: 160260
Project: 160260
Buggy source:
public void testDeepCloneWithJsonParser() throws Exception {
  Map<String,Object> map1=new HashMap<String,Object>();
  Object[] objs={new String("String_Node_Str"),new String("String_Node_Str")};
  Map<String,Object> map=new HashMap<String,Object>();
  map.put("String_Node_Str","String_Node_Str");
  List<Object> list=new ArrayList<Object>();
  list.add("String_Node_Str");
  list.add("String_Node_Str");
  int[] ints={1,2};
  map1.put("String_Node_Str",objs);
  map1.put("String_Node_Str",ints);
  map1.put("String_Node_Str",map);
  map1.put("String_Node_Str",list);
  Map<String,Object> deepMap1=DeepClone.deepClone(map1);
  ObjectMapper mapper=new ObjectMapper();
  String str1=mapper.writeValueAsString(map1);
  String str2=mapper.writeValueAsString(deepMap1);
  assertEquals(str1,str2);
  assertTrue(str1.equals(str2));
  ((Map)deepMap1.get("String_Node_Str")).put("String_Node_Str","String_Node_Str");
  str1=mapper.writeValueAsString(map1);
  str2=mapper.writeValueAsString(deepMap1);
  assertFalse(str1.equals(str2));
}

Fixed version (ground truth):
public void testDeepCloneWithJsonParser() throws Exception {
  Map<String,Object> map1=new HashMap<String,Object>();
  Object[] objs={new String("String_Node_Str"),new String("String_Node_Str")};
  Map<String,Object> map=new HashMap<String,Object>();
  map.put("String_Node_Str","String_Node_Str");
  List<Object> list=new ArrayList<Object>();
  list.add("String_Node_Str");
  list.add("String_Node_Str");
  int[] ints={1,2};
  map1.put("String_Node_Str",objs);
  map1.put("String_Node_Str",ints);
  map1.put("String_Node_Str",map);
  map1.put("String_Node_Str",list);
  Map<String,Object> deepMap1=DeepClone.deepClone(map1);
  ObjectMapper mapper=new ObjectMapper();
  String str1=mapper.writer(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS).writeValueAsString(map1);
  String str2=mapper.writer(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS).writeValueAsString(deepMap1);
  assertEquals(str1,str2);
  assertTrue(str1.equals(str2));
  ((Map)deepMap1.get("String_Node_Str")).put("String_Node_Str","String_Node_Str");
  str1=mapper.writer(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS).writeValueAsString(map1);
  str2=mapper.writer(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS).writeValueAsString(deepMap1);
  assertFalse(str1.equals(str2));
}
Program: 160263
Project: 160263
Buggy source:
public void testGetDocumentWithLargeJSON(){
  Map<String,Object> props=new HashMap<String,Object>();
  props.put("String_Node_Str","String_Node_Str");
  char[] chars=new char[2500000];
  Arrays.fill(chars,'a');
  props.put("String_Node_Str",new String(chars));
  Document doc=createDocumentWithProperties(database,props);
  assertNotNull(doc);
  Document docFetched=database.getDocument(doc.getId());
  Map<String,Object> fetchedProps=docFetched.getCurrentRevision().getProperties();
  assertEquals(fetchedProps.get("String_Node_Str"),new String(chars));
}

Fixed version (ground truth):
public void testGetDocumentWithLargeJSON(){
  Map<String,Object> props=new HashMap<String,Object>();
  props.put("String_Node_Str","String_Node_Str");
  char[] chars=new char[3 * 1024 * 10243];
  Arrays.fill(chars,'a');
  props.put("String_Node_Str",new String(chars));
  Document doc=createDocumentWithProperties(database,props);
  assertNotNull(doc);
  Document docFetched=database.getDocument(doc.getId());
  Map<String,Object> fetchedProps=docFetched.getCurrentRevision().getProperties();
  assertEquals(fetchedProps.get("String_Node_Str"),new String(chars));
}
Program: 160265
Project: 160265
Buggy source:
public void failingTestDocumentPropertiesAreImmutable() throws Exception {
  String jsonString="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  Map map=(Map)Manager.getObjectMapper().readValue(jsonString,Object.class);
  Document doc=createDocumentWithProperties(database,map);
  boolean firstLevelImmutable=false;
  Map<String,Object> props=doc.getProperties();
  try {
    props.put("String_Node_Str","String_Node_Str");
  }
 catch (  UnsupportedOperationException e) {
    firstLevelImmutable=true;
  }
  assertTrue(firstLevelImmutable);
  boolean secondLevelImmutable=false;
  Map wikiProps=(Map)props.get("String_Node_Str");
  try {
    wikiProps.put("String_Node_Str","String_Node_Str");
  }
 catch (  UnsupportedOperationException e) {
    secondLevelImmutable=true;
  }
  assertTrue(secondLevelImmutable);
  boolean thirdLevelImmutable=false;
  Map evolutionProps=(Map)wikiProps.get("String_Node_Str");
  try {
    evolutionProps.put("String_Node_Str","String_Node_Str");
  }
 catch (  UnsupportedOperationException e) {
    thirdLevelImmutable=true;
  }
  assertTrue(thirdLevelImmutable);
}

Fixed version (ground truth):
/** 
 * NOTE: ** Might Not Be Fixed  Immutability of nested dictionaries might cause performance issue. It is not sure if it worth to fix this.
 */
public void failingTestDocumentPropertiesAreImmutable() throws Exception {
  String jsonString="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  Map map=(Map)Manager.getObjectMapper().readValue(jsonString,Object.class);
  Document doc=createDocumentWithProperties(database,map);
  boolean firstLevelImmutable=false;
  Map<String,Object> props=doc.getProperties();
  try {
    props.put("String_Node_Str","String_Node_Str");
  }
 catch (  UnsupportedOperationException e) {
    firstLevelImmutable=true;
  }
  assertTrue(firstLevelImmutable);
  boolean secondLevelImmutable=false;
  Map wikiProps=(Map)props.get("String_Node_Str");
  try {
    wikiProps.put("String_Node_Str","String_Node_Str");
  }
 catch (  UnsupportedOperationException e) {
    secondLevelImmutable=true;
  }
  assertTrue(secondLevelImmutable);
  boolean thirdLevelImmutable=false;
  Map evolutionProps=(Map)wikiProps.get("String_Node_Str");
  try {
    evolutionProps.put("String_Node_Str","String_Node_Str");
  }
 catch (  UnsupportedOperationException e) {
    thirdLevelImmutable=true;
  }
  assertTrue(thirdLevelImmutable);
}
Program: 160266
Project: 160266
Buggy source:
@Override public void run(){
  try {
    if (num == Integer.MAX_VALUE)     queryAction2(expectCount,viewName2);
 else     queryAction(num,expectCount,viewName1);
  }
 catch (  CouchbaseLiteException e) {
    e.printStackTrace();
    fail(e.getMessage());
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    assertTrue(latch.await(30,TimeUnit.SECONDS));
  }
 catch (  InterruptedException e) {
    fail(e.toString());
  }
  db.close();
}
Program: 160269
Project: 160269
Buggy source:
@Override protected void setUp() throws Exception {
  super.setUp();
  if (!syncgatewayTestsEnabled())   return;
}

Fixed version (ground truth):
@Override protected void setUp() throws Exception {
  if (!syncgatewayTestsEnabled())   return;
  super.setUp();
}
Program: 160271
Project: 160271
Buggy source:
public void testAsCanonicalJSON(){
  Map<String,Object> src=new HashMap<String,Object>();
  src.put("String_Node_Str","String_Node_Str");
  src.put("String_Node_Str","String_Node_Str");
  Map<String,Object> nest=new HashMap<String,Object>();
  nest.put("String_Node_Str","String_Node_Str");
  nest.put("String_Node_Str","String_Node_Str");
  src.put("String_Node_Str",nest);
  String json=new String(RevisionUtils.asCanonicalJSON(src));
  assertEquals("String_Node_Str",json);
  Log.e(TAG,"String_Node_Str",json);
}

Fixed version (ground truth):
public void testAsCanonicalJSON(){
  Map<String,Object> src=new HashMap<String,Object>();
  src.put("String_Node_Str","String_Node_Str");
  src.put("String_Node_Str","String_Node_Str");
  Map<String,Object> nest=new HashMap<String,Object>();
  nest.put("String_Node_Str","String_Node_Str");
  nest.put("String_Node_Str","String_Node_Str");
  nest.put("String_Node_Str","String_Node_Str");
  nest.put("String_Node_Str","String_Node_Str");
  nest.put("String_Node_Str","String_Node_Str");
  src.put("String_Node_Str",nest);
  List<Object> list=new ArrayList<Object>();
  list.add("String_Node_Str");
  Map<String,Object> mapInList=new HashMap<String,Object>();
  mapInList.put("String_Node_Str","String_Node_Str");
  mapInList.put("String_Node_Str","String_Node_Str");
  list.add(mapInList);
  list.add("String_Node_Str");
  src.put("String_Node_Str",list);
  String json=new String(RevisionUtils.asCanonicalJSON(src));
  assertEquals("String_Node_Str",json);
  Log.i(TAG,"String_Node_Str",json);
}
Program: 160272
Project: 160272
Buggy source:
@Override protected void setUp() throws Exception {
  super.setUp();
  if (!syncgatewayTestsEnabled())   return;
}

Fixed version (ground truth):
@Override protected void setUp() throws Exception {
  if (!syncgatewayTestsEnabled())   return;
  super.setUp();
}
Program: 160274
Project: 160274
Buggy source:
@Override public void changed(Document.ChangeEvent event){
  DocumentChange docChange=event.getChange();
  String msg="String_Node_Str";
  msg=String.format(msg,docChange.getAddedRevision(),docChange.isConflict());
  Log.d(TAG,msg);
  documentChanged.countDown();
}

Fixed version (ground truth):
@Override public void changed(Database.ChangeEvent event){
  Log.e(TAG,"String_Node_Str",event);
  counter.countDown();
  try {
    List<DocumentChange> changes=event.getChanges();
    Log.e(TAG,"String_Node_Str",changes.size());
    int conflictsInDocumentChange=0;
    for (    DocumentChange documentChange : changes) {
      Log.e(TAG,"String_Node_Str",documentChange.isConflict());
      if (documentChange.isConflict()) {
        conflictsInDocumentChange++;
        Document document=database.getDocument(documentChange.getDocumentId());
        List<SavedRevision> conflictRevisions=document.getConflictingRevisions();
        if (conflictRevisions.size() > 1) {
          for (          SavedRevision conflictingRevision : conflictRevisions) {
            UnsavedRevision newRevision=conflictingRevision.createRevision();
            if (!conflictingRevision.equals(document.getCurrentRevision())) {
              newRevision.setIsDeletion(true);
            }
            SavedRevision srev=newRevision.save(true);
            Log.e(TAG,"String_Node_Str",srev);
          }
        }
      }
    }
    Log.e(TAG,"String_Node_Str",conflictsInDocumentChange);
    if (counter.getCount() == 1)     assertEquals(1,conflictsInDocumentChange);
 else     if (counter.getCount() == 0)     assertEquals(2,conflictsInDocumentChange);
  }
 catch (  Exception e) {
    Log.e(TAG,"String_Node_Str",e);
  }
}
Program: 160275
Project: 160275
Buggy source:
protected void stopDatabase(){
  if (database != null) {
    database.close();
  }
}

Fixed version (ground truth):
protected void stopDatabase(){
  if (database != null) {
    if (!database.close()) {
      Log.e(TAG,"String_Node_Str");
    }
  }
}
Program: 160277
Project: 160277
Buggy source:
@Override public void deleteCookie(String name){
}

Fixed version (ground truth):
@Override public void deleteCookie(URL url){
}
Program: 160278
Project: 160278
Buggy source:
protected Document createDocWithProperties(Map<String,Object> properties1) throws CouchbaseLiteException {
  Document doc1=database.createDocument();
  UnsavedRevision revUnsaved=doc1.createRevision();
  revUnsaved.setUserProperties(properties1);
  SavedRevision rev=revUnsaved.save();
  assertNotNull(rev);
  return doc1;
}

Fixed version (ground truth):
protected Document createDocWithProperties(Map<String,Object> props,Database db) throws CouchbaseLiteException {
  Document doc=db.createDocument();
  UnsavedRevision revUnsaved=doc.createRevision();
  revUnsaved.setUserProperties(props);
  SavedRevision rev=revUnsaved.save();
  assertNotNull(rev);
  return doc;
}
Program: 160280
Project: 160280
Buggy source:
private void putReplicationOnline(Replication replication) throws InterruptedException {
  Log.d(Log.TAG,"String_Node_Str",replication);
  final CountDownLatch wentOnline=new CountDownLatch(1);
  Replication.ChangeListener changeListener=new ReplicationActiveObserver(wentOnline);
  replication.addChangeListener(changeListener);
  replication.goOnline();
  boolean succeeded=wentOnline.await(30,TimeUnit.SECONDS);
  assertTrue(succeeded);
  replication.removeChangeListener(changeListener);
  Log.d(Log.TAG,"String_Node_Str",replication);
}

Fixed version (ground truth):
private void putReplicationOnline(Replication replication) throws InterruptedException {
  Log.d(Log.TAG,"String_Node_Str",replication);
  final CountDownLatch wentOnline=new CountDownLatch(1);
  Replication.ChangeListener changeListener=new ReplicationRunningObserver(wentOnline);
  replication.addChangeListener(changeListener);
  replication.goOnline();
  boolean succeeded=wentOnline.await(30,TimeUnit.SECONDS);
  assertTrue(succeeded);
  replication.removeChangeListener(changeListener);
  Log.d(Log.TAG,"String_Node_Str",replication);
}
Program: 160281
Project: 160281
Buggy source:
public void testGetUserAgent(){
  String userAgent=manager.getUserAgent();
  assertTrue(userAgent.indexOf(Manager.PRODUCT_NAME + "String_Node_Str" + Version.SYNC_PROTOCOL_VERSION) != -1);
}

Fixed version (ground truth):
public void testGetUserAgent(){
  String userAgent=Manager.getUserAgent();
  assertTrue(userAgent.indexOf(Manager.PRODUCT_NAME + "String_Node_Str" + Version.SYNC_PROTOCOL_VERSION) != -1);
}
Program: 160282
Project: 160282
Buggy source:
public void failingTestChangeTrackerContinuous() throws Throwable {
  final CountDownLatch changeTrackerFinishedSignal=new CountDownLatch(1);
  final CountDownLatch changeReceivedSignal=new CountDownLatch(1);
  URL testURL=getReplicationURL();
  ChangeTrackerClient client=new ChangeTrackerClient(){
    @Override public String getUserAgent(){
      return manager.getUserAgent();
    }
    @Override public void changeTrackerStopped(    ChangeTracker tracker){
      changeTrackerFinishedSignal.countDown();
    }
    @Override public void changeTrackerFinished(    ChangeTracker tracker){
    }
    @Override public void changeTrackerCaughtUp(){
    }
    @Override public void changeTrackerReceivedChange(    Map<String,Object> change){
      Object seq=change.get("String_Node_Str");
      changeReceivedSignal.countDown();
    }
    @Override public HttpClient getHttpClient(){
      return new DefaultHttpClient();
    }
  }
;
  final ChangeTracker changeTracker=new ChangeTracker(testURL,ChangeTracker.ChangeTrackerMode.Continuous,false,0,client);
  changeTracker.setUsePOST(isTestingAgainstSyncGateway());
  changeTracker.start();
  try {
    boolean success=changeReceivedSignal.await(300,TimeUnit.SECONDS);
    assertTrue(success);
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
  changeTracker.stop();
  try {
    boolean success=changeTrackerFinishedSignal.await(300,TimeUnit.SECONDS);
    assertTrue(success);
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void failingTestChangeTrackerContinuous() throws Throwable {
  final CountDownLatch changeTrackerFinishedSignal=new CountDownLatch(1);
  final CountDownLatch changeReceivedSignal=new CountDownLatch(1);
  URL testURL=getReplicationURL();
  ChangeTrackerClient client=new ChangeTrackerClient(){
    @Override public void changeTrackerStopped(    ChangeTracker tracker){
      changeTrackerFinishedSignal.countDown();
    }
    @Override public void changeTrackerFinished(    ChangeTracker tracker){
    }
    @Override public void changeTrackerCaughtUp(){
    }
    @Override public void changeTrackerReceivedChange(    Map<String,Object> change){
      Object seq=change.get("String_Node_Str");
      changeReceivedSignal.countDown();
    }
    @Override public HttpClient getHttpClient(){
      return new DefaultHttpClient();
    }
  }
;
  final ChangeTracker changeTracker=new ChangeTracker(testURL,ChangeTracker.ChangeTrackerMode.Continuous,false,0,client);
  changeTracker.setUsePOST(isTestingAgainstSyncGateway());
  changeTracker.start();
  try {
    boolean success=changeReceivedSignal.await(300,TimeUnit.SECONDS);
    assertTrue(success);
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
  changeTracker.stop();
  try {
    boolean success=changeTrackerFinishedSignal.await(300,TimeUnit.SECONDS);
    assertTrue(success);
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
}
Program: 160286
Project: 160286
Buggy source:
@Override public long insertOrThrow(String table,String nullColumnHack,ContentValues values) throws SQLException {
  try {
    return database.insertOrThrow(table,nullColumnHack,toContentValues(values));
  }
 catch (  com.couchbase.lite.database.SQLException e) {
    throw new SQLException(e);
  }
}

Fixed version (ground truth):
@Override public long insertOrThrow(String table,String nullColumnHack,ContentValues values) throws SQLException {
  try {
    return database.insertOrThrow(table,nullColumnHack,toContentValues(values));
  }
 catch (  com.couchbase.lite.database.SQLException e) {
    if (e instanceof com.couchbase.lite.database.sqlite.exception.SQLiteConstraintException)     throw new SQLException(SQLException.SQLITE_CONSTRAINT,e);
 else     throw new SQLException(e);
  }
}
Program: 160287
Project: 160287
Buggy source:
@Override public long insertOrThrow(String table,String nullColumnHack,ContentValues values) throws SQLException {
  try {
    return database.insertOrThrow(table,nullColumnHack,AndroidSQLiteHelper.toAndroidContentValues(values));
  }
 catch (  android.database.SQLException e) {
    throw new SQLException(e);
  }
}

Fixed version (ground truth):
@Override public long insertOrThrow(String table,String nullColumnHack,ContentValues values) throws SQLException {
  try {
    return database.insertOrThrow(table,nullColumnHack,AndroidSQLiteHelper.toAndroidContentValues(values));
  }
 catch (  android.database.SQLException e) {
    if (e instanceof android.database.sqlite.SQLiteConstraintException)     throw new SQLException(SQLException.SQLITE_CONSTRAINT,e);
 else     throw new SQLException(e);
  }
}
Program: 160288
Project: 160288
Buggy source:
public void testChangeNotification() throws CouchbaseLiteException {
  Database.ChangeListener changeListener=new Database.ChangeListener(){
    @Override public void changed(    Database.ChangeEvent event){
      changeNotifications++;
    }
  }
;
  database.addChangeListener(changeListener);
  Map<String,Object> documentProperties=new HashMap<String,Object>();
  documentProperties.put("String_Node_Str",1);
  documentProperties.put("String_Node_Str",false);
  documentProperties.put("String_Node_Str","String_Node_Str");
  Body body=new Body(documentProperties);
  RevisionInternal rev1=new RevisionInternal(body);
  Status status=new Status();
  rev1=database.putRevision(rev1,null,false,status);
  assertEquals(1,changeNotifications);
}

Fixed version (ground truth):
public void testChangeNotification() throws CouchbaseLiteException {
  changeNotifications=0;
  Database.ChangeListener changeListener=new Database.ChangeListener(){
    @Override public void changed(    Database.ChangeEvent event){
      changeNotifications++;
    }
  }
;
  database.addChangeListener(changeListener);
  Map<String,Object> documentProperties=new HashMap<String,Object>();
  documentProperties.put("String_Node_Str",1);
  documentProperties.put("String_Node_Str",false);
  documentProperties.put("String_Node_Str","String_Node_Str");
  Body body=new Body(documentProperties);
  RevisionInternal rev1=new RevisionInternal(body);
  Status status=new Status();
  rev1=database.putRevision(rev1,null,false,status);
  assertEquals(1,changeNotifications);
}
Program: 160293
Project: 160293
Buggy source:
public double runOne(final int numberOfDocuments,final int sizeOfDocuments) throws Exception {
  String[] bigObj=new String[sizeOfDocuments];
  for (int i=0; i < sizeOfDocuments; i++) {
    bigObj[i]=_propertyValue;
  }
  final Map<String,Object> props=new HashMap<String,Object>();
  props.put("String_Node_Str",bigObj);
  String docIdTimestamp=Long.toString(System.currentTimeMillis());
  for (int i=0; i < numberOfDocuments; i++) {
    String docId=String.format("String_Node_Str",i,docIdTimestamp);
    try {
      addDocWithId(docId,props,"String_Node_Str",false);
    }
 catch (    IOException ioex) {
      Log.v("String_Node_Str",TAG + "String_Node_Str",ioex);
      fail();
    }
  }
  URL remote=getReplicationURL();
  long startMillis=System.currentTimeMillis();
  final Replication repl=database.createPushReplication(remote);
  repl.setContinuous(false);
  if (!isSyncGateway(remote)) {
    repl.setCreateTarget(true);
    Assert.assertTrue(repl.shouldCreateTarget());
  }
  Log.v("String_Node_Str",TAG + "String_Node_Str" + repl);
  runReplication(repl);
  Log.v("String_Node_Str",TAG + "String_Node_Str" + repl);
  double executionTime=Long.valueOf(System.currentTimeMillis() - startMillis);
  Log.v("String_Node_Str",TAG + "String_Node_Str" + executionTime+ "String_Node_Str"+ numberOfDocuments+ "String_Node_Str"+ sizeOfDocuments);
  return executionTime;
}

Fixed version (ground truth):
public double runOne(final int numberOfDocuments,final int sizeOfDocuments) throws Exception {
  char[] array=new char[sizeOfDocuments];
  Arrays.fill(array,'*');
  String body=new String(array);
  final Map<String,Object> props=new HashMap<String,Object>();
  props.put("String_Node_Str",body);
  String docIdTimestamp=Long.toString(System.currentTimeMillis());
  for (int i=0; i < numberOfDocuments; i++) {
    String docId=String.format("String_Node_Str",i,docIdTimestamp);
    try {
      addDocWithId(docId,props,null,false);
    }
 catch (    IOException ioex) {
      Log.v("String_Node_Str",TAG + "String_Node_Str",ioex);
      fail();
    }
  }
  URL remote=getReplicationURL();
  long startMillis=System.currentTimeMillis();
  final Replication repl=database.createPushReplication(remote);
  repl.setContinuous(false);
  if (!isSyncGateway(remote)) {
    repl.setCreateTarget(true);
    Assert.assertTrue(repl.shouldCreateTarget());
  }
  Log.v("String_Node_Str",TAG + "String_Node_Str" + repl);
  runReplication(repl);
  Log.v("String_Node_Str",TAG + "String_Node_Str" + repl);
  double executionTime=Long.valueOf(System.currentTimeMillis() - startMillis);
  Log.v("String_Node_Str",TAG + "String_Node_Str" + executionTime+ "String_Node_Str"+ numberOfDocuments+ "String_Node_Str"+ sizeOfDocuments);
  return executionTime;
}
Program: 160295
Project: 160295
Buggy source:
public double runOne(int numberOfDocuments,int sizeOfDocuments) throws CouchbaseLiteException {
  return 0;
}

Fixed version (ground truth):
public double runOne(int numberOfDocuments,int sizeOfDocuments) throws Exception {
  return 0;
}
Program: 160296
Project: 160296
Buggy source:
@Override public MockResponse dispatch(RecordedRequest request) throws InterruptedException {
  System.out.println(String.format("String_Node_Str",request));
  for (  String pathRegex : queueMap.keySet()) {
    if (regexMatches(pathRegex,request.getPath())) {
      recordRequest(pathRegex,request);
      BlockingQueue<SmartMockResponse> responseQueue=queueMap.get(pathRegex);
      if (responseQueue == null) {
        String msg=String.format("String_Node_Str",pathRegex);
        throw new RuntimeException(msg);
      }
      if (!responseQueue.isEmpty()) {
        SmartMockResponse smartMockResponse=responseQueue.take();
        if (smartMockResponse.delayMs() > 0) {
          System.out.println(String.format("String_Node_Str",smartMockResponse.delayMs()));
          Thread.sleep(smartMockResponse.delayMs());
          System.out.println("String_Node_Str");
        }
        if (smartMockResponse.isSticky()) {
          responseQueue.put(smartMockResponse);
        }
        MockResponse mockResponse=smartMockResponse.generateMockResponse(request);
        System.out.println(String.format("String_Node_Str",mockResponse.getBody()));
        addHeaders(mockResponse);
        return mockResponse;
      }
 else {
        return new MockResponse().setResponseCode(HttpURLConnection.HTTP_NOT_ACCEPTABLE);
      }
    }
  }
  return new MockResponse().setResponseCode(HttpURLConnection.HTTP_NOT_ACCEPTABLE);
}

Fixed version (ground truth):
@Override public MockResponse dispatch(RecordedRequest request) throws InterruptedException {
  System.out.println(String.format("String_Node_Str",request));
  for (  String pathRegex : queueMap.keySet()) {
    if (regexMatches(pathRegex,request.getPath())) {
      recordRequest(pathRegex,request);
      BlockingQueue<SmartMockResponse> responseQueue=queueMap.get(pathRegex);
      if (responseQueue == null) {
        String msg=String.format("String_Node_Str",pathRegex);
        throw new RuntimeException(msg);
      }
      if (!responseQueue.isEmpty()) {
        SmartMockResponse smartMockResponse=responseQueue.take();
        if (smartMockResponse.isSticky()) {
          responseQueue.put(smartMockResponse);
        }
        if (smartMockResponse.delayMs() > 0) {
          System.out.println(String.format("String_Node_Str",smartMockResponse.delayMs()));
          Thread.sleep(smartMockResponse.delayMs());
          System.out.println("String_Node_Str");
        }
        MockResponse mockResponse=smartMockResponse.generateMockResponse(request);
        System.out.println(String.format("String_Node_Str",mockResponse.getBody()));
        addHeaders(mockResponse);
        return mockResponse;
      }
 else {
        return new MockResponse().setResponseCode(HttpURLConnection.HTTP_NOT_ACCEPTABLE);
      }
    }
  }
  return new MockResponse().setResponseCode(HttpURLConnection.HTTP_NOT_ACCEPTABLE);
}
Program: 160297
Project: 160297
Buggy source:
public MockDocumentGet(MockDocument mockDocument){
  this();
  this.docId=mockDocument.getDocId();
  this.rev=mockDocument.getDocRev();
  this.jsonMap=mockDocument.getJsonMap();
  this.revHistoryMap=new HashMap<String,Object>();
}

Fixed version (ground truth):
public MockDocumentGet(MockDocument mockDocument){
  this();
  this.docId=mockDocument.getDocId();
  this.rev=mockDocument.getDocRev();
  this.jsonMap=mockDocument.getJsonMap();
}
Program: 160300
Project: 160300
Buggy source:
private boolean isSyncGateway(URL remote){
  return (remote.getPort() == 4984 || remote.getPort() == 4984);
}

Fixed version (ground truth):
private boolean isSyncGateway(URL remote){
  return (remote.getPort() == 4984 || remote.getPort() == 80);
}
Program: 160301
Project: 160301
Buggy source:
public List<HttpRequest> getCapturedRequests(){
  List<HttpRequest> snapshot=new ArrayList<HttpRequest>();
  snapshot.addAll(capturedRequests);
  return snapshot;
}

Fixed version (ground truth):
public List<HttpRequest> getCapturedRequests(){
  return capturedRequests;
}