auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public java.util.List < com.android.sdklib.devices.Device > getUserDevices ( ) { synchronized ( this ) { if ( ( mUserDevices ) == null ) { mUserDevices = new java.util.ArrayList < com.android.sdklib.devices.Device > ( ) ; try { java.io.File userDevicesFile = new java.io.File ( com.android.prefs.AndroidLocation.getFolder ( ) , com.android.sdklib.SdkConstants.FN_DEVICES_XML ) ; mUserDevices.addAll ( loadDevices ( userDevicesFile ) ) ; } catch ( com.android.prefs.AndroidLocation.AndroidLocationException e ) { mLog.warning ( "Couldn't load user devices: %1$" , e.getMessage ( ) ) ; } } } return mUserDevices ; }

Target:
public java.util.List < com.android.sdklib.devices.Device > getUserDevices ( ) { synchronized ( this ) { if ( ( mUserDevices ) == null ) { mUserDevices = new java.util.ArrayList < com.android.sdklib.devices.Device > ( ) ; try { java.io.File userDevicesFile = new java.io.File ( com.android.prefs.AndroidLocation.getFolder ( ) , com.android.sdklib.SdkConstants.FN_DEVICES_XML ) ; mUserDevices.addAll ( loadDevices ( userDevicesFile ) ) ; } catch ( com.android.prefs.AndroidLocation.AndroidLocationException e ) { mLog.warning ( "Couldn't load user devices: %1$s" , e.getMessage ( ) ) ; } } } return mUserDevices ; }
Source:
public void testSetActivityResultMultipleTime ( ) { android.content.Intent intent = new android.content.Intent ( android.content.Intent.ACTION_VIEW , android.net.Uri.parse ( "http://www.android.com" ) ) ; android.app.Instrumentation.ActivityResult result = new android.app.Instrumentation.ActivityResult ( 10 , intent ) ; android.app.Instrumentation.ActivityResult duplicateResult = new android.app.Instrumentation.ActivityResult ( 100 , new android.content.Intent ( android.content.Intent.ACTION_VIEW , android.net.Uri.parse ( "http://www.google.com" ) ) ) ; org.hamcrest.Matcher < android.content.Intent > matcher = org.hamcrest.CoreMatchers.allOf ( android.support.test.espresso.intent.matcher.IntentMatchers.hasAction ( org.hamcrest.CoreMatchers.equalTo ( Intent.ACTION_VIEW ) ) , android.support.test.espresso.intent.matcher.IntentMatchers.hasData ( android.support.test.espresso.intent.matcher.UriMatchers.hasHost ( org.hamcrest.CoreMatchers.equalTo ( "www.android.com" ) ) ) ) ; resettingStubber.setActivityResultForIntent ( matcher , result ) ; resettingStubber.setActivityResultForIntent ( matcher , duplicateResult ) ; assertEquals ( "Activity result didn't match expected value." , resettingStubber.getActivityResultForIntent ( intent ) , duplicateResult ) ; assertEquals ( "Activity result didn't match expected value." , resettingStubber.getActivityResultForIntent ( intent ) , duplicateResult ) ; }

Target:
public void setActivityResultMultipleTime ( ) { android.content.Intent intent = new android.content.Intent ( android.content.Intent.ACTION_VIEW , android.net.Uri.parse ( "http://www.android.com" ) ) ; android.app.Instrumentation.ActivityResult result = new android.app.Instrumentation.ActivityResult ( 10 , intent ) ; android.app.Instrumentation.ActivityResult duplicateResult = new android.app.Instrumentation.ActivityResult ( 100 , new android.content.Intent ( android.content.Intent.ACTION_VIEW , android.net.Uri.parse ( "http://www.google.com" ) ) ) ; org.hamcrest.Matcher < android.content.Intent > matcher = org.hamcrest.CoreMatchers.allOf ( android.support.test.espresso.intent.matcher.IntentMatchers.hasAction ( org.hamcrest.CoreMatchers.equalTo ( Intent.ACTION_VIEW ) ) , android.support.test.espresso.intent.matcher.IntentMatchers.hasData ( android.support.test.espresso.intent.matcher.UriMatchers.hasHost ( org.hamcrest.CoreMatchers.equalTo ( "www.android.com" ) ) ) ) ; resettingStubber.setActivityResultForIntent ( matcher , result ) ; resettingStubber.setActivityResultForIntent ( matcher , duplicateResult ) ; org.junit.Assert.assertEquals ( "Activity result didn't match expected value." , resettingStubber.getActivityResultForIntent ( intent ) , duplicateResult ) ; org.junit.Assert.assertEquals ( "Activity result didn't match expected value." , resettingStubber.getActivityResultForIntent ( intent ) , duplicateResult ) ; }
Source:
public java.lang.String toString ( ) { java.lang.StringBuffer sb = new java.lang.StringBuffer ( ) ; java.lang.String timeStampType ; sb.append ( "mRegistered=" ) . append ( ( mRegistered ? "YES" : "NO" ) ) ; timeStampType = android.telephony.CellInfo.timeStampTypeToString ( mTimeStampType ) ; sb.append ( " mTimeStampType=" ) . append ( timeStampType ) ; sb.append ( " mTimeStamp=" ) . append ( mTimeStamp ) . append ( "ns" ) ; return sb.toString ( ) ; }

Target:
public java.lang.String toString ( ) { java.lang.StringBuffer sb = new java.lang.StringBuffer ( ) ; java.lang.String timeStampType ; sb.append ( "mRegistered=" ) . append ( ( mRegistered ? "YES" : "NO" ) ) ; timeStampType = android.telephony.CellInfo.timeStampTypeToString ( mTimeStampType ) ; sb.append ( " mTimeStampType=" ) . append ( timeStampType ) ; sb.append ( " mTimeStamp=" ) . append ( mTimeStamp ) . append ( "ns" ) ; sb.append ( " mCellConnectionStatus=" ) . append ( mCellConnectionStatus ) ; return sb.toString ( ) ; }
Source:
private void searchRequestFromNative ( byte [ ] address , int charsetId , byte [ ] searchStr ) { if ( com.android.bluetooth.avrcp.Avrcp.DEBUG ) android.util.Log.v ( com.android.bluetooth.avrcp.Avrcp.TAG , "searchRequestFromNative" ) ; if ( com.android.bluetooth.avrcp.Avrcp.DEBUG ) android.util.Log.d ( com.android.bluetooth.avrcp.Avrcp.TAG , "search is not supported" ) ; searchRspNative ( address , AvrcpConstants.RSP_SRCH_NOT_SPRTD , 0 , 0 ) ; }

Target:
private void addToPlayListRequestFromNative ( byte [ ] address , byte scope , byte [ ] uid , int uidCounter ) { android.util.Log.w ( com.android.bluetooth.avrcp.Avrcp.TAG , ( "addToPlayListRequestFromNative: not supported! scope=" + scope ) ) ; addToNowPlayingRspNative ( address , AvrcpConstants.RSP_INTERNAL_ERR ) ; }
Source:
public com.google.testing.littlemock.Behaviour andReturn ( final java.lang.Object result ) { return new com.google.testing.littlemock.Behaviour ( ) { @ java.lang.Override public < T > T when ( T mock ) { return com.google.testing.littlemock.LittleMock.doAnswer ( new java.util.concurrent.Callable < java.lang.Object > ( ) { @ java.lang.Override public java.lang.Object call ( ) throws java.lang.Exception { latch.countDown ( ) ; return result ; } } ) . when ( mock ) ; } } ; }

Target:
public org.mockito.stubbing.Stubber andReturn ( final java.lang.Object result ) { return new org.mockito.internal.stubbing.StubberImpl ( ) { @ java.lang.Override public < T > T when ( T mock ) { return org.mockito.Mockito.doAnswer ( new org.mockito.stubbing.Answer < java.lang.Object > ( ) { @ java.lang.Override public java.lang.Object answer ( org.mockito.invocation.InvocationOnMock invocation ) throws java.lang.Exception { latch.countDown ( ) ; return result ; } } ) . when ( mock ) ; } } ; }
Source:
public void testNotifySecondaryFromProtected ( ) { java.util.List < java.lang.String > fooSecondaries = mFooUser0.getSecondaryDexPathsFromProtectedDirs ( ) ; notifyDexLoad ( mFooUser0 , fooSecondaries , mUser0 ) ; com.android.server.pm.dex.PackageDexUsage.PackageUseInfo pui = getPackageUseInfo ( mFooUser0 ) ; org.junit.Assert.assertFalse ( pui.isUsedByOtherApps ( ) ) ; org.junit.Assert.assertEquals ( fooSecondaries.size ( ) , pui.getDexUseInfoMap ( ) . size ( ) ) ; assertSecondaryUse ( mFooUser0 , pui , fooSecondaries , false , mUser0 ) ; }

Target:
public void testNotifySecondaryFromProtected ( ) { java.util.List < java.lang.String > fooSecondaries = mFooUser0.getSecondaryDexPathsFromProtectedDirs ( ) ; notifyDexLoad ( mFooUser0 , fooSecondaries , mUser0 ) ; com.android.server.pm.dex.PackageDexUsage.PackageUseInfo pui = getPackageUseInfo ( mFooUser0 ) ; assertIsUsedByOtherApps ( mFooUser0 , pui , false ) ; org.junit.Assert.assertEquals ( fooSecondaries.size ( ) , pui.getDexUseInfoMap ( ) . size ( ) ) ; assertSecondaryUse ( mFooUser0 , pui , fooSecondaries , false , mUser0 ) ; }
Source:
public void testNotifyResponseEndDataPath ( ) throws org.json.JSONException { final short transactionId = 50 ; final int reason = WifiAwareNative.AWARE_STATUS_NDP_END_FAILED ; android.os.Bundle args = new android.os.Bundle ( ) ; args.putInt ( "status" , reason ) ; args.putInt ( "value" , 0 ) ; args.putInt ( "response_type" , WifiAwareNative.AWARE_RESPONSE_DP_END ) ; com.android.server.wifi.aware.WifiAwareHalMock.callNotifyResponse ( transactionId , com.android.server.wifi.HalMockUtils.convertBundleToJson ( args ) . toString ( ) ) ; org.mockito.Mockito.verify ( mAwareStateManager ) . onEndDataPathResponse ( transactionId , false , reason ) ; org.mockito.Mockito.verifyNoMoreInteractions ( mAwareStateManager ) ; }

Target:
public void testNotifyResponseEndDataPath ( ) throws org.json.JSONException { final short transactionId = 50 ; final int reason = WifiAwareNative.AWARE_STATUS_INVALID_NDP_ID ; android.os.Bundle args = new android.os.Bundle ( ) ; args.putInt ( "status" , reason ) ; args.putInt ( "response_type" , WifiAwareNative.AWARE_RESPONSE_DP_END ) ; com.android.server.wifi.aware.WifiAwareHalMock.callNotifyResponse ( transactionId , com.android.server.wifi.HalMockUtils.convertBundleToJson ( args ) . toString ( ) ) ; org.mockito.Mockito.verify ( mAwareStateManager ) . onEndDataPathResponse ( transactionId , false , reason ) ; org.mockito.Mockito.verifyNoMoreInteractions ( mAwareStateManager ) ; }
Source:
public void testSingleOutput ( ) { com.android.build.VariantOutput match ; java.util.List < com.android.build.VariantOutput > list = com.google.common.collect.Lists.newArrayList ( ) ; list.add ( ( match = com.android.ide.common.build.SplitOutputMatcherTest.getUniversalOutput ( 1 ) ) ) ; java.util.List < java.io.File > result = com.android.ide.common.build.SplitOutputMatcherTest.computeBestOutput ( list , 160 , "foo" ) ; assertEquals ( 1 , result.size ( ) ) ; assertEquals ( match.getMainOutputFile ( ) . getOutputFile ( ) , result.get ( 0 ) ) ; }

Target:
public void testSingleOutput ( ) { com.android.build.VariantOutput match ; java.util.List < com.android.build.VariantOutput > list = com.google.common.collect.Lists.newArrayList ( ) ; list.add ( ( match = com.android.ide.common.build.SplitOutputMatcherTest.getUniversalOutput ( 1 ) ) ) ; java.util.List < com.android.build.OutputFile > result = com.android.ide.common.build.SplitOutputMatcherTest.computeBestOutput ( list , 160 , "foo" ) ; assertEquals ( 1 , result.size ( ) ) ; assertEquals ( match.getMainOutputFile ( ) , result.get ( 0 ) ) ; }
Source:
public void validateCertCredentialWithMismatchFingerprint ( ) throws java.lang.Exception { android.net.wifi.hotspot2.pps.Credential cred = new android.net.wifi.hotspot2.pps.Credential ( ) ; cred.realm = "realm" ; cred.certCredential = new android.net.wifi.hotspot2.pps.Credential.CertificateCredential ( ) ; cred.certCredential.certType = "x509v3" ; cred.certCredential.certSha256FingerPrint = new byte [ 32 ] ; java.util.Arrays.fill ( cred.certCredential.certSha256FingerPrint , ( ( byte ) ( 0 ) ) ) ; cred.caCertificate = android.net.wifi.FakeKeys.CA_CERT0 ; cred.clientCertificateChain = new java.security.cert.X509Certificate [ ] { android.net.wifi.FakeKeys.CLIENT_CERT } ; cred.clientPrivateKey = android.net.wifi.FakeKeys.RSA_KEY1 ; org.junit.Assert.assertFalse ( cred.validate ( ) ) ; }

Target:
public void validateCertCredentialWithMismatchFingerprint ( ) throws java.lang.Exception { android.net.wifi.hotspot2.pps.Credential cred = android.net.wifi.hotspot2.pps.CredentialTest.createCredentialWithCertificateCredential ( ) ; cred.getCertCredential ( ) . setCertSha256Fingerprint ( new byte [ 32 ] ) ; org.junit.Assert.assertFalse ( cred.validate ( ) ) ; }
Source:
public android.app.AlertDialog create ( ) { final android.app.AlertDialog dialog = new android.app.AlertDialog ( P.mContext ) ; P.apply ( dialog.mAlert ) ; dialog.setCancelable ( P.mCancelable ) ; dialog.setOnCancelListener ( P.mOnCancelListener ) ; if ( ( P.mOnKeyListener ) != null ) { dialog.setOnKeyListener ( P.mOnKeyListener ) ; } return dialog ; }

Target:
public android.app.AlertDialog create ( ) { final android.app.AlertDialog dialog = new android.app.AlertDialog ( P.mContext , mTheme ) ; P.apply ( dialog.mAlert ) ; dialog.setCancelable ( P.mCancelable ) ; dialog.setOnCancelListener ( P.mOnCancelListener ) ; if ( ( P.mOnKeyListener ) != null ) { dialog.setOnKeyListener ( P.mOnKeyListener ) ; } return dialog ; }
Source:
java.lang.String getOutputFileNameForSplit ( java.lang.String split ) { java.lang.String apkName = "${project.archivesBaseName}-${outputBaseName}_${split}" ; return apkName + ( ( signingConfig ) == null ? "-unsigned.apk" : "-unaligned.apk" ) ; }

Target:
public java.lang.String getOutputFileNameForSplit ( final java.lang.String split ) { java.lang.String archivesBaseName = ( ( java.lang.String ) ( getProject ( ) . getProperties ( ) . get ( "archivesBaseName" ) ) ) ; java.lang.String apkName = ( ( ( archivesBaseName + "-" ) + ( outputBaseName ) ) + "_" ) + split ; return apkName + ( ( signingConfig ) == null ? "-unsigned.apk" : "-unaligned.apk" ) ; }
Source:
private void resizeScrollbar ( ) { int sx = ( ( int ) ( ( mImgSize ) * ( mScale ) ) ) ; int cx = ( mClientSize ) - ( 2 * ( IMAGE_MARGIN ) ) ; if ( sx < cx ) { mScrollbar.setEnabled ( false ) ; } else { mScrollbar.setEnabled ( true ) ; mScrollbar.setMaximum ( sx ) ; mScrollbar.setThumb ( cx ) ; } }

Target:
public void setClientSize ( int clientSize ) { mClientSize = clientSize ; mScrollbar.setPageIncrement ( clientSize ) ; resizeScrollbar ( ) ; }
Source:
public org.eclipse.swt.graphics.Image getFlag ( com.android.ide.common.resources.configuration.LanguageQualifier language , com.android.ide.common.resources.configuration.RegionQualifier region ) { java.lang.String languageCode = ( language != null ) ? language.getValue ( ) : null ; java.lang.String regionCode = ( region != null ) ? region.getValue ( ) : null ; if ( LanguageQualifier.FAKE_LANG_VALUE.equals ( languageCode ) ) { languageCode = null ; } if ( RegionQualifier.FAKE_REGION_VALUE.equals ( regionCode ) ) { regionCode = null ; } return getFlag ( languageCode , regionCode ) ; }

Target:
public org.eclipse.swt.graphics.Image getFlag ( @ com.android.annotations.Nullable com.android.ide.common.resources.configuration.LocaleQualifier locale ) { if ( locale == null ) { return null ; } java.lang.String languageCode = locale.getLanguage ( ) ; java.lang.String regionCode = locale.getRegion ( ) ; if ( LocaleQualifier.FAKE_VALUE.equals ( languageCode ) ) { languageCode = null ; } return getFlag ( languageCode , regionCode ) ; }
Source:
public void terminateSession ( int clientId , int sessionId ) { enforceAccessPermission ( ) ; enforceChangePermission ( ) ; int uid = getMockableCallingUid ( ) ; enforceClientValidity ( uid , clientId ) ; if ( com.android.server.wifi.nan.WifiNanServiceImpl.VDBG ) { android.util.Log.v ( com.android.server.wifi.nan.WifiNanServiceImpl.TAG , ( ( ( ( ( "terminateSession: sessionId=" + sessionId ) + ", uid=" ) + uid ) + ", clientId=" ) + clientId ) ) ; } mStateManager.terminateSession ( clientId , sessionId ) ; }

Target:
public void terminateSession ( int clientId , int sessionId ) { enforceAccessPermission ( ) ; enforceChangePermission ( ) ; int uid = getMockableCallingUid ( ) ; enforceClientValidity ( uid , clientId ) ; if ( com.android.server.wifi.aware.WifiAwareServiceImpl.VDBG ) { android.util.Log.v ( com.android.server.wifi.aware.WifiAwareServiceImpl.TAG , ( ( ( ( ( "terminateSession: sessionId=" + sessionId ) + ", uid=" ) + uid ) + ", clientId=" ) + clientId ) ) ; } mStateManager.terminateSession ( clientId , sessionId ) ; }
Source:
public boolean isConditional ( ) { java.lang.Object o = annotation.getValue ( com.android.tools.lint.checks.SupportAnnotationDetector.ATTR_CONDITIONAL ) ; if ( o instanceof java.lang.Boolean ) { return ( ( java.lang.Boolean ) ( o ) ) ; } else if ( o instanceof com.android.tools.lint.client.api.JavaParser.ResolvedField ) { o = ( ( com.android.tools.lint.client.api.JavaParser.ResolvedField ) ( o ) ) . getValue ( ) ; if ( o instanceof java.lang.Boolean ) { return ( ( java.lang.Boolean ) ( o ) ) ; } } return false ; }

Target:
public boolean isConditional ( ) { java.lang.Boolean o = com.android.tools.lint.checks.PermissionRequirement.getAnnotationBooleanValue ( annotation , com.android.tools.lint.checks.SupportAnnotationDetector.ATTR_CONDITIONAL ) ; if ( o != null ) { return o ; } return false ; }
Source:
public synchronized void listEvents ( java.io.PrintWriter pw ) { long localTimeMs = java.lang.System.currentTimeMillis ( ) ; for ( android.net.metrics.DefaultNetworkEvent ev : mEvents ) { pw.println ( ev ) ; } }

Target:
public synchronized void listEvents ( java.io.PrintWriter pw ) { pw.println ( "default network events:" ) ; long localTimeMs = java.lang.System.currentTimeMillis ( ) ; long timeMs = android.os.SystemClock.elapsedRealtime ( ) ; for ( android.net.metrics.DefaultNetworkEvent ev : mEventsLog.toArray ( ) ) { com.android.server.connectivity.DefaultNetworkMetrics.printEvent ( localTimeMs , pw , ev ) ; } mCurrentDefaultNetwork.updateDuration ( timeMs ) ; if ( mIsCurrentlyValid ) { updateValidationTime ( timeMs ) ; mLastValidationTimeMs = timeMs ; } com.android.server.connectivity.DefaultNetworkMetrics.printEvent ( localTimeMs , pw , mCurrentDefaultNetwork ) ; }
Source:
public com.android.server.wifi.SoftApManager makeSoftApManager ( com.android.server.wifi.WifiNative wifiNative , android.os.INetworkManagementService nmService , android.net.ConnectivityManager cm , java.lang.String countryCode , java.util.ArrayList < java.lang.Integer > allowed2GChannels , com.android.server.wifi.SoftApManager.Listener listener , android.net.wifi.IApInterface apInterface ) { return new com.android.server.wifi.SoftApManager ( mWifiServiceHandlerThread.getLooper ( ) , wifiNative , countryCode , allowed2GChannels , listener , apInterface ) ; }

Target:
public com.android.server.wifi.SoftApManager makeSoftApManager ( android.os.INetworkManagementService nmService , com.android.server.wifi.SoftApManager.Listener listener , android.net.wifi.IApInterface apInterface , android.net.wifi.WifiConfiguration config ) { return new com.android.server.wifi.SoftApManager ( mWifiServiceHandlerThread.getLooper ( ) , mWifiNative , mCountryCode.getCountryCode ( ) , listener , apInterface , nmService , mWifiApConfigStore , config ) ; }
Source:
public void logp ( java.util.logging.Level level , java.lang.String sourceClass , java.lang.String sourceMethod , java.lang.String msg , java.lang.Object [ ] params ) { if ( ( ( level.intValue ( ) ) < ( levelValue ) ) || ( ( levelValue ) == ( java.util.logging.Logger.offValue ) ) ) { return ; } java.util.logging.LogRecord lr = new java.util.logging.LogRecord ( level , msg ) ; lr.setSourceClassName ( sourceClass ) ; lr.setSourceMethodName ( sourceMethod ) ; lr.setParameters ( params ) ; doLog ( lr ) ; }

Target:
public void logrb ( java.util.logging.Level level , java.lang.String sourceClass , java.lang.String sourceMethod , java.lang.String bundleName , java.lang.String msg , java.lang.Object [ ] params ) { if ( ! ( isLoggable ( level ) ) ) { return ; } java.util.logging.LogRecord lr = new java.util.logging.LogRecord ( level , msg ) ; lr.setSourceClassName ( sourceClass ) ; lr.setSourceMethodName ( sourceMethod ) ; lr.setParameters ( params ) ; doLog ( lr , bundleName ) ; }
Source:
private void responseSignalStrength ( android.hardware.radio.V1_0.RadioResponseInfo responseInfo , com.android.internal.telephony.V1_0.SignalStrength sigStrength ) { com.android.internal.telephony.RILRequest rr = mRil.processResponse ( responseInfo ) ; if ( rr != null ) { android.telephony.SignalStrength ret = com.android.internal.telephony.RIL.convertHalSignalStrength ( sigStrength ) ; if ( ( responseInfo.error ) == ( android.hardware.radio.V1_0.RadioError.NONE ) ) { com.android.internal.telephony.RadioResponse.sendMessageResponse ( rr.mResult , ret ) ; } mRil.processResponseDone ( rr , responseInfo , ret ) ; } }

Target:
private void responseSignalStrength_1_2 ( android.hardware.radio.V1_0.RadioResponseInfo responseInfo , com.android.internal.telephony.V1_2.SignalStrength signalStrength ) { com.android.internal.telephony.RILRequest rr = mRil.processResponse ( responseInfo ) ; if ( rr != null ) { android.telephony.SignalStrength ret = com.android.internal.telephony.RIL.convertHalSignalStrength_1_2 ( signalStrength ) ; if ( ( responseInfo.error ) == ( android.hardware.radio.V1_0.RadioError.NONE ) ) { com.android.internal.telephony.RadioResponse.sendMessageResponse ( rr.mResult , ret ) ; } mRil.processResponseDone ( rr , responseInfo , ret ) ; } }
Source:
protected void hangupAndPowerOff ( ) { if ( ( ! ( mPhone.isPhoneTypeGsm ( ) ) ) || ( mPhone.isInCall ( ) ) ) { mPhone.mCT.mRingingCall.hangupIfAlive ( ) ; mPhone.mCT.mBackgroundCall.hangupIfAlive ( ) ; mPhone.mCT.mForegroundCall.hangupIfAlive ( ) ; } mCi.setRadioPower ( false , null ) ; }

Target:
protected void hangupAndPowerOff ( ) { if ( ( ! ( mPhone.isPhoneTypeGsm ( ) ) ) || ( mPhone.isInCall ( ) ) ) { mPhone.mCT.mRingingCall.hangupIfAlive ( ) ; mPhone.mCT.mBackgroundCall.hangupIfAlive ( ) ; mPhone.mCT.mForegroundCall.hangupIfAlive ( ) ; } mCi.setRadioPower ( false , obtainMessage ( com.android.internal.telephony.ServiceStateTracker.EVENT_RADIO_POWER_OFF_DONE ) ) ; }
Source:
public void onActivityResult ( int request , int result , android.content.Intent data ) { if ( ( ( request == ( com.android.packageinstaller.PackageInstallerActivity.REQUEST_ENABLE_UNKNOWN_SOURCES ) ) && ( result == ( RESULT_OK ) ) ) && ( isUnknownSourcesEnabled ( ) ) ) { initiateInstall ( ) ; } else { finish ( ) ; } }

Target:
private void launchSettingsAppAndFinish ( ) { android.content.Intent launchSettingsIntent = new android.content.Intent ( android.provider.Settings.ACTION_SECURITY_SETTINGS ) ; launchSettingsIntent.setFlags ( Intent.FLAG_ACTIVITY_NEW_TASK ) ; startActivity ( launchSettingsIntent ) ; finish ( ) ; }
Source:
private void processLogLines ( java.lang.String [ ] lines ) { java.util.List < com.android.ddmuilib.logcat.LogCatMessage > messages = mLogCatMessageParser.processLogLines ( lines , mPidToNameMapper ) ; if ( ( messages.size ( ) ) > 0 ) { for ( com.android.ddmuilib.logcat.LogCatMessage m : messages ) { mLogMessages.appendMessage ( m ) ; } sendMessageReceivedEvent ( messages ) ; } }

Target:
private void processLogLines ( java.lang.String [ ] lines ) { java.util.List < com.android.ddmuilib.logcat.LogCatMessage > newMessages = mLogCatMessageParser.processLogLines ( lines , mPidToNameMapper ) ; if ( ( newMessages.size ( ) ) > 0 ) { java.util.List < com.android.ddmuilib.logcat.LogCatMessage > deletedMessages ; synchronized ( mLogMessages ) { deletedMessages = mLogMessages.ensureSpace ( newMessages.size ( ) ) ; mLogMessages.appendMessages ( newMessages ) ; } sendLogChangedEvent ( newMessages , deletedMessages ) ; } }
Source:
public void testNonMeteredCapability ( ) throws java.lang.Exception { org.mockito.Mockito.doReturn ( 2819 ) . when ( mPhone ) . getSubId ( ) ; mContextFixture.getCarrierConfigBundle ( ) . putStringArray ( CarrierConfigManager.KEY_CARRIER_METERED_APN_TYPES_STRINGS , new java.lang.String [ ] { "mms" } ) ; testConnectEvent ( ) ; org.junit.Assert.assertTrue ( getCopyNetworkCapabilities ( ) . hasCapability ( NetworkCapabilities.NET_CAPABILITY_NOT_METERED ) ) ; org.junit.Assert.assertFalse ( getNetworkInfo ( ) . isMetered ( ) ) ; }

Target:
public void testNonMeteredCapability ( ) throws java.lang.Exception { org.mockito.Mockito.doReturn ( 2819 ) . when ( mPhone ) . getSubId ( ) ; mContextFixture.getCarrierConfigBundle ( ) . putStringArray ( CarrierConfigManager.KEY_CARRIER_METERED_APN_TYPES_STRINGS , new java.lang.String [ ] { "mms" } ) ; testConnectEvent ( ) ; org.junit.Assert.assertTrue ( getNetworkCapabilities ( ) . hasCapability ( NetworkCapabilities.NET_CAPABILITY_NOT_METERED ) ) ; org.junit.Assert.assertFalse ( getNetworkInfo ( ) . isMetered ( ) ) ; }
Source:
public void test_SSLSocketFactory_getSupportedCipherSuites ( ) { javax.net.ssl.SSLSocketFactory sf = ( ( javax.net.ssl.SSLSocketFactory ) ( javax.net.ssl.SSLSocketFactory.getDefault ( ) ) ) ; java.lang.String [ ] cipherSuites = sf.getSupportedCipherSuites ( ) ; libcore.java.security.StandardNames.assertValidCipherSuites ( cipherSuites ) ; assertNotSame ( cipherSuites , sf.getSupportedCipherSuites ( ) ) ; }

Target:
public void test_SSLSocketFactory_getSupportedCipherSuites ( ) { javax.net.ssl.SSLSocketFactory sf = ( ( javax.net.ssl.SSLSocketFactory ) ( javax.net.ssl.SSLSocketFactory.getDefault ( ) ) ) ; java.lang.String [ ] cipherSuites = sf.getSupportedCipherSuites ( ) ; libcore.java.security.StandardNames.assertSupportedCipherSuites ( cipherSuites ) ; assertNotSame ( cipherSuites , sf.getSupportedCipherSuites ( ) ) ; }
Source:
public void test_getValue ( ) { javax.net.ssl.SSLSession s = clientSession ; tests.api.javax.net.ssl.SSLSessionTest.mySSLSessionBindingListener sbl = new tests.api.javax.net.ssl.SSLSessionTest.mySSLSessionBindingListener ( ) ; try { s.getValue ( null ) ; fail ( "IllegalArgumentException wasn't thrown" ) ; } catch ( java.lang.IllegalArgumentException expected ) { } s.putValue ( "Name" , sbl ) ; java.lang.Object obj = s.getValue ( "Name" ) ; assertTrue ( ( obj instanceof javax.net.ssl.SSLSessionBindingListener ) ) ; }

Target:
public void test_getValue ( ) { javax.net.ssl.SSLSession s = clientSession ; org.apache.harmony.tests.javax.net.ssl.SSLSessionTest.mySSLSessionBindingListener sbl = new org.apache.harmony.tests.javax.net.ssl.SSLSessionTest.mySSLSessionBindingListener ( ) ; try { s.getValue ( null ) ; fail ( "IllegalArgumentException wasn't thrown" ) ; } catch ( java.lang.IllegalArgumentException expected ) { } s.putValue ( "Name" , sbl ) ; java.lang.Object obj = s.getValue ( "Name" ) ; assertTrue ( ( obj instanceof javax.net.ssl.SSLSessionBindingListener ) ) ; }
Source:
private void removeItems ( @ javax.annotation.Nonnull java.util.List < java.lang.String > cstStringsToRemove , @ javax.annotation.Nonnull java.util.List < com.android.jack.dx.rop.cst.CstFieldRef > cstFieldRefsToRemove , @ javax.annotation.Nonnull java.util.List < com.android.jack.dx.rop.cst.CstMethodRef > cstMethodRefsToRemove , @ javax.annotation.Nonnull java.util.List < com.android.jack.dx.rop.cst.CstType > cstTypesToRemove , @ javax.annotation.Nonnull java.util.List < com.android.jack.dx.rop.cst.CstPrototypeRef > cstPrototypeRefsToRemove ) { string2CstStrings.keySet ( ) . removeAll ( cstStringsToRemove ) ; cstFieldRefs.removeAll ( cstFieldRefsToRemove ) ; cstMethodRefs.removeAll ( cstMethodRefsToRemove ) ; cstTypes.removeAll ( cstTypesToRemove ) ; cstPrototypeRefs.removeAll ( cstPrototypeRefsToRemove ) ; }

Target:
private void removeItems ( @ javax.annotation.Nonnull java.util.List < java.lang.String > cstStringsToRemove , @ javax.annotation.Nonnull java.util.List < com.android.jack.dx.rop.cst.CstFieldRef > cstFieldRefsToRemove , @ javax.annotation.Nonnull java.util.List < com.android.jack.dx.rop.cst.CstMethodRef > cstMethodRefsToRemove , @ javax.annotation.Nonnull java.util.List < com.android.jack.dx.rop.cst.CstType > cstTypesToRemove , @ javax.annotation.Nonnull java.util.List < com.android.jack.dx.rop.cst.CstPrototypeRef > cstPrototypeRefsToRemove , @ javax.annotation.Nonnull java.util.List < com.android.jack.dx.rop.cst.CstMethodHandleRef > cstMethodHandleRefsToRemove ) { string2CstStrings.keySet ( ) . removeAll ( cstStringsToRemove ) ; cstFieldRefs.removeAll ( cstFieldRefsToRemove ) ; cstMethodRefs.removeAll ( cstMethodRefsToRemove ) ; cstTypes.removeAll ( cstTypesToRemove ) ; cstPrototypeRefs.removeAll ( cstPrototypeRefsToRemove ) ; cstMethodHandleRefs.removeAll ( cstMethodHandleRefsToRemove ) ; }
Source:
public void notifyCallForwardingChanged ( com.android.internal.telephony.Phone sender ) { int subId = sender.getSubId ( ) ; try { if ( ( mRegistry ) != null ) { mRegistry.notifyCallForwardingChangedForSubscriber ( subId , sender.getCallForwardingIndicator ( ) ) ; } } catch ( android.os.RemoteException ex ) { } }

Target:
public void notifyCallForwardingChanged ( com.android.internal.telephony.Phone sender ) { int subId = sender.getSubId ( ) ; try { if ( ( mRegistry ) != null ) { android.telephony.Rlog.d ( com.android.internal.telephony.DefaultPhoneNotifier.LOG_TAG , ( ( ( "notifyCallForwardingChanged: subId=" + subId ) + ", isCFActive=" ) + ( sender.getCallForwardingIndicator ( ) ) ) ) ; mRegistry.notifyCallForwardingChangedForSubscriber ( subId , sender.getCallForwardingIndicator ( ) ) ; } } catch ( android.os.RemoteException ex ) { } }
Source:
public void setUp ( ) throws java.lang.Exception { org.mockito.MockitoAnnotations.initMocks ( this ) ; mObserverHandlerThread = new com.android.server.net.NetworkStatsServiceTest.IdleableHandlerThread ( "HandlerThread" ) ; mObserverHandlerThread.start ( ) ; final android.os.Looper observerLooper = mObserverHandlerThread.getLooper ( ) ; mStatsObservers = new com.android.server.net.NetworkStatsObservers ( ) { @ java.lang.Override protected android.os.Looper getHandlerLooperLocked ( ) { return observerLooper ; } } ; mHandler = new com.android.server.net.NetworkStatsServiceTest.LatchedHandler ( android.os.Looper.getMainLooper ( ) , new android.os.ConditionVariable ( ) ) ; mMessenger = new android.os.Messenger ( mHandler ) ; mActiveIfaces = new android.util.ArrayMap ( ) ; mActiveUidIfaces = new android.util.ArrayMap ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { org.mockito.MockitoAnnotations.initMocks ( this ) ; mObserverHandlerThread = new android.os.HandlerThread ( "HandlerThread" ) ; mObserverHandlerThread.start ( ) ; final android.os.Looper observerLooper = mObserverHandlerThread.getLooper ( ) ; mStatsObservers = new com.android.server.net.NetworkStatsObservers ( ) { @ java.lang.Override protected android.os.Looper getHandlerLooperLocked ( ) { return observerLooper ; } } ; mHandler = new com.android.server.net.NetworkStatsServiceTest.LatchedHandler ( android.os.Looper.getMainLooper ( ) , new android.os.ConditionVariable ( ) ) ; mMessenger = new android.os.Messenger ( mHandler ) ; mActiveIfaces = new android.util.ArrayMap ( ) ; mActiveUidIfaces = new android.util.ArrayMap ( ) ; }
Source:
public java.net.Socket implAccept ( java.nio.SocketChannelImpl clientSocketChannel ) throws java.io.IOException { java.net.Socket clientSocket = clientSocketChannel.socket ( ) ; boolean connectOK = false ; try { synchronized ( this ) { super . implAccept ( clientSocket ) ; clientSocketChannel.setConnected ( ) ; clientSocketChannel.setBound ( true ) ; clientSocketChannel.finishAccept ( ) ; } connectOK = true ; } finally { if ( ! connectOK ) { clientSocket.close ( ) ; } } return clientSocket ; }

Target:
public java.net.Socket implAccept ( java.nio.SocketChannelImpl clientSocketChannel ) throws java.io.IOException { java.net.Socket clientSocket = clientSocketChannel.socket ( ) ; boolean connectOK = false ; try { synchronized ( this ) { super . implAccept ( clientSocket ) ; java.net.InetSocketAddress remoteAddress = new java.net.InetSocketAddress ( clientSocket.getInetAddress ( ) , clientSocket.getPort ( ) ) ; clientSocketChannel.onAccept ( remoteAddress , false ) ; } connectOK = true ; } finally { if ( ! connectOK ) { clientSocket.close ( ) ; } } return clientSocket ; }
Source:
public void onAlarm ( ) { final boolean stillScheduled ; synchronized ( this ) { stillScheduled = mScheduled ; mScheduled = false ; } if ( stillScheduled ) { android.os.Message msg = mHandler.obtainMessage ( mCmd , mArg1 , mArg2 , mObj ) ; mHandler.dispatchMessage ( msg ) ; msg.recycle ( ) ; } }

Target:
public void onAlarm ( ) { final boolean stillScheduled ; synchronized ( this ) { stillScheduled = mScheduled ; mScheduled = false ; } if ( stillScheduled ) { android.os.Message msg ; if ( ( mRunnable ) == null ) { msg = mHandler.obtainMessage ( mCmd , mArg1 , mArg2 , mObj ) ; } else { msg = android.os.Message.obtain ( mHandler , mRunnable ) ; } mHandler.dispatchMessage ( msg ) ; msg.recycle ( ) ; } }
Source:
public synchronized void add ( long time , int type , float ... values ) { assert ( values.length ) == ( myStreams ) ; float total = 0.0F ; for ( float value : values ) { total += value ; } mMaxTotal = java.lang.Math.max ( mMaxTotal , total ) ; mSamples.add ( new com.android.tools.chartlib.TimelineData.Sample ( ( ( time - ( mStart ) ) / 1000.0F ) , type , values ) ) ; }

Target:
public synchronized void addFromArea ( long timeMills , int type , float ... areas ) { float timeForStart = ( timeMills - ( mStart ) ) / 1000.0F ; com.android.tools.chartlib.TimelineData.Sample lastSample = ( mSamples.isEmpty ( ) ) ? null : mSamples.get ( ( ( mSamples.size ( ) ) - 1 ) ) ; for ( com.android.tools.chartlib.TimelineData.Sample sample : com.android.tools.chartlib.TimelineData.convertAreasToSamples ( timeForStart , type , areas , lastSample ) ) { add ( sample ) ; } }
Source:
public void visitResourceReference ( @ com.android.annotations.NonNull com.android.tools.lint.detector.api.JavaContext context , @ com.android.annotations.Nullable lombok.ast.AstVisitor visitor , @ com.android.annotations.NonNull org.w3c.dom.Node node , @ com.android.annotations.NonNull java.lang.String type , @ com.android.annotations.NonNull java.lang.String name , boolean isFramework ) { if ( ( ! isFramework ) && ( type.equals ( ResourceType.ID.getName ( ) ) ) ) { mRelevantIds.add ( name ) ; } }

Target:
public void visitResourceReference ( @ com.android.annotations.NonNull com.android.tools.lint.detector.api.JavaContext context , @ com.android.annotations.Nullable com.intellij.psi.JavaElementVisitor visitor , @ com.android.annotations.NonNull com.intellij.psi.PsiElement node , @ com.android.annotations.NonNull com.android.resources.ResourceType type , @ com.android.annotations.NonNull java.lang.String name , boolean isFramework ) { if ( ( ! isFramework ) && ( type == ( com.android.resources.ResourceType.ID ) ) ) { mRelevantIds.add ( name ) ; } }
Source:
public void delete ( @ javax.annotation.Nonnull com.android.jack.library.FileType fileType , @ javax.annotation.Nonnull com.android.sched.vfs.VPath typePath ) throws com.android.jack.library.FileTypeDoesNotExistException , com.android.sched.util.file.CannotDeleteFileException { try { com.android.sched.vfs.InputVFS currentSectionVFS = getSectionVFS ( fileType ) ; currentSectionVFS.getRootInputVDir ( ) . getInputVFile ( buildFileVPath ( fileType , typePath ) ) . delete ( ) ; } catch ( com.android.sched.util.file.NotFileOrDirectoryException e ) { throw new com.android.jack.library.FileTypeDoesNotExistException ( getLocation ( ) , typePath , fileType ) ; } catch ( com.android.sched.util.file.NoSuchFileException e ) { throw new com.android.jack.library.FileTypeDoesNotExistException ( getLocation ( ) , typePath , fileType ) ; } }

Target:
public void delete ( @ javax.annotation.Nonnull com.android.jack.library.FileType fileType , @ javax.annotation.Nonnull com.android.sched.vfs.VPath typePath ) throws com.android.jack.library.FileTypeDoesNotExistException , com.android.sched.util.file.CannotDeleteFileException { try { com.android.sched.vfs.InputVFS currentSectionVFS = getSectionVFS ( fileType ) ; currentSectionVFS.getRootDir ( ) . getInputVFile ( buildFileVPath ( fileType , typePath ) ) . delete ( ) ; } catch ( com.android.sched.util.file.NotFileOrDirectoryException e ) { throw new com.android.jack.library.FileTypeDoesNotExistException ( getLocation ( ) , typePath , fileType ) ; } catch ( com.android.sched.util.file.NoSuchFileException e ) { throw new com.android.jack.library.FileTypeDoesNotExistException ( getLocation ( ) , typePath , fileType ) ; } }
Source:
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 ; }

Target:
private int getNextDebuggerPort ( ) { return mDebuggerPorts.next ( ) ; }
Source:
public static double min ( double a , double b ) { if ( a != a ) return a ; if ( ( ( a == 0.0 ) && ( b == 0.0 ) ) && ( ( java.lang.Double.doubleToRawLongBits ( b ) ) == ( java.lang.StrictMath.negativeZeroDoubleBits ) ) ) { return b ; } return a <= b ? a : b ; }

Target:
public static double max ( double a , double b ) { return java.lang.Math.max ( a , b ) ; }
Source:
static java.lang.String getContentType ( java.lang.String fileName ) throws java.io.IOException { java.lang.String resourceName = "org/apache/harmony/luni/tests/" + fileName ; java.net.URL url = java.lang.ClassLoader.getSystemClassLoader ( ) . getResource ( resourceName ) ; assertNotNull ( ( "Cannot find test resource " + resourceName ) , url ) ; return new libcore.net.url.FileURLConnection ( url ) . getContentType ( ) ; }

Target:
static java.lang.String getContentType ( java.lang.String fileName ) throws java.io.IOException { java.lang.String resourceName = "resources/" + fileName ; java.net.URL url = java.lang.ClassLoader.getSystemClassLoader ( ) . getResource ( resourceName ) ; assertNotNull ( ( "Cannot find test resource " + resourceName ) , url ) ; return new libcore.net.url.FileURLConnection ( url ) . getContentType ( ) ; }
Source:
public void setTargetPhoneAccount ( android.telecom.PhoneAccountHandle accountHandle ) { if ( ! ( java.util.Objects.equals ( mTargetPhoneAccountHandle , accountHandle ) ) ) { mTargetPhoneAccountHandle = accountHandle ; for ( com.android.server.telecom.Call.Listener l : mListeners ) { l.onTargetPhoneAccountChanged ( this ) ; } configureIsWorkCall ( ) ; checkIfVideoCapable ( ) ; } }

Target:
public void setTargetPhoneAccount ( android.telecom.PhoneAccountHandle accountHandle ) { if ( ! ( java.util.Objects.equals ( mTargetPhoneAccountHandle , accountHandle ) ) ) { mTargetPhoneAccountHandle = accountHandle ; for ( com.android.server.telecom.Call.Listener l : mListeners ) { l.onTargetPhoneAccountChanged ( this ) ; } configureCallAttributes ( ) ; } checkIfVideoCapable ( ) ; checkIfRttCapable ( ) ; }
Source:
private void editSlideshow ( ) { android.net.Uri dataUri = mWorkingMessage.saveAsMms ( false ) ; if ( dataUri == null ) { return ; } android.content.Intent intent = new android.content.Intent ( this , com.android.mms.ui.SlideshowEditActivity.class ) ; intent.setData ( dataUri ) ; startActivityForResult ( intent , com.android.mms.ui.ComposeMessageActivity.REQUEST_CODE_CREATE_SLIDESHOW ) ; }

Target:
public void run ( ) { mTempMmsUri = mWorkingMessage.saveAsMms ( false ) ; }
Source:
void addPortToAvailableList ( int port ) { if ( port > 0 ) { synchronized ( mDebuggerPorts ) { if ( ( mDebuggerPorts.indexOf ( port ) ) == ( - 1 ) ) { int count = mDebuggerPorts.size ( ) ; for ( int i = 0 ; i < count ; i ++ ) { if ( port < ( mDebuggerPorts.get ( i ) ) ) { mDebuggerPorts.add ( i , port ) ; break ; } } } } } }

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 setUp ( ) throws java.lang.Exception { mTargetContext = android.support.test.InstrumentationRegistry.getTargetContext ( ) ; if ( ! ( mTargetContext.getResources ( ) . getBoolean ( R.bool.profile_supported_hfpclient ) ) ) { return ; } startServices ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { mTargetContext = android.support.test.InstrumentationRegistry.getTargetContext ( ) ; org.junit.Assume.assumeTrue ( "Ignore test when HeadsetClientService is not enabled" , mTargetContext.getResources ( ) . getBoolean ( R.bool.profile_supported_hfpclient ) ) ; org.mockito.MockitoAnnotations.initMocks ( this ) ; com.android.bluetooth.TestUtils.setAdapterService ( mAdapterService ) ; com.android.bluetooth.TestUtils.startService ( mServiceRule , com.android.bluetooth.hfpclient.HeadsetClientService.class ) ; mService = com.android.bluetooth.hfpclient.HeadsetClientService.getHeadsetClientService ( ) ; org.junit.Assert.assertNotNull ( mService ) ; mAdapter = android.bluetooth.BluetoothAdapter.getDefaultAdapter ( ) ; org.junit.Assert.assertNotNull ( mAdapter ) ; }
Source:
public int getLteOnCdmaModeForSubscriber ( int subId , java.lang.String callingPackage ) { if ( ! ( canReadPhoneState ( callingPackage , "getLteOnCdmaModeForSubscriber" ) ) ) { return com.android.internal.telephony.PhoneConstants.LTE_ON_CDMA_UNKNOWN ; } final com.android.internal.telephony.Phone phone = getPhone ( subId ) ; if ( phone == null ) { return com.android.internal.telephony.PhoneConstants.LTE_ON_CDMA_UNKNOWN ; } else { return phone.getLteOnCdmaMode ( ) ; } }

Target:
public int getLteOnCdmaModeForSubscriber ( int subId , java.lang.String callingPackage ) { if ( ! ( com.android.internal.telephony.TelephonyPermissions.checkCallingOrSelfReadPhoneState ( mApp , callingPackage , "getLteOnCdmaModeForSubscriber" ) ) ) { return com.android.internal.telephony.PhoneConstants.LTE_ON_CDMA_UNKNOWN ; } final com.android.internal.telephony.Phone phone = getPhone ( subId ) ; if ( phone == null ) { return com.android.internal.telephony.PhoneConstants.LTE_ON_CDMA_UNKNOWN ; } else { return phone.getLteOnCdmaMode ( ) ; } }
Source:
protected void onResume ( ) { super . onResume ( ) ; final java.util.List < android.net.wifi.WifiConfiguration > wifiConfigs = mWifiManager.getConfiguredNetworks ( ) ; java.lang.StringBuffer configList = new java.lang.StringBuffer ( ) ; for ( int i = ( wifiConfigs.size ( ) ) - 1 ; i >= 0 ; i -- ) { configList.append ( wifiConfigs.get ( i ) ) ; } mConfigList.setText ( configList ) ; }

Target:
protected void onResume ( ) { super . onResume ( ) ; if ( mWifiManager.isWifiEnabled ( ) ) { final java.util.List < android.net.wifi.WifiConfiguration > wifiConfigs = mWifiManager.getConfiguredNetworks ( ) ; java.lang.StringBuffer configList = new java.lang.StringBuffer ( ) ; for ( int i = ( wifiConfigs.size ( ) ) - 1 ; i >= 0 ; i -- ) { configList.append ( wifiConfigs.get ( i ) ) ; } mConfigList.setText ( configList ) ; } else { mConfigList.setText ( R.string.wifi_state_disabled ) ; } }
Source:
public void replaceUserConfiguration ( com.android.ide.eclipse.adt.internal.sdk.LayoutDevice device , java.lang.String oldConfigName , java.lang.String newConfigName , com.android.ide.eclipse.adt.internal.resources.configurations.FolderConfiguration config ) { if ( mUserLayoutDevices.contains ( device ) ) { if ( ( oldConfigName != null ) && ( ( oldConfigName.equals ( newConfigName ) ) == false ) ) { device.removeConfig ( oldConfigName ) ; } device.addConfig ( newConfigName , config ) ; } }

Target:
public void replaceUserConfiguration ( com.android.ide.eclipse.adt.internal.sdk.LayoutDevice device , java.lang.String oldConfigName , java.lang.String newConfigName , com.android.ide.common.resources.configuration.FolderConfiguration config ) { if ( mUserLayoutDevices.contains ( device ) ) { if ( ( oldConfigName != null ) && ( ( oldConfigName.equals ( newConfigName ) ) == false ) ) { device.removeConfig ( oldConfigName ) ; } device.addConfig ( newConfigName , config ) ; } }
Source:
private void updatePBSecondaryFolderVersion ( long counterValue ) { if ( android.os.SystemProperties.getBoolean ( "ro.bluetooth.pbap.sec" , false ) ) { android.util.Log.d ( com.android.bluetooth.pbap.BluetoothPbapObexServer.TAG , "Reset secondary folder version bit for PTS case" ) ; BluetoothPbapService.secondaryVersionCounter = 0 ; } else { BluetoothPbapService.secondaryVersionCounter = BluetoothPbapService.primaryVersionCounter ; } }

Target:
private byte [ ] getPBPrimaryFolderVersion ( ) { long primaryVcMsb = 0 ; java.nio.ByteBuffer pvc = java.nio.ByteBuffer.allocate ( 16 ) ; pvc.putLong ( primaryVcMsb ) ; android.util.Log.d ( com.android.bluetooth.pbap.BluetoothPbapObexServer.TAG , ( "primaryVersionCounter is " + ( BluetoothPbapUtils.primaryVersionCounter ) ) ) ; pvc.putLong ( BluetoothPbapUtils.primaryVersionCounter ) ; return pvc.array ( ) ; }
Source:
public static int NotEqualTrueRhs ( boolean arg ) { return arg == true ? 3 : 5 ; }

Target:
public static int runSmaliTest ( java.lang.String name , boolean input ) { try { java.lang.Class < ? > c = java.lang.Class.forName ( "SmaliTests" ) ; java.lang.reflect.Method m = c.getMethod ( name , new java.lang.Class [ ] { boolean . class } ) ; return ( ( java.lang.Integer ) ( m.invoke ( null , input ) ) ) ; } catch ( java.lang.Exception ex ) { throw new java.lang.Error ( ex ) ; } }
Source:
private static java.lang.String decodeToString ( java.lang.String in ) throws java.lang.Exception { byte [ ] out = libcore.io.Base64Test.decodeToBytes ( in ) ; return out == null ? null : new java.lang.String ( out , java.nio.charset.StandardCharsets.US_ASCII ) ; }

Target:
private static java.lang.String decodeToString ( java.lang.String in ) throws java.lang.Exception { byte [ ] bytes = libcore.io.Base64Test.asciiToBytes ( in ) ; byte [ ] out = libcore.io.Base64.decode ( bytes ) ; if ( out == null ) { return null ; } return libcore.io.Base64Test.bytesToAscii ( out ) ; }
Source:
public void testStandaloneWeekdayParsing ( ) throws java.lang.Exception { java.util.Locale fi = new java.util.Locale ( "fi" ) ; assertEquals ( java.util.Calendar.TUESDAY , libcore.java.text.SimpleDateFormatTest.parseDate ( fi , "cccc yyyy" , "tiistai 2000" ) . get ( java.util.Calendar.DAY_OF_WEEK ) ) ; assertEquals ( java.util.Calendar.TUESDAY , libcore.java.text.SimpleDateFormatTest.parseDate ( fi , "EEEE yyyy" , "tiistaina 2000" ) . get ( java.util.Calendar.DAY_OF_WEEK ) ) ; libcore.java.text.SimpleDateFormatTest.assertCannotParse ( fi , "cccc yyyy" , "tiistaina 2000" ) ; libcore.java.text.SimpleDateFormatTest.assertCannotParse ( fi , "EEEE yyyy" , "tiistai 2000" ) ; }

Target:
public void testStandaloneWeekdayParsing ( ) throws java.lang.Exception { java.util.Locale fi = new java.util.Locale ( "fi" ) ; assertEquals ( java.util.Calendar.TUESDAY , libcore.java.text.SimpleDateFormatTest.parseDateUtc ( fi , "cccc yyyy" , "tiistai 2000" ) . get ( java.util.Calendar.DAY_OF_WEEK ) ) ; assertEquals ( java.util.Calendar.TUESDAY , libcore.java.text.SimpleDateFormatTest.parseDateUtc ( fi , "EEEE yyyy" , "tiistaina 2000" ) . get ( java.util.Calendar.DAY_OF_WEEK ) ) ; libcore.java.text.SimpleDateFormatTest.assertCannotParse ( fi , "cccc yyyy" , "tiistaina 2000" ) ; libcore.java.text.SimpleDateFormatTest.assertCannotParse ( fi , "EEEE yyyy" , "tiistai 2000" ) ; }
Source:
public java.nio.ByteBuffer getByteBuffer ( long offset , int size ) throws java.io.IOException { java.nio.ByteBuffer result = java.nio.ByteBuffer.allocate ( size ) ; copyTo ( offset , size , result ) ; result.flip ( ) ; return result ; }

Target:
public java.nio.ByteBuffer getByteBuffer ( long offset , int size ) throws java.io.IOException { if ( size < 0 ) { throw new java.lang.IndexOutOfBoundsException ( ( "size: " + size ) ) ; } java.nio.ByteBuffer result = java.nio.ByteBuffer.allocate ( size ) ; copyTo ( offset , size , result ) ; result.flip ( ) ; return result ; }
Source:
public void requestShutdown ( android.os.Message result ) { android.hardware.radio.V1_0.IRadio radioProxy = getRadioProxy ( result ) ; if ( radioProxy != null ) { com.android.internal.telephony.RILRequest rr = obtainRequest ( com.android.internal.telephony.RIL_REQUEST_SHUTDOWN , result , mRILDefaultWorkSource ) ; if ( com.android.internal.telephony.RIL.RILJ_LOGD ) { riljLog ( ( ( ( rr.serialString ( ) ) + "> " ) + ( com.android.internal.telephony.RIL.requestToString ( rr.mRequest ) ) ) ) ; } try { radioProxy.requestShutdown ( rr.mSerial ) ; } catch ( android.os.RemoteException | java.lang.RuntimeException e ) { handleRadioProxyExceptionForRR ( rr , "requestShutdown" , e ) ; } } }

Target:
public void getHardwareConfig ( android.os.Message result ) { android.hardware.radio.V1_0.IRadio radioProxy = getRadioProxy ( result ) ; if ( radioProxy != null ) { com.android.internal.telephony.RILRequest rr = obtainRequest ( com.android.internal.telephony.RIL_REQUEST_GET_HARDWARE_CONFIG , result , mRILDefaultWorkSource ) ; if ( com.android.internal.telephony.RIL.RILJ_LOGD ) riljLog ( ( ( ( rr.serialString ( ) ) + "> " ) + ( com.android.internal.telephony.RIL.requestToString ( rr.mRequest ) ) ) ) ; try { radioProxy.getHardwareConfig ( rr.mSerial ) ; } catch ( android.os.RemoteException | java.lang.RuntimeException e ) { handleRadioProxyExceptionForRR ( rr , "getHardwareConfig" , e ) ; } } }