auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void stopForegroundCompat ( ) { if ( ( mStopForeground ) != null ) { mStopForegroundArgs [ 0 ] = java.lang.Boolean.TRUE ; try { mStopForeground.invoke ( this , mStopForegroundArgs ) ; } catch ( java.lang.Exception e ) { com.googlecode.android_scripting.Log.e ( e ) ; } return ; } mNotificationManager.cancel ( mNotificationId ) ; setForeground ( false ) ; }

Target:
protected android.app.NotificationManager getNotificationManager ( ) { if ( ( mNotificationManager ) == null ) { mNotificationManager = ( ( android.app.NotificationManager ) ( getSystemService ( com.googlecode.android_scripting.NOTIFICATION_SERVICE ) ) ) ; } return mNotificationManager ; }
Source:
public void testFocusGain ( ) { testSnkPlay ( ) ; streamHandler.handleMessage ( streamHandler.obtainMessage ( A2dpSinkStreamHandler.AUDIO_FOCUS_CHANGE , AudioManager.AUDIOFOCUS_GAIN ) ) ; org.mockito.Mockito.verify ( mockAudioManager , org.mockito.Mockito.times ( 1 ) ) . requestAudioFocus ( org.mockito.Mockito.any ( ) , org.mockito.Mockito.anyInt ( ) , org.mockito.Mockito.anyInt ( ) ) ; org.mockito.Mockito.verify ( mockA2dpSink , org.mockito.Mockito.times ( 2 ) ) . informAudioFocusStateNative ( 1 ) ; org.mockito.Mockito.verify ( mockA2dpSink , org.mockito.Mockito.times ( 2 ) ) . informAudioTrackGainNative ( 1.0F ) ; }

Target:
public void testSrcPlayIot ( ) { org.mockito.Mockito.when ( mockPackageManager.hasSystemFeature ( org.mockito.Mockito.any ( ) ) ) . thenReturn ( true ) ; streamHandler.handleMessage ( streamHandler.obtainMessage ( A2dpSinkStreamHandler.SRC_PLAY ) ) ; org.mockito.Mockito.verify ( mockAudioManager , org.mockito.Mockito.times ( 1 ) ) . requestAudioFocus ( org.mockito.Mockito.any ( ) ) ; org.mockito.Mockito.verify ( mockA2dpSink , org.mockito.Mockito.times ( 1 ) ) . informAudioFocusStateNative ( 1 ) ; org.mockito.Mockito.verify ( mockA2dpSink , org.mockito.Mockito.times ( 1 ) ) . informAudioTrackGainNative ( 1.0F ) ; }
Source:
public void testLintWarningOnGetSignaturesFlagInBitwiseAndExpression ( ) throws java.lang.Exception { assertEquals ( ( "src/test/pkg/GetSignaturesBitwiseAndTest.java:9: Information: Reading app signatures from getPackageInfo: The app signatures could be exploited if not validated properly; see issue explanation for details. [PackageManagerGetSignatures]\n" + ( ( " Integer.MAX_VALUE & PackageManager.GET_SIGNATURES);\n" + " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ) + "0 errors, 1 warnings\n" ) ) , lintProject ( ( "src/test/pkg/GetSignaturesBitwiseAndTest.java.txt" + "=>src/test/pkg/GetSignaturesBitwiseAndTest.java" ) ) ) ; }

Target:
public void testLintWarningOnGetSignaturesFlagInBitwiseAndExpression ( ) throws java.lang.Exception { assertEquals ( ( "src/test/pkg/GetSignaturesBitwiseAndTest.java:9: Information: Reading app signatures from getPackageInfo: The app signatures could be exploited if not validated properly; see issue explanation for details. [PackageManagerGetSignatures]\n" + ( ( " Integer.MAX_VALUE & PackageManager.GET_SIGNATURES);\n" + " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ) + "0 errors, 1 warnings\n" ) ) , lintProject ( java ( "src/test/pkg/GetSignaturesBitwiseAndTest.java" , ( "" + ( ( ( ( ( ( ( ( ( ( "package test.pkg;\n" + "\n" ) + "import android.app.Activity;\n" ) + "import android.content.pm.PackageManager;\n" ) + "\n" ) + "public class GetSignaturesBitwiseAndTest extends Activity {\n" ) + " public void failLintCheck() throws Exception {\n" ) + " getPackageManager().getPackageInfo(\"some.pkg\",\n" ) + " Integer.MAX_VALUE & PackageManager.GET_SIGNATURES);\n" ) + " }\n" ) + "}" ) ) ) ) ) ; }
Source:
public void testProxyingPackagePrivateMethods_AreIntercepted ( ) throws java.lang.Throwable { assertEquals ( "fake result" , proxyFor ( com.google.dexmaker.stock.ProxyBuilderTest.HasPackagePrivateMethod.class ) . build ( ) . result ( ) ) ; }

Target:
public void testProxyingPackagePrivateMethods_NotIntercepted ( ) throws java.lang.Throwable { com.google.dexmaker.stock.ProxyBuilderTest.HasPackagePrivateMethod proxy = proxyFor ( com.google.dexmaker.stock.ProxyBuilderTest.HasPackagePrivateMethod.class ) . build ( ) ; try { proxy.getClass ( ) . getDeclaredMethod ( "result" ) ; fail ( ) ; } catch ( java.lang.NoSuchMethodException expected ) { } try { proxy.result ( ) ; fail ( ) ; } catch ( junit.framework.AssertionFailedError expected ) { } }
Source:
public java.lang.Object [ ] getTestObjects ( ) { java.util.Locale [ ] locales = com.ibm.icu.dev.test.serializable.SerializableTest.getLocales ( ) ; java.lang.String rules = "This is a very odd little set of rules, just for testing, you know..." ; com.ibm.icu.text.StringPrepParseException [ ] exceptions = new com.ibm.icu.text.StringPrepParseException [ locales.length ] ; for ( int i = 0 ; i < ( locales.length ) ; i += 1 ) { exceptions [ i ] = new com.ibm.icu.text.StringPrepParseException ( locales [ i ] . toString ( ) , i , rules , i ) ; } return exceptions ; }

Target:
public java.lang.Object [ ] getTestObjects ( ) { java.util.Locale [ ] locales = com.ibm.icu.dev.test.serializable.SerializableTestUtility.getLocales ( ) ; java.lang.String rules = "This is a very odd little set of rules, just for testing, you know..." ; com.ibm.icu.text.StringPrepParseException [ ] exceptions = new com.ibm.icu.text.StringPrepParseException [ locales.length ] ; for ( int i = 0 ; i < ( locales.length ) ; i += 1 ) { exceptions [ i ] = new com.ibm.icu.text.StringPrepParseException ( locales [ i ] . toString ( ) , i , rules , i ) ; } return exceptions ; }
Source:
public boolean onPreferenceChange ( android.preference.Preference preference , java.lang.Object newValue ) { if ( preference == ( mAutoSelect ) ) { boolean autoSelect = ( ( java.lang.Boolean ) ( newValue ) ) ; selectNetworkAutomatic ( autoSelect ) ; return true ; } return false ; }

Target:
public boolean onPreferenceChange ( android.preference.Preference preference , java.lang.Object newValue ) { if ( preference == ( mAutoSelect ) ) { boolean autoSelect = ( ( java.lang.Boolean ) ( newValue ) ) ; selectNetworkAutomatic ( autoSelect ) ; com.android.internal.logging.MetricsLogger.action ( getContext ( ) , MetricsEvent.ACTION_MOBILE_NETWORK_AUTO_SELECT_NETWORK_TOGGLE , autoSelect ) ; return true ; } return false ; }
Source:
public void testInstallWithWorkingDir ( ) throws java.lang.Exception { java.io.File workingDir = new java.io.File ( testInstallDir , TzDataBundleInstaller.WORKING_DIR_NAME ) ; assertTrue ( workingDir.mkdir ( ) ) ; libcore.tzdata.update2.TzDataBundleInstallerTest.createFile ( new java.io.File ( workingDir , "myFile" ) ) ; libcore.tzdata.update2.ConfigBundle tzData = createValidTzDataBundle ( libcore.tzdata.update2.TzDataBundleInstallerTest.NEW_RULES_VERSION ) ; assertTrue ( installer.install ( tzData.getBundleBytes ( ) ) ) ; assertTzDataInstalled ( tzData ) ; }

Target:
public void testInstallWithWorkingDir ( ) throws java.lang.Exception { java.io.File workingDir = installer.getWorkingDir ( ) ; assertTrue ( workingDir.mkdir ( ) ) ; libcore.tzdata.update2.TzDataBundleInstallerTest.createFile ( new java.io.File ( workingDir , "myFile" ) ) ; libcore.tzdata.update2.ConfigBundle tzData = createValidTzDataBundle ( libcore.tzdata.update2.TzDataBundleInstallerTest.NEW_RULES_VERSION ) ; assertTrue ( installer.install ( tzData.getBundleBytes ( ) ) ) ; assertTzDataInstalled ( tzData ) ; }
Source:
public void testDismissKeyguard_fromShowWhenLocked_notAllowed ( ) throws java.lang.Exception { if ( ! ( isHandheld ( ) ) ) { return ; } gotoKeyguard ( ) ; mAmWmState.waitForKeyguardShowingAndNotOccluded ( mDevice ) ; assertShowingAndNotOccluded ( ) ; launchActivity ( "ShowWhenLockedActivity" ) ; mAmWmState.computeState ( mDevice , new java.lang.String [ ] { "ShowWhenLockedActivity" } ) ; mAmWmState.assertVisibility ( "ShowWhenLockedActivity" , true ) ; assertShowingAndOccluded ( ) ; executeShellCommand ( "am broadcast -a trigger_broadcast --ez dismissKeyguard true" ) ; assertShowingAndOccluded ( ) ; mAmWmState.assertVisibility ( "ShowWhenLockedActivity" , true ) ; }

Target:
public void testDismissKeyguard_fromShowWhenLocked_notAllowed ( ) throws java.lang.Exception { if ( ( ! ( isHandheld ( ) ) ) || ( isUiModeLockedToVrHeadset ( ) ) ) { return ; } gotoKeyguard ( ) ; mAmWmState.waitForKeyguardShowingAndNotOccluded ( mDevice ) ; assertShowingAndNotOccluded ( ) ; launchActivity ( "ShowWhenLockedActivity" ) ; mAmWmState.computeState ( mDevice , new java.lang.String [ ] { "ShowWhenLockedActivity" } ) ; mAmWmState.assertVisibility ( "ShowWhenLockedActivity" , true ) ; assertShowingAndOccluded ( ) ; executeShellCommand ( "am broadcast -a trigger_broadcast --ez dismissKeyguard true" ) ; assertShowingAndOccluded ( ) ; mAmWmState.assertVisibility ( "ShowWhenLockedActivity" , true ) ; }
Source:
public void setEchoSuppressionEnabled ( boolean enabled ) { if ( com.android.internal.telephony.CallManager.VDBG ) { android.telephony.Rlog.d ( com.android.internal.telephony.CallManager.LOG_TAG , ( ( " setEchoSuppression(" + enabled ) + ")" ) ) ; android.telephony.Rlog.d ( com.android.internal.telephony.CallManager.LOG_TAG , toString ( ) ) ; } if ( hasActiveFgCall ( ) ) { getActiveFgCall ( ) . getPhone ( ) . setEchoSuppressionEnabled ( enabled ) ; } if ( com.android.internal.telephony.CallManager.VDBG ) { android.telephony.Rlog.d ( com.android.internal.telephony.CallManager.LOG_TAG , ( ( "End setEchoSuppression(" + enabled ) + ")" ) ) ; android.telephony.Rlog.d ( com.android.internal.telephony.CallManager.LOG_TAG , toString ( ) ) ; } }

Target:
public void setEchoSuppressionEnabled ( ) { if ( com.android.internal.telephony.CallManager.VDBG ) { android.telephony.Rlog.d ( com.android.internal.telephony.CallManager.LOG_TAG , " setEchoSuppression()" ) ; android.telephony.Rlog.d ( com.android.internal.telephony.CallManager.LOG_TAG , toString ( ) ) ; } if ( hasActiveFgCall ( ) ) { getActiveFgCall ( ) . getPhone ( ) . setEchoSuppressionEnabled ( ) ; } if ( com.android.internal.telephony.CallManager.VDBG ) { android.telephony.Rlog.d ( com.android.internal.telephony.CallManager.LOG_TAG , "End setEchoSuppression()" ) ; android.telephony.Rlog.d ( com.android.internal.telephony.CallManager.LOG_TAG , toString ( ) ) ; } }
Source:
protected java.lang.String getCipherName ( int keySize , org.apache.harmony.xnet.provider.jsse.OpenSSLCipher.Mode mode ) { if ( mode == ( org.apache.harmony.xnet.provider.jsse.OpenSSLCipher.Mode.ECB ) ) { return "des-ede" ; } else { return "des-ede-" + ( mode.toString ( ) . toLowerCase ( java.util.Locale.US ) ) ; } }

Target:
protected java.lang.String getCipherName ( int keySize , org.apache.harmony.xnet.provider.jsse.OpenSSLCipher.Mode mode ) { final java.lang.String baseCipherName ; if ( keySize == 16 ) { baseCipherName = "des-ede" ; } else { baseCipherName = "des-ede3" ; } if ( mode == ( org.apache.harmony.xnet.provider.jsse.OpenSSLCipher.Mode.ECB ) ) { return baseCipherName ; } else { return ( baseCipherName + "-" ) + ( mode.toString ( ) . toLowerCase ( java.util.Locale.US ) ) ; } }
Source:
private void ensureServerOpen ( ) throws java.io.IOException { ensureServerClosed ( ) ; this . server1 = new java.net.ServerSocket ( localAddr1.getPort ( ) ) ; this . server2 = new java.net.ServerSocket ( localAddr2.getPort ( ) ) ; assertTrue ( this . server1.isBound ( ) ) ; assertTrue ( this . server2.isBound ( ) ) ; }

Target:
private void ensureServerOpen ( ) throws java.io.IOException { ensureServerClosed ( ) ; this . server1 = new java.net.ServerSocket ( 0 ) ; this . localAddr1 = new java.net.InetSocketAddress ( "127.0.0.1" , server1.getLocalPort ( ) ) ; this . server2 = new java.net.ServerSocket ( 0 ) ; this . localAddr2 = new java.net.InetSocketAddress ( "127.0.0.1" , server2.getLocalPort ( ) ) ; assertTrue ( this . server1.isBound ( ) ) ; assertTrue ( this . server2.isBound ( ) ) ; }
Source:
private boolean isAnnotatedByRuntimeAnnotation ( @ javax.annotation.Nonnull com.android.jack.ir.ast.Annotable annotable ) { for ( com.android.jack.ir.ast.JAnnotation annotation : annotable.getAnnotationTypes ( ) ) { if ( ( annotation instanceof com.android.jack.ir.ast.JDefinedAnnotation ) && ( ( ( ( com.android.jack.ir.ast.JDefinedAnnotation ) ( annotation ) ) . getRetentionPolicy ( ) ) == ( com.android.jack.ir.ast.JRetentionPolicy.RUNTIME ) ) ) { return true ; } } return false ; }

Target:
private boolean isAnnotatedByRuntimeAnnotation ( @ javax.annotation.Nonnull com.android.jack.ir.ast.Annotable annotable ) { for ( com.android.jack.ir.ast.JAnnotationType annotation : annotable.getAnnotationTypes ( ) ) { if ( ( annotation instanceof com.android.jack.ir.ast.JDefinedAnnotationType ) && ( ( ( ( com.android.jack.ir.ast.JDefinedAnnotationType ) ( annotation ) ) . getRetentionPolicy ( ) ) == ( com.android.jack.ir.ast.JRetentionPolicy.RUNTIME ) ) ) { return true ; } } return false ; }
Source:
public boolean hideSoftInputFromWindow ( android.os.IBinder windowToken , int flags , android.os.ResultReceiver resultReceiver ) { checkFocus ( ) ; synchronized ( mH ) { if ( ( ( mServedView ) == null ) || ( ( mServedView.getWindowToken ( ) ) != windowToken ) ) { return false ; } try { return mService.hideSoftInput ( mClient , flags , resultReceiver ) ; } catch ( android.os.RemoteException e ) { } return false ; } }

Target:
public boolean hideSoftInputFromWindow ( android.os.IBinder windowToken , int flags , android.os.ResultReceiver resultReceiver ) { checkFocus ( ) ; synchronized ( mH ) { if ( ( ( mServedView ) == null ) || ( ( mServedView.getWindowToken ( ) ) != windowToken ) ) { return false ; } try { return mService.hideSoftInput ( mClient , flags , resultReceiver ) ; } catch ( android.os.RemoteException e ) { throw e.rethrowFromSystemServer ( ) ; } } }
Source:
public void widgetDefaultSelected ( org.eclipse.swt.events.SelectionEvent e ) { java.lang.Object selection = ( ( org.eclipse.swt.widgets.TreeItem ) ( e.item ) ) . getData ( ) ; if ( selection instanceof com.android.ddmlib.IDevice ) { com.android.hierarchyviewerlib.ComponentRegistry.getDirector ( ) . loadPixelPerfectData ( ( ( com.android.ddmlib.IDevice ) ( selection ) ) ) ; } else if ( selection instanceof com.android.hierarchyviewerlib.device.Window ) { com.android.hierarchyviewerlib.ComponentRegistry.getDirector ( ) . loadViewTreeData ( ( ( com.android.hierarchyviewerlib.device.Window ) ( selection ) ) ) ; } }

Target:
public void widgetDefaultSelected ( org.eclipse.swt.events.SelectionEvent e ) { java.lang.Object selection = ( ( org.eclipse.swt.widgets.TreeItem ) ( e.item ) ) . getData ( ) ; if ( selection instanceof com.android.ddmlib.IDevice ) { com.android.hierarchyviewerlib.HierarchyViewerDirector.getDirector ( ) . loadPixelPerfectData ( ( ( com.android.ddmlib.IDevice ) ( selection ) ) ) ; } else if ( selection instanceof com.android.hierarchyviewerlib.device.Window ) { com.android.hierarchyviewerlib.HierarchyViewerDirector.getDirector ( ) . loadViewTreeData ( ( ( com.android.hierarchyviewerlib.device.Window ) ( selection ) ) ) ; } }
Source:
public void handleEvent ( org.eclipse.swt.widgets.Event event ) { if ( ! ( mInternalApplicationNameUpdate ) ) { mApplicationNameModifiedByUser = true ; } }

Target:
private void onApplicationFieldModified ( ) { if ( ! ( mInternalApplicationNameUpdate ) ) { mApplicationNameModifiedByUser = true ; if ( ! ( mActivityNameModifiedByUser ) ) { java.lang.String name = com.android.ide.eclipse.adt.internal.editors.descriptors.DescriptorsUtils.capitalize ( mApplicationNameField.getText ( ) ) ; try { mInternalActivityNameUpdate = true ; mActivityNameField.setText ( ( name + ( com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectCreationPage.ACTIVITY_NAME_SUFFIX ) ) ) ; } finally { mInternalActivityNameUpdate = false ; } } } }
Source:
private java.security.cert.X509Certificate getCertificateFromResources ( java.lang.String resourceName ) throws java.lang.Exception { try ( java.io.InputStream in = getClass ( ) . getResourceAsStream ( resourceName ) ) { if ( in == null ) { throw new java.lang.IllegalArgumentException ( ( "Resource not found: " + resourceName ) ) ; } return ( ( java.security.cert.X509Certificate ) ( java.security.cert.CertificateFactory.getInstance ( "X.509" ) . generateCertificate ( in ) ) ) ; } }

Target:
private void assertVerifiedForEach ( java.lang.String apkFilenamePatternInResources , java.lang.String [ ] args ) throws java.lang.Exception { assertVerifiedForEach ( apkFilenamePatternInResources , args , null , null ) ; }
Source:
private static void setHandlerInstanceField ( java.lang.Object instance , java.lang.reflect.InvocationHandler handler ) { try { java.lang.reflect.Field handlerField = instance.getClass ( ) . getDeclaredField ( com.google.dexmaker.stock.ProxyBuilder.FIELD_NAME_HANDLER ) ; handlerField.setAccessible ( true ) ; handlerField.set ( instance , handler ) ; } catch ( java.lang.NoSuchFieldException e ) { throw new java.lang.AssertionError ( e ) ; } catch ( java.lang.IllegalAccessException e ) { throw new java.lang.AssertionError ( e ) ; } }

Target:
public static void setInvocationHandler ( java.lang.Object instance , java.lang.reflect.InvocationHandler handler ) { try { java.lang.reflect.Field handlerField = instance.getClass ( ) . getDeclaredField ( com.google.dexmaker.stock.ProxyBuilder.FIELD_NAME_HANDLER ) ; handlerField.setAccessible ( true ) ; handlerField.set ( instance , handler ) ; } catch ( java.lang.NoSuchFieldException e ) { throw new java.lang.IllegalArgumentException ( "Not a valid proxy instance" , e ) ; } catch ( java.lang.IllegalAccessException e ) { throw new java.lang.AssertionError ( e ) ; } }
Source:
synchronized void nAllocationRead2D ( long id , int xoff , int yoff , int mip , int face , int w , int h , java.lang.Object d , int sizeBytes , android.support.v8.renderscript.Element.DataType dt ) { validate ( ) ; rsnAllocationRead2D ( mContext , id , xoff , yoff , mip , face , w , h , d , sizeBytes , dt.mID ) ; }

Target:
synchronized void nAllocationRead1D ( long id , int off , int mip , int count , java.lang.Object d , int sizeBytes , android.support.v8.renderscript.Element.DataType dt , int mSize , boolean usePadding ) { validate ( ) ; rsnAllocationRead1D ( mContext , id , off , mip , count , d , sizeBytes , dt.mID , mSize , usePadding ) ; }
Source:
public void copyFrom ( byte [ ] d ) { mRS.validate ( ) ; if ( ( mCurrentDimZ ) > 0 ) { copy3DRangeFrom ( 0 , 0 , 0 , mCurrentDimX , mCurrentDimY , mCurrentDimZ , d ) ; } else if ( ( mCurrentDimY ) > 0 ) { copy2DRangeFrom ( 0 , 0 , mCurrentDimX , mCurrentDimY , d ) ; } else { copy1DRangeFrom ( 0 , mCurrentCount , d ) ; } }

Target:
public void copyFrom ( float [ ] d ) { validateIsFloat32 ( ) ; copyFromUnchecked ( d , Element.DataType.FLOAT_32 , d.length ) ; }
Source:
private void addIfMissing ( java.lang.Class < ? extends com.android.settings.dashboard.conditional.Condition > clz , java.util.ArrayList < com.android.settings.dashboard.conditional.Condition > conditions ) { if ( ( getCondition ( clz , conditions ) ) == null ) { if ( com.android.settings.dashboard.conditional.ConditionManager.DEBUG ) android.util.Log.d ( com.android.settings.dashboard.conditional.ConditionManager.TAG , ( "Adding missing " + ( clz.getName ( ) ) ) ) ; conditions.add ( createCondition ( clz ) ) ; } }

Target:
private void addIfMissing ( java.lang.Class < ? extends com.android.settings.dashboard.conditional.Condition > clz , java.util.ArrayList < com.android.settings.dashboard.conditional.Condition > conditions ) { if ( ( getCondition ( clz , conditions ) ) == null ) { if ( com.android.settings.dashboard.conditional.ConditionManager.DEBUG ) android.util.Log.d ( com.android.settings.dashboard.conditional.ConditionManager.TAG , ( "Adding missing " + ( clz.getName ( ) ) ) ) ; com.android.settings.dashboard.conditional.Condition condition = createCondition ( clz ) ; if ( condition != null ) { conditions.add ( condition ) ; } } }
Source:
public void enter ( ) { super . enter ( ) ; sendMessageDelayed ( com.android.bluetooth.hfp.HeadsetStateMachine.CONNECT_TIMEOUT , mCurrentDevice , com.android.bluetooth.hfp.HeadsetStateMachine.sConnectTimeoutMillis ) ; if ( ( mPrevState ) == ( mDisconnected ) ) { broadcastConnectionState ( mCurrentDevice , BluetoothProfile.STATE_CONNECTING , BluetoothProfile.STATE_DISCONNECTED ) ; } else { stateLogWtfStack ( ( ( ( "Illegal state transition from " + ( mPrevState ) ) + ", mCurrentDevice=" ) + ( mCurrentDevice ) ) ) ; } }

Target:
int getConnectionStateInt ( ) { return android.bluetooth.BluetoothProfile.STATE_CONNECTING ; }
Source:
private java.io.InputStream fetchXmlUrl ( java.lang.String urlString , com.android.sdklib.internal.repository.DownloadCache cache , com.android.sdklib.internal.repository.ITaskMonitor monitor , java.lang.Exception [ ] outException ) { try { java.io.InputStream xml = cache.openCachedUrl ( urlString , monitor ) ; if ( xml != null ) { xml.mark ( 500000 ) ; xml = new com.android.sdklib.io.NonClosingInputStream ( xml ) ; ( ( com.android.sdklib.io.NonClosingInputStream ) ( xml ) ) . setCloseBehavior ( CloseBehavior.RESET ) ; } return xml ; } catch ( java.lang.Exception e ) { if ( outException != null ) { outException [ 0 ] = e ; } } return null ; }

Target:
private java.io.InputStream fetchXmlUrl ( java.lang.String urlString , com.android.sdklib.internal.repository.DownloadCache cache , com.android.sdklib.internal.repository.ITaskMonitor monitor , java.lang.Exception [ ] outException ) { try { java.io.InputStream xml = cache.openCachedUrl ( urlString , monitor ) ; if ( xml != null ) { xml.mark ( 500000 ) ; xml = new com.android.io.NonClosingInputStream ( xml ) ; ( ( com.android.io.NonClosingInputStream ) ( xml ) ) . setCloseBehavior ( CloseBehavior.RESET ) ; } return xml ; } catch ( java.lang.Exception e ) { if ( outException != null ) { outException [ 0 ] = e ; } } return null ; }
Source:
static com.android.dialer.historyitemactions.HistoryItemPrimaryActionInfo fromVoicemailEntry ( android.content.Context context , com.android.dialer.voicemail.model.VoicemailEntry voicemailEntry ) { return com.android.dialer.historyitemactions.HistoryItemPrimaryActionInfo.builder ( ) . setNumber ( voicemailEntry.getNumber ( ) ) . setPhotoInfo ( com.android.dialer.calllogutils.NumberAttributesConverter.toPhotoInfoBuilder ( voicemailEntry.getNumberAttributes ( ) ) . setFormattedNumber ( voicemailEntry.getFormattedNumber ( ) ) . build ( ) ) . setPrimaryText ( com.android.dialer.voicemail.listui.menu.PrimaryAction.buildPrimaryVoicemailText ( context , voicemailEntry ) ) . setSecondaryText ( com.android.dialer.voicemail.listui.menu.PrimaryAction.buildSecondaryVoicemailText ( voicemailEntry ) ) . build ( ) ; }

Target:
static com.android.dialer.historyitemactions.HistoryItemBottomSheetHeaderInfo fromVoicemailEntry ( com.android.dialer.voicemail.model.VoicemailEntry voicemailEntry ) { return com.android.dialer.historyitemactions.HistoryItemBottomSheetHeaderInfo.newBuilder ( ) . setNumber ( voicemailEntry.getNumber ( ) ) . setPhotoInfo ( com.android.dialer.calllogutils.NumberAttributesConverter.toPhotoInfoBuilder ( voicemailEntry.getNumberAttributes ( ) ) . setFormattedNumber ( voicemailEntry.getFormattedNumber ( ) ) . build ( ) ) . setPrimaryText ( com.android.dialer.voicemail.listui.menu.BottomSheetHeader.buildPrimaryVoicemailText ( voicemailEntry ) ) . setSecondaryText ( com.android.dialer.voicemail.listui.menu.BottomSheetHeader.buildSecondaryVoicemailText ( voicemailEntry ) ) . build ( ) ; }
Source:
public void testStageInstallWithErrorCode_withBadlyFormedRevision ( ) throws java.lang.Exception { libcore.tzdata.shared2.DistroVersion validDistroVersion = new libcore.tzdata.shared2.DistroVersion ( 1 , 1 , libcore.tzdata.update2.TimeZoneDistroInstallerTest.NEW_RULES_VERSION , 1 ) ; byte [ ] invalidRevisionBytes = validDistroVersion.toBytes ( ) ; invalidRevisionBytes [ ( ( invalidRevisionBytes.length ) - 3 ) ] = 'A' ; libcore.tzdata.shared2.TimeZoneDistro distro = libcore.tzdata.update2.TimeZoneDistroInstallerTest.createTimeZoneDistroWithVersionBytes ( invalidRevisionBytes ) ; assertEquals ( TimeZoneDistroInstaller.INSTALL_FAIL_BAD_DISTRO_STRUCTURE , installer.stageInstallWithErrorCode ( distro.getBytes ( ) ) ) ; assertNoDistroOperationStaged ( ) ; assertNoInstalledDistro ( ) ; }

Target:
public void testStageInstallWithErrorCode_withBadlyFormedRevision ( ) throws java.lang.Exception { com.android.timezone.distro.DistroVersion validDistroVersion = new com.android.timezone.distro.DistroVersion ( 1 , 1 , libcore.tzdata.update2.TimeZoneDistroInstallerTest.NEW_RULES_VERSION , 1 ) ; byte [ ] invalidRevisionBytes = validDistroVersion.toBytes ( ) ; invalidRevisionBytes [ ( ( invalidRevisionBytes.length ) - 3 ) ] = 'A' ; com.android.timezone.distro.TimeZoneDistro distro = libcore.tzdata.update2.TimeZoneDistroInstallerTest.createTimeZoneDistroWithVersionBytes ( invalidRevisionBytes ) ; assertEquals ( TimeZoneDistroInstaller.INSTALL_FAIL_BAD_DISTRO_STRUCTURE , installer.stageInstallWithErrorCode ( distro.getBytes ( ) ) ) ; assertNoDistroOperationStaged ( ) ; assertNoInstalledDistro ( ) ; }
Source:
public void testCorrectCertUsedFromPkcs7SignedDataCertsSet ( ) throws java.lang.Exception { com.android.apksig.ApkVerifier.Result result = verify ( "v1-only-pkcs7-cert-bag-first-cert-not-used.apk" ) ; com.android.apksig.ApkVerifierTest.assertVerified ( result ) ; java.util.List < java.security.cert.X509Certificate > signingCerts = result.getSignerCertificates ( ) ; org.junit.Assert.assertEquals ( 1 , signingCerts.size ( ) ) ; org.junit.Assert.assertEquals ( "fb5dbd3c669af9fc236c6991e6387b7f11ff0590997f22d0f5c74ff40e04fca8" , com.android.apksig.internal.test.HexEncoding.encode ( com.android.apksig.ApkVerifierTest.sha256 ( signingCerts.get ( 0 ) . getEncoded ( ) ) ) ) ; }

Target:
public void testCorrectCertUsedFromPkcs7SignedDataCertsSet ( ) throws java.lang.Exception { com.android.apksig.ApkVerifier.Result result = verify ( "v1-only-pkcs7-cert-bag-first-cert-not-used.apk" ) ; com.android.apksig.ApkVerifierTest.assertVerified ( result ) ; java.util.List < java.security.cert.X509Certificate > signingCerts = result.getSignerCertificates ( ) ; org.junit.Assert.assertEquals ( 1 , signingCerts.size ( ) ) ; org.junit.Assert.assertEquals ( "fb5dbd3c669af9fc236c6991e6387b7f11ff0590997f22d0f5c74ff40e04fca8" , com.android.apksig.internal.util.HexEncoding.encode ( com.android.apksig.ApkVerifierTest.sha256 ( signingCerts.get ( 0 ) . getEncoded ( ) ) ) ) ; }
Source:
protected android.app.Fragment onCreateInitialFragment ( ) { com.android.tv.common.ui.setup.SetupFragment fragment = new com.android.tv.tuner.setup.WelcomeFragment ( ) ; fragment.setShortDistance ( ( ( com.android.tv.common.ui.setup.SetupFragment.FRAGMENT_EXIT_TRANSITION ) | ( com.android.tv.common.ui.setup.SetupFragment.FRAGMENT_REENTER_TRANSITION ) ) ) ; return fragment ; }

Target:
protected android.app.Fragment onCreateInitialFragment ( ) { com.android.tv.common.ui.setup.SetupFragment fragment = new com.android.tv.tuner.setup.WelcomeFragment ( ) ; android.os.Bundle args = new android.os.Bundle ( ) ; args.putInt ( com.android.tv.tuner.setup.TunerSetupActivity.KEY_TUNER_TYPE , mTunerType ) ; fragment.setArguments ( args ) ; fragment.setShortDistance ( ( ( com.android.tv.common.ui.setup.SetupFragment.FRAGMENT_EXIT_TRANSITION ) | ( com.android.tv.common.ui.setup.SetupFragment.FRAGMENT_REENTER_TRANSITION ) ) ) ; return fragment ; }
Source:
private void terminateCall ( ) { if ( com.android.bluetooth.hfpclient.HeadsetClientStateMachine.DBG ) { android.util.Log.d ( com.android.bluetooth.hfpclient.HeadsetClientStateMachine.TAG , "terminateCall" ) ; } int action = HeadsetClientHalConstants.CALL_ACTION_CHUP ; android.bluetooth.BluetoothHeadsetClientCall c = getCall ( BluetoothHeadsetClientCall.CALL_STATE_DIALING , BluetoothHeadsetClientCall.CALL_STATE_ALERTING , BluetoothHeadsetClientCall.CALL_STATE_ACTIVE ) ; if ( c != null ) { if ( handleCallActionNative ( action , 0 ) ) { addQueuedAction ( com.android.bluetooth.hfpclient.HeadsetClientStateMachine.TERMINATE_CALL , action ) ; } else { android.util.Log.e ( com.android.bluetooth.hfpclient.HeadsetClientStateMachine.TAG , "ERROR: Couldn't terminate outgoing call" ) ; } } }

Target:
private void terminateCall ( ) { if ( com.android.bluetooth.hfpclient.HeadsetClientStateMachine.DBG ) { android.util.Log.d ( com.android.bluetooth.hfpclient.HeadsetClientStateMachine.TAG , "terminateCall" ) ; } int action = HeadsetClientHalConstants.CALL_ACTION_CHUP ; android.bluetooth.BluetoothHeadsetClientCall c = getCall ( BluetoothHeadsetClientCall.CALL_STATE_DIALING , BluetoothHeadsetClientCall.CALL_STATE_ALERTING , BluetoothHeadsetClientCall.CALL_STATE_ACTIVE ) ; if ( c != null ) { if ( handleCallActionNative ( getByteAddress ( mCurrentDevice ) , action , 0 ) ) { addQueuedAction ( com.android.bluetooth.hfpclient.HeadsetClientStateMachine.TERMINATE_CALL , action ) ; } else { android.util.Log.e ( com.android.bluetooth.hfpclient.HeadsetClientStateMachine.TAG , "ERROR: Couldn't terminate outgoing call" ) ; } } }
Source:
public void configure ( org.bouncycastle.jcajce.provider.config.ConfigurableProvider provider ) { provider.addAlgorithm ( "Mac.SIPHASH" , ( ( org.bouncycastle.jcajce.provider.symmetric.SipHash.Mappings.PREFIX ) + "$Mac" ) ) ; provider.addAlgorithm ( "Alg.Alias.Mac.SIPHASH-2-4" , "SIPHASH" ) ; provider.addAlgorithm ( "Mac.SIPHASH-4-8" , ( ( org.bouncycastle.jcajce.provider.symmetric.SipHash.Mappings.PREFIX ) + "$Mac48" ) ) ; }

Target:
public void configure ( org.bouncycastle.jcajce.provider.config.ConfigurableProvider provider ) { provider.addAlgorithm ( "Mac.SIPHASH-2-4" , ( ( org.bouncycastle.jcajce.provider.symmetric.SipHash.Mappings.PREFIX ) + "$Mac24" ) ) ; provider.addAlgorithm ( "Alg.Alias.Mac.SIPHASH" , "SIPHASH-2-4" ) ; provider.addAlgorithm ( "Mac.SIPHASH-4-8" , ( ( org.bouncycastle.jcajce.provider.symmetric.SipHash.Mappings.PREFIX ) + "$Mac48" ) ) ; provider.addAlgorithm ( "KeyGenerator.SIPHASH" , ( ( org.bouncycastle.jcajce.provider.symmetric.SipHash.Mappings.PREFIX ) + "$KeyGen" ) ) ; provider.addAlgorithm ( "Alg.Alias.KeyGenerator.SIPHASH-2-4" , "SIPHASH" ) ; provider.addAlgorithm ( "Alg.Alias.KeyGenerator.SIPHASH-4-8" , "SIPHASH" ) ; }
Source:
public void test_handshake_failsWithInvalidSCT ( ) throws java.lang.Exception { org.conscrypt.OpenSSLSocketImplTest.TestConnection connection = new org.conscrypt.OpenSSLSocketImplTest.TestConnection ( new java.security.cert.X509Certificate [ ] { cert , ca } , certKey , true ) ; connection.clientHooks.ctVerificationEnabled = true ; connection.serverHooks.sctTLSExtension = org.conscrypt.TestUtils.readTestFile ( "ct-signed-timestamp-list-invalid" ) ; try { connection.doHandshake ( ) ; fail ( "SSLHandshakeException not thrown" ) ; } catch ( java.util.concurrent.ExecutionException e ) { assertEquals ( javax.net.ssl.SSLHandshakeException.class , e.getCause ( ) . getClass ( ) ) ; assertEquals ( java.security.cert.CertificateException.class , e.getCause ( ) . getCause ( ) . getClass ( ) ) ; } }

Target:
public void test_handshake_failsWithMissingSCT ( ) throws java.lang.Exception { org.conscrypt.OpenSSLSocketImplTest.TestConnection connection = new org.conscrypt.OpenSSLSocketImplTest.TestConnection ( new java.security.cert.X509Certificate [ ] { cert , ca } , certKey , true ) ; connection.clientHooks.ctVerificationEnabled = true ; connection.doHandshake ( ) ; assertTrue ( ( ( connection.clientException ) instanceof javax.net.ssl.SSLHandshakeException ) ) ; assertTrue ( ( ( connection.clientException.getCause ( ) ) instanceof java.security.cert.CertificateException ) ) ; }
Source:
public void copyFrom ( int [ ] d ) { mRS.validate ( ) ; if ( ( mCurrentDimZ ) > 0 ) { copy3DRangeFrom ( 0 , 0 , 0 , mCurrentDimX , mCurrentDimY , mCurrentDimZ , d ) ; } else if ( ( mCurrentDimY ) > 0 ) { copy2DRangeFrom ( 0 , 0 , mCurrentDimX , mCurrentDimY , d ) ; } else { copy1DRangeFrom ( 0 , mCurrentCount , d ) ; } }

Target:
public void copyFromUnchecked ( int [ ] d ) { copyFromUnchecked ( d , Element.DataType.SIGNED_32 , d.length ) ; }
Source:
public void answerVideo ( java.lang.String callId , int videoState ) { com.android.internal.os.SomeArgs args = com.android.internal.os.SomeArgs.obtain ( ) ; args.arg1 = callId ; args.argi1 = videoState ; mHandler.obtainMessage ( android.telecom.ConnectionService.MSG_ANSWER_VIDEO , args ) . sendToTarget ( ) ; }

Target:
public void answerVideo ( java.lang.String callId , int videoState , android.telecom.Logging.Session.Info sessionInfo ) { android.telecom.Log.startSession ( sessionInfo , android.telecom.ConnectionService.SESSION_ANSWER_VIDEO ) ; try { com.android.internal.os.SomeArgs args = com.android.internal.os.SomeArgs.obtain ( ) ; args.arg1 = callId ; args.arg2 = android.telecom.Log.createSubsession ( ) ; args.argi1 = videoState ; mHandler.obtainMessage ( android.telecom.ConnectionService.MSG_ANSWER_VIDEO , args ) . sendToTarget ( ) ; } finally { android.telecom.Log.endSession ( ) ; } }
Source:
public void cellInfoList ( int indicationType , java.util.ArrayList < com.android.internal.telephony.V1_0.CellInfo > var2 ) { }

Target:
public void oemHookRaw ( int indicationType , java.util.ArrayList < java.lang.Byte > data ) { mRil.processIndication ( indicationType ) ; byte [ ] response = com.android.internal.telephony.RIL.arrayListToPrimitiveArray ( data ) ; if ( RIL.RILJ_LOGD ) { mRil.unsljLogvRet ( com.android.internal.telephony.RILConstants.RIL_UNSOL_OEM_HOOK_RAW , com.android.internal.telephony.uicc.IccUtils.bytesToHexString ( response ) ) ; } if ( ( mRil.mUnsolOemHookRawRegistrant ) != null ) { mRil.mUnsolOemHookRawRegistrant.notifyRegistrant ( new android.os.AsyncResult ( null , response , null ) ) ; } }
Source:
public void modemReset ( int indicationType , java.lang.String reason ) { mRil.processIndication ( indicationType ) ; if ( RIL.RILJ_LOGD ) mRil.unsljLogRet ( com.android.internal.telephony.RILConstants.RIL_UNSOL_MODEM_RESTART , reason ) ; mRil.writeMetricsModemRestartEvent ( reason ) ; }

Target:
public void modemReset ( int indicationType , java.lang.String reason ) { mRil.processIndication ( indicationType ) ; if ( RIL.RILJ_LOGD ) mRil.unsljLogRet ( com.android.internal.telephony.RILConstants.RIL_UNSOL_MODEM_RESTART , reason ) ; mRil.writeMetricsModemRestartEvent ( reason ) ; mRil.mModemResetRegistrants.notifyRegistrants ( new android.os.AsyncResult ( null , reason , null ) ) ; }
Source:
public java.lang.reflect.Type getGenericSuperclass ( ) { libcore.reflect.GenericSignatureParser parser = new libcore.reflect.GenericSignatureParser ( getClassLoader ( ) ) ; parser.parseForClass ( this , getSignatureAttribute ( ) ) ; return libcore.reflect.Types.getType ( parser.superclassType ) ; }

Target:
public java.lang.reflect.Type getGenericSuperclass ( ) { java.lang.reflect.Type superClass = getSuperclass ( ) ; if ( superClass == null ) { return null ; } java.lang.String signature = getSignatureAttribute ( ) ; if ( signature != null ) { libcore.reflect.GenericSignatureParser parser = new libcore.reflect.GenericSignatureParser ( getClassLoader ( ) ) ; parser.parseForClass ( this , getSignatureAttribute ( ) ) ; superClass = parser.superclassType ; } return libcore.reflect.Types.getType ( superClass ) ; }
Source:
public void test_nullLocale ( ) { assertCalendarConfigEquals ( java.util.Calendar.getInstance ( java.util.Locale.getDefault ( ) ) , java.util.Calendar.getInstance ( ( ( java.util.Locale ) ( null ) ) ) ) ; assertCalendarConfigEquals ( java.util.Calendar.getInstance ( java.util.TimeZone.getDefault ( ) , java.util.Locale.getDefault ( ) ) , java.util.Calendar.getInstance ( java.util.TimeZone.getDefault ( ) , null ) ) ; assertCalendarConfigEquals ( new java.util.GregorianCalendar ( java.util.Locale.getDefault ( ) ) , new java.util.GregorianCalendar ( ( ( java.util.Locale ) ( null ) ) ) ) ; }

Target:
public void test_nullLocale_getInstance_Locale ( ) { assertCalendarConfigEquals ( java.util.Calendar.getInstance ( java.util.Locale.getDefault ( ) ) , java.util.Calendar.getInstance ( ( ( java.util.Locale ) ( 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 ( ( ( mEnforcingState ) != null ) && ( ! ( mEnforcingState.equals ( com.android.tradefed.targetprep.VtsCoveragePreparer.SELINUX_DISABLED ) ) ) ) { device.executeShellCommand ( ( "setenforce " + ( mEnforcingState ) ) ) ; } if ( ( mDeviceInfoPath ) != null ) { com.android.tradefed.util.FileUtil.recursiveDelete ( mDeviceInfoPath ) ; device.executeShellCommand ( ( "rm -r " + ( com.android.tradefed.targetprep.VtsCoveragePreparer.COVERAGE_CONFIGURE_DST ) ) ) ; } device.executeShellCommand ( java.lang.String.format ( "rm -rf %s/*" , com.android.tradefed.targetprep.VtsCoveragePreparer.COVERAGE_DATA_PATH ) ) ; }

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 ( ( ( mEnforcingState ) != null ) && ( ! ( mEnforcingState.equals ( com.android.tradefed.targetprep.VtsCoveragePreparer.SELINUX_DISABLED ) ) ) ) { device.executeShellCommand ( ( "setenforce " + ( mEnforcingState ) ) ) ; } cleanupCoverageData ( device ) ; }
Source:
public void testNoLauncherCallbackPackageAddedSecondaryUser ( ) throws java.lang.Exception { if ( ! ( mMultiUserSupported ) ) { return ; } startCallbackService ( ) ; installApp ( com.android.cts.devicepolicy.SIMPLE_APP_APK ) ; try { assertTrue ( runDeviceTests ( com.android.cts.devicepolicy.LAUNCHER_TESTS_PKG , com.android.cts.devicepolicy.LAUNCHER_TESTS_CLASS , "testNoPackageAddedCallbackForUser" , 0 , ( "-e testUser " + ( mSecondaryUserSerialNumber ) ) ) ) ; } finally { getDevice ( ) . uninstallPackage ( com.android.cts.devicepolicy.SIMPLE_APP_PKG ) ; } }

Target:
public void testNoLauncherCallbackPackageAddedSecondaryUser ( ) throws java.lang.Exception { if ( ( ! ( mMultiUserSupported ) ) || ( mHasLiveTvFeature ) ) { return ; } startCallbackService ( ) ; installApp ( com.android.cts.devicepolicy.SIMPLE_APP_APK ) ; try { assertTrue ( runDeviceTests ( com.android.cts.devicepolicy.LAUNCHER_TESTS_PKG , com.android.cts.devicepolicy.LAUNCHER_TESTS_CLASS , "testNoPackageAddedCallbackForUser" , 0 , ( "-e testUser " + ( mSecondaryUserSerialNumber ) ) ) ) ; } finally { getDevice ( ) . uninstallPackage ( com.android.cts.devicepolicy.SIMPLE_APP_PKG ) ; } }
Source:
void connectHeadset ( android.bluetooth.HeadsetBase headset , int headsetType ) { mHeadset = headset ; mHeadsetType = headsetType ; if ( ( mHeadsetType ) == ( com.android.phone.BluetoothHandsfree.TYPE_HEADSET ) ) { initializeHeadsetAtParser ( ) ; } else { initializeHandsfreeAtParser ( ) ; } headset.startEventThread ( ) ; configAudioParameters ( ) ; if ( inDebug ( ) ) { startDebug ( ) ; } if ( isIncallAudio ( ) ) { audioOn ( ) ; } }

Target:
void connectHeadset ( android.bluetooth.HeadsetBase headset , int headsetType ) { mHeadset = headset ; mHeadsetType = headsetType ; if ( ( mHeadsetType ) == ( com.android.phone.BluetoothHandsfree.TYPE_HEADSET ) ) { initializeHeadsetAtParser ( ) ; } else { initializeHandsfreeAtParser ( ) ; } registerAllVendorSpecificCommands ( ) ; headset.startEventThread ( ) ; configAudioParameters ( ) ; if ( inDebug ( ) ) { startDebug ( ) ; } if ( isIncallAudio ( ) ) { audioOn ( ) ; } }
Source:
public android.security.keymaster.OperationResult finish ( android.os.IBinder token , android.security.keymaster.KeymasterArguments arguments , byte [ ] signature ) { try { return mBinder.finish ( token , arguments , signature ) ; } catch ( android.os.RemoteException e ) { android.util.Log.w ( android.security.KeyStore.TAG , "Cannot connect to keystore" , e ) ; return null ; } }

Target:
public android.security.keymaster.OperationResult finish ( android.os.IBinder token , android.security.keymaster.KeymasterArguments arguments , byte [ ] signature , byte [ ] entropy ) { try { return mBinder.finish ( token , arguments , signature , entropy ) ; } catch ( android.os.RemoteException e ) { android.util.Log.w ( android.security.KeyStore.TAG , "Cannot connect to keystore" , e ) ; return null ; } }
Source:
public void testGrant_Generated_Success ( ) throws java.lang.Exception { assertTrue ( "Password should work for keystore" , mKeyStore.password ( android.security.KeyStoreTest.TEST_PASSWD ) ) ; assertTrue ( "Should be able to generate key for testcase" , mKeyStore.generate ( android.security.KeyStoreTest.TEST_KEYNAME , KeyStore.UID_SELF , NativeCrypto.EVP_PKEY_RSA , android.security.KeyStoreTest.RSA_KEY_SIZE , KeyStore.FLAG_ENCRYPTED , null ) ) ; assertTrue ( "Should be able to grant key to other user" , mKeyStore.grant ( android.security.KeyStoreTest.TEST_KEYNAME , 0 ) ) ; }

Target:
public void testGrant_Generated_Success ( ) throws java.lang.Exception { assertTrue ( "Password should work for keystore" , mKeyStore.password ( android.security.KeyStoreTest.TEST_PASSWD ) ) ; assertTrue ( "Should be able to generate key for testcase" , mKeyStore.generate ( android.security.KeyStoreTest.TEST_KEYNAME , KeyStore.UID_SELF , NativeConstants.EVP_PKEY_RSA , android.security.KeyStoreTest.RSA_KEY_SIZE , KeyStore.FLAG_ENCRYPTED , null ) ) ; assertTrue ( "Should be able to grant key to other user" , mKeyStore.grant ( android.security.KeyStoreTest.TEST_KEYNAME , 0 ) ) ; }
Source:
public void scheduleAtFixedRate ( java.util.TimerTask task , java.util.Date when , long period ) { if ( ( period <= 0 ) || ( ( when.getTime ( ) ) < 0 ) ) { throw new java.lang.IllegalArgumentException ( ) ; } long delay = ( when.getTime ( ) ) - ( java.lang.System.currentTimeMillis ( ) ) ; scheduleImpl ( task , delay , period , true ) ; }

Target:
public void schedule ( java.util.TimerTask task , long delay ) { validateScheduling ( task , java.util.Timer.VALID_DATE , delay , 1 ) ; doSchedule ( task , ( ( java.lang.System.currentTimeMillis ( ) ) + delay ) , null ) ; }
Source:
public java.lang.String toString ( ) { return new java.lang.StringBuilder ( android.telephony.CellIdentityTdscdma.TAG ) . append ( ":{ mMcc=" ) . append ( mMccStr ) . append ( " mMnc=" ) . append ( mMncStr ) . append ( " mLac=" ) . append ( mLac ) . append ( " mCid=" ) . append ( mCid ) . append ( " mCpid=" ) . append ( mCpid ) . append ( "}" ) . toString ( ) ; }

Target:
public java.lang.String toString ( ) { return new java.lang.StringBuilder ( android.telephony.CellIdentityTdscdma.TAG ) . append ( ":{ mMcc=" ) . append ( mMccStr ) . append ( " mMnc=" ) . append ( mMncStr ) . append ( " mLac=" ) . append ( mLac ) . append ( " mCid=" ) . append ( mCid ) . append ( " mCpid=" ) . append ( mCpid ) . append ( " mAlphaLong=" ) . append ( mAlphaLong ) . append ( " mAlphaShort=" ) . append ( mAlphaShort ) . append ( "}" ) . toString ( ) ; }
Source:
private static java.lang.String getDeclarationTypeString ( org.eclipse.jdt.core.dom.BodyDeclaration bodyDeclaration ) { java.lang.String typeString = com.google.currysrc.api.transform.ast.BodyDeclarationLocaters.NODE_TYPE_TO_STRING_NAME.get ( bodyDeclaration.getNodeType ( ) ) ; if ( typeString == null ) { throw new java.lang.IllegalArgumentException ( ( "Unsupported node type: " + bodyDeclaration ) ) ; } return typeString ; }

Target:
public static java.util.List < java.lang.String > toLocaterStringForms ( org.eclipse.jdt.core.dom.BodyDeclaration bodyDeclaration ) { java.util.List < com.google.currysrc.api.transform.ast.BodyDeclarationLocater > locaters = com.google.currysrc.api.transform.ast.BodyDeclarationLocaters.createLocaters ( bodyDeclaration ) ; java.util.List < java.lang.String > stringForms = new java.util.ArrayList ( locaters.size ( ) ) ; for ( com.google.currysrc.api.transform.ast.BodyDeclarationLocater locater : locaters ) { stringForms.add ( ( ( ( locater.getStringFormType ( ) ) + ":" ) + ( locater.getStringFormTarget ( ) ) ) ) ; } return stringForms ; }
Source:
public boolean setNetworkSelectionModeManual ( int subId , com.android.internal.telephony.OperatorInfo operator , boolean persistSelection ) { try { com.android.internal.telephony.ITelephony telephony = getITelephony ( ) ; if ( telephony != null ) return telephony.setNetworkSelectionModeManual ( subId , operator , persistSelection ) ; } catch ( android.os.RemoteException ex ) { android.telephony.Rlog.e ( android.telephony.TelephonyManager.TAG , "setNetworkSelectionModeManual RemoteException" , ex ) ; } catch ( java.lang.NullPointerException ex ) { android.telephony.Rlog.e ( android.telephony.TelephonyManager.TAG , "setNetworkSelectionModeManual NPE" , ex ) ; } return false ; }

Target:
private java.lang.String getNaiBySubscriberId ( int subId ) { try { com.android.internal.telephony.IPhoneSubInfo info = getSubscriberInfo ( ) ; if ( info == null ) return null ; java.lang.String nai = info.getNaiForSubscriber ( subId , mContext.getOpPackageName ( ) ) ; if ( android.util.Log.isLoggable ( android.telephony.TelephonyManager.TAG , Log.VERBOSE ) ) { android.telephony.Rlog.v ( android.telephony.TelephonyManager.TAG , ( "Nai = " + nai ) ) ; } return nai ; } catch ( android.os.RemoteException ex ) { return null ; } catch ( java.lang.NullPointerException ex ) { return null ; } }
Source:
private static java.math.BigInteger fieldElement2Integer ( java.math.BigInteger n , org.bouncycastle.math.ec.ECFieldElement fieldElement ) { java.math.BigInteger num = fieldElement.toBigInteger ( ) ; while ( ( num.bitLength ( ) ) >= ( n.bitLength ( ) ) ) { num = num.clearBit ( ( ( num.bitLength ( ) ) - 1 ) ) ; } return num ; }

Target:
private static java.math.BigInteger truncate ( java.math.BigInteger x , int bitLength ) { if ( ( x.bitLength ( ) ) > bitLength ) { x = x.mod ( org.bouncycastle.crypto.signers.DSTU4145Signer.ONE.shiftLeft ( bitLength ) ) ; } return x ; }
Source:
public void run ( ) { mTestRunner = new com.android.ide.eclipse.adt.internal.launch.junit.runtime.RemoteAdtTestRunner ( ) ; mTestRunner.runTests ( mRunConfig.getProgramArguments ( ) , mJUnitInfo ) ; }

Target:
public void run ( ) { if ( ( org.eclipse.swt.widgets.Display.getCurrent ( ) ) != null ) { com.android.ide.eclipse.adt.AdtPlugin.log ( IStatus.ERROR , "Adt test runner executed on UI thread" ) ; com.android.ide.eclipse.adt.AdtPlugin.printErrorToConsole ( mJUnitInfo.getProject ( ) , "Test launch failed due to internal error: Running tests on UI thread" ) ; terminate ( ) ; return ; } mTestRunner = new com.android.ide.eclipse.adt.internal.launch.junit.runtime.RemoteAdtTestRunner ( ) ; mTestRunner.runTests ( mRunConfig.getProgramArguments ( ) , mJUnitInfo ) ; }
Source:
public void onUEvent ( android.os.UEventObserver.UEvent event ) { android.util.Log.v ( com.android.server.HeadsetObserver.TAG , ( "Headset UEVENT: " + ( event.toString ( ) ) ) ) ; try { update ( event.get ( "SWITCH_NAME" ) , java.lang.Integer.parseInt ( event.get ( "SWITCH_STATE" ) ) ) ; } catch ( java.lang.NumberFormatException e ) { android.util.Log.e ( com.android.server.HeadsetObserver.TAG , ( "Could not parse switch state from event " + event ) ) ; } }

Target:
public void onUEvent ( android.os.UEventObserver.UEvent event ) { if ( com.android.server.HeadsetObserver.LOG ) android.util.Log.v ( com.android.server.HeadsetObserver.TAG , ( "Headset UEVENT: " + ( event.toString ( ) ) ) ) ; try { update ( event.get ( "SWITCH_NAME" ) , java.lang.Integer.parseInt ( event.get ( "SWITCH_STATE" ) ) ) ; } catch ( java.lang.NumberFormatException e ) { android.util.Log.e ( com.android.server.HeadsetObserver.TAG , ( "Could not parse switch state from event " + event ) ) ; } }
Source:
public char [ ] formatLong ( long value , java.text.FieldPosition field ) { libcore.icu.NativeDecimalFormat.FieldPositionIterator fpi = libcore.icu.NativeDecimalFormat.FieldPositionIterator.forFieldPosition ( field ) ; char [ ] result = libcore.icu.NativeDecimalFormat.formatLong ( this . address , value , fpi ) ; if ( fpi != null ) { libcore.icu.NativeDecimalFormat.FieldPositionIterator.setFieldPosition ( fpi , field ) ; } return result ; }

Target:
public char [ ] formatLong ( long value , java.text.FieldPosition field ) { libcore.icu.NativeDecimalFormat.FieldPositionIterator fpi = libcore.icu.NativeDecimalFormat.FieldPositionIterator.forFieldPosition ( field ) ; char [ ] result = libcore.icu.NativeDecimalFormat.formatLong ( this . address , value , fpi ) ; if ( ( fpi != null ) && ( field != null ) ) { libcore.icu.NativeDecimalFormat.updateFieldPosition ( field , fpi ) ; } return result ; }