auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testGetOptionNames ( ) throws java.lang.Exception { java.util.Set < java.lang.String > optionNames = com.android.compatibility.common.tradefed.util.OptionHelper.getOptionNames ( this ) ; java.util.List < java.lang.String > expectedNames = java.util.Arrays.asList ( com.android.compatibility.common.tradefed.util.OptionHelperTest.TEST_CLASS , com.android.compatibility.common.tradefed.util.OptionHelperTest.TEST_NAME , com.android.compatibility.common.tradefed.util.OptionHelperTest.TEST_SUITE ) ; assertEquals ( "Missing option names" , true , optionNames.containsAll ( expectedNames ) ) ; assertEquals ( "Expected four elements" , 4 , optionNames.size ( ) ) ; }

Target:
public void testGetOptionNames ( ) throws java.lang.Exception { java.util.Set < java.lang.String > optionNames = com.android.compatibility.common.tradefed.util.OptionHelper.getOptionNames ( this ) ; java.util.List < java.lang.String > expectedNames = java.util.Arrays.asList ( com.android.compatibility.common.tradefed.util.OptionHelperTest.TEST_CLASS , com.android.compatibility.common.tradefed.util.OptionHelperTest.TEST_NAME , com.android.compatibility.common.tradefed.util.OptionHelperTest.TEST_SUITE , com.android.compatibility.common.tradefed.util.OptionHelperTest.TEST_LOGPATH ) ; assertEquals ( "Missing option names" , true , optionNames.containsAll ( expectedNames ) ) ; assertEquals ( "Expected five elements" , 5 , optionNames.size ( ) ) ; }
Source:
public void close ( ) throws java.io.IOException { input.close ( ) ; try { cipher.doFinal ( ) ; } catch ( javax.crypto.BadPaddingException ex ) { } catch ( javax.crypto.IllegalBlockSizeException ex ) { } ostart = 0 ; ofinish = 0 ; }

Target:
public void close ( ) throws java.io.IOException { if ( closed ) { return ; } closed = true ; input.close ( ) ; if ( ! ( done ) ) { try { cipher.doFinal ( ) ; } catch ( javax.crypto.BadPaddingException | javax.crypto.IllegalBlockSizeException ex ) { } } ostart = 0 ; ofinish = 0 ; }
Source:
public void dependsOn ( final com.android.build.gradle.internal.TaskFactory taskFactory , final java.lang.Object ... other ) { taskFactory.named ( name , new org.gradle.api.Action < org.gradle.api.Task > ( ) { @ java.lang.Override public void execute ( org.gradle.api.Task task ) { task.dependsOn ( other ) ; } } ) ; }

Target:
public void dependsOn ( final com.android.build.gradle.internal.TaskFactory taskFactory , final java.lang.Object ... dependencies ) { taskFactory.named ( name , new org.gradle.api.Action < org.gradle.api.Task > ( ) { @ java.lang.Override public void execute ( org.gradle.api.Task task ) { for ( java.lang.Object dependency : dependencies ) { if ( dependency instanceof com.android.build.gradle.internal.scope.AndroidTask ) { task.dependsOn ( ( ( com.android.build.gradle.internal.scope.AndroidTask ) ( dependency ) ) . getName ( ) ) ; } else { task.dependsOn ( dependency ) ; } } } } ) ; }
Source:
public void test10089890 ( ) throws java.lang.Exception { java.util.Locale l = java.util.Locale.US ; java.util.TimeZone utc = java.util.TimeZone.getTimeZone ( "UTC" ) ; java.util.TimeZone pacific = java.util.TimeZone.getTimeZone ( "America/Los_Angeles" ) ; int flags = ( ( ( FORMAT_SHOW_DATE ) | ( FORMAT_ABBREV_ALL ) ) | ( FORMAT_SHOW_TIME ) ) | ( FORMAT_24HOUR ) ; assertEquals ( "Jan 1, 1970, 00:00 – Jan 2, 1970, 00:00" , formatDateRange ( l , utc , 0 , ( ( libcore.icu.DateIntervalFormatTest.DAY ) + 1 ) , flags ) ) ; assertEquals ( "Dec 31, 1969, 16:00 – Jan 1, 1970, 16:00" , formatDateRange ( l , pacific , 0 , libcore.icu.DateIntervalFormatTest.DAY , flags ) ) ; }

Target:
public void test10089890 ( ) throws java.lang.Exception { android.icu.util.ULocale l = android.icu.util.ULocale.US ; android.icu.util.TimeZone utc = android.icu.util.TimeZone.getTimeZone ( "UTC" ) ; android.icu.util.TimeZone pacific = android.icu.util.TimeZone.getTimeZone ( "America/Los_Angeles" ) ; int flags = ( ( ( FORMAT_SHOW_DATE ) | ( FORMAT_ABBREV_ALL ) ) | ( FORMAT_SHOW_TIME ) ) | ( FORMAT_24HOUR ) ; assertEquals ( "Jan 1, 1970, 00:00 – Jan 2, 1970, 00:00" , formatDateRange ( l , utc , 0 , ( ( libcore.icu.DateIntervalFormatTest.DAY ) + 1 ) , flags ) ) ; assertEquals ( "Dec 31, 1969, 16:00 – Jan 1, 1970, 16:00" , formatDateRange ( l , pacific , 0 , libcore.icu.DateIntervalFormatTest.DAY , flags ) ) ; }
Source:
public java.lang.String toString ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( "DnsEvent(" ) . append ( netId ) . append ( ", " ) ; for ( int t : com.android.internal.util.BitUtils.unpackBits ( transports ) ) { builder.append ( android.net.NetworkCapabilities.transportNameOf ( t ) ) . append ( ", " ) ; } builder.append ( java.lang.String.format ( "%d events, " , eventCount ) ) ; builder.append ( java.lang.String.format ( "%d success)" , successCount ) ) ; return builder.toString ( ) ; }

Target:
public java.lang.String toString ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( "DnsEvent(" ) . append ( "netId=" ) . append ( netId ) . append ( ", " ) ; for ( int t : com.android.internal.util.BitUtils.unpackBits ( transports ) ) { builder.append ( android.net.NetworkCapabilities.transportNameOf ( t ) ) . append ( ", " ) ; } builder.append ( java.lang.String.format ( "%d events, " , eventCount ) ) ; builder.append ( java.lang.String.format ( "%d success)" , successCount ) ) ; return builder.toString ( ) ; }
Source:
void copy2DRangeFromUnchecked ( int xoff , int yoff , int w , int h , float [ ] data ) { android.os.Trace.traceBegin ( RenderScript.TRACE_TAG , "copy2DRangeFromUnchecked" ) ; mRS.validate ( ) ; validate2DRange ( xoff , yoff , w , h ) ; mRS.nAllocationData2D ( getIDSafe ( ) , xoff , yoff , mSelectedLOD , mSelectedFace.mID , w , h , data , ( ( data.length ) * 4 ) , Element.DataType.FLOAT_32 ) ; android.os.Trace.traceEnd ( RenderScript.TRACE_TAG ) ; }

Target:
public void copy2DRangeFrom ( int xoff , int yoff , int w , int h , short [ ] data ) { validateIsInt16 ( ) ; copy2DRangeFromUnchecked ( xoff , yoff , w , h , data , Element.DataType.SIGNED_16 , data.length ) ; }
Source:
public void test001_2 ( ) throws java.lang.Exception { com.android.jack.test.toolchain.IToolchain toolchain = com.android.jack.test.toolchain.AbstractTestTools.getCandidateToolchain ( ) ; toolchain.srcToExe ( com.android.jack.test.toolchain.AbstractTestTools.getClasspathAsString ( toolchain.getDefaultBootClasspath ( ) ) , com.android.jack.test.toolchain.AbstractTestTools.createTempDir ( ) , false , new java.io.File [ ] { new java.io.File ( com.android.jack.annotation.AnnotationTests.ANNOTATION001_PATH , "Annotation8.java" ) , new java.io.File ( com.android.jack.annotation.AnnotationTests.ANNOTATION001_PATH , "Annotated2.java" ) } ) ; }

Target:
public void test001_2 ( ) throws java.lang.Exception { com.android.jack.test.toolchain.IToolchain toolchain = com.android.jack.test.toolchain.AbstractTestTools.getCandidateToolchain ( ) ; toolchain.addToClasspath ( toolchain.getDefaultBootClasspath ( ) ) . srcToExe ( com.android.jack.test.toolchain.AbstractTestTools.createTempDir ( ) , false , new java.io.File [ ] { new java.io.File ( com.android.jack.annotation.AnnotationTests.ANNOTATION001_PATH , "Annotation8.java" ) , new java.io.File ( com.android.jack.annotation.AnnotationTests.ANNOTATION001_PATH , "Annotated2.java" ) } ) ; }
Source:
boolean isRespondViaSmsCapable ( ) { if ( ( mState ) != ( CallState.RINGING ) ) { return false ; } if ( ( getHandle ( ) ) == null ) { return false ; } if ( android.telephony.PhoneNumberUtils.isUriNumber ( getHandle ( ) . toString ( ) ) ) { return false ; } if ( ( com.android.internal.telephony.SmsApplication.getDefaultRespondViaMessageApplication ( mContext , true ) ) == null ) { return false ; } return true ; }

Target:
boolean isRespondViaSmsCapable ( ) { if ( ( mState ) != ( CallState.RINGING ) ) { return false ; } if ( ( getHandle ( ) ) == null ) { return false ; } if ( mPhoneNumberUtilsAdapter.isUriNumber ( getHandle ( ) . toString ( ) ) ) { return false ; } if ( ( com.android.internal.telephony.SmsApplication.getDefaultRespondViaMessageApplication ( mContext , true ) ) == null ) { return false ; } return true ; }
Source:
public void testInstallWithInvalidBundleVersionFile ( ) throws java.lang.Exception { java.io.File workingDir = new java.io.File ( testInstallDir , TzDataBundleInstaller.WORKING_DIR_NAME ) ; assertTrue ( workingDir.mkdir ( ) ) ; libcore.tzdata.update2.ConfigBundle tzData = createTzDataBundleWithInvalidBundleVersion ( libcore.tzdata.update2.TzDataBundleInstallerTest.NEW_RULES_VERSION ) ; assertFalse ( installer.install ( tzData.getBundleBytes ( ) ) ) ; assertNoContentInstalled ( ) ; }

Target:
public void testUninstall_noExistingDataBundle ( ) throws java.lang.Exception { assertFalse ( installer.uninstall ( ) ) ; assertNoContentInstalled ( ) ; }
Source:
public void testE3 ( ) { dot.junit.opcodes.aget_char.d.T_aget_char_1 t = new dot.junit.opcodes.aget_char.d.T_aget_char_1 ( ) ; char [ ] arr = new char [ 2 ] ; try { t.run ( arr , ( - 1 ) ) ; fail ( "expected ArrayIndexOutOfBoundsException" ) ; } catch ( java.lang.ArrayIndexOutOfBoundsException aie ) { } }

Target:
public void testE3 ( ) { loadAndRun ( "dot.junit.opcodes.aget_char.d.T_aget_char_1" , java.lang.ArrayIndexOutOfBoundsException.class , new char [ 2 ] , ( - 1 ) ) ; }
Source:
private void broadcastIdleTime ( android.bluetooth.BluetoothDevice device , int idleTime ) { android.content.Intent intent = new android.content.Intent ( android.bluetooth.BluetoothHidHost.ACTION_IDLE_TIME_CHANGED ) ; intent.putExtra ( BluetoothDevice.EXTRA_DEVICE , device ) ; intent.putExtra ( BluetoothHidHost.EXTRA_IDLE_TIME , idleTime ) ; intent.addFlags ( Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT ) ; sendBroadcast ( intent , com.android.bluetooth.hid.BLUETOOTH_PERM ) ; if ( com.android.bluetooth.hid.HidService.DBG ) { log ( ( ( ( "Idle time (" + device ) + "): " ) + idleTime ) ) ; } }

Target:
private void broadcastIdleTime ( android.bluetooth.BluetoothDevice device , int idleTime ) { android.content.Intent intent = new android.content.Intent ( android.bluetooth.BluetoothHidHost.ACTION_IDLE_TIME_CHANGED ) ; intent.putExtra ( BluetoothDevice.EXTRA_DEVICE , device ) ; intent.putExtra ( BluetoothHidHost.EXTRA_IDLE_TIME , idleTime ) ; intent.addFlags ( Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT ) ; sendBroadcast ( intent , com.android.bluetooth.hid.BLUETOOTH_PERM ) ; if ( com.android.bluetooth.hid.HidHostService.DBG ) { log ( ( ( ( "Idle time (" + device ) + "): " ) + idleTime ) ) ; } }
Source:
public void testLibsManifestMerging ( ) throws java.lang.Exception { java.io.File project = new java.io.File ( testDir , "libsTest" ) ; java.io.File fileOutput = new java.io.File ( project , ( ( "libapp/build/" + ( com.android.builder.model.AndroidProject.FD_INTERMEDIATES ) ) + "/bundles/release/AndroidManifest.xml" ) ) ; runGradleTasks ( sdkDir , ndkDir , BasePlugin.GRADLE_MIN_VERSION , project , java.util.Collections.< java.lang.String > emptyList ( ) , "clean" , "build" ) ; assertTrue ( fileOutput.exists ( ) ) ; }

Target:
public void testLibsManifestMerging ( ) throws java.lang.Exception { java.io.File project = new java.io.File ( testDir , "libsTest" ) ; java.io.File fileOutput = new java.io.File ( project , ( ( "libapp/build/" + ( com.android.builder.model.AndroidProject.FD_INTERMEDIATES ) ) + "/bundles/release/AndroidManifest.xml" ) ) ; runGradleTasks ( sdkDir , ndkDir , BasePlugin.GRADLE_TEST_VERSION , project , java.util.Collections.< java.lang.String > emptyList ( ) , "clean" , "build" ) ; assertTrue ( fileOutput.exists ( ) ) ; }
Source:
private static void startActivityMonitoring ( ) { com.intellij.concurrency.JobScheduler.getScheduler ( ) . scheduleAtFixedRate ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { long count = com.intellij.ide.SystemHealthMonitor.ourStudioActionCount.getAndSet ( 0 ) ; if ( count == 0 ) { return ; } com.intellij.internal.statistic.analytics.PlatformUsageTracker.trackActivity ( count ) ; if ( com.intellij.openapi.application.ApplicationManager.getApplication ( ) . isInternal ( ) ) { java.lang.System.out.printf ( "%d: Activity Tracker, usage in the last minute: %d\n" , ( ( java.lang.System.currentTimeMillis ( ) ) % 10000 ) , count ) ; } } } , com.intellij.ide.SystemHealthMonitor.INTERVAL_IN_MINUTES , com.intellij.ide.SystemHealthMonitor.INTERVAL_IN_MINUTES , java.util.concurrent.TimeUnit.MINUTES ) ; }

Target:
private static void startActivityMonitoring ( ) { com.intellij.concurrency.JobScheduler.getScheduler ( ) . scheduleAtFixedRate ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { long count = com.intellij.ide.SystemHealthMonitor.ourStudioActionCount.getAndSet ( 0 ) ; if ( count == 0 ) { return ; } com.intellij.internal.statistic.analytics.PlatformUsageTracker.trackActivity ( count ) ; if ( com.intellij.openapi.application.ApplicationManager.getApplication ( ) . isInternal ( ) ) { java.lang.System.out.printf ( "%d: Activity Tracker, usage in the last minute: %d\n" , ( ( java.lang.System.currentTimeMillis ( ) ) % 10000 ) , count ) ; } } } , com.intellij.ide.SystemHealthMonitor.INITIAL_DELAY_MINUTES , com.intellij.ide.SystemHealthMonitor.INTERVAL_IN_MINUTES , java.util.concurrent.TimeUnit.MINUTES ) ; }
Source:
private void notifyFeatureState ( @ android.telephony.ims.feature.ImsFeature.ImsState int state ) { if ( ( mStatusCallback ) != null ) { try { android.util.Log.i ( android.telephony.ims.feature.ImsFeature.LOG_TAG , "notifying ImsFeatureState" ) ; mStatusCallback.notifyImsFeatureStatus ( state ) ; } catch ( android.os.RemoteException e ) { mStatusCallback = null ; android.util.Log.w ( android.telephony.ims.feature.ImsFeature.LOG_TAG , ( "Couldn't notify feature state: " + ( e.getMessage ( ) ) ) ) ; } } sendImsServiceIntent ( state ) ; }

Target:
private void notifyFeatureState ( @ android.telephony.ims.feature.ImsFeature.ImsState int state ) { if ( ( mStatusCallback ) != null ) { try { android.util.Log.i ( android.telephony.ims.feature.ImsFeature.LOG_TAG , ( "notifying ImsFeatureState=" + state ) ) ; mStatusCallback.notifyImsFeatureStatus ( state ) ; } catch ( android.os.RemoteException e ) { mStatusCallback = null ; android.util.Log.w ( android.telephony.ims.feature.ImsFeature.LOG_TAG , ( "Couldn't notify feature state: " + ( e.getMessage ( ) ) ) ) ; } } sendImsServiceIntent ( state ) ; }
Source:
protected void onPause ( ) { super . onPause ( ) ; mLocalManager.setForegroundActivity ( null ) ; unregisterReceiver ( mReceiver ) ; mLocalManager.unregisterCallback ( this ) ; if ( ( mScreenType ) == ( com.android.settings.bluetooth.BluetoothSettings.SCREEN_TYPE_SETTINGS ) ) { mNamePreference.pause ( ) ; mDiscoverableEnabler.pause ( ) ; mEnabler.pause ( ) ; } }

Target:
protected void onPause ( ) { super . onPause ( ) ; mLocalManager.setForegroundActivity ( null ) ; mDevicePreferenceMap.clear ( ) ; mDeviceList.removeAll ( ) ; unregisterReceiver ( mReceiver ) ; mLocalManager.unregisterCallback ( this ) ; if ( ( mScreenType ) == ( com.android.settings.bluetooth.BluetoothSettings.SCREEN_TYPE_SETTINGS ) ) { mNamePreference.pause ( ) ; mDiscoverableEnabler.pause ( ) ; mEnabler.pause ( ) ; } }
Source:
private void scanExtras ( com.android.sdklib.SdkManager sdkManager , java.util.HashSet < java.io.File > visited , java.util.ArrayList < java.lang.Package > packages , com.android.utils.ILogger log ) { java.io.File root = new java.io.File ( sdkManager.getLocation ( ) , com.android.SdkConstants.FD_EXTRAS ) ; if ( ! ( root.isDirectory ( ) ) ) { return ; } for ( java.io.File vendor : root.listFiles ( ) ) { if ( vendor.isDirectory ( ) ) { scanExtrasDirectory ( vendor.getAbsolutePath ( ) , visited , packages , log ) ; } } }

Target:
private void scanExtras ( com.android.sdklib.SdkManager sdkManager , java.util.HashSet < java.io.File > visited , java.util.ArrayList < java.lang.Package > packages , com.android.utils.ILogger log ) { java.io.File root = new java.io.File ( sdkManager.getLocation ( ) , com.android.SdkConstants.FD_EXTRAS ) ; for ( java.io.File vendor : com.android.sdklib.internal.repository.LocalSdkParser.listFilesNonNull ( root ) ) { if ( vendor.isDirectory ( ) ) { scanExtrasDirectory ( vendor.getAbsolutePath ( ) , visited , packages , log ) ; } } }
Source:
void regularScanTimeout ( com.android.bluetooth.gatt.ScanClient client ) { if ( ( ! ( isExemptFromScanDowngrade ( client ) ) ) && ( client.stats.isScanningTooLong ( ) ) ) { android.util.Log.w ( com.android.bluetooth.gatt.ScanManager.TAG , ( ( "Moving scan client to opportunistic (scannerId " + ( client.scannerId ) ) + ")" ) ) ; setOpportunisticScanClient ( client ) ; removeScanFilters ( client.scannerId ) ; client.stats.setScanTimeout ( ) ; } configureRegularScanParams ( ) ; if ( ( numRegularScanClients ( ) ) == 0 ) { logd ( "stop scan" ) ; gattClientScanNative ( false ) ; } }

Target:
void regularScanTimeout ( com.android.bluetooth.gatt.ScanClient client ) { if ( ( ! ( isExemptFromScanDowngrade ( client ) ) ) && ( client.stats.isScanningTooLong ( ) ) ) { android.util.Log.w ( com.android.bluetooth.gatt.ScanManager.TAG , ( ( "Moving scan client to opportunistic (scannerId " + ( client.scannerId ) ) + ")" ) ) ; setOpportunisticScanClient ( client ) ; removeScanFilters ( client.scannerId ) ; client.stats.setScanTimeout ( ) ; } configureRegularScanParams ( ) ; if ( ( numRegularScanClients ( ) ) == 0 ) { if ( com.android.bluetooth.gatt.ScanManager.DBG ) android.util.Log.d ( com.android.bluetooth.gatt.ScanManager.TAG , "stop scan" ) ; gattClientScanNative ( false ) ; } }
Source:
public int getSimCarrierId ( ) { try { com.android.internal.telephony.ITelephony service = getITelephony ( ) ; if ( service != null ) { return service.getSubscriptionCarrierId ( getSubId ( ) ) ; } } catch ( android.os.RemoteException ex ) { ex.rethrowAsRuntimeException ( ) ; } return android.telephony.TelephonyManager.UNKNOWN_CARRIER_ID ; }

Target:
public java.lang.CharSequence getSimCarrierIdName ( ) { try { com.android.internal.telephony.ITelephony service = getITelephony ( ) ; if ( service != null ) { return service.getSubscriptionCarrierName ( getSubId ( ) ) ; } } catch ( android.os.RemoteException ex ) { } return null ; }
Source:
private android.net.wifi.ScanResult findMatchingScanResult ( java.util.List < android.net.wifi.ScanResult > scanResults , android.net.wifi.WifiConfiguration wifiConfiguration ) { java.lang.String ssid = android.net.wifi.WifiInfo.removeDoubleQuotes ( wifiConfiguration.SSID ) ; java.lang.String bssid = wifiConfiguration.BSSID ; for ( android.net.wifi.ScanResult scanResult : scanResults ) { if ( ( ssid.equals ( scanResult.SSID ) ) && ( bssid.equals ( scanResult.BSSID ) ) ) { return scanResult ; } } return null ; }

Target:
private android.net.wifi.ScanResult findMatchingScanResult ( java.util.List < android.net.wifi.ScanResult > scanResults , android.net.wifi.WifiConfiguration wifiConfiguration ) { java.lang.String ssid = com.android.networkrecommendation.WifiConfigurationUtil.removeDoubleQuotes ( wifiConfiguration ) ; java.lang.String bssid = wifiConfiguration.BSSID ; for ( android.net.wifi.ScanResult scanResult : scanResults ) { if ( ( ssid.equals ( scanResult.SSID ) ) && ( bssid.equals ( scanResult.BSSID ) ) ) { return scanResult ; } } return null ; }
Source:
protected java.lang.String getEFPath ( int efid ) { switch ( efid ) { case EF_SMS : case EF_CST : case EF_RUIM_SPN : return ( MF_SIM ) + ( DF_CDMA ) ; } return getCommonIccEFPath ( efid ) ; }

Target:
protected java.lang.String getEFPath ( int efid ) { switch ( efid ) { case EF_SMS : case EF_CST : case EF_RUIM_SPN : case EF_CSIM_LI : case EF_CSIM_MDN : case EF_CSIM_IMSIM : case EF_CSIM_CDMAHOME : case EF_CSIM_EPRL : return ( MF_SIM ) + ( DF_CDMA ) ; } return getCommonIccEFPath ( efid ) ; }
Source:
public void onOpen ( android.database.sqlite.SQLiteDatabase db ) { }

Target:
public void onOpen ( android.database.sqlite.SQLiteDatabase db ) { try { db.execSQL ( ( ( ( ( "delete from " + ( com.android.emailcommon.provider.Account.TABLE_NAME ) ) + " WHERE " ) + ( com.android.emailcommon.provider.EmailContent.AccountColumns.DISPLAY_NAME ) ) + " ISNULL;" ) ) ; db.execSQL ( ( ( ( ( "delete from " + ( com.android.emailcommon.provider.HostAuth.TABLE_NAME ) ) + " WHERE " ) + ( com.android.emailcommon.provider.EmailContent.HostAuthColumns.PROTOCOL ) ) + " ISNULL;" ) ) ; } catch ( android.database.SQLException e ) { android.util.Log.w ( com.android.email.provider.DBHelper.TAG , ( "Exception cleaning EmailProvider.db" + e ) ) ; } }
Source:
public com.android.hierarchyviewerlib.device.Window [ ] getWindows ( com.android.ddmlib.IDevice device ) { com.android.hierarchyviewerlib.device.Window [ ] windows = null ; synchronized ( mDeviceMap ) { com.android.hierarchyviewerlib.models.DeviceSelectionModel.DeviceInfo info = mDeviceMap.get ( device ) ; if ( info != null ) { windows = mDeviceMap.get ( device ) . windows ; } } return windows ; }

Target:
public com.android.hierarchyviewerlib.device.IHvDevice [ ] getDevices ( ) { synchronized ( mDeviceMap ) { java.util.Set < com.android.hierarchyviewerlib.device.IHvDevice > devices = mDeviceMap.keySet ( ) ; return devices.toArray ( new com.android.hierarchyviewerlib.device.IHvDevice [ devices.size ( ) ] ) ; } }
Source:
public void testOverflowing32BitUnixDates ( ) { final java.util.TimeZone tz = java.util.TimeZone.getTimeZone ( "America/New_York" ) ; assertFalse ( tz.inDaylightTime ( new java.util.Date ( ( - 2206292400000L ) ) ) ) ; assertEquals ( ( - 18000000 ) , tz.getOffset ( ( - 2206292400000L ) ) ) ; assertFalse ( tz.inDaylightTime ( new java.util.Date ( 2206292400000L ) ) ) ; assertEquals ( ( - 18000000 ) , tz.getOffset ( 2206292400000L ) ) ; }

Target:
public void testOverflowing32BitUnixDates ( ) { final java.util.TimeZone tz = java.util.TimeZone.getTimeZone ( "America/New_York" ) ; long upperTime = 2206292400000L ; long lowerTime = - upperTime ; assertFalse ( tz.inDaylightTime ( new java.util.Date ( lowerTime ) ) ) ; assertEquals ( ( - 18000000 ) , tz.getOffset ( lowerTime ) ) ; assertFalse ( tz.inDaylightTime ( new java.util.Date ( upperTime ) ) ) ; assertEquals ( ( - 18000000 ) , tz.getOffset ( upperTime ) ) ; }
Source:
boolean movePrevious ( ) { if ( ( ( mItemCount ) > 0 ) && ( ( mSelectedPosition ) > 0 ) ) { scrollToChild ( ( ( ( mSelectedPosition ) - ( mFirstPosition ) ) - 1 ) ) ; return true ; } else { return false ; } }

Target:
boolean moveDirection ( int direction ) { direction = ( isLayoutRtl ( ) ) ? - direction : direction ; int targetPosition = ( mSelectedPosition ) + direction ; if ( ( ( ( mItemCount ) > 0 ) && ( targetPosition >= 0 ) ) && ( targetPosition < ( mItemCount ) ) ) { scrollToChild ( ( targetPosition - ( mFirstPosition ) ) ) ; return true ; } else { return false ; } }
Source:
public int count ( @ javax.annotation.Nullable java.lang.Object element ) { try { com.google.common.collect.Count frequency = backingMap.get ( element ) ; return frequency == null ? 0 : frequency.get ( ) ; } catch ( java.lang.NullPointerException e ) { return 0 ; } catch ( java.lang.ClassCastException e ) { return 0 ; } }

Target:
public int count ( @ javax.annotation.Nullable java.lang.Object element ) { com.google.common.collect.Count frequency = com.google.common.collect.Maps.safeGet ( backingMap , element ) ; return frequency == null ? 0 : frequency.get ( ) ; }
Source:
public void checkClass ( @ com.android.annotations.NonNull com.android.tools.lint.detector.api.JavaContext javaContext , @ com.android.annotations.Nullable lombok.ast.ClassDeclaration node , @ com.android.annotations.NonNull org.w3c.dom.Node declarationOrAnonymous , @ com.android.annotations.NonNull com.android.tools.lint.client.api.JavaParser.ResolvedClass cls ) { if ( node == null ) { return ; } if ( ! ( cls.isInheritingFrom ( com.android.SdkConstants.CLASS_ACTIVITY , true ) ) ) { return ; } node.accept ( new com.android.tools.lint.checks.AppIndexingApiDetector.MethodVisitor ( javaContext ) ) ; }

Target:
public void checkClass ( @ com.android.annotations.NonNull com.android.tools.lint.detector.api.JavaContext context , @ com.android.annotations.NonNull com.intellij.psi.PsiClass declaration ) { if ( ( declaration.getName ( ) ) == null ) { return ; } if ( ! ( context.getEvaluator ( ) . extendsClass ( declaration , com.android.SdkConstants.CLASS_ACTIVITY , true ) ) ) { return ; } declaration.accept ( new com.android.tools.lint.checks.AppIndexingApiDetector.MethodVisitor ( context , declaration ) ) ; }
Source:
public void testInterrupted ( ) throws java.io.IOException { java.nio.channels.Selector selector = java.nio.channels.Selector.open ( ) ; try { java.lang.Thread.currentThread ( ) . interrupt ( ) ; int count = selector.select ( ) ; assertEquals ( 0 , count ) ; } finally { selector.close ( ) ; } }

Target:
public void testInterrupted ( ) throws java.io.IOException { java.nio.channels.Selector selector = java.nio.channels.Selector.open ( ) ; try { java.lang.Thread.currentThread ( ) . interrupt ( ) ; int count = selector.select ( ) ; assertEquals ( 0 , count ) ; assertTrue ( java.lang.Thread.currentThread ( ) . isInterrupted ( ) ) ; } finally { selector.close ( ) ; assertTrue ( java.lang.Thread.interrupted ( ) ) ; } }
Source:
private void saveCurrentStatus ( ) { preStartIndex = findStartIndex ; }

Target:
private void prepareForScan ( ) { if ( ( findStartIndex ) >= ( ( buffer.capacity ( ) ) / 2 ) ) { int oldPosition = buffer.position ( ) ; buffer.position ( findStartIndex ) ; buffer.compact ( ) ; buffer.position ( oldPosition ) ; bufferLength -= findStartIndex ; findStartIndex = 0 ; preStartIndex = - 1 ; resetMatcher ( ) ; } preStartIndex = findStartIndex ; }
Source:
private static void setWfcRoamingSettingInternal ( android.content.Context context , boolean enabled ) { final com.android.ims.ImsManager imsManager = com.android.ims.ImsManager.getInstance ( context , android.telephony.SubscriptionManager.getDefaultVoicePhoneId ( ) ) ; if ( imsManager != null ) { final int value = ( enabled ) ? ImsConfig.FeatureValueConstants.ON : ImsConfig.FeatureValueConstants.OFF ; java.lang.Thread thread = new java.lang.Thread ( new java.lang.Runnable ( ) { public void run ( ) { try { imsManager.getConfigInterface ( ) . setProvisionedValue ( ImsConfig.ConfigConstants.VOICE_OVER_WIFI_ROAMING , value ) ; } catch ( com.android.ims.ImsException e ) { } } } ) ; thread.start ( ) ; } }

Target:
public static void setWfcRoamingSetting ( android.content.Context context , boolean enabled ) { android.provider.Settings.Global.putInt ( context.getContentResolver ( ) , android.provider.Settings.Global.WFC_IMS_ROAMING_ENABLED , ( enabled ? ImsConfig.FeatureValueConstants.ON : ImsConfig.FeatureValueConstants.OFF ) ) ; final com.android.ims.ImsManager imsManager = com.android.ims.ImsManager.getInstance ( context , android.telephony.SubscriptionManager.getDefaultVoicePhoneId ( ) ) ; if ( imsManager != null ) { imsManager.setWfcRoamingSettingInternal ( enabled ) ; } }
Source:
public android.os.ParcelUuid [ ] getUuids ( ) { if ( ( ( android.bluetooth.BluetoothDevice.sService ) == null ) || ( ( isBluetoothEnabled ( ) ) == false ) ) { android.util.Log.e ( android.bluetooth.BluetoothDevice.TAG , "BT not enabled. Cannot get remote device Uuids" ) ; return null ; } try { return android.bluetooth.BluetoothDevice.sService.getRemoteUuids ( this ) ; } catch ( android.os.RemoteException e ) { android.util.Log.e ( android.bluetooth.BluetoothDevice.TAG , "" , e ) ; } return null ; }

Target:
public boolean setSimAccessPermission ( int value ) { final android.bluetooth.IBluetooth service = android.bluetooth.BluetoothDevice.sService ; if ( service == null ) { return false ; } try { return service.setSimAccessPermission ( this , value ) ; } catch ( android.os.RemoteException e ) { android.util.Log.e ( android.bluetooth.BluetoothDevice.TAG , "" , e ) ; } return false ; }
Source:
private void getRcFeaturesRequestFromNative ( byte [ ] address , int features ) { android.os.Message msg = mHandler.obtainMessage ( com.android.bluetooth.avrcp.Avrcp.MSG_NATIVE_REQ_GET_RC_FEATURES , features , 0 , com.android.bluetooth.Utils.getAddressStringFromByte ( address ) ) ; mHandler.sendMessage ( msg ) ; }

Target:
private void getRcFeaturesRequestFromNative ( byte [ ] address , int features ) { final com.android.bluetooth.avrcp.Avrcp.AvrcpMessageHandler handler = mHandler ; if ( handler == null ) { if ( com.android.bluetooth.avrcp.Avrcp.DEBUG ) android.util.Log.d ( com.android.bluetooth.avrcp.Avrcp.TAG , "getRcFeaturesRequestFromNative: mHandler is already null" ) ; return ; } android.os.Message msg = handler.obtainMessage ( com.android.bluetooth.avrcp.Avrcp.MSG_NATIVE_REQ_GET_RC_FEATURES , features , 0 , com.android.bluetooth.Utils.getAddressStringFromByte ( address ) ) ; handler.sendMessage ( msg ) ; }
Source:
public void testLongWriteBytesTo ( ) { byte [ ] dest = new byte [ 8 ] ; com.google.common.hash.HashCodes.fromLong ( 42 ) . writeBytesTo ( dest , 0 , 8 ) ; assertTrue ( com.google.common.jdk5backport.Arrays.equals ( com.google.common.hash.HashCodes.fromLong ( 42 ) . asBytes ( ) , dest ) ) ; }

Target:
public void testLongWriteBytesTo ( ) { byte [ ] dest = new byte [ 8 ] ; com.google.common.hash.HashCode.fromLong ( 42 ) . writeBytesTo ( dest , 0 , 8 ) ; assertTrue ( com.google.common.jdk5backport.Arrays.equals ( com.google.common.hash.HashCode.fromLong ( 42 ) . asBytes ( ) , dest ) ) ; }
Source:
public void test_ConstructorIILjava_net_InetAddress ( ) throws java.io.IOException { int freePortNumber = tests.support.Support_PortManager.getNextPort ( ) ; java.net.ServerSocket ss = new java.net.ServerSocket ( freePortNumber , 10 , java.net.InetAddress.getLocalHost ( ) ) ; try { new java.net.ServerSocket ( freePortNumber , 10 , java.net.InetAddress.getLocalHost ( ) ) ; fail ( "IOException was not thrown." ) ; } catch ( java.io.IOException expected ) { } ss.close ( ) ; try { new java.net.ServerSocket ( 65536 , 10 , java.net.InetAddress.getLocalHost ( ) ) ; fail ( "IllegalArgumentException was not thrown." ) ; } catch ( java.lang.IllegalArgumentException expected ) { } }

Target:
public void test_ConstructorIILjava_net_InetAddress ( ) throws java.io.IOException { java.net.ServerSocket ss = new java.net.ServerSocket ( 0 , 10 , java.net.InetAddress.getLocalHost ( ) ) ; try { new java.net.ServerSocket ( ss.getLocalPort ( ) , 10 , java.net.InetAddress.getLocalHost ( ) ) ; fail ( "IOException was not thrown." ) ; } catch ( java.io.IOException expected ) { } ss.close ( ) ; try { new java.net.ServerSocket ( 65536 , 10 , java.net.InetAddress.getLocalHost ( ) ) ; fail ( "IllegalArgumentException was not thrown." ) ; } catch ( java.lang.IllegalArgumentException expected ) { } }
Source:
public ContactSource.Type getContactSource ( ) { switch ( nameSource ) { case com.android.dialer.phonelookup.consolidator.PhoneLookupInfoConsolidator.NameSource.CP2_DEFAULT_DIRECTORY : return ContactSource.Type.SOURCE_TYPE_DIRECTORY ; case com.android.dialer.phonelookup.consolidator.PhoneLookupInfoConsolidator.NameSource.CP2_EXTENDED_DIRECTORY : return ContactSource.Type.SOURCE_TYPE_EXTENDED ; case com.android.dialer.phonelookup.consolidator.PhoneLookupInfoConsolidator.NameSource.PEOPLE_API : return getRefinedPeopleApiSource ( ) ; case com.android.dialer.phonelookup.consolidator.PhoneLookupInfoConsolidator.NameSource.CNAP : return ContactSource.Type.SOURCE_TYPE_CNAP ; case com.android.dialer.phonelookup.consolidator.PhoneLookupInfoConsolidator.NameSource.NONE : return ContactSource.Type.UNKNOWN_SOURCE_TYPE ; default : throw com.android.dialer.common.Assert.createUnsupportedOperationFailException ( java.lang.String.format ( "Unsupported name source: %s" , nameSource ) ) ; } }

Target:
public ContactSource.Type getContactSource ( ) { switch ( nameSource ) { case com.android.dialer.phonelookup.consolidator.PhoneLookupInfoConsolidator.NameSource.CP2_DEFAULT_DIRECTORY : return ContactSource.Type.SOURCE_TYPE_DIRECTORY ; case com.android.dialer.phonelookup.consolidator.PhoneLookupInfoConsolidator.NameSource.CP2_EXTENDED_DIRECTORY : return ContactSource.Type.SOURCE_TYPE_EXTENDED ; case com.android.dialer.phonelookup.consolidator.PhoneLookupInfoConsolidator.NameSource.PEOPLE_API : return getRefinedPeopleApiSource ( ) ; case com.android.dialer.phonelookup.consolidator.PhoneLookupInfoConsolidator.NameSource.CEQUINT : return ContactSource.Type.SOURCE_TYPE_CEQUINT_CALLER_ID ; case com.android.dialer.phonelookup.consolidator.PhoneLookupInfoConsolidator.NameSource.CNAP : return ContactSource.Type.SOURCE_TYPE_CNAP ; case com.android.dialer.phonelookup.consolidator.PhoneLookupInfoConsolidator.NameSource.NONE : return ContactSource.Type.UNKNOWN_SOURCE_TYPE ; default : throw com.android.dialer.common.Assert.createUnsupportedOperationFailException ( java.lang.String.format ( "Unsupported name source: %s" , nameSource ) ) ; } }
Source:
public int getDiscoverableTimeout ( ) { if ( ( getState ( ) ) != ( android.bluetooth.BluetoothAdapter.STATE_ON ) ) return - 1 ; try { synchronized ( mManagerCallback ) { if ( ( mService ) != null ) return mService.getDiscoverableTimeout ( ) ; } } catch ( android.os.RemoteException e ) { android.util.Log.e ( android.bluetooth.BluetoothAdapter.TAG , "" , e ) ; } return - 1 ; }

Target:
public int getScanMode ( ) { if ( ( getState ( ) ) != ( android.bluetooth.BluetoothAdapter.STATE_ON ) ) return android.bluetooth.BluetoothAdapter.SCAN_MODE_NONE ; try { mServiceLock.readLock ( ) . lock ( ) ; if ( ( mService ) != null ) return mService.getScanMode ( ) ; } catch ( android.os.RemoteException e ) { android.util.Log.e ( android.bluetooth.BluetoothAdapter.TAG , "" , e ) ; } finally { mServiceLock.readLock ( ) . unlock ( ) ; } return android.bluetooth.BluetoothAdapter.SCAN_MODE_NONE ; }
Source:
public boolean setPriority ( android.bluetooth.BluetoothDevice device , int priority ) { Settings.Global.putInt ( getContentResolver ( ) , Settings.Global.getBluetoothMapPriorityKey ( device.getAddress ( ) ) , priority ) ; if ( com.android.bluetooth.map.BluetoothMapService.VERBOSE ) { android.util.Log.v ( com.android.bluetooth.map.BluetoothMapService.TAG , ( ( ( "Saved priority " + device ) + " = " ) + priority ) ) ; } return true ; }

Target:
public boolean disconnect ( android.bluetooth.BluetoothDevice device ) { if ( com.android.bluetooth.map.BluetoothMapService.VERBOSE ) { android.util.Log.v ( com.android.bluetooth.map.BluetoothMapService.TAG , "disconnect()" ) ; } com.android.bluetooth.map.BluetoothMapService service = getService ( ) ; if ( service == null ) { return false ; } service.disconnect ( device ) ; return true ; }
Source:
private static com.android.jack.resource.ResourceImporter getResourceImporter ( @ javax.annotation.Nonnull java.util.List < java.io.File > importedResources , @ javax.annotation.Nonnull com.android.sched.util.RunnableHooks hooks ) throws com.android.jack.resource.ResourceReadingException { java.util.List < com.android.sched.vfs.InputVFS > resourceVDirs = new java.util.ArrayList < com.android.sched.vfs.InputVFS > ( ) ; for ( java.io.File resourceDir : importedResources ) { try { com.android.sched.vfs.InputVFS dir = new com.android.sched.vfs.DirectVFS ( new com.android.sched.util.file.Directory ( resourceDir.getPath ( ) , hooks , com.android.sched.util.file.FileOrDirectory.Existence.MUST_EXIST , com.android.sched.util.file.FileOrDirectory.Permission.READ , com.android.sched.util.file.FileOrDirectory.ChangePermission.NOCHANGE ) ) ; resourceVDirs.add ( dir ) ; } catch ( java.io.IOException ioException ) { throw new com.android.jack.resource.ResourceReadingException ( ioException ) ; } } return new com.android.jack.resource.ResourceImporter ( resourceVDirs ) ; }

Target:
public static void checkAndRun ( @ javax.annotation.Nonnull com.android.jack.Options options ) throws com.android.jack.IllegalOptionsException , com.android.jack.JackUserException , com.android.sched.scheduler.ProcessException , com.android.sched.util.config.ConfigurationException { com.android.sched.util.RunnableHooks hooks = new com.android.sched.util.RunnableHooks ( ) ; try { com.android.jack.Jack.check ( options , hooks ) ; com.android.jack.Jack.run ( options , hooks ) ; } finally { hooks.runHooks ( ) ; } }
Source:
private void writeObject ( java.io.ObjectOutputStream stream ) throws java.io.IOException { if ( getOpenSSLKey ( ) . isEngineBased ( ) ) { throw new java.io.NotSerializableException ( "engine-based keys can not be serialized" ) ; } stream.defaultWriteObject ( ) ; ensureReadParams ( ) ; stream.writeObject ( new java.math.BigInteger ( g ) ) ; stream.writeObject ( new java.math.BigInteger ( p ) ) ; stream.writeObject ( new java.math.BigInteger ( x ) ) ; }

Target:
private java.lang.Object writeReplace ( ) throws java.io.NotSerializableException { if ( getOpenSSLKey ( ) . isEngineBased ( ) ) { throw new java.io.NotSerializableException ( "engine-based keys can not be serialized" ) ; } return new org.conscrypt.OpenSSLDHPrivateKey.SerializationProxy ( this ) ; }
Source:
protected void tearDown ( ) throws java.lang.Exception { if ( mHasFeature ) { if ( mRemoveOwnerInTearDown ) { assertTrue ( "Failed to clear owner" , removeAdmin ( ( ( ( com.android.cts.devicepolicy.UserRestrictionsTest.DEVICE_ADMIN_PKG ) + "/" ) + ( com.android.cts.devicepolicy.UserRestrictionsTest.ADMIN_RECEIVER_TEST_CLASS ) ) , mDeviceOwnerUserId ) ) ; assertTrue ( "Some user restrictions are still set" , runTests ( "userrestrictions.CheckNoOwnerRestrictionsTest" , mDeviceOwnerUserId ) ) ; } removeTestUsers ( ) ; } super . tearDown ( ) ; }

Target:
protected void tearDown ( ) throws java.lang.Exception { if ( mHasFeature ) { if ( mRemoveOwnerInTearDown ) { assertTrue ( "Failed to clear owner" , removeAdmin ( ( ( ( com.android.cts.devicepolicy.UserRestrictionsTest.DEVICE_ADMIN_PKG ) + "/" ) + ( com.android.cts.devicepolicy.UserRestrictionsTest.ADMIN_RECEIVER_TEST_CLASS ) ) , mDeviceOwnerUserId ) ) ; assertTrue ( "Some user restrictions are still set" , runTests ( "userrestrictions.CheckNoOwnerRestrictionsTest" , mDeviceOwnerUserId ) ) ; } removeTestUsers ( ) ; getDevice ( ) . uninstallPackage ( com.android.cts.devicepolicy.UserRestrictionsTest.DEVICE_ADMIN_PKG ) ; } super . tearDown ( ) ; }
Source:
protected java.security.AlgorithmParameters engineGenerateParameters ( ) { byte [ ] iv = new byte [ 16 ] ; if ( ( random ) == null ) { random = new java.security.SecureRandom ( ) ; } random.nextBytes ( iv ) ; java.security.AlgorithmParameters params ; try { params = java.security.AlgorithmParameters.getInstance ( "Noekeon" , BouncyCastleProvider.PROVIDER_NAME ) ; params.init ( new javax.crypto.spec.IvParameterSpec ( iv ) ) ; } catch ( java.lang.Exception e ) { throw new java.lang.RuntimeException ( e.getMessage ( ) ) ; } return params ; }

Target:
protected java.security.AlgorithmParameters engineGenerateParameters ( ) { byte [ ] iv = new byte [ 16 ] ; if ( ( random ) == null ) { random = new java.security.SecureRandom ( ) ; } random.nextBytes ( iv ) ; java.security.AlgorithmParameters params ; try { params = createParametersInstance ( "Noekeon" ) ; params.init ( new javax.crypto.spec.IvParameterSpec ( iv ) ) ; } catch ( java.lang.Exception e ) { throw new java.lang.RuntimeException ( e.getMessage ( ) ) ; } return params ; }
Source:
public void testAesGcm64Tcp4UdpEncap ( ) throws java.lang.Exception { android.net.IpSecAlgorithm authCrypt = new android.net.IpSecAlgorithm ( android.net.IpSecAlgorithm.AUTH_CRYPT_AES_GCM , android.net.cts.IpSecManagerTest.getKey ( 288 ) , 64 ) ; checkTransform ( android.system.OsConstants.IPPROTO_TCP , android.net.cts.IpSecManagerTest.IPV4_LOOPBACK , null , null , authCrypt , true , 1 , false ) ; checkTransform ( android.system.OsConstants.IPPROTO_TCP , android.net.cts.IpSecManagerTest.IPV4_LOOPBACK , null , null , authCrypt , true , 1 , true ) ; }

Target:
public void testAuthUdp4 ( ) throws java.lang.Exception { android.net.IpSecAlgorithm auth = new android.net.IpSecAlgorithm ( android.net.IpSecAlgorithm.AUTH_HMAC_SHA256 , getAuthKey ( 256 ) , 128 ) ; checkTransform ( android.system.OsConstants.IPPROTO_UDP , android.net.cts.IpSecManagerTest.IPV4_LOOPBACK , null , auth , false , 1 , false ) ; checkTransform ( android.system.OsConstants.IPPROTO_UDP , android.net.cts.IpSecManagerTest.IPV4_LOOPBACK , null , auth , false , 1 , true ) ; }
Source:
public void testRootnF32_3 ( ) { android.renderscript.Allocation nAlloc = android.renderscript.Allocation.createSized ( mRS , android.renderscript.Element.I32_3 ( mRS ) , android.renderscript.cts.INPUTSIZE ) ; n = new int [ ( INPUTSIZE ) * 4 ] ; android.renderscript.cts.RSUtils.genRandom ( 10560497 , 32 , 1 , 1 , n , 4 , 1 ) ; nAlloc.copyFrom ( n ) ; script_f32.set_n3 ( nAlloc ) ; doF32_3 ( 11191281 , 16 ) ; }

Target:
public void testRootnF32_3 ( ) { android.renderscript.Allocation nAlloc = android.renderscript.Allocation.createSized ( mRS , android.renderscript.Element.I32_3 ( mRS ) , android.renderscript.cts.INPUTSIZE ) ; n = new int [ ( INPUTSIZE ) * 4 ] ; android.renderscript.cts.RSUtils.genRandomInts ( 10560497 , 32 , 1 , n ) ; nAlloc.copyFrom ( n ) ; script_f32.set_n3 ( nAlloc ) ; doF32_3 ( 11191281 , 16 ) ; }
Source:
public void onDestroy ( ) { super . onDestroy ( ) ; stopAdvertise ( ) ; if ( ( mGattServer ) == null ) { return ; } if ( ( mDevice ) != null ) mGattServer.cancelConnection ( mDevice ) ; mGattServer.close ( ) ; }

Target:
public void onDestroy ( ) { super . onDestroy ( ) ; cancelNotificationTaskOfSecureTestStartFailure ( ) ; stopAdvertise ( ) ; if ( ( mGattServer ) == null ) { return ; } if ( ( mDevice ) != null ) { mGattServer.cancelConnection ( mDevice ) ; } mGattServer.clearServices ( ) ; mGattServer.close ( ) ; }
Source:
public boolean password ( java.lang.String password ) { try { return ( mBinder.password ( password ) ) == ( android.security.KeyStore.NO_ERROR ) ; } catch ( android.os.RemoteException e ) { android.util.Log.w ( android.security.KeyStore.TAG , "Cannot connect to keystore" , e ) ; return false ; } }

Target:
public boolean onUserPasswordChanged ( int userId , java.lang.String newPassword ) { if ( newPassword == null ) { newPassword = "" ; } try { return ( mBinder.onUserPasswordChanged ( userId , newPassword ) ) == ( android.security.KeyStore.NO_ERROR ) ; } catch ( android.os.RemoteException e ) { android.util.Log.w ( android.security.KeyStore.TAG , "Cannot connect to keystore" , e ) ; return false ; } }
Source:
private void notifyDefaultData ( com.android.internal.telephony.dataconnection.ApnContext apnContext ) { if ( DBG ) { log ( ( ( ( "notifyDefaultData: type=" + ( apnContext.getApnType ( ) ) ) + ", reason:" ) + ( apnContext.getReason ( ) ) ) ) ; } apnContext.setState ( DctConstants.State.CONNECTED ) ; mPhone.notifyDataConnection ( apnContext.getReason ( ) , apnContext.getApnType ( ) ) ; startNetStatPoll ( ) ; startDataStallAlarm ( com.android.internal.telephony.dataconnection.DATA_STALL_NOT_SUSPECTED ) ; }

Target:
private boolean retryAfterDisconnected ( com.android.internal.telephony.dataconnection.ApnContext apnContext ) { boolean retry = true ; java.lang.String reason = apnContext.getReason ( ) ; if ( ( Phone.REASON_RADIO_TURNED_OFF.equals ( reason ) ) || ( ( isOnlySingleDcAllowed ( mPhone.getServiceState ( ) . getRilDataRadioTechnology ( ) ) ) && ( isHigherPriorityApnContextActive ( apnContext ) ) ) ) { retry = false ; } return retry ; }
Source:
public void testCannotSetDeviceOwnerWhenAccountPresent ( ) throws java.lang.Exception { if ( ! ( mHasFeature ) ) { return ; } installApp ( com.android.cts.devicepolicy.CustomDeviceOwnerTest.DEVICE_AND_PROFILE_OWNER_APK ) ; try { assertTrue ( runDeviceTestsAsUser ( com.android.cts.devicepolicy.CustomDeviceOwnerTest.DEVICE_AND_PROFILE_OWNER_PKG , ".AccountUtilsTest" , "testAddAccount" , 0 ) ) ; assertFalse ( setDeviceOwner ( com.android.cts.devicepolicy.CustomDeviceOwnerTest.DEVICE_AND_PROFILE_OWNER_ADMIN_COMPONENT ) ) ; } finally { runDeviceTests ( com.android.cts.devicepolicy.CustomDeviceOwnerTest.DEVICE_AND_PROFILE_OWNER_PKG , com.android.cts.devicepolicy.CustomDeviceOwnerTest.DEVICE_AND_PROFILE_OWNER_CLEAR ) ; assertTrue ( runDeviceTestsAsUser ( com.android.cts.devicepolicy.CustomDeviceOwnerTest.DEVICE_AND_PROFILE_OWNER_PKG , ".AccountUtilsTest" , "testRemoveAccounts" , 0 ) ) ; } }

Target:
public void testCannotSetDeviceOwnerWhenAccountPresent ( ) throws java.lang.Exception { if ( ! ( mHasFeature ) ) { return ; } installAppAsUser ( com.android.cts.devicepolicy.CustomDeviceOwnerTest.ACCOUNT_MANAGEMENT_APK , mPrimaryUserId ) ; installAppAsUser ( com.android.cts.devicepolicy.CustomDeviceOwnerTest.DEVICE_OWNER_APK , mPrimaryUserId ) ; try { assertTrue ( runDeviceTestsAsUser ( com.android.cts.devicepolicy.CustomDeviceOwnerTest.ACCOUNT_MANAGEMENT_PKG , ".AccountUtilsTest" , "testAddAccountExplicitly" , mPrimaryUserId ) ) ; assertFalse ( setDeviceOwner ( com.android.cts.devicepolicy.CustomDeviceOwnerTest.DEVICE_OWNER_ADMIN_COMPONENT , mPrimaryUserId , true ) ) ; } finally { removeAdmin ( com.android.cts.devicepolicy.CustomDeviceOwnerTest.DEVICE_OWNER_ADMIN_COMPONENT , mPrimaryUserId ) ; assertTrue ( runDeviceTestsAsUser ( com.android.cts.devicepolicy.CustomDeviceOwnerTest.ACCOUNT_MANAGEMENT_PKG , ".AccountUtilsTest" , "testRemoveAccountExplicitly" , mPrimaryUserId ) ) ; } }
Source:
private void mergeSpacers ( com.android.ide.common.layout.grid.GridModel.ViewData prevSpacer , com.android.ide.common.layout.grid.GridModel.ViewData spacer , boolean row ) { int combinedSizeDp = - 1 ; int prevSizeDp = getDipSize ( prevSpacer , row ) ; int sizeDp = getDipSize ( spacer , row ) ; combinedSizeDp = prevSizeDp + sizeDp ; java.lang.String attribute = ( row ) ? com.android.ide.common.layout.LayoutConstants.ATTR_LAYOUT_HEIGHT : com.android.ide.common.layout.LayoutConstants.ATTR_LAYOUT_WIDTH ; prevSpacer.node.setAttribute ( com.android.ide.common.layout.LayoutConstants.ANDROID_URI , attribute , java.lang.String.format ( com.android.ide.common.layout.LayoutConstants.VALUE_N_DP , combinedSizeDp ) ) ; layout.removeChild ( spacer.node ) ; }

Target:
private void mergeSpacers ( com.android.ide.common.layout.grid.GridModel.ViewData prevSpacer , com.android.ide.common.layout.grid.GridModel.ViewData spacer , boolean row ) { int combinedSizeDp = - 1 ; int prevSizeDp = getDipSize ( prevSpacer , row ) ; int sizeDp = getDipSize ( spacer , row ) ; combinedSizeDp = prevSizeDp + sizeDp ; java.lang.String attribute = ( row ) ? com.android.ide.common.layout.LayoutConstants.ATTR_LAYOUT_HEIGHT : com.android.ide.common.layout.LayoutConstants.ATTR_LAYOUT_WIDTH ; prevSpacer.node.setAttribute ( com.android.util.XmlUtils.ANDROID_URI , attribute , java.lang.String.format ( com.android.ide.common.layout.LayoutConstants.VALUE_N_DP , combinedSizeDp ) ) ; layout.removeChild ( spacer.node ) ; }
Source:
public void testMergedResourcesByName ( ) throws java.lang.Exception { com.android.ide.common.res2.ResourceMerger merger = com.android.ide.common.res2.ResourceMergerTest.getResourceMerger ( ) ; verifyResourceExists ( merger , "drawable/icon" , "drawable-ldpi/icon" , "drawable/icon2" , "drawable/patch" , "raw/foo" , "layout/main" , "layout/layout_ref" , "layout/alias_replaced_by_file" , "layout/file_replaced_by_alias" , "drawable/color_drawable" , "drawable/drawable_ref" , "color/color" , "string/basic_string" , "string/xliff_string" , "string/styled_string" , "style/style" , "array/string_array" , "attr/dimen_attr" , "attr/string_attr" , "attr/enum_attr" , "attr/flag_attr" , "attr/blah" , "declare-styleable/declare_styleable" , "dimen/dimen" , "id/item_id" , "integer/integer" ) ; }

Target:
public void testMergedResourcesByName ( ) throws java.lang.Exception { com.android.ide.common.res2.ResourceMerger merger = com.android.ide.common.res2.ResourceMergerTest.getResourceMerger ( ) ; verifyResourceExists ( merger , "drawable/icon" , "drawable-ldpi/icon" , "drawable/icon2" , "drawable/patch" , "raw/foo" , "layout/main" , "layout/layout_ref" , "layout/alias_replaced_by_file" , "layout/file_replaced_by_alias" , "drawable/color_drawable" , "drawable/drawable_ref" , "color/color" , "string/basic_string" , "string/xliff_string" , "string/styled_string" , "style/style" , "array/string_array" , "attr/dimen_attr" , "attr/string_attr" , "attr/enum_attr" , "attr/flag_attr" , "attr/blah" , "attr/blah2" , "declare-styleable/declare_styleable" , "dimen/dimen" , "id/item_id" , "integer/integer" ) ; }