nus-yam/ex-repair huggingface dataset:
Program: 152678
Project: 152678
Buggy source:
public static ServletSecurityMetaData parse(XMLStreamReader reader) throws XMLStreamException {
  ServletSecurityMetaData servletSecurity=new ServletSecurityMetaData();
  while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
    final Element element=Element.forName(reader.getLocalName());
switch (element) {
case HTTP_METHOD_CONSTRAINT:
      List<HttpMethodConstraintMetaData> httpMethodConstraints=servletSecurity.getHttpMethodConstraints();
    if (httpMethodConstraints == null) {
      httpMethodConstraints=new ArrayList<HttpMethodConstraintMetaData>();
      servletSecurity.setHttpMethodConstraints(httpMethodConstraints);
    }
  httpMethodConstraints.add(HttpMethodConstraintMetaDataParser.parse(reader));
break;
case EMPTY_ROLE_SEMANTIC:
servletSecurity.setEmptyRoleSemantic(EmptyRoleSemanticType.valueOf(getElementText(reader)));
break;
case TRANSPORT_GUARANTEE:
servletSecurity.setTransportGuarantee(TransportGuaranteeType.valueOf(getElementText(reader)));
break;
case ROLE_ALLOWED:
List<String> rolesAllowed=servletSecurity.getRolesAllowed();
if (rolesAllowed == null) {
rolesAllowed=new ArrayList<String>();
servletSecurity.setRolesAllowed(rolesAllowed);
}
rolesAllowed.add(getElementText(reader));
break;
default :
throw unexpectedElement(reader);
}
}
return servletSecurity;
}

Fixed version (ground truth):
public static ServletSecurityMetaData parse(XMLStreamReader reader) throws XMLStreamException {
  ServletSecurityMetaData servletSecurity=new ServletSecurityMetaData();
  while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
    final Element element=Element.forName(reader.getLocalName());
switch (element) {
case HTTP_METHOD_CONSTRAINT:
      List<HttpMethodConstraintMetaData> httpMethodConstraints=servletSecurity.getHttpMethodConstraints();
    if (httpMethodConstraints == null) {
      httpMethodConstraints=new ArrayList<HttpMethodConstraintMetaData>();
      servletSecurity.setHttpMethodConstraints(httpMethodConstraints);
    }
  httpMethodConstraints.add(HttpMethodConstraintMetaDataParser.parse(reader));
break;
case EMPTY_ROLE_SEMANTIC:
try {
servletSecurity.setEmptyRoleSemantic(EmptyRoleSemanticType.valueOf(getElementText(reader)));
}
 catch (IllegalArgumentException e) {
throw unexpectedValue(reader,e);
}
break;
case TRANSPORT_GUARANTEE:
try {
servletSecurity.setTransportGuarantee(TransportGuaranteeType.valueOf(getElementText(reader)));
}
 catch (IllegalArgumentException e) {
throw unexpectedValue(reader,e);
}
break;
case ROLE_ALLOWED:
List<String> rolesAllowed=servletSecurity.getRolesAllowed();
if (rolesAllowed == null) {
rolesAllowed=new ArrayList<String>();
servletSecurity.setRolesAllowed(rolesAllowed);
}
rolesAllowed.add(getElementText(reader));
break;
default :
throw unexpectedElement(reader);
}
}
return servletSecurity;
}
Program: 152680
Project: 152680
Buggy source:
public static VariableMetaData parse(XMLStreamReader reader) throws XMLStreamException {
  VariableMetaData variable=new VariableMetaData();
  final int count=reader.getAttributeCount();
  for (int i=0; i < count; i++) {
    final String value=reader.getAttributeValue(i);
    if (attributeHasNamespace(reader,i)) {
      continue;
    }
    final Attribute attribute=Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case ID:
{
        variable.setId(value);
        break;
      }
default :
    throw unexpectedAttribute(reader,i);
}
}
DescriptionsImpl descriptions=new DescriptionsImpl();
while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
if (DescriptionsMetaDataParser.parse(reader,descriptions)) {
  if (variable.getDescriptions() == null) {
    variable.setDescriptions(descriptions);
  }
  continue;
}
final Element element=Element.forName(reader.getLocalName());
switch (element) {
case NAME_GIVEN:
  variable.setNameGiven(getElementText(reader));
break;
case NAME_FROM_ATTRIBUTE:
variable.setNameFromAttribute(getElementText(reader));
break;
case VARIABLE_CLASS:
variable.setVariableClass(getElementText(reader));
break;
case DECLARE:
variable.setDeclare(getElementText(reader));
break;
case SCOPE:
variable.setScope(VariableScopeType.valueOf(getElementText(reader)));
break;
default :
throw unexpectedElement(reader);
}
}
return variable;
}

Fixed version (ground truth):
public static VariableMetaData parse(XMLStreamReader reader) throws XMLStreamException {
  VariableMetaData variable=new VariableMetaData();
  final int count=reader.getAttributeCount();
  for (int i=0; i < count; i++) {
    final String value=reader.getAttributeValue(i);
    if (attributeHasNamespace(reader,i)) {
      continue;
    }
    final Attribute attribute=Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case ID:
{
        variable.setId(value);
        break;
      }
default :
    throw unexpectedAttribute(reader,i);
}
}
DescriptionsImpl descriptions=new DescriptionsImpl();
while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
if (DescriptionsMetaDataParser.parse(reader,descriptions)) {
  if (variable.getDescriptions() == null) {
    variable.setDescriptions(descriptions);
  }
  continue;
}
final Element element=Element.forName(reader.getLocalName());
switch (element) {
case NAME_GIVEN:
  variable.setNameGiven(getElementText(reader));
break;
case NAME_FROM_ATTRIBUTE:
variable.setNameFromAttribute(getElementText(reader));
break;
case VARIABLE_CLASS:
variable.setVariableClass(getElementText(reader));
break;
case DECLARE:
variable.setDeclare(getElementText(reader));
break;
case SCOPE:
try {
variable.setScope(VariableScopeType.valueOf(getElementText(reader)));
}
 catch (IllegalArgumentException e) {
throw unexpectedValue(reader,e);
}
break;
default :
throw unexpectedElement(reader);
}
}
return variable;
}
Program: 152682
Project: 152682
Buggy source:
public static SessionConfigMetaData parse(XMLStreamReader reader) throws XMLStreamException {
  SessionConfigMetaData sessionConfig=new SessionConfigMetaData();
  final int count=reader.getAttributeCount();
  for (int i=0; i < count; i++) {
    final String value=reader.getAttributeValue(i);
    if (attributeHasNamespace(reader,i)) {
      continue;
    }
    final Attribute attribute=Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case ID:
{
        sessionConfig.setId(value);
        break;
      }
default :
    throw unexpectedAttribute(reader,i);
}
}
while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
final Element element=Element.forName(reader.getLocalName());
switch (element) {
case SESSION_TIMEOUT:
  try {
    sessionConfig.setSessionTimeout(Integer.valueOf(getElementText(reader)));
  }
 catch (  NumberFormatException e) {
    throw unexpectedValue(reader,e);
  }
break;
case COOKIE_CONFIG:
sessionConfig.setCookieConfig(CookieConfigMetaDataParser.parse(reader));
break;
case TRACKING_MODE:
List<SessionTrackingModeType> trackingModes=sessionConfig.getSessionTrackingModes();
if (trackingModes == null) {
trackingModes=new ArrayList<SessionTrackingModeType>();
sessionConfig.setSessionTrackingModes(trackingModes);
}
trackingModes.add(SessionTrackingModeType.valueOf(getElementText(reader)));
break;
default :
throw unexpectedElement(reader);
}
}
return sessionConfig;
}

Fixed version (ground truth):
public static SessionConfigMetaData parse(XMLStreamReader reader) throws XMLStreamException {
  SessionConfigMetaData sessionConfig=new SessionConfigMetaData();
  final int count=reader.getAttributeCount();
  for (int i=0; i < count; i++) {
    final String value=reader.getAttributeValue(i);
    if (attributeHasNamespace(reader,i)) {
      continue;
    }
    final Attribute attribute=Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case ID:
{
        sessionConfig.setId(value);
        break;
      }
default :
    throw unexpectedAttribute(reader,i);
}
}
while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
final Element element=Element.forName(reader.getLocalName());
switch (element) {
case SESSION_TIMEOUT:
  try {
    sessionConfig.setSessionTimeout(Integer.valueOf(getElementText(reader)));
  }
 catch (  NumberFormatException e) {
    throw unexpectedValue(reader,e);
  }
break;
case COOKIE_CONFIG:
sessionConfig.setCookieConfig(CookieConfigMetaDataParser.parse(reader));
break;
case TRACKING_MODE:
List<SessionTrackingModeType> trackingModes=sessionConfig.getSessionTrackingModes();
if (trackingModes == null) {
trackingModes=new ArrayList<SessionTrackingModeType>();
sessionConfig.setSessionTrackingModes(trackingModes);
}
try {
trackingModes.add(SessionTrackingModeType.valueOf(getElementText(reader)));
}
 catch (IllegalArgumentException e) {
throw unexpectedValue(reader,e);
}
break;
default :
throw unexpectedElement(reader);
}
}
return sessionConfig;
}
Program: 152683
Project: 152683
Buggy source:
public static UserDataConstraintMetaData parse(XMLStreamReader reader) throws XMLStreamException {
  UserDataConstraintMetaData userDataConstraint=new UserDataConstraintMetaData();
  final int count=reader.getAttributeCount();
  for (int i=0; i < count; i++) {
    final String value=reader.getAttributeValue(i);
    if (attributeHasNamespace(reader,i)) {
      continue;
    }
    final Attribute attribute=Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case ID:
{
        userDataConstraint.setId(value);
        break;
      }
default :
    throw unexpectedAttribute(reader,i);
}
}
DescriptionsImpl descriptions=new DescriptionsImpl();
while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
if (DescriptionsMetaDataParser.parse(reader,descriptions)) {
  if (userDataConstraint.getDescriptions() == null) {
    userDataConstraint.setDescriptions(descriptions);
  }
  continue;
}
final Element element=Element.forName(reader.getLocalName());
switch (element) {
case TRANSPORT_GUARANTEE:
  userDataConstraint.setTransportGuarantee(TransportGuaranteeType.valueOf(getElementText(reader)));
break;
default :
throw unexpectedElement(reader);
}
}
return userDataConstraint;
}

Fixed version (ground truth):
public static UserDataConstraintMetaData parse(XMLStreamReader reader) throws XMLStreamException {
  UserDataConstraintMetaData userDataConstraint=new UserDataConstraintMetaData();
  final int count=reader.getAttributeCount();
  for (int i=0; i < count; i++) {
    final String value=reader.getAttributeValue(i);
    if (attributeHasNamespace(reader,i)) {
      continue;
    }
    final Attribute attribute=Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
case ID:
{
        userDataConstraint.setId(value);
        break;
      }
default :
    throw unexpectedAttribute(reader,i);
}
}
DescriptionsImpl descriptions=new DescriptionsImpl();
while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
if (DescriptionsMetaDataParser.parse(reader,descriptions)) {
  if (userDataConstraint.getDescriptions() == null) {
    userDataConstraint.setDescriptions(descriptions);
  }
  continue;
}
final Element element=Element.forName(reader.getLocalName());
switch (element) {
case TRANSPORT_GUARANTEE:
  try {
    userDataConstraint.setTransportGuarantee(TransportGuaranteeType.valueOf(getElementText(reader)));
  }
 catch (  IllegalArgumentException e) {
    throw unexpectedValue(reader,e);
  }
break;
default :
throw unexpectedElement(reader);
}
}
return userDataConstraint;
}
Program: 152684
Project: 152684
Buggy source:
public void merge(final ApplicationClientMetaData override,final ApplicationClientMetaData original){
  IdMetaDataImplWithDescriptionGroupMerger.merge(this,override,original);
  if (override != null) {
    this.metadataComplete=override.isMetadataComplete();
  }
  if (override != null && override.getEnvironmentRefsGroupMetaData() != null) {
    this.environmentRefsGroupMetaData.merge(override.getEnvironmentRefsGroupMetaData(),original.getEnvironmentRefsGroupMetaData());
  }
 else   if (original != null && original.getEnvironmentRefsGroupMetaData() != null) {
    this.environmentRefsGroupMetaData=original.getEnvironmentRefsGroupMetaData();
  }
  if (override != null && override.getCallbackHandler() != null) {
    this.callbackHandler=override.getCallbackHandler();
  }
 else   if (original != null && original.getCallbackHandler() != null) {
    this.callbackHandler=original.getCallbackHandler();
  }
  if (override != null && override.getVersion() != null) {
    version=override.getVersion();
  }
 else   if (original != null && original.getVersion() != null) {
    version=original.getVersion();
  }
}

Fixed version (ground truth):
public void merge(final ApplicationClientMetaData override,final ApplicationClientMetaData original){
  IdMetaDataImplWithDescriptionGroupMerger.merge(this,override,original);
  if (override != null) {
    this.metadataComplete=override.isMetadataComplete();
  }
 else   if (original != null) {
    this.metadataComplete=original.isMetadataComplete();
  }
  if (override != null && override.getEnvironmentRefsGroupMetaData() != null) {
    this.environmentRefsGroupMetaData.merge(override.getEnvironmentRefsGroupMetaData(),original.getEnvironmentRefsGroupMetaData());
  }
 else   if (original != null && original.getEnvironmentRefsGroupMetaData() != null) {
    this.environmentRefsGroupMetaData=original.getEnvironmentRefsGroupMetaData();
  }
  if (override != null && override.getCallbackHandler() != null) {
    this.callbackHandler=override.getCallbackHandler();
  }
 else   if (original != null && original.getCallbackHandler() != null) {
    this.callbackHandler=original.getCallbackHandler();
  }
  if (override != null && override.getVersion() != null) {
    version=override.getVersion();
  }
 else   if (original != null && original.getVersion() != null) {
    version=original.getVersion();
  }
}
Program: 152685
Project: 152685
Buggy source:
private final void assertUnknownOrMessageDrivenBean(){
  throw new RuntimeException("String_Node_Str");
}

Fixed version (ground truth):
private final void assertUnknownOrMessageDrivenBean(){
  if (getEjbType() != null && getEjbType() != EjbType.MESSAGE_DRIVEN)   throw new IllegalStateException("String_Node_Str" + this + "String_Node_Str"+ getEjbType());
}
Program: 152686
Project: 152686
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void merge(MessageDrivenBeanMetaData override,MessageDrivenBeanMetaData original){
  super.merge(override,original);
  MessageDrivenBean31MetaData overrideMetaData=(MessageDrivenBean31MetaData)override;
  MessageDrivenBean31MetaData originalMetaData=(MessageDrivenBean31MetaData)original;
  Collection<TimerMetaData> originalTimers=original == null ? null : originalMetaData.timers;
  Collection<TimerMetaData> overrideTimers=override == null ? null : overrideMetaData.timers;
  if (originalTimers != null || overrideTimers != null) {
    if (this.timers == null) {
      this.timers=new ArrayList<TimerMetaData>();
    }
    MergeUtil.merge(this.timers,overrideTimers,originalTimers);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void merge(JBossGenericBeanMetaData override,MessageDrivenBeanMetaData original){
  super.merge(override,original);
  MessageDrivenBean31MetaData originalMetaData=(MessageDrivenBean31MetaData)original;
  Collection<TimerMetaData> originalTimers=original == null ? null : originalMetaData.timers;
  Collection<TimerMetaData> overrideTimers=override == null ? null : override.getTimers();
  if (originalTimers != null || overrideTimers != null) {
    if (this.timers == null) {
      this.timers=new ArrayList<TimerMetaData>();
    }
    MergeUtil.merge(this.timers,overrideTimers,originalTimers);
  }
}
Program: 152688
Project: 152688
Buggy source:
/** 
 * Tests that only valid session-type values (stateless, stateful, singleton) for session beans are allowed in ejb-jar.xml
 * @throws Exception
 */
@Test public void testInvalidSessionTypeInEjbJarXml() throws Exception {
  try {
    EjbJarMetaData ejb31=unmarshal(EjbJarMetaData.class,"String_Node_Str");
    fail("String_Node_Str");
  }
 catch (  JBossXBException jbxbe) {
    logger.debug("String_Node_Str",jbxbe);
  }
}

Fixed version (ground truth):
/** 
 * Tests that only valid session-type values (stateless, stateful, singleton) for session beans are allowed in ejb-jar.xml
 * @throws Exception
 */
@Test public void testInvalidSessionTypeInEjbJarXml() throws Exception {
  try {
    EjbJarMetaData ejb31=unmarshal(EjbJarMetaData.class,"String_Node_Str");
    fail("String_Node_Str");
  }
 catch (  XMLStreamException e) {
    logger.debug("String_Node_Str",e);
    String message=e.getMessage();
    assertTrue(message.contains("String_Node_Str"));
  }
}
Program: 152689
Project: 152689
Buggy source:
public int getBlockTint(fb world,int original,int x,int y,int z,TintType ttype){
  double temperature=0.0;
  double humidity=0.0;
switch (ttype) {
case GRASS:
    world.a().a(x,z,1,1);
  temperature=world.a().a[0];
humidity=world.a().b[0];
try {
return colorMult(original,hx.a(temperature,humidity));
}
 catch (Throwable t) {
System.err.println("String_Node_Str" + temperature + "String_Node_Str"+ humidity);
t.printStackTrace();
}
case FOLIAGE:
world.a().a(x,z,1,1);
temperature=world.a().a[0];
humidity=world.a().b[0];
try {
return colorMult(original,je.a(temperature,humidity));
}
 catch (Throwable t) {
System.err.println("String_Node_Str" + temperature + "String_Node_Str"+ humidity);
t.printStackTrace();
}
case PINE:
return colorMult(original,je.a());
case BIRCH:
return colorMult(original,je.b());
case REDSTONE:
int blockmeta=world.e(x,y,z);
float floatmeta=(float)blockmeta / 15F;
float r=floatmeta * 0.6F + 0.4F;
if (blockmeta == 0) {
r=0.0F;
}
float g=floatmeta * floatmeta * 0.7F - 0.5F;
float b=floatmeta * floatmeta * 0.6F - 0.7F;
if (g < 0.0F) {
g=0.0F;
}
if (b < 0.0F) {
b=0.0F;
}
int tint=((int)(b * 0xff)) + (((int)(g * 0xff)) << 8) + (((int)(r * 0xff)) << 16);
return colorMult(original,tint);
default :
return original;
}
}

Fixed version (ground truth):
public int getBlockTint(fb world,int original,int x,int y,int z,TintType ttype){
  if (true)   return original;
  double temperature=0.0;
  double humidity=0.0;
switch (ttype) {
case GRASS:
synchronized (world) {
      world.a().a(x,z,1,1);
      temperature=world.a().a[0];
      humidity=world.a().b[0];
    }
  try {
    return colorMult(original,hx.a(temperature,humidity));
  }
 catch (  Throwable t) {
    System.err.println("String_Node_Str" + temperature + "String_Node_Str"+ humidity);
    t.printStackTrace();
  }
case FOLIAGE:
synchronized (world) {
  world.a().a(x,z,1,1);
  temperature=world.a().a[0];
  humidity=world.a().b[0];
}
try {
return colorMult(original,je.a(temperature,humidity));
}
 catch (Throwable t) {
System.err.println("String_Node_Str" + temperature + "String_Node_Str"+ humidity);
t.printStackTrace();
}
case PINE:
return colorMult(original,je.a());
case BIRCH:
return colorMult(original,je.b());
case REDSTONE:
int blockmeta=world.e(x,y,z);
float floatmeta=(float)blockmeta / 15F;
float r=floatmeta * 0.6F + 0.4F;
if (blockmeta == 0) {
r=0.0F;
}
float g=floatmeta * floatmeta * 0.7F - 0.5F;
float b=floatmeta * floatmeta * 0.6F - 0.7F;
if (g < 0.0F) {
g=0.0F;
}
if (b < 0.0F) {
b=0.0F;
}
int tint=((int)(b * 0xff)) + (((int)(g * 0xff)) << 8) + (((int)(r * 0xff)) << 16);
return colorMult(original,tint);
default :
return original;
}
}
Program: 152690
Project: 152690
Buggy source:
private void restoreDefaultAPN(int subId){
  SQLiteDatabase db=mOpenHelper.getWritableDatabase();
  try {
    db.delete(CARRIERS_TABLE,null,null);
  }
 catch (  SQLException e) {
    loge("String_Node_Str" + e);
  }
  setPreferredApnId((long)INVALID_APN_ID,subId);
  mOpenHelper.initDatabase(db);
}

Fixed version (ground truth):
private void restoreDefaultAPN(int subId){
  SQLiteDatabase db=mOpenHelper.getWritableDatabase();
  TelephonyManager mTm=(TelephonyManager)getContext().getSystemService(Context.TELEPHONY_SERVICE);
  SubscriptionManager sm=SubscriptionManager.from(getContext());
  String selSubOperatorNumeric=mTm.getSimOperator(subId);
  String otherSubOperatorNumeric=null;
  String where=null;
  List<SubscriptionInfo> subInfoList=sm.getActiveSubscriptionInfoList();
  int simCountWithSameNumeric=0;
  if (subInfoList != null && subInfoList.size() > 1) {
    where="String_Node_Str";
    for (    SubscriptionInfo subInfo : subInfoList) {
      if (subId != subInfo.getSubscriptionId()) {
        otherSubOperatorNumeric=mTm.getSimOperator(subInfo.getSubscriptionId());
        if (!otherSubOperatorNumeric.equalsIgnoreCase(selSubOperatorNumeric)) {
          where=where + "String_Node_Str" + otherSubOperatorNumeric+ "String_Node_Str";
        }
 else {
          simCountWithSameNumeric++;
        }
      }
    }
    where=where + "String_Node_Str" + USER_EDITED+ "String_Node_Str";
  }
  if (simCountWithSameNumeric == subInfoList.size() - 1) {
    where=null;
  }
  log("String_Node_Str" + where);
  try {
    db.delete(CARRIERS_TABLE,where,null);
  }
 catch (  SQLException e) {
    loge("String_Node_Str" + e);
  }
  setPreferredApnId((long)INVALID_APN_ID,subId);
  mOpenHelper.initDatabase(db);
}
Program: 152704
Project: 152704
Buggy source:
@Override public ParcelFileDescriptor openFile(Uri uri,String mode) throws FileNotFoundException {
  ParcelFileDescriptor fd;
  int match=sURLMatcher.match(uri);
  if (Log.isLoggable(TAG,Log.VERBOSE)) {
    Log.d(TAG,"String_Node_Str" + uri + "String_Node_Str"+ mode);
  }
switch (match) {
case MMS_SCRAP_SPACE:
    fd=getTempStoreFd();
  break;
default :
fd=openFileHelper(uri,mode);
}
return fd;
}

Fixed version (ground truth):
@Override public ParcelFileDescriptor openFile(Uri uri,String mode) throws FileNotFoundException {
  ParcelFileDescriptor fd;
  int match=sURLMatcher.match(uri);
  if (Log.isLoggable(TAG,Log.VERBOSE)) {
    Log.d(TAG,"String_Node_Str" + uri + "String_Node_Str"+ mode);
  }
switch (match) {
default :
    fd=openFileHelper(uri,mode);
}
return fd;
}
Program: 152707
Project: 152707
Buggy source:
@Override public ParcelFileDescriptor openFile(Uri uri,String mode) throws FileNotFoundException {
  ParcelFileDescriptor fd;
  int match=sURLMatcher.match(uri);
  if (Log.isLoggable(TAG,Log.VERBOSE)) {
    Log.d(TAG,"String_Node_Str" + uri + "String_Node_Str"+ mode);
  }
switch (match) {
case MMS_SCRAP_SPACE:
    fd=getTempStoreFd();
  break;
default :
fd=openFileHelper(uri,mode);
}
return fd;
}

Fixed version (ground truth):
@Override public ParcelFileDescriptor openFile(Uri uri,String mode) throws FileNotFoundException {
  ParcelFileDescriptor fd;
  int match=sURLMatcher.match(uri);
  if (Log.isLoggable(TAG,Log.VERBOSE)) {
    Log.d(TAG,"String_Node_Str" + uri + "String_Node_Str"+ mode);
  }
switch (match) {
default :
    fd=openFileHelper(uri,mode);
}
return fd;
}
Program: 152713
Project: 152713
Buggy source:
/** 
 * Return the thread ID for this list of recipients IDs.  If no thread exists with this ID, create one and return it.  Callers should always use Threads.getThreadId to access this information.
 */
private synchronized Cursor getThreadId(List<String> recipients){
  String recipientIds=getSpaceSeparatedNumbers(getSortedSet(getAddressIds(recipients)));
  String THREAD_QUERY="String_Node_Str" + "String_Node_Str";
  if (DEBUG) {
    Log.v(LOG_TAG,"String_Node_Str" + THREAD_QUERY);
  }
  SQLiteDatabase db=mOpenHelper.getReadableDatabase();
  Cursor cursor=db.rawQuery(THREAD_QUERY,new String[]{recipientIds});
  if (cursor.getCount() == 0) {
    cursor.close();
    if (DEBUG) {
      Log.v(LOG_TAG,"String_Node_Str");
    }
    insertThread(recipientIds,recipients.size());
    db=mOpenHelper.getReadableDatabase();
    cursor=db.rawQuery(THREAD_QUERY,new String[]{recipientIds});
  }
  if (DEBUG) {
    Log.v(LOG_TAG,"String_Node_Str" + cursor.getCount());
  }
  return cursor;
}

Fixed version (ground truth):
/** 
 * Return the thread ID for this list of recipients IDs.  If no thread exists with this ID, create one and return it.  Callers should always use Threads.getThreadId to access this information.
 */
private synchronized Cursor getThreadId(List<String> recipients){
  String recipientIds=getSpaceSeparatedNumbers(getSortedSet(getAddressIds(recipients)));
  String THREAD_QUERY="String_Node_Str" + "String_Node_Str";
  if (DEBUG) {
    Log.v(LOG_TAG,"String_Node_Str" + THREAD_QUERY + "String_Node_Str"+ recipientIds);
  }
  SQLiteDatabase db=mOpenHelper.getReadableDatabase();
  Cursor cursor=db.rawQuery(THREAD_QUERY,new String[]{recipientIds});
  if (cursor.getCount() == 0) {
    cursor.close();
    if (DEBUG) {
      Log.v(LOG_TAG,"String_Node_Str");
    }
    insertThread(recipientIds,recipients.size());
    db=mOpenHelper.getReadableDatabase();
    cursor=db.rawQuery(THREAD_QUERY,new String[]{recipientIds});
  }
  if (DEBUG) {
    Log.v(LOG_TAG,"String_Node_Str" + cursor.getCount());
  }
  return cursor;
}
Program: 152715
Project: 152715
Buggy source:
/** 
 * Return the canonical address ID for this address.
 */
private long getSingleAddressId(String address){
  boolean isEmail=Mms.isEmailAddress(address);
  String refinedAddress=isEmail ? address.toLowerCase() : address;
  String selection=isEmail ? "String_Node_Str" : String.format("String_Node_Str",(mUseStrictPhoneNumberComparation ? 1 : 0));
  String[] selectionArgs=new String[]{refinedAddress};
  Cursor cursor=null;
  try {
    SQLiteDatabase db=mOpenHelper.getReadableDatabase();
    cursor=db.query("String_Node_Str",ID_PROJECTION,selection,selectionArgs,null,null,null);
    if (cursor.getCount() == 0) {
      ContentValues contentValues=new ContentValues(1);
      contentValues.put(CanonicalAddressesColumns.ADDRESS,refinedAddress);
      db=mOpenHelper.getWritableDatabase();
      return db.insert("String_Node_Str",CanonicalAddressesColumns.ADDRESS,contentValues);
    }
    if (cursor.moveToFirst()) {
      return cursor.getLong(cursor.getColumnIndexOrThrow(BaseColumns._ID));
    }
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
  return -1L;
}

Fixed version (ground truth):
/** 
 * Return the canonical address ID for this address.
 */
private long getSingleAddressId(String address){
  boolean isEmail=Mms.isEmailAddress(address);
  String refinedAddress=isEmail ? address.toLowerCase() : address;
  String selection="String_Node_Str";
  String[] selectionArgs;
  if (isEmail) {
    selectionArgs=new String[]{refinedAddress};
  }
 else {
    selection+="String_Node_Str" + String.format("String_Node_Str",(mUseStrictPhoneNumberComparation ? 1 : 0));
    selectionArgs=new String[]{refinedAddress,refinedAddress};
  }
  Cursor cursor=null;
  try {
    SQLiteDatabase db=mOpenHelper.getReadableDatabase();
    cursor=db.query("String_Node_Str",ID_PROJECTION,selection,selectionArgs,null,null,null);
    if (cursor.getCount() == 0) {
      ContentValues contentValues=new ContentValues(1);
      contentValues.put(CanonicalAddressesColumns.ADDRESS,refinedAddress);
      db=mOpenHelper.getWritableDatabase();
      return db.insert("String_Node_Str",CanonicalAddressesColumns.ADDRESS,contentValues);
    }
    if (cursor.moveToFirst()) {
      return cursor.getLong(cursor.getColumnIndexOrThrow(BaseColumns._ID));
    }
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
  return -1L;
}
Program: 152716
Project: 152716
Buggy source:
/** 
 * Return the thread ID for this list of recipients IDs.  If no thread exists with this ID, create one and return it.  Callers should always use Threads.getThreadId to access this information.
 */
private synchronized Cursor getThreadId(List<String> recipients){
  String recipientIds=getSpaceSeparatedNumbers(getSortedSet(getAddressIds(recipients)));
  String THREAD_QUERY="String_Node_Str" + "String_Node_Str";
  if (DEBUG) {
    Log.v(LOG_TAG,"String_Node_Str" + THREAD_QUERY);
  }
  SQLiteDatabase db=mOpenHelper.getReadableDatabase();
  Cursor cursor=db.rawQuery(THREAD_QUERY,new String[]{recipientIds});
  if (cursor.getCount() == 0) {
    cursor.close();
    if (DEBUG) {
      Log.v(LOG_TAG,"String_Node_Str");
    }
    insertThread(recipientIds,recipients.size());
    db=mOpenHelper.getReadableDatabase();
    cursor=db.rawQuery(THREAD_QUERY,new String[]{recipientIds});
  }
  if (DEBUG) {
    Log.v(LOG_TAG,"String_Node_Str" + cursor.getCount());
  }
  return cursor;
}

Fixed version (ground truth):
/** 
 * Return the thread ID for this list of recipients IDs.  If no thread exists with this ID, create one and return it.  Callers should always use Threads.getThreadId to access this information.
 */
private synchronized Cursor getThreadId(List<String> recipients){
  String recipientIds=getSpaceSeparatedNumbers(getSortedSet(getAddressIds(recipients)));
  String THREAD_QUERY="String_Node_Str" + "String_Node_Str";
  if (DEBUG) {
    Log.v(LOG_TAG,"String_Node_Str" + THREAD_QUERY + "String_Node_Str"+ recipientIds);
  }
  SQLiteDatabase db=mOpenHelper.getReadableDatabase();
  Cursor cursor=db.rawQuery(THREAD_QUERY,new String[]{recipientIds});
  if (cursor.getCount() == 0) {
    cursor.close();
    if (DEBUG) {
      Log.v(LOG_TAG,"String_Node_Str");
    }
    insertThread(recipientIds,recipients.size());
    db=mOpenHelper.getReadableDatabase();
    cursor=db.rawQuery(THREAD_QUERY,new String[]{recipientIds});
  }
  if (DEBUG) {
    Log.v(LOG_TAG,"String_Node_Str" + cursor.getCount());
  }
  return cursor;
}
Program: 152718
Project: 152718
Buggy source:
/** 
 * Return the canonical address ID for this address.
 */
private long getSingleAddressId(String address){
  boolean isEmail=Mms.isEmailAddress(address);
  String refinedAddress=isEmail ? address.toLowerCase() : address;
  String selection=isEmail ? "String_Node_Str" : String.format("String_Node_Str",(mUseStrictPhoneNumberComparation ? 1 : 0));
  String[] selectionArgs=new String[]{refinedAddress};
  Cursor cursor=null;
  try {
    SQLiteDatabase db=mOpenHelper.getReadableDatabase();
    cursor=db.query("String_Node_Str",ID_PROJECTION,selection,selectionArgs,null,null,null);
    if (cursor.getCount() == 0) {
      ContentValues contentValues=new ContentValues(1);
      contentValues.put(CanonicalAddressesColumns.ADDRESS,refinedAddress);
      db=mOpenHelper.getWritableDatabase();
      return db.insert("String_Node_Str",CanonicalAddressesColumns.ADDRESS,contentValues);
    }
    if (cursor.moveToFirst()) {
      return cursor.getLong(cursor.getColumnIndexOrThrow(BaseColumns._ID));
    }
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
  return -1L;
}

Fixed version (ground truth):
/** 
 * Return the canonical address ID for this address.
 */
private long getSingleAddressId(String address){
  boolean isEmail=Mms.isEmailAddress(address);
  String refinedAddress=isEmail ? address.toLowerCase() : address;
  String selection="String_Node_Str";
  String[] selectionArgs;
  if (isEmail) {
    selectionArgs=new String[]{refinedAddress};
  }
 else {
    selection+="String_Node_Str" + String.format("String_Node_Str",(mUseStrictPhoneNumberComparation ? 1 : 0));
    selectionArgs=new String[]{refinedAddress,refinedAddress};
  }
  Cursor cursor=null;
  try {
    SQLiteDatabase db=mOpenHelper.getReadableDatabase();
    cursor=db.query("String_Node_Str",ID_PROJECTION,selection,selectionArgs,null,null,null);
    if (cursor.getCount() == 0) {
      ContentValues contentValues=new ContentValues(1);
      contentValues.put(CanonicalAddressesColumns.ADDRESS,refinedAddress);
      db=mOpenHelper.getWritableDatabase();
      return db.insert("String_Node_Str",CanonicalAddressesColumns.ADDRESS,contentValues);
    }
    if (cursor.moveToFirst()) {
      return cursor.getLong(cursor.getColumnIndexOrThrow(BaseColumns._ID));
    }
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
  return -1L;
}
Program: 152719
Project: 152719
Buggy source:
/** 
 * Return the thread ID for this list of recipients IDs.  If no thread exists with this ID, create one and return it.  Callers should always use Threads.getThreadId to access this information.
 */
private synchronized Cursor getThreadId(List<String> recipients){
  String recipientIds=getSpaceSeparatedNumbers(getSortedSet(getAddressIds(recipients)));
  String THREAD_QUERY="String_Node_Str" + "String_Node_Str";
  if (DEBUG) {
    Log.v(LOG_TAG,"String_Node_Str" + THREAD_QUERY);
  }
  SQLiteDatabase db=mOpenHelper.getReadableDatabase();
  Cursor cursor=db.rawQuery(THREAD_QUERY,new String[]{recipientIds});
  if (cursor.getCount() == 0) {
    cursor.close();
    if (DEBUG) {
      Log.v(LOG_TAG,"String_Node_Str");
    }
    insertThread(recipientIds,recipients.size());
    db=mOpenHelper.getReadableDatabase();
    cursor=db.rawQuery(THREAD_QUERY,new String[]{recipientIds});
  }
  if (DEBUG) {
    Log.v(LOG_TAG,"String_Node_Str" + cursor.getCount());
  }
  return cursor;
}

Fixed version (ground truth):
/** 
 * Return the thread ID for this list of recipients IDs.  If no thread exists with this ID, create one and return it.  Callers should always use Threads.getThreadId to access this information.
 */
private synchronized Cursor getThreadId(List<String> recipients){
  String recipientIds=getSpaceSeparatedNumbers(getSortedSet(getAddressIds(recipients)));
  String THREAD_QUERY="String_Node_Str" + "String_Node_Str";
  if (DEBUG) {
    Log.v(LOG_TAG,"String_Node_Str" + THREAD_QUERY + "String_Node_Str"+ recipientIds);
  }
  SQLiteDatabase db=mOpenHelper.getReadableDatabase();
  Cursor cursor=db.rawQuery(THREAD_QUERY,new String[]{recipientIds});
  if (cursor.getCount() == 0) {
    cursor.close();
    if (DEBUG) {
      Log.v(LOG_TAG,"String_Node_Str");
    }
    insertThread(recipientIds,recipients.size());
    db=mOpenHelper.getReadableDatabase();
    cursor=db.rawQuery(THREAD_QUERY,new String[]{recipientIds});
  }
  if (DEBUG) {
    Log.v(LOG_TAG,"String_Node_Str" + cursor.getCount());
  }
  return cursor;
}
Program: 152721
Project: 152721
Buggy source:
/** 
 * Return the canonical address ID for this address.
 */
private long getSingleAddressId(String address){
  boolean isEmail=Mms.isEmailAddress(address);
  String refinedAddress=isEmail ? address.toLowerCase() : address;
  String selection=isEmail ? "String_Node_Str" : String.format("String_Node_Str",(mUseStrictPhoneNumberComparation ? 1 : 0));
  String[] selectionArgs=new String[]{refinedAddress};
  Cursor cursor=null;
  try {
    SQLiteDatabase db=mOpenHelper.getReadableDatabase();
    cursor=db.query("String_Node_Str",ID_PROJECTION,selection,selectionArgs,null,null,null);
    if (cursor.getCount() == 0) {
      ContentValues contentValues=new ContentValues(1);
      contentValues.put(CanonicalAddressesColumns.ADDRESS,refinedAddress);
      db=mOpenHelper.getWritableDatabase();
      return db.insert("String_Node_Str",CanonicalAddressesColumns.ADDRESS,contentValues);
    }
    if (cursor.moveToFirst()) {
      return cursor.getLong(cursor.getColumnIndexOrThrow(BaseColumns._ID));
    }
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
  return -1L;
}

Fixed version (ground truth):
/** 
 * Return the canonical address ID for this address.
 */
private long getSingleAddressId(String address){
  boolean isEmail=Mms.isEmailAddress(address);
  String refinedAddress=isEmail ? address.toLowerCase() : address;
  String selection="String_Node_Str";
  String[] selectionArgs;
  if (isEmail) {
    selectionArgs=new String[]{refinedAddress};
  }
 else {
    selection+="String_Node_Str" + String.format("String_Node_Str",(mUseStrictPhoneNumberComparation ? 1 : 0));
    selectionArgs=new String[]{refinedAddress,refinedAddress};
  }
  Cursor cursor=null;
  try {
    SQLiteDatabase db=mOpenHelper.getReadableDatabase();
    cursor=db.query("String_Node_Str",ID_PROJECTION,selection,selectionArgs,null,null,null);
    if (cursor.getCount() == 0) {
      ContentValues contentValues=new ContentValues(1);
      contentValues.put(CanonicalAddressesColumns.ADDRESS,refinedAddress);
      db=mOpenHelper.getWritableDatabase();
      return db.insert("String_Node_Str",CanonicalAddressesColumns.ADDRESS,contentValues);
    }
    if (cursor.moveToFirst()) {
      return cursor.getLong(cursor.getColumnIndexOrThrow(BaseColumns._ID));
    }
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
  return -1L;
}
Program: 152723
Project: 152723
Buggy source:
@Override protected void onPostCreate(Bundle savedInstanceState){
  super.onPostCreate(savedInstanceState);
  Intent intent=getIntent();
  if (Intent.ACTION_VIEW.equals(intent.getAction())) {
    QRCodeUrlAnalyser qrCodeUrlAnalyser=new QRCodeUrlAnalyser();
    qrCodeUrlAnalyser.startWizardCauseOfUriInput(intent.getData(),this);
  }
 else   if (loginmanager.getAllLoginSets().size() < 1) {
    showStartupWizard();
  }
  Settings settings=((SchoolPlannerApp)getApplication()).getSettings();
  String autoLoginSetString=settings.getAutoLoginSet();
  if (settings.isAutoLogin() && !autoLoginSetString.equals("String_Node_Str")) {
    LoginSet loginSet=loginmanager.getLoginSet(autoLoginSetString);
    if (loginSet != null) {
      loginListener.performLogin(loginSet);
    }
  }
}

Fixed version (ground truth):
@Override protected void onPostCreate(Bundle savedInstanceState){
  super.onPostCreate(savedInstanceState);
  Intent intent=getIntent();
  if (Intent.ACTION_VIEW.equals(intent.getAction())) {
    QRCodeUrlAnalyser qrCodeUrlAnalyser=new QRCodeUrlAnalyser();
    qrCodeUrlAnalyser.startWizardCauseOfUriInput(intent.getDataString(),this);
  }
 else   if (loginmanager.getAllLoginSets().size() < 1) {
    showStartupWizard();
  }
  Settings settings=((SchoolPlannerApp)getApplication()).getSettings();
  String autoLoginSetString=settings.getAutoLoginSet();
  if (settings.isAutoLogin() && !autoLoginSetString.equals("String_Node_Str")) {
    LoginSet loginSet=loginmanager.getLoginSet(autoLoginSetString);
    if (loginSet != null) {
      loginListener.performLogin(loginSet);
    }
  }
}
Program: 152724
Project: 152724
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.startup_wizard_introduction);
  initTitle(getResources().getString(R.string.startup_wizard_header));
  expert=(RadioButton)findViewById(R.id.swi_radio_expert);
  easy=(RadioButton)findViewById(R.id.swi_radio_easy);
  qrcode=(RadioButton)findViewById(R.id.swi_radio_qrcode);
  nextButton=(Button)findViewById(R.id.startup_wizard_introduction_next_button);
  nextButton.setOnClickListener(new Button.OnClickListener(){
    @Override public void onClick(    View v){
      if (expert.isChecked())       startActivity(new Intent(thisActivity,StartupWizardLoginInformationExpert.class));
      if (easy.isChecked())       startActivity(new Intent(thisActivity,StartupWizardLoginInformationEasyServerUrl.class));
      if (qrcode.isChecked())       startQRCodeReader();
    }
  }
);
  backButton=(Button)findViewById(R.id.startup_wizard_introduction_back_button);
  backButton.setOnClickListener(new Button.OnClickListener(){
    @Override public void onClick(    View v){
      finish();
    }
  }
);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.startup_wizard_introduction);
  initTitle(getResources().getString(R.string.startup_wizard_header));
  expert=(RadioButton)findViewById(R.id.swi_radio_expert);
  easy=(RadioButton)findViewById(R.id.swi_radio_easy);
  qrcode=(RadioButton)findViewById(R.id.swi_radio_qrcode);
  nextButton=(Button)findViewById(R.id.startup_wizard_introduction_next_button);
  nextButton.setOnClickListener(new Button.OnClickListener(){
    @Override public void onClick(    View v){
      if (expert.isChecked())       startActivity(new Intent(thisActivity,StartupWizardLoginInformationExpert.class));
      if (easy.isChecked())       startActivity(new Intent(thisActivity,StartupWizardLoginInformationEasyServerUrl.class));
      if (qrcode.isChecked())       startQRCodeReader();
    }
  }
);
  backButton=(Button)findViewById(R.id.startup_wizard_introduction_back_button);
  backButton.setOnClickListener(new Button.OnClickListener(){
    @Override public void onClick(    View v){
      onBackPressed();
    }
  }
);
}
Program: 152725
Project: 152725
Buggy source:
@Override public void onClick(View v){
  finish();
}

Fixed version (ground truth):
@Override public void onClick(View v){
  onBackPressed();
}
Program: 152726
Project: 152726
Buggy source:
public void onActivityResult(int requestCode,int resultCode,Intent intent){
  IntentResult scanResult=IntentIntegrator.parseActivityResult(requestCode,resultCode,intent);
  String data=scanResult.getContents();
  if (scanResult != null && data.startsWith("String_Node_Str")) {
    Uri uri=Uri.parse(scanResult.getContents());
    QRCodeUrlAnalyser qrCodeUrlAnalyser=new QRCodeUrlAnalyser();
    qrCodeUrlAnalyser.startWizardCauseOfUriInput(uri,this);
    Log.d("String_Node_Str",scanResult.toString());
  }
 else {
    Toast.makeText(getApplicationContext(),getResources().getString(R.string.startup_wizard_introduction_qrcode_error),Toast.LENGTH_SHORT).show();
  }
}

Fixed version (ground truth):
public void onActivityResult(int requestCode,int resultCode,Intent intent){
  if (resultCode == RESULT_OK) {
    IntentResult scanResult=IntentIntegrator.parseActivityResult(requestCode,resultCode,intent);
    String data=scanResult.getContents();
    if (scanResult != null && data.startsWith("String_Node_Str")) {
      QRCodeUrlAnalyser qrCodeUrlAnalyser=new QRCodeUrlAnalyser();
      qrCodeUrlAnalyser.startWizardCauseOfUriInput(scanResult.getContents(),this);
    }
 else {
      Toast.makeText(getApplicationContext(),getResources().getString(R.string.startup_wizard_introduction_qrcode_error),Toast.LENGTH_SHORT).show();
    }
  }
}
Program: 152727
Project: 152727
Buggy source:
public void startWizardCauseOfUriInput(Uri uri,Activity activity){
  String school_url=uri.getQueryParameter(LoginSetConstants.serverUrlKey);
  String school=uri.getQueryParameter(LoginSetConstants.schoolKey);
  String user=uri.getQueryParameter(LoginSetConstants.usernameKey);
  String pass=uri.getQueryParameter(LoginSetConstants.passwordKey);
  String name=uri.getQueryParameter(LoginSetConstants.nameKey);
  boolean ssl=Boolean.parseBoolean(uri.getQueryParameter(LoginSetConstants.sslOnlyKey));
  Log.d("String_Node_Str",uri.toString());
  Log.d("String_Node_Str","String_Node_Str" + school_url + "String_Node_Str"+ school+ "String_Node_Str"+ user+ "String_Node_Str"+ pass+ "String_Node_Str"+ name+ "String_Node_Str"+ ssl);
  Intent loginSetEditor=new Intent(activity,StartupWizardLoginInformationExpert.class);
  loginSetEditor.putExtra(LoginSetConstants.nameKey,name);
  loginSetEditor.putExtra(LoginSetConstants.serverUrlKey,school_url);
  loginSetEditor.putExtra(LoginSetConstants.schoolKey,school);
  loginSetEditor.putExtra(LoginSetConstants.usernameKey,user);
  loginSetEditor.putExtra(LoginSetConstants.passwordKey,pass);
  loginSetEditor.putExtra(LoginSetConstants.sslOnlyKey,ssl);
  activity.startActivityForResult(loginSetEditor,STARTUP_WIZARD_INTRODUCTION_REQUEST_CODE);
}

Fixed version (ground truth):
public void startWizardCauseOfUriInput(String url,Activity activity){
  Uri uri=Uri.parse(Uri.decode(Uri.decode(url)));
  Log.d("String_Node_Str",uri.toString());
  String school_url=uri.getQueryParameter(LoginSetConstants.serverUrlKey);
  String school=uri.getQueryParameter(LoginSetConstants.schoolKey);
  String user=uri.getQueryParameter(LoginSetConstants.usernameKey);
  String pass=uri.getQueryParameter(LoginSetConstants.passwordKey);
  String name=uri.getQueryParameter(LoginSetConstants.nameKey);
  boolean ssl=Boolean.parseBoolean(uri.getQueryParameter(LoginSetConstants.sslOnlyKey));
  Intent loginSetEditor=new Intent(activity,StartupWizardLoginInformationExpert.class);
  loginSetEditor.putExtra(LoginSetConstants.nameKey,name);
  loginSetEditor.putExtra(LoginSetConstants.serverUrlKey,school_url);
  loginSetEditor.putExtra(LoginSetConstants.schoolKey,school);
  loginSetEditor.putExtra(LoginSetConstants.usernameKey,user);
  loginSetEditor.putExtra(LoginSetConstants.passwordKey,pass);
  loginSetEditor.putExtra(LoginSetConstants.sslOnlyKey,ssl);
  activity.startActivityForResult(loginSetEditor,STARTUP_WIZARD_INTRODUCTION_REQUEST_CODE);
}
Program: 152728
Project: 152728
Buggy source:
public GUIWeek analyse(){
  Set<String> keySet=weekdata.keySet();
  TreeSet<DateTime> dates=new TreeSet<DateTime>();
  for (  Object element : keySet) {
    String string=(String)element;
    dates.add(DateTimeUtils.iso8601StringToDateTime(string));
  }
  for (int i=0; i < 4; i++) {
    Log.d("String_Node_Str","String_Node_Str" + timegridRaw.getTimegridForDateTimeDay(2 + i));
  }
  HashMap<DateTime,List<TimegridUnit>> timegrid=initTimeGrid(timegridRaw,dates);
  GUIWeek week=new GUIWeek();
  for (  Object element : dates) {
    DateTime dateTime=(DateTime)element;
    List<Lesson> lessons=weekdata.get(DateTimeUtils.toISO8601Date(dateTime));
    GUIDay d=analyseDay(dateTime,lessons,timegrid.get(dateTime));
    week.setGUIDay(dateTime,d);
  }
  week.setViewType(viewtype);
  week.setTimegrid(getMondayTimeGrid(timegrid));
  week.setHolidays(holidays);
  return week;
}

Fixed version (ground truth):
public GUIWeek analyse(){
  Set<String> keySet=weekdata.keySet();
  TreeSet<DateTime> dates=new TreeSet<DateTime>();
  for (  Object element : keySet) {
    String string=(String)element;
    dates.add(DateTimeUtils.iso8601StringToDateTime(string));
  }
  HashMap<DateTime,List<TimegridUnit>> timegrid=initTimeGrid(timegridRaw,dates);
  GUIWeek week=new GUIWeek();
  for (  Object element : dates) {
    DateTime dateTime=(DateTime)element;
    List<Lesson> lessons=weekdata.get(DateTimeUtils.toISO8601Date(dateTime));
    GUIDay d=analyseDay(dateTime,lessons,timegrid.get(dateTime));
    week.setGUIDay(dateTime,d);
  }
  week.setViewType(viewtype);
  week.setTimegrid(getMondayTimeGrid(timegrid));
  week.setHolidays(holidays);
  return week;
}
Program: 152729
Project: 152729
Buggy source:
private int setBackgroundColor(){
  List<Lesson> lessons=giveMeTheCorrectList();
  List<? extends ViewType> vt=null;
  if (lessons.size() != 0) {
    if (viewtype instanceof SchoolClass) {
      vt=lessons.get(0).getSchoolSubjects();
    }
 else     if (viewtype instanceof SchoolTeacher) {
      vt=lessons.get(0).getSchoolSubjects();
    }
 else     if (viewtype instanceof SchoolRoom) {
      vt=lessons.get(0).getSchoolClasses();
    }
 else     if (viewtype instanceof SchoolSubject) {
      vt=lessons.get(0).getSchoolTeachers();
    }
    if (vt.size() != 0) {
      String bcolor=vt.get(0).getBackColor();
      if (!bcolor.equalsIgnoreCase("String_Node_Str")) {
        setBackgroundColor(Color.parseColor("String_Node_Str" + bcolor));
        return Color.parseColor("String_Node_Str" + bcolor);
      }
    }
  }
  return Color.WHITE;
}

Fixed version (ground truth):
private int setBackgroundColor(){
  List<Lesson> lessons=giveMeTheCorrectList();
  List<? extends ViewType> vt=null;
  if (lessons.size() != 0) {
    if (viewtype instanceof SchoolClass) {
      vt=lessons.get(0).getSchoolSubjects();
    }
 else     if (viewtype instanceof SchoolTeacher) {
      vt=lessons.get(0).getSchoolSubjects();
    }
 else     if (viewtype instanceof SchoolRoom) {
      vt=lessons.get(0).getSchoolClasses();
    }
 else     if (viewtype instanceof SchoolSubject) {
      vt=lessons.get(0).getSchoolTeachers();
    }
    if (vt.size() != 0) {
      String bcolor=vt.get(0).getBackColor();
      if (!bcolor.equalsIgnoreCase("String_Node_Str")) {
        if (bcolor.length() == 6) {
          setBackgroundColor(Color.parseColor("String_Node_Str" + bcolor));
          return Color.parseColor("String_Node_Str" + bcolor);
        }
        if (bcolor.length() == 8) {
          bcolor=bcolor.substring(2);
          setBackgroundColor(Color.parseColor("String_Node_Str" + bcolor));
          return Color.parseColor("String_Node_Str" + bcolor);
        }
      }
    }
  }
  return Color.WHITE;
}