auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
boolean moveNext ( ) { if ( ( ( mItemCount ) > 0 ) && ( ( mSelectedPosition ) < ( ( mItemCount ) - 1 ) ) ) { scrollToChild ( ( ( ( mSelectedPosition ) - ( mFirstPosition ) ) + 1 ) ) ; return true ; } else { return false ; } }

Target:
boolean moveDirection ( int direction ) { direction = ( isLayoutRtl ( ) ) ? - direction : direction ; int targetPosition = ( mSelectedPosition ) + direction ; if ( ( ( ( mItemCount ) > 0 ) && ( targetPosition >= 0 ) ) && ( targetPosition < ( mItemCount ) ) ) { scrollToChild ( ( targetPosition - ( mFirstPosition ) ) ) ; return true ; } else { return false ; } }
Source:
public static void testSendMessage7bit ( android.app.Activity activity , int serialNumber , int category ) { android.content.Intent intent = new android.content.Intent ( android.provider.Telephony.Sms.Intents.SMS_CB_RECEIVED_ACTION ) ; intent.putExtra ( "message" , com.android.cellbroadcastreceiver.tests.SendTestMessages.createFromPdu ( activity , com.android.cellbroadcastreceiver.tests.SendTestMessages.gsm7BitTest , serialNumber , category ) ) ; activity.sendOrderedBroadcastAsUser ( intent , UserHandle.ALL , Manifest.permission.RECEIVE_SMS , AppOpsManager.OP_RECEIVE_SMS , null , null , Activity.RESULT_OK , null , null ) ; }

Target:
private static void sendBroadcast ( android.app.Activity activity , int serialNumber , int category , byte [ ] pdu ) { android.content.Intent intent = new android.content.Intent ( android.provider.Telephony.Sms.Intents.SMS_CB_RECEIVED_ACTION ) ; intent.putExtra ( "message" , com.android.cellbroadcastreceiver.tests.SendTestMessages.createFromPdu ( activity , pdu , serialNumber , category ) ) ; intent.setPackage ( com.android.cellbroadcastreceiver.tests.SendTestMessages.CB_RECEIVER_PKG ) ; activity.sendOrderedBroadcastAsUser ( intent , UserHandle.ALL , Manifest.permission.RECEIVE_SMS , AppOpsManager.OP_RECEIVE_SMS , null , null , Activity.RESULT_OK , null , null ) ; }
Source:
public boolean isConflicting ( com.android.tv.dvr.ScheduledRecording schedule ) { return ( ( schedule != null ) && ( com.android.tv.common.SoftPreconditions.checkState ( mDataManager.isDvrScheduleLoadFinished ( ) ) ) ) && ( mScheduleManager.isConflicting ( schedule ) ) ; }

Target:
public void setHighestPriority ( com.android.tv.dvr.data.ScheduledRecording schedule ) { if ( com.android.tv.common.SoftPreconditions.checkState ( mDataManager.isDvrScheduleLoadFinished ( ) ) ) { long newPriority = mScheduleManager.suggestHighestPriority ( schedule ) ; if ( newPriority != ( schedule.getPriority ( ) ) ) { mDataManager.updateScheduledRecording ( com.android.tv.dvr.data.ScheduledRecording.buildFrom ( schedule ) . setPriority ( newPriority ) . build ( ) ) ; } } }
Source:
public boolean equals ( @ javax.annotation.Nullable java.lang.Object object ) { return standardEquals ( object ) ; }

Target:
java.util.Collection < V2 > transform ( K key , java.util.Collection < V1 > values ) { com.google.common.base.Function < ? super V1 , V2 > function = com.google.common.collect.Maps.asValueToValueFunction ( transformer , key ) ; if ( values instanceof java.util.List ) { return com.google.common.collect.Lists.transform ( ( ( java.util.List < V1 > ) ( values ) ) , function ) ; } else { return com.google.common.collect.Collections2.transform ( values , function ) ; } }
Source:
public void testInstall_withBadlyFormedRulesVersion ( ) throws java.lang.Exception { final java.lang.String invalidRulesVersion = "203Bc" ; byte [ ] versionBytes = libcore.tzdata.update2.BundleVersion.getBytes ( BundleVersion.FULL_BUNDLE_FORMAT_VERSION , invalidRulesVersion , "001" ) ; libcore.tzdata.update2.TimeZoneBundle bundle = libcore.tzdata.update2.TimeZoneBundleInstallerTest.createTimeZoneBundleWithVersionBytes ( versionBytes ) ; assertFalse ( installer.install ( bundle.getBytes ( ) ) ) ; assertNoContentInstalled ( ) ; }

Target:
public void testInstall_withBadlyFormedRulesVersion ( ) throws java.lang.Exception { libcore.tzdata.update2.BundleVersion validBundleVersion = new libcore.tzdata.update2.BundleVersion ( 1 , 1 , libcore.tzdata.update2.TimeZoneBundleInstallerTest.NEW_RULES_VERSION , 1 ) ; byte [ ] invalidRulesVersionBytes = validBundleVersion.toBytes ( ) ; invalidRulesVersionBytes [ ( ( invalidRulesVersionBytes.length ) - 6 ) ] = 'B' ; libcore.tzdata.update2.TimeZoneBundle bundle = libcore.tzdata.update2.TimeZoneBundleInstallerTest.createTimeZoneBundleWithVersionBytes ( invalidRulesVersionBytes ) ; assertEquals ( TimeZoneBundleInstaller.INSTALL_FAIL_BAD_BUNDLE_STRUCTURE , installer.installWithErrorCode ( bundle.getBytes ( ) ) ) ; assertNoContentInstalled ( ) ; }
Source:
private void processUsesConfiguration ( org.xml.sax.Attributes attributes ) { mManifestData.mUsesConfiguration = new com.android.sdklib.xml.ManifestData.UsesConfiguration ( ) ; mManifestData.mUsesConfiguration.mReqFiveWayNav = java.lang.Boolean.valueOf ( getAttributeValue ( attributes , AndroidManifest.ATTRIBUTE_REQ_5WAYNAV , true ) ) ; mManifestData.mUsesConfiguration.mReqNavigation = com.android.sdklib.resources.Navigation.getEnum ( getAttributeValue ( attributes , AndroidManifest.ATTRIBUTE_REQ_NAVIGATION , true ) ) ; mManifestData.mUsesConfiguration.mReqHardKeyboard = java.lang.Boolean.valueOf ( getAttributeValue ( attributes , AndroidManifest.ATTRIBUTE_REQ_HARDKEYBOARD , true ) ) ; mManifestData.mUsesConfiguration.mReqKeyboardType = com.android.sdklib.resources.Keyboard.getEnum ( getAttributeValue ( attributes , AndroidManifest.ATTRIBUTE_REQ_KEYBOARDTYPE , true ) ) ; mManifestData.mUsesConfiguration.mReqTouchScreen = com.android.sdklib.resources.TouchScreen.getEnum ( getAttributeValue ( attributes , AndroidManifest.ATTRIBUTE_REQ_TOUCHSCREEN , true ) ) ; }

Target:
private void processUsesConfiguration ( org.xml.sax.Attributes attributes ) { mManifestData.mUsesConfiguration = new com.android.sdklib.xml.ManifestData.UsesConfiguration ( ) ; mManifestData.mUsesConfiguration.mReqFiveWayNav = getAttributeBooleanValue ( attributes , AndroidManifest.ATTRIBUTE_REQ_5WAYNAV , true ) ; mManifestData.mUsesConfiguration.mReqNavigation = com.android.sdklib.resources.Navigation.getEnum ( getAttributeValue ( attributes , AndroidManifest.ATTRIBUTE_REQ_NAVIGATION , true ) ) ; mManifestData.mUsesConfiguration.mReqHardKeyboard = getAttributeBooleanValue ( attributes , AndroidManifest.ATTRIBUTE_REQ_HARDKEYBOARD , true ) ; mManifestData.mUsesConfiguration.mReqKeyboardType = com.android.sdklib.resources.Keyboard.getEnum ( getAttributeValue ( attributes , AndroidManifest.ATTRIBUTE_REQ_KEYBOARDTYPE , true ) ) ; mManifestData.mUsesConfiguration.mReqTouchScreen = com.android.sdklib.resources.TouchScreen.getEnum ( getAttributeValue ( attributes , AndroidManifest.ATTRIBUTE_REQ_TOUCHSCREEN , true ) ) ; }
Source:
public void testSaveProperties ( ) { java.util.Properties props = createProps ( ) ; com.android.sdklib.internal.repository.packages.MinToolsPackageTest.MockMinToolsPackage p = new com.android.sdklib.internal.repository.packages.MinToolsPackageTest.MockMinToolsPackage ( null , props , ( - 1 ) , null , null , null , com.android.sdklib.internal.repository.archives.Archive.Os.ANY , com.android.sdklib.internal.repository.archives.Archive.Arch.ANY , LOCAL_ARCHIVE_PATH ) ; java.util.Properties props2 = new java.util.Properties ( ) ; p.saveProperties ( props2 ) ; assertEquals ( props2 , props ) ; }

Target:
public void testSaveProperties ( ) { java.util.Properties expected = createExpectedProps ( ) ; com.android.sdklib.internal.repository.packages.MinToolsPackageTest.MockMinToolsPackage p = new com.android.sdklib.internal.repository.packages.MinToolsPackageTest.MockMinToolsPackage ( null , expected , ( - 1 ) , null , null , null , com.android.sdklib.internal.repository.archives.Archive.Os.ANY , com.android.sdklib.internal.repository.archives.Archive.Arch.ANY , LOCAL_ARCHIVE_PATH ) ; java.util.Properties actual = new java.util.Properties ( ) ; p.saveProperties ( actual ) ; assertEquals ( expected , actual ) ; }
Source:
public com.android.sched.util.config.id.PropertyId.IValue < T > check ( @ javax.annotation.Nonnull com.android.sched.util.codec.CodecContext context ) { return this ; }

Target:
public com.android.sched.util.config.id.PropertyId.IValue < T > check ( @ javax.annotation.Nonnull com.android.sched.util.codec.CodecContext context ) throws com.android.sched.util.codec.ParsingException { try { ( ( com.android.sched.util.config.id.PropertyId < T > ) ( this ) ) . codec.checkValue ( context , value ) ; } catch ( com.android.sched.util.codec.CheckingException e ) { throw new com.android.sched.util.codec.ParsingException ( e.getMessage ( ) ) ; } return this ; }
Source:
private void registerEvents ( int slotId ) { if ( ( mStkContext [ slotId ] . mSetupEventListSettings ) == null ) { return ; } for ( int event : mStkContext [ slotId ] . mSetupEventListSettings.eventList ) { switch ( event ) { case com.android.internal.telephony.cat.CatCmdMessage.SetupEventListConstants.IDLE_SCREEN_AVAILABLE_EVENT : registerProcessObserver ( ) ; break ; case com.android.internal.telephony.cat.CatCmdMessage.SetupEventListConstants.LANGUAGE_SELECTION_EVENT : default : break ; } } }

Target:
private void registerEvents ( int slotId ) { if ( ( mStkContext [ slotId ] . mSetupEventListSettings ) == null ) { return ; } for ( int event : mStkContext [ slotId ] . mSetupEventListSettings.eventList ) { switch ( event ) { case com.android.internal.telephony.cat.CatCmdMessage.SetupEventListConstants.USER_ACTIVITY_EVENT : registerUserActivityReceiver ( ) ; break ; case com.android.internal.telephony.cat.CatCmdMessage.SetupEventListConstants.IDLE_SCREEN_AVAILABLE_EVENT : registerProcessObserver ( ) ; break ; case com.android.internal.telephony.cat.CatCmdMessage.SetupEventListConstants.LANGUAGE_SELECTION_EVENT : default : break ; } } }
Source:
private void blockNumberWithAnswer ( java.lang.String phoneNumber , org.mockito.stubbing.Answer answer ) throws java.lang.Exception { org.mockito.Mockito.when ( getBlockedNumberProvider ( ) . call ( org.mockito.Matchers.anyString ( ) , org.mockito.Matchers.eq ( BlockedNumberContract.SystemContract.METHOD_SHOULD_SYSTEM_BLOCK_NUMBER ) , org.mockito.Matchers.eq ( phoneNumber ) , org.mockito.Matchers.isNull ( android.os.Bundle.class ) ) ) . thenAnswer ( answer ) ; }

Target:
private void blockNumberWithAnswer ( java.lang.String phoneNumber , org.mockito.stubbing.Answer answer ) throws java.lang.Exception { org.mockito.Mockito.when ( getBlockedNumberProvider ( ) . call ( org.mockito.Matchers.anyString ( ) , org.mockito.Matchers.eq ( BlockedNumberContract.SystemContract.METHOD_SHOULD_SYSTEM_BLOCK_NUMBER ) , org.mockito.Matchers.eq ( phoneNumber ) , org.mockito.ArgumentMatchers.nullable ( android.os.Bundle.class ) ) ) . thenAnswer ( answer ) ; }
Source:
void addToArray ( java.util.List < com.android.util.Pair < java.lang.String , java.lang.Integer > > list , java.lang.String name , int value ) { for ( com.android.util.Pair < java.lang.String , java.lang.Integer > pair : list ) { if ( name.equals ( pair.getFirst ( ) ) ) { return ; } } list.add ( com.android.util.Pair.of ( name , java.lang.Integer.valueOf ( value ) ) ) ; }

Target:
void addToArray ( java.util.List < com.android.util.Pair < java.lang.String , java.lang.Integer > > list , java.lang.String name , int value ) { for ( com.android.util.Pair < java.lang.String , java.lang.Integer > pair : list ) { if ( ( name.equals ( pair.getFirst ( ) ) ) && ( ( pair.getSecond ( ) ) < value ) ) { return ; } } list.add ( com.android.util.Pair.of ( name , java.lang.Integer.valueOf ( value ) ) ) ; }
Source:
public void run ( ) { com.android.hierarchyviewerlib.ui.util.PsdFile psdFile = com.android.hierarchyviewerlib.device.DeviceBridge.captureLayers ( window ) ; if ( psdFile != null ) { java.lang.String extensionedFileName = fileName ; if ( ! ( extensionedFileName.toLowerCase ( ) . endsWith ( ".psd" ) ) ) { extensionedFileName += ".psd" ; } try { psdFile.write ( new java.io.FileOutputStream ( extensionedFileName ) ) ; } catch ( java.io.FileNotFoundException e ) { com.android.ddmlib.Log.e ( com.android.hierarchyviewerlib.HierarchyViewerDirector.TAG , ( "Unable to write to file " + fileName ) ) ; } } }

Target:
public void run ( ) { com.android.hierarchyviewerlib.device.IHvDevice hvDevice = getHvDevice ( window.getDevice ( ) ) ; com.android.hierarchyviewerlib.ui.util.PsdFile psdFile = hvDevice.captureLayers ( window ) ; if ( psdFile != null ) { java.lang.String extensionedFileName = fileName ; if ( ! ( extensionedFileName.toLowerCase ( ) . endsWith ( ".psd" ) ) ) { extensionedFileName += ".psd" ; } try { psdFile.write ( new java.io.FileOutputStream ( extensionedFileName ) ) ; } catch ( java.io.FileNotFoundException e ) { com.android.ddmlib.Log.e ( com.android.hierarchyviewerlib.HierarchyViewerDirector.TAG , ( "Unable to write to file " + fileName ) ) ; } } }
Source:
protected void raiseWarning ( short alertDescription , java.lang.String message ) throws java.io.IOException { raiseAlert ( AlertLevel.warning , alertDescription , message , null ) ; }

Target:
protected void sendFinishedMessage ( ) throws java.io.IOException { byte [ ] verify_data = createVerifyData ( getContext ( ) . isServer ( ) ) ; org.bouncycastle.crypto.tls.TlsProtocol.HandshakeMessage message = new org.bouncycastle.crypto.tls.TlsProtocol.HandshakeMessage ( HandshakeType.finished , verify_data.length ) ; message.write ( verify_data ) ; message.writeToRecordStream ( ) ; }
Source:
private void checkItem ( com.android.builder.resources.Resource item ) throws com.android.builder.resources.DuplicateResourceException { com.android.builder.resources.Resource otherItem = mItems.get ( item.getKey ( ) ) ; if ( otherItem != null ) { throw new com.android.builder.resources.DuplicateResourceException ( item , otherItem ) ; } }

Target:
void checkItems ( ) throws com.android.builder.resources.DuplicateResourceException { for ( java.util.Map.Entry < java.lang.String , java.util.Collection < com.android.builder.resources.Resource > > entry : mItems.asMap ( ) . entrySet ( ) ) { java.util.Collection < com.android.builder.resources.Resource > items = entry.getValue ( ) ; com.android.builder.resources.Resource lastItem = null ; for ( com.android.builder.resources.Resource item : items ) { if ( ! ( item.isRemoved ( ) ) ) { if ( lastItem == null ) { lastItem = item ; } else { throw new com.android.builder.resources.DuplicateResourceException ( item , lastItem ) ; } } } } }
Source:
private static java.nio.MappedByteBuffer map ( java.io.RandomAccessFile raf , java.nio.channels.FileChannel.MapMode mode , long size ) throws java.io.IOException { java.nio.channels.FileChannel channel = raf.getChannel ( ) ; boolean threw = true ; try { java.nio.MappedByteBuffer mbb = channel.map ( mode , 0 , size ) ; threw = false ; return mbb ; } finally { com.google.common.io.Closeables.close ( channel , threw ) ; } }

Target:
public boolean apply ( java.io.File file ) { return file.isFile ( ) ; }
Source:
public void invokeOemRilRequestStrings ( java.lang.String [ ] strings , android.os.Message response ) { com.android.internal.telephony.RILRequest rr = com.android.internal.telephony.RILRequest.obtain ( com.android.internal.telephony.RIL_REQUEST_OEM_HOOK_STRINGS , response ) ; if ( com.android.internal.telephony.RIL.RILJ_LOGD ) riljLog ( ( ( ( rr.serialString ( ) ) + "> " ) + ( com.android.internal.telephony.RIL.requestToString ( rr.mRequest ) ) ) ) ; rr.mParcel.writeStringArray ( strings ) ; send ( rr ) ; }

Target:
public void invokeOemRilRequestStrings ( java.lang.String [ ] strings , android.os.Message response ) { com.android.internal.telephony.RILRequest rr = com.android.internal.telephony.RILRequest.obtain ( com.android.internal.telephony.RIL_REQUEST_OEM_HOOK_STRINGS , response , mRILDefaultWorkSource ) ; if ( com.android.internal.telephony.RIL.RILJ_LOGD ) riljLog ( ( ( ( rr.serialString ( ) ) + "> " ) + ( com.android.internal.telephony.RIL.requestToString ( rr.mRequest ) ) ) ) ; rr.mParcel.writeStringArray ( strings ) ; send ( rr ) ; }
Source:
void writeTo ( org.json.JSONStringer stringer ) throws org.json.JSONException { stringer.object ( ) ; for ( java.util.Map.Entry < java.lang.String , java.lang.Object > entry : nameValuePairs.entrySet ( ) ) { stringer.key ( entry.getKey ( ) ) . value ( entry.getValue ( ) ) ; } stringer.endObject ( ) ; }

Target:
public org.json.JSONArray names ( ) { return nameValuePairs.isEmpty ( ) ? null : new org.json.JSONArray ( new java.util.ArrayList < java.lang.String > ( nameValuePairs.keySet ( ) ) ) ; }
Source:
public boolean needsPreprocessing ( java.io.File resourceFile ) { return ( ( ( resourceFile.getPath ( ) . endsWith ( ".xml" ) ) && ( isInDrawable ( resourceFile ) ) ) && ( ( getEffectiveVersion ( resourceFile ) ) < ( com.android.builder.png.VectorDrawableRenderer.MIN_SDK_WITH_VECTOR_SUPPORT ) ) ) && ( isRootVector ( resourceFile ) ) ; }

Target:
private boolean isXml ( java.io.File resourceFile ) { return resourceFile.getPath ( ) . endsWith ( ".xml" ) ; }
Source:
static < E > java.util.Iterator < E > singletonIterator ( final E e ) { return new java.util.Iterator < E > ( ) { private boolean hasNext = true ; public boolean hasNext ( ) { return hasNext ; } public E next ( ) { if ( hasNext ) { hasNext = false ; return e ; } throw new java.util.NoSuchElementException ( ) ; } public void remove ( ) { throw new java.lang.UnsupportedOperationException ( ) ; } } ; }

Target:
public void forEachRemaining ( java.util.function.Consumer < ? super E > action ) { java.util.Objects.requireNonNull ( action ) ; if ( hasNext ) { action.accept ( e ) ; hasNext = false ; } }
Source:
protected android.support.v8.renderscript.Script.KernelID createKernelID ( int slot , int sig , android.support.v8.renderscript.Element ein , android.support.v8.renderscript.Element eout ) { android.support.v8.renderscript.Script.KernelID k = mKIDs.get ( slot ) ; if ( k != null ) { return k ; } long id = mRS.nScriptKernelIDCreate ( getID ( mRS ) , slot , sig ) ; if ( id == 0 ) { throw new android.support.v8.renderscript.RSDriverException ( "Failed to create KernelID" ) ; } k = new android.support.v8.renderscript.Script.KernelID ( id , mRS , this , slot , sig ) ; mKIDs.put ( slot , k ) ; return k ; }

Target:
public void setVar ( int index , double v ) { mRS.nScriptSetVarD ( getID ( mRS ) , index , v , mUseIncSupp ) ; }
Source:
public void systemReady ( ) { mKeyguardMediator.onSystemReady ( ) ; android.os.SystemProperties.set ( "dev.bootcomplete" , "1" ) ; synchronized ( mLock ) { updateOrientationListenerLp ( ) ; } }

Target:
public void systemReady ( ) { mKeyguardMediator.onSystemReady ( ) ; android.os.SystemProperties.set ( "dev.bootcomplete" , "1" ) ; synchronized ( mLock ) { updateOrientationListenerLp ( ) ; mSystemReady = true ; mHandler.post ( new java.lang.Runnable ( ) { public void run ( ) { updateSettings ( ) ; } } ) ; } }
Source:
public void onReceive ( android.content.Context context , android.content.Intent intent ) { if ( Intent.ACTION_SCREEN_ON.equals ( intent.getAction ( ) ) ) { mStartButton.setEnabled ( true ) ; } else if ( com.android.cts.verifier.jobscheduler.IdleConstraintTestActivity.ACTION_EXPEDITE_IDLE_MODE.equals ( intent.getAction ( ) ) ) { mStartButton.setEnabled ( false ) ; } else { android.util.Log.e ( com.android.cts.verifier.jobscheduler.IdleConstraintTestActivity.TAG , "Invalid broadcast received, was expecting SCREEN_ON" ) ; } }

Target:
protected void startTestImpl ( ) { mStartButton.setEnabled ( false ) ; new com.android.cts.verifier.jobscheduler.IdleConstraintTestActivity.TestIdleModeTaskNotIdle ( ) . execute ( ) ; }
Source:
public void run ( ) { com.android.rs.test.RenderScript pRS = com.android.rs.test.RenderScript.create ( mCtx ) ; com.android.rs.test.ScriptC_math_conformance s = new com.android.rs.test.ScriptC_math_conformance ( pRS ) ; pRS.setMessageHandler ( mRsMessage ) ; s.invoke_math_conformance_test ( ) ; pRS.finish ( ) ; waitForMessage ( ) ; pRS.destroy ( ) ; passTest ( ) ; }

Target:
public void run ( ) { android.renderscript.RenderScript pRS = android.renderscript.RenderScript.create ( mCtx ) ; com.android.rs.test.ScriptC_math_conformance s = new com.android.rs.test.ScriptC_math_conformance ( pRS ) ; pRS.setMessageHandler ( mRsMessage ) ; s.invoke_math_conformance_test ( ) ; pRS.finish ( ) ; waitForMessage ( ) ; pRS.destroy ( ) ; passTest ( ) ; }
Source:
public void copy ( @ javax.annotation.Nonnull com.android.sched.vfs.VFile srcFile , @ javax.annotation.Nonnull com.android.sched.vfs.DeflateFS.DeflateVFile dstFile ) throws com.android.sched.util.file.CannotCloseException , com.android.sched.util.file.CannotReadException , com.android.sched.util.file.CannotWriteException , com.android.sched.util.file.WrongPermissionException { if ( srcFile instanceof com.android.sched.vfs.DeflateFS.DeflateVFile ) { vfs.copy ( ( ( com.android.sched.vfs.DeflateFS.DeflateVFile ) ( srcFile ) ) . getWrappedFile ( ) , dstFile.getWrappedFile ( ) ) ; } else { super . copy ( srcFile , dstFile ) ; } }

Target:
public void copy ( @ javax.annotation.Nonnull com.android.sched.vfs.VFile srcFile , @ javax.annotation.Nonnull com.android.sched.vfs.DeflateFS.DeflateVFile dstFile ) throws com.android.sched.util.file.CannotCloseException , com.android.sched.util.file.CannotReadException , com.android.sched.util.file.CannotWriteException , com.android.sched.util.file.WrongPermissionException { if ( srcFile instanceof com.android.sched.vfs.DeflateFS.DeflateVFile ) { vfs.copy ( ( ( com.android.sched.vfs.DeflateFS.DeflateVFile ) ( srcFile ) ) . getWrappedFile ( ) , dstFile.getWrappedFile ( ) ) ; com.android.sched.util.log.Tracer tracer = getTracer ( ) ; if ( tracer != null ) { tracer.getStatistic ( com.android.sched.vfs.DeflateFS.OPTIMIZED_COPIES ) . addTrue ( ) ; } } else { super . copy ( srcFile , dstFile ) ; } }
Source:
private void printBlockIds ( @ javax.annotation.Nonnull java.lang.Iterable < com.android.jack.ir.ast.cfg.JBasicBlock > blocks ) { print ( "{" ) ; java.lang.String sep = " " ; for ( com.android.jack.ir.ast.cfg.JBasicBlock block : blocks ) { print ( sep ) ; if ( ( ( cfgBlocks ) != null ) && ( cfgBlocks.containsKey ( block ) ) ) { print ( cfgBlocks.get ( block ) ) ; } else { print ( "???" ) ; } sep = ", " ; } print ( " }" ) ; }

Target:
private void printBlockIds ( @ javax.annotation.Nonnull java.lang.Iterable < com.android.jack.ir.ast.cfg.JBasicBlock > blocks , @ javax.annotation.CheckForNull com.android.jack.ir.ast.cfg.JBasicBlock primary ) { print ( "{" ) ; java.lang.String sep = " " ; for ( com.android.jack.ir.ast.cfg.JBasicBlock block : blocks ) { print ( sep ) ; if ( ( ( cfgBlocks ) != null ) && ( cfgBlocks.containsKey ( block ) ) ) { print ( cfgBlocks.get ( block ) ) ; } else { print ( "???" ) ; } if ( block == primary ) { print ( "**" ) ; } sep = ", " ; } print ( " }" ) ; }
Source:
public void keepScreenOnStoppedLw ( ) { if ( ( ( mKeyguardDelegate ) != null ) && ( ! ( mKeyguardDelegate.isShowingAndNotHidden ( ) ) ) ) { long curTime = android.os.SystemClock.uptimeMillis ( ) ; mPowerManager.userActivity ( android.os.SystemClock.uptimeMillis ( ) , false ) ; } }

Target:
public void onWakeUp ( ) { synchronized ( mLock ) { if ( shouldEnableWakeGestureLp ( ) ) { performHapticFeedbackLw ( null , HapticFeedbackConstants.VIRTUAL_KEY , false ) ; mPowerManager.wakeUp ( android.os.SystemClock.uptimeMillis ( ) ) ; } } }
Source:
protected boolean processLayersFromBackToFocus ( com.android.rs.test.BlurStack blurStack ) { for ( int targetLayer = ( blurStack.getNumLayers ( ) ) - 1 ; targetLayer >= ( blurStack.getFocusLayer ( ) ) ; -- targetLayer ) { com.android.rs.test.LayerInfo layerInfo = blurStack.getLayerInfo ( targetLayer ) ; setTargetLayer ( layerInfo ) ; int dilationRadius = com.android.rs.test.RefocusFilter.getKernelRadius ( layerInfo.backDepth , blurStack ) ; setBlendInfo ( dilationRadius ) ; setKernelData ( targetLayer , blurStack ) ; computeLayerMatteBehindFocalDepth ( ) ; filterLayerBehindFocalDepth ( ) ; updateSharpImageUsingFuzzyImage ( ) ; } return true ; }

Target:
protected boolean processLayersFromBackToFocus ( com.android.rs.refocus.BlurStack blurStack ) { for ( int targetLayer = ( blurStack.getNumLayers ( ) ) - 1 ; targetLayer >= ( blurStack.getFocusLayer ( ) ) ; -- targetLayer ) { com.android.rs.refocus.LayerInfo layerInfo = blurStack.getLayerInfo ( targetLayer ) ; setTargetLayer ( layerInfo ) ; int dilationRadius = com.android.rs.refocus.RefocusFilter.getKernelRadius ( layerInfo.backDepth , blurStack ) ; setBlendInfo ( dilationRadius ) ; setKernelData ( targetLayer , blurStack ) ; computeLayerMatteBehindFocalDepth ( ) ; filterLayerBehindFocalDepth ( ) ; updateSharpImageUsingFuzzyImage ( ) ; } return true ; }
Source:
public void testGetUsesLibraries ( ) { assertEquals ( 1 , mManifestTestApp.getUsesLibraries ( ) . length ) ; assertEquals ( com.android.sdklib.xml.AndroidManifestParserTest.LIBRARY_NAME , mManifestTestApp.getUsesLibraries ( ) [ 0 ] ) ; }

Target:
public void testGetUsesLibraries ( ) { com.android.sdklib.xml.ManifestData.UsesLibrary [ ] libraries = mManifestTestApp.getUsesLibraries ( ) ; assertEquals ( 2 , libraries.length ) ; assertEquals ( com.android.sdklib.xml.AndroidManifestParserTest.LIBRARY_NAME , libraries [ 0 ] . getName ( ) ) ; assertEquals ( java.lang.Boolean.FALSE , libraries [ 0 ] . getRequired ( ) ) ; assertEquals ( com.android.sdklib.xml.AndroidManifestParserTest.LIBRARY_NAME2 , libraries [ 1 ] . getName ( ) ) ; assertEquals ( java.lang.Boolean.TRUE , libraries [ 1 ] . getRequired ( ) ) ; }
Source:
private android.util.Pair < java.lang.ref.WeakReference < com.android.services.telephony.TelephonyConnection > , java.util.List < com.android.internal.telephony.Phone > > makeCachedConnectionPhonePair ( com.android.services.telephony.TelephonyConnection c ) { java.util.List < com.android.internal.telephony.Phone > phones = new java.util.ArrayList ( java.util.Arrays.asList ( mPhoneFactoryProxy.getPhones ( ) ) ) ; return new android.util.Pair ( new java.lang.ref.WeakReference ( c ) , phones ) ; }

Target:
private android.util.Pair < java.lang.ref.WeakReference < com.android.services.telephony.TelephonyConnection > , java.util.Queue < com.android.internal.telephony.Phone > > makeCachedConnectionPhonePair ( com.android.services.telephony.TelephonyConnection c ) { java.util.Queue < com.android.internal.telephony.Phone > phones = new java.util.LinkedList ( java.util.Arrays.asList ( mPhoneFactoryProxy.getPhones ( ) ) ) ; return new android.util.Pair ( new java.lang.ref.WeakReference ( c ) , phones ) ; }
Source:
public java.lang.String trimLeadingFrom ( java.lang.CharSequence sequence ) { int len = sequence.length ( ) ; int first ; for ( first = 0 ; first < len ; first ++ ) { if ( ! ( matches ( sequence.charAt ( first ) ) ) ) { break ; } } return sequence.subSequence ( first , len ) . toString ( ) ; }

Target:
public java.lang.String trimLeadingFrom ( java.lang.CharSequence sequence ) { int len = sequence.length ( ) ; for ( int first = 0 ; first < len ; first ++ ) { if ( ! ( matches ( sequence.charAt ( first ) ) ) ) { return sequence.subSequence ( first , len ) . toString ( ) ; } } return "" ; }
Source:
public void requestUninstall_nullTokenBytes ( ) throws java.lang.Exception { configureCallerHasPermission ( ) ; com.android.server.timezone.RulesManagerServiceTest.TestCallback callback = new com.android.server.timezone.RulesManagerServiceTest.TestCallback ( ) ; org.junit.Assert.assertEquals ( RulesManager.SUCCESS , mRulesManagerService.requestUninstall ( null , callback ) ) ; verifyNoInstallerCallsMade ( ) ; callback.assertNoResultReceived ( ) ; configureStageUninstallExpectation ( true ) ; mFakeExecutor.simulateAsyncExecutionOfLastCommand ( ) ; verifyStageUninstallCalled ( ) ; verifyPackageTrackerCalled ( null , true ) ; callback.assertResultReceived ( Callback.SUCCESS ) ; }

Target:
public void requestUninstall_nullTokenBytes ( ) throws java.lang.Exception { configureCallerHasPermission ( ) ; com.android.server.timezone.RulesManagerServiceTest.TestCallback callback = new com.android.server.timezone.RulesManagerServiceTest.TestCallback ( ) ; org.junit.Assert.assertEquals ( RulesManager.SUCCESS , mRulesManagerService.requestUninstall ( null , callback ) ) ; verifyNoInstallerCallsMade ( ) ; callback.assertNoResultReceived ( ) ; configureStageUninstallExpectation ( TimeZoneDistroInstaller.UNINSTALL_SUCCESS ) ; mFakeExecutor.simulateAsyncExecutionOfLastCommand ( ) ; verifyStageUninstallCalled ( ) ; verifyPackageTrackerCalled ( null , true ) ; callback.assertResultReceived ( Callback.SUCCESS ) ; }
Source:
private synchronized void expectVoiceRecognition ( android.bluetooth.BluetoothDevice device ) { mWaitingForVoiceRecognition = true ; android.os.Message m = obtainMessage ( com.android.bluetooth.hfp.HeadsetStateMachine.START_VR_TIMEOUT ) ; m.obj = getMatchingDevice ( device ) ; sendMessageDelayed ( m , com.android.bluetooth.hfp.HeadsetStateMachine.START_VR_TIMEOUT_MILLIS ) ; if ( ! ( mSystemInterface.getVoiceRecognitionWakeLock ( ) . isHeld ( ) ) ) { mSystemInterface.getVoiceRecognitionWakeLock ( ) . acquire ( com.android.bluetooth.hfp.HeadsetStateMachine.START_VR_TIMEOUT_MILLIS ) ; } }

Target:
private synchronized void expectVoiceRecognition ( android.bluetooth.BluetoothDevice device ) { mWaitingForVoiceRecognition = true ; android.os.Message m = obtainMessage ( com.android.bluetooth.hfp.HeadsetStateMachine.START_VR_TIMEOUT ) ; m.obj = getMatchingDevice ( device ) ; sendMessageDelayed ( m , com.android.bluetooth.hfp.HeadsetStateMachine.START_VR_TIMEOUT_VALUE ) ; if ( ! ( mSystemInterface.getVoiceRecognitionWakeLock ( ) . isHeld ( ) ) ) { mSystemInterface.getVoiceRecognitionWakeLock ( ) . acquire ( com.android.bluetooth.hfp.HeadsetStateMachine.START_VR_TIMEOUT_VALUE ) ; } }
Source:
protected boolean start ( ) { if ( com.android.bluetooth.hid.HidDeviceService.DBG ) { android.util.Log.d ( com.android.bluetooth.hid.HidDeviceService.TAG , "start()" ) ; } mHandler = new com.android.bluetooth.hid.HidDeviceService.HidDeviceServiceHandler ( ) ; com.android.bluetooth.hid.HidDeviceService.setHidDeviceService ( this ) ; mHidDeviceNativeInterface = com.android.bluetooth.hid.HidDeviceNativeInterface.getInstance ( ) ; mHidDeviceNativeInterface.init ( ) ; mNativeAvailable = true ; return true ; }

Target:
protected boolean start ( ) { if ( com.android.bluetooth.hid.HidDeviceService.DBG ) { android.util.Log.d ( com.android.bluetooth.hid.HidDeviceService.TAG , "start()" ) ; } mHandler = new com.android.bluetooth.hid.HidDeviceService.HidDeviceServiceHandler ( ) ; mHidDeviceNativeInterface = com.android.bluetooth.hid.HidDeviceNativeInterface.getInstance ( ) ; mHidDeviceNativeInterface.init ( ) ; mNativeAvailable = true ; mActivityManager = ( ( android.app.ActivityManager ) ( getSystemService ( Context.ACTIVITY_SERVICE ) ) ) ; mActivityManager.addOnUidImportanceListener ( mUidImportanceListener , com.android.bluetooth.hid.HidDeviceService.FOREGROUND_IMPORTANCE_CUTOFF ) ; com.android.bluetooth.hid.HidDeviceService.setHidDeviceService ( this ) ; return true ; }
Source:
void stopDtmfTone ( ) { if ( ( mConnectionService ) == null ) { android.telecom.Log.w ( this , "stopDtmfTone() request on a call without a connection service." ) ; } else { android.telecom.Log.i ( this , "Send stopDtmfTone to connection service for call %s" , this ) ; android.telecom.Log.addEvent ( this , LogUtils.Events.STOP_DTMF ) ; mConnectionService.stopDtmfTone ( this ) ; } }

Target:
public void stopDtmfTone ( ) { if ( ( mConnectionService ) == null ) { android.telecom.Log.w ( this , "stopDtmfTone() request on a call without a connection service." ) ; } else { android.telecom.Log.i ( this , "Send stopDtmfTone to connection service for call %s" , this ) ; android.telecom.Log.addEvent ( this , LogUtils.Events.STOP_DTMF ) ; mConnectionService.stopDtmfTone ( this ) ; } mPlayingDtmfTone = com.android.server.telecom.Call.NO_DTMF_TONE ; }
Source:
public void testApi10 ( ) throws java.lang.Exception { assertEquals ( ( "ApiCallTest.java:20: Error: Call requires API level 11 (current min is 10): android.app.Activity#getActionBar\n" + ( ( ( ( ( ( "ApiCallTest.java:30: Error: Call requires API level 11 (current min is 10): android.widget.Chronometer#setTextIsSelectable\n" + "ApiCallTest.java:33: Error: Field requires API level 11 (current min is 10): dalvik.bytecode.OpcodeInfo#MAXIMUM_VALUE\n" ) + "ApiCallTest.java:38: Error: Class requires API level 14 (current min is 10): android.app.ApplicationErrorReport.BatteryInfo\n" ) + "ApiCallTest.java:38: Error: Field requires API level 14 (current min is 10): android.app.ApplicationErrorReport#batteryInfo\n" ) + "ApiCallTest.java:41: Error: Field requires API level 11 (current min is 10): android.graphics.PorterDuff$Mode#OVERLAY\n" ) + "ApiCallTest.java:46: Error: Class requires API level 14 (current min is 10): android.widget.GridLayout\n" ) + "ApiCallTest.java:50: Error: Class requires API level 14 (current min is 10): android.app.ApplicationErrorReport" ) ) , lintProject ( "apicheck/classpath=>.classpath" , "apicheck/minsdk10.xml=>AndroidManifest.xml" , "apicheck/ApiCallTest.java.txt=>src/foo/bar/ApiCallTest.java" , "apicheck/ApiCallTest.class.data=>bin/classes/foo/bar/ApiCallTest.class" ) ) ; }

Target:
public void testApi10 ( ) throws java.lang.Exception { assertEquals ( ( "ApiCallTest.java:20: Error: Call requires API level 11 (current min is 10): android.app.Activity#getActionBar\n" + ( ( ( ( ( ( "ApiCallTest.java:30: Error: Call requires API level 11 (current min is 10): android.widget.Chronometer#setTextIsSelectable\n" + "ApiCallTest.java:33: Error: Field requires API level 11 (current min is 10): dalvik.bytecode.OpcodeInfo#MAXIMUM_VALUE\n" ) + "ApiCallTest.java:38: Error: Class requires API level 14 (current min is 10): android.app.ApplicationErrorReport.BatteryInfo\n" ) + "ApiCallTest.java:38: Error: Field requires API level 14 (current min is 10): android.app.ApplicationErrorReport#batteryInfo\n" ) + "ApiCallTest.java:41: Error: Field requires API level 11 (current min is 10): android.graphics.PorterDuff$Mode#OVERLAY\n" ) + "ApiCallTest.java:45: Error: Class requires API level 14 (current min is 10): android.widget.GridLayout\n" ) + "ApiCallTest.java:49: Error: Class requires API level 14 (current min is 10): android.app.ApplicationErrorReport" ) ) , lintProject ( "apicheck/classpath=>.classpath" , "apicheck/minsdk10.xml=>AndroidManifest.xml" , "apicheck/ApiCallTest.java.txt=>src/foo/bar/ApiCallTest.java" , "apicheck/ApiCallTest.class.data=>bin/classes/foo/bar/ApiCallTest.class" ) ) ; }
Source:
public void startFilterLookup ( com.android.server.telecom.Call call , com.android.server.telecom.callfiltering.CallFilterResultCallback callback ) { mCallback = callback ; mIncomingCall = call ; java.lang.String number = ( ( call.getHandle ( ) ) == null ) ? null : call.getHandle ( ) . getSchemeSpecificPart ( ) ; this . execute ( number ) ; }

Target:
public void onContactPhotoQueryComplete ( android.net.Uri handle , com.android.internal.telephony.CallerInfo info ) { }
Source:
public void testLock ( ) throws java.lang.Exception { assertFalse ( mKeyStore.lock ( ) ) ; mKeyStore.password ( android.security.KeyStoreTest.TEST_PASSWD ) ; assertEquals ( KeyStore.State.UNLOCKED , mKeyStore.state ( ) ) ; assertTrue ( mKeyStore.lock ( ) ) ; assertEquals ( KeyStore.State.LOCKED , mKeyStore.state ( ) ) ; }

Target:
public void testLock ( ) throws java.lang.Exception { assertFalse ( mKeyStore.lock ( ) ) ; mKeyStore.onUserPasswordChanged ( android.security.KeyStoreTest.TEST_PASSWD ) ; assertEquals ( KeyStore.State.UNLOCKED , mKeyStore.state ( ) ) ; assertTrue ( mKeyStore.lock ( ) ) ; assertEquals ( KeyStore.State.LOCKED , mKeyStore.state ( ) ) ; }
Source:
public static void main ( java.lang.String [ ] args ) { ReturnsAndArgPassing.main ( null ) ; BasicTest.main ( null ) ; Clash.main ( null ) ; Clash2.main ( null ) ; Clash3.main ( null ) ; Clash4.main ( null ) ; WrappedThrow.main ( null ) ; NarrowingTest.main ( null ) ; }

Target:
public static void main ( java.lang.String [ ] args ) { ReturnsAndArgPassing.main ( null ) ; BasicTest.main ( null ) ; Clash.main ( null ) ; Clash2.main ( null ) ; Clash3.main ( null ) ; Clash4.main ( null ) ; WrappedThrow.main ( null ) ; NarrowingTest.main ( null ) ; FloatSelect.main ( null ) ; }
Source:
private com.android.rs.test.Byte2 pack_b2 ( byte [ ] val ) { assert ( val.length ) == 2 ; android.util.Log.i ( "bug_char" , ( ( ( "pack_b2 " + ( val [ 0 ] ) ) + " " ) + ( val [ 1 ] ) ) ) ; return new com.android.rs.test.Byte2 ( val [ 0 ] , val [ 1 ] ) ; }

Target:
private android.renderscript.Byte2 pack_b2 ( byte [ ] val ) { assert ( val.length ) == 2 ; android.util.Log.i ( "bug_char" , ( ( ( "pack_b2 " + ( val [ 0 ] ) ) + " " ) + ( val [ 1 ] ) ) ) ; return new android.renderscript.Byte2 ( val [ 0 ] , val [ 1 ] ) ; }
Source:
public void requestNetwork ( android.net.NetworkRequest request , android.net.ConnectivityManager.NetworkCallback networkCallback , int timeoutMs ) { int legacyType = inferLegacyTypeForNetworkCapabilities ( request.networkCapabilities ) ; requestNetwork ( request , networkCallback , timeoutMs , legacyType , getDefaultHandler ( ) ) ; }

Target:
public void requestNetwork ( android.net.NetworkRequest request , int timeoutMs , android.net.ConnectivityManager.NetworkCallback networkCallback ) { if ( timeoutMs <= 0 ) { throw new java.lang.IllegalArgumentException ( ( "Non-positive timeoutMs: " + timeoutMs ) ) ; } int legacyType = inferLegacyTypeForNetworkCapabilities ( request.networkCapabilities ) ; requestNetwork ( request , networkCallback , timeoutMs , legacyType , getDefaultHandler ( ) ) ; }
Source:
public void onDynamicSensorConnected ( android.hardware.Sensor sensor ) { mSensor = sensor ; android.util.Log.d ( com.android.cts.verifier.sensors.DynamicSensorDiscoveryTestActivity.TAG , ( "Sensor Connected: " + ( mSensor ) ) ) ; if ( ( mConnectLatch ) != null ) { mConnectLatch.countDown ( ) ; } }

Target:
public void onDynamicSensorConnected ( android.hardware.Sensor sensor ) { android.util.Log.d ( com.android.cts.verifier.sensors.DynamicSensorDiscoveryTestActivity.TAG , ( "Sensor Connected: " + sensor ) ) ; if ( ( ( mExpectSensorId ) == null ) || ( ( mExpectSensorId ) == ( sensor.getId ( ) ) ) ) { mSensor = sensor ; if ( ( mConnectLatch ) != null ) { mConnectLatch.countDown ( ) ; } } }
Source:
private void updateAvd ( ) { try { java.lang.String avdName = mSdkCommandLine.getParamName ( ) ; com.android.sdklib.internal.avd.AvdManager avdManager = new com.android.sdklib.internal.avd.AvdManager ( mSdkManager , mSdkLog ) ; avdManager.updateAvd ( avdName , mSdkLog ) ; } catch ( com.android.prefs.AndroidLocation.AndroidLocationException e ) { errorAndExit ( e.getMessage ( ) ) ; } catch ( java.io.IOException e ) { errorAndExit ( e.getMessage ( ) ) ; } }

Target:
private void updateAvd ( ) { try { java.lang.String avdName = mSdkCommandLine.getParamName ( ) ; com.android.sdklib.internal.avd.AvdManager avdManager = com.android.sdklib.internal.avd.AvdManager.getInstance ( mSdkManager , mSdkLog ) ; avdManager.updateAvd ( avdName , mSdkLog ) ; } catch ( com.android.prefs.AndroidLocation.AndroidLocationException e ) { errorAndExit ( e.getMessage ( ) ) ; } catch ( java.io.IOException e ) { errorAndExit ( e.getMessage ( ) ) ; } }
Source:
public void testSslFallback_allSupportedProtocols ( ) throws java.lang.Exception { java.lang.String [ ] allSupportedProtocols = new java.lang.String [ ] { "TLSv1.2" , "TLSv1.1" , "TLSv1" } ; libcore.javax.net.ssl.TestSSLContext testSSLContext = createDefaultTestSSLContext ( ) ; javax.net.ssl.SSLSocketFactory serverSocketFactory = new libcore.java.net.URLConnectionTest.LimitedProtocolsSocketFactory ( testSSLContext.serverContext.getSocketFactory ( ) , allSupportedProtocols ) ; javax.net.ssl.SSLSocketFactory clientSocketFactoryDelegate = new libcore.java.net.URLConnectionTest.LimitedProtocolsSocketFactory ( testSSLContext.clientContext.getSocketFactory ( ) , allSupportedProtocols ) ; checkSslFallback ( serverSocketFactory , clientSocketFactoryDelegate ) ; }

Target:
public void testNoSslFallback_defaultProtocols ( ) throws java.lang.Exception { java.lang.String [ ] expectedEnabledProtocols = new java.lang.String [ ] { "TLSv1.2" , "TLSv1.1" , "TLSv1" } ; libcore.javax.net.ssl.TestSSLContext testSSLContext = createDefaultTestSSLContext ( ) ; javax.net.ssl.SSLSocketFactory serverSocketFactory = testSSLContext.serverContext.getSocketFactory ( ) ; javax.net.ssl.SSLSocketFactory clientSocketFactory = testSSLContext.clientContext.getSocketFactory ( ) ; checkNoFallbackOnFailedHandshake ( clientSocketFactory , serverSocketFactory , expectedEnabledProtocols ) ; }
Source:
private int getUpdateOutputSize ( int inputLen ) { if ( encrypting ) { return ( inputLen + ( modeBlockSize ) ) - 1 ; } else if ( ( modeBlockSize ) == 1 ) { return inputLen ; } else { return inputLen + ( modeBlockSize ) ; } }

Target:
private int getOutputSize ( int inputLen ) { if ( ( modeBlockSize ) == 1 ) { return inputLen ; } else { final int buffered = org.apache.harmony.xnet.provider.jsse.NativeCrypto.get_EVP_CIPHER_CTX_buf_len ( cipherCtx.getContext ( ) ) ; if ( ( ! ( encrypting ) ) || ( ( padding ) == ( org.apache.harmony.xnet.provider.jsse.OpenSSLCipher.Padding.NOPADDING ) ) ) { return buffered + inputLen ; } else { final int totalLen = ( inputLen + buffered ) + ( modeBlockSize ) ; return totalLen - ( totalLen % ( modeBlockSize ) ) ; } } }
Source:
public static int fromJCAMode ( java.lang.String mode ) { java.lang.String modeLower = mode.toLowerCase ( java.util.Locale.US ) ; if ( "ecb" . equals ( modeLower ) ) { return android.security.KeyStoreKeyConstraints.BlockMode.ECB ; } else if ( "cbc" . equals ( modeLower ) ) { return android.security.KeyStoreKeyConstraints.BlockMode.CBC ; } else if ( "ctr" . equals ( modeLower ) ) { return android.security.KeyStoreKeyConstraints.BlockMode.CTR ; } else { throw new java.lang.IllegalArgumentException ( ( "Unknown block mode: " + mode ) ) ; } }

Target:
public static int fromJCAMode ( java.lang.String mode ) { java.lang.String modeLower = mode.toLowerCase ( java.util.Locale.US ) ; if ( "ecb" . equals ( modeLower ) ) { return android.security.KeyStoreKeyConstraints.BlockMode.ECB ; } else if ( "cbc" . equals ( modeLower ) ) { return android.security.KeyStoreKeyConstraints.BlockMode.CBC ; } else if ( "ctr" . equals ( modeLower ) ) { return android.security.KeyStoreKeyConstraints.BlockMode.CTR ; } else if ( "gcm" . equals ( modeLower ) ) { return android.security.KeyStoreKeyConstraints.BlockMode.CTR ; } else { throw new java.lang.IllegalArgumentException ( ( "Unknown block mode: " + mode ) ) ; } }
Source:
public java.lang.String getBucketLabel ( int bucketIndex ) { if ( ( bucketIndex < 0 ) || ( bucketIndex >= ( getBucketCount ( ) ) ) ) { return com.android.providers.contacts.ContactLocaleUtils.ContactLocaleUtilsBase.EMPTY_STRING ; } else if ( bucketIndex == ( mNumberBucketIndex ) ) { return com.android.providers.contacts.ContactLocaleUtils.ContactLocaleUtilsBase.NUMBER_STRING ; } else if ( bucketIndex > ( mNumberBucketIndex ) ) { -- bucketIndex ; } return mAlphabeticIndex.getBucketLabel ( bucketIndex ) ; }

Target:
public java.lang.String getBucketLabel ( int bucketIndex ) { if ( ( bucketIndex < 0 ) || ( bucketIndex >= ( getBucketCount ( ) ) ) ) { return com.android.providers.contacts.ContactLocaleUtils.ContactLocaleUtilsBase.EMPTY_STRING ; } else if ( bucketIndex == ( mNumberBucketIndex ) ) { return com.android.providers.contacts.ContactLocaleUtils.ContactLocaleUtilsBase.NUMBER_STRING ; } else if ( bucketIndex > ( mNumberBucketIndex ) ) { -- bucketIndex ; } return mAlphabeticIndex.getBucket ( bucketIndex ) . getLabel ( ) ; }
Source:
public boolean setPriority ( android.bluetooth.BluetoothDevice device , int priority ) { enforceCallingOrSelfPermission ( com.android.bluetooth.hid.BLUETOOTH_ADMIN_PERM , "Need BLUETOOTH_ADMIN permission" ) ; if ( com.android.bluetooth.hid.HidService.DBG ) { android.util.Log.d ( com.android.bluetooth.hid.HidService.TAG , ( "setPriority: " + ( device.getAddress ( ) ) ) ) ; } Settings.Global.putInt ( getContentResolver ( ) , Settings.Global.getBluetoothInputDevicePriorityKey ( device.getAddress ( ) ) , priority ) ; if ( com.android.bluetooth.hid.HidService.DBG ) { android.util.Log.d ( com.android.bluetooth.hid.HidService.TAG , ( ( ( "Saved priority " + device ) + " = " ) + priority ) ) ; } return true ; }

Target:
public boolean setPriority ( android.bluetooth.BluetoothDevice device , int priority ) { enforceCallingOrSelfPermission ( com.android.bluetooth.hid.BLUETOOTH_ADMIN_PERM , "Need BLUETOOTH_ADMIN permission" ) ; if ( com.android.bluetooth.hid.HidService.DBG ) { android.util.Log.d ( com.android.bluetooth.hid.HidService.TAG , ( "setPriority: " + ( device.getAddress ( ) ) ) ) ; } Settings.Global.putInt ( getContentResolver ( ) , Settings.Global.getBluetoothHidHostPriorityKey ( device.getAddress ( ) ) , priority ) ; if ( com.android.bluetooth.hid.HidService.DBG ) { android.util.Log.d ( com.android.bluetooth.hid.HidService.TAG , ( ( ( "Saved priority " + device ) + " = " ) + priority ) ) ; } return true ; }
Source:
private boolean hasGlobalSearchActivity ( ) { android.content.Context context = getInstrumentation ( ) . getTargetContext ( ) ; android.app.SearchManager searchManager = ( ( android.app.SearchManager ) ( context.getSystemService ( Context.SEARCH_SERVICE ) ) ) ; if ( searchManager == null ) { return false ; } try { return ( searchManager.getGlobalSearchActivity ( ) ) != null ; } catch ( java.lang.NullPointerException e ) { return false ; } }

Target:
private boolean hasGlobalSearchActivity ( ) { android.content.Context context = getInstrumentation ( ) . getTargetContext ( ) ; android.app.UiModeManager uiModeManager = context.getSystemService ( android.app.UiModeManager.class ) ; if ( ( uiModeManager.getCurrentModeType ( ) ) == ( android.content.res.Configuration.UI_MODE_TYPE_TELEVISION ) ) { return false ; } android.app.SearchManager searchManager = ( ( android.app.SearchManager ) ( context.getSystemService ( Context.SEARCH_SERVICE ) ) ) ; if ( searchManager == null ) { return false ; } try { return ( searchManager.getGlobalSearchActivity ( ) ) != null ; } catch ( java.lang.NullPointerException e ) { return false ; } }
Source:
private libcore.util.ZoneInfo createZoneInfo ( int [ ] [ ] transitionTimes , int [ ] [ ] transitionTypes ) throws java.lang.Exception { return createZoneInfo ( getName ( ) , transitionTimes , transitionTypes , java.lang.System.currentTimeMillis ( ) ) ; }

Target:
public void testReadTimeZone_NegativeTypes ( ) throws java.lang.Exception { libcore.util.ZoneInfoTestHelper.ZoneInfoDataBuilder builder = new libcore.util.ZoneInfoTestHelper.ZoneInfoDataBuilder ( ) ; builder.initializeToValid ( ) ; builder.setTypeCountOverride ( ( - 1 ) ) ; byte [ ] bytes = builder.build ( ) ; try { createZoneInfo ( getName ( ) , java.lang.System.currentTimeMillis ( ) , bytes ) ; fail ( ) ; } catch ( java.io.IOException expected ) { } }
Source:
public void mergeWithLowerPriorityNode ( com.android.manifmerger.XmlElement lowerPriorityNode , com.android.manifmerger.MergingReport.Builder mergingReport ) { mergingReport.getLogger ( ) . info ( ( ( ( "Merging " + ( getId ( ) ) ) + " with lower " ) + ( lowerPriorityNode.printPosition ( ) ) ) ) ; for ( com.android.manifmerger.XmlAttribute lowerPriorityAttribute : lowerPriorityNode.getAttributes ( ) ) { lowerPriorityAttribute.mergeInHigherPriorityElement ( this , mergingReport ) ; } mergeChildren ( lowerPriorityNode , mergingReport ) ; }

Target:
public void mergeWithLowerPriorityNode ( com.android.manifmerger.XmlElement lowerPriorityNode , com.android.manifmerger.MergingReport.Builder mergingReport ) { mergingReport.getLogger ( ) . info ( ( ( ( "Merging " + ( getId ( ) ) ) + " with lower " ) + ( lowerPriorityNode.printPosition ( ) ) ) ) ; if ( ( getType ( ) . getMergeType ( ) ) != ( MergeType.MERGE_CHILDREN_ONLY ) ) { for ( com.android.manifmerger.XmlAttribute lowerPriorityAttribute : lowerPriorityNode.getAttributes ( ) ) { lowerPriorityAttribute.mergeInHigherPriorityElement ( this , mergingReport ) ; } } mergeChildren ( lowerPriorityNode , mergingReport ) ; }
Source:
public com.android.jack.dx.io.MethodId get ( int index ) { com.android.jack.dx.io.DexBuffer.checkBounds ( index , tableOfContents.methodIds.size ) ; return open ( ( ( tableOfContents.methodIds.off ) + ( ( com.android.jack.dx.dex.SizeOf.MEMBER_ID_ITEM ) * index ) ) ) . readMethodId ( ) ; }

Target:
private java.util.List < com.android.jack.dx.io.FieldId > readFieldIds ( ) { com.android.jack.dx.io.DexBuffer.Section fieldIds = open ( tableOfContents.fieldIds.off ) ; com.android.jack.dx.io.FieldId [ ] result = new com.android.jack.dx.io.FieldId [ tableOfContents.fieldIds.size ] ; for ( int i = 0 ; i < ( tableOfContents.fieldIds.size ) ; ++ i ) { result [ i ] = fieldIds.readFieldId ( ) ; } return java.util.Arrays.asList ( result ) ; }