auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testListIterator1_IndexOutOfBoundsException ( ) { try { java.util.concurrent.CopyOnWriteArrayList c = new java.util.concurrent.CopyOnWriteArrayList ( ) ; c.listIterator ( ( - 1 ) ) ; shouldThrow ( ) ; } catch ( java.lang.IndexOutOfBoundsException success ) { } }

Target:
public void testAdd1_IndexOutOfBoundsException ( ) { java.util.concurrent.CopyOnWriteArrayList c = jsr166.CopyOnWriteArrayListTest.populatedArray ( 5 ) ; java.util.List [ ] lists = new java.util.List [ ] { c , c.subList ( 1 , ( ( c.size ( ) ) - 1 ) ) } ; for ( java.util.List list : lists ) { try { list.add ( ( - 1 ) , "qwerty" ) ; shouldThrow ( ) ; } catch ( java.lang.IndexOutOfBoundsException success ) { } } }
Source:
public void testAddAll2_IndexOutOfBoundsException ( ) { try { java.util.concurrent.CopyOnWriteArrayList c = new java.util.concurrent.CopyOnWriteArrayList ( ) ; c.add ( "asdasd" ) ; c.add ( "asdasdasd" ) ; c.addAll ( 100 , new java.util.LinkedList ( ) ) ; shouldThrow ( ) ; } catch ( java.lang.IndexOutOfBoundsException success ) { } }

Target:
public void testListIterator2_IndexOutOfBoundsException ( ) { java.util.concurrent.CopyOnWriteArrayList c = jsr166.CopyOnWriteArrayListTest.populatedArray ( 5 ) ; java.util.List [ ] lists = new java.util.List [ ] { c , c.subList ( 1 , ( ( c.size ( ) ) - 1 ) ) } ; for ( java.util.List list : lists ) { try { list.listIterator ( ( ( list.size ( ) ) + 1 ) ) ; shouldThrow ( ) ; } catch ( java.lang.IndexOutOfBoundsException success ) { } } }
Source:
public void runWithComparer ( android.uirendering.cts.bitmapcomparers.BitmapComparer bitmapComparer ) { }

Target:
public void runWithComparer ( android.uirendering.cts.bitmapcomparers.BitmapComparer bitmapComparer ) { if ( ( mTestCases.size ( ) ) == 0 ) { throw new java.lang.IllegalStateException ( "Need at least one test to run" ) ; } android.graphics.Bitmap idealBitmap = captureRenderSpec ( mTestCases.remove ( 0 ) ) ; for ( android.uirendering.cts.testinfrastructure.ActivityTestBase.TestCase testCase : mTestCases ) { android.graphics.Bitmap testCaseBitmap = captureRenderSpec ( testCase ) ; mBitmapAsserter.assertBitmapsAreSimilar ( idealBitmap , testCaseBitmap , bitmapComparer , getName ( ) , testCase.getDebugString ( ) ) ; } }
Source:
public void currentLinkCapacityEstimate ( int indicationType , com.android.internal.telephony.V1_2.LinkCapacityEstimate lce ) { }

Target:
public void currentLinkCapacityEstimate ( int indicationType , com.android.internal.telephony.V1_2.LinkCapacityEstimate lce ) { mRil.processIndication ( indicationType ) ; com.android.internal.telephony.LinkCapacityEstimate response = com.android.internal.telephony.RIL.convertHalLceData ( lce , mRil ) ; if ( RIL.RILJ_LOGD ) mRil.unsljLogRet ( com.android.internal.telephony.RILConstants.RIL_UNSOL_LCEDATA_RECV , response ) ; if ( ( mRil.mLceInfoRegistrants ) != null ) { mRil.mLceInfoRegistrants.notifyRegistrants ( new android.os.AsyncResult ( null , response , null ) ) ; } }
Source:
public void visitInvokeDynamicInsn ( java.lang.String name , java.lang.String desc , org.objectweb.asm.Handle bsm , java.lang.Object ... bsmArgs ) { buf.setLength ( 0 ) ; buf.append ( tab2 ) . append ( "INVOKEDYNAMIC" ) . append ( ' ' ) ; buf.append ( name ) ; appendDescriptor ( org.objectweb.asm.util.Textifier.METHOD_DESCRIPTOR , desc ) ; buf.append ( " [" ) ; appendHandle ( bsm ) ; buf.append ( tab3 ) . append ( "// arguments:" ) ; if ( ( bsmArgs.length ) == 0 ) { buf.append ( " none" ) ; } else { buf.append ( '\n' ) . append ( tab3 ) ; for ( int i = 0 ; i < ( bsmArgs.length ) ; i ++ ) { java.lang.Object cst = bsmArgs [ i ] ; if ( cst instanceof java.lang.String ) { org.objectweb.asm.util.Printer.appendString ( buf , ( ( java.lang.String ) ( cst ) ) ) ; } else if ( cst instanceof org.objectweb.asm.Type ) { buf.append ( ( ( org.objectweb.asm.Type ) ( cst ) ) . getDescriptor ( ) ) . append ( ".class" ) ; } else if ( cst instanceof org.objectweb.asm.Handle ) { appendHandle ( ( ( org.objectweb.asm.Handle ) ( cst ) ) ) ; } else { buf.append ( cst ) ; } buf.append ( ", " ) ; } buf.setLength ( ( ( buf.length ( ) ) - 2 ) ) ; } buf.append ( '\n' ) ; buf.append ( tab2 ) . append ( "]\n" ) ; text.add ( buf.toString ( ) ) ; }

Target:
public void visitMethodInsn ( final int opcode , final java.lang.String owner , final java.lang.String name , final java.lang.String desc ) { if ( ( api ) >= ( org.objectweb.asm.Opcodes.ASM5 ) ) { super . visitMethodInsn ( opcode , owner , name , desc ) ; return ; } doVisitMethodInsn ( opcode , owner , name , desc , ( opcode == ( org.objectweb.asm.Opcodes.INVOKEINTERFACE ) ) ) ; }
Source:
public synchronized void onPlaybackStateChanged ( android.media.session.PlaybackState state ) { if ( com.android.bluetooth.avrcp.Avrcp.DEBUG ) android.util.Log.v ( com.android.bluetooth.avrcp.Avrcp.TAG , ( "onPlaybackStateChanged: state " + ( state.toString ( ) ) ) ) ; updatePlaybackState ( state ) ; byte stateBytes = ( ( byte ) ( convertPlayStateToBytes ( state.getState ( ) ) ) ) ; com.android.bluetooth.avrcp.MediaPlayerInfo player = getAddressedPlayerInfo ( ) ; if ( player != null ) { player.setPlayStatus ( stateBytes ) ; } else { android.util.Log.w ( com.android.bluetooth.avrcp.Avrcp.TAG , ( "onPlaybackStateChanged: no addressed player id=" + ( mCurrAddrPlayerID ) ) ) ; } }

Target:
public synchronized void onPlaybackStateChanged ( android.media.session.PlaybackState state ) { if ( com.android.bluetooth.avrcp.Avrcp.DEBUG ) android.util.Log.v ( com.android.bluetooth.avrcp.Avrcp.TAG , ( "onPlaybackStateChanged: state " + ( state.toString ( ) ) ) ) ; updateCurrentMediaState ( ) ; }
Source:
public boolean apply ( com.android.jack.ir.ast.JDefinedClassOrInterface clOrI ) { com.android.sched.util.location.Location location = clOrI.getLocation ( ) ; if ( location instanceof com.android.jack.library.TypeInInputLibraryLocation ) { com.android.jack.library.InputLibrary inputLibrary = ( ( com.android.jack.library.TypeInInputLibraryLocation ) ( location ) ) . getInputLibraryLocation ( ) . getInputLibrary ( ) ; if ( inputLibrary.getFileTypes ( ) . containsAll ( session.getGeneratedFileTypes ( ) ) ) { return false ; } } return true ; }

Target:
public boolean apply ( com.android.jack.ir.ast.JDefinedClassOrInterface clOrI ) { com.android.sched.util.location.Location location = clOrI.getLocation ( ) ; if ( location instanceof com.android.jack.library.TypeInInputLibraryLocation ) { com.android.jack.library.InputLibrary inputLibrary = ( ( com.android.jack.library.TypeInInputLibraryLocation ) ( location ) ) . getInputLibraryLocation ( ) . getInputLibrary ( ) ; if ( inputLibrary.containsFileType ( FileType.DEX ) ) { return false ; } } return true ; }
Source:
public static long sendfile ( java.io.FileDescriptor outFd , java.io.FileDescriptor inFd , android.system.SendfileOffset inOffset , long byteCount ) throws android.system.ErrnoException { android.util.MutableLong internalInOffset = new android.util.MutableLong ( inOffset.value ) ; try { return Libcore.os.sendfile ( outFd , inFd , internalInOffset , byteCount ) ; } finally { inOffset.value = internalInOffset.value ; } }

Target:
public static long sendfile ( java.io.FileDescriptor outFd , java.io.FileDescriptor inFd , android.system.Int64Ref inOffset , long byteCount ) throws android.system.ErrnoException { return Libcore.os.sendfile ( outFd , inFd , inOffset , byteCount ) ; }
Source:
public void clearLocalPkg ( int filters ) { mLegacyBuildTools = null ; int minf = java.lang.Integer.lowestOneBit ( filters ) ; for ( int filter = minf ; ( filters != 0 ) && ( filter <= ( com.android.sdklib.repository.local.LocalSdk.PKG_ALL ) ) ; filter <<= 1 ) { if ( ( filters & filter ) == 0 ) { continue ; } filters ^= filter ; mVisitedDirs.removeAll ( filter ) ; mLocalPackages.removeAll ( filter ) ; } }

Target:
public void clearLocalPkg ( @ com.android.annotations.NonNull java.util.EnumSet < com.android.sdklib.repository.descriptors.PkgType > filters ) { mLegacyBuildTools = null ; for ( com.android.sdklib.repository.descriptors.PkgType filter : filters ) { mVisitedDirs.removeAll ( filter ) ; mLocalPackages.removeAll ( filter ) ; } }
Source:
private void handleSupplicantConnectionLoss ( ) { mWifiMonitor.killSupplicant ( mP2pSupported ) ; mWifiNative.closeSupplicantConnection ( ) ; sendSupplicantConnectionChangedBroadcast ( false ) ; setWifiState ( android.net.wifi.WifiManager.WIFI_STATE_DISABLED ) ; }

Target:
private void handleSupplicantConnectionLoss ( boolean killSupplicant ) { if ( killSupplicant ) { mWifiMonitor.stopAllMonitoring ( ) ; try { if ( ! ( mClientInterface.disableSupplicant ( ) ) ) { loge ( "Failed to disable supplicant after connection loss" ) ; } } catch ( android.os.RemoteException e ) { } } mWifiNative.closeSupplicantConnection ( ) ; sendSupplicantConnectionChangedBroadcast ( false ) ; setWifiState ( android.net.wifi.WifiManager.WIFI_STATE_DISABLED ) ; }
Source:
public void onConfigurationChanged ( final android.content.res.Configuration newConfig ) { if ( checkNeedsPost ( ) ) { mRunQueue.addTask ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { onConfigurationChanged ( newConfig ) ; } } ) ; return ; } mAwContents.onConfigurationChanged ( newConfig ) ; }

Target:
public void onWindowVisibilityChanged ( final int visibility ) { if ( checkNeedsPost ( ) ) { mRunQueue.addTask ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { onWindowVisibilityChanged ( visibility ) ; } } ) ; return ; } mAwContents.onWindowVisibilityChanged ( visibility ) ; }
Source:
public void testBasicSourceProviders ( ) throws java.lang.Exception { com.android.build.gradle.model.AndroidProjectTest.ProjectData projectData = getModelForProject ( com.android.build.gradle.model.AndroidProjectTest.FOLDER_TEST_REGULAR , "basic" ) ; com.android.builder.model.AndroidProject model = projectData.model ; java.io.File projectDir = projectData.projectDir ; com.android.build.gradle.model.AndroidProjectTest.testDefaultSourceSets ( model , projectDir ) ; for ( com.android.builder.model.Variant variant : model.getVariants ( ) ) { com.android.builder.model.AndroidArtifact artifact = variant.getMainArtifact ( ) ; assertNull ( artifact.getVariantSourceProvider ( ) ) ; assertNull ( artifact.getMultiFlavorSourceProvider ( ) ) ; } }

Target:
public void testBasicSourceProviders ( ) throws java.lang.Exception { com.android.build.gradle.model.AndroidProjectTest.ProjectData projectData = getModelForProject ( com.android.build.gradle.model.AndroidProjectTest.FOLDER_TEST_SAMPLE , "basic" ) ; com.android.builder.model.AndroidProject model = projectData.model ; java.io.File projectDir = projectData.projectDir ; com.android.build.gradle.model.AndroidProjectTest.testDefaultSourceSets ( model , projectDir ) ; for ( com.android.builder.model.Variant variant : model.getVariants ( ) ) { com.android.builder.model.AndroidArtifact artifact = variant.getMainArtifact ( ) ; assertNull ( artifact.getVariantSourceProvider ( ) ) ; assertNull ( artifact.getMultiFlavorSourceProvider ( ) ) ; } }
Source:
void scheduleWriteStoppedPackagesLocked ( ) { if ( ! ( mHandler.hasMessages ( com.android.server.pm.PackageManagerService.WRITE_STOPPED_PACKAGES ) ) ) { mHandler.sendEmptyMessageDelayed ( com.android.server.pm.PackageManagerService.WRITE_STOPPED_PACKAGES , com.android.server.pm.PackageManagerService.WRITE_SETTINGS_DELAY ) ; } }

Target:
void scheduleWritePackageRestrictionsLocked ( int userId ) { if ( ! ( com.android.server.pm.PackageManagerService.sUserManager.exists ( userId ) ) ) return ; mDirtyUsers.add ( userId ) ; if ( ! ( mHandler.hasMessages ( com.android.server.pm.PackageManagerService.WRITE_PACKAGE_RESTRICTIONS ) ) ) { mHandler.sendEmptyMessageDelayed ( com.android.server.pm.PackageManagerService.WRITE_PACKAGE_RESTRICTIONS , com.android.server.pm.PackageManagerService.WRITE_SETTINGS_DELAY ) ; } }
Source:
public void testNorwegian ( ) throws java.lang.Exception { assertEquals ( ( "res/values-nb/typos.xml:6: Warning: \"Andriod\" is a common misspelling; did you mean \"Android\" ? [Typos]\n" + ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( " <string name=\"s2\">Mer morro med Andriod</string>\n" + " ^\n" ) + "res/values-nb/typos.xml:6: Warning: \"morro\" is a common misspelling; did you mean \"moro\" ? [Typos]\n" ) + " <string name=\"s2\">Mer morro med Andriod</string>\n" ) + " ^\n" ) + "res/values-nb/typos.xml:8: Warning: \"Parallel\" is a common misspelling; did you mean \"Parallell\" ? [Typos]\n" ) + " <string name=\"s3\"> Parallel </string>\n" ) + " ^\n" ) + "res/values-nb/typos.xml:10: Warning: \"altid\" is a common misspelling; did you mean \"alltid\" ? [Typos]\n" ) + " <string name=\"s4\"><b>altid</b></string>\n" ) + " ^\n" ) + "res/values-nb/typos.xml:12: Warning: \"Altid\" is a common misspelling; did you mean \"Alltid\" ? [Typos]\n" ) + " <string name=\"s5\">Altid</string>\n" ) + " ^\n" ) + "res/values-nb/typos.xml:18: Warning: \"karri¾re\" is a common misspelling; did you mean \"karrire\" ? [Typos]\n" ) + " <string name=\"s7\">Koding er en spennende karri¾re</string>\n" ) + " ^\n" ) + "0 errors, 6 warnings\n" ) + "" ) ) , lintProject ( "res/values-nb/typos.xml" ) ) ; }

Target:
public void testNorwegian ( ) throws java.lang.Exception { assertEquals ( ( "res/values-nb/typos.xml:6: Warning: \"Andriod\" is a common misspelling; did you mean \"Android\" ? [Typos]\n" + ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( " <string name=\"s2\">Mer morro med Andriod</string>\n" + " ^\n" ) + "res/values-nb/typos.xml:6: Warning: \"morro\" is a common misspelling; did you mean \"moro\" ? [Typos]\n" ) + " <string name=\"s2\">Mer morro med Andriod</string>\n" ) + " ^\n" ) + "res/values-nb/typos.xml:8: Warning: \"Parallel\" is a common misspelling; did you mean \"Parallell\" ? [Typos]\n" ) + " <string name=\"s3\"> Parallel </string>\n" ) + " ^\n" ) + "res/values-nb/typos.xml:10: Warning: \"altid\" is a common misspelling; did you mean \"alltid\" ? [Typos]\n" ) + " <string name=\"s4\"><b>altid</b></string>\n" ) + " ^\n" ) + "res/values-nb/typos.xml:12: Warning: \"Altid\" is a common misspelling; did you mean \"Alltid\" ? [Typos]\n" ) + " <string name=\"s5\">Altid</string>\n" ) + " ^\n" ) + "res/values-nb/typos.xml:18: Warning: \"karriære\" is a common misspelling; did you mean \"karrière\" ? [Typos]\n" ) + " <string name=\"s7\">Koding er en spennende karriære</string>\n" ) + " ^\n" ) + "0 errors, 6 warnings\n" ) + "" ) ) , lintProject ( "res/values-nb/typos.xml" ) ) ; }
Source:
public void showSoftInputUnchecked ( int flags , android.os.ResultReceiver resultReceiver ) { try { mService.showSoftInput ( mClient , flags , resultReceiver ) ; } catch ( android.os.RemoteException e ) { } }

Target:
public boolean showSoftInput ( android.view.View view , int flags , android.os.ResultReceiver resultReceiver ) { checkFocus ( ) ; synchronized ( mH ) { if ( ( ( mServedView ) != view ) && ( ( ( mServedView ) == null ) || ( ! ( mServedView.checkInputConnectionProxy ( view ) ) ) ) ) { return false ; } try { return mService.showSoftInput ( mClient , flags , resultReceiver ) ; } catch ( android.os.RemoteException e ) { throw e.rethrowFromSystemServer ( ) ; } } }
Source:
public void resizeStack ( int stackId , android.graphics.Rect bounds ) { enforceCallingPermission ( android.Manifest.permission.MANAGE_ACTIVITY_STACKS , "resizeStack()" ) ; long ident = android.os.Binder.clearCallingIdentity ( ) ; try { synchronized ( this ) { mStackSupervisor.resizeStackLocked ( stackId , bounds ) ; } } finally { android.os.Binder.restoreCallingIdentity ( ident ) ; } }

Target:
public boolean removeTask ( int taskId ) { enforceCallingPermission ( android.Manifest.permission.REMOVE_TASKS , "removeTask()" ) ; synchronized ( this ) { final long ident = android.os.Binder.clearCallingIdentity ( ) ; try { return removeTaskByIdLocked ( taskId , true , com.android.server.am.ActivityManagerService.REMOVE_FROM_RECENTS ) ; } finally { android.os.Binder.restoreCallingIdentity ( ident ) ; } } }
Source:
public void run ( @ javax.annotation.Nonnull com.android.jack.ir.ast.JSession session ) throws com.android.jack.JackAbortException { com.android.jack.backend.dex.DexWritingTool writingTool = com.android.sched.util.config.ThreadConfig.get ( DexFileWriter.DEX_WRITING_POLICY ) ; try { writingTool.finishMerge ( outputVDir ) ; } catch ( com.android.jack.backend.dex.DexWritingException e ) { session.getReporter ( ) . report ( Severity.FATAL , e ) ; throw new com.android.jack.JackAbortException ( e ) ; } }

Target:
public void run ( @ javax.annotation.Nonnull com.android.jack.ir.ast.JSession session ) throws com.android.jack.JackAbortException { com.android.jack.backend.dex.DexWritingTool writingTool = com.android.sched.util.config.ThreadConfig.get ( DexFileWriter.DEX_WRITING_POLICY ) ; try { writingTool.finishMerge ( outputVDir ) ; } catch ( com.android.jack.backend.dex.DexWritingException e ) { session.getReporter ( ) . report ( Severity.FATAL , e ) ; throw new com.android.jack.JackAbortException ( e ) ; } if ( com.android.sched.util.config.ThreadConfig.get ( Options.DETERMINISTIC_MULTIDEX_MODE ) . booleanValue ( ) ) { for ( com.android.jack.ir.ast.JDefinedClassOrInterface type : session.getTypesToEmit ( ) ) { type.removeMarker ( com.android.jack.backend.dex.NumberMarker.class ) ; } } }
Source:
public void testCrLf3 ( ) throws java.lang.Exception { com.android.ide.eclipse.adt.internal.editors.formatting.XmlFormatPreferences prefs = com.android.ide.eclipse.adt.internal.editors.formatting.XmlFormatPreferences.defaults ( ) ; prefs.removeEmptyLines = true ; check ( ( "<root>\r\n" + ( ( ( ( ( ( ( "\r\n" + "\r\n" ) + " [<element/>\r\n" ) + " <second/>]\r\n" ) + "\r\n" ) + "\r\n" ) + "\r\n" ) + "</root>\r\n" ) ) , ( " <element/>\r\n" + " <second/>" ) , ( "<root>\r\n" + ( ( " <element/>\r\n" + " <second/>\r\n" ) + "</root>\r\n" ) ) , prefs ) ; }

Target:
public void testCrLf3 ( ) throws java.lang.Exception { com.android.ide.common.xml.XmlFormatPreferences prefs = com.android.ide.common.xml.XmlFormatPreferences.defaults ( ) ; prefs.removeEmptyLines = true ; check ( ( "<root>\r\n" + ( ( ( ( ( ( ( "\r\n" + "\r\n" ) + " [<element/>\r\n" ) + " <second/>]\r\n" ) + "\r\n" ) + "\r\n" ) + "\r\n" ) + "</root>\r\n" ) ) , ( " <element/>\r\n" + " <second/>" ) , ( "<root>\r\n" + ( ( " <element/>\r\n" + " <second/>\r\n" ) + "</root>\r\n" ) ) , prefs ) ; }
Source:
public void testGetApiByPreviewName ( ) { assertEquals ( 5 , com.android.sdklib.SdkVersionInfo.getApiByPreviewName ( "Eclair" , false ) ) ; assertEquals ( 18 , com.android.sdklib.SdkVersionInfo.getApiByPreviewName ( "JellyBeanMR2" , false ) ) ; assertEquals ( ( - 1 ) , com.android.sdklib.SdkVersionInfo.getApiByPreviewName ( "UnknownName" , false ) ) ; assertEquals ( ( ( com.android.sdklib.SdkVersionInfo.HIGHEST_KNOWN_API ) + 1 ) , com.android.sdklib.SdkVersionInfo.getApiByPreviewName ( "UnknownName" , true ) ) ; }

Target:
public void testGetApiByPreviewName ( ) { assertEquals ( 5 , com.android.sdklib.SdkVersionInfo.getApiByPreviewName ( "Eclair" , false ) ) ; assertEquals ( 18 , com.android.sdklib.SdkVersionInfo.getApiByPreviewName ( "JellyBeanMR2" , false ) ) ; assertEquals ( 21 , com.android.sdklib.SdkVersionInfo.getApiByPreviewName ( "Lollipop" , false ) ) ; assertEquals ( 21 , com.android.sdklib.SdkVersionInfo.getApiByPreviewName ( "L" , false ) ) ; assertEquals ( ( - 1 ) , com.android.sdklib.SdkVersionInfo.getApiByPreviewName ( "UnknownName" , false ) ) ; assertEquals ( ( ( com.android.sdklib.SdkVersionInfo.HIGHEST_KNOWN_API ) + 1 ) , com.android.sdklib.SdkVersionInfo.getApiByPreviewName ( "UnknownName" , true ) ) ; }
Source:
public void stopTethering ( int type ) { try { mService.stopTethering ( type ) ; } catch ( android.os.RemoteException e ) { throw e.rethrowFromSystemServer ( ) ; } }

Target:
public void stopTethering ( int type ) { try { java.lang.String pkgName = mContext.getOpPackageName ( ) ; android.util.Log.i ( android.net.ConnectivityManager.TAG , ( "stopTethering caller:" + pkgName ) ) ; mService.stopTethering ( type , pkgName ) ; } catch ( android.os.RemoteException e ) { throw e.rethrowFromSystemServer ( ) ; } }
Source:
public void testForegroundService ( ) throws java.lang.Exception { android.content.Intent intent = new android.content.Intent ( ) ; intent.setClass ( mContext , com.android.server.cts.device.batterystats.SimpleForegroundService.class ) ; mContext.startForegroundService ( intent ) ; java.lang.Thread.sleep ( 3000 ) ; }

Target:
public void testForegroundService ( ) throws java.lang.Exception { android.content.Intent intent = new android.content.Intent ( ) ; intent.setClass ( mContext , com.android.server.cts.device.batterystats.SimpleForegroundService.class ) ; android.util.Log.i ( com.android.server.cts.device.batterystats.BatteryStatsProcessStateTests.TAG , "Starting foreground service." ) ; mContext.startForegroundService ( intent ) ; java.lang.Thread.sleep ( 3000 ) ; }
Source:
public void testBasic ( ) { com.android.build.gradle.model.AndroidProjectTest.ProjectData projectData = getModelForProject ( "basic" ) ; com.android.builder.model.AndroidProject model = projectData.model ; assertFalse ( "Library Project" , model.isLibrary ( ) ) ; assertEquals ( "Compile Target" , "android-19" , model.getCompileTarget ( ) ) ; assertFalse ( "Non empty bootclasspath" , model.getBootClasspath ( ) . isEmpty ( ) ) ; com.android.builder.model.JavaCompileOptions javaCompileOptions = model.getJavaCompileOptions ( ) ; assertEquals ( "1.6" , javaCompileOptions.getSourceCompatibility ( ) ) ; assertEquals ( "1.6" , javaCompileOptions.getTargetCompatibility ( ) ) ; }

Target:
public void testBasic ( ) { com.android.build.gradle.model.AndroidProjectTest.ProjectData projectData = getModelForProject ( com.android.build.gradle.model.AndroidProjectTest.FOLDER_TEST_REGULAR , "basic" ) ; com.android.builder.model.AndroidProject model = projectData.model ; assertFalse ( "Library Project" , model.isLibrary ( ) ) ; assertEquals ( "Compile Target" , "android-19" , model.getCompileTarget ( ) ) ; assertFalse ( "Non empty bootclasspath" , model.getBootClasspath ( ) . isEmpty ( ) ) ; com.android.builder.model.JavaCompileOptions javaCompileOptions = model.getJavaCompileOptions ( ) ; assertEquals ( "1.6" , javaCompileOptions.getSourceCompatibility ( ) ) ; assertEquals ( "1.6" , javaCompileOptions.getTargetCompatibility ( ) ) ; }
Source:
public void notifyStateChanged ( ) { try { int status = mImsManager.getImsServiceStatus ( ) ; log ( ( "Status Changed: " + status ) ) ; switch ( status ) { case android.telephony.ims.feature.ImsFeature.STATE_READY : { startListeningForCalls ( ) ; break ; } case android.telephony.ims.feature.ImsFeature.STATE_INITIALIZING : case android.telephony.ims.feature.ImsFeature.STATE_NOT_AVAILABLE : { stopListeningForCalls ( ) ; break ; } default : { android.util.Log.w ( com.android.internal.telephony.imsphone.ImsPhoneCallTracker.LOG_TAG , "Unexpected State!" ) ; } } } catch ( com.android.ims.ImsException e ) { retryGetImsService ( ) ; } }

Target:
public void notifyStateChanged ( ) { try { int status = mImsManager.getImsServiceState ( ) ; log ( ( "Status Changed: " + status ) ) ; switch ( status ) { case android.telephony.ims.feature.ImsFeature.STATE_READY : { startListeningForCalls ( ) ; break ; } case android.telephony.ims.feature.ImsFeature.STATE_INITIALIZING : case android.telephony.ims.feature.ImsFeature.STATE_UNAVAILABLE : { stopListeningForCalls ( ) ; break ; } default : { android.util.Log.w ( com.android.internal.telephony.imsphone.ImsPhoneCallTracker.LOG_TAG , "Unexpected State!" ) ; } } } catch ( com.android.ims.ImsException e ) { retryGetImsService ( ) ; } }
Source:
long getHiSyncId ( android.bluetooth.BluetoothDevice device ) { if ( ! ( mDeviceHiSyncIdMap.containsKey ( device ) ) ) { return android.bluetooth.BluetoothHearingAid.HI_SYNC_ID_INVALID ; } return mDeviceHiSyncIdMap.get ( device ) ; }

Target:
public void setActiveDevice ( android.bluetooth.BluetoothDevice device ) { if ( com.android.bluetooth.hearingaid.HearingAidService.DBG ) { android.util.Log.d ( com.android.bluetooth.hearingaid.HearingAidService.TAG , ( "setActiveDevice:" + device ) ) ; } if ( device == null ) { if ( ( mActiveDeviceHiSyncId ) != ( android.bluetooth.BluetoothHearingAid.HI_SYNC_ID_INVALID ) ) { reportActiveDevice ( null ) ; mActiveDeviceHiSyncId = android.bluetooth.BluetoothHearingAid.HI_SYNC_ID_INVALID ; } return ; } java.lang.Long deviceHiSyncId = mDeviceHiSyncIdMap.getOrDefault ( device , BluetoothHearingAid.HI_SYNC_ID_INVALID ) ; if ( deviceHiSyncId != ( mActiveDeviceHiSyncId ) ) { reportActiveDevice ( device ) ; mActiveDeviceHiSyncId = deviceHiSyncId ; } }
Source:
public static void computeAtanh ( android.renderscript.cts.TestAtanh.ArgumentsFloatFloat args ) { args.ulf = 5 ; args.ulfRelaxed = 128 ; double x = ( ( double ) ( args.in ) ) ; args.out = ( ( float ) ( ( java.lang.StrictMath.log ( ( ( x + 1.0 ) / ( x - 1.0 ) ) ) ) / 2.0 ) ) ; }

Target:
public static void computeConvert ( android.renderscript.cts.TestConvert.ArgumentsFloatInt args ) { args.out = android.renderscript.cts.CoreMathVerifier.convertFloatToInt ( args.inV ) ; }
Source:
private void setPhoto ( com.android.dialer.voicemail.model.VoicemailEntry voicemailEntry ) { com.android.dialer.contactphoto.ContactPhotoManager.getInstance ( context ) . loadDialerThumbnailOrPhoto ( quickContactBadge , ( ( voicemailEntry.lookupUri ( ) ) == null ? null : android.net.Uri.parse ( voicemailEntry.lookupUri ( ) ) ) , voicemailEntry.photoId ( ) , ( ( voicemailEntry.photoUri ( ) ) == null ? null : android.net.Uri.parse ( voicemailEntry.photoUri ( ) ) ) , voicemailEntry.name ( ) , LetterTileDrawable.TYPE_DEFAULT ) ; }

Target:
private void setPhoto ( com.android.dialer.voicemail.model.VoicemailEntry voicemailEntry ) { com.android.dialer.contactphoto.ContactPhotoManager.getInstance ( context ) . loadDialerThumbnailOrPhoto ( quickContactBadge , com.android.dialer.voicemail.listui.NewVoicemailViewHolder.parseUri ( voicemailEntry.numberAttributes ( ) . getLookupUri ( ) ) , voicemailEntry.numberAttributes ( ) . getPhotoId ( ) , com.android.dialer.voicemail.listui.NewVoicemailViewHolder.parseUri ( voicemailEntry.numberAttributes ( ) . getPhotoUri ( ) ) , com.android.dialer.voicemail.listui.VoicemailEntryText.buildPrimaryVoicemailText ( context , voicemailEntry ) , LetterTileDrawable.TYPE_DEFAULT ) ; }
Source:
public int getItemCount ( ) { int numberOfHeaders = 0 ; if ( ( todayHeaderPosition ) != null ) { numberOfHeaders ++ ; } if ( ( olderHeaderPosition ) != null ) { numberOfHeaders ++ ; } return ( cursor.getCount ( ) ) + numberOfHeaders ; }

Target:
public int getItemCount ( ) { int numberOfHeaders = 0 ; if ( ( todayHeaderPosition ) != null ) { numberOfHeaders ++ ; } if ( ( yesterdayHeaderPosition ) != null ) { numberOfHeaders ++ ; } if ( ( olderHeaderPosition ) != null ) { numberOfHeaders ++ ; } return ( cursor.getCount ( ) ) + numberOfHeaders ; }
Source:
android.net.NetworkScoreManager getNetworkScoreManager ( ) { android.net.NetworkScoreManager networkScoreManager = mock ( android.net.NetworkScoreManager.class ) ; return networkScoreManager ; }

Target:
private void setupWifiInfo ( ) { when ( mWifiInfo.is24GHz ( ) ) . thenReturn ( true ) ; when ( mWifiInfo.is5GHz ( ) ) . thenReturn ( false ) ; when ( mWifiInfo.getRssi ( ) ) . thenReturn ( ( - 70 ) ) ; when ( mWifiInfo.getNetworkId ( ) ) . thenReturn ( WifiConfiguration.INVALID_NETWORK_ID ) ; when ( mWifiInfo.getBSSID ( ) ) . thenReturn ( null ) ; }
Source:
public void setError ( int code , java.lang.String msg ) { returnCode = code ; returnMsg = msg ; android.util.Slog.w ( com.android.server.pm.PackageManagerService.TAG , msg ) ; }

Target:
public void setReturnCode ( int returnCode ) { this . returnCode = returnCode ; final int childCount = ( ( addedChildPackages ) != null ) ? addedChildPackages.size ( ) : 0 ; for ( int i = 0 ; i < childCount ; i ++ ) { addedChildPackages.valueAt ( i ) . returnCode = returnCode ; } }
Source:
void copy2DRangeFromUnchecked ( int xoff , int yoff , int w , int h , short [ ] data ) { mRS.validate ( ) ; validate2DRange ( xoff , yoff , w , h ) ; mRS.nAllocationData2D ( getIDSafe ( ) , xoff , yoff , mSelectedLOD , mSelectedFace.mID , w , h , data , ( ( data.length ) * 2 ) ) ; }

Target:
public void copy2DRangeFrom ( int xoff , int yoff , int w , int h , android.support.v8.renderscript.Allocation data , int dataXoff , int dataYoff ) { mRS.validate ( ) ; validate2DRange ( xoff , yoff , w , h ) ; mRS.nAllocationData2D ( getIDSafe ( ) , xoff , yoff , mSelectedLOD , mSelectedFace.mID , w , h , data.getID ( mRS ) , dataXoff , dataYoff , data.mSelectedLOD , data.mSelectedFace.mID ) ; }
Source:
void messageFromNative ( com.android.bluetooth.a2dp.A2dpStackEvent stackEvent ) { synchronized ( mStateMachines ) { android.bluetooth.BluetoothDevice device = stackEvent.device ; com.android.bluetooth.a2dp.A2dpStateMachine sm = getOrCreateStateMachine ( device ) ; if ( sm == null ) { android.util.Log.e ( com.android.bluetooth.a2dp.A2dpService.TAG , ( "Cannot process stack event: no state machine: " + stackEvent ) ) ; return ; } sm.sendMessage ( A2dpStateMachine.STACK_EVENT , stackEvent ) ; } }

Target:
java.util.List < android.bluetooth.BluetoothDevice > getDevices ( ) { java.util.List < android.bluetooth.BluetoothDevice > devices = new java.util.ArrayList < > ( ) ; synchronized ( mStateMachines ) { for ( com.android.bluetooth.a2dp.A2dpStateMachine sm : mStateMachines.values ( ) ) { devices.add ( sm.getDevice ( ) ) ; } return devices ; } }
Source:
private void compileAndUpload ( ) { final java.lang.Runnable startUploading = new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { com.intellij.openapi.application.ApplicationManager.getApplication ( ) . invokeLater ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { startUploadingProcess ( ) ; } } ) ; } } ; com.android.tools.idea.gradle.invoker.GradleInvoker.getInstance ( myProject ) . compileJava ( new com.intellij.openapi.module.Module [ ] { myModule } ) ; startUploading.run ( ) ; }

Target:
public void execute ( @ org.jetbrains.annotations.NotNull com.android.tools.idea.gradle.invoker.GradleInvocationResult result ) { invoker.removeAfterGradleInvocationTask ( this ) ; if ( result.isBuildSuccessful ( ) ) { startUploading.run ( ) ; } }
Source:
public final java.nio.MappedByteBuffer load ( ) { try { Libcore.os.mlock ( block.toInt ( ) , block.getSize ( ) ) ; Libcore.os.munlock ( block.toInt ( ) , block.getSize ( ) ) ; } catch ( libcore.io.ErrnoException ignored ) { } return this ; }

Target:
public final java.nio.MappedByteBuffer load ( ) { checkIsMapped ( ) ; try { Libcore.os.mlock ( block.toLong ( ) , block.getSize ( ) ) ; Libcore.os.munlock ( block.toLong ( ) , block.getSize ( ) ) ; } catch ( libcore.io.ErrnoException ignored ) { } return this ; }
Source:
public com.android.dx.dex.file.IndexedItem get ( com.android.dx.rop.cst.Constant cst ) { throw new java.lang.UnsupportedOperationException ( "unsupported" ) ; }

Target:
public com.android.dx.dex.file.IndexedItem get ( com.android.dx.rop.cst.Constant cst ) { if ( cst == null ) { throw new java.lang.NullPointerException ( "cst == null" ) ; } if ( ! ( cst instanceof com.android.dx.rop.cst.CstProtoRef ) ) { throw new java.lang.IllegalArgumentException ( "cst not instance of CstProtoRef" ) ; } throwIfNotPrepared ( ) ; com.android.dx.rop.cst.CstProtoRef protoRef = ( ( com.android.dx.rop.cst.CstProtoRef ) ( cst ) ) ; com.android.dx.dex.file.IndexedItem result = protoIds.get ( protoRef.getPrototype ( ) ) ; if ( result == null ) { throw new java.lang.IllegalArgumentException ( "not found" ) ; } return result ; }
Source:
private static java.lang.String encodeClassLoader ( java.lang.String classpath , java.lang.String classLoaderName ) { java.lang.String classLoaderDexoptEncoding = classLoaderName ; if ( "dalvik.system.PathClassLoader" . equals ( classLoaderName ) ) { classLoaderDexoptEncoding = "PCL" ; } else { android.util.Slog.wtf ( com.android.server.pm.dex.DexoptUtils.TAG , ( "Unsupported classLoaderName: " + classLoaderName ) ) ; } return ( ( classLoaderDexoptEncoding + "[" ) + classpath ) + "]" ; }

Target:
static java.lang.String encodeClassLoader ( java.lang.String classpath , java.lang.String classLoaderName ) { if ( classpath.equals ( PackageDexOptimizer.SKIP_SHARED_LIBRARY_CHECK ) ) { return classpath ; } java.lang.String classLoaderDexoptEncoding = classLoaderName ; if ( "dalvik.system.PathClassLoader" . equals ( classLoaderName ) ) { classLoaderDexoptEncoding = "PCL" ; } else { android.util.Slog.wtf ( com.android.server.pm.dex.DexoptUtils.TAG , ( "Unsupported classLoaderName: " + classLoaderName ) ) ; } return ( ( classLoaderDexoptEncoding + "[" ) + classpath ) + "]" ; }
Source:
public void testKeyPairGenerator_Initialize_ParamsAndSecureRandom_Failure ( ) throws java.lang.Exception { mGenerator.initialize ( new android.security.AndroidKeyPairGeneratorSpec ( getContext ( ) , android.security.AndroidKeyPairGeneratorTest.TEST_ALIAS_1 , android.security.AndroidKeyPairGeneratorTest.TEST_DN_1 , android.security.AndroidKeyPairGeneratorTest.TEST_SERIAL_1 , android.security.AndroidKeyPairGeneratorTest.NOW , android.security.AndroidKeyPairGeneratorTest.NOW_PLUS_10_YEARS ) , new java.security.SecureRandom ( ) ) ; }

Target:
public void testKeyPairGenerator_GenerateKeyPair_Unencrypted_Success ( ) throws java.lang.Exception { mGenerator.initialize ( new android.security.AndroidKeyPairGeneratorSpec.Builder ( getContext ( ) ) . setAlias ( android.security.AndroidKeyPairGeneratorTest.TEST_ALIAS_1 ) . setSubject ( android.security.AndroidKeyPairGeneratorTest.TEST_DN_1 ) . setSerialNumber ( android.security.AndroidKeyPairGeneratorTest.TEST_SERIAL_1 ) . setStartDate ( android.security.AndroidKeyPairGeneratorTest.NOW ) . setEndDate ( android.security.AndroidKeyPairGeneratorTest.NOW_PLUS_10_YEARS ) . build ( ) ) ; final java.security.KeyPair pair = mGenerator.generateKeyPair ( ) ; assertNotNull ( "The KeyPair returned should not be null" , pair ) ; assertKeyPairCorrect ( pair , android.security.AndroidKeyPairGeneratorTest.TEST_ALIAS_1 , android.security.AndroidKeyPairGeneratorTest.TEST_DN_1 , android.security.AndroidKeyPairGeneratorTest.TEST_SERIAL_1 , android.security.AndroidKeyPairGeneratorTest.NOW , android.security.AndroidKeyPairGeneratorTest.NOW_PLUS_10_YEARS ) ; }
Source:
protected void startTestActivity ( java.lang.String testName ) { android.content.Intent intent = new android.content.Intent ( ) ; mTestName = testName ; intent.setAction ( ( "android.intent.action.TEST_START_ACTIVITY_" + testName ) ) ; intent.setComponent ( new android.content.ComponentName ( getInstrumentation ( ) . getContext ( ) , android.assist.cts.TestStartActivity.class ) ) ; intent.putExtra ( Utils.TESTCASE_TYPE , testName ) ; setActivityIntent ( intent ) ; mTestActivity = getActivity ( ) ; }

Target:
protected void startTestActivity ( java.lang.String testName ) { android.content.Intent intent = new android.content.Intent ( ) ; mTestName = testName ; intent.setAction ( ( "android.intent.action.TEST_START_ACTIVITY_" + testName ) ) ; intent.setComponent ( new android.content.ComponentName ( getInstrumentation ( ) . getContext ( ) , android.assist.cts.TestStartActivity.class ) ) ; intent.putExtra ( Utils.TESTCASE_TYPE , testName ) ; setActivityIntent ( intent ) ; mTestActivity = getActivity ( ) ; mActivityManager = ( ( android.app.ActivityManager ) ( mContext.getSystemService ( Context.ACTIVITY_SERVICE ) ) ) ; }
Source:
public void run ( ) { this . values = null ; this . futures = null ; }

Target:
public void run ( ) { if ( this . isCancelled ( ) ) { for ( com.google.common.util.concurrent.ListenableFuture < ? > future : this . futures ) { future.cancel ( this . wasInterrupted ( ) ) ; } } this . futures = null ; this . values = null ; this . combiner = null ; }
Source:
public void testKernelBasicTests ( ) { if ( ! ( android.os.cts.OSFeatures.needsSeccompSupport ( ) ) ) return ; if ( isRunningUnderEmulatedAbi ( ) ) { android.util.Log.d ( android.os.cts.SeccompTest.TAG , "Skipping test running under an emulated ABI" ) ; return ; } final java.lang.String [ ] tests = new java.lang.String [ ] { "global.mode_strict_support" , "global.mode_strict_cannot_call_prctl" , "global.no_new_privs_support" , "global.mode_filter_support" , "global.filter_size_limits" , "global.filter_chain_limits" , "global.mode_filter_cannot_move_to_strict" , "global.mode_filter_get_seccomp" , "global.ALLOW_all" , "global.empty_prog" , "global.unknown_ret_is_kill_inside" , "global.unknown_ret_is_kill_above_allow" , "global.KILL_all" , "global.KILL_one" , "global.KILL_one_arg_one" , "global.KILL_one_arg_six" , "global.arg_out_of_range" , "global.ERRNO_one" , "global.ERRNO_one_ok" } ; runKernelUnitTestSuite ( tests ) ; }

Target:
public void testKernelBasicTests ( ) { if ( ! ( android.os.cts.OSFeatures.needsSeccompSupport ( ) ) ) return ; if ( isRunningUnderEmulatedAbi ( ) ) { android.util.Log.d ( android.os.cts.SeccompTest.TAG , "Skipping test running under an emulated ABI" ) ; return ; } final java.lang.String [ ] tests = new java.lang.String [ ] { "global.mode_strict_support" , "global.mode_strict_cannot_call_prctl" , "global.no_new_privs_support" , "global.mode_filter_support" , "global.filter_size_limits" , "global.filter_chain_limits" , "global.mode_filter_cannot_move_to_strict" , "global.mode_filter_get_seccomp" , "global.ALLOW_all" , "global.empty_prog" , "global.unknown_ret_is_kill_inside" , "global.unknown_ret_is_kill_above_allow" , "global.KILL_all" , "global.KILL_one" , "global.KILL_one_arg_one" , "global.KILL_one_arg_six" , "global.arg_out_of_range" , "global.ERRNO_valid" , "global.ERRNO_zero" } ; runKernelUnitTestSuite ( tests ) ; }
Source:
public void testDecode_Normal ( ) throws java.lang.Exception { tests.api.java.nio.charset.CharsetTest.MockCharset c1 = new tests.api.java.nio.charset.CharsetTest.MockCharset ( "mock" , null ) ; java.nio.CharBuffer cb = c1.decode ( java.nio.ByteBuffer.wrap ( "abcdefg" . getBytes ( "iso8859-1" ) ) ) ; assertEquals ( "abcdefg" , new java.lang.String ( cb.array ( ) ) ) ; cb = c1.decode ( java.nio.ByteBuffer.wrap ( "" . getBytes ( "iso8859-1" ) ) ) ; assertEquals ( "" , new java.lang.String ( cb.array ( ) ) ) ; }

Target:
public void testDecode_Normal ( ) throws java.lang.Exception { org.apache.harmony.tests.java.nio.charset.CharsetTest.MockCharset c1 = new org.apache.harmony.tests.java.nio.charset.CharsetTest.MockCharset ( "mock" , null ) ; java.nio.CharBuffer cb = c1.decode ( java.nio.ByteBuffer.wrap ( "abcdefg" . getBytes ( "iso8859-1" ) ) ) ; assertEquals ( "abcdefg" , new java.lang.String ( cb.array ( ) ) ) ; cb = c1.decode ( java.nio.ByteBuffer.wrap ( "" . getBytes ( "iso8859-1" ) ) ) ; assertEquals ( "" , new java.lang.String ( cb.array ( ) ) ) ; }
Source:
private void assertDumpContainsCallbackLog ( java.lang.String callback , int id , java.lang.String extra ) { java.lang.String serviceDump = dumpService ( ) ; java.lang.String extraPattern = ( extra == null ) ? "" : "," + extra ; java.util.regex.Pattern logLineRegex = java.util.regex.Pattern.compile ( ( ( ( ( ( "^.+" + callback ) + ": ClientInfo\\[uid=\\d+,android\\.os\\.Messenger@[a-f0-9]+\\],Id=" ) + id ) + extraPattern ) + "$" ) , java.util.regex.Pattern.MULTILINE ) ; assertTrue ( ( ( ( ( ( ( ( ( "dump did not contain callback log with callback=" + callback ) + ", id=" ) + id ) + ", extra=" ) + extra ) + ": " ) + serviceDump ) + "\n" ) , logLineRegex.matcher ( serviceDump ) . find ( ) ) ; }

Target:
private void assertDumpContainsCallbackLog ( java.lang.String callback , int id , java.lang.String extra ) { java.lang.String serviceDump = dumpService ( ) ; java.lang.String extraPattern = ( extra == null ) ? "" : "," + extra ; java.util.regex.Pattern logLineRegex = java.util.regex.Pattern.compile ( ( ( ( ( ( "^.+" + callback ) + ": ClientInfo\\[uid=\\d+,android\\.os\\.Messenger@[a-f0-9]+\\],Id=" ) + id ) + extraPattern ) + "$" ) , java.util.regex.Pattern.MULTILINE ) ; org.junit.Assert.assertTrue ( ( ( ( ( ( ( ( ( "dump did not contain callback log with callback=" + callback ) + ", id=" ) + id ) + ", extra=" ) + extra ) + ": " ) + serviceDump ) + "\n" ) , logLineRegex.matcher ( serviceDump ) . find ( ) ) ; }
Source:
public void testNoResidualPermissionsOnUninstall ( ) throws java.lang.Exception { assertNull ( getDevice ( ) . installPackage ( com.android.cts.migration.MigrationHelper.getTestFile ( mCtsBuild , android.appsecurity.cts.PermissionsHostTest.APK_23 ) , false , false ) ) ; runDeviceTests ( android.appsecurity.cts.PermissionsHostTest.USES_PERMISSION_PKG , "com.android.cts.usepermission.UsePermissionTest23" , "testNoResidualPermissionsOnUninstall_part1" ) ; assertNull ( getDevice ( ) . uninstallPackage ( android.appsecurity.cts.PermissionsHostTest.USES_PERMISSION_PKG ) ) ; assertNull ( getDevice ( ) . installPackage ( com.android.cts.migration.MigrationHelper.getTestFile ( mCtsBuild , android.appsecurity.cts.PermissionsHostTest.APK_23 ) , false , false ) ) ; runDeviceTests ( android.appsecurity.cts.PermissionsHostTest.USES_PERMISSION_PKG , "com.android.cts.usepermission.UsePermissionTest23" , "testNoResidualPermissionsOnUninstall_part2" ) ; }

Target:
public void testRevokePropagatedOnUpgradeOldToNewModel ( ) throws java.lang.Exception { assertNull ( getDevice ( ) . installPackage ( com.android.cts.migration.MigrationHelper.getTestFile ( mCtsBuild , android.appsecurity.cts.PermissionsHostTest.APK_22 ) , false , false ) ) ; try { runDeviceTests ( android.appsecurity.cts.PermissionsHostTest.PKG , "com.android.cts.usepermission.UsePermissionTest22" , "testRevokePropagatedOnUpgradeOldToNewModel_part1" ) ; fail ( "App must be killed on a permission revoke" ) ; } catch ( java.lang.AssertionError expected ) { } assertNull ( getDevice ( ) . installPackage ( com.android.cts.migration.MigrationHelper.getTestFile ( mCtsBuild , android.appsecurity.cts.PermissionsHostTest.APK_23 ) , true , false ) ) ; runDeviceTests ( android.appsecurity.cts.PermissionsHostTest.PKG , "com.android.cts.usepermission.UsePermissionTest23" , "testRevokePropagatedOnUpgradeOldToNewModel_part2" ) ; }
Source:
public void run ( ) { updateExternalMediaStatusInner ( mediaStatus , reportStatus ) ; }

Target:
public void run ( ) { mHandler.removeCallbacks ( this ) ; final boolean succeded ; synchronized ( mInstallLock ) { succeded = deleteApplicationCacheFilesLI ( packageName , userId ) ; } clearExternalStorageDataSync ( packageName , userId , false ) ; if ( observer != null ) { try { observer.onRemoveCompleted ( packageName , succeded ) ; } catch ( android.os.RemoteException e ) { android.util.Log.i ( com.android.server.pm.PackageManagerService.TAG , "Observer no longer exists." ) ; } } }
Source:
public boolean isAdequate ( @ com.android.annotations.NonNull java.util.EnumSet < com.android.tools.lint.detector.api.Scope > scope ) { if ( scope.containsAll ( mScope ) ) { return true ; } if ( ( mAnalysisScopes ) != null ) { for ( java.util.EnumSet < com.android.tools.lint.detector.api.Scope > analysisScope : mAnalysisScopes ) { if ( mScope.containsAll ( analysisScope ) ) { return true ; } } } return false ; }

Target:
public boolean isAdequate ( @ com.android.annotations.NonNull java.util.EnumSet < com.android.tools.lint.detector.api.Scope > scope ) { if ( scope.containsAll ( mScope ) ) { return true ; } if ( ( mAnalysisScopes ) != null ) { for ( java.util.EnumSet < com.android.tools.lint.detector.api.Scope > analysisScope : mAnalysisScopes ) { if ( mScope.containsAll ( analysisScope ) ) { return true ; } } } if ( ( ( this ) == ( com.android.tools.lint.client.api.IssueRegistry.LINT_ERROR ) ) || ( ( this ) == ( com.android.tools.lint.client.api.IssueRegistry.PARSER_ERROR ) ) ) { return true ; } return false ; }
Source:
public static java.lang.String getEndpointIdentificationAlgorithm ( javax.net.ssl.SSLParameters params ) { return params.getEndpointIdentificationAlgorithm ( ) ; }

Target:
public static void getSSLParameters ( javax.net.ssl.SSLParameters params , org.conscrypt.SSLParametersImpl impl , org.conscrypt.OpenSSLSocketImpl socket ) { params.setEndpointIdentificationAlgorithm ( impl.getEndpointIdentificationAlgorithm ( ) ) ; if ( ( impl.getUseSni ( ) ) && ( org.conscrypt.AddressUtils.isValidSniHostname ( socket.getHostname ( ) ) ) ) { params.setServerNames ( java.util.Collections.< javax.net.ssl.SNIServerName > singletonList ( new javax.net.ssl.SNIHostName ( socket.getHostname ( ) ) ) ) ; } }
Source:
public void run ( ) { try { vfs.close ( ) ; } catch ( java.io.IOException e ) { logger.log ( java.util.logging.Level.WARNING , ( ( "Failed to close zip for '" + string ) + "'." ) , e ) ; } }

Target:
public com.android.sched.vfs.SequentialOutputVFS checkString ( @ javax.annotation.Nonnull com.android.sched.util.codec.CodecContext context , @ javax.annotation.Nonnull final java.lang.String string ) throws com.android.sched.util.codec.ParsingException { com.android.sched.util.RunnableHooks hooks = context.getRunnableHooks ( ) ; try { final com.android.sched.vfs.OutputZipVFS vfs = new com.android.sched.vfs.OutputZipVFS ( new com.android.sched.util.file.OutputZipFile ( string , hooks , existence , change ) ) ; return vfs ; } catch ( java.io.IOException e ) { throw new com.android.sched.util.codec.ParsingException ( e.getMessage ( ) , e ) ; } }
Source:
public static void main ( java.lang.String [ ] args ) { Main.assertIntEquals ( 7 , Main.testTrueBranch ( 4 , 3 ) ) ; Main.assertIntEquals ( 1 , Main.testFalseBranch ( 4 , 3 ) ) ; Main.assertIntEquals ( 42 , Main.testRemoveLoop ( 42 ) ) ; }

Target:
public static void main ( java.lang.String [ ] args ) { Main.assertIntEquals ( 7 , Main.testTrueBranch ( 4 , 3 ) ) ; Main.assertIntEquals ( 1 , Main.testFalseBranch ( 4 , 3 ) ) ; Main.assertIntEquals ( 42 , Main.testRemoveLoop ( 42 ) ) ; Main.assertIntEquals ( 23 , Main.testUpdateLoopInformation ( 23 ) ) ; Main.assertIntEquals ( 12 , Main.testRemoveSuspendCheck ( 12 , 5 ) ) ; }
Source:
public android.net.Uri getVoicemailRingtoneUri ( android.telecom.PhoneAccountHandle accountHandle ) { final com.android.internal.telephony.Phone phone = com.android.phone.PhoneUtils.getPhoneForPhoneAccountHandle ( accountHandle ) ; if ( phone == null ) { return null ; } return com.android.phone.settings.VoicemailNotificationSettingsUtil.getRingtoneUri ( phone ) ; }

Target:
public void setVoicemailRingtoneUri ( java.lang.String callingPackage , android.telecom.PhoneAccountHandle phoneAccountHandle , android.net.Uri uri ) { mAppOps.checkPackage ( android.os.Binder.getCallingUid ( ) , callingPackage ) ; if ( ! ( android.text.TextUtils.equals ( callingPackage , android.telecom.TelecomManager.from ( mPhone.getContext ( ) ) . getDefaultDialerPackage ( ) ) ) ) { enforceModifyPermissionOrCarrierPrivilege ( com.android.phone.PhoneUtils.getSubIdForPhoneAccountHandle ( phoneAccountHandle ) ) ; } com.android.internal.telephony.Phone phone = com.android.phone.PhoneUtils.getPhoneForPhoneAccountHandle ( phoneAccountHandle ) ; if ( phone == null ) { phone = mPhone ; } com.android.phone.settings.VoicemailNotificationSettingsUtil.setRingtoneUri ( phone , uri ) ; }
Source:
public void run ( ) { for ( com.android.ide.eclipse.adt.editors.layout.gscripts.MenuAction a2 : actions ) { if ( a2 instanceof com.android.ide.eclipse.adt.editors.layout.gscripts.MenuAction.Action ) { try { ( ( com.android.ide.eclipse.adt.editors.layout.gscripts.MenuAction.Action ) ( a2 ) ) . getCallback ( ) . action ( a2 , key , ( ! isChecked ) ) ; } catch ( java.lang.Exception e ) { com.android.ide.eclipse.adt.internal.editors.layout.gre.RulesEngine gre = mCanvas.getRulesEngine ( ) ; gre.logError ( "XML edit operation failed: %s" , e.toString ( ) ) ; } } } }

Target:
public void run ( ) { for ( com.android.ide.common.api.MenuAction a2 : actions ) { if ( a2 instanceof com.android.ide.common.api.MenuAction.Action ) { try { ( ( com.android.ide.common.api.MenuAction.Action ) ( a2 ) ) . getCallback ( ) . action ( a2 , key , ( ! isChecked ) ) ; } catch ( java.lang.Exception e ) { com.android.ide.eclipse.adt.internal.editors.layout.gre.RulesEngine gre = mCanvas.getRulesEngine ( ) ; gre.logError ( "XML edit operation failed: %s" , e.toString ( ) ) ; } } } }
Source:
public void onClose ( ) { if ( com.android.bluetooth.opp.BluetoothOppObexServerSession.V ) android.util.Log.v ( com.android.bluetooth.opp.BluetoothOppObexServerSession.TAG , "release WakeLock" ) ; if ( mWakeLock.isHeld ( ) ) { mWakeLock.release ( ) ; } if ( mPartialWakeLock.isHeld ( ) ) { mPartialWakeLock.release ( ) ; } if ( ( mCallback ) != null ) { android.os.Message msg = android.os.Message.obtain ( mCallback ) ; msg.what = BluetoothOppObexSession.MSG_SESSION_COMPLETE ; msg.obj = mInfo ; msg.sendToTarget ( ) ; } }

Target:
private synchronized void releaseWakeLocks ( ) { if ( mWakeLock.isHeld ( ) ) { mWakeLock.release ( ) ; } if ( mPartialWakeLock.isHeld ( ) ) { mPartialWakeLock.release ( ) ; } }