auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void msgDeviceConnect ( android.bluetooth.BluetoothDevice device ) { android.util.Log.d ( com.android.bluetooth.a2dpsink.mbs.A2dpMediaBrowserService.TAG , "msgDeviceConnect" ) ; mA2dpDevice = device ; refreshInitialPlayingState ( ) ; }

Target:
private synchronized void msgDeviceConnect ( android.bluetooth.BluetoothDevice device ) { android.util.Log.d ( com.android.bluetooth.a2dpsink.mbs.A2dpMediaBrowserService.TAG , "msgDeviceConnect" ) ; mA2dpDevice = device ; mAvrcpCtrlSrvc = com.android.bluetooth.avrcpcontroller.AvrcpControllerService.getAvrcpControllerService ( ) ; if ( ( mAvrcpCtrlSrvc ) == null ) { android.util.Log.e ( com.android.bluetooth.a2dpsink.mbs.A2dpMediaBrowserService.TAG , "!!!AVRCP Controller cannot be null" ) ; return ; } refreshInitialPlayingState ( ) ; }
Source:
void onDisconnect ( com.android.internal.telephony.cdma.DisconnectCause cause ) { this . cause = cause ; if ( ! ( disconnected ) ) { doDisconnect ( ) ; if ( false ) android.util.Log.d ( com.android.internal.telephony.cdma.CdmaConnection.LOG_TAG , ( "[CDMAConn] onDisconnect: cause=" + cause ) ) ; owner.phone.notifyDisconnect ( this ) ; if ( ( parent ) != null ) { parent.connectionDisconnected ( this ) ; } } releaseWakeLock ( ) ; }

Target:
void onDisconnect ( com.android.internal.telephony.cdma.DisconnectCause cause ) { this . cause = cause ; if ( ! ( disconnected ) ) { doDisconnect ( ) ; if ( false ) android.telephony.Rlog.d ( com.android.internal.telephony.cdma.CdmaConnection.LOG_TAG , ( "[CDMAConn] onDisconnect: cause=" + cause ) ) ; owner.phone.notifyDisconnect ( this ) ; if ( ( parent ) != null ) { parent.connectionDisconnected ( this ) ; } } releaseWakeLock ( ) ; }
Source:
public static void loadAsync ( android.content.Context context ) { if ( com.android.cts.verifier.sensors.helpers.OpenCVLibrary.isLoaded ( ) ) return ; org.opencv.android.OpenCVLoader.initAsync ( OpenCVLoader.OPENCV_VERSION_2_4_9 , context , new org.opencv.android.BaseLoaderCallback ( context ) { @ java.lang.Override public void onManagerConnected ( int status ) { android.util.Log.v ( com.android.cts.verifier.sensors.helpers.OpenCVLibrary.TAG , ( "New Loading status: " + status ) ) ; switch ( status ) { case org.opencv.android.LoaderCallbackInterface.SUCCESS : { com.android.cts.verifier.sensors.helpers.OpenCVLibrary.mLoaded = true ; } break ; default : { super . onManagerConnected ( status ) ; } break ; } } } ) ; }

Target:
public static void loadAsync ( android.content.Context context ) { if ( com.android.cts.verifier.sensors.helpers.OpenCVLibrary.isLoaded ( ) ) return ; org.opencv.android.OpenCVLoader.initAsync ( OpenCVLoader.OPENCV_VERSION_3_0_0 , context , new org.opencv.android.BaseLoaderCallback ( context ) { @ java.lang.Override public void onManagerConnected ( int status ) { android.util.Log.v ( com.android.cts.verifier.sensors.helpers.OpenCVLibrary.TAG , ( "New Loading status: " + status ) ) ; switch ( status ) { case org.opencv.android.LoaderCallbackInterface.SUCCESS : { com.android.cts.verifier.sensors.helpers.OpenCVLibrary.mLoaded = true ; } break ; default : { super . onManagerConnected ( status ) ; } break ; } } } ) ; }
Source:
public org.objectweb.asm.MethodVisitor visitMethod ( int access , java.lang.String name , java.lang.String desc , java.lang.String signature , java.lang.String [ ] exceptions ) { if ( com.google.devtools.build.android.desugar.BitFlags.isSet ( access , Opcodes.ACC_BRIDGE ) ) { ++ ( bridgeMethods ) ; } if ( "<clinit>" . equals ( name ) ) { ++ ( clinitMethods ) ; } return super . visitMethod ( access , name , desc , signature , exceptions ) ; }

Target:
public org.objectweb.asm.MethodVisitor visitMethod ( int access , java.lang.String name , java.lang.String desc , java.lang.String signature , java.lang.String [ ] exceptions ) { if ( com.google.devtools.build.android.desugar.io.BitFlags.isSet ( access , Opcodes.ACC_BRIDGE ) ) { ++ ( bridgeMethods ) ; } if ( "<clinit>" . equals ( name ) ) { ++ ( clinitMethods ) ; } return super . visitMethod ( access , name , desc , signature , exceptions ) ; }
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 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 testGet1_IndexOutOfBoundsException ( ) { try { java.util.concurrent.CopyOnWriteArrayList c = new java.util.concurrent.CopyOnWriteArrayList ( ) ; c.get ( ( - 1 ) ) ; shouldThrow ( ) ; } catch ( java.lang.IndexOutOfBoundsException success ) { } }

Target:
public void testGet1_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.get ( ( - 1 ) ) ; shouldThrow ( ) ; } catch ( java.lang.IndexOutOfBoundsException success ) { } } }
Source:
private synchronized void onApplicationStateChanged ( byte [ ] address , boolean registered ) { if ( com.android.bluetooth.hid.HidDeviceService.DBG ) { android.util.Log.d ( com.android.bluetooth.hid.HidDeviceService.TAG , ( "onApplicationStateChanged(): registered=" + registered ) ) ; } android.os.Message msg = mHandler.obtainMessage ( com.android.bluetooth.hid.HidDeviceService.MESSAGE_APPLICATION_STATE_CHANGED ) ; msg.obj = address ; msg.arg1 = ( registered ) ? 1 : 0 ; mHandler.sendMessage ( msg ) ; }

Target:
synchronized void onConnectStateChangedFromNative ( android.bluetooth.BluetoothDevice device , int state ) { if ( com.android.bluetooth.hid.HidDeviceService.DBG ) { android.util.Log.d ( com.android.bluetooth.hid.HidDeviceService.TAG , ( ( ( "onConnectStateChanged(): device=" + device ) + " state=" ) + state ) ) ; } android.os.Message msg = mHandler.obtainMessage ( com.android.bluetooth.hid.HidDeviceService.MESSAGE_CONNECT_STATE_CHANGED ) ; msg.obj = device ; msg.arg1 = state ; mHandler.sendMessage ( msg ) ; }
Source:
public void onCreate ( ) { super . onCreate ( ) ; mBluetoothManager = ( ( android.bluetooth.BluetoothManager ) ( getSystemService ( Context.BLUETOOTH_SERVICE ) ) ) ; mBluetoothAdapter = mBluetoothManager.getAdapter ( ) ; mScanner = mBluetoothAdapter.getBluetoothLeScanner ( ) ; mHandler = new android.os.Handler ( ) ; mContext = this ; startScan ( ) ; }

Target:
public void onCreate ( ) { super . onCreate ( ) ; registerReceiver ( mBondStatusReceiver , new android.content.IntentFilter ( android.bluetooth.BluetoothDevice.ACTION_BOND_STATE_CHANGED ) ) ; mBluetoothManager = ( ( android.bluetooth.BluetoothManager ) ( getSystemService ( Context.BLUETOOTH_SERVICE ) ) ) ; mBluetoothAdapter = mBluetoothManager.getAdapter ( ) ; mScanner = mBluetoothAdapter.getBluetoothLeScanner ( ) ; mHandler = new android.os.Handler ( ) ; mContext = this ; mNotifyCount = 0 ; mTaskQueue = new com.android.cts.verifier.bluetooth.TestTaskQueue ( ( ( getClass ( ) . getName ( ) ) + "_taskHandlerThread" ) ) ; }
Source:
public void testNewInstanceString_IntArrayIntIntConstructor ( ) { runTestNewInstanceString ( "([III)V" , new org.apache.harmony.jpda.tests.jdwp.ClassType.ConstructorArgumentsProvider ( ) { @ java.lang.Override public void provideConstructorArguments ( java.util.List < org.apache.harmony.jpda.tests.framework.jdwp.Value > constructorArguments ) { long debuggeeClassId = getClassIDBySignature ( getDebuggeeClassSignature ( ) ) ; org.apache.harmony.jpda.tests.framework.jdwp.Value intArrayValue = getStaticFieldValue ( debuggeeClassId , "INT_ARRAY" ) ; constructorArguments.add ( intArrayValue ) ; constructorArguments.add ( new org.apache.harmony.jpda.tests.framework.jdwp.Value ( 0 ) ) ; constructorArguments.add ( new org.apache.harmony.jpda.tests.framework.jdwp.Value ( 1 ) ) ; } } ) ; }

Target:
public void testNewInstanceString_IntArrayIntIntConstructor ( ) { runTestNewInstanceString ( "([III)V" , "m" , new org.apache.harmony.jpda.tests.jdwp.ClassType.ConstructorArgumentsProvider ( ) { @ java.lang.Override public void provideConstructorArguments ( java.util.List < org.apache.harmony.jpda.tests.framework.jdwp.Value > constructorArguments ) { long debuggeeClassId = getClassIDBySignature ( getDebuggeeClassSignature ( ) ) ; org.apache.harmony.jpda.tests.framework.jdwp.Value intArrayValue = getStaticFieldValue ( debuggeeClassId , "INT_ARRAY" ) ; constructorArguments.add ( intArrayValue ) ; constructorArguments.add ( new org.apache.harmony.jpda.tests.framework.jdwp.Value ( 0 ) ) ; constructorArguments.add ( new org.apache.harmony.jpda.tests.framework.jdwp.Value ( 1 ) ) ; } } ) ; }
Source:
private void updateNodeProxies ( com.android.ide.eclipse.adt.internal.editors.layout.gle2.CanvasViewInfo vi ) { if ( vi == null ) { return ; } com.android.ide.eclipse.adt.internal.editors.layout.uimodel.UiViewElementNode key = vi.getUiViewKey ( ) ; if ( key != null ) { mNodeFactory.create ( vi ) ; } for ( com.android.ide.eclipse.adt.internal.editors.layout.gle2.CanvasViewInfo child : vi.getChildren ( ) ) { updateNodeProxies ( child ) ; } }

Target:
void delete ( ) { mDeleteAction.run ( ) ; }
Source:
private void updateEnclosingType ( @ javax.annotation.Nonnull com.android.jack.ir.ast.JDefinedClassOrInterface type ) { com.android.jack.ir.ast.JClassOrInterface enclosingType = type.getEnclosingType ( ) ; while ( enclosingType instanceof com.android.jack.ir.ast.JDefinedClassOrInterface ) { if ( ( ! ( mustBeRemovedInternal ( enclosingType ) ) ) || ( ! ( enclosingType.isToEmit ( ) ) ) ) { break ; } enclosingType = ( ( com.android.jack.ir.ast.JDefinedClassOrInterface ) ( enclosingType ) ) . getEnclosingType ( ) ; } type.setEnclosingType ( enclosingType ) ; }

Target:
private void updateEnclosingType ( @ javax.annotation.Nonnull com.android.jack.ir.ast.JDefinedClassOrInterface type ) { com.android.jack.ir.ast.JClassOrInterface enclosingType = type.getEnclosingType ( ) ; while ( enclosingType instanceof com.android.jack.ir.ast.JDefinedClassOrInterface ) { if ( ( ! ( mustBeRemovedInternal ( enclosingType ) ) ) || ( isTypeFromClasspath ( type ) ) ) { break ; } enclosingType = ( ( com.android.jack.ir.ast.JDefinedClassOrInterface ) ( enclosingType ) ) . getEnclosingType ( ) ; } type.setEnclosingType ( enclosingType ) ; }
Source:
private static void checkAndUpdateBooleanAliases ( java.util.Map < java.lang.String , java.lang.reflect.Field > nameToFieldMap , java.util.Map < java.lang.String , java.lang.String > booleanAliasMap , java.lang.String optionName ) { com.google.devtools.common.options.IsolatedOptionsData.checkForCollisions ( nameToFieldMap , ( "no" + optionName ) , "boolean option alias" ) ; booleanAliasMap.put ( ( "no" + optionName ) , optionName ) ; }

Target:
private static void checkAndUpdateBooleanAliases ( java.util.Map < java.lang.String , java.lang.reflect.Field > nameToFieldMap , java.util.Map < java.lang.String , java.lang.String > booleanAliasMap , java.lang.String optionName ) { com.google.devtools.common.options.IsolatedOptionsData.checkForCollisions ( nameToFieldMap , ( "no_" + optionName ) , "boolean option alias" ) ; com.google.devtools.common.options.IsolatedOptionsData.checkForCollisions ( nameToFieldMap , ( "no" + optionName ) , "boolean option alias" ) ; booleanAliasMap.put ( ( "no_" + optionName ) , optionName ) ; booleanAliasMap.put ( ( "no" + optionName ) , optionName ) ; }
Source:
public com.android.dx.ssa.RegisterSpec getLocalAssignment ( ) { com.android.dx.ssa.RegisterSpec assignment ; if ( ( insn.getOpcode ( ) . getOpcode ( ) ) == ( RegOps.MARK_LOCAL ) ) { assignment = insn.getSources ( ) . get ( 0 ) ; } else { assignment = getResult ( ) ; } if ( assignment == null ) { return null ; } com.android.dx.ssa.LocalItem local = assignment.getLocalItem ( ) ; if ( local == null ) { return null ; } return assignment ; }

Target:
public com.android.dx.rop.code.RegisterSpec getLocalAssignment ( ) { com.android.dx.rop.code.RegisterSpec assignment ; if ( ( insn.getOpcode ( ) . getOpcode ( ) ) == ( com.android.dx.rop.code.RegOps.MARK_LOCAL ) ) { assignment = insn.getSources ( ) . get ( 0 ) ; } else { assignment = getResult ( ) ; } if ( assignment == null ) { return null ; } com.android.dx.rop.code.LocalItem local = assignment.getLocalItem ( ) ; if ( local == null ) { return null ; } return assignment ; }
Source:
private void handleCopyAndInstall ( android.content.Context context , byte [ ] checkToken , libcore.tzdata.prototype_updater.RulesCheckReceiver.DistroVersionInfo distroVersionInfo ) { android.app.timezone.RulesState rulesState = mRulesManager.getRulesState ( ) ; if ( ! ( ( rulesState.isDistroFormatVersionSupported ( distroVersionInfo.mDistroFormatVersion ) ) && ( rulesState.isSystemVersionOlderThan ( distroVersionInfo.mDistroRulesVersion ) ) ) ) { handleCheckComplete ( checkToken , true ) ; return ; } java.io.File file = libcore.tzdata.prototype_updater.RulesCheckReceiver.copyDataToLocalFile ( context ) ; if ( file == null ) { boolean success = false ; handleCheckComplete ( checkToken , success ) ; return ; } handleInstall ( checkToken , file ) ; }

Target:
private void handleCopyAndInstall ( android.content.Context context , byte [ ] checkToken , libcore.tzdata.prototype_updater.RulesCheckReceiver.DistroVersionInfo distroVersionInfo ) { android.app.timezone.RulesState rulesState = mRulesManager.getRulesState ( ) ; if ( ( ! ( rulesState.isDistroFormatVersionSupported ( distroVersionInfo.mDistroFormatVersion ) ) ) || ( rulesState.isSystemVersionNewerThan ( distroVersionInfo.mDistroRulesVersion ) ) ) { handleCheckComplete ( checkToken , true ) ; return ; } java.io.File file = libcore.tzdata.prototype_updater.RulesCheckReceiver.copyDataToLocalFile ( context ) ; if ( file == null ) { boolean success = false ; handleCheckComplete ( checkToken , success ) ; return ; } handleInstall ( checkToken , file ) ; }
Source:
public static java.lang.String getPackageVersionName ( android.content.Context context ) { java.lang.String msg = "versionName not available" ; try { android.content.pm.PackageManager pm = context.getPackageManager ( ) ; android.content.pm.PackageInfo pi = pm.getPackageInfo ( context.getPackageName ( ) , 0 ) ; msg = "" ; if ( ( pi.versionName ) != null ) { msg = pi.versionName ; } } catch ( android.content.pm.PackageManager.NameNotFoundException e ) { org.chromium.base.Log.d ( org.chromium.base.BuildInfo.TAG , msg ) ; } return msg ; }

Target:
public static java.lang.String getPackageVersionName ( ) { java.lang.String msg = "versionName not available" ; try { android.content.pm.PackageManager pm = org.chromium.base.ContextUtils.getApplicationContext ( ) . getPackageManager ( ) ; android.content.pm.PackageInfo pi = pm.getPackageInfo ( org.chromium.base.BuildInfo.getPackageName ( ) , 0 ) ; msg = "" ; if ( ( pi.versionName ) != null ) { msg = pi.versionName ; } } catch ( android.content.pm.PackageManager.NameNotFoundException e ) { org.chromium.base.Log.d ( org.chromium.base.BuildInfo.TAG , msg ) ; } return msg ; }
Source:
public void run ( int i ) { assertTrue ( cursor.moveToNext ( ) ) ; try ( android.database.Cursor c = mContentResolver.query ( channelUri , null , null , null , null ) ) { while ( c.moveToNext ( ) ) { } } }

Target:
public void run ( int i ) { assertTrue ( cursor.moveToNext ( ) ) ; try ( android.database.Cursor c = mContentResolver.query ( android.media.tv.TvContract.buildChannelUri ( cursor.getLong ( 0 ) ) , null , null , null , null ) ) { while ( c.moveToNext ( ) ) { } } }
Source:
public float getDistanceFromCell ( float x , float y , int [ ] cell ) { cellToCenterPoint ( cell [ 0 ] , cell [ 1 ] , mTmpPoint ) ; float distance = ( ( float ) ( java.lang.Math.sqrt ( ( ( java.lang.Math.pow ( ( x - ( mTmpPoint [ 0 ] ) ) , 2 ) ) + ( java.lang.Math.pow ( ( y - ( mTmpPoint [ 1 ] ) ) , 2 ) ) ) ) ) ) ; return distance ; }

Target:
public float getDistanceFromCell ( float x , float y , int [ ] cell ) { cellToCenterPoint ( cell [ 0 ] , cell [ 1 ] , mTmpPoint ) ; float distance = ( ( float ) ( java.lang.Math.hypot ( ( x - ( mTmpPoint [ 0 ] ) ) , ( y - ( mTmpPoint [ 1 ] ) ) ) ) ) ; return distance ; }
Source:
public void dumpDoesNotClearLastFailureData ( ) throws java.lang.Exception { mLastMileLogger.reportConnectionEvent ( BaseWifiDiagnostics.CONNECTION_EVENT_STARTED ) ; android.os.FileUtils.stringToFile ( mTraceDataFile.getPath ( ) , "rdev_connect" ) ; mLastMileLogger.reportConnectionEvent ( BaseWifiDiagnostics.CONNECTION_EVENT_FAILED ) ; getDumpString ( ) ; java.lang.String dumpString = getDumpString ( ) ; org.junit.Assert.assertTrue ( dumpString.contains ( "rdev_connect" ) ) ; }

Target:
public void dumpDoesNotClearPendingConnectionTrace ( ) throws java.lang.Exception { mLastMileLogger.reportConnectionEvent ( com.android.server.wifi.LastMileLoggerTest.FAKE_CONNECTION_ID , BaseWifiDiagnostics.CONNECTION_EVENT_STARTED ) ; android.os.FileUtils.stringToFile ( mTraceDataFile.getPath ( ) , "rdev_connect" ) ; getDumpString ( ) ; java.lang.String dumpString = getDumpString ( ) ; org.junit.Assert.assertTrue ( dumpString.contains ( "rdev_connect" ) ) ; }
Source:
public final void accept ( @ com.android.annotations.NonNull com.android.tools.perflib.heap.Visitor visitor ) { if ( visitor.visitEnter ( this ) ) { for ( java.lang.Object value : getStaticFieldValues ( ) . values ( ) ) { if ( value instanceof com.android.tools.perflib.heap.Instance ) { ( ( com.android.tools.perflib.heap.Instance ) ( value ) ) . accept ( visitor ) ; } } visitor.visitLeave ( this ) ; } }

Target:
public final void accept ( @ com.android.annotations.NonNull com.android.tools.perflib.heap.Visitor visitor ) { visitor.visitClassObj ( this ) ; for ( java.lang.Object value : getStaticFieldValues ( ) . values ( ) ) { if ( value instanceof com.android.tools.perflib.heap.Instance ) { visitor.visitLater ( ( ( com.android.tools.perflib.heap.Instance ) ( value ) ) ) ; } } }
Source:
private int getDexoptNeeded ( java.lang.String path , java.lang.String isa , java.lang.String compilerFilter , boolean newProfile , boolean downgrade ) { int dexoptNeeded ; try { dexoptNeeded = dalvik.system.DexFile.getDexOptNeeded ( path , isa , compilerFilter , newProfile , downgrade ) ; } catch ( java.io.IOException ioe ) { android.util.Slog.w ( com.android.server.pm.PackageDexOptimizer.TAG , ( "IOException reading apk: " + path ) , ioe ) ; return com.android.server.pm.PackageDexOptimizer.DEX_OPT_FAILED ; } return adjustDexoptNeeded ( dexoptNeeded ) ; }

Target:
private int getDexoptNeeded ( java.lang.String path , java.lang.String isa , java.lang.String compilerFilter , java.lang.String classLoaderContext , boolean newProfile , boolean downgrade ) { int dexoptNeeded ; try { dexoptNeeded = dalvik.system.DexFile.getDexOptNeeded ( path , isa , compilerFilter , classLoaderContext , newProfile , downgrade ) ; } catch ( java.io.IOException ioe ) { android.util.Slog.w ( com.android.server.pm.PackageDexOptimizer.TAG , ( "IOException reading apk: " + path ) , ioe ) ; return com.android.server.pm.PackageDexOptimizer.DEX_OPT_FAILED ; } return adjustDexoptNeeded ( dexoptNeeded ) ; }
Source:
private void performDexOptLibsLI ( java.util.ArrayList < java.lang.String > libs , java.lang.String [ ] instructionSets , boolean forceDex , boolean defer , android.util.ArraySet < java.lang.String > done ) { for ( java.lang.String libName : libs ) { android.content.pm.PackageParser.Package libPkg = mPackageManagerService.findSharedNonSystemLibrary ( libName ) ; if ( ( libPkg != null ) && ( ! ( done.contains ( libName ) ) ) ) { performDexOptLI ( libPkg , instructionSets , forceDex , defer , done ) ; } } }

Target:
private void performDexOptLibsLI ( java.util.ArrayList < java.lang.String > libs , java.lang.String [ ] instructionSets , boolean forceDex , boolean defer , boolean bootComplete , android.util.ArraySet < java.lang.String > done ) { for ( java.lang.String libName : libs ) { android.content.pm.PackageParser.Package libPkg = mPackageManagerService.findSharedNonSystemLibrary ( libName ) ; if ( ( libPkg != null ) && ( ! ( done.contains ( libName ) ) ) ) { performDexOptLI ( libPkg , instructionSets , forceDex , defer , bootComplete , done ) ; } } }
Source:
public static void testSendEtwsMessageCancel ( android.app.Activity activity , int serialNumber ) { android.content.Intent intent = new android.content.Intent ( android.provider.Telephony.Sms.Intents.SMS_EMERGENCY_CB_RECEIVED_ACTION ) ; intent.putExtra ( "message" , com.android.cellbroadcastreceiver.tests.SendTestMessages.createFromPdu ( activity , com.android.cellbroadcastreceiver.tests.SendTestMessages.etwsMessageCancel , serialNumber , 0 ) ) ; activity.sendOrderedBroadcastAsUser ( intent , UserHandle.ALL , Manifest.permission.RECEIVE_EMERGENCY_BROADCAST , AppOpsManager.OP_RECEIVE_EMERGECY_SMS , null , null , Activity.RESULT_OK , null , null ) ; }

Target:
public static void testSendEtwsMessageCancel ( android.app.Activity activity , int serialNumber ) { com.android.cellbroadcastreceiver.tests.SendTestMessages.sendBroadcast ( activity , serialNumber , 0 , com.android.cellbroadcastreceiver.tests.SendTestMessages.etwsMessageCancel ) ; }
Source:
public boolean containsErrors ( ) { if ( ! ( mErrors.isEmpty ( ) ) ) { return true ; } if ( ! ( mV2SchemeSigners.isEmpty ( ) ) ) { for ( com.android.apksigner.core.ApkVerifier.Result.V2SchemeSignerInfo signer : mV2SchemeSigners ) { if ( signer.containsErrors ( ) ) { return true ; } } } return false ; }

Target:
public boolean containsErrors ( ) { if ( ! ( mErrors.isEmpty ( ) ) ) { return true ; } if ( ! ( mV1SchemeSigners.isEmpty ( ) ) ) { for ( com.android.apksigner.core.ApkVerifier.Result.V1SchemeSignerInfo signer : mV1SchemeSigners ) { if ( signer.containsErrors ( ) ) { return true ; } } } if ( ! ( mV2SchemeSigners.isEmpty ( ) ) ) { for ( com.android.apksigner.core.ApkVerifier.Result.V2SchemeSignerInfo signer : mV2SchemeSigners ) { if ( signer.containsErrors ( ) ) { return true ; } } } return false ; }
Source:
protected org.eclipse.swt.widgets.Control createContents ( org.eclipse.swt.widgets.Composite parent ) { org.eclipse.swt.widgets.Control control = super . createContents ( parent ) ; getShell ( ) . setText ( ( ( mAvdInfo ) == null ? "Create new Android Virtual Device (AVD)" : "Edit Android Virtual Device (AVD)" ) ) ; mOkButton = getButton ( IDialogConstants.OK_ID ) ; if ( ( mAvdInfo ) != null ) { fillExistingAvdInfo ( mAvdInfo ) ; } else if ( ( mInitWithDevice ) != null ) { fillInitialDeviceInfo ( mInitWithDevice ) ; } validatePage ( ) ; return control ; }

Target:
protected org.eclipse.swt.widgets.Control createContents ( org.eclipse.swt.widgets.Composite parent ) { org.eclipse.swt.widgets.Control control = super . createContents ( parent ) ; getShell ( ) . setMinimumSize ( new org.eclipse.swt.graphics.Point ( 350 , 600 ) ) ; getShell ( ) . setText ( ( ( mAvdInfo ) == null ? "Create new Android Virtual Device (AVD)" : "Edit Android Virtual Device (AVD)" ) ) ; mOkButton = getButton ( IDialogConstants.OK_ID ) ; if ( ( mAvdInfo ) != null ) { fillExistingAvdInfo ( mAvdInfo ) ; } else if ( ( mInitWithDevice ) != null ) { fillInitialDeviceInfo ( mInitWithDevice ) ; } validatePage ( ) ; return control ; }
Source:
public void setTime ( long millis ) { mContext.enforceCallingOrSelfPermission ( "android.permission.SET_TIME" , "setTime" ) ; android.os.SystemClock.setCurrentTimeMillis ( millis ) ; }

Target:
public boolean setTime ( long millis ) { mContext.enforceCallingOrSelfPermission ( "android.permission.SET_TIME" , "setTime" ) ; if ( ( mNativeData ) == 0 ) { android.util.Slog.w ( com.android.server.AlarmManagerService.TAG , "Not setting time since no alarm driver is available." ) ; return false ; } synchronized ( mLock ) { return ( setKernelTime ( mNativeData , millis ) ) == 0 ; } }
Source:
public android.graphics.Bitmap getBitmapWithDrmCheck ( ) throws android.drm.mobile1.DrmException { return internalGetBitmap ( getUriWithDrmCheck ( ) ) ; }

Target:
public void cancelThumbnailLoading ( ) { if ( ( mItemLoadedFuture ) != null ) { if ( android.util.Log.isLoggable ( LogTag.APP , Log.DEBUG ) ) { android.util.Log.v ( com.android.mms.model.ImageModel.TAG , ( "cancelThumbnailLoading for: " + ( this ) ) ) ; } mItemLoadedFuture.cancel ( ) ; mItemLoadedFuture = null ; } }
Source:
public boolean setNetworkSelectionModeManual ( int subId , com.android.internal.telephony.OperatorInfo operator , boolean persistSelection ) { try { com.android.internal.telephony.ITelephony telephony = getITelephony ( ) ; if ( telephony != null ) return telephony.setNetworkSelectionModeManual ( subId , operator , persistSelection ) ; } catch ( android.os.RemoteException ex ) { android.telephony.Rlog.e ( android.telephony.TelephonyManager.TAG , "setNetworkSelectionModeManual RemoteException" , ex ) ; } catch ( java.lang.NullPointerException ex ) { android.telephony.Rlog.e ( android.telephony.TelephonyManager.TAG , "setNetworkSelectionModeManual NPE" , ex ) ; } return false ; }

Target:
public void setNetworkSelectionModeAutomatic ( ) { try { com.android.internal.telephony.ITelephony telephony = getITelephony ( ) ; if ( telephony != null ) { telephony.setNetworkSelectionModeAutomatic ( getSubId ( ) ) ; } } catch ( android.os.RemoteException ex ) { android.telephony.Rlog.e ( android.telephony.TelephonyManager.TAG , "setNetworkSelectionModeAutomatic RemoteException" , ex ) ; } catch ( java.lang.NullPointerException ex ) { android.telephony.Rlog.e ( android.telephony.TelephonyManager.TAG , "setNetworkSelectionModeAutomatic NPE" , ex ) ; } }
Source:
private android.graphics.drawable.Drawable getDrawableForBitmap ( android.content.res.Resources resources , android.graphics.Bitmap bitmap , com.android.dialer.contactphoto.ContactPhotoManagerImpl.Request request ) { if ( request.mIsCircular ) { final android.support.v4.graphics.drawable.RoundedBitmapDrawable drawable = android.support.v4.graphics.drawable.RoundedBitmapDrawableFactory.create ( resources , bitmap ) ; drawable.setAntiAlias ( true ) ; drawable.setCornerRadius ( ( ( drawable.getIntrinsicHeight ( ) ) / 2 ) ) ; return drawable ; } else { return new android.graphics.drawable.BitmapDrawable ( resources , bitmap ) ; } }

Target:
private android.graphics.drawable.Drawable getDrawableForBitmap ( android.content.res.Resources resources , android.graphics.Bitmap bitmap , com.android.dialer.contactphoto.ContactPhotoManagerImpl.Request request ) { if ( request.isCircular ) { final android.support.v4.graphics.drawable.RoundedBitmapDrawable drawable = android.support.v4.graphics.drawable.RoundedBitmapDrawableFactory.create ( resources , bitmap ) ; drawable.setAntiAlias ( true ) ; drawable.setCornerRadius ( ( ( drawable.getIntrinsicHeight ( ) ) / 2 ) ) ; return drawable ; } else { return new android.graphics.drawable.BitmapDrawable ( resources , bitmap ) ; } }
Source:
final void get ( int [ ] dst , int dstOffset , int intCount ) { checkNotFreed ( ) ; int byteCount = checkGetBounds ( SizeOf.INT , dst.length , dstOffset , intCount ) ; this . block.peekIntArray ( ( ( offset ) + ( position ) ) , dst , dstOffset , intCount , order.needsSwap ) ; position += byteCount ; }

Target:
final void get ( int [ ] dst , int dstOffset , int intCount ) { checkIsAccessible ( ) ; int byteCount = checkGetBounds ( SizeOf.INT , dst.length , dstOffset , intCount ) ; this . block.peekIntArray ( ( ( offset ) + ( position ) ) , dst , dstOffset , intCount , order.needsSwap ) ; position += byteCount ; }
Source:
public java.lang.String getPhotoUri ( ) { switch ( nameSource ) { case com.android.dialer.phonelookup.consolidator.PhoneLookupInfoConsolidator.NameSource.CP2_DEFAULT_DIRECTORY : return com.android.dialer.common.Assert.isNotNull ( firstDefaultCp2Contact ) . getPhotoUri ( ) ; case com.android.dialer.phonelookup.consolidator.PhoneLookupInfoConsolidator.NameSource.CP2_EXTENDED_DIRECTORY : return com.android.dialer.common.Assert.isNotNull ( firstExtendedCp2Contact ) . getPhotoUri ( ) ; case com.android.dialer.phonelookup.consolidator.PhoneLookupInfoConsolidator.NameSource.PEOPLE_API : case com.android.dialer.phonelookup.consolidator.PhoneLookupInfoConsolidator.NameSource.NONE : return "" ; default : throw com.android.dialer.common.Assert.createUnsupportedOperationFailException ( java.lang.String.format ( "Unsupported name source: %s" , nameSource ) ) ; } }

Target:
public java.lang.String getPhotoUri ( ) { switch ( nameSource ) { case com.android.dialer.phonelookup.consolidator.PhoneLookupInfoConsolidator.NameSource.CP2_DEFAULT_DIRECTORY : return com.android.dialer.common.Assert.isNotNull ( firstDefaultCp2Contact ) . getPhotoUri ( ) ; case com.android.dialer.phonelookup.consolidator.PhoneLookupInfoConsolidator.NameSource.CP2_EXTENDED_DIRECTORY : return com.android.dialer.common.Assert.isNotNull ( firstExtendedCp2Contact ) . getPhotoUri ( ) ; case com.android.dialer.phonelookup.consolidator.PhoneLookupInfoConsolidator.NameSource.PEOPLE_API : case com.android.dialer.phonelookup.consolidator.PhoneLookupInfoConsolidator.NameSource.CNAP : case com.android.dialer.phonelookup.consolidator.PhoneLookupInfoConsolidator.NameSource.NONE : return "" ; default : throw com.android.dialer.common.Assert.createUnsupportedOperationFailException ( java.lang.String.format ( "Unsupported name source: %s" , nameSource ) ) ; } }
Source:
static < K , V > java.util.Iterator < K > keyIterator ( java.util.Iterator < java.util.Map.Entry < K , V > > entryIterator ) { return new com.google.common.collect.TransformedIterator < java.util.Map.Entry < K , V > , K > ( entryIterator ) { @ java.lang.Override K transform ( java.util.Map.Entry < K , V > entry ) { return entry.getKey ( ) ; } } ; }

Target:
static boolean containsValueImpl ( java.util.Map < ? , ? > map , @ javax.annotation.Nullable java.lang.Object value ) { return com.google.common.collect.Iterators.contains ( com.google.common.collect.Maps.valueIterator ( map.entrySet ( ) . iterator ( ) ) , value ) ; }
Source:
public final void testCreateDup ( ) { com.android.ide.eclipse.adt.internal.editors.layout.descriptors.ViewElementDescriptor ved = new com.android.ide.eclipse.adt.internal.editors.layout.descriptors.ViewElementDescriptor ( "xml" , "MyJavaClass" ) ; com.android.ide.eclipse.adt.internal.editors.layout.uimodel.UiViewElementNode uiv = new com.android.ide.eclipse.adt.internal.editors.layout.uimodel.UiViewElementNode ( ved ) ; com.android.ide.eclipse.adt.internal.editors.layout.gre.NodeFactoryTest.MockLayoutViewInfo lvi = new com.android.ide.eclipse.adt.internal.editors.layout.gre.NodeFactoryTest.MockLayoutViewInfo ( uiv , "name" , 10 , 12 , 110 , 120 ) ; com.android.ide.eclipse.adt.internal.editors.layout.gle2.CanvasViewInfo cvi = new com.android.ide.eclipse.adt.internal.editors.layout.gle2.CanvasViewInfo ( lvi ) ; com.android.ide.eclipse.adt.internal.editors.layout.gre.NodeProxy proxy1 = m.create ( cvi ) ; com.android.ide.eclipse.adt.internal.editors.layout.gre.NodeProxy proxy2 = m.create ( cvi ) ; assertSame ( proxy2 , proxy1 ) ; }

Target:
public final void testCreateDup ( ) { com.android.ide.eclipse.adt.internal.editors.layout.descriptors.ViewElementDescriptor ved = new com.android.ide.eclipse.adt.internal.editors.layout.descriptors.ViewElementDescriptor ( "xml" , "com.example.MyJavaClass" ) ; com.android.ide.eclipse.adt.internal.editors.layout.uimodel.UiViewElementNode uiv = new com.android.ide.eclipse.adt.internal.editors.layout.uimodel.UiViewElementNode ( ved ) ; com.android.ide.eclipse.adt.internal.editors.layout.gre.NodeFactoryTest.MockLayoutViewInfo lvi = new com.android.ide.eclipse.adt.internal.editors.layout.gre.NodeFactoryTest.MockLayoutViewInfo ( uiv , "name" , 10 , 12 , 110 , 120 ) ; com.android.ide.eclipse.adt.internal.editors.layout.gle2.CanvasViewInfo cvi = new com.android.ide.eclipse.adt.internal.editors.layout.gle2.CanvasViewInfo ( lvi ) ; com.android.ide.eclipse.adt.internal.editors.layout.gre.NodeProxy proxy1 = m.create ( cvi ) ; com.android.ide.eclipse.adt.internal.editors.layout.gre.NodeProxy proxy2 = m.create ( cvi ) ; assertSame ( proxy2 , proxy1 ) ; }
Source:
private java.io.File createEmptyLibrary ( ) throws java.io.IOException , java.lang.Exception { java.util.List < java.lang.Class < ? extends com.android.jack.test.toolchain.IToolchain > > exclude = new java.util.ArrayList < java.lang.Class < ? extends com.android.jack.test.toolchain.IToolchain > > ( 1 ) ; exclude.add ( com.android.jack.test.toolchain.LegacyToolchain.class ) ; com.android.jack.test.toolchain.AndroidToolchain toolchain = com.android.jack.test.toolchain.AbstractTestTools.getCandidateToolchain ( com.android.jack.test.toolchain.AndroidToolchain.class , exclude ) ; java.io.File emptyLib = com.android.jack.test.toolchain.AbstractTestTools.createTempFile ( "empty" , toolchain.getLibraryExtension ( ) ) ; toolchain.srcToLib ( emptyLib , true ) ; return emptyLib ; }

Target:
private java.io.File createEmptyLibrary ( ) throws java.io.IOException , java.lang.Exception { java.util.List < java.lang.Class < ? extends com.android.jack.test.toolchain.IToolchain > > exclude = new java.util.ArrayList < java.lang.Class < ? extends com.android.jack.test.toolchain.IToolchain > > ( 1 ) ; exclude.add ( com.android.jack.test.toolchain.LegacyBasedToolchain.class ) ; com.android.jack.test.toolchain.AndroidToolchain toolchain = com.android.jack.test.toolchain.AbstractTestTools.getCandidateToolchain ( com.android.jack.test.toolchain.AndroidToolchain.class , exclude ) ; java.io.File emptyLib = com.android.jack.test.toolchain.AbstractTestTools.createTempFile ( "empty" , toolchain.getLibraryExtension ( ) ) ; toolchain.srcToLib ( emptyLib , true ) ; return emptyLib ; }
Source:
public java.lang.String toString ( ) { java.lang.StringBuilder result = new java.lang.StringBuilder ( ) ; for ( int i = 0 ; i < ( com.ibm.icu.text.DateTimePatternGenerator.TYPE_LIMIT ) ; ++ i ) { if ( ( original [ i ] . length ( ) ) != 0 ) result.append ( original [ i ] ) ; } return result.toString ( ) ; }

Target:
private java.lang.StringBuilder appendFieldTo ( int field , java.lang.StringBuilder sb , boolean canonical ) { char ch = ( ( char ) ( chars [ field ] ) ) ; int length = lengths [ field ] ; if ( canonical ) { ch = com.ibm.icu.text.DateTimePatternGenerator.getCanonicalChar ( field , ch ) ; } for ( int i = 0 ; i < length ; i ++ ) { sb.append ( ch ) ; } return sb ; }
Source:
private boolean canDispatchAccessibilityEvent ( android.view.accessibility.AccessibilityEvent event ) { return ( ( event.getEventType ( ) ) != ( android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED ) ) || ( ( event.getWindowId ( ) ) == ( mActiveWindowId ) ) ; }

Target:
private boolean canDispatchAccessibilityEvent ( android.view.accessibility.AccessibilityEvent event ) { final int eventType = event.getEventType ( ) ; switch ( eventType ) { case android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED : case android.view.accessibility.AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED : case android.view.accessibility.AccessibilityEvent.TYPE_TOUCH_EXPLORATION_GESTURE_START : case android.view.accessibility.AccessibilityEvent.TYPE_TOUCH_EXPLORATION_GESTURE_END : case android.view.accessibility.AccessibilityEvent.TYPE_GESTURE_DETECTION_START : case android.view.accessibility.AccessibilityEvent.TYPE_GESTURE_DETECTION_END : case android.view.accessibility.AccessibilityEvent.TYPE_TOUCH_INTERACTION_START : case android.view.accessibility.AccessibilityEvent.TYPE_TOUCH_INTERACTION_END : case android.view.accessibility.AccessibilityEvent.TYPE_VIEW_HOVER_ENTER : case android.view.accessibility.AccessibilityEvent.TYPE_VIEW_HOVER_EXIT : { return true ; } default : return ( event.getWindowId ( ) ) == ( mActiveWindowId ) ; } }
Source:
public boolean isRecordingFinished ( ) { return ( ( mSchedule ) != null ) && ( ( ( ( mSchedule.getState ( ) ) == ( com.android.tv.dvr.ScheduledRecording.STATE_RECORDING_FAILED ) ) || ( ( mSchedule.getState ( ) ) == ( com.android.tv.dvr.ScheduledRecording.STATE_RECORDING_CLIPPED ) ) ) || ( ( mSchedule.getState ( ) ) == ( com.android.tv.dvr.ScheduledRecording.STATE_RECORDING_FINISHED ) ) ) ; }

Target:
public boolean isRecordingFinished ( ) { return ( ( mSchedule ) != null ) && ( ( ( ( mSchedule.getState ( ) ) == ( com.android.tv.dvr.data.ScheduledRecording.STATE_RECORDING_FAILED ) ) || ( ( mSchedule.getState ( ) ) == ( com.android.tv.dvr.data.ScheduledRecording.STATE_RECORDING_CLIPPED ) ) ) || ( ( mSchedule.getState ( ) ) == ( com.android.tv.dvr.data.ScheduledRecording.STATE_RECORDING_FINISHED ) ) ) ; }
Source:
public void testDialogShowWhenLockedActivity ( ) throws java.lang.Exception { if ( ! ( isHandheld ( ) ) ) { return ; } launchActivity ( "ShowWhenLockedDialogActivity" ) ; mAmWmState.computeState ( mDevice , new java.lang.String [ ] { "ShowWhenLockedDialogActivity" } ) ; mAmWmState.assertVisibility ( "ShowWhenLockedDialogActivity" , true ) ; gotoKeyguard ( ) ; mAmWmState.computeState ( mDevice , null ) ; mAmWmState.assertVisibility ( "ShowWhenLockedDialogActivity" , true ) ; assertWallpaperShowing ( ) ; assertShowingAndOccluded ( ) ; pressHomeButton ( ) ; unlockDevice ( ) ; }

Target:
public void testDialogShowWhenLockedActivity ( ) throws java.lang.Exception { if ( ( ! ( isHandheld ( ) ) ) || ( isUiModeLockedToVrHeadset ( ) ) ) { return ; } launchActivity ( "ShowWhenLockedDialogActivity" ) ; mAmWmState.computeState ( mDevice , new java.lang.String [ ] { "ShowWhenLockedDialogActivity" } ) ; mAmWmState.assertVisibility ( "ShowWhenLockedDialogActivity" , true ) ; gotoKeyguard ( ) ; mAmWmState.computeState ( mDevice , null ) ; mAmWmState.assertVisibility ( "ShowWhenLockedDialogActivity" , true ) ; assertWallpaperShowing ( ) ; assertShowingAndOccluded ( ) ; pressHomeButton ( ) ; unlockDevice ( ) ; }
Source:
public void onImsDisconnected ( com.android.ims.ImsReasonInfo imsReasonInfo ) { if ( com.android.internal.telephony.imsphone.ImsPhoneCallTracker.DBG ) log ( ( "onImsDisconnected imsReasonInfo=" + imsReasonInfo ) ) ; resetImsCapabilities ( ) ; mPhone.setServiceState ( ServiceState.STATE_OUT_OF_SERVICE ) ; mPhone.setImsRegistered ( false ) ; mPhone.processDisconnectReason ( imsReasonInfo ) ; mMetrics.writeOnImsConnectionState ( mPhone.getPhoneId ( ) , ImsConnectionState.State.DISCONNECTED , imsReasonInfo ) ; }

Target:
public void onDeregistered ( com.android.ims.ImsReasonInfo imsReasonInfo ) { if ( com.android.internal.telephony.imsphone.ImsPhoneCallTracker.DBG ) log ( ( "onImsDisconnected imsReasonInfo=" + imsReasonInfo ) ) ; resetImsCapabilities ( ) ; mPhone.setServiceState ( ServiceState.STATE_OUT_OF_SERVICE ) ; mPhone.setImsRegistered ( false ) ; mPhone.processDisconnectReason ( imsReasonInfo ) ; mMetrics.writeOnImsConnectionState ( mPhone.getPhoneId ( ) , ImsConnectionState.State.DISCONNECTED , imsReasonInfo ) ; }
Source:
public boolean mayHaveImplementations ( proguard.classfile.Method method ) { return ( ( ( u2accessFlags ) & ( ClassConstants.INTERNAL_ACC_FINAL ) ) == 0 ) && ( ( method == null ) || ( ( ( ( method.getAccessFlags ( ) ) & ( ( ( ClassConstants.INTERNAL_ACC_PRIVATE ) | ( ClassConstants.INTERNAL_ACC_STATIC ) ) | ( ClassConstants.INTERNAL_ACC_FINAL ) ) ) == 0 ) && ( ! ( method.getName ( this ) . equals ( ClassConstants.INTERNAL_METHOD_NAME_INIT ) ) ) ) ) ; }

Target:
public boolean mayHaveImplementations ( proguard.classfile.Method method ) { return ( ( ( u2accessFlags ) & ( ClassConstants.ACC_FINAL ) ) == 0 ) && ( ( method == null ) || ( ( ( ( method.getAccessFlags ( ) ) & ( ( ( ClassConstants.ACC_PRIVATE ) | ( ClassConstants.ACC_STATIC ) ) | ( ClassConstants.ACC_FINAL ) ) ) == 0 ) && ( ! ( method.getName ( this ) . equals ( ClassConstants.METHOD_NAME_INIT ) ) ) ) ) ; }
Source:
private void responseByteArrayList ( android.hardware.radio.V1_0.RadioResponseInfo responseInfo , java.util.ArrayList < java.lang.Byte > var ) { com.android.internal.telephony.RILRequest rr = mRil.processResponse ( responseInfo ) ; if ( rr != null ) { byte [ ] ret = null ; if ( ( responseInfo.error ) == ( android.hardware.radio.V1_0.RadioError.NONE ) ) { ret = com.android.internal.telephony.RIL.arrayListToPrimitiveArray ( var ) ; sendMessageResponse ( rr.mResult , ret ) ; } mRil.processResponseDone ( rr , responseInfo , ret ) ; } }

Target:
public void setSimCardPowerResponse ( android.hardware.radio.V1_0.RadioResponseInfo responseInfo ) { responseVoid ( responseInfo ) ; }
Source:
private static void printUsage ( ) { java.lang.System.out.println ( "Usage: cts-api-coverage [OPTION]... [APK]..." ) ; java.lang.System.out.println ( ) ; java.lang.System.out.println ( "Generates a report about what Android framework methods are called " ) ; java.lang.System.out.println ( "from the given APKs." ) ; java.lang.System.out.println ( ) ; java.lang.System.out.println ( "Use the Makefiles rules in CtsTestCoverage.mk to generate the report " ) ; java.lang.System.out.println ( "rather than executing this directly. If you still want to run this " ) ; java.lang.System.out.println ( "directly, then this must be used from the $ANDROID_BUILD_TOP " ) ; java.lang.System.out.println ( "directory and dexdeps must be built via \"make dexdeps\"." ) ; java.lang.System.out.println ( ) ; java.lang.System.out.println ( "Options:" ) ; java.lang.System.out.println ( " -o FILE output file or standard out if not given" ) ; java.lang.System.out.println ( " -f [txt|xml] format of output either text or xml" ) ; java.lang.System.out.println ( ) ; java.lang.System.exit ( 1 ) ; }

Target:
private static void printUsage ( ) { java.lang.System.out.println ( "Usage: cts-api-coverage [OPTION]... [APK]..." ) ; java.lang.System.out.println ( ) ; java.lang.System.out.println ( "Generates a report about what Android framework methods are called " ) ; java.lang.System.out.println ( "from the given APKs." ) ; java.lang.System.out.println ( ) ; java.lang.System.out.println ( "Use the Makefiles rules in CtsTestCoverage.mk to generate the report " ) ; java.lang.System.out.println ( "rather than executing this directly. If you still want to run this " ) ; java.lang.System.out.println ( "directly, then this must be used from the $ANDROID_BUILD_TOP " ) ; java.lang.System.out.println ( "directory and dexdeps must be built via \"make dexdeps\"." ) ; java.lang.System.out.println ( ) ; java.lang.System.out.println ( "Options:" ) ; java.lang.System.out.println ( " -o FILE output file or standard out if not given" ) ; java.lang.System.out.println ( " -f [txt|xml] format of output either text or xml" ) ; java.lang.System.out.println ( " -d PATH path to dexdeps or expected to be in $PATH" ) ; java.lang.System.out.println ( ) ; java.lang.System.exit ( 1 ) ; }
Source:
public synchronized void onDisconnect ( ) { if ( com.android.bluetooth.hfpclient.connserv.HfpClientConnection.DBG ) { android.util.Log.d ( com.android.bluetooth.hfpclient.connserv.HfpClientConnection.TAG , ( ( ( "onDisconnect call: " + ( mCurrentCall ) ) + " state: " ) + ( mClosed ) ) ) ; } if ( ! ( mClosed ) ) { mHeadsetProfile.terminateCall ( mDevice , mCurrentCall ) ; mLocalDisconnect = true ; } }

Target:
public synchronized void onDisconnect ( ) { if ( com.android.bluetooth.hfpclient.connserv.HfpClientConnection.DBG ) { android.util.Log.d ( com.android.bluetooth.hfpclient.connserv.HfpClientConnection.TAG , ( ( ( "onDisconnect call: " + ( mCurrentCall ) ) + " state: " ) + ( mClosed ) ) ) ; } if ( ! ( mClosed ) ) { mHeadsetProfile.terminateCall ( mDevice , mCurrentCall ) ; mLocalDisconnect = true ; mClosing = true ; } }
Source:
public void unregisterNetworkCallback ( android.net.ConnectivityManager.NetworkCallback networkCallback ) { if ( ( ( networkCallback == null ) || ( ( networkCallback.networkRequest ) == null ) ) || ( ( networkCallback.networkRequest.requestId ) == ( android.net.ConnectivityManager.REQUEST_ID_UNSET ) ) ) { throw new java.lang.IllegalArgumentException ( "Invalid NetworkCallback" ) ; } try { mService.releaseNetworkRequest ( networkCallback.networkRequest ) ; } catch ( android.os.RemoteException e ) { throw e.rethrowFromSystemServer ( ) ; } }

Target:
private boolean isRegistered ( ) { return ( ( networkRequest ) != null ) && ( ( networkRequest.requestId ) != ( android.net.ConnectivityManager.REQUEST_ID_UNSET ) ) ; }
Source:
public void testLicenseIdNotFound ( ) throws java.lang.Exception { java.lang.String document = ( ( ( ( ( ( "<?xml version=\"1.0\"?>" + ( com.android.sdklib.repository.SdkRepositoryTest.OPEN_TAG ) ) + "<r:license id=\"lic1\"> some license </r:license> " ) + "<r:tool> <r:uses-license ref=\"lic2\" /> <r:revision>1</r:revision> " ) + "<r:min-platform-tools-rev>1</r:min-platform-tools-rev> " ) + "<r:archives> <r:archive os=\"any\"> <r:size>1</r:size> <r:checksum>2822ae37115ebf13412bbef91339ee0d9454525e</r:checksum> " ) + "<r:url>url</r:url> </r:archive> </r:archives> </r:tool>" ) + ( com.android.sdklib.repository.SdkRepositoryTest.CLOSE_TAG ) ; javax.xml.transform.Source source = new javax.xml.transform.stream.StreamSource ( new java.io.StringReader ( document ) ) ; javax.xml.validation.Validator validator = getValidator ( SdkRepoConstants.NS_LATEST_VERSION , null ) ; try { validator.validate ( source ) ; } catch ( org.xml.sax.SAXParseException e ) { assertRegex ( "cvc-id.1: There is no ID/IDREF binding for IDREF 'lic2'.*" , e.getMessage ( ) ) ; return ; } fail ( ) ; }

Target:
public void testUnknownContentXml ( ) throws java.lang.Exception { java.lang.String document = ( ( "<?xml version=\"1.0\"?>" + ( com.android.sdklib.repository.SdkRepositoryTest.OPEN_TAG ) ) + "<r:unknown />" ) + ( com.android.sdklib.repository.SdkRepositoryTest.CLOSE_TAG ) ; javax.xml.transform.Source source = new javax.xml.transform.stream.StreamSource ( new java.io.StringReader ( document ) ) ; javax.xml.validation.Validator validator = getRepoValidator ( SdkRepoConstants.NS_LATEST_VERSION , null ) ; try { validator.validate ( source ) ; } catch ( org.xml.sax.SAXParseException e ) { assertRegex ( "cvc-complex-type.2.4.a: Invalid content was found.*" , e.getMessage ( ) ) ; return ; } fail ( ) ; }
Source:
public boolean offer ( E e , long timeout , java.util.concurrent.TimeUnit unit ) throws java.lang.InterruptedException { java.util.concurrent.ArrayBlockingQueue.checkNotNull ( e ) ; long nanos = unit.toNanos ( timeout ) ; final java.util.concurrent.locks.ReentrantLock lock = this . lock ; lock.lockInterruptibly ( ) ; try { while ( ( count ) == ( items.length ) ) { if ( nanos <= 0 ) return false ; nanos = notFull.awaitNanos ( nanos ) ; } insert ( e ) ; return true ; } finally { lock.unlock ( ) ; } }

Target:
public boolean offer ( E e , long timeout , java.util.concurrent.TimeUnit unit ) throws java.lang.InterruptedException { java.util.concurrent.ArrayBlockingQueue.checkNotNull ( e ) ; long nanos = unit.toNanos ( timeout ) ; final java.util.concurrent.locks.ReentrantLock lock = this . lock ; lock.lockInterruptibly ( ) ; try { while ( ( count ) == ( items.length ) ) { if ( nanos <= 0 ) return false ; nanos = notFull.awaitNanos ( nanos ) ; } enqueue ( e ) ; return true ; } finally { lock.unlock ( ) ; } }
Source:
public java.lang.String getDeviceId ( java.lang.String callingPackage ) { if ( ! ( com.android.internal.telephony.TelephonyPermissions.checkCallingOrSelfReadPhoneState ( mApp , callingPackage , "getDeviceId" ) ) ) { return null ; } final com.android.internal.telephony.Phone phone = com.android.internal.telephony.PhoneFactory.getPhone ( 0 ) ; if ( phone != null ) { return phone.getDeviceId ( ) ; } else { return null ; } }

Target:
public java.lang.String getDeviceId ( java.lang.String callingPackage ) { final com.android.internal.telephony.Phone phone = com.android.internal.telephony.PhoneFactory.getPhone ( 0 ) ; if ( phone == null ) { return null ; } int subId = phone.getSubId ( ) ; if ( ! ( com.android.internal.telephony.TelephonyPermissions.checkCallingOrSelfReadPhoneState ( mApp , subId , callingPackage , "getDeviceId" ) ) ) { return null ; } return phone.getDeviceId ( ) ; }