auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testWithContentDescriptionFromResourceId ( ) { android.view.View view = new android.view.View ( context ) ; view.setContentDescription ( context.getString ( R.string.something ) ) ; assertFalse ( android.support.test.espresso.matcher.ViewMatchers.withContentDescription ( R.string.other_string ) . matches ( view ) ) ; assertTrue ( android.support.test.espresso.matcher.ViewMatchers.withContentDescription ( R.string.something ) . matches ( view ) ) ; }

Target:
public void withContentDescriptionFromResourceId ( ) { android.view.View view = new android.view.View ( context ) ; view.setContentDescription ( context.getString ( R.string.something ) ) ; org.junit.Assert.assertFalse ( android.support.test.espresso.matcher.ViewMatchers.withContentDescription ( R.string.other_string ) . matches ( view ) ) ; org.junit.Assert.assertTrue ( android.support.test.espresso.matcher.ViewMatchers.withContentDescription ( R.string.something ) . matches ( view ) ) ; }
Source:
public static void maybeAddModuleForCopyingNumber ( android.content.Context context , java.util.List < com.android.dialer.contactactions.ContactActionModule > modules , java.lang.String originalNumber ) { if ( android.text.TextUtils.isEmpty ( originalNumber ) ) { return ; } modules.add ( new com.android.dialer.contactactions.ContactActionModule ( ) { @ java.lang.Override public int getStringId ( ) { return R.string.copy_number ; } @ java.lang.Override public int getDrawableId ( ) { return R.drawable.quantum_ic_content_copy_vd_theme_24 ; } @ java.lang.Override public boolean onClick ( ) { com.android.dialer.clipboard.ClipboardUtils.copyText ( context , null , originalNumber , true ) ; return false ; } } ) ; }

Target:
public static void maybeAddModuleForSendingTextMessage ( android.content.Context context , java.util.List < com.android.dialer.contactactions.ContactActionModule > modules , java.lang.String normalizedNumber , boolean isBlocked ) { if ( isBlocked ) { return ; } if ( ! ( android.text.TextUtils.isEmpty ( normalizedNumber ) ) ) { modules.add ( new com.android.dialer.contactactions.IntentModule ( context , com.android.dialer.util.IntentUtil.getSendSmsIntent ( normalizedNumber ) , R.string.send_a_message , R.drawable.quantum_ic_message_vd_theme_24 ) ) ; } }
Source:
private void readObject ( java.io.ObjectInputStream s ) throws java.io.IOException , java.lang.ClassNotFoundException { encodedParams = ( ( byte [ ] ) ( s.readUnshared ( ) ) ) ; encryptedContent = ( ( byte [ ] ) ( s.readUnshared ( ) ) ) ; sealAlg = ( ( java.lang.String ) ( s.readObject ( ) ) ) ; paramsAlg = ( ( java.lang.String ) ( s.readObject ( ) ) ) ; }

Target:
private void readObject ( java.io.ObjectInputStream s ) throws java.io.IOException , java.lang.ClassNotFoundException { java.io.ObjectInputStream.GetField fields = s.readFields ( ) ; this . encodedParams = javax.crypto.SealedObject.getSafeCopy ( fields , "encodedParams" ) ; this . encryptedContent = javax.crypto.SealedObject.getSafeCopy ( fields , "encryptedContent" ) ; this . paramsAlg = ( ( java.lang.String ) ( fields.get ( "paramsAlg" , null ) ) ) ; this . sealAlg = ( ( java.lang.String ) ( fields.get ( "sealAlg" , null ) ) ) ; }
Source:
void selectMultiple ( java.util.Collection < com.android.ide.eclipse.adt.internal.editors.layout.gle2.CanvasViewInfo > viewInfos ) { mAltSelection = null ; boolean redoLayout = hasExplodedItems ( ) ; mSelections.clear ( ) ; if ( viewInfos != null ) { for ( com.android.ide.eclipse.adt.internal.editors.layout.gle2.CanvasViewInfo viewInfo : viewInfos ) { mSelections.add ( createSelection ( viewInfo ) ) ; if ( viewInfo.isInvisibleParent ( ) ) { redoLayout = true ; } } } fireSelectionChanged ( ) ; if ( redoLayout ) { mCanvas.getLayoutEditor ( ) . recomputeLayout ( ) ; } redraw ( ) ; }

Target:
void selectMultiple ( java.util.Collection < com.android.ide.eclipse.adt.internal.editors.layout.gle2.CanvasViewInfo > viewInfos ) { mAltSelection = null ; boolean redoLayout = hasExplodedItems ( ) ; mSelections.clear ( ) ; if ( viewInfos != null ) { for ( com.android.ide.eclipse.adt.internal.editors.layout.gle2.CanvasViewInfo viewInfo : viewInfos ) { mSelections.add ( createSelection ( viewInfo ) ) ; if ( viewInfo.isInvisible ( ) ) { redoLayout = true ; } } } fireSelectionChanged ( ) ; if ( redoLayout ) { mCanvas.getLayoutEditor ( ) . recomputeLayout ( ) ; } redraw ( ) ; }
Source:
public static java.lang.String getOutputDirectoryName ( org.gradle.nativeplatform.NativeBinarySpec binary ) { return com.google.common.base.Joiner.on ( java.io.File.separator ) . join ( AndroidProject.FD_INTERMEDIATES , "binaries" , binary.getName ( ) , binary.getBuildType ( ) . getName ( ) , binary.getFlavor ( ) . getName ( ) , "lib" , binary.getTargetPlatform ( ) . getName ( ) ) ; }

Target:
public static java.lang.String getOutputDirectoryName ( org.gradle.nativeplatform.NativeBinarySpec binary ) { return com.android.build.gradle.ndk.internal.NdkNamingScheme.getOutputDirectoryName ( binary.getBuildType ( ) . getName ( ) , binary.getFlavor ( ) . getName ( ) , binary.getTargetPlatform ( ) . getName ( ) ) ; }
Source:
public void testNewInstanceString_IntArrayIntIntConstructor ( ) { runTestNewInstanceString ( "([III)V" , new org.apache.harmony.jpda.tests.jdwp.ClassType.NewInstanceStringTest.ConstructorArgumentsProvider ( ) { @ java.lang.Override public void provideConstructorArguments ( java.util.List < org.apache.harmony.jpda.tests.framework.jdwp.Value > constructorArguments ) { long debuggeeClassId = getClassIDBySignature ( getDebuggeeClassSignature ( ) ) ; org.apache.harmony.jpda.tests.framework.jdwp.Value intArrayValue = getStaticFieldValue ( debuggeeClassId , "INT_ARRAY" ) ; constructorArguments.add ( intArrayValue ) ; constructorArguments.add ( new org.apache.harmony.jpda.tests.framework.jdwp.Value ( 0 ) ) ; constructorArguments.add ( new org.apache.harmony.jpda.tests.framework.jdwp.Value ( 1 ) ) ; } } ) ; }

Target:
public void testNewInstanceString_IntArrayIntIntConstructor ( ) { runTestNewInstanceString ( "([III)V" , new org.apache.harmony.jpda.tests.jdwp.ClassType.ConstructorArgumentsProvider ( ) { @ java.lang.Override public void provideConstructorArguments ( java.util.List < org.apache.harmony.jpda.tests.framework.jdwp.Value > constructorArguments ) { long debuggeeClassId = getClassIDBySignature ( getDebuggeeClassSignature ( ) ) ; org.apache.harmony.jpda.tests.framework.jdwp.Value intArrayValue = getStaticFieldValue ( debuggeeClassId , "INT_ARRAY" ) ; constructorArguments.add ( intArrayValue ) ; constructorArguments.add ( new org.apache.harmony.jpda.tests.framework.jdwp.Value ( 0 ) ) ; constructorArguments.add ( new org.apache.harmony.jpda.tests.framework.jdwp.Value ( 1 ) ) ; } } ) ; }
Source:
public boolean getScanCapabilities ( com.android.server.wifi.WifiNative.ScanCapabilities capabilities ) { try { if ( ( mWifiVendorHal ) != null ) { return mWifiVendorHal.getScanCapabilities ( capabilities ) ; } } catch ( java.lang.UnsupportedOperationException e ) { } legacyHalWarning ( ) ; synchronized ( com.android.server.wifi.WifiNative.sLock ) { return ( isHalStarted ( ) ) && ( com.android.server.wifi.WifiNative.getScanCapabilitiesNative ( com.android.server.wifi.WifiNative.sWlan0Index , capabilities ) ) ; } }

Target:
public boolean initializeSupplicantHal ( ) { return mWifiSupplicantHal.initialize ( ) ; }
Source:
public void testCheckAccessLevel_hasAppOpsBitAllowed ( ) throws java.lang.Exception { setHasCarrierPrivileges ( false ) ; setIsDeviceOwner ( false ) ; setIsProfileOwner ( true ) ; setHasAppOpsPermission ( AppOpsManager.MODE_ALLOWED , false ) ; setHasReadHistoryPermission ( false ) ; assertEquals ( NetworkStatsAccess.Level.USER , com.android.server.net.NetworkStatsAccess.checkAccessLevel ( mContext , com.android.server.net.NetworkStatsAccessTest.TEST_UID , com.android.server.net.NetworkStatsAccessTest.TEST_PKG ) ) ; }

Target:
public void testCheckAccessLevel_hasAppOpsBitAllowed ( ) throws java.lang.Exception { setHasCarrierPrivileges ( false ) ; setIsDeviceOwner ( false ) ; setIsProfileOwner ( true ) ; setHasAppOpsPermission ( AppOpsManager.MODE_ALLOWED , false ) ; setHasReadHistoryPermission ( false ) ; org.junit.Assert.assertEquals ( NetworkStatsAccess.Level.DEVICESUMMARY , com.android.server.net.NetworkStatsAccess.checkAccessLevel ( mContext , com.android.server.net.NetworkStatsAccessTest.TEST_UID , com.android.server.net.NetworkStatsAccessTest.TEST_PKG ) ) ; }
Source:
void bind ( android.database.Cursor cursor ) { com.android.dialer.calllog.ui.CoalescedAnnotatedCallLogCursorLoader.Row row = new com.android.dialer.calllog.ui.CoalescedAnnotatedCallLogCursorLoader.Row ( cursor ) ; primaryTextView.setText ( buildPrimaryText ( row ) ) ; secondaryTextView.setText ( buildSecondaryText ( row ) ) ; if ( row.isNew ( ) ) { primaryTextView.setTextAppearance ( R.style.primary_textview_new_call ) ; secondaryTextView.setTextAppearance ( R.style.secondary_textview_new_call ) ; } setPhoto ( row ) ; setPrimaryCallTypes ( row ) ; setSecondaryCallTypes ( row ) ; setPhoneAccounts ( row ) ; }

Target:
void bind ( android.database.Cursor cursor ) { com.android.dialer.calllog.ui.CoalescedAnnotatedCallLogCursorLoader.Row row = new com.android.dialer.calllog.ui.CoalescedAnnotatedCallLogCursorLoader.Row ( cursor ) ; primaryTextView.setText ( buildPrimaryText ( row ) ) ; secondaryTextView.setText ( buildSecondaryText ( row ) ) ; if ( isNewMissedCall ( row ) ) { primaryTextView.setTextAppearance ( R.style.primary_textview_new_call ) ; secondaryTextView.setTextAppearance ( R.style.secondary_textview_new_call ) ; } setPhoto ( row ) ; setPrimaryCallTypes ( row ) ; setSecondaryCallTypes ( row ) ; setPhoneAccounts ( row ) ; }
Source:
public void handleUssdRequest ( java.lang.String ussdRequest , android.os.ResultReceiver wrappedCallback ) { enforceCallPermission ( ) ; int subId = getDefaultSubscription ( ) ; if ( ! ( android.telephony.SubscriptionManager.isValidSubscriptionId ( subId ) ) ) { return ; } android.util.Pair < java.lang.String , android.os.ResultReceiver > ussdObject = new android.util.Pair ( ussdRequest , wrappedCallback ) ; sendRequest ( com.android.phone.PhoneInterfaceManager.CMD_HANDLE_USSD_REQUEST , ussdObject , subId ) ; }

Target:
public java.lang.String getVisualVoicemailPackageName ( java.lang.String callingPackage , @ android.annotation.Nullable android.telecom.PhoneAccountHandle phoneAccountHandle ) { mAppOps.checkPackage ( android.os.Binder.getCallingUid ( ) , callingPackage ) ; if ( ! ( canReadPhoneState ( callingPackage , "getVisualVoicemailPackageName" ) ) ) { return null ; } int subId = com.android.phone.PhoneUtils.getSubIdForPhoneAccountHandle ( phoneAccountHandle ) ; return com.android.phone.vvm.RemoteVvmTaskManager.getRemotePackage ( mPhone.getContext ( ) , subId ) . getPackageName ( ) ; }
Source:
public java.util.List < com.android.tv.dvr.RecordedProgram > getRecordedPrograms ( long seriesRecordingId ) { com.android.tv.dvr.SeriesRecording seriesRecording = getSeriesRecording ( seriesRecordingId ) ; if ( seriesRecording == null ) { return java.util.Collections.emptyList ( ) ; } java.util.List < com.android.tv.dvr.RecordedProgram > result = new java.util.ArrayList < > ( ) ; for ( com.android.tv.dvr.RecordedProgram r : getRecordedPrograms ( ) ) { if ( seriesRecording.getSeriesId ( ) . equals ( r.getSeriesId ( ) ) ) { result.add ( r ) ; } } return result ; }

Target:
public java.util.List < com.android.tv.dvr.data.RecordedProgram > getRecordedPrograms ( long seriesRecordingId ) { com.android.tv.dvr.data.SeriesRecording seriesRecording = getSeriesRecording ( seriesRecordingId ) ; if ( seriesRecording == null ) { return java.util.Collections.emptyList ( ) ; } java.util.List < com.android.tv.dvr.data.RecordedProgram > result = new java.util.ArrayList < > ( ) ; for ( com.android.tv.dvr.data.RecordedProgram r : getRecordedPrograms ( ) ) { if ( seriesRecording.getSeriesId ( ) . equals ( r.getSeriesId ( ) ) ) { result.add ( r ) ; } } return result ; }
Source:
protected void setupTests ( com.android.cts.verifier.ArrayTestListAdapter adapter ) { setupFingerprintTests ( adapter ) ; if ( hasTrustAgents ( ) ) { setupDisableTrustAgentsTest ( adapter ) ; } adapter.add ( new com.android.cts.verifier.admin.DialogTestListItem ( this , R.string.device_admin_keyguard_disable_camera , ( ( getTestIdPrefix ( ) ) + "KeyguardDisableCamera" ) , R.string.device_admin_keyguard_disable_camera_instruction , new android.content.Intent ( com.android.cts.verifier.managedprovisioning.ByodHelperActivity.ACTION_LOCKNOW ) ) ) ; adapter.add ( new com.android.cts.verifier.admin.DialogTestListItem ( this , R.string.device_admin_disable_notifications , "DeviceAdmin_DisableNotifications" , R.string.device_admin_disable_notifications_instruction , new android.content.Intent ( com.android.cts.verifier.managedprovisioning.ByodHelperActivity.ACTION_NOTIFICATION_ON_LOCKSCREEN ) ) ) ; }

Target:
protected void setupTests ( com.android.cts.verifier.ArrayTestListAdapter adapter ) { setupFingerprintTests ( adapter ) ; if ( hasTrustAgents ( ) ) { setupDisableTrustAgentsTest ( adapter ) ; } if ( getPackageManager ( ) . hasSystemFeature ( PackageManager.FEATURE_CAMERA ) ) { adapter.add ( new com.android.cts.verifier.admin.DialogTestListItem ( this , R.string.device_admin_keyguard_disable_camera , ( ( getTestIdPrefix ( ) ) + "KeyguardDisableCamera" ) , R.string.device_admin_keyguard_disable_camera_instruction , new android.content.Intent ( com.android.cts.verifier.managedprovisioning.ByodHelperActivity.ACTION_LOCKNOW ) ) ) ; } adapter.add ( new com.android.cts.verifier.admin.DialogTestListItem ( this , R.string.device_admin_disable_notifications , "DeviceAdmin_DisableNotifications" , R.string.device_admin_disable_notifications_instruction , new android.content.Intent ( com.android.cts.verifier.managedprovisioning.ByodHelperActivity.ACTION_NOTIFICATION_ON_LOCKSCREEN ) ) ) ; }
Source:
public void showCircularDisplayMaskIfNeeded ( ) { if ( ( mContext.getResources ( ) . getBoolean ( com.android.internal.R.bool.config_windowIsRound ) ) && ( mContext.getResources ( ) . getBoolean ( com.android.internal.R.bool.config_windowShowCircularMask ) ) ) { mH.sendMessage ( mH.obtainMessage ( com.android.server.wm.WindowManagerService.H.SHOW_CIRCULAR_DISPLAY_MASK ) ) ; } }

Target:
public void updateCircularDisplayMaskIfNeeded ( ) { if ( ( mContext.getResources ( ) . getBoolean ( com.android.internal.R.bool.config_windowIsRound ) ) && ( mContext.getResources ( ) . getBoolean ( com.android.internal.R.bool.config_windowShowCircularMask ) ) ) { int inversionState = Settings.Secure.getIntForUser ( mContext.getContentResolver ( ) , Settings.Secure.ACCESSIBILITY_DISPLAY_INVERSION_ENABLED , 0 , mCurrentUserId ) ; int showMask = ( inversionState == 1 ) ? 0 : 1 ; android.os.Message m = mH.obtainMessage ( com.android.server.wm.WindowManagerService.H.SHOW_CIRCULAR_DISPLAY_MASK ) ; m.arg1 = showMask ; mH.sendMessage ( m ) ; } }
Source:
public void deinit ( ) { mInitialized = false ; unregisterObserver ( ) ; if ( ( mSmsBroadcastReceiver ) != null ) { mSmsBroadcastReceiver.unregister ( ) ; } unRegisterPhoneServiceStateListener ( ) ; failPendingMessages ( ) ; removeDeletedMessages ( ) ; }

Target:
public void deinit ( ) { mInitialized = false ; unregisterObserver ( ) ; if ( ( mSmsBroadcastReceiver ) != null ) { mSmsBroadcastReceiver.unregister ( ) ; } unRegisterPhoneServiceStateListener ( ) ; if ( android.os.UserManager.get ( mContext ) . isUserUnlocked ( ) ) { failPendingMessages ( ) ; removeDeletedMessages ( ) ; } }
Source:
private void initEmergencyApnSetting ( ) { java.lang.String selection = "type=\"emergency\"" ; android.database.Cursor cursor = mPhone.getContext ( ) . getContentResolver ( ) . query ( Telephony.Carriers.CONTENT_URI , null , selection , null , null ) ; if ( cursor != null ) { if ( ( cursor.getCount ( ) ) > 0 ) { if ( cursor.moveToFirst ( ) ) { mEmergencyApn = makeApnSetting ( cursor ) ; } } cursor.close ( ) ; } }

Target:
private void initEmergencyApnSetting ( ) { java.lang.String selection = "type=\"emergency\"" ; android.database.Cursor cursor = mPhone.getContext ( ) . getContentResolver ( ) . query ( android.net.Uri.withAppendedPath ( Telephony.Carriers.CONTENT_URI , "filtered" ) , null , selection , null , null ) ; if ( cursor != null ) { if ( ( cursor.getCount ( ) ) > 0 ) { if ( cursor.moveToFirst ( ) ) { mEmergencyApn = makeApnSetting ( cursor ) ; } } cursor.close ( ) ; } }
Source:
public void testSinglePreDexLibrary ( ) throws com.android.ide.common.internal.LoggedErrorException , java.io.IOException , java.lang.InterruptedException { java.lang.String content = "Some Content" ; java.io.File input = com.android.builder.internal.compiler.PreDexCacheTest.createInputFile ( content ) ; java.io.File output = java.io.File.createTempFile ( "predex" , ".jar" ) ; output.deleteOnExit ( ) ; com.android.builder.internal.compiler.PreDexCache.getCache ( ) . preDexLibrary ( input , output , false , new com.android.builder.internal.compiler.PreDexCacheTest.FakeDexOptions ( ) , mBuildToolInfo , false , new com.android.builder.internal.compiler.PreDexCacheTest.FakeCommandLineRunner ( new com.android.utils.StdLogger ( StdLogger.Level.INFO ) ) ) ; com.android.builder.internal.compiler.PreDexCacheTest.checkOutputFile ( content , output ) ; }

Target:
public void testSinglePreDexLibrary ( ) throws com.android.ide.common.process.ProcessException , java.io.IOException , java.lang.InterruptedException { java.lang.String content = "Some Content" ; java.io.File input = com.android.builder.internal.compiler.PreDexCacheTest.createInputFile ( content ) ; java.io.File output = java.io.File.createTempFile ( "predex" , ".jar" ) ; output.deleteOnExit ( ) ; com.android.builder.internal.compiler.PreDexCache.getCache ( ) . preDexLibrary ( input , output , false , new com.android.builder.internal.compiler.PreDexCacheTest.FakeDexOptions ( ) , mBuildToolInfo , false , new com.android.builder.internal.compiler.PreDexCacheTest.FakeJavaProcessExecutor ( ) , new com.android.builder.internal.compiler.PreDexCacheTest.FakeProcessOutputHandler ( ) ) ; com.android.builder.internal.compiler.PreDexCacheTest.checkOutputFile ( content , output ) ; }
Source:
public void testManifestIExistingI ( ) { int iFlags = PackageManager.INSTALL_INTERNAL ; int rFlags = PackageManager.INSTALL_REPLACE_EXISTING ; installFromRawResource ( "install.apk" , R.raw.install , iFlags , false , false , ( - 1 ) , ( - 1 ) ) ; installFromRawResource ( "install.apk" , R.raw.install_loc_internal , rFlags , true , false , ( - 1 ) , PackageInfo.INSTALL_LOCATION_INTERNAL_ONLY ) ; }

Target:
public void testFlagEExistingE ( ) { if ( android.os.Environment.isExternalStorageEmulated ( ) ) { return ; } int iFlags = android.content.pm.PackageManager.INSTALL_EXTERNAL ; int rFlags = ( android.content.pm.PackageManager.INSTALL_EXTERNAL ) | ( android.content.pm.PackageManager.INSTALL_REPLACE_EXISTING ) ; installFromRawResource ( "install.apk" , R.raw.install , iFlags , false , false , ( - 1 ) , ( - 1 ) ) ; installFromRawResource ( "install.apk" , R.raw.install , rFlags , true , false , ( - 1 ) , ( - 1 ) ) ; }
Source:
public boolean cleanup ( ) { if ( com.android.bluetooth.map.BluetoothMapService.DEBUG ) android.util.Log.d ( com.android.bluetooth.map.BluetoothMapService.TAG , "cleanup()" ) ; setState ( BluetoothMap.STATE_DISCONNECTED , BluetoothMap.RESULT_CANCELED ) ; sendShutdownMessage ( ) ; return true ; }

Target:
public boolean cleanup ( ) { if ( com.android.bluetooth.map.BluetoothMapService.DEBUG ) { android.util.Log.d ( com.android.bluetooth.map.BluetoothMapService.TAG , "cleanup()" ) ; } if ( ! ( isMapStarted ( ) ) ) { if ( com.android.bluetooth.map.BluetoothMapService.DEBUG ) { android.util.Log.d ( com.android.bluetooth.map.BluetoothMapService.TAG , ( "Service Not Available to STOP or Shutdown already" + " in progress - Ignoring" ) ) ; } return true ; } else { if ( com.android.bluetooth.map.BluetoothMapService.VERBOSE ) android.util.Log.d ( com.android.bluetooth.map.BluetoothMapService.TAG , "Service Stoping()" ) ; } setState ( BluetoothMap.STATE_DISCONNECTED , BluetoothMap.RESULT_CANCELED ) ; if ( ( mSessionStatusHandler ) != null ) { sendShutdownMessage ( ) ; } mServiceStarted = false ; return true ; }
Source:
private static boolean isMainApkCompatibleWithDevice ( com.android.build.OutputFile mainOutputFile , java.util.Collection < java.lang.String > variantAbiFilters , java.util.Collection < java.lang.String > deviceAbis ) { if ( ( ( com.android.ide.common.build.SplitOutputMatcher.getFilter ( mainOutputFile , OutputFile.ABI ) ) == null ) && ( variantAbiFilters != null ) ) { for ( java.lang.String abi : deviceAbis ) { if ( variantAbiFilters.contains ( abi ) ) { return true ; } } return false ; } return true ; }

Target:
private static boolean isMainApkCompatibleWithDevice ( com.android.build.OutputFile mainOutputFile , java.util.Collection < java.lang.String > variantAbiFilters , java.util.Collection < java.lang.String > deviceAbis ) { if ( ( ( ( com.android.ide.common.build.SplitOutputMatcher.getFilter ( mainOutputFile , OutputFile.ABI ) ) == null ) && ( variantAbiFilters != null ) ) && ( ! ( variantAbiFilters.isEmpty ( ) ) ) ) { for ( java.lang.String abi : deviceAbis ) { if ( variantAbiFilters.contains ( abi ) ) { return true ; } } return false ; } return true ; }
Source:
android.net.INetworkPolicyListener waitAndVerify ( ) { assertNotNull ( "waitAndVerify() called before expect()" , latch ) ; try { assertTrue ( "callback not called in 5 seconds" , latch.await ( 5 , java.util.concurrent.TimeUnit.SECONDS ) ) ; } catch ( java.lang.InterruptedException e ) { fail ( "Thread interrupted before callback called" ) ; } finally { latch = null ; } return org.mockito.Mockito.verify ( listener , org.mockito.Mockito.atLeastOnce ( ) ) ; }

Target:
android.net.INetworkPolicyListener waitAndVerify ( ) { org.junit.Assert.assertNotNull ( "waitAndVerify() called before expect()" , latch ) ; try { org.junit.Assert.assertTrue ( "callback not called in 5 seconds" , latch.await ( 5 , java.util.concurrent.TimeUnit.SECONDS ) ) ; } catch ( java.lang.InterruptedException e ) { org.junit.Assert.fail ( "Thread interrupted before callback called" ) ; } finally { latch = null ; } return org.mockito.Mockito.verify ( listener , org.mockito.Mockito.atLeastOnce ( ) ) ; }
Source:
public void testDependencies ( ) throws java.lang.Exception { mEnabled = java.util.Collections.singleton ( com.android.tools.lint.checks.GradleDetector.DEPENDENCY ) ; assertEquals ( ( ( ( ( ( ( "" + ( ( ( ( ( ( "build.gradle:5: Warning: Old buildToolsVersion 19.0.0; recommended version is 19.1.0 or later [GradleDependency]\n" + " buildToolsVersion \"19.0.0\"\n" ) + " ~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ) + "build.gradle:24: Warning: A newer version of com.google.guava:guava than 11.0.2 is available: 18.0 [GradleDependency]\n" ) + " freeCompile \'com.google.guava:guava:11.0.2\'\n" ) + " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ) + "build.gradle:25: Warning: A newer version of com.android.support:appcompat-v7 than 13.0.0 is available: " ) ) + ( com.android.sdklib.SdkVersionInfo.HIGHEST_KNOWN_STABLE_API ) ) + ".0.0 [GradleDependency]\n" ) + " compile \'com.android.support:appcompat-v7:13.0.0\'\n" ) + " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ) + "0 errors, 3 warnings\n" ) , lintProject ( "gradle/Dependencies.gradle=>build.gradle" ) ) ; }

Target:
public void testDependencies ( ) throws java.lang.Exception { mEnabled = java.util.Collections.singleton ( com.android.tools.lint.checks.GradleDetector.DEPENDENCY ) ; assertEquals ( ( ( ( ( ( ( "" + ( ( ( ( ( ( "build.gradle:5: Warning: Old buildToolsVersion 19.0.0; recommended version is 19.1.0 or later [GradleDependency]\n" + " buildToolsVersion \"19.0.0\"\n" ) + " ~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ) + "build.gradle:24: Warning: A newer version of com.google.guava:guava than 11.0.2 is available: 18.0 [GradleDependency]\n" ) + " freeCompile \'com.google.guava:guava:11.0.2\'\n" ) + " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ) + "build.gradle:25: Warning: A newer version of com.android.support:appcompat-v7 than 13.0.0 is available: " ) ) + ( com.android.sdklib.SdkVersionInfo.HIGHEST_KNOWN_STABLE_API ) ) + ".0.2 [GradleDependency]\n" ) + " compile \'com.android.support:appcompat-v7:13.0.0\'\n" ) + " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ) + "0 errors, 3 warnings\n" ) , lintProject ( "gradle/Dependencies.gradle=>build.gradle" ) ) ; }
Source:
public com.android.jack.dx.io.instructions.DecodedInstruction decode ( int opcodeUnit , com.android.jack.dx.io.instructions.CodeInput in ) throws java.io.EOFException { int baseAddress = ( in.cursor ( ) ) - 1 ; int opcode = com.android.jack.dx.io.instructions.InstructionCodec.byte0 ( opcodeUnit ) ; int literal = com.android.jack.dx.io.instructions.InstructionCodec.byte1 ( opcodeUnit ) ; int target = in.readInt ( ) ; return new com.android.jack.dx.io.instructions.ZeroRegisterDecodedInstruction ( this , opcode , 0 , null , ( baseAddress + target ) , literal ) ; }

Target:
public com.android.jack.dx.io.instructions.DecodedInstruction decode ( int opcodeUnit , com.android.jack.dx.io.instructions.CodeInput in ) throws java.io.EOFException { int baseAddress = ( in.cursor ( ) ) - 1 ; int opcode = com.android.jack.dx.io.instructions.InstructionCodec.byte0 ( opcodeUnit ) ; int literal = com.android.jack.dx.io.instructions.InstructionCodec.byte1 ( opcodeUnit ) ; int target = in.readInt ( ) ; return new com.android.jack.dx.io.instructions.ZeroRegisterDecodedInstruction ( this , opcode , 0 , com.android.jack.dx.io.IndexType.NONE , ( baseAddress + target ) , literal ) ; }
Source:
private com.android.ide.eclipse.adt.internal.editors.layout.gre.NodeProxy create ( com.android.ide.eclipse.adt.internal.editors.layout.uimodel.UiViewElementNode uiNode , org.eclipse.swt.graphics.Rectangle bounds ) { com.android.ide.eclipse.adt.internal.editors.layout.gre.NodeProxy proxy = mNodeMap.get ( uiNode ) ; if ( proxy == null ) { proxy = new com.android.ide.eclipse.adt.internal.editors.layout.gre.NodeProxy ( uiNode , bounds , this ) ; mNodeMap.put ( uiNode , proxy ) ; } else if ( ( bounds != null ) && ( ! ( proxy.getBounds ( ) . equals ( bounds ) ) ) ) { proxy.setBounds ( bounds ) ; } return proxy ; }

Target:
private com.android.ide.eclipse.adt.internal.editors.layout.gre.NodeProxy create ( com.android.ide.eclipse.adt.internal.editors.layout.uimodel.UiViewElementNode uiNode , org.eclipse.swt.graphics.Rectangle bounds ) { com.android.ide.eclipse.adt.internal.editors.layout.gre.NodeProxy proxy = mNodeMap.get ( uiNode ) ; if ( proxy == null ) { proxy = new com.android.ide.eclipse.adt.internal.editors.layout.gre.NodeProxy ( uiNode , bounds , this ) ; mNodeMap.put ( uiNode , proxy ) ; } else if ( ( bounds != null ) && ( ! ( com.android.ide.eclipse.adt.internal.editors.layout.gle2.SwtUtils.equals ( proxy.getBounds ( ) , bounds ) ) ) ) { proxy.setBounds ( bounds ) ; } return proxy ; }
Source:
public void testSetupDriverForSoftApModeError ( ) { com.android.server.wifi.WificondControl wificondControl = org.mockito.Mockito.mock ( com.android.server.wifi.WificondControl.class ) ; android.net.wifi.IWificond wificond = org.mockito.Mockito.mock ( android.net.wifi.IWificond.class ) ; org.mockito.Mockito.when ( wificondControl.setupDriverForSoftApMode ( ) ) . thenReturn ( null ) ; mWifiNative.setWificondControl ( wificondControl ) ; android.net.wifi.IApInterface returnedApInterface = mWifiNative.setupForSoftApMode ( ) ; org.junit.Assert.assertEquals ( null , returnedApInterface ) ; org.mockito.Mockito.verify ( mWifiNative ) . startHal ( org.mockito.Mockito.eq ( false ) ) ; org.mockito.Mockito.verify ( wificondControl ) . setupDriverForSoftApMode ( ) ; }

Target:
public void testStartPnoScan ( ) throws java.lang.Exception { mWifiNative.startPnoScan ( com.android.server.wifi.WifiNativeTest.TEST_PNO_SETTINGS ) ; org.mockito.Mockito.verify ( mWificondControl ) . startPnoScan ( com.android.server.wifi.WifiNativeTest.TEST_PNO_SETTINGS ) ; }
Source:
public boolean onSearchRequested ( ) { final android.app.SearchManager searchManager = ( ( android.app.SearchManager ) ( mContext.getSystemService ( Context.SEARCH_SERVICE ) ) ) ; final android.content.ComponentName appName = getAssociatedActivity ( ) ; if ( appName != null ) { searchManager.startSearch ( null , false , appName , null , false ) ; dismiss ( ) ; return true ; } else { return false ; } }

Target:
public boolean onSearchRequested ( ) { final android.app.SearchManager searchManager = ( ( android.app.SearchManager ) ( mContext.getSystemService ( Context.SEARCH_SERVICE ) ) ) ; final android.content.ComponentName appName = getAssociatedActivity ( ) ; if ( ( appName != null ) && ( ( searchManager.getSearchableInfo ( appName ) ) != null ) ) { searchManager.startSearch ( null , false , appName , null , false ) ; dismiss ( ) ; return true ; } else { return false ; } }
Source:
public void requestInstall_nullCallback ( ) throws java.lang.Exception { configureCallerHasPermission ( ) ; android.os.ParcelFileDescriptor parcelFileDescriptor = createFakeParcelFileDescriptor ( ) ; byte [ ] tokenBytes = createArbitraryTokenBytes ( ) ; android.app.timezone.ICallback callback = null ; try { mRulesManagerService.requestInstall ( parcelFileDescriptor , tokenBytes , callback ) ; org.junit.Assert.fail ( ) ; } catch ( java.lang.NullPointerException expected ) { } mFakeExecutor.assertNothingQueued ( ) ; verifyNoInstallerCallsMade ( ) ; verifyNoPackageTrackerCallsMade ( ) ; }

Target:
public void requestInstall_nullCallback ( ) throws java.lang.Exception { configureCallerHasPermission ( ) ; android.os.ParcelFileDescriptor parcelFileDescriptor = com.android.server.timezone.RulesManagerServiceTest.createParcelFileDescriptor ( com.android.server.timezone.RulesManagerServiceTest.createArbitraryBytes ( 1000 ) ) ; byte [ ] tokenBytes = createArbitraryTokenBytes ( ) ; android.app.timezone.ICallback callback = null ; try { mRulesManagerService.requestInstall ( parcelFileDescriptor , tokenBytes , callback ) ; org.junit.Assert.fail ( ) ; } catch ( java.lang.NullPointerException expected ) { } com.android.server.timezone.RulesManagerServiceTest.assertClosed ( parcelFileDescriptor ) ; mFakeExecutor.assertNothingQueued ( ) ; verifyNoInstallerCallsMade ( ) ; verifyNoPackageTrackerCallsMade ( ) ; }
Source:
public void testMovedConstants ( ) throws java.lang.Exception { assertEquals ( ( "" + ( ( ( ( ( ( "src/test/pkg/ApiSourceCheck2.java:10: Warning: Field requires API level 11 (current min is 1): android.widget.AbsListView#CHOICE_MODE_MULTIPLE_MODAL [InlinedApi]\n" + " int mode2 = AbsListView.CHOICE_MODE_MULTIPLE_MODAL;\n" ) + " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ) + "src/test/pkg/ApiSourceCheck2.java:14: Warning: Field requires API level 11 (current min is 1): android.widget.ListView#CHOICE_MODE_MULTIPLE_MODAL [InlinedApi]\n" ) + " int mode6 = ListView.CHOICE_MODE_MULTIPLE_MODAL;\n" ) + " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ) + "0 errors, 2 warnings\n" ) ) , lintProject ( "apicheck/classpath=>.classpath" , "apicheck/minsdk1.xml=>AndroidManifest.xml" , "project.properties19=>project.properties" , "apicheck/ApiSourceCheck2.java.txt=>src/test/pkg/ApiSourceCheck2.java" , "apicheck/ApiSourceCheck2.class.data=>bin/classes/test/pkg/ApiSourceCheck2.class" ) ) ; }

Target:
public void testMovedConstants ( ) throws java.lang.Exception { assertEquals ( ( "" + ( ( ( ( ( ( "src/test/pkg/ApiSourceCheck2.java:10: Warning: Field requires API level 11 (current min is 1): android.widget.AbsListView#CHOICE_MODE_MULTIPLE_MODAL [InlinedApi]\n" + " int mode2 = AbsListView.CHOICE_MODE_MULTIPLE_MODAL;\n" ) + " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ) + "src/test/pkg/ApiSourceCheck2.java:14: Warning: Field requires API level 11 (current min is 1): android.widget.AbsListView#CHOICE_MODE_MULTIPLE_MODAL [InlinedApi]\n" ) + " int mode6 = ListView.CHOICE_MODE_MULTIPLE_MODAL;\n" ) + " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ) + "0 errors, 2 warnings\n" ) ) , lintProject ( "apicheck/classpath=>.classpath" , "apicheck/minsdk1.xml=>AndroidManifest.xml" , "project.properties19=>project.properties" , "apicheck/ApiSourceCheck2.java.txt=>src/test/pkg/ApiSourceCheck2.java" , "apicheck/ApiSourceCheck2.class.data=>bin/classes/test/pkg/ApiSourceCheck2.class" ) ) ; }
Source:
private void saveMessage ( ) { android.net.Uri messageUri = null ; if ( mMessage.isReplace ( ) ) { messageUri = replaceMessage ( mMessage ) ; } else { messageUri = storeMessage ( mMessage ) ; } if ( ( ! ( mRead ) ) && ( messageUri != null ) ) { com.android.mms.transaction.MessagingNotification.nonBlockingUpdateNewMessageIndicator ( this , true , false ) ; } }

Target:
private void saveMessage ( ) { android.net.Uri messageUri = null ; if ( mMessage.isReplace ( ) ) { messageUri = replaceMessage ( mMessage ) ; } else { messageUri = storeMessage ( mMessage ) ; } if ( ( ! ( mRead ) ) && ( messageUri != null ) ) { com.android.mms.transaction.MessagingNotification.nonBlockingUpdateNewMessageIndicator ( this , MessagingNotification.THREAD_ALL , false ) ; } }
Source:
com.android.builder.core.AndroidBuilder createAndroidBuilder ( org.gradle.api.Project project , com.android.build.gradle.internal.ExtraModelInfo extraModelInfo ) { java.lang.String creator = "Android Gradle" ; com.android.utils.ILogger logger = new com.android.build.gradle.internal.LoggerWrapper ( project.logger ) ; return new com.android.builder.core.AndroidBuilder ( ( project == ( project.rootProject ) ? project.name : project.path ) , creator , new com.android.build.gradle.internal.process.GradleProcessExecutor ( project ) , new com.android.build.gradle.internal.process.GradleJavaProcessExecutor ( project ) , new com.android.ide.common.process.LoggedProcessOutputHandler ( logger ) , extraModelInfo , logger , project.logger.isEnabled ( LogLevel.INFO ) ) ; }

Target:
public com.android.builder.core.AndroidBuilder createAndroidBuilder ( org.gradle.api.Project project , com.android.build.gradle.internal.ExtraModelInfo extraModelInfo ) { java.lang.String creator = "Android Gradle" ; com.android.utils.ILogger logger = new com.android.build.gradle.internal.LoggerWrapper ( project.getLogger ( ) ) ; return new com.android.builder.core.AndroidBuilder ( ( project.equals ( project.getRootProject ( ) ) ? project.getName ( ) : project.getPath ( ) ) , creator , new com.android.build.gradle.internal.process.GradleProcessExecutor ( project ) , new com.android.build.gradle.internal.process.GradleJavaProcessExecutor ( project ) , new com.android.ide.common.process.LoggedProcessOutputHandler ( logger ) , extraModelInfo , logger , project.getLogger ( ) . isEnabled ( LogLevel.INFO ) ) ; }
Source:
public void testStageInstallWithErrorCode_badTzLookupFile ( ) 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 ) ) ; assertInstallDistroStaged ( stagedDistro ) ; com.android.timezone.distro.TimeZoneDistro incompleteDistro = libcore.tzdata.update2.TimeZoneDistroInstallerTest.createValidTimeZoneDistroBuilder ( libcore.tzdata.update2.TimeZoneDistroInstallerTest.NEWER_RULES_VERSION , 1 ) . setTzLookupXml ( "<foo />" ) . buildUnvalidated ( ) ; assertEquals ( TimeZoneDistroInstaller.INSTALL_FAIL_VALIDATION_ERROR , installer.stageInstallWithErrorCode ( incompleteDistro ) ) ; assertInstallDistroStaged ( stagedDistro ) ; assertNoInstalledDistro ( ) ; }

Target:
public void testStageInstallWithErrorCode_badTzLookupFile ( ) throws java.lang.Exception { byte [ ] stagedDistroBytes = libcore.tzdata.update2.TimeZoneDistroInstallerTest.createValidTimeZoneDistroBytes ( libcore.tzdata.update2.TimeZoneDistroInstallerTest.NEW_RULES_VERSION , 1 ) ; assertEquals ( TimeZoneDistroInstaller.INSTALL_SUCCESS , installer.stageInstallWithErrorCode ( new com.android.timezone.distro.TimeZoneDistro ( stagedDistroBytes ) ) ) ; assertInstallDistroStaged ( stagedDistroBytes ) ; byte [ ] incompleteDistroBytes = libcore.tzdata.update2.TimeZoneDistroInstallerTest.createValidTimeZoneDistroBuilder ( libcore.tzdata.update2.TimeZoneDistroInstallerTest.NEWER_RULES_VERSION , 1 ) . setTzLookupXml ( "<foo />" ) . buildUnvalidatedBytes ( ) ; assertEquals ( TimeZoneDistroInstaller.INSTALL_FAIL_VALIDATION_ERROR , installer.stageInstallWithErrorCode ( new com.android.timezone.distro.TimeZoneDistro ( incompleteDistroBytes ) ) ) ; assertInstallDistroStaged ( stagedDistroBytes ) ; assertNoInstalledDistro ( ) ; }
Source:
public static < E > java.util.LinkedHashSet < E > newLinkedHashSet ( java.lang.Iterable < ? extends E > elements ) { if ( elements instanceof java.util.Collection ) { return new java.util.LinkedHashSet < E > ( com.google.common.collect.Collections2.cast ( elements ) ) ; } java.util.LinkedHashSet < E > set = com.google.common.collect.Sets.newLinkedHashSet ( ) ; for ( E element : elements ) { set.add ( element ) ; } return set ; }

Target:
public static < E > java.util.LinkedHashSet < E > newLinkedHashSet ( java.lang.Iterable < ? extends E > elements ) { if ( elements instanceof java.util.Collection ) { return new java.util.LinkedHashSet < E > ( com.google.common.collect.Collections2.cast ( elements ) ) ; } java.util.LinkedHashSet < E > set = com.google.common.collect.Sets.newLinkedHashSet ( ) ; com.google.common.collect.Iterables.addAll ( set , elements ) ; return set ; }
Source:
public boolean setCurrentInputMethodSubtype ( android.view.inputmethod.InputMethodSubtype subtype ) { synchronized ( mH ) { try { return mService.setCurrentInputMethodSubtype ( subtype ) ; } catch ( android.os.RemoteException e ) { android.util.Log.w ( android.view.inputmethod.InputMethodManager.TAG , ( "IME died: " + ( mCurId ) ) , e ) ; return false ; } } }

Target:
public void showInputMethodPicker ( boolean showAuxiliarySubtypes ) { synchronized ( mH ) { try { final int mode = ( showAuxiliarySubtypes ) ? android.view.inputmethod.InputMethodManager.SHOW_IM_PICKER_MODE_INCLUDE_AUXILIARY_SUBTYPES : android.view.inputmethod.InputMethodManager.SHOW_IM_PICKER_MODE_EXCLUDE_AUXILIARY_SUBTYPES ; mService.showInputMethodPickerFromClient ( mClient , mode ) ; } catch ( android.os.RemoteException e ) { throw e.rethrowFromSystemServer ( ) ; } } }
Source:
private void handleSessionEnd ( ) { com.android.internal.telephony.cat.CatLog.d ( this , "SESSION END" ) ; mCurrntCmd = mMenuCmd ; android.content.Intent intent = new android.content.Intent ( AppInterface.CAT_SESSION_END_ACTION ) ; mContext.sendBroadcast ( intent ) ; }

Target:
private void handleSessionEnd ( ) { com.android.internal.telephony.cat.CatLog.d ( this , ( "SESSION END on " + ( mSlotId ) ) ) ; mCurrntCmd = mMenuCmd ; android.content.Intent intent = new android.content.Intent ( AppInterface.CAT_SESSION_END_ACTION ) ; intent.putExtra ( "SLOT_ID" , mSlotId ) ; mContext.sendBroadcast ( intent ) ; }
Source:
public final void mapSourceRegisters ( com.android.dx.ssa.RegisterMapper mapper ) { com.android.dx.ssa.RegisterSpecList oldSources = insn.getSources ( ) ; com.android.dx.ssa.RegisterSpecList newSources = mapper.map ( oldSources ) ; if ( newSources != oldSources ) { insn = insn.withNewRegisters ( getResult ( ) , newSources ) ; getBlock ( ) . getParent ( ) . onSourcesChanged ( this , oldSources ) ; } }

Target:
public final void mapSourceRegisters ( com.android.dx.ssa.RegisterMapper mapper ) { com.android.dx.rop.code.RegisterSpecList oldSources = insn.getSources ( ) ; com.android.dx.rop.code.RegisterSpecList newSources = mapper.map ( oldSources ) ; if ( newSources != oldSources ) { insn = insn.withNewRegisters ( getResult ( ) , newSources ) ; getBlock ( ) . getParent ( ) . onSourcesChanged ( this , oldSources ) ; } }
Source:
public void testGetProperty_badResponse ( ) throws java.lang.Exception { com.android.ddmlib.IDevice mockDevice = org.easymock.EasyMock.createMock ( com.android.ddmlib.IDevice.class ) ; com.android.ddmlib.DeviceTest.injectShellResponse ( mockDevice , "blargh" ) ; org.easymock.EasyMock.replay ( mockDevice ) ; com.android.ddmlib.PropertyFetcher fetcher = new com.android.ddmlib.PropertyFetcher ( mockDevice ) ; assertNull ( fetcher.getProperty ( "dev.bootcomplete" ) . get ( ) ) ; }

Target:
public void testGetProperty_badResponse ( ) throws java.lang.Exception { com.android.ddmlib.IDevice mockDevice = com.android.ddmlib.DeviceTest.createMockDevice ( ) ; com.android.ddmlib.DeviceTest.injectShellResponse ( mockDevice , "blargh" ) ; org.easymock.EasyMock.replay ( mockDevice ) ; com.android.ddmlib.PropertyFetcher fetcher = new com.android.ddmlib.PropertyFetcher ( mockDevice ) ; assertNull ( fetcher.getProperty ( "dev.bootcomplete" ) . get ( ) ) ; }
Source:
public void run ( ) { java.io.InputStreamReader is = new java.io.InputStreamReader ( process.getErrorStream ( ) ) ; java.io.BufferedReader errReader = new java.io.BufferedReader ( is ) ; try { while ( true ) { java.lang.String line = errReader.readLine ( ) ; if ( line != null ) { monitor.setResult ( "[%1$s] Error: %2$s" , scriptName , line ) ; } else { break ; } } } catch ( java.io.IOException e ) { } }

Target:
public void run ( ) { java.io.InputStreamReader is = new java.io.InputStreamReader ( process.getErrorStream ( ) ) ; java.io.BufferedReader errReader = new java.io.BufferedReader ( is ) ; try { while ( true ) { java.lang.String line = errReader.readLine ( ) ; if ( line != null ) { monitor.logError ( "[%1$s] Error: %2$s" , scriptName , line ) ; } else { break ; } } } catch ( java.io.IOException e ) { } }
Source:
public void testIsLegalReplacement ( ) { try { encoder.isLegalReplacement ( null ) ; fail ( "should throw null pointer exception" ) ; } catch ( java.lang.NullPointerException e ) { } assertTrue ( encoder.isLegalReplacement ( specifiedReplacement ) ) ; assertTrue ( encoder.isLegalReplacement ( new byte [ 200 ] ) ) ; byte [ ] ba = getIllegalByteArray ( ) ; if ( ba != null ) { assertFalse ( encoder.isLegalReplacement ( ba ) ) ; } }

Target:
public void test_isLegalReplacement_bad ( ) { assertTrue ( encoder.isLegalReplacement ( new byte [ 200 ] ) ) ; byte [ ] ba = getIllegalByteArray ( ) ; if ( ba != null ) { assertFalse ( encoder.isLegalReplacement ( ba ) ) ; } }
Source:
private android.net.wifi.hotspot2.PasspointConfiguration createTestConfigWithSimCredential ( ) { android.net.wifi.hotspot2.PasspointConfiguration config = new android.net.wifi.hotspot2.PasspointConfiguration ( ) ; android.net.wifi.hotspot2.pps.HomeSP homeSp = new android.net.wifi.hotspot2.pps.HomeSP ( ) ; homeSp.setFqdn ( com.android.server.wifi.hotspot2.PasspointManagerTest.TEST_FQDN ) ; homeSp.setFriendlyName ( com.android.server.wifi.hotspot2.PasspointManagerTest.TEST_FRIENDLY_NAME ) ; config.setHomeSp ( homeSp ) ; android.net.wifi.hotspot2.pps.Credential credential = new android.net.wifi.hotspot2.pps.Credential ( ) ; credential.setRealm ( com.android.server.wifi.hotspot2.PasspointManagerTest.TEST_REALM ) ; android.net.wifi.hotspot2.pps.Credential.SimCredential simCredential = new android.net.wifi.hotspot2.pps.Credential.SimCredential ( ) ; simCredential.setImsi ( com.android.server.wifi.hotspot2.PasspointManagerTest.TEST_IMSI ) ; simCredential.setEapType ( EAPConstants.EAP_SIM ) ; credential.setSimCredential ( simCredential ) ; config.setCredential ( credential ) ; return config ; }

Target:
private android.net.wifi.hotspot2.PasspointConfiguration createTestConfigWithSimCredential ( ) { android.net.wifi.hotspot2.PasspointConfiguration config = new android.net.wifi.hotspot2.PasspointConfiguration ( ) ; android.net.wifi.hotspot2.pps.HomeSp homeSp = new android.net.wifi.hotspot2.pps.HomeSp ( ) ; homeSp.setFqdn ( com.android.server.wifi.hotspot2.PasspointManagerTest.TEST_FQDN ) ; homeSp.setFriendlyName ( com.android.server.wifi.hotspot2.PasspointManagerTest.TEST_FRIENDLY_NAME ) ; config.setHomeSp ( homeSp ) ; android.net.wifi.hotspot2.pps.Credential credential = new android.net.wifi.hotspot2.pps.Credential ( ) ; credential.setRealm ( com.android.server.wifi.hotspot2.PasspointManagerTest.TEST_REALM ) ; android.net.wifi.hotspot2.pps.Credential.SimCredential simCredential = new android.net.wifi.hotspot2.pps.Credential.SimCredential ( ) ; simCredential.setImsi ( com.android.server.wifi.hotspot2.PasspointManagerTest.TEST_IMSI ) ; simCredential.setEapType ( EAPConstants.EAP_SIM ) ; credential.setSimCredential ( simCredential ) ; config.setCredential ( credential ) ; return config ; }
Source:
public void getProperty_volatile ( ) throws java.lang.Exception { com.android.ddmlib.IDevice mockDevice = org.easymock.EasyMock.createMock ( com.android.ddmlib.IDevice.class ) ; injectShellResponse ( mockDevice , "[dev.bootcomplete]: [0]\r\n" ) ; injectShellResponse ( mockDevice , "[dev.bootcomplete]: [1]\r\n" ) ; org.easymock.EasyMock.replay ( mockDevice ) ; com.android.ddmlib.PropertyFetcher fetcher = new com.android.ddmlib.PropertyFetcher ( mockDevice ) ; org.junit.Assert.assertEquals ( "0" , fetcher.getProperty ( "dev.bootcomplete" ) . get ( ) ) ; org.junit.Assert.assertEquals ( "1" , fetcher.getProperty ( "dev.bootcomplete" ) . get ( ) ) ; }

Target:
public void testGetProperty_volatile ( ) throws java.lang.Exception { com.android.ddmlib.IDevice mockDevice = org.easymock.EasyMock.createMock ( com.android.ddmlib.IDevice.class ) ; injectShellResponse ( mockDevice , "[dev.bootcomplete]: [0]\r\n" ) ; injectShellResponse ( mockDevice , "[dev.bootcomplete]: [1]\r\n" ) ; org.easymock.EasyMock.replay ( mockDevice ) ; com.android.ddmlib.PropertyFetcher fetcher = new com.android.ddmlib.PropertyFetcher ( mockDevice ) ; assertEquals ( "0" , fetcher.getProperty ( "dev.bootcomplete" ) . get ( ) ) ; assertEquals ( "1" , fetcher.getProperty ( "dev.bootcomplete" ) . get ( ) ) ; }
Source:
public void setIconTint ( int tint , float darkIntensity , android.graphics.Rect tintArea ) { applyDarkIntensity ( com.android.systemui.statusbar.phone.StatusBarIconController.getDarkIntensity ( tintArea , mMobile , darkIntensity ) , mMobile , mMobileDark ) ; setTint ( mMobileType , com.android.systemui.statusbar.phone.StatusBarIconController.getTint ( tintArea , mMobileType , tint ) ) ; }

Target:
public void setIconTint ( int tint , float darkIntensity , android.graphics.Rect tintArea ) { applyDarkIntensity ( com.android.systemui.statusbar.phone.StatusBarIconController.getDarkIntensity ( tintArea , mMobile , darkIntensity ) , mMobile , mMobileDark ) ; setTint ( mMobileType , com.android.systemui.statusbar.phone.StatusBarIconController.getTint ( tintArea , mMobileType , tint ) ) ; setTint ( mMobileActivity , com.android.systemui.statusbar.phone.StatusBarIconController.getTint ( tintArea , mMobileActivity , tint ) ) ; }
Source:
public void sendRttModifyRequest ( ) { logi ( "sendRttModifyRequest" ) ; synchronized ( mLockObj ) { if ( ( mSession ) == null ) { loge ( "sendRttModifyRequest::no session" ) ; } if ( mCallProfile.mMediaProfile.isRttCall ( ) ) { logi ( "sendRttModifyRequest::Already RTT call, ignoring." ) ; return ; } android.os.Parcel p = android.os.Parcel.obtain ( ) ; mCallProfile.writeToParcel ( p , 0 ) ; com.android.ims.ImsCallProfile requestedProfile = new com.android.ims.ImsCallProfile ( p ) ; requestedProfile.mMediaProfile.setRttMode ( ImsStreamMediaProfile.RTT_MODE_FULL ) ; mSession.sendRttModifyRequest ( requestedProfile ) ; } }

Target:
public void sendRttMessage ( java.lang.String rttMessage ) { synchronized ( mLockObj ) { if ( ( mSession ) == null ) { loge ( "sendRttMessage::no session" ) ; } if ( ! ( mCallProfile.mMediaProfile.isRttCall ( ) ) ) { logi ( "sendRttMessage::Not an rtt call, ignoring" ) ; return ; } mSession.sendRttMessage ( rttMessage ) ; } }
Source:
static org.conscrypt.OpenSSLRSAPrivateKey getInstance ( org.conscrypt.OpenSSLKey key ) { byte [ ] [ ] params = org.conscrypt.NativeCrypto.get_RSA_private_params ( key.getPkeyContext ( ) ) ; if ( ( params [ 1 ] ) != null ) { return new org.conscrypt.OpenSSLRSAPrivateCrtKey ( key , params ) ; } return new org.conscrypt.OpenSSLRSAPrivateKey ( key , params ) ; }

Target:
static org.conscrypt.OpenSSLRSAPrivateKey getInstance ( org.conscrypt.OpenSSLKey key ) { byte [ ] [ ] params = org.conscrypt.NativeCrypto.get_RSA_private_params ( key.getNativeRef ( ) ) ; if ( ( params [ 1 ] ) != null ) { return new org.conscrypt.OpenSSLRSAPrivateCrtKey ( key , params ) ; } return new org.conscrypt.OpenSSLRSAPrivateKey ( key , params ) ; }