auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void requestScores ( android.net.NetworkKey [ ] networks ) throws android.os.RemoteException { if ( ( networks != null ) && ( ( networks.length ) > 0 ) ) { mHandler.obtainMessage ( android.net.NetworkRecommendationProvider.ServiceHandler.MSG_REQUEST_SCORES , networks ) . sendToTarget ( ) ; } }

Target:
public void requestScores ( final android.net.NetworkKey [ ] networks ) throws android.os.RemoteException { if ( ( networks != null ) && ( ( networks.length ) > 0 ) ) { mHandler.post ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { onRequestScores ( networks ) ; } } ) ; } }
Source:
public void tearDown ( ) throws java.lang.Exception { stopService ( ) ; mTargetContext.unregisterReceiver ( mConnectionStateChangedReceiver ) ; mConnectionStateChangedQueue.clear ( ) ; }

Target:
public void tearDown ( ) throws java.lang.Exception { if ( ! ( mTargetContext.getResources ( ) . getBoolean ( R.bool.profile_supported_a2dp ) ) ) { return ; } stopService ( ) ; mTargetContext.unregisterReceiver ( mConnectionStateChangedReceiver ) ; mConnectionStateChangedQueue.clear ( ) ; com.android.bluetooth.TestUtils.clearAdapterService ( mAdapterService ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; mDevice.registerWatcher ( com.android.devtools.systemimage.uitest.watchers.LockScreenWatcher.class . getName ( ) , new com.android.devtools.systemimage.uitest.watchers.LockScreenWatcher ( mDevice ) ) ; }

Target:
public void testLockScreenWatcher ( ) throws java.lang.Exception { android.app.Instrumentation instrumentation = testFramework.getInstrumentation ( ) ; android.support.test.uiautomator.UiDevice device = testFramework.getDevice ( ) ; device.registerWatcher ( com.android.devtools.systemimage.uitest.watchers.LockScreenWatcher.class . getName ( ) , new com.android.devtools.systemimage.uitest.watchers.LockScreenWatcher ( device ) ) ; device.sleep ( ) ; device.wakeUp ( ) ; com.android.devtools.systemimage.uitest.utils.AppLauncher.launch ( instrumentation , "Email" ) ; device.removeWatcher ( com.android.devtools.systemimage.uitest.watchers.LockScreenWatcher.class . getName ( ) ) ; }
Source:
private void notifyCharacteristicChanged ( java.lang.String value ) { showMessage ( ( "Characteristic changed: " + value ) ) ; android.content.Intent intent = new android.content.Intent ( com.android.cts.verifier.bluetooth.BleClientService.BLE_CHARACTERISTIC_CHANGED ) ; intent.putExtra ( com.android.cts.verifier.bluetooth.BleClientService.EXTRA_CHARACTERISTIC_VALUE , value ) ; sendBroadcast ( intent ) ; }

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:
private static void onDataPathRequest ( int pubSubId , byte [ ] mac , int ndpId , byte [ ] message ) { if ( com.android.server.wifi.aware.WifiAwareNative.VDBG ) { android.util.Log.v ( com.android.server.wifi.aware.WifiAwareNative.TAG , ( ( ( ( ( "onDataPathRequest: pubSubId=" + pubSubId ) + ", mac=" ) + ( java.lang.String.valueOf ( libcore.util.HexEncoding.encode ( mac ) ) ) ) + ", ndpId=" ) + ndpId ) ) ; } com.android.server.wifi.aware.WifiAwareStateManager.getInstance ( ) . onDataPathRequestNotification ( pubSubId , mac , ndpId , message ) ; }

Target:
private static void onDataPathRequest ( int pubSubId , byte [ ] mac , int ndpId , byte [ ] message ) { if ( com.android.server.wifi.aware.WifiAwareNative.VDBG ) { android.util.Log.v ( com.android.server.wifi.aware.WifiAwareNative.TAG , ( ( ( ( ( "onDataPathRequest: pubSubId=" + pubSubId ) + ", mac=" ) + ( java.lang.String.valueOf ( libcore.util.HexEncoding.encode ( mac ) ) ) ) + ", ndpId=" ) + ndpId ) ) ; } com.android.server.wifi.aware.WifiAwareNative.sWifiAwareStateManager.onDataPathRequestNotification ( pubSubId , mac , ndpId , message ) ; }
Source:
private void sendMessage ( int what , com.android.bluetooth.gatt.ScanClient client ) { android.os.Message message = new android.os.Message ( ) ; message.what = what ; message.obj = client ; mHandler.sendMessage ( message ) ; }

Target:
public void onUidImportance ( final int uid , final int importance ) { if ( ( mService.mScannerMap.getAppScanStatsByUid ( uid ) ) != null ) { android.os.Message message = new android.os.Message ( ) ; message.what = com.android.bluetooth.gatt.ScanManager.MSG_IMPORTANCE_CHANGE ; message.obj = new com.android.bluetooth.gatt.ScanManager.UidImportance ( uid , importance ) ; mHandler.sendMessage ( message ) ; } }
Source:
public void testNewInstanceString_StringBufferConstructor ( ) { runTestNewInstanceString ( "(Ljava/lang/StringBuffer;)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 stringBufferValue = getStaticFieldValue ( debuggeeClassId , "STRING_BUFFER" ) ; constructorArguments.add ( stringBufferValue ) ; } } ) ; }

Target:
public void testNewInstanceString_StringBufferConstructor ( ) { runTestNewInstanceString ( "(Ljava/lang/StringBuffer;)V" , "my test string" , 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 stringBufferValue = getStaticFieldValue ( debuggeeClassId , "STRING_BUFFER" ) ; constructorArguments.add ( stringBufferValue ) ; } } ) ; }
Source:
public void execute ( ) { synchronized ( runnables ) { if ( executed ) { return ; } executed = true ; } while ( ! ( runnables.isEmpty ( ) ) ) { runnables.poll ( ) . execute ( ) ; } }

Target:
public void execute ( ) { com.google.common.util.concurrent.ExecutionList.RunnableExecutorPair list ; synchronized ( this ) { if ( executed ) { return ; } executed = true ; list = runnables ; runnables = null ; } com.google.common.util.concurrent.ExecutionList.RunnableExecutorPair reversedList = null ; while ( list != null ) { com.google.common.util.concurrent.ExecutionList.RunnableExecutorPair tmp = list ; list = list.next ; tmp.next = reversedList ; reversedList = tmp ; } while ( reversedList != null ) { com.google.common.util.concurrent.ExecutionList.executeListener ( reversedList.runnable , reversedList.executor ) ; reversedList = reversedList.next ; } }
Source:
public void test_parkFor_1 ( ) { java.util.concurrent.CyclicBarrier barrier = new java.util.concurrent.CyclicBarrier ( 2 ) ; tests.api.org.apache.harmony.kernel.dalvik.ThreadsTest.Parker parker = new tests.api.org.apache.harmony.kernel.dalvik.ThreadsTest.Parker ( barrier , false , 500 ) ; java.lang.Thread parkerThread = new java.lang.Thread ( parker ) ; java.lang.Thread waiterThread = new java.lang.Thread ( new tests.api.org.apache.harmony.kernel.dalvik.ThreadsTest.WaitAndUnpark ( barrier , 1000 , parkerThread ) ) ; parkerThread.start ( ) ; waiterThread.start ( ) ; parker.assertDurationIsInRange ( 500 ) ; }

Target:
public void test_parkFor_1 ( ) throws java.lang.Exception { java.util.concurrent.CyclicBarrier barrier = new java.util.concurrent.CyclicBarrier ( 2 ) ; tests.api.org.apache.harmony.kernel.dalvik.ThreadsTest.Parker parker = new tests.api.org.apache.harmony.kernel.dalvik.ThreadsTest.Parker ( barrier , false , 500 ) ; java.lang.Thread parkerThread = new java.lang.Thread ( parker ) ; java.lang.Thread waiterThread = new java.lang.Thread ( new tests.api.org.apache.harmony.kernel.dalvik.ThreadsTest.WaitAndUnpark ( barrier , 1000 , parkerThread ) ) ; parkerThread.start ( ) ; waiterThread.start ( ) ; parker.assertDurationIsInRange ( 500 ) ; waiterThread.join ( ) ; parkerThread.join ( ) ; }
Source:
public void onRangingSuccess ( int rangingId , android.net.wifi.RttManager.ParcelableRttResults results ) { if ( android.net.wifi.nan.WifiNanManager.VDBG ) { android.util.Log.v ( android.net.wifi.nan.WifiNanManager.TAG , ( ( ( "onRangingSuccess: rangingId=" + rangingId ) + ", results=" ) + results ) ) ; } android.os.Message msg = mHandler.obtainMessage ( android.net.wifi.nan.WifiNanManager.WifiNanEventCallbackProxy.CALLBACK_RANGING_SUCCESS ) ; msg.arg1 = rangingId ; msg.obj = results ; mHandler.sendMessage ( msg ) ; }

Target:
public void onRangingSuccess ( int rangingId , android.net.wifi.RttManager.ParcelableRttResults results ) { if ( android.net.wifi.aware.WifiAwareManager.VDBG ) { android.util.Log.v ( android.net.wifi.aware.WifiAwareManager.TAG , ( ( ( "onRangingSuccess: rangingId=" + rangingId ) + ", results=" ) + results ) ) ; } android.os.Message msg = mHandler.obtainMessage ( android.net.wifi.aware.WifiAwareManager.WifiAwareEventCallbackProxy.CALLBACK_RANGING_SUCCESS ) ; msg.arg1 = rangingId ; msg.obj = results ; mHandler.sendMessage ( msg ) ; }
Source:
public static void copy ( java.io.File from , java.io.File to ) throws java.io.IOException { com.google.common.base.Preconditions.checkArgument ( ( ! ( from.equals ( to ) ) ) , "Source %s and destination %s must be different" , from , to ) ; com.google.common.io.Files.copy ( com.google.common.io.Files.newInputStreamSupplier ( from ) , to ) ; }

Target:
public static void copy ( java.io.File from , java.io.File to ) throws java.io.IOException { com.google.common.base.Preconditions.checkArgument ( ( ! ( from.equals ( to ) ) ) , "Source %s and destination %s must be different" , from , to ) ; com.google.common.io.Files.asByteSource ( from ) . copyTo ( com.google.common.io.Files.asByteSink ( to ) ) ; }
Source:
public int getBooleanAttributes ( java.io.File f ) { int rv = getBooleanAttributes0 ( f.getPath ( ) ) ; java.lang.String name = f.getName ( ) ; boolean hidden = ( ( name.length ( ) ) > 0 ) && ( ( name.charAt ( 0 ) ) == '.' ) ; return rv | ( hidden ? java.io.FileSystem.BA_HIDDEN : 0 ) ; }

Target:
public int getBooleanAttributes ( java.io.File f ) { dalvik.system.BlockGuard.getThreadPolicy ( ) . onReadFromDisk ( ) ; int rv = getBooleanAttributes0 ( f.getPath ( ) ) ; java.lang.String name = f.getName ( ) ; boolean hidden = ( ( name.length ( ) ) > 0 ) && ( ( name.charAt ( 0 ) ) == '.' ) ; return rv | ( hidden ? java.io.FileSystem.BA_HIDDEN : 0 ) ; }
Source:
private com.android.ahat.heapdump.Value getDumpedValue ( java.lang.String name , com.android.ahat.heapdump.AhatSnapshot snapshot ) { com.android.ahat.heapdump.AhatClassObj main = snapshot.findClass ( "Main" ) ; com.android.ahat.heapdump.AhatInstance stuff = null ; for ( com.android.ahat.heapdump.FieldValue field : main.getStaticFieldValues ( ) ) { if ( "stuff" . equals ( field.name ) ) { stuff = field.value.asAhatInstance ( ) ; } } return stuff.getField ( name ) ; }

Target:
private static com.android.ahat.heapdump.AhatClassObj findClass ( com.android.ahat.heapdump.AhatSnapshot snapshot , java.lang.String name ) { com.android.ahat.heapdump.Site root = snapshot.getRootSite ( ) ; java.util.Collection < com.android.ahat.heapdump.AhatInstance > classes = new java.util.ArrayList < com.android.ahat.heapdump.AhatInstance > ( ) ; root.getObjects ( null , "java.lang.Class" , classes ) ; for ( com.android.ahat.heapdump.AhatInstance inst : classes ) { if ( inst.isClassObj ( ) ) { com.android.ahat.heapdump.AhatClassObj cls = inst.asClassObj ( ) ; if ( name.equals ( cls.getName ( ) ) ) { return cls ; } } } return null ; }
Source:
protected void deleteFile ( java.io.File dir ) { if ( dir.isDirectory ( ) ) { for ( java.io.File f : dir.listFiles ( ) ) { deleteFile ( f ) ; } } else if ( dir.isFile ( ) ) { assertTrue ( dir.getPath ( ) , dir.delete ( ) ) ; } }

Target:
protected void deleteFile ( java.io.File dir ) { com.android.testutils.TestUtils.deleteFile ( dir ) ; }
Source:
public static java.util.List < java.lang.Integer > getInts ( android.security.keymaster.KeyCharacteristics keyCharacteristics , int tag ) { java.util.List < java.lang.Integer > result = new java.util.ArrayList < java.lang.Integer > ( ) ; result.addAll ( keyCharacteristics.hwEnforced.getInts ( tag ) ) ; result.addAll ( keyCharacteristics.swEnforced.getInts ( tag ) ) ; return result ; }

Target:
public static int [ ] getKeymasterBlockModesFromJcaBlockModes ( java.lang.String [ ] jcaBlockModes ) { if ( ( jcaBlockModes == null ) || ( ( jcaBlockModes.length ) == 0 ) ) { return libcore.util.EmptyArray.INT ; } int [ ] result = new int [ jcaBlockModes.length ] ; for ( int i = 0 ; i < ( jcaBlockModes.length ) ; i ++ ) { result [ i ] = android.security.KeymasterUtils.getKeymasterBlockModeFromJcaBlockMode ( jcaBlockModes [ i ] ) ; } return result ; }
Source:
public void testGetPath_SpecifiedApiResource ( ) { initializePsiClass ( "\"abc\"" , "\"\"" ) ; initializePsiMethod ( "\"\"" , "\"\"" , "\"\"" ) ; org.mockito.MockitoAnnotations.initMocks ( this ) ; com.google.gct.intellij.endpoints.validation.RestSignatureInspection inspection = new com.google.gct.intellij.endpoints.validation.RestSignatureInspection ( ) ; java.lang.String path = inspection.getPath ( mockPsiMethod ) ; junit.framework.Assert.assertEquals ( "abc" , path ) ; }

Target:
public void testGetPath_SpecifiedApiResource ( ) { initializePsiClass ( "\"abc\"" , "\"\"" ) ; initializePsiMethod ( "\"\"" , "\"\"" , "\"\"" ) ; org.mockito.MockitoAnnotations.initMocks ( this ) ; com.google.gct.idea.appengine.validation.RestSignatureInspection inspection = new com.google.gct.idea.appengine.validation.RestSignatureInspection ( ) ; java.lang.String path = inspection.getPath ( mockPsiMethod ) ; junit.framework.Assert.assertEquals ( "abc" , path ) ; }
Source:
public void findDifferentValue ( ) { java.util.List < java.lang.String > strings = com.google.common.collect.Lists.newArrayList ( "foo" , "maxSdkVersion:'20'" , "bar" ) ; com.android.build.gradle.integration.common.truth.ApkSubjectTest.FakeFailureStrategy failure = new com.android.build.gradle.integration.common.truth.ApkSubjectTest.FakeFailureStrategy ( ) ; java.io.File file = new java.io.File ( "foo" ) ; com.android.build.gradle.integration.common.truth.ApkSubject subject = new com.android.build.gradle.integration.common.truth.ApkSubject ( failure , file ) ; subject.checkMaxSdkVersion ( strings , 14 ) ; com.google.common.truth.Truth.assertThat ( failure.message ) . is ( "Not true that <foo> has maxSdkVersion <14>. It is <20>" ) ; }

Target:
public void findDifferentValue ( ) { java.util.List < java.lang.String > strings = com.google.common.collect.Lists.newArrayList ( "foo" , "maxSdkVersion:'20'" , "bar" ) ; com.android.build.gradle.integration.common.truth.FakeFailureStrategy failure = new com.android.build.gradle.integration.common.truth.FakeFailureStrategy ( ) ; java.io.File file = new java.io.File ( "foo" ) ; com.android.build.gradle.integration.common.truth.ApkSubject subject = new com.android.build.gradle.integration.common.truth.ApkSubject ( failure , file ) ; subject.checkMaxSdkVersion ( strings , 14 ) ; com.google.common.truth.Truth.assertThat ( failure.message ) . is ( "Not true that <foo> has maxSdkVersion <14>. It is <20>" ) ; }
Source:
private static void edgeSplitSuccessors ( com.android.jack.ir.ast.cfg.JControlFlowGraph cfg ) { for ( com.android.jack.ir.ast.cfg.JBasicBlock block : cfg.getInternalBlocksUnordered ( ) ) { for ( com.android.jack.ir.ast.cfg.JBasicBlock succ : block.getSuccessors ( ) ) { if ( com.android.jack.transformations.ssa.SsaBasicBlockSplitter.needsNewSuccessor ( block , succ ) ) { if ( ( succ instanceof com.android.jack.ir.ast.cfg.JCatchBasicBlock ) || ( succ instanceof com.android.jack.ir.ast.cfg.JCaseBasicBlock ) ) { block.split ( ( - 1 ) ) ; } else { com.android.jack.transformations.ssa.SsaBasicBlockSplitter.insertNewSimpleSuccessor ( block , succ ) ; } } } } }

Target:
private void removeExceptionHandlingContext ( @ javax.annotation.Nonnull com.android.jack.ir.ast.cfg.JControlFlowGraph cfg ) { for ( com.android.jack.ir.ast.cfg.JBasicBlock block : cfg.getInternalBlocksUnordered ( ) ) { for ( com.android.jack.ir.ast.cfg.JBasicBlockElement element : block.getElements ( true ) ) { element.resetEHContext ( ExceptionHandlingContext.EMPTY ) ; } } new com.android.jack.optimizations.cfg.CfgBasicBlockUtils ( cfg ) . removeUnreachableBlocks ( ) ; }
Source:
public void afterHandshake ( long session , long s , long c , java.net.Socket sock , java.io.FileDescriptor fd , org.conscrypt.NativeCrypto.SSLHandshakeCallbacks callback ) throws java.lang.Exception { java.lang.String v = org.conscrypt.NativeCrypto.SSL_SESSION_get_version ( session ) ; assertTrue ( StandardNames.SSL_SOCKET_PROTOCOLS.contains ( v ) ) ; super . afterHandshake ( session , s , c , sock , fd , callback ) ; }

Target:
public void run ( long sslSession ) throws java.lang.Exception { try { org.conscrypt.NativeCrypto.SSL_shutdown ( sslSession , org.conscrypt.NativeCryptoTest.INVALID_FD , org.conscrypt.NativeCryptoTest.DUMMY_CB ) ; fail ( ) ; } catch ( java.net.SocketException expected ) { } }
Source:
public android.net.IpSecTransform.Builder setSpi ( @ android.net.IpSecTransform.TransformDirection int direction , android.net.IpSecManager.SecurityParameterIndex spi ) { mConfig.setSpiResourceId ( direction , spi.getResourceId ( ) ) ; return this ; }

Target:
public android.net.IpSecTransform buildTransportModeTransform ( @ android.annotation.NonNull java.net.InetAddress sourceAddress , @ android.annotation.NonNull android.net.IpSecManager.SecurityParameterIndex spi ) throws IpSecManager.ResourceUnavailableException , IpSecManager.SpiUnavailableException , java.io.IOException { com.android.internal.util.Preconditions.checkNotNull ( sourceAddress ) ; com.android.internal.util.Preconditions.checkNotNull ( spi ) ; if ( ( spi.getResourceId ( ) ) == ( android.net.IpSecManager.INVALID_RESOURCE_ID ) ) { throw new java.lang.IllegalArgumentException ( "Invalid SecurityParameterIndex" ) ; } mConfig.setMode ( android.net.IpSecTransform.MODE_TRANSPORT ) ; mConfig.setSourceAddress ( sourceAddress.getHostAddress ( ) ) ; mConfig.setSpiResourceId ( spi.getResourceId ( ) ) ; return new android.net.IpSecTransform ( mContext , mConfig ) . activate ( ) ; }
Source:
private void writePersistentServicesLocked ( ) { if ( ( mSerializerAndParser ) == null ) { return ; } java.io.FileOutputStream fos = null ; try { fos = mPersistentServicesFile.startWrite ( ) ; org.xmlpull.v1.XmlSerializer out = new com.android.internal.util.FastXmlSerializer ( ) ; out.setOutput ( fos , "utf-8" ) ; out.startDocument ( null , true ) ; out.setFeature ( "http://xmlpull.org/v1/doc/features.html#indent-output" , true ) ; out.startTag ( null , "services" ) ; for ( int i = 0 ; i < ( mUserServices.size ( ) ) ; i ++ ) { final android.content.pm.RegisteredServicesCache.UserServices < V > user = mUserServices.valueAt ( i ) ; for ( java.util.Map.Entry < V , java.lang.Integer > service : user.persistentServices.entrySet ( ) ) { out.startTag ( null , "service" ) ; out.attribute ( null , "uid" , java.lang.Integer.toString ( service.getValue ( ) ) ) ; mSerializerAndParser.writeAsXml ( service.getKey ( ) , out ) ; out.endTag ( null , "service" ) ; } } out.endTag ( null , "services" ) ; out.endDocument ( ) ; mPersistentServicesFile.finishWrite ( fos ) ; } catch ( java.io.IOException e1 ) { android.util.Log.w ( android.content.pm.RegisteredServicesCache.TAG , "Error writing accounts" , e1 ) ; if ( fos != null ) { mPersistentServicesFile.failWrite ( fos ) ; } } }

Target:
private void writePersistentServicesLocked ( ) { if ( ( mSerializerAndParser ) == null ) { return ; } java.io.FileOutputStream fos = null ; try { fos = mPersistentServicesFile.startWrite ( ) ; org.xmlpull.v1.XmlSerializer out = new com.android.internal.util.FastXmlSerializer ( ) ; out.setOutput ( fos , java.nio.charset.StandardCharsets.UTF_8.name ( ) ) ; out.startDocument ( null , true ) ; out.setFeature ( "http://xmlpull.org/v1/doc/features.html#indent-output" , true ) ; out.startTag ( null , "services" ) ; for ( int i = 0 ; i < ( mUserServices.size ( ) ) ; i ++ ) { final android.content.pm.RegisteredServicesCache.UserServices < V > user = mUserServices.valueAt ( i ) ; for ( java.util.Map.Entry < V , java.lang.Integer > service : user.persistentServices.entrySet ( ) ) { out.startTag ( null , "service" ) ; out.attribute ( null , "uid" , java.lang.Integer.toString ( service.getValue ( ) ) ) ; mSerializerAndParser.writeAsXml ( service.getKey ( ) , out ) ; out.endTag ( null , "service" ) ; } } out.endTag ( null , "services" ) ; out.endDocument ( ) ; mPersistentServicesFile.finishWrite ( fos ) ; } catch ( java.io.IOException e1 ) { android.util.Log.w ( android.content.pm.RegisteredServicesCache.TAG , "Error writing accounts" , e1 ) ; if ( fos != null ) { mPersistentServicesFile.failWrite ( fos ) ; } } }
Source:
public void onSomePackagesChanged ( ) { synchronized ( mLock ) { if ( ( mUiAutomationService ) == null ) { populateAccessibilityServiceListLocked ( ) ; manageServicesLocked ( ) ; } } }

Target:
public void onSomePackagesChanged ( ) { synchronized ( mLock ) { if ( ( getChangingUserId ( ) ) != ( mCurrentUserId ) ) { return ; } if ( ( mUiAutomationService ) == null ) { com.android.server.accessibility.AccessibilityManagerService.UserState userState = getCurrentUserStateLocked ( ) ; populateInstalledAccessibilityServiceLocked ( userState ) ; manageServicesLocked ( userState ) ; } } }
Source:
public void notifyFindDialogDismissed ( ) { if ( checkNeedsPost ( ) ) { mRunQueue.addTask ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { notifyFindDialogDismissed ( ) ; } } ) ; return ; } clearMatches ( ) ; }

Target:
public void findAllAsync ( final java.lang.String searchString ) { if ( checkNeedsPost ( ) ) { mRunQueue.addTask ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { findAllAsync ( searchString ) ; } } ) ; return ; } mAwContents.findAllAsync ( searchString ) ; }
Source:
public static com.android.jack.jayce.JayceInternalWriter get ( @ javax.annotation.Nonnull com.android.jack.library.OutputJackLibrary outputJackLibrary , @ javax.annotation.Nonnull java.io.OutputStream out ) { com.android.jack.jayce.v0003.io.JayceInternalWriterImpl jayceWriter = new com.android.jack.jayce.v0003.io.JayceInternalWriterImpl ( out ) ; outputJackLibrary.putProperty ( FileType.JAYCE.buildPropertyName ( null ) , java.lang.String.valueOf ( true ) ) ; outputJackLibrary.putProperty ( JayceProperties.KEY_JAYCE_MAJOR_VERSION , java.lang.String.valueOf ( com.android.jack.jayce.JayceWriterFactory.DEFAULT_MAJOR_VERSION ) ) ; outputJackLibrary.putProperty ( JayceProperties.KEY_JAYCE_MINOR_VERSION , java.lang.String.valueOf ( jayceWriter.getCurrentMinor ( ) ) ) ; return jayceWriter ; }

Target:
public static com.android.jack.jayce.JayceInternalWriter get ( @ javax.annotation.Nonnull com.android.jack.library.OutputJackLibrary outputJackLibrary , @ javax.annotation.Nonnull java.io.OutputStream out ) { com.android.jack.jayce.v0003.io.JayceInternalWriterImpl jayceWriter = new com.android.jack.jayce.v0003.io.JayceInternalWriterImpl ( out ) ; outputJackLibrary.putProperty ( outputJackLibrary.buildPropertyName ( FileType.JAYCE , null ) , java.lang.String.valueOf ( true ) ) ; outputJackLibrary.putProperty ( outputJackLibrary.keyJayceMajorVersion , java.lang.String.valueOf ( com.android.jack.jayce.JayceWriterFactory.DEFAULT_MAJOR_VERSION ) ) ; outputJackLibrary.putProperty ( outputJackLibrary.keyJayceMinorVersion , java.lang.String.valueOf ( jayceWriter.getCurrentMinor ( ) ) ) ; return jayceWriter ; }
Source:
public void mockInterface ( ) throws java.lang.Exception { com.android.dx.mockito.tests.MockTests.TestInterface t = org.mockito.Mockito.mock ( com.android.dx.mockito.tests.MockTests.TestInterface.class ) ; org.junit.Assert.assertNull ( t.returnA ( ) ) ; org.mockito.Mockito.when ( t.returnA ( ) ) . thenReturn ( "B" ) ; org.junit.Assert.assertEquals ( "B" , t.returnA ( ) ) ; }

Target:
public void mockInterface ( ) throws java.lang.Exception { com.android.dx.mockito.tests.GeneralMocking.TestInterface t = org.mockito.Mockito.mock ( com.android.dx.mockito.tests.GeneralMocking.TestInterface.class ) ; org.junit.Assert.assertNull ( t.returnA ( ) ) ; org.mockito.Mockito.when ( t.returnA ( ) ) . thenReturn ( "B" ) ; org.junit.Assert.assertEquals ( "B" , t.returnA ( ) ) ; }
Source:
public void test_setPosixFilePermissions_NPE ( ) throws java.io.IOException { java.util.Set < java.nio.file.attribute.PosixFilePermission > perm = java.nio.file.attribute.PosixFilePermissions.fromString ( "rwx------" ) ; java.nio.file.attribute.FileAttribute < java.util.Set < java.nio.file.attribute.PosixFilePermission > > attr = java.nio.file.attribute.PosixFilePermissions.asFileAttribute ( perm ) ; try { java.nio.file.Files.setPosixFilePermissions ( null , perm ) ; } catch ( java.lang.NullPointerException expected ) { } try { java.nio.file.Files.setPosixFilePermissions ( filesSetup.getDataFilePath ( ) , null ) ; } catch ( java.lang.NullPointerException expected ) { } }

Target:
public void test_setPosixFilePermissions_NPE ( ) throws java.io.IOException { java.util.Set < java.nio.file.attribute.PosixFilePermission > perm = java.nio.file.attribute.PosixFilePermissions.fromString ( "rwx------" ) ; java.nio.file.attribute.FileAttribute < java.util.Set < java.nio.file.attribute.PosixFilePermission > > attr = java.nio.file.attribute.PosixFilePermissions.asFileAttribute ( perm ) ; try { java.nio.file.Files.setPosixFilePermissions ( null , perm ) ; org.junit.Assert.fail ( ) ; } catch ( java.lang.NullPointerException expected ) { } try { java.nio.file.Files.setPosixFilePermissions ( filesSetup.getDataFilePath ( ) , null ) ; org.junit.Assert.fail ( ) ; } catch ( java.lang.NullPointerException expected ) { } }
Source:
public void testNoMatchingViewException ( ) { try { android.support.test.espresso.Espresso.onView ( android.support.test.espresso.base.DefaultFailureHandlerTest.withMatchesThatReturns ( false ) ) . check ( android.support.test.espresso.assertion.ViewAssertions.matches ( org.hamcrest.Matchers.not ( android.support.test.espresso.matcher.ViewMatchers.isDisplayed ( ) ) ) ) ; fail ( "Previous call expected to fail" ) ; } catch ( android.support.test.espresso.NoMatchingViewException e ) { assertFailureStackContainsThisClass ( e ) ; } }

Target:
public void noMatchingViewException ( ) { expectedException.expect ( android.support.test.espresso.NoMatchingViewException.class ) ; expectedException.expect ( stackTraceContainsThisClass ( ) ) ; android.support.test.espresso.Espresso.onView ( android.support.test.espresso.base.DefaultFailureHandlerTest.withMatchesThatReturns ( false ) ) . check ( android.support.test.espresso.assertion.ViewAssertions.matches ( org.hamcrest.Matchers.not ( android.support.test.espresso.matcher.ViewMatchers.isDisplayed ( ) ) ) ) ; }
Source:
private int applyCapability ( int capabilities , int capability ) { int newCapabilities = capabilities | capability ; return newCapabilities ; }

Target:
private int applyHostProperties ( int conferenceProperties , int properties ) { conferenceProperties = changeBitmask ( conferenceProperties , Connection.PROPERTY_HIGH_DEF_AUDIO , can ( properties , Connection.PROPERTY_HIGH_DEF_AUDIO ) ) ; conferenceProperties = changeBitmask ( conferenceProperties , Connection.PROPERTY_WIFI , can ( properties , Connection.PROPERTY_WIFI ) ) ; conferenceProperties = changeBitmask ( conferenceProperties , Connection.PROPERTY_IS_EXTERNAL_CALL , can ( properties , Connection.PROPERTY_IS_EXTERNAL_CALL ) ) ; return conferenceProperties ; }
Source:
private void showCancellationConfirmDialog ( ) { new android.app.AlertDialog.Builder ( this ) . setTitle ( android.R.string.dialog_alert_title ) . setIcon ( android.R.drawable.ic_dialog_alert ) . setMessage ( ( mAddingProfile ? R.string.vpn_confirm_add_profile_cancellation : R.string.vpn_confirm_edit_profile_cancellation ) ) . setPositiveButton ( R.string.vpn_yes_button , new android.content.DialogInterface.OnClickListener ( ) { public void onClick ( android.content.DialogInterface dialog , int w ) { finish ( ) ; } } ) . setNegativeButton ( R.string.vpn_mistake_button , null ) . show ( ) ; }

Target:
protected android.app.Dialog onCreateDialog ( int id ) { if ( id == ( com.android.settings.vpn.VpnEditor.CONFIRM_DIALOG_ID ) ) { return new android.app.AlertDialog.Builder ( this ) . setTitle ( android.R.string.dialog_alert_title ) . setIcon ( android.R.drawable.ic_dialog_alert ) . setMessage ( ( mAddingProfile ? R.string.vpn_confirm_add_profile_cancellation : R.string.vpn_confirm_edit_profile_cancellation ) ) . setPositiveButton ( R.string.vpn_yes_button , new android.content.DialogInterface.OnClickListener ( ) { public void onClick ( android.content.DialogInterface dialog , int w ) { finish ( ) ; } } ) . setNegativeButton ( R.string.vpn_mistake_button , null ) . create ( ) ; } return super . onCreateDialog ( id ) ; }
Source:
public void testStageInstallWithErrorCode_missingTzDataFile ( ) throws java.lang.Exception { libcore.tzdata.shared2.TimeZoneDistro stagedDistro = libcore.tzdata.update2.TimeZoneDistroInstallerTest.createValidTimeZoneDistro ( libcore.tzdata.update2.TimeZoneDistroInstallerTest.NEW_RULES_VERSION , 1 ) ; assertEquals ( TimeZoneDistroInstaller.INSTALL_SUCCESS , installer.stageInstallWithErrorCode ( stagedDistro.getBytes ( ) ) ) ; assertInstallDistroStaged ( stagedDistro ) ; libcore.tzdata.shared2.TimeZoneDistro incompleteDistro = libcore.tzdata.update2.TimeZoneDistroInstallerTest.createValidTimeZoneDistroBuilder ( libcore.tzdata.update2.TimeZoneDistroInstallerTest.NEWER_RULES_VERSION , 1 ) . clearTzDataForTests ( ) . buildUnvalidated ( ) ; assertEquals ( TimeZoneDistroInstaller.INSTALL_FAIL_BAD_DISTRO_STRUCTURE , installer.stageInstallWithErrorCode ( incompleteDistro.getBytes ( ) ) ) ; assertInstallDistroStaged ( stagedDistro ) ; assertNoInstalledDistro ( ) ; }

Target:
public void testStageInstallWithErrorCode_missingTzDataFile ( ) throws java.lang.Exception { com.android.timezone.distro.TimeZoneDistro stagedDistro = libcore.tzdata.update2.TimeZoneDistroInstallerTest.createValidTimeZoneDistro ( libcore.tzdata.update2.TimeZoneDistroInstallerTest.NEW_RULES_VERSION , 1 ) ; assertEquals ( TimeZoneDistroInstaller.INSTALL_SUCCESS , installer.stageInstallWithErrorCode ( stagedDistro.getBytes ( ) ) ) ; assertInstallDistroStaged ( stagedDistro ) ; com.android.timezone.distro.TimeZoneDistro incompleteDistro = libcore.tzdata.update2.TimeZoneDistroInstallerTest.createValidTimeZoneDistroBuilder ( libcore.tzdata.update2.TimeZoneDistroInstallerTest.NEWER_RULES_VERSION , 1 ) . clearTzDataForTests ( ) . buildUnvalidated ( ) ; assertEquals ( TimeZoneDistroInstaller.INSTALL_FAIL_BAD_DISTRO_STRUCTURE , installer.stageInstallWithErrorCode ( incompleteDistro.getBytes ( ) ) ) ; assertInstallDistroStaged ( stagedDistro ) ; assertNoInstalledDistro ( ) ; }
Source:
public void testNoDpi2 ( ) throws java.lang.Exception { assertEquals ( ( "drawable-xhdpi/frame.png: Warning: The following unrelated icon files have identical contents: frame.png, frame.png, frame.png, file1.png, file2.png, frame.png\n" + "drawable-xhdpi/frame.png: Warning: The image frame.png varies significantly in its density-independent (dip) size across the various density versions: drawable-ldpi/frame.png: 629x387 dp (472x290 px), drawable-mdpi/frame.png: 472x290 dp (472x290 px), drawable-hdpi/frame.png: 315x193 dp (472x290 px), drawable-xhdpi/frame.png: 236x145 dp (472x290 px)" ) , lintProject ( "res/drawable-mdpi/frame.png=>res/drawable-mdpi/frame.png" , "res/drawable-mdpi/frame.png=>res/drawable-hdpi/frame.png" , "res/drawable-mdpi/frame.png=>res/drawable-ldpi/frame.png" , "res/drawable-mdpi/frame.png=>res/drawable-xhdpi/frame.png" , "res/drawable-mdpi/frame.png=>res/drawable-nodpi/file1.png" , "res/drawable-mdpi/frame.png=>res/drawable-nodpi/file2.png" ) ) ; }

Target:
public void testNoDpi2 ( ) throws java.lang.Exception { assertEquals ( ( "res/drawable-xhdpi/frame.png: Warning: The image frame.png varies significantly in its density-independent (dip) size across the various density versions: drawable-ldpi/frame.png: 629x387 dp (472x290 px), drawable-mdpi/frame.png: 472x290 dp (472x290 px), drawable-hdpi/frame.png: 315x193 dp (472x290 px), drawable-xhdpi/frame.png: 236x145 dp (472x290 px) [IconDipSize]\n" + ( ( ( ( ( ( ( ( ( ( " res/drawable-hdpi/frame.png: <No location-specific message\n" + " res/drawable-mdpi/frame.png: <No location-specific message\n" ) + " res/drawable-ldpi/frame.png: <No location-specific message\n" ) + "res/drawable-xhdpi/frame.png: Warning: The following unrelated icon files have identical contents: frame.png, frame.png, frame.png, file1.png, file2.png, frame.png [IconDuplicates]\n" ) + " res/drawable-nodpi/file2.png: <No location-specific message\n" ) + " res/drawable-nodpi/file1.png: <No location-specific message\n" ) + " res/drawable-mdpi/frame.png: <No location-specific message\n" ) + " res/drawable-ldpi/frame.png: <No location-specific message\n" ) + " res/drawable-hdpi/frame.png: <No location-specific message\n" ) + "0 errors, 2 warnings\n" ) + "" ) ) , lintProject ( "res/drawable-mdpi/frame.png=>res/drawable-mdpi/frame.png" , "res/drawable-mdpi/frame.png=>res/drawable-hdpi/frame.png" , "res/drawable-mdpi/frame.png=>res/drawable-ldpi/frame.png" , "res/drawable-mdpi/frame.png=>res/drawable-xhdpi/frame.png" , "res/drawable-mdpi/frame.png=>res/drawable-nodpi/file1.png" , "res/drawable-mdpi/frame.png=>res/drawable-nodpi/file2.png" ) ) ; }
Source:
private java.util.Set < com.android.compatibility.common.util.TestStatus > getStatusesToRun ( ) { java.util.Set < com.android.compatibility.common.util.TestStatus > statusesToRun = new java.util.HashSet < com.android.compatibility.common.util.TestStatus > ( ) ; for ( java.lang.String resultType : mResultTypes ) { if ( resultType != ( com.android.compatibility.common.tradefed.result.SubPlanHelper.NOT_EXECUTED ) ) { statusesToRun.add ( com.android.compatibility.common.tradefed.result.SubPlanHelper.STATUS_MAP.get ( resultType ) ) ; } } return statusesToRun ; }

Target:
private java.util.Set < com.android.compatibility.common.util.TestStatus > getStatusesToRun ( ) { java.util.Set < com.android.compatibility.common.util.TestStatus > statusesToRun = new java.util.HashSet < com.android.compatibility.common.util.TestStatus > ( ) ; for ( java.lang.String resultType : mResultTypes ) { if ( resultType != ( com.android.compatibility.common.tradefed.result.SubPlanCreator.NOT_EXECUTED ) ) { statusesToRun.add ( com.android.compatibility.common.tradefed.result.SubPlanCreator.STATUS_MAP.get ( resultType ) ) ; } } return statusesToRun ; }
Source:
public boolean cancelPairingUserInput ( ) { if ( ( android.bluetooth.BluetoothDevice.sService ) == null ) { android.util.Log.e ( android.bluetooth.BluetoothDevice.TAG , "BT not enabled. Cannot create pairing user input" ) ; return false ; } try { return android.bluetooth.BluetoothDevice.sService.cancelBondProcess ( this ) ; } catch ( android.os.RemoteException e ) { android.util.Log.e ( android.bluetooth.BluetoothDevice.TAG , "" , e ) ; } return false ; }

Target:
public int getSimAccessPermission ( ) { final android.bluetooth.IBluetooth service = android.bluetooth.BluetoothDevice.sService ; if ( service == null ) { return android.bluetooth.BluetoothDevice.ACCESS_UNKNOWN ; } try { return service.getSimAccessPermission ( this ) ; } catch ( android.os.RemoteException e ) { android.util.Log.e ( android.bluetooth.BluetoothDevice.TAG , "" , e ) ; } return android.bluetooth.BluetoothDevice.ACCESS_UNKNOWN ; }
Source:
public void setRttStreams ( boolean shouldBeRtt ) { boolean areStreamsInitialized = ( ( mInCallToConnectionServiceStreams ) != null ) && ( ( mConnectionServiceToInCallStreams ) != null ) ; if ( shouldBeRtt && ( ! areStreamsInitialized ) ) { try { mInCallToConnectionServiceStreams = android.os.ParcelFileDescriptor.createReliablePipe ( ) ; mConnectionServiceToInCallStreams = android.os.ParcelFileDescriptor.createReliablePipe ( ) ; } catch ( java.io.IOException e ) { android.telecom.Log.e ( this , e , "Failed to create pipes for RTT call." ) ; } } else if ( ( ! shouldBeRtt ) && areStreamsInitialized ) { closeRttPipes ( ) ; mInCallToConnectionServiceStreams = null ; mConnectionServiceToInCallStreams = null ; } }

Target:
public void createRttStreams ( ) { if ( ! ( areRttStreamsInitialized ( ) ) ) { android.telecom.Log.i ( this , "Initializing RTT streams" ) ; try { mWasEverRtt = true ; mInCallToConnectionServiceStreams = android.os.ParcelFileDescriptor.createReliablePipe ( ) ; mConnectionServiceToInCallStreams = android.os.ParcelFileDescriptor.createReliablePipe ( ) ; } catch ( java.io.IOException e ) { android.telecom.Log.e ( this , e , "Failed to create pipes for RTT call." ) ; } } }
Source:
public boolean removeWithId ( T item ) { int index = indexWithTypeAndId ( item ) ; return ( ( index >= 0 ) && ( index < ( com.android.tv.dvr.ui.SortedArrayAdapter.size ( ) ) ) ) && ( remove ( com.android.tv.dvr.ui.SortedArrayAdapter.get ( index ) ) ) ; }

Target:
public boolean removeWithId ( T item ) { int index = indexWithId ( item ) ; return ( ( index >= 0 ) && ( index < ( com.android.tv.dvr.ui.SortedArrayAdapter.size ( ) ) ) ) && ( ( removeItems ( index , 1 ) ) == 1 ) ; }
Source:
public int getItemCount ( ) { com.android.dialer.common.LogUtil.enterBlock ( "NewVoicemailAdapter.getItemCount" ) ; int numberOfHeaders = 0 ; if ( ( todayHeaderPosition ) != ( java.lang.Integer.MAX_VALUE ) ) { numberOfHeaders ++ ; } if ( ( olderHeaderPosition ) != ( java.lang.Integer.MAX_VALUE ) ) { numberOfHeaders ++ ; } return ( cursor.getCount ( ) ) + numberOfHeaders ; }

Target:
public int getItemCount ( ) { com.android.dialer.common.LogUtil.enterBlock ( "NewVoicemailAdapter.getItemCount" ) ; int numberOfHeaders = 0 ; if ( ( todayHeaderPosition ) != ( java.lang.Integer.MAX_VALUE ) ) { numberOfHeaders ++ ; } if ( ( olderHeaderPosition ) != ( java.lang.Integer.MAX_VALUE ) ) { numberOfHeaders ++ ; } com.android.dialer.common.LogUtil.i ( "NewVoicemailAdapter.getItemCount" , "cursor cnt:%d, num of headers:%d, delete size:%d" , cursor.getCount ( ) , numberOfHeaders , deletedVoicemailPosition.size ( ) ) ; return ( ( cursor.getCount ( ) ) + numberOfHeaders ) - ( deletedVoicemailPosition.size ( ) ) ; }
Source:
public org.bouncycastle.math.ec.ECPoint multiply ( org.bouncycastle.math.ec.ECPoint p , java.math.BigInteger k ) { int sign = k.signum ( ) ; if ( ( sign == 0 ) || ( p.isInfinity ( ) ) ) { return p.getCurve ( ) . getInfinity ( ) ; } org.bouncycastle.math.ec.ECPoint positive = multiplyPositive ( p , k.abs ( ) ) ; return sign > 0 ? positive : positive.negate ( ) ; }

Target:
public org.bouncycastle.math.ec.ECPoint multiply ( org.bouncycastle.math.ec.ECPoint p , java.math.BigInteger k ) { int sign = k.signum ( ) ; if ( ( sign == 0 ) || ( p.isInfinity ( ) ) ) { return p.getCurve ( ) . getInfinity ( ) ; } org.bouncycastle.math.ec.ECPoint positive = multiplyPositive ( p , k.abs ( ) ) ; org.bouncycastle.math.ec.ECPoint result = ( sign > 0 ) ? positive : positive.negate ( ) ; return org.bouncycastle.math.ec.ECAlgorithms.validatePoint ( result ) ; }
Source:
public boolean equals ( java.lang.Object o ) { if ( ( this ) == o ) return true ; if ( ! ( o instanceof com.intellij.psi.search.NonClasspathDirectoryScope ) ) return false ; com.intellij.psi.search.NonClasspathDirectoryScope that = ( ( com.intellij.psi.search.NonClasspathDirectoryScope ) ( o ) ) ; if ( ! ( myRoot.equals ( that.myRoot ) ) ) return false ; return true ; }

Target:
public boolean equals ( java.lang.Object o ) { if ( ( this ) == o ) return true ; if ( ! ( o instanceof com.intellij.psi.search.NonClasspathDirectoriesScope ) ) return false ; com.intellij.psi.search.NonClasspathDirectoriesScope that = ( ( com.intellij.psi.search.NonClasspathDirectoriesScope ) ( o ) ) ; if ( ! ( myRoots.equals ( that.myRoots ) ) ) return false ; return true ; }
Source:
public void testNotifyPackageDataDestroyForeignUse ( ) { java.util.List < java.lang.String > fooSecondaries = mFooUser0.getSecondaryDexPaths ( ) ; notifyDexLoad ( mFooUser0 , fooSecondaries , mUser0 ) ; notifyDexLoad ( mBarUser0 , mFooUser0.getBaseAndSplitDexPaths ( ) , mUser0 ) ; mDexManager.notifyPackageDataDestroyed ( mFooUser0.getPackageName ( ) , mUser0 ) ; com.android.server.pm.dex.PackageDexUsage.PackageUseInfo pui = getPackageUseInfo ( mFooUser0 ) ; org.junit.Assert.assertTrue ( pui.isUsedByOtherApps ( ) ) ; org.junit.Assert.assertTrue ( pui.getDexUseInfoMap ( ) . isEmpty ( ) ) ; }

Target:
public void testNotifyPackageDataDestroyForeignUse ( ) { java.util.List < java.lang.String > fooSecondaries = mFooUser0.getSecondaryDexPaths ( ) ; notifyDexLoad ( mFooUser0 , fooSecondaries , mUser0 ) ; notifyDexLoad ( mBarUser0 , mFooUser0.getBaseAndSplitDexPaths ( ) , mUser0 ) ; mDexManager.notifyPackageDataDestroyed ( mFooUser0.getPackageName ( ) , mUser0 ) ; com.android.server.pm.dex.PackageDexUsage.PackageUseInfo pui = getPackageUseInfo ( mFooUser0 ) ; assertIsUsedByOtherApps ( mFooUser0 , pui , true ) ; org.junit.Assert.assertTrue ( pui.getDexUseInfoMap ( ) . isEmpty ( ) ) ; }
Source:
public static boolean isProfileSet ( android.content.Context context ) { android.database.Cursor c = context.getContentResolver ( ) . query ( Profile.CONTENT_VCARD_URI , new java.lang.String [ ] { android.provider.ContactsContract.Profile._ID } , null , null , null ) ; boolean isSet = ( c != null ) && ( ( c.getCount ( ) ) > 0 ) ; if ( c != null ) { c.close ( ) ; c = null ; } return isSet ; }

Target:
static void loadAllContacts ( android.content.Context context , android.os.Handler handler ) { if ( com.android.bluetooth.pbap.BluetoothPbapUtils.V ) { android.util.Log.v ( com.android.bluetooth.pbap.BluetoothPbapUtils.TAG , "Loading Contacts ..." ) ; } java.lang.String [ ] projection = new java.lang.String [ ] { android.provider.ContactsContract.Data.CONTACT_ID , android.provider.ContactsContract.Data.DATA1 , android.provider.ContactsContract.Data.MIMETYPE } ; com.android.bluetooth.pbap.BluetoothPbapUtils.sTotalContacts = com.android.bluetooth.pbap.BluetoothPbapUtils.fetchAndSetContacts ( context , handler , projection , null , null , true ) ; if ( ( com.android.bluetooth.pbap.BluetoothPbapUtils.sTotalContacts ) < 0 ) { com.android.bluetooth.pbap.BluetoothPbapUtils.sTotalContacts = 0 ; return ; } com.android.bluetooth.pbap.BluetoothPbapUtils.sContactsLoaded = true ; }
Source:
public synchronized void close ( ) { closed = true ; }

Target:
public synchronized void close ( ) { if ( ! ( closed ) ) { assert areStreamsClosed ( ) : ( ( ( "At least one stream from VFS '" + ( getDescription ( ) ) ) + "' in " ) + ( getLocation ( ) . getDescription ( ) ) ) + " has not been closed, see log for details" ; openedStreams.clear ( ) ; closed = true ; } }
Source:
public boolean disable ( boolean persist ) { try { return mManagerService.disable ( persist ) ; } catch ( android.os.RemoteException e ) { android.util.Log.e ( android.bluetooth.BluetoothAdapter.TAG , "" , e ) ; } return false ; }

Target:
public long getDiscoveryEndMillis ( ) { try { mServiceLock.readLock ( ) . lock ( ) ; if ( ( mService ) != null ) return mService.getDiscoveryEndMillis ( ) ; } catch ( android.os.RemoteException e ) { android.util.Log.e ( android.bluetooth.BluetoothAdapter.TAG , "" , e ) ; } finally { mServiceLock.readLock ( ) . unlock ( ) ; } return - 1 ; }
Source:
public void test_handshakeWithSCTFromTLSExtension ( ) throws java.lang.Exception { org.conscrypt.OpenSSLSocketImplTest.TestConnection connection = new org.conscrypt.OpenSSLSocketImplTest.TestConnection ( new java.security.cert.X509Certificate [ ] { cert , ca } , certKey , true ) ; connection.clientHooks.ctVerificationEnabled = true ; connection.serverHooks.sctTLSExtension = org.conscrypt.TestUtils.readTestFile ( "ct-signed-timestamp-list" ) ; connection.doHandshake ( ) ; assertTrue ( connection.clientHooks.isHandshakeCompleted ) ; assertTrue ( connection.serverHooks.isHandshakeCompleted ) ; }

Target:
public void test_handshakeWithSCTFromTLSExtension ( ) throws java.lang.Exception { org.conscrypt.OpenSSLSocketImplTest.TestConnection connection = new org.conscrypt.OpenSSLSocketImplTest.TestConnection ( new java.security.cert.X509Certificate [ ] { cert , ca } , certKey , true ) ; connection.clientHooks.ctVerificationEnabled = true ; connection.serverHooks.sctTLSExtension = org.conscrypt.TestUtils.readTestFile ( "ct-signed-timestamp-list" ) ; connection.doHandshake ( ) ; org.junit.Assert.assertTrue ( connection.clientHooks.isHandshakeCompleted ) ; org.junit.Assert.assertTrue ( connection.serverHooks.isHandshakeCompleted ) ; }
Source:
private java.io.File getLintWorkDir ( ) { java.lang.String path = java.lang.System.getProperty ( com.android.tools.lint.Main.PROP_WORK_DIR ) ; if ( ( path == null ) || ( ( path.length ( ) ) == 0 ) ) { path = java.lang.System.getenv ( com.android.tools.lint.Main.PROP_WORK_DIR ) ; } if ( ( path != null ) && ( ( path.length ( ) ) > 0 ) ) { return new java.io.File ( path ) ; } return null ; }

Target:
private static java.io.File getLintWorkDir ( ) { java.lang.String path = java.lang.System.getProperty ( com.android.tools.lint.Main.PROP_WORK_DIR ) ; if ( ( path == null ) || ( path.isEmpty ( ) ) ) { path = java.lang.System.getenv ( com.android.tools.lint.Main.PROP_WORK_DIR ) ; } if ( ( path != null ) && ( ! ( path.isEmpty ( ) ) ) ) { return new java.io.File ( path ) ; } return null ; }
Source:
private void onConnectStateChanged ( byte [ ] address , int state ) { if ( com.android.bluetooth.hid.HidService.DBG ) android.util.Log.d ( com.android.bluetooth.hid.HidService.TAG , ( "onConnectStateChanged: state=" + state ) ) ; android.os.Message msg = mHandler.obtainMessage ( com.android.bluetooth.hid.HidService.MESSAGE_CONNECT_STATE_CHANGED ) ; msg.obj = address ; msg.arg1 = state ; mHandler.sendMessage ( msg ) ; }

Target:
private void onConnectStateChanged ( byte [ ] address , int state ) { if ( com.android.bluetooth.hid.HidHostService.DBG ) android.util.Log.d ( com.android.bluetooth.hid.HidHostService.TAG , ( "onConnectStateChanged: state=" + state ) ) ; android.os.Message msg = mHandler.obtainMessage ( com.android.bluetooth.hid.HidHostService.MESSAGE_CONNECT_STATE_CHANGED ) ; msg.obj = address ; msg.arg1 = state ; mHandler.sendMessage ( msg ) ; }
Source:
public static java.lang.String map2OID ( java.lang.String algName ) { org.apache.harmony.security.utils.AlgNameMapper.checkCacheVersion ( ) ; java.lang.String result = org.apache.harmony.security.utils.AlgNameMapper.alg2OidMap.get ( algName.toUpperCase ( java.util.Locale.US ) ) ; if ( result != null ) { return result ; } org.apache.harmony.security.utils.AlgNameMapperSource s = org.apache.harmony.security.utils.AlgNameMapper.source ; if ( s != null ) { return s.mapNameToOid ( algName ) ; } return null ; }

Target:
public static java.lang.String map2OID ( java.lang.String algName ) { org.apache.harmony.security.utils.AlgNameMapper.checkCacheVersion ( ) ; java.lang.String result = org.apache.harmony.security.utils.AlgNameMapper.alg2OidMap.get ( algName.toUpperCase ( java.util.Locale.ROOT ) ) ; if ( result != null ) { return result ; } org.apache.harmony.security.utils.AlgNameMapperSource s = org.apache.harmony.security.utils.AlgNameMapper.source ; if ( s != null ) { return s.mapNameToOid ( algName ) ; } return null ; }