auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void respondToDataPathRequest ( boolean accept , int ndpId , java.lang.String interfaceName , byte [ ] pmk ) { android.os.Message msg = mSm.obtainMessage ( com.android.server.wifi.aware.WifiAwareStateManager.MESSAGE_TYPE_COMMAND ) ; msg.arg1 = com.android.server.wifi.aware.WifiAwareStateManager.COMMAND_TYPE_RESPOND_TO_DATA_PATH_SETUP_REQUEST ; msg.arg2 = ndpId ; msg.obj = accept ; msg.getData ( ) . putString ( com.android.server.wifi.aware.WifiAwareStateManager.MESSAGE_BUNDLE_KEY_INTERFACE_NAME , interfaceName ) ; msg.getData ( ) . putByteArray ( com.android.server.wifi.aware.WifiAwareStateManager.MESSAGE_BUNDLE_KEY_PMK , pmk ) ; mSm.sendMessage ( msg ) ; }

Target:
public void respondToDataPathRequest ( boolean accept , int ndpId , java.lang.String interfaceName , byte [ ] pmk , java.lang.String passphrase ) { android.os.Message msg = mSm.obtainMessage ( com.android.server.wifi.aware.WifiAwareStateManager.MESSAGE_TYPE_COMMAND ) ; msg.arg1 = com.android.server.wifi.aware.WifiAwareStateManager.COMMAND_TYPE_RESPOND_TO_DATA_PATH_SETUP_REQUEST ; msg.arg2 = ndpId ; msg.obj = accept ; msg.getData ( ) . putString ( com.android.server.wifi.aware.WifiAwareStateManager.MESSAGE_BUNDLE_KEY_INTERFACE_NAME , interfaceName ) ; msg.getData ( ) . putByteArray ( com.android.server.wifi.aware.WifiAwareStateManager.MESSAGE_BUNDLE_KEY_PMK , pmk ) ; msg.getData ( ) . putString ( com.android.server.wifi.aware.WifiAwareStateManager.MESSAGE_BUNDLE_KEY_PASSPHRASE , passphrase ) ; mSm.sendMessage ( msg ) ; }
Source:
private org.eclipse.ltk.core.refactoring.participants.RenameRefactoring createFieldRefactoring ( org.eclipse.jdt.core.IField field ) { org.eclipse.jdt.internal.corext.refactoring.rename.RenameFieldProcessor processor = new org.eclipse.jdt.internal.corext.refactoring.rename.RenameFieldProcessor ( field ) ; processor.setRenameGetter ( false ) ; processor.setRenameSetter ( false ) ; org.eclipse.ltk.core.refactoring.participants.RenameRefactoring refactoring = new org.eclipse.ltk.core.refactoring.participants.RenameRefactoring ( processor ) ; processor.setUpdateReferences ( mUpdateReferences ) ; processor.setUpdateTextualMatches ( false ) ; processor.setNewElementName ( mNewName ) ; try { if ( refactoring.isApplicable ( ) ) { return refactoring ; } } catch ( org.eclipse.core.runtime.CoreException e ) { com.android.ide.eclipse.adt.AdtPlugin.log ( e , null ) ; } return null ; }

Target:
private org.eclipse.ltk.core.refactoring.participants.RenameRefactoring createFieldRefactoring ( org.eclipse.jdt.core.IField field ) { return com.android.ide.eclipse.adt.internal.refactorings.core.RenameResourceParticipant.createFieldRefactoring ( field , mNewName , mUpdateReferences ) ; }
Source:
public static com.android.jack.dx.rop.cst.CstMethodRef createMethodRef ( @ javax.annotation.Nonnull com.android.jack.ir.ast.JMethodCall methodCall ) { com.android.jack.dx.rop.cst.CstType definingClass = com.android.jack.backend.dex.rop.RopHelper.getCstType ( methodCall.getReceiverType ( ) ) ; com.android.jack.dx.rop.cst.CstMethodRef methodRef = new com.android.jack.dx.rop.cst.CstMethodRef ( definingClass , new com.android.jack.dx.rop.cst.CstString ( methodCall.getMethodName ( ) ) , com.android.jack.backend.dex.rop.RopHelper.getPrototype ( methodCall.getMethodId ( ) ) ) ; return methodRef ; }

Target:
public static com.android.jack.dx.rop.cst.CstMethodRef createMethodRef ( @ javax.annotation.Nonnull com.android.jack.ir.ast.JMethodCall methodCall ) { com.android.jack.dx.rop.type.Type definingClass = com.android.jack.backend.dex.rop.RopHelper.convertTypeToDx ( methodCall.getReceiverType ( ) ) ; com.android.jack.dx.rop.cst.CstMethodRef methodRef = new com.android.jack.dx.rop.cst.CstMethodRef ( definingClass , new com.android.jack.dx.rop.cst.CstString ( methodCall.getMethodName ( ) ) , com.android.jack.backend.dex.rop.RopHelper.getPrototype ( methodCall.getMethodId ( ) ) ) ; return methodRef ; }
Source:
private boolean canRejectCallWithSms ( ) { return ( ( primaryCallState ) != null ) && ( ! ( ( ( ( primaryCallState.state ( ) ) == ( com.android.incallui.call.DialerCall.State.DISCONNECTED ) ) || ( ( primaryCallState.state ( ) ) == ( com.android.incallui.call.DialerCall.State.DISCONNECTING ) ) ) || ( ( primaryCallState.state ( ) ) == ( com.android.incallui.call.DialerCall.State.IDLE ) ) ) ) ; }

Target:
private boolean canRejectCallWithSms ( ) { return ( ( primaryCallState ) != null ) && ( ! ( ( ( ( primaryCallState.state ( ) ) == ( com.android.incallui.call.state.DialerCallState.DISCONNECTED ) ) || ( ( primaryCallState.state ( ) ) == ( com.android.incallui.call.state.DialerCallState.DISCONNECTING ) ) ) || ( ( primaryCallState.state ( ) ) == ( com.android.incallui.call.state.DialerCallState.IDLE ) ) ) ) ; }
Source:
private void reportConnectionAttemptEnd ( int level2FailureCode , int connectivityFailureCode ) { mWifiMetrics.endConnectionEvent ( level2FailureCode , connectivityFailureCode ) ; switch ( level2FailureCode ) { case WifiMetrics.ConnectionEvent.FAILURE_NONE : mWifiDiagnostics.reportConnectionEvent ( WifiDiagnostics.CONNECTION_EVENT_SUCCEEDED ) ; break ; case WifiMetrics.ConnectionEvent.FAILURE_REDUNDANT_CONNECTION_ATTEMPT : case WifiMetrics.ConnectionEvent.FAILURE_CONNECT_NETWORK_FAILED : break ; default : mWifiDiagnostics.reportConnectionEvent ( WifiDiagnostics.CONNECTION_EVENT_FAILED ) ; } }

Target:
private void reportConnectionAttemptStart ( android.net.wifi.WifiConfiguration config , java.lang.String targetBSSID , int roamType ) { mWifiMetrics.startConnectionEvent ( config , targetBSSID , roamType ) ; mDiagsConnectionStartMillis = mClock.getElapsedSinceBootMillis ( ) ; mWifiDiagnostics.reportConnectionEvent ( mDiagsConnectionStartMillis , WifiDiagnostics.CONNECTION_EVENT_STARTED ) ; sendMessageDelayed ( com.android.server.wifi.WifiStateMachine.CMD_DIAGS_CONNECT_TIMEOUT , mDiagsConnectionStartMillis , com.android.server.wifi.WifiStateMachine.DIAGS_CONNECT_TIMEOUT_MILLIS ) ; }
Source:
private void fillBucketFromSummaryEntry ( android.app.usage.NetworkStats.Bucket bucketOut ) { bucketOut.mUid = android.app.usage.NetworkStats.Bucket.convertUid ( mRecycledSummaryEntry.uid ) ; bucketOut.mTag = android.app.usage.NetworkStats.Bucket.convertTag ( mRecycledSummaryEntry.tag ) ; bucketOut.mState = android.app.usage.NetworkStats.Bucket.convertState ( mRecycledSummaryEntry.set ) ; bucketOut.mMetered = android.app.usage.NetworkStats.Bucket.convertMetered ( mRecycledSummaryEntry.metered ) ; bucketOut.mRoaming = android.app.usage.NetworkStats.Bucket.convertRoaming ( mRecycledSummaryEntry.roaming ) ; bucketOut.mBeginTimeStamp = mStartTimeStamp ; bucketOut.mEndTimeStamp = mEndTimeStamp ; bucketOut.mRxBytes = mRecycledSummaryEntry.rxBytes ; bucketOut.mRxPackets = mRecycledSummaryEntry.rxPackets ; bucketOut.mTxBytes = mRecycledSummaryEntry.txBytes ; bucketOut.mTxPackets = mRecycledSummaryEntry.txPackets ; }

Target:
private void fillBucketFromSummaryEntry ( android.app.usage.NetworkStats.Bucket bucketOut ) { bucketOut.mUid = android.app.usage.NetworkStats.Bucket.convertUid ( mRecycledSummaryEntry.uid ) ; bucketOut.mTag = android.app.usage.NetworkStats.Bucket.convertTag ( mRecycledSummaryEntry.tag ) ; bucketOut.mState = android.app.usage.NetworkStats.Bucket.convertState ( mRecycledSummaryEntry.set ) ; bucketOut.mDefaultNetwork = android.app.usage.NetworkStats.Bucket.convertDefaultNetwork ( mRecycledSummaryEntry.defaultNetwork ) ; bucketOut.mMetered = android.app.usage.NetworkStats.Bucket.convertMetered ( mRecycledSummaryEntry.metered ) ; bucketOut.mRoaming = android.app.usage.NetworkStats.Bucket.convertRoaming ( mRecycledSummaryEntry.roaming ) ; bucketOut.mBeginTimeStamp = mStartTimeStamp ; bucketOut.mEndTimeStamp = mEndTimeStamp ; bucketOut.mRxBytes = mRecycledSummaryEntry.rxBytes ; bucketOut.mRxPackets = mRecycledSummaryEntry.rxPackets ; bucketOut.mTxBytes = mRecycledSummaryEntry.txBytes ; bucketOut.mTxPackets = mRecycledSummaryEntry.txPackets ; }
Source:
private static android.app.job.JobWorkItem makeWorkItem ( android.net.Uri voicemailUri ) { android.content.Intent intent = new android.content.Intent ( ) ; intent.putExtra ( com.android.voicemail.impl.transcribe.TranscriptionService.EXTRA_VOICEMAIL_URI , voicemailUri ) ; return new android.app.job.JobWorkItem ( intent ) ; }

Target:
private static android.app.job.JobWorkItem makeWorkItem ( android.net.Uri voicemailUri , android.telecom.PhoneAccountHandle account ) { android.content.Intent intent = new android.content.Intent ( ) ; intent.putExtra ( com.android.voicemail.impl.transcribe.TranscriptionService.EXTRA_VOICEMAIL_URI , voicemailUri ) ; if ( account != null ) { intent.putExtra ( com.android.voicemail.impl.transcribe.TranscriptionService.EXTRA_ACCOUNT_HANDLE , account ) ; } return new android.app.job.JobWorkItem ( intent ) ; }
Source:
public static void main ( java.lang.String [ ] args ) throws java.lang.Exception { java.lang.String name = java.lang.System.getProperty ( "java.vm.name" ) ; if ( ! ( "Dalvik" . equals ( name ) ) ) { java.lang.System.out.println ( ( "This test is not supported on " + name ) ) ; return ; } Main.testMethodTracing ( ) ; Main.testRuntimeStat ( ) ; }

Target:
public static void main ( java.lang.String [ ] args ) throws java.lang.Exception { java.lang.String name = java.lang.System.getProperty ( "java.vm.name" ) ; if ( ! ( "Dalvik" . equals ( name ) ) ) { java.lang.System.out.println ( ( "This test is not supported on " + name ) ) ; return ; } Main.testMethodTracing ( ) ; Main.testCountInstances ( ) ; Main.testRuntimeStat ( ) ; Main.testRuntimeStats ( ) ; }
Source:
public com.android.jack.dx.rop.type.Type getComponentType ( ) { if ( ( componentType ) == null ) { if ( ( descriptor.charAt ( 0 ) ) != '[' ) { throw new java.lang.IllegalArgumentException ( ( "not an array type: " + ( descriptor ) ) ) ; } componentType = com.android.jack.dx.rop.type.Type.intern ( descriptor.substring ( 1 ) ) ; } return componentType ; }

Target:
public com.android.jack.dx.rop.type.Type getArrayType ( ) { if ( ( arrayType ) == null ) { arrayType = com.android.jack.dx.rop.type.Type.putIntern ( new com.android.jack.dx.rop.type.Type ( ( '[' + ( descriptor.getString ( ) ) ) , com.android.jack.dx.rop.type.Type.BT_OBJECT ) ) ; } return arrayType ; }
Source:
void cleanUpResourcesLI ( ) { java.lang.String sourceDir = getCodePath ( ) ; if ( cleanUp ( ) ) { int retCode = mInstaller.rmdex ( sourceDir ) ; if ( retCode < 0 ) { android.util.Slog.w ( com.android.server.pm.PackageManagerService.TAG , ( ( ( ( "Couldn't remove dex file for package: " + " at location " ) + sourceDir ) + ", retcode=" ) + retCode ) ) ; } } }

Target:
void cleanUpResourcesLI ( ) { java.lang.String sourceDir = getCodePath ( ) ; if ( cleanUp ( ) ) { if ( ( instructionSet ) == null ) { throw new java.lang.IllegalStateException ( "instructionSet == null" ) ; } int retCode = mInstaller.rmdex ( sourceDir , instructionSet ) ; if ( retCode < 0 ) { android.util.Slog.w ( com.android.server.pm.PackageManagerService.TAG , ( ( ( ( "Couldn't remove dex file for package: " + " at location " ) + sourceDir ) + ", retcode=" ) + retCode ) ) ; } } }
Source:
private void allowConnection ( boolean allow ) { if ( allow ) { doReturn ( BluetoothProfile.PRIORITY_ON ) . when ( mA2dpService ) . getPriority ( any ( android.bluetooth.BluetoothDevice.class ) ) ; } else { doReturn ( BluetoothProfile.PRIORITY_OFF ) . when ( mA2dpService ) . getPriority ( any ( android.bluetooth.BluetoothDevice.class ) ) ; } doReturn ( true ) . when ( mA2dpService ) . canConnectToDevice ( any ( android.bluetooth.BluetoothDevice.class ) ) ; }

Target:
private void allowConnection ( boolean allow ) { doReturn ( allow ) . when ( mA2dpService ) . okToConnect ( any ( android.bluetooth.BluetoothDevice.class ) ) ; }
Source:
public int gattServerOpenGattServer ( @ com.googlecode.android_scripting.rpc.RpcParameter ( name = "index" ) java.lang.Integer index ) throws java.lang.Exception { if ( ( mBluetoothGattServerCallbackList.get ( index ) ) != null ) { android.bluetooth.BluetoothGattServer mGattServer = mBluetoothManager.openGattServer ( mContext , mBluetoothGattServerCallbackList.get ( index ) ) ; com.googlecode.android_scripting.facade.bluetooth.GattServerFacade.GattServerCount += 1 ; int in = com.googlecode.android_scripting.facade.bluetooth.GattServerFacade.GattServerCount ; mBluetoothGattServerList.put ( in , mGattServer ) ; return in ; } else { throw new java.lang.Exception ( ( "Invalid index input:" + ( java.lang.Integer.toString ( index ) ) ) ) ; } }

Target:
public int gattServerOpenGattServer ( @ com.googlecode.android_scripting.rpc.RpcParameter ( name = "index" ) java.lang.Integer index ) throws java.lang.Exception { if ( ( mBluetoothGattServerCallbackList.get ( index ) ) != null ) { android.bluetooth.BluetoothGattServer mGattServer = mBluetoothManager.openGattServer ( mContext , mBluetoothGattServerCallbackList.get ( index ) ) ; com.googlecode.android_scripting.facade.bluetooth.GattServerFacade.sGattServerCount += 1 ; int in = com.googlecode.android_scripting.facade.bluetooth.GattServerFacade.sGattServerCount ; mBluetoothGattServerList.put ( in , mGattServer ) ; return in ; } else { throw new java.lang.Exception ( ( "Invalid index input:" + ( java.lang.Integer.toString ( index ) ) ) ) ; } }
Source:
public void logp ( java.util.logging.Level level , java.lang.String sourceClass , java.lang.String sourceMethod , java.lang.String msg ) { 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 ) ; doLog ( lr ) ; }

Target:
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 ( ! ( isLoggable ( level ) ) ) { return ; } java.util.logging.LogRecord lr = new java.util.logging.LogRecord ( level , msg ) ; lr.setSourceClassName ( sourceClass ) ; lr.setSourceMethodName ( sourceMethod ) ; lr.setThrown ( thrown ) ; doLog ( lr ) ; }
Source:
void putUnchecked ( int pos , short [ ] src , int srcOffset , int length ) { libcore.io.Memory.pokeShortArray ( ix ( pos ) , src , srcOffset , length , ( ! ( nativeByteOrder ) ) ) ; }

Target:
void putUnchecked ( int pos , short [ ] src , int srcOffset , int length ) { if ( ! ( memoryRef.isAccessible ) ) { throw new java.lang.IllegalStateException ( "buffer is inaccessible" ) ; } libcore.io.Memory.pokeShortArray ( ix ( pos ) , src , srcOffset , length , ( ! ( nativeByteOrder ) ) ) ; }
Source:
synchronized void nAllocationData2D ( long id , int xoff , int yoff , int mip , int face , int w , int h , long [ ] d , int sizeBytes ) { validate ( ) ; rsnAllocationData2D ( mContext , id , xoff , yoff , mip , face , w , h , d , sizeBytes ) ; }

Target:
synchronized void nAllocationData2D ( long id , int xoff , int yoff , int mip , int face , int w , int h , java.lang.Object d , int sizeBytes , android.support.v8.renderscript.Element.DataType dt ) { validate ( ) ; rsnAllocationData2D ( mContext , id , xoff , yoff , mip , face , w , h , d , sizeBytes , dt.mID ) ; }
Source:
public android.content.Loader < com.android.contacts.common.model.Contact > onCreateLoader ( int id , android.os.Bundle args ) { if ( ( mLookupUri ) == null ) { android.util.Log.wtf ( com.android.contacts.quickcontact.QuickContactActivity.TAG , "Lookup uri wasn't initialized. Loader was started too early" ) ; } return new com.android.contacts.common.model.ContactLoader ( getApplicationContext ( ) , mLookupUri , true , false , true , true ) ; }

Target:
public android.content.Loader < com.android.contacts.model.Contact > onCreateLoader ( int id , android.os.Bundle args ) { if ( ( mLookupUri ) == null ) { android.util.Log.wtf ( com.android.contacts.quickcontact.QuickContactActivity.TAG , "Lookup uri wasn't initialized. Loader was started too early" ) ; } return new com.android.contacts.model.ContactLoader ( getApplicationContext ( ) , mLookupUri , true , true , true ) ; }
Source:
public void voiceRadioTechChanged ( int indicationType , int var2 ) { }

Target:
public void voiceRadioTechChanged ( int indicationType , int rat ) { mRil.processIndication ( indicationType ) ; int [ ] response = new int [ 1 ] ; response [ 0 ] = rat ; if ( RIL.RILJ_LOGD ) mRil.unsljLogRet ( com.android.internal.telephony.RILConstants.RIL_UNSOL_VOICE_RADIO_TECH_CHANGED , response ) ; mRil.mVoiceRadioTechChangedRegistrants.notifyRegistrants ( new android.os.AsyncResult ( null , response , null ) ) ; }
Source:
public void enter ( ) { if ( com.android.server.wifi.WifiStateMachine.DBG ) { log ( ( ( "RoamingState Enter" + " mScreenOn=" ) + ( mScreenOn ) ) ) ; } setScanAlarm ( false , 0 ) ; ( roamWatchdogCount ) ++ ; loge ( ( "Start Roam Watchdog " + ( roamWatchdogCount ) ) ) ; sendMessageDelayed ( obtainMessage ( com.android.server.wifi.WifiStateMachine.CMD_ROAM_WATCHDOG_TIMER , roamWatchdogCount , 0 ) , com.android.server.wifi.WifiStateMachine.ROAM_GUARD_TIMER_MSEC ) ; mAssociated = false ; }

Target:
public void enter ( ) { if ( mVerboseLoggingEnabled ) { log ( ( ( "RoamingState Enter" + " mScreenOn=" ) + ( mScreenOn ) ) ) ; } ( roamWatchdogCount ) ++ ; logd ( ( "Start Roam Watchdog " + ( roamWatchdogCount ) ) ) ; sendMessageDelayed ( obtainMessage ( com.android.server.wifi.WifiStateMachine.CMD_ROAM_WATCHDOG_TIMER , roamWatchdogCount , 0 ) , com.android.server.wifi.WifiStateMachine.ROAM_GUARD_TIMER_MSEC ) ; mAssociated = false ; }
Source:
public void test_currencyWithPatternDigits ( ) throws java.lang.Exception { java.text.NumberFormat nf = java.text.NumberFormat.getCurrencyInstance ( java.util.Locale.JAPAN ) ; assertEquals ( "￥50" , nf.format ( 50.0 ) ) ; nf = java.text.NumberFormat.getCurrencyInstance ( java.util.Locale.forLanguageTag ( "hy-AM" ) ) ; assertEquals ( "֏ 50" , nf.format ( 50.0 ) ) ; nf = java.text.NumberFormat.getCurrencyInstance ( java.util.Locale.forLanguageTag ( "de-CH" ) ) ; assertEquals ( "CHF 50.00" , nf.format ( 50.0 ) ) ; }

Target:
public void test_currencyWithPatternDigits ( ) throws java.lang.Exception { java.text.NumberFormat nf = java.text.NumberFormat.getCurrencyInstance ( java.util.Locale.JAPAN ) ; assertEquals ( "￥50" , nf.format ( 50.0 ) ) ; nf = java.text.NumberFormat.getCurrencyInstance ( java.util.Locale.forLanguageTag ( "hy-AM" ) ) ; assertEquals ( "50 ֏" , nf.format ( 50.0 ) ) ; nf = java.text.NumberFormat.getCurrencyInstance ( java.util.Locale.forLanguageTag ( "de-CH" ) ) ; assertEquals ( "CHF 50.00" , nf.format ( 50.0 ) ) ; }
Source:
private void writeBtHciSnoopLogOptions ( ) { android.bluetooth.BluetoothAdapter adapter = android.bluetooth.BluetoothAdapter.getDefaultAdapter ( ) ; adapter.configHciSnoopLog ( mBtHciSnoopLog.isChecked ( ) ) ; Settings.Secure.putInt ( getActivity ( ) . getContentResolver ( ) , Settings.Secure.BLUETOOTH_HCI_LOG , ( mBtHciSnoopLog.isChecked ( ) ? 1 : 0 ) ) ; }

Target:
private void writeBtHciSnoopLogOptions ( ) { android.bluetooth.BluetoothAdapter adapter = android.bluetooth.BluetoothAdapter.getDefaultAdapter ( ) ; android.os.SystemProperties.set ( com.android.settings.DevelopmentSettings.BLUETOOTH_BTSNOOP_ENABLE_PROPERTY , java.lang.Boolean.toString ( mBtHciSnoopLog.isChecked ( ) ) ) ; }
Source:
boolean enqueue ( java.lang.ref.Reference < ? extends T > r ) { synchronized ( lock ) { if ( ( tail ) == null ) { head = r ; } else { tail.queueNext = r ; } tail = r ; tail.queueNext = r ; lock.notifyAll ( ) ; return true ; } }

Target:
boolean enqueue ( java.lang.ref.Reference < ? extends T > reference ) { synchronized ( lock ) { if ( enqueueLocked ( reference ) ) { lock.notifyAll ( ) ; return true ; } return false ; } }
Source:
public void testPublishTerminatedDone ( ) throws org.json.JSONException { final int publishId = 167 ; android.os.Bundle args = new android.os.Bundle ( ) ; args.putInt ( "publish_id" , publishId ) ; args.putInt ( "reason" , WifiAwareNative.AWARE_STATUS_SUCCESS ) ; com.android.server.wifi.aware.WifiAwareHalMock.callPublishTerminated ( com.android.server.wifi.HalMockUtils.convertBundleToJson ( args ) . toString ( ) ) ; org.mockito.Mockito.verify ( mAwareStateManager ) . onSessionTerminatedNotification ( publishId , DiscoverySessionCallback.TERMINATE_REASON_DONE , true ) ; org.mockito.Mockito.verifyNoMoreInteractions ( mAwareStateManager ) ; }

Target:
public void testSubscribeTerminatedFail ( ) throws org.json.JSONException { final int subscribeId = 167 ; android.os.Bundle args = new android.os.Bundle ( ) ; args.putInt ( "subscribe_id" , subscribeId ) ; args.putInt ( "reason" , WifiAwareNative.AWARE_STATUS_INTERNAL_FAILURE ) ; com.android.server.wifi.aware.WifiAwareHalMock.callSubscribeTerminated ( com.android.server.wifi.HalMockUtils.convertBundleToJson ( args ) . toString ( ) ) ; org.mockito.Mockito.verify ( mAwareStateManager ) . onSessionTerminatedNotification ( subscribeId , WifiAwareNative.AWARE_STATUS_INTERNAL_FAILURE , false ) ; org.mockito.Mockito.verifyNoMoreInteractions ( mAwareStateManager ) ; }
Source:
public static java.lang.String getStorageRootFromOptions ( @ org.jetbrains.annotations.NotNull com.intellij.openapi.module.Module module ) { java.lang.String moduleRoot = com.intellij.openapi.roots.impl.storage.ClasspathStorage.getModuleDir ( module ) ; java.lang.String storageRef = module.getOptionValue ( JpsProjectLoader.CLASSPATH_DIR_ATTRIBUTE ) ; if ( storageRef == null ) { return moduleRoot ; } storageRef = com.intellij.openapi.util.io.FileUtil.toSystemIndependentName ( storageRef ) ; return ( storageRef.charAt ( 0 ) ) == '/' ? storageRef : ( moduleRoot + '/' ) + storageRef ; }

Target:
public static java.lang.String getStorageRootFromOptions ( @ org.jetbrains.annotations.NotNull com.intellij.openapi.module.Module module ) { java.lang.String moduleRoot = com.intellij.openapi.roots.impl.storage.ClasspathStorage.getModuleDir ( module ) ; java.lang.String storageRef = module.getOptionValue ( JpsProjectLoader.CLASSPATH_DIR_ATTRIBUTE ) ; if ( storageRef == null ) { return moduleRoot ; } storageRef = com.intellij.openapi.util.io.FileUtil.toSystemIndependentName ( storageRef ) ; if ( com.intellij.openapi.util.SystemInfo.isWindows ? com.intellij.openapi.util.io.FileUtil.isAbsolutePlatformIndependent ( storageRef ) : com.intellij.openapi.util.io.FileUtil.isUnixAbsolutePath ( storageRef ) ) { return storageRef ; } else { return ( moduleRoot + '/' ) + storageRef ; } }
Source:
public org.eclipse.swt.graphics.Font getFont ( java.lang.Object element ) { if ( element instanceof com.android.hierarchyviewerlib.device.Window ) { int focusedWindow = mModel.getFocusedWindow ( ( ( com.android.hierarchyviewerlib.device.Window ) ( element ) ) . getDevice ( ) ) ; if ( focusedWindow == ( ( ( com.android.hierarchyviewerlib.device.Window ) ( element ) ) . getHashCode ( ) ) ) { return mBoldFont ; } } return null ; }

Target:
public org.eclipse.swt.graphics.Font getFont ( java.lang.Object element ) { if ( element instanceof com.android.hierarchyviewerlib.models.Window ) { int focusedWindow = mModel.getFocusedWindow ( ( ( com.android.hierarchyviewerlib.models.Window ) ( element ) ) . getHvDevice ( ) ) ; if ( focusedWindow == ( ( ( com.android.hierarchyviewerlib.models.Window ) ( element ) ) . getHashCode ( ) ) ) { return mBoldFont ; } } return null ; }
Source:
public boolean retainAll ( final java.util.Collection < ? > c ) { com.google.common.base.Preconditions.checkNotNull ( c ) ; com.google.common.base.Predicate < java.util.Map.Entry < R , V > > predicate = new com.google.common.base.Predicate < java.util.Map.Entry < R , V > > ( ) { @ java.lang.Override public boolean apply ( java.util.Map.Entry < R , V > entry ) { return ! ( c.contains ( entry.getValue ( ) ) ) ; } } ; return removePredicate ( predicate ) ; }

Target:
public java.util.Iterator < java.util.Map.Entry < C , java.util.Map < R , V > > > iterator ( ) { return com.google.common.collect.Maps.asMapEntryIterator ( columnKeySet ( ) , new com.google.common.base.Function < C , java.util.Map < R , V > > ( ) { @ java.lang.Override public java.util.Map < R , V > apply ( C columnKey ) { return column ( columnKey ) ; } } ) ; }
Source:
public void normalLogRecSizeIsUsedByDefault ( ) { for ( int i = 0 ; i < ( ( WifiStateMachine.NUM_LOG_RECS_NORMAL ) * 2 ) ; i ++ ) { mWsm.sendMessage ( WifiStateMachine.CMD_DISCONNECT ) ; } mLooper.dispatchAll ( ) ; org.junit.Assert.assertEquals ( WifiStateMachine.NUM_LOG_RECS_NORMAL , mWsm.getLogRecSize ( ) ) ; }

Target:
public void normalLogRecSizeIsUsedByDefault ( ) { org.junit.Assert.assertEquals ( WifiStateMachine.NUM_LOG_RECS_NORMAL , mWsm.getLogRecMaxSize ( ) ) ; }
Source:
public boolean replace ( K key , V oldValue , V newValue ) { int hash = java.util.concurrent.ConcurrentHashMap.hash ( key.hashCode ( ) ) ; if ( ( oldValue == null ) || ( newValue == null ) ) throw new java.lang.NullPointerException ( ) ; java.util.concurrent.ConcurrentHashMap.Segment < K , V > s = segmentForHash ( hash ) ; return ( s != null ) && ( s.replace ( key , hash , oldValue , newValue ) ) ; }

Target:
public boolean replace ( K key , V oldValue , V newValue ) { if ( ( ( key == null ) || ( oldValue == null ) ) || ( newValue == null ) ) throw new java.lang.NullPointerException ( ) ; return ( replaceNode ( key , newValue , oldValue ) ) != null ; }
Source:
public boolean perform ( ) { try { java.util.List < byte [ ] > l = new java.util.ArrayList < byte [ ] > ( ) ; for ( int i = 0 ; i < 1024 ; i ++ ) { l.add ( new byte [ 1024 ] ) ; } } catch ( java.lang.OutOfMemoryError e ) { } return true ; }

Target:
public boolean perform ( ) { try { java.util.List < byte [ ] > l = new java.util.ArrayList < byte [ ] > ( ) ; for ( int i = 0 ; i < ( Main.Alloc.ALLOC_COUNT ) ; i ++ ) { l.add ( new byte [ Main.Alloc.ALLOC_SIZE ] ) ; } } catch ( java.lang.OutOfMemoryError e ) { } return true ; }
Source:
public static android.telephony.MbmsDownloadManager create ( android.content.Context context , android.telephony.mbms.MbmsDownloadManagerCallback listener , int subscriptionId ) throws android.telephony.mbms.MbmsException { android.telephony.MbmsDownloadManager mdm = new android.telephony.MbmsDownloadManager ( context , listener , subscriptionId ) ; mdm.bindAndInitialize ( ) ; return mdm ; }

Target:
public static android.telephony.MbmsDownloadManager create ( android.content.Context context , android.telephony.mbms.MbmsDownloadManagerCallback listener , int subscriptionId ) throws android.telephony.mbms.MbmsException { if ( ! ( android.telephony.MbmsDownloadManager.sIsInitialized.compareAndSet ( false , true ) ) ) { throw new android.telephony.mbms.MbmsException ( MbmsException.InitializationErrors.ERROR_DUPLICATE_INITIALIZE ) ; } android.telephony.MbmsDownloadManager mdm = new android.telephony.MbmsDownloadManager ( context , listener , subscriptionId ) ; try { mdm.bindAndInitialize ( ) ; } catch ( android.telephony.mbms.MbmsException e ) { android.telephony.MbmsDownloadManager.sIsInitialized.set ( false ) ; throw e ; } return mdm ; }
Source:
public boolean matches ( @ com.android.annotations.NonNull java.lang.String name ) { int length = name.length ( ) ; char [ ] chars = mBinding.readableName ( ) ; if ( ( chars.length ) != length ) { return false ; } for ( int i = 0 ; i < length ; i ++ ) { if ( ( chars [ i ] ) != ( name.charAt ( i ) ) ) { return false ; } } return true ; }

Target:
private static boolean sameChars ( java.lang.String str , char [ ] chars ) { int length = str.length ( ) ; if ( ( chars.length ) != length ) { return false ; } for ( int i = 0 ; i < length ; i ++ ) { if ( ( chars [ i ] ) != ( str.charAt ( i ) ) ) { return false ; } } return true ; }
Source:
public void performReceive ( android.content.Intent intent , int resultCode , java.lang.String data , android.os.Bundle extras , boolean ordered , boolean sticky ) throws android.os.RemoteException { synchronized ( this ) { mDidUpdate = true ; } systemReady ( goingCallback ) ; }

Target:
public void onReceive ( android.content.Context context , android.content.Intent intent ) { java.lang.String [ ] pkgs = intent.getStringArrayExtra ( Intent.EXTRA_PACKAGES ) ; if ( pkgs != null ) { for ( java.lang.String pkg : pkgs ) { synchronized ( this ) { if ( forceStopPackageLocked ( pkg , ( - 1 ) , false , false , false ) ) { setResultCode ( Activity.RESULT_OK ) ; return ; } } } } }
Source:
private boolean abortIdleOptimizations ( long lowStorageThreshold ) { if ( mAbortIdleOptimization.get ( ) ) { return true ; } long usableSpace = mDataDir.getUsableSpace ( ) ; if ( usableSpace < lowStorageThreshold ) { android.util.Log.w ( com.android.server.pm.BackgroundDexOptService.TAG , ( "Aborting background dex opt job due to low storage: " + usableSpace ) ) ; return true ; } return false ; }

Target:
private int reconcileSecondaryDexFiles ( com.android.server.pm.dex.DexManager dm ) { for ( java.lang.String p : dm.getAllPackagesWithSecondaryDexFiles ( ) ) { if ( mAbortIdleOptimization.get ( ) ) { return com.android.server.pm.BackgroundDexOptService.OPTIMIZE_ABORT_BY_JOB_SCHEDULER ; } dm.reconcileSecondaryDexFiles ( p ) ; } return com.android.server.pm.BackgroundDexOptService.OPTIMIZE_PROCESSED ; }
Source:
public void enter ( ) { super . enter ( ) ; mConnectingTimestampMs = java.lang.Long.MIN_VALUE ; mPhonebook.resetAtState ( ) ; mSystemInterface.getHeadsetPhoneState ( ) . listenForPhoneState ( false ) ; mVoiceRecognitionStarted = false ; mWaitingForVoiceRecognition = false ; mAudioParams.clear ( ) ; broadcastStateTransitions ( ) ; if ( ( ( mPrevState ) != null ) && ( ( mAdapterService.getBondState ( mDevice ) ) == ( android.bluetooth.BluetoothDevice.BOND_NONE ) ) ) { getHandler ( ) . post ( ( ) -> com.android.bluetooth.hfp.mHeadsetService.removeStateMachine ( com.android.bluetooth.hfp.mDevice ) ) ; } }

Target:
public void enter ( ) { super . enter ( ) ; mConnectingTimestampMs = java.lang.Long.MIN_VALUE ; mPhonebook.resetAtState ( ) ; updateAgIndicatorEnableState ( null ) ; mVoiceRecognitionStarted = false ; mWaitingForVoiceRecognition = false ; mAudioParams.clear ( ) ; broadcastStateTransitions ( ) ; if ( ( ( mPrevState ) != null ) && ( ( mAdapterService.getBondState ( mDevice ) ) == ( android.bluetooth.BluetoothDevice.BOND_NONE ) ) ) { getHandler ( ) . post ( ( ) -> com.android.bluetooth.hfp.mHeadsetService.removeStateMachine ( com.android.bluetooth.hfp.mDevice ) ) ; } }
Source:
private static java.util.List < com.android.ide.eclipse.gltrace.state.transforms.IStateTransform > transformsForGlDepthFunc ( com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage msg ) { com.android.ide.eclipse.gldebugger.GLEnum func = com.android.ide.eclipse.gldebugger.GLEnum.valueOf ( msg.getArgs ( 0 ) . getIntValue ( 0 ) ) ; com.android.ide.eclipse.gltrace.state.transforms.IStateTransform transform = new com.android.ide.eclipse.gltrace.state.transforms.PropertyChangeTransform ( com.android.ide.eclipse.gltrace.state.transforms.GLPropertyAccessor.makeAccessor ( msg.getContextId ( ) , GLStateType.PIXEL_OPERATIONS , GLStateType.DEPTH_FUNC ) , func ) ; return java.util.Collections.singletonList ( transform ) ; }

Target:
private static java.util.List < com.android.ide.eclipse.gltrace.state.transforms.IStateTransform > transformsForGlDepthFunc ( com.android.ide.eclipse.gltrace.GLProtoBuf.GLMessage msg ) { com.android.ide.eclipse.gltrace.GLEnum func = com.android.ide.eclipse.gltrace.GLEnum.valueOf ( msg.getArgs ( 0 ) . getIntValue ( 0 ) ) ; com.android.ide.eclipse.gltrace.state.transforms.IStateTransform transform = new com.android.ide.eclipse.gltrace.state.transforms.PropertyChangeTransform ( com.android.ide.eclipse.gltrace.state.transforms.GLPropertyAccessor.makeAccessor ( msg.getContextId ( ) , GLStateType.PIXEL_OPERATIONS , GLStateType.DEPTH_FUNC ) , func ) ; return java.util.Collections.singletonList ( transform ) ; }
Source:
public static long digestFile ( java.io.File file ) throws java.io.IOException { if ( com.intellij.updater.Utils.isZipFile ( file.getName ( ) ) ) { java.util.zip.ZipFile zipFile ; try { zipFile = new java.util.zip.ZipFile ( file ) ; } catch ( java.io.IOException e ) { com.intellij.updater.Runner.printStackTrace ( e ) ; return com.intellij.updater.Digester.doDigestRegularFile ( file ) ; } try { return com.intellij.updater.Digester.doDigestZipFile ( zipFile ) ; } finally { zipFile.close ( ) ; } } return com.intellij.updater.Digester.doDigestRegularFile ( file ) ; }

Target:
public static long digestFile ( java.io.File file ) throws java.io.IOException { if ( ( ! ( Runner.ZIP_AS_BINARY ) ) && ( com.intellij.updater.Utils.isZipFile ( file.getName ( ) ) ) ) { java.util.zip.ZipFile zipFile ; try { zipFile = new java.util.zip.ZipFile ( file ) ; } catch ( java.io.IOException e ) { com.intellij.updater.Runner.printStackTrace ( e ) ; return com.intellij.updater.Digester.digestRegularFile ( file ) ; } try { return com.intellij.updater.Digester.doDigestZipFile ( zipFile ) ; } finally { zipFile.close ( ) ; } } return com.intellij.updater.Digester.digestRegularFile ( file ) ; }
Source:
public void setApplicationEnabledSetting ( java.lang.String appPackageName , int newState , int flags , int userId ) { if ( ! ( com.android.server.pm.PackageManagerService.sUserManager.exists ( userId ) ) ) return ; setEnabledSetting ( appPackageName , null , newState , flags , userId ) ; }

Target:
public void setComponentEnabledSetting ( android.content.ComponentName componentName , int newState , int flags , int userId ) { if ( ! ( com.android.server.pm.PackageManagerService.sUserManager.exists ( userId ) ) ) return ; setEnabledSetting ( componentName.getPackageName ( ) , componentName.getClassName ( ) , newState , flags , userId , null ) ; }
Source:
private static void printBitmap ( com.android.ahat.Doc doc , com.android.tools.perflib.heap.Instance inst ) { com.android.tools.perflib.heap.Instance bitmap = com.android.ahat.InstanceUtils.getAssociatedBitmapInstance ( inst ) ; if ( bitmap != null ) { doc.section ( "Bitmap Image" ) ; doc.println ( com.android.ahat.DocString.image ( com.android.ahat.DocString.formattedUri ( "bitmap?id=%d" , bitmap.getId ( ) ) , "bitmap image" ) ) ; } }

Target:
private static void printBitmap ( com.android.ahat.Doc doc , com.android.ahat.heapdump.AhatInstance inst ) { com.android.ahat.heapdump.AhatInstance bitmap = inst.getAssociatedBitmapInstance ( ) ; if ( bitmap != null ) { doc.section ( "Bitmap Image" ) ; doc.println ( com.android.ahat.DocString.image ( com.android.ahat.DocString.formattedUri ( "bitmap?id=%d" , bitmap.getId ( ) ) , "bitmap image" ) ) ; } }
Source:
public void createTestProject ( ) { com.android.sdklib.IAndroidTarget target = null ; com.android.sdklib.IAndroidTarget [ ] targets = getSdk ( ) . getTargets ( ) ; for ( com.android.sdklib.IAndroidTarget t : targets ) { if ( ( t.getVersion ( ) . getApiLevel ( ) ) >= 11 ) { target = t ; break ; } } assertNotNull ( target ) ; }

Target:
public void createTestProject ( ) { com.android.sdklib.IAndroidTarget target = null ; com.android.sdklib.IAndroidTarget [ ] targets = getSdk ( ) . getTargets ( ) ; for ( com.android.sdklib.IAndroidTarget t : targets ) { if ( ( t.getVersion ( ) . getApiLevel ( ) ) >= ( com.android.ide.eclipse.adt.internal.editors.layout.refactoring.AdtProjectTest.TARGET_API_LEVEL ) ) { target = t ; break ; } } assertNotNull ( target ) ; }
Source:
public void visitLibraryMethod ( proguard.classfile.visitor.LibraryClass libraryClass , proguard.classfile.visitor.LibraryMethod libraryMethod ) { if ( visitThisMethod ) { libraryMethod.accept ( libraryClass , memberVisitor ) ; } if ( ! ( isSpecial ( libraryClass , libraryMethod ) ) ) { libraryClass.hierarchyAccept ( false , visitSuperMethods , visitInterfaceMethods , visitOverridingMethods , new proguard.classfile.visitor.NamedMethodVisitor ( libraryMethod.getName ( libraryClass ) , libraryMethod.getDescriptor ( libraryClass ) , new proguard.classfile.visitor.MemberAccessFilter ( 0 , ( ( ClassConstants.INTERNAL_ACC_PRIVATE ) | ( ClassConstants.INTERNAL_ACC_STATIC ) ) , memberVisitor ) ) ) ; } }

Target:
public void visitLibraryMethod ( proguard.classfile.visitor.LibraryClass libraryClass , proguard.classfile.visitor.LibraryMethod libraryMethod ) { if ( visitThisMethod ) { libraryMethod.accept ( libraryClass , memberVisitor ) ; } if ( ! ( isSpecial ( libraryClass , libraryMethod ) ) ) { libraryClass.hierarchyAccept ( false , visitSuperMethods , visitInterfaceMethods , visitOverridingMethods , new proguard.classfile.visitor.NamedMethodVisitor ( libraryMethod.getName ( libraryClass ) , libraryMethod.getDescriptor ( libraryClass ) , new proguard.classfile.visitor.MemberAccessFilter ( 0 , ( ( ClassConstants.ACC_PRIVATE ) | ( ClassConstants.ACC_STATIC ) ) , memberVisitor ) ) ) ; } }
Source:
private void onRecordsLoaded ( ) { if ( DBG ) log ( "onRecordsLoaded: createAllApnList" ) ; createAllApnList ( ) ; if ( mPhone.mCi.getRadioState ( ) . isOn ( ) ) { if ( DBG ) log ( "onRecordsLoaded: notifying data availability" ) ; notifyOffApnsOfAvailability ( Phone.REASON_SIM_LOADED ) ; } setupDataOnConnectableApns ( Phone.REASON_SIM_LOADED ) ; }

Target:
private void onRecordsLoaded ( ) { if ( DBG ) log ( "onRecordsLoaded: createAllApnList" ) ; createAllApnList ( ) ; setInitialAttachApn ( ) ; if ( mPhone.mCi.getRadioState ( ) . isOn ( ) ) { if ( DBG ) log ( "onRecordsLoaded: notifying data availability" ) ; notifyOffApnsOfAvailability ( Phone.REASON_SIM_LOADED ) ; } setupDataOnConnectableApns ( Phone.REASON_SIM_LOADED ) ; }
Source:
private static void test_directGetResourceAsStream ( dalvik.system.DexClassLoaderTest.Configuration config , java.lang.String resourceName , java.lang.String expectedContents ) throws java.lang.Exception { dalvik.system.DexClassLoader dcl = dalvik.system.DexClassLoaderTest.createInstance ( config ) ; java.io.InputStream in = dcl.getResourceAsStream ( resourceName ) ; byte [ ] contents = libcore.io.Streams.readFully ( in ) ; java.lang.String s = new java.lang.String ( contents , "UTF-8" ) ; assertEquals ( expectedContents , s ) ; }

Target:
private java.lang.String createLoaderAndGetResource ( java.lang.String resourceName , java.io.File ... files ) throws java.lang.Exception { java.lang.ClassLoader cl = createLoader ( files ) ; java.io.InputStream in = cl.getResourceAsStream ( resourceName ) ; if ( in == null ) { throw new java.lang.IllegalStateException ( ( "Resource not found: " + resourceName ) ) ; } byte [ ] contents = libcore.io.Streams.readFully ( in ) ; return new java.lang.String ( contents , "UTF-8" ) ; }
Source:
public boolean perform ( ) { try { Main.SigQuit.kill.invoke ( null , Main.SigQuit.pid , Main.SigQuit.sigquit ) ; } catch ( java.lang.OutOfMemoryError e ) { } catch ( java.lang.Exception e ) { if ( ! ( e.getClass ( ) . getName ( ) . equals ( "ErrnoException" ) ) ) { e.printStackTrace ( java.lang.System.out ) ; } } return true ; }

Target:
public boolean perform ( ) { try { Main.SigQuit.kill.invoke ( null , Main.SigQuit.pid , Main.SigQuit.sigquit ) ; } catch ( java.lang.OutOfMemoryError e ) { } catch ( java.lang.Exception e ) { if ( ! ( e.getClass ( ) . getName ( ) . equals ( Main.errnoExceptionName ) ) ) { Main.printThrowable ( e ) ; } } return true ; }
Source:
private static void compileSourceToDex ( @ javax.annotation.Nonnull com.android.jack.Options options , @ javax.annotation.Nonnull java.io.File sourceFolderOrSourceList , @ javax.annotation.CheckForNull java.lang.String classpath , @ javax.annotation.Nonnull java.io.File out ) throws java.lang.Exception { options.setEcjArguments ( com.android.jack.TestTools.buildEcjArgs ( ) ) ; addFile ( sourceFolderOrSourceList , options.getEcjArguments ( ) ) ; options.setClasspath ( classpath ) ; options.setOutputDir ( out ) ; com.android.jack.experimental.incremental.JackIncremental.run ( options ) ; }

Target:
private static void compileSourceToDex ( @ javax.annotation.Nonnull com.android.jack.Options options , @ javax.annotation.Nonnull java.io.File sourceFolderOrSourceList , @ javax.annotation.CheckForNull java.lang.String classpath , @ javax.annotation.Nonnull java.io.File out ) throws java.lang.Exception { options.setEcjArguments ( com.android.jack.TestTools.buildEcjArgs ( ) ) ; addFile ( sourceFolderOrSourceList , options.getEcjArguments ( ) ) ; options.setClasspath ( classpath ) ; options.setOutputDir ( out ) ; com.android.jack.Jack.run ( options ) ; }
Source:
private int setUpDisconnectingState ( ) { int numBroadcastsSent = setUpConnectedState ( ) ; numBroadcastsSent ++ ; mHeadsetStateMachine.sendMessage ( HeadsetStateMachine.DISCONNECT , mTestDevice ) ; verify ( mHeadsetService , timeout ( com.android.bluetooth.hfp.HeadsetStateMachineTest.ASYNC_CALL_TIMEOUT_MILLIS ) . times ( numBroadcastsSent ) ) . sendBroadcastAsUser ( mIntentArgument.capture ( ) , eq ( UserHandle.ALL ) , eq ( HeadsetService.BLUETOOTH_PERM ) ) ; com.android.bluetooth.hfp.HeadsetStateMachineTest.verifyConnectionStateBroadcast ( mTestDevice , BluetoothProfile.STATE_DISCONNECTING , BluetoothProfile.STATE_CONNECTED , mIntentArgument.getValue ( ) ) ; org.junit.Assert.assertThat ( mHeadsetStateMachine.getCurrentState ( ) , org.hamcrest.core.IsInstanceOf.instanceOf ( HeadsetStateMachine.Disconnecting.class ) ) ; return numBroadcastsSent ; }

Target:
private int setUpDisconnectingState ( ) { int numBroadcastsSent = setUpConnectedState ( ) ; numBroadcastsSent ++ ; mHeadsetStateMachine.sendMessage ( HeadsetStateMachine.DISCONNECT , mTestDevice ) ; verify ( mHeadsetService , timeout ( com.android.bluetooth.hfp.HeadsetStateMachineTest.ASYNC_CALL_TIMEOUT_MILLIS ) . times ( numBroadcastsSent ) ) . sendBroadcastAsUser ( mIntentArgument.capture ( ) , eq ( UserHandle.ALL ) , eq ( HeadsetService.BLUETOOTH_PERM ) ) ; com.android.bluetooth.hfp.HeadsetTestUtils.verifyConnectionStateBroadcast ( mTestDevice , BluetoothProfile.STATE_DISCONNECTING , BluetoothProfile.STATE_CONNECTED , mIntentArgument.getValue ( ) ) ; org.junit.Assert.assertThat ( mHeadsetStateMachine.getCurrentState ( ) , org.hamcrest.core.IsInstanceOf.instanceOf ( HeadsetStateMachine.Disconnecting.class ) ) ; return numBroadcastsSent ; }
Source:
public void testTimeoutFailure ( ) throws java.lang.Exception { mServer.clearServerReply ( ) ; assertFalse ( mClient.requestTime ( mServer.getAddress ( ) , mServer.getPort ( ) , 500 , mNetwork ) ) ; assertEquals ( 1 , mServer.numRequestsReceived ( ) ) ; assertEquals ( 0 , mServer.numRepliesSent ( ) ) ; }

Target:
public void testTimeoutFailure ( ) throws java.lang.Exception { mServer.clearServerReply ( ) ; junit.framework.Assert.assertFalse ( mClient.requestTime ( mServer.getAddress ( ) , mServer.getPort ( ) , 500 , mNetwork ) ) ; junit.framework.Assert.assertEquals ( 1 , mServer.numRequestsReceived ( ) ) ; junit.framework.Assert.assertEquals ( 0 , mServer.numRepliesSent ( ) ) ; }
Source:
public void setMasterMute ( boolean state , int flags ) { android.media.IAudioService service = android.media.AudioManager.getService ( ) ; try { service.setMasterMute ( state , flags , getContext ( ) . getOpPackageName ( ) , mICallBack ) ; } catch ( android.os.RemoteException e ) { android.util.Log.e ( android.media.AudioManager.TAG , "Dead object in setMasterMute" , e ) ; } }

Target:
public void setMasterMute ( boolean state , int flags ) { android.media.IAudioService service = android.media.AudioManager.getService ( ) ; try { service.setMasterMute ( state , flags , mApplicationContext.getOpPackageName ( ) , mICallBack ) ; } catch ( android.os.RemoteException e ) { android.util.Log.e ( android.media.AudioManager.TAG , "Dead object in setMasterMute" , e ) ; } }
Source:
public java.util.List < android.net.wifi.hotspot2.PasspointConfiguration > getPasspointConfigurations ( ) { enforceAccessPermission ( ) ; mLog.trace ( "getPasspointConfigurations uid=%" ) . c ( android.os.Binder.getCallingUid ( ) ) . flush ( ) ; return mWifiStateMachine.syncGetPasspointConfigs ( mWifiStateMachineChannel ) ; }

Target:
public java.util.List < android.net.wifi.hotspot2.PasspointConfiguration > getPasspointConfigurations ( ) { enforceAccessPermission ( ) ; mLog.trace ( "getPasspointConfigurations uid=%" ) . c ( android.os.Binder.getCallingUid ( ) ) . flush ( ) ; if ( ! ( mContext.getResources ( ) . getBoolean ( com.android.internal.R.bool.config_wifi_hotspot2_enabled ) ) ) { throw new java.lang.UnsupportedOperationException ( "Passpoint not enabled" ) ; } return mWifiStateMachine.syncGetPasspointConfigs ( mWifiStateMachineChannel ) ; }
Source:
static void acquirePartialWakeLock ( android.content.Context context ) { if ( ( com.android.cellbroadcastreceiver.CellBroadcastAlertWakeLock.sPartialWakeLock ) == null ) { android.os.PowerManager pm = ( ( android.os.PowerManager ) ( context.getSystemService ( Context.POWER_SERVICE ) ) ) ; com.android.cellbroadcastreceiver.CellBroadcastAlertWakeLock.sPartialWakeLock = pm.newWakeLock ( PowerManager.PARTIAL_WAKE_LOCK , com.android.cellbroadcastreceiver.CellBroadcastAlertWakeLock.TAG ) ; } if ( ! ( com.android.cellbroadcastreceiver.CellBroadcastAlertWakeLock.sPartialWakeLock.isHeld ( ) ) ) { com.android.cellbroadcastreceiver.CellBroadcastAlertWakeLock.sPartialWakeLock.acquire ( 1000 ) ; android.util.Log.d ( com.android.cellbroadcastreceiver.CellBroadcastAlertWakeLock.TAG , "acquired partial wakelock" ) ; } }

Target:
static void acquirePartialWakeLock ( android.content.Context context , long timeout ) { if ( ( com.android.cellbroadcastreceiver.CellBroadcastAlertWakeLock.sPartialWakeLock ) == null ) { android.os.PowerManager pm = ( ( android.os.PowerManager ) ( context.getSystemService ( Context.POWER_SERVICE ) ) ) ; com.android.cellbroadcastreceiver.CellBroadcastAlertWakeLock.sPartialWakeLock = pm.newWakeLock ( PowerManager.PARTIAL_WAKE_LOCK , com.android.cellbroadcastreceiver.CellBroadcastAlertWakeLock.TAG ) ; } if ( ! ( com.android.cellbroadcastreceiver.CellBroadcastAlertWakeLock.sPartialWakeLock.isHeld ( ) ) ) { com.android.cellbroadcastreceiver.CellBroadcastAlertWakeLock.sPartialWakeLock.acquire ( timeout ) ; android.util.Log.d ( com.android.cellbroadcastreceiver.CellBroadcastAlertWakeLock.TAG , "acquired partial wakelock" ) ; } }
Source:
public void installAppAndLaunch ( ) throws java.lang.Exception { android.app.Instrumentation instrumentation = testFramework.getInstrumentation ( ) ; if ( ( api ) == 18 ) { return ; } com.android.devtools.systemimage.uitest.utils.AppLauncher.launch ( instrumentation , "RsHelloCompute" ) ; org.junit.Assert.assertTrue ( testFramework.getDevice ( ) . findObject ( new android.support.test.uiautomator.UiSelector ( ) . resourceId ( Res.APP_IMAGE_VIEW_ID ) ) . exists ( ) ) ; }

Target:
public void installAppAndLaunch ( ) throws java.lang.Exception { android.app.Instrumentation instrumentation = testFramework.getInstrumentation ( ) ; if ( ( api ) == 18 ) { return ; } if ( ! ( com.android.devtools.systemimage.uitest.utils.PackageInstallationUtil.isPackageInstalled ( instrumentation , "com.example.android.rs.hellocompute" ) ) ) { com.android.devtools.systemimage.uitest.utils.PackageInstallationUtil.installApk ( instrumentation , "HelloCompute.apk" ) ; } com.android.devtools.systemimage.uitest.utils.AppLauncher.launch ( instrumentation , "RsHelloCompute" ) ; org.junit.Assert.assertTrue ( testFramework.getDevice ( ) . findObject ( new android.support.test.uiautomator.UiSelector ( ) . resourceId ( Res.APP_IMAGE_VIEW_ID ) ) . exists ( ) ) ; }
Source:
private static java.awt.Component createButton ( java.lang.String label , java.awt.event.ActionListener action ) { javax.swing.JButton button = new javax.swing.JButton ( label ) ; button.setPreferredSize ( button.getPreferredSize ( ) ) ; button.addActionListener ( action ) ; return button ; }

Target:
private static java.awt.Component createButton ( java.lang.String label , java.awt.event.ActionListener action ) { javax.swing.JButton button = new javax.swing.JButton ( label ) ; button.addActionListener ( action ) ; button.setMaximumSize ( new java.awt.Dimension ( java.lang.Integer.MAX_VALUE , button.getMaximumSize ( ) . height ) ) ; return button ; }