auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static boolean isWfcProvisionedOnDevice ( android.content.Context context ) { if ( com.android.ims.ImsManager.getBooleanCarrierConfig ( context , CarrierConfigManager.KEY_CARRIER_VOLTE_PROVISIONING_REQUIRED_BOOL ) ) { com.android.ims.ImsManager mgr = com.android.ims.ImsManager.getInstance ( context , android.telephony.SubscriptionManager.getDefaultVoicePhoneId ( ) ) ; if ( mgr != null ) { return mgr.isWfcProvisioned ( ) ; } } return true ; }

Target:
public static boolean isWfcProvisionedOnDevice ( android.content.Context context ) { if ( com.android.ims.ImsManager.getBooleanCarrierConfig ( context , CarrierConfigManager.KEY_CARRIER_VOLTE_OVERRIDE_WFC_PROVISIONING_BOOL ) ) { if ( ! ( com.android.ims.ImsManager.isVolteProvisionedOnDevice ( context ) ) ) { return false ; } } if ( com.android.ims.ImsManager.getBooleanCarrierConfig ( context , CarrierConfigManager.KEY_CARRIER_VOLTE_PROVISIONING_REQUIRED_BOOL ) ) { com.android.ims.ImsManager mgr = com.android.ims.ImsManager.getInstance ( context , android.telephony.SubscriptionManager.getDefaultVoicePhoneId ( ) ) ; if ( mgr != null ) { return mgr.isWfcProvisioned ( ) ; } } return true ; }
Source:
public byte [ ] iccExchangeSimIO ( int fileID , int command , int p1 , int p2 , int p3 , java.lang.String filePath ) { try { com.android.internal.telephony.ITelephony telephony = getITelephony ( ) ; if ( telephony != null ) return telephony.iccExchangeSimIO ( fileID , command , p1 , p2 , p3 , filePath ) ; } catch ( android.os.RemoteException ex ) { } catch ( java.lang.NullPointerException ex ) { } return null ; }

Target:
public void sendVisualVoicemailSmsForSubscriber ( int subId , java.lang.String number , int port , java.lang.String text , android.app.PendingIntent sentIntent ) { try { com.android.internal.telephony.ITelephony telephony = getITelephony ( ) ; if ( telephony != null ) { telephony.sendVisualVoicemailSmsForSubscriber ( mContext.getOpPackageName ( ) , subId , number , port , text , sentIntent ) ; } } catch ( android.os.RemoteException ex ) { } }
Source:
public void subscribe ( @ android.annotation.NonNull android.net.wifi.aware.SubscribeConfig subscribeConfig , @ android.annotation.NonNull android.net.wifi.aware.WifiAwareDiscoverySessionCallback callback , @ android.annotation.Nullable android.os.Handler handler ) { android.net.wifi.aware.WifiAwareManager mgr = mMgr.get ( ) ; if ( mgr == null ) { android.util.Log.e ( android.net.wifi.aware.WifiAwareSession.TAG , "publish: called post GC on WifiAwareManager" ) ; return ; } if ( mTerminated ) { android.util.Log.e ( android.net.wifi.aware.WifiAwareSession.TAG , "publish: called after termination" ) ; return ; } mgr.subscribe ( mClientId , ( handler == null ? android.os.Looper.getMainLooper ( ) : handler.getLooper ( ) ) , subscribeConfig , callback ) ; }

Target:
public void subscribe ( @ android.annotation.NonNull android.net.wifi.aware.SubscribeConfig subscribeConfig , @ android.annotation.NonNull android.net.wifi.aware.DiscoverySessionCallback callback , @ android.annotation.Nullable android.os.Handler handler ) { android.net.wifi.aware.WifiAwareManager mgr = mMgr.get ( ) ; if ( mgr == null ) { android.util.Log.e ( android.net.wifi.aware.WifiAwareSession.TAG , "publish: called post GC on WifiAwareManager" ) ; return ; } if ( mTerminated ) { android.util.Log.e ( android.net.wifi.aware.WifiAwareSession.TAG , "publish: called after termination" ) ; return ; } mgr.subscribe ( mClientId , ( handler == null ? android.os.Looper.getMainLooper ( ) : handler.getLooper ( ) ) , subscribeConfig , callback ) ; }
Source:
public void testSetIconWithParamDrawable ( ) throws java.lang.Throwable { runTestOnUiThread ( new java.lang.Runnable ( ) { public void run ( ) { mDrawable = mContext.getResources ( ) . getDrawable ( R.drawable.btn_check_on ) ; mBuilder = new android.app.AlertDialog.Builder ( mContext ) ; mBuilder.setIcon ( mDrawable ) ; mDialog = mBuilder.show ( ) ; } } ) ; mInstrumentation.waitForIdleSync ( ) ; }

Target:
public void testSetIconWithParamDrawable ( ) throws java.lang.Throwable { runTestOnUiThread ( new java.lang.Runnable ( ) { public void run ( ) { mDrawable = mContext.getResources ( ) . getDrawable ( android.R.drawable.btn_default ) ; mBuilder = new android.app.AlertDialog.Builder ( mContext ) ; mBuilder.setIcon ( mDrawable ) ; mDialog = mBuilder.show ( ) ; } } ) ; mInstrumentation.waitForIdleSync ( ) ; }
Source:
public void addTo ( java.lang.String name , java.lang.String address ) { if ( ( this . to ) == null ) this . to = new java.util.ArrayList < android.text.util.Rfc822Token > ( 1 ) ; this . to.add ( new android.text.util.Rfc822Token ( name , address , null ) ) ; }

Target:
public void addTo ( java.lang.String name , java.lang.String address ) { if ( ( this . mTo ) == null ) this . mTo = new java.util.ArrayList < android.text.util.Rfc822Token > ( 1 ) ; this . mTo.add ( new android.text.util.Rfc822Token ( name , address , null ) ) ; }
Source:
public static boolean isAdtProjectDir ( @ com.android.annotations.Nullable java.io.File file ) { return ( com.android.tools.gradle.eclipse.GradleImport.isEclipseProjectDir ( file ) ) && ( new java.io.File ( file , com.android.SdkConstants.ANDROID_MANIFEST_XML ) . exists ( ) ) ; }

Target:
public static boolean isAdtProjectDir ( @ com.android.annotations.Nullable java.io.File file ) { return ( new java.io.File ( file , com.android.SdkConstants.ANDROID_MANIFEST_XML ) . exists ( ) ) && ( ( com.android.tools.gradle.eclipse.GradleImport.isEclipseProjectDir ( file ) ) || ( ( new java.io.File ( file , com.android.SdkConstants.FD_RES ) . exists ( ) ) && ( new java.io.File ( file , com.android.SdkConstants.FD_SOURCES ) . exists ( ) ) ) ) ; }
Source:
private boolean handleAbiListQuery ( ) { try { final byte [ ] abiListBytes = abiList.getBytes ( java.nio.charset.StandardCharsets.US_ASCII ) ; mSocketOutStream.writeInt ( abiListBytes.length ) ; mSocketOutStream.write ( abiListBytes ) ; return false ; } catch ( java.io.IOException ioe ) { android.util.Log.e ( com.android.internal.os.ZygoteConnection.TAG , "Error writing to command socket" , ioe ) ; return true ; } }

Target:
private void handleAbiListQuery ( ) { try { final byte [ ] abiListBytes = abiList.getBytes ( java.nio.charset.StandardCharsets.US_ASCII ) ; mSocketOutStream.writeInt ( abiListBytes.length ) ; mSocketOutStream.write ( abiListBytes ) ; } catch ( java.io.IOException ioe ) { throw new java.lang.IllegalStateException ( "Error writing to command socket" , ioe ) ; } }
Source:
public void testCheckFilesExist ( ) throws java.lang.Exception { java.io.File dir = createTempDir ( ) ; createRegularFile ( dir , "exists1" ) ; java.io.File subDir = createDir ( dir , "subDir" ) ; createRegularFile ( subDir , "exists2" ) ; assertTrue ( libcore.tzdata.update2.FileUtils.filesExist ( dir , "exists1" , "subDir/exists2" ) ) ; assertFalse ( libcore.tzdata.update2.FileUtils.filesExist ( dir , "doesNotExist" ) ) ; assertFalse ( libcore.tzdata.update2.FileUtils.filesExist ( dir , "subDir/doesNotExist" ) ) ; }

Target:
public void testCheckFilesExist ( ) throws java.lang.Exception { java.io.File dir = createTempDir ( ) ; createRegularFile ( dir , "exists1" ) ; java.io.File subDir = createDir ( dir , "subDir" ) ; createRegularFile ( subDir , "exists2" ) ; assertTrue ( libcore.tzdata.shared2.FileUtils.filesExist ( dir , "exists1" , "subDir/exists2" ) ) ; assertFalse ( libcore.tzdata.shared2.FileUtils.filesExist ( dir , "doesNotExist" ) ) ; assertFalse ( libcore.tzdata.shared2.FileUtils.filesExist ( dir , "subDir/doesNotExist" ) ) ; }
Source:
public static int ioctlInt ( java.io.FileDescriptor fd , int cmd , android.system.Int32Ref arg ) throws android.system.ErrnoException { android.util.MutableInt internalArg = new android.util.MutableInt ( arg.value ) ; try { return Libcore.os.ioctlInt ( fd , cmd , internalArg ) ; } finally { arg.value = internalArg.value ; } }

Target:
public static int ioctlInt ( java.io.FileDescriptor fd , int cmd , android.system.Int32Ref arg ) throws android.system.ErrnoException { android.system.MutableInt internalArg = new android.system.MutableInt ( arg.value ) ; try { return Libcore.os.ioctlInt ( fd , cmd , internalArg ) ; } finally { arg.value = internalArg.value ; } }
Source:
public final void testLocalSdkTest_getPkgInfo_PlatformTools ( ) { assertNull ( mLS.getPkgInfo ( LocalSdk.PKG_PLATFORM_TOOLS ) ) ; mLS.clearLocalPkg ( LocalSdk.PKG_ALL ) ; mFOp.recordExistingFolder ( "/sdk/platform-tools" ) ; mFOp.recordExistingFile ( "/sdk/platform-tools/source.properties" , ( "Pkg.License=Terms and Conditions\n" + ( ( ( ( "Archive.Os=WINDOWS\n" + "Pkg.Revision=18.19.20\n" ) + "Pkg.LicenseRef=android-sdk-license\n" ) + "Archive.Arch=ANY\n" ) + "Pkg.SourceUrl=https\\://dl-ssl.google.com/android/repository/repository-8.xml" ) ) ) ; com.android.sdklib.repository.local.LocalPkgInfo pi = mLS.getPkgInfo ( LocalSdk.PKG_PLATFORM_TOOLS ) ; assertNotNull ( pi ) ; assertTrue ( ( pi instanceof com.android.sdklib.repository.local.LocalPlatformToolPkgInfo ) ) ; assertEquals ( new java.io.File ( "/sdk/platform-tools" ) , pi.getLocalDir ( ) ) ; assertSame ( mLS , pi.getLocalSdk ( ) ) ; assertEquals ( null , pi.getLoadError ( ) ) ; assertEquals ( new com.android.sdklib.repository.FullRevision ( 18 , 19 , 20 ) , pi.getFullRevision ( ) ) ; assertEquals ( "<LocalPlatformToolPkgInfo FullRev=18.19.20>" , pi.toString ( ) ) ; java.lang.Package pkg = pi.getPackage ( ) ; assertNotNull ( pkg ) ; }

Target:
public final void testLocalSdkTest_getPkgInfo_PlatformTools ( ) { assertNull ( mLS.getPkgInfo ( PkgType.PKG_PLATFORM_TOOLS ) ) ; mLS.clearLocalPkg ( PkgType.PKG_ALL ) ; mFOp.recordExistingFolder ( "/sdk/platform-tools" ) ; mFOp.recordExistingFile ( "/sdk/platform-tools/source.properties" , ( "Pkg.License=Terms and Conditions\n" + ( ( ( ( "Archive.Os=WINDOWS\n" + "Pkg.Revision=18.19.20\n" ) + "Pkg.LicenseRef=android-sdk-license\n" ) + "Archive.Arch=ANY\n" ) + "Pkg.SourceUrl=https\\://dl-ssl.google.com/android/repository/repository-8.xml" ) ) ) ; com.android.sdklib.repository.local.LocalPkgInfo pi = mLS.getPkgInfo ( PkgType.PKG_PLATFORM_TOOLS ) ; assertNotNull ( pi ) ; assertTrue ( ( pi instanceof com.android.sdklib.repository.local.LocalPlatformToolPkgInfo ) ) ; assertEquals ( new java.io.File ( "/sdk/platform-tools" ) , pi.getLocalDir ( ) ) ; assertSame ( mLS , pi.getLocalSdk ( ) ) ; assertEquals ( null , pi.getLoadError ( ) ) ; assertEquals ( new com.android.sdklib.repository.FullRevision ( 18 , 19 , 20 ) , pi.getDesc ( ) . getFullRevision ( ) ) ; assertEquals ( "<LocalPlatformToolPkgInfo:PkgDesc FullRev=18.19.20>" , pi.toString ( ) ) ; java.lang.Package pkg = pi.getPackage ( ) ; assertNotNull ( pkg ) ; }
Source:
private java.lang.String normalizeWord ( java.lang.String word ) { switch ( this ) { case LOWER_HYPHEN : return com.google.common.base.Ascii.toLowerCase ( word ) ; case LOWER_UNDERSCORE : return com.google.common.base.Ascii.toLowerCase ( word ) ; case LOWER_CAMEL : return com.google.common.base.CaseFormat.firstCharOnlyToUpper ( word ) ; case UPPER_CAMEL : return com.google.common.base.CaseFormat.firstCharOnlyToUpper ( word ) ; case UPPER_UNDERSCORE : return com.google.common.base.Ascii.toUpperCase ( word ) ; } throw new java.lang.RuntimeException ( ( "unknown case: " + ( this ) ) ) ; }

Target:
public int hashCode ( ) { return ( sourceFormat.hashCode ( ) ) ^ ( targetFormat.hashCode ( ) ) ; }
Source:
private static java.util.List < com.intellij.execution.impl.BeforeRunTask > getCopies ( java.util.List < com.intellij.execution.impl.BeforeRunTask > original ) { java.util.List < com.intellij.execution.impl.BeforeRunTask > result = new java.util.ArrayList < com.intellij.execution.impl.BeforeRunTask > ( ) ; if ( original != null ) { for ( com.intellij.execution.impl.BeforeRunTask task : original ) { if ( ! ( task.isEnabled ( ) ) ) continue ; result.add ( task.clone ( ) ) ; } } return result ; }

Target:
private static java.util.List < com.intellij.execution.impl.BeforeRunTask > getCopies ( @ org.jetbrains.annotations.NotNull java.util.List < com.intellij.execution.impl.BeforeRunTask > original ) { java.util.List < com.intellij.execution.impl.BeforeRunTask > result = new com.intellij.util.SmartList < com.intellij.execution.impl.BeforeRunTask > ( ) ; for ( com.intellij.execution.impl.BeforeRunTask task : original ) { if ( task.isEnabled ( ) ) { result.add ( task.clone ( ) ) ; } } return result ; }
Source:
protected void doBuildPatchFile ( java.io.File olderFile , java.io.File newerFile , java.util.zip.ZipOutputStream patchOutput ) throws java.io.IOException { Runner.logger.info ( "building PatchFile" ) ; patchOutput.putNextEntry ( new java.util.zip.ZipEntry ( myPath ) ) ; writeExecutableFlag ( patchOutput , newerFile ) ; com.intellij.updater.Utils.copyFileToStream ( newerFile , patchOutput ) ; patchOutput.closeEntry ( ) ; }

Target:
protected void doBuildPatchFile ( java.io.File olderFile , java.io.File newerFile , java.util.zip.ZipOutputStream patchOutput ) throws java.io.IOException { Runner.logger.info ( "building PatchFile" ) ; patchOutput.putNextEntry ( new java.util.zip.ZipEntry ( myPath ) ) ; if ( ! ( newerFile.isDirectory ( ) ) ) { writeExecutableFlag ( patchOutput , newerFile ) ; com.intellij.updater.Utils.copyFileToStream ( newerFile , patchOutput ) ; } patchOutput.closeEntry ( ) ; }
Source:
void setField ( @ javax.annotation.Nonnull org.eclipse.jdt.internal.compiler.lookup.FieldBinding binding , @ javax.annotation.Nonnull com.android.jack.ir.ast.JField field ) { cacheField ( signature ( binding ) , field ) ; }

Target:
private com.android.jack.ir.ast.JMethod findMethod ( @ javax.annotation.Nonnull org.eclipse.jdt.internal.compiler.lookup.MethodBinding binding , @ javax.annotation.Nonnull com.android.jack.ir.ast.JDefinedClassOrInterface enclosingType ) { com.android.jack.ir.ast.JMethod method = null ; java.lang.String paramsSignature = new java.lang.String ( binding.signature ( ) ) ; java.lang.String searchedSignature = ( new java.lang.String ( binding.selector ) ) + paramsSignature ; int paramsCount = com.android.jack.ir.impl.ReferenceMapper.countParams ( paramsSignature ) ; for ( com.android.jack.ir.ast.JMethod existing : enclosingType.getMethods ( ) ) { if ( equals ( paramsCount , searchedSignature , existing ) ) { method = existing ; break ; } } return method ; }
Source:
public void testLauncherCallbackPackageChangedMainUser ( ) throws java.lang.Exception { if ( ! ( mHasLauncherApps ) ) { return ; } installApp ( com.android.cts.devicepolicy.SIMPLE_APP_APK ) ; try { startCallbackService ( ) ; int serialNumber = getUserSerialNumber ( 0 ) ; installApp ( com.android.cts.devicepolicy.SIMPLE_APP_APK ) ; assertTrue ( runDeviceTests ( com.android.cts.devicepolicy.LAUNCHER_TESTS_PKG , com.android.cts.devicepolicy.LAUNCHER_TESTS_CLASS , "testPackageChangedCallbackForUser" , 0 , ( "-e testUser " + serialNumber ) ) ) ; } finally { getDevice ( ) . uninstallPackage ( com.android.cts.devicepolicy.SIMPLE_APP_PKG ) ; } }

Target:
public void testLauncherCallbackPackageChangedMainUser ( ) throws java.lang.Exception { if ( ( ! ( mHasLauncherApps ) ) || ( mHasLiveTvFeature ) ) { return ; } installApp ( com.android.cts.devicepolicy.SIMPLE_APP_APK ) ; try { startCallbackService ( ) ; int serialNumber = getUserSerialNumber ( 0 ) ; installApp ( com.android.cts.devicepolicy.SIMPLE_APP_APK ) ; assertTrue ( runDeviceTests ( com.android.cts.devicepolicy.LAUNCHER_TESTS_PKG , com.android.cts.devicepolicy.LAUNCHER_TESTS_CLASS , "testPackageChangedCallbackForUser" , 0 , ( "-e testUser " + serialNumber ) ) ) ; } finally { getDevice ( ) . uninstallPackage ( com.android.cts.devicepolicy.SIMPLE_APP_PKG ) ; } }
Source:
void start ( final android.os.Bundle icicle , final android.content.Intent intent ) { boolean noCrashRecovery = intent.getBooleanExtra ( com.android.browser.Controller.NO_CRASH_RECOVERY , false ) ; if ( ( icicle != null ) || noCrashRecovery ) { doStart ( icicle , intent , false ) ; } else { mCrashRecoveryHandler.startRecovery ( intent ) ; } }

Target:
public void start ( final android.content.Intent intent ) { android.webkit.WebViewClassic.setShouldMonitorWebCoreThread ( ) ; mCrashRecoveryHandler.startRecovery ( intent ) ; }
Source:
public void test_with_adjustment_OffsetTime ( ) { java.time.OffsetTime test = TEST_11_30_59_500_PONE.with ( java.time.OffsetTime.of ( 13 , 35 , 0 , 0 , tck.java.time.TCKOffsetTime.OFFSET_PTWO ) ) ; org.testng.Assert.assertEquals ( test , java.time.OffsetTime.of ( 13 , 35 , 0 , 0 , tck.java.time.TCKOffsetTime.OFFSET_PTWO ) ) ; }

Target:
public void test_with_adjustment_OffsetTime ( ) { java.time.OffsetTime test = tck.java.time.TCKOffsetTime.TEST_11_30_59_500_PONE.with ( java.time.OffsetTime.of ( 13 , 35 , 0 , 0 , tck.java.time.TCKOffsetTime.OFFSET_PTWO ) ) ; org.testng.Assert.assertEquals ( test , java.time.OffsetTime.of ( 13 , 35 , 0 , 0 , tck.java.time.TCKOffsetTime.OFFSET_PTWO ) ) ; }
Source:
private void responseRadioCapability ( android.hardware.radio.V1_0.RadioResponseInfo responseInfo , com.android.internal.telephony.V1_0.RadioCapability rc ) { com.android.internal.telephony.RILRequest rr = mRil.processResponse ( responseInfo ) ; if ( rr != null ) { com.android.internal.telephony.RadioCapability ret = null ; if ( ( responseInfo.error ) == ( android.hardware.radio.V1_0.RadioError.NONE ) ) { ret = com.android.internal.telephony.RIL.convertHalRadioCapability ( rc , mRil ) ; sendMessageResponse ( rr.mResult , ret ) ; } mRil.processResponseDone ( rr , responseInfo , ret ) ; } }

Target:
private void responseLceData ( android.hardware.radio.V1_0.RadioResponseInfo responseInfo , android.hardware.radio.V1_0.LceDataInfo lceInfo ) { com.android.internal.telephony.RILRequest rr = mRil.processResponse ( responseInfo ) ; if ( rr != null ) { java.util.ArrayList < java.lang.Integer > ret = null ; if ( ( responseInfo.error ) == ( android.hardware.radio.V1_0.RadioError.NONE ) ) { ret = com.android.internal.telephony.RIL.convertHalLceData ( lceInfo , mRil ) ; com.android.internal.telephony.RadioResponse.sendMessageResponse ( rr.mResult , ret ) ; } mRil.processResponseDone ( rr , responseInfo , ret ) ; } }
Source:
public boolean resetUid ( int uid ) { try { mError = mBinder.reset_uid ( uid ) ; return ( mError ) == ( 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 ; } }

Target:
public java.lang.String [ ] saw ( java.lang.String prefix , int uid ) { return list ( prefix , uid ) ; }
Source:
public void showInputMethodPicker ( boolean showAuxiliarySubtypes ) { synchronized ( mH ) { try { final int mode = ( showAuxiliarySubtypes ) ? android.view.inputmethod.InputMethodManager.SHOW_IM_PICKER_MODE_INCLUDE_AUXILIARY_SUBTYPES : android.view.inputmethod.InputMethodManager.SHOW_IM_PICKER_MODE_EXCLUDE_AUXILIARY_SUBTYPES ; mService.showInputMethodPickerFromClient ( mClient , mode ) ; } catch ( android.os.RemoteException e ) { android.util.Log.w ( android.view.inputmethod.InputMethodManager.TAG , ( "IME died: " + ( mCurId ) ) , e ) ; } } }

Target:
public void showInputMethodPicker ( boolean showAuxiliarySubtypes ) { synchronized ( mH ) { try { final int mode = ( showAuxiliarySubtypes ) ? android.view.inputmethod.InputMethodManager.SHOW_IM_PICKER_MODE_INCLUDE_AUXILIARY_SUBTYPES : android.view.inputmethod.InputMethodManager.SHOW_IM_PICKER_MODE_EXCLUDE_AUXILIARY_SUBTYPES ; mService.showInputMethodPickerFromClient ( mClient , mode ) ; } catch ( android.os.RemoteException e ) { throw e.rethrowFromSystemServer ( ) ; } } }
Source:
public void setOutputFile ( @ com.android.annotations.NonNull java.io.File outputFile ) { if ( ( outputs.size ( ) ) > 1 ) { throw new java.lang.RuntimeException ( java.lang.String.format ( "More than one output on variant '%s', cannot call setOutput() on it. Call it on one of its outputs instead." , getName ( ) ) ) ; } plugin.displayDeprecationWarning ( "variant.setOutputFile() is deprecated. Call it on one of variant.getOutputs() instead." ) ; outputs.get ( 0 ) . setOutputFile ( outputFile ) ; }

Target:
public void resValue ( @ com.android.annotations.NonNull java.lang.String type , @ com.android.annotations.NonNull java.lang.String name , @ com.android.annotations.NonNull java.lang.String value ) { getVariantData ( ) . getVariantConfiguration ( ) . addResValue ( type , name , value ) ; }
Source:
public java.net.URL findResource ( java.lang.String name ) { if ( ( ( zipFile ) == null ) || ( ( zipFile.getEntry ( name ) ) == null ) ) { return null ; } try { return new java.net.URL ( ( ( ( "jar:" + ( file.toURL ( ) ) ) + "!/" ) + name ) ) ; } catch ( java.net.MalformedURLException ex ) { throw new java.lang.RuntimeException ( ex ) ; } }

Target:
public java.net.URL findResource ( java.lang.String name ) { maybeInit ( ) ; if ( ( ( zipFile ) == null ) || ( ( zipFile.getEntry ( name ) ) == null ) ) { return null ; } try { return new java.net.URL ( ( ( ( "jar:" + ( file.toURL ( ) ) ) + "!/" ) + name ) ) ; } catch ( java.net.MalformedURLException ex ) { throw new java.lang.RuntimeException ( ex ) ; } }
Source:
public void test1_anyInRange ( ) { int [ ] bits = new int [ 100 ] ; for ( int i = 0 ; i < 100 ; i += 11 ) { assertFalse ( com.android.dx.util._tests.BitsTest.label ( i ) , com.android.dx.util.Bits.anyInRange ( bits , 0 , i ) ) ; } }

Target:
public void test1_anyInRange ( ) { int [ ] bits = new int [ 100 ] ; for ( int i = 0 ; i < 100 ; i += 11 ) { assertFalse ( com.android.dx.util.BitsTest.label ( i ) , com.android.dx.util.Bits.anyInRange ( bits , 0 , i ) ) ; } }
Source:
private void handleUsbAction ( android.content.Intent intent ) { final boolean usbConnected = intent.getBooleanExtra ( android.hardware.usb.UsbManager.USB_CONNECTED , false ) ; final boolean rndisEnabled = intent.getBooleanExtra ( android.hardware.usb.UsbManager.USB_FUNCTION_RNDIS , false ) ; synchronized ( this . mPublicSync ) { mRndisEnabled = rndisEnabled ; if ( ( usbConnected && ( mRndisEnabled ) ) && ( mUsbTetherRequested ) ) { tetherMatchingInterfaces ( true , ConnectivityManager.TETHERING_USB ) ; } mUsbTetherRequested = false ; } }

Target:
private void handleUsbAction ( android.content.Intent intent ) { final boolean usbConnected = intent.getBooleanExtra ( android.hardware.usb.UsbManager.USB_CONNECTED , false ) ; final boolean rndisEnabled = intent.getBooleanExtra ( android.hardware.usb.UsbManager.USB_FUNCTION_RNDIS , false ) ; synchronized ( this . mPublicSync ) { mRndisEnabled = rndisEnabled ; if ( ( usbConnected && ( mRndisEnabled ) ) && ( mUsbTetherRequested ) ) { tetherMatchingInterfaces ( IControlsTethering.STATE_TETHERED , ConnectivityManager.TETHERING_USB ) ; } mUsbTetherRequested = false ; } }
Source:
public void testNoMerging ( ) throws java.lang.Exception { java.io.File master = getProjectDir ( "MasterProject" , "multiproject/main-manifest.xml=>AndroidManifest.xml" , "multiproject/main.properties=>project.properties" , "multiproject/MainCode.java.txt=>src/foo/main/MainCode.java" ) ; java.io.File library = getProjectDir ( "LibraryProject" , "multiproject/library-manifest.xml=>AndroidManifest.xml" , "multiproject/library.properties=>project.properties" , "multiproject/LibraryCode.java.txt=>src/foo/library/LibraryCode.java" , "multiproject/strings.xml=>res/values/strings.xml" ) ; assertEquals ( ( "/LibraryProject/res/values/strings.xml:7: Warning: The resource R.string.string3 appears to be unused [UnusedResources]\n" + ( ( " <string name=\"string3\">String 3</string>\n" + " ~~~~~~~~~~~~~~\n" ) + "0 errors, 1 warnings\n" ) ) , checkLint ( java.util.Arrays.asList ( master , library ) ) . replace ( "/TESTROOT" , "" ) ) ; }

Target:
public void testNoMerging ( ) throws java.lang.Exception { java.io.File master = getProjectDir ( "MasterProject" , "multiproject/main-manifest.xml=>AndroidManifest.xml" , "multiproject/main.properties=>project.properties" , "multiproject/MainCode.java.txt=>src/foo/main/MainCode.java" ) ; java.io.File library = getProjectDir ( "LibraryProject" , "multiproject/library-manifest.xml=>AndroidManifest.xml" , "multiproject/library.properties=>project.properties" , "multiproject/LibraryCode.java.txt=>src/foo/library/LibraryCode.java" , "multiproject/strings.xml=>res/values/strings.xml" ) ; assertEquals ( ( "LibraryProject/res/values/strings.xml:7: Warning: The resource R.string.string3 appears to be unused [UnusedResources]\n" + ( ( " <string name=\"string3\">String 3</string>\n" + " ~~~~~~~~~~~~~~\n" ) + "0 errors, 1 warnings\n" ) ) , checkLint ( java.util.Arrays.asList ( master , library ) ) . replace ( "/TESTROOT/" , "" ) ) ; }
Source:
public void test_wrap_01 ( ) throws java.io.IOException , java.lang.InterruptedException { prepareEngines ( ) ; doHandshake ( ) ; java.nio.ByteBuffer bbs = java.nio.ByteBuffer.allocate ( 100 ) ; java.nio.ByteBuffer bbd = java.nio.ByteBuffer.allocate ( 20000 ) ; clientEngine.engine.wrap ( new java.nio.ByteBuffer [ ] { bbs } , 0 , 1 , bbd ) ; }

Target:
public void test_wrap_01 ( ) throws java.lang.Exception { prepareEngines ( ) ; doHandshake ( ) ; java.nio.ByteBuffer bbs = java.nio.ByteBuffer.allocate ( 100 ) ; java.nio.ByteBuffer bbd = java.nio.ByteBuffer.allocate ( tests.api.javax.net.ssl.SSLEngineTest.MAX_TLS_RECORD_SIZE ) ; clientEngine.engine.wrap ( new java.nio.ByteBuffer [ ] { bbs } , 0 , 1 , bbd ) ; }
Source:
final void get ( short [ ] dst , int dstOffset , int shortCount ) { int byteCount = checkGetBounds ( SizeOf.SHORT , dst.length , dstOffset , shortCount ) ; this . block.peekShortArray ( ( ( offset ) + ( position ) ) , dst , dstOffset , shortCount , order.needsSwap ) ; position += byteCount ; }

Target:
public final java.nio.ByteBuffer get ( byte [ ] dst , int dstOffset , int byteCount ) { checkGetBounds ( 1 , dst.length , dstOffset , byteCount ) ; this . block.peekByteArray ( ( ( offset ) + ( position ) ) , dst , dstOffset , byteCount ) ; position += byteCount ; return this ; }
Source:
public void disconnect ( ) { android.net.wifi.nan.WifiNanManager mgr = mMgr.get ( ) ; if ( mgr == null ) { android.util.Log.w ( android.net.wifi.nan.WifiNanSession.TAG , "disconnect: called post GC on WifiNanManager" ) ; return ; } mgr.disconnect ( mClientId , mBinder ) ; mTerminated = true ; mMgr.clear ( ) ; mCloseGuard.close ( ) ; }

Target:
public void destroy ( ) { android.net.wifi.nan.WifiNanManager mgr = mMgr.get ( ) ; if ( mgr == null ) { android.util.Log.w ( android.net.wifi.nan.WifiNanSession.TAG , "destroy: called post GC on WifiNanManager" ) ; return ; } mgr.disconnect ( mClientId , mBinder ) ; mTerminated = true ; mMgr.clear ( ) ; mCloseGuard.close ( ) ; }
Source:
public void wifiNanSendMessage ( @ com.googlecode.android_scripting.rpc.RpcParameter ( name = "sessionId" , description = "The session ID returned when session" + " was created using publish or subscribe" ) java.lang.Integer sessionId , @ com.googlecode.android_scripting.rpc.RpcParameter ( name = "peerId" , description = "The ID of the peer being communicated " + "with. Obtained from a previous message or match session." ) java.lang.Integer peerId , @ com.googlecode.android_scripting.rpc.RpcParameter ( name = "messageId" , description = "Arbitrary handle used for " + "identification of the message in the message status callbacks" ) java.lang.Integer messageId , @ com.googlecode.android_scripting.rpc.RpcParameter ( name = "message" ) java.lang.String message , @ com.googlecode.android_scripting.rpc.RpcParameter ( name = "retryCount" , description = "Number of retries (0 for none) if " + "transmission fails due to no ACK reception" ) java.lang.Integer retryCount ) throws android.os.RemoteException { android.net.wifi.nan.WifiNanDiscoveryBaseSession session ; synchronized ( mLock ) { session = mDiscoverySessions.get ( sessionId ) ; } if ( session == null ) { throw new java.lang.IllegalStateException ( ( ( "Calling wifiNanSendMessage before session (session ID " + sessionId ) + " is ready" ) ) ; } byte [ ] bytes = message.getBytes ( ) ; session.sendMessage ( java.lang.Integer.valueOf ( peerId ) , messageId , bytes , retryCount ) ; }

Target:
public void wifiNanSendMessage ( @ com.googlecode.android_scripting.rpc.RpcParameter ( name = "sessionId" , description = "The session ID returned when session" + " was created using publish or subscribe" ) java.lang.Integer sessionId , @ com.googlecode.android_scripting.rpc.RpcParameter ( name = "peerId" , description = "The ID of the peer being communicated " + "with. Obtained from a previous message or match session." ) java.lang.Integer peerId , @ com.googlecode.android_scripting.rpc.RpcParameter ( name = "messageId" , description = "Arbitrary handle used for " + "identification of the message in the message status callbacks" ) java.lang.Integer messageId , @ com.googlecode.android_scripting.rpc.RpcParameter ( name = "message" ) java.lang.String message , @ com.googlecode.android_scripting.rpc.RpcParameter ( name = "retryCount" , description = "Number of retries (0 for none) if " + "transmission fails due to no ACK reception" ) java.lang.Integer retryCount ) throws android.os.RemoteException { android.net.wifi.nan.WifiNanDiscoveryBaseSession session ; synchronized ( mLock ) { session = mDiscoverySessions.get ( sessionId ) ; } if ( session == null ) { throw new java.lang.IllegalStateException ( ( ( "Calling wifiNanSendMessage before session (session ID " + sessionId ) + " is ready" ) ) ; } byte [ ] bytes = message.getBytes ( ) ; session.sendMessage ( new android.net.wifi.nan.WifiNanManager.OpaquePeerHandle ( peerId ) , messageId , bytes , retryCount ) ; }
Source:
public static java.io.FileDescriptor getFileDescriptorFromSSLSocket ( org.conscrypt.OpenSSLSocketImpl openSSLSocketImpl ) { try { java.lang.reflect.Field f_impl = java.net.Socket.class . getDeclaredField ( "impl" ) ; f_impl.setAccessible ( true ) ; java.lang.Object socketImpl = f_impl.get ( openSSLSocketImpl ) ; java.lang.reflect.Field f_fd = java.net.SocketImpl.class . getDeclaredField ( "fd" ) ; f_fd.setAccessible ( true ) ; return ( ( java.io.FileDescriptor ) ( f_fd.get ( socketImpl ) ) ) ; } catch ( java.lang.Exception e ) { throw new java.lang.RuntimeException ( "Can't get FileDescriptor from socket" , e ) ; } }

Target:
static java.io.FileDescriptor getFileDescriptorFromSSLSocket ( org.conscrypt.AbstractConscryptSocket socket ) { try { java.lang.reflect.Field f_impl = java.net.Socket.class . getDeclaredField ( "impl" ) ; f_impl.setAccessible ( true ) ; java.lang.Object socketImpl = f_impl.get ( socket ) ; java.lang.reflect.Field f_fd = java.net.SocketImpl.class . getDeclaredField ( "fd" ) ; f_fd.setAccessible ( true ) ; return ( ( java.io.FileDescriptor ) ( f_fd.get ( socketImpl ) ) ) ; } catch ( java.lang.Exception e ) { throw new java.lang.RuntimeException ( "Can't get FileDescriptor from socket" , e ) ; } }
Source:
public com.android.ide.eclipse.adt.internal.resources.manager.ProjectResources getFrameworkResources ( ) { if ( ( mEditedFile ) != null ) { com.android.ide.eclipse.adt.internal.sdk.Sdk currentSdk = com.android.ide.eclipse.adt.internal.sdk.Sdk.getCurrent ( ) ; if ( currentSdk != null ) { com.android.sdklib.IAndroidTarget target = currentSdk.getTarget ( mEditedFile.getProject ( ) ) ; if ( target != null ) { com.android.ide.eclipse.adt.internal.sdk.AndroidTargetData data = currentSdk.getTargetData ( target ) ; if ( data != null ) { return data.getFrameworkResources ( ) ; } } } } return null ; }

Target:
public com.android.ide.eclipse.adt.internal.resources.manager.ProjectResources getFrameworkResources ( ) { return getFrameworkResources ( getRenderingTarget ( ) ) ; }
Source:
public static java.lang.String toString ( @ android.security.KeyStoreKeyConstraints.AlgorithmEnum int algorithm ) { switch ( algorithm ) { case android.security.KeyStoreKeyConstraints.Algorithm.AES : return "AES" ; case android.security.KeyStoreKeyConstraints.Algorithm.HMAC : return "HMAC" ; default : throw new java.lang.IllegalArgumentException ( ( "Unknown algorithm: " + algorithm ) ) ; } }

Target:
public static java.lang.String toString ( @ android.security.KeyStoreKeyConstraints.AlgorithmEnum int algorithm ) { switch ( algorithm ) { case android.security.KeyStoreKeyConstraints.Algorithm.AES : return "AES" ; case android.security.KeyStoreKeyConstraints.Algorithm.HMAC : return "HMAC" ; case android.security.KeyStoreKeyConstraints.Algorithm.RSA : return "RSA" ; case android.security.KeyStoreKeyConstraints.Algorithm.EC : return "EC" ; default : throw new java.lang.IllegalArgumentException ( ( "Unknown algorithm: " + algorithm ) ) ; } }
Source:
public final android.net.Uri uncanonicalize ( android.net.Uri url ) { android.content.IContentProvider provider = acquireProvider ( url ) ; if ( provider == null ) { return null ; } try { return provider.uncanonicalize ( mPackageName , url ) ; } catch ( android.os.RemoteException e ) { return null ; } finally { releaseProvider ( provider ) ; } }

Target:
public final android.net.Uri uncanonicalize ( @ android.annotation.NonNull android.net.Uri url ) { com.android.internal.util.Preconditions.checkNotNull ( url , "url" ) ; android.content.IContentProvider provider = acquireProvider ( url ) ; if ( provider == null ) { return null ; } try { return provider.uncanonicalize ( mPackageName , url ) ; } catch ( android.os.RemoteException e ) { return null ; } finally { releaseProvider ( provider ) ; } }
Source:
public void getProperty_badResponse ( ) throws java.lang.Exception { com.android.ddmlib.IDevice mockDevice = org.easymock.EasyMock.createMock ( com.android.ddmlib.IDevice.class ) ; injectShellResponse ( mockDevice , "blargh" ) ; org.easymock.EasyMock.replay ( mockDevice ) ; com.android.ddmlib.PropertyFetcher fetcher = new com.android.ddmlib.PropertyFetcher ( mockDevice ) ; org.junit.Assert.assertNull ( fetcher.getProperty ( "dev.bootcomplete" ) . get ( ) ) ; }

Target:
public void testGetProperty_badResponse ( ) throws java.lang.Exception { com.android.ddmlib.IDevice mockDevice = org.easymock.EasyMock.createMock ( com.android.ddmlib.IDevice.class ) ; injectShellResponse ( mockDevice , "blargh" ) ; org.easymock.EasyMock.replay ( mockDevice ) ; com.android.ddmlib.PropertyFetcher fetcher = new com.android.ddmlib.PropertyFetcher ( mockDevice ) ; assertNull ( fetcher.getProperty ( "dev.bootcomplete" ) . get ( ) ) ; }
Source:
public void scheduleDrawable ( android.graphics.drawable.Drawable who , java.lang.Runnable what , long when ) { if ( ( ( verifyDrawable ( who ) ) && ( what != null ) ) && ( ( mAttachInfo ) != null ) ) { mAttachInfo.mHandler.postAtTime ( what , who , when ) ; } }

Target:
public void scheduleDrawable ( android.graphics.drawable.Drawable who , java.lang.Runnable what , long when ) { if ( ( verifyDrawable ( who ) ) && ( what != null ) ) { if ( ( mAttachInfo ) != null ) { mAttachInfo.mHandler.postAtTime ( what , who , when ) ; } else { android.view.ViewRootImpl.getRunQueue ( ) . postDelayed ( what , ( when - ( android.os.SystemClock.uptimeMillis ( ) ) ) ) ; } } }
Source:
private void record ( com.android.tools.lint.detector.api.ClassContext context , org.objectweb.asm.tree.MethodNode method , org.objectweb.asm.tree.AbstractInsnNode instruction , java.lang.String owner ) { if ( ( owner.indexOf ( '$' ) ) != ( - 1 ) ) { return ; } if ( ( mCandidates ) == null ) { mCandidates = lombok.ast.libs.org.parboiled.google.collect.Lists.newArrayList ( ) ; } mCandidates.add ( new com.android.tools.lint.checks.InvalidPackageDetector.Candidate ( owner , context.getClassNode ( ) . name , context.getJarFile ( ) ) ) ; }

Target:
private void record ( com.android.tools.lint.detector.api.ClassContext context , org.objectweb.asm.tree.MethodNode method , org.objectweb.asm.tree.AbstractInsnNode instruction , java.lang.String owner ) { if ( ( owner.indexOf ( '$' ) ) != ( - 1 ) ) { return ; } if ( ( mCandidates ) == null ) { mCandidates = com.google.common.collect.Lists.newArrayList ( ) ; } mCandidates.add ( new com.android.tools.lint.checks.InvalidPackageDetector.Candidate ( owner , context.getClassNode ( ) . name , context.getJarFile ( ) ) ) ; }
Source:
public void onViewCreated ( android.view.View view , android.os.Bundle savedInstanceState ) { super . onViewCreated ( view , savedInstanceState ) ; final android.app.Activity activity = getActivity ( ) ; if ( activity != null ) { mProgressHeader = ( ( android.widget.ProgressBar ) ( setPinnedHeaderView ( R.layout.wifi_progress_header ) ) ) ; } }

Target:
public void onViewCreated ( android.view.View view , android.os.Bundle savedInstanceState ) { super . onViewCreated ( view , savedInstanceState ) ; final android.app.Activity activity = getActivity ( ) ; if ( activity != null ) { mProgressHeader = ( ( android.widget.ProgressBar ) ( setPinnedHeaderView ( R.layout.wifi_progress_header ) ) ) ; setProgressBarVisible ( false ) ; } }
Source:
private void startAsyncQuery ( ) { try { setTitle ( getString ( R.string.refreshing ) ) ; setProgressBarIndeterminateVisibility ( true ) ; com.android.mms.data.Conversation.startQueryForAll ( mQueryHandler , com.android.mms.ui.ConversationList.THREAD_LIST_QUERY_TOKEN ) ; com.android.mms.data.Conversation.startQuery ( mQueryHandler , com.android.mms.ui.ConversationList.UNREAD_THREADS_QUERY_TOKEN , ( ( android.provider.Telephony.Threads.READ ) + "=0" ) ) ; } catch ( android.database.sqlite.SQLiteException e ) { android.database.sqlite.SqliteWrapper.checkSQLiteException ( this , e ) ; } }

Target:
public boolean onSearchRequested ( ) { if ( ( mSearchItem ) != null ) { mSearchItem.expandActionView ( ) ; } return true ; }
Source:
public void testDiscoveryInterfaceChange ( ) throws org.json.JSONException { final byte [ ] mac = libcore.util.HexEncoding.decode ( "060504030201" . toCharArray ( ) , false ) ; android.os.Bundle args = new android.os.Bundle ( ) ; args.putInt ( "event_type" , WifiNanNative.NAN_EVENT_ID_DISC_MAC_ADDR ) ; args.putByteArray ( "data" , mac ) ; com.android.server.wifi.nan.WifiNanHalMock.callDiscEngEvent ( com.android.server.wifi.HalMockUtils.convertBundleToJson ( args ) . toString ( ) ) ; org.mockito.Mockito.verify ( mNanStateManager ) . onInterfaceAddressChangeNotification ( mac ) ; org.mockito.Mockito.verifyNoMoreInteractions ( mNanStateManager ) ; }

Target:
public void testDiscoveryInterfaceChange ( ) throws org.json.JSONException { final byte [ ] mac = libcore.util.HexEncoding.decode ( "060504030201" . toCharArray ( ) , false ) ; android.os.Bundle args = new android.os.Bundle ( ) ; args.putInt ( "event_type" , WifiAwareNative.AWARE_EVENT_ID_DISC_MAC_ADDR ) ; args.putByteArray ( "data" , mac ) ; com.android.server.wifi.aware.WifiAwareHalMock.callDiscEngEvent ( com.android.server.wifi.HalMockUtils.convertBundleToJson ( args ) . toString ( ) ) ; org.mockito.Mockito.verify ( mAwareStateManager ) . onInterfaceAddressChangeNotification ( mac ) ; org.mockito.Mockito.verifyNoMoreInteractions ( mAwareStateManager ) ; }
Source:
private void addDismissUpgradeRequestAction ( android.app.Notification.Builder builder ) { com.android.dialer.common.LogUtil.i ( "StatusBarNotifier.addDismissUpgradeRequestAction" , "will show \"dismiss upgrade\" action in the incoming call Notification" ) ; android.app.PendingIntent declineVideoPendingIntent = com.android.incallui.StatusBarNotifier.createNotificationPendingIntent ( context , com.android.incallui.NotificationBroadcastReceiver.ACTION_DECLINE_VIDEO_UPGRADE_REQUEST ) ; builder.addAction ( new android.app.Notification.Action.Builder ( android.graphics.drawable.Icon.createWithResource ( context , R.drawable.quantum_ic_videocam_white_24 ) , getActionText ( R.string.notification_action_dismiss , R.color.notification_action_dismiss ) , declineVideoPendingIntent ) . build ( ) ) ; }

Target:
private void addDismissUpgradeRequestAction ( android.app.Notification.Builder builder ) { com.android.dialer.common.LogUtil.i ( "StatusBarNotifier.addDismissUpgradeRequestAction" , "will show \"dismiss upgrade\" action in the incoming call Notification" ) ; android.app.PendingIntent declineVideoPendingIntent = com.android.incallui.StatusBarNotifier.createNotificationPendingIntent ( context , com.android.incallui.NotificationBroadcastReceiver.ACTION_DECLINE_VIDEO_UPGRADE_REQUEST ) ; builder.addAction ( new android.app.Notification.Action.Builder ( android.graphics.drawable.Icon.createWithResource ( context , R.drawable.quantum_ic_videocam_vd_white_24 ) , getActionText ( R.string.notification_action_dismiss , R.color.notification_action_dismiss ) , declineVideoPendingIntent ) . build ( ) ) ; }
Source:
public int getCdmaEriIconIndexForSubscriber ( int subId , java.lang.String callingPackage ) { if ( ! ( canReadPhoneState ( callingPackage , "getCdmaEriIconIndexForSubscriber" ) ) ) { return - 1 ; } final com.android.internal.telephony.Phone phone = getPhone ( subId ) ; if ( phone != null ) { return phone.getCdmaEriIconIndex ( ) ; } else { return - 1 ; } }

Target:
public int getCdmaEriIconIndexForSubscriber ( int subId , java.lang.String callingPackage ) { if ( ! ( com.android.internal.telephony.TelephonyPermissions.checkCallingOrSelfReadPhoneState ( mApp , callingPackage , "getCdmaEriIconIndexForSubscriber" ) ) ) { return - 1 ; } final com.android.internal.telephony.Phone phone = getPhone ( subId ) ; if ( phone != null ) { return phone.getCdmaEriIconIndex ( ) ; } else { return - 1 ; } }
Source:
public void test_useRadix_I ( ) { s = new java.util.Scanner ( "test" ) ; try { s.useRadix ( ( ( java.lang.Character.MIN_RADIX ) - 1 ) ) ; fail ( "Should throw IllegalArgumentException" ) ; } catch ( java.lang.IllegalArgumentException e ) { } try { s.useRadix ( ( ( java.lang.Character.MAX_RADIX ) + 1 ) ) ; fail ( "Should throw IllegalArgumentException" ) ; } catch ( java.lang.IllegalArgumentException e ) { } s.useRadix ( 11 ) ; assertEquals ( 11 , s.radix ( ) ) ; }

Target:
public void test_useLocale_LLocale ( ) { s = new java.util.Scanner ( "test" ) ; try { s.useLocale ( null ) ; fail ( ) ; } catch ( java.lang.NullPointerException expected ) { } s.useLocale ( new java.util.Locale ( "test" , "test" ) ) ; assertEquals ( new java.util.Locale ( "test" , "test" ) , s.locale ( ) ) ; }
Source:
private void setUserMobileDataEnabled ( int subId , boolean enable ) { try { android.util.Log.d ( android.telephony.TelephonyManager.TAG , ( "setUserMobileDataEnabled: enabled=" + enable ) ) ; com.android.internal.telephony.ITelephony telephony = getITelephony ( ) ; if ( telephony != null ) telephony.setUserDataEnabled ( subId , enable ) ; } catch ( android.os.RemoteException e ) { android.util.Log.e ( android.telephony.TelephonyManager.TAG , "Error calling ITelephony#setUserDataEnabled" , e ) ; } }

Target:
public void setDataEnabled ( int subId , boolean enable ) { try { android.util.Log.d ( android.telephony.TelephonyManager.TAG , ( "setDataEnabled: enabled=" + enable ) ) ; com.android.internal.telephony.ITelephony telephony = getITelephony ( ) ; if ( telephony != null ) telephony.setUserDataEnabled ( subId , enable ) ; } catch ( android.os.RemoteException e ) { android.util.Log.e ( android.telephony.TelephonyManager.TAG , "Error calling ITelephony#setUserDataEnabled" , e ) ; } }
Source:
public void close ( ) throws java.io.IOException { synchronized ( this ) { if ( ( ( fd ) == null ) || ( ( mFdCreatedInternally ) == false ) ) { fd = null ; return ; } try { Libcore.os.close ( fd ) ; } catch ( libcore.io.ErrnoException e ) { e.rethrowAsIOException ( ) ; } fd = null ; } }

Target:
public void close ( ) throws java.io.IOException { synchronized ( this ) { if ( ( ( fd ) == null ) || ( ( mFdCreatedInternally ) == false ) ) { fd = null ; return ; } try { android.system.Os.close ( fd ) ; } catch ( android.system.ErrnoException e ) { e.rethrowAsIOException ( ) ; } fd = null ; } }
Source:
private void initContentStream ( java.io.InputStream transferStream ) throws java.io.IOException { if ( ( transparentGzip ) && ( responseHeaders.isContentEncodingGzip ( ) ) ) { responseHeaders.stripContentEncoding ( ) ; responseBodyIn = new java.util.zip.GZIPInputStream ( transferStream ) ; } else { responseBodyIn = transferStream ; } }

Target:
private void initContentStream ( java.io.InputStream transferStream ) throws java.io.IOException { if ( ( transparentGzip ) && ( responseHeaders.isContentEncodingGzip ( ) ) ) { responseHeaders.stripContentEncoding ( ) ; responseHeaders.stripContentLength ( ) ; responseBodyIn = new java.util.zip.GZIPInputStream ( transferStream ) ; } else { responseBodyIn = transferStream ; } }
Source:
public void test_initLjava_security_KeyStore_01 ( ) throws java.lang.Exception { java.security.KeyStore ksNull = null ; javax.net.ssl.TrustManagerFactory [ ] trustMF = tests.api.javax.net.ssl.TrustManagerFactory1Test.createTMFac ( ) ; assertNotNull ( "TrustManagerFactory objects were not created" , trustMF ) ; try { trustMF [ 0 ] . init ( ksNull ) ; } catch ( java.lang.Exception ex ) { fail ( ( ex + " unexpected exception was thrown for null parameter" ) ) ; } }

Target:
public void test_initLjava_security_KeyStore_01 ( ) throws java.lang.Exception { java.security.KeyStore ksNull = null ; javax.net.ssl.TrustManagerFactory [ ] trustMF = org.apache.harmony.tests.javax.net.ssl.TrustManagerFactory1Test.createTMFac ( ) ; assertNotNull ( "TrustManagerFactory objects were not created" , trustMF ) ; try { trustMF [ 0 ] . init ( ksNull ) ; } catch ( java.lang.Exception ex ) { fail ( ( ex + " unexpected exception was thrown for null parameter" ) ) ; } }
Source:
boolean recover ( com.android.tradefed.device.ITestDevice device , java.lang.String reportPath ) throws com.android.tradefed.device.DeviceNotAvailableException , java.io.IOException { try { parse ( device , reportPath ) ; mBitstreams.removeAll ( mProcessedBitstreams ) ; device.pushString ( getBitstreamsListString ( ) , mBitstreamsListTxt ) ; return true ; } catch ( java.lang.RuntimeException e ) { com.android.tradefed.log.LogUtil.CLog.e ( "Error parsing report; saving report to %s" , device.pullFile ( reportPath ) ) ; com.android.tradefed.log.LogUtil.CLog.e ( e ) ; return false ; } }

Target:
boolean recover ( com.android.tradefed.device.ITestDevice device , java.lang.String reportPath ) throws com.android.tradefed.device.DeviceNotAvailableException , java.io.IOException { try { parse ( device , reportPath ) ; mBitstreams.removeAll ( mProcessedBitstreams ) ; device.pushString ( getBitstreamsListString ( ) , mBitstreamsListTxt ) ; return true ; } catch ( java.lang.RuntimeException e ) { java.io.File hostFile = ( reportPath == null ) ? null : device.pullFile ( reportPath ) ; com.android.tradefed.log.LogUtil.CLog.e ( "Error parsing report; saving report to %s" , hostFile ) ; com.android.tradefed.log.LogUtil.CLog.e ( e ) ; return false ; } }
Source:
private boolean hasFormattingPatternForNumber ( com.google.i18n.phonenumbers.Phonenumber.PhoneNumber number ) { int countryCallingCode = number.getCountryCode ( ) ; java.lang.String phoneNumberRegion = getRegionCodeForCountryCode ( countryCallingCode ) ; com.google.i18n.phonenumbers.Phonemetadata.PhoneMetadata metadata = getMetadataForRegionOrCallingCode ( countryCallingCode , phoneNumberRegion ) ; if ( metadata == null ) { return false ; } java.lang.String nationalNumber = getNationalSignificantNumber ( number ) ; com.google.i18n.phonenumbers.Phonemetadata.NumberFormat formatRule = chooseFormattingPatternForNumber ( metadata.numberFormats ( ) , nationalNumber ) ; return formatRule != null ; }

Target:
private boolean hasFormattingPatternForNumber ( com.google.i18n.phonenumbers.Phonenumber.PhoneNumber number ) { int countryCallingCode = number.getCountryCode ( ) ; java.lang.String phoneNumberRegion = getRegionCodeForCountryCode ( countryCallingCode ) ; com.google.i18n.phonenumbers.nano.Phonemetadata.PhoneMetadata metadata = getMetadataForRegionOrCallingCode ( countryCallingCode , phoneNumberRegion ) ; if ( metadata == null ) { return false ; } java.lang.String nationalNumber = getNationalSignificantNumber ( number ) ; com.google.i18n.phonenumbers.nano.Phonemetadata.NumberFormat formatRule = chooseFormattingPatternForNumber ( metadata.numberFormat , nationalNumber ) ; return formatRule != null ; }