auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void checkResourceContent ( @ javax.annotation.Nonnull com.android.sched.vfs.InputVFile candidateFile , @ javax.annotation.Nonnull java.io.File referenceFile ) throws java.io.IOException { java.io.BufferedReader candidateReader = null ; java.io.BufferedReader referenceReader = null ; try { candidateReader = new java.io.BufferedReader ( new java.io.InputStreamReader ( candidateFile.getInputStream ( ) ) ) ; referenceReader = new java.io.BufferedReader ( new java.io.InputStreamReader ( new java.io.FileInputStream ( referenceFile ) ) ) ; compareReadLines ( referenceReader , candidateReader ) ; } finally { if ( candidateReader != null ) { candidateReader.close ( ) ; } if ( referenceReader != null ) { referenceReader.close ( ) ; } } }

Target:
private static void checkResourceContent ( @ javax.annotation.Nonnull com.android.sched.vfs.InputVFile candidateFile , @ javax.annotation.Nonnull java.io.File referenceFile ) throws java.io.IOException { java.io.BufferedReader candidateReader = null ; java.io.BufferedReader referenceReader = null ; try { candidateReader = new java.io.BufferedReader ( new java.io.InputStreamReader ( candidateFile.getInputStream ( ) ) ) ; referenceReader = new java.io.BufferedReader ( new java.io.InputStreamReader ( new java.io.FileInputStream ( referenceFile ) ) ) ; com.android.jack.resource.ResourceTests.compareReadLines ( referenceReader , candidateReader ) ; } finally { if ( candidateReader != null ) { candidateReader.close ( ) ; } if ( referenceReader != null ) { referenceReader.close ( ) ; } } }
Source:
java.lang.Integer connIdByAddress ( int id , java.lang.String address ) { com.android.bluetooth.gatt.ContextMap < T > . App entry = getById ( id ) ; if ( entry == null ) return null ; java.util.Iterator < com.android.bluetooth.gatt.ContextMap < T > . Connection > i = mConnections.iterator ( ) ; while ( i.hasNext ( ) ) { com.android.bluetooth.gatt.ContextMap < T > . Connection connection = i.next ( ) ; if ( ( connection.address.equals ( address ) ) && ( ( connection.appId ) == id ) ) return connection.connId ; } return null ; }

Target:
java.lang.Integer connIdByAddress ( int id , java.lang.String address ) { com.android.bluetooth.gatt.ContextMap < T > . App entry = getById ( id ) ; if ( entry == null ) return null ; java.util.Iterator < com.android.bluetooth.gatt.ContextMap < T > . Connection > i = mConnections.iterator ( ) ; while ( i.hasNext ( ) ) { com.android.bluetooth.gatt.ContextMap < T > . Connection connection = i.next ( ) ; if ( ( connection.address.equalsIgnoreCase ( address ) ) && ( ( connection.appId ) == id ) ) return connection.connId ; } return null ; }
Source:
private static void addOptionalDirection ( java.util.EnumMap < com.ibm.icu.text.RelativeDateTimeFormatter.Direction , java.lang.String > unitStrings , com.ibm.icu.text.RelativeDateTimeFormatter.Direction direction , com.ibm.icu.impl.ICUResourceBundle bundle , java.lang.String key ) { java.lang.String s = bundle.findStringWithFallback ( key ) ; if ( s != null ) { unitStrings.put ( direction , s ) ; } }

Target:
private java.lang.String getRelativeUnitPluralPattern ( com.ibm.icu.text.RelativeDateTimeFormatter.Style style , com.ibm.icu.text.RelativeDateTimeFormatter.RelativeUnit unit , int pastFutureIndex , com.ibm.icu.impl.StandardPlural pluralForm ) { if ( pluralForm != ( com.ibm.icu.impl.StandardPlural.OTHER ) ) { java.lang.String formatter = getRelativeUnitPattern ( style , unit , pastFutureIndex , pluralForm ) ; if ( formatter != null ) { return formatter ; } } return getRelativeUnitPattern ( style , unit , pastFutureIndex , StandardPlural.OTHER ) ; }
Source:
private int convertPlayStateToPlayStatus ( android.media.session.PlaybackState state ) { int playStatus = com.android.bluetooth.avrcp.Avrcp.PLAYSTATUS_ERROR ; switch ( state.getState ( ) ) { case android.media.session.PlaybackState.STATE_PLAYING : case android.media.session.PlaybackState.STATE_BUFFERING : playStatus = com.android.bluetooth.avrcp.Avrcp.PLAYSTATUS_PLAYING ; break ; case android.media.session.PlaybackState.STATE_STOPPED : case android.media.session.PlaybackState.STATE_NONE : playStatus = com.android.bluetooth.avrcp.Avrcp.PLAYSTATUS_STOPPED ; break ; case android.media.session.PlaybackState.STATE_PAUSED : playStatus = com.android.bluetooth.avrcp.Avrcp.PLAYSTATUS_PAUSED ; break ; case android.media.session.PlaybackState.STATE_FAST_FORWARDING : case android.media.session.PlaybackState.STATE_SKIPPING_TO_NEXT : case android.media.session.PlaybackState.STATE_SKIPPING_TO_QUEUE_ITEM : playStatus = com.android.bluetooth.avrcp.Avrcp.PLAYSTATUS_FWD_SEEK ; break ; case android.media.session.PlaybackState.STATE_REWINDING : case android.media.session.PlaybackState.STATE_SKIPPING_TO_PREVIOUS : playStatus = com.android.bluetooth.avrcp.Avrcp.PLAYSTATUS_REV_SEEK ; break ; case android.media.session.PlaybackState.STATE_ERROR : playStatus = com.android.bluetooth.avrcp.Avrcp.PLAYSTATUS_ERROR ; break ; } return playStatus ; }

Target:
private byte getBluetoothPlayState ( android.media.session.PlaybackState pbState ) { if ( pbState == null ) { android.util.Log.w ( com.android.bluetooth.avrcp.Avrcp.TAG , "playState object null, sending STOPPED" ) ; return com.android.bluetooth.avrcp.Avrcp.PLAYSTATUS_STOPPED ; } switch ( pbState.getState ( ) ) { case android.media.session.PlaybackState.STATE_PLAYING : case android.media.session.PlaybackState.STATE_BUFFERING : return com.android.bluetooth.avrcp.Avrcp.PLAYSTATUS_PLAYING ; case android.media.session.PlaybackState.STATE_STOPPED : case android.media.session.PlaybackState.STATE_NONE : case android.media.session.PlaybackState.STATE_CONNECTING : return com.android.bluetooth.avrcp.Avrcp.PLAYSTATUS_STOPPED ; case android.media.session.PlaybackState.STATE_PAUSED : return com.android.bluetooth.avrcp.Avrcp.PLAYSTATUS_PAUSED ; case android.media.session.PlaybackState.STATE_FAST_FORWARDING : case android.media.session.PlaybackState.STATE_SKIPPING_TO_NEXT : case android.media.session.PlaybackState.STATE_SKIPPING_TO_QUEUE_ITEM : return com.android.bluetooth.avrcp.Avrcp.PLAYSTATUS_FWD_SEEK ; case android.media.session.PlaybackState.STATE_REWINDING : case android.media.session.PlaybackState.STATE_SKIPPING_TO_PREVIOUS : return com.android.bluetooth.avrcp.Avrcp.PLAYSTATUS_REV_SEEK ; case android.media.session.PlaybackState.STATE_ERROR : default : return com.android.bluetooth.avrcp.Avrcp.PLAYSTATUS_ERROR ; } }
Source:
private static void setAppState ( android.content.Context context , boolean install ) { if ( context == null ) { return ; } android.content.pm.PackageManager pm = context.getPackageManager ( ) ; if ( pm == null ) { return ; } android.content.ComponentName cName = new android.content.ComponentName ( "com.android.stk" , "com.android.stk.StkLauncherActivity" ) ; int state = ( install ) ? android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_ENABLED : android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED ; try { pm.setComponentEnabledSetting ( cName , state , PackageManager.DONT_KILL_APP ) ; } catch ( java.lang.Exception e ) { com.android.internal.telephony.gsm.stk.StkLog.d ( "StkAppInstaller" , "Could not change STK app state" ) ; } }

Target:
private static void setAppState ( android.content.Context context , boolean install ) { if ( context == null ) { return ; } android.content.pm.PackageManager pm = context.getPackageManager ( ) ; if ( pm == null ) { return ; } android.content.ComponentName cName = new android.content.ComponentName ( "com.android.stk" , "com.android.stk.StkLauncherActivity" ) ; int state = ( install ) ? android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_ENABLED : android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED ; try { pm.setComponentEnabledSetting ( cName , state , PackageManager.DONT_KILL_APP ) ; } catch ( java.lang.Exception e ) { com.android.internal.telephony.cat.CatLog.d ( "StkAppInstaller" , "Could not change STK app state" ) ; } }
Source:
public void testSubjectAltNameAndCn ( ) { assertFalse ( verifyWithServerCertificate ( "imap.g.com" , new libcore.javax.net.ssl.DefaultHostnameVerifierTest.StubX509Certificate ( "" ) . addSubjectAlternativeName ( libcore.javax.net.ssl.DefaultHostnameVerifierTest.ALT_DNS_NAME , "a.y.com" ) ) ) ; assertFalse ( verifyWithServerCertificate ( "imap.g.com" , new libcore.javax.net.ssl.DefaultHostnameVerifierTest.StubX509Certificate ( "cn=imap.g.com" ) . addSubjectAlternativeName ( libcore.javax.net.ssl.DefaultHostnameVerifierTest.ALT_DNS_NAME , "a.y.com" ) ) ) ; assertTrue ( verifyWithServerCertificate ( "imap.g.com" , new libcore.javax.net.ssl.DefaultHostnameVerifierTest.StubX509Certificate ( "" ) . addSubjectAlternativeName ( libcore.javax.net.ssl.DefaultHostnameVerifierTest.ALT_DNS_NAME , "imap.g.com" ) ) ) ; }

Target:
public void testVerify_matchesAltNameButNotCommonName ( ) { assertTrue ( verifyWithServerCertificate ( "imap.g.com" , new libcore.javax.net.ssl.DefaultHostnameVerifierTest.StubX509Certificate ( "Common Name" ) . addSubjectAlternativeName ( libcore.javax.net.ssl.DefaultHostnameVerifierTest.ALT_DNS_NAME , "imap.g.com" ) ) ) ; assertFalse ( verifyWithServerCertificate ( "imap.g.com" , new libcore.javax.net.ssl.DefaultHostnameVerifierTest.StubX509Certificate ( "imap.g.com" ) . addSubjectAlternativeName ( libcore.javax.net.ssl.DefaultHostnameVerifierTest.ALT_DNS_NAME , "example.com" ) ) ) ; }
Source:
private void disconnectAll ( ) { for ( com.android.bluetooth.hfpclient.connserv.HfpClientConnection connection : mConnections.values ( ) ) { connection.onHfpDisconnected ( ) ; } if ( ( mConference ) != null ) { mConference.destroy ( ) ; mConference = null ; } }

Target:
private synchronized void disconnectAll ( ) { for ( com.android.bluetooth.hfpclient.connserv.HfpClientConnection connection : mConnections.values ( ) ) { connection.onHfpDisconnected ( ) ; } mConnections.clear ( ) ; if ( ( mConference ) != null ) { mConference.destroy ( ) ; mConference = null ; } }
Source:
private void buildAssignVariableRef ( @ javax.annotation.Nonnull com.android.jack.dx.rop.code.RegisterSpec destReg , @ javax.annotation.Nonnull com.android.jack.ir.ast.JVariableRef vRef , @ javax.annotation.Nonnull com.android.jack.dx.rop.code.SourcePosition sourcePosition ) { com.android.jack.dx.rop.code.RegisterSpec valueReg = ropReg.getRegisterSpec ( vRef ) ; com.android.jack.dx.rop.code.RegisterSpecList sources = com.android.jack.dx.rop.code.RegisterSpecList.make ( valueReg ) ; addInstruction ( new com.android.jack.dx.rop.code.PlainInsn ( com.android.jack.dx.rop.code.Rops.opMove ( valueReg.getTypeBearer ( ) ) , sourcePosition , destReg , sources ) ) ; }

Target:
private void buildAssignVariableRef ( @ javax.annotation.Nonnull com.android.jack.dx.rop.code.RegisterSpec destReg , @ javax.annotation.Nonnull com.android.jack.ir.ast.JVariableRef vRef , @ javax.annotation.Nonnull com.android.jack.dx.rop.code.SourcePosition sourcePosition ) { com.android.jack.dx.rop.code.RegisterSpec valueReg = ropReg.getOrCreateRegisterSpec ( vRef ) ; com.android.jack.dx.rop.code.RegisterSpecList sources = com.android.jack.dx.rop.code.RegisterSpecList.make ( valueReg ) ; addInstruction ( new com.android.jack.dx.rop.code.PlainInsn ( com.android.jack.dx.rop.code.Rops.opMove ( valueReg.getTypeBearer ( ) ) , sourcePosition , destReg , sources ) ) ; }
Source:
public void sampleAllocation ( int count , java.lang.String desc , java.lang.Object newObj , long size ) { try { com.android.sched.util.log.Tracer tracer = com.android.sched.util.log.TracerFactory.getTracer ( ) ; if ( tracer.isTracing ( ) ) { com.android.sched.util.log.tracer.probe.HeapAllocationProbe.ThreadLocalCounting tlc = com.android.sched.util.log.tracer.probe.HeapAllocationProbe.alloc.get ( ) ; ( tlc.count ) ++ ; tlc.size += size ; tracer.registerObject ( newObj , size , count ) ; } } catch ( com.android.sched.util.config.ConfigurationError e ) { } }

Target:
public void sampleAllocation ( int count , java.lang.String desc , java.lang.Object newObj , long size ) { com.android.sched.util.log.Tracer tracer = com.android.sched.util.log.TracerFactory.getTracer ( ) ; try { if ( tracer.isTracing ( ) ) { com.android.sched.util.log.tracer.probe.HeapAllocationProbe.ThreadLocalCounting tlc = com.android.sched.util.log.tracer.probe.HeapAllocationProbe.alloc.get ( ) ; ( tlc.count ) ++ ; tlc.size += size ; tracer.registerObject ( newObj , size , count , getAllocationSite ( ) ) ; } } catch ( com.android.sched.util.config.ConfigurationError e ) { } }
Source:
public void testCreateFeatureWithNoPermissions ( ) throws android.os.RemoteException { org.mockito.Mockito.doThrow ( new java.lang.SecurityException ( ) ) . when ( mMockContext ) . enforceCallingOrSelfPermission ( org.mockito.Matchers.eq ( android.Manifest.permission.MODIFY_PHONE_STATE ) , org.mockito.Matchers.anyString ( ) ) ; try { mTestImsServiceBinder.createImsFeature ( android.telephony.ims.ImsServiceTest.TEST_SLOT_0 , ImsFeature.MMTEL , mTestCallback ) ; junit.framework.Assert.fail ( ) ; } catch ( java.lang.SecurityException e ) { } }

Target:
public void testImsServiceDownSentCompatInitializing ( ) throws android.os.RemoteException { mTestImsServiceBinder.createMMTelFeature ( android.telephony.ims.ImsServiceTest.TEST_SLOT_0 , mTestCallback ) ; mTestImsService.mSpyMMTelFeature.sendSetFeatureState ( ImsFeature.STATE_INITIALIZING ) ; org.mockito.ArgumentCaptor < android.content.Intent > intentCaptor = org.mockito.ArgumentCaptor.forClass ( android.content.Intent.class ) ; org.mockito.Mockito.verify ( mMockContext ) . sendBroadcast ( intentCaptor.capture ( ) ) ; try { junit.framework.Assert.assertNotNull ( intentCaptor.getValue ( ) ) ; verifyServiceDownSent ( intentCaptor.getValue ( ) ) ; } catch ( java.lang.IndexOutOfBoundsException e ) { junit.framework.Assert.fail ( "Did not receive all intents" ) ; } }
Source:
public void enter ( ) { log ( ( "Enter Disconnected: " + ( getCurrentMessage ( ) . what ) ) ) ; }

Target:
public void enter ( ) { log ( ( "Enter Disconnected: " + ( getCurrentMessage ( ) . what ) ) ) ; if ( ( ( ( mCurrentDevice ) != null ) || ( ( mTargetDevice ) != null ) ) || ( ( mIncomingDevice ) != null ) ) { loge ( ( ( ( ( ( "ERROR: enter() inconsistent state in Disconnected: current = " + ( mCurrentDevice ) ) + " target = " ) + ( mTargetDevice ) ) + " incoming = " ) + ( mIncomingDevice ) ) ) ; } removeMessages ( com.android.bluetooth.a2dp.A2dpStateMachine.CONNECT_TIMEOUT ) ; }
Source:
private void syncClirSetting ( ) { android.content.SharedPreferences sp = android.preference.PreferenceManager.getDefaultSharedPreferences ( getContext ( ) ) ; int clirSetting = sp.getInt ( ( ( CLIR_KEY ) + ( getPhoneId ( ) ) ) , ( - 1 ) ) ; if ( clirSetting >= 0 ) { mCi.setCLIR ( clirSetting , null ) ; } }

Target:
private void syncClirSetting ( ) { android.content.SharedPreferences sp = android.preference.PreferenceManager.getDefaultSharedPreferences ( getContext ( ) ) ; int clirSetting = sp.getInt ( ( ( CLIR_KEY ) + ( getPhoneId ( ) ) ) , ( - 1 ) ) ; android.telephony.Rlog.i ( com.android.internal.telephony.GsmCdmaPhone.LOG_TAG , ( ( ( ( "syncClirSetting: " + ( CLIR_KEY ) ) + ( getPhoneId ( ) ) ) + "=" ) + clirSetting ) ) ; if ( clirSetting >= 0 ) { mCi.setCLIR ( clirSetting , null ) ; } }
Source:
public void runCmdLine ( java.lang.String [ ] command ) throws java.io.IOException , java.lang.InterruptedException { java.lang.Process process = java.lang.Runtime.getRuntime ( ) . exec ( command ) ; if ( ( grabProcessOutput ( process ) ) != 0 ) { throw new java.lang.RuntimeException ( java.lang.String.format ( "running %s failed. see output" , command [ 0 ] ) ) ; } }

Target:
public void runCmdLine ( java.lang.String [ ] command ) throws java.io.IOException , java.lang.InterruptedException { java.lang.Process process = java.lang.Runtime.getRuntime ( ) . exec ( command ) ; if ( ( grabProcessOutput ( process ) ) != 0 ) { throw new java.lang.RuntimeException ( java.lang.String.format ( "Running %s failed. See output" , command [ 0 ] ) ) ; } }
Source:
public com.google.common.base.CharMatcher precomputed ( ) { return this ; }

Target:
static com.google.common.base.CharMatcher inRange ( final char startInclusive , final char endInclusive , java.lang.String description ) { return new com.google.common.base.CharMatcher.FastMatcher ( description ) { @ java.lang.Override public boolean matches ( char c ) { return ( startInclusive <= c ) && ( c <= endInclusive ) ; } @ com.google.common.annotations.GwtIncompatible ( value = "java.util.BitSet" ) @ java.lang.Override void setBits ( java.util.BitSet table ) { table.set ( startInclusive , ( endInclusive + 1 ) ) ; } } ; }
Source:
private static boolean matches ( java.lang.String regexp , java.lang.String str ) { java.util.regex.Pattern pattern = ( ( java.util.regex.Pattern ) ( javax.crypto.Cipher.Transform.patternCache.get ( regexp ) ) ) ; if ( pattern == null ) { pattern = java.util.regex.Pattern.compile ( regexp ) ; javax.crypto.Cipher.Transform.patternCache.putIfAbsent ( regexp , pattern ) ; } return pattern.matcher ( str.toUpperCase ( java.util.Locale.ENGLISH ) ) . matches ( ) ; }

Target:
static boolean matchAttribute ( java.security.Provider.Service service , java.lang.String attr , java.lang.String value ) { if ( value == null ) { return true ; } final java.lang.String pattern = service.getAttribute ( attr ) ; if ( pattern == null ) { return true ; } final java.lang.String valueUc = value.toUpperCase ( java.util.Locale.US ) ; return valueUc.matches ( pattern.toUpperCase ( java.util.Locale.US ) ) ; }
Source:
public java.lang.String loadValue ( java.lang.String key ) { java.lang.String value = mWifiNative.getNetworkVariable ( mNetId , key ) ; if ( ! ( android.text.TextUtils.isEmpty ( value ) ) ) { if ( ! ( enterpriseConfigKeyShouldBeQuoted ( key ) ) ) { value = com.android.server.wifi.WifiSupplicantControl.removeDoubleQuotes ( value ) ; } return value ; } else { return null ; } }

Target:
public java.lang.String loadValue ( java.lang.String key ) { java.lang.String value = mWifiNative.getNetworkVariable ( mNetId , key ) ; if ( ! ( android.text.TextUtils.isEmpty ( value ) ) ) { if ( ! ( enterpriseConfigKeyShouldBeQuoted ( key ) ) ) { value = android.net.wifi.WifiInfo.removeDoubleQuotes ( value ) ; } return value ; } else { return null ; } }
Source:
private int getNextDebuggerPort ( ) { synchronized ( mDebuggerPorts ) { if ( ( mDebuggerPorts.size ( ) ) > 0 ) { int port = mDebuggerPorts.get ( 0 ) ; mDebuggerPorts.remove ( 0 ) ; if ( ( mDebuggerPorts.size ( ) ) == 0 ) { mDebuggerPorts.add ( ( port + 1 ) ) ; } return port ; } } return - 1 ; }

Target:
private int getNextDebuggerPort ( ) { synchronized ( mDebuggerPorts ) { if ( ! ( mDebuggerPorts.isEmpty ( ) ) ) { int port = mDebuggerPorts.get ( 0 ) ; mDebuggerPorts.remove ( 0 ) ; if ( mDebuggerPorts.isEmpty ( ) ) { mDebuggerPorts.add ( ( port + 1 ) ) ; } return port ; } } return - 1 ; }
Source:
public void applyDeviceVolume ( int device ) { int index ; if ( isMuted ( ) ) { index = 0 ; } else if ( ( ( device & ( AudioSystem.DEVICE_OUT_ALL_A2DP ) ) != 0 ) && ( mAvrcpAbsVolSupported ) ) { index = ( ( mIndexMax ) + 5 ) / 10 ; } else { index = ( ( getIndex ( device ) ) + 5 ) / 10 ; } android.media.AudioSystem.setStreamVolumeIndex ( mStreamType , index , device ) ; }

Target:
public void applyDeviceVolume ( int device ) { int index ; if ( isMuted ( ) ) { index = 0 ; } else if ( ( ( ( device & ( AudioSystem.DEVICE_OUT_ALL_A2DP ) ) != 0 ) && ( mAvrcpAbsVolSupported ) ) || ( ( device & ( mFullVolumeDevices ) ) != 0 ) ) { index = ( ( mIndexMax ) + 5 ) / 10 ; } else { index = ( ( getIndex ( device ) ) + 5 ) / 10 ; } android.media.AudioSystem.setStreamVolumeIndex ( mStreamType , index , device ) ; }
Source:
void startCoreServices ( ) { debugLog ( "startCoreServices()" ) ; java.lang.Class [ ] supportedProfileServices = com.android.bluetooth.btservice.Config.getSupportedProfiles ( ) ; setAllProfileServiceStates ( supportedProfileServices , BluetoothAdapter.STATE_ON ) ; }

Target:
void startProfileServices ( ) { debugLog ( "startCoreServices()" ) ; java.lang.Class [ ] supportedProfileServices = com.android.bluetooth.btservice.Config.getSupportedProfiles ( ) ; if ( ( ( supportedProfileServices.length ) == 1 ) && ( com.android.bluetooth.gatt.GattService.class . getSimpleName ( ) . equals ( supportedProfileServices [ 0 ] . getSimpleName ( ) ) ) ) { updateUuids ( ) ; setBluetoothClassFromConfig ( ) ; mAdapterStateMachine.sendMessage ( AdapterState.BREDR_STARTED ) ; } else { setAllProfileServiceStates ( supportedProfileServices , BluetoothAdapter.STATE_ON ) ; } }
Source:
public void testMisMatchedCallStack ( ) { com.android.tools.perflib.vmtrace.CallStackReconstructor reconstructor = new com.android.tools.perflib.vmtrace.CallStackReconstructor ( ) ; reconstructor.addTraceAction ( 3 , TraceAction.METHOD_EXIT , 1 , 1 ) ; reconstructor.addTraceAction ( 2 , TraceAction.METHOD_EXIT , 2 , 2 ) ; reconstructor.addTraceAction ( 1 , TraceAction.METHOD_EXIT , 3 , 3 ) ; java.lang.String callStack = getCallStackInfo ( reconstructor.getTopLevelCallees ( ) ) ; assertEquals ( " -> 1 -> 2 -> 3" , callStack ) ; }

Target:
public void testMisMatchedCallStack ( ) { com.android.tools.perflib.vmtrace.CallStackReconstructor reconstructor = new com.android.tools.perflib.vmtrace.CallStackReconstructor ( 255 ) ; reconstructor.addTraceAction ( 3 , TraceAction.METHOD_EXIT , 1 , 1 ) ; reconstructor.addTraceAction ( 2 , TraceAction.METHOD_EXIT , 2 , 2 ) ; reconstructor.addTraceAction ( 1 , TraceAction.METHOD_EXIT , 3 , 3 ) ; java.lang.String callStack = reconstructor.getTopLevel ( ) . toString ( ) ; assertEquals ( " -> 255 -> 1 -> 2 -> 3" , callStack ) ; }
Source:
public static long getUidTxBytes ( int uid ) { final int callingUid = android.net.android.os.Process.myUid ( ) ; if ( ( callingUid == android.net.android.os.Process ) || ( callingUid == uid ) ) { return android.net.TrafficStats.nativeGetUidStat ( uid , android.net.TrafficStats.TYPE_TX_BYTES ) ; } else { return android.net.TrafficStats.UNSUPPORTED ; } }

Target:
public static long getLoopbackRxPackets ( ) { try { return android.net.TrafficStats.getStatsService ( ) . getIfaceStats ( android.net.TrafficStats.LOOPBACK_IFACE , android.net.TrafficStats.TYPE_RX_PACKETS ) ; } catch ( android.os.RemoteException e ) { throw e.rethrowFromSystemServer ( ) ; } }
Source:
private static com.android.chimpchat.core.IChimpBackend createBackendByName ( java.lang.String backendName ) { if ( "adb" . equals ( backendName ) ) { if ( ( com.android.chimpchat.ChimpChat.sAdbLocation ) == null ) { return new com.android.chimpchat.adb.AdbBackend ( ) ; } else { return new com.android.chimpchat.adb.AdbBackend ( com.android.chimpchat.ChimpChat.sAdbLocation ) ; } } else { return null ; } }

Target:
private static com.android.chimpchat.core.IChimpBackend createBackendByName ( java.lang.String backendName ) { if ( "adb" . equals ( backendName ) ) { return new com.android.chimpchat.adb.AdbBackend ( com.android.chimpchat.ChimpChat.sAdbLocation , com.android.chimpchat.ChimpChat.sNoInitAdb ) ; } else { return null ; } }
Source:
public static void w ( java.lang.Object objectPrefix , java.lang.String format , java.lang.Object ... args ) { if ( android.telecom.Log.WARN ) { android.util.Log.w ( android.telecom.Log.TAG , android.telecom.Log.buildMessage ( android.telecom.Log.getPrefixFromObject ( objectPrefix ) , format , args ) ) ; } }

Target:
public static void v ( java.lang.Object objectPrefix , java.lang.String format , java.lang.Object ... args ) { if ( android.telecom.Log.sIsUserExtendedLoggingEnabled ) { android.telecom.Log.maybeDisableLogging ( ) ; android.util.Slog.i ( android.telecom.Log.TAG , android.telecom.Log.buildMessage ( android.telecom.Log.getPrefixFromObject ( objectPrefix ) , format , args ) ) ; } else if ( android.telecom.Log.VERBOSE ) { android.util.Slog.v ( android.telecom.Log.TAG , android.telecom.Log.buildMessage ( android.telecom.Log.getPrefixFromObject ( objectPrefix ) , format , args ) ) ; } }
Source:
public void dup2_x1 ( ) { super . dup2_x1 ( ) ; producerPop ( ) ; producerPop ( ) ; producerPop ( ) ; producerPush ( ) ; producerPush ( ) ; producerPush ( ) ; producerPush ( ) ; producerPush ( ) ; }

Target:
public void dup_x1 ( ) { super . dup_x1 ( ) ; producerStack.pop ( ) ; producerStack.pop ( ) ; producerStack.push ( producerValue ) ; producerStack.push ( producerValue ) ; producerStack.push ( producerValue ) ; actualProducerStack.dup_x1 ( ) ; }
Source:
private void run ( @ javax.annotation.Nonnull com.android.jack.test.runtime.RuntimeTestInfo rti ) throws java.lang.Exception { new com.android.jack.test.helper.RuntimeTestHelper ( rti ) . addProperty ( Options.ANDROID_MIN_API_LEVEL.getName ( ) , java.lang.String.valueOf ( AndroidCompatibilityChecker.N_API_LEVEL ) ) . setSourceLevel ( SourceLevel.JAVA_8 ) . addIgnoredCandidateToolchain ( com.android.jack.test.toolchain.JillBasedToolchain.class ) . addIgnoredCandidateToolchain ( com.android.jack.test.toolchain.JackApiV01.class ) . compileAndRunTest ( ) ; }

Target:
public void testDefaultMethod018 ( ) throws java.lang.Exception { new com.android.jack.test.helper.RuntimeTestHelper ( DEFAULTMETHOD018 ) . addProperty ( Options.ANDROID_MIN_API_LEVEL.getName ( ) , java.lang.String.valueOf ( AndroidCompatibilityChecker.N_API_LEVEL ) ) . setSourceLevel ( SourceLevel.JAVA_8 ) . addIgnoredCandidateToolchain ( com.android.jack.test.toolchain.JackApiV01.class ) . addIgnoredCandidateToolchain ( com.android.jack.test.toolchain.JillBasedToolchain.class ) . compileAndRunTest ( ) ; }
Source:
public void testConnectWithConfig ( ) { android.net.wifi.aware.ConfigRequest configRequest = new android.net.wifi.aware.ConfigRequest.Builder ( ) . setMasterPreference ( 55 ) . build ( ) ; java.lang.String callingPackage = "com.google.somePackage" ; mDut.connect ( mBinderMock , callingPackage , mCallbackMock , configRequest , false ) ; org.mockito.Mockito.verify ( mAwareStateManagerMock ) . connect ( org.mockito.Matchers.anyInt ( ) , org.mockito.Matchers.anyInt ( ) , org.mockito.Matchers.anyInt ( ) , org.mockito.Matchers.eq ( callingPackage ) , org.mockito.Matchers.eq ( mCallbackMock ) , org.mockito.Matchers.eq ( configRequest ) , org.mockito.Matchers.eq ( false ) ) ; }

Target:
public void testConnectWithConfig ( ) { android.net.wifi.aware.ConfigRequest configRequest = new android.net.wifi.aware.ConfigRequest.Builder ( ) . setMasterPreference ( 55 ) . build ( ) ; java.lang.String callingPackage = "com.google.somePackage" ; mDut.connect ( mBinderMock , callingPackage , mCallbackMock , configRequest , false ) ; org.mockito.Mockito.verify ( mAwareStateManagerMock ) . connect ( org.mockito.ArgumentMatchers.anyInt ( ) , org.mockito.ArgumentMatchers.anyInt ( ) , org.mockito.ArgumentMatchers.anyInt ( ) , org.mockito.ArgumentMatchers.eq ( callingPackage ) , org.mockito.ArgumentMatchers.eq ( mCallbackMock ) , org.mockito.ArgumentMatchers.eq ( configRequest ) , org.mockito.ArgumentMatchers.eq ( false ) ) ; }
Source:
private void testExplicitPositionMatchParent ( ) { doLayoutParamTest ( ( android.view.WindowManager.LayoutParams params ) -> { params.width = WindowManager.LayoutParams.MATCH_PARENT ; params.height = WindowManager.LayoutParams.MATCH_PARENT ; params.x = 100 ; params.y = 100 ; } ) ; }

Target:
private void testExplicitSizeBottomRightGravity ( ) { doLayoutParamTest ( ( android.view.WindowManager.LayoutParams params ) -> { params.width = ( 200 - ( mOutsets.left ) ) - ( mOutsets.right ) ; params.height = ( 200 - ( mOutsets.bottom ) ) - ( mOutsets.top ) ; params.gravity = ( android.view.Gravity.BOTTOM ) | ( android.view.Gravity.RIGHT ) ; } ) ; }
Source:
public static com.intellij.execution.testframework.ui.BaseTestsOutputConsoleView createAndAttachConsole ( @ org.jetbrains.annotations.NotNull final java.lang.String testFrameworkName , @ org.jetbrains.annotations.NotNull final com.intellij.execution.process.ProcessHandler processHandler , @ org.jetbrains.annotations.NotNull final com.intellij.execution.testframework.TestConsoleProperties consoleProperties , com.intellij.execution.runners.ExecutionEnvironment environment ) throws com.intellij.execution.ExecutionException { com.intellij.execution.testframework.ui.BaseTestsOutputConsoleView console = com.google.gct.testing.results.GoogleCloudTestResultsConnectionUtil.createConsole ( testFrameworkName , consoleProperties , environment ) ; console.attachToProcess ( processHandler ) ; return console ; }

Target:
public static com.intellij.execution.testframework.ui.BaseTestsOutputConsoleView createAndAttachConsole ( @ org.jetbrains.annotations.NotNull final java.lang.String testFrameworkName , @ org.jetbrains.annotations.NotNull final com.intellij.execution.process.ProcessHandler processHandler , @ org.jetbrains.annotations.NotNull final com.intellij.execution.testframework.TestConsoleProperties consoleProperties , com.intellij.execution.runners.ExecutionEnvironment environment , @ org.jetbrains.annotations.NotNull final com.google.gct.testing.CloudMatrixExecutionCancellator matrixExecutionCancellator ) throws com.intellij.execution.ExecutionException { com.intellij.execution.testframework.ui.BaseTestsOutputConsoleView console = com.google.gct.testing.results.GoogleCloudTestResultsConnectionUtil.createConsole ( testFrameworkName , consoleProperties , environment , matrixExecutionCancellator ) ; console.attachToProcess ( processHandler ) ; return console ; }
Source:
public void annotate ( com.android.dx.util.ExceptionWithContext ex ) { int limit = ( stackPtr ) - 1 ; for ( int i = 0 ; i <= limit ; i ++ ) { java.lang.String idx = ( i == limit ) ? "top0" : com.android.dx.util.Hex.u2 ( ( limit - i ) ) ; ex.addContext ( ( ( ( "stack[" + idx ) + "]: " ) + ( com.android.dx.cf.code.ExecutionStack.stackElementString ( stack [ i ] ) ) ) ) ; } }

Target:
public void annotate ( com.android.dex.util.ExceptionWithContext ex ) { int limit = ( stackPtr ) - 1 ; for ( int i = 0 ; i <= limit ; i ++ ) { java.lang.String idx = ( i == limit ) ? "top0" : com.android.dx.util.Hex.u2 ( ( limit - i ) ) ; ex.addContext ( ( ( ( "stack[" + idx ) + "]: " ) + ( com.android.dx.cf.code.ExecutionStack.stackElementString ( stack [ i ] ) ) ) ) ; } }
Source:
public void copy3DRangeFrom ( int xoff , int yoff , int zoff , int w , int h , int d , long [ ] data ) { validateIsInt64 ( ) ; copy3DRangeFromUnchecked ( xoff , yoff , zoff , w , h , d , data ) ; }

Target:
private void copy3DRangeFromUnchecked ( int xoff , int yoff , int zoff , int w , int h , int d , java.lang.Object array , android.support.v8.renderscript.Element.DataType dt , int arrayLen ) { mRS.validate ( ) ; validate3DRange ( xoff , yoff , zoff , w , h , d ) ; mRS.nAllocationData3D ( getIDSafe ( ) , xoff , yoff , zoff , mSelectedLOD , w , h , d , array , ( arrayLen * ( dt.mSize ) ) , dt ) ; }
Source:
private void sendByChannel ( java.lang.String data , java.net.InetSocketAddress address ) throws java.lang.Exception { try { assertEquals ( data.length ( ) , this . channel2.send ( java.nio.ByteBuffer.wrap ( data.getBytes ( ) ) , address ) ) ; } finally { this . channel2.close ( ) ; } }

Target:
private void sendOnChannel2 ( java.lang.String data , java.net.SocketAddress address ) throws java.io.IOException { assertEquals ( data.length ( ) , channel2.send ( java.nio.ByteBuffer.wrap ( data.getBytes ( ) ) , address ) ) ; }
Source:
public void copyFrom ( byte [ ] d ) { 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 ) ; } }

Target:
public void copyFrom ( byte [ ] d ) { validateIsInt8 ( ) ; copyFromUnchecked ( d , Element.DataType.SIGNED_8 , d.length ) ; }
Source:
public void addTestCase ( com.android.vts.entity.TestCaseRunEntity testCase ) { if ( ( testCase.result ) > ( resultCounts.length ) ) return ; ++ ( resultCounts [ testCase.result ] ) ; com.android.vts.util.TestRunDetails.ResultColumn column = columns [ testCase.result ] ; column.add ( testCase.testCaseName ) ; }

Target:
public void addTestCase ( com.android.vts.entity.TestCaseRunEntity testCaseEntity ) { for ( com.android.vts.entity.TestCaseRunEntity.TestCase testCase : testCaseEntity.testCases ) { int result = testCase.result ; if ( result > ( resultCounts.length ) ) continue ; ++ ( resultCounts [ result ] ) ; com.android.vts.util.TestRunDetails.ResultColumn column = columns [ result ] ; column.add ( testCase.name ) ; } }
Source:
private static void putMtu ( java.nio.ByteBuffer ra , int mtu ) { final byte ND_OPTION_MTU = 5 ; final byte MTU_NUM_8OCTETS = 1 ; ra.put ( ND_OPTION_MTU ) . put ( MTU_NUM_8OCTETS ) . putShort ( android.net.ip.RouterAdvertisementDaemon.asShort ( 0 ) ) . putInt ( ( mtu < ( android.net.ip.RouterAdvertisementDaemon.IPV6_MIN_MTU ) ? android.net.ip.RouterAdvertisementDaemon.IPV6_MIN_MTU : mtu ) ) ; }

Target:
private static void putMtu ( java.nio.ByteBuffer ra , int mtu ) { final byte ND_OPTION_MTU = 5 ; final byte MTU_NUM_8OCTETS = 1 ; ra.put ( ND_OPTION_MTU ) . put ( MTU_NUM_8OCTETS ) . putShort ( android.net.ip.RouterAdvertisementDaemon.asShort ( 0 ) ) . putInt ( ( mtu < ( android.net.util.NetworkConstants.IPV6_MIN_MTU ) ? android.net.util.NetworkConstants.IPV6_MIN_MTU : mtu ) ) ; }
Source:
public void rilConnected ( int indicationType ) { }

Target:
public void rilConnected ( int indicationType ) { mRil.processIndication ( indicationType ) ; if ( RIL.RILJ_LOGD ) mRil.unsljLog ( com.android.internal.telephony.RILConstants.RIL_UNSOL_RIL_CONNECTED ) ; mRil.setRadioPower ( false , null ) ; mRil.setCdmaSubscriptionSource ( mRil.mCdmaSubscription , null ) ; mRil.setCellInfoListRate ( ) ; mRil.notifyRegistrantsRilConnectionChanged ( 15 ) ; mRil.updateScreenState ( true ) ; }
Source:
synchronized void nAllocationData3D ( long id , int xoff , int yoff , int zoff , int mip , int w , int h , int depth , java.lang.Object d , int sizeBytes , android.renderscript.Element.DataType dt ) { validate ( ) ; rsnAllocationData3D ( mContext , id , xoff , yoff , zoff , mip , w , h , depth , d , sizeBytes , dt.mID ) ; }

Target:
synchronized void nAllocationRead3D ( long id , int xoff , int yoff , int zoff , int mip , int w , int h , int depth , java.lang.Object d , int sizeBytes , android.renderscript.Element.DataType dt , int mSize , boolean usePadding ) { validate ( ) ; rsnAllocationRead3D ( mContext , id , xoff , yoff , zoff , mip , w , h , depth , d , sizeBytes , dt.mID , mSize , usePadding ) ; }
Source:
static final < K , V > java.util.concurrent.ConcurrentHashMap.HashEntry < K , V > [ ] newArray ( int i ) { return new java.util.concurrent.ConcurrentHashMap.HashEntry [ i ] ; }

Target:
static final < K , V > void setEntryAt ( java.util.concurrent.ConcurrentHashMap.HashEntry < K , V > [ ] tab , int i , java.util.concurrent.ConcurrentHashMap.HashEntry < K , V > e ) { java.util.concurrent.ConcurrentHashMap.UNSAFE.putOrderedObject ( tab , ( ( ( ( long ) ( i ) ) << ( java.util.concurrent.ConcurrentHashMap.TSHIFT ) ) + ( java.util.concurrent.ConcurrentHashMap.TBASE ) ) , e ) ; }
Source:
public java.lang.String nextPackageToClean ( java.lang.String lastPackage ) { synchronized ( mPackages ) { if ( ! ( isExternalMediaAvailable ( ) ) ) { return null ; } if ( lastPackage != null ) { mSettings.mPackagesToBeCleaned.remove ( lastPackage ) ; } return ( mSettings.mPackagesToBeCleaned.size ( ) ) > 0 ? mSettings.mPackagesToBeCleaned.get ( 0 ) : null ; } }

Target:
public android.content.pm.PackageCleanItem nextPackageToClean ( android.content.pm.PackageCleanItem lastPackage ) { synchronized ( mPackages ) { if ( ! ( isExternalMediaAvailable ( ) ) ) { return null ; } final java.util.ArrayList < android.content.pm.PackageCleanItem > pkgs = mSettings.mPackagesToBeCleaned ; if ( lastPackage != null ) { pkgs.remove ( lastPackage ) ; } if ( ( pkgs.size ( ) ) > 0 ) { return pkgs.get ( 0 ) ; } } return null ; }
Source:
public void test_wrap_01 ( ) throws java.lang.Exception { prepareEngines ( ) ; doHandshake ( ) ; java.nio.ByteBuffer bbs = java.nio.ByteBuffer.allocate ( 100 ) ; java.nio.ByteBuffer bbd = java.nio.ByteBuffer.allocate ( tests.api.javax.net.ssl.SSLEngineTest.MAX_TLS_RECORD_SIZE ) ; clientEngine.engine.wrap ( new java.nio.ByteBuffer [ ] { bbs } , 0 , 1 , bbd ) ; }

Target:
public void test_wrap_01 ( ) throws java.lang.Exception { prepareEngines ( ) ; doHandshake ( ) ; java.nio.ByteBuffer bbs = java.nio.ByteBuffer.allocate ( 100 ) ; java.nio.ByteBuffer bbd = java.nio.ByteBuffer.allocate ( org.apache.harmony.tests.javax.net.ssl.SSLEngineTest.MAX_TLS_RECORD_SIZE ) ; clientEngine.engine.wrap ( new java.nio.ByteBuffer [ ] { bbs } , 0 , 1 , bbd ) ; }
Source:
protected static java.io.InputStream getXsdStream ( java.lang.String rootElement , int version ) { java.lang.String filename = java.lang.String.format ( "%1$s-%2$02d.xsd" , rootElement , version ) ; java.io.InputStream stream = null ; try { stream = com.android.sdklib.repository.RepoXsdUtil.class . getResourceAsStream ( filename ) ; } catch ( java.lang.Exception e ) { } if ( stream == null ) { filename = java.lang.String.format ( "-%1$s-%2$02d.xsd" , rootElement , version ) ; try { stream = com.android.sdklib.repository.RepoXsdUtil.class . getResourceAsStream ( filename ) ; } catch ( java.lang.Exception e ) { } } return stream ; }

Target:
public void startElement ( java.lang.String uri , java.lang.String localName , java.lang.String name , org.xml.sax.Attributes attributes ) throws org.xml.sax.SAXException { name = name.substring ( ( ( name.indexOf ( ':' ) ) + 1 ) ) ; if ( ( name.equals ( com.android.sdklib.repository.RepoXsdUtil.NODE_IMPORT ) ) || ( name.equals ( com.android.sdklib.repository.RepoXsdUtil.NODE_INCLUDE ) ) ) { java.lang.String importFile = attributes.getValue ( com.android.sdklib.repository.RepoXsdUtil.ATTR_SCHEMA_LOCATION ) ; streams.add ( new javax.xml.transform.stream.StreamSource ( com.android.sdklib.repository.RepoXsdUtil.class . getResourceAsStream ( importFile ) ) ) ; } }
Source:
private void cmdDumpsys ( java.io.FileDescriptor fd , java.io.PrintWriter pw , java.lang.String [ ] args ) { final android.net.ConnectivityMetricsEvent [ ] events ; synchronized ( mLock ) { events = mEventLog.toArray ( ) ; } for ( android.net.ConnectivityMetricsEvent ev : events ) { pw.println ( ev.toString ( ) ) ; } if ( ( mNetdListener ) != null ) { mNetdListener.list ( pw ) ; } }

Target:
private void cmdDumpsys ( java.io.FileDescriptor fd , java.io.PrintWriter pw , java.lang.String [ ] args ) { final android.net.ConnectivityMetricsEvent [ ] events ; synchronized ( mLock ) { events = mEventLog.toArray ( ) ; } for ( android.net.ConnectivityMetricsEvent ev : events ) { pw.println ( ev.toString ( ) ) ; } if ( ( mNetdListener ) != null ) { mNetdListener.list ( pw ) ; } mDefaultNetworkMetrics.listEvents ( pw ) ; }
Source:
public void test_with_adjustment_AmPm ( ) { java.time.OffsetTime test = TEST_11_30_59_500_PONE.with ( new java.time.temporal.TemporalAdjuster ( ) { @ java.lang.Override public java.time.temporal.Temporal adjustInto ( java.time.temporal.Temporal dateTime ) { return dateTime.with ( java.time.temporal.ChronoField.HOUR_OF_DAY , 23 ) ; } } ) ; org.testng.Assert.assertEquals ( test , java.time.OffsetTime.of ( 23 , 30 , 59 , 500 , tck.java.time.TCKOffsetTime.OFFSET_PONE ) ) ; }

Target:
public void test_with_adjustment_AmPm ( ) { java.time.OffsetTime test = tck.java.time.TCKOffsetTime.TEST_11_30_59_500_PONE.with ( new java.time.temporal.TemporalAdjuster ( ) { @ java.lang.Override public java.time.temporal.Temporal adjustInto ( java.time.temporal.Temporal dateTime ) { return dateTime.with ( java.time.temporal.ChronoField.HOUR_OF_DAY , 23 ) ; } } ) ; org.testng.Assert.assertEquals ( test , java.time.OffsetTime.of ( 23 , 30 , 59 , 500 , tck.java.time.TCKOffsetTime.OFFSET_PONE ) ) ; }
Source:
protected void onHandleIntent ( android.content.Intent intent ) { android.util.Log.d ( com.android.tests.bandwidthenforcement.BandwidthEnforcementTestService.TAG , "Trying to establish a connection." ) ; java.lang.String outputFile = intent.getStringExtra ( com.android.tests.bandwidthenforcement.BandwidthEnforcementTestService.OUTPUT_FILE ) ; com.android.tests.bandwidthenforcement.BandwidthEnforcementTestService.dumpResult ( "testUrlConnection" , com.android.tests.bandwidthenforcement.BandwidthEnforcementTestService.testUrlConnection ( ) , outputFile ) ; com.android.tests.bandwidthenforcement.BandwidthEnforcementTestService.dumpResult ( "testUrlConnectionv6" , com.android.tests.bandwidthenforcement.BandwidthEnforcementTestService.testUrlConnectionv6 ( ) , outputFile ) ; com.android.tests.bandwidthenforcement.BandwidthEnforcementTestService.dumpResult ( "testSntp" , com.android.tests.bandwidthenforcement.BandwidthEnforcementTestService.testSntp ( ) , outputFile ) ; com.android.tests.bandwidthenforcement.BandwidthEnforcementTestService.dumpResult ( "testDns" , com.android.tests.bandwidthenforcement.BandwidthEnforcementTestService.testDns ( ) , outputFile ) ; }

Target:
protected void onHandleIntent ( android.content.Intent intent ) { android.util.Log.d ( com.android.tests.bandwidthenforcement.BandwidthEnforcementTestService.TAG , "Trying to establish a connection." ) ; java.lang.String outputFile = intent.getStringExtra ( com.android.tests.bandwidthenforcement.BandwidthEnforcementTestService.OUTPUT_FILE ) ; com.android.tests.bandwidthenforcement.BandwidthEnforcementTestService.dumpResult ( "testUrlConnection" , com.android.tests.bandwidthenforcement.BandwidthEnforcementTestService.testUrlConnection ( ) , outputFile ) ; com.android.tests.bandwidthenforcement.BandwidthEnforcementTestService.dumpResult ( "testUrlConnectionv6" , com.android.tests.bandwidthenforcement.BandwidthEnforcementTestService.testUrlConnectionv6 ( ) , outputFile ) ; com.android.tests.bandwidthenforcement.BandwidthEnforcementTestService.dumpResult ( "testSntp" , com.android.tests.bandwidthenforcement.BandwidthEnforcementTestService.testSntp ( getApplicationContext ( ) ) , outputFile ) ; com.android.tests.bandwidthenforcement.BandwidthEnforcementTestService.dumpResult ( "testDns" , com.android.tests.bandwidthenforcement.BandwidthEnforcementTestService.testDns ( ) , outputFile ) ; }
Source:
private void startAlert ( ) { if ( ( mToneGenerator ) == null ) { mToneGenerator = new android.media.ToneGenerator ( android.media.AudioManager.STREAM_VOICE_CALL , com.android.services.telephony.EmergencyTonePlayer.ALERT_RELATIVE_VOLUME_PERCENT ) ; mSavedInCallVolume = mAudioManager.getStreamVolume ( AudioManager.STREAM_VOICE_CALL ) ; mAudioManager.setStreamVolume ( AudioManager.STREAM_VOICE_CALL , mAudioManager.getStreamMaxVolume ( AudioManager.STREAM_VOICE_CALL ) , 0 ) ; mToneGenerator.startTone ( ToneGenerator.TONE_CDMA_EMERGENCY_RINGBACK ) ; } else { com.android.services.telephony.Log.d ( this , "An alert is already running." ) ; } }

Target:
private void startAlert ( ) { int ringerMode = mAudioManager.getRingerMode ( ) ; if ( ringerMode != ( android.media.AudioManager.RINGER_MODE_NORMAL ) ) { com.android.services.telephony.Log.i ( this , "startAlert: skipping emergency tone due to ringer mode %d" , ringerMode ) ; return ; } if ( ( mToneGenerator ) == null ) { mToneGenerator = new android.media.ToneGenerator ( android.media.AudioManager.STREAM_VOICE_CALL , com.android.services.telephony.EmergencyTonePlayer.ALERT_RELATIVE_VOLUME_PERCENT ) ; mSavedInCallVolume = mAudioManager.getStreamVolume ( AudioManager.STREAM_VOICE_CALL ) ; mAudioManager.setStreamVolume ( AudioManager.STREAM_VOICE_CALL , mAudioManager.getStreamMaxVolume ( AudioManager.STREAM_VOICE_CALL ) , 0 ) ; mToneGenerator.startTone ( ToneGenerator.TONE_CDMA_EMERGENCY_RINGBACK ) ; } }
Source:
public boolean checkConfigOverridePermission ( int uid ) { try { int permission = mFacade.checkUidPermission ( android.Manifest.permission.OVERRIDE_WIFI_CONFIG , uid ) ; return permission == ( android.content.pm.PackageManager.PERMISSION_GRANTED ) ; } catch ( android.os.RemoteException e ) { android.util.Log.e ( com.android.server.wifi.WifiConfigManagerNew.TAG , ( "Error checking for permission " + e ) ) ; return false ; } }

Target:
public boolean checkConfigOverridePermission ( int uid ) { try { int permission = mFacade.checkUidPermission ( android.Manifest.permission.OVERRIDE_WIFI_CONFIG , uid ) ; return permission == ( android.content.pm.PackageManager.PERMISSION_GRANTED ) ; } catch ( android.os.RemoteException e ) { android.util.Log.e ( com.android.server.wifi.WifiConfigManager.TAG , ( "Error checking for permission " + e ) ) ; return false ; } }
Source:
public void sendSingleScanRequestWithNoResults ( ) throws java.lang.Exception { android.net.wifi.WifiScanner.ScanSettings requestSettings = createRequest ( WifiScanner.WIFI_BAND_BOTH , 0 , 0 , 20 , WifiScanner.REPORT_EVENT_AFTER_EACH_SCAN ) ; doSuccessfulSingleScan ( requestSettings , computeSingleScanNativeSettings ( requestSettings ) , com.android.server.wifi.ScanResults.create ( 0 , new int [ 0 ] ) ) ; }

Target:
public void sendSingleScanRequestWithNoResults ( ) throws java.lang.Exception { android.net.wifi.WifiScanner.ScanSettings requestSettings = com.android.server.wifi.ScanTestUtil.createRequest ( WifiScanner.WIFI_BAND_BOTH , 0 , 0 , 20 , WifiScanner.REPORT_EVENT_AFTER_EACH_SCAN ) ; doSuccessfulSingleScan ( requestSettings , com.android.server.wifi.ScanTestUtil.computeSingleScanNativeSettings ( requestSettings ) , com.android.server.wifi.ScanResults.create ( 0 , new int [ 0 ] ) ) ; }
Source:
public void testLicenseIdNotFound ( ) throws java.lang.Exception { java.lang.String document = ( ( ( ( ( ( "<?xml version=\"1.0\"?>" + ( com.android.sdklib.repository.SdkRepositoryTest.OPEN_TAG ) ) + "<r:license id=\"lic1\"> some license </r:license> " ) + "<r:tool> <r:uses-license ref=\"lic2\" /> <r:revision>1</r:revision> " ) + "<r:min-platform-tools-rev>1</r:min-platform-tools-rev> " ) + "<r:archives> <r:archive os=\"any\"> <r:size>1</r:size> <r:checksum>2822ae37115ebf13412bbef91339ee0d9454525e</r:checksum> " ) + "<r:url>url</r:url> </r:archive> </r:archives> </r:tool>" ) + ( com.android.sdklib.repository.SdkRepositoryTest.CLOSE_TAG ) ; javax.xml.transform.Source source = new javax.xml.transform.stream.StreamSource ( new java.io.StringReader ( document ) ) ; javax.xml.validation.Validator validator = getValidator ( SdkRepoConstants.NS_LATEST_VERSION , null ) ; try { validator.validate ( source ) ; } catch ( org.xml.sax.SAXParseException e ) { assertRegex ( "cvc-id.1: There is no ID/IDREF binding for IDREF 'lic2'.*" , e.getMessage ( ) ) ; return ; } fail ( ) ; }

Target:
public void testLicenseIdNotFound ( ) throws java.lang.Exception { java.lang.String document = ( ( ( ( ( ( "<?xml version=\"1.0\"?>" + ( com.android.sdklib.repository.SdkRepositoryTest.OPEN_TAG ) ) + "<r:license id=\"lic1\"> some license </r:license> " ) + "<r:tool> <r:uses-license ref=\"lic2\" /> <r:revision>1</r:revision> " ) + "<r:min-platform-tools-rev>1</r:min-platform-tools-rev> " ) + "<r:archives> <r:archive os=\"any\"> <r:size>1</r:size> <r:checksum>2822ae37115ebf13412bbef91339ee0d9454525e</r:checksum> " ) + "<r:url>url</r:url> </r:archive> </r:archives> </r:tool>" ) + ( com.android.sdklib.repository.SdkRepositoryTest.CLOSE_TAG ) ; javax.xml.transform.Source source = new javax.xml.transform.stream.StreamSource ( new java.io.StringReader ( document ) ) ; javax.xml.validation.Validator validator = getRepoValidator ( SdkRepoConstants.NS_LATEST_VERSION , null ) ; try { validator.validate ( source ) ; } catch ( org.xml.sax.SAXParseException e ) { assertRegex ( "cvc-id.1: There is no ID/IDREF binding for IDREF 'lic2'.*" , e.getMessage ( ) ) ; return ; } fail ( ) ; }
Source:
void setTask ( com.android.server.am.TaskRecord newTask , com.android.server.am.TaskRecord taskToAffiliateWith ) { if ( ( ( task ) != null ) && ( task.removeActivity ( this ) ) ) { if ( ( task ) != newTask ) { task.stack.removeTask ( task ) ; } else { android.util.Slog.d ( com.android.server.am.ActivityRecord.TAG , ( "!!! REMOVE THIS LOG !!! setTask: nearly removed stack=" + ( newTask == null ? null : newTask.stack ) ) ) ; } } task = newTask ; setTaskToAffiliateWith ( taskToAffiliateWith ) ; }

Target:
void setTask ( com.android.server.am.TaskRecord newTask , com.android.server.am.TaskRecord taskToAffiliateWith ) { if ( ( ( task ) != null ) && ( task.removeActivity ( this ) ) ) { if ( ( task ) != newTask ) { task.stack.removeTask ( task , "setTask" ) ; } else { android.util.Slog.d ( com.android.server.am.ActivityRecord.TAG , ( "!!! REMOVE THIS LOG !!! setTask: nearly removed stack=" + ( newTask == null ? null : newTask.stack ) ) ) ; } } task = newTask ; setTaskToAffiliateWith ( taskToAffiliateWith ) ; }