auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void enter ( ) { android.util.Log.i ( com.android.bluetooth.a2dp.A2dpStateMachine.TAG , ( ( ( "Enter Connected(" + ( mDevice ) ) + "): " ) + ( com.android.bluetooth.a2dp.A2dpStateMachine.messageWhatToString ( getCurrentMessage ( ) . what ) ) ) ) ; mConnectionState = android.bluetooth.BluetoothProfile.STATE_CONNECTED ; removeDeferredMessages ( com.android.bluetooth.a2dp.A2dpStateMachine.CONNECT ) ; removeMessages ( com.android.bluetooth.a2dp.A2dpStateMachine.CONNECT_TIMEOUT ) ; broadcastConnectionState ( mConnectionState , mLastConnectionState ) ; broadcastAudioState ( BluetoothA2dp.STATE_NOT_PLAYING , BluetoothA2dp.STATE_PLAYING ) ; }

Target:
public void enter ( ) { android.os.Message currentMessage = getCurrentMessage ( ) ; android.util.Log.i ( com.android.bluetooth.a2dp.A2dpStateMachine.TAG , ( ( ( "Enter Connected(" + ( mDevice ) ) + "): " ) + ( currentMessage == null ? "null" : com.android.bluetooth.a2dp.A2dpStateMachine.messageWhatToString ( currentMessage.what ) ) ) ) ; mConnectionState = android.bluetooth.BluetoothProfile.STATE_CONNECTED ; removeDeferredMessages ( com.android.bluetooth.a2dp.A2dpStateMachine.CONNECT ) ; removeMessages ( com.android.bluetooth.a2dp.A2dpStateMachine.CONNECT_TIMEOUT ) ; broadcastConnectionState ( mConnectionState , mLastConnectionState ) ; broadcastAudioState ( BluetoothA2dp.STATE_NOT_PLAYING , BluetoothA2dp.STATE_PLAYING ) ; }
Source:
private void init ( com.android.sdklib.xml.AndroidManifestParser.ManifestData manifestData ) { com.android.sdklib.xml.AndroidManifestParser.Instrumentation [ ] instrumentations = manifestData.getInstrumentations ( ) ; mInstrumentationNames = new java.lang.String [ instrumentations.length ] ; for ( int i = 0 ; i < ( instrumentations.length ) ; i ++ ) { mInstrumentationNames [ i ] = instrumentations [ i ] . getName ( ) ; } mHasRunnerLibrary = hasTestRunnerLibrary ( manifestData ) ; }

Target:
private void init ( com.android.sdklib.xml.ManifestData manifestData ) { com.android.sdklib.xml.ManifestData.Instrumentation [ ] instrumentations = manifestData.getInstrumentations ( ) ; mInstrumentationNames = new java.lang.String [ instrumentations.length ] ; for ( int i = 0 ; i < ( instrumentations.length ) ; i ++ ) { mInstrumentationNames [ i ] = instrumentations [ i ] . getName ( ) ; } mHasRunnerLibrary = hasTestRunnerLibrary ( manifestData ) ; }
Source:
protected libcore.util.ZoneInfo create ( java.lang.String id ) { int index = java.util.Arrays.binarySearch ( ids , id ) ; if ( index < 0 ) { return null ; } libcore.io.BufferIterator it = mappedFile.bigEndianIterator ( ) ; it.skip ( byteOffsets [ index ] ) ; return libcore.util.ZoneInfo.makeTimeZone ( id , it ) ; }

Target:
public libcore.io.BufferIterator getBufferIterator ( java.lang.String id ) { int index = java.util.Arrays.binarySearch ( ids , id ) ; if ( index < 0 ) { return null ; } libcore.io.BufferIterator it = mappedFile.bigEndianIterator ( ) ; it.skip ( byteOffsets [ index ] ) ; return it ; }
Source:
public boolean remove ( java.lang.Object key , java.lang.Object value ) { int hash = java.util.concurrent.ConcurrentHashMap.hash ( key.hashCode ( ) ) ; if ( value == null ) return false ; return ( segmentFor ( hash ) . remove ( key , hash , value ) ) != null ; }

Target:
public boolean remove ( java.lang.Object key , java.lang.Object value ) { int hash = java.util.concurrent.ConcurrentHashMap.hash ( key.hashCode ( ) ) ; java.util.concurrent.ConcurrentHashMap.Segment < K , V > s ; return ( ( value != null ) && ( ( s = segmentForHash ( hash ) ) != null ) ) && ( ( s.remove ( key , hash , value ) ) != null ) ; }
Source:
public android.content.pm.ResolveInfo resolveService ( android.content.Intent intent , java.lang.String resolvedType , int flags ) { java.util.List < android.content.pm.ResolveInfo > query = queryIntentServices ( intent , resolvedType , flags ) ; if ( query != null ) { if ( ( query.size ( ) ) >= 1 ) { return query.get ( 0 ) ; } } return null ; }

Target:
public android.content.pm.ResolveInfo resolveService ( android.content.Intent intent , java.lang.String resolvedType , int flags , int userId ) { java.util.List < android.content.pm.ResolveInfo > query = queryIntentServices ( intent , resolvedType , flags , userId ) ; if ( ! ( com.android.server.pm.PackageManagerService.sUserManager.exists ( userId ) ) ) return null ; if ( query != null ) { if ( ( query.size ( ) ) >= 1 ) { return query.get ( 0 ) ; } } return null ; }
Source:
static sun.security.util.DisabledAlgorithmConstraints.KeySizeConstraint.Operator of ( java.lang.String s ) { switch ( s ) { case "==" : return sun.security.util.DisabledAlgorithmConstraints.KeySizeConstraint.Operator.EQ ; case "!=" : return sun.security.util.DisabledAlgorithmConstraints.KeySizeConstraint.Operator.NE ; case "<" : return sun.security.util.DisabledAlgorithmConstraints.KeySizeConstraint.Operator.LT ; case "<=" : return sun.security.util.DisabledAlgorithmConstraints.KeySizeConstraint.Operator.LE ; case ">" : return sun.security.util.DisabledAlgorithmConstraints.KeySizeConstraint.Operator.GT ; case ">=" : return sun.security.util.DisabledAlgorithmConstraints.KeySizeConstraint.Operator.GE ; } throw new java.lang.IllegalArgumentException ( ( s + " is not a legal Operator" ) ) ; }

Target:
static sun.security.util.DisabledAlgorithmConstraints.Constraint.Operator of ( java.lang.String s ) { switch ( s ) { case "==" : return sun.security.util.DisabledAlgorithmConstraints.Constraint.Operator.EQ ; case "!=" : return sun.security.util.DisabledAlgorithmConstraints.Constraint.Operator.NE ; case "<" : return sun.security.util.DisabledAlgorithmConstraints.Constraint.Operator.LT ; case "<=" : return sun.security.util.DisabledAlgorithmConstraints.Constraint.Operator.LE ; case ">" : return sun.security.util.DisabledAlgorithmConstraints.Constraint.Operator.GT ; case ">=" : return sun.security.util.DisabledAlgorithmConstraints.Constraint.Operator.GE ; } throw new java.lang.IllegalArgumentException ( ( ( ( "Error in security " + "property. " ) + s ) + " is not a legal Operator" ) ) ; }
Source:
public void test_ConstructorLjava_lang_String ( ) { java.lang.ThreadGroup newGroup = null ; java.lang.ThreadGroup initial = getInitialThreadGroup ( ) ; final java.lang.String name = "Test name" ; newGroup = new java.lang.ThreadGroup ( name ) ; assertTrue ( "Has to be possible to create a subgroup of current group using simple constructor" , ( ( newGroup.getParent ( ) ) == initial ) ) ; assertTrue ( "Name has to be correct" , newGroup.getName ( ) . equals ( name ) ) ; newGroup.destroy ( ) ; }

Target:
protected void tearDown ( ) { java.lang.Thread.setDefaultUncaughtExceptionHandler ( originalThreadDefaultUncaughtExceptionHandler ) ; }
Source:
android.net.NetworkCapabilities expectCapabilitiesWithout ( int capability , com.android.server.ConnectivityServiceTest.MockNetworkAgent agent ) { com.android.server.ConnectivityServiceTest.CallbackInfo cbi = expectCallback ( com.android.server.ConnectivityServiceTest.CallbackState.NETWORK_CAPABILITIES , agent ) ; android.net.NetworkCapabilities nc = ( ( android.net.NetworkCapabilities ) ( cbi.arg ) ) ; org.junit.Assert.assertFalse ( nc.hasCapability ( capability ) ) ; return nc ; }

Target:
android.net.NetworkCapabilities expectCapabilitiesWith ( int capability , com.android.server.ConnectivityServiceTest.MockNetworkAgent agent , int timeoutMs ) { com.android.server.ConnectivityServiceTest.CallbackInfo cbi = expectCallback ( com.android.server.ConnectivityServiceTest.CallbackState.NETWORK_CAPABILITIES , agent , timeoutMs ) ; android.net.NetworkCapabilities nc = ( ( android.net.NetworkCapabilities ) ( cbi.arg ) ) ; org.junit.Assert.assertTrue ( nc.hasCapability ( capability ) ) ; return nc ; }
Source:
public static java.io.File createTempDir ( ) throws java.io.IOException { try { final java.io.File tmpDir = com.android.sched.util.file.Files.createTempDir ( ) ; java.lang.Runtime.getRuntime ( ) . addShutdownHook ( new java.lang.Thread ( ) { @ java.lang.Override public void run ( ) { try { com.android.jack.test.toolchain.AbstractTestTools.deleteTempDir ( tmpDir ) ; } catch ( java.io.IOException e ) { java.lang.System.err.println ( e.getMessage ( ) ) ; } } } ) ; return tmpDir ; } catch ( java.lang.IllegalStateException e ) { throw new java.io.IOException ( e ) ; } }

Target:
public static java.io.File createTempDir ( ) throws com.android.sched.util.file.CannotCreateFileException , com.android.sched.util.file.CannotSetPermissionException , com.android.sched.util.file.WrongPermissionException , java.io.IOException { try { final java.io.File tmpDir = com.android.sched.util.file.Files.createTempDir ( com.android.jack.test.toolchain.AbstractTestTools.TMP_PREFIX ) ; java.lang.Runtime.getRuntime ( ) . addShutdownHook ( new java.lang.Thread ( ) { @ java.lang.Override public void run ( ) { try { com.android.jack.test.toolchain.AbstractTestTools.deleteTempDir ( tmpDir ) ; } catch ( java.io.IOException e ) { java.lang.System.err.println ( e.getMessage ( ) ) ; } } } ) ; return tmpDir ; } catch ( java.lang.IllegalStateException e ) { throw new java.io.IOException ( e ) ; } }
Source:
private void performSystemPropertiesInjection ( com.android.manifmerger.XmlDocument xmlDocument ) { for ( com.android.manifmerger.ManifestMerger2.SystemProperty systemProperty : com.android.manifmerger.ManifestMerger2.SystemProperty.values ( ) ) { java.lang.String propertyOverride = mSystemPropertyResolver.getValue ( systemProperty ) ; if ( propertyOverride != null ) { systemProperty.addTo ( xmlDocument.getXml ( ) , propertyOverride ) ; } } }

Target:
private void performSystemPropertiesInjection ( com.android.manifmerger.MergingReport.Builder mergingReport , com.android.manifmerger.XmlDocument xmlDocument ) { for ( com.android.manifmerger.ManifestMerger2.SystemProperty systemProperty : com.android.manifmerger.ManifestMerger2.SystemProperty.values ( ) ) { java.lang.String propertyOverride = mSystemPropertyResolver.getValue ( systemProperty ) ; if ( propertyOverride != null ) { systemProperty.addTo ( mergingReport.getActionRecorder ( ) , xmlDocument , propertyOverride ) ; } } }
Source:
private void callbackUnavailableTest ( android.autofillservice.cts.CannedFillResponse response ) throws java.lang.Exception { enableService ( ) ; final android.autofillservice.cts.MyAutofillCallback callback = mActivity.registerCallback ( ) ; sReplier.addResponse ( response ) ; mActivity.mUsername.changeFocus ( true ) ; sReplier.getNextFillRequest ( ) ; sUiBot.assertNoDatasets ( ) ; callback.assertUiUnavailableEvent ( mActivity.mCustomView , mActivity.mUsername.text.id ) ; }

Target:
private void callbackUnavailableTest ( android.autofillservice.cts.CannedFillResponse response ) throws java.lang.Exception { enableService ( ) ; final android.autofillservice.cts.MyAutofillCallback callback = mActivity.registerCallback ( ) ; sReplier.addResponse ( response ) ; focusToUsername ( ) ; sReplier.getNextFillRequest ( ) ; sUiBot.assertNoDatasets ( ) ; callback.assertUiUnavailableEvent ( mActivity.mCustomView , mActivity.mUsername.text.id ) ; }
Source:
public int getLteAsuLevel ( ) { int lteAsuLevel = 99 ; int lteDbm = getLteDbm ( ) ; if ( lteDbm <= ( - 140 ) ) lteAsuLevel = 0 ; else if ( lteDbm >= ( - 43 ) ) lteAsuLevel = 97 ; else lteAsuLevel = lteDbm + 140 ; if ( android.telephony.SignalStrength.DBG ) android.telephony.SignalStrength.log ( ( "Lte Asu level: " + lteAsuLevel ) ) ; return lteAsuLevel ; }

Target:
public int getLteAsuLevel ( ) { int lteAsuLevel = 99 ; int lteDbm = getLteDbm ( ) ; if ( lteDbm == ( android.telephony.SignalStrength.INVALID ) ) lteAsuLevel = 255 ; else lteAsuLevel = lteDbm + 140 ; if ( android.telephony.SignalStrength.DBG ) android.telephony.SignalStrength.log ( ( "Lte Asu level: " + lteAsuLevel ) ) ; return lteAsuLevel ; }
Source:
public void copySelectionToClipboard ( org.eclipse.swt.dnd.Clipboard clipboard ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( ) ; for ( com.android.ddmuilib.logcat.LogCatMessage m : getSelectedLogCatMessages ( ) ) { sb.append ( m.toString ( ) ) ; sb.append ( '\n' ) ; } if ( ( sb.length ( ) ) > 0 ) { clipboard.setContents ( new java.lang.Object [ ] { sb.toString ( ) } , new org.eclipse.swt.dnd.Transfer [ ] { org.eclipse.swt.dnd.TextTransfer.getInstance ( ) } ) ; } }

Target:
public void copySelectionToClipboard ( org.eclipse.swt.dnd.Clipboard clipboard ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( ) ; for ( com.android.ddmlib.logcat.LogCatMessage m : getSelectedLogCatMessages ( ) ) { sb.append ( m.toString ( ) ) ; sb.append ( '\n' ) ; } if ( ( sb.length ( ) ) > 0 ) { clipboard.setContents ( new java.lang.Object [ ] { sb.toString ( ) } , new org.eclipse.swt.dnd.Transfer [ ] { org.eclipse.swt.dnd.TextTransfer.getInstance ( ) } ) ; } }
Source:
public void run ( ) { mBuilder = new android.app.AlertDialog.Builder ( mContext ) ; mBuilder.setPositiveButton ( R.string.year , mOnClickListener ) ; mDialog = mBuilder.show ( ) ; mButton = ( ( android.widget.Button ) ( mDialog.getWindow ( ) . findViewById ( R.id.button1 ) ) ) ; mButton.performClick ( ) ; }

Target:
public void run ( ) { mBuilder = new android.app.AlertDialog.Builder ( mContext ) ; mBuilder.setNeutralButton ( mTitle , mOnClickListener ) ; mDialog = mBuilder.show ( ) ; mButton = mDialog.getButton ( DialogInterface.BUTTON_NEUTRAL ) ; mButton.performClick ( ) ; }
Source:
public void testGetImei ( ) { java.lang.String imei = mTelephonyManager.getImei ( ) ; if ( ( ( mTelephonyManager.getSimState ( ) ) == ( android.telephony.TelephonyManager.SIM_STATE_ABSENT ) ) && ( imei == null ) ) { return ; } verifyImei ( imei , mTelephonyManager.getDeviceId ( ) ) ; }

Target:
public void testGetImeiForSlot ( ) { if ( ! ( mPackageManager.hasSystemFeature ( PackageManager.FEATURE_TELEPHONY ) ) ) { return ; } for ( int i = 0 ; i < ( mTelephonyManager.getPhoneCount ( ) ) ; i ++ ) { java.lang.String imei = mTelephonyManager.getImei ( i ) ; if ( ! ( android.text.TextUtils.isEmpty ( imei ) ) ) { android.telephony.cts.TelephonyManagerTest.assertImei ( imei ) ; } } mTelephonyManager.getImei ( ( - 1 ) ) ; mTelephonyManager.getImei ( mTelephonyManager.getPhoneCount ( ) ) ; }
Source:
private void addSpeakerOnAction ( android.app.Notification.Builder builder ) { com.android.dialer.common.LogUtil.d ( "StatusBarNotifier.addSpeakerOnAction" , "will show \"Speaker on\" action in the ongoing active call Notification" ) ; android.app.PendingIntent speakerOnPendingIntent = com.android.incallui.StatusBarNotifier.createNotificationPendingIntent ( context , com.android.incallui.NotificationBroadcastReceiver.ACTION_TURN_ON_SPEAKER ) ; builder.addAction ( new android.app.Notification.Action.Builder ( android.graphics.drawable.Icon.createWithResource ( context , R.drawable.quantum_ic_volume_up_white_24 ) , context.getText ( R.string.notification_action_speaker_on ) , speakerOnPendingIntent ) . build ( ) ) ; }

Target:
private void addSpeakerOnAction ( android.app.Notification.Builder builder ) { com.android.dialer.common.LogUtil.d ( "StatusBarNotifier.addSpeakerOnAction" , "will show \"Speaker on\" action in the ongoing active call Notification" ) ; android.app.PendingIntent speakerOnPendingIntent = com.android.incallui.StatusBarNotifier.createNotificationPendingIntent ( context , com.android.incallui.NotificationBroadcastReceiver.ACTION_TURN_ON_SPEAKER ) ; builder.addAction ( new android.app.Notification.Action.Builder ( android.graphics.drawable.Icon.createWithResource ( context , R.drawable.quantum_ic_volume_up_vd_theme_24 ) , context.getText ( R.string.notification_action_speaker_on ) , speakerOnPendingIntent ) . build ( ) ) ; }
Source:
public void testGetEmulatedCoreLibraryInvocationTarget_ignoreRenamed ( ) throws java.lang.Exception { com.google.devtools.build.android.desugar.CoreLibrarySupport support = new com.google.devtools.build.android.desugar.CoreLibrarySupport ( new com.google.devtools.build.android.desugar.CoreLibraryRewriter ( "" ) , java.lang.Thread.currentThread ( ) . getContextClassLoader ( ) , com.google.common.collect.ImmutableList.of ( "java/util/concurrent/" ) , com.google.common.collect.ImmutableList.of ( "java/util/Map" ) ) ; com.google.common.truth.Truth.assertThat ( support.getEmulatedCoreLibraryInvocationTarget ( Opcodes.INVOKEINTERFACE , "java/util/Map" , "getOrDefault" , "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;" , true ) ) . isEqualTo ( java.util.Map.class ) ; com.google.common.truth.Truth.assertThat ( support.getEmulatedCoreLibraryInvocationTarget ( Opcodes.INVOKEINTERFACE , "java/util/concurrent/ConcurrentMap" , "getOrDefault" , "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;" , true ) ) . isNull ( ) ; }

Target:
public void testGetCoreInterfaceRewritingTarget_ignoreRenamedInvokeInterface ( ) throws java.lang.Exception { com.google.devtools.build.android.desugar.CoreLibrarySupport support = new com.google.devtools.build.android.desugar.CoreLibrarySupport ( new com.google.devtools.build.android.desugar.CoreLibraryRewriter ( "" ) , java.lang.Thread.currentThread ( ) . getContextClassLoader ( ) , com.google.common.collect.ImmutableList.of ( "java/util/concurrent/" ) , com.google.common.collect.ImmutableList.of ( "java/util/Map" ) ) ; com.google.common.truth.Truth.assertThat ( support.getCoreInterfaceRewritingTarget ( Opcodes.INVOKEINTERFACE , "java/util/Map" , "getOrDefault" , "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;" , true ) ) . isEqualTo ( java.util.Map.class ) ; com.google.common.truth.Truth.assertThat ( support.getCoreInterfaceRewritingTarget ( Opcodes.INVOKEINTERFACE , "java/util/concurrent/ConcurrentMap" , "getOrDefault" , "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;" , true ) ) . isNull ( ) ; }
Source:
public com.android.ide.common.resources.ResourceFile getFile ( java.lang.String filename ) { if ( ( mFiles ) != null ) { for ( com.android.ide.common.resources.ResourceFile f : mFiles ) { if ( f.getFile ( ) . getName ( ) . equals ( filename ) ) { return f ; } } } return null ; }

Target:
private com.android.ide.common.resources.ResourceFile getFile ( com.android.io.IAbstractFile file , com.android.ide.common.resources.ScanningContext context ) { assert mFolder.equals ( file.getParentFolder ( ) ) ; if ( ( mNames ) != null ) { com.android.ide.common.resources.ResourceFile resFile = mNames.get ( file.getName ( ) ) ; if ( resFile != null ) { return resFile ; } } if ( file.exists ( ) ) { com.android.ide.common.resources.ResourceFile resFile = createResourceFile ( file ) ; resFile.load ( context ) ; addFile ( resFile ) ; return resFile ; } return null ; }
Source:
public com.intellij.updater.PatchAction merge ( com.intellij.updater.PatchAction other ) { if ( this . equals ( other ) ) { return this ; } com.intellij.updater.MultiAction multi = new com.intellij.updater.MultiAction ( myPatch , myPath , Digester.INVALID ) ; multi.addAction ( this ) ; multi.addAction ( other ) ; return multi ; }

Target:
public void buildPatchFile ( java.io.File olderDir , java.io.File newerDir , java.util.zip.ZipOutputStream patchOutput ) throws java.io.IOException { doBuildPatchFile ( getFile ( olderDir ) , getFile ( newerDir ) , patchOutput ) ; }
Source:
private void init ( ) { mSendReceiver.reset ( ) ; mDeliveryReceiver.reset ( ) ; mSentIntent = android.app.PendingIntent.getBroadcast ( getContext ( ) , 0 , mSendIntent , PendingIntent.FLAG_ONE_SHOT ) ; mDeliveredIntent = android.app.PendingIntent.getBroadcast ( getContext ( ) , 0 , mDeliveryIntent , PendingIntent.FLAG_ONE_SHOT ) ; }

Target:
private void init ( ) { mSendReceiver.reset ( ) ; mDeliveryReceiver.reset ( ) ; mDataSmsReceiver.reset ( ) ; android.telephony.cts.SmsManagerTest.mReceivedDataSms = false ; mSentIntent = android.app.PendingIntent.getBroadcast ( getContext ( ) , 0 , mSendIntent , PendingIntent.FLAG_ONE_SHOT ) ; mDeliveredIntent = android.app.PendingIntent.getBroadcast ( getContext ( ) , 0 , mDeliveryIntent , PendingIntent.FLAG_ONE_SHOT ) ; }
Source:
private void updateLocalMediaPath ( java.io.File mediaFolder ) throws com.android.tradefed.targetprep.TargetSetupError { java.lang.String [ ] subDirs = mediaFolder.list ( ) ; if ( ( subDirs.length ) != 1 ) { throw new com.android.tradefed.targetprep.TargetSetupError ( java.lang.String.format ( "Unexpected contents in directory %s" , mLocalMediaPath ) ) ; } java.io.File newMediaFolder = new java.io.File ( mediaFolder , subDirs [ 0 ] ) ; mLocalMediaPath = newMediaFolder.toString ( ) ; }

Target:
private void updateLocalMediaPath ( java.io.File mediaFolder ) throws com.android.tradefed.targetprep.TargetSetupError { java.lang.String [ ] subDirs = mediaFolder.list ( ) ; if ( ( subDirs.length ) != 1 ) { throw new com.android.tradefed.targetprep.TargetSetupError ( java.lang.String.format ( "Unexpected contents in directory %s" , mediaFolder.getAbsolutePath ( ) ) ) ; } mLocalMediaPath = new java.io.File ( mediaFolder , subDirs [ 0 ] ) . getAbsolutePath ( ) ; }
Source:
public void testIsIdle_onEmptyPool ( ) throws java.lang.Exception { assertTrue ( monitor.isIdleNow ( ) ) ; final java.util.concurrent.atomic.AtomicBoolean isIdle = new java.util.concurrent.atomic.AtomicBoolean ( false ) ; monitor.notifyWhenIdle ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { isIdle.set ( true ) ; } } ) ; assertTrue ( isIdle.get ( ) ) ; }

Target:
public void isIdle_onEmptyPool ( ) throws java.lang.Exception { org.junit.Assert.assertTrue ( monitor.isIdleNow ( ) ) ; final java.util.concurrent.atomic.AtomicBoolean isIdle = new java.util.concurrent.atomic.AtomicBoolean ( false ) ; monitor.notifyWhenIdle ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { isIdle.set ( true ) ; } } ) ; org.junit.Assert.assertTrue ( isIdle.get ( ) ) ; }
Source:
public void testCaCertificateAddedDetected ( ) { com.android.server.wifi.WifiConfigurationUtilTest.EnterpriseConfig eapConfigNoCerts = new com.android.server.wifi.WifiConfigurationUtilTest.EnterpriseConfig ( WifiEnterpriseConfig.Eap.TTLS ) . setPhase2 ( WifiEnterpriseConfig.Phase2.MSCHAPV2 ) . setIdentity ( "username" , "password" ) ; com.android.server.wifi.WifiConfigurationUtilTest.EnterpriseConfig eapConfig1Cert = new com.android.server.wifi.WifiConfigurationUtilTest.EnterpriseConfig ( WifiEnterpriseConfig.Eap.TTLS ) . setPhase2 ( WifiEnterpriseConfig.Phase2.MSCHAPV2 ) . setIdentity ( "username" , "password" ) . setCaCerts ( new java.security.cert.X509Certificate [ ] { android.net.wifi.FakeKeys.CA_CERT0 } ) ; assertTrue ( com.android.server.wifi.WifiConfigurationUtil.hasEnterpriseConfigChanged ( eapConfigNoCerts.enterpriseConfig , eapConfig1Cert.enterpriseConfig ) ) ; }

Target:
public void testCaCertificateAddedDetected ( ) { com.android.server.wifi.WifiConfigurationUtilTest.EnterpriseConfig eapConfigNoCerts = new com.android.server.wifi.WifiConfigurationUtilTest.EnterpriseConfig ( WifiEnterpriseConfig.Eap.TTLS ) . setPhase2 ( WifiEnterpriseConfig.Phase2.MSCHAPV2 ) . setIdentity ( "username" , "password" ) ; com.android.server.wifi.WifiConfigurationUtilTest.EnterpriseConfig eapConfig1Cert = new com.android.server.wifi.WifiConfigurationUtilTest.EnterpriseConfig ( WifiEnterpriseConfig.Eap.TTLS ) . setPhase2 ( WifiEnterpriseConfig.Phase2.MSCHAPV2 ) . setIdentity ( "username" , "password" ) . setCaCerts ( new java.security.cert.X509Certificate [ ] { FakeKeys.CA_CERT0 } ) ; assertTrue ( com.android.server.wifi.WifiConfigurationUtil.hasEnterpriseConfigChanged ( eapConfigNoCerts.enterpriseConfig , eapConfig1Cert.enterpriseConfig ) ) ; }
Source:
private static java.lang.String readPassword ( java.io.File keyFile ) { java.lang.System.out.print ( ( ( "Enter password for " + keyFile ) + " (password will not be hidden): " ) ) ; java.lang.System.out.flush ( ) ; java.io.BufferedReader stdin = new java.io.BufferedReader ( new java.io.InputStreamReader ( java.lang.System.in ) ) ; try { return stdin.readLine ( ) ; } catch ( java.io.IOException ex ) { return null ; } }

Target:
private static java.lang.String readPassword ( java.io.File keyFile ) { java.io.Console console ; char [ ] pwd ; if ( ( ( console = java.lang.System.console ( ) ) != null ) && ( ( pwd = console.readPassword ( "[%s]" , ( "Enter password for " + keyFile ) ) ) != null ) ) { return java.lang.String.valueOf ( pwd ) ; } else { return null ; } }
Source:
private void selectSingle ( com.android.ide.eclipse.adt.internal.editors.layout.gle2.CanvasViewInfo vi ) { mAltSelection = null ; if ( ( mSelections.size ( ) ) > 0 ) { if ( ( ( mSelections.size ( ) ) == 1 ) && ( ( mSelections.getFirst ( ) . getViewInfo ( ) ) == vi ) ) { return ; } mSelections.clear ( ) ; } if ( vi != null ) { mSelections.add ( new com.android.ide.eclipse.adt.internal.editors.layout.gle2.CanvasSelection ( vi , mRulesEngine , mNodeFactory ) ) ; } redraw ( ) ; }

Target:
private void selectSingle ( com.android.ide.eclipse.adt.internal.editors.layout.gle2.CanvasViewInfo vi ) { mAltSelection = null ; if ( ( mSelections.size ( ) ) > 0 ) { if ( ( ( mSelections.size ( ) ) == 1 ) && ( ( mSelections.getFirst ( ) . getViewInfo ( ) ) == vi ) ) { return ; } mSelections.clear ( ) ; } if ( vi != null ) { mSelections.add ( new com.android.ide.eclipse.adt.internal.editors.layout.gle2.CanvasSelection ( vi , mRulesEngine , mNodeFactory ) ) ; } updateOulineSelection ( ) ; redraw ( ) ; }
Source:
void startCleaningPackages ( ) { synchronized ( mPackages ) { if ( ! ( isExternalMediaAvailable ( ) ) ) { return ; } if ( ( mSettings.mPackagesToBeCleaned.size ( ) ) <= 0 ) { return ; } } android.content.Intent intent = new android.content.Intent ( android.content.pm.PackageManager.ACTION_CLEAN_EXTERNAL_STORAGE ) ; intent.setComponent ( com.android.server.pm.PackageManagerService.DEFAULT_CONTAINER_COMPONENT ) ; android.app.IActivityManager am = android.app.ActivityManagerNative.getDefault ( ) ; if ( am != null ) { try { am.startService ( null , intent , null ) ; } catch ( android.os.RemoteException e ) { } } }

Target:
private void killApplication ( java.lang.String pkgName , int appId , java.lang.String reason ) { android.app.IActivityManager am = android.app.ActivityManagerNative.getDefault ( ) ; if ( am != null ) { try { am.killApplicationWithAppId ( pkgName , appId , reason ) ; } catch ( android.os.RemoteException e ) { } } }
Source:
public long getVtDataUsage ( ) { mApp.enforceCallingOrSelfPermission ( android.Manifest.permission.READ_NETWORK_USAGE_HISTORY , null ) ; final com.android.internal.telephony.Phone [ ] phones = com.android.internal.telephony.PhoneFactory.getPhones ( ) ; long total = 0 ; for ( com.android.internal.telephony.Phone phone : phones ) { total += phone.getVtDataUsage ( ) ; } return total ; }

Target:
public android.net.NetworkStats getVtDataUsage ( int subId , boolean perUidStats ) { mApp.enforceCallingOrSelfPermission ( android.Manifest.permission.READ_NETWORK_USAGE_HISTORY , null ) ; com.android.internal.telephony.Phone phone = getPhone ( subId ) ; if ( phone != null ) { return phone.getVtDataUsage ( perUidStats ) ; } return null ; }
Source:
private void editSmsMessageItem ( com.android.mms.ui.MessageItem msgItem ) { synchronized ( mConversation ) { if ( ( mConversation.getMessageCount ( ) ) <= 1 ) { mConversation.clearThreadId ( ) ; } } android.net.Uri uri = android.content.ContentUris.withAppendedId ( Sms.CONTENT_URI , msgItem.mMsgId ) ; android.database.sqlite.SqliteWrapper.delete ( this , mContentResolver , uri , null , null ) ; mWorkingMessage.setText ( msgItem.mBody ) ; }

Target:
private void editSmsMessageItem ( com.android.mms.ui.MessageItem msgItem ) { synchronized ( mConversation ) { if ( ( mConversation.getMessageCount ( ) ) <= 1 ) { mConversation.clearThreadId ( ) ; com.android.mms.transaction.MessagingNotification.setCurrentlyDisplayedThreadId ( MessagingNotification.THREAD_NONE ) ; } } android.net.Uri uri = android.content.ContentUris.withAppendedId ( Sms.CONTENT_URI , msgItem.mMsgId ) ; android.database.sqlite.SqliteWrapper.delete ( this , mContentResolver , uri , null , null ) ; mWorkingMessage.setText ( msgItem.mBody ) ; }
Source:
public void testPressImeActionButtonOnNonEditorWidget ( ) { try { android.support.test.espresso.Espresso.onView ( android.support.test.espresso.matcher.ViewMatchers.withId ( R.id.send_button ) ) . perform ( android.support.test.espresso.action.ViewActions.pressImeActionButton ( ) ) ; fail ( "Expected exception on previous call" ) ; } catch ( android.support.test.espresso.PerformException expected ) { assertTrue ( ( ( expected.getCause ( ) ) instanceof java.lang.IllegalStateException ) ) ; } }

Target:
protected boolean matchesSafely ( java.lang.Throwable throwable ) { return throwable instanceof java.lang.IllegalStateException ; }
Source:
public static long compareUnsignedLong ( long a , long b ) { long aFirstFourBits = a > > > 60 ; long bFirstFourBits = b > > > 60 ; long firstFourBitsDiff = aFirstFourBits - bFirstFourBits ; if ( firstFourBitsDiff != 0 ) { return firstFourBitsDiff ; } long aRest = a & 1152921504606846975L ; long bRest = b & 1152921504606846975L ; return aRest - bRest ; }

Target:
public static void genRandomBytes ( long seed , byte [ ] array , boolean signed , int numberOfBits ) { long [ ] longs = new long [ array.length ] ; android.renderscript.cts.RSUtils.genRandomLongs ( seed , longs , signed , numberOfBits ) ; for ( int i = 0 ; i < ( array.length ) ; i ++ ) { array [ i ] = ( ( byte ) ( longs [ i ] ) ) ; } }
Source:
private void maybeShowManageConferenceCallButton ( ) { if ( ( mPrimary ) == null ) { getUi ( ) . showManageConferenceCallButton ( false ) ; return ; } final boolean canManageConference = mPrimary.can ( PhoneCapabilities.MANAGE_CONFERENCE ) ; getUi ( ) . showManageConferenceCallButton ( ( ( mPrimary.isConferenceCall ( ) ) && canManageConference ) ) ; }

Target:
private boolean shouldShowManageConference ( ) { if ( ( mPrimary ) == null ) { return false ; } return mPrimary.can ( PhoneCapabilities.MANAGE_CONFERENCE ) ; }
Source:
public android.net.NetworkCapabilities addTransportType ( int transportType ) { android.net.NetworkCapabilities.checkValidTransportType ( transportType ) ; mTransportTypes |= 1 << transportType ; setNetworkSpecifier ( mNetworkSpecifier ) ; return this ; }

Target:
public android.net.NetworkCapabilities addTransportType ( int transportType ) { if ( ( transportType < ( android.net.NetworkCapabilities.MIN_TRANSPORT ) ) || ( transportType > ( android.net.NetworkCapabilities.MAX_TRANSPORT ) ) ) { throw new java.lang.IllegalArgumentException ( "TransportType out of range" ) ; } mTransportTypes |= 1 << transportType ; setNetworkSpecifier ( mNetworkSpecifier ) ; return this ; }
Source:
public void test_getDisplayNameZI ( ) { java.util.Locale.setDefault ( java.util.Locale.US ) ; java.util.TimeZone tz = java.util.TimeZone.getTimeZone ( "America/Los_Angeles" ) ; assertEquals ( "PST" , tz.getDisplayName ( false , 0 ) ) ; assertEquals ( "Pacific Daylight Time" , tz.getDisplayName ( true , 1 ) ) ; assertEquals ( "Pacific Standard Time" , tz.getDisplayName ( false , 1 ) ) ; }

Target:
public void test_getDisplayNameZI ( ) { java.util.Locale.setDefault ( java.util.Locale.US ) ; java.util.TimeZone tz = java.util.TimeZone.getTimeZone ( "America/Los_Angeles" ) ; assertEquals ( "PST" , tz.getDisplayName ( false , java.util.TimeZone.SHORT ) ) ; assertEquals ( "Pacific Daylight Time" , tz.getDisplayName ( true , java.util.TimeZone.LONG ) ) ; assertEquals ( "Pacific Standard Time" , tz.getDisplayName ( false , java.util.TimeZone.LONG ) ) ; }
Source:
public void enter ( ) { mNetworkInfo.setIsAvailable ( true ) ; if ( ( mNetworkAgent ) != null ) mNetworkAgent.sendNetworkInfo ( mNetworkInfo ) ; int defaultInterval = mContext.getResources ( ) . getInteger ( R.integer.config_wifi_supplicant_scan_interval ) ; mSupplicantScanIntervalMs = Settings.Global.getLong ( mContext.getContentResolver ( ) , Settings.Global.WIFI_SUPPLICANT_SCAN_INTERVAL_MS , defaultInterval ) ; mWifiNative.setScanInterval ( ( ( ( int ) ( mSupplicantScanIntervalMs ) ) / 1000 ) ) ; mWifiNative.setExternalSim ( true ) ; setRandomMacOui ( ) ; mWifiNative.enableAutoConnect ( false ) ; }

Target:
public void enter ( ) { setWifiState ( android.net.wifi.WifiManager.WIFI_STATE_ENABLED ) ; mNetworkInfo.setIsAvailable ( true ) ; if ( ( mNetworkAgent ) != null ) mNetworkAgent.sendNetworkInfo ( mNetworkInfo ) ; setNetworkDetailedState ( DetailedState.DISCONNECTED ) ; mWifiConnectivityManager.setWifiEnabled ( true ) ; mWifiMetrics.setWifiState ( WifiMetricsProto.WifiLog.WIFI_DISCONNECTED ) ; }
Source:
public void testI18n ( ) throws java.lang.Exception { assertFalse ( mKeyStore.put ( android.security.KeyStoreTest.TEST_I18N_KEY , android.security.KeyStoreTest.TEST_I18N_VALUE , KeyStore.UID_SELF , KeyStore.FLAG_ENCRYPTED ) ) ; assertFalse ( mKeyStore.contains ( android.security.KeyStoreTest.TEST_I18N_KEY ) ) ; mKeyStore.password ( android.security.KeyStoreTest.TEST_I18N_KEY ) ; assertTrue ( mKeyStore.put ( android.security.KeyStoreTest.TEST_I18N_KEY , android.security.KeyStoreTest.TEST_I18N_VALUE , KeyStore.UID_SELF , KeyStore.FLAG_ENCRYPTED ) ) ; assertTrue ( mKeyStore.contains ( android.security.KeyStoreTest.TEST_I18N_KEY ) ) ; }

Target:
public void testI18n ( ) throws java.lang.Exception { assertFalse ( mKeyStore.put ( android.security.KeyStoreTest.TEST_I18N_KEY , android.security.KeyStoreTest.TEST_I18N_VALUE , KeyStore.UID_SELF , KeyStore.FLAG_ENCRYPTED ) ) ; assertFalse ( mKeyStore.contains ( android.security.KeyStoreTest.TEST_I18N_KEY ) ) ; mKeyStore.onUserPasswordChanged ( android.security.KeyStoreTest.TEST_I18N_KEY ) ; assertTrue ( mKeyStore.put ( android.security.KeyStoreTest.TEST_I18N_KEY , android.security.KeyStoreTest.TEST_I18N_VALUE , KeyStore.UID_SELF , KeyStore.FLAG_ENCRYPTED ) ) ; assertTrue ( mKeyStore.contains ( android.security.KeyStoreTest.TEST_I18N_KEY ) ) ; }
Source:
public java.lang.String getRegexEquivalent ( ) { if ( ( strings.size ( ) ) == 0 ) { return toString ( ) ; } java.lang.StringBuffer result = new java.lang.StringBuffer ( "(?:" ) ; _generatePattern ( result , true , false ) ; for ( java.lang.String s : strings ) { result.append ( '|' ) ; com.ibm.icu.text.UnicodeSet._appendToPat ( result , s , true ) ; } return result.append ( ")" ) . toString ( ) ; }

Target:
public java.lang.String getRegexEquivalent ( ) { if ( ( strings.size ( ) ) == 0 ) { return toString ( ) ; } java.lang.StringBuilder result = new java.lang.StringBuilder ( "(?:" ) ; appendNewPattern ( result , true , false ) ; for ( java.lang.String s : strings ) { result.append ( '|' ) ; com.ibm.icu.text.UnicodeSet._appendToPat ( result , s , true ) ; } return result.append ( ")" ) . toString ( ) ; }
Source:
private void assertUidTotal ( android.net.NetworkTemplate template , int uid , long rxBytes , long rxPackets , long txBytes , long txPackets , int operations ) throws java.lang.Exception { assertUidTotal ( template , uid , android.net.NetworkStats.SET_ALL , android.net.NetworkStats.ROAMING_ALL , rxBytes , rxPackets , txBytes , txPackets , operations ) ; }

Target:
private void assertUidTotal ( android.net.NetworkTemplate template , int uid , long rxBytes , long rxPackets , long txBytes , long txPackets , int operations ) throws java.lang.Exception { assertUidTotal ( template , uid , android.net.NetworkStats.SET_ALL , android.net.NetworkStats.METERED_ALL , android.net.NetworkStats.ROAMING_ALL , rxBytes , rxPackets , txBytes , txPackets , operations ) ; }
Source:
public boolean setActiveUser ( java.lang.String userEmail ) { synchronized ( this ) { if ( ! ( allUsers.containsKey ( userEmail ) ) ) { return false ; } if ( ( activeUser ) != null ) { activeUser.setActive ( false ) ; } activeUser = allUsers.get ( userEmail ) ; activeUser.setActive ( true ) ; return true ; } }

Target:
public void setActiveUser ( @ org.jetbrains.annotations.NotNull java.lang.String userEmail ) throws java.lang.IllegalArgumentException { synchronized ( this ) { if ( ! ( allUsers.containsKey ( userEmail ) ) ) { throw new java.lang.IllegalArgumentException ( ( userEmail + " is not a logged in user." ) ) ; } if ( ( activeUser ) != null ) { activeUser.setActive ( false ) ; } activeUser = allUsers.get ( userEmail ) ; activeUser.setActive ( true ) ; com.google.gct.login.GoogleLoginPrefs.saveActiveUser ( userEmail ) ; } }
Source:
public void testOnSetUpCoverageDisabled ( ) throws java.lang.Exception { doReturn ( "UnknowFlaver" ) . when ( mDevice ) . getBuildFlavor ( ) ; doReturn ( "None" ) . when ( mDevice ) . getProperty ( GCOV_PROPERTY ) ; mPreparer.setUp ( mDevice , mBuildInfo ) ; verify ( mBuildInfo , never ( ) ) . setFile ( anyObject ( ) , anyObject ( ) , anyObject ( ) ) ; }

Target:
public void testOnSetUpCoverageDisabled ( ) throws java.lang.Exception { org.mockito.Mockito.doReturn ( "UnknowFlaver" ) . when ( mDevice ) . getBuildFlavor ( ) ; org.mockito.Mockito.doReturn ( "None" ) . when ( mDevice ) . getProperty ( GCOV_PROPERTY ) ; mPreparer.setUp ( mDevice , mBuildInfo ) ; org.mockito.Mockito.verify ( mBuildInfo , org.mockito.Mockito.never ( ) ) . setFile ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
private void handleAddedCall ( com.android.server.telecom.ConnectionServiceFocusManager.CallFocus call ) { if ( ! ( mCalls.contains ( call ) ) ) { mCalls.add ( call ) ; } if ( java.util.Objects.equals ( mCurrentFocus , call.getConnectionServiceWrapper ( ) ) ) { updateCurrentFocusCall ( ) ; } }

Target:
private void handleAddedCall ( com.android.server.telecom.ConnectionServiceFocusManager.CallFocus call ) { android.telecom.Log.d ( this , "handleAddedCall %s" , call ) ; if ( ! ( mCalls.contains ( call ) ) ) { mCalls.add ( call ) ; } if ( java.util.Objects.equals ( mCurrentFocus , call.getConnectionServiceWrapper ( ) ) ) { updateCurrentFocusCall ( ) ; } }
Source:
public static ClassPair get ( ) { java.lang.Class < ? > helper1_class = Helper1.class ; java.lang.Class < ? > test_class = Test.class ; try { java.lang.ClassLoader loader = helper1_class.getClassLoader ( ) ; java.lang.reflect.Method reportAfterLoading = loader.getClass ( ) . getDeclaredMethod ( "reportAfterLoading" ) ; reportAfterLoading.invoke ( loader ) ; } catch ( java.lang.Throwable t ) { t.printStackTrace ( ) ; } return new ClassPair ( helper1_class , test_class ) ; }

Target:
public static ClassPair get ( ) { java.lang.Class < ? > helper1_class = Helper1.class ; java.lang.Class < ? > test_class = Test.class ; try { java.lang.ClassLoader loader = helper1_class.getClassLoader ( ) ; java.lang.reflect.Method reportAfterLoading = loader.getClass ( ) . getDeclaredMethod ( "reportAfterLoading" ) ; reportAfterLoading.invoke ( loader ) ; } catch ( java.lang.Throwable t ) { t.printStackTrace ( java.lang.System.out ) ; } return new ClassPair ( helper1_class , test_class ) ; }
Source:
public com.android.internal.telephony.TimeZoneLookupHelper.CountryResult lookupByCountry ( java.lang.String isoCountryCode , long whenMillis ) { libcore.util.CountryTimeZones countryTimeZones = libcore.util.TimeZoneFinder.getInstance ( ) . lookupCountryTimeZones ( isoCountryCode ) ; if ( countryTimeZones == null ) { return null ; } if ( ( countryTimeZones.getDefaultTimeZoneId ( ) ) == null ) { return null ; } return new com.android.internal.telephony.TimeZoneLookupHelper.CountryResult ( countryTimeZones.getDefaultTimeZoneId ( ) , countryTimeZones.isDefaultOkForCountryTimeZoneDetection ( whenMillis ) , whenMillis ) ; }

Target:
public com.android.internal.telephony.TimeZoneLookupHelper.CountryResult lookupByCountry ( java.lang.String isoCountryCode , long whenMillis ) { libcore.util.CountryTimeZones countryTimeZones = getCountryTimeZones ( isoCountryCode ) ; if ( countryTimeZones == null ) { return null ; } if ( ( countryTimeZones.getDefaultTimeZoneId ( ) ) == null ) { return null ; } return new com.android.internal.telephony.TimeZoneLookupHelper.CountryResult ( countryTimeZones.getDefaultTimeZoneId ( ) , countryTimeZones.isDefaultOkForCountryTimeZoneDetection ( whenMillis ) , whenMillis ) ; }
Source:
public com.android.server.wifi.hotspot2.PasspointMatch match ( java.util.Map < com.android.server.wifi.hotspot2.anqp.Constants.ANQPElementType , com.android.server.wifi.hotspot2.anqp.ANQPElement > anqpElements ) { return PasspointMatch.None ; }

Target:
public com.android.server.wifi.hotspot2.PasspointMatch match ( java.util.Map < com.android.server.wifi.hotspot2.anqp.Constants.ANQPElementType , com.android.server.wifi.hotspot2.anqp.ANQPElement > anqpElements ) { com.android.server.wifi.hotspot2.PasspointMatch providerMatch = matchProvider ( anqpElements ) ; int authMatch = com.android.server.wifi.hotspot2.ANQPMatcher.matchNAIRealm ( ( ( com.android.server.wifi.hotspot2.anqp.NAIRealmElement ) ( anqpElements.get ( ANQPElementType.ANQPNAIRealm ) ) ) , mConfig.credential.realm , mEAPMethodID , mAuthParam ) ; if ( authMatch == ( AuthMatch.NONE ) ) { return PasspointMatch.None ; } if ( ( authMatch & ( AuthMatch.REALM ) ) == 0 ) { return providerMatch ; } return providerMatch == ( PasspointMatch.None ) ? PasspointMatch.RoamingProvider : providerMatch ; }
Source:
public void timeIcuBreakIterator ( int nreps ) { for ( int i = 0 ; i < nreps ; ++ i ) { java.text.BreakIterator it = java.text.com.android.ibm.icu.text.BreakIterator.getLineInstance ( text.locale ) ; it.setText ( text.text ) ; while ( ( it.next ( ) ) != java.text.com.android.ibm.icu.text.BreakIterator ) { } } }

Target:
public void timeIcuBreakIterator ( int nreps ) { for ( int i = 0 ; i < nreps ; ++ i ) { java.text.BreakIterator it = android.icu.text.BreakIterator.getLineInstance ( text.locale ) ; it.setText ( text.text ) ; while ( ( it.next ( ) ) != ( java.text.BreakIterator.DONE ) ) { } } }
Source:
private void setString ( int offset , int maxLength , java.lang.String theString ) { byte [ ] stringBytes = theString.getBytes ( Charsets.ISO_8859_1 ) ; int length = java.lang.Math.min ( stringBytes.length , maxLength ) ; java.lang.System.arraycopy ( stringBytes , 0 , buffer , offset , length ) ; buffer [ ( offset + length ) ] = 0 ; }

Target:
private void setString ( int offset , int maxLength , java.lang.String theString ) { byte [ ] stringBytes = theString.getBytes ( java.nio.charset.StandardCharsets.ISO_8859_1 ) ; int length = java.lang.Math.min ( stringBytes.length , maxLength ) ; java.lang.System.arraycopy ( stringBytes , 0 , buffer , offset , length ) ; buffer [ ( offset + length ) ] = 0 ; }
Source:
private java.lang.String formatNsn ( java.lang.String number , com.google.i18n.phonenumbers.Phonemetadata.PhoneMetadata metadata , com.google.i18n.phonenumbers.PhoneNumberUtil.PhoneNumberFormat numberFormat , java.lang.String carrierCode ) { java.util.List < com.google.i18n.phonenumbers.Phonemetadata.NumberFormat > intlNumberFormats = metadata.intlNumberFormats ( ) ; java.util.List < com.google.i18n.phonenumbers.Phonemetadata.NumberFormat > availableFormats = ( ( ( intlNumberFormats.size ( ) ) == 0 ) || ( numberFormat == ( com.google.i18n.phonenumbers.PhoneNumberUtil.PhoneNumberFormat.NATIONAL ) ) ) ? metadata.numberFormats ( ) : metadata.intlNumberFormats ( ) ; com.google.i18n.phonenumbers.Phonemetadata.NumberFormat formattingPattern = chooseFormattingPatternForNumber ( availableFormats , number ) ; return formattingPattern == null ? number : formatNsnUsingPattern ( number , formattingPattern , numberFormat , carrierCode ) ; }

Target:
private java.lang.String formatNsn ( java.lang.String number , com.google.i18n.phonenumbers.nano.Phonemetadata.PhoneMetadata metadata , com.google.i18n.phonenumbers.PhoneNumberUtil.PhoneNumberFormat numberFormat ) { return formatNsn ( number , metadata , numberFormat , null ) ; }
Source:
public static synchronized com.android.bluetooth.btservice.AdapterService getAdapterService ( ) { if ( ( ( com.android.bluetooth.btservice.AdapterService.sAdapterService ) != null ) && ( ! ( com.android.bluetooth.btservice.AdapterService.sAdapterService.mCleaningUp ) ) ) { android.util.Log.d ( com.android.bluetooth.btservice.AdapterService.TAG , ( "getAdapterService() - returning " + ( com.android.bluetooth.btservice.AdapterService.sAdapterService ) ) ) ; return com.android.bluetooth.btservice.AdapterService.sAdapterService ; } if ( com.android.bluetooth.btservice.AdapterService.DBG ) { if ( ( com.android.bluetooth.btservice.AdapterService.sAdapterService ) == null ) { android.util.Log.d ( com.android.bluetooth.btservice.AdapterService.TAG , "getAdapterService() - Service not available" ) ; } else if ( com.android.bluetooth.btservice.AdapterService.sAdapterService.mCleaningUp ) { android.util.Log.d ( com.android.bluetooth.btservice.AdapterService.TAG , "getAdapterService() - Service is cleaning up" ) ; } } return null ; }

Target:
private static synchronized void setAdapterService ( com.android.bluetooth.btservice.AdapterService instance ) { android.util.Log.d ( com.android.bluetooth.btservice.AdapterService.TAG , ( "setAdapterService() - trying to set service to " + instance ) ) ; if ( instance == null ) { return ; } com.android.bluetooth.btservice.AdapterService.sAdapterService = instance ; }
Source:
public void flush ( ) throws java.io.IOException { if ( syncFlush ) { int byteCount ; while ( ( byteCount = def.deflate ( buf , 0 , buf.length , java.util.zip.Deflater.SYNC_FLUSH ) ) != 0 ) { out.write ( buf , 0 , byteCount ) ; } } out.flush ( ) ; }

Target:
public void flush ( ) throws java.io.IOException { if ( ( syncFlush ) && ( ! ( done ) ) ) { int byteCount ; while ( ( byteCount = def.deflate ( buf , 0 , buf.length , java.util.zip.Deflater.SYNC_FLUSH ) ) != 0 ) { out.write ( buf , 0 , byteCount ) ; } } out.flush ( ) ; }
Source:
private void continueTest ( ) { new com.android.cts.verifier.jobscheduler.ChargingConstraintTestActivity.TestDevicePluggedInConstraint ( ) . execute ( ) ; }

Target:
private void showWaitingForStableChargingViews ( ) { mWaitingForChargingProgressBar.start ( com.android.cts.verifier.jobscheduler.ChargingConstraintTestActivity.WAIT_FOR_CHARGING_DURATION , 1000 , new com.android.cts.verifier.TimerProgressBar.TimerExpiredCallback ( ) { @ java.lang.Override public void onTimerExpired ( ) { mProblemWithChargerTextView.setVisibility ( View.VISIBLE ) ; } } ) ; mWaitingForChargingProgressBar.setVisibility ( View.VISIBLE ) ; mWaitingForChargingTextView.setVisibility ( View.VISIBLE ) ; mProblemWithChargerTextView.setVisibility ( View.GONE ) ; }
Source:
private boolean elementCanHaveChildren ( java.lang.Object descriptor ) { if ( descriptor instanceof com.android.ide.eclipse.adt.internal.editors.descriptors.ElementDescriptor ) { com.android.ide.eclipse.adt.internal.editors.descriptors.ElementDescriptor desc = ( ( com.android.ide.eclipse.adt.internal.editors.descriptors.ElementDescriptor ) ( descriptor ) ) ; if ( desc.hasChildren ( ) ) { return true ; } for ( com.android.ide.eclipse.adt.internal.editors.descriptors.AttributeDescriptor attr_desc : desc.getAttributes ( ) ) { if ( attr_desc instanceof com.android.ide.eclipse.adt.internal.editors.descriptors.TextValueDescriptor ) { return true ; } } } return false ; }

Target:
private boolean elementCanHaveChildren ( java.lang.Object descriptor ) { if ( descriptor instanceof com.android.ide.eclipse.adt.internal.editors.descriptors.ElementDescriptor ) { com.android.ide.eclipse.adt.internal.editors.descriptors.ElementDescriptor desc = ( ( com.android.ide.eclipse.adt.internal.editors.descriptors.ElementDescriptor ) ( descriptor ) ) ; if ( desc.hasChildren ( ) ) { return true ; } for ( com.android.ide.eclipse.adt.internal.editors.descriptors.AttributeDescriptor attrDesc : desc.getAttributes ( ) ) { if ( attrDesc instanceof com.android.ide.eclipse.adt.internal.editors.descriptors.TextValueDescriptor ) { return true ; } } } return false ; }
Source:
private static boolean isSpnMatched ( android.content.Context context ) { try { java.lang.String spnResource = context.getResources ( ) . getString ( R.string.motorola_enabled_spn ) ; return spnResource.equalsIgnoreCase ( context.getSystemService ( android.telephony.TelephonyManager.class ) . getSimOperatorName ( ) ) ; } catch ( android.content.res.Resources exception ) { return true ; } }

Target:
private static boolean isSpnMatched ( android.content.Context context ) { try { for ( java.lang.String spnResource : context.getResources ( ) . getStringArray ( R.array.motorola_enabled_spn ) ) { if ( spnResource.equalsIgnoreCase ( context.getSystemService ( android.telephony.TelephonyManager.class ) . getSimOperatorName ( ) ) ) { return true ; } } return false ; } catch ( android.content.res.Resources exception ) { return true ; } }