auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public int [ ] getAdnRecordsSize ( int efid ) { if ( DBG ) logd ( ( "getAdnRecordsSize: efid=" + efid ) ) ; synchronized ( mLock ) { checkThread ( ) ; recordSize = new int [ 3 ] ; java.util.concurrent.atomic.AtomicBoolean status = new java.util.concurrent.atomic.AtomicBoolean ( false ) ; android.os.Message response = mBaseHandler.obtainMessage ( com.android.internal.telephony.cdma.EVENT_GET_SIZE_DONE , status ) ; com.android.internal.telephony.IccFileHandler fh = phone.getIccFileHandler ( ) ; if ( fh != null ) { fh.getEFLinearRecordSize ( efid , response ) ; waitForResult ( status ) ; } } return recordSize ; }

Target:
public int [ ] getAdnRecordsSize ( int efid ) { if ( DBG ) logd ( ( "getAdnRecordsSize: efid=" + efid ) ) ; synchronized ( mLock ) { checkThread ( ) ; recordSize = new int [ 3 ] ; java.util.concurrent.atomic.AtomicBoolean status = new java.util.concurrent.atomic.AtomicBoolean ( false ) ; android.os.Message response = mBaseHandler.obtainMessage ( com.android.internal.telephony.cdma.EVENT_GET_SIZE_DONE , status ) ; com.android.internal.telephony.uicc.IccFileHandler fh = phone.getIccFileHandler ( ) ; if ( fh != null ) { fh.getEFLinearRecordSize ( efid , response ) ; waitForResult ( status ) ; } } return recordSize ; }
Source:
private static boolean needToConvert ( com.android.internal.telephony.Phone phone ) { android.telephony.CarrierConfigManager configManager = ( ( android.telephony.CarrierConfigManager ) ( phone.getContext ( ) . getSystemService ( Context.CARRIER_CONFIG_SERVICE ) ) ) ; if ( configManager != null ) { android.os.PersistableBundle bundle = configManager.getConfig ( ) ; if ( bundle != null ) { return bundle.getBoolean ( CarrierConfigManager.KEY_SMS_REQUIRES_DESTINATION_NUMBER_CONVERSION_BOOL ) ; } } return false ; }

Target:
private static boolean needToConvert ( com.android.internal.telephony.Phone phone ) { final long identity = android.os.Binder.clearCallingIdentity ( ) ; try { android.telephony.CarrierConfigManager configManager = ( ( android.telephony.CarrierConfigManager ) ( phone.getContext ( ) . getSystemService ( Context.CARRIER_CONFIG_SERVICE ) ) ) ; if ( configManager != null ) { android.os.PersistableBundle bundle = configManager.getConfig ( ) ; if ( bundle != null ) { return bundle.getBoolean ( CarrierConfigManager.KEY_SMS_REQUIRES_DESTINATION_NUMBER_CONVERSION_BOOL ) ; } } } finally { android.os.Binder.restoreCallingIdentity ( identity ) ; } return false ; }
Source:
private static void sortAttributeChoices ( com.android.ide.eclipse.adt.internal.editors.descriptors.AttributeDescriptor descriptor , java.util.List < java.lang.String > choices ) { final com.android.ide.common.api.IAttributeInfo attributeInfo = descriptor.getAttributeInfo ( ) ; java.util.Collections.sort ( choices , new java.util.Comparator < java.lang.String > ( ) { @ java.lang.Override public int compare ( java.lang.String s1 , java.lang.String s2 ) { int compare = ( com.android.ide.eclipse.adt.internal.editors.uimodel.UiResourceAttributeNode.score ( attributeInfo , s1 ) ) - ( com.android.ide.eclipse.adt.internal.editors.uimodel.UiResourceAttributeNode.score ( attributeInfo , s2 ) ) ; if ( compare == 0 ) { compare = s1.compareTo ( s2 ) ; } return compare ; } } ) ; }

Target:
public static void sortAttributeChoices ( com.android.ide.eclipse.adt.internal.editors.descriptors.AttributeDescriptor descriptor , java.util.List < java.lang.String > choices ) { final com.android.ide.common.api.IAttributeInfo attributeInfo = descriptor.getAttributeInfo ( ) ; java.util.Collections.sort ( choices , new java.util.Comparator < java.lang.String > ( ) { @ java.lang.Override public int compare ( java.lang.String s1 , java.lang.String s2 ) { int compare = ( com.android.ide.eclipse.adt.internal.editors.uimodel.UiResourceAttributeNode.score ( attributeInfo , s1 ) ) - ( com.android.ide.eclipse.adt.internal.editors.uimodel.UiResourceAttributeNode.score ( attributeInfo , s2 ) ) ; if ( compare == 0 ) { compare = s1.compareToIgnoreCase ( s2 ) ; } return compare ; } } ) ; }
Source:
public static java.lang.annotation.Annotation createAnnotation ( java.lang.Class < ? extends java.lang.annotation.Annotation > annotationType , libcore.reflect.AnnotationMember [ ] elements ) { libcore.reflect.AnnotationFactory factory = new libcore.reflect.AnnotationFactory ( annotationType , elements ) ; return ( ( java.lang.annotation.Annotation ) ( java.lang.reflect.Proxy.newProxyInstance ( annotationType.getClassLoader ( ) , new java.lang.Class [ ] { annotationType } , factory ) ) ) ; }

Target:
public static < A extends java.lang.annotation.Annotation > A createAnnotation ( java.lang.Class < ? extends java.lang.annotation.Annotation > annotationType , libcore.reflect.AnnotationMember [ ] elements ) { libcore.reflect.AnnotationFactory factory = new libcore.reflect.AnnotationFactory ( annotationType , elements ) ; return ( ( A ) ( java.lang.reflect.Proxy.newProxyInstance ( annotationType.getClassLoader ( ) , new java.lang.Class [ ] { annotationType } , factory ) ) ) ; }
Source:
public java.util.List < java.io.File > getJavaLibraries ( ) { if ( ( mJavaLibraries ) == null ) { java.io.File jarFile = mLibrary.getJarFile ( ) ; if ( jarFile.exists ( ) ) { mJavaLibraries = java.util.Collections.singletonList ( jarFile ) ; } else { mJavaLibraries = java.util.Collections.emptyList ( ) ; } } return mJavaLibraries ; }

Target:
public java.util.List < java.io.File > getJavaLibraries ( ) { if ( ( mJavaLibraries ) == null ) { mJavaLibraries = com.google.common.collect.Lists.newArrayList ( ) ; java.io.File jarFile = mLibrary.getJarFile ( ) ; if ( jarFile.exists ( ) ) { mJavaLibraries.add ( jarFile ) ; } for ( java.io.File local : mLibrary.getLocalJars ( ) ) { if ( local.exists ( ) ) { mJavaLibraries.add ( local ) ; } } } return mJavaLibraries ; }
Source:
public void onPause ( ) { super . onPause ( ) ; if ( ( ( mLocalManager ) == null ) || ( isUiRestricted ( ) ) ) { return ; } removeAllDevices ( ) ; mLocalManager.setForegroundActivity ( null ) ; mLocalManager.getEventManager ( ) . unregisterCallback ( this ) ; }

Target:
public void onStop ( ) { super . onStop ( ) ; if ( ( ( mLocalManager ) == null ) || ( isUiRestricted ( ) ) ) { return ; } removeAllDevices ( ) ; mLocalManager.setForegroundActivity ( null ) ; mLocalManager.getEventManager ( ) . unregisterCallback ( this ) ; }
Source:
public void readContent ( @ javax.annotation.Nonnull com.android.jack.jayce.v0002.io.JayceInternalReaderImpl in ) throws java.io.IOException { level = in.getNodeLevel ( ) ; name = in.readId ( ) ; returnType = in.readId ( ) ; modifier = in.readInt ( ) ; annotations = in.readNodes ( com.android.jack.jayce.v0002.nodes.NAnnotationLiteral.class ) ; defaultValue = in.readNode ( com.android.jack.jayce.v0002.nodes.NLiteral.class ) ; markers = in.readNodes ( com.android.jack.jayce.v0002.nodes.NMarker.class ) ; }

Target:
public void readContent ( @ javax.annotation.Nonnull com.android.jack.jayce.v0002.io.JayceInternalReaderImpl in ) throws java.io.IOException { level = in.getNodeLevel ( ) ; name = in.readId ( ) ; returnType = in.readId ( ) ; modifier = in.readInt ( ) ; annotations = in.readNodes ( com.android.jack.jayce.v0002.nodes.NAnnotation.class ) ; defaultValue = in.readNode ( com.android.jack.jayce.v0002.nodes.NLiteral.class ) ; markers = in.readNodes ( com.android.jack.jayce.v0002.nodes.NMarker.class ) ; }
Source:
public void setUp ( ) throws com.android.tradefed.device.DeviceNotAvailableException , java.lang.Exception { mDevice = getDevice ( ) ; mIsBackupSupported = hasDeviceFeature ( android.cts.backup.BaseBackupHostSideTest.FEATURE_BACKUP ) ; org.junit.Assume.assumeTrue ( mIsBackupSupported ) ; junit.framework.Assert.assertTrue ( "LocalTransport should be available." , hasBackupTransport ( android.cts.backup.BaseBackupHostSideTest.LOCAL_TRANSPORT ) ) ; mWasBackupEnabled = enableBackup ( true ) ; mOldTransport = setBackupTransport ( android.cts.backup.BaseBackupHostSideTest.LOCAL_TRANSPORT ) ; assertNotNull ( mCtsBuildInfo ) ; }

Target:
public void setUp ( ) throws com.android.tradefed.device.DeviceNotAvailableException , java.lang.Exception { mDevice = getDevice ( ) ; mIsBackupSupported = hasDeviceFeature ( android.cts.backup.BaseBackupHostSideTest.FEATURE_BACKUP ) ; if ( ! ( mIsBackupSupported ) ) { com.android.tradefed.log.LogUtil.CLog.i ( "android.software.backup feature is not supported on this device" ) ; return ; } junit.framework.Assert.assertTrue ( "LocalTransport should be available." , hasBackupTransport ( android.cts.backup.BaseBackupHostSideTest.LOCAL_TRANSPORT ) ) ; mWasBackupEnabled = enableBackup ( true ) ; mOldTransport = setBackupTransport ( android.cts.backup.BaseBackupHostSideTest.LOCAL_TRANSPORT ) ; assertNotNull ( mCtsBuildInfo ) ; }
Source:
public java.util.Collection < com.android.ide.common.resources.ResourceItem > getResourceItemsOfType ( com.android.resources.ResourceType type ) { java.util.List < com.android.ide.common.resources.ResourceItem > list = mResourceMap.get ( type ) ; if ( list == null ) { return java.util.Collections.emptyList ( ) ; } java.util.List < com.android.ide.common.resources.ResourceItem > roList = mReadOnlyListMap.get ( list ) ; if ( roList == null ) { roList = java.util.Collections.unmodifiableList ( list ) ; mReadOnlyListMap.put ( list , roList ) ; } return roList ; }

Target:
public java.util.Collection < com.android.ide.common.resources.ResourceItem > getResourceItemsOfType ( com.android.resources.ResourceType type ) { java.util.Map < java.lang.String , com.android.ide.common.resources.ResourceItem > map = mResourceMap.get ( type ) ; if ( map == null ) { return java.util.Collections.emptyList ( ) ; } java.util.Collection < com.android.ide.common.resources.ResourceItem > roList = mReadOnlyListMap.get ( map ) ; if ( roList == null ) { roList = java.util.Collections.unmodifiableCollection ( map.values ( ) ) ; mReadOnlyListMap.put ( map , roList ) ; } return roList ; }
Source:
private static void checkOnTouchListener ( com.android.tools.lint.detector.api.ClassContext context , org.objectweb.asm.tree.ClassNode classNode ) { org.objectweb.asm.tree.MethodNode onTouchNode = com.android.tools.lint.checks.ClickableViewAccessibilityDetector.findMethod ( classNode.methods , com.android.tools.lint.checks.ClickableViewAccessibilityDetector.ON_TOUCH , com.android.tools.lint.checks.ClickableViewAccessibilityDetector.ON_TOUCH_SIG ) ; if ( onTouchNode != null ) { org.objectweb.asm.tree.AbstractInsnNode performClickInsnNode = com.android.tools.lint.checks.ClickableViewAccessibilityDetector.findMethodCallInstruction ( onTouchNode.instructions , com.android.SdkConstants.ANDROID_VIEW_VIEW , com.android.tools.lint.checks.ClickableViewAccessibilityDetector.PERFORM_CLICK , com.android.tools.lint.checks.ClickableViewAccessibilityDetector.PERFORM_CLICK_SIG ) ; if ( performClickInsnNode == null ) { java.lang.String message = java.lang.String.format ( "%1$s#onTouch should call View#performClick when a click is detected" , classNode.name ) ; context.report ( com.android.tools.lint.checks.ClickableViewAccessibilityDetector.ISSUE , onTouchNode , null , context.getLocation ( onTouchNode , classNode ) , message , null ) ; } } }

Target:
private static void checkOnTouchListener ( com.android.tools.lint.detector.api.ClassContext context , org.objectweb.asm.tree.ClassNode classNode ) { org.objectweb.asm.tree.MethodNode onTouchNode = com.android.tools.lint.checks.ClickableViewAccessibilityDetector.findMethod ( classNode.methods , com.android.tools.lint.checks.ClickableViewAccessibilityDetector.ON_TOUCH , com.android.tools.lint.checks.ClickableViewAccessibilityDetector.ON_TOUCH_SIG ) ; if ( onTouchNode != null ) { org.objectweb.asm.tree.AbstractInsnNode performClickInsnNode = com.android.tools.lint.checks.ClickableViewAccessibilityDetector.findMethodCallInstruction ( onTouchNode.instructions , com.android.SdkConstants.ANDROID_VIEW_VIEW , com.android.tools.lint.checks.ClickableViewAccessibilityDetector.PERFORM_CLICK , com.android.tools.lint.checks.ClickableViewAccessibilityDetector.PERFORM_CLICK_SIG ) ; if ( performClickInsnNode == null ) { java.lang.String message = java.lang.String.format ( "`%1$s#onTouch` should call `View#performClick` when a click is detected" , classNode.name ) ; context.report ( com.android.tools.lint.checks.ClickableViewAccessibilityDetector.ISSUE , onTouchNode , null , context.getLocation ( onTouchNode , classNode ) , message , null ) ; } } }
Source:
public void testConfigurationUpdatesWhenResizedFromDockedStack ( ) throws java.lang.Exception { HEAD ( 5 ) ; android.server.cts.c121a Merge ; }

Target:
public void testConfigurationUpdatesWhenResizedFromFullscreen ( ) throws java.lang.Exception { if ( ! ( supportsSplitScreenMultiWindow ( ) ) ) { com.android.tradefed.log.LogUtil.CLog.logAndDisplay ( LogLevel.INFO , "Skipping test: no multi-window support" ) ; return ; } launchActivityInStack ( android.server.cts.ActivityManagerAppConfigurationTests.RESIZEABLE_ACTIVITY_NAME , android.server.cts.FULLSCREEN_WORKSPACE_STACK_ID ) ; final android.server.cts.ReportedSizes fullscreenSizes = getActivityDisplaySize ( android.server.cts.ActivityManagerAppConfigurationTests.RESIZEABLE_ACTIVITY_NAME ) ; moveActivityToStack ( android.server.cts.ActivityManagerAppConfigurationTests.RESIZEABLE_ACTIVITY_NAME , android.server.cts.DOCKED_STACK_ID ) ; final android.server.cts.ReportedSizes dockedSizes = getActivityDisplaySize ( android.server.cts.ActivityManagerAppConfigurationTests.RESIZEABLE_ACTIVITY_NAME ) ; android.server.cts.ActivityManagerAppConfigurationTests.assertSizesAreSane ( fullscreenSizes , dockedSizes ) ; }
Source:
public android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeFormatterData get ( android.icu.util.ULocale locale ) { java.lang.String key = locale.toString ( ) ; android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeFormatterData result = cache.get ( key ) ; if ( result == null ) { result = new android.icu.text.RelativeDateTimeFormatter.Loader ( locale ) . load ( ) ; cache.put ( key , result ) ; } return result ; }

Target:
public android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeFormatterData get ( android.icu.util.ULocale locale ) { java.lang.String key = locale.toString ( ) ; return cache.getInstance ( key , locale ) ; }
Source:
public android.os.Bundle getAvailableChannels ( int band ) { mChannelHelper.updateChannels ( ) ; android.net.wifi.WifiScanner.ChannelSpec [ ] channelSpecs = mChannelHelper.getAvailableScanChannels ( band ) ; java.util.ArrayList < java.lang.Integer > list = new java.util.ArrayList < java.lang.Integer > ( channelSpecs.length ) ; for ( android.net.wifi.WifiScanner.ChannelSpec channelSpec : channelSpecs ) { list.add ( channelSpec.frequency ) ; } android.os.Bundle b = new android.os.Bundle ( ) ; b.putIntegerArrayList ( WifiScanner.GET_AVAILABLE_CHANNELS_EXTRA , list ) ; return b ; }

Target:
public android.os.Bundle getAvailableChannels ( int band ) { mChannelHelper.updateChannels ( ) ; android.net.wifi.WifiScanner.ChannelSpec [ ] channelSpecs = mChannelHelper.getAvailableScanChannels ( band ) ; java.util.ArrayList < java.lang.Integer > list = new java.util.ArrayList < java.lang.Integer > ( channelSpecs.length ) ; for ( android.net.wifi.WifiScanner.ChannelSpec channelSpec : channelSpecs ) { list.add ( channelSpec.frequency ) ; } android.os.Bundle b = new android.os.Bundle ( ) ; b.putIntegerArrayList ( WifiScanner.GET_AVAILABLE_CHANNELS_EXTRA , list ) ; mLog.trace ( "getAvailableChannels uid=%" ) . c ( android.os.Binder.getCallingUid ( ) ) . flush ( ) ; return b ; }
Source:
public void checkValidity ( ) { }

Target:
public void checkValidity ( ) { com.android.jack.ir.ast.cfg.CfgExpressionValidator.validate ( this ) ; if ( this . isTerminal ( ) ) { if ( ( this ) != ( getBasicBlock ( ) . getLastElement ( ) ) ) { throw new com.android.jack.ir.JNodeInternalError ( this , "Terminal block element must be the last element of the block" ) ; } } else { if ( ( ( this . getBasicBlock ( ) ) instanceof com.android.jack.ir.ast.cfg.JThrowingBasicBlock ) && ( ( this ) == ( getBasicBlock ( ) . getLastElement ( ) ) ) ) { throw new com.android.jack.ir.JNodeInternalError ( this , "Non-terminal block element must NOT be the last element of the throwing block" ) ; } } }
Source:
private void validateExposureTime ( long request , long result ) { long expTimeDelta = request - result ; mCollector.expectTrue ( ( ( ( "Exposture time is invalid for AE manaul control test, request: " + request ) + " result: " ) + result ) , ( ( expTimeDelta < ( android.hardware.camera2.cts.CaptureRequestTest.EXPOSURE_TIME_ERROR_MARGIN_NS ) ) && ( expTimeDelta >= 0 ) ) ) ; }

Target:
private void validateExposureTime ( long request , long result ) { long expTimeDelta = request - result ; long expTimeErrorMargin = ( ( long ) ( java.lang.Math.max ( android.hardware.camera2.cts.CaptureRequestTest.EXPOSURE_TIME_ERROR_MARGIN_NS , ( request * ( android.hardware.camera2.cts.CaptureRequestTest.EXPOSURE_TIME_ERROR_MARGIN_RATE ) ) ) ) ) ; mCollector.expectTrue ( ( ( ( "Exposture time is invalid for AE manaul control test, request: " + request ) + " result: " ) + result ) , ( ( expTimeDelta < expTimeErrorMargin ) && ( expTimeDelta >= 0 ) ) ) ; }
Source:
public void test_getSoTimeout ( ) throws java.lang.Exception { java.net.DatagramSocket ds = new java.net.DatagramSocket ( ) ; ds.setSoTimeout ( 100 ) ; assertEquals ( "Returned incorrect timeout" , 100 , ds.getSoTimeout ( ) ) ; }

Target:
public void test_getSoTimeout ( ) throws java.lang.Exception { java.net.DatagramSocket ds = new java.net.DatagramSocket ( ) ; final int timeoutSet = 100 ; ds.setSoTimeout ( timeoutSet ) ; int actualTimeout = ds.getSoTimeout ( ) ; assertTrue ( "Returned incorrect timeout" , ( ( java.lang.Math.abs ( ( actualTimeout - timeoutSet ) ) ) <= 10 ) ) ; }
Source:
public void onClick ( android.view.View v ) { zoomWithPreview ( 1.0F ) ; updateZoomButtonsEnabled ( ) ; }

Target:
public void setEmbeddedTitleBar ( android.view.View v ) { if ( ( mTitleBar ) == v ) return ; if ( ( mTitleBar ) != null ) { removeView ( mTitleBar ) ; } if ( null != v ) { addView ( v , new android.widget.AbsoluteLayout.LayoutParams ( ViewGroup.LayoutParams.FILL_PARENT , ViewGroup.LayoutParams.WRAP_CONTENT , 0 , 0 ) ) ; if ( ( mTitleShadow ) == null ) { mTitleShadow = ( ( android.graphics.drawable.Drawable ) ( mContext.getResources ( ) . getDrawable ( com.android.internal.R.drawable.title_bar_shadow ) ) ) ; } } mTitleBar = v ; }
Source:
private synchronized void onIntrData ( byte reportId , byte [ ] data ) { if ( com.android.bluetooth.hid.HidDeviceService.DBG ) { android.util.Log.d ( com.android.bluetooth.hid.HidDeviceService.TAG , ( "onIntrData(): reportId=" + reportId ) ) ; } java.nio.ByteBuffer bb = java.nio.ByteBuffer.wrap ( data ) ; android.os.Message msg = mHandler.obtainMessage ( com.android.bluetooth.hid.HidDeviceService.MESSAGE_INTR_DATA ) ; msg.arg1 = reportId ; msg.obj = bb ; mHandler.sendMessage ( msg ) ; }

Target:
synchronized void onIntrDataFromNative ( byte reportId , byte [ ] data ) { if ( com.android.bluetooth.hid.HidDeviceService.DBG ) { android.util.Log.d ( com.android.bluetooth.hid.HidDeviceService.TAG , ( "onIntrData(): reportId=" + reportId ) ) ; } java.nio.ByteBuffer bb = java.nio.ByteBuffer.wrap ( data ) ; android.os.Message msg = mHandler.obtainMessage ( com.android.bluetooth.hid.HidDeviceService.MESSAGE_INTR_DATA ) ; msg.arg1 = reportId ; msg.obj = bb ; mHandler.sendMessage ( msg ) ; }
Source:
public final short getShort ( long addr ) { if ( myValuesAreBufferAligned ) { long page = addr / ( myPageSize ) ; int page_offset = ( ( int ) ( addr % ( myPageSize ) ) ) ; return getBuffer ( page , false ) . getShort ( page_offset ) ; } else { get ( addr , myTypedIOBuffer , 0 , 2 ) ; return com.intellij.util.io.Bits.getShort ( myTypedIOBuffer , 0 ) ; } }

Target:
public final short getShort ( long addr ) { if ( myValuesAreBufferAligned ) { long page = addr / ( myPageSize ) ; int page_offset = ( ( int ) ( addr % ( myPageSize ) ) ) ; return getReadOnlyBuffer ( page ) . getShort ( page_offset ) ; } else { get ( addr , myTypedIOBuffer , 0 , 2 ) ; return com.intellij.util.io.Bits.getShort ( myTypedIOBuffer , 0 ) ; } }
Source:
private java.io.File createRscLibrary ( ) throws java.io.IOException , java.lang.Exception { com.android.jack.test.toolchain.JackBasedToolchain toolchain = com.android.jack.test.toolchain.AbstractTestTools.getCandidateToolchain ( com.android.jack.test.toolchain.JackBasedToolchain.class ) ; java.io.File emptyLib = com.android.jack.test.toolchain.AbstractTestTools.createTempFile ( "rsc" , toolchain.getLibraryExtension ( ) ) ; toolchain.addResource ( com.android.jack.test.toolchain.AbstractTestTools.getTestRootDir ( "com.android.jack.library.test001.lib" ) ) ; toolchain.srcToLib ( emptyLib , true ) ; return emptyLib ; }

Target:
private java.io.File createRscLibrary ( ) throws java.io.IOException , java.lang.Exception { com.android.jack.test.toolchain.JackBasedToolchain toolchain = com.android.jack.test.toolchain.AbstractTestTools.getCandidateToolchain ( com.android.jack.test.toolchain.JackBasedToolchain.class ) ; java.io.File emptyLib = com.android.jack.test.toolchain.AbstractTestTools.createTempFile ( "rsc" , toolchain.getLibraryExtension ( ) ) ; toolchain.addResourceDir ( com.android.jack.test.toolchain.AbstractTestTools.getTestRootDir ( "com.android.jack.library.test001.lib" ) ) ; toolchain.srcToLib ( emptyLib , true ) ; return emptyLib ; }
Source:
private void write ( int index , java.io.FileWriter writer ) throws java.io.IOException { switch ( index ) { case com.android.sdklib.internal.export.ApkData.INDEX_OUTPUTNAME : com.android.sdklib.internal.export.ApkData.writeValue ( writer , mOutputName ) ; break ; case com.android.sdklib.internal.export.ApkData.INDEX_PROJECT : com.android.sdklib.internal.export.ApkData.writeValue ( writer , mRelativePath ) ; break ; case com.android.sdklib.internal.export.ApkData.INDEX_MINOR : com.android.sdklib.internal.export.ApkData.writeValue ( writer , mMinor ) ; break ; case com.android.sdklib.internal.export.ApkData.INDEX_MINSDK : com.android.sdklib.internal.export.ApkData.writeValue ( writer , mMinSdkVersion ) ; break ; case com.android.sdklib.internal.export.ApkData.INDEX_ABI : com.android.sdklib.internal.export.ApkData.writeValue ( writer , ( ( mAbi ) != null ? mAbi : "" ) ) ; break ; } }

Target:
private void write ( int index , java.io.OutputStreamWriter writer ) throws java.io.IOException { switch ( index ) { case com.android.sdklib.internal.export.ApkData.INDEX_OUTPUTNAME : com.android.sdklib.internal.export.ApkData.writeValue ( writer , mOutputName ) ; break ; case com.android.sdklib.internal.export.ApkData.INDEX_PROJECT : com.android.sdklib.internal.export.ApkData.writeValue ( writer , mRelativePath ) ; break ; case com.android.sdklib.internal.export.ApkData.INDEX_MINOR : com.android.sdklib.internal.export.ApkData.writeValue ( writer , mMinor ) ; break ; case com.android.sdklib.internal.export.ApkData.INDEX_MINSDK : com.android.sdklib.internal.export.ApkData.writeValue ( writer , mMinSdkVersion ) ; break ; case com.android.sdklib.internal.export.ApkData.INDEX_ABI : com.android.sdklib.internal.export.ApkData.writeValue ( writer , ( ( mAbi ) != null ? mAbi : "" ) ) ; break ; } }
Source:
private boolean delete ( byte [ ] key ) { execute ( 'd' , key ) ; return ( mError ) == ( android.security.KeyStore.NO_ERROR ) ; }

Target:
public boolean put ( java.lang.String key , byte [ ] value ) { try { return ( mBinder.insert ( key , value ) ) == ( android.security.KeyStore.NO_ERROR ) ; } catch ( android.os.RemoteException e ) { android.util.Log.w ( android.security.KeyStore.TAG , "Cannot connect to keystore" , e ) ; return false ; } }
Source:
private void processIcbMmiCodeForUpdate ( ) { java.lang.String dialingNumber = mSia ; java.lang.String [ ] icbNum = null ; int callAction ; if ( dialingNumber != null ) { icbNum = dialingNumber.split ( "\\$" ) ; } callAction = callBarAction ( dialingNumber ) ; try { mPhone.mCT.getUtInterface ( ) . updateCallBarring ( ImsUtInterface.CB_BS_MT , callAction , obtainMessage ( com.android.internal.telephony.imsphone.ImsPhoneMmiCode.EVENT_SET_COMPLETE , this ) , icbNum ) ; } catch ( com.android.ims.ImsException e ) { android.telephony.Rlog.d ( com.android.internal.telephony.imsphone.ImsPhoneMmiCode.LOG_TAG , "Could not get UT handle for updating ICB." ) ; } }

Target:
private void processIcbMmiCodeForUpdate ( ) { java.lang.String dialingNumber = mSia ; java.lang.String [ ] icbNum = null ; int callAction ; if ( dialingNumber != null ) { icbNum = dialingNumber.split ( "\\$" ) ; } callAction = callBarAction ( dialingNumber ) ; try { mPhone.mCT.getUtInterface ( ) . updateCallBarring ( ImsUtInterface.CB_BS_MT , callAction , obtainMessage ( com.android.internal.telephony.imsphone.ImsPhoneMmiCode.EVENT_SET_COMPLETE , this ) , icbNum ) ; } catch ( com.android.ims.ImsException e ) { android.telephony.Rlog.d ( com.android.internal.telephony.imsphone.ImsPhoneMmiCode.LOG_TAG , "processIcbMmiCodeForUpdate:Could not get UT handle for updating ICB." ) ; } }
Source:
public void testSessionToken ( ) throws java.lang.Exception { java.lang.String tag = "test session" ; android.media.session.MediaSession session = new android.media.session.MediaSession ( getContext ( ) , tag ) ; android.media.session.MediaSession.Token sessionToken = session.getSessionToken ( ) ; assertNotNull ( sessionToken ) ; assertEquals ( 0 , sessionToken.describeContents ( ) ) ; android.os.Parcel p = android.os.Parcel.obtain ( ) ; sessionToken.writeToParcel ( p , 0 ) ; p.setDataPosition ( 0 ) ; android.media.session.MediaSession.Token token = MediaSession.Token.CREATOR.createFromParcel ( p ) ; assertEquals ( token , sessionToken ) ; p.recycle ( ) ; }

Target:
public void testSessionToken ( ) throws java.lang.Exception { android.media.session.MediaSession.Token sessionToken = mSession.getSessionToken ( ) ; assertNotNull ( sessionToken ) ; assertEquals ( 0 , sessionToken.describeContents ( ) ) ; android.os.Parcel p = android.os.Parcel.obtain ( ) ; sessionToken.writeToParcel ( p , 0 ) ; p.setDataPosition ( 0 ) ; android.media.session.MediaSession.Token token = MediaSession.Token.CREATOR.createFromParcel ( p ) ; assertEquals ( token , sessionToken ) ; p.recycle ( ) ; }
Source:
private android.net.Network connectKeepaliveNetwork ( android.net.LinkProperties lp ) { if ( ( mWiFiNetworkAgent ) != null ) { org.junit.Assert.assertNull ( mCm.getNetworkCapabilities ( mWiFiNetworkAgent.getNetwork ( ) ) ) ; } mWiFiNetworkAgent = new com.android.server.ConnectivityServiceTest.MockNetworkAgent ( TRANSPORT_WIFI ) ; android.os.ConditionVariable cv = waitForConnectivityBroadcasts ( 1 ) ; mWiFiNetworkAgent.connect ( true ) ; com.android.server.ConnectivityServiceTest.waitFor ( cv ) ; verifyActiveNetwork ( com.android.server.TRANSPORT_WIFI ) ; mWiFiNetworkAgent.sendLinkProperties ( lp ) ; waitForIdle ( ) ; return mWiFiNetworkAgent.getNetwork ( ) ; }

Target:
private android.net.Network connectKeepaliveNetwork ( android.net.LinkProperties lp ) { if ( ( mWiFiNetworkAgent ) != null ) { org.junit.Assert.assertNull ( mCm.getNetworkCapabilities ( mWiFiNetworkAgent.getNetwork ( ) ) ) ; } mWiFiNetworkAgent = new com.android.server.ConnectivityServiceTest.MockNetworkAgent ( android.net.NetworkCapabilities.TRANSPORT_WIFI ) ; android.os.ConditionVariable cv = waitForConnectivityBroadcasts ( 1 ) ; mWiFiNetworkAgent.connect ( true ) ; com.android.server.ConnectivityServiceTest.waitFor ( cv ) ; verifyActiveNetwork ( android.net.NetworkCapabilities.TRANSPORT_WIFI ) ; mWiFiNetworkAgent.sendLinkProperties ( lp ) ; waitForIdle ( ) ; return mWiFiNetworkAgent.getNetwork ( ) ; }
Source:
public void startScan ( int callingUid , int scanCounter , android.net.wifi.ScanSettings settings , android.os.WorkSource workSource ) { android.os.Bundle bundle = new android.os.Bundle ( ) ; bundle.putParcelable ( com.android.server.wifi.WifiStateMachine.CUSTOMIZED_SCAN_SETTING , settings ) ; bundle.putParcelable ( com.android.server.wifi.WifiStateMachine.CUSTOMIZED_SCAN_WORKSOURCE , workSource ) ; bundle.putLong ( com.android.server.wifi.WifiStateMachine.SCAN_REQUEST_TIME , java.lang.System.currentTimeMillis ( ) ) ; sendMessage ( com.android.server.wifi.WifiStateMachine.CMD_START_SCAN , callingUid , scanCounter , bundle ) ; }

Target:
public void startScan ( int callingUid , int scanCounter , android.net.wifi.ScanSettings settings , android.os.WorkSource workSource ) { android.os.Bundle bundle = new android.os.Bundle ( ) ; bundle.putParcelable ( com.android.server.wifi.WifiStateMachine.CUSTOMIZED_SCAN_SETTING , settings ) ; bundle.putParcelable ( com.android.server.wifi.WifiStateMachine.CUSTOMIZED_SCAN_WORKSOURCE , workSource ) ; bundle.putLong ( com.android.server.wifi.WifiStateMachine.SCAN_REQUEST_TIME , mClock.getWallClockMillis ( ) ) ; sendMessage ( com.android.server.wifi.WifiStateMachine.CMD_START_SCAN , callingUid , scanCounter , bundle ) ; }
Source:
public boolean onHandleForceStop ( android.content.Intent intent , java.lang.String [ ] packages , int uid , boolean doit ) { int userId = intent.getIntExtra ( Intent.EXTRA_USER_HANDLE , 0 ) ; if ( packages != null ) { for ( java.lang.String pkg : packages ) { synchronized ( this ) { if ( forceStopPackageLocked ( pkg , ( - 1 ) , false , false , false , false , false , userId , "finished booting" ) ) { return true ; } } } } return false ; }

Target:
public void onReceive ( android.content.Context context , android.content.Intent intent ) { java.lang.String [ ] pkgs = intent.getStringArrayExtra ( Intent.EXTRA_PACKAGES ) ; if ( pkgs != null ) { for ( java.lang.String pkg : pkgs ) { synchronized ( this ) { if ( forceStopPackageLocked ( pkg , ( - 1 ) , false , false , false , false , false , 0 , "finished booting" ) ) { setResultCode ( Activity.RESULT_OK ) ; return ; } } } } }
Source:
public void setUp ( ) throws java.lang.Exception { mMockDevice = org.easymock.EasyMock.createNiceMock ( com.android.tradefed.device.ITestDevice.class ) ; mMockBuildInfo = org.easymock.EasyMock.createNiceMock ( com.android.tradefed.build.IBuildInfo.class ) ; mMockHelper = new com.android.compatibility.common.tradefed.build.VtsCompatibilityInvocationHelper ( ) ; mPreparer = new com.android.tradefed.targetprep.VtsTraceCollectPreparer ( ) { @ java.lang.Override com.android.compatibility.common.tradefed.build.VtsCompatibilityInvocationHelper createVtsHelper ( ) { return mMockHelper ; } } ; com.android.tradefed.config.OptionSetter setter = new com.android.tradefed.config.OptionSetter ( mPreparer ) ; setter.setOptionValue ( "local-trace-dir" , com.android.tradefed.targetprep.VtsTraceCollectPreparerTest.TEST_TRACE_DIR ) ; }

Target:
public java.io.File getTestsDir ( ) throws java.io.FileNotFoundException { return mTestDir ; }
Source:
private void createConnectionFailed ( final java.lang.String callId , final android.telecom.ConnectionRequest request , boolean isIncoming ) { android.telecom.Log.i ( this , "createConnectionFailed %s" , callId ) ; if ( isIncoming ) { onCreateIncomingConnectionFailed ( request ) ; } else { onCreateOutgoingConnectionFailed ( request ) ; } }

Target:
private void createConnectionFailed ( final android.telecom.PhoneAccountHandle callManagerAccount , final java.lang.String callId , final android.telecom.ConnectionRequest request , boolean isIncoming ) { android.telecom.Log.i ( this , "createConnectionFailed %s" , callId ) ; if ( isIncoming ) { onCreateIncomingConnectionFailed ( callManagerAccount , request ) ; } else { onCreateOutgoingConnectionFailed ( callManagerAccount , request ) ; } }
Source:
public void testUnescapeStringShouldUnescapeAtSignAndQuestionMarkOnlyAtBeginning ( ) throws java.lang.Exception { assertEquals ( "@text" , com.android.ide.common.resources.ValueResourceParser.unescapeResourceString ( "\\@text" , false , true ) ) ; assertEquals ( "a@text" , com.android.ide.common.resources.ValueResourceParser.unescapeResourceString ( "a@text" , false , true ) ) ; assertEquals ( "?text" , com.android.ide.common.resources.ValueResourceParser.unescapeResourceString ( "\\?text" , false , true ) ) ; assertEquals ( "a?text" , com.android.ide.common.resources.ValueResourceParser.unescapeResourceString ( "a?text" , false , true ) ) ; assertEquals ( " ?text" , com.android.ide.common.resources.ValueResourceParser.unescapeResourceString ( "\" ?text\"" , false , true ) ) ; }

Target:
public void testUnescapeStringShouldUnescapeAtSignAndQuestionMarkOnlyAtBeginning ( ) throws java.lang.Exception { assertEquals ( "@text" , com.android.ide.common.res2.ValueXmlHelper.unescapeResourceString ( "\\@text" , false , true ) ) ; assertEquals ( "a@text" , com.android.ide.common.res2.ValueXmlHelper.unescapeResourceString ( "a@text" , false , true ) ) ; assertEquals ( "?text" , com.android.ide.common.res2.ValueXmlHelper.unescapeResourceString ( "\\?text" , false , true ) ) ; assertEquals ( "a?text" , com.android.ide.common.res2.ValueXmlHelper.unescapeResourceString ( "a?text" , false , true ) ) ; assertEquals ( " ?text" , com.android.ide.common.res2.ValueXmlHelper.unescapeResourceString ( "\" ?text\"" , false , true ) ) ; }
Source:
public void feed ( long offset , long size , com.android.apksigner.core.util.DataSink sink ) throws java.io.IOException { checkChunkValid ( offset , size ) ; int chunkPosition = ( ( int ) ( offset ) ) ; int chunkLimit = ( ( int ) ( chunkPosition + size ) ) ; java.nio.ByteBuffer chunk ; synchronized ( mBuffer ) { mBuffer.position ( 0 ) ; mBuffer.limit ( chunkLimit ) ; mBuffer.position ( chunkPosition ) ; chunk = mBuffer.slice ( ) ; } sink.consume ( chunk ) ; }

Target:
public java.nio.ByteBuffer getByteBuffer ( long offset , int size ) { checkChunkValid ( offset , size ) ; int chunkPosition = ( ( int ) ( offset ) ) ; int chunkLimit = chunkPosition + size ; synchronized ( mBuffer ) { mBuffer.position ( 0 ) ; mBuffer.limit ( chunkLimit ) ; mBuffer.position ( chunkPosition ) ; return mBuffer.slice ( ) ; } }
Source:
private boolean shouldTurnOffFullNetworkUpdate ( ) { return ( mIsPowerSaveOn ) || ( ( ( ! ( mIsCharging ) ) && ( ! ( mIsScreenOn ) ) ) && ( ! ( mIsTetheringOn ) ) ) ; }

Target:
private boolean shouldTurnOffSignalStrength ( ) { if ( mIsPowerSaveOn ) { return true ; } if ( ( ( mIsCharging ) || ( mIsScreenOn ) ) || ( ( mUpdateModes.get ( TelephonyManager.INDICATION_FILTER_SIGNAL_STRENGTH ) ) == ( android.telephony.TelephonyManager.INDICATION_UPDATE_MODE_IGNORE_SCREEN_OFF ) ) ) { return false ; } return true ; }
Source:
private void responseSetupDataCall ( android.hardware.radio.V1_0.RadioResponseInfo responseInfo , android.hardware.radio.V1_0.SetupDataCallResult dcResponse ) { com.android.internal.telephony.RILRequest rr = mRil.processResponse ( responseInfo ) ; if ( rr != null ) { com.android.internal.telephony.dataconnection.DataCallResponse ret = null ; if ( ( responseInfo.error ) == ( android.hardware.radio.V1_0.RadioError.NONE ) ) { ret = com.android.internal.telephony.RIL.convertHalDc ( dcResponse ) ; com.android.internal.telephony.RadioResponse.sendMessageResponse ( rr.mResult , ret ) ; } mRil.processResponseDone ( rr , responseInfo , ret ) ; } }

Target:
private void responseSetupDataCall ( android.hardware.radio.V1_0.RadioResponseInfo responseInfo , android.hardware.radio.V1_0.SetupDataCallResult setupDataCallResult ) { com.android.internal.telephony.RILRequest rr = mRil.processResponse ( responseInfo ) ; if ( rr != null ) { com.android.internal.telephony.dataconnection.DataCallResponse ret = com.android.internal.telephony.RIL.convertDataCallResult ( setupDataCallResult ) ; if ( ( responseInfo.error ) == ( android.hardware.radio.V1_0.RadioError.NONE ) ) { com.android.internal.telephony.RadioResponse.sendMessageResponse ( rr.mResult , ret ) ; } mRil.processResponseDone ( rr , responseInfo , ret ) ; } }
Source:
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 ) ) ; } }

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.GCM ; } else { throw new java.lang.IllegalArgumentException ( ( "Unknown block mode: " + mode ) ) ; } }
Source:
private static java.security.spec.AlgorithmParameterSpec getAlgorithmParameterSpec ( java.lang.String algorithm ) { if ( ! ( libcore.javax.crypto.CipherTest.isPBE ( algorithm ) ) ) { return null ; } final byte [ ] salt = new byte [ 8 ] ; new java.security.SecureRandom ( ) . nextBytes ( salt ) ; return new javax.crypto.spec.PBEParameterSpec ( salt , 1024 ) ; }

Target:
private static java.security.spec.AlgorithmParameterSpec getDecryptAlgorithmParameterSpec ( java.security.spec.AlgorithmParameterSpec encryptSpec , javax.crypto.Cipher encryptCipher ) { java.lang.String algorithm = encryptCipher.getAlgorithm ( ) . toUpperCase ( java.util.Locale.US ) ; if ( libcore.javax.crypto.CipherTest.isPBE ( algorithm ) ) { return encryptSpec ; } if ( libcore.javax.crypto.CipherTest.isOnlyWrappingAlgorithm ( algorithm ) ) { return null ; } byte [ ] iv = encryptCipher.getIV ( ) ; if ( iv != null ) { return new javax.crypto.spec.IvParameterSpec ( iv ) ; } return null ; }
Source:
public void tearDown ( com.android.tradefed.device.ITestDevice device , com.android.tradefed.build.IBuildInfo buildInfo , java.lang.Throwable e ) throws com.android.tradefed.device.DeviceNotAvailableException { if ( ( mVenvDir ) != null ) { com.android.tradefed.util.FileUtil.recursiveDelete ( mVenvDir ) ; com.android.tradefed.log.LogUtil.CLog.i ( "Deleted the virtual env's temp working dir, %s." , mVenvDir ) ; mVenvDir = null ; } }

Target:
public void tearDown ( com.android.tradefed.device.ITestDevice device , com.android.tradefed.build.IBuildInfo buildInfo , java.lang.Throwable e ) throws com.android.tradefed.device.DeviceNotAvailableException { if ( ( mVenvDir ) != null ) { try { com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer.recursiveDelete ( mVenvDir.toPath ( ) ) ; com.android.tradefed.log.LogUtil.CLog.i ( "Deleted the virtual env's temp working dir, %s." , mVenvDir ) ; } catch ( java.io.IOException exception ) { com.android.tradefed.log.LogUtil.CLog.e ( "Failed to delete %s: %s" , mVenvDir , exception ) ; } mVenvDir = null ; } }
Source:
public boolean updateSubscribe ( short transactionId , android.net.wifi.nan.SubscribeConfig config ) { if ( mIsPublishSession ) { android.util.Log.e ( com.android.server.wifi.nan.WifiNanDiscoverySessionState.TAG , "A PUBLISH session is being used to subscribe" ) ; try { mCallback.onSessionConfigFail ( WifiNanNative.NAN_STATUS_ERROR ) ; } catch ( android.os.RemoteException e ) { android.util.Log.e ( com.android.server.wifi.nan.WifiNanDiscoverySessionState.TAG , ( "updateSubscribe: RemoteException=" + e ) ) ; } return false ; } return com.android.server.wifi.nan.WifiNanNative.getInstance ( ) . subscribe ( transactionId , mPubSubId , config ) ; }

Target:
public boolean updateSubscribe ( short transactionId , android.net.wifi.aware.SubscribeConfig config ) { if ( mIsPublishSession ) { android.util.Log.e ( com.android.server.wifi.aware.WifiAwareDiscoverySessionState.TAG , "A PUBLISH session is being used to subscribe" ) ; try { mCallback.onSessionConfigFail ( WifiAwareNative.AWARE_STATUS_ERROR ) ; } catch ( android.os.RemoteException e ) { android.util.Log.e ( com.android.server.wifi.aware.WifiAwareDiscoverySessionState.TAG , ( "updateSubscribe: RemoteException=" + e ) ) ; } return false ; } return com.android.server.wifi.aware.WifiAwareNative.getInstance ( ) . subscribe ( transactionId , mPubSubId , config ) ; }
Source:
public android.telephony.VisualVoicemailSmsFilterSettings getVisualVoicemailSmsFilterSettings ( java.lang.String packageName , int subId ) { try { com.android.internal.telephony.ITelephony telephony = getITelephony ( ) ; if ( telephony != null ) { return telephony.getSystemVisualVoicemailSmsFilterSettings ( packageName , subId ) ; } } catch ( android.os.RemoteException ex ) { } catch ( java.lang.NullPointerException ex ) { } return null ; }

Target:
public android.telephony.VisualVoicemailSmsFilterSettings getActiveVisualVoicemailSmsFilterSettings ( int subId ) { try { com.android.internal.telephony.ITelephony telephony = getITelephony ( ) ; if ( telephony != null ) { return telephony.getActiveVisualVoicemailSmsFilterSettings ( subId ) ; } } catch ( android.os.RemoteException ex ) { } catch ( java.lang.NullPointerException ex ) { } return null ; }
Source:
public void compileFinalizer ( ) throws java.lang.Exception { java.io.File out = com.android.jack.TestTools.createTempFile ( "out" , ".zip" ) ; java.lang.String classpath = com.android.jack.TestTools.getClasspathAsString ( com.android.jack.compile.androidtree.dalvik.finalizer.FinalizerTest.BOOTCLASSPATH ) ; com.android.jack.TestTools.compileSourceToDex ( new com.android.jack.Options ( ) , com.android.jack.TestTools.getDalvikTestFolder ( "036-finalizer" ) , classpath , out , true ) ; }

Target:
public void compileFinalizer ( ) throws java.lang.Exception { java.io.File out = com.android.jack.TestTools.createTempFile ( "out" , ".zip" ) ; java.lang.String classpath = com.android.jack.TestTools.getClasspathAsString ( com.android.jack.compile.androidtree.dalvik.finalizer.FinalizerTest.BOOTCLASSPATH ) ; com.android.jack.TestTools.compileSourceToDex ( new com.android.jack.Options ( ) , com.android.jack.TestTools.getArtTestFolder ( "036-finalizer" ) , classpath , out , true ) ; }
Source:
public void sendBackgroundScanBandRequest ( ) throws java.lang.Exception { android.net.wifi.WifiScanner.ScanSettings requestSettings = createRequest ( WifiScanner.WIFI_BAND_BOTH , 30000 , 0 , 20 , WifiScanner.REPORT_EVENT_AFTER_EACH_SCAN ) ; com.android.server.wifi.WifiNative.ScanSettings nativeSettings = new com.android.server.wifi.scanner.NativeScanSettingsBuilder ( ) . withBasePeriod ( 30000 ) . withMaxApPerScan ( com.android.server.wifi.scanner.WifiScanningServiceTest.MAX_AP_PER_SCAN ) . withMaxScansToCache ( BackgroundScanScheduler.DEFAULT_MAX_SCANS_TO_BATCH ) . addBucketWithBand ( 30000 , WifiScanner.REPORT_EVENT_AFTER_EACH_SCAN , WifiScanner.WIFI_BAND_BOTH ) . build ( ) ; doSuccessfulBackgroundScan ( requestSettings , nativeSettings ) ; assertEquals ( mWifiMetrics.getBackgroundScanCount ( ) , 1 ) ; }

Target:
public void sendBackgroundScanBandRequest ( ) throws java.lang.Exception { android.net.wifi.WifiScanner.ScanSettings requestSettings = com.android.server.wifi.ScanTestUtil.createRequest ( WifiScanner.WIFI_BAND_BOTH , 30000 , 0 , 20 , WifiScanner.REPORT_EVENT_AFTER_EACH_SCAN ) ; com.android.server.wifi.WifiNative.ScanSettings nativeSettings = new com.android.server.wifi.ScanTestUtil.NativeScanSettingsBuilder ( ) . withBasePeriod ( 30000 ) . withMaxApPerScan ( com.android.server.wifi.scanner.WifiScanningServiceTest.MAX_AP_PER_SCAN ) . withMaxScansToCache ( BackgroundScanScheduler.DEFAULT_MAX_SCANS_TO_BATCH ) . addBucketWithBand ( 30000 , WifiScanner.REPORT_EVENT_AFTER_EACH_SCAN , WifiScanner.WIFI_BAND_BOTH ) . build ( ) ; doSuccessfulBackgroundScan ( requestSettings , nativeSettings ) ; org.junit.Assert.assertEquals ( mWifiMetrics.getBackgroundScanCount ( ) , 1 ) ; }
Source:
public static void increaseAnsweredCount ( android.content.Context context ) { android.content.SharedPreferences sharedPreferences = com.android.dialer.util.DialerUtils.getDefaultSharedPreferenceForDeviceProtectedStorageContext ( context ) ; int answeredCount = sharedPreferences.getInt ( com.android.incallui.answer.impl.hint.AnswerHintFactory.ANSWERED_COUNT_PREFERENCE_KEY , 0 ) ; sharedPreferences.edit ( ) . putInt ( com.android.incallui.answer.impl.hint.AnswerHintFactory.ANSWERED_COUNT_PREFERENCE_KEY , ( answeredCount + 1 ) ) . apply ( ) ; }

Target:
public static void increaseAnsweredCount ( android.content.Context context ) { android.content.SharedPreferences sharedPreferences = com.android.dialer.storage.StorageComponent.get ( context ) . unencryptedSharedPrefs ( ) ; int answeredCount = sharedPreferences.getInt ( com.android.incallui.answer.impl.hint.AnswerHintFactory.ANSWERED_COUNT_PREFERENCE_KEY , 0 ) ; sharedPreferences.edit ( ) . putInt ( com.android.incallui.answer.impl.hint.AnswerHintFactory.ANSWERED_COUNT_PREFERENCE_KEY , ( answeredCount + 1 ) ) . apply ( ) ; }
Source:
public android.icu.util.TimeZone lookupTimeZoneByCountryAndOffset ( java.lang.String countryIso , int offsetSeconds , boolean isDst , long whenMillis , android.icu.util.TimeZone bias ) { libcore.util.CountryTimeZones countryTimeZones = lookupCountryTimeZones ( countryIso ) ; if ( countryTimeZones == null ) { return null ; } return countryTimeZones.lookupByOffsetWithBias ( offsetSeconds , isDst , whenMillis , bias ) ; }

Target:
public android.icu.util.TimeZone lookupTimeZoneByCountryAndOffset ( java.lang.String countryIso , int offsetMillis , boolean isDst , long whenMillis , android.icu.util.TimeZone bias ) { libcore.util.CountryTimeZones countryTimeZones = lookupCountryTimeZones ( countryIso ) ; if ( countryTimeZones == null ) { return null ; } libcore.util.CountryTimeZones.OffsetResult offsetResult = countryTimeZones.lookupByOffsetWithBias ( offsetMillis , isDst , whenMillis , bias ) ; return offsetResult != null ? offsetResult.mTimeZone : null ; }
Source:
private void loadPreferences ( ) { org.eclipse.core.runtime.preferences.IEclipsePreferences prefs = new org.eclipse.core.runtime.preferences.InstanceScope ( ) . getNode ( GlTracePlugin.PLUGIN_ID ) ; mAppPackageToTrace = prefs.get ( com.android.ide.eclipse.gltrace.GLTraceOptionsDialog.PREF_APP_PACKAGE , "" ) ; mActivityToTrace = prefs.get ( com.android.ide.eclipse.gltrace.GLTraceOptionsDialog.PREF_ACTIVITY , "" ) ; mTraceFilePath = prefs.get ( com.android.ide.eclipse.gltrace.GLTraceOptionsDialog.PREF_TRACEFILE , "" ) ; mLastUsedDevice = prefs.get ( com.android.ide.eclipse.gltrace.GLTraceOptionsDialog.PREF_DEVICE , "" ) ; }

Target:
private void loadPreferences ( ) { org.eclipse.core.runtime.preferences.IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode ( GlTracePlugin.PLUGIN_ID ) ; mAppPackageToTrace = prefs.get ( com.android.ide.eclipse.gltrace.GLTraceOptionsDialog.PREF_APP_PACKAGE , "" ) ; mActivityToTrace = prefs.get ( com.android.ide.eclipse.gltrace.GLTraceOptionsDialog.PREF_ACTIVITY , "" ) ; mTraceFilePath = prefs.get ( com.android.ide.eclipse.gltrace.GLTraceOptionsDialog.PREF_TRACEFILE , "" ) ; mLastUsedDevice = prefs.get ( com.android.ide.eclipse.gltrace.GLTraceOptionsDialog.PREF_DEVICE , "" ) ; }
Source:
private void loadStackTrace ( ) throws java.io.IOException { int serialNumber = mInput.readInt ( ) ; int threadSerialNumber = mInput.readInt ( ) ; final int numFrames = mInput.readInt ( ) ; com.android.tools.perflib.heap.StackFrame [ ] frames = new com.android.tools.perflib.heap.StackFrame [ numFrames ] ; for ( int i = 0 ; i < numFrames ; i ++ ) { frames [ i ] = mSnapshot.getStackFrame ( readId ( ) ) ; } com.android.tools.perflib.heap.StackTrace trace = new com.android.tools.perflib.heap.StackTrace ( serialNumber , threadSerialNumber , frames ) ; mSnapshot.addStackTrace ( trace ) ; }

Target:
private void loadStackFrame ( ) throws java.io.IOException { long id = readId ( ) ; java.lang.String methodName = mStrings.get ( readId ( ) ) ; java.lang.String methodSignature = mStrings.get ( readId ( ) ) ; java.lang.String sourceFile = mStrings.get ( readId ( ) ) ; int serial = mInput.readInt ( ) ; int lineNumber = mInput.readInt ( ) ; com.android.tools.perflib.heap.StackFrame frame = new com.android.tools.perflib.heap.StackFrame ( id , methodName , methodSignature , sourceFile , serial , lineNumber ) ; mSnapshot.addStackFrame ( frame ) ; }