nus-yam/ex-repair huggingface dataset:
Program: 43727
Project: 43727
Buggy source:
/** 
 * (Usually optional) Set the data for the intent along with an explicit MIME data type.  This method should very rarely be used -- it allows you to override the MIME type that would ordinarily be inferred from the data with your own type given here.
 * @param data The URI of the data this intent is now targeting.
 * @param type The MIME type of the data being handled by this intent.
 * @return Returns the same Intent object, for chaining multiple callsinto a single statement.
 * @see #setData
 * @see #setType
 */
public Intent setDataAndType(Uri data,String type){
  mData=data;
  mType=type;
  return this;
}

Fixed version (ground truth):
/** 
 * (Usually optional) Set the data for the intent along with an explicit MIME data type.  This method should very rarely be used -- it allows you to override the MIME type that would ordinarily be inferred from the data with your own type given here. <p><em>Note: MIME type, Uri scheme, and host name matching in the Android framework is case-sensitive, unlike the formal RFC definitions. As a result, you should always write these elements with lower case letters, and normalize any MIME types or Uris you receive from outside of Android to ensure these elements are lower case before supplying them here.</em></p>
 * @param data The URI of the data this intent is now targeting.
 * @param type The MIME type of the data being handled by this intent.
 * @return Returns the same Intent object, for chaining multiple callsinto a single statement.
 * @see #setData
 * @see #setType
 */
public Intent setDataAndType(Uri data,String type){
  mData=data;
  mType=type;
  return this;
}
Program: 43728
Project: 43728
Buggy source:
/** 
 * Set an explicit MIME data type.  This is used to create intents that only specify a type and not data, for example to indicate the type of data to return.  This method automatically clears any data that was previously set by   {@link #setData}.
 * @param type The MIME type of the data being handled by this intent.
 * @return Returns the same Intent object, for chaining multiple callsinto a single statement.
 * @see #getType
 * @see #setData
 * @see #setDataAndType
 */
public Intent setType(String type){
  mData=null;
  mType=type;
  return this;
}

Fixed version (ground truth):
/** 
 * Set an explicit MIME data type.  This is used to create intents that only specify a type and not data, for example to indicate the type of data to return.  This method automatically clears any data that was previously set by   {@link #setData}. <p><em>Note: MIME type matching in the Android framework is case-sensitive, unlike formal RFC MIME types.  As a result, you should always write your MIME types with lower case letters, and any MIME types you receive from outside of Android should be converted to lower case before supplying them here.</em></p>
 * @param type The MIME type of the data being handled by this intent.
 * @return Returns the same Intent object, for chaining multiple callsinto a single statement.
 * @see #getType
 * @see #setData
 * @see #setDataAndType
 */
public Intent setType(String type){
  mData=null;
  mType=type;
  return this;
}
Program: 43729
Project: 43729
Buggy source:
/** 
 * Add a new Intent data authority to match against.  The filter must include one or more schemes (via   {@link #addDataScheme}) for the authority to be considered.  If any authorities are included in the filter, then an Intent's data must match one of them.  If no authorities are included, then only the scheme must match.
 * @param host The host part of the authority to match.  May start with asingle '*' to wildcard the front of the host name.
 * @param port Optional port part of the authority to match.  If null, anyport is allowed.
 * @see #matchData
 * @see #addDataScheme
 */
public final void addDataAuthority(String host,String port){
  if (mDataAuthorities == null)   mDataAuthorities=new ArrayList<AuthorityEntry>();
  if (port != null)   port=port.intern();
  mDataAuthorities.add(new AuthorityEntry(host.intern(),port));
}

Fixed version (ground truth):
/** 
 * Add a new Intent data authority to match against.  The filter must include one or more schemes (via   {@link #addDataScheme}) for the authority to be considered.  If any authorities are included in the filter, then an Intent's data must match one of them.  If no authorities are included, then only the scheme must match. <p><em>Note: host name in the Android framework is case-sensitive, unlike formal RFC host names.  As a result, you should always write your host names with lower case letters, and any host names you receive from outside of Android should be converted to lower case before supplying them here.</em></p>
 * @param host The host part of the authority to match.  May start with asingle '*' to wildcard the front of the host name.
 * @param port Optional port part of the authority to match.  If null, anyport is allowed.
 * @see #matchData
 * @see #addDataScheme
 */
public final void addDataAuthority(String host,String port){
  if (mDataAuthorities == null)   mDataAuthorities=new ArrayList<AuthorityEntry>();
  if (port != null)   port=port.intern();
  mDataAuthorities.add(new AuthorityEntry(host.intern(),port));
}
Program: 43731
Project: 43731
Buggy source:
/** 
 * Add a new Intent data scheme to match against.  If any schemes are included in the filter, then an Intent's data must be <em>either</em> one of these schemes <em>or</em> a matching data type.  If no schemes are included, then an Intent will match only if it includes no data.
 * @param scheme Name of the scheme to match, i.e. "http".
 * @see #matchData
 */
public final void addDataScheme(String scheme){
  if (mDataSchemes == null)   mDataSchemes=new ArrayList<String>();
  if (!mDataSchemes.contains(scheme)) {
    mDataSchemes.add(scheme.intern());
  }
}

Fixed version (ground truth):
/** 
 * Add a new Intent data scheme to match against.  If any schemes are included in the filter, then an Intent's data must be <em>either</em> one of these schemes <em>or</em> a matching data type.  If no schemes are included, then an Intent will match only if it includes no data. <p><em>Note: scheme matching in the Android framework is case-sensitive, unlike formal RFC schemes.  As a result, you should always write your schemes with lower case letters, and any schemes you receive from outside of Android should be converted to lower case before supplying them here.</em></p>
 * @param scheme Name of the scheme to match, i.e. "http".
 * @see #matchData
 */
public final void addDataScheme(String scheme){
  if (mDataSchemes == null)   mDataSchemes=new ArrayList<String>();
  if (!mDataSchemes.contains(scheme)) {
    mDataSchemes.add(scheme.intern());
  }
}
Program: 43732
Project: 43732
Buggy source:
/** 
 * Add a new Intent data type to match against.  If any types are included in the filter, then an Intent's data must be <em>either</em> one of these types <em>or</em> a matching scheme.  If no data types are included, then an Intent will only match if it specifies no data. <p>Throws   {@link MalformedMimeTypeException} if the given MIME type isnot syntactically correct.
 * @param type Name of the data type to match, i.e. "vnd.android.cursor.dir/person".
 * @see #matchData
 */
public final void addDataType(String type) throws MalformedMimeTypeException {
  final int slashpos=type.indexOf('/');
  final int typelen=type.length();
  if (slashpos > 0 && typelen >= slashpos + 2) {
    if (mDataTypes == null)     mDataTypes=new ArrayList<String>();
    if (typelen == slashpos + 2 && type.charAt(slashpos + 1) == '*') {
      String str=type.substring(0,slashpos);
      if (!mDataTypes.contains(str)) {
        mDataTypes.add(str.intern());
      }
      mHasPartialTypes=true;
    }
 else {
      if (!mDataTypes.contains(type)) {
        mDataTypes.add(type.intern());
      }
    }
    return;
  }
  throw new MalformedMimeTypeException(type);
}

Fixed version (ground truth):
/** 
 * Add a new Intent data type to match against.  If any types are included in the filter, then an Intent's data must be <em>either</em> one of these types <em>or</em> a matching scheme.  If no data types are included, then an Intent will only match if it specifies no data. <p><em>Note: MIME type matching in the Android framework is case-sensitive, unlike formal RFC MIME types.  As a result, you should always write your MIME types with lower case letters, and any MIME types you receive from outside of Android should be converted to lower case before supplying them here.</em></p> <p>Throws   {@link MalformedMimeTypeException} if the given MIME type isnot syntactically correct.
 * @param type Name of the data type to match, i.e. "vnd.android.cursor.dir/person".
 * @see #matchData
 */
public final void addDataType(String type) throws MalformedMimeTypeException {
  final int slashpos=type.indexOf('/');
  final int typelen=type.length();
  if (slashpos > 0 && typelen >= slashpos + 2) {
    if (mDataTypes == null)     mDataTypes=new ArrayList<String>();
    if (typelen == slashpos + 2 && type.charAt(slashpos + 1) == '*') {
      String str=type.substring(0,slashpos);
      if (!mDataTypes.contains(str)) {
        mDataTypes.add(str.intern());
      }
      mHasPartialTypes=true;
    }
 else {
      if (!mDataTypes.contains(type)) {
        mDataTypes.add(type.intern());
      }
    }
    return;
  }
  throw new MalformedMimeTypeException(type);
}
Program: 43733
Project: 43733
Buggy source:
/** 
 * Set the data this intent is operating on.  This method automatically clears any type that was previously set by   {@link #setType}.
 * @param data The URI of the data this intent is now targeting.
 * @return Returns the same Intent object, for chaining multiple callsinto a single statement.
 * @see #getData
 * @see #setType
 * @see #setDataAndType
 */
public Intent setData(Uri data){
  mData=data;
  mType=null;
  return this;
}

Fixed version (ground truth):
/** 
 * Set the data this intent is operating on.  This method automatically clears any type that was previously set by   {@link #setType}. <p><em>Note: scheme and host name matching in the Android framework is case-sensitive, unlike the formal RFC.  As a result, you should always ensure that you write your Uri with these elements using lower case letters, and normalize any Uris you receive from outside of Android to ensure the scheme and host is lower case.</em></p>
 * @param data The URI of the data this intent is now targeting.
 * @return Returns the same Intent object, for chaining multiple callsinto a single statement.
 * @see #getData
 * @see #setType
 * @see #setDataAndType
 */
public Intent setData(Uri data){
  mData=data;
  mType=null;
  return this;
}
Program: 43734
Project: 43734
Buggy source:
/** 
 * (Usually optional) Set the data for the intent along with an explicit MIME data type.  This method should very rarely be used -- it allows you to override the MIME type that would ordinarily be inferred from the data with your own type given here.
 * @param data The URI of the data this intent is now targeting.
 * @param type The MIME type of the data being handled by this intent.
 * @return Returns the same Intent object, for chaining multiple callsinto a single statement.
 * @see #setData
 * @see #setType
 */
public Intent setDataAndType(Uri data,String type){
  mData=data;
  mType=type;
  return this;
}

Fixed version (ground truth):
/** 
 * (Usually optional) Set the data for the intent along with an explicit MIME data type.  This method should very rarely be used -- it allows you to override the MIME type that would ordinarily be inferred from the data with your own type given here. <p><em>Note: MIME type, Uri scheme, and host name matching in the Android framework is case-sensitive, unlike the formal RFC definitions. As a result, you should always write these elements with lower case letters, and normalize any MIME types or Uris you receive from outside of Android to ensure these elements are lower case before supplying them here.</em></p>
 * @param data The URI of the data this intent is now targeting.
 * @param type The MIME type of the data being handled by this intent.
 * @return Returns the same Intent object, for chaining multiple callsinto a single statement.
 * @see #setData
 * @see #setType
 */
public Intent setDataAndType(Uri data,String type){
  mData=data;
  mType=type;
  return this;
}
Program: 43735
Project: 43735
Buggy source:
/** 
 * Set an explicit MIME data type.  This is used to create intents that only specify a type and not data, for example to indicate the type of data to return.  This method automatically clears any data that was previously set by   {@link #setData}.
 * @param type The MIME type of the data being handled by this intent.
 * @return Returns the same Intent object, for chaining multiple callsinto a single statement.
 * @see #getType
 * @see #setData
 * @see #setDataAndType
 */
public Intent setType(String type){
  mData=null;
  mType=type;
  return this;
}

Fixed version (ground truth):
/** 
 * Set an explicit MIME data type.  This is used to create intents that only specify a type and not data, for example to indicate the type of data to return.  This method automatically clears any data that was previously set by   {@link #setData}. <p><em>Note: MIME type matching in the Android framework is case-sensitive, unlike formal RFC MIME types.  As a result, you should always write your MIME types with lower case letters, and any MIME types you receive from outside of Android should be converted to lower case before supplying them here.</em></p>
 * @param type The MIME type of the data being handled by this intent.
 * @return Returns the same Intent object, for chaining multiple callsinto a single statement.
 * @see #getType
 * @see #setData
 * @see #setDataAndType
 */
public Intent setType(String type){
  mData=null;
  mType=type;
  return this;
}
Program: 43736
Project: 43736
Buggy source:
/** 
 * Add a new Intent data authority to match against.  The filter must include one or more schemes (via   {@link #addDataScheme}) for the authority to be considered.  If any authorities are included in the filter, then an Intent's data must match one of them.  If no authorities are included, then only the scheme must match.
 * @param host The host part of the authority to match.  May start with asingle '*' to wildcard the front of the host name.
 * @param port Optional port part of the authority to match.  If null, anyport is allowed.
 * @see #matchData
 * @see #addDataScheme
 */
public final void addDataAuthority(String host,String port){
  if (mDataAuthorities == null)   mDataAuthorities=new ArrayList<AuthorityEntry>();
  if (port != null)   port=port.intern();
  mDataAuthorities.add(new AuthorityEntry(host.intern(),port));
}

Fixed version (ground truth):
/** 
 * Add a new Intent data authority to match against.  The filter must include one or more schemes (via   {@link #addDataScheme}) for the authority to be considered.  If any authorities are included in the filter, then an Intent's data must match one of them.  If no authorities are included, then only the scheme must match. <p><em>Note: host name in the Android framework is case-sensitive, unlike formal RFC host names.  As a result, you should always write your host names with lower case letters, and any host names you receive from outside of Android should be converted to lower case before supplying them here.</em></p>
 * @param host The host part of the authority to match.  May start with asingle '*' to wildcard the front of the host name.
 * @param port Optional port part of the authority to match.  If null, anyport is allowed.
 * @see #matchData
 * @see #addDataScheme
 */
public final void addDataAuthority(String host,String port){
  if (mDataAuthorities == null)   mDataAuthorities=new ArrayList<AuthorityEntry>();
  if (port != null)   port=port.intern();
  mDataAuthorities.add(new AuthorityEntry(host.intern(),port));
}
Program: 43738
Project: 43738
Buggy source:
/** 
 * Add a new Intent data scheme to match against.  If any schemes are included in the filter, then an Intent's data must be <em>either</em> one of these schemes <em>or</em> a matching data type.  If no schemes are included, then an Intent will match only if it includes no data.
 * @param scheme Name of the scheme to match, i.e. "http".
 * @see #matchData
 */
public final void addDataScheme(String scheme){
  if (mDataSchemes == null)   mDataSchemes=new ArrayList<String>();
  if (!mDataSchemes.contains(scheme)) {
    mDataSchemes.add(scheme.intern());
  }
}

Fixed version (ground truth):
/** 
 * Add a new Intent data scheme to match against.  If any schemes are included in the filter, then an Intent's data must be <em>either</em> one of these schemes <em>or</em> a matching data type.  If no schemes are included, then an Intent will match only if it includes no data. <p><em>Note: scheme matching in the Android framework is case-sensitive, unlike formal RFC schemes.  As a result, you should always write your schemes with lower case letters, and any schemes you receive from outside of Android should be converted to lower case before supplying them here.</em></p>
 * @param scheme Name of the scheme to match, i.e. "http".
 * @see #matchData
 */
public final void addDataScheme(String scheme){
  if (mDataSchemes == null)   mDataSchemes=new ArrayList<String>();
  if (!mDataSchemes.contains(scheme)) {
    mDataSchemes.add(scheme.intern());
  }
}
Program: 43739
Project: 43739
Buggy source:
/** 
 * Add a new Intent data type to match against.  If any types are included in the filter, then an Intent's data must be <em>either</em> one of these types <em>or</em> a matching scheme.  If no data types are included, then an Intent will only match if it specifies no data. <p>Throws   {@link MalformedMimeTypeException} if the given MIME type isnot syntactically correct.
 * @param type Name of the data type to match, i.e. "vnd.android.cursor.dir/person".
 * @see #matchData
 */
public final void addDataType(String type) throws MalformedMimeTypeException {
  final int slashpos=type.indexOf('/');
  final int typelen=type.length();
  if (slashpos > 0 && typelen >= slashpos + 2) {
    if (mDataTypes == null)     mDataTypes=new ArrayList<String>();
    if (typelen == slashpos + 2 && type.charAt(slashpos + 1) == '*') {
      String str=type.substring(0,slashpos);
      if (!mDataTypes.contains(str)) {
        mDataTypes.add(str.intern());
      }
      mHasPartialTypes=true;
    }
 else {
      if (!mDataTypes.contains(type)) {
        mDataTypes.add(type.intern());
      }
    }
    return;
  }
  throw new MalformedMimeTypeException(type);
}

Fixed version (ground truth):
/** 
 * Add a new Intent data type to match against.  If any types are included in the filter, then an Intent's data must be <em>either</em> one of these types <em>or</em> a matching scheme.  If no data types are included, then an Intent will only match if it specifies no data. <p><em>Note: MIME type matching in the Android framework is case-sensitive, unlike formal RFC MIME types.  As a result, you should always write your MIME types with lower case letters, and any MIME types you receive from outside of Android should be converted to lower case before supplying them here.</em></p> <p>Throws   {@link MalformedMimeTypeException} if the given MIME type isnot syntactically correct.
 * @param type Name of the data type to match, i.e. "vnd.android.cursor.dir/person".
 * @see #matchData
 */
public final void addDataType(String type) throws MalformedMimeTypeException {
  final int slashpos=type.indexOf('/');
  final int typelen=type.length();
  if (slashpos > 0 && typelen >= slashpos + 2) {
    if (mDataTypes == null)     mDataTypes=new ArrayList<String>();
    if (typelen == slashpos + 2 && type.charAt(slashpos + 1) == '*') {
      String str=type.substring(0,slashpos);
      if (!mDataTypes.contains(str)) {
        mDataTypes.add(str.intern());
      }
      mHasPartialTypes=true;
    }
 else {
      if (!mDataTypes.contains(type)) {
        mDataTypes.add(type.intern());
      }
    }
    return;
  }
  throw new MalformedMimeTypeException(type);
}
Program: 43740
Project: 43740
Buggy source:
/** 
 * This method is called when the BroadcastReceiver is receiving an Intent broadcast.  During this time you can use the other methods on BroadcastReceiver to view/modify the current result values.  The function is normally called from the main thread of its process, so you should never perform long-running operations in it (there is a timeout of 10 seconds that the system allows before considering the receiver to be blocked and a candidate to be killed). You cannot launch a popup dialog in your implementation of onReceive(). <p><b>If this BroadcastReceiver was launched through a &lt;receiver&gt; tag, then the object is no longer alive after returning from this function.</b>  This means you should not perform any operations that return a result to you asynchronously -- in particular, for interacting with services, you should use  {@link Context#startService(Intent)} instead of{@link Context#bindService(Intent,ServiceConnection,int)}.  If you wish to interact with a service that is already running, you can use  {@link #peekService}.
 * @param context The Context in which the receiver is running.
 * @param intent The Intent being received.
 */
public abstract void onReceive(Context context,Intent intent);

Fixed version (ground truth):
/** 
 * This method is called when the BroadcastReceiver is receiving an Intent broadcast.  During this time you can use the other methods on BroadcastReceiver to view/modify the current result values.  The function is normally called within the main thread of its process, so you should never perform long-running operations in it (there is a timeout of 10 seconds that the system allows before considering the receiver to be blocked and a candidate to be killed). You cannot launch a popup dialog in your implementation of onReceive(). <p><b>If this BroadcastReceiver was launched through a &lt;receiver&gt; tag, then the object is no longer alive after returning from this function.</b>  This means you should not perform any operations that return a result to you asynchronously -- in particular, for interacting with services, you should use  {@link Context#startService(Intent)} instead of{@link Context#bindService(Intent,ServiceConnection,int)}.  If you wish to interact with a service that is already running, you can use  {@link #peekService}. <p>The Intent filters used in   {@link android.content.Context#registerReceiver}and in application manifests are <em>not</em> guaranteed to be exclusive. They are hints to the operating system about how to find suitable recipients. It is possible for senders to force delivery to specific recipients, bypassing filter resolution.  For this reason,   {@link #onReceive(Context,Intent) onReceive()}implementations should respond only to known actions, ignoring any unexpected Intents that they may receive.
 * @param context The Context in which the receiver is running.
 * @param intent The Intent being received.
 */
public abstract void onReceive(Context context,Intent intent);
Program: 43741
Project: 43741
Buggy source:
/** 
 * This method is called when the BroadcastReceiver is receiving an Intent broadcast.  During this time you can use the other methods on BroadcastReceiver to view/modify the current result values.  The function is normally called from the main thread of its process, so you should never perform long-running operations in it (there is a timeout of 10 seconds that the system allows before considering the receiver to be blocked and a candidate to be killed). You cannot launch a popup dialog in your implementation of onReceive(). <p><b>If this BroadcastReceiver was launched through a &lt;receiver&gt; tag, then the object is no longer alive after returning from this function.</b>  This means you should not perform any operations that return a result to you asynchronously -- in particular, for interacting with services, you should use  {@link Context#startService(Intent)} instead of{@link Context#bindService(Intent,ServiceConnection,int)}.  If you wish to interact with a service that is already running, you can use  {@link #peekService}.
 * @param context The Context in which the receiver is running.
 * @param intent The Intent being received.
 */
public abstract void onReceive(Context context,Intent intent);

Fixed version (ground truth):
/** 
 * This method is called when the BroadcastReceiver is receiving an Intent broadcast.  During this time you can use the other methods on BroadcastReceiver to view/modify the current result values.  The function is normally called within the main thread of its process, so you should never perform long-running operations in it (there is a timeout of 10 seconds that the system allows before considering the receiver to be blocked and a candidate to be killed). You cannot launch a popup dialog in your implementation of onReceive(). <p><b>If this BroadcastReceiver was launched through a &lt;receiver&gt; tag, then the object is no longer alive after returning from this function.</b>  This means you should not perform any operations that return a result to you asynchronously -- in particular, for interacting with services, you should use  {@link Context#startService(Intent)} instead of{@link Context#bindService(Intent,ServiceConnection,int)}.  If you wish to interact with a service that is already running, you can use  {@link #peekService}. <p>The Intent filters used in   {@link android.content.Context#registerReceiver}and in application manifests are <em>not</em> guaranteed to be exclusive. They are hints to the operating system about how to find suitable recipients. It is possible for senders to force delivery to specific recipients, bypassing filter resolution.  For this reason,   {@link #onReceive(Context,Intent) onReceive()}implementations should respond only to known actions, ignoring any unexpected Intents that they may receive.
 * @param context The Context in which the receiver is running.
 * @param intent The Intent being received.
 */
public abstract void onReceive(Context context,Intent intent);
Program: 43742
Project: 43742
Buggy source:
/** 
 * This method is called when the BroadcastReceiver is receiving an Intent broadcast.  During this time you can use the other methods on BroadcastReceiver to view/modify the current result values.  The function is normally called from the main thread of its process, so you should never perform long-running operations in it (there is a timeout of 10 seconds that the system allows before considering the receiver to be blocked and a candidate to be killed). You cannot launch a popup dialog in your implementation of onReceive(). <p><b>If this BroadcastReceiver was launched through a &lt;receiver&gt; tag, then the object is no longer alive after returning from this function.</b>  This means you should not perform any operations that return a result to you asynchronously -- in particular, for interacting with services, you should use  {@link Context#startService(Intent)} instead of{@link Context#bindService(Intent,ServiceConnection,int)}.  If you wish to interact with a service that is already running, you can use  {@link #peekService}.
 * @param context The Context in which the receiver is running.
 * @param intent The Intent being received.
 */
public abstract void onReceive(Context context,Intent intent);

Fixed version (ground truth):
/** 
 * This method is called when the BroadcastReceiver is receiving an Intent broadcast.  During this time you can use the other methods on BroadcastReceiver to view/modify the current result values.  The function is normally called within the main thread of its process, so you should never perform long-running operations in it (there is a timeout of 10 seconds that the system allows before considering the receiver to be blocked and a candidate to be killed). You cannot launch a popup dialog in your implementation of onReceive(). <p><b>If this BroadcastReceiver was launched through a &lt;receiver&gt; tag, then the object is no longer alive after returning from this function.</b>  This means you should not perform any operations that return a result to you asynchronously -- in particular, for interacting with services, you should use  {@link Context#startService(Intent)} instead of{@link Context#bindService(Intent,ServiceConnection,int)}.  If you wish to interact with a service that is already running, you can use  {@link #peekService}. <p>The Intent filters used in   {@link android.content.Context#registerReceiver}and in application manifests are <em>not</em> guaranteed to be exclusive. They are hints to the operating system about how to find suitable recipients. It is possible for senders to force delivery to specific recipients, bypassing filter resolution.  For this reason,   {@link #onReceive(Context,Intent) onReceive()}implementations should respond only to known actions, ignoring any unexpected Intents that they may receive.
 * @param context The Context in which the receiver is running.
 * @param intent The Intent being received.
 */
public abstract void onReceive(Context context,Intent intent);
Program: 43745
Project: 43745
Buggy source:
/** 
 * Returns the name, conservatively quoting it if there are any characters that are likely to cause trouble outside of a quoted string, or returning it literally if it seems safe.
 */
public static String quoteNameIfNecessary(String name){
  int len=name.length();
  for (int i=0; i < len; i++) {
    char c=name.charAt(i);
    if (!((c >= 'A' && i <= 'Z') || (c >= 'a' && c <= 'z') || (c == ' ')|| (c >= '0' && c <= '9'))) {
      return '"' + quoteName(name) + '"';
    }
  }
  return name;
}

Fixed version (ground truth):
/** 
 * Returns the name, conservatively quoting it if there are any characters that are likely to cause trouble outside of a quoted string, or returning it literally if it seems safe.
 */
public static String quoteNameIfNecessary(String name){
  int len=name.length();
  for (int i=0; i < len; i++) {
    char c=name.charAt(i);
    if (!((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c == ' ')|| (c >= '0' && c <= '9'))) {
      return '"' + quoteName(name) + '"';
    }
  }
  return name;
}
Program: 43747
Project: 43747
Buggy source:
/** 
 * Returns the name, conservatively quoting it if there are any characters that are likely to cause trouble outside of a quoted string, or returning it literally if it seems safe.
 */
public static String quoteNameIfNecessary(String name){
  int len=name.length();
  for (int i=0; i < len; i++) {
    char c=name.charAt(i);
    if (!((c >= 'A' && i <= 'Z') || (c >= 'a' && c <= 'z') || (c == ' ')|| (c >= '0' && c <= '9'))) {
      return '"' + quoteName(name) + '"';
    }
  }
  return name;
}

Fixed version (ground truth):
/** 
 * Returns the name, conservatively quoting it if there are any characters that are likely to cause trouble outside of a quoted string, or returning it literally if it seems safe.
 */
public static String quoteNameIfNecessary(String name){
  int len=name.length();
  for (int i=0; i < len; i++) {
    char c=name.charAt(i);
    if (!((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c == ' ')|| (c >= '0' && c <= '9'))) {
      return '"' + quoteName(name) + '"';
    }
  }
  return name;
}
Program: 43748
Project: 43748
Buggy source:
/** 
 * Returns the name, conservatively quoting it if there are any characters that are likely to cause trouble outside of a quoted string, or returning it literally if it seems safe.
 */
public static String quoteNameIfNecessary(String name){
  int len=name.length();
  for (int i=0; i < len; i++) {
    char c=name.charAt(i);
    if (!((c >= 'A' && i <= 'Z') || (c >= 'a' && c <= 'z') || (c == ' ')|| (c >= '0' && c <= '9'))) {
      return '"' + quoteName(name) + '"';
    }
  }
  return name;
}

Fixed version (ground truth):
/** 
 * Returns the name, conservatively quoting it if there are any characters that are likely to cause trouble outside of a quoted string, or returning it literally if it seems safe.
 */
public static String quoteNameIfNecessary(String name){
  int len=name.length();
  for (int i=0; i < len; i++) {
    char c=name.charAt(i);
    if (!((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c == ' ')|| (c >= '0' && c <= '9'))) {
      return '"' + quoteName(name) + '"';
    }
  }
  return name;
}
Program: 43749
Project: 43749
Buggy source:
/** 
 * {@inheritDoc} 
 */
public boolean finishAnimationLw(){
  boolean changed=false;
  boolean hiding=false;
  if (mStatusBar != null) {
    if (mForceStatusBar) {
      changed|=mStatusBar.showLw(true);
    }
 else     if (mTopFullscreenOpaqueWindowState != null) {
      WindowManager.LayoutParams lp=mTopFullscreenOpaqueWindowState.getAttrs();
      boolean hideStatusBar=(lp.flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) != 0;
      if (hideStatusBar) {
        changed|=mStatusBar.hideLw(true);
        hiding=true;
      }
 else {
        changed|=mStatusBar.showLw(true);
      }
    }
  }
  if (changed && hiding) {
    IStatusBar sbs=IStatusBar.Stub.asInterface(ServiceManager.getService("String_Node_Str"));
    if (sbs != null) {
      try {
        sbs.deactivate();
      }
 catch (      RemoteException e) {
      }
    }
  }
  return changed;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public boolean finishAnimationLw(){
  return false;
}
Program: 43751
Project: 43751
Buggy source:
/** 
 * {@inheritDoc} 
 */
public void beginLayoutLw(int displayWidth,int displayHeight){
  mW=displayWidth;
  mH=displayHeight;
  mDockLeft=mContentLeft=mCurLeft=0;
  mDockTop=mContentTop=mCurTop=0;
  mDockRight=mContentRight=mCurRight=displayWidth;
  mDockBottom=mContentBottom=mCurBottom=displayHeight;
  mDockLayer=0x10000000;
  if (mStatusBar != null) {
    final Rect pf=mTmpParentFrame;
    final Rect df=mTmpDisplayFrame;
    final Rect vf=mTmpVisibleFrame;
    pf.left=df.left=vf.left=0;
    pf.top=df.top=vf.top=0;
    pf.right=df.right=vf.right=displayWidth;
    pf.bottom=df.bottom=vf.bottom=displayHeight;
    mStatusBar.computeFrameLw(pf,df,vf,vf);
    if (mStatusBar.isVisibleLw()) {
      mDockTop=mContentTop=mCurTop=mStatusBar.getFrameLw().bottom;
      if (DEBUG_LAYOUT)       Log.v(TAG,"String_Node_Str" + mDockBottom + "String_Node_Str"+ mContentBottom+ "String_Node_Str"+ mCurBottom);
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public void beginLayoutLw(int displayWidth,int displayHeight){
  mW=displayWidth;
  mH=displayHeight;
  mDockLeft=mContentLeft=mCurLeft=0;
  mDockTop=mContentTop=mCurTop=0;
  mDockRight=mContentRight=mCurRight=displayWidth;
  mDockBottom=mContentBottom=mCurBottom=displayHeight;
  mDockLayer=0x10000000;
  mTopFullscreenOpaqueWindowState=null;
  mForceStatusBar=false;
  if (mStatusBar != null) {
    final Rect pf=mTmpParentFrame;
    final Rect df=mTmpDisplayFrame;
    final Rect vf=mTmpVisibleFrame;
    pf.left=df.left=vf.left=0;
    pf.top=df.top=vf.top=0;
    pf.right=df.right=vf.right=displayWidth;
    pf.bottom=df.bottom=vf.bottom=displayHeight;
    mStatusBar.computeFrameLw(pf,df,vf,vf);
    if (mStatusBar.isVisibleLw()) {
      mDockTop=mContentTop=mCurTop=mStatusBar.getFrameLw().bottom;
      if (DEBUG_LAYOUT)       Log.v(TAG,"String_Node_Str" + mDockBottom + "String_Node_Str"+ mContentBottom+ "String_Node_Str"+ mCurBottom);
    }
  }
}
Program: 43752
Project: 43752
Buggy source:
/** 
 * {@inheritDoc} 
 */
public void beginAnimationLw(int displayWidth,int displayHeight){
  mTopFullscreenOpaqueWindowState=null;
  mForceStatusBar=false;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public void beginAnimationLw(int displayWidth,int displayHeight){
}
Program: 43753
Project: 43753
Buggy source:
/** 
 * {@inheritDoc} 
 */
public void animatingWindowLw(WindowState win,WindowManager.LayoutParams attrs){
  if (win.isVisibleLw()) {
    if ((attrs.flags & FLAG_FORCE_NOT_FULLSCREEN) != 0) {
      mForceStatusBar=true;
    }
 else     if (mTopFullscreenOpaqueWindowState == null && attrs.type >= FIRST_APPLICATION_WINDOW && attrs.type <= LAST_APPLICATION_WINDOW && win.fillsScreenLw(mW,mH,true,false) && win.isVisibleLw()) {
      mTopFullscreenOpaqueWindowState=win;
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public void animatingWindowLw(WindowState win,WindowManager.LayoutParams attrs){
}
Program: 43754
Project: 43754
Buggy source:
/** 
 * {@inheritDoc} 
 */
public void finishLayoutLw(){
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public boolean finishLayoutLw(){
  boolean changed=false;
  boolean hiding=false;
  if (mStatusBar != null) {
    if (mForceStatusBar) {
      if (DEBUG_LAYOUT)       Log.v(TAG,"String_Node_Str");
      changed|=mStatusBar.showLw(true);
    }
 else     if (mTopFullscreenOpaqueWindowState != null) {
      WindowManager.LayoutParams lp=mTopFullscreenOpaqueWindowState.getAttrs();
      boolean hideStatusBar=(lp.flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) != 0;
      if (hideStatusBar) {
        if (DEBUG_LAYOUT)         Log.v(TAG,"String_Node_Str");
        changed|=mStatusBar.hideLw(true);
        hiding=true;
      }
 else {
        if (DEBUG_LAYOUT)         Log.v(TAG,"String_Node_Str");
        changed|=mStatusBar.showLw(true);
      }
    }
  }
  if (changed && hiding) {
    IStatusBar sbs=IStatusBar.Stub.asInterface(ServiceManager.getService("String_Node_Str"));
    if (sbs != null) {
      try {
        sbs.deactivate();
      }
 catch (      RemoteException e) {
      }
    }
  }
  return changed;
}
Program: 43755
Project: 43755
Buggy source:
/** 
 * {@inheritDoc} 
 */
public boolean finishAnimationLw(){
  boolean changed=false;
  boolean hiding=false;
  if (mStatusBar != null) {
    if (mForceStatusBar) {
      changed|=mStatusBar.showLw(true);
    }
 else     if (mTopFullscreenOpaqueWindowState != null) {
      WindowManager.LayoutParams lp=mTopFullscreenOpaqueWindowState.getAttrs();
      boolean hideStatusBar=(lp.flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) != 0;
      if (hideStatusBar) {
        changed|=mStatusBar.hideLw(true);
        hiding=true;
      }
 else {
        changed|=mStatusBar.showLw(true);
      }
    }
  }
  if (changed && hiding) {
    IStatusBar sbs=IStatusBar.Stub.asInterface(ServiceManager.getService("String_Node_Str"));
    if (sbs != null) {
      try {
        sbs.deactivate();
      }
 catch (      RemoteException e) {
      }
    }
  }
  return changed;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public boolean finishAnimationLw(){
  return false;
}
Program: 43757
Project: 43757
Buggy source:
/** 
 * {@inheritDoc} 
 */
public void beginLayoutLw(int displayWidth,int displayHeight){
  mW=displayWidth;
  mH=displayHeight;
  mDockLeft=mContentLeft=mCurLeft=0;
  mDockTop=mContentTop=mCurTop=0;
  mDockRight=mContentRight=mCurRight=displayWidth;
  mDockBottom=mContentBottom=mCurBottom=displayHeight;
  mDockLayer=0x10000000;
  if (mStatusBar != null) {
    final Rect pf=mTmpParentFrame;
    final Rect df=mTmpDisplayFrame;
    final Rect vf=mTmpVisibleFrame;
    pf.left=df.left=vf.left=0;
    pf.top=df.top=vf.top=0;
    pf.right=df.right=vf.right=displayWidth;
    pf.bottom=df.bottom=vf.bottom=displayHeight;
    mStatusBar.computeFrameLw(pf,df,vf,vf);
    if (mStatusBar.isVisibleLw()) {
      mDockTop=mContentTop=mCurTop=mStatusBar.getFrameLw().bottom;
      if (DEBUG_LAYOUT)       Log.v(TAG,"String_Node_Str" + mDockBottom + "String_Node_Str"+ mContentBottom+ "String_Node_Str"+ mCurBottom);
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public void beginLayoutLw(int displayWidth,int displayHeight){
  mW=displayWidth;
  mH=displayHeight;
  mDockLeft=mContentLeft=mCurLeft=0;
  mDockTop=mContentTop=mCurTop=0;
  mDockRight=mContentRight=mCurRight=displayWidth;
  mDockBottom=mContentBottom=mCurBottom=displayHeight;
  mDockLayer=0x10000000;
  mTopFullscreenOpaqueWindowState=null;
  mForceStatusBar=false;
  if (mStatusBar != null) {
    final Rect pf=mTmpParentFrame;
    final Rect df=mTmpDisplayFrame;
    final Rect vf=mTmpVisibleFrame;
    pf.left=df.left=vf.left=0;
    pf.top=df.top=vf.top=0;
    pf.right=df.right=vf.right=displayWidth;
    pf.bottom=df.bottom=vf.bottom=displayHeight;
    mStatusBar.computeFrameLw(pf,df,vf,vf);
    if (mStatusBar.isVisibleLw()) {
      mDockTop=mContentTop=mCurTop=mStatusBar.getFrameLw().bottom;
      if (DEBUG_LAYOUT)       Log.v(TAG,"String_Node_Str" + mDockBottom + "String_Node_Str"+ mContentBottom+ "String_Node_Str"+ mCurBottom);
    }
  }
}
Program: 43758
Project: 43758
Buggy source:
/** 
 * {@inheritDoc} 
 */
public void beginAnimationLw(int displayWidth,int displayHeight){
  mTopFullscreenOpaqueWindowState=null;
  mForceStatusBar=false;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public void beginAnimationLw(int displayWidth,int displayHeight){
}
Program: 43759
Project: 43759
Buggy source:
/** 
 * {@inheritDoc} 
 */
public void animatingWindowLw(WindowState win,WindowManager.LayoutParams attrs){
  if (win.isVisibleLw()) {
    if ((attrs.flags & FLAG_FORCE_NOT_FULLSCREEN) != 0) {
      mForceStatusBar=true;
    }
 else     if (mTopFullscreenOpaqueWindowState == null && attrs.type >= FIRST_APPLICATION_WINDOW && attrs.type <= LAST_APPLICATION_WINDOW && win.fillsScreenLw(mW,mH,true,false) && win.isVisibleLw()) {
      mTopFullscreenOpaqueWindowState=win;
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public void animatingWindowLw(WindowState win,WindowManager.LayoutParams attrs){
}
Program: 43760
Project: 43760
Buggy source:
/** 
 * {@inheritDoc} 
 */
public void finishLayoutLw(){
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public boolean finishLayoutLw(){
  boolean changed=false;
  boolean hiding=false;
  if (mStatusBar != null) {
    if (mForceStatusBar) {
      if (DEBUG_LAYOUT)       Log.v(TAG,"String_Node_Str");
      changed|=mStatusBar.showLw(true);
    }
 else     if (mTopFullscreenOpaqueWindowState != null) {
      WindowManager.LayoutParams lp=mTopFullscreenOpaqueWindowState.getAttrs();
      boolean hideStatusBar=(lp.flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) != 0;
      if (hideStatusBar) {
        if (DEBUG_LAYOUT)         Log.v(TAG,"String_Node_Str");
        changed|=mStatusBar.hideLw(true);
        hiding=true;
      }
 else {
        if (DEBUG_LAYOUT)         Log.v(TAG,"String_Node_Str");
        changed|=mStatusBar.showLw(true);
      }
    }
  }
  if (changed && hiding) {
    IStatusBar sbs=IStatusBar.Stub.asInterface(ServiceManager.getService("String_Node_Str"));
    if (sbs != null) {
      try {
        sbs.deactivate();
      }
 catch (      RemoteException e) {
      }
    }
  }
  return changed;
}
Program: 43761
Project: 43761
Buggy source:
/** 
 * {@inheritDoc} 
 */
public boolean finishAnimationLw(){
  boolean changed=false;
  boolean hiding=false;
  if (mStatusBar != null) {
    if (mForceStatusBar) {
      changed|=mStatusBar.showLw(true);
    }
 else     if (mTopFullscreenOpaqueWindowState != null) {
      WindowManager.LayoutParams lp=mTopFullscreenOpaqueWindowState.getAttrs();
      boolean hideStatusBar=(lp.flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) != 0;
      if (hideStatusBar) {
        changed|=mStatusBar.hideLw(true);
        hiding=true;
      }
 else {
        changed|=mStatusBar.showLw(true);
      }
    }
  }
  if (changed && hiding) {
    IStatusBar sbs=IStatusBar.Stub.asInterface(ServiceManager.getService("String_Node_Str"));
    if (sbs != null) {
      try {
        sbs.deactivate();
      }
 catch (      RemoteException e) {
      }
    }
  }
  return changed;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public boolean finishAnimationLw(){
  return false;
}
Program: 43763
Project: 43763
Buggy source:
/** 
 * {@inheritDoc} 
 */
public void beginLayoutLw(int displayWidth,int displayHeight){
  mW=displayWidth;
  mH=displayHeight;
  mDockLeft=mContentLeft=mCurLeft=0;
  mDockTop=mContentTop=mCurTop=0;
  mDockRight=mContentRight=mCurRight=displayWidth;
  mDockBottom=mContentBottom=mCurBottom=displayHeight;
  mDockLayer=0x10000000;
  if (mStatusBar != null) {
    final Rect pf=mTmpParentFrame;
    final Rect df=mTmpDisplayFrame;
    final Rect vf=mTmpVisibleFrame;
    pf.left=df.left=vf.left=0;
    pf.top=df.top=vf.top=0;
    pf.right=df.right=vf.right=displayWidth;
    pf.bottom=df.bottom=vf.bottom=displayHeight;
    mStatusBar.computeFrameLw(pf,df,vf,vf);
    if (mStatusBar.isVisibleLw()) {
      mDockTop=mContentTop=mCurTop=mStatusBar.getFrameLw().bottom;
      if (DEBUG_LAYOUT)       Log.v(TAG,"String_Node_Str" + mDockBottom + "String_Node_Str"+ mContentBottom+ "String_Node_Str"+ mCurBottom);
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public void beginLayoutLw(int displayWidth,int displayHeight){
  mW=displayWidth;
  mH=displayHeight;
  mDockLeft=mContentLeft=mCurLeft=0;
  mDockTop=mContentTop=mCurTop=0;
  mDockRight=mContentRight=mCurRight=displayWidth;
  mDockBottom=mContentBottom=mCurBottom=displayHeight;
  mDockLayer=0x10000000;
  mTopFullscreenOpaqueWindowState=null;
  mForceStatusBar=false;
  if (mStatusBar != null) {
    final Rect pf=mTmpParentFrame;
    final Rect df=mTmpDisplayFrame;
    final Rect vf=mTmpVisibleFrame;
    pf.left=df.left=vf.left=0;
    pf.top=df.top=vf.top=0;
    pf.right=df.right=vf.right=displayWidth;
    pf.bottom=df.bottom=vf.bottom=displayHeight;
    mStatusBar.computeFrameLw(pf,df,vf,vf);
    if (mStatusBar.isVisibleLw()) {
      mDockTop=mContentTop=mCurTop=mStatusBar.getFrameLw().bottom;
      if (DEBUG_LAYOUT)       Log.v(TAG,"String_Node_Str" + mDockBottom + "String_Node_Str"+ mContentBottom+ "String_Node_Str"+ mCurBottom);
    }
  }
}
Program: 43764
Project: 43764
Buggy source:
/** 
 * {@inheritDoc} 
 */
public void beginAnimationLw(int displayWidth,int displayHeight){
  mTopFullscreenOpaqueWindowState=null;
  mForceStatusBar=false;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public void beginAnimationLw(int displayWidth,int displayHeight){
}
Program: 43765
Project: 43765
Buggy source:
/** 
 * {@inheritDoc} 
 */
public void animatingWindowLw(WindowState win,WindowManager.LayoutParams attrs){
  if (win.isVisibleLw()) {
    if ((attrs.flags & FLAG_FORCE_NOT_FULLSCREEN) != 0) {
      mForceStatusBar=true;
    }
 else     if (mTopFullscreenOpaqueWindowState == null && attrs.type >= FIRST_APPLICATION_WINDOW && attrs.type <= LAST_APPLICATION_WINDOW && win.fillsScreenLw(mW,mH,true,false) && win.isVisibleLw()) {
      mTopFullscreenOpaqueWindowState=win;
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public void animatingWindowLw(WindowState win,WindowManager.LayoutParams attrs){
}
Program: 43766
Project: 43766
Buggy source:
/** 
 * {@inheritDoc} 
 */
public void finishLayoutLw(){
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public boolean finishLayoutLw(){
  boolean changed=false;
  boolean hiding=false;
  if (mStatusBar != null) {
    if (mForceStatusBar) {
      if (DEBUG_LAYOUT)       Log.v(TAG,"String_Node_Str");
      changed|=mStatusBar.showLw(true);
    }
 else     if (mTopFullscreenOpaqueWindowState != null) {
      WindowManager.LayoutParams lp=mTopFullscreenOpaqueWindowState.getAttrs();
      boolean hideStatusBar=(lp.flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) != 0;
      if (hideStatusBar) {
        if (DEBUG_LAYOUT)         Log.v(TAG,"String_Node_Str");
        changed|=mStatusBar.hideLw(true);
        hiding=true;
      }
 else {
        if (DEBUG_LAYOUT)         Log.v(TAG,"String_Node_Str");
        changed|=mStatusBar.showLw(true);
      }
    }
  }
  if (changed && hiding) {
    IStatusBar sbs=IStatusBar.Stub.asInterface(ServiceManager.getService("String_Node_Str"));
    if (sbs != null) {
      try {
        sbs.deactivate();
      }
 catch (      RemoteException e) {
      }
    }
  }
  return changed;
}
Program: 43768
Project: 43768
Buggy source:
public void run(){
  try {
    if (!hasCache) {
      captureView.buildDrawingCache();
    }
    cache[0]=captureView.getDrawingCache();
  }
  finally {
    latch.countDown();
  }
}

Fixed version (ground truth):
public void run(){
  try {
    cache[0]=captureView.createSnapshot(Bitmap.Config.ARGB_8888,0);
  }
 catch (  OutOfMemoryError e) {
    try {
      cache[0]=captureView.createSnapshot(Bitmap.Config.ARGB_4444,0);
    }
 catch (    OutOfMemoryError e2) {
      Log.w("String_Node_Str","String_Node_Str");
    }
  }
 finally {
    latch.countDown();
  }
}