auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static com.android.chimpchat.core.IChimpBackend createBackendByName ( java.lang.String backendName ) { if ( "adb" . equals ( backendName ) ) { return new com.android.chimpchat.adb.AdbBackend ( ) ; } else if ( "stub" . equals ( backendName ) ) { return new com.android.chimpchat.stub.StubBackend ( ) ; } else { return null ; } }

Target:
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 ; } }
Source:
public void testRetrySuccessFail ( ) throws java.lang.Exception { doReturn ( "something" ) . when ( mDevice ) . executeShellCommand ( com.android.tradefed.util.CmdUtilTest.TEST_CMD ) ; org.junit.Assert.assertFalse ( mCmdUtil.retry ( mDevice , com.android.tradefed.util.CmdUtilTest.RUN_CMD , com.android.tradefed.util.CmdUtilTest.TEST_CMD , mCheckEmpty ) ) ; verify ( mDevice , times ( mCmdUtil.MAX_RETRY_COUNT ) ) . executeShellCommand ( eq ( com.android.tradefed.util.CmdUtilTest.RUN_CMD ) ) ; }

Target:
public void testRetryFail ( ) throws java.lang.Exception { doReturn ( "something" ) . when ( mDevice ) . executeShellCommand ( com.android.tradefed.util.CmdUtilTest.TEST_CMD ) ; org.junit.Assert.assertFalse ( mCmdUtil.retry ( mDevice , com.android.tradefed.util.CmdUtilTest.RUN_CMD , com.android.tradefed.util.CmdUtilTest.TEST_CMD , mCheckEmpty ) ) ; verify ( mDevice , times ( mCmdUtil.MAX_RETRY_COUNT ) ) . executeShellCommand ( eq ( com.android.tradefed.util.CmdUtilTest.RUN_CMD ) ) ; }
Source:
public void onCallForwardingIndicatorChanged ( boolean visible ) { if ( com.android.phone.CallNotifier.VDBG ) log ( ( ( ( "onCallForwardingIndicatorChanged(): " + ( this . mSubId ) ) + " " ) + visible ) ) ; mApplication.notificationMgr.updateCfi ( this . mSubId , visible ) ; }

Target:
public void onCallForwardingIndicatorChanged ( boolean visible ) { android.util.Log.i ( com.android.phone.CallNotifier.LOG_TAG , ( ( ( "onCallForwardingIndicatorChanged(): subId=" + ( this . mSubId ) ) + ", visible=" ) + ( visible ? "Y" : "N" ) ) ) ; mCFIStatus.put ( this . mSubId , visible ) ; updatePhoneStateListeners ( false ) ; }
Source:
public android.security.cts.ReadElf.Symbol getDynamicSymbol ( java.lang.String name ) { if ( ( ( mDynSymOffset ) == 0 ) && ( ( mDynSymSize ) == 0 ) ) { return null ; } if ( ( mDynamicSymbols ) == null ) { mDynamicSymbols = new java.util.HashMap < java.lang.String , android.security.cts.ReadElf.Symbol > ( ) ; try { readSymbolTable ( mDynamicSymbols , mDynStrOffset , mDynStrSize , mDynSymOffset , mDynSymSize ) ; } catch ( java.io.IOException e ) { return null ; } } return mDynamicSymbols.get ( name ) ; }

Target:
public android.os.cts.ReadElf.Symbol getSymbol ( java.lang.String name ) { if ( ( ( mSymTabOffset ) == 0 ) && ( ( mSymTabSize ) == 0 ) ) { return null ; } if ( ( mSymbols ) == null ) { mSymbols = new java.util.HashMap < java.lang.String , android.os.cts.ReadElf.Symbol > ( ) ; try { readSymbolTable ( mSymbols , mStrTabOffset , mStrTabSize , mSymTabOffset , mSymTabSize ) ; } catch ( java.io.IOException e ) { return null ; } } return mSymbols.get ( name ) ; }
Source:
private void maybeShowManageConferenceCallButton ( ) { if ( ( mPrimary ) == null ) { getUi ( ) . showManageConferenceCallButton ( false ) ; return ; } final boolean canManageConference = mPrimary.can ( PhoneCapabilities.MANAGE_CONFERENCE ) ; getUi ( ) . showManageConferenceCallButton ( ( ( mPrimary.isConferenceCall ( ) ) && canManageConference ) ) ; }

Target:
private void maybeShowManageConferenceCallButton ( ) { getUi ( ) . showManageConferenceCallButton ( shouldShowManageConference ( ) ) ; }
Source:
public void testKeyStore_Store_OutputStream_Failure ( ) throws java.lang.Exception { mKeyStore.load ( null , null ) ; java.io.OutputStream sink = new java.io.ByteArrayOutputStream ( ) ; try { mKeyStore.store ( sink , null ) ; fail ( "Should throw UnsupportedOperationException when trying to store" ) ; } catch ( java.lang.UnsupportedOperationException success ) { } try { mKeyStore.store ( sink , "blah" . toCharArray ( ) ) ; fail ( "Should throw UnsupportedOperationException when trying to store" ) ; } catch ( java.lang.UnsupportedOperationException success ) { } }

Target:
public void testKeyStore_Store_OutputStream_Encrypted_Failure ( ) throws java.lang.Exception { setupPassword ( ) ; mKeyStore.load ( null , null ) ; java.io.OutputStream sink = new java.io.ByteArrayOutputStream ( ) ; try { mKeyStore.store ( sink , null ) ; fail ( "Should throw UnsupportedOperationException when trying to store" ) ; } catch ( java.lang.UnsupportedOperationException success ) { } try { mKeyStore.store ( sink , "blah" . toCharArray ( ) ) ; fail ( "Should throw UnsupportedOperationException when trying to store" ) ; } catch ( java.lang.UnsupportedOperationException success ) { } }
Source:
private void addListValue ( java.lang.reflect.Field field , java.lang.Object value , com.google.devtools.common.options.OptionPriority priority , java.lang.String source , java.lang.String implicitDependant , java.lang.String expandedFrom ) { com.google.devtools.common.options.OptionsParserImpl.ParsedOptionEntry entry = parsedValues.get ( field ) ; if ( entry == null ) { entry = new com.google.devtools.common.options.OptionsParserImpl.ParsedOptionEntry ( com.google.common.collect.ArrayListMultimap.create ( ) , priority , source , implicitDependant , expandedFrom , true ) ; parsedValues.put ( field , entry ) ; maybeAddDeprecationWarning ( field ) ; } entry.addValue ( priority , value ) ; }

Target:
private void addListValue ( java.lang.reflect.Field field , java.lang.Object value , com.google.devtools.common.options.OptionPriority priority , java.lang.String source , java.lang.String implicitDependant , java.lang.String expandedFrom ) { com.google.devtools.common.options.OptionsParser.OptionValueDescription entry = parsedValues.get ( field ) ; if ( entry == null ) { entry = new com.google.devtools.common.options.OptionsParser.OptionValueDescription ( field.getName ( ) , com.google.common.collect.ArrayListMultimap.create ( ) , priority , source , implicitDependant , expandedFrom , true ) ; parsedValues.put ( field , entry ) ; maybeAddDeprecationWarning ( field ) ; } entry.addValue ( priority , value ) ; }
Source:
public void setZeroDigit ( char zeroDigit ) { if ( ( digits ) != null ) { digits = digits.clone ( ) ; this . digits [ 0 ] = zeroDigit ; for ( int i = 1 ; i < 10 ; i ++ ) { this . digits [ i ] = ( ( char ) ( zeroDigit + i ) ) ; } } else { this . zeroDigit = zeroDigit ; } }

Target:
public void setPercentString ( java.lang.String percentString ) { if ( percentString == null ) { throw new java.lang.NullPointerException ( "The input percent sign is null" ) ; } this . percentString = percentString ; if ( ( percentString.length ( ) ) == 1 ) { this . percent = percentString.charAt ( 0 ) ; } else { this . percent = com.ibm.icu.text.DecimalFormatSymbols.DEF_PERCENT ; } }
Source:
private void applyPropertyPattern ( com.ibm.icu.impl.RuleCharacterIterator chars , java.lang.StringBuffer rebuiltPat , com.ibm.icu.text.SymbolTable symbols ) { java.lang.String patStr = chars.lookahead ( ) ; java.text.ParsePosition pos = new java.text.ParsePosition ( 0 ) ; applyPropertyPattern ( patStr , pos , symbols ) ; if ( ( pos.getIndex ( ) ) == 0 ) { com.ibm.icu.text.UnicodeSet.syntaxError ( chars , "Invalid property pattern" ) ; } chars.jumpahead ( pos.getIndex ( ) ) ; rebuiltPat.append ( patStr.substring ( 0 , pos.getIndex ( ) ) ) ; }

Target:
private void applyPropertyPattern ( com.ibm.icu.impl.RuleCharacterIterator chars , java.lang.Appendable rebuiltPat , com.ibm.icu.text.SymbolTable symbols ) { java.lang.String patStr = chars.lookahead ( ) ; java.text.ParsePosition pos = new java.text.ParsePosition ( 0 ) ; applyPropertyPattern ( patStr , pos , symbols ) ; if ( ( pos.getIndex ( ) ) == 0 ) { com.ibm.icu.text.UnicodeSet.syntaxError ( chars , "Invalid property pattern" ) ; } chars.jumpahead ( pos.getIndex ( ) ) ; com.ibm.icu.text.UnicodeSet.append ( rebuiltPat , patStr.substring ( 0 , pos.getIndex ( ) ) ) ; }
Source:
public static com.google.devtools.build.android.desugar.LambdaInfo create ( java.lang.String desiredInternalName , java.lang.String factoryMethodDesc , org.objectweb.asm.Handle methodReference , org.objectweb.asm.Handle bridgeMethod ) { return new com.google.devtools.build.android.desugar.AutoValue_LambdaInfo ( desiredInternalName , factoryMethodDesc , methodReference , bridgeMethod ) ; }

Target:
public static com.google.devtools.build.android.desugar.LambdaInfo create ( java.lang.String desiredInternalName , java.lang.String factoryMethodDesc , boolean needFactory , org.objectweb.asm.Handle methodReference , org.objectweb.asm.Handle bridgeMethod ) { com.google.common.base.Preconditions.checkArgument ( ( ( ! needFactory ) || ( ! ( factoryMethodDesc.startsWith ( "()" ) ) ) ) , "Shouldn't need a factory method for %s : %s" , desiredInternalName , factoryMethodDesc ) ; return new com.google.devtools.build.android.desugar.AutoValue_LambdaInfo ( desiredInternalName , factoryMethodDesc , needFactory , methodReference , bridgeMethod ) ; }
Source:
private java.lang.StringBuffer subformat ( java.lang.String pluralCount , java.lang.StringBuffer result , java.text.FieldPosition fieldPosition , boolean isNegative , boolean isInteger , boolean parseAttr ) { if ( ( style ) == ( NumberFormat.PLURALCURRENCYSTYLE ) ) { java.lang.String currencyPluralPattern = currencyPluralInfo.getCurrencyPluralPattern ( pluralCount ) ; if ( ( formatPattern.equals ( currencyPluralPattern ) ) == false ) { applyPatternWithoutExpandAffix ( currencyPluralPattern , false ) ; } } expandAffixAdjustWidth ( pluralCount ) ; return subformat ( result , fieldPosition , isNegative , isInteger , parseAttr ) ; }

Target:
private java.lang.StringBuffer subformat ( java.lang.String pluralCount , java.lang.StringBuffer result , java.text.FieldPosition fieldPosition , boolean isNegative , boolean isInteger , boolean parseAttr ) { if ( ( style ) == ( com.ibm.icu.text.NumberFormat.PLURALCURRENCYSTYLE ) ) { java.lang.String currencyPluralPattern = currencyPluralInfo.getCurrencyPluralPattern ( pluralCount ) ; if ( ( formatPattern.equals ( currencyPluralPattern ) ) == false ) { applyPatternWithoutExpandAffix ( currencyPluralPattern , false ) ; } } expandAffixAdjustWidth ( pluralCount ) ; return subformat ( result , fieldPosition , isNegative , isInteger , parseAttr ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; if ( ! ( isSupported ( ) ) ) return ; setRestrictBackground ( false ) ; removeRestrictBackgroundWhitelist ( mUid ) ; removeRestrictBackgroundBlacklist ( mUid ) ; registerBroadcastReceiver ( ) ; assertRestrictBackgroundChangedReceived ( 0 ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; mIsDataSaverSupported = isDataSaverSupported ( ) ; if ( ! ( isSupported ( ) ) ) return ; setRestrictBackground ( false ) ; removeRestrictBackgroundWhitelist ( mUid ) ; removeRestrictBackgroundBlacklist ( mUid ) ; registerBroadcastReceiver ( ) ; assertRestrictBackgroundChangedReceived ( 0 ) ; }
Source:
public void testCallMethodOnCreatedFeature ( ) throws android.os.RemoteException { com.android.ims.internal.IImsMMTelFeature f = mTestImsServiceBinder.createMMTelFeature ( android.telephony.ims.ImsServiceTest.TEST_SLOT_0 , mTestCallback ) ; f.isConnected ( 0 , 0 ) ; junit.framework.Assert.assertTrue ( mTestImsService.mTestMMTelFeature.isConnectedCalled ) ; }

Target:
public void testImsServiceUpSentCompat ( ) throws android.os.RemoteException { mTestImsServiceBinder.createMmTelFeature ( android.telephony.ims.ImsServiceTest.TEST_SLOT_0 , mTestCallback ) ; mTestImsService.mSpyMmTelFeature.sendSetFeatureState ( ImsFeature.STATE_READY ) ; 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 ( ) ) ; verifyServiceUpSent ( intentCaptor.getValue ( ) ) ; } catch ( java.lang.IndexOutOfBoundsException e ) { junit.framework.Assert.fail ( "Did not receive all intents" ) ; } }
Source:
void test ( ) { BRANCH ( ( ( 39808.0 - ( cts ) ) - ( dev ) ) ) ; { com.android.cts.verifier.notifications.MockListener.MockListener.getInstance ( ) . requestListenerHints ( MockListener.HINT_HOST_DISABLE_CALL_EFFECTS ) ; status = RETEST ; } int result = com.android.cts.verifier.notifications.MockListener.MockListener.getInstance ( ) . getCurrentListenerHints ( ) ; HEAD ( 616632 ) ; }

Target:
protected void test ( ) { if ( ( status ) == ( READY ) ) { com.android.cts.verifier.notifications.MockListener.MockListener.getInstance ( ) . requestListenerHints ( MockListener.HINT_HOST_DISABLE_CALL_EFFECTS ) ; status = RETEST ; } else { int result = com.android.cts.verifier.notifications.MockListener.MockListener.getInstance ( ) . getCurrentListenerHints ( ) ; if ( ( result & ( com.android.cts.verifier.notifications.MockListener.MockListener.HINT_HOST_DISABLE_CALL_EFFECTS ) ) == ( com.android.cts.verifier.notifications.MockListener.MockListener.HINT_HOST_DISABLE_CALL_EFFECTS ) ) { status = PASS ; next ( ) ; } else { logFail ( ) ; status = FAIL ; } } }
Source:
public void testIsDemoUser_inDemoUser ( ) throws java.lang.Exception { final int demoUserId = createDemoUser ( ) ; getDevice ( ) . startUser ( demoUserId ) ; installAppAsUser ( android.host.retaildemo.DemoModeTest.RETAIL_DEMO_TEST_APK , demoUserId ) ; junit.framework.Assert.assertTrue ( runDeviceTestsAsUser ( ".DemoUserTest" , "testIsDemoUser_success" , demoUserId ) ) ; }

Target:
public void testIsDemoUser_inDemoUser ( ) throws java.lang.Exception { if ( ! ( getDevice ( ) . isMultiUserSupported ( ) ) ) { return ; } final int demoUserId = createDemoUser ( ) ; getDevice ( ) . startUser ( demoUserId ) ; installAppAsUser ( android.host.retaildemo.DemoModeTest.RETAIL_DEMO_TEST_APK , demoUserId ) ; junit.framework.Assert.assertTrue ( runDeviceTestsAsUser ( ".DemoUserTest" , "testIsDemoUser_success" , demoUserId ) ) ; }
Source:
public void noteAudioTurnedOnLocked ( ) { if ( ! ( mAudioTurnedOn ) ) { mAudioTurnedOn = true ; if ( ( mAudioTurnedOnTimer ) == null ) { mAudioTurnedOnTimer = new com.android.internal.os.BatteryStatsImpl.StopwatchTimer ( this , AUDIO_TURNED_ON , null , mUnpluggables ) ; } mAudioTurnedOnTimer.startRunningLocked ( this ) ; } }

Target:
public com.android.internal.os.BatteryStatsImpl.StopwatchTimer createAudioTurnedOnTimerLocked ( ) { if ( ( mAudioTurnedOnTimer ) == null ) { mAudioTurnedOnTimer = new com.android.internal.os.BatteryStatsImpl.StopwatchTimer ( this , AUDIO_TURNED_ON , null , mUnpluggables ) ; } return mAudioTurnedOnTimer ; }
Source:
public void testSpecials ( ) { final com.ibm.icu.util.LocaleMatcher matcher = new com.ibm.icu.util.LocaleMatcher ( "en, fil, ro, nn" ) ; assertEquals ( new com.ibm.icu.util.ULocale ( "fil" ) , matcher.getBestMatch ( "tl" ) ) ; assertEquals ( new com.ibm.icu.util.ULocale ( "ro" ) , matcher.getBestMatch ( "mo" ) ) ; assertEquals ( new com.ibm.icu.util.ULocale ( "nn" ) , matcher.getBestMatch ( "nb" ) ) ; assertEquals ( new com.ibm.icu.util.ULocale ( "en" ) , matcher.getBestMatch ( "ja" ) ) ; }

Target:
public void testSpecials ( ) { final com.ibm.icu.util.LocaleMatcher matcher = new com.ibm.icu.util.LocaleMatcher ( "en, fil, ro, nn" ) ; assertEquals ( new com.ibm.icu.util.ULocale ( "fil" ) , matcher.getBestMatch ( "tl" ) ) ; assertEquals ( new com.ibm.icu.util.ULocale ( "ro" ) , matcher.getBestMatch ( "mo" ) ) ; assertEquals ( new com.ibm.icu.util.ULocale ( "nn" ) , matcher.getBestMatch ( "no" ) ) ; assertEquals ( new com.ibm.icu.util.ULocale ( "en" ) , matcher.getBestMatch ( "ja" ) ) ; }
Source:
public void actionPerformed ( com.intellij.openapi.actionSystem.AnActionEvent e ) { final com.intellij.openapi.project.Project project = e.getProject ( ) ; final com.intellij.openapi.module.Module appEngineModule = e.getData ( LangDataKeys.MODULE ) ; com.android.tools.idea.gradle.invoker.GradleInvoker.getInstance ( project ) . executeTasks ( java.util.Arrays.asList ( ( ( appEngineModule.getName ( ) ) + ":appengineEndpointsInstallClientLibs" ) ) ) ; }

Target:
public void actionPerformed ( com.intellij.openapi.actionSystem.AnActionEvent e ) { final com.intellij.openapi.project.Project project = e.getProject ( ) ; final com.intellij.openapi.module.Module appEngineModule = e.getData ( LangDataKeys.MODULE ) ; if ( ( project == null ) || ( appEngineModule == null ) ) { com.intellij.openapi.ui.Messages.showErrorDialog ( project , "Please select an App Engine module." , com.google.gct.idea.appengine.gradle.action.InstallClientLibrariesAction.ERROR_MSG_TITLE ) ; return ; } com.android.tools.idea.gradle.invoker.GradleInvoker.getInstance ( project ) . executeTasks ( java.util.Arrays.asList ( ( ( appEngineModule.getName ( ) ) + ":appengineEndpointsInstallClientLibs" ) ) ) ; }
Source:
public void onLoadFinished ( android.content.Loader < android.database.Cursor > loader , android.database.Cursor data ) { if ( com.android.dialer.app.list.OldSpeedDialFragment.DEBUG ) { com.android.dialer.common.LogUtil.d ( "ContactTileLoaderListener.onLoadFinished" , null ) ; } contactTileAdapter.setContactCursor ( data ) ; setEmptyViewVisibility ( ( ( contactTileAdapter.getCount ( ) ) == 0 ) ) ; }

Target:
public void onCreate ( android.os.Bundle savedState ) { android.os.Trace.beginSection ( ( ( com.android.dialer.app.list.OldSpeedDialFragment.TAG ) + " onCreate" ) ) ; super . onCreate ( savedState ) ; contactTileAdapter = new com.android.dialer.app.list.PhoneFavoritesTileAdapter ( getContext ( ) , contactTileAdapterListener , this ) ; contactTileAdapter.setPhotoLoader ( com.android.dialer.contactphoto.ContactPhotoManager.getInstance ( getContext ( ) ) ) ; contactTileLoaderListener = new com.android.dialer.app.list.OldSpeedDialFragment.ContactTileLoaderListener ( this , contactTileAdapter ) ; animationDuration = getResources ( ) . getInteger ( R.integer.fade_duration ) ; android.os.Trace.endSection ( ) ; }
Source:
protected com.android.internal.telephony.SMSDispatcher.SmsTracker getSmsTracker ( java.util.HashMap < java.lang.String , java.lang.Object > data , android.app.PendingIntent sentIntent , android.app.PendingIntent deliveryIntent , java.lang.String format , android.net.Uri messageUri , boolean isExpectMore , java.lang.String fullMessageText , boolean isText , boolean persistMessage ) { return getSmsTracker ( data , sentIntent , deliveryIntent , format , null , null , messageUri , null , isExpectMore , fullMessageText , isText , persistMessage ) ; }

Target:
protected com.android.internal.telephony.SMSDispatcher.SmsTracker getSmsTracker ( java.util.HashMap < java.lang.String , java.lang.Object > data , android.app.PendingIntent sentIntent , android.app.PendingIntent deliveryIntent , java.lang.String format , android.net.Uri messageUri , boolean expectMore , java.lang.String fullMessageText , boolean isText , boolean persistMessage ) { return getSmsTracker ( data , sentIntent , deliveryIntent , format , null , null , messageUri , null , expectMore , fullMessageText , isText , persistMessage , com.android.internal.telephony.IccSmsInterfaceManager.SMS_MESSAGE_PRIORITY_NOT_SPECIFIED , com.android.internal.telephony.IccSmsInterfaceManager.SMS_MESSAGE_PERIOD_NOT_SPECIFIED ) ; }
Source:
public java.nio.LongBuffer put ( java.nio.LongBuffer src ) { if ( src == ( this ) ) { throw new java.lang.IllegalArgumentException ( ) ; } if ( ( src.remaining ( ) ) > ( remaining ( ) ) ) { throw new java.nio.BufferOverflowException ( ) ; } long [ ] contents = new long [ src.remaining ( ) ] ; src.get ( contents ) ; put ( contents ) ; return this ; }

Target:
public java.nio.LongBuffer put ( java.nio.LongBuffer src ) { if ( src == ( this ) ) { throw new java.lang.IllegalArgumentException ( "src == this" ) ; } if ( ( src.remaining ( ) ) > ( remaining ( ) ) ) { throw new java.nio.BufferOverflowException ( ) ; } long [ ] contents = new long [ src.remaining ( ) ] ; src.get ( contents ) ; put ( contents ) ; return this ; }
Source:
private java.lang.String getPathToApks ( org.jetbrains.android.run.AndroidRunningState runningState ) { java.lang.String buildPath = ( runningState.getFacet ( ) . getModule ( ) . getModuleFile ( ) . getParent ( ) . getPath ( ) ) + "/build" ; java.io.File buildFolder = new java.io.File ( buildPath ) ; for ( java.lang.String subFolder : buildFolder.list ( ) ) { if ( subFolder.equals ( "apk" ) ) { return buildPath + "/apk/" ; } } return buildPath + "/outputs/apk/" ; }

Target:
private void addPathIfExists ( java.util.List < java.lang.String > apkPaths , java.lang.String apkPath ) { if ( new java.io.File ( apkPath ) . exists ( ) ) { apkPaths.add ( apkPath ) ; } }
Source:
private void verifyStandardDeviation ( ) throws java.lang.Throwable { android.hardware.cts.helpers.sensoroperations.VerifySensorOperation verifyStdDev = new android.hardware.cts.helpers.sensoroperations.VerifySensorOperation ( this . getApplicationContext ( ) , android.hardware.Sensor.TYPE_MAGNETIC_FIELD , android.hardware.SensorManager.SENSOR_DELAY_FASTEST , 0 , 100 ) ; verifyStdDev.verifyStandardDeviation ( new float [ ] { 2.0F , 2.0F , 2.0F } ) ; verifyStdDev.execute ( ) ; logSuccess ( ) ; }

Target:
private void verifyStandardDeviation ( ) throws java.lang.Throwable { android.hardware.cts.helpers.sensoroperations.TestSensorOperation verifyStdDev = new android.hardware.cts.helpers.sensoroperations.TestSensorOperation ( this . getApplicationContext ( ) , android.hardware.Sensor.TYPE_MAGNETIC_FIELD , android.hardware.SensorManager.SENSOR_DELAY_FASTEST , 0 , 100 ) ; verifyStdDev.addVerification ( new android.hardware.cts.helpers.sensorverification.StandardDeviationVerification ( new float [ ] { 2.0F , 2.0F , 2.0F } ) ) ; verifyStdDev.execute ( ) ; logSuccess ( ) ; }
Source:
public final java.nio.ByteBuffer get ( byte [ ] dst , int dstOffset , int byteCount ) { checkGetBounds ( 1 , dst.length , dstOffset , byteCount ) ; this . block.peekByteArray ( ( ( offset ) + ( position ) ) , dst , dstOffset , byteCount ) ; position += byteCount ; return this ; }

Target:
public java.nio.ByteBuffer put ( byte value ) { if ( isReadOnly ) { throw new java.nio.ReadOnlyBufferException ( ) ; } if ( ( position ) == ( limit ) ) { throw new java.nio.BufferOverflowException ( ) ; } this . block.pokeByte ( ( ( offset ) + ( ( position ) ++ ) ) , value ) ; return this ; }
Source:
public java.lang.String getDeviceSoftwareVersionForSlot ( int slotIndex , java.lang.String callingPackage ) { if ( ! ( com.android.internal.telephony.TelephonyPermissions.checkCallingOrSelfReadPhoneState ( mApp , callingPackage , "getDeviceSoftwareVersionForSlot" ) ) ) { return null ; } com.android.internal.telephony.Phone phone = com.android.internal.telephony.PhoneFactory.getPhone ( slotIndex ) ; return phone == null ? null : phone.getDeviceSvn ( ) ; }

Target:
public int getRadioAccessFamily ( int phoneId , java.lang.String callingPackage ) { com.android.internal.telephony.Phone phone = com.android.internal.telephony.PhoneFactory.getPhone ( phoneId ) ; if ( phone == null ) { return android.telephony.RadioAccessFamily.RAF_UNKNOWN ; } int subId = phone.getSubId ( ) ; if ( ! ( com.android.internal.telephony.TelephonyPermissions.checkCallingOrSelfReadPhoneState ( mApp , subId , callingPackage , "getRadioAccessFamily" ) ) ) { return android.telephony.RadioAccessFamily.RAF_UNKNOWN ; } return com.android.internal.telephony.ProxyController.getInstance ( ) . getRadioAccessFamily ( phoneId ) ; }
Source:
static int retrieveItemId ( com.android.internal.telephony.gsm.stk.ComprehensionTlv ctlv ) throws com.android.internal.telephony.gsm.stk.ResultException { int id = 0 ; byte [ ] rawValue = ctlv.getRawValue ( ) ; int valueIndex = ctlv.getValueIndex ( ) ; try { id = ( rawValue [ valueIndex ] ) & 255 ; } catch ( java.lang.IndexOutOfBoundsException e ) { throw new com.android.internal.telephony.gsm.stk.ResultException ( ResultCode.CMD_DATA_NOT_UNDERSTOOD ) ; } return id ; }

Target:
static int retrieveItemId ( com.android.internal.telephony.cat.ComprehensionTlv ctlv ) throws com.android.internal.telephony.cat.ResultException { int id = 0 ; byte [ ] rawValue = ctlv.getRawValue ( ) ; int valueIndex = ctlv.getValueIndex ( ) ; try { id = ( rawValue [ valueIndex ] ) & 255 ; } catch ( java.lang.IndexOutOfBoundsException e ) { throw new com.android.internal.telephony.cat.ResultException ( ResultCode.CMD_DATA_NOT_UNDERSTOOD ) ; } return id ; }
Source:
public final int update ( java.nio.ByteBuffer input , java.nio.ByteBuffer output ) throws javax.crypto.ShortBufferException { checkCipherState ( ) ; if ( ( input == null ) || ( output == null ) ) { throw new java.lang.IllegalArgumentException ( "Buffers must not be null" ) ; } if ( input == output ) { throw new java.lang.IllegalArgumentException ( ( "Input and output buffers must " + "not be the same object, consider using buffer.duplicate()" ) ) ; } if ( output.isReadOnly ( ) ) { throw new java.nio.ReadOnlyBufferException ( ) ; } chooseFirstProvider ( ) ; return spi.engineUpdate ( input , output ) ; }

Target:
public final int update ( java.nio.ByteBuffer input , java.nio.ByteBuffer output ) throws javax.crypto.ShortBufferException { checkCipherState ( ) ; if ( ( input == null ) || ( output == null ) ) { throw new java.lang.IllegalArgumentException ( "Buffers must not be null" ) ; } if ( input == output ) { throw new java.lang.IllegalArgumentException ( ( "Input and output buffers must " + "not be the same object, consider using buffer.duplicate()" ) ) ; } if ( output.isReadOnly ( ) ) { throw new java.nio.ReadOnlyBufferException ( ) ; } updateProviderIfNeeded ( ) ; return spi.engineUpdate ( input , output ) ; }
Source:
public void getOutgoingCallerIdDisplay ( android.os.Message onComplete ) { if ( com.android.internal.telephony.imsphone.ImsPhone.DBG ) android.telephony.Rlog.d ( com.android.internal.telephony.imsphone.ImsPhone.LOG_TAG , "getCLIR" ) ; android.os.Message resp ; resp = obtainMessage ( com.android.internal.telephony.imsphone.ImsPhone.EVENT_GET_CLIR_DONE , onComplete ) ; try { com.android.ims.ImsUtInterface ut = mCT.getUtInterface ( ) ; ut.queryCLIR ( resp ) ; } catch ( com.android.ims.ImsException e ) { sendErrorResponse ( onComplete , e ) ; } }

Target:
public void getOutgoingCallerIdDisplay ( android.os.Message onComplete ) { if ( com.android.internal.telephony.imsphone.ImsPhone.DBG ) logd ( "getCLIR" ) ; android.os.Message resp ; resp = obtainMessage ( com.android.internal.telephony.imsphone.ImsPhone.EVENT_GET_CLIR_DONE , onComplete ) ; try { com.android.ims.ImsUtInterface ut = mCT.getUtInterface ( ) ; ut.queryCLIR ( resp ) ; } catch ( com.android.ims.ImsException e ) { sendErrorResponse ( onComplete , e ) ; } }
Source:
public void testImage ( ) throws java.io.IOException { java.io.File f = java.io.File.createTempFile ( "img" , "png" ) ; f.deleteOnExit ( ) ; java.lang.String actual = new com.android.utils.HtmlBuilder ( ) . addImage ( f.toURI ( ) . toURL ( ) , "preview" ) . getHtml ( ) ; java.lang.String path = f.getAbsolutePath ( ) ; if ( ! ( path.startsWith ( "/" ) ) ) { path = '/' + path ; } java.lang.String expected = java.lang.String.format ( "<img src=\'file:%1$s\' alt=\"preview\" />" , path ) ; assertEquals ( expected , actual ) ; }

Target:
public void testImage ( ) throws java.io.IOException { java.io.File f = java.io.File.createTempFile ( "img" , "png" ) ; f.deleteOnExit ( ) ; java.lang.String actual = new com.android.utils.HtmlBuilder ( ) . addImage ( com.android.utils.SdkUtils.fileToUrl ( f ) , "preview" ) . getHtml ( ) ; java.lang.String path = f.getAbsolutePath ( ) ; if ( ! ( path.startsWith ( "/" ) ) ) { path = '/' + path ; } java.lang.String expected = java.lang.String.format ( "<img src=\'file:%1$s\' alt=\"preview\" />" , path ) ; assertEquals ( expected , actual ) ; }
Source:
public void exceptionPostsError ( ) throws java.lang.Exception { mNetwork.setNumExceptionsToThrow ( MockNetwork.ALWAYS_THROW_EXCEPTIONS ) ; mNetworkQueue.add ( mRequest ) ; mNetworkQueue.waitUntilEmpty ( com.android.volley.NetworkDispatcherTest.TIMEOUT_MILLIS ) ; assertFalse ( mDelivery.postResponse_called ) ; assertTrue ( mDelivery.postError_called ) ; }

Target:
public void exceptionPostsError ( ) throws java.lang.Exception { org.mockito.Mockito.when ( mNetwork.performRequest ( org.mockito.ArgumentMatchers.any ( com.android.volley.Request.class ) ) ) . thenThrow ( new com.android.volley.ServerError ( ) ) ; mDispatcher.processRequest ( mRequest ) ; org.mockito.Mockito.verify ( mDelivery ) . postError ( org.mockito.ArgumentMatchers.any ( com.android.volley.Request.class ) , org.mockito.ArgumentMatchers.any ( com.android.volley.VolleyError.class ) ) ; org.mockito.Mockito.verify ( mDelivery , org.mockito.Mockito.never ( ) ) . postResponse ( org.mockito.ArgumentMatchers.any ( com.android.volley.Request.class ) , org.mockito.ArgumentMatchers.any ( com.android.volley.Response.class ) ) ; }
Source:
public static org.eclipse.jdt.core.IClasspathEntry [ ] addEntryToClasspath ( org.eclipse.jdt.core.IClasspathEntry [ ] entries , org.eclipse.jdt.core.IClasspathEntry new_entry ) { int n = entries.length ; org.eclipse.jdt.core.IClasspathEntry [ ] newEntries = new org.eclipse.jdt.core.IClasspathEntry [ n + 1 ] ; java.lang.System.arraycopy ( entries , 0 , newEntries , 0 , n ) ; newEntries [ n ] = new_entry ; return newEntries ; }

Target:
public static org.eclipse.jdt.core.IClasspathEntry [ ] addEntryToClasspath ( org.eclipse.jdt.core.IClasspathEntry [ ] entries , org.eclipse.jdt.core.IClasspathEntry newEntry ) { int n = entries.length ; org.eclipse.jdt.core.IClasspathEntry [ ] newEntries = new org.eclipse.jdt.core.IClasspathEntry [ n + 1 ] ; java.lang.System.arraycopy ( entries , 0 , newEntries , 0 , n ) ; newEntries [ n ] = newEntry ; return newEntries ; }
Source:
public void test001_throughJayce ( ) throws java.lang.Exception { java.io.File tmpDir = com.android.jack.test.toolchain.AbstractTestTools.createTempDir ( ) ; com.android.jack.test.toolchain.IToolchain toolchain = com.android.jack.test.toolchain.AbstractTestTools.getCandidateToolchain ( ) ; toolchain.srcToLib ( com.android.jack.test.toolchain.AbstractTestTools.getClasspathAsString ( toolchain.getDefaultBootClasspath ( ) ) , tmpDir , false , com.android.jack.test.toolchain.AbstractTestTools.getTestRootDir ( "com.android.jack.nopackage.test001.jack" ) ) ; toolchain = com.android.jack.test.toolchain.AbstractTestTools.getCandidateToolchain ( ) ; toolchain.libToExe ( tmpDir , com.android.jack.test.toolchain.AbstractTestTools.createTempDir ( ) , false ) ; }

Target:
public void test001_throughJayce ( ) throws java.lang.Exception { java.io.File tmpDir = com.android.jack.test.toolchain.AbstractTestTools.createTempDir ( ) ; com.android.jack.test.toolchain.IToolchain toolchain = com.android.jack.test.toolchain.AbstractTestTools.getCandidateToolchain ( ) ; toolchain.addToClasspath ( toolchain.getDefaultBootClasspath ( ) ) . srcToLib ( tmpDir , false , com.android.jack.test.toolchain.AbstractTestTools.getTestRootDir ( "com.android.jack.nopackage.test001.jack" ) ) ; toolchain = com.android.jack.test.toolchain.AbstractTestTools.getCandidateToolchain ( ) ; toolchain.libToExe ( tmpDir , com.android.jack.test.toolchain.AbstractTestTools.createTempDir ( ) , false ) ; }
Source:
private void handleEnterEmergencyCallbackMode ( android.os.Message msg ) { if ( com.android.internal.telephony.GsmCdmaPhone.DBG ) { android.telephony.Rlog.d ( com.android.internal.telephony.GsmCdmaPhone.LOG_TAG , ( "handleEnterEmergencyCallbackMode,mIsPhoneInEcmState= " + ( mIsPhoneInEcmState ) ) ) ; } if ( ! ( mIsPhoneInEcmState ) ) { setIsInEcm ( true ) ; sendEmergencyCallbackModeChange ( ) ; long delayInMillis = android.os.SystemProperties.getLong ( TelephonyProperties.PROPERTY_ECM_EXIT_TIMER , com.android.internal.telephony.GsmCdmaPhone.DEFAULT_ECM_EXIT_TIMER_VALUE ) ; postDelayed ( mExitEcmRunnable , delayInMillis ) ; mWakeLock.acquire ( ) ; } }

Target:
private void handleEnterEmergencyCallbackMode ( android.os.Message msg ) { if ( com.android.internal.telephony.GsmCdmaPhone.DBG ) { android.telephony.Rlog.d ( com.android.internal.telephony.GsmCdmaPhone.LOG_TAG , ( "handleEnterEmergencyCallbackMode, isInEcm()=" + ( isInEcm ( ) ) ) ) ; } if ( ! ( isInEcm ( ) ) ) { setIsInEcm ( true ) ; sendEmergencyCallbackModeChange ( ) ; long delayInMillis = android.os.SystemProperties.getLong ( TelephonyProperties.PROPERTY_ECM_EXIT_TIMER , com.android.internal.telephony.GsmCdmaPhone.DEFAULT_ECM_EXIT_TIMER_VALUE ) ; postDelayed ( mExitEcmRunnable , delayInMillis ) ; mWakeLock.acquire ( ) ; } }
Source:
private boolean removeTaskByIdLocked ( int taskId , boolean killProcess ) { com.android.server.am.TaskRecord tr = mStackSupervisor.anyTaskForIdLocked ( taskId , false ) ; if ( tr != null ) { tr.removeTaskActivitiesLocked ( ) ; cleanUpRemovedTaskLocked ( tr , killProcess ) ; if ( tr.isPersistable ) { notifyTaskPersisterLocked ( null , true ) ; } return true ; } android.util.Slog.w ( com.android.server.am.ActivityManagerService.TAG , ( "Request to remove task ignored for non-existent task " + taskId ) ) ; return false ; }

Target:
public void clearGrantedUriPermissions ( java.lang.String packageName , int userId ) { enforceCallingPermission ( android.Manifest.permission.CLEAR_APP_GRANTED_URI_PERMISSIONS , "clearGrantedUriPermissions" ) ; removeUriPermissionsForPackageLocked ( packageName , userId , true ) ; }
Source:
public boolean hasNext ( ) { return backingIterator.hasNext ( ) ; }

Target:
protected java.util.Set < java.util.Map.Entry < K , V > > createEntrySet ( ) { return new com.google.common.collect.Maps.EntrySet < K , V > ( ) { @ java.lang.Override java.util.Map < K , V > map ( ) { return com.google.common.collect.Maps.AsMapView.this ; } @ java.lang.Override public java.util.Iterator < java.util.Map.Entry < K , V > > iterator ( ) { return com.google.common.collect.Maps.asMapEntryIterator ( backingSet ( ) , function ) ; } } ; }
Source:
private synchronized void initGenericTypes ( ) { if ( ! ( genericTypesAreInitialized ) ) { java.lang.String signatureAttribute = getSignatureAttribute ( ) ; org.apache.harmony.luni.lang.reflect.GenericSignatureParser parser = new org.apache.harmony.luni.lang.reflect.GenericSignatureParser ( declaringClass.getClassLoader ( ) ) ; parser.parseForMethod ( this , signatureAttribute , exceptionTypes ) ; formalTypeParameters = parser.formalTypeParameters ; genericParameterTypes = parser.parameterTypes ; genericExceptionTypes = parser.exceptionTypes ; genericReturnType = parser.returnType ; genericTypesAreInitialized = true ; } }

Target:
private synchronized void initGenericTypes ( ) { if ( ! ( genericTypesAreInitialized ) ) { java.lang.String signatureAttribute = getSignatureAttribute ( ) ; libcore.reflect.GenericSignatureParser parser = new libcore.reflect.GenericSignatureParser ( declaringClass.getClassLoader ( ) ) ; parser.parseForMethod ( this , signatureAttribute , exceptionTypes ) ; formalTypeParameters = parser.formalTypeParameters ; genericParameterTypes = parser.parameterTypes ; genericExceptionTypes = parser.exceptionTypes ; genericReturnType = parser.returnType ; genericTypesAreInitialized = true ; } }
Source:
public void testReverting ( ) throws java.lang.Exception { createPatch ( ) ; com.intellij.updater.PatchFileCreator.PreparationResult preparationResult = com.intellij.updater.PatchFileCreator.prepareAndValidate ( myFile , myOlderDir , com.intellij.updater.TEST_UI ) ; preparationResult.patch.getActions ( ) . add ( new com.intellij.updater.PatchFileCreatorTest.MyFailOnApplyPatchAction ( ) ) ; assertNothingHasChanged ( preparationResult , new java.util.HashMap < java.lang.String , com.intellij.updater.ValidationResult.Option > ( ) ) ; }

Target:
public void testRevertingWithAbsentFileToDelete ( ) throws java.lang.Exception { com.intellij.updater.Patch patch = com.intellij.updater.PatchFileCreator.create ( myPatchSpec , myFile , com.intellij.updater.TEST_UI ) ; new java.io.File ( myOlderDir , "bin/idea.bat" ) . delete ( ) ; com.intellij.updater.PatchFileCreator.PreparationResult preparationResult = com.intellij.updater.PatchFileCreator.prepareAndValidate ( myFile , myOlderDir , com.intellij.updater.TEST_UI ) ; preparationResult.patch.getActions ( ) . add ( new com.intellij.updater.PatchFileCreatorTest.MyFailOnApplyPatchAction ( patch ) ) ; assertNothingHasChanged ( patch , preparationResult , new java.util.HashMap < java.lang.String , com.intellij.updater.ValidationResult.Option > ( ) ) ; }
Source:
public boolean equals ( com.google.doclava.ClassInfo that ) { if ( that != null ) { return this . qualifiedName ( ) . equals ( that.qualifiedName ( ) ) ; } else { return false ; } }

Target:
public int compareTo ( java.lang.Object that ) { if ( that instanceof com.google.doclava.ClassInfo ) { return mQualifiedName.compareTo ( ( ( com.google.doclava.ClassInfo ) ( that ) ) . mQualifiedName ) ; } else { return ( this . hashCode ( ) ) - ( that.hashCode ( ) ) ; } }
Source:
public void copyFrom ( float [ ] 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 copy1DRangeFromUnchecked ( int off , int count , java.lang.Object array ) { copy1DRangeFromUnchecked ( off , count , array , validateObjectIsPrimitiveArray ( array , false ) , java.lang.reflect.Array.getLength ( array ) ) ; }
Source:
public void validateUserCredentialWithEapTls ( ) throws java.lang.Exception { android.net.wifi.hotspot2.pps.Credential cred = new android.net.wifi.hotspot2.pps.Credential ( ) ; cred.realm = "realm" ; cred.userCredential = new android.net.wifi.hotspot2.pps.Credential.UserCredential ( ) ; cred.userCredential.username = "username" ; cred.userCredential.password = "password" ; cred.userCredential.eapType = android.net.wifi.EAPConstants.EAP_TLS ; cred.userCredential.nonEapInnerMethod = "MS-CHAP" ; cred.caCertificate = android.net.wifi.FakeKeys.CA_CERT0 ; org.junit.Assert.assertFalse ( cred.validate ( ) ) ; }

Target:
public void validateUserCredentialWithEapTls ( ) throws java.lang.Exception { android.net.wifi.hotspot2.pps.Credential cred = android.net.wifi.hotspot2.pps.CredentialTest.createCredentialWithUserCredential ( ) ; cred.getUserCredential ( ) . setEapType ( EAPConstants.EAP_TLS ) ; org.junit.Assert.assertFalse ( cred.validate ( ) ) ; }
Source:
public static java.lang.String apiToMagic ( int targetApiLevel ) { java.lang.String version ; if ( targetApiLevel >= ( com.android.jack.dx.dex.DexFormat.API_CURRENT ) ) { version = com.android.jack.dx.dex.DexFormat.VERSION_CURRENT ; } else { version = com.android.jack.dx.dex.DexFormat.VERSION_FOR_API_13 ; } return ( ( com.android.jack.dx.dex.DexFormat.MAGIC_PREFIX ) + version ) + ( com.android.jack.dx.dex.DexFormat.MAGIC_SUFFIX ) ; }

Target:
public static java.lang.String apiToMagic ( int targetApiLevel ) { java.lang.String version ; if ( targetApiLevel >= ( com.android.jack.dx.dex.DexFormat.API_ANDROID_O ) ) { version = com.android.jack.dx.dex.DexFormat.VERSION_FOR_API_26 ; } else if ( targetApiLevel >= ( com.android.jack.dx.dex.DexFormat.API_ANDROID_N ) ) { version = com.android.jack.dx.dex.DexFormat.VERSION_FOR_API_24 ; } else { version = com.android.jack.dx.dex.DexFormat.VERSION_FOR_API_13 ; } return ( ( com.android.jack.dx.dex.DexFormat.MAGIC_PREFIX ) + version ) + ( com.android.jack.dx.dex.DexFormat.MAGIC_SUFFIX ) ; }
Source:
public int getDataNetworkTypeForSubscriber ( int subId , java.lang.String callingPackage ) { if ( ! ( com.android.internal.telephony.TelephonyPermissions.checkCallingOrSelfReadPhoneState ( mApp , callingPackage , "getDataNetworkTypeForSubscriber" ) ) ) { return android.telephony.TelephonyManager.NETWORK_TYPE_UNKNOWN ; } final com.android.internal.telephony.Phone phone = getPhone ( subId ) ; if ( phone != null ) { return phone.getServiceState ( ) . getDataNetworkType ( ) ; } else { return android.telephony.TelephonyManager.NETWORK_TYPE_UNKNOWN ; } }

Target:
public int getNetworkTypeForSubscriber ( int subId , java.lang.String callingPackage ) { if ( ! ( com.android.internal.telephony.TelephonyPermissions.checkCallingOrSelfReadPhoneState ( mApp , subId , callingPackage , "getNetworkTypeForSubscriber" ) ) ) { return android.telephony.TelephonyManager.NETWORK_TYPE_UNKNOWN ; } final com.android.internal.telephony.Phone phone = getPhone ( subId ) ; if ( phone != null ) { return phone.getServiceState ( ) . getDataNetworkType ( ) ; } else { return android.telephony.TelephonyManager.NETWORK_TYPE_UNKNOWN ; } }
Source:
public void testNonResizeableActivityHasFullDisplayBounds ( ) throws java.lang.Exception { launchActivityInStack ( android.server.cts.ActivityManagerFreeformStackTests.NON_RESIZEABLE_ACTIVITY , android.server.cts.FREEFORM_WORKSPACE_STACK_ID ) ; mAmWmState.computeState ( mDevice , new java.lang.String [ ] { android.server.cts.ActivityManagerFreeformStackTests.NON_RESIZEABLE_ACTIVITY } ) ; final android.server.cts.ActivityManagerState.ActivityTask task = mAmWmState.getAmState ( ) . getTaskByActivityName ( android.server.cts.ActivityManagerFreeformStackTests.NON_RESIZEABLE_ACTIVITY ) ; final android.server.cts.ActivityManagerState.ActivityStack stack = mAmWmState.getAmState ( ) . getStackById ( task.mStackId ) ; assertEquals ( mAmWmState.getWmState ( ) . getDisplay ( stack.mDisplayId ) . getDisplayRect ( ) , task.getBounds ( ) ) ; }

Target:
public void testNonResizeableActivityHasFullDisplayBounds ( ) throws java.lang.Exception { launchActivityInStack ( android.server.cts.ActivityManagerFreeformStackTests.NON_RESIZEABLE_ACTIVITY , android.server.cts.FREEFORM_WORKSPACE_STACK_ID ) ; mAmWmState.computeState ( mDevice , new java.lang.String [ ] { android.server.cts.ActivityManagerFreeformStackTests.NON_RESIZEABLE_ACTIVITY } ) ; final android.server.cts.ActivityManagerState.ActivityTask task = mAmWmState.getAmState ( ) . getTaskByActivityName ( android.server.cts.ActivityManagerFreeformStackTests.NON_RESIZEABLE_ACTIVITY ) ; final android.server.cts.ActivityManagerState.ActivityStack stack = mAmWmState.getAmState ( ) . getStackById ( task.mStackId ) ; if ( task.isFullscreen ( ) ) { return ; } assertEquals ( mAmWmState.getWmState ( ) . getDisplay ( stack.mDisplayId ) . getDisplayRect ( ) , task.getBounds ( ) ) ; }
Source:
private boolean checkForPrivateKey ( java.lang.String keyType , java.lang.Class < ? > keyClass ) { java.lang.String alias = sslParameters.getKeyManager ( ) . chooseServerAlias ( keyType , null , null ) ; if ( alias == null ) { return false ; } java.security.PrivateKey key = sslParameters.getKeyManager ( ) . getPrivateKey ( alias ) ; return ( key != null ) && ( keyClass.isAssignableFrom ( key.getClass ( ) ) ) ; }

Target:
private boolean checkForPrivateKey ( java.lang.String keyType , java.lang.String keyAlgorithm ) { java.lang.String alias = sslParameters.getKeyManager ( ) . chooseServerAlias ( keyType , null , null ) ; if ( alias == null ) { return false ; } java.security.PrivateKey key = sslParameters.getKeyManager ( ) . getPrivateKey ( alias ) ; return ( key != null ) && ( keyAlgorithm.equals ( key.getAlgorithm ( ) ) ) ; }
Source:
public void onCut ( org.eclipse.swt.dnd.Clipboard clipboard ) { }

Target:
private void createMenuAction ( org.eclipse.jface.action.IMenuManager manager ) { manager.removeAll ( ) ; manager.add ( mCutAction ) ; manager.add ( mCopyAction ) ; manager.add ( mPasteAction ) ; manager.add ( new org.eclipse.jface.action.Separator ( ) ) ; manager.add ( mDeleteAction ) ; manager.add ( mSelectAllAction ) ; }
Source:
public void testStageUninstall_noExistingDistro ( ) throws java.lang.Exception { assertFalse ( installer.stageUninstall ( ) ) ; assertNoDistroOperationStaged ( ) ; assertNoInstalledDistro ( ) ; }

Target:
public void testStageUninstall_existingStagedInstall ( ) throws java.lang.Exception { java.io.File stagedDataDir = installer.getStagedTzDataDir ( ) ; assertTrue ( stagedDataDir.mkdir ( ) ) ; byte [ ] distroBytes = com.android.timezone.distro.installer.TimeZoneDistroInstallerTest.createValidTimeZoneDistroBytes ( com.android.timezone.distro.installer.TimeZoneDistroInstallerTest.NEW_RULES_VERSION , 1 ) ; assertEquals ( TimeZoneDistroInstaller.INSTALL_SUCCESS , installer.stageInstallWithErrorCode ( new com.android.timezone.distro.TimeZoneDistro ( distroBytes ) ) ) ; assertEquals ( TimeZoneDistroInstaller.UNINSTALL_NOTHING_INSTALLED , installer.stageUninstall ( ) ) ; assertNoDistroOperationStaged ( ) ; }
Source:
public int getConnectionState ( ) { if ( ( getState ( ) ) != ( android.bluetooth.BluetoothAdapter.STATE_ON ) ) return android.bluetooth.BluetoothAdapter.STATE_DISCONNECTED ; try { synchronized ( mManagerCallback ) { if ( ( mService ) != null ) return mService.getAdapterConnectionState ( ) ; } } catch ( android.os.RemoteException e ) { android.util.Log.e ( android.bluetooth.BluetoothAdapter.TAG , "getConnectionState:" , e ) ; } return android.bluetooth.BluetoothAdapter.STATE_DISCONNECTED ; }

Target:
public boolean isOffloadedScanBatchingSupported ( ) { if ( ! ( getLeAccess ( ) ) ) return false ; try { mServiceLock.readLock ( ) . lock ( ) ; if ( ( mService ) != null ) return mService.isOffloadedScanBatchingSupported ( ) ; } catch ( android.os.RemoteException e ) { android.util.Log.e ( android.bluetooth.BluetoothAdapter.TAG , "failed to get isOffloadedScanBatchingSupported, error: " , e ) ; } finally { mServiceLock.readLock ( ) . unlock ( ) ; } return false ; }
Source:
public java.util.List < java.lang.String > callGetSelectionHint ( com.android.ide.eclipse.adt.internal.editors.layout.gre.NodeProxy parentNode , com.android.ide.eclipse.adt.internal.editors.layout.gre.NodeProxy childNode ) { com.android.ide.common.api.IViewRule rule = loadRule ( parentNode.getNode ( ) ) ; if ( rule != null ) { try { return rule.getSelectionHint ( parentNode , childNode ) ; } catch ( java.lang.Exception e ) { logError ( "%getSelectionHint() failed: %s" , rule.getClass ( ) . getSimpleName ( ) , e.toString ( ) ) ; } } return null ; }

Target:
public java.util.List < java.lang.String > callGetSelectionHint ( com.android.ide.eclipse.adt.internal.editors.layout.gre.NodeProxy parentNode , com.android.ide.eclipse.adt.internal.editors.layout.gre.NodeProxy childNode ) { com.android.ide.common.api.IViewRule rule = loadRule ( parentNode.getNode ( ) ) ; if ( rule != null ) { try { return rule.getSelectionHint ( parentNode , childNode ) ; } catch ( java.lang.Exception e ) { com.android.ide.eclipse.adt.AdtPlugin.log ( e , "%getSelectionHint() failed: %s" , rule.getClass ( ) . getSimpleName ( ) , e.toString ( ) ) ; } } return null ; }
Source:
private static com.google.currysrc.api.transform.TransformRule createHidePublicClassesRule ( ) { com.google.common.collect.ImmutableList.Builder < com.google.currysrc.api.transform.ast.TypeLocater > apiClassesWhitelistBuilder = com.google.common.collect.ImmutableList.builder ( ) ; for ( java.lang.String publicClassName : com.android.icu4j.srcgen.Icu4jTransform.PUBLIC_API_CLASSES ) { apiClassesWhitelistBuilder.add ( new com.google.currysrc.api.transform.ast.TypeLocater ( publicClassName ) ) ; } return com.android.icu4j.srcgen.Icu4jTransformRules.createOptionalRule ( new com.google.currysrc.transformers.HidePublicClasses ( apiClassesWhitelistBuilder.build ( ) , "Only a subset of ICU is exposed in Android" ) ) ; }

Target:
private static com.google.currysrc.api.process.Rule createHidePublicClassesRule ( ) { com.google.common.collect.ImmutableList.Builder < com.google.currysrc.api.process.ast.TypeLocator > apiClassesWhitelistBuilder = com.google.common.collect.ImmutableList.builder ( ) ; for ( java.lang.String publicClassName : com.android.icu4j.srcgen.Icu4jTransform.PUBLIC_API_CLASSES ) { apiClassesWhitelistBuilder.add ( new com.google.currysrc.api.process.ast.TypeLocator ( publicClassName ) ) ; } return com.android.icu4j.srcgen.Icu4jTransformRules.createOptionalRule ( new com.google.currysrc.processors.HidePublicClasses ( apiClassesWhitelistBuilder.build ( ) , "Only a subset of ICU is exposed in Android" ) ) ; }
Source:
public java.lang.String getClientName ( int pid ) { synchronized ( mClients ) { for ( com.android.ddmlib.Client c : mClients ) { if ( ( c.getClientData ( ) . getPid ( ) ) == pid ) { return c.getClientData ( ) . getClientDescription ( ) ; } } } return null ; }

Target:
public java.lang.String getClientName ( int pid ) { return mClientInfo.get ( java.lang.Integer.valueOf ( pid ) ) ; }