auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public java.lang.String toString ( ) { return ( ( ( ( ( ( ( ( ( "{mTag=" + ( mTag ) ) + " mApnContext=" ) + ( mApnContext ) ) + " mProfileId=" ) + ( mProfileId ) ) + " mRat=" ) + ( mRilRat ) ) + " mOnCompletedMsg=" ) + ( com.android.internal.telephony.dataconnection.DataConnection.msgToString ( mOnCompletedMsg ) ) ) + "}" ; }

Target:
public java.lang.String toString ( ) { return ( ( ( ( ( ( ( ( ( ( ( "{mTag=" + ( mTag ) ) + " mApnContext=" ) + ( mApnContext ) ) + " mProfileId=" ) + ( mProfileId ) ) + " mRat=" ) + ( mRilRat ) ) + " mUnmeteredUseOnly=" ) + ( mUnmeteredUseOnly ) ) + " mOnCompletedMsg=" ) + ( com.android.internal.telephony.dataconnection.DataConnection.msgToString ( mOnCompletedMsg ) ) ) + "}" ; }
Source:
public android.content.pm.ResolveInfo getLastChosenActivity ( android.content.Intent intent , java.lang.String resolvedType , int flags ) { final int userId = android.os.UserHandle.getCallingUserId ( ) ; if ( com.android.server.pm.PackageManagerService.DEBUG_PREFERRED ) android.util.Log.v ( com.android.server.pm.PackageManagerService.TAG , ( "Querying last chosen activity for " + intent ) ) ; java.util.List < android.content.pm.ResolveInfo > query = queryIntentActivities ( intent , resolvedType , flags , userId ) ; return findPreferredActivity ( intent , resolvedType , flags , query , 0 , false , false , false , userId ) ; }

Target:
public android.content.pm.ResolveInfo getLastChosenActivity ( android.content.Intent intent , java.lang.String resolvedType , int flags ) { final int userId = android.os.UserHandle.getCallingUserId ( ) ; if ( com.android.server.pm.PackageManagerService.DEBUG_PREFERRED ) android.util.Log.v ( com.android.server.pm.PackageManagerService.TAG , ( "Querying last chosen activity for " + intent ) ) ; final java.util.List < android.content.pm.ResolveInfo > query = queryIntentActivitiesInternal ( intent , resolvedType , flags , userId ) ; return findPreferredActivity ( intent , resolvedType , flags , query , 0 , false , false , false , userId ) ; }
Source:
private void printCharacterData ( int depth , org.w3c.dom.Node node ) { indent ( depth ) ; mOut.append ( "<![CDATA[" ) ; mOut.append ( node.getNodeValue ( ) ) ; mOut.append ( "]]>" ) ; mOut.append ( mLineSeparator ) ; }

Target:
private void printCharacterData ( int depth , org.w3c.dom.Node node ) { java.lang.String nodeValue = node.getNodeValue ( ) ; boolean separateLine = ( nodeValue.indexOf ( '\n' ) ) != ( - 1 ) ; if ( separateLine && ( ! ( endsWithLineSeparator ( ) ) ) ) { mOut.append ( mLineSeparator ) ; } mOut.append ( "<![CDATA[" ) ; mOut.append ( nodeValue ) ; mOut.append ( "]]>" ) ; if ( separateLine ) { mOut.append ( mLineSeparator ) ; } }
Source:
public static java.util.List < java.lang.String > readLines ( java.net.URL url , java.nio.charset.Charset charset ) throws java.io.IOException { return com.google.common.io.CharStreams.readLines ( com.google.common.io.Resources.newReaderSupplier ( url , charset ) ) ; }

Target:
public static java.util.List < java.lang.String > readLines ( java.net.URL url , java.nio.charset.Charset charset ) throws java.io.IOException { return com.google.common.io.Resources.readLines ( url , charset , new com.google.common.io.LineProcessor < java.util.List < java.lang.String > > ( ) { final java.util.List < java.lang.String > result = com.google.common.collect.Lists.newArrayList ( ) ; @ java.lang.Override public boolean processLine ( java.lang.String line ) { result.add ( line ) ; return true ; } @ java.lang.Override public java.util.List < java.lang.String > getResult ( ) { return result ; } } ) ; }
Source:
private static java.nio.ByteBuffer mapFile ( @ com.android.annotations.NonNull java.io.File f , long offset ) throws java.io.IOException { java.io.FileInputStream dataFile = new java.io.FileInputStream ( f ) ; try { java.nio.channels.FileChannel fc = dataFile.getChannel ( ) ; java.nio.MappedByteBuffer buffer = fc.map ( java.nio.channels.FileChannel.MapMode.READ_ONLY , offset , ( ( f.length ( ) ) - offset ) ) ; buffer.order ( java.nio.ByteOrder.LITTLE_ENDIAN ) ; return buffer ; } finally { dataFile.close ( ) ; } }

Target:
public void parse ( ) throws java.io.IOException { long headerLength = parseHeader ( mTraceFile ) ; java.nio.ByteBuffer buffer = com.android.ddmlib.ByteBufferUtil.mapFile ( mTraceFile , headerLength , java.nio.ByteOrder.LITTLE_ENDIAN ) ; parseData ( buffer ) ; computeTimingStatistics ( ) ; }
Source:
private java.io.InputStream openFileSystemContents ( java.lang.String fileName ) throws java.io.IOException { java.lang.String fullFileName = ( ( libcore.java.net.FtpURLConnectionTest.USER_HOME_DIR ) + "/" ) + fileName ; org.mockftpserver.fake.filesystem.FileEntry entry = ( ( org.mockftpserver.fake.filesystem.FileEntry ) ( fileSystem.getEntry ( fullFileName ) ) ) ; assertNotNull ( ( "File must exist with name " + fullFileName ) , entry ) ; return entry.createInputStream ( ) ; }

Target:
private java.io.InputStream openFileSystemContents ( java.lang.String fileName ) throws java.io.IOException { java.lang.String fullFileName = ( ( libcore.java.net.FtpURLConnectionTest.VALID_USER_HOME_DIR ) + "/" ) + fileName ; org.mockftpserver.fake.filesystem.FileEntry entry = ( ( org.mockftpserver.fake.filesystem.FileEntry ) ( fileSystem.getEntry ( fullFileName ) ) ) ; assertNotNull ( ( "File must exist with name " + fullFileName ) , entry ) ; return entry.createInputStream ( ) ; }
Source:
public void testNextLongBoundedNeg ( ) { try { long f = java.util.concurrent.ThreadLocalRandom.current ( ) . nextLong ( ( - 17 ) ) ; shouldThrow ( ) ; } catch ( java.lang.IllegalArgumentException success ) { } }

Target:
public void testNextLongBoundNonPositive ( ) { java.util.concurrent.ThreadLocalRandom rnd = java.util.concurrent.ThreadLocalRandom.current ( ) ; for ( long bound : new long [ ] { 0L , - 17L , java.lang.Long.MIN_VALUE } ) { try { rnd.nextLong ( bound ) ; shouldThrow ( ) ; } catch ( java.lang.IllegalArgumentException success ) { } } }
Source:
synchronized void nAllocationData3D ( long id , int xoff , int yoff , int zoff , int mip , int w , int h , int depth , long [ ] d , int sizeBytes ) { validate ( ) ; rsnAllocationData3D ( mContext , id , xoff , yoff , zoff , mip , w , h , depth , d , sizeBytes ) ; }

Target:
synchronized void nScriptForEach ( long id , int slot , long ain , long aout , byte [ ] params , boolean mUseInc ) { validate ( ) ; if ( params == null ) { rsnScriptForEach ( mContext , mIncCon , id , slot , ain , aout , mUseInc ) ; } else { rsnScriptForEach ( mContext , mIncCon , id , slot , ain , aout , params , mUseInc ) ; } }
Source:
public void testAesGcm64Udp4UdpEncap ( ) throws java.lang.Exception { android.net.IpSecAlgorithm authCrypt = new android.net.IpSecAlgorithm ( android.net.IpSecAlgorithm.AUTH_CRYPT_AES_GCM , android.net.cts.IpSecManagerTest.getKey ( 288 ) , 64 ) ; checkTransform ( android.system.OsConstants.IPPROTO_UDP , android.net.cts.IpSecManagerTest.IPV4_LOOPBACK , null , null , authCrypt , true , 1 , false ) ; checkTransform ( android.system.OsConstants.IPPROTO_UDP , android.net.cts.IpSecManagerTest.IPV4_LOOPBACK , null , null , authCrypt , true , 1 , true ) ; }

Target:
public void testAesCbcHmacSha512Tcp4UdpEncap ( ) throws java.lang.Exception { android.net.IpSecAlgorithm crypt = new android.net.IpSecAlgorithm ( android.net.IpSecAlgorithm.CRYPT_AES_CBC , android.net.cts.IpSecManagerTest.CRYPT_KEY ) ; android.net.IpSecAlgorithm auth = new android.net.IpSecAlgorithm ( android.net.IpSecAlgorithm.AUTH_HMAC_SHA512 , getAuthKey ( 512 ) , 256 ) ; checkTransform ( android.system.OsConstants.IPPROTO_TCP , android.net.cts.IpSecManagerTest.IPV4_LOOPBACK , crypt , auth , true , 1 , false ) ; }
Source:
public void onClick ( android.content.DialogInterface dialog , int which ) { android.util.Log.i ( TAG , "Canceling installation" ) ; finish ( ) ; }

Target:
public void onReceive ( android.content.Context context , android.content.Intent intent ) { final int statusCode = intent.getIntExtra ( PackageInstaller.EXTRA_STATUS , PackageInstaller.STATUS_FAILURE ) ; if ( statusCode == ( android.content.pm.PackageInstaller.STATUS_PENDING_USER_ACTION ) ) { context.startActivity ( ( ( android.content.Intent ) ( intent.getParcelableExtra ( Intent.EXTRA_INTENT ) ) ) ) ; } else { onPackageInstalled ( statusCode ) ; } }
Source:
private void tearDown ( android.app.admin.DevicePolicyManager dpm , android.content.ComponentName admin ) { if ( ( dpm == null ) || ( ! ( dpm.isDeviceOwnerApp ( getPackageName ( ) ) ) ) ) { return ; } dpm.setStatusBarDisabled ( admin , false ) ; dpm.setKeyguardDisabled ( admin , false ) ; dpm.clearUserRestriction ( admin , UserManager.DISALLOW_CONFIG_BLUETOOTH ) ; dpm.clearUserRestriction ( admin , UserManager.DISALLOW_CONFIG_WIFI ) ; dpm.clearDeviceOwnerApp ( getPackageName ( ) ) ; }

Target:
private void tearDown ( android.app.admin.DevicePolicyManager dpm , android.content.ComponentName admin ) { if ( ( dpm == null ) || ( ! ( dpm.isDeviceOwnerApp ( getPackageName ( ) ) ) ) ) { return ; } dpm.setStatusBarDisabled ( admin , false ) ; dpm.setKeyguardDisabled ( admin , false ) ; dpm.clearUserRestriction ( admin , UserManager.DISALLOW_CONFIG_BLUETOOTH ) ; dpm.clearUserRestriction ( admin , UserManager.DISALLOW_CONFIG_WIFI ) ; dpm.clearUserRestriction ( admin , UserManager.DISALLOW_CONFIG_VPN ) ; dpm.clearDeviceOwnerApp ( getPackageName ( ) ) ; }
Source:
void sendAfterTextChanged ( android.text.Editable text ) { if ( ( mListeners ) != null ) { final java.util.ArrayList < android.text.TextWatcher > list = mListeners ; final int count = list.size ( ) ; for ( int i = 0 ; i < count ; i ++ ) { list.get ( i ) . afterTextChanged ( text ) ; } } }

Target:
void sendAfterTextChanged ( android.text.Editable text ) { if ( ( mListeners ) != null ) { final java.util.ArrayList < android.text.TextWatcher > list = mListeners ; final int count = list.size ( ) ; for ( int i = 0 ; i < count ; i ++ ) { list.get ( i ) . afterTextChanged ( text ) ; } } hideErrorIfUnchanged ( ) ; }
Source:
public void generateApkDataEntryInManifest ( int minSdkVersion , @ com.android.annotations.NonNull java.io.File manifestFile ) throws com.android.ide.common.internal.LoggedErrorException , java.io.IOException , java.lang.InterruptedException { java.lang.String content = ( ( ( ( ( ( ( ( ( ( ( "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" + ( "<manifest package=\"\" xmlns:android=\"http://schemas.android.com/apk/res/android\">\n" + " <uses-sdk android:minSdkVersion=\"" ) ) + minSdkVersion ) + "\"/>\n" ) + " <application>\n" ) + " <meta-data android:name=\"" ) + ( com.android.builder.core.BuilderConstants.ANDROID_WEAR ) ) + "\"\n" ) + " android:resource=\"@xml/" ) + ( com.android.builder.core.BuilderConstants.ANDROID_WEAR_MICRO_APK ) ) + "\" />\n" ) + " </application>\n" ) + "</manifest>\n" ; com.google.common.io.Files.write ( content , manifestFile , com.google.common.base.Charsets.UTF_8 ) ; }

Target:
public void generateApkDataEntryInManifest ( int minSdkVersion , int targetSdkVersion , @ com.android.annotations.NonNull java.io.File manifestFile ) throws com.android.ide.common.internal.LoggedErrorException , java.io.IOException , java.lang.InterruptedException { java.lang.StringBuilder content = new java.lang.StringBuilder ( ) ; content.append ( "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" ) . append ( "<manifest package=\"\" xmlns:android=\"http://schemas.android.com/apk/res/android\">\n" ) . append ( " <uses-sdk android:minSdkVersion=\"" ) . append ( minSdkVersion ) . append ( "\"" ) ; if ( targetSdkVersion != ( - 1 ) ) { content.append ( " android:targetSdkVersion=\"" ) . append ( targetSdkVersion ) . append ( "\"" ) ; } content.append ( "/>\n" ) ; content.append ( " <application>\n" ) . append ( ( ( " <meta-data android:name=\"" + ( com.android.builder.core.BuilderConstants.ANDROID_WEAR ) ) + "\"\n" ) ) . append ( ( " android:resource=\"@xml/" + ( com.android.builder.core.BuilderConstants.ANDROID_WEAR_MICRO_APK ) ) ) . append ( "\" />\n" ) . append ( " </application>\n" ) . append ( "</manifest>\n" ) ; com.google.common.io.Files.write ( content , manifestFile , com.google.common.base.Charsets.UTF_8 ) ; }
Source:
private static void addZipEntry ( java.util.zip.ZipOutputStream zos , java.lang.String name , byte [ ] content ) throws com.android.timezone.distro.DistroException { try { java.util.zip.ZipEntry zipEntry = new java.util.zip.ZipEntry ( name ) ; zipEntry.setSize ( content.length ) ; zos.putNextEntry ( zipEntry ) ; zos.write ( content ) ; zos.closeEntry ( ) ; } catch ( java.io.IOException e ) { throw new com.android.timezone.distro.DistroException ( "Unable to add zip entry" , e ) ; } }

Target:
private static void addZipEntry ( java.util.zip.ZipOutputStream zos , java.lang.String name , byte [ ] content ) throws com.android.timezone.distro.DistroException { try { java.util.zip.ZipEntry zipEntry = new java.util.zip.ZipEntry ( name ) ; zipEntry.setSize ( content.length ) ; zipEntry.setTime ( com.android.timezone.distro.tools.TimeZoneDistroBuilder.ENTRY_TIMESTAMP ) ; zos.putNextEntry ( zipEntry ) ; zos.write ( content ) ; zos.closeEntry ( ) ; } catch ( java.io.IOException e ) { throw new com.android.timezone.distro.DistroException ( "Unable to add zip entry" , e ) ; } }
Source:
public void onPause ( ) { super . onPause ( ) ; if ( ( ( mPhone ) != null ) && ( ! ( com.android.settings.Utils.isWifiOnly ( getApplicationContext ( ) ) ) ) ) { mPhoneStateReceiver.unregisterIntent ( ) ; mTelephonyManager.listen ( mPhoneStateListener , PhoneStateListener.LISTEN_NONE ) ; } if ( mShowLatestAreaInfo ) { unregisterReceiver ( mAreaInfoReceiver ) ; } unregisterReceiver ( mBatteryInfoReceiver ) ; mHandler.removeMessages ( com.android.settings.deviceinfo.Status.EVENT_UPDATE_STATS ) ; }

Target:
public void onPause ( ) { super . onPause ( ) ; if ( ( ( mPhone ) != null ) && ( ! ( com.android.settings.Utils.isWifiOnly ( getApplicationContext ( ) ) ) ) ) { mPhoneStateReceiver.unregisterIntent ( ) ; mTelephonyManager.listen ( mPhoneStateListener , PhoneStateListener.LISTEN_NONE ) ; } if ( mShowLatestAreaInfo ) { unregisterReceiver ( mAreaInfoReceiver ) ; } unregisterReceiver ( mBatteryInfoReceiver ) ; unregisterReceiver ( mConnectivityReceiver ) ; mHandler.removeMessages ( com.android.settings.deviceinfo.Status.EVENT_UPDATE_STATS ) ; }
Source:
public V get ( @ javax.annotation.Nullable java.lang.Object key ) { if ( key == null ) { return null ; } int index = ( com.google.common.collect.Hashing.smear ( key.hashCode ( ) ) ) & ( mask ) ; for ( com.google.common.collect.RegularImmutableMap.LinkedEntry < K , V > entry = table [ index ] ; entry != null ; entry = entry.next ( ) ) { K candidateKey = entry.getKey ( ) ; if ( key.equals ( candidateKey ) ) { return entry.getValue ( ) ; } } return null ; }

Target:
public V get ( @ javax.annotation.Nullable java.lang.Object key ) { if ( key == null ) { return null ; } int index = ( com.google.common.collect.Hashing.smear ( key.hashCode ( ) ) ) & ( mask ) ; for ( com.google.common.collect.ImmutableMapEntry < K , V > entry = table [ index ] ; entry != null ; entry = entry.getNextInKeyBucket ( ) ) { K candidateKey = entry.getKey ( ) ; if ( key.equals ( candidateKey ) ) { return entry.getValue ( ) ; } } return null ; }
Source:
private java.io.File getLoggingDir ( java.lang.String testClassName , java.lang.String testMethodName ) { java.io.File loggingDir = new java.io.File ( new java.io.File ( mInstrumentation.getTargetContext ( ) . getExternalFilesDir ( null ) , testClassName ) , testMethodName ) ; loggingDir.mkdirs ( ) ; return loggingDir ; }

Target:
private java.io.File getLoggingDir ( java.lang.String testClassName , java.lang.String testMethodName ) { java.io.File externalStorageLogDir = new java.io.File ( android.os.Environment.getExternalStorageDirectory ( ) . getPath ( ) , "Logs" ) ; if ( ! ( externalStorageLogDir.exists ( ) ) ) externalStorageLogDir.mkdir ( ) ; java.io.File loggingDir = new java.io.File ( new java.io.File ( externalStorageLogDir.getPath ( ) , testClassName ) , testMethodName ) ; loggingDir.mkdirs ( ) ; return loggingDir ; }
Source:
public void copyFrom ( com.android.server.pm.PackageSettingBase base ) { grantedPermissions = base.grantedPermissions ; gids = base.gids ; timeStamp = base.timeStamp ; firstInstallTime = base.firstInstallTime ; lastUpdateTime = base.lastUpdateTime ; signatures = base.signatures ; permissionsFixed = base.permissionsFixed ; haveGids = base.haveGids ; userState.clear ( ) ; for ( int i = 0 ; i < ( base.userState.size ( ) ) ; i ++ ) { userState.put ( base.userState.keyAt ( i ) , base.userState.valueAt ( i ) ) ; } installStatus = base.installStatus ; keySetData = base.keySetData ; }

Target:
public void copyFrom ( com.android.server.pm.PackageSettingBase base ) { grantedPermissions = base.grantedPermissions ; gids = base.gids ; requiredCpuAbiString = base.requiredCpuAbiString ; timeStamp = base.timeStamp ; firstInstallTime = base.firstInstallTime ; lastUpdateTime = base.lastUpdateTime ; signatures = base.signatures ; permissionsFixed = base.permissionsFixed ; haveGids = base.haveGids ; userState.clear ( ) ; for ( int i = 0 ; i < ( base.userState.size ( ) ) ; i ++ ) { userState.put ( base.userState.keyAt ( i ) , base.userState.valueAt ( i ) ) ; } installStatus = base.installStatus ; keySetData = base.keySetData ; }
Source:
public java.lang.String checkString ( @ javax.annotation.Nonnull com.android.sched.util.codec.CodecContext context , @ javax.annotation.Nonnull java.lang.String string ) throws com.android.sched.util.codec.ParsingException { if ( ! ( com.android.jack.util.NamingTools.isFullMethodName ( string ) ) ) { throw new com.android.sched.util.codec.ParsingException ( ( ( ( ( "The value must be " + ( getUsage ( ) ) ) + " but is '" ) + string ) + "'" ) ) ; } return string ; }

Target:
public com.android.jack.util.MethodNameCodec.MethodNameValue parseString ( @ javax.annotation.Nonnull com.android.sched.util.codec.CodecContext context , @ javax.annotation.Nonnull java.lang.String string ) { try { return checkString ( context , string ) ; } catch ( com.android.sched.util.codec.ParsingException e ) { throw new com.android.sched.util.config.ConfigurationError ( e ) ; } }
Source:
private void modifyClass ( org.objectweb.asm.tree.ClassNode classNode ) { classNode.access &= ~ ( org.objectweb.asm.Opcodes.ACC_FINAL ) ; java.util.List < org.objectweb.asm.tree.MethodNode > methodNodes = classNode.methods ; for ( org.objectweb.asm.tree.MethodNode methodNode : methodNodes ) { methodNode.access &= ~ ( org.objectweb.asm.Opcodes.ACC_FINAL ) ; fixMethodBody ( methodNode , classNode ) ; } }

Target:
private void modifyClass ( org.objectweb.asm.tree.ClassNode classNode ) { classNode.access &= ~ ( org.objectweb.asm.Opcodes.ACC_FINAL ) ; java.util.List < org.objectweb.asm.tree.MethodNode > methodNodes = classNode.methods ; for ( org.objectweb.asm.tree.MethodNode methodNode : methodNodes ) { methodNode.access &= ~ ( org.objectweb.asm.Opcodes.ACC_FINAL ) ; fixMethodBody ( methodNode , classNode ) ; } java.util.List < org.objectweb.asm.tree.InnerClassNode > innerClasses = classNode.innerClasses ; for ( org.objectweb.asm.tree.InnerClassNode innerClassNode : innerClasses ) { innerClassNode.access &= ~ ( org.objectweb.asm.Opcodes.ACC_FINAL ) ; } }
Source:
public java.lang.Package [ ] getInstalledPackage ( ) { com.android.sdklib.internal.repository.LocalSdkParser parser = getLocalSdkParser ( ) ; java.lang.Package [ ] packages = parser.getPackages ( ) ; if ( packages == null ) { packages = parser.parseSdk ( getOsSdkRoot ( ) , getSdkManager ( ) , getSdkLog ( ) ) ; } return packages ; }

Target:
public java.lang.Package [ ] getInstalledPackages ( ) { com.android.sdklib.internal.repository.LocalSdkParser parser = getLocalSdkParser ( ) ; java.lang.Package [ ] packages = parser.getPackages ( ) ; if ( packages == null ) { packages = parser.parseSdk ( getOsSdkRoot ( ) , getSdkManager ( ) , getSdkLog ( ) ) ; } return packages ; }
Source:
public java.lang.String toString ( ) { java.io.ByteArrayOutputStream os = new java.io.ByteArrayOutputStream ( ) ; long bioCtx = org.conscrypt.NativeCrypto.create_BIO_OutputStream ( os ) ; try { org.conscrypt.NativeCrypto.X509_print_ex ( bioCtx , mContext , 0 , 0 ) ; return os.toString ( ) ; } finally { org.conscrypt.NativeCrypto.BIO_free ( bioCtx ) ; } }

Target:
public java.lang.String toString ( ) { java.io.ByteArrayOutputStream os = new java.io.ByteArrayOutputStream ( ) ; long bioCtx = org.conscrypt.NativeCrypto.create_BIO_OutputStream ( os ) ; try { org.conscrypt.NativeCrypto.X509_print_ex ( bioCtx , mContext , 0 , 0 ) ; return os.toString ( ) ; } finally { org.conscrypt.NativeCrypto.BIO_free_all ( bioCtx ) ; } }
Source:
public void testLayerDoesNotTriggerLifecycleMethods ( ) throws java.lang.Exception { mTestActivity.startTest ( Utils.LIFECYCLE ) ; waitForAssistantToBeReady ( mReadyLatch ) ; mTestActivity.start3pApp ( Utils.LIFECYCLE ) ; waitForOnResume ( ) ; startSession ( ) ; waitForContext ( ) ; waitAndSeeIfLifecycleMethodsAreTriggered ( ) ; }

Target:
public void testLayerDoesNotTriggerLifecycleMethods ( ) throws java.lang.Exception { if ( mActivityManager.isLowRamDevice ( ) ) { android.util.Log.d ( android.assist.cts.LifecycleTest.TAG , "Not running assist tests on low-RAM device." ) ; return ; } mTestActivity.startTest ( Utils.LIFECYCLE ) ; waitForAssistantToBeReady ( mReadyLatch ) ; mTestActivity.start3pApp ( Utils.LIFECYCLE ) ; waitForOnResume ( ) ; startSession ( ) ; waitForContext ( ) ; waitAndSeeIfLifecycleMethodsAreTriggered ( ) ; }
Source:
protected void createFilter ( com.android.gallery3d.filtershow.filters.Resources res , float scaleFactor , int quality , android.support.v8.renderscript.Allocation in ) { android.support.v8.renderscript.RenderScript rsCtx = getRenderScriptContext ( ) ; android.support.v8.renderscript.Type.Builder tb_float = new android.support.v8.renderscript.Type.Builder ( rsCtx , android.support.v8.renderscript.Element.F32_4 ( rsCtx ) ) ; tb_float.setX ( in.getType ( ) . getX ( ) ) ; tb_float.setY ( in.getType ( ) . getY ( ) ) ; mScript = new com.android.gallery3d.filtershow.filters.ScriptC_saturation ( rsCtx ) ; }

Target:
protected void createFilter ( com.android.gallery3d.filtershow.filters.Resources res , float scaleFactor , int quality , android.renderscript.Allocation in ) { android.renderscript.RenderScript rsCtx = getRenderScriptContext ( ) ; android.renderscript.Type.Builder tb_float = new android.renderscript.Type.Builder ( rsCtx , android.renderscript.Element.F32_4 ( rsCtx ) ) ; tb_float.setX ( in.getType ( ) . getX ( ) ) ; tb_float.setY ( in.getType ( ) . getY ( ) ) ; mScript = new com.android.gallery3d.filtershow.filters.ScriptC_saturation ( rsCtx ) ; }
Source:
public com.android.ide.common.api.DropFeedback callOnDropMove ( com.android.ide.eclipse.adt.internal.editors.layout.gre.NodeProxy targetNode , com.android.ide.common.api.IDragElement [ ] elements , com.android.ide.common.api.DropFeedback feedback , com.android.ide.common.api.Point where ) { com.android.ide.common.api.IViewRule rule = loadRule ( targetNode.getNode ( ) ) ; if ( rule != null ) { try { return rule.onDropMove ( targetNode , elements , feedback , where ) ; } catch ( java.lang.Exception e ) { logError ( "%s.onDropMove() failed: %s" , rule.getClass ( ) . getSimpleName ( ) , e.toString ( ) ) ; } } return null ; }

Target:
public com.android.ide.common.api.DropFeedback callOnDropMove ( com.android.ide.eclipse.adt.internal.editors.layout.gre.NodeProxy targetNode , com.android.ide.common.api.IDragElement [ ] elements , com.android.ide.common.api.DropFeedback feedback , com.android.ide.common.api.Point where ) { com.android.ide.common.api.IViewRule rule = loadRule ( targetNode.getNode ( ) ) ; if ( rule != null ) { try { return rule.onDropMove ( targetNode , elements , feedback , where ) ; } catch ( java.lang.Exception e ) { com.android.ide.eclipse.adt.AdtPlugin.log ( e , "%s.onDropMove() failed: %s" , rule.getClass ( ) . getSimpleName ( ) , e.toString ( ) ) ; } } return null ; }
Source:
private boolean contactsDeleted ( long lastModified ) { try ( android.database.Cursor cursor = appContext.getContentResolver ( ) . query ( DeletedContacts.CONTENT_URI , new java.lang.String [ ] { android.provider.ContactsContract.DeletedContacts.CONTACT_DELETED_TIMESTAMP } , ( ( android.provider.ContactsContract.DeletedContacts.CONTACT_DELETED_TIMESTAMP ) + " > ?" ) , new java.lang.String [ ] { java.lang.Long.toString ( lastModified ) } , null ) ) { return ( cursor.getCount ( ) ) > 0 ; } }

Target:
private boolean contactsDeleted ( long lastModified ) { try ( android.database.Cursor cursor = appContext.getContentResolver ( ) . query ( DeletedContacts.CONTENT_URI , new java.lang.String [ ] { android.provider.ContactsContract.DeletedContacts.CONTACT_DELETED_TIMESTAMP } , ( ( android.provider.ContactsContract.DeletedContacts.CONTACT_DELETED_TIMESTAMP ) + " > ?" ) , new java.lang.String [ ] { java.lang.Long.toString ( lastModified ) } , null ) ) { if ( cursor == null ) { com.android.dialer.common.LogUtil.w ( "Cp2PhoneLookup.contactsDeleted" , "null cursor" ) ; return false ; } return ( cursor.getCount ( ) ) > 0 ; } }
Source:
public void replaceWith ( com.android.layoutlib.api.ResourceValue value ) { assert value instanceof com.android.layoutlib.api.StyleResourceValue ; super . replaceWith ( value ) ; if ( value instanceof com.android.layoutlib.api.StyleResourceValue ) { mItems.clear ( ) ; mItems.putAll ( ( ( com.android.layoutlib.api.StyleResourceValue ) ( value ) ) . mItems ) ; } }

Target:
public void replaceWith ( com.android.ide.common.rendering.api.ResourceValue value ) { assert value instanceof com.android.ide.common.rendering.api.StyleResourceValue ; super . replaceWith ( value ) ; if ( value instanceof com.android.ide.common.rendering.api.StyleResourceValue ) { mItems.clear ( ) ; mItems.putAll ( ( ( com.android.ide.common.rendering.api.StyleResourceValue ) ( value ) ) . mItems ) ; } }
Source:
public com.android.jack.dx.io.FieldId get ( int index ) { com.android.jack.dx.io.DexBuffer.checkBounds ( index , tableOfContents.fieldIds.size ) ; return open ( ( ( tableOfContents.fieldIds.off ) + ( ( com.android.jack.dx.dex.SizeOf.MEMBER_ID_ITEM ) * index ) ) ) . readFieldId ( ) ; }

Target:
private java.util.List < java.lang.Integer > readTypeIds ( ) { com.android.jack.dx.io.DexBuffer.Section typeIds = open ( tableOfContents.typeIds.off ) ; java.lang.Integer [ ] result = new java.lang.Integer [ tableOfContents.typeIds.size ] ; for ( int i = 0 ; i < ( tableOfContents.typeIds.size ) ; ++ i ) { result [ i ] = java.lang.Integer.valueOf ( typeIds.readInt ( ) ) ; } return java.util.Arrays.asList ( result ) ; }
Source:
private static void applyInvokeWithSecurityPolicy ( com.android.internal.os.ZygoteConnection.Arguments args , android.net.Credentials peer ) throws com.android.internal.os.ZygoteSecurityException { int peerUid = peer.getUid ( ) ; if ( ( ( args.invokeWith ) != null ) && ( peerUid != 0 ) ) { throw new com.android.internal.os.ZygoteSecurityException ( ( "Peer is not permitted to specify " + "an explicit invoke-with wrapper command" ) ) ; } }

Target:
private static void applyInvokeWithSecurityPolicy ( com.android.internal.os.ZygoteConnection.Arguments args , android.net.Credentials peer , java.lang.String peerSecurityContext ) throws com.android.internal.os.ZygoteSecurityException { int peerUid = peer.getUid ( ) ; if ( ( ( args.invokeWith ) != null ) && ( peerUid != 0 ) ) { throw new com.android.internal.os.ZygoteSecurityException ( ( "Peer is not permitted to specify " + "an explicit invoke-with wrapper command" ) ) ; } if ( ( args.invokeWith ) != null ) { boolean allowed = android.os.SELinux.checkSELinuxAccess ( peerSecurityContext , peerSecurityContext , "zygote" , "specifyinvokewith" ) ; if ( ! allowed ) { throw new com.android.internal.os.ZygoteSecurityException ( ( "Peer is not permitted to specify " + "an explicit invoke-with wrapper command" ) ) ; } } }
Source:
private void logValidationProbe ( long durationMs , int probeType , int probeResult ) { probeType = android.net.metrics.ValidationProbeEvent.makeProbeType ( probeType , validationStage ( ) . isFirstValidation ) ; mMetricsLog.log ( new android.net.metrics.ValidationProbeEvent ( mNetId , durationMs , probeType , probeResult ) ) ; }

Target:
private void logValidationProbe ( long durationMs , int probeType , int probeResult ) { int [ ] transports = mNetworkAgentInfo.networkCapabilities.getTransportTypes ( ) ; boolean isFirstValidation = validationStage ( ) . isFirstValidation ; android.net.metrics.ValidationProbeEvent ev = new android.net.metrics.ValidationProbeEvent ( ) ; ev.probeType = android.net.metrics.ValidationProbeEvent.makeProbeType ( probeType , isFirstValidation ) ; ev.returnCode = probeResult ; ev.durationMs = durationMs ; mMetricsLog.log ( mNetId , transports , ev ) ; }
Source:
public void setMute ( boolean enableMute , android.os.Message response ) { com.android.internal.telephony.RILRequest rr = com.android.internal.telephony.RILRequest.obtain ( com.android.internal.telephony.RIL_REQUEST_SET_MUTE , response ) ; if ( com.android.internal.telephony.RIL.RILJ_LOGD ) riljLog ( ( ( ( ( ( rr.serialString ( ) ) + "> " ) + ( com.android.internal.telephony.RIL.requestToString ( rr.mRequest ) ) ) + " " ) + enableMute ) ) ; rr.mParcel.writeInt ( 1 ) ; rr.mParcel.writeInt ( ( enableMute ? 1 : 0 ) ) ; send ( rr ) ; }

Target:
public void setMute ( boolean enableMute , android.os.Message response ) { com.android.internal.telephony.RILRequest rr = com.android.internal.telephony.RILRequest.obtain ( com.android.internal.telephony.RIL_REQUEST_SET_MUTE , response , mRILDefaultWorkSource ) ; if ( com.android.internal.telephony.RIL.RILJ_LOGD ) riljLog ( ( ( ( ( ( rr.serialString ( ) ) + "> " ) + ( com.android.internal.telephony.RIL.requestToString ( rr.mRequest ) ) ) + " " ) + enableMute ) ) ; rr.mParcel.writeInt ( 1 ) ; rr.mParcel.writeInt ( ( enableMute ? 1 : 0 ) ) ; send ( rr ) ; }
Source:
public void reportConnectionFailureIsIgnoredWithoutVerboseMode ( ) { final boolean verbosityToggle = false ; mWifiDiagnostics.startLogging ( verbosityToggle ) ; mWifiDiagnostics.reportConnectionFailure ( ) ; org.mockito.Mockito.verify ( mWifiNative ) . getTxPktFates ( org.mockito.Mockito.anyObject ( ) ) ; org.mockito.Mockito.verify ( mWifiNative ) . getRxPktFates ( org.mockito.Mockito.anyObject ( ) ) ; }

Target:
public void reportConnectionFailureIsIgnoredWithoutVerboseMode ( ) { final boolean verbosityToggle = false ; mWifiDiagnostics.startLogging ( verbosityToggle ) ; mWifiDiagnostics.reportConnectionEvent ( WifiDiagnostics.CONNECTION_EVENT_FAILED ) ; org.mockito.Mockito.verify ( mWifiNative ) . getTxPktFates ( org.mockito.Mockito.anyObject ( ) ) ; org.mockito.Mockito.verify ( mWifiNative ) . getRxPktFates ( org.mockito.Mockito.anyObject ( ) ) ; }
Source:
public static void computeCospi ( android.renderscript.cts.TestCospi.ArgumentsFloatFloat args ) { args.out = new android.renderscript.cts.Floaty ( android.renderscript.cts.CoreMathVerifier.cos ( ( ( args.in ) * ( ( float ) ( java.lang.Math.PI ) ) ) ) , 4 , 128 ) ; }

Target:
public static void computeCospi ( android.renderscript.cts.TestCospi.ArgumentsFloatFloat args ) { android.renderscript.cts.Floaty ip = new android.renderscript.cts.Floaty ( ( ( float ) ( ( ( double ) ( args.in ) ) * ( java.lang.Math.PI ) ) ) , 1 , 1 ) ; args.out = android.renderscript.cts.Floaty.FloatyFromRange ( ( ( float ) ( java.lang.Math.cos ( ip.getDoubleMin ( ) ) ) ) , ( ( float ) ( java.lang.Math.cos ( ip.getDoubleMax ( ) ) ) ) , 4 , 128 ) ; }
Source:
synchronized void nAllocationData3D ( long id , int xoff , int yoff , int zoff , int mip , int w , int h , int depth , byte [ ] d , int sizeBytes ) { validate ( ) ; rsnAllocationData3D ( mContext , id , xoff , yoff , zoff , mip , w , h , depth , d , sizeBytes ) ; }

Target:
synchronized void nScriptInvoke ( long id , int slot , boolean mUseInc ) { validate ( ) ; long curCon = mContext ; if ( mUseInc ) { curCon = mIncCon ; } rsnScriptInvoke ( curCon , id , slot , mUseInc ) ; }
Source:
private static void child ( ) throws java.lang.Exception { java.lang.System.out.println ( "spawning child" ) ; java.lang.ProcessBuilder pb = new java.lang.ProcessBuilder ( "sleep" , "5" ) ; java.lang.Process proc = pb.start ( ) ; java.lang.Thread.sleep ( 1000 ) ; Main.checkManager ( ) ; proc.waitFor ( ) ; java.lang.System.out.println ( "child died" ) ; }

Target:
private static void child ( ) throws java.lang.Exception { java.lang.System.out.println ( "spawning child" ) ; java.lang.ProcessBuilder pb = new java.lang.ProcessBuilder ( "sleep" , "5" ) ; java.lang.Process proc = pb.start ( ) ; java.lang.Thread.sleep ( 2000 ) ; Main.checkManager ( ) ; proc.waitFor ( ) ; java.lang.System.out.println ( "child died" ) ; }
Source:
public android.database.Cursor queryAggregationSuggestions ( android.database.sqlite.SQLiteQueryBuilder qb , java.lang.String [ ] projection , long contactId , int maxSuggestions , java.lang.String filter ) { final android.database.sqlite.SQLiteDatabase db = mDbHelper.getReadableDatabase ( ) ; java.util.List < com.android.providers.contacts.ContactMatcher.MatchScore > bestMatches = findMatchingContacts ( db , contactId ) ; return queryMatchingContacts ( qb , db , contactId , projection , bestMatches , maxSuggestions , filter ) ; }

Target:
public android.database.Cursor queryAggregationSuggestions ( android.database.sqlite.SQLiteQueryBuilder qb , java.lang.String [ ] projection , long contactId , int maxSuggestions , java.lang.String filter , java.util.ArrayList < com.android.providers.contacts.ContactAggregator.AggregationSuggestionParameter > parameters ) { final android.database.sqlite.SQLiteDatabase db = mDbHelper.getReadableDatabase ( ) ; db.beginTransaction ( ) ; try { java.util.List < com.android.providers.contacts.ContactMatcher.MatchScore > bestMatches = findMatchingContacts ( db , contactId , parameters ) ; return queryMatchingContacts ( qb , db , projection , bestMatches , maxSuggestions , filter ) ; } finally { db.endTransaction ( ) ; } }
Source:
private static boolean meetsAssistedDialingCriteria ( android.content.ContentValues row1 , android.content.ContentValues row2 ) { int row1Assisted = ( row1.getAsInteger ( AnnotatedCallLog.FEATURES ) ) & ( com.android.dialer.compat.telephony.TelephonyManagerCompat.FEATURES_ASSISTED_DIALING ) ; int row2Assisted = ( row2.getAsInteger ( AnnotatedCallLog.FEATURES ) ) & ( com.android.dialer.compat.telephony.TelephonyManagerCompat.FEATURES_ASSISTED_DIALING ) ; return row1Assisted == row2Assisted ; }

Target:
private static boolean meetsCallFeatureCriteria ( android.content.ContentValues row1 , android.content.ContentValues row2 ) { int row1Features = row1.getAsInteger ( AnnotatedCallLog.FEATURES ) ; int row2Features = row2.getAsInteger ( AnnotatedCallLog.FEATURES ) ; if ( ( row1Features & ( com.android.dialer.compat.telephony.TelephonyManagerCompat.FEATURES_ASSISTED_DIALING ) ) != ( row2Features & ( com.android.dialer.compat.telephony.TelephonyManagerCompat.FEATURES_ASSISTED_DIALING ) ) ) { return false ; } if ( ( row1Features & ( android.provider.CallLog.Calls.FEATURES_VIDEO ) ) != ( row2Features & ( android.provider.CallLog.Calls.FEATURES_VIDEO ) ) ) { return false ; } return true ; }
Source:
public final void transform ( org.eclipse.jdt.core.dom.CompilationUnit cu , org.eclipse.jdt.core.dom.rewrite.ASTRewrite rewrite ) { java.util.List < org.eclipse.jdt.core.dom.Comment > comments = cu.getCommentList ( ) ; for ( org.eclipse.jdt.core.dom.Comment comment : com.google.common.collect.Lists.reverse ( comments ) ) { if ( comment instanceof org.eclipse.jdt.core.dom.Javadoc ) { org.eclipse.jdt.core.dom.Javadoc javadoc = ( ( org.eclipse.jdt.core.dom.Javadoc ) ( comment ) ) ; visit ( javadoc , rewrite ) ; } } }

Target:
public final void process ( com.google.currysrc.api.process.Context context , org.eclipse.jdt.core.dom.CompilationUnit cu ) { java.util.List < org.eclipse.jdt.core.dom.Comment > comments = cu.getCommentList ( ) ; org.eclipse.jdt.core.dom.rewrite.ASTRewrite rewrite = context.rewrite ( ) ; com.google.currysrc.api.process.Reporter reporter = context.reporter ( ) ; for ( org.eclipse.jdt.core.dom.Comment comment : com.google.common.collect.Lists.reverse ( comments ) ) { if ( comment instanceof org.eclipse.jdt.core.dom.Javadoc ) { org.eclipse.jdt.core.dom.Javadoc javadoc = ( ( org.eclipse.jdt.core.dom.Javadoc ) ( comment ) ) ; visit ( reporter , javadoc , rewrite ) ; } } }
Source:
com.android.sched.vfs.DirectFS.DirectVDir getVDir ( @ javax.annotation.Nonnull com.android.sched.vfs.DirectFS.DirectVDir parent , @ javax.annotation.Nonnull java.lang.String name ) throws com.android.sched.util.file.NoSuchFileException , com.android.sched.util.file.NotDirectoryException { assert ( ( permissions ) & ( com.android.sched.util.file.FileOrDirectory.Permission.READ ) ) != 0 ; java.io.File file = new java.io.File ( parent.getNativePath ( ) , name ) ; com.android.sched.util.file.Directory.check ( file , new com.android.sched.util.location.DirectoryLocation ( file ) ) ; return new com.android.sched.vfs.DirectFS.DirectNonRootVDir ( this , parent , name ) ; }

Target:
com.android.sched.vfs.ParentVFile createVFile ( @ javax.annotation.Nonnull com.android.sched.vfs.ParentVDir parent , @ javax.annotation.Nonnull java.lang.String name ) throws com.android.sched.util.file.CannotCreateFileException { assert ! ( isClosed ( ) ) ; assert ( ( permissions ) & ( com.android.sched.util.file.FileOrDirectory.Permission.WRITE ) ) != 0 ; java.io.File path = getNativeFile ( parent.getPath ( ) , name ) ; try { com.android.sched.util.file.AbstractStreamFile.create ( path , new com.android.sched.util.location.FileLocation ( path ) ) ; } catch ( com.android.sched.util.file.FileAlreadyExistsException e ) { } return new com.android.sched.vfs.ParentVFile ( this , parent , name ) ; }
Source:
private static org.apache.http.HttpEntity entityFromConnection ( java.net.HttpURLConnection connection ) { org.apache.http.entity.BasicHttpEntity entity = new org.apache.http.entity.BasicHttpEntity ( ) ; java.io.InputStream inputStream ; try { inputStream = connection.getInputStream ( ) ; } catch ( java.io.IOException ioe ) { inputStream = connection.getErrorStream ( ) ; } entity.setContent ( inputStream ) ; entity.setContentLength ( connection.getContentLength ( ) ) ; entity.setContentEncoding ( connection.getContentEncoding ( ) ) ; entity.setContentType ( connection.getContentType ( ) ) ; return entity ; }

Target:
private static java.io.InputStream inputStreamFromConnection ( java.net.HttpURLConnection connection ) { java.io.InputStream inputStream ; try { inputStream = connection.getInputStream ( ) ; } catch ( java.io.IOException ioe ) { inputStream = connection.getErrorStream ( ) ; } return inputStream ; }
Source:
public void testSetValues001 ( ) { logWriter.println ( "testSetValues001 started" ) ; synchronizer.receiveMessage ( JPDADebuggeeSynchronizer.SGNL_READY ) ; long classID = getClassIDBySignature ( getDebuggeeSignature ( ) ) ; org.apache.harmony.jpda.tests.jdwp.ClassType.FieldInfo [ ] fields = jdwpGetFieldIDs ( classID ) ; for ( int i = 0 ; i < ( fields.length ) ; i ++ ) { org.apache.harmony.jpda.tests.jdwp.ClassType.FieldInfo field = fields [ i ] ; testField ( classID , field ) ; } }

Target:
public void testSetValues001 ( ) { logWriter.println ( "testSetValues001 started" ) ; synchronizer.receiveMessage ( JPDADebuggeeSynchronizer.SGNL_READY ) ; long classID = getClassIDBySignature ( getDebuggeeSignature ( ) ) ; org.apache.harmony.jpda.tests.framework.jdwp.Field [ ] fields = jdwpGetFieldIDs ( classID ) ; for ( int i = 0 ; i < ( fields.length ) ; i ++ ) { org.apache.harmony.jpda.tests.framework.jdwp.Field field = fields [ i ] ; testField ( classID , field ) ; } }
Source:
public synchronized int getConnectionState ( ) { com.android.internal.util.IState currentState = getCurrentState ( ) ; if ( currentState == ( mConnecting ) ) { return android.bluetooth.BluetoothProfile.STATE_CONNECTING ; } else if ( currentState instanceof com.android.bluetooth.hfp.HeadsetStateMachine.ConnectedBase ) { return android.bluetooth.BluetoothProfile.STATE_CONNECTED ; } else if ( currentState == ( mDisconnecting ) ) { return android.bluetooth.BluetoothProfile.STATE_DISCONNECTING ; } return android.bluetooth.BluetoothProfile.STATE_DISCONNECTED ; }

Target:
java.util.List < android.bluetooth.BluetoothDevice > getConnectedDevices ( ) { java.util.List < android.bluetooth.BluetoothDevice > devices = new java.util.ArrayList < > ( ) ; synchronized ( this ) { if ( ( getCurrentState ( ) ) instanceof com.android.bluetooth.hfp.HeadsetStateMachine.ConnectedBase ) { devices.add ( mCurrentDevice ) ; } } return devices ; }
Source:
public static < T > org.hamcrest.org.hamcrest.Matcher < T > sameInstance ( T object ) { return org.hamcrest.core.IsSame.sameInstance ( object ) ; }

Target:
public static < T > org.hamcrest.org.hamcrest.Matcher < T > allOf ( org.hamcrest.org.hamcrest.Matcher < ? extends T > first , org.hamcrest.org.hamcrest.Matcher < ? extends T > second , org.hamcrest.org.hamcrest.Matcher < ? extends T > third , org.hamcrest.org.hamcrest.Matcher < ? extends T > fourth , org.hamcrest.org.hamcrest.Matcher < ? extends T > fifth , org.hamcrest.org.hamcrest.Matcher < ? extends T > sixth ) { return org.hamcrest.core.AllOf.< org.hamcrest.T > allOf ( first , second , third , fourth , fifth , sixth ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { org.mockito.MockitoAnnotations.initMocks ( this ) ; com.android.server.wifi.TestUtil.installWlanWifiNative ( mWifiNative ) ; mLooper = new android.os.test.TestLooper ( ) ; mRttServiceImpl = new com.android.server.wifi.RttService.RttServiceImpl ( mContext , mLooper.getLooper ( ) ) ; mRttServiceImpl.startService ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { org.mockito.MockitoAnnotations.initMocks ( this ) ; com.android.server.wifi.TestUtil.installWlanWifiNative ( mWifiNative ) ; mLooper = new android.os.test.TestLooper ( ) ; org.mockito.Mockito.when ( mWifiInjector.makeWificond ( ) ) . thenReturn ( mWificond ) ; mRttServiceImpl = new com.android.server.wifi.RttService.RttServiceImpl ( mContext , mLooper.getLooper ( ) , mWifiInjector ) ; mRttServiceImpl.startService ( ) ; }
Source:
public void onClick ( android.content.DialogInterface dialog , int which ) { if ( ( wps.setup ) == ( android.net.wifi.WpsInfo.KEYPAD ) ) { mSavedPeerConfig.wps.pin = pin.getText ( ) . toString ( ) ; } if ( android.net.wifi.p2p.WifiP2pService.DBG ) logd ( ( ( ( getName ( ) ) + " accept invitation " ) + ( mSavedPeerConfig ) ) ) ; sendMessage ( android.net.wifi.p2p.WifiP2pService.PEER_CONNECTION_USER_ACCEPT ) ; }

Target:
public void onClick ( android.content.DialogInterface dialog , int which ) { if ( android.net.wifi.p2p.WifiP2pService.DBG ) logd ( ( ( getName ( ) ) + " ignore connect" ) ) ; sendMessage ( android.net.wifi.p2p.WifiP2pService.PEER_CONNECTION_USER_REJECT ) ; }
Source:
public void testStrategyFileSimple ( ) throws java.lang.Exception { final android.support.v4.content.FileProvider.SimplePathStrategy strat = new android.support.v4.content.FileProvider.SimplePathStrategy ( "authority" ) ; strat.addRoot ( "tag" , mContext.getFilesDir ( ) ) ; java.io.File file = android.support.v4.content.FileProviderTest.buildPath ( mContext.getFilesDir ( ) , "file.test" ) ; assertEquals ( file.getPath ( ) , strat.getFileForUri ( android.net.Uri.parse ( "content://authority/tag/file.test" ) ) . getPath ( ) ) ; file = android.support.v4.content.FileProviderTest.buildPath ( mContext.getFilesDir ( ) , "subdir" , "file.test" ) ; assertEquals ( file.getPath ( ) , strat.getFileForUri ( android.net.Uri.parse ( "content://authority/tag/subdir/file.test" ) ) . getPath ( ) ) ; }

Target:
public void testStrategyFileSimple ( ) throws java.lang.Exception { final android.support.v4.content.FileProvider.SimplePathStrategy strat = new android.support.v4.content.FileProvider.SimplePathStrategy ( "authority" ) ; strat.addRoot ( "tag" , mContext.getFilesDir ( ) ) ; java.io.File expectedRoot = mContext.getFilesDir ( ) . getCanonicalFile ( ) ; java.io.File file = android.support.v4.content.FileProviderTest.buildPath ( expectedRoot , "file.test" ) ; assertEquals ( file.getPath ( ) , strat.getFileForUri ( android.net.Uri.parse ( "content://authority/tag/file.test" ) ) . getPath ( ) ) ; file = android.support.v4.content.FileProviderTest.buildPath ( expectedRoot , "subdir" , "file.test" ) ; assertEquals ( file.getPath ( ) , strat.getFileForUri ( android.net.Uri.parse ( "content://authority/tag/subdir/file.test" ) ) . getPath ( ) ) ; }
Source:
public void writeIpAndProxyConfigurations ( android.net.IpConfiguration config ) { android.util.SparseArray < android.net.IpConfiguration > networks = new android.util.SparseArray < android.net.IpConfiguration > ( ) ; networks.put ( 0 , config ) ; writeIpAndProxyConfigurations ( com.android.server.ethernet.EthernetConfigStore.ipConfigFile , networks ) ; }

Target:
public void write ( java.lang.String iface , android.net.IpConfiguration config ) { boolean modified ; synchronized ( mSync ) { if ( config == null ) { modified = ( mIpConfigurations.remove ( iface ) ) != null ; } else { android.net.IpConfiguration oldConfig = mIpConfigurations.put ( iface , config ) ; modified = ! ( config.equals ( oldConfig ) ) ; } if ( modified ) { mStore.writeIpConfigurations ( com.android.server.ethernet.EthernetConfigStore.ipConfigFile , mIpConfigurations ) ; } } }
Source:
public com.android.sched.vfs.VFS 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 { try { return new com.android.sched.vfs.CachedDirectFS ( new com.android.sched.util.file.Directory ( string , context.getRunnableHooks ( ) , existence , permissions , change ) , permissions ) ; } catch ( java.io.IOException e ) { throw new com.android.sched.util.codec.ParsingException ( e ) ; } }

Target:
public com.android.sched.vfs.VFS 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 { try { return new com.android.sched.vfs.CachedDirectFS ( new com.android.sched.util.file.Directory ( context.getWorkingDirectory ( ) , string , context.getRunnableHooks ( ) , existence , permissions , change ) , permissions ) ; } catch ( java.io.IOException e ) { throw new com.android.sched.util.codec.ParsingException ( e ) ; } }
Source:
public static java.util.List < com.google.gct.idea.appengine.wizard.AppEngineTemplates.TemplateInfo > getLocalTemplates ( ) { com.google.gct.idea.appengine.wizard.AppEngineTemplates.LOG.info ( "Populating built-in App Engine templates..." ) ; java.io.File jarPath = new java.io.File ( com.intellij.util.PathUtil.getJarPathForClass ( com.google.gct.idea.appengine.wizard.AppEngineTemplates.class ) ) ; if ( jarPath.isFile ( ) ) { jarPath = jarPath.getParentFile ( ) ; } java.io.File root = new java.io.File ( jarPath , com.google.gct.idea.appengine.wizard.AppEngineTemplates.TEMPLATES_DIR ) ; if ( ! ( root.exists ( ) ) ) { com.google.gct.idea.appengine.wizard.AppEngineTemplates.LOG.error ( "Failed to find templates directory, perhaps your cloud tools plugin is corrupt?" ) ; } return com.google.gct.idea.appengine.wizard.AppEngineTemplates.populateTemplates ( root ) ; }

Target:
private static java.io.File findTemplatesDirInPluginJar ( java.lang.String name ) { java.io.File jarPath = new java.io.File ( com.intellij.util.PathUtil.getJarPathForClass ( com.google.gct.idea.appengine.wizard.AppEngineTemplates.class ) ) ; if ( jarPath.isFile ( ) ) { jarPath = jarPath.getParentFile ( ) ; } return new java.io.File ( jarPath , name ) ; }
Source:
public void waitForCalls ( int expectedCalls , long timeout ) throws java.lang.InterruptedException { synchronized ( mLock ) { mExpectedCalls = expectedCalls ; if ( ( mCalls ) < ( mExpectedCalls ) ) { mLock.wait ( timeout ) ; } } }

Target:
public boolean waitForCalls ( int expectedCalls , long timeout ) throws java.lang.InterruptedException { synchronized ( mLock ) { mExpectedCalls = expectedCalls ; long startTime = android.os.SystemClock.elapsedRealtime ( ) ; while ( ( mCalls ) < ( mExpectedCalls ) ) { long waitTime = timeout - ( ( android.os.SystemClock.elapsedRealtime ( ) ) - startTime ) ; if ( waitTime > 0 ) { mLock.wait ( waitTime ) ; } else { return false ; } } return true ; } }