auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testCharSequenceCreator ( ) { android.os.Parcel p = android.os.Parcel.obtain ( ) ; android.text.TextUtils.writeToParcel ( null , p , 0 ) ; java.lang.CharSequence text = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel ( p ) ; assertNull ( "null CharSequence should generate null from parcel" , text ) ; p = android.os.Parcel.obtain ( ) ; android.text.TextUtils.writeToParcel ( "test" , p , 0 ) ; text = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel ( p ) ; assertEquals ( "conversion to/from parcel failed" , "test" , text ) ; }

Target:
public void testCharSequenceCreator ( ) { android.os.Parcel p = android.os.Parcel.obtain ( ) ; android.text.TextUtils.writeToParcel ( null , p , 0 ) ; java.lang.CharSequence text = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel ( p ) ; assertNull ( "null CharSequence should generate null from parcel" , text ) ; p = android.os.Parcel.obtain ( ) ; android.text.TextUtils.writeToParcel ( "test" , p , 0 ) ; p.setDataPosition ( 0 ) ; text = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel ( p ) ; assertEquals ( "conversion to/from parcel failed" , "test" , text ) ; }
Source:
public void checkValue ( @ javax.annotation.Nonnull com.android.sched.util.codec.CodecContext context , @ javax.annotation.Nonnull com.android.sched.util.config.DefaultFactory < T > factory ) throws com.android.sched.util.codec.CheckingException { if ( ! ( checkClass ( factory.getInstanciatedClass ( ) ) ) ) { throw new com.android.sched.util.codec.CheckingException ( ( ( ( ( "The value must be a DefaultFactory<{" + ( com.google.common.base.Joiner.on ( ',' ) . join ( com.android.sched.util.codec.DefaultFactorySelector.getClasses ( ) ) ) ) + "}> but is a DefaultFactory<" ) + ( factory.getInstanciatedClass ( ) . getCanonicalName ( ) ) ) + ">" ) ) ; } }

Target:
public void checkValue ( @ javax.annotation.Nonnull com.android.sched.util.codec.CodecContext context , @ javax.annotation.Nonnull com.android.sched.util.config.DefaultFactory < T > factory ) throws com.android.sched.util.codec.CheckingException { if ( ! ( checkClass ( factory.getInstantiatedClass ( ) ) ) ) { throw new com.android.sched.util.codec.CheckingException ( ( ( ( ( "The value must be a DefaultFactory<{" + ( com.google.common.base.Joiner.on ( ',' ) . join ( com.android.sched.util.codec.DefaultFactorySelector.getClasses ( ) ) ) ) + "}> but is a DefaultFactory<" ) + ( factory.getInstantiatedClass ( ) . getCanonicalName ( ) ) ) + ">" ) ) ; } }
Source:
private boolean hasUnexpectedItalianLeadingZero ( com.google.i18n.phonenumbers.Phonenumber.PhoneNumber number ) { return ( number.isItalianLeadingZero ( ) ) && ( ! ( isLeadingZeroPossible ( number.getCountryCode ( ) ) ) ) ; }

Target:
public java.util.Set < com.google.i18n.phonenumbers.PhoneNumberUtil.PhoneNumberType > getSupportedTypesForRegion ( java.lang.String regionCode ) { if ( ! ( isValidRegionCode ( regionCode ) ) ) { com.google.i18n.phonenumbers.PhoneNumberUtil.logger.log ( java.util.logging.Level.WARNING , ( "Invalid or unknown region code provided: " + regionCode ) ) ; return java.util.Collections.unmodifiableSet ( new java.util.TreeSet < com.google.i18n.phonenumbers.PhoneNumberUtil.PhoneNumberType > ( ) ) ; } com.google.i18n.phonenumbers.Phonemetadata.PhoneMetadata metadata = getMetadataForRegion ( regionCode ) ; return getSupportedTypesForMetadata ( metadata ) ; }
Source:
public void onWindowFocusChanged ( final boolean hasWindowFocus ) { if ( checkNeedsPost ( ) ) { mRunQueue.addTask ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { onWindowFocusChanged ( hasWindowFocus ) ; } } ) ; return ; } mAwContents.onWindowFocusChanged ( hasWindowFocus ) ; }

Target:
public void onVisibilityChanged ( final android.view.View changedView , final int visibility ) { if ( ( mAwContents ) == null ) return ; if ( checkNeedsPost ( ) ) { mRunQueue.addTask ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { onVisibilityChanged ( changedView , visibility ) ; } } ) ; return ; } mAwContents.onVisibilityChanged ( changedView , visibility ) ; }
Source:
org.apache.harmony.luni.lang.reflect.ListOfTypes parseOptTypeArguments ( ) { org.apache.harmony.luni.lang.reflect.ListOfTypes typeArgs = new org.apache.harmony.luni.lang.reflect.ListOfTypes ( 8 ) ; if ( ( symbol ) == '<' ) { scanSymbol ( ) ; typeArgs.add ( parseTypeArgument ( ) ) ; while ( ( ( symbol ) != '>' ) && ( ( symbol ) > 0 ) ) { typeArgs.add ( parseTypeArgument ( ) ) ; } expect ( '>' ) ; } return typeArgs ; }

Target:
libcore.reflect.ListOfTypes parseOptTypeArguments ( ) { libcore.reflect.ListOfTypes typeArgs = new libcore.reflect.ListOfTypes ( 8 ) ; if ( ( symbol ) == '<' ) { scanSymbol ( ) ; typeArgs.add ( parseTypeArgument ( ) ) ; while ( ( ( symbol ) != '>' ) && ( ( symbol ) > 0 ) ) { typeArgs.add ( parseTypeArgument ( ) ) ; } expect ( '>' ) ; } return typeArgs ; }
Source:
void addEntry ( int hash , K key , V value , int bucketIndex ) { super . addEntry ( hash , key , value , bucketIndex ) ; java.util.LinkedHashMap.LinkedHashMapEntry < K , V > eldest = header.after ; if ( removeEldestEntry ( eldest ) ) { removeEntryForKey ( eldest.key ) ; } }

Target:
void addEntry ( int hash , K key , V value , int bucketIndex ) { java.util.LinkedHashMap.LinkedHashMapEntry < K , V > eldest = header.after ; if ( eldest != ( header ) ) { boolean removeEldest ; ( size ) ++ ; try { removeEldest = removeEldestEntry ( eldest ) ; } finally { ( size ) -- ; } if ( removeEldest ) { removeEntryForKey ( eldest.key ) ; } } super . addEntry ( hash , key , value , bucketIndex ) ; }
Source:
private com.android.builder.model.AndroidProject execute ( @ com.android.annotations.NonNull java.util.List < java.lang.String > arguments , boolean returnModel , @ com.android.annotations.NonNull java.lang.String ... tasks ) { org.gradle.tooling.ProjectConnection connection = getProjectConnection ( ) ; try { executeBuild ( arguments , connection , tasks ) ; if ( returnModel ) { java.util.Map < java.lang.String , com.android.builder.model.AndroidProject > modelMap = com.android.build.gradle.integration.common.fixture.GradleTestProject.buildModel ( connection ) ; org.junit.Assert.assertEquals ( "Quering GradleTestProject.getModel() with multi-project settings" , 1 , modelMap.size ( ) ) ; return modelMap.get ( ":" ) ; } } finally { connection.close ( ) ; } return null ; }

Target:
private com.android.builder.model.AndroidProject execute ( @ com.android.annotations.NonNull java.util.List < java.lang.String > arguments , boolean returnModel , boolean emulateStudio_1_0 , @ com.android.annotations.NonNull java.lang.String ... tasks ) { org.gradle.tooling.ProjectConnection connection = getProjectConnection ( ) ; try { executeBuild ( arguments , connection , tasks ) ; if ( returnModel ) { java.util.Map < java.lang.String , com.android.builder.model.AndroidProject > modelMap = com.android.build.gradle.integration.common.fixture.GradleTestProject.buildModel ( connection , emulateStudio_1_0 ) ; org.junit.Assert.assertEquals ( "Quering GradleTestProject.getModel() with multi-project settings" , 1 , modelMap.size ( ) ) ; return modelMap.get ( ":" ) ; } } finally { connection.close ( ) ; } return null ; }
Source:
public void onCreate ( android.os.Bundle savedState ) { super . onCreate ( savedState ) ; addContactTask = com.android.dialer.common.concurrent.DialerExecutors.createUiTaskBuilder ( getContext ( ) , getFragmentManager ( ) , "RegularSearchFragment.addContact" , new com.android.dialer.app.list.RegularSearchFragment.AddContactWorker ( getContext ( ) . getApplicationContext ( ) ) ) . build ( ) ; }

Target:
public void onCreate ( android.os.Bundle savedState ) { super . onCreate ( savedState ) ; addContactTask = com.android.dialer.common.concurrent.DialerExecutorComponent.get ( getContext ( ) ) . dialerExecutorFactory ( ) . createUiTaskBuilder ( getFragmentManager ( ) , "RegularSearchFragment.addContact" , new com.android.dialer.app.list.RegularSearchFragment.AddContactWorker ( getContext ( ) . getApplicationContext ( ) ) ) . build ( ) ; }
Source:
public boolean processMessage ( android.os.Message message ) { if ( checkForAndHandleModeChange ( message ) ) { return HANDLED ; } return NOT_HANDLED ; }

Target:
public boolean processMessage ( android.os.Message message ) { if ( checkForAndHandleModeChange ( message ) ) { return HANDLED ; } switch ( message.what ) { case com.android.server.wifi.WifiStateMachinePrime.CMD_START_AP : android.util.Log.d ( com.android.server.wifi.WifiStateMachinePrime.TAG , "Received CMD_START_AP (now invalid message) - dropping" ) ; break ; case com.android.server.wifi.WifiStateMachinePrime.CMD_STOP_AP : break ; case com.android.server.wifi.WifiStateMachinePrime.CMD_START_AP_FAILURE : android.util.Log.e ( com.android.server.wifi.WifiStateMachinePrime.TAG , "Failed to start SoftApMode. Wait for next mode command." ) ; break ; case com.android.server.wifi.WifiStateMachinePrime.CMD_AP_STOPPED : android.util.Log.d ( com.android.server.wifi.WifiStateMachinePrime.TAG , "SoftApModeActiveState stopped. Wait for next mode command." ) ; break ; default : return NOT_HANDLED ; } return HANDLED ; }
Source:
public void connectionForTraceRequest ( ) throws java.lang.Exception { com.android.volley.mock.TestRequest.Trace request = new com.android.volley.mock.TestRequest.Trace ( ) ; assertEquals ( request.getMethod ( ) , Method.TRACE ) ; com.android.volley.toolbox.HurlStack.setConnectionParametersForRequest ( mMockConnection , request ) ; assertEquals ( "TRACE" , mMockConnection.getRequestMethod ( ) ) ; assertFalse ( mMockConnection.getDoOutput ( ) ) ; }

Target:
public void connectionForOptionsRequest ( ) throws java.lang.Exception { com.android.volley.mock.TestRequest.Options request = new com.android.volley.mock.TestRequest.Options ( ) ; org.junit.Assert.assertEquals ( request.getMethod ( ) , Method.OPTIONS ) ; com.android.volley.toolbox.HurlStack.setConnectionParametersForRequest ( mMockConnection , request ) ; org.mockito.Mockito.verify ( mMockConnection ) . setRequestMethod ( "OPTIONS" ) ; org.mockito.Mockito.verify ( mMockConnection , org.mockito.Mockito.never ( ) ) . setDoOutput ( true ) ; }
Source:
public int hashCode ( ) { int primeNum = 31 ; return ( ( ( mRegistered ? 0 : 1 ) * primeNum ) + ( ( ( int ) ( ( mTimeStamp ) / 1000 ) ) * primeNum ) ) + ( ( mTimeStampType ) * primeNum ) ; }

Target:
public int hashCode ( ) { int primeNum = 31 ; return ( ( ( ( mRegistered ? 0 : 1 ) * primeNum ) + ( ( ( int ) ( ( mTimeStamp ) / 1000 ) ) * primeNum ) ) + ( ( mTimeStampType ) * primeNum ) ) + ( ( mCellConnectionStatus ) * primeNum ) ; }
Source:
boolean removeNetwork ( int netId ) { boolean ret = mWifiNative.removeNetwork ( netId ) ; android.net.wifi.WifiConfiguration config = null ; if ( ret ) { config = mConfiguredNetworks.get ( netId ) ; if ( config != null ) { config = mConfiguredNetworks.remove ( netId ) ; mNetworkIds.remove ( android.net.wifi.WifiConfigStore.configKey ( config ) ) ; } } if ( config != null ) { sendConfiguredNetworksChangedBroadcast ( config , WifiManager.CHANGE_REASON_REMOVED ) ; } return ret ; }

Target:
private void removeConfigAndSendBroadcastIfNeeded ( int netId ) { android.net.wifi.WifiConfiguration config = mConfiguredNetworks.get ( netId ) ; if ( config != null ) { if ( ( config.enterpriseConfig ) != null ) { config.enterpriseConfig.removeKeys ( mKeyStore ) ; } mConfiguredNetworks.remove ( netId ) ; mNetworkIds.remove ( android.net.wifi.WifiConfigStore.configKey ( config ) ) ; writeIpAndProxyConfigurations ( ) ; sendConfiguredNetworksChangedBroadcast ( config , WifiManager.CHANGE_REASON_REMOVED ) ; } }
Source:
private static com.android.sched.util.file.Directory createTempDir ( @ javax.annotation.Nonnull com.android.sched.util.RunnableHooks hooks ) { try { java.io.File tmp = com.google.common.io.Files.createTempDir ( ) ; com.android.sched.util.file.Directory dir = new com.android.sched.util.file.Directory ( tmp.getPath ( ) , hooks , com.android.sched.util.file.FileOrDirectory.Existence.MUST_EXIST , com.android.sched.util.file.FileOrDirectory.Permission.WRITE , com.android.sched.util.file.FileOrDirectory.ChangePermission.NOCHANGE ) ; hooks.addHook ( new com.android.jack.Options.TempDirDeleter ( dir ) ) ; return dir ; } catch ( java.io.IOException e ) { throw new com.android.jack.JackUserException ( e ) ; } }

Target:
private static com.android.sched.util.file.Directory createTempDir ( @ javax.annotation.Nonnull com.android.sched.util.RunnableHooks hooks ) { try { java.io.File tmp = com.android.sched.util.file.Files.createTempDir ( ) ; com.android.sched.util.file.Directory dir = new com.android.sched.util.file.Directory ( tmp.getPath ( ) , hooks , com.android.sched.util.file.FileOrDirectory.Existence.MUST_EXIST , com.android.sched.util.file.FileOrDirectory.Permission.WRITE , com.android.sched.util.file.FileOrDirectory.ChangePermission.NOCHANGE ) ; hooks.addHook ( new com.android.jack.Options.TempDirDeleter ( dir ) ) ; return dir ; } catch ( java.io.IOException e ) { throw new com.android.jack.JackUserException ( e ) ; } }
Source:
public void copyFrom ( short [ ] d ) { android.os.Trace.traceBegin ( RenderScript.TRACE_TAG , "copyFrom" ) ; mRS.validate ( ) ; if ( ( mCurrentDimZ ) > 0 ) { copy3DRangeFrom ( 0 , 0 , 0 , mCurrentDimX , mCurrentDimY , mCurrentDimZ , d ) ; } else if ( ( mCurrentDimY ) > 0 ) { copy2DRangeFrom ( 0 , 0 , mCurrentDimX , mCurrentDimY , d ) ; } else { copy1DRangeFrom ( 0 , mCurrentCount , d ) ; } android.os.Trace.traceEnd ( RenderScript.TRACE_TAG ) ; }

Target:
public void copyFromUnchecked ( java.lang.Object array ) { android.os.Trace.traceBegin ( RenderScript.TRACE_TAG , "copyFromUnchecked" ) ; copyFromUnchecked ( array , validateObjectIsPrimitiveArray ( array , false ) , java.lang.reflect.Array.getLength ( array ) ) ; android.os.Trace.traceEnd ( RenderScript.TRACE_TAG ) ; }
Source:
public static java.security.SecureRandom getSecureRandom ( ) { java.security.SecureRandom r = sun.security.jca.JCAUtil.secureRandom ; if ( r == null ) { synchronized ( sun.security.jca.JCAUtil.LOCK ) { r = sun.security.jca.JCAUtil.secureRandom ; if ( r == null ) { r = new java.security.SecureRandom ( ) ; sun.security.jca.JCAUtil.secureRandom = r ; } } } return r ; }

Target:
public static java.security.SecureRandom getSecureRandom ( ) { return sun.security.jca.JCAUtil.CachedSecureRandomHolder.instance ; }
Source:
public static int getApiByBuildCode ( java.lang.String buildCode , boolean recognizeUnknowns ) { for ( int api = 1 ; api <= ( com.android.sdklib.SdkVersionInfo.HIGHEST_KNOWN_API ) ; api ++ ) { java.lang.String code = com.android.sdklib.SdkVersionInfo.getBuildCode ( api ) ; if ( ( code != null ) && ( code.equalsIgnoreCase ( buildCode ) ) ) { return api ; } } return recognizeUnknowns ? ( com.android.sdklib.SdkVersionInfo.HIGHEST_KNOWN_API ) + 1 : - 1 ; }

Target:
public static int getApiByBuildCode ( java.lang.String buildCode , boolean recognizeUnknowns ) { for ( int api = 1 ; api <= ( com.android.sdklib.SdkVersionInfo.HIGHEST_KNOWN_API ) ; api ++ ) { java.lang.String code = com.android.sdklib.SdkVersionInfo.getBuildCode ( api ) ; if ( ( code != null ) && ( code.equalsIgnoreCase ( buildCode ) ) ) { return api ; } } if ( buildCode.equalsIgnoreCase ( "L" ) ) { return 21 ; } return recognizeUnknowns ? ( com.android.sdklib.SdkVersionInfo.HIGHEST_KNOWN_API ) + 1 : - 1 ; }
Source:
public void testSendMessage ( ) { int sessionId = 2394 ; int peerId = 2032 ; byte [ ] message = new byte [ com.android.server.wifi.nan.WifiNanServiceImplTest.MAX_LENGTH ] ; int messageId = 2043 ; int clientId = doConnect ( ) ; mDut.sendMessage ( clientId , sessionId , peerId , message , messageId , 0 ) ; org.mockito.Mockito.verify ( mNanStateManagerMock ) . sendMessage ( clientId , sessionId , peerId , message , messageId , 0 ) ; }

Target:
public void testSendMessage ( ) { int sessionId = 2394 ; int peerId = 2032 ; byte [ ] message = new byte [ com.android.server.wifi.aware.WifiAwareServiceImplTest.MAX_LENGTH ] ; int messageId = 2043 ; int clientId = doConnect ( ) ; mDut.sendMessage ( clientId , sessionId , peerId , message , messageId , 0 ) ; org.mockito.Mockito.verify ( mAwareStateManagerMock ) . sendMessage ( clientId , sessionId , peerId , message , messageId , 0 ) ; }
Source:
private void waitUninterruptibly ( com.google.common.util.concurrent.Monitor.Guard guard , boolean signalBeforeWaiting ) { if ( ! ( guard.isSatisfied ( ) ) ) { if ( signalBeforeWaiting ) { signalConditionsOfSatisfiedGuards ( null ) ; } incrementWaiters ( guard ) ; try { final java.util.concurrent.locks.Condition condition = guard.condition ; do { condition.awaitUninterruptibly ( ) ; } while ( ! ( guard.isSatisfied ( ) ) ) ; } finally { decrementWaiters ( guard ) ; } } }

Target:
public void enterWhenUninterruptibly ( com.google.common.util.concurrent.Monitor.Guard guard ) { if ( ( guard.monitor ) != ( this ) ) { throw new java.lang.IllegalMonitorStateException ( ) ; } final java.util.concurrent.locks.ReentrantLock lock = this . lock ; boolean signalBeforeWaiting = lock.isHeldByCurrentThread ( ) ; lock.lock ( ) ; boolean satisfied = false ; try { if ( ! ( guard.isSatisfied ( ) ) ) { awaitUninterruptibly ( guard , signalBeforeWaiting ) ; } satisfied = true ; } finally { if ( ! satisfied ) { leave ( ) ; } } }
Source:
static java.lang.String getVoicemailDuration ( android.content.Context context , com.android.dialer.voicemail.model.VoicemailEntry voicemailEntry ) { long minutes = java.util.concurrent.TimeUnit.SECONDS.toMinutes ( voicemailEntry.duration ( ) ) ; long seconds = ( voicemailEntry.duration ( ) ) - ( java.util.concurrent.TimeUnit.MINUTES.toSeconds ( minutes ) ) ; if ( minutes > 99 ) { com.android.dialer.common.LogUtil.w ( "VoicemailEntryText.getVoicemailDuration" , "Duration was %d" , voicemailEntry.duration ( ) ) ; minutes = 99 ; } return context.getString ( R.string.voicemailDurationFormat , minutes , seconds ) ; }

Target:
static java.lang.String getVoicemailDuration ( android.content.Context context , com.android.dialer.voicemail.model.VoicemailEntry voicemailEntry ) { long minutes = java.util.concurrent.TimeUnit.SECONDS.toMinutes ( voicemailEntry.getDuration ( ) ) ; long seconds = ( voicemailEntry.getDuration ( ) ) - ( java.util.concurrent.TimeUnit.MINUTES.toSeconds ( minutes ) ) ; if ( minutes > 99 ) { com.android.dialer.common.LogUtil.w ( "VoicemailEntryText.getVoicemailDuration" , "Duration was %d" , voicemailEntry.getDuration ( ) ) ; minutes = 99 ; } return context.getString ( R.string.voicemailDurationFormat , minutes , seconds ) ; }
Source:
public void setVideoProvider ( java.lang.String callId , com.android.internal.telecom.IVideoProvider videoProvider ) { com.android.server.telecom.Log.startSession ( "CSW.sVP" ) ; long token = android.os.Binder.clearCallingIdentity ( ) ; try { synchronized ( mLock ) { logIncoming ( "setVideoProvider %s" , callId ) ; com.android.server.telecom.Call call = mCallIdMapper.getCall ( callId ) ; if ( call != null ) { call.setVideoProvider ( videoProvider ) ; } } } finally { android.os.Binder.restoreCallingIdentity ( token ) ; com.android.server.telecom.Log.endSession ( ) ; } }

Target:
public void setVideoProvider ( java.lang.String callId , com.android.internal.telecom.IVideoProvider videoProvider ) { android.telecom.Log.startSession ( "CSW.sVP" ) ; long token = android.os.Binder.clearCallingIdentity ( ) ; try { synchronized ( mLock ) { logIncoming ( "setVideoProvider %s" , callId ) ; com.android.server.telecom.Call call = mCallIdMapper.getCall ( callId ) ; if ( call != null ) { call.setVideoProvider ( videoProvider ) ; } } } finally { android.os.Binder.restoreCallingIdentity ( token ) ; android.telecom.Log.endSession ( ) ; } }
Source:
public void onOtaspChanged ( int otaspMode ) { com.android.phone.otasp.OtaspSimStateReceiver.logd ( ( "onOtaspChanged: otaspMode=" + otaspMode ) ) ; if ( otaspMode == ( com.android.internal.telephony.ServiceStateTracker.OTASP_NEEDED ) ) { com.android.phone.otasp.OtaspSimStateReceiver.logd ( "otasp activation required, start otaspActivationService" ) ; mContext.startService ( new android.content.Intent ( mContext , com.android.phone.otasp.OtaspActivationService.class ) ) ; } else if ( otaspMode == ( com.android.internal.telephony.ServiceStateTracker.OTASP_NOT_NEEDED ) ) { com.android.phone.otasp.OtaspActivationService.updateActivationState ( mContext , true ) ; } }

Target:
public void onOtaspChanged ( int otaspMode ) { com.android.phone.otasp.OtaspSimStateReceiver.logd ( ( "onOtaspChanged: otaspMode=" + otaspMode ) ) ; if ( otaspMode == ( android.telephony.TelephonyManager.OTASP_NEEDED ) ) { com.android.phone.otasp.OtaspSimStateReceiver.logd ( "otasp activation required, start otaspActivationService" ) ; mContext.startService ( new android.content.Intent ( mContext , com.android.phone.otasp.OtaspActivationService.class ) ) ; } else if ( otaspMode == ( android.telephony.TelephonyManager.OTASP_NOT_NEEDED ) ) { com.android.phone.otasp.OtaspActivationService.updateActivationState ( mContext , true ) ; } }
Source:
void makeAppNotRespondingLocked ( com.android.server.am.ProcessRecord app , java.lang.String tag , java.lang.String shortMsg , java.lang.String longMsg , byte [ ] crashData ) { app.notResponding = true ; app.notRespondingReport = generateProcessError ( app , ActivityManager.ProcessErrorStateInfo.NOT_RESPONDING , tag , shortMsg , longMsg , crashData ) ; startAppProblemLocked ( app ) ; app.stopFreezingAllLocked ( ) ; }

Target:
private void makeAppNotRespondingLocked ( com.android.server.am.ProcessRecord app , java.lang.String activity , java.lang.String shortMsg , java.lang.String longMsg ) { app.notResponding = true ; app.notRespondingReport = generateProcessError ( app , ActivityManager.ProcessErrorStateInfo.NOT_RESPONDING , activity , shortMsg , longMsg , null ) ; startAppProblemLocked ( app ) ; app.stopFreezingAllLocked ( ) ; }
Source:
public final void activityIdle ( android.os.IBinder token , android.content.res.Configuration config ) { final long origId = android.os.Binder.clearCallingIdentity ( ) ; activityIdleInternal ( token , false , config ) ; android.os.Binder.restoreCallingIdentity ( origId ) ; }

Target:
public boolean removeSubTask ( int taskId , int subTaskIndex ) { synchronized ( this ) { enforceCallingPermission ( android.Manifest.permission.REMOVE_TASKS , "removeSubTask()" ) ; long ident = android.os.Binder.clearCallingIdentity ( ) ; try { return ( mMainStack.removeTaskActivitiesLocked ( taskId , subTaskIndex ) ) != null ; } finally { android.os.Binder.restoreCallingIdentity ( ident ) ; } } }
Source:
public T newInstance ( java.lang.Object ... args ) throws java.lang.IllegalAccessException , java.lang.IllegalArgumentException , java.lang.InstantiationException , java.lang.reflect.InvocationTargetException { if ( ( serializationClass ) == null ) { return newInstance0 ( args ) ; } else { return ( ( T ) ( java.lang.reflect.Constructor.newInstanceFromSerialization ( serializationCtor , serializationClass ) ) ) ; } }

Target:
public T newInstance ( java.lang.Object ... initargs ) throws java.lang.IllegalAccessException , java.lang.IllegalArgumentException , java.lang.InstantiationException , java.lang.reflect.InvocationTargetException { if ( ( serializationClass ) == null ) { return newInstance0 ( initargs ) ; } else { return ( ( T ) ( java.lang.reflect.Constructor.newInstanceFromSerialization ( serializationCtor , serializationClass ) ) ) ; } }
Source:
public final void testGetDeviceStatus ( ) { assertEquals ( DeviceStatus.EXISTS , dm.getDeviceStatus ( "7in WSVGA (Tablet)" , "Generic" , ( - 1338842870 ) ) ) ; assertEquals ( DeviceStatus.CHANGED , dm.getDeviceStatus ( "7in WSVGA (Tablet)" , "Generic" , 1 ) ) ; assertEquals ( DeviceStatus.EXISTS , dm.getDeviceStatus ( "Nexus One" , "Google" , ( - 1812631727 ) ) ) ; assertEquals ( DeviceStatus.CHANGED , dm.getDeviceStatus ( "Nexus One" , "Google" , 2 ) ) ; assertEquals ( DeviceStatus.MISSING , dm.getDeviceStatus ( "My Device" , "Custom OEM" , 3 ) ) ; }

Target:
public final void testHasHardwarePropHashChanged_Oem ( ) { final com.android.sdklib.devices.Device d2 = dm.getDevice ( "Nexus One" , "Google" ) ; assertEquals ( "MD5:d886364fc30320c0518f51002d0ef22d" , com.android.sdklib.devices.DeviceManager.hasHardwarePropHashChanged ( d2 , "invalid" ) ) ; assertEquals ( null , com.android.sdklib.devices.DeviceManager.hasHardwarePropHashChanged ( d2 , "MD5:d886364fc30320c0518f51002d0ef22d" ) ) ; d2.getDefaultHardware ( ) . setKeyboard ( Keyboard.QWERTY ) ; assertEquals ( "MD5:db682e0a58e74a8614e43e6e15c05176" , com.android.sdklib.devices.DeviceManager.hasHardwarePropHashChanged ( d2 , "MD5:d886364fc30320c0518f51002d0ef22d" ) ) ; d2.getDefaultHardware ( ) . setKeyboard ( Keyboard.NOKEY ) ; assertEquals ( null , com.android.sdklib.devices.DeviceManager.hasHardwarePropHashChanged ( d2 , "MD5:d886364fc30320c0518f51002d0ef22d" ) ) ; }
Source:
private static void checkSetSize ( final org.jetbrains.asm4.commons.GeneratorAdapter generator , final int componentLocal , final java.lang.String methodName , final java.awt.Dimension dimension ) { if ( dimension != null ) { generator.loadLocal ( componentLocal ) ; com.intellij.uiDesigner.compiler.AsmCodeGenerator.pushPropValue ( generator , "java.awt.Dimension" , dimension ) ; generator.invokeVirtual ( org.jetbrains.asm4.Type.getType ( java.awt.Component.class ) , new org.jetbrains.asm4.commons.Method ( methodName , org.jetbrains.asm4.Type.VOID_TYPE , new org.jetbrains.asm4.Type [ ] { org.jetbrains.asm4.Type.getType ( java.awt.Dimension.class ) } ) ) ; } }

Target:
private static void checkSetSize ( final org.jetbrains.org.objectweb.asm.commons.GeneratorAdapter generator , final int componentLocal , final java.lang.String methodName , final java.awt.Dimension dimension ) { if ( dimension != null ) { generator.loadLocal ( componentLocal ) ; com.intellij.uiDesigner.compiler.AsmCodeGenerator.pushPropValue ( generator , "java.awt.Dimension" , dimension ) ; generator.invokeVirtual ( org.jetbrains.org.objectweb.asm.Type.getType ( java.awt.Component.class ) , new org.jetbrains.org.objectweb.asm.commons.Method ( methodName , org.jetbrains.org.objectweb.asm.Type.VOID_TYPE , new org.jetbrains.org.objectweb.asm.Type [ ] { org.jetbrains.org.objectweb.asm.Type.getType ( java.awt.Dimension.class ) } ) ) ; } }
Source:
public void destroyUserData ( java.lang.String uuid , int userId , int flags ) throws com.android.internal.os.InstallerConnection.InstallerException { mInstaller.execute ( "destroy_user_data" , uuid , userId , flags ) ; }

Target:
public void destroyUserData ( java.lang.String uuid , int userId , int flags ) throws com.android.internal.os.InstallerConnection.InstallerException { checkLock ( ) ; try { mInstalld.destroyUserData ( uuid , userId , flags ) ; } catch ( android.os.RemoteException | android.os.ServiceSpecificException e ) { throw new com.android.internal.os.InstallerConnection.InstallerException ( e.getMessage ( ) ) ; } }
Source:
public void test_getBucketLabel_invalid ( ) throws java.lang.Exception { libcore.icu.ImmutableIndex ii = libcore.icu.AlphabeticIndexTest.createIndex ( java.util.Locale.US ) ; try { ii.getBucketLabel ( ( - 1 ) ) ; fail ( ) ; } catch ( java.lang.IllegalArgumentException expected ) { } try { ii.getBucketLabel ( 123456 ) ; fail ( ) ; } catch ( java.lang.IllegalArgumentException expected ) { } }

Target:
public void test_getBucketLabel_invalid ( ) throws java.lang.Exception { libcore.icu.AlphabeticIndex.ImmutableIndex ii = libcore.icu.AlphabeticIndexTest.createIndex ( java.util.Locale.US ) ; try { ii.getBucketLabel ( ( - 1 ) ) ; fail ( ) ; } catch ( java.lang.IllegalArgumentException expected ) { } try { ii.getBucketLabel ( 123456 ) ; fail ( ) ; } catch ( java.lang.IllegalArgumentException expected ) { } }
Source:
protected void notifyProfileServiceStateChanged ( int state ) { com.android.bluetooth.btservice.AdapterService adapterService = com.android.bluetooth.btservice.AdapterService.getAdapterService ( ) ; if ( adapterService != null ) { adapterService.onProfileServiceStateChanged ( getClass ( ) . getName ( ) , state ) ; } }

Target:
private void doStop ( ) { if ( ! ( mProfileStarted ) ) { android.util.Log.w ( mName , "doStop() called, but the profile is not running." ) ; } mProfileStarted = false ; if ( ( mAdapterService ) != null ) { mAdapterService.onProfileServiceStateChanged ( getClass ( ) . getName ( ) , BluetoothAdapter.STATE_OFF ) ; } if ( ! ( stop ( ) ) ) { android.util.Log.e ( mName , "Unable to stop profile" ) ; } if ( ( mUserSwitchedReceiver ) != null ) { getApplicationContext ( ) . unregisterReceiver ( mUserSwitchedReceiver ) ; mUserSwitchedReceiver = null ; } stopSelf ( ) ; }
Source:
public static com.android.jack.Options parseCommandLine ( @ javax.annotation.Nonnull java.util.List < java.lang.String > list ) throws org.kohsuke.args4j.CmdLineException { com.android.jack.Options options = new com.android.jack.Options ( ) ; org.kohsuke.args4j.CmdLineParser parser = new org.kohsuke.args4j.CmdLineParser ( options ) ; parser.setUsageWidth ( 100 ) ; parser.parseArgument ( list ) ; parser.stopOptionParsing ( ) ; return options ; }

Target:
public static com.android.jack.Options parseCommandLine ( @ javax.annotation.Nonnull java.util.List < java.lang.String > list ) throws org.kohsuke.args4j.CmdLineException { com.android.jack.Options options = new com.android.jack.Options ( ) ; org.kohsuke.args4j.CmdLineParser parser = new org.kohsuke.args4j.CmdLineParser ( options , org.kohsuke.args4j.ParserProperties.defaults ( ) . withUsageWidth ( 100 ) ) ; parser.parseArgument ( list ) ; parser.stopOptionParsing ( ) ; return options ; }
Source:
public static void create ( android.content.Context context ) { context = context.getApplicationContext ( ) ; if ( ( org.chromium.base.PowerMonitor.sInstance ) == null ) { org.chromium.base.PowerMonitor.sInstance = org.chromium.base.PowerMonitor.LazyHolder.INSTANCE ; org.chromium.base.ApplicationStatus.registerApplicationStateListener ( org.chromium.base.PowerMonitor.sInstance ) ; android.content.IntentFilter ifilter = new android.content.IntentFilter ( android.content.Intent.ACTION_BATTERY_CHANGED ) ; android.content.Intent batteryStatusIntent = context.registerReceiver ( null , ifilter ) ; if ( batteryStatusIntent != null ) org.chromium.base.PowerMonitor.onBatteryChargingChanged ( batteryStatusIntent ) ; } }

Target:
public void onReceive ( android.content.Context context , android.content.Intent intent ) { org.chromium.base.PowerMonitor.onBatteryChargingChanged ( intent ) ; }
Source:
public void testValues ( ) throws java.lang.Exception { assertEquals ( ( "" + ( ( ( ( ( ( ( ( ( ( ( ( "res/values/customattr.xml:2: Error: Resource named \'ContentFrame\' does not start with the project\'s resource prefix \'unit_test_prefix_\'; rename to \'unit_test_prefix_ContentFrame\' ? [ResourceName]\n" + " <declare-styleable name=\"ContentFrame\">\n" ) + " ~~~~~~~~~~~~~~~~~~~\n" ) + "res/values/customattr.xml:3: Error: Resource named \'content\' does not start with the project\'s resource prefix \'unit_test_prefix_\'; rename to \'unit_test_prefix_content\' ? [ResourceName]\n" ) + " <attr name=\"content\" format=\"reference\" />\n" ) + " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ) + "res/values/customattr.xml:4: Error: Resource named \'contentId\' does not start with the project\'s resource prefix \'unit_test_prefix_\'; rename to \'unit_test_prefix_contentId\' ? [ResourceName]\n" ) + " <attr name=\"contentId\" format=\"reference\" />\n" ) + " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ) + "res/layout/customattrlayout.xml:2: Error: Resource named \'customattrlayout\' does not start with the project\'s resource prefix \'unit_test_prefix_\'; rename to \'unit_test_prefix_customattrlayout\' ? [ResourceName]\n" ) + "<foo.bar.ContentFrame\n" ) + "^\n" ) + "4 errors, 0 warnings\n" ) ) , lintProject ( "res/values/customattr.xml" , "res/layout/customattrlayout.xml" , "unusedR.java.txt=>gen/my/pkg/R.java" , "AndroidManifest.xml" ) ) ; }

Target:
public void testValues ( ) throws java.lang.Exception { assertEquals ( ( "" + ( ( ( ( ( ( ( ( ( ( ( ( "res/values/customattr.xml:2: Error: Resource named \'ContentFrame\' does not start with the project\'s resource prefix \'unit_test_prefix_\'; rename to \'unit_test_prefix_ContentFrame\' ? [ResourceName]\n" + " <declare-styleable name=\"ContentFrame\">\n" ) + " ~~~~~~~~~~~~~~~~~~~\n" ) + "res/values/customattr.xml:3: Error: Resource named \'content\' does not start with the project\'s resource prefix \'unit_test_prefix_\'; rename to \'unit_test_prefix_content\' ? [ResourceName]\n" ) + " <attr name=\"content\" format=\"reference\" />\n" ) + " ~~~~~~~~~~~~~~\n" ) + "res/values/customattr.xml:4: Error: Resource named \'contentId\' does not start with the project\'s resource prefix \'unit_test_prefix_\'; rename to \'unit_test_prefix_contentId\' ? [ResourceName]\n" ) + " <attr name=\"contentId\" format=\"reference\" />\n" ) + " ~~~~~~~~~~~~~~~~\n" ) + "res/layout/customattrlayout.xml:2: Error: Resource named \'customattrlayout\' does not start with the project\'s resource prefix \'unit_test_prefix_\'; rename to \'unit_test_prefix_customattrlayout\' ? [ResourceName]\n" ) + "<foo.bar.ContentFrame\n" ) + "^\n" ) + "4 errors, 0 warnings\n" ) ) , lintProject ( "res/values/customattr.xml" , "res/layout/customattrlayout.xml" , "unusedR.java.txt=>gen/my/pkg/R.java" , "AndroidManifest.xml" ) ) ; }
Source:
public void testConfigurationUpdatesWhenResizedFromFullscreen ( ) throws java.lang.Exception { HEAD ( 5 ) ; android.server.cts.c121a Merge ; }

Target:
public void testConfigurationUpdatesWhenResizedFromFullscreen ( ) throws java.lang.Exception { if ( ! ( supportsSplitScreenMultiWindow ( ) ) ) { com.android.tradefed.log.LogUtil.CLog.logAndDisplay ( LogLevel.INFO , "Skipping test: no multi-window support" ) ; return ; } launchActivityInStack ( android.server.cts.ActivityManagerAppConfigurationTests.RESIZEABLE_ACTIVITY_NAME , android.server.cts.FULLSCREEN_WORKSPACE_STACK_ID ) ; final android.server.cts.ReportedSizes fullscreenSizes = getActivityDisplaySize ( android.server.cts.ActivityManagerAppConfigurationTests.RESIZEABLE_ACTIVITY_NAME ) ; moveActivityToStack ( android.server.cts.ActivityManagerAppConfigurationTests.RESIZEABLE_ACTIVITY_NAME , android.server.cts.DOCKED_STACK_ID ) ; final android.server.cts.ReportedSizes dockedSizes = getActivityDisplaySize ( android.server.cts.ActivityManagerAppConfigurationTests.RESIZEABLE_ACTIVITY_NAME ) ; android.server.cts.ActivityManagerAppConfigurationTests.assertSizesAreSane ( fullscreenSizes , dockedSizes ) ; }
Source:
public void setRebindRetryTime ( com.android.internal.telephony.ims.ImsServiceController.RebindRetry retry ) { mRebindRetry = retry ; }

Target:
public com.android.ims.internal.IImsMMTelFeature getMMTelFeature ( int slotId ) { synchronized ( mLock ) { com.android.internal.telephony.ims.ImsServiceController.ImsFeatureContainer f = getImsFeatureContainer ( slotId , ImsFeature.MMTEL ) ; if ( f == null ) { android.util.Log.w ( com.android.internal.telephony.ims.ImsServiceController.LOG_TAG , ( "Requested null MMTelFeature on slot " + slotId ) ) ; return null ; } return f.resolve ( com.android.ims.internal.IImsMMTelFeature.class ) ; } }
Source:
protected com.intellij.psi.PsiFile createFile ( @ org.jetbrains.annotations.NotNull com.intellij.openapi.project.Project project , @ org.jetbrains.annotations.NotNull com.intellij.openapi.vfs.VirtualFile virtualFile ) { return com.intellij.util.ObjectUtils.assertNotNull ( com.intellij.psi.PsiManager.getInstance ( project ) . findFile ( virtualFile ) ) ; }

Target:
protected com.intellij.psi.PsiFile createFile ( @ org.jetbrains.annotations.NotNull com.intellij.openapi.project.Project project , @ org.jetbrains.annotations.NotNull com.intellij.openapi.vfs.VirtualFile virtualFile ) { com.intellij.psi.PsiFile file = com.intellij.psi.PsiManager.getInstance ( project ) . findFile ( virtualFile ) ; if ( file == null ) { com.intellij.lang.Language language = new com.intellij.psi.SingleRootFileViewProvider ( com.intellij.psi.PsiManager.getInstance ( project ) , virtualFile ) . getBaseLanguage ( ) ; throw new java.lang.AssertionError ( java.lang.String.format ( "no PSI for \'%s\'\nfile valid=%s, fileType=%s, language=%s" , virtualFile.getName ( ) , virtualFile.isValid ( ) , virtualFile.getFileType ( ) , language ) ) ; } return file ; }
Source:
protected void sortAndPrepareInternal ( @ javax.annotation.Nonnull java.util.ArrayList < com.android.jack.ir.ast.JDefinedClassOrInterface > defaultList , @ javax.annotation.Nonnull java.util.ArrayList < com.android.jack.ir.ast.JDefinedClassOrInterface > mainList ) { java.util.Collections.sort ( defaultList , nameComp ) ; int number = com.android.jack.tools.merger.ConstantManager.FIRST_DETERMINISTIC_MODE_INDEX ; for ( com.android.jack.ir.ast.JDefinedClassOrInterface type : mainList ) { type.addMarker ( new com.android.jack.backend.dex.NumberMarker ( ( number ++ ) ) ) ; } number = com.android.jack.tools.merger.ConstantManager.FIRST_DETERMINISTIC_MODE_INDEX ; for ( com.android.jack.ir.ast.JDefinedClassOrInterface type : defaultList ) { type.addMarker ( new com.android.jack.backend.dex.NumberMarker ( ( number ++ ) ) ) ; } }

Target:
protected void sortAndNumberInternal ( @ javax.annotation.Nonnull java.util.ArrayList < com.android.jack.ir.ast.JDefinedClassOrInterface > defaultList , @ javax.annotation.Nonnull java.util.ArrayList < com.android.jack.ir.ast.JDefinedClassOrInterface > mainList ) { java.util.Collections.sort ( defaultList , nameComp ) ; int number = 0 ; for ( com.android.jack.ir.ast.JDefinedClassOrInterface type : mainList ) { type.addMarker ( new com.android.jack.backend.dex.NumberMarker ( ( number ++ ) ) ) ; } number = 0 ; for ( com.android.jack.ir.ast.JDefinedClassOrInterface type : defaultList ) { type.addMarker ( new com.android.jack.backend.dex.NumberMarker ( ( number ++ ) ) ) ; } }
Source:
public void testStageInstallWithErrorCode_successfulFollowOnUpdate_newerVersion ( ) throws java.lang.Exception { com.android.timezone.distro.TimeZoneDistro distro1 = libcore.tzdata.update2.TimeZoneDistroInstallerTest.createValidTimeZoneDistro ( libcore.tzdata.update2.TimeZoneDistroInstallerTest.NEW_RULES_VERSION , 1 ) ; assertEquals ( TimeZoneDistroInstaller.INSTALL_SUCCESS , installer.stageInstallWithErrorCode ( distro1 ) ) ; assertInstallDistroStaged ( distro1 ) ; com.android.timezone.distro.TimeZoneDistro distro2 = libcore.tzdata.update2.TimeZoneDistroInstallerTest.createValidTimeZoneDistro ( libcore.tzdata.update2.TimeZoneDistroInstallerTest.NEW_RULES_VERSION , 2 ) ; assertEquals ( TimeZoneDistroInstaller.INSTALL_SUCCESS , installer.stageInstallWithErrorCode ( distro2 ) ) ; assertInstallDistroStaged ( distro2 ) ; com.android.timezone.distro.TimeZoneDistro distro3 = libcore.tzdata.update2.TimeZoneDistroInstallerTest.createValidTimeZoneDistro ( libcore.tzdata.update2.TimeZoneDistroInstallerTest.NEWER_RULES_VERSION , 1 ) ; assertEquals ( TimeZoneDistroInstaller.INSTALL_SUCCESS , installer.stageInstallWithErrorCode ( distro3 ) ) ; assertInstallDistroStaged ( distro3 ) ; assertNoInstalledDistro ( ) ; }

Target:
public void testStageInstallWithErrorCode_withNewerDistroVersion ( ) throws java.lang.Exception { byte [ ] distroBytes = libcore.tzdata.update2.TimeZoneDistroInstallerTest.createValidTimeZoneDistroBuilder ( libcore.tzdata.update2.TimeZoneDistroInstallerTest.NEW_RULES_VERSION , 1 ) . replaceFormatVersionForTests ( 2 , 1 ) . buildUnvalidatedBytes ( ) ; assertEquals ( TimeZoneDistroInstaller.INSTALL_FAIL_BAD_DISTRO_FORMAT_VERSION , installer.stageInstallWithErrorCode ( new com.android.timezone.distro.TimeZoneDistro ( distroBytes ) ) ) ; assertNoDistroOperationStaged ( ) ; assertNoInstalledDistro ( ) ; }
Source:
public void testInnerClass ( ) { android.signature.cts.JDiffClassDescription clz = new android.signature.cts.JDiffClassDescription ( "android.signature.cts.tests.data" , "NormalClass.InnerClass" , new android.signature.cts.tests.JDiffClassDescriptionTest.NoFailures ( ) ) ; clz.setType ( JDiffClassDescription.JDiffType.CLASS ) ; clz.setModifier ( java.lang.reflect.Modifier.PUBLIC ) ; android.signature.cts.JDiffClassDescription.JDiffField field = new android.signature.cts.JDiffClassDescription.JDiffField ( "innerClassData" , "java.lang.String" , java.lang.reflect.Modifier.PRIVATE ) ; clz.addField ( field ) ; clz.checkSignatureCompliance ( ) ; assertEquals ( clz.toSignatureString ( ) , "public class NormalClass.InnerClass" ) ; }

Target:
public void testInnerClass ( ) { android.signature.cts.JDiffClassDescription clz = new android.signature.cts.JDiffClassDescription ( "android.signature.cts.tests.data" , "NormalClass.InnerClass" , new android.signature.cts.tests.JDiffClassDescriptionTest.NoFailures ( ) ) ; clz.setType ( JDiffClassDescription.JDiffType.CLASS ) ; clz.setModifier ( java.lang.reflect.Modifier.PUBLIC ) ; android.signature.cts.JDiffClassDescription.JDiffField field = new android.signature.cts.JDiffClassDescription.JDiffField ( "innerClassData" , "java.lang.String" , java.lang.reflect.Modifier.PRIVATE , android.signature.cts.tests.JDiffClassDescriptionTest.VALUE ) ; clz.addField ( field ) ; clz.checkSignatureCompliance ( ) ; assertEquals ( clz.toSignatureString ( ) , "public class NormalClass.InnerClass" ) ; }
Source:
private static void child ( ) throws java.lang.Exception { java.lang.System.out.println ( "spawning child" ) ; java.lang.ProcessBuilder pb = new java.lang.ProcessBuilder ( "/system/bin/sleep" , "5" ) ; java.lang.Process proc = pb.start ( ) ; java.lang.Thread.sleep ( 1000 ) ; Main.checkManager ( ) ; proc.waitFor ( ) ; java.lang.System.out.println ( "child died" ) ; }

Target:
private static void child ( ) throws java.lang.Exception { java.lang.System.out.println ( "spawning child" ) ; java.lang.ProcessBuilder pb = new java.lang.ProcessBuilder ( "sleep" , "5" ) ; java.lang.Process proc = pb.start ( ) ; java.lang.Thread.sleep ( 1000 ) ; Main.checkManager ( ) ; proc.waitFor ( ) ; java.lang.System.out.println ( "child died" ) ; }
Source:
public void testMergedResourcesByName ( ) throws java.lang.Exception { com.android.ide.common.res2.ResourceMerger merger = com.android.ide.common.res2.ResourceMergerTest.getResourceMerger ( ) ; verifyResourceExists ( merger , "drawable/icon" , "drawable-ldpi/icon" , "drawable/icon2" , "drawable/patch" , "raw/foo" , "layout/main" , "layout/layout_ref" , "layout/alias_replaced_by_file" , "layout/file_replaced_by_alias" , "drawable/color_drawable" , "drawable/drawable_ref" , "color/color" , "string/basic_string" , "string/xliff_string" , "string/xliff_with_carriage_return" , "string/styled_string" , "style/style" , "array/string_array" , "attr/dimen_attr" , "attr/string_attr" , "attr/enum_attr" , "attr/flag_attr" , "attr/blah" , "attr/blah2" , "attr/flagAttr" , "declare-styleable/declare_styleable" , "dimen/dimen" , "id/item_id" , "integer/integer" ) ; }

Target:
public void testMergedResourcesByName ( ) throws java.lang.Exception { com.android.ide.common.res2.ResourceMerger merger = com.android.ide.common.res2.ResourceMergerTest.getResourceMerger ( ) ; verifyResourceExists ( merger , "drawable/icon" , "drawable-ldpi-v4/icon" , "drawable/icon2" , "drawable/patch" , "raw/foo" , "layout/main" , "layout/layout_ref" , "layout/alias_replaced_by_file" , "layout/file_replaced_by_alias" , "drawable/color_drawable" , "drawable/drawable_ref" , "color/color" , "string/basic_string" , "string/xliff_string" , "string/xliff_with_carriage_return" , "string/styled_string" , "style/style" , "array/string_array" , "attr/dimen_attr" , "attr/string_attr" , "attr/enum_attr" , "attr/flag_attr" , "attr/blah" , "attr/blah2" , "attr/flagAttr" , "declare-styleable/declare_styleable" , "dimen/dimen" , "dimen-sw600dp-v13/offset" , "id/item_id" , "integer/integer" ) ; }
Source:
public java.lang.String getSimOperatorName ( ) { return getSimOperatorNameForPhone ( android.telephony.TelephonyManager.getDefaultPhone ( ) ) ; }

Target:
public java.lang.String getSimOperatorNumeric ( ) { int subId = android.telephony.SubscriptionManager.getDefaultDataSubscriptionId ( ) ; if ( ! ( android.telephony.SubscriptionManager.isUsableSubIdValue ( subId ) ) ) { subId = android.telephony.SubscriptionManager.getDefaultSmsSubscriptionId ( ) ; if ( ! ( android.telephony.SubscriptionManager.isUsableSubIdValue ( subId ) ) ) { subId = android.telephony.SubscriptionManager.getDefaultVoiceSubscriptionId ( ) ; if ( ! ( android.telephony.SubscriptionManager.isUsableSubIdValue ( subId ) ) ) { subId = android.telephony.SubscriptionManager.getDefaultSubscriptionId ( ) ; } } } return getSimOperatorNumeric ( subId ) ; }
Source:
public void testOnVendorSpecificHeadsetEvent_testCorrectAppleBatteryVsc ( ) { org.junit.Assert.assertNull ( mRemoteDevices.getDeviceProperties ( mDevice1 ) ) ; mRemoteDevices.onVendorSpecificHeadsetEvent ( com.android.bluetooth.btservice.RemoteDevicesTest.getVendorSpecificHeadsetEventIntent ( BluetoothHeadset.VENDOR_SPECIFIC_HEADSET_EVENT_IPHONEACCEV , BluetoothAssignedNumbers.APPLE , BluetoothHeadset.AT_CMD_TYPE_SET , new java.lang.Object [ ] { 3 , android.bluetooth.BluetoothHeadset.VENDOR_SPECIFIC_HEADSET_EVENT_IPHONEACCEV_BATTERY_LEVEL , 5 , 2 , 1 , 3 , 10 } , mDevice1 ) ) ; org.mockito.Mockito.verify ( mAdapterService ) . sendBroadcast ( mIntentArgument.capture ( ) , mStringArgument.capture ( ) ) ; com.android.bluetooth.btservice.RemoteDevicesTest.verfyBatteryLevelChangedIntent ( mDevice1 , 60 , mIntentArgument ) ; org.junit.Assert.assertEquals ( AdapterService.BLUETOOTH_PERM , mStringArgument.getValue ( ) ) ; }

Target:
public void testOnVendorSpecificHeadsetEvent_testCorrectAppleBatteryVsc ( ) { org.junit.Assert.assertNull ( mRemoteDevices.getDeviceProperties ( mDevice1 ) ) ; mRemoteDevices.onVendorSpecificHeadsetEvent ( com.android.bluetooth.btservice.RemoteDevicesTest.getVendorSpecificHeadsetEventIntent ( BluetoothHeadset.VENDOR_SPECIFIC_HEADSET_EVENT_IPHONEACCEV , BluetoothAssignedNumbers.APPLE , BluetoothHeadset.AT_CMD_TYPE_SET , new java.lang.Object [ ] { 3 , android.bluetooth.BluetoothHeadset.VENDOR_SPECIFIC_HEADSET_EVENT_IPHONEACCEV_BATTERY_LEVEL , 5 , 2 , 1 , 3 , 10 } , mDevice1 ) ) ; org.mockito.Mockito.verify ( mAdapterService ) . sendBroadcast ( mIntentArgument.capture ( ) , mStringArgument.capture ( ) ) ; com.android.bluetooth.btservice.RemoteDevicesTest.verifyBatteryLevelChangedIntent ( mDevice1 , 60 , mIntentArgument ) ; org.junit.Assert.assertEquals ( AdapterService.BLUETOOTH_PERM , mStringArgument.getValue ( ) ) ; }
Source:
public void testUpgradeKeepsPermissions ( ) throws java.lang.Exception { assertNull ( getDevice ( ) . installPackage ( com.android.cts.migration.MigrationHelper.getTestFile ( mCtsBuild , android.appsecurity.cts.PermissionsHostTest.APK_22 ) , false , false ) ) ; runDeviceTests ( android.appsecurity.cts.PermissionsHostTest.USES_PERMISSION_PKG , "com.android.cts.usepermission.UsePermissionTest22" , "testAllPermissionsGrantedByDefault" ) ; assertNull ( getDevice ( ) . installPackage ( com.android.cts.migration.MigrationHelper.getTestFile ( mCtsBuild , android.appsecurity.cts.PermissionsHostTest.APK_23 ) , true , false ) ) ; runDeviceTests ( android.appsecurity.cts.PermissionsHostTest.USES_PERMISSION_PKG , "com.android.cts.usepermission.UsePermissionTest23" , "testAllPermissionsGrantedOnUpgrade" ) ; }

Target:
public void testUpgradeKeepsPermissions ( ) throws java.lang.Exception { assertNull ( getDevice ( ) . installPackage ( com.android.cts.migration.MigrationHelper.getTestFile ( mCtsBuild , android.appsecurity.cts.PermissionsHostTest.APK_22 ) , false , false ) ) ; runDeviceTests ( android.appsecurity.cts.PermissionsHostTest.PKG , "com.android.cts.usepermission.UsePermissionTest22" , "testAllPermissionsGrantedByDefault" ) ; assertNull ( getDevice ( ) . installPackage ( com.android.cts.migration.MigrationHelper.getTestFile ( mCtsBuild , android.appsecurity.cts.PermissionsHostTest.APK_23 ) , true , false ) ) ; runDeviceTests ( android.appsecurity.cts.PermissionsHostTest.PKG , "com.android.cts.usepermission.UsePermissionTest23" , "testAllPermissionsGrantedOnUpgrade" ) ; }
Source:
public static boolean isInternalCategory2Type ( java.lang.String internalType ) { return ( ( internalType.length ( ) ) == 1 ) && ( ( ( internalType.charAt ( 0 ) ) == ( proguard.classfile.ClassConstants.INTERNAL_TYPE_LONG ) ) || ( ( internalType.charAt ( 0 ) ) == ( proguard.classfile.ClassConstants.INTERNAL_TYPE_DOUBLE ) ) ) ; }

Target:
public static boolean isInternalCategory2Type ( java.lang.String internalType ) { return ( ( internalType.length ( ) ) == 1 ) && ( ( ( internalType.charAt ( 0 ) ) == ( ClassConstants.TYPE_LONG ) ) || ( ( internalType.charAt ( 0 ) ) == ( ClassConstants.TYPE_DOUBLE ) ) ) ; }