nus-yam/ex-repair huggingface dataset:
Program: 1512
Project: 1512
Buggy source:
/** 
 * @hide Retrieve the string value for the attribute at <var>index</var> that is not allowed to change with the given configurations.
 * @param index Index of attribute to retrieve.
 * @param allowedChangingConfigs Bit mask of configurations fromActivityInfo that are allowed to change.
 * @return String holding string data.  Any styling information isremoved.  Returns null if the attribute is not defined.
 */
public String getNonConfigurationString(int index,int allowedChangingConfigs){
  index*=AssetManager.STYLE_NUM_ENTRIES;
  final int[] data=mData;
  final int type=data[index + AssetManager.STYLE_TYPE];
  if ((data[index + AssetManager.STYLE_CHANGING_CONFIGURATIONS] & ~allowedChangingConfigs) != 0) {
    return null;
  }
  if (type == TypedValue.TYPE_NULL) {
    return null;
  }
 else   if (type == TypedValue.TYPE_STRING) {
    return loadStringValueAt(index).toString();
  }
  TypedValue v=mValue;
  if (getValueAt(index,v)) {
    Log.w(Resources.TAG,"String_Node_Str" + v);
    CharSequence cs=v.coerceToString();
    return cs != null ? cs.toString() : null;
  }
  Log.w(Resources.TAG,"String_Node_Str" + Integer.toHexString(type));
  return null;
}

Fixed version (ground truth):
/** 
 * @hide Retrieve the string value for the attribute at <var>index</var> that is not allowed to change with the given configurations.
 * @param index Index of attribute to retrieve.
 * @param allowedChangingConfigs Bit mask of configurations from{@link Configuration}.NATIVE_CONFIG_* that are allowed to change.
 * @return String holding string data.  Any styling information isremoved.  Returns null if the attribute is not defined.
 */
public String getNonConfigurationString(int index,int allowedChangingConfigs){
  index*=AssetManager.STYLE_NUM_ENTRIES;
  final int[] data=mData;
  final int type=data[index + AssetManager.STYLE_TYPE];
  if ((data[index + AssetManager.STYLE_CHANGING_CONFIGURATIONS] & ~allowedChangingConfigs) != 0) {
    return null;
  }
  if (type == TypedValue.TYPE_NULL) {
    return null;
  }
 else   if (type == TypedValue.TYPE_STRING) {
    return loadStringValueAt(index).toString();
  }
  TypedValue v=mValue;
  if (getValueAt(index,v)) {
    Log.w(Resources.TAG,"String_Node_Str" + v);
    CharSequence cs=v.coerceToString();
    return cs != null ? cs.toString() : null;
  }
  Log.w(Resources.TAG,"String_Node_Str" + Integer.toHexString(type));
  return null;
}
Program: 1516
Project: 1516
Buggy source:
/** 
 * @hide Retrieve the string value for the attribute at <var>index</var> that is not allowed to change with the given configurations.
 * @param index Index of attribute to retrieve.
 * @param allowedChangingConfigs Bit mask of configurations fromActivityInfo that are allowed to change.
 * @return String holding string data.  Any styling information isremoved.  Returns null if the attribute is not defined.
 */
public String getNonConfigurationString(int index,int allowedChangingConfigs){
  index*=AssetManager.STYLE_NUM_ENTRIES;
  final int[] data=mData;
  final int type=data[index + AssetManager.STYLE_TYPE];
  if ((data[index + AssetManager.STYLE_CHANGING_CONFIGURATIONS] & ~allowedChangingConfigs) != 0) {
    return null;
  }
  if (type == TypedValue.TYPE_NULL) {
    return null;
  }
 else   if (type == TypedValue.TYPE_STRING) {
    return loadStringValueAt(index).toString();
  }
  TypedValue v=mValue;
  if (getValueAt(index,v)) {
    Log.w(Resources.TAG,"String_Node_Str" + v);
    CharSequence cs=v.coerceToString();
    return cs != null ? cs.toString() : null;
  }
  Log.w(Resources.TAG,"String_Node_Str" + Integer.toHexString(type));
  return null;
}

Fixed version (ground truth):
/** 
 * @hide Retrieve the string value for the attribute at <var>index</var> that is not allowed to change with the given configurations.
 * @param index Index of attribute to retrieve.
 * @param allowedChangingConfigs Bit mask of configurations from{@link Configuration}.NATIVE_CONFIG_* that are allowed to change.
 * @return String holding string data.  Any styling information isremoved.  Returns null if the attribute is not defined.
 */
public String getNonConfigurationString(int index,int allowedChangingConfigs){
  index*=AssetManager.STYLE_NUM_ENTRIES;
  final int[] data=mData;
  final int type=data[index + AssetManager.STYLE_TYPE];
  if ((data[index + AssetManager.STYLE_CHANGING_CONFIGURATIONS] & ~allowedChangingConfigs) != 0) {
    return null;
  }
  if (type == TypedValue.TYPE_NULL) {
    return null;
  }
 else   if (type == TypedValue.TYPE_STRING) {
    return loadStringValueAt(index).toString();
  }
  TypedValue v=mValue;
  if (getValueAt(index,v)) {
    Log.w(Resources.TAG,"String_Node_Str" + v);
    CharSequence cs=v.coerceToString();
    return cs != null ? cs.toString() : null;
  }
  Log.w(Resources.TAG,"String_Node_Str" + Integer.toHexString(type));
  return null;
}
Program: 1517
Project: 1517
Buggy source:
/** 
 * Releases resources associated with this MediaPlayer object. It is considered good practice to call this method when you're done using the MediaPlayer. In particular, whenever an Activity of an application is paused (its onPause() method is called), or stopped (its onStop() method is called), this method should be invoked to release the MediaPlayer object, unless the application has a special need to keep the object around. In addition to unnecessary resources (such as memory and instances of codecs) being held, failure to call this method immediately if a MediaPlayer object is no longer needed may also lead to continuous battery consumption for mobile devices, and playback failure for other applications if no multiple instances of the same codec are supported on a device. Even if multiple instances of the same codec are supported, some performance degradation may be expected when unnecessary multiple instances are used at the same time.
 */
public void release(){
  stayAwake(false);
  updateSurfaceScreenOn();
  mOnPreparedListener=null;
  mOnBufferingUpdateListener=null;
  mOnCompletionListener=null;
  mOnSeekCompleteListener=null;
  mOnErrorListener=null;
  mOnInfoListener=null;
  mOnVideoSizeChangedListener=null;
  mOnTimedTextListener=null;
  mTimeProvider.close();
  mTimeProvider=null;
  mOnSubtitleDataListener=null;
  _release();
}

Fixed version (ground truth):
/** 
 * Releases resources associated with this MediaPlayer object. It is considered good practice to call this method when you're done using the MediaPlayer. In particular, whenever an Activity of an application is paused (its onPause() method is called), or stopped (its onStop() method is called), this method should be invoked to release the MediaPlayer object, unless the application has a special need to keep the object around. In addition to unnecessary resources (such as memory and instances of codecs) being held, failure to call this method immediately if a MediaPlayer object is no longer needed may also lead to continuous battery consumption for mobile devices, and playback failure for other applications if no multiple instances of the same codec are supported on a device. Even if multiple instances of the same codec are supported, some performance degradation may be expected when unnecessary multiple instances are used at the same time.
 */
public void release(){
  stayAwake(false);
  updateSurfaceScreenOn();
  mOnPreparedListener=null;
  mOnBufferingUpdateListener=null;
  mOnCompletionListener=null;
  mOnSeekCompleteListener=null;
  mOnErrorListener=null;
  mOnInfoListener=null;
  mOnVideoSizeChangedListener=null;
  mOnTimedTextListener=null;
  if (mTimeProvider != null) {
    mTimeProvider.close();
    mTimeProvider=null;
  }
  mOnSubtitleDataListener=null;
  _release();
}
Program: 1518
Project: 1518
Buggy source:
/** 
 * Resets the MediaPlayer to its uninitialized state. After calling this method, you will have to initialize it again by setting the data source and calling prepare().
 */
public void reset(){
  mSelectedSubtitleTrackIndex=-1;
synchronized (mOpenSubtitleSources) {
    for (    final InputStream is : mOpenSubtitleSources) {
      try {
        is.close();
      }
 catch (      IOException e) {
      }
    }
    mOpenSubtitleSources.clear();
  }
  mOutOfBandSubtitleTracks.clear();
  mInbandSubtitleTracks=new SubtitleTrack[0];
  if (mSubtitleController != null) {
    mSubtitleController.reset();
  }
  stayAwake(false);
  _reset();
  mEventHandler.removeCallbacksAndMessages(null);
  disableProxyListener();
}

Fixed version (ground truth):
/** 
 * Resets the MediaPlayer to its uninitialized state. After calling this method, you will have to initialize it again by setting the data source and calling prepare().
 */
public void reset(){
  mSelectedSubtitleTrackIndex=-1;
synchronized (mOpenSubtitleSources) {
    for (    final InputStream is : mOpenSubtitleSources) {
      try {
        is.close();
      }
 catch (      IOException e) {
      }
    }
    mOpenSubtitleSources.clear();
  }
  mOutOfBandSubtitleTracks.clear();
  mInbandSubtitleTracks=new SubtitleTrack[0];
  if (mSubtitleController != null) {
    mSubtitleController.reset();
  }
  if (mTimeProvider != null) {
    mTimeProvider.close();
    mTimeProvider=null;
  }
  stayAwake(false);
  _reset();
  if (mEventHandler != null) {
    mEventHandler.removeCallbacksAndMessages(null);
  }
  disableProxyListener();
}
Program: 1519
Project: 1519
Buggy source:
public EventHandler(MediaPlayer mp,Looper looper){
  super(looper);
  mMediaPlayer=mp;
}

Fixed version (ground truth):
public EventHandler(Looper looper){
  super(looper);
}
Program: 1520
Project: 1520
Buggy source:
/** 
 * @hide 
 */
public void close(){
  mEventHandler.removeMessages(NOTIFY);
}

Fixed version (ground truth):
/** 
 * @hide 
 */
public void close(){
  mEventHandler.removeMessages(NOTIFY);
  if (mHandlerThread != null) {
    mHandlerThread.quitSafely();
    mHandlerThread=null;
  }
}
Program: 1521
Project: 1521
Buggy source:
@Override protected void finalize(){
  native_finalize();
}

Fixed version (ground truth):
/** 
 * @hide 
 */
protected void finalize(){
  if (mHandlerThread != null) {
    mHandlerThread.quitSafely();
  }
}
Program: 1522
Project: 1522
Buggy source:
public TimeProvider(MediaPlayer mp){
  mPlayer=mp;
  try {
    getCurrentTimeUs(true,false);
  }
 catch (  IllegalStateException e) {
    mRefresh=true;
  }
  mEventHandler=new EventHandler();
  mListeners=new MediaTimeProvider.OnMediaTimeListener[0];
  mTimes=new long[0];
  mLastTimeUs=0;
  mTimeAdjustment=0;
}

Fixed version (ground truth):
public TimeProvider(MediaPlayer mp){
  mPlayer=mp;
  try {
    getCurrentTimeUs(true,false);
  }
 catch (  IllegalStateException e) {
    mRefresh=true;
  }
  Looper looper;
  if ((looper=Looper.myLooper()) == null && (looper=Looper.getMainLooper()) == null) {
    mHandlerThread=new HandlerThread("String_Node_Str",Process.THREAD_PRIORITY_FOREGROUND);
    mHandlerThread.start();
    looper=mHandlerThread.getLooper();
  }
  mEventHandler=new EventHandler(looper);
  mListeners=new MediaTimeProvider.OnMediaTimeListener[0];
  mTimes=new long[0];
  mLastTimeUs=0;
  mTimeAdjustment=0;
}
Program: 1523
Project: 1523
Buggy source:
/** 
 * @hide 
 */
public MediaTimeProvider getMediaTimeProvider(){
  return mTimeProvider;
}

Fixed version (ground truth):
/** 
 * @hide 
 */
public MediaTimeProvider getMediaTimeProvider(){
  if (mTimeProvider == null) {
    mTimeProvider=new TimeProvider(this);
  }
  return mTimeProvider;
}
Program: 1527
Project: 1527
Buggy source:
/** 
 * @hide Retrieve the string value for the attribute at <var>index</var> that is not allowed to change with the given configurations.
 * @param index Index of attribute to retrieve.
 * @param allowedChangingConfigs Bit mask of configurations fromActivityInfo that are allowed to change.
 * @return String holding string data.  Any styling information isremoved.  Returns null if the attribute is not defined.
 */
public String getNonConfigurationString(int index,int allowedChangingConfigs){
  index*=AssetManager.STYLE_NUM_ENTRIES;
  final int[] data=mData;
  final int type=data[index + AssetManager.STYLE_TYPE];
  if ((data[index + AssetManager.STYLE_CHANGING_CONFIGURATIONS] & ~allowedChangingConfigs) != 0) {
    return null;
  }
  if (type == TypedValue.TYPE_NULL) {
    return null;
  }
 else   if (type == TypedValue.TYPE_STRING) {
    return loadStringValueAt(index).toString();
  }
  TypedValue v=mValue;
  if (getValueAt(index,v)) {
    Log.w(Resources.TAG,"String_Node_Str" + v);
    CharSequence cs=v.coerceToString();
    return cs != null ? cs.toString() : null;
  }
  Log.w(Resources.TAG,"String_Node_Str" + Integer.toHexString(type));
  return null;
}

Fixed version (ground truth):
/** 
 * @hide Retrieve the string value for the attribute at <var>index</var> that is not allowed to change with the given configurations.
 * @param index Index of attribute to retrieve.
 * @param allowedChangingConfigs Bit mask of configurations from{@link Configuration}.NATIVE_CONFIG_* that are allowed to change.
 * @return String holding string data.  Any styling information isremoved.  Returns null if the attribute is not defined.
 */
public String getNonConfigurationString(int index,int allowedChangingConfigs){
  index*=AssetManager.STYLE_NUM_ENTRIES;
  final int[] data=mData;
  final int type=data[index + AssetManager.STYLE_TYPE];
  if ((data[index + AssetManager.STYLE_CHANGING_CONFIGURATIONS] & ~allowedChangingConfigs) != 0) {
    return null;
  }
  if (type == TypedValue.TYPE_NULL) {
    return null;
  }
 else   if (type == TypedValue.TYPE_STRING) {
    return loadStringValueAt(index).toString();
  }
  TypedValue v=mValue;
  if (getValueAt(index,v)) {
    Log.w(Resources.TAG,"String_Node_Str" + v);
    CharSequence cs=v.coerceToString();
    return cs != null ? cs.toString() : null;
  }
  Log.w(Resources.TAG,"String_Node_Str" + Integer.toHexString(type));
  return null;
}
Program: 1528
Project: 1528
Buggy source:
/** 
 * Releases resources associated with this MediaPlayer object. It is considered good practice to call this method when you're done using the MediaPlayer. In particular, whenever an Activity of an application is paused (its onPause() method is called), or stopped (its onStop() method is called), this method should be invoked to release the MediaPlayer object, unless the application has a special need to keep the object around. In addition to unnecessary resources (such as memory and instances of codecs) being held, failure to call this method immediately if a MediaPlayer object is no longer needed may also lead to continuous battery consumption for mobile devices, and playback failure for other applications if no multiple instances of the same codec are supported on a device. Even if multiple instances of the same codec are supported, some performance degradation may be expected when unnecessary multiple instances are used at the same time.
 */
public void release(){
  stayAwake(false);
  updateSurfaceScreenOn();
  mOnPreparedListener=null;
  mOnBufferingUpdateListener=null;
  mOnCompletionListener=null;
  mOnSeekCompleteListener=null;
  mOnErrorListener=null;
  mOnInfoListener=null;
  mOnVideoSizeChangedListener=null;
  mOnTimedTextListener=null;
  mTimeProvider.close();
  mTimeProvider=null;
  mOnSubtitleDataListener=null;
  _release();
}

Fixed version (ground truth):
/** 
 * Releases resources associated with this MediaPlayer object. It is considered good practice to call this method when you're done using the MediaPlayer. In particular, whenever an Activity of an application is paused (its onPause() method is called), or stopped (its onStop() method is called), this method should be invoked to release the MediaPlayer object, unless the application has a special need to keep the object around. In addition to unnecessary resources (such as memory and instances of codecs) being held, failure to call this method immediately if a MediaPlayer object is no longer needed may also lead to continuous battery consumption for mobile devices, and playback failure for other applications if no multiple instances of the same codec are supported on a device. Even if multiple instances of the same codec are supported, some performance degradation may be expected when unnecessary multiple instances are used at the same time.
 */
public void release(){
  stayAwake(false);
  updateSurfaceScreenOn();
  mOnPreparedListener=null;
  mOnBufferingUpdateListener=null;
  mOnCompletionListener=null;
  mOnSeekCompleteListener=null;
  mOnErrorListener=null;
  mOnInfoListener=null;
  mOnVideoSizeChangedListener=null;
  mOnTimedTextListener=null;
  if (mTimeProvider != null) {
    mTimeProvider.close();
    mTimeProvider=null;
  }
  mOnSubtitleDataListener=null;
  _release();
}
Program: 1529
Project: 1529
Buggy source:
/** 
 * Resets the MediaPlayer to its uninitialized state. After calling this method, you will have to initialize it again by setting the data source and calling prepare().
 */
public void reset(){
  mSelectedSubtitleTrackIndex=-1;
synchronized (mOpenSubtitleSources) {
    for (    final InputStream is : mOpenSubtitleSources) {
      try {
        is.close();
      }
 catch (      IOException e) {
      }
    }
    mOpenSubtitleSources.clear();
  }
  mOutOfBandSubtitleTracks.clear();
  mInbandSubtitleTracks=new SubtitleTrack[0];
  if (mSubtitleController != null) {
    mSubtitleController.reset();
  }
  stayAwake(false);
  _reset();
  mEventHandler.removeCallbacksAndMessages(null);
  disableProxyListener();
}

Fixed version (ground truth):
/** 
 * Resets the MediaPlayer to its uninitialized state. After calling this method, you will have to initialize it again by setting the data source and calling prepare().
 */
public void reset(){
  mSelectedSubtitleTrackIndex=-1;
synchronized (mOpenSubtitleSources) {
    for (    final InputStream is : mOpenSubtitleSources) {
      try {
        is.close();
      }
 catch (      IOException e) {
      }
    }
    mOpenSubtitleSources.clear();
  }
  mOutOfBandSubtitleTracks.clear();
  mInbandSubtitleTracks=new SubtitleTrack[0];
  if (mSubtitleController != null) {
    mSubtitleController.reset();
  }
  if (mTimeProvider != null) {
    mTimeProvider.close();
    mTimeProvider=null;
  }
  stayAwake(false);
  _reset();
  if (mEventHandler != null) {
    mEventHandler.removeCallbacksAndMessages(null);
  }
  disableProxyListener();
}
Program: 1530
Project: 1530
Buggy source:
public EventHandler(MediaPlayer mp,Looper looper){
  super(looper);
  mMediaPlayer=mp;
}

Fixed version (ground truth):
public EventHandler(Looper looper){
  super(looper);
}
Program: 1531
Project: 1531
Buggy source:
/** 
 * @hide 
 */
public void close(){
  mEventHandler.removeMessages(NOTIFY);
}

Fixed version (ground truth):
/** 
 * @hide 
 */
public void close(){
  mEventHandler.removeMessages(NOTIFY);
  if (mHandlerThread != null) {
    mHandlerThread.quitSafely();
    mHandlerThread=null;
  }
}
Program: 1532
Project: 1532
Buggy source:
@Override protected void finalize(){
  native_finalize();
}

Fixed version (ground truth):
/** 
 * @hide 
 */
protected void finalize(){
  if (mHandlerThread != null) {
    mHandlerThread.quitSafely();
  }
}
Program: 1533
Project: 1533
Buggy source:
public TimeProvider(MediaPlayer mp){
  mPlayer=mp;
  try {
    getCurrentTimeUs(true,false);
  }
 catch (  IllegalStateException e) {
    mRefresh=true;
  }
  mEventHandler=new EventHandler();
  mListeners=new MediaTimeProvider.OnMediaTimeListener[0];
  mTimes=new long[0];
  mLastTimeUs=0;
  mTimeAdjustment=0;
}

Fixed version (ground truth):
public TimeProvider(MediaPlayer mp){
  mPlayer=mp;
  try {
    getCurrentTimeUs(true,false);
  }
 catch (  IllegalStateException e) {
    mRefresh=true;
  }
  Looper looper;
  if ((looper=Looper.myLooper()) == null && (looper=Looper.getMainLooper()) == null) {
    mHandlerThread=new HandlerThread("String_Node_Str",Process.THREAD_PRIORITY_FOREGROUND);
    mHandlerThread.start();
    looper=mHandlerThread.getLooper();
  }
  mEventHandler=new EventHandler(looper);
  mListeners=new MediaTimeProvider.OnMediaTimeListener[0];
  mTimes=new long[0];
  mLastTimeUs=0;
  mTimeAdjustment=0;
}
Program: 1534
Project: 1534
Buggy source:
/** 
 * @hide 
 */
public MediaTimeProvider getMediaTimeProvider(){
  return mTimeProvider;
}

Fixed version (ground truth):
/** 
 * @hide 
 */
public MediaTimeProvider getMediaTimeProvider(){
  if (mTimeProvider == null) {
    mTimeProvider=new TimeProvider(this);
  }
  return mTimeProvider;
}
Program: 1535
Project: 1535
Buggy source:
/** 
 * Releases resources associated with this MediaPlayer object. It is considered good practice to call this method when you're done using the MediaPlayer. In particular, whenever an Activity of an application is paused (its onPause() method is called), or stopped (its onStop() method is called), this method should be invoked to release the MediaPlayer object, unless the application has a special need to keep the object around. In addition to unnecessary resources (such as memory and instances of codecs) being held, failure to call this method immediately if a MediaPlayer object is no longer needed may also lead to continuous battery consumption for mobile devices, and playback failure for other applications if no multiple instances of the same codec are supported on a device. Even if multiple instances of the same codec are supported, some performance degradation may be expected when unnecessary multiple instances are used at the same time.
 */
public void release(){
  stayAwake(false);
  updateSurfaceScreenOn();
  mOnPreparedListener=null;
  mOnBufferingUpdateListener=null;
  mOnCompletionListener=null;
  mOnSeekCompleteListener=null;
  mOnErrorListener=null;
  mOnInfoListener=null;
  mOnVideoSizeChangedListener=null;
  mOnTimedTextListener=null;
  mTimeProvider.close();
  mTimeProvider=null;
  mOnSubtitleDataListener=null;
  _release();
}

Fixed version (ground truth):
/** 
 * Releases resources associated with this MediaPlayer object. It is considered good practice to call this method when you're done using the MediaPlayer. In particular, whenever an Activity of an application is paused (its onPause() method is called), or stopped (its onStop() method is called), this method should be invoked to release the MediaPlayer object, unless the application has a special need to keep the object around. In addition to unnecessary resources (such as memory and instances of codecs) being held, failure to call this method immediately if a MediaPlayer object is no longer needed may also lead to continuous battery consumption for mobile devices, and playback failure for other applications if no multiple instances of the same codec are supported on a device. Even if multiple instances of the same codec are supported, some performance degradation may be expected when unnecessary multiple instances are used at the same time.
 */
public void release(){
  stayAwake(false);
  updateSurfaceScreenOn();
  mOnPreparedListener=null;
  mOnBufferingUpdateListener=null;
  mOnCompletionListener=null;
  mOnSeekCompleteListener=null;
  mOnErrorListener=null;
  mOnInfoListener=null;
  mOnVideoSizeChangedListener=null;
  mOnTimedTextListener=null;
  if (mTimeProvider != null) {
    mTimeProvider.close();
    mTimeProvider=null;
  }
  mOnSubtitleDataListener=null;
  _release();
}
Program: 1536
Project: 1536
Buggy source:
/** 
 * Resets the MediaPlayer to its uninitialized state. After calling this method, you will have to initialize it again by setting the data source and calling prepare().
 */
public void reset(){
  mSelectedSubtitleTrackIndex=-1;
synchronized (mOpenSubtitleSources) {
    for (    final InputStream is : mOpenSubtitleSources) {
      try {
        is.close();
      }
 catch (      IOException e) {
      }
    }
    mOpenSubtitleSources.clear();
  }
  mOutOfBandSubtitleTracks.clear();
  mInbandSubtitleTracks=new SubtitleTrack[0];
  if (mSubtitleController != null) {
    mSubtitleController.reset();
  }
  stayAwake(false);
  _reset();
  mEventHandler.removeCallbacksAndMessages(null);
  disableProxyListener();
}

Fixed version (ground truth):
/** 
 * Resets the MediaPlayer to its uninitialized state. After calling this method, you will have to initialize it again by setting the data source and calling prepare().
 */
public void reset(){
  mSelectedSubtitleTrackIndex=-1;
synchronized (mOpenSubtitleSources) {
    for (    final InputStream is : mOpenSubtitleSources) {
      try {
        is.close();
      }
 catch (      IOException e) {
      }
    }
    mOpenSubtitleSources.clear();
  }
  mOutOfBandSubtitleTracks.clear();
  mInbandSubtitleTracks=new SubtitleTrack[0];
  if (mSubtitleController != null) {
    mSubtitleController.reset();
  }
  if (mTimeProvider != null) {
    mTimeProvider.close();
    mTimeProvider=null;
  }
  stayAwake(false);
  _reset();
  if (mEventHandler != null) {
    mEventHandler.removeCallbacksAndMessages(null);
  }
  disableProxyListener();
}
Program: 1537
Project: 1537
Buggy source:
public EventHandler(MediaPlayer mp,Looper looper){
  super(looper);
  mMediaPlayer=mp;
}

Fixed version (ground truth):
public EventHandler(Looper looper){
  super(looper);
}
Program: 1538
Project: 1538
Buggy source:
/** 
 * @hide 
 */
public void close(){
  mEventHandler.removeMessages(NOTIFY);
}

Fixed version (ground truth):
/** 
 * @hide 
 */
public void close(){
  mEventHandler.removeMessages(NOTIFY);
  if (mHandlerThread != null) {
    mHandlerThread.quitSafely();
    mHandlerThread=null;
  }
}
Program: 1539
Project: 1539
Buggy source:
@Override protected void finalize(){
  native_finalize();
}

Fixed version (ground truth):
/** 
 * @hide 
 */
protected void finalize(){
  if (mHandlerThread != null) {
    mHandlerThread.quitSafely();
  }
}
Program: 1540
Project: 1540
Buggy source:
public TimeProvider(MediaPlayer mp){
  mPlayer=mp;
  try {
    getCurrentTimeUs(true,false);
  }
 catch (  IllegalStateException e) {
    mRefresh=true;
  }
  mEventHandler=new EventHandler();
  mListeners=new MediaTimeProvider.OnMediaTimeListener[0];
  mTimes=new long[0];
  mLastTimeUs=0;
  mTimeAdjustment=0;
}

Fixed version (ground truth):
public TimeProvider(MediaPlayer mp){
  mPlayer=mp;
  try {
    getCurrentTimeUs(true,false);
  }
 catch (  IllegalStateException e) {
    mRefresh=true;
  }
  Looper looper;
  if ((looper=Looper.myLooper()) == null && (looper=Looper.getMainLooper()) == null) {
    mHandlerThread=new HandlerThread("String_Node_Str",Process.THREAD_PRIORITY_FOREGROUND);
    mHandlerThread.start();
    looper=mHandlerThread.getLooper();
  }
  mEventHandler=new EventHandler(looper);
  mListeners=new MediaTimeProvider.OnMediaTimeListener[0];
  mTimes=new long[0];
  mLastTimeUs=0;
  mTimeAdjustment=0;
}
Program: 1541
Project: 1541
Buggy source:
/** 
 * @hide 
 */
public MediaTimeProvider getMediaTimeProvider(){
  return mTimeProvider;
}

Fixed version (ground truth):
/** 
 * @hide 
 */
public MediaTimeProvider getMediaTimeProvider(){
  if (mTimeProvider == null) {
    mTimeProvider=new TimeProvider(this);
  }
  return mTimeProvider;
}
Program: 1542
Project: 1542
Buggy source:
/** 
 * Releases resources associated with this MediaPlayer object. It is considered good practice to call this method when you're done using the MediaPlayer. In particular, whenever an Activity of an application is paused (its onPause() method is called), or stopped (its onStop() method is called), this method should be invoked to release the MediaPlayer object, unless the application has a special need to keep the object around. In addition to unnecessary resources (such as memory and instances of codecs) being held, failure to call this method immediately if a MediaPlayer object is no longer needed may also lead to continuous battery consumption for mobile devices, and playback failure for other applications if no multiple instances of the same codec are supported on a device. Even if multiple instances of the same codec are supported, some performance degradation may be expected when unnecessary multiple instances are used at the same time.
 */
public void release(){
  stayAwake(false);
  updateSurfaceScreenOn();
  mOnPreparedListener=null;
  mOnBufferingUpdateListener=null;
  mOnCompletionListener=null;
  mOnSeekCompleteListener=null;
  mOnErrorListener=null;
  mOnInfoListener=null;
  mOnVideoSizeChangedListener=null;
  mOnTimedTextListener=null;
  mTimeProvider.close();
  mTimeProvider=null;
  mOnSubtitleDataListener=null;
  _release();
}

Fixed version (ground truth):
/** 
 * Releases resources associated with this MediaPlayer object. It is considered good practice to call this method when you're done using the MediaPlayer. In particular, whenever an Activity of an application is paused (its onPause() method is called), or stopped (its onStop() method is called), this method should be invoked to release the MediaPlayer object, unless the application has a special need to keep the object around. In addition to unnecessary resources (such as memory and instances of codecs) being held, failure to call this method immediately if a MediaPlayer object is no longer needed may also lead to continuous battery consumption for mobile devices, and playback failure for other applications if no multiple instances of the same codec are supported on a device. Even if multiple instances of the same codec are supported, some performance degradation may be expected when unnecessary multiple instances are used at the same time.
 */
public void release(){
  stayAwake(false);
  updateSurfaceScreenOn();
  mOnPreparedListener=null;
  mOnBufferingUpdateListener=null;
  mOnCompletionListener=null;
  mOnSeekCompleteListener=null;
  mOnErrorListener=null;
  mOnInfoListener=null;
  mOnVideoSizeChangedListener=null;
  mOnTimedTextListener=null;
  if (mTimeProvider != null) {
    mTimeProvider.close();
    mTimeProvider=null;
  }
  mOnSubtitleDataListener=null;
  _release();
}
Program: 1543
Project: 1543
Buggy source:
/** 
 * Resets the MediaPlayer to its uninitialized state. After calling this method, you will have to initialize it again by setting the data source and calling prepare().
 */
public void reset(){
  mSelectedSubtitleTrackIndex=-1;
synchronized (mOpenSubtitleSources) {
    for (    final InputStream is : mOpenSubtitleSources) {
      try {
        is.close();
      }
 catch (      IOException e) {
      }
    }
    mOpenSubtitleSources.clear();
  }
  mOutOfBandSubtitleTracks.clear();
  mInbandSubtitleTracks=new SubtitleTrack[0];
  if (mSubtitleController != null) {
    mSubtitleController.reset();
  }
  stayAwake(false);
  _reset();
  mEventHandler.removeCallbacksAndMessages(null);
  disableProxyListener();
}

Fixed version (ground truth):
/** 
 * Resets the MediaPlayer to its uninitialized state. After calling this method, you will have to initialize it again by setting the data source and calling prepare().
 */
public void reset(){
  mSelectedSubtitleTrackIndex=-1;
synchronized (mOpenSubtitleSources) {
    for (    final InputStream is : mOpenSubtitleSources) {
      try {
        is.close();
      }
 catch (      IOException e) {
      }
    }
    mOpenSubtitleSources.clear();
  }
  mOutOfBandSubtitleTracks.clear();
  mInbandSubtitleTracks=new SubtitleTrack[0];
  if (mSubtitleController != null) {
    mSubtitleController.reset();
  }
  if (mTimeProvider != null) {
    mTimeProvider.close();
    mTimeProvider=null;
  }
  stayAwake(false);
  _reset();
  if (mEventHandler != null) {
    mEventHandler.removeCallbacksAndMessages(null);
  }
  disableProxyListener();
}
Program: 1544
Project: 1544
Buggy source:
public EventHandler(MediaPlayer mp,Looper looper){
  super(looper);
  mMediaPlayer=mp;
}

Fixed version (ground truth):
public EventHandler(Looper looper){
  super(looper);
}
Program: 1545
Project: 1545
Buggy source:
/** 
 * @hide 
 */
public void close(){
  mEventHandler.removeMessages(NOTIFY);
}

Fixed version (ground truth):
/** 
 * @hide 
 */
public void close(){
  mEventHandler.removeMessages(NOTIFY);
  if (mHandlerThread != null) {
    mHandlerThread.quitSafely();
    mHandlerThread=null;
  }
}
Program: 1546
Project: 1546
Buggy source:
@Override protected void finalize(){
  native_finalize();
}

Fixed version (ground truth):
/** 
 * @hide 
 */
protected void finalize(){
  if (mHandlerThread != null) {
    mHandlerThread.quitSafely();
  }
}
Program: 1547
Project: 1547
Buggy source:
public TimeProvider(MediaPlayer mp){
  mPlayer=mp;
  try {
    getCurrentTimeUs(true,false);
  }
 catch (  IllegalStateException e) {
    mRefresh=true;
  }
  mEventHandler=new EventHandler();
  mListeners=new MediaTimeProvider.OnMediaTimeListener[0];
  mTimes=new long[0];
  mLastTimeUs=0;
  mTimeAdjustment=0;
}

Fixed version (ground truth):
public TimeProvider(MediaPlayer mp){
  mPlayer=mp;
  try {
    getCurrentTimeUs(true,false);
  }
 catch (  IllegalStateException e) {
    mRefresh=true;
  }
  Looper looper;
  if ((looper=Looper.myLooper()) == null && (looper=Looper.getMainLooper()) == null) {
    mHandlerThread=new HandlerThread("String_Node_Str",Process.THREAD_PRIORITY_FOREGROUND);
    mHandlerThread.start();
    looper=mHandlerThread.getLooper();
  }
  mEventHandler=new EventHandler(looper);
  mListeners=new MediaTimeProvider.OnMediaTimeListener[0];
  mTimes=new long[0];
  mLastTimeUs=0;
  mTimeAdjustment=0;
}
Program: 1548
Project: 1548
Buggy source:
/** 
 * @hide 
 */
public MediaTimeProvider getMediaTimeProvider(){
  return mTimeProvider;
}

Fixed version (ground truth):
/** 
 * @hide 
 */
public MediaTimeProvider getMediaTimeProvider(){
  if (mTimeProvider == null) {
    mTimeProvider=new TimeProvider(this);
  }
  return mTimeProvider;
}
Program: 1549
Project: 1549
Buggy source:
/** 
 * Releases resources associated with this MediaPlayer object. It is considered good practice to call this method when you're done using the MediaPlayer. In particular, whenever an Activity of an application is paused (its onPause() method is called), or stopped (its onStop() method is called), this method should be invoked to release the MediaPlayer object, unless the application has a special need to keep the object around. In addition to unnecessary resources (such as memory and instances of codecs) being held, failure to call this method immediately if a MediaPlayer object is no longer needed may also lead to continuous battery consumption for mobile devices, and playback failure for other applications if no multiple instances of the same codec are supported on a device. Even if multiple instances of the same codec are supported, some performance degradation may be expected when unnecessary multiple instances are used at the same time.
 */
public void release(){
  stayAwake(false);
  updateSurfaceScreenOn();
  mOnPreparedListener=null;
  mOnBufferingUpdateListener=null;
  mOnCompletionListener=null;
  mOnSeekCompleteListener=null;
  mOnErrorListener=null;
  mOnInfoListener=null;
  mOnVideoSizeChangedListener=null;
  mOnTimedTextListener=null;
  mTimeProvider.close();
  mTimeProvider=null;
  mOnSubtitleDataListener=null;
  _release();
}

Fixed version (ground truth):
/** 
 * Releases resources associated with this MediaPlayer object. It is considered good practice to call this method when you're done using the MediaPlayer. In particular, whenever an Activity of an application is paused (its onPause() method is called), or stopped (its onStop() method is called), this method should be invoked to release the MediaPlayer object, unless the application has a special need to keep the object around. In addition to unnecessary resources (such as memory and instances of codecs) being held, failure to call this method immediately if a MediaPlayer object is no longer needed may also lead to continuous battery consumption for mobile devices, and playback failure for other applications if no multiple instances of the same codec are supported on a device. Even if multiple instances of the same codec are supported, some performance degradation may be expected when unnecessary multiple instances are used at the same time.
 */
public void release(){
  stayAwake(false);
  updateSurfaceScreenOn();
  mOnPreparedListener=null;
  mOnBufferingUpdateListener=null;
  mOnCompletionListener=null;
  mOnSeekCompleteListener=null;
  mOnErrorListener=null;
  mOnInfoListener=null;
  mOnVideoSizeChangedListener=null;
  mOnTimedTextListener=null;
  if (mTimeProvider != null) {
    mTimeProvider.close();
    mTimeProvider=null;
  }
  mOnSubtitleDataListener=null;
  _release();
}
Program: 1550
Project: 1550
Buggy source:
/** 
 * Resets the MediaPlayer to its uninitialized state. After calling this method, you will have to initialize it again by setting the data source and calling prepare().
 */
public void reset(){
  mSelectedSubtitleTrackIndex=-1;
synchronized (mOpenSubtitleSources) {
    for (    final InputStream is : mOpenSubtitleSources) {
      try {
        is.close();
      }
 catch (      IOException e) {
      }
    }
    mOpenSubtitleSources.clear();
  }
  mOutOfBandSubtitleTracks.clear();
  mInbandSubtitleTracks=new SubtitleTrack[0];
  if (mSubtitleController != null) {
    mSubtitleController.reset();
  }
  stayAwake(false);
  _reset();
  mEventHandler.removeCallbacksAndMessages(null);
  disableProxyListener();
}

Fixed version (ground truth):
/** 
 * Resets the MediaPlayer to its uninitialized state. After calling this method, you will have to initialize it again by setting the data source and calling prepare().
 */
public void reset(){
  mSelectedSubtitleTrackIndex=-1;
synchronized (mOpenSubtitleSources) {
    for (    final InputStream is : mOpenSubtitleSources) {
      try {
        is.close();
      }
 catch (      IOException e) {
      }
    }
    mOpenSubtitleSources.clear();
  }
  mOutOfBandSubtitleTracks.clear();
  mInbandSubtitleTracks=new SubtitleTrack[0];
  if (mSubtitleController != null) {
    mSubtitleController.reset();
  }
  if (mTimeProvider != null) {
    mTimeProvider.close();
    mTimeProvider=null;
  }
  stayAwake(false);
  _reset();
  if (mEventHandler != null) {
    mEventHandler.removeCallbacksAndMessages(null);
  }
  disableProxyListener();
}
Program: 1551
Project: 1551
Buggy source:
public EventHandler(MediaPlayer mp,Looper looper){
  super(looper);
  mMediaPlayer=mp;
}

Fixed version (ground truth):
public EventHandler(Looper looper){
  super(looper);
}
Program: 1552
Project: 1552
Buggy source:
/** 
 * @hide 
 */
public void close(){
  mEventHandler.removeMessages(NOTIFY);
}

Fixed version (ground truth):
/** 
 * @hide 
 */
public void close(){
  mEventHandler.removeMessages(NOTIFY);
  if (mHandlerThread != null) {
    mHandlerThread.quitSafely();
    mHandlerThread=null;
  }
}
Program: 1553
Project: 1553
Buggy source:
@Override protected void finalize(){
  native_finalize();
}

Fixed version (ground truth):
/** 
 * @hide 
 */
protected void finalize(){
  if (mHandlerThread != null) {
    mHandlerThread.quitSafely();
  }
}
Program: 1554
Project: 1554
Buggy source:
public TimeProvider(MediaPlayer mp){
  mPlayer=mp;
  try {
    getCurrentTimeUs(true,false);
  }
 catch (  IllegalStateException e) {
    mRefresh=true;
  }
  mEventHandler=new EventHandler();
  mListeners=new MediaTimeProvider.OnMediaTimeListener[0];
  mTimes=new long[0];
  mLastTimeUs=0;
  mTimeAdjustment=0;
}

Fixed version (ground truth):
public TimeProvider(MediaPlayer mp){
  mPlayer=mp;
  try {
    getCurrentTimeUs(true,false);
  }
 catch (  IllegalStateException e) {
    mRefresh=true;
  }
  Looper looper;
  if ((looper=Looper.myLooper()) == null && (looper=Looper.getMainLooper()) == null) {
    mHandlerThread=new HandlerThread("String_Node_Str",Process.THREAD_PRIORITY_FOREGROUND);
    mHandlerThread.start();
    looper=mHandlerThread.getLooper();
  }
  mEventHandler=new EventHandler(looper);
  mListeners=new MediaTimeProvider.OnMediaTimeListener[0];
  mTimes=new long[0];
  mLastTimeUs=0;
  mTimeAdjustment=0;
}
Program: 1555
Project: 1555
Buggy source:
/** 
 * @hide 
 */
public MediaTimeProvider getMediaTimeProvider(){
  return mTimeProvider;
}

Fixed version (ground truth):
/** 
 * @hide 
 */
public MediaTimeProvider getMediaTimeProvider(){
  if (mTimeProvider == null) {
    mTimeProvider=new TimeProvider(this);
  }
  return mTimeProvider;
}
Program: 1556
Project: 1556
Buggy source:
/** 
 * Returns a new media size in a portrait orientation which is the height is the greater dimension.
 * @return New instance in landscape orientation.
 */
public MediaSize asPortrait(){
  return new MediaSize(mId,mPackageName,mLabel,Math.min(mWidthMils,mHeightMils),Math.max(mWidthMils,mHeightMils),mLabelResId);
}

Fixed version (ground truth):
/** 
 * Returns a new media size in a portrait orientation which is the height is the greater dimension.
 * @return New instance in landscape orientation.
 */
public MediaSize asPortrait(){
  return new MediaSize(mId,mLabel,mPackageName,Math.min(mWidthMils,mHeightMils),Math.max(mWidthMils,mHeightMils),mLabelResId);
}
Program: 1557
Project: 1557
Buggy source:
/** 
 * Returns a new media size in a landscape orientation which is the height is the lesser dimension.
 * @return New instance in landscape orientation.
 */
public MediaSize asLandscape(){
  return new MediaSize(mId,mLabel,Math.max(mWidthMils,mHeightMils),Math.min(mWidthMils,mHeightMils),mLabelResId);
}

Fixed version (ground truth):
/** 
 * Returns a new media size in a landscape orientation which is the height is the lesser dimension.
 * @return New instance in landscape orientation.
 */
public MediaSize asLandscape(){
  return new MediaSize(mId,mLabel,mPackageName,Math.max(mWidthMils,mHeightMils),Math.min(mWidthMils,mHeightMils),mLabelResId);
}
Program: 1558
Project: 1558
Buggy source:
@SuppressWarnings("String_Node_Str") public void addPrinterAndWritePrinterHistory(PrinterInfo printer){
  if (mHistoricalPrinters.size() >= MAX_HISTORY_LENGTH) {
    mHistoricalPrinters.remove(0);
  }
  mHistoricalPrinters.add(printer);
  mWriteTask.executeOnExecutor(AsyncTask.SERIAL_EXECUTOR,new ArrayList<PrinterInfo>(mHistoricalPrinters));
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void addPrinterAndWritePrinterHistory(PrinterInfo printer){
  if (mHistoricalPrinters.size() >= MAX_HISTORY_LENGTH) {
    mHistoricalPrinters.remove(0);
  }
  mHistoricalPrinters.add(printer);
  new WriteTask().executeOnExecutor(AsyncTask.SERIAL_EXECUTOR,new ArrayList<PrinterInfo>(mHistoricalPrinters));
}
Program: 1559
Project: 1559
Buggy source:
public boolean stopReadPrinterHistory(){
  return mReadTask.cancel(true);
}

Fixed version (ground truth):
public boolean stopReadPrinterHistory(){
  final boolean cancelled=mReadTask.cancel(true);
  mReadTask=null;
  return cancelled;
}
Program: 1560
Project: 1560
Buggy source:
public void readPrinterHistory(){
  if (DEBUG) {
    Log.i(LOG_TAG,"String_Node_Str");
  }
  mReadHistoryInProgress=true;
  mReadTask.executeOnExecutor(AsyncTask.SERIAL_EXECUTOR,(Void[])null);
}

Fixed version (ground truth):
public void readPrinterHistory(){
  if (DEBUG) {
    Log.i(LOG_TAG,"String_Node_Str");
  }
  mReadHistoryInProgress=true;
  mReadTask=new ReadTask();
  mReadTask.executeOnExecutor(AsyncTask.SERIAL_EXECUTOR,(Void[])null);
}
Program: 1561
Project: 1561
Buggy source:
@Override protected void onPostExecute(List<PrinterInfo> printers){
  if (DEBUG) {
    Log.i(LOG_TAG,"String_Node_Str" + FusedPrintersProvider.this.hashCode());
  }
  mHistoricalPrinters=printers;
  mFavoritePrinters.addAll(computeFavoritePrinters(printers));
  mReadHistoryInProgress=false;
  mReadHistoryCompleted=true;
  computeAndDeliverResult();
  loadInternal();
}

Fixed version (ground truth):
@Override protected void onPostExecute(List<PrinterInfo> printers){
  if (DEBUG) {
    Log.i(LOG_TAG,"String_Node_Str" + FusedPrintersProvider.this.hashCode());
  }
  mHistoricalPrinters=printers;
  mFavoritePrinters.addAll(computeFavoritePrinters(printers));
  mReadHistoryInProgress=false;
  mReadHistoryCompleted=true;
  computeAndDeliverResult();
  loadInternal();
  mReadTask=null;
}
Program: 1562
Project: 1562
Buggy source:
private void updateUiForNewPrinterCapabilities(){
  if (!mMediaSizeSpinnerAdapter.isEmpty()) {
    mIgnoreNextMediaSizeChange=true;
    mMediaSizeSpinnerAdapter.clear();
  }
  if (!mColorModeSpinnerAdapter.isEmpty()) {
    mIgnoreNextColorModeChange=true;
    mColorModeSpinnerAdapter.clear();
  }
  if (!mOrientationSpinnerAdapter.isEmpty()) {
    mIgnoreNextOrientationChange=true;
    mOrientationSpinner.setSelection(0);
  }
  if (mRangeOptionsSpinner.getSelectedItemPosition() != 0) {
    mIgnoreNextRangeOptionChange=true;
    mRangeOptionsSpinner.setSelection(0);
  }
  if (!TextUtils.isEmpty(mCopiesEditText.getText())) {
    mIgnoreNextCopiesChange=true;
    mCopiesEditText.setText(MIN_COPIES_STRING);
  }
  updateUi();
}

Fixed version (ground truth):
private void updateUiForNewPrinterCapabilities(){
  if (!mMediaSizeSpinnerAdapter.isEmpty()) {
    mIgnoreNextMediaSizeChange=true;
    mMediaSizeSpinnerAdapter.clear();
  }
  if (!mColorModeSpinnerAdapter.isEmpty()) {
    mIgnoreNextColorModeChange=true;
    mColorModeSpinnerAdapter.clear();
  }
  if (mOrientationSpinner.getSelectedItemPosition() != 0) {
    mIgnoreNextOrientationChange=true;
    mOrientationSpinner.setSelection(0);
  }
  if (mRangeOptionsSpinner.getSelectedItemPosition() != 0) {
    mIgnoreNextRangeOptionChange=true;
    mRangeOptionsSpinner.setSelection(0);
  }
  if (!TextUtils.isEmpty(mCopiesEditText.getText())) {
    mIgnoreNextCopiesChange=true;
    mCopiesEditText.setText(MIN_COPIES_STRING);
  }
  updateUi();
}
Program: 1563
Project: 1563
Buggy source:
public boolean onTouchEvent(MotionEvent event){
  if (!mEditor.isPrintConfirmed() && !mEditor.isPreviewConfirmed() && mEditor.shouldCloseOnTouch(event)) {
    if (!mController.isWorking()) {
      PrintJobConfigActivity.this.finish();
    }
    mEditor.cancel();
    return true;
  }
  return super.onTouchEvent(event);
}

Fixed version (ground truth):
public boolean onTouchEvent(MotionEvent event){
  if (!mEditor.isPrintConfirmed() && mEditor.shouldCloseOnTouch(event)) {
    if (!mController.isWorking()) {
      PrintJobConfigActivity.this.finish();
    }
    mEditor.cancel();
    return true;
  }
  return super.onTouchEvent(event);
}
Program: 1565
Project: 1565
Buggy source:
public void addCurrentPrinterToHistory(){
  PrinterInfo printer=(PrinterInfo)mDestinationSpinner.getSelectedItem();
  if (printer != null) {
    FusedPrintersProvider printersLoader=(FusedPrintersProvider)(Loader<?>)getLoaderManager().getLoader(LOADER_ID_PRINTERS_LOADER);
    if (printersLoader != null) {
      printersLoader.addHistoricalPrinter(printer);
    }
  }
}

Fixed version (ground truth):
public void addCurrentPrinterToHistory(){
  PrinterInfo printer=(PrinterInfo)mDestinationSpinner.getSelectedItem();
  PrinterId fakePdfPritnerId=mDestinationSpinnerAdapter.mFakePdfPrinter.getId();
  if (printer != null && !printer.getId().equals(fakePdfPritnerId)) {
    FusedPrintersProvider printersLoader=(FusedPrintersProvider)(Loader<?>)getLoaderManager().getLoader(LOADER_ID_PRINTERS_LOADER);
    if (printersLoader != null) {
      printersLoader.addHistoricalPrinter(printer);
    }
  }
}