auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static java.lang.CharSequence getLabelForVideoRequest ( android.content.Context context , com.android.incallui.incall.protocol.PrimaryCallState state ) { switch ( state.sessionModificationState ) { case com.android.incallui.videotech.utils.SessionModificationState.WAITING_FOR_UPGRADE_TO_VIDEO_RESPONSE : return context.getString ( R.string.incall_video_call_requesting ) ; case com.android.incallui.videotech.utils.SessionModificationState.REQUEST_FAILED : case com.android.incallui.videotech.utils.SessionModificationState.UPGRADE_TO_VIDEO_REQUEST_FAILED : return context.getString ( R.string.incall_video_call_request_failed ) ; case com.android.incallui.videotech.utils.SessionModificationState.REQUEST_REJECTED : return context.getString ( R.string.incall_video_call_request_rejected ) ; case com.android.incallui.videotech.utils.SessionModificationState.UPGRADE_TO_VIDEO_REQUEST_TIMED_OUT : return context.getString ( R.string.incall_video_call_request_timed_out ) ; case com.android.incallui.videotech.utils.SessionModificationState.RECEIVED_UPGRADE_TO_VIDEO_REQUEST : return com.android.incallui.contactgrid.TopRow.getLabelForIncomingVideo ( context , state.sessionModificationState , state.isWifi ) ; case com.android.incallui.videotech.utils.SessionModificationState.NO_REQUEST : default : com.android.dialer.common.Assert.fail ( ) ; return null ; } }

Target:
private static java.lang.CharSequence getLabelForVideoRequest ( android.content.Context context , com.android.incallui.incall.protocol.PrimaryCallState state ) { switch ( state.sessionModificationState ) { case com.android.incallui.videotech.utils.SessionModificationState.WAITING_FOR_UPGRADE_TO_VIDEO_RESPONSE : return context.getString ( R.string.incall_video_call_upgrade_request ) ; case com.android.incallui.videotech.utils.SessionModificationState.REQUEST_FAILED : case com.android.incallui.videotech.utils.SessionModificationState.UPGRADE_TO_VIDEO_REQUEST_FAILED : return context.getString ( R.string.incall_video_call_request_failed ) ; case com.android.incallui.videotech.utils.SessionModificationState.REQUEST_REJECTED : return context.getString ( R.string.incall_video_call_request_rejected ) ; case com.android.incallui.videotech.utils.SessionModificationState.UPGRADE_TO_VIDEO_REQUEST_TIMED_OUT : return context.getString ( R.string.incall_video_call_request_timed_out ) ; case com.android.incallui.videotech.utils.SessionModificationState.RECEIVED_UPGRADE_TO_VIDEO_REQUEST : return com.android.incallui.contactgrid.TopRow.getLabelForIncomingVideo ( context , state.sessionModificationState , state.isWifi ) ; case com.android.incallui.videotech.utils.SessionModificationState.NO_REQUEST : default : com.android.dialer.common.Assert.fail ( ) ; return null ; } }
Source:
protected void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; if ( ( com.android.ide.eclipse.adt.internal.editors.layout.refactoring.AdtProjectTest.sProject ) == null ) { org.eclipse.core.resources.IProject project = null ; java.lang.String projectName = "testproject-" + ( java.lang.System.currentTimeMillis ( ) ) ; project = createProject ( projectName ) ; assertNotNull ( project ) ; com.android.ide.eclipse.adt.internal.editors.layout.refactoring.AdtProjectTest.sProject = project ; } }

Target:
protected org.eclipse.core.resources.IProject getProject ( ) { java.lang.String projectName = getProjectName ( ) ; org.eclipse.core.resources.IProject project = com.android.ide.eclipse.adt.internal.editors.layout.refactoring.AdtProjectTest.sProjectMap.get ( projectName ) ; if ( project == null ) { project = createProject ( projectName ) ; assertNotNull ( project ) ; com.android.ide.eclipse.adt.internal.editors.layout.refactoring.AdtProjectTest.sProjectMap.put ( projectName , project ) ; } return project ; }
Source:
public com.android.jack.dx.io.instructions.DecodedInstruction decode ( int opcodeUnit , com.android.jack.dx.io.instructions.CodeInput in ) throws java.io.EOFException { int opcode = com.android.jack.dx.io.instructions.InstructionCodec.byte0 ( opcodeUnit ) ; int a = com.android.jack.dx.io.instructions.InstructionCodec.byte1 ( opcodeUnit ) ; int index = in.readInt ( ) ; com.android.jack.dx.io.IndexType indexType = com.android.jack.dx.io.OpcodeInfo.getIndexType ( opcode ) ; return new com.android.jack.dx.io.instructions.OneRegisterDecodedInstruction ( this , opcode , index , indexType , 0 , 0L , a ) ; }

Target:
public com.android.jack.dx.io.instructions.DecodedInstruction decode ( int opcodeUnit , com.android.jack.dx.io.instructions.CodeInput in ) throws java.io.EOFException { return com.android.jack.dx.io.instructions.InstructionCodec.decodeRegisterList ( this , opcodeUnit , in ) ; }
Source:
public static void validate ( @ com.android.annotations.NonNull com.android.manifmerger.XmlDocument xmlDocument , @ com.android.annotations.NonNull com.android.manifmerger.MergingReport.Builder mergingReport ) { com.google.common.base.Preconditions.checkNotNull ( xmlDocument ) ; com.google.common.base.Preconditions.checkNotNull ( mergingReport ) ; com.android.manifmerger.PostValidator.reOrderElements ( xmlDocument.getRootNode ( ) ) ; com.android.manifmerger.PostValidator.validate ( xmlDocument.getRootNode ( ) , mergingReport.getActionRecorder ( ) . build ( ) , mergingReport ) ; }

Target:
public static void validate ( @ com.android.annotations.NonNull com.android.manifmerger.XmlDocument xmlDocument , @ com.android.annotations.NonNull com.android.manifmerger.MergingReport.Builder mergingReport ) { com.google.common.base.Preconditions.checkNotNull ( xmlDocument ) ; com.google.common.base.Preconditions.checkNotNull ( mergingReport ) ; com.android.manifmerger.PostValidator.enforceAndroidNamespaceDeclaration ( xmlDocument ) ; com.android.manifmerger.PostValidator.reOrderElements ( xmlDocument.getRootNode ( ) ) ; com.android.manifmerger.PostValidator.validate ( xmlDocument.getRootNode ( ) , mergingReport.getActionRecorder ( ) . build ( ) , mergingReport ) ; }
Source:
public void onGetReport ( byte type , byte id , int bufferSize ) { android.util.Log.d ( android.bluetooth.BluetoothHidDeviceCallback.TAG , ( ( ( ( ( "onGetReport: type=" + type ) + " id=" ) + id ) + " bufferSize=" ) + bufferSize ) ) ; }

Target:
public void onGetReport ( android.bluetooth.BluetoothDevice device , byte type , byte id , int bufferSize ) { android.util.Log.d ( android.bluetooth.BluetoothHidDeviceCallback.TAG , ( ( ( ( ( ( ( "onGetReport: device=" + device ) + " type=" ) + type ) + " id=" ) + id ) + " bufferSize=" ) + bufferSize ) ) ; }
Source:
public void setSuppServiceNotifications ( boolean enable , android.os.Message result ) { com.android.internal.telephony.RILRequest rr = com.android.internal.telephony.RILRequest.obtain ( com.android.internal.telephony.RIL_REQUEST_SET_SUPP_SVC_NOTIFICATION , result ) ; rr.mParcel.writeInt ( 1 ) ; rr.mParcel.writeInt ( ( enable ? 1 : 0 ) ) ; if ( com.android.internal.telephony.RIL.RILJ_LOGD ) riljLog ( ( ( ( rr.serialString ( ) ) + "> " ) + ( com.android.internal.telephony.RIL.requestToString ( rr.mRequest ) ) ) ) ; send ( rr ) ; }

Target:
public void deleteSmsOnRuim ( int index , android.os.Message response ) { com.android.internal.telephony.RILRequest rr = com.android.internal.telephony.RILRequest.obtain ( com.android.internal.telephony.RIL_REQUEST_CDMA_DELETE_SMS_ON_RUIM , response , mRILDefaultWorkSource ) ; rr.mParcel.writeInt ( 1 ) ; rr.mParcel.writeInt ( index ) ; if ( com.android.internal.telephony.RIL.RILJ_LOGV ) riljLog ( ( ( ( ( ( rr.serialString ( ) ) + "> " ) + ( com.android.internal.telephony.RIL.requestToString ( rr.mRequest ) ) ) + " " ) + index ) ) ; send ( rr ) ; }
Source:
private int convertPlayStateToBytes ( int playState ) { switch ( playState ) { case android.media.session.PlaybackState.STATE_PLAYING : case android.media.session.PlaybackState.STATE_BUFFERING : return com.android.bluetooth.avrcp.Avrcp.PLAYSTATUS_PLAYING ; case android.media.session.PlaybackState.STATE_STOPPED : case android.media.session.PlaybackState.STATE_NONE : case android.media.session.PlaybackState.STATE_CONNECTING : return com.android.bluetooth.avrcp.Avrcp.PLAYSTATUS_STOPPED ; case android.media.session.PlaybackState.STATE_PAUSED : return com.android.bluetooth.avrcp.Avrcp.PLAYSTATUS_PAUSED ; case android.media.session.PlaybackState.STATE_FAST_FORWARDING : case android.media.session.PlaybackState.STATE_SKIPPING_TO_NEXT : case android.media.session.PlaybackState.STATE_SKIPPING_TO_QUEUE_ITEM : return com.android.bluetooth.avrcp.Avrcp.PLAYSTATUS_FWD_SEEK ; case android.media.session.PlaybackState.STATE_REWINDING : case android.media.session.PlaybackState.STATE_SKIPPING_TO_PREVIOUS : return com.android.bluetooth.avrcp.Avrcp.PLAYSTATUS_REV_SEEK ; case android.media.session.PlaybackState.STATE_ERROR : default : return com.android.bluetooth.avrcp.Avrcp.PLAYSTATUS_ERROR ; } }

Target:
private byte getBluetoothPlayState ( android.media.session.PlaybackState pbState ) { if ( pbState == null ) { android.util.Log.w ( com.android.bluetooth.avrcp.Avrcp.TAG , "playState object null, sending STOPPED" ) ; return com.android.bluetooth.avrcp.Avrcp.PLAYSTATUS_STOPPED ; } switch ( pbState.getState ( ) ) { case android.media.session.PlaybackState.STATE_PLAYING : case android.media.session.PlaybackState.STATE_BUFFERING : return com.android.bluetooth.avrcp.Avrcp.PLAYSTATUS_PLAYING ; case android.media.session.PlaybackState.STATE_STOPPED : case android.media.session.PlaybackState.STATE_NONE : case android.media.session.PlaybackState.STATE_CONNECTING : return com.android.bluetooth.avrcp.Avrcp.PLAYSTATUS_STOPPED ; case android.media.session.PlaybackState.STATE_PAUSED : return com.android.bluetooth.avrcp.Avrcp.PLAYSTATUS_PAUSED ; case android.media.session.PlaybackState.STATE_FAST_FORWARDING : case android.media.session.PlaybackState.STATE_SKIPPING_TO_NEXT : case android.media.session.PlaybackState.STATE_SKIPPING_TO_QUEUE_ITEM : return com.android.bluetooth.avrcp.Avrcp.PLAYSTATUS_FWD_SEEK ; case android.media.session.PlaybackState.STATE_REWINDING : case android.media.session.PlaybackState.STATE_SKIPPING_TO_PREVIOUS : return com.android.bluetooth.avrcp.Avrcp.PLAYSTATUS_REV_SEEK ; case android.media.session.PlaybackState.STATE_ERROR : default : return com.android.bluetooth.avrcp.Avrcp.PLAYSTATUS_ERROR ; } }
Source:
void answer ( com.android.server.telecom.Call call , int videoState ) { final java.lang.String callId = mCallIdMapper.getCallId ( call ) ; if ( ( callId != null ) && ( isServiceValid ( "answer" ) ) ) { try { logOutgoing ( "answer %s %d" , callId , videoState ) ; if ( android.telecom.VideoProfile.isAudioOnly ( videoState ) ) { mServiceInterface.answer ( callId ) ; } else { mServiceInterface.answerVideo ( callId , videoState ) ; } } catch ( android.os.RemoteException e ) { } } }

Target:
void disconnect ( com.android.server.telecom.Call call ) { final java.lang.String callId = mCallIdMapper.getCallId ( call ) ; if ( ( callId != null ) && ( isServiceValid ( "disconnect" ) ) ) { try { logOutgoing ( "disconnect %s" , callId ) ; mServiceInterface.disconnect ( callId , android.telecom.Log.getExternalSession ( ) ) ; } catch ( android.os.RemoteException e ) { } } }
Source:
public com.google.i18n.phonenumbers.PhoneNumberUtil.ValidationResult isPossibleNumberWithReason ( com.google.i18n.phonenumbers.Phonenumber.PhoneNumber number ) { java.lang.String nationalNumber = getNationalSignificantNumber ( number ) ; int countryCode = number.getCountryCode ( ) ; if ( ! ( hasValidCountryCallingCode ( countryCode ) ) ) { return com.google.i18n.phonenumbers.PhoneNumberUtil.ValidationResult.INVALID_COUNTRY_CODE ; } java.lang.String regionCode = getRegionCodeForCountryCode ( countryCode ) ; com.google.i18n.phonenumbers.nano.Phonemetadata.PhoneMetadata metadata = getMetadataForRegionOrCallingCode ( countryCode , regionCode ) ; java.util.regex.Pattern possibleNumberPattern = regexCache.getPatternForRegex ( metadata.generalDesc.possibleNumberPattern ) ; return testNumberLengthAgainstPattern ( possibleNumberPattern , nationalNumber ) ; }

Target:
private boolean isShorterThanPossibleNormalNumber ( com.google.i18n.phonenumbers.Phonemetadata.PhoneMetadata regionMetadata , java.lang.String number ) { java.util.regex.Pattern possibleNumberPattern = regexCache.getPatternForRegex ( regionMetadata.getGeneralDesc ( ) . getPossibleNumberPattern ( ) ) ; return ( testNumberLengthAgainstPattern ( possibleNumberPattern , number ) ) == ( com.google.i18n.phonenumbers.PhoneNumberUtil.ValidationResult.TOO_SHORT ) ; }
Source:
public static java.lang.Float [ ] getStandardDeviations ( android.hardware.cts.helpers.TestSensorEvent [ ] events ) { java.lang.Float [ ] variances = android.hardware.cts.helpers.SensorCtsHelper.getVariances ( events ) ; java.lang.Float [ ] stdDevs = new java.lang.Float [ variances.length ] ; for ( int i = 0 ; i < ( variances.length ) ; i ++ ) { stdDevs [ i ] = ( ( float ) ( java.lang.Math.sqrt ( variances [ i ] ) ) ) ; } return stdDevs ; }

Target:
public static java.lang.String formatAssertionMessage ( android.hardware.Sensor sensor , java.lang.String label ) { return java.lang.String.format ( "%s | %s, handle: %d" , label , android.hardware.cts.helpers.SensorTestInformation.getSensorName ( sensor.getType ( ) ) , sensor.getHandle ( ) ) ; }
Source:
void copy2DRangeFromUnchecked ( int xoff , int yoff , int w , int h , int [ ] data ) { android.os.Trace.traceBegin ( RenderScript.TRACE_TAG , "copy2DRangeFromUnchecked" ) ; mRS.validate ( ) ; validate2DRange ( xoff , yoff , w , h ) ; mRS.nAllocationData2D ( getIDSafe ( ) , xoff , yoff , mSelectedLOD , mSelectedFace.mID , w , h , data , ( ( data.length ) * 4 ) , Element.DataType.SIGNED_32 ) ; android.os.Trace.traceEnd ( RenderScript.TRACE_TAG ) ; }

Target:
public void copy2DRangeFrom ( int xoff , int yoff , int w , int h , short [ ] data ) { validateIsInt16 ( ) ; copy2DRangeFromUnchecked ( xoff , yoff , w , h , data , Element.DataType.SIGNED_16 , data.length ) ; }
Source:
protected void runTest ( ) throws java.lang.Throwable { try { runTasksOnProject ( projectName , gradleVersion , java.util.Collections.< java.lang.String > emptyList ( ) , "clean" , "connectedCheck" ) ; } finally { } }

Target:
protected void runTest ( ) throws java.lang.Throwable { try { if ( ( testType ) == ( com.android.build.gradle.DeviceTest.TestType.CHECK ) ) { runTasksOnProject ( projectName , gradleVersion , java.util.Collections.< java.lang.String > emptyList ( ) , "clean" , "connectedCheck" ) ; } else { runTasksOnProject ( projectName , gradleVersion , java.util.Collections.< java.lang.String > emptyList ( ) , "clean" , "connectedCheck" , "mergeAndroidReports" ) ; } } finally { } }
Source:
public final void removeMarkersFromFile ( org.eclipse.core.resources.IFile file , java.lang.String markerId ) { try { if ( file.exists ( ) ) { file.deleteMarkers ( markerId , true , IResource.DEPTH_ZERO ) ; } } catch ( org.eclipse.core.runtime.CoreException ce ) { java.lang.String msg = java.lang.String.format ( Messages.Marker_Delete_Error , markerId , file.toString ( ) ) ; com.android.ide.eclipse.adt.AdtPlugin.printErrorToConsole ( getProject ( ) , msg ) ; } }

Target:
public final void removeMarkersFromResource ( org.eclipse.core.resources.IResource resource , java.lang.String markerId ) { try { if ( resource.exists ( ) ) { resource.deleteMarkers ( markerId , true , IResource.DEPTH_ZERO ) ; } } catch ( org.eclipse.core.runtime.CoreException ce ) { java.lang.String msg = java.lang.String.format ( Messages.Marker_Delete_Error , markerId , resource.toString ( ) ) ; com.android.ide.eclipse.adt.AdtPlugin.printErrorToConsole ( getProject ( ) , msg ) ; } }
Source:
private static boolean willWorkForMulticast ( java.net.NetworkInterface iface ) throws java.io.IOException { return ( ( ( iface.isUp ( ) ) && ( ! ( iface.isLoopback ( ) ) ) ) && ( iface.supportsMulticast ( ) ) ) && ( iface.getInetAddresses ( ) . hasMoreElements ( ) ) ; }

Target:
private static boolean willWorkForMulticast ( java.net.NetworkInterface iface ) throws java.io.IOException { return ( ( ( ( iface.isUp ( ) ) && ( ! ( iface.isLoopback ( ) ) ) ) && ( ! ( iface.isPointToPoint ( ) ) ) ) && ( iface.supportsMulticast ( ) ) ) && ( iface.getInetAddresses ( ) . hasMoreElements ( ) ) ; }
Source:
protected boolean isValidSourceFile ( java.io.File sourceFolder , java.io.File file ) { java.io.File resFolder = file.getParentFile ( ) ; return ( resFolder.getParentFile ( ) . equals ( sourceFolder ) ) && ( ( com.android.resources.ResourceFolderType.getFolderType ( resFolder.getName ( ) ) ) != null ) ; }

Target:
protected boolean isValidSourceFile ( @ com.android.annotations.NonNull java.io.File sourceFolder , @ com.android.annotations.NonNull java.io.File file ) { if ( ! ( super . isValidSourceFile ( sourceFolder , file ) ) ) { return false ; } java.io.File resFolder = file.getParentFile ( ) ; return ( ( resFolder.getParentFile ( ) . equals ( sourceFolder ) ) && ( com.android.ide.common.packaging.PackagingUtils.checkFolderForPackaging ( resFolder.getName ( ) ) ) ) && ( ( com.android.resources.ResourceFolderType.getFolderType ( resFolder.getName ( ) ) ) != null ) ; }
Source:
public void logp ( java.util.logging.Level level , java.lang.String sourceClass , java.lang.String sourceMethod , java.lang.String msg , java.lang.Throwable thrown ) { if ( ( ( level.intValue ( ) ) < ( levelValue ) ) || ( ( levelValue ) == ( java.util.logging.Logger.offValue ) ) ) { return ; } java.util.logging.LogRecord lr = new java.util.logging.LogRecord ( level , msg ) ; lr.setSourceClassName ( sourceClass ) ; lr.setSourceMethodName ( sourceMethod ) ; lr.setThrown ( thrown ) ; doLog ( lr ) ; }

Target:
public void logp ( java.util.logging.Level level , java.lang.String sourceClass , java.lang.String sourceMethod , java.lang.String msg ) { if ( ! ( isLoggable ( level ) ) ) { return ; } java.util.logging.LogRecord lr = new java.util.logging.LogRecord ( level , msg ) ; lr.setSourceClassName ( sourceClass ) ; lr.setSourceMethodName ( sourceMethod ) ; doLog ( lr ) ; }
Source:
public void rebootRecoveryWithCommand ( java.lang.String command , boolean update ) { if ( com.android.server.RecoverySystemService.DEBUG ) android.util.Slog.d ( com.android.server.RecoverySystemService.TAG , ( ( "rebootRecoveryWithCommand: [" + command ) + "]" ) ) ; synchronized ( com.android.server.RecoverySystemService.sRequestLock ) { if ( ! ( setupOrClearBcb ( true , command ) ) ) { return ; } android.os.PowerManager pm = ( ( android.os.PowerManager ) ( mContext.getSystemService ( Context.POWER_SERVICE ) ) ) ; pm.reboot ( ( update ? android.os.PowerManager.REBOOT_RECOVERY_UPDATE : android.os.PowerManager.REBOOT_RECOVERY ) ) ; } }

Target:
public void rebootRecoveryWithCommand ( java.lang.String command ) { if ( com.android.server.RecoverySystemService.DEBUG ) android.util.Slog.d ( com.android.server.RecoverySystemService.TAG , ( ( "rebootRecoveryWithCommand: [" + command ) + "]" ) ) ; synchronized ( com.android.server.RecoverySystemService.sRequestLock ) { if ( ! ( setupOrClearBcb ( true , command ) ) ) { return ; } android.os.PowerManager pm = ( ( android.os.PowerManager ) ( mContext.getSystemService ( Context.POWER_SERVICE ) ) ) ; pm.reboot ( PowerManager.REBOOT_RECOVERY ) ; } }
Source:
private void registerSettingsObserver ( ) { mSettingsObserver.unobserve ( ) ; java.lang.String simSuffix = "" ; if ( ( android.telephony.TelephonyManager.getDefault ( ) . getSimCount ( ) ) > 1 ) { simSuffix = java.lang.Integer.toString ( mPhone.getSubId ( ) ) ; } mSettingsObserver.observe ( Settings.Global.getUriFor ( ( ( Settings.Global.DATA_ROAMING ) + simSuffix ) ) , DctConstants.EVENT_ROAMING_ON ) ; mSettingsObserver.observe ( Settings.Global.getUriFor ( Settings.Global.DEVICE_PROVISIONED ) , DctConstants.EVENT_DEVICE_PROVISIONED_CHANGE ) ; mSettingsObserver.observe ( Settings.Global.getUriFor ( Settings.Global.DEVICE_PROVISIONING_MOBILE_DATA_ENABLED ) , DctConstants.EVENT_DEVICE_PROVISIONED_CHANGE ) ; }

Target:
private void registerSettingsObserver ( ) { mSettingsObserver.unobserve ( ) ; java.lang.String simSuffix = "" ; if ( ( android.telephony.TelephonyManager.getDefault ( ) . getSimCount ( ) ) > 1 ) { simSuffix = java.lang.Integer.toString ( mPhone.getSubId ( ) ) ; } mSettingsObserver.observe ( Settings.Global.getUriFor ( ( ( Settings.Global.DATA_ROAMING ) + simSuffix ) ) , DctConstants.EVENT_ROAMING_SETTING_CHANGE ) ; mSettingsObserver.observe ( Settings.Global.getUriFor ( Settings.Global.DEVICE_PROVISIONED ) , DctConstants.EVENT_DEVICE_PROVISIONED_CHANGE ) ; mSettingsObserver.observe ( Settings.Global.getUriFor ( Settings.Global.DEVICE_PROVISIONING_MOBILE_DATA_ENABLED ) , DctConstants.EVENT_DEVICE_PROVISIONED_CHANGE ) ; }
Source:
public java.lang.String getMessage ( ) { java.lang.String message = super . getMessage ( ) ; if ( nodeTrace.isEmpty ( ) ) { return message ; } else { com.android.jack.ir.JNodeInternalError.NodeInfo bottomNode = nodeTrace.get ( 0 ) ; return ( ( ( ( message + ": " ) + ( bottomNode.getClassName ( ) ) ) + " at \"" ) + ( bottomNode.getSourceInfo ( ) ) ) + '"' ; } }

Target:
public java.lang.String getMessage ( ) { java.lang.String message = super . getMessage ( ) ; if ( nodeTrace.isEmpty ( ) ) { return message ; } else { com.android.jack.ir.JNodeInternalError.NodeInfo bottomNode = nodeTrace.get ( 0 ) ; return ( ( ( ( message + ": " ) + ( bottomNode.getClassName ( ) ) ) + " at \"" ) + ( java.lang.String.valueOf ( bottomNode.getSourceInfo ( ) ) ) ) + '"' ; } }
Source:
public void checkValidity ( ) { com.android.jack.ir.ast.cfg.CfgExpressionValidator.validate ( this ) ; if ( this . isTerminal ( ) ) { if ( ( this ) != ( getBasicBlock ( ) . getLastElement ( ) ) ) { throw new com.android.jack.ir.JNodeInternalError ( this , "Terminal block element must be the last element of the block" ) ; } } else { if ( ( ( this . getBasicBlock ( ) ) instanceof com.android.jack.ir.ast.cfg.JThrowingBasicBlock ) && ( ( this ) == ( getBasicBlock ( ) . getLastElement ( ) ) ) ) { throw new com.android.jack.ir.JNodeInternalError ( this , "Non-terminal block element must NOT be the last element of the throwing block" ) ; } } }

Target:
public void checkValidity ( ) { com.android.jack.ir.ast.cfg.CfgExpressionValidator.validate ( this ) ; if ( this . isTerminal ( ) ) { if ( ( this ) != ( getBasicBlock ( ) . getLastElement ( ) ) ) { throw new com.android.jack.ir.JNodeInternalError ( this , "Terminal block element must be the last element of the block" ) ; } } else { if ( ( this ) == ( getBasicBlock ( ) . getLastElement ( ) ) ) { throw new com.android.jack.ir.JNodeInternalError ( this , "Non-terminal block element must NOT be the last element of the block" ) ; } } }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; mSpyContext = mComponentContextFixture.getTestDouble ( ) . getApplicationContext ( ) ; org.mockito.Mockito.doReturn ( mSpyContext ) . when ( mSpyContext ) . getApplicationContext ( ) ; mNumOutgoingCallsMade = 0 ; setupInCallServices ( ) ; setupTelecomSystem ( ) ; setupConnectionServices ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; mSpyContext = mComponentContextFixture.getTestDouble ( ) . getApplicationContext ( ) ; org.mockito.Mockito.doReturn ( mSpyContext ) . when ( mSpyContext ) . getApplicationContext ( ) ; mNumOutgoingCallsMade = 0 ; mIsEmergencyCall = false ; setupInCallServices ( ) ; setupTelecomSystem ( ) ; setupConnectionServices ( ) ; }
Source:
private boolean isAllowedProviderSafe ( java.lang.String provider ) { if ( ( LocationManager.GPS_PROVIDER.equals ( provider ) ) && ( ( mContext.checkCallingPermission ( com.android.server.LocationManagerService.ACCESS_FINE_LOCATION ) ) != ( android.content.pm.PackageManager.PERMISSION_GRANTED ) ) ) { return false ; } if ( ( ( LocationManager.NETWORK_PROVIDER.equals ( provider ) ) && ( ( mContext.checkCallingPermission ( com.android.server.LocationManagerService.ACCESS_FINE_LOCATION ) ) != ( android.content.pm.PackageManager.PERMISSION_GRANTED ) ) ) && ( ( mContext.checkCallingPermission ( com.android.server.LocationManagerService.ACCESS_COARSE_LOCATION ) ) != ( android.content.pm.PackageManager.PERMISSION_GRANTED ) ) ) { return false ; } return true ; }

Target:
private boolean isAllowedProviderSafe ( java.lang.String provider ) { if ( ( LocationManager.GPS_PROVIDER.equals ( provider ) ) && ( ( mContext.checkCallingOrSelfPermission ( com.android.server.LocationManagerService.ACCESS_FINE_LOCATION ) ) != ( android.content.pm.PackageManager.PERMISSION_GRANTED ) ) ) { return false ; } if ( ( ( LocationManager.NETWORK_PROVIDER.equals ( provider ) ) && ( ( mContext.checkCallingOrSelfPermission ( com.android.server.LocationManagerService.ACCESS_FINE_LOCATION ) ) != ( android.content.pm.PackageManager.PERMISSION_GRANTED ) ) ) && ( ( mContext.checkCallingOrSelfPermission ( com.android.server.LocationManagerService.ACCESS_COARSE_LOCATION ) ) != ( android.content.pm.PackageManager.PERMISSION_GRANTED ) ) ) { return false ; } return true ; }
Source:
public int nextCodePoint ( ) { int ch1 = next ( ) ; if ( android.icu.text.UTF16.isLeadSurrogate ( ( ( char ) ( ch1 ) ) ) ) { int ch2 = next ( ) ; if ( android.icu.text.UTF16.isTrailSurrogate ( ( ( char ) ( ch2 ) ) ) ) { return android.icu.impl.UCharacterProperty.getRawSupplementary ( ( ( char ) ( ch1 ) ) , ( ( char ) ( ch2 ) ) ) ; } else if ( ch2 != ( DONE ) ) { previous ( ) ; } } return ch1 ; }

Target:
public int nextCodePoint ( ) { int ch1 = next ( ) ; if ( android.icu.text.UTF16.isLeadSurrogate ( ( ( char ) ( ch1 ) ) ) ) { int ch2 = next ( ) ; if ( android.icu.text.UTF16.isTrailSurrogate ( ( ( char ) ( ch2 ) ) ) ) { return java.lang.Character.toCodePoint ( ( ( char ) ( ch1 ) ) , ( ( char ) ( ch2 ) ) ) ; } else if ( ch2 != ( DONE ) ) { previous ( ) ; } } return ch1 ; }
Source:
public void testGetActivities ( ) { assertEquals ( 1 , mManifestTestApp.getActivities ( ) . length ) ; com.android.sdklib.xml.AndroidManifestParser.Activity activity = mManifestTestApp.getActivities ( ) [ 0 ] ; assertEquals ( com.android.ide.eclipse.adt.internal.project.AndroidManifestParserTest.ACTIVITY_NAME , activity.getName ( ) ) ; assertTrue ( activity.hasAction ( ) ) ; assertTrue ( activity.isHomeActivity ( ) ) ; assertTrue ( activity.hasAction ( ) ) ; assertEquals ( activity , mManifestTestApp.getActivities ( ) [ 0 ] ) ; }

Target:
public void testGetPackage ( ) { assertEquals ( com.android.ide.eclipse.adt.internal.project.AndroidManifestParserTest.PACKAGE_NAME , mManifestTestApp.getPackage ( ) ) ; }
Source:
private static void onDataPathConfirm ( int ndpId , byte [ ] mac , boolean accept , int reason , byte [ ] message ) { if ( com.android.server.wifi.aware.WifiAwareNative.VDBG ) { android.util.Log.v ( com.android.server.wifi.aware.WifiAwareNative.TAG , ( ( ( ( ( ( ( "onDataPathConfirm: ndpId=" + ndpId ) + ", mac=" ) + ( java.lang.String.valueOf ( libcore.util.HexEncoding.encode ( mac ) ) ) ) + ", accept=" ) + accept ) + ", reason=" ) + reason ) ) ; } com.android.server.wifi.aware.WifiAwareStateManager.getInstance ( ) . onDataPathConfirmNotification ( ndpId , mac , accept , reason , message ) ; }

Target:
private static void onDataPathConfirm ( int ndpId , byte [ ] mac , boolean accept , int reason , byte [ ] message ) { if ( com.android.server.wifi.aware.WifiAwareNative.VDBG ) { android.util.Log.v ( com.android.server.wifi.aware.WifiAwareNative.TAG , ( ( ( ( ( ( ( "onDataPathConfirm: ndpId=" + ndpId ) + ", mac=" ) + ( java.lang.String.valueOf ( libcore.util.HexEncoding.encode ( mac ) ) ) ) + ", accept=" ) + accept ) + ", reason=" ) + reason ) ) ; } com.android.server.wifi.aware.WifiAwareNative.sWifiAwareStateManager.onDataPathConfirmNotification ( ndpId , mac , accept , reason , message ) ; }
Source:
public void newSmsStatusReport ( int var1 , java.util.ArrayList < java.lang.Byte > var2 ) { }

Target:
public void newSmsStatusReport ( int indicationType , java.util.ArrayList < java.lang.Byte > pdu ) { mRil.processIndication ( indicationType ) ; byte [ ] pduArray = com.android.internal.telephony.RIL.arrayListToPrimitiveArray ( pdu ) ; if ( RIL.RILJ_LOGD ) mRil.unsljLog ( com.android.internal.telephony.RILConstants.RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT ) ; if ( ( mRil.mSmsStatusRegistrant ) != null ) { mRil.mSmsStatusRegistrant.notifyRegistrant ( new android.os.AsyncResult ( null , pduArray , null ) ) ; } }
Source:
public void visitLater ( com.android.tools.perflib.heap.Instance parent , @ com.android.annotations.NonNull com.android.tools.perflib.heap.Instance child ) { if ( ( ( mVisitDistance ) < ( child.getDistanceToGcRoot ( ) ) ) && ( ( ( parent == null ) || ( ! ( parent.getIsSoftReference ( ) ) ) ) || ( child.getIsSoftReference ( ) ) ) ) { child.setDistanceToGcRoot ( mVisitDistance ) ; child.setNextInstanceToGcRoot ( mPreviousInstance ) ; mPriorityQueue.add ( child ) ; } }

Target:
public void visitLater ( com.android.tools.perflib.heap.Instance parent , @ com.android.annotations.NonNull com.android.tools.perflib.heap.Instance child ) { if ( ( ( mVisitDistance ) < ( child.getDistanceToGcRoot ( ) ) ) && ( ( ( ( parent == null ) || ( ( child.getSoftReferences ( ) ) == null ) ) || ( ! ( child.getSoftReferences ( ) . contains ( parent ) ) ) ) || ( child.getIsSoftReference ( ) ) ) ) { child.setDistanceToGcRoot ( mVisitDistance ) ; child.setNextInstanceToGcRoot ( mPreviousInstance ) ; mPriorityQueue.add ( child ) ; } }
Source:
public int addExtraItem ( T item ) { super . add ( item ) ; return ++ ( mExtraItemCount ) ; }

Target:
public int addExtraItem ( T item ) { long newItemId = getId ( item ) ; com.android.tv.common.SoftPreconditions.checkState ( ( ! ( mIds.contains ( newItemId ) ) ) ) ; mIds.add ( newItemId ) ; super . add ( item ) ; return ++ ( mExtraItemCount ) ; }
Source:
public boolean updateNetworkAfterDisconnect ( int networkId ) { if ( mVerboseLoggingEnabled ) { android.util.Log.v ( com.android.server.wifi.WifiConfigManager.TAG , ( "Update network after disconnect for " + networkId ) ) ; } android.net.wifi.WifiConfiguration config = getInternalConfiguredNetwork ( networkId ) ; if ( config == null ) { return false ; } config.lastDisconnected = mClock.getWallClockMillis ( ) ; if ( ( config.status ) == ( WifiConfiguration.Status.CURRENT ) ) { setNetworkStatus ( config , WifiConfiguration.Status.ENABLED ) ; } return true ; }

Target:
public boolean updateNetworkAfterDisconnect ( int networkId ) { if ( mVerboseLoggingEnabled ) { android.util.Log.v ( com.android.server.wifi.WifiConfigManager.TAG , ( "Update network after disconnect for " + networkId ) ) ; } android.net.wifi.WifiConfiguration config = getInternalConfiguredNetwork ( networkId ) ; if ( config == null ) { return false ; } config.lastDisconnected = mClock.getWallClockMillis ( ) ; if ( ( config.status ) == ( WifiConfiguration.Status.CURRENT ) ) { setNetworkStatus ( config , WifiConfiguration.Status.ENABLED ) ; } saveToStore ( false ) ; return true ; }
Source:
protected java.util.List < org.eclipse.ltk.core.refactoring.Change > computeChanges ( ) { final com.android.ide.eclipse.adt.internal.wizards.templates.TemplateHandler template = mValues.template ; template.setBackupMergedFiles ( false ) ; java.util.Map < java.lang.String , java.lang.Object > paramMap = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; addProjectInfo ( paramMap ) ; com.android.ide.eclipse.adt.internal.wizards.templates.TemplateHandler.addDirectoryParameters ( paramMap , getProject ( ) ) ; if ( mValues.createActivity ) { paramMap.put ( com.android.ide.eclipse.adt.internal.wizards.templates.NewProjectWizard.ATTR_APP_COMPAT , true ) ; } return template.render ( mProject , paramMap ) ; }

Target:
public void run ( ) { com.android.ide.eclipse.adt.internal.actions.AddSupportJarAction.installAppCompatLibrary ( mProject , true ) ; }
Source:
public void verifyCertificateChain ( byte [ ] [ ] asn1DerEncodedCertificateChain , java.lang.String authMethod ) throws java.security.cert.CertificateException { if ( org.apache.harmony.xnet.provider.jsse.NativeCryptoTest.DEBUG ) { java.lang.System.out.println ( ( ( ( ( ( ( "ssl=0x" + ( java.lang.Integer.toString ( sslNativePointer , 16 ) ) ) + " verifyCertificateChain" ) + " asn1DerEncodedCertificateChain=" ) + asn1DerEncodedCertificateChain ) + " authMethod=" ) + authMethod ) ) ; } this . asn1DerEncodedCertificateChain = asn1DerEncodedCertificateChain ; this . authMethod = authMethod ; this . verifyCertificateChainCalled = true ; }

Target:
public void verifyCertificateChain ( byte [ ] [ ] asn1DerEncodedCertificateChain , java.lang.String authMethod ) throws java.security.cert.CertificateException { if ( org.apache.harmony.xnet.provider.jsse.NativeCryptoTest.DEBUG ) { java.lang.System.out.println ( ( ( ( ( ( ( "ssl=0x" + ( java.lang.Long.toString ( sslNativePointer , 16 ) ) ) + " verifyCertificateChain" ) + " asn1DerEncodedCertificateChain=" ) + asn1DerEncodedCertificateChain ) + " authMethod=" ) + authMethod ) ) ; } this . asn1DerEncodedCertificateChain = asn1DerEncodedCertificateChain ; this . authMethod = authMethod ; this . verifyCertificateChainCalled = true ; }
Source:
protected boolean preferenceTreeClick ( android.preference.Preference preference ) { return ( preference == ( mAutoSelect ) ) || ( preference == ( mNetworkSelect ) ) ; }

Target:
protected boolean preferenceTreeClick ( android.preference.Preference preference ) { if ( mEnableNewManualSelectNetworkUI ) { logd ( "enable New AutoSelectNetwork UI" ) ; if ( preference == ( mChooseNetwork ) ) { openChooseNetworkPage ( ) ; } return ( preference == ( mAutoSelect ) ) || ( preference == ( mChooseNetwork ) ) ; } else { return ( preference == ( mAutoSelect ) ) || ( preference == ( mNetworkSelect ) ) ; } }
Source:
private java.util.List < com.android.jack.ir.ast.JMethodIdWithReturnType > getBridges ( @ javax.annotation.Nonnull org.eclipse.jdt.internal.compiler.ast.FunctionalExpression fe ) { org.eclipse.jdt.internal.compiler.lookup.MethodBinding [ ] bridges = fe.getRequiredBridges ( ) ; java.util.List < com.android.jack.ir.ast.JMethodIdWithReturnType > mds = new java.util.ArrayList < com.android.jack.ir.ast.JMethodIdWithReturnType > ( ) ; if ( bridges != null ) { for ( org.eclipse.jdt.internal.compiler.lookup.MethodBinding bridge : bridges ) { mds.add ( getJMethodIdWithReturnType ( bridge ) ) ; } } return mds ; }

Target:
private java.util.List < com.android.jack.ir.ast.JMethodId > getBridges ( @ javax.annotation.Nonnull org.eclipse.jdt.internal.compiler.ast.FunctionalExpression fe ) { org.eclipse.jdt.internal.compiler.lookup.MethodBinding [ ] bridges = fe.getRequiredBridges ( ) ; java.util.List < com.android.jack.ir.ast.JMethodId > mds = new java.util.ArrayList < com.android.jack.ir.ast.JMethodId > ( ) ; if ( bridges != null ) { for ( org.eclipse.jdt.internal.compiler.lookup.MethodBinding bridge : bridges ) { mds.add ( getJMethodId ( bridge ) ) ; } } return mds ; }
Source:
private java.lang.Object responseSignalStrength ( android.os.Parcel p ) { int numInts = 12 ; int [ ] response ; response = new int [ numInts ] ; for ( int i = 0 ; i < numInts ; i ++ ) { response [ i ] = p.readInt ( ) ; } return response ; }

Target:
private java.lang.Object responseSignalStrength ( android.os.Parcel p ) { android.telephony.SignalStrength signalStrength = new android.telephony.SignalStrength ( p ) ; return signalStrength ; }
Source:
private static void onPublishTerminated ( int publishId , int status ) { if ( com.android.server.wifi.aware.WifiAwareNative.VDBG ) android.util.Log.v ( com.android.server.wifi.aware.WifiAwareNative.TAG , ( ( ( "onPublishTerminated: publishId=" + publishId ) + ", status=" ) + status ) ) ; com.android.server.wifi.aware.WifiAwareStateManager.getInstance ( ) . onSessionTerminatedNotification ( publishId , ( status == ( com.android.server.wifi.aware.WifiAwareNative.AWARE_STATUS_SUCCESS ) ? android.net.wifi.aware.WifiAwareDiscoverySessionCallback.TERMINATE_REASON_DONE : android.net.wifi.aware.WifiAwareDiscoverySessionCallback.TERMINATE_REASON_FAIL ) , true ) ; }

Target:
private static void onPublishTerminated ( int publishId , int status ) { if ( com.android.server.wifi.aware.WifiAwareNative.VDBG ) android.util.Log.v ( com.android.server.wifi.aware.WifiAwareNative.TAG , ( ( ( "onPublishTerminated: publishId=" + publishId ) + ", status=" ) + status ) ) ; com.android.server.wifi.aware.WifiAwareNative.sWifiAwareStateManager.onSessionTerminatedNotification ( publishId , ( status == ( com.android.server.wifi.aware.WifiAwareNative.AWARE_STATUS_SUCCESS ) ? android.net.wifi.aware.DiscoverySessionCallback.TERMINATE_REASON_DONE : android.net.wifi.aware.DiscoverySessionCallback.TERMINATE_REASON_FAIL ) , true ) ; }
Source:
public void setIsVoipAudioMode ( java.lang.String callId , boolean isVoip ) { android.telecom.Log.startSession ( "CSW.sIVAM" ) ; long token = android.os.Binder.clearCallingIdentity ( ) ; try { synchronized ( mLock ) { logIncoming ( "setIsVoipAudioMode %s %b" , callId , isVoip ) ; com.android.server.telecom.Call call = mCallIdMapper.getCall ( callId ) ; if ( call != null ) { call.setIsVoipAudioMode ( isVoip ) ; } } } finally { android.os.Binder.restoreCallingIdentity ( token ) ; android.telecom.Log.endSession ( ) ; } }

Target:
public void setIsVoipAudioMode ( java.lang.String callId , boolean isVoip , android.telecom.Logging.Session.Info sessionInfo ) { android.telecom.Log.startSession ( sessionInfo , "CSW.sIVAM" ) ; long token = android.os.Binder.clearCallingIdentity ( ) ; try { synchronized ( mLock ) { logIncoming ( "setIsVoipAudioMode %s %b" , callId , isVoip ) ; com.android.server.telecom.Call call = mCallIdMapper.getCall ( callId ) ; if ( call != null ) { call.setIsVoipAudioMode ( isVoip ) ; } } } finally { android.os.Binder.restoreCallingIdentity ( token ) ; android.telecom.Log.endSession ( ) ; } }
Source:
private static void addContactToEabDb ( android.content.Context context , java.util.ArrayList < android.content.ContentProviderOperation > ops , java.lang.String displayName , java.lang.String phoneNumber , java.lang.String rawContactId , java.lang.String contactId , java.lang.String dataId ) { ops.add ( android.content.ContentProviderOperation.newInsert ( EABContract.EABColumns.CONTENT_URI ) . withValue ( EABContract.EABColumns.CONTACT_NAME , displayName ) . withValue ( EABContract.EABColumns.CONTACT_NUMBER , phoneNumber ) . withValue ( EABContract.EABColumns.ACCOUNT_TYPE , com.android.service.ims.presence.AccountUtil.ACCOUNT_TYPE ) . withValue ( EABContract.EABColumns.RAW_CONTACT_ID , rawContactId ) . withValue ( EABContract.EABColumns.CONTACT_ID , contactId ) . withValue ( EABContract.EABColumns.DATA_ID , dataId ) . build ( ) ) ; }

Target:
private static void addContactToEabDb ( android.content.Context context , java.util.ArrayList < android.content.ContentProviderOperation > ops , java.lang.String displayName , java.lang.String phoneNumber , java.lang.String formattedNumber , java.lang.String rawContactId , java.lang.String contactId , java.lang.String dataId ) { ops.add ( android.content.ContentProviderOperation.newInsert ( EABContract.EABColumns.CONTENT_URI ) . withValue ( EABContract.EABColumns.CONTACT_NAME , displayName ) . withValue ( EABContract.EABColumns.CONTACT_NUMBER , phoneNumber ) . withValue ( EABContract.EABColumns.FORMATTED_NUMBER , formattedNumber ) . withValue ( EABContract.EABColumns.ACCOUNT_TYPE , com.android.service.ims.presence.EABDbUtil.ACCOUNT_TYPE ) . withValue ( EABContract.EABColumns.RAW_CONTACT_ID , rawContactId ) . withValue ( EABContract.EABColumns.CONTACT_ID , contactId ) . withValue ( EABContract.EABColumns.DATA_ID , dataId ) . build ( ) ) ; }
Source:
public boolean remove ( @ javax.annotation.Nullable java.lang.Object key , @ javax.annotation.Nullable java.lang.Object value ) { java.util.Iterator < V > values = new ValueForKeyIterator ( key ) ; while ( values.hasNext ( ) ) { if ( com.google.common.base.Objects.equal ( values.next ( ) , value ) ) { values.remove ( ) ; return true ; } } return false ; }

Target:
public boolean containsKey ( @ javax.annotation.Nullable java.lang.Object key ) { return keyToKeyList.containsKey ( key ) ; }
Source:
public com.ibm.icu.text.QuantityFormatter.Builder add ( java.lang.String variant , java.lang.String template ) { ensureCapacity ( ) ; java.lang.Integer idx = com.ibm.icu.text.QuantityFormatter.INDEX_MAP.get ( variant ) ; if ( idx == null ) { throw new java.lang.IllegalArgumentException ( variant ) ; } com.ibm.icu.impl.SimplePatternFormatter newT = com.ibm.icu.impl.SimplePatternFormatter.compile ( template ) ; if ( ( newT.getPlaceholderCount ( ) ) > 1 ) { throw new java.lang.IllegalArgumentException ( ( "Extra placeholders: " + template ) ) ; } templates [ idx.intValue ( ) ] = newT ; return this ; }

Target:
public com.ibm.icu.text.QuantityFormatter.Builder add ( java.lang.String variant , java.lang.String template ) { int idx = com.ibm.icu.text.QuantityFormatter.getPluralIndex ( variant ) ; if ( idx < 0 ) { throw new java.lang.IllegalArgumentException ( variant ) ; } com.ibm.icu.impl.SimplePatternFormatter newT = com.ibm.icu.impl.SimplePatternFormatter.compile ( template ) ; if ( ( newT.getPlaceholderCount ( ) ) > 1 ) { throw new java.lang.IllegalArgumentException ( ( "Extra placeholders: " + template ) ) ; } ensureCapacity ( ) ; templates [ idx ] = newT ; return this ; }
Source:
private void uninstall ( @ com.android.annotations.NonNull java.io.File apk , @ com.android.annotations.NonNull java.lang.String packageName , @ com.android.annotations.NonNull java.lang.String deviceName ) throws com.android.builder.testing.api.DeviceException { if ( packageName != null ) { logger.info ( "DeviceConnector '%s': uninstalling %s" , deviceName , packageName ) ; device.uninstallPackage ( packageName ) ; } else { logger.info ( "DeviceConnector '%s': unable to uninstall %s: unable to get package name" , deviceName , apk ) ; } }

Target:
private void uninstall ( @ com.android.annotations.NonNull java.io.File apk , @ com.android.annotations.NonNull java.lang.String packageName , @ com.android.annotations.NonNull java.lang.String deviceName ) throws com.android.builder.testing.api.DeviceException { if ( packageName != null ) { logger.info ( "DeviceConnector '%s': uninstalling %s" , deviceName , packageName ) ; device.uninstallPackage ( packageName , timeout ) ; } else { logger.info ( "DeviceConnector '%s': unable to uninstall %s: unable to get package name" , deviceName , apk ) ; } }
Source:
private static void deleteRecursive ( java.io.File root ) { if ( root.exists ( ) ) { if ( root.isDirectory ( ) ) { for ( java.io.File file : root.listFiles ( ) ) { com.android.build.gradle.internal.test.fixture.GradleProjectTestRule.deleteRecursive ( file ) ; } } org.junit.Assert.assertTrue ( root.delete ( ) ) ; } }

Target:
private static void deleteRecursive ( java.io.File root ) { if ( root.exists ( ) ) { if ( root.isDirectory ( ) ) { java.io.File [ ] files = root.listFiles ( ) ; if ( files != null ) { for ( java.io.File file : files ) { com.android.build.gradle.internal.test.fixture.GradleProjectTestRule.deleteRecursive ( file ) ; } } } org.junit.Assert.assertTrue ( root.delete ( ) ) ; } }
Source:
public int read ( byte [ ] buffer , int offset , int length ) { java.util.Arrays.checkOffsetAndCount ( buffer.length , offset , length ) ; if ( length > ( mRemaining ) ) { length = ( ( int ) ( mRemaining ) ) ; } mRemaining -= length ; if ( length == 0 ) { return - 1 ; } else { return length ; } }

Target:
public int read ( byte [ ] buffer , int offset , int length ) { libcore.util.ArrayUtils.throwsIfOutOfBounds ( buffer.length , offset , length ) ; if ( length > ( mRemaining ) ) { length = ( ( int ) ( mRemaining ) ) ; } mRemaining -= length ; if ( length == 0 ) { return - 1 ; } else { return length ; } }
Source:
public void download_downloadsChunkOfZip ( ) throws java.lang.Exception { java.io.File packageFile = java.nio.file.Paths.get ( mTargetContext.getCacheDir ( ) . getAbsolutePath ( ) , "ota.zip" ) . toFile ( ) ; java.nio.file.Files.deleteIfExists ( packageFile.toPath ( ) ) ; java.nio.file.Files.copy ( mTestContext.getResources ( ) . openRawResource ( R.raw.ota_002_package ) , packageFile.toPath ( ) ) ; java.lang.String url = "file://" + ( packageFile.getAbsolutePath ( ) ) ; java.io.File outFile = java.nio.file.Paths.get ( mTargetContext.getCacheDir ( ) . getAbsolutePath ( ) , "care_map.txt" ) . toFile ( ) ; java.nio.file.Files.deleteIfExists ( outFile.toPath ( ) ) ; com.example.android.systemupdatersample.util.FileDownloader downloader = new com.example.android.systemupdatersample.util.FileDownloader ( url , 160 , 8 , outFile ) ; downloader.download ( ) ; java.lang.String downloadedContent = java.lang.String.join ( "\n" , java.nio.file.Files.readAllLines ( outFile.toPath ( ) ) ) ; junit.framework.Assert.assertEquals ( "CARE_MAP" , downloadedContent ) ; }

Target:
public void download_downloadsChunkOfZip ( ) throws java.lang.Exception { java.io.File packageFile = java.nio.file.Paths.get ( mTargetContext.getCacheDir ( ) . getAbsolutePath ( ) , "ota.zip" ) . toFile ( ) ; java.nio.file.Files.deleteIfExists ( packageFile.toPath ( ) ) ; java.nio.file.Files.copy ( mTestContext.getResources ( ) . openRawResource ( R.raw.ota_002_package ) , packageFile.toPath ( ) ) ; java.lang.String url = "file://" + ( packageFile.getAbsolutePath ( ) ) ; java.io.File outFile = java.nio.file.Paths.get ( mTargetContext.getCacheDir ( ) . getAbsolutePath ( ) , "care_map.txt" ) . toFile ( ) ; java.nio.file.Files.deleteIfExists ( outFile.toPath ( ) ) ; com.example.android.systemupdatersample.util.FileDownloader downloader = new com.example.android.systemupdatersample.util.FileDownloader ( url , 1674 , 12 , outFile ) ; downloader.download ( ) ; java.lang.String downloadedContent = java.lang.String.join ( "\n" , java.nio.file.Files.readAllLines ( outFile.toPath ( ) ) ) ; junit.framework.Assert.assertEquals ( "CARE_MAP-TXT" , downloadedContent ) ; }
Source:
public void createAppData ( java.lang.String uuid , java.lang.String pkgname , int userid , int flags , int appid , java.lang.String seinfo , int targetSdkVersion ) throws com.android.internal.os.InstallerConnection.InstallerException { mInstaller.execute ( "create_app_data" , uuid , pkgname , userid , flags , appid , seinfo , targetSdkVersion ) ; }

Target:
public void createAppData ( java.lang.String uuid , java.lang.String pkgname , int userid , int flags , int appid , java.lang.String seinfo , int targetSdkVersion ) throws com.android.internal.os.InstallerConnection.InstallerException { if ( com.android.server.pm.Installer.USE_BINDER ) { try { mInstalld.createAppData ( uuid , pkgname , userid , flags , appid , seinfo , targetSdkVersion ) ; } catch ( android.os.RemoteException | android.os.ServiceSpecificException e ) { throw new com.android.internal.os.InstallerConnection.InstallerException ( e.getMessage ( ) ) ; } } else { mInstaller.execute ( "create_app_data" , uuid , pkgname , userid , flags , appid , seinfo , targetSdkVersion ) ; } }
Source:
public void srcToLib ( @ javax.annotation.Nonnull java.io.File out , boolean zipFiles , @ javax.annotation.Nonnull java.io.File ... sources ) throws java.lang.Exception { try { srcToCommon ( sources ) ; if ( zipFiles ) { jackOptions.setJayceOutputZip ( out ) ; } else { jackOptions.setJayceOutputDir ( out ) ; } java.lang.System.setOut ( outRedirectStream ) ; java.lang.System.setErr ( errRedirectStream ) ; com.android.jack.Jack.run ( jackOptions ) ; } finally { java.lang.System.setOut ( stdOut ) ; java.lang.System.setErr ( stdErr ) ; } }

Target:
public void srcToLib ( @ javax.annotation.Nonnull java.io.File out , boolean zipFiles , @ javax.annotation.Nonnull java.io.File ... sources ) throws java.lang.Exception { try { srcToCommon ( sources ) ; if ( zipFiles ) { jackOptions.setJayceOutputZip ( out ) ; } else { jackOptions.setJayceOutputDir ( out ) ; } java.lang.System.setOut ( outRedirectStream ) ; java.lang.System.setErr ( errRedirectStream ) ; com.android.jack.Jack.checkAndRun ( jackOptions ) ; } finally { java.lang.System.setOut ( stdOut ) ; java.lang.System.setErr ( stdErr ) ; } }