auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testGetInstalledDistroVersion ( ) throws java.lang.Exception { assertNull ( installer.getInstalledDistroVersion ( ) ) ; assertNoDistroOperationStaged ( ) ; assertNoInstalledDistro ( ) ; com.android.timezone.distro.TimeZoneDistro distro = libcore.tzdata.update2.TimeZoneDistroInstallerTest.createValidTimeZoneDistro ( libcore.tzdata.update2.TimeZoneDistroInstallerTest.NEW_RULES_VERSION , 1 ) ; simulateInstalledDistro ( distro ) ; assertInstalledDistro ( distro ) ; assertEquals ( distro.getDistroVersion ( ) , installer.getInstalledDistroVersion ( ) ) ; assertNoDistroOperationStaged ( ) ; assertInstalledDistro ( distro ) ; }

Target:
public void testGetInstalledDistroVersion ( ) throws java.lang.Exception { assertNull ( installer.getInstalledDistroVersion ( ) ) ; assertNoDistroOperationStaged ( ) ; assertNoInstalledDistro ( ) ; byte [ ] distroBytes = libcore.tzdata.update2.TimeZoneDistroInstallerTest.createValidTimeZoneDistroBytes ( libcore.tzdata.update2.TimeZoneDistroInstallerTest.NEW_RULES_VERSION , 1 ) ; simulateInstalledDistro ( distroBytes ) ; assertInstalledDistro ( distroBytes ) ; assertEquals ( new com.android.timezone.distro.TimeZoneDistro ( distroBytes ) . getDistroVersion ( ) , installer.getInstalledDistroVersion ( ) ) ; assertNoDistroOperationStaged ( ) ; assertInstalledDistro ( distroBytes ) ; }
Source:
static int foo ( ) { try { Main.constantIndexing2 ( new int [ 3 ] ) ; } catch ( java.lang.ArrayIndexOutOfBoundsException e ) { return 99 ; } return 0 ; }

Target:
static int foo ( ) { try { Main.constantIndexing2 ( new int [ 3 ] ) ; } catch ( java.lang.ArrayIndexOutOfBoundsException e ) { try { Main.constantIndexingForward6 ( new int [ 3 ] ) ; } catch ( java.lang.ArrayIndexOutOfBoundsException e2 ) { return 99 ; } } return 0 ; }
Source:
public void testAccountHandle ( ) { if ( ! ( mShouldTestTelecom ) ) { return ; } org.junit.Assert.assertThat ( mCall.getDetails ( ) . getAccountHandle ( ) , org.hamcrest.CoreMatchers.is ( android.telecom.PhoneAccountHandle.class ) ) ; assertEquals ( android.telecom.cts.TEST_PHONE_ACCOUNT_HANDLE , mCall.getDetails ( ) . getAccountHandle ( ) ) ; }

Target:
public void testAccountHandle ( ) { if ( ! ( mShouldTestTelecom ) ) { return ; } org.junit.Assert.assertThat ( mCall.getDetails ( ) . getAccountHandle ( ) , org.hamcrest.CoreMatchers.instanceOf ( android.telecom.PhoneAccountHandle.class ) ) ; assertEquals ( android.telecom.cts.TEST_PHONE_ACCOUNT_HANDLE , mCall.getDetails ( ) . getAccountHandle ( ) ) ; }
Source:
public void testAesCbcHmacSha1Udp6 ( ) throws java.lang.Exception { android.net.IpSecAlgorithm crypt = new android.net.IpSecAlgorithm ( android.net.IpSecAlgorithm.CRYPT_AES_CBC , android.net.cts.IpSecManagerTest.CRYPT_KEY ) ; android.net.IpSecAlgorithm auth = new android.net.IpSecAlgorithm ( android.net.IpSecAlgorithm.AUTH_HMAC_SHA1 , getAuthKey ( 160 ) , 96 ) ; checkTransform ( android.system.OsConstants.IPPROTO_UDP , android.net.cts.IpSecManagerTest.IPV6_LOOPBACK , crypt , auth , false , 1 , false ) ; checkTransform ( android.system.OsConstants.IPPROTO_UDP , android.net.cts.IpSecManagerTest.IPV6_LOOPBACK , crypt , auth , false , 1 , true ) ; }

Target:
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.CRYPT_KEY ) ; 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 ) ; }
Source:
public final int startActivityWithConfig ( android.app.IApplicationThread caller , android.content.Intent intent , java.lang.String resolvedType , android.net.Uri [ ] grantedUriPermissions , int grantedMode , android.os.IBinder resultTo , java.lang.String resultWho , int requestCode , boolean onlyIfNeeded , boolean debug , android.content.res.Configuration config ) { return startActivityMayWait ( caller , intent , resolvedType , grantedUriPermissions , grantedMode , resultTo , resultWho , requestCode , onlyIfNeeded , debug , null , config ) ; }

Target:
void grantUriPermissionUncheckedFromIntentLocked ( int targetUid , java.lang.String targetPkg , android.content.Intent intent , com.android.server.am.UriPermissionOwner owner ) { grantUriPermissionUncheckedLocked ( targetUid , targetPkg , intent.getData ( ) , intent.getFlags ( ) , owner ) ; }
Source:
public void testConnectWithDisconnectAndSingleExistingNetwork ( ) throws java.lang.Exception { executeAndValidateInitializationSequence ( ) ; executeAndValidateConnectSequence ( 0 , false , true ) ; }

Target:
public void testConnectFailureDueToNetworkAddFailure ( ) throws java.lang.Exception { executeAndValidateInitializationSequence ( ) ; setupMocksForConnectSequence ( false ) ; org.mockito.Mockito.doAnswer ( new android.app.test.MockAnswerUtil.AnswerWithArguments ( ) { public void answer ( ISupplicantStaIface.addNetworkCallback cb ) throws android.os.RemoteException { cb.onValues ( mStatusFailure , org.mockito.Mockito.mock ( android.hardware.wifi.supplicant.V1_0.ISupplicantStaNetwork.class ) ) ; return ; } } ) . when ( mISupplicantStaIfaceMock ) . addNetwork ( org.mockito.Matchers.any ( ISupplicantStaIface.addNetworkCallback.class ) ) ; assertFalse ( mDut.connectToNetwork ( new android.net.wifi.WifiConfiguration ( ) ) ) ; }
Source:
public com.android.jack.dx.io.instructions.DecodedInstruction decode ( int opcodeUnit , com.android.jack.dx.io.instructions.CodeInput in ) { int opcode = com.android.jack.dx.io.instructions.InstructionCodec.byte0 ( opcodeUnit ) ; int a = com.android.jack.dx.io.instructions.InstructionCodec.byte1 ( opcodeUnit ) ; return new com.android.jack.dx.io.instructions.OneRegisterDecodedInstruction ( this , opcode , 0 , null , 0 , 0L , a ) ; }

Target:
public com.android.jack.dx.io.instructions.DecodedInstruction decode ( int opcodeUnit , com.android.jack.dx.io.instructions.CodeInput in ) { int opcode = com.android.jack.dx.io.instructions.InstructionCodec.byte0 ( opcodeUnit ) ; int a = com.android.jack.dx.io.instructions.InstructionCodec.byte1 ( opcodeUnit ) ; return new com.android.jack.dx.io.instructions.OneRegisterDecodedInstruction ( this , opcode , 0 , com.android.jack.dx.io.IndexType.NONE , 0 , 0L , a ) ; }
Source:
public com.android.apksig.ApkSigner build ( ) { return new com.android.apksig.ApkSigner ( mSignerConfigs , mMinSdkVersion , mV1SigningEnabled , mV2SigningEnabled , mDebuggableApkPermitted , mOtherSignersSignaturesPreserved , mCreatedBy , mSignerEngine , mInputApkFile , mInputApkDataSource , mOutputApkFile , mOutputApkDataSink , mOutputApkDataSource ) ; }

Target:
public com.android.apksig.ApkSigner build ( ) { if ( ( mV3SigningExplicitlyDisabled ) && ( mV3SigningExplicitlyEnabled ) ) { throw new java.lang.IllegalStateException ( ( "Builder configured to both enable and disable APK " + "Signature Scheme v3 signing" ) ) ; } if ( mV3SigningExplicitlyDisabled ) { mV3SigningEnabled = false ; } if ( mV3SigningExplicitlyEnabled ) { mV3SigningEnabled = true ; } return new com.android.apksig.ApkSigner ( mSignerConfigs , mMinSdkVersion , mV1SigningEnabled , mV2SigningEnabled , mV3SigningEnabled , mDebuggableApkPermitted , mOtherSignersSignaturesPreserved , mCreatedBy , mSignerEngine , mInputApkFile , mInputApkDataSource , mOutputApkFile , mOutputApkDataSink , mOutputApkDataSource , mSigningCertificateLineage ) ; }
Source:
void setSystemAudioMode ( boolean on , boolean updateSetting ) { com.android.server.hdmi.HdmiLogger.debug ( "System Audio Mode change[old:%b new:%b]" , mSystemAudioActivated , on ) ; if ( updateSetting ) { mService.writeBooleanSetting ( Global.HDMI_SYSTEM_AUDIO_ENABLED , on ) ; } updateAudioManagerForSystemAudio ( on ) ; synchronized ( mLock ) { if ( ( mSystemAudioActivated ) != on ) { mSystemAudioActivated = on ; mService.announceSystemAudioModeChange ( on ) ; } } }

Target:
public void updateSAD ( java.lang.String keyValuePairs , boolean supportMultiChannels ) { mService.getAudioManager ( ) . setParameters ( keyValuePairs ) ; mService.setCecOption ( Constants.OPTION_CEC_SUPPORT_MULTICHANNELS , ( supportMultiChannels ? Constants.ENABLED : Constants.DISABLED ) ) ; }
Source:
private java.lang.String formatAssertionMessage ( java.lang.String label , java.lang.String format , java.lang.Object ... params ) { return java.lang.String.format ( "%s | %s, handle: %d | %s" , android.hardware.cts.helpers.SensorTestInformation.getSensorName ( mSensor.getType ( ) ) , mSensor.getHandle ( ) , java.lang.String.format ( format , params ) ) ; }

Target:
public void registerListener ( android.hardware.cts.helpers.TestSensorEventListener listener ) { if ( ( mTestSensorEventListener ) != null ) { android.util.Log.w ( android.hardware.cts.helpers.TestSensorManager.LOG_TAG , "Listener already registered, returning." ) ; return ; } mTestSensorEventListener = ( listener != null ) ? listener : new android.hardware.cts.helpers.TestSensorEventListener ( ) ; mTestSensorEventListener.setSensorInfo ( mSensor , mRateUs , mMaxBatchReportLatencyUs ) ; java.lang.String message = android.hardware.cts.helpers.SensorCtsHelper.formatAssertionMessage ( mSensor , "registerListener" ) ; boolean result = mSensorManager.registerListener ( mTestSensorEventListener , mSensor , mRateUs , mMaxBatchReportLatencyUs ) ; junit.framework.Assert.assertTrue ( message , result ) ; }
Source:
protected void addTab ( java.lang.String title , final org.gradle.api.Action < org.w3c.dom.Element > contentRenderer ) { tabsRenderer.add ( title , new org.gradle.reporting.DomReportRenderer < T > ( ) { @ java.lang.Override public void render ( T model , org.w3c.dom.Element parent ) { contentRenderer.execute ( parent ) ; } } ) ; }

Target:
protected void addTab ( java.lang.String title , final org.gradle.api.Action < org.gradle.api.internal.html.SimpleHtmlWriter > contentRenderer ) { tabsRenderer.add ( title , new org.gradle.reporting.ReportRenderer < T , org.gradle.api.internal.html.SimpleHtmlWriter > ( ) { @ java.lang.Override public void render ( T model , org.gradle.api.internal.html.SimpleHtmlWriter writer ) { contentRenderer.execute ( writer ) ; } } ) ; }
Source:
public boolean isPossibleShortNumberForRegion ( com.google.i18n.phonenumbers.Phonenumber.PhoneNumber number , java.lang.String regionDialingFrom ) { if ( ! ( regionDialingFromMatchesNumber ( number , regionDialingFrom ) ) ) { return false ; } com.google.i18n.phonenumbers.Phonemetadata.PhoneMetadata phoneMetadata = com.google.i18n.phonenumbers.MetadataManager.getShortNumberMetadataForRegion ( regionDialingFrom ) ; if ( phoneMetadata == null ) { return false ; } return matcherApi.matchesPossibleNumber ( com.google.i18n.phonenumbers.ShortNumberInfo.getNationalSignificantNumber ( number ) , phoneMetadata.getGeneralDesc ( ) ) ; }

Target:
public boolean isPossibleShortNumberForRegion ( com.google.i18n.phonenumbers.Phonenumber.PhoneNumber number , java.lang.String regionDialingFrom ) { if ( ! ( regionDialingFromMatchesNumber ( number , regionDialingFrom ) ) ) { return false ; } com.google.i18n.phonenumbers.Phonemetadata.PhoneMetadata phoneMetadata = com.google.i18n.phonenumbers.MetadataManager.getShortNumberMetadataForRegion ( regionDialingFrom ) ; if ( phoneMetadata == null ) { return false ; } int numberLength = com.google.i18n.phonenumbers.ShortNumberInfo.getNationalSignificantNumber ( number ) . length ( ) ; return phoneMetadata.getGeneralDesc ( ) . getPossibleLengthList ( ) . contains ( numberLength ) ; }
Source:
private boolean isPermissionEnforcedLocked ( java.lang.String permission , boolean enforcedDefault ) { if ( android.Manifest.permission.READ_EXTERNAL_STORAGE.equals ( permission ) ) { if ( ( mSettings.mReadExternalStorageEnforced ) != null ) { return mSettings.mReadExternalStorageEnforced ; } else { return enforcedDefault ; } } else { return true ; } }

Target:
public void resetPreferredActivities ( int userId ) { mContext.enforceCallingOrSelfPermission ( android.Manifest.permission.SET_PREFERRED_APPLICATIONS , null ) ; synchronized ( mPackages ) { int user = android.os.UserHandle.getCallingUserId ( ) ; clearPackagePreferredActivitiesLPw ( null , user ) ; mSettings.readDefaultPreferredAppsLPw ( this , user ) ; mSettings.writePackageRestrictionsLPr ( user ) ; scheduleWriteSettingsLocked ( ) ; } }
Source:
public void onReceive ( android.content.Context context , android.content.Intent intent ) { java.lang.String action = intent.getAction ( ) ; if ( action.equals ( Intent.ACTION_BOOT_COMPLETED ) ) { if ( com.android.bluetooth.avrcp.Avrcp.DEBUG ) android.util.Log.d ( com.android.bluetooth.avrcp.Avrcp.TAG , "Boot completed, initializing player lists" ) ; new com.android.bluetooth.avrcp.Avrcp.BrowsablePlayerListBuilder ( ) . start ( ) ; } }

Target:
public void onReceive ( android.content.Context context , android.content.Intent intent ) { java.lang.String action = intent.getAction ( ) ; if ( action.equals ( Intent.ACTION_BOOT_COMPLETED ) ) { if ( com.android.bluetooth.avrcp.Avrcp.DEBUG ) android.util.Log.d ( com.android.bluetooth.avrcp.Avrcp.TAG , "Boot completed, initializing player lists" ) ; mBrowsableListBuilder.start ( ) ; } }
Source:
public void onSimStateChanged ( int subId , int slotId , com.android.internal.telephony.IccCardConstants.State simState ) { if ( com.android.keyguard.KeyguardSimPinView.DEBUG ) android.util.Log.v ( com.android.keyguard.KeyguardSimPinView.TAG , ( ( ( ( "onSimStateChanged(subId=" + subId ) + ",state=" ) + simState ) + ")" ) ) ; resetState ( ) ; }

Target:
public void onSimStateChanged ( int subId , int slotId , com.android.internal.telephony.IccCardConstants.State simState ) { if ( com.android.keyguard.KeyguardSimPinView.DEBUG ) android.util.Log.v ( com.android.keyguard.KeyguardSimPinView.TAG , ( ( ( ( "onSimStateChanged(subId=" + subId ) + ",state=" ) + simState ) + ")" ) ) ; switch ( simState ) { case ABSENT : { com.android.keyguard.KeyguardUpdateMonitor.getInstance ( getContext ( ) ) . reportSimUnlocked ( mSubId ) ; mCallback.dismiss ( true , com.android.keyguard.KeyguardUpdateMonitor.getCurrentUser ( ) ) ; break ; } default : resetState ( ) ; } }
Source:
public void testRun ( ) throws com.android.ddmlib.AdbCommandRejectedException , com.android.ddmlib.ShellCommandUnresponsiveException , com.android.ddmlib.TimeoutException , java.io.IOException { mRunner.run ( new com.android.ddmlib.testrunner.RemoteAndroidTestRunnerTest.EmptyListener ( ) ) ; assertStringsEquals ( java.lang.String.format ( "am instrument -w -r %s/%s" , com.android.ddmlib.testrunner.RemoteAndroidTestRunnerTest.TEST_PACKAGE , com.android.ddmlib.testrunner.RemoteAndroidTestRunnerTest.TEST_RUNNER ) , mMockDevice.getLastShellCommand ( ) ) ; }

Target:
protected void setUp ( ) throws java.lang.Exception { mMockDevice = org.easymock.EasyMock.createMock ( com.android.ddmlib.IDevice.class ) ; org.easymock.EasyMock.expect ( mMockDevice.getSerialNumber ( ) ) . andStubReturn ( "serial" ) ; mMockListener = org.easymock.EasyMock.createNiceMock ( com.android.ddmlib.testrunner.ITestRunListener.class ) ; mRunner = new com.android.ddmlib.testrunner.RemoteAndroidTestRunner ( com.android.ddmlib.testrunner.RemoteAndroidTestRunnerTest.TEST_PACKAGE , com.android.ddmlib.testrunner.RemoteAndroidTestRunnerTest.TEST_RUNNER , mMockDevice ) ; }
Source:
public void setDataEnabled ( boolean enable ) { setDataEnabled ( getSubId ( android.telephony.SubscriptionManager.getDefaultDataSubscriptionId ( ) ) , enable ) ; }

Target:
public boolean setNetworkSelectionModeManual ( java.lang.String operatorNumeric , boolean persistSelection ) { try { com.android.internal.telephony.ITelephony telephony = getITelephony ( ) ; if ( telephony != null ) { return telephony.setNetworkSelectionModeManual ( getSubId ( ) , operatorNumeric , persistSelection ) ; } } catch ( android.os.RemoteException ex ) { android.telephony.Rlog.e ( android.telephony.TelephonyManager.TAG , "setNetworkSelectionModeManual RemoteException" , ex ) ; } catch ( java.lang.NullPointerException ex ) { android.telephony.Rlog.e ( android.telephony.TelephonyManager.TAG , "setNetworkSelectionModeManual NPE" , ex ) ; } return false ; }
Source:
public boolean loadFromXmlNode ( org.w3c.dom.Node xml_node ) { boolean structure_changed = ( mXmlNode ) != xml_node ; mXmlNode = xml_node ; if ( xml_node != null ) { updateAttributeList ( xml_node ) ; structure_changed |= updateElementList ( xml_node ) ; invokeUiUpdateListeners ( ( structure_changed ? com.android.ide.eclipse.adt.internal.editors.uimodel.IUiUpdateListener.UiUpdateState.CHILDREN_CHANGED : com.android.ide.eclipse.adt.internal.editors.uimodel.IUiUpdateListener.UiUpdateState.ATTR_UPDATED ) ) ; } return structure_changed ; }

Target:
public boolean loadFromXmlNode ( org.w3c.dom.Node xmlNode ) { boolean structureChanged = ( mXmlNode ) != xmlNode ; mXmlNode = xmlNode ; if ( xmlNode != null ) { updateAttributeList ( xmlNode ) ; structureChanged |= updateElementList ( xmlNode ) ; invokeUiUpdateListeners ( ( structureChanged ? com.android.ide.eclipse.adt.internal.editors.uimodel.IUiUpdateListener.UiUpdateState.CHILDREN_CHANGED : com.android.ide.eclipse.adt.internal.editors.uimodel.IUiUpdateListener.UiUpdateState.ATTR_UPDATED ) ) ; } return structureChanged ; }
Source:
public int checkRightsStatus ( java.lang.String path , int action ) { if ( ( ( null == path ) || ( path.equals ( "" ) ) ) || ( ! ( DrmStore.Action.isValid ( action ) ) ) ) { throw new java.lang.IllegalArgumentException ( "Given path or action is not valid" ) ; } else if ( ( getState ( ) ) == ( android.drm.DrmManagerClient.STATE_UNINITIALIZED ) ) { throw new java.lang.IllegalStateException ( "Not Initialized yet" ) ; } return _checkRightsStatus ( mUniqueId , path , action ) ; }

Target:
public int loadPlugIns ( ) { int result = android.drm.DrmManagerClient.ERROR_UNKNOWN ; if ( ( android.drm.DrmManagerClient.STATE_UNINITIALIZED ) == ( getState ( ) ) ) { if ( null != ( mEventHandler ) ) { android.os.Message msg = mEventHandler.obtainMessage ( android.drm.DrmManagerClient.ACTION_INITIALIZE , new java.lang.ref.WeakReference < android.drm.DrmManagerClient > ( this ) ) ; result = ( mEventHandler.sendMessage ( msg ) ) ? android.drm.DrmManagerClient.ERROR_NONE : result ; } } else { result = android.drm.DrmManagerClient.ERROR_NONE ; } return result ; }
Source:
private static int hash ( int hash , java.lang.String s ) { if ( s == null ) return hash ; return ( hash * 127 ) + ( s.hashCode ( ) ) ; }

Target:
private static int hash ( int hash , java.lang.String s ) { if ( s == null ) return hash ; return ( s.indexOf ( '%' ) ) < 0 ? ( hash * 127 ) + ( s.hashCode ( ) ) : java.net.URI.normalizedHash ( hash , s ) ; }
Source:
public sun.misc.URLClassPath.Loader run ( ) throws java.io.IOException { java.lang.String file = url.getFile ( ) ; if ( ( file != null ) && ( file.endsWith ( "/" ) ) ) { if ( "file" . equals ( url.getProtocol ( ) ) ) { return new sun.misc.URLClassPath.FileLoader ( url ) ; } else { return new sun.misc.URLClassPath.Loader ( url ) ; } } else { return new sun.misc.URLClassPath.JarLoader ( url , jarHandler , lmap ) ; } }

Target:
public sun.misc.URLClassPath.Loader run ( ) throws java.io.IOException { java.lang.String file = url.getFile ( ) ; if ( ( file != null ) && ( file.endsWith ( "/" ) ) ) { if ( "file" . equals ( url.getProtocol ( ) ) ) { return new sun.misc.URLClassPath.FileLoader ( url ) ; } else { return new sun.misc.URLClassPath.Loader ( url ) ; } } else { return new sun.misc.URLClassPath.JarLoader ( url , jarHandler , lmap , acc ) ; } }
Source:
void copy3DRangeFromUnchecked ( int xoff , int yoff , int zoff , int w , int h , int d , byte [ ] data ) { mRS.validate ( ) ; validate3DRange ( xoff , yoff , zoff , w , h , d ) ; mRS.nAllocationData3D ( getIDSafe ( ) , xoff , yoff , zoff , mSelectedLOD , w , h , d , data , data.length ) ; }

Target:
void copy3DRangeFromUnchecked ( int xoff , int yoff , int zoff , int w , int h , int d , byte [ ] data ) { mRS.validate ( ) ; validate3DRange ( xoff , yoff , zoff , w , h , d ) ; mRS.nAllocationData3D ( getIDSafe ( ) , xoff , yoff , zoff , mSelectedLOD , w , h , d , data , data.length , Element.DataType.SIGNED_8 ) ; }
Source:
public void testQuerySystemForCarMode_False ( ) { org.mockito.Mockito.when ( mContext.getSystemService ( Context.UI_MODE_SERVICE ) ) . thenReturn ( mUiModeManager ) ; org.mockito.Mockito.when ( mUiModeManager.getCurrentModeType ( ) ) . thenReturn ( Configuration.UI_MODE_TYPE_NORMAL ) ; assertFalse ( new com.android.server.telecom.SystemStateProvider ( mContext ) . isCarMode ( ) ) ; }

Target:
public void testQuerySystemForCarMode_False ( ) { org.mockito.Mockito.when ( mContext.getSystemService ( Context.UI_MODE_SERVICE ) ) . thenReturn ( mUiModeManager ) ; org.mockito.Mockito.when ( mUiModeManager.getCurrentModeType ( ) ) . thenReturn ( Configuration.UI_MODE_TYPE_NORMAL ) ; org.junit.Assert.assertFalse ( new com.android.server.telecom.SystemStateProvider ( mContext ) . isCarMode ( ) ) ; }
Source:
private void updatePriorityQueue ( java.util.Timer.ScheduledTask taskExecuted , long timeFinished ) { scheduledTaskPriorityQueue.remove ( taskExecuted ) ; if ( ( taskExecuted.period ) == null ) { return ; } taskExecuted.nextExecution = ( taskExecuted.period ) + ( taskExecuted.isAtFixedRate ? taskExecuted.nextExecution : timeFinished ) ; scheduledTaskPriorityQueue.add ( taskExecuted ) ; }

Target:
private void updatePriorityQueue ( java.util.Timer.ScheduledTask taskExecuted , long timeFinished ) { scheduledTaskPriorityQueue.remove ( taskExecuted ) ; if ( ( ( taskExecuted.period ) == null ) || ( taskExecuted.timerTask.isCancelled ( ) ) ) { return ; } taskExecuted.nextExecution = ( taskExecuted.period ) + ( taskExecuted.isAtFixedRate ? taskExecuted.nextExecution : timeFinished ) ; scheduledTaskPriorityQueue.add ( taskExecuted ) ; }
Source:
public void onDownloadStart ( java.lang.String url , java.lang.String userAgent , java.lang.String contentDisposition , java.lang.String mimeType , long contentLength ) { if ( ( mDownloadListener ) != null ) { org.chromium.content.common.TraceEvent.begin ( ) ; if ( com.android.webview.chromium.WebViewContentsClientAdapter.TRACE ) android.util.Log.d ( com.android.webview.chromium.WebViewContentsClientAdapter.TAG , "onDownloadStart" ) ; mDownloadListener.onDownloadStart ( url , userAgent , contentDisposition , mimeType , contentLength ) ; org.chromium.content.common.TraceEvent.end ( ) ; } }

Target:
public void onDownloadStart ( java.lang.String url , java.lang.String userAgent , java.lang.String contentDisposition , java.lang.String mimeType , long contentLength ) { if ( ( mDownloadListener ) != null ) { org.chromium.base.TraceEvent.begin ( ) ; if ( com.android.webview.chromium.WebViewContentsClientAdapter.TRACE ) android.util.Log.d ( com.android.webview.chromium.WebViewContentsClientAdapter.TAG , "onDownloadStart" ) ; mDownloadListener.onDownloadStart ( url , userAgent , contentDisposition , mimeType , contentLength ) ; org.chromium.base.TraceEvent.end ( ) ; } }
Source:
public void testNonGeographicalRegionMetadataLoadsCorrectly ( ) { java.util.concurrent.ConcurrentHashMap < java.lang.Integer , com.google.i18n.phonenumbers.Phonemetadata.PhoneMetadata > map = new java.util.concurrent.ConcurrentHashMap < java.lang.Integer , com.google.i18n.phonenumbers.Phonemetadata.PhoneMetadata > ( ) ; com.google.i18n.phonenumbers.Phonemetadata.PhoneMetadata metadata = com.google.i18n.phonenumbers.MultiFileMetadataSourceImpl.loadMetadataFromFile ( 800 , map , "/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProtoForTesting" , PhoneNumberUtil.DEFAULT_METADATA_LOADER ) ; assertEquals ( metadata , map.get ( 800 ) ) ; }

Target:
public void testNonGeoPhoneNumberMetadataLoadCorrectly ( ) { com.google.i18n.phonenumbers.Phonemetadata.PhoneMetadata intlMetadata = com.google.i18n.phonenumbers.MultiFileMetadataSourceImplTest.SOURCE.getMetadataForNonGeographicalRegion ( 800 ) ; assertEquals ( intlMetadata.getId ( ) , "001" ) ; assertTrue ( intlMetadata.hasGeneralDesc ( ) ) ; }
Source:
public void testAesCbcHmacSha1Tcp4 ( ) throws java.lang.Exception { android.net.IpSecAlgorithm crypt = new android.net.IpSecAlgorithm ( android.net.IpSecAlgorithm.CRYPT_AES_CBC , android.net.cts.IpSecManagerTest.CRYPT_KEY ) ; android.net.IpSecAlgorithm auth = new android.net.IpSecAlgorithm ( android.net.IpSecAlgorithm.AUTH_HMAC_SHA1 , getAuthKey ( 256 ) , 128 ) ; checkTransform ( android.system.OsConstants.IPPROTO_TCP , android.net.cts.IpSecManagerTest.IPV4_LOOPBACK , crypt , auth ) ; }

Target:
public void testAesCbcHmacSha1Tcp4 ( ) throws java.lang.Exception { android.net.IpSecAlgorithm crypt = new android.net.IpSecAlgorithm ( android.net.IpSecAlgorithm.CRYPT_AES_CBC , android.net.cts.IpSecManagerTest.CRYPT_KEY ) ; android.net.IpSecAlgorithm auth = new android.net.IpSecAlgorithm ( android.net.IpSecAlgorithm.AUTH_HMAC_SHA1 , getAuthKey ( 160 ) , 96 ) ; checkTransform ( android.system.OsConstants.IPPROTO_TCP , android.net.cts.IpSecManagerTest.IPV4_LOOPBACK , crypt , auth , false , 1 , false ) ; checkTransform ( android.system.OsConstants.IPPROTO_TCP , android.net.cts.IpSecManagerTest.IPV4_LOOPBACK , crypt , auth , false , 1 , true ) ; }
Source:
public com.android.sched.reflections.ReflectionManager getReflectionManager ( @ javax.annotation.Nonnull com.android.sched.reflections.ReflectionManager primary ) { if ( ( getPlugins ( ) . size ( ) ) == 0 ) { return primary ; } else { com.android.sched.reflections.CompositeReflectionManager composite = new com.android.sched.reflections.CompositeReflectionManager ( ) ; composite.addReflectionManager ( primary ) ; for ( com.android.jack.plugin.Plugin plugin : getPlugins ( ) ) { composite.addReflectionManager ( plugin.getReflectionManager ( ) ) ; } return composite ; } }

Target:
public com.android.sched.reflections.ReflectionManager getReflectionManager ( @ javax.annotation.Nonnull com.android.sched.reflections.ReflectionManager primary ) { if ( ( getPlugins ( ) . size ( ) ) == 0 ) { return primary ; } else { com.android.sched.reflections.CompositeReflectionManager composite = new com.android.sched.reflections.CompositeReflectionManager ( ) ; composite.addReflectionManager ( primary ) ; for ( com.android.jack.plugin.v01.Plugin plugin : getPlugins ( ) ) { composite.addReflectionManager ( plugin.getReflectionManager ( ) ) ; } return composite ; } }
Source:
private void incCallbackHandlerRefCount ( ) { synchronized ( android.net.ConnectivityManager.sCallbackRefCount ) { if ( ( android.net.ConnectivityManager.sCallbackRefCount.incrementAndGet ( ) ) == 1 ) { android.os.HandlerThread callbackThread = new android.os.HandlerThread ( "ConnectivityManager" ) ; callbackThread.start ( ) ; android.net.ConnectivityManager.sCallbackHandler = new android.net.ConnectivityManager.CallbackHandler ( callbackThread.getLooper ( ) ) ; } } }

Target:
private android.net.ConnectivityManager.CallbackHandler getHandler ( ) { synchronized ( android.net.ConnectivityManager.sCallbacks ) { if ( ( android.net.ConnectivityManager.sCallbackHandler ) == null ) { android.net.ConnectivityManager.sCallbackHandler = new android.net.ConnectivityManager.CallbackHandler ( android.net.ConnectivityThread.getInstanceLooper ( ) ) ; } return android.net.ConnectivityManager.sCallbackHandler ; } }
Source:
public com.android.build.gradle.tasks.ZipAlign createZipAlignTask ( @ com.android.annotations.NonNull java.lang.String taskName , @ com.android.annotations.NonNull java.io.File inputFile , @ com.android.annotations.NonNull java.io.File outputFile ) { if ( ( zipAlignTask ) != null ) { throw new java.lang.RuntimeException ( java.lang.String.format ( "ZipAlign task for variant '%s' already exists." , variantData.getName ( ) ) ) ; } zipAlignTask = variantData.basePlugin.createZipAlignTask ( taskName , inputFile , outputFile ) ; assembleTask.dependsOn ( zipAlignTask ) ; return zipAlignTask ; }

Target:
public com.android.build.gradle.tasks.ZipAlign createZipAlignTask ( @ com.android.annotations.NonNull java.lang.String taskName , @ com.android.annotations.NonNull java.io.File inputFile , @ com.android.annotations.NonNull java.io.File outputFile ) { if ( ( zipAlignTask ) != null ) { throw new java.lang.RuntimeException ( java.lang.String.format ( "ZipAlign task for variant '%s' already exists." , variantData.getName ( ) ) ) ; } zipAlignTask = variantData.basePlugin.getTaskManager ( ) . createZipAlignTask ( taskName , inputFile , outputFile ) ; assembleTask.dependsOn ( zipAlignTask ) ; return zipAlignTask ; }
Source:
public void actionPerformed ( java.awt.event.ActionEvent e ) { reloadClassFilters ( ) ; com.intellij.ide.util.ClassFilter classFilter = createClassConditionFilter ( ) ; com.intellij.debugger.ui.breakpoints.EditClassFiltersDialog _dialog = new com.intellij.debugger.ui.breakpoints.EditClassFiltersDialog ( myProject , classFilter ) ; _dialog.setFilters ( myClassFilters , myClassExclusionFilters ) ; _dialog.show ( ) ; if ( ( _dialog.getExitCode ( ) ) == ( com.intellij.openapi.ui.DialogWrapper.OK_EXIT_CODE ) ) { myClassFilters = _dialog.getFilters ( ) ; myClassExclusionFilters = _dialog.getExclusionFilters ( ) ; updateClassFilterEditor ( true ) ; } }

Target:
public void actionPerformed ( java.awt.event.ActionEvent e ) { updateCheckboxes ( ) ; }
Source:
public static org.hamcrest.Matcher < android.view.View > isClosed ( ) { return new android.support.test.espresso.matcher.BoundedMatcher < android.view.View , android.support.v4.widget.DrawerLayout > ( android.support.v4.widget.DrawerLayout.class ) { @ java.lang.Override public void describeTo ( org.hamcrest.Description description ) { description.appendText ( "is drawer closed" ) ; } @ java.lang.Override public boolean matchesSafely ( android.support.v4.widget.DrawerLayout drawer ) { return ! ( drawer.isDrawerVisible ( GravityCompat.START ) ) ; } } ; }

Target:
public static org.hamcrest.Matcher < android.view.View > isClosed ( final int gravity ) { return new android.support.test.espresso.matcher.BoundedMatcher < android.view.View , android.support.v4.widget.DrawerLayout > ( android.support.v4.widget.DrawerLayout.class ) { @ java.lang.Override public void describeTo ( org.hamcrest.Description description ) { description.appendText ( "is drawer closed" ) ; } @ java.lang.Override public boolean matchesSafely ( android.support.v4.widget.DrawerLayout drawer ) { return ! ( drawer.isDrawerVisible ( gravity ) ) ; } } ; }
Source:
public void testNonfullscreenAppOrientationRequests ( ) throws java.lang.Exception { java.lang.String logSeparator = clearLogcat ( ) ; launchActivity ( android.server.cts.ActivityManagerAppConfigurationTests.PORTRAIT_ACTIVITY_NAME ) ; final android.server.cts.ReportedSizes initialReportedSizes = getLastReportedSizesForActivity ( android.server.cts.ActivityManagerAppConfigurationTests.PORTRAIT_ACTIVITY_NAME , logSeparator ) ; assertEquals ( "portrait activity should be in portrait" , 1 , initialReportedSizes.orientation ) ; logSeparator = clearLogcat ( ) ; launchActivityInComponent ( android.server.cts.ActivityManagerAppConfigurationTests.TRANSLUCENT_CURRENT_PACKAGE , android.server.cts.ActivityManagerAppConfigurationTests.TRANSLUCENT_ACTIVITY ) ; assertEquals ( "non-fullscreen activity requested landscape orientation" , 0 , mAmWmState.getWmState ( ) . getLastOrientation ( ) ) ; }

Target:
public void testNonfullscreenAppOrientationRequests ( ) throws java.lang.Exception { java.lang.String logSeparator = clearLogcat ( ) ; launchActivity ( android.server.cts.ActivityManagerAppConfigurationTests.PORTRAIT_ACTIVITY_NAME ) ; final android.server.cts.ReportedSizes initialReportedSizes = getLastReportedSizesForActivity ( android.server.cts.ActivityManagerAppConfigurationTests.PORTRAIT_ACTIVITY_NAME , logSeparator ) ; assertEquals ( "portrait activity should be in portrait" , 1 , initialReportedSizes.orientation ) ; logSeparator = clearLogcat ( ) ; launchActivityInComponent ( android.server.cts.ActivityManagerAppConfigurationTests.TRANSLUCENT_SDK_26_PACKAGE , android.server.cts.ActivityManagerAppConfigurationTests.TRANSLUCENT_ACTIVITY ) ; assertEquals ( "Legacy non-fullscreen activity requested landscape orientation" , 0 , mAmWmState.getWmState ( ) . getLastOrientation ( ) ) ; }
Source:
public void eraseSubscriptions ( android.app.PendingIntent callbackIntent ) { if ( ! ( isEnabled ( ) ) ) { android.telephony.euicc.EuiccManager.sendUnavailableError ( callbackIntent ) ; return ; } try { android.telephony.euicc.EuiccManager.getIEuiccController ( ) . eraseSubscriptions ( callbackIntent ) ; } catch ( android.os.RemoteException e ) { throw e.rethrowFromSystemServer ( ) ; } }

Target:
public void retainSubscriptionsForFactoryReset ( android.app.PendingIntent callbackIntent ) { if ( ! ( isEnabled ( ) ) ) { android.telephony.euicc.EuiccManager.sendUnavailableError ( callbackIntent ) ; return ; } try { getIEuiccController ( ) . retainSubscriptionsForFactoryReset ( callbackIntent ) ; } catch ( android.os.RemoteException e ) { throw e.rethrowFromSystemServer ( ) ; } }
Source:
public boolean isMatchFor ( com.android.ide.eclipse.adt.internal.resources.configurations.ResourceQualifier qualifier ) { if ( qualifier instanceof com.android.ide.eclipse.adt.internal.resources.configurations.KeyboardStateQualifier ) { com.android.ide.eclipse.adt.internal.resources.configurations.KeyboardStateQualifier referenceQualifier = ( ( com.android.ide.eclipse.adt.internal.resources.configurations.KeyboardStateQualifier ) ( qualifier ) ) ; if ( ( ( referenceQualifier.mValue ) == ( com.android.ide.eclipse.adt.internal.resources.configurations.KeyboardStateQualifier.KeyboardState.SOFT ) ) && ( ( mValue ) == ( com.android.ide.eclipse.adt.internal.resources.configurations.KeyboardStateQualifier.KeyboardState.EXPOSED ) ) ) { return true ; } return ( referenceQualifier.mValue ) == ( mValue ) ; } return false ; }

Target:
public boolean isMatchFor ( com.android.ide.eclipse.adt.internal.resources.configurations.ResourceQualifier qualifier ) { if ( qualifier instanceof com.android.ide.eclipse.adt.internal.resources.configurations.KeyboardStateQualifier ) { com.android.ide.eclipse.adt.internal.resources.configurations.KeyboardStateQualifier referenceQualifier = ( ( com.android.ide.eclipse.adt.internal.resources.configurations.KeyboardStateQualifier ) ( qualifier ) ) ; if ( ( ( referenceQualifier.mValue ) == ( com.android.sdklib.resources.KeyboardState.SOFT ) ) && ( ( mValue ) == ( com.android.sdklib.resources.KeyboardState.EXPOSED ) ) ) { return true ; } return ( referenceQualifier.mValue ) == ( mValue ) ; } return false ; }
Source:
public void setPackageStoppedState ( java.lang.String packageName , boolean stopped , int userId ) { if ( ! ( com.android.server.pm.PackageManagerService.sUserManager.exists ( userId ) ) ) return ; final int uid = android.os.Binder.getCallingUid ( ) ; final int permission = mContext.checkCallingOrSelfPermission ( android.Manifest.permission.CHANGE_COMPONENT_ENABLED_STATE ) ; final boolean allowedByPermission = permission == ( android.content.pm.PackageManager.PERMISSION_GRANTED ) ; checkValidCaller ( uid , userId ) ; synchronized ( mPackages ) { if ( mSettings.setPackageStoppedStateLPw ( packageName , stopped , allowedByPermission , uid , userId ) ) { scheduleWritePackageRestrictionsLocked ( userId ) ; } } }

Target:
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 ) ; }
Source:
private boolean areAllApplicationsReady ( ) { for ( com.android.internal.telephony.uicc.UiccCardApplication app : mUiccApplications ) { if ( ( ( app != null ) && ( isSupportedApplication ( app ) ) ) && ( ! ( app.isReady ( ) ) ) ) { if ( com.android.internal.telephony.uicc.UiccProfile.VDBG ) log ( "areAllApplicationsReady: return false" ) ; return false ; } } if ( com.android.internal.telephony.uicc.UiccProfile.VDBG ) { log ( ( "areAllApplicationsReady: outside loop, return " + ( ( mUiccApplications [ 0 ] ) != null ) ) ) ; } return ( mUiccApplications [ 0 ] ) != null ; }

Target:
private boolean areAllApplicationsReady ( ) { for ( com.android.internal.telephony.uicc.UiccCardApplication app : mUiccApplications ) { if ( ( ( app != null ) && ( isSupportedApplication ( app ) ) ) && ( ! ( app.isReady ( ) ) ) ) { if ( com.android.internal.telephony.uicc.UiccProfile.VDBG ) com.android.internal.telephony.uicc.UiccProfile.log ( "areAllApplicationsReady: return false" ) ; return false ; } } if ( com.android.internal.telephony.uicc.UiccProfile.VDBG ) { com.android.internal.telephony.uicc.UiccProfile.log ( ( "areAllApplicationsReady: outside loop, return " + ( ( mUiccApplication ) != null ) ) ) ; } return ( mUiccApplication ) != null ; }
Source:
public void initializeNdkConfig ( @ org.gradle.model.Path ( value = "android.ndk" ) com.android.build.gradle.managed.NdkConfig ndk ) { ndk.setModuleName ( "" ) ; ndk.setToolchain ( "" ) ; ndk.setToolchainVersion ( "" ) ; ndk.setCFlags ( com.google.common.collect.Lists.< java.lang.String > newArrayList ( ) ) ; ndk.setCppFlags ( com.google.common.collect.Lists.< java.lang.String > newArrayList ( ) ) ; ndk.setLdLibs ( com.google.common.collect.Lists.< java.lang.String > newArrayList ( ) ) ; ndk.setAbiFilters ( com.google.common.collect.Sets.< java.lang.String > newHashSet ( ) ) ; ndk.setStl ( "" ) ; ndk.setRenderscriptNdkMode ( false ) ; }

Target:
public void initializeNdkConfig ( @ org.gradle.model.Path ( value = "android.ndk" ) com.android.build.gradle.managed.NdkConfig ndk ) { com.android.build.gradle.internal.NdkOptionsHelper.init ( ndk ) ; ndk.setModuleName ( "" ) ; ndk.setToolchain ( "" ) ; ndk.setToolchainVersion ( "" ) ; ndk.setStl ( "" ) ; ndk.setRenderscriptNdkMode ( false ) ; }
Source:
public void run ( ) { try { rq.wait ( 1000 ) ; } catch ( java.lang.Exception e ) { } synchronized ( rq ) { org.apache.harmony.tests.java.lang.ref.ReferenceQueueTest.integer = new java.lang.Integer ( 667 ) ; java.lang.ref.SoftReference sr = new java.lang.ref.SoftReference ( org.apache.harmony.tests.java.lang.ref.ReferenceQueueTest.integer , rq ) ; sr.enqueue ( ) ; rq.notify ( ) ; } }

Target:
public void run ( ) { try { java.lang.Thread.sleep ( 100 ) ; } catch ( java.lang.Exception e ) { } org.apache.harmony.tests.java.lang.ref.ReferenceQueueTest.integer = new java.lang.Integer ( 667 ) ; java.lang.ref.SoftReference sr = new java.lang.ref.SoftReference ( org.apache.harmony.tests.java.lang.ref.ReferenceQueueTest.integer , rq ) ; sr.enqueue ( ) ; }
Source:
public static int forkAndSpecialize ( int uid , int gid , int [ ] gids , int debugFlags , int [ ] [ ] rlimits , int mountExternal , java.lang.String seInfo , java.lang.String niceName ) { dalvik.system.Zygote.preFork ( ) ; int pid = dalvik.system.Zygote.nativeForkAndSpecialize ( uid , gid , gids , debugFlags , rlimits , mountExternal , seInfo , niceName ) ; dalvik.system.Zygote.postFork ( ) ; return pid ; }

Target:
public static native int nativeForkAndSpecialize ( int uid , int gid , int [ ] gids , int debugFlags , int [ ] [ ] rlimits , int mountExternal , java.lang.String seInfo , java.lang.String niceName , int [ ] fdsToClose ) ;
Source:
synchronized void nAllocationData2D ( int id , int xoff , int yoff , int mip , int face , int w , int h , int [ ] d , int sizeBytes ) { validate ( ) ; rsnAllocationData2D ( mContext , id , xoff , yoff , mip , face , w , h , d , sizeBytes ) ; }

Target:
synchronized void nAllocationData2D ( int id , int xoff , int yoff , int mip , int face , int w , int h , java.lang.Object d , int sizeBytes , android.renderscript.Element.DataType dt ) { validate ( ) ; rsnAllocationData2D ( mContext , id , xoff , yoff , mip , face , w , h , d , sizeBytes , dt.mID ) ; }
Source:
public static java.lang.String toLocaterStringForm ( org.eclipse.jdt.core.dom.BodyDeclaration bodyDeclaration ) { return ( ( com.google.currysrc.api.transform.ast.BodyDeclarationLocaters.getDeclarationTypeString ( bodyDeclaration ) ) + ":" ) + ( com.google.currysrc.api.transform.ast.BodyDeclarationLocaters.createName ( bodyDeclaration ) ) ; }

Target:
public static java.util.List < java.lang.String > toLocaterStringForms ( org.eclipse.jdt.core.dom.BodyDeclaration bodyDeclaration ) { java.util.List < com.google.currysrc.api.transform.ast.BodyDeclarationLocater > locaters = com.google.currysrc.api.transform.ast.BodyDeclarationLocaters.createLocaters ( bodyDeclaration ) ; java.util.List < java.lang.String > stringForms = new java.util.ArrayList ( locaters.size ( ) ) ; for ( com.google.currysrc.api.transform.ast.BodyDeclarationLocater locater : locaters ) { stringForms.add ( ( ( ( locater.getStringFormType ( ) ) + ":" ) + ( locater.getStringFormTarget ( ) ) ) ) ; } return stringForms ; }
Source:
public android.net.wifi.WifiConfiguration getMatchingWifiConfig ( android.net.wifi.ScanResult scanResult ) { if ( scanResult == null ) { return null ; } android.util.Pair < com.android.server.wifi.hotspot2.PasspointProvider , com.android.server.wifi.hotspot2.PasspointMatch > matchedProvider = matchProvider ( scanResult ) ; if ( matchedProvider == null ) { return null ; } android.net.wifi.WifiConfiguration config = matchedProvider.first.getWifiConfig ( ) ; config.SSID = com.android.server.wifi.util.ScanResultUtil.createQuotedSSID ( scanResult.SSID ) ; return config ; }

Target:
public android.net.wifi.WifiConfiguration getMatchingWifiConfig ( android.net.wifi.ScanResult scanResult ) { if ( scanResult == null ) { android.util.Log.e ( com.android.server.wifi.hotspot2.PasspointManager.TAG , "Attempt to get matching config for a null ScanResult" ) ; return null ; } android.util.Pair < com.android.server.wifi.hotspot2.PasspointProvider , com.android.server.wifi.hotspot2.PasspointMatch > matchedProvider = matchProvider ( scanResult ) ; if ( matchedProvider == null ) { return null ; } android.net.wifi.WifiConfiguration config = matchedProvider.first.getWifiConfig ( ) ; config.SSID = com.android.server.wifi.util.ScanResultUtil.createQuotedSSID ( scanResult.SSID ) ; return config ; }
Source:
public static void pullFromHost ( java.io.File src , java.io.File dest ) { try { com.android.tradefed.util.FileUtil.recursiveCopy ( src , dest ) ; com.android.tradefed.util.FileUtil.recursiveDelete ( src ) ; } catch ( java.io.IOException e ) { com.android.tradefed.log.LogUtil.CLog.e ( "Caught exception during pull." ) ; com.android.tradefed.log.LogUtil.CLog.e ( e ) ; } }

Target:
public static void pullFromHost ( java.io.File src , java.io.File dest ) { try { if ( ( src.listFiles ( ) ) != null ) { com.android.tradefed.util.FileUtil.recursiveCopy ( src , dest ) ; } com.android.tradefed.util.FileUtil.recursiveDelete ( src ) ; } catch ( java.io.IOException e ) { com.android.tradefed.log.LogUtil.CLog.e ( "Caught exception during pull." ) ; com.android.tradefed.log.LogUtil.CLog.e ( e ) ; } }
Source:
public void testBadTruncatedOffer ( ) throws java.lang.Exception { final byte [ ] packet = com.android.internal.util.HexDump.hexStringToByteArray ( ( "450001518d0600004011144dc0a82b01c0a82bf7" + ( ( ( ( ( ( ( ( "00430044013d9ac7" + "02010600dfc23d1f0002000000000000c0a82bf7c0a82b0100000000" ) + "30766ff2a90c00000000000000000000" ) + "0000000000000000000000000000000000000000000000000000000000000000" ) + "0000000000000000000000000000000000000000000000000000000000000000" ) + "0000000000000000000000000000000000000000000000000000000000000000" ) + "0000000000000000000000000000000000000000000000000000000000000000" ) + "0000000000000000000000000000000000000000000000000000000000000000" ) + "00000000000000000000000000000000000000000000000000000000000000" ) ) ) ; try { android.net.dhcp.DhcpPacket.DhcpPacket offerPacket = android.net.dhcp.DhcpPacket.DhcpPacket.decodeFullPacket ( packet , packet.length , android.net.dhcp.ENCAP_L3 ) ; } catch ( android.net.dhcp.DhcpPacket.DhcpPacket expected ) { assertDhcpErrorCodes ( DhcpErrorEvent.L3_TOO_SHORT , expected.errorCode ) ; return ; } fail ( "Dhcp packet parsing should have failed" ) ; }

Target:
public void testBadTruncatedOffer ( ) throws java.lang.Exception { final byte [ ] packet = com.android.internal.util.HexDump.hexStringToByteArray ( ( "450001518d0600004011144dc0a82b01c0a82bf7" + ( ( ( ( ( ( ( ( "00430044013d9ac7" + "02010600dfc23d1f0002000000000000c0a82bf7c0a82b0100000000" ) + "30766ff2a90c00000000000000000000" ) + "0000000000000000000000000000000000000000000000000000000000000000" ) + "0000000000000000000000000000000000000000000000000000000000000000" ) + "0000000000000000000000000000000000000000000000000000000000000000" ) + "0000000000000000000000000000000000000000000000000000000000000000" ) + "0000000000000000000000000000000000000000000000000000000000000000" ) + "00000000000000000000000000000000000000000000000000000000000000" ) ) ) ; try { android.net.dhcp.DhcpPacket.DhcpPacket offerPacket = android.net.dhcp.DhcpPacket.DhcpPacket.decodeFullPacket ( packet , packet.length , android.net.dhcp.ENCAP_L3 ) ; } catch ( android.net.dhcp.DhcpPacket.DhcpPacket expected ) { assertDhcpErrorCodes ( DhcpErrorEvent.L3_TOO_SHORT , expected.errorCode ) ; return ; } org.junit.Assert.fail ( "Dhcp packet parsing should have failed" ) ; }
Source:
public void enter ( ) { mPhone.mCi.registerForRilConnected ( getHandler ( ) , DataConnection.EVENT_RIL_CONNECTED , null ) ; mPhone.mCi.registerForDataCallListChanged ( getHandler ( ) , DataConnection.EVENT_DATA_STATE_CHANGED , null ) ; if ( android.os.Build.IS_DEBUGGABLE ) { mDcTesterDeactivateAll = new com.android.internal.telephony.dataconnection.DcTesterDeactivateAll ( mPhone , this , getHandler ( ) ) ; } if ( ( mNetworkPolicyManager ) != null ) { mNetworkPolicyManager.registerListener ( mListener ) ; } }

Target:
public void exit ( ) { if ( ( ( mPhone ) != null ) & ( ( mDataServiceManager.getTransportType ( ) ) == ( android.telephony.AccessNetworkConstants.TransportType.WWAN ) ) ) { mPhone.mCi.unregisterForRilConnected ( getHandler ( ) ) ; } mDataServiceManager.unregisterForDataCallListChanged ( getHandler ( ) ) ; if ( ( mDcTesterDeactivateAll ) != null ) { mDcTesterDeactivateAll.dispose ( ) ; } if ( ( mNetworkPolicyManager ) != null ) { mNetworkPolicyManager.unregisterListener ( mListener ) ; } }
Source:
private java.util.List < android.content.pm.ResolveInfo > doQueryIntentServices ( android.content.Intent intent , int flags ) { java.util.List < android.content.pm.ResolveInfo > result = new java.util.ArrayList < > ( ) ; for ( android.content.ComponentName componentName : mComponentNamesByAction.get ( intent.getAction ( ) ) ) { android.content.pm.ResolveInfo resolveInfo = new android.content.pm.ResolveInfo ( ) ; resolveInfo.serviceInfo = mServiceInfoByComponentName.get ( componentName ) ; result.add ( resolveInfo ) ; } return result ; }

Target:
private java.util.List < android.content.pm.ResolveInfo > doQueryIntentServices ( android.content.Intent intent , int flags ) { java.util.List < android.content.pm.ResolveInfo > result = new java.util.ArrayList < > ( ) ; for ( android.content.ComponentName componentName : mComponentNamesByAction.get ( intent.getAction ( ) ) ) { android.content.pm.ResolveInfo resolveInfo = new android.content.pm.ResolveInfo ( ) ; resolveInfo.serviceInfo = mServiceInfoByComponentName.get ( componentName ) ; resolveInfo.serviceInfo.metaData = new android.os.Bundle ( ) ; resolveInfo.serviceInfo.metaData.putBoolean ( TelecomManager.METADATA_INCLUDE_EXTERNAL_CALLS , true ) ; result.add ( resolveInfo ) ; } return result ; }
Source:
public static long copy ( java.io.InputStream from , java.io.OutputStream to ) throws java.io.IOException { byte [ ] buf = new byte [ com.google.common.io.ByteStreams.BUF_SIZE ] ; long total = 0 ; while ( true ) { int r = from.read ( buf ) ; if ( r == ( - 1 ) ) { break ; } to.write ( buf , 0 , r ) ; total += r ; } return total ; }

Target:
public static long copy ( java.io.InputStream from , java.io.OutputStream to ) throws java.io.IOException { com.google.common.base.Preconditions.checkNotNull ( from ) ; com.google.common.base.Preconditions.checkNotNull ( to ) ; byte [ ] buf = new byte [ com.google.common.io.ByteStreams.BUF_SIZE ] ; long total = 0 ; while ( true ) { int r = from.read ( buf ) ; if ( r == ( - 1 ) ) { break ; } to.write ( buf , 0 , r ) ; total += r ; } return total ; }