auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void sendAck ( ) { android.os.Message msg ; com.android.internal.telephony.RILRequest rr = com.android.internal.telephony.RILRequest.obtain ( com.android.internal.telephony.RIL_RESPONSE_ACKNOWLEDGEMENT , null ) ; msg = mSender.obtainMessage ( com.android.internal.telephony.RIL.EVENT_SEND_ACK , rr ) ; acquireWakeLock ( rr , com.android.internal.telephony.RIL.FOR_ACK_WAKELOCK ) ; msg.sendToTarget ( ) ; }

Target:
private void sendAck ( ) { com.android.internal.telephony.RILRequest rr = com.android.internal.telephony.RILRequest.obtain ( com.android.internal.telephony.RIL_RESPONSE_ACKNOWLEDGEMENT , null ) ; acquireWakeLock ( rr , com.android.internal.telephony.RIL.FOR_ACK_WAKELOCK ) ; android.hardware.radio.V1_0.IRadio radioProxy = getRadioProxy ( ) ; if ( radioProxy != null ) { try { radioProxy.responseAcknowledgement ( ) ; } catch ( java.lang.Exception e ) { riljLoge ( ( "sendAck: exception : " + e ) ) ; } } else { android.telephony.Rlog.e ( com.android.internal.telephony.RIL.RILJ_LOG_TAG , "Error trying to send ack, radioProxy = null" ) ; } rr.release ( ) ; }
Source:
private static java.lang.String getNewerVersionAvailableMessage ( com.android.ide.common.repository.GradleCoordinate dependency , com.android.sdklib.repository.FullRevision version , boolean includeMicro ) { java.lang.String versionString = ( ( includeMicro || ( ( version.getMicro ( ) ) != 0 ) ) || ( version.isPreview ( ) ) ) ? version.toString ( ) : ( ( version.getMajor ( ) ) + "." ) + ( version.getMinor ( ) ) ; return com.android.tools.lint.checks.GradleDetector.getNewerVersionAvailableMessage ( dependency , versionString ) ; }

Target:
private static java.lang.String getNewerVersionAvailableMessage ( com.android.ide.common.repository.GradleCoordinate dependency , com.android.sdklib.repository.PreciseRevision version ) { return com.android.tools.lint.checks.GradleDetector.getNewerVersionAvailableMessage ( dependency , version.toString ( ) ) ; }
Source:
public void run ( ) { mBuilder = new android.app.AlertDialog.Builder ( mContext ) ; mBuilder.setNeutralButton ( com.android.cts.stub.R.string.notify , mOnClickListener ) ; mDialog = mBuilder.show ( ) ; mButton = ( ( android.widget.Button ) ( mDialog.getWindow ( ) . findViewById ( R.id.button3 ) ) ) ; mButton.performClick ( ) ; }

Target:
public void run ( ) { mBuilder = new android.app.AlertDialog.Builder ( mContext ) ; mBuilder.setNeutralButton ( com.android.cts.stub.R.string.notify , mOnClickListener ) ; mDialog = mBuilder.show ( ) ; mButton = mDialog.getButton ( DialogInterface.BUTTON_NEUTRAL ) ; mButton.performClick ( ) ; }
Source:
public void testSatisfiedNetworkRequestDoesNotTriggerOnUnavailable ( ) { android.net.NetworkRequest nr = new android.net.NetworkRequest.Builder ( ) . addTransportType ( NetworkCapabilities.TRANSPORT_WIFI ) . build ( ) ; final com.android.server.ConnectivityServiceTest.TestNetworkCallback networkCallback = new com.android.server.ConnectivityServiceTest.TestNetworkCallback ( ) ; mCm.requestNetwork ( nr , networkCallback , 10 ) ; mWiFiNetworkAgent = new com.android.server.ConnectivityServiceTest.MockNetworkAgent ( TRANSPORT_WIFI ) ; mWiFiNetworkAgent.connect ( false ) ; networkCallback.expectCallback ( com.android.server.ConnectivityServiceTest.CallbackState.AVAILABLE , mWiFiNetworkAgent ) ; try { java.lang.Thread.sleep ( 15 ) ; } catch ( java.lang.InterruptedException e ) { } networkCallback.assertNoCallback ( ) ; }

Target:
public void testSatisfiedNetworkRequestDoesNotTriggerOnUnavailable ( ) { android.net.NetworkRequest nr = new android.net.NetworkRequest.Builder ( ) . addTransportType ( NetworkCapabilities.TRANSPORT_WIFI ) . build ( ) ; final com.android.server.ConnectivityServiceTest.TestNetworkCallback networkCallback = new com.android.server.ConnectivityServiceTest.TestNetworkCallback ( ) ; mCm.requestNetwork ( nr , networkCallback , 10 ) ; mWiFiNetworkAgent = new com.android.server.ConnectivityServiceTest.MockNetworkAgent ( TRANSPORT_WIFI ) ; mWiFiNetworkAgent.connect ( false ) ; networkCallback.expectCallback ( com.android.server.ConnectivityServiceTest.CallbackState.AVAILABLE , mWiFiNetworkAgent ) ; com.android.server.ConnectivityServiceTest.sleepFor ( 15 ) ; networkCallback.assertNoCallback ( ) ; }
Source:
static void processUnknownCallIntent ( com.android.server.telecom.CallsManager callsManager , android.content.Intent intent ) { android.telecom.PhoneAccountHandle phoneAccountHandle = intent.getParcelableExtra ( TelecomManager.EXTRA_PHONE_ACCOUNT_HANDLE ) ; if ( phoneAccountHandle == null ) { com.android.server.telecom.Log.w ( com.android.server.telecom.CallIntentProcessor.class , "Rejecting unknown call due to null phone account" ) ; return ; } if ( ( phoneAccountHandle.getComponentName ( ) ) == null ) { com.android.server.telecom.Log.w ( com.android.server.telecom.CallIntentProcessor.class , "Rejecting unknown call due to null component name" ) ; return ; } callsManager.addNewUnknownCall ( phoneAccountHandle , intent.getExtras ( ) ) ; }

Target:
static void processUnknownCallIntent ( com.android.server.telecom.CallsManager callsManager , android.content.Intent intent ) { android.telecom.PhoneAccountHandle phoneAccountHandle = intent.getParcelableExtra ( TelecomManager.EXTRA_PHONE_ACCOUNT_HANDLE ) ; if ( phoneAccountHandle == null ) { android.telecom.Log.w ( com.android.server.telecom.CallIntentProcessor.class , "Rejecting unknown call due to null phone account" ) ; return ; } if ( ( phoneAccountHandle.getComponentName ( ) ) == null ) { android.telecom.Log.w ( com.android.server.telecom.CallIntentProcessor.class , "Rejecting unknown call due to null component name" ) ; return ; } callsManager.addNewUnknownCall ( phoneAccountHandle , intent.getExtras ( ) ) ; }
Source:
, name = "setCalled" , returnType = int . class , argumentTypes = { int . class } ) private static int setCalled ( int index ) { TestInvokeCustomWithConcurrentThreads.called [ index ] . getAndIncrement ( ) ; TestInvokeCustomWithConcurrentThreads.targetted [ TestInvokeCustomWithConcurrentThreads.getThreadIndex ( ) ] . set ( index ) ; return 0 ; }

Target:
, fieldOrMethodName = "setCalled" , returnType = int . class , parameterTypes = { int . class } ) private static int setCalled ( int index ) { TestInvokeCustomWithConcurrentThreads.called [ index ] . getAndIncrement ( ) ; TestInvokeCustomWithConcurrentThreads.targetted [ TestInvokeCustomWithConcurrentThreads.getThreadIndex ( ) ] . set ( index ) ; return 0 ; }
Source:
private WifiNative.ScanEventHandler verifyStartSingleScan ( org.mockito.InOrder order , com.android.server.wifi.WifiNative.ScanSettings expected ) { org.mockito.ArgumentCaptor < com.android.server.wifi.WifiNative.ScanSettings > scanSettingsCaptor = org.mockito.ArgumentCaptor.forClass ( WifiNative.ScanSettings.class ) ; org.mockito.ArgumentCaptor < com.android.server.wifi.WifiNative.ScanEventHandler > scanEventHandlerCaptor = org.mockito.ArgumentCaptor.forClass ( WifiNative.ScanEventHandler.class ) ; order.verify ( mWifiScannerImpl ) . startSingleScan ( scanSettingsCaptor.capture ( ) , scanEventHandlerCaptor.capture ( ) ) ; assertNativeScanSettingsEquals ( expected , scanSettingsCaptor.getValue ( ) ) ; return scanEventHandlerCaptor.getValue ( ) ; }

Target:
private WifiNative.ScanEventHandler verifyStartSingleScan ( org.mockito.InOrder order , com.android.server.wifi.WifiNative.ScanSettings expected ) { org.mockito.ArgumentCaptor < com.android.server.wifi.WifiNative.ScanSettings > scanSettingsCaptor = org.mockito.ArgumentCaptor.forClass ( WifiNative.ScanSettings.class ) ; org.mockito.ArgumentCaptor < com.android.server.wifi.WifiNative.ScanEventHandler > scanEventHandlerCaptor = org.mockito.ArgumentCaptor.forClass ( WifiNative.ScanEventHandler.class ) ; order.verify ( mWifiScannerImpl ) . startSingleScan ( scanSettingsCaptor.capture ( ) , scanEventHandlerCaptor.capture ( ) ) ; com.android.server.wifi.ScanTestUtil.assertNativeScanSettingsEquals ( expected , scanSettingsCaptor.getValue ( ) ) ; return scanEventHandlerCaptor.getValue ( ) ; }
Source:
void foo1 ( int [ ] array , int start , int end ) { for ( int i = start ; i < end ; i ++ ) { array [ i ] = 1 ; sum += array [ i ] ; } }

Target:
void foo1 ( int [ ] array , int start , int end , boolean expectInterpreter ) { for ( int i = start ; i < end ; i ++ ) { if ( expectInterpreter ) { Main.assertIsInterpreted ( ) ; } else { Main.assertIsManaged ( ) ; } array [ i ] = 1 ; sum += array [ i ] ; } }
Source:
public void requestNetwork ( android.net.NetworkRequest request , android.net.ConnectivityManager.NetworkCallback networkCallback , int timeoutMs ) { if ( timeoutMs <= 0 ) { throw new java.lang.IllegalArgumentException ( ( "Non-positive timeoutMs: " + timeoutMs ) ) ; } int legacyType = inferLegacyTypeForNetworkCapabilities ( request.networkCapabilities ) ; requestNetwork ( request , networkCallback , timeoutMs , legacyType , getDefaultHandler ( ) ) ; }

Target:
public void requestNetwork ( android.net.NetworkRequest request , android.net.ConnectivityManager.NetworkCallback networkCallback , int timeoutMs ) { android.net.ConnectivityManager.checkTimeout ( timeoutMs ) ; int legacyType = inferLegacyTypeForNetworkCapabilities ( request.networkCapabilities ) ; requestNetwork ( request , networkCallback , timeoutMs , legacyType , getDefaultHandler ( ) ) ; }
Source:
public com.android.jack.dx.rop.cst.CstFieldRef getFieldRef ( ) { if ( ( fieldRef ) == null ) { fieldRef = new com.android.jack.dx.rop.cst.CstFieldRef ( getDefiningClass ( ) , getName ( ) , getDescriptor ( ) ) ; } return fieldRef ; }

Target:
public final boolean equals ( java.lang.Object other ) { if ( ( other == null ) || ( ( getClass ( ) ) != ( other.getClass ( ) ) ) ) { return false ; } com.android.jack.dx.rop.cst.CstEnumRef otherRef = ( ( com.android.jack.dx.rop.cst.CstEnumRef ) ( other ) ) ; return ( ( getDefiningClass ( ) . equals ( otherRef.getDefiningClass ( ) ) ) && ( getName ( ) . equals ( otherRef.getName ( ) ) ) ) && ( getType ( ) . equals ( otherRef.getType ( ) ) ) ; }
Source:
public java.lang.String getDeviceSoftwareVersionForSlot ( int slotIndex , java.lang.String callingPackage ) { if ( ! ( com.android.internal.telephony.TelephonyPermissions.checkCallingOrSelfReadPhoneState ( mApp , callingPackage , "getDeviceSoftwareVersionForSlot" ) ) ) { return null ; } com.android.internal.telephony.Phone phone = com.android.internal.telephony.PhoneFactory.getPhone ( slotIndex ) ; return phone == null ? null : phone.getDeviceSvn ( ) ; }

Target:
public java.lang.String getMeidForSlot ( int slotIndex , java.lang.String callingPackage ) { com.android.internal.telephony.Phone phone = com.android.internal.telephony.PhoneFactory.getPhone ( slotIndex ) ; if ( phone == null ) { return null ; } int subId = phone.getSubId ( ) ; if ( ! ( com.android.internal.telephony.TelephonyPermissions.checkCallingOrSelfReadPhoneState ( mApp , subId , callingPackage , "getMeidForSlot" ) ) ) { return null ; } return phone.getMeid ( ) ; }
Source:
public void testCsPutStringExtra ( ) throws java.lang.Exception { com.android.server.telecom.tests.IdPair ids = startAndMakeActiveIncomingCall ( "650-555-1212" , mPhoneAccountA0.getAccountHandle ( ) , mConnectionServiceFixtureA ) ; android.telecom.Connection connection = mConnectionServiceFixtureA.mLatestConnection ; connection.putExtra ( com.android.server.telecom.tests.CallExtrasTest.EXTRA_KEY_STR , com.android.server.telecom.tests.CallExtrasTest.EXTRA_VALUE_STR ) ; mInCallServiceFixtureX.waitForUpdate ( ) ; assertTrue ( mInCallServiceFixtureX.getCall ( ids.mCallId ) . getExtras ( ) . containsKey ( com.android.server.telecom.tests.CallExtrasTest.EXTRA_KEY_STR ) ) ; assertEquals ( com.android.server.telecom.tests.CallExtrasTest.EXTRA_VALUE_STR , mInCallServiceFixtureX.getCall ( ids.mCallId ) . getExtras ( ) . getString ( com.android.server.telecom.tests.CallExtrasTest.EXTRA_KEY_STR ) ) ; }

Target:
public void testCsPutStringExtra ( ) throws java.lang.Exception { com.android.server.telecom.tests.IdPair ids = startAndMakeActiveIncomingCall ( "650-555-1212" , mPhoneAccountA0.getAccountHandle ( ) , mConnectionServiceFixtureA ) ; android.telecom.Connection connection = mConnectionServiceFixtureA.mLatestConnection ; connection.putExtra ( com.android.server.telecom.tests.CallExtrasTest.EXTRA_KEY_STR , com.android.server.telecom.tests.CallExtrasTest.EXTRA_VALUE_STR ) ; mInCallServiceFixtureX.waitForUpdate ( ) ; org.junit.Assert.assertTrue ( mInCallServiceFixtureX.getCall ( ids.mCallId ) . getExtras ( ) . containsKey ( com.android.server.telecom.tests.CallExtrasTest.EXTRA_KEY_STR ) ) ; org.junit.Assert.assertEquals ( com.android.server.telecom.tests.CallExtrasTest.EXTRA_VALUE_STR , mInCallServiceFixtureX.getCall ( ids.mCallId ) . getExtras ( ) . getString ( com.android.server.telecom.tests.CallExtrasTest.EXTRA_KEY_STR ) ) ; }
Source:
public static boolean isEmailAddress ( java.lang.String address ) { if ( android.text.TextUtils.isEmpty ( address ) ) { return false ; } java.lang.String s = android.provider.Telephony.Mms.extractAddrSpec ( address ) ; java.util.regex.Matcher match = Regex.EMAIL_ADDRESS_PATTERN.matcher ( s ) ; return match.matches ( ) ; }

Target:
public static boolean isEmailAddress ( java.lang.String address ) { if ( android.text.TextUtils.isEmpty ( address ) ) { return false ; } java.lang.String s = android.provider.Telephony.Mms.extractAddrSpec ( address ) ; java.util.regex.Matcher match = Patterns.EMAIL_ADDRESS.matcher ( s ) ; return match.matches ( ) ; }
Source:
private static java.net.Inet6Address getLocalDnsIpFor ( android.net.IpPrefix localPrefix ) { final byte [ ] dnsBytes = localPrefix.getRawAddress ( ) ; dnsBytes [ ( ( dnsBytes.length ) - 1 ) ] = 1 ; try { return java.net.Inet6Address.getByAddress ( null , dnsBytes , 0 ) ; } catch ( java.net.UnknownHostException e ) { android.util.Slog.wtf ( com.android.server.connectivity.tethering.IPv6TetheringInterfaceServices.TAG , ( "Failed to construct Inet6Address from: " + localPrefix ) ) ; return null ; } }

Target:
private static java.net.Inet6Address getLocalDnsIpFor ( android.net.IpPrefix localPrefix ) { final byte [ ] dnsBytes = localPrefix.getRawAddress ( ) ; dnsBytes [ ( ( dnsBytes.length ) - 1 ) ] = com.android.server.connectivity.tethering.IPv6TetheringInterfaceServices.getRandomNonZeroByte ( ) ; try { return java.net.Inet6Address.getByAddress ( null , dnsBytes , 0 ) ; } catch ( java.net.UnknownHostException e ) { android.util.Slog.wtf ( com.android.server.connectivity.tethering.IPv6TetheringInterfaceServices.TAG , ( "Failed to construct Inet6Address from: " + localPrefix ) ) ; return null ; } }
Source:
public void handleUserUnlock ( int userId ) { if ( mVerboseLoggingEnabled ) { android.util.Log.v ( com.android.server.wifi.WifiConfigManager.TAG , ( "Handling user unlock for " + userId ) ) ; } if ( ( userId == ( mCurrentUserId ) ) && ( mPendingUnlockStoreRead ) ) { loadFromStoreAndMigrateAfterUserSwitch ( mCurrentUserId ) ; } }

Target:
private java.util.Set < java.lang.Integer > clearInternalUserData ( int userId ) { java.util.Set < java.lang.Integer > removedNetworkIds = new java.util.HashSet < > ( ) ; for ( android.net.wifi.WifiConfiguration config : getInternalConfiguredNetworks ( ) ) { if ( ( ! ( config.shared ) ) && ( com.android.server.wifi.WifiConfigurationUtil.doesUidBelongToAnyProfile ( config.creatorUid , mUserManager.getProfiles ( userId ) ) ) ) { removedNetworkIds.add ( config.networkId ) ; mConfiguredNetworks.remove ( config.networkId ) ; } } mDeletedEphemeralSSIDs.clear ( ) ; mScanDetailCaches.clear ( ) ; clearLastSelectedNetwork ( ) ; return removedNetworkIds ; }
Source:
public boolean removeAll ( java.util.Collection < ? > c ) { boolean modified = false ; for ( java.util.Iterator < K > i = iterator ( ) ; i.hasNext ( ) ; ) { if ( c.contains ( i.next ( ) ) ) { i.remove ( ) ; modified = true ; } } return modified ; }

Target:
public boolean removeAll ( java.util.Collection < ? > c ) { java.util.Objects.requireNonNull ( c ) ; boolean modified = false ; for ( java.util.Iterator < K > i = iterator ( ) ; i.hasNext ( ) ; ) { if ( c.contains ( i.next ( ) ) ) { i.remove ( ) ; modified = true ; } } return modified ; }
Source:
private void sendCancelUserConfirmationIntent ( android.bluetooth.BluetoothDevice device ) { android.content.Intent intent = new android.content.Intent ( android.bluetooth.BluetoothDevice.ACTION_CONNECTION_ACCESS_CANCEL ) ; intent.setClassName ( com.android.bluetooth.sap.SapService.ACCESS_AUTHORITY_PACKAGE , com.android.bluetooth.sap.SapService.ACCESS_AUTHORITY_CLASS ) ; intent.putExtra ( BluetoothDevice.EXTRA_DEVICE , device ) ; intent.putExtra ( BluetoothDevice.EXTRA_ACCESS_REQUEST_TYPE , BluetoothDevice.REQUEST_TYPE_SIM_ACCESS ) ; sendBroadcast ( intent , com.android.bluetooth.sap.BLUETOOTH_PERM ) ; }

Target:
private void sendCancelUserConfirmationIntent ( android.bluetooth.BluetoothDevice device ) { android.content.Intent intent = new android.content.Intent ( android.bluetooth.BluetoothDevice.ACTION_CONNECTION_ACCESS_CANCEL ) ; intent.setPackage ( com.android.bluetooth.sap.SapService.ACCESS_AUTHORITY_PACKAGE ) ; intent.putExtra ( BluetoothDevice.EXTRA_DEVICE , device ) ; intent.putExtra ( BluetoothDevice.EXTRA_ACCESS_REQUEST_TYPE , BluetoothDevice.REQUEST_TYPE_SIM_ACCESS ) ; sendBroadcast ( intent , com.android.bluetooth.sap.BLUETOOTH_PERM ) ; }
Source:
private android.app.PendingIntent createTelecomPendingIntent ( java.lang.String action , android.net.Uri data , android.os.UserHandle userHandle ) { android.content.Intent intent = new android.content.Intent ( action , data , mContext , com.android.server.telecom.components.TelecomBroadcastReceiver.class ) ; intent.putExtra ( TelecomBroadcastIntentProcessor.EXTRA_USERHANDLE , userHandle ) ; return android.app.PendingIntent.getBroadcast ( mContext , 0 , intent , 0 ) ; }

Target:
private android.app.PendingIntent createTelecomPendingIntent ( java.lang.String action , android.net.Uri data , android.os.UserHandle userHandle ) { android.content.Intent intent = new android.content.Intent ( action , data , mContext , com.android.server.telecom.components.TelecomBroadcastReceiver.class ) ; intent.putExtra ( TelecomBroadcastIntentProcessor.EXTRA_USERHANDLE , userHandle ) ; return android.app.PendingIntent.getBroadcast ( mContext , 0 , intent , PendingIntent.FLAG_CANCEL_CURRENT ) ; }
Source:
public boolean matches ( org.eclipse.jdt.core.dom.BodyDeclaration node ) { if ( node instanceof org.eclipse.jdt.core.dom.MethodDeclaration ) { org.eclipse.jdt.core.dom.MethodDeclaration methodDeclaration = ( ( org.eclipse.jdt.core.dom.MethodDeclaration ) ( node ) ) ; if ( methodDeclaration.getName ( ) . getFullyQualifiedName ( ) . equals ( methodName ) ) { return parameterMatcher.matches ( methodDeclaration ) ; } } return false ; }

Target:
public boolean matches ( org.eclipse.jdt.core.dom.BodyDeclaration node ) { if ( node instanceof org.eclipse.jdt.core.dom.MethodDeclaration ) { org.eclipse.jdt.core.dom.BodyDeclaration parentNode = ( ( org.eclipse.jdt.core.dom.BodyDeclaration ) ( node.getParent ( ) ) ) ; org.eclipse.jdt.core.dom.MethodDeclaration methodDeclaration = ( ( org.eclipse.jdt.core.dom.MethodDeclaration ) ( node ) ) ; return ( ( typeLocator.matches ( parentNode ) ) && ( methodDeclaration.getName ( ) . getFullyQualifiedName ( ) . equals ( methodName ) ) ) && ( parameterMatcher.matches ( methodDeclaration ) ) ; } return false ; }
Source:
void setSystemAudioMode ( boolean on ) { if ( ( ! ( isSystemAudioControlFeatureEnabled ( ) ) ) && on ) { com.android.server.hdmi.HdmiLogger.debug ( ( "Cannot turn on system audio mode " + "because the System Audio Control feature is disabled." ) ) ; return ; } com.android.server.hdmi.HdmiLogger.debug ( "System Audio Mode change[old:%b new:%b]" , mSystemAudioActivated , on ) ; updateAudioManagerForSystemAudio ( on ) ; synchronized ( mLock ) { if ( ( mSystemAudioActivated ) != on ) { mSystemAudioActivated = on ; mService.announceSystemAudioModeChange ( on ) ; } } }

Target:
void setSystemAudioMode ( boolean on ) { if ( ( ! ( isSystemAudioControlFeatureEnabled ( ) ) ) && on ) { com.android.server.hdmi.HdmiLogger.debug ( ( "Cannot turn on system audio mode " + "because the System Audio Control feature is disabled." ) ) ; return ; } com.android.server.hdmi.HdmiLogger.debug ( "System Audio Mode change[old:%b new:%b]" , mSystemAudioActivated , on ) ; updateAudioManagerForSystemAudio ( on ) ; synchronized ( mLock ) { if ( ( mSystemAudioActivated ) != on ) { mSystemAudioActivated = on ; mService.announceSystemAudioModeChange ( on ) ; } startArcAction ( on ) ; } }
Source:
public boolean onPrepareOptionsMenu ( com.android.internal.telephony.gsm.stk.Menu menu ) { super . onPrepareOptionsMenu ( menu ) ; boolean helpVisible = false ; boolean mainVisible = false ; if ( ( mState ) == ( com.android.stk.StkMenuActivity.STATE_SECONDARY ) ) { mainVisible = true ; } if ( ( mStkMenu ) != null ) { helpVisible = mStkMenu.helpAvailable ; } menu.findItem ( StkApp.MENU_ID_END_SESSION ) . setVisible ( mainVisible ) ; menu.findItem ( StkApp.MENU_ID_HELP ) . setVisible ( helpVisible ) ; return true ; }

Target:
public boolean onPrepareOptionsMenu ( com.android.internal.telephony.cat.Menu menu ) { super . onPrepareOptionsMenu ( menu ) ; boolean helpVisible = false ; boolean mainVisible = false ; if ( ( mState ) == ( com.android.stk.StkMenuActivity.STATE_SECONDARY ) ) { mainVisible = true ; } if ( ( mStkMenu ) != null ) { helpVisible = mStkMenu.helpAvailable ; } menu.findItem ( StkApp.MENU_ID_END_SESSION ) . setVisible ( mainVisible ) ; menu.findItem ( StkApp.MENU_ID_HELP ) . setVisible ( helpVisible ) ; return true ; }
Source:
public org.xmlpull.v1.XmlSerializer newSerializer ( ) throws org.xmlpull.v1.XmlPullParserException { return new org.kxml2.io.KXmlSerializer ( ) ; }

Target:
private static org.xmlpull.v1.XmlPullParserException newInstantiationException ( java.lang.String message , java.util.ArrayList < java.lang.Exception > exceptions ) { if ( ( exceptions == null ) || ( exceptions.isEmpty ( ) ) ) { return new org.xmlpull.v1.XmlPullParserException ( message ) ; } else { org.xmlpull.v1.XmlPullParserException exception = new org.xmlpull.v1.XmlPullParserException ( message ) ; for ( java.lang.Exception ex : exceptions ) { exception.addSuppressed ( ex ) ; } return exception ; } }
Source:
private void queryCallsUpdate ( int id , int state , java.lang.String number , boolean multiParty , boolean outgoing ) { android.util.Log.d ( com.android.bluetooth.hfpclient.HeadsetClientStateMachine.TAG , ( "queryCallsUpdate: " + id ) ) ; if ( ( mCallsUpdate ) == null ) { return ; } mCallsUpdate.put ( id , new android.bluetooth.BluetoothHeadsetClientCall ( mCurrentDevice , id , state , number , multiParty , outgoing ) ) ; }

Target:
private void queryCallsUpdate ( int id , int state , java.lang.String number , boolean multiParty , boolean outgoing ) { if ( com.android.bluetooth.hfpclient.HeadsetClientStateMachine.DBG ) { android.util.Log.d ( com.android.bluetooth.hfpclient.HeadsetClientStateMachine.TAG , ( "queryCallsUpdate: " + id ) ) ; } mCallsUpdate.put ( id , new android.bluetooth.BluetoothHeadsetClientCall ( mCurrentDevice , id , state , number , multiParty , outgoing ) ) ; }
Source:
public void testRevokePropagatedOnUpgradeNewToNewModel ( ) throws java.lang.Exception { assertNull ( getDevice ( ) . installPackage ( com.android.cts.migration.MigrationHelper.getTestFile ( mCtsBuild , android.appsecurity.cts.PermissionsHostTest.APK_23 ) , false , false ) ) ; runDeviceTests ( android.appsecurity.cts.PermissionsHostTest.USES_PERMISSION_PKG , "com.android.cts.usepermission.UsePermissionTest23" , "testRevokePropagatedOnUpgradeNewToNewModel_part1" ) ; assertNull ( getDevice ( ) . installPackage ( com.android.cts.migration.MigrationHelper.getTestFile ( mCtsBuild , android.appsecurity.cts.PermissionsHostTest.APK_23 ) , true , false ) ) ; runDeviceTests ( android.appsecurity.cts.PermissionsHostTest.USES_PERMISSION_PKG , "com.android.cts.usepermission.UsePermissionTest23" , "testRevokePropagatedOnUpgradeNewToNewModel_part2" ) ; }

Target:
public void testFail ( ) throws java.lang.Exception { assertNull ( getDevice ( ) . installPackage ( com.android.cts.migration.MigrationHelper.getTestFile ( mCtsBuild , android.appsecurity.cts.PermissionsHostTest.APK_23 ) , false , false ) ) ; try { runDeviceTests ( android.appsecurity.cts.PermissionsHostTest.PKG , "com.android.cts.usepermission.UsePermissionTest23" , "testFail" ) ; fail ( "Expected remote failure" ) ; } catch ( java.lang.AssertionError expected ) { } }
Source:
public com.google.common.base.Optional < com.android.manifmerger.XmlDocument > merge ( com.android.manifmerger.XmlDocument lowerPriorityDocument , com.android.manifmerger.MergingReport.Builder mergingReportBuilder ) { mergingReportBuilder.getActionRecorder ( ) . recordDefaultNodeAction ( getRootNode ( ) ) ; getRootNode ( ) . mergeWithLowerPriorityNode ( lowerPriorityDocument.getRootNode ( ) , mergingReportBuilder ) ; return com.google.common.base.Optional.of ( reparse ( ) ) ; }

Target:
public com.google.common.base.Optional < com.android.manifmerger.XmlDocument > merge ( com.android.manifmerger.XmlDocument lowerPriorityDocument , com.android.manifmerger.MergingReport.Builder mergingReportBuilder ) { mergingReportBuilder.getActionRecorder ( ) . recordDefaultNodeAction ( getRootNode ( ) ) ; getRootNode ( ) . mergeWithLowerPriorityNode ( lowerPriorityDocument.getRootNode ( ) , mergingReportBuilder ) ; return mergingReportBuilder.hasErrors ( ) ? com.google.common.base.Optional.< com.android.manifmerger.XmlDocument > absent ( ) : com.google.common.base.Optional.of ( reparse ( ) ) ; }
Source:
public boolean getReportXtOverDev ( ) { return getSecureBoolean ( android.provider.Settings.Secure.NETSTATS_REPORT_XT_OVER_DEV , true ) ; }

Target:
public com.android.server.net.NetworkStatsService.NetworkStatsSettings.Config getUidTagConfig ( ) { return new com.android.server.net.NetworkStatsService.NetworkStatsSettings.Config ( getGlobalLong ( android.provider.Settings.Global.NETSTATS_UID_TAG_BUCKET_DURATION , ( 2 * ( android.text.format.DateUtils.HOUR_IN_MILLIS ) ) ) , getGlobalLong ( android.provider.Settings.Global.NETSTATS_UID_TAG_ROTATE_AGE , ( 5 * ( android.text.format.DateUtils.DAY_IN_MILLIS ) ) ) , getGlobalLong ( android.provider.Settings.Global.NETSTATS_UID_TAG_DELETE_AGE , ( 15 * ( android.text.format.DateUtils.DAY_IN_MILLIS ) ) ) ) ; }
Source:
private void createPatch ( ) throws com.intellij.updater.OperationCancelledException , java.io.IOException { com.intellij.updater.PatchFileCreator.create ( myOlderDir , myNewerDir , myFile , java.util.Collections.< java.lang.String > emptyList ( ) , java.util.Collections.< java.lang.String > emptyList ( ) , java.util.Collections.< java.lang.String > emptyList ( ) , com.intellij.updater.TEST_UI ) ; assertTrue ( myFile.exists ( ) ) ; }

Target:
protected com.intellij.updater.Patch createPatch ( ) throws com.intellij.updater.OperationCancelledException , java.io.IOException { com.intellij.updater.Patch patch = com.intellij.updater.PatchFileCreator.create ( myPatchSpec , myFile , com.intellij.updater.TEST_UI ) ; assertTrue ( myFile.exists ( ) ) ; return patch ; }
Source:
public void addFooterView ( android.view.View v , java.lang.Object data , boolean isSelectable ) { final android.widget.ListView.FixedViewInfo info = new android.widget.ListView.FixedViewInfo ( ) ; info.view = v ; info.data = data ; info.isSelectable = isSelectable ; mFooterViewInfos.add ( info ) ; if ( ( mAdapter ) != null ) { if ( ! ( ( mAdapter ) instanceof android.widget.HeaderViewListAdapter ) ) { mAdapter = new android.widget.HeaderViewListAdapter ( mHeaderViewInfos , mFooterViewInfos , mAdapter ) ; } if ( ( mDataSetObserver ) != null ) { mDataSetObserver.onChanged ( ) ; } } }

Target:
public void addFooterView ( android.view.View v , java.lang.Object data , boolean isSelectable ) { final android.widget.ListView.FixedViewInfo info = new android.widget.ListView.FixedViewInfo ( ) ; info.view = v ; info.data = data ; info.isSelectable = isSelectable ; mFooterViewInfos.add ( info ) ; mAreAllItemsSelectable &= isSelectable ; if ( ( mAdapter ) != null ) { if ( ! ( ( mAdapter ) instanceof android.widget.HeaderViewListAdapter ) ) { mAdapter = new android.widget.HeaderViewListAdapter ( mHeaderViewInfos , mFooterViewInfos , mAdapter ) ; } if ( ( mDataSetObserver ) != null ) { mDataSetObserver.onChanged ( ) ; } } }
Source:
private void copyFile ( @ com.android.annotations.NonNull java.io.File fileToUse , @ com.android.annotations.NonNull java.io.File originalFile , @ com.android.annotations.NonNull java.io.File resDir , @ com.android.annotations.NonNull com.google.common.collect.SetMultimap < java.lang.String , java.lang.String > state ) throws java.io.IOException { com.google.common.base.Preconditions.checkNotNull ( resDir ) ; java.lang.String relativePath = resDir.toURI ( ) . relativize ( fileToUse.toURI ( ) ) . getPath ( ) ; java.io.File finalFile = new java.io.File ( getOutputResDirectory ( ) , relativePath ) ; com.google.common.io.Files.createParentDirs ( finalFile ) ; com.google.common.io.Files.copy ( fileToUse , finalFile ) ; state.put ( originalFile.getAbsolutePath ( ) , finalFile.getAbsolutePath ( ) ) ; }

Target:
private void finalizeMerge ( com.android.ide.common.res2.PreprocessResourcesMerger merger ) throws com.android.ide.common.res2.MergingException { com.android.ide.common.res2.PreprocessResourcesWriter writer = new com.android.ide.common.res2.PreprocessResourcesWriter ( getOutputResDirectory ( ) ) ; merger.mergeData ( writer , true ) ; merger.writeBlobTo ( getIncrementalFolder ( ) , writer ) ; }
Source:
protected byte [ ] engineDoFinal ( ) { ensureKeystoreOperationInitialized ( ) ; byte [ ] result ; try { result = mChunkedStreamer.doFinal ( null , 0 , 0 ) ; } catch ( android.security.KeyStoreException e ) { throw android.security.KeyStore.getCryptoOperationException ( e ) ; } engineReset ( ) ; return result ; }

Target:
protected byte [ ] engineDoFinal ( ) { try { ensureKeystoreOperationInitialized ( ) ; } catch ( java.security.InvalidKeyException e ) { throw new java.lang.IllegalStateException ( "Failed to reinitialize MAC" , e ) ; } byte [ ] result ; try { result = mChunkedStreamer.doFinal ( null , 0 , 0 ) ; } catch ( android.security.KeyStoreException e ) { throw new java.lang.IllegalStateException ( "Keystore operation failed" , e ) ; } resetWhilePreservingInitState ( ) ; return result ; }
Source:
public boolean compareTo ( com.android.internal.telephony.gsm.stk.CommandDetails other ) { return ( ( ( ( this . compRequired ) == ( other.compRequired ) ) && ( ( this . commandNumber ) == ( other.commandNumber ) ) ) && ( ( this . commandQualifier ) == ( other.commandQualifier ) ) ) && ( ( this . typeOfCommand ) == ( other.typeOfCommand ) ) ; }

Target:
public boolean compareTo ( com.android.internal.telephony.cat.CommandDetails other ) { return ( ( ( ( this . compRequired ) == ( other.compRequired ) ) && ( ( this . commandNumber ) == ( other.commandNumber ) ) ) && ( ( this . commandQualifier ) == ( other.commandQualifier ) ) ) && ( ( this . typeOfCommand ) == ( other.typeOfCommand ) ) ; }
Source:
public void testAesCbcHmacMd5Udp4UdpEncap ( ) throws java.lang.Exception { android.net.IpSecAlgorithm crypt = new android.net.IpSecAlgorithm ( android.net.IpSecAlgorithm.CRYPT_AES_CBC , android.net.cts.IpSecManagerTest.getKey ( 256 ) ) ; android.net.IpSecAlgorithm auth = new android.net.IpSecAlgorithm ( android.net.IpSecAlgorithm.AUTH_HMAC_MD5 , android.net.cts.IpSecManagerTest.getKey ( 128 ) , 96 ) ; checkTransform ( android.system.OsConstants.IPPROTO_UDP , android.net.cts.IpSecManagerTest.IPV4_LOOPBACK , crypt , auth , null , true , 1 , false ) ; checkTransform ( android.system.OsConstants.IPPROTO_UDP , android.net.cts.IpSecManagerTest.IPV4_LOOPBACK , crypt , auth , null , true , 1 , true ) ; }

Target:
public void testCryptTcp4 ( ) throws java.lang.Exception { android.net.IpSecAlgorithm crypt = new android.net.IpSecAlgorithm ( android.net.IpSecAlgorithm.CRYPT_AES_CBC , android.net.cts.IpSecManagerTest.CRYPT_KEY ) ; checkTransform ( android.system.OsConstants.IPPROTO_TCP , android.net.cts.IpSecManagerTest.IPV4_LOOPBACK , crypt , null , false , 1 , false ) ; checkTransform ( android.system.OsConstants.IPPROTO_TCP , android.net.cts.IpSecManagerTest.IPV4_LOOPBACK , crypt , null , false , 1 , true ) ; }
Source:
public void copyElementTo ( int xoff , int component_number , java.lang.Object array ) { copyElementTo ( xoff , 0 , 0 , component_number , array ) ; }

Target:
private void copyTo ( java.lang.Object array , android.renderscript.Element.DataType dt , int arrayLen ) { android.os.Trace.traceBegin ( RenderScript.TRACE_TAG , "copyTo" ) ; mRS.validate ( ) ; boolean usePadding = false ; if ( ( mAutoPadding ) && ( ( mType.getElement ( ) . getVectorSize ( ) ) == 3 ) ) { usePadding = true ; } mRS.nAllocationRead ( getID ( mRS ) , array , dt , mType.mElement.mType.mSize , usePadding ) ; android.os.Trace.traceEnd ( RenderScript.TRACE_TAG ) ; }
Source:
public void showMultiSelectRemoveView ( boolean show ) { multiSelectUnSelectAllViewContent.setVisibility ( ( show ? android.view.View.VISIBLE : android.view.View.GONE ) ) ; multiSelectUnSelectAllViewContent.setAlpha ( ( show ? 0 : 1 ) ) ; multiSelectUnSelectAllViewContent.animate ( ) . alpha ( ( show ? 1 : 0 ) ) . start ( ) ; ( ( com.android.dialer.app.list.ListsFragment ) ( getParentFragment ( ) ) ) . showMultiSelectRemoveView ( show ) ; }

Target:
public void showMultiSelectRemoveView ( boolean show ) { multiSelectUnSelectAllViewContent.setVisibility ( ( show ? android.view.View.VISIBLE : android.view.View.GONE ) ) ; multiSelectUnSelectAllViewContent.setAlpha ( ( show ? 0 : 1 ) ) ; multiSelectUnSelectAllViewContent.animate ( ) . alpha ( ( show ? 1 : 0 ) ) . start ( ) ; com.android.dialer.common.FragmentUtils.getParentUnsafe ( this , com.android.dialer.app.calllog.CallLogFragment.CallLogFragmentListener.class ) . showMultiSelectRemoveView ( show ) ; }
Source:
void showGlobalActionsDialog ( ) { if ( ( mGlobalActions ) == null ) { mGlobalActions = new com.android.internal.policy.impl.GlobalActions ( mContext ) ; } final boolean keyguardShowing = mKeyguardMediator.isShowing ( ) ; mGlobalActions.showDialog ( keyguardShowing , isDeviceProvisioned ( ) ) ; if ( keyguardShowing ) { mKeyguardMediator.pokeWakelock ( ) ; } }

Target:
void showGlobalActionsDialog ( ) { if ( ( mGlobalActions ) == null ) { mGlobalActions = new com.android.internal.policy.impl.GlobalActions ( mContext ) ; } final boolean keyguardShowing = mKeyguardMediator.isShowingAndNotHidden ( ) ; mGlobalActions.showDialog ( keyguardShowing , isDeviceProvisioned ( ) ) ; if ( keyguardShowing ) { mKeyguardMediator.pokeWakelock ( ) ; } }
Source:
public void int16 ( short v ) throws java.io.IOException { mBuffer [ 0 ] = ( ( byte ) ( ( v > > > 0 ) & 255 ) ) ; mBuffer [ 1 ] = ( ( byte ) ( ( v > > > 8 ) & 255 ) ) ; write ( 2 ) ; }

Target:
public void uint8 ( short v ) throws java.io.IOException { mBuffer [ 0 ] = ( ( byte ) ( v & 255 ) ) ; mOutputStream.write ( mBuffer , 0 , 1 ) ; }
Source:
public void testSetColumnNumberGetColumnNumber ( ) { org.xml.sax.helpers.LocatorImpl l = new org.xml.sax.helpers.LocatorImpl ( ) ; l.setColumnNumber ( tests.api.org.xml.sax.helpers.LocatorImplTest.COL ) ; assertEquals ( tests.api.org.xml.sax.helpers.LocatorImplTest.COL , l.getColumnNumber ( ) ) ; l.setColumnNumber ( 0 ) ; assertEquals ( 0 , l.getColumnNumber ( ) ) ; }

Target:
public void testSetColumnNumberGetColumnNumber ( ) { org.xml.sax.helpers.LocatorImpl l = new org.xml.sax.helpers.LocatorImpl ( ) ; l.setColumnNumber ( org.apache.harmony.tests.org.xml.sax.helpers.LocatorImplTest.COL ) ; assertEquals ( org.apache.harmony.tests.org.xml.sax.helpers.LocatorImplTest.COL , l.getColumnNumber ( ) ) ; l.setColumnNumber ( 0 ) ; assertEquals ( 0 , l.getColumnNumber ( ) ) ; }
Source:
public void tearDown ( ) { mHidDeviceService.stop ( ) ; mHidDeviceService.cleanup ( ) ; mHidDeviceService = null ; mTargetContext.unregisterReceiver ( mConnectionStateChangedReceiver ) ; mConnectionStateChangedQueue.clear ( ) ; mCallbackQueue.clear ( ) ; }

Target:
public void tearDown ( ) throws java.lang.Exception { if ( ! ( mTargetContext.getResources ( ) . getBoolean ( R.bool.profile_supported_hid_device ) ) ) { return ; } com.android.bluetooth.TestUtils.stopService ( mServiceRule , com.android.bluetooth.hid.HidDeviceService.class ) ; mHidDeviceService = com.android.bluetooth.hid.HidDeviceService.getHidDeviceService ( ) ; org.junit.Assert.assertNull ( mHidDeviceService ) ; mTargetContext.unregisterReceiver ( mConnectionStateChangedReceiver ) ; mConnectionStateChangedQueue.clear ( ) ; mCallbackQueue.clear ( ) ; com.android.bluetooth.hid.HidDeviceTest.setHidDeviceNativeInterfaceInstance ( null ) ; com.android.bluetooth.TestUtils.clearAdapterService ( mAdapterService ) ; }
Source:
private java.lang.String addExistingConnectionInternal ( android.telecom.PhoneAccountHandle handle , android.telecom.Connection connection ) { java.lang.String id ; if ( handle == null ) { id = java.util.UUID.randomUUID ( ) . toString ( ) ; } else { id = ( ( handle.getComponentName ( ) . getClassName ( ) ) + "@" ) + ( getNextCallId ( ) ) ; } addConnection ( id , connection ) ; return id ; }

Target:
private java.lang.String addExistingConnectionInternal ( android.telecom.PhoneAccountHandle handle , android.telecom.Connection connection ) { java.lang.String id ; if ( ( ( connection.getExtras ( ) ) != null ) && ( connection.getExtras ( ) . containsKey ( Connection.EXTRA_ORIGINAL_CONNECTION_ID ) ) ) { id = connection.getExtras ( ) . getString ( Connection.EXTRA_ORIGINAL_CONNECTION_ID ) ; android.telecom.Log.d ( this , "addExistingConnectionInternal - conn %s reusing original id %s" , connection.getTelecomCallId ( ) , id ) ; } else if ( handle == null ) { id = java.util.UUID.randomUUID ( ) . toString ( ) ; } else { id = ( ( handle.getComponentName ( ) . getClassName ( ) ) + "@" ) + ( getNextCallId ( ) ) ; } addConnection ( id , connection ) ; return id ; }
Source:
public void testMergeOnDefault ( ) { com.android.builder.ProductFlavor flavor = mCustom.mergeWith ( mDefault ) ; assertEquals ( 42 , flavor.getMinSdkVersion ( ) ) ; assertEquals ( 43 , flavor.getTargetSdkVersion ( ) ) ; assertEquals ( 44 , flavor.getVersionCode ( ) ) ; assertEquals ( "42.0" , flavor.getVersionName ( ) ) ; assertEquals ( "com.forty.two" , flavor.getPackageName ( ) ) ; assertEquals ( "com.forty.two.test" , flavor.getTestPackageName ( ) ) ; assertEquals ( "com.forty.two.test.Runner" , flavor.getTestInstrumentationRunner ( ) ) ; }

Target:
public void testMergeOnDefault ( ) { com.android.builder.ProductFlavor flavor = mCustom.mergeOver ( mDefault ) ; assertEquals ( 42 , flavor.getMinSdkVersion ( ) ) ; assertEquals ( 43 , flavor.getTargetSdkVersion ( ) ) ; assertEquals ( 44 , flavor.getVersionCode ( ) ) ; assertEquals ( "42.0" , flavor.getVersionName ( ) ) ; assertEquals ( "com.forty.two" , flavor.getPackageName ( ) ) ; assertEquals ( "com.forty.two.test" , flavor.getTestPackageName ( ) ) ; assertEquals ( "com.forty.two.test.Runner" , flavor.getTestInstrumentationRunner ( ) ) ; }
Source:
public static MergingReport.Result validate ( @ com.android.annotations.NonNull com.android.manifmerger.MergingReport.Builder mergingReport , @ com.android.annotations.NonNull com.android.manifmerger.XmlDocument xmlDocument ) { return com.android.manifmerger.PreValidator.validate ( mergingReport , xmlDocument.getRootNode ( ) ) ; }

Target:
public static MergingReport.Result validate ( @ com.android.annotations.NonNull com.android.manifmerger.MergingReport.Builder mergingReport , @ com.android.annotations.NonNull com.android.manifmerger.XmlDocument xmlDocument ) { com.android.manifmerger.MergingReport.Result validated = com.android.manifmerger.PreValidator.validate ( mergingReport , xmlDocument.getRootNode ( ) ) ; if ( validated == ( MergingReport.Result.SUCCESS ) ) { com.android.manifmerger.PreValidator.splitUsesFeatureDeclarations ( mergingReport , xmlDocument.getRootNode ( ) ) ; } return validated ; }
Source:
public void testCreateNanNetworkInterface ( ) throws org.json.JSONException { final short transactionId = 10 ; final java.lang.String interfaceName = "nan0" ; mDut.createNanNetworkInterface ( transactionId , interfaceName ) ; org.mockito.Mockito.verify ( mNanHalMock ) . createNanNetworkInterfaceMockNative ( org.mockito.Matchers.eq ( transactionId ) , mArgs.capture ( ) ) ; android.os.Bundle argsData = com.android.server.wifi.HalMockUtils.convertJsonToBundle ( mArgs.getValue ( ) ) ; collector.checkThat ( "iface_name" , new java.lang.String ( argsData.getByteArray ( "iface_name" ) ) , org.hamcrest.core.IsEqual.equalTo ( interfaceName ) ) ; }

Target:
public void testCreateAwareNetworkInterface ( ) throws org.json.JSONException { final short transactionId = 10 ; final java.lang.String interfaceName = "aware0" ; mDut.createAwareNetworkInterface ( transactionId , interfaceName ) ; org.mockito.Mockito.verify ( mAwareHalMock ) . createAwareNetworkInterfaceMockNative ( org.mockito.Matchers.eq ( transactionId ) , mArgs.capture ( ) ) ; android.os.Bundle argsData = com.android.server.wifi.HalMockUtils.convertJsonToBundle ( mArgs.getValue ( ) ) ; collector.checkThat ( "iface_name" , new java.lang.String ( argsData.getByteArray ( "iface_name" ) ) , org.hamcrest.core.IsEqual.equalTo ( interfaceName ) ) ; }
Source:
public void testSubscribeBadServiceName ( ) { android.net.wifi.nan.SubscribeConfig subscribeConfig = new android.net.wifi.nan.SubscribeConfig.Builder ( ) . setServiceName ( "InvalidServiceCharacters__" ) . build ( ) ; int clientId = doConnect ( ) ; android.net.wifi.nan.IWifiNanDiscoverySessionCallback mockCallback = org.mockito.Mockito.mock ( android.net.wifi.nan.IWifiNanDiscoverySessionCallback.class ) ; mDut.subscribe ( clientId , subscribeConfig , mockCallback ) ; org.mockito.Mockito.verify ( mNanStateManagerMock ) . subscribe ( clientId , subscribeConfig , mockCallback ) ; }

Target:
public void testUpdatePublishInvalid ( ) { int sessionId = 1232 ; android.net.wifi.nan.PublishConfig publishConfig = new android.net.wifi.nan.PublishConfig.Builder ( ) . setServiceName ( "something with spaces" ) . build ( ) ; int clientId = doConnect ( ) ; mDut.updatePublish ( clientId , sessionId , publishConfig ) ; org.mockito.Mockito.verify ( mNanStateManagerMock ) . updatePublish ( clientId , sessionId , publishConfig ) ; }
Source:
public void tearDown ( com.android.tradefed.device.ITestDevice device , com.android.tradefed.build.IBuildInfo buildInfo , java.lang.Throwable e ) throws com.android.tradefed.device.DeviceNotAvailableException { switch ( mTarget ) { case DEVICE : if ( ( ( ! ( e instanceof com.android.tradefed.device.DeviceNotAvailableException ) ) && ( mCleanup ) ) && ( ( mFilePushed ) != null ) ) { device.executeShellCommand ( ( "rm -r " + ( mFilePushed ) ) ) ; } break ; case HOST : com.android.tradefed.util.FileUtil.recursiveDelete ( new java.io.File ( mFilePushed ) ) ; break ; } }

Target:
public void tearDown ( com.android.tradefed.device.ITestDevice device , com.android.tradefed.build.IBuildInfo buildInfo , java.lang.Throwable e ) throws com.android.tradefed.device.DeviceNotAvailableException { switch ( mTarget ) { case DEVICE : if ( ( ( ! ( e instanceof com.android.tradefed.device.DeviceNotAvailableException ) ) && ( mCleanup ) ) && ( ( mFilePushed ) != null ) ) { device.executeShellCommand ( ( "rm -r " + ( mFilePushed ) ) ) ; } break ; case HOST : if ( ( mFilePushed ) != null ) { com.android.tradefed.util.FileUtil.deleteFile ( new java.io.File ( mFilePushed ) ) ; } } }
Source:
public static android.content.SyncStatusInfo getSyncStatus ( android.accounts.Account account , java.lang.String authority ) { try { return android.content.ContentResolver.getContentService ( ) . getSyncStatus ( account , authority ) ; } catch ( android.os.RemoteException e ) { throw new java.lang.RuntimeException ( "the ContentService should always be reachable" , e ) ; } }

Target:
public static boolean getSyncAutomaticallyAsUser ( android.accounts.Account account , java.lang.String authority , int userId ) { try { return android.content.ContentResolver.getContentService ( ) . getSyncAutomaticallyAsUser ( account , authority , userId ) ; } catch ( android.os.RemoteException e ) { throw new java.lang.RuntimeException ( "the ContentService should always be reachable" , e ) ; } }
Source:
public void keyguardWaitingForActivityDrawn ( ) { enforceNotIsolatedCaller ( "keyguardWaitingForActivityDrawn" ) ; final long token = android.os.Binder.clearCallingIdentity ( ) ; try { synchronized ( this ) { if ( com.android.server.am.ActivityManagerService.DEBUG_LOCKSCREEN ) logLockScreen ( "" ) ; mWindowManager.keyguardWaitingForActivityDrawn ( ) ; if ( mLockScreenShown ) { mLockScreenShown = false ; comeOutOfSleepIfNeededLocked ( ) ; } } } finally { android.os.Binder.restoreCallingIdentity ( token ) ; } }

Target:
public void systemBackupRestored ( ) { synchronized ( this ) { if ( mSystemReady ) { mTaskPersister.restoreTasksFromOtherDeviceLocked ( ) ; } else { android.util.Slog.w ( com.android.server.am.ActivityManagerService.TAG , "System backup restored before system is ready" ) ; } } }
Source:
public java.lang.String getSimCountryIso ( ) { return getSimCountryIsoForPhone ( android.telephony.TelephonyManager.getDefaultPhone ( ) ) ; }

Target:
public java.lang.String getVisualVoicemailPackageName ( ) { try { com.android.internal.telephony.ITelephony telephony = getITelephony ( ) ; if ( telephony != null ) { return telephony.getVisualVoicemailPackageName ( mContext.getOpPackageName ( ) , getSubId ( ) ) ; } } catch ( android.os.RemoteException ex ) { } catch ( java.lang.NullPointerException ex ) { } return null ; }
Source:
protected void cleanup ( ) { if ( com.android.bluetooth.hid.HidHostService.DBG ) android.util.Log.d ( com.android.bluetooth.hid.HidHostService.TAG , "Stopping Bluetooth HidHostService" ) ; if ( mNativeAvailable ) { cleanupNative ( ) ; mNativeAvailable = false ; } if ( ( mInputDevices ) != null ) { for ( android.bluetooth.BluetoothDevice device : mInputDevices.keySet ( ) ) { int inputDeviceState = getConnectionState ( device ) ; if ( inputDeviceState != ( android.bluetooth.BluetoothProfile.STATE_DISCONNECTED ) ) { broadcastConnectionState ( device , BluetoothProfile.STATE_DISCONNECTED ) ; } } mInputDevices.clear ( ) ; } com.android.bluetooth.hid.HidHostService.clearHidHostService ( ) ; }

Target:
protected void cleanup ( ) { if ( com.android.bluetooth.hid.HidHostService.DBG ) android.util.Log.d ( com.android.bluetooth.hid.HidHostService.TAG , "Stopping Bluetooth HidHostService" ) ; if ( mNativeAvailable ) { cleanupNative ( ) ; mNativeAvailable = false ; } if ( ( mInputDevices ) != null ) { for ( android.bluetooth.BluetoothDevice device : mInputDevices.keySet ( ) ) { int inputDeviceState = getConnectionState ( device ) ; if ( inputDeviceState != ( android.bluetooth.BluetoothProfile.STATE_DISCONNECTED ) ) { broadcastConnectionState ( device , BluetoothProfile.STATE_DISCONNECTED ) ; } } mInputDevices.clear ( ) ; } com.android.bluetooth.hid.HidHostService.setHidHostService ( null ) ; }
Source:
private final void startRfcommSocketListeners ( int masId ) { if ( masId == ( - 1 ) ) { for ( int i = 0 , c = mMasInstances.size ( ) ; i < c ; i ++ ) { mMasInstances.valueAt ( i ) . startRfcommSocketListener ( ) ; } } else { com.android.bluetooth.map.BluetoothMapMasInstance masInst = mMasInstances.get ( masId ) ; if ( masInst != null ) { masInst.startRfcommSocketListener ( ) ; } else { android.util.Log.w ( com.android.bluetooth.map.BluetoothMapService.TAG , ( "startRfcommSocketListeners(): Invalid MasId: " + masId ) ) ; } } }

Target:
private void startSocketListeners ( int masId ) { if ( masId == ( - 1 ) ) { for ( int i = 0 , c = mMasInstances.size ( ) ; i < c ; i ++ ) { mMasInstances.valueAt ( i ) . startSocketListeners ( ) ; } } else { com.android.bluetooth.map.BluetoothMapMasInstance masInst = mMasInstances.get ( masId ) ; if ( masInst != null ) { masInst.startSocketListeners ( ) ; } else { android.util.Log.w ( com.android.bluetooth.map.BluetoothMapService.TAG , ( "startSocketListeners(): Invalid MasId: " + masId ) ) ; } } }
Source:
static boolean safeContainsKey ( java.util.Map < ? , ? > map , java.lang.Object key ) { try { return map.containsKey ( key ) ; } catch ( java.lang.ClassCastException e ) { return false ; } }

Target:
static boolean safeContainsKey ( java.util.Map < ? , ? > map , java.lang.Object key ) { com.google.common.base.Preconditions.checkNotNull ( map ) ; try { return map.containsKey ( key ) ; } catch ( java.lang.ClassCastException e ) { return false ; } catch ( java.lang.NullPointerException e ) { return false ; } }