auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean getDataEnabled ( int subId ) { boolean retVal = false ; try { com.android.internal.telephony.ITelephony telephony = getITelephony ( ) ; if ( telephony != null ) retVal = telephony.getDataEnabled ( subId ) ; } catch ( android.os.RemoteException e ) { android.util.Log.e ( android.telephony.TelephonyManager.TAG , "Error calling ITelephony#getDataEnabled" , e ) ; } catch ( java.lang.NullPointerException e ) { } return retVal ; }

Target:
public boolean getDataEnabled ( int subId ) { boolean retVal = false ; try { com.android.internal.telephony.ITelephony telephony = getITelephony ( ) ; if ( telephony != null ) retVal = telephony.isUserDataEnabled ( subId ) ; } catch ( android.os.RemoteException e ) { android.util.Log.e ( android.telephony.TelephonyManager.TAG , "Error calling ITelephony#isUserDataEnabled" , e ) ; } catch ( java.lang.NullPointerException e ) { } return retVal ; }
Source:
protected com.android.ide.common.internal.PngCruncher getCruncher ( ) { java.io.File aapt = getAapt ( ) ; return QueuedCruncher.Builder.INSTANCE.newCruncher ( aapt.getAbsolutePath ( ) , com.android.builder.png.NinePatchAsyncAaptProcessTest.sLogger ) ; }

Target:
public static java.util.Collection < java.lang.Object [ ] > getNinePatches ( ) { java.util.Collection < java.lang.Object [ ] > params = com.android.builder.png.NinePatchAaptProcessorTestUtils.getNinePatches ( ) ; com.android.builder.png.NinePatchAsyncAaptProcessTest.sClassStartTime.set ( java.lang.System.currentTimeMillis ( ) ) ; com.android.builder.png.NinePatchAsyncAaptProcessTest.sCruncherKey.set ( com.android.builder.png.NinePatchAsyncAaptProcessTest.sCruncher.start ( ) ) ; return params ; }
Source:
public java.lang.String name ( ) { return ( ( ( ( ( "NetworkAgentInfo [" + ( networkInfo.getTypeName ( ) ) ) + " (" ) + ( networkInfo.getSubtypeName ( ) ) ) + ") - " ) + ( ( network ) == null ? "null" : network.toString ( ) ) ) + "]" ; }

Target:
public android.net.Network network ( ) { return network ; }
Source:
public void run ( ) { java.util.List < com.android.ddmuilib.logcat.LogCatMessage > selectedMessages = getSelectedLogCatMessages ( ) ; if ( ( selectedMessages.size ( ) ) == 0 ) { addNewFilter ( ) ; } else { com.android.ddmuilib.logcat.LogCatMessage m = selectedMessages.get ( 0 ) ; addNewFilter ( m.getTag ( ) , m.getMessage ( ) , m.getPid ( ) , m.getAppName ( ) , m.getLogLevel ( ) ) ; } }

Target:
public void run ( ) { java.util.List < com.android.ddmlib.logcat.LogCatMessage > selectedMessages = getSelectedLogCatMessages ( ) ; if ( ( selectedMessages.size ( ) ) == 0 ) { addNewFilter ( ) ; } else { com.android.ddmlib.logcat.LogCatMessage m = selectedMessages.get ( 0 ) ; addNewFilter ( m.getTag ( ) , m.getMessage ( ) , m.getPid ( ) , m.getAppName ( ) , m.getLogLevel ( ) ) ; } }
Source:
public void test_getLocalSocketAddress_afterClose ( ) throws java.io.IOException { java.nio.channels.SocketChannel sc = java.nio.channels.SocketChannel.open ( ) ; assertNull ( sc.getLocalAddress ( ) ) ; java.net.InetSocketAddress bindAddr = new java.net.InetSocketAddress ( "localhost" , 0 ) ; sc.bind ( bindAddr ) ; assertNotNull ( sc.getLocalAddress ( ) ) ; sc.close ( ) ; assertFalse ( sc.isOpen ( ) ) ; try { sc.getLocalAddress ( ) ; fail ( ) ; } catch ( java.nio.channels.ClosedChannelException expected ) { } }

Target:
public void test_getLocalSocketAddress_afterClose ( ) throws java.io.IOException { java.nio.channels.SocketChannel sc = java.nio.channels.SocketChannel.open ( ) ; assertNull ( sc.socket ( ) . getLocalSocketAddress ( ) ) ; java.net.InetSocketAddress bindAddr = new java.net.InetSocketAddress ( "localhost" , 0 ) ; sc.socket ( ) . bind ( bindAddr ) ; assertNotNull ( sc.socket ( ) . getLocalSocketAddress ( ) ) ; sc.close ( ) ; assertFalse ( sc.isOpen ( ) ) ; sc.socket ( ) . getLocalSocketAddress ( ) ; }
Source:
public void setHorizontalScrollbarOverlay ( final boolean overlay ) { if ( checkNeedsPost ( ) ) { mRunQueue.addTask ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { setHorizontalScrollbarOverlay ( overlay ) ; } } ) ; return ; } mAwContents.setHorizontalScrollbarOverlay ( overlay ) ; }

Target:
public void setNetworkAvailable ( final boolean networkUp ) { if ( checkNeedsPost ( ) ) { mRunQueue.addTask ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { setNetworkAvailable ( networkUp ) ; } } ) ; return ; } mAwContents.setNetworkAvailable ( networkUp ) ; }
Source:
private static void setLocaleFromMccIfNeeded ( android.content.Context context , int mcc ) { if ( ( android.telephony.TelephonyManager.getLteOnCdmaModeStatic ( ) ) == ( PhoneConstants.LTE_ON_CDMA_TRUE ) ) { return ; } java.lang.String language = com.android.internal.telephony.MccTable.defaultLanguageForMcc ( mcc ) ; java.lang.String country = com.android.internal.telephony.MccTable.countryCodeForMcc ( mcc ) ; android.util.Log.d ( com.android.internal.telephony.MccTable.LOG_TAG , ( ( ( "locale set to " + language ) + "_" ) + country ) ) ; com.android.internal.telephony.MccTable.setSystemLocale ( context , language , country ) ; }

Target:
private static void setLocaleFromMccIfNeeded ( android.content.Context context , int mcc ) { if ( ( android.telephony.TelephonyManager.getLteOnCdmaModeStatic ( ) ) == ( PhoneConstants.LTE_ON_CDMA_TRUE ) ) { return ; } java.lang.String language = com.android.internal.telephony.MccTable.defaultLanguageForMcc ( mcc ) ; java.lang.String country = com.android.internal.telephony.MccTable.countryCodeForMcc ( mcc ) ; android.telephony.Rlog.d ( com.android.internal.telephony.MccTable.LOG_TAG , ( ( ( "locale set to " + language ) + "_" ) + country ) ) ; com.android.internal.telephony.MccTable.setSystemLocale ( context , language , country ) ; }
Source:
protected com.android.sched.vfs.OutputVFile getOutputDex ( @ javax.annotation.Nonnull com.android.sched.vfs.OutputVDir outputVDir , int dexCount ) throws com.android.jack.JackIOException { assert dexCount >= 1 ; java.lang.String dexName ; if ( dexCount == 1 ) { dexName = DexFileWriter.DEX_FILENAME ; } else { dexName = ( ( DexFileWriter.DEX_PREFIX ) + dexCount ) + ( DexFileWriter.DEX_FILE_EXTENSION ) ; } try { return outputVDir.createOutputVFile ( new com.android.sched.vfs.VPath ( dexName , '/' ) ) ; } catch ( java.io.IOException e ) { throw new com.android.jack.JackIOException ( ( ( ( "Cannot create dex file '" + dexName ) + "' in " ) + outputVDir ) , e ) ; } }

Target:
protected com.android.sched.vfs.OutputVFile getOutputDex ( @ javax.annotation.Nonnull com.android.sched.vfs.OutputVDir outputVDir , int dexCount ) throws com.android.jack.JackIOException { assert dexCount >= 1 ; java.lang.String dexName ; if ( dexCount == 1 ) { dexName = DexFileWriter.DEX_FILENAME ; } else { dexName = ( ( DexFileWriter.DEX_PREFIX ) + dexCount ) + ( BinaryKind.DEX.getFileExtension ( ) ) ; } try { return outputVDir.createOutputVFile ( new com.android.sched.vfs.VPath ( dexName , '/' ) ) ; } catch ( java.io.IOException e ) { throw new com.android.jack.JackIOException ( ( ( ( "Cannot create dex file '" + dexName ) + "' in " ) + outputVDir ) , e ) ; } }
Source:
public com.android.jack.debug.DebugVariableInfoMarker exportAsJast ( @ javax.annotation.Nonnull com.android.jack.jayce.v0004.io.ExportSession exportSession ) { assert ( name ) != null ; assert ( type ) != null ; return new com.android.jack.debug.DebugVariableInfoMarker ( name , exportSession.getLookup ( ) . getType ( type ) , genericSignature ) ; }

Target:
public com.android.jack.debug.DebugVariableInfoMarker exportAsJast ( @ javax.annotation.Nonnull com.android.jack.jayce.v0004.io.ExportSession exportSession ) { if ( ( ( name ) == null ) && ( ( type ) == null ) ) { return com.android.jack.debug.DebugVariableInfoMarker.NO_DEBUG_INFO ; } assert ( name ) != null ; assert ( type ) != null ; return new com.android.jack.debug.DebugVariableInfoMarker ( name , exportSession.getLookup ( ) . getType ( type ) , genericSignature ) ; }
Source:
public void copy1DRangeFromUnchecked ( int off , int count , float [ ] d ) { android.os.Trace.traceBegin ( RenderScript.TRACE_TAG , "copy1DRangeFromUnchecked" ) ; int dataSize = ( mType.mElement.getBytesSize ( ) ) * count ; data1DChecks ( off , count , ( ( d.length ) * 4 ) , dataSize ) ; mRS.nAllocationData1D ( getIDSafe ( ) , off , mSelectedLOD , count , d , dataSize , Element.DataType.FLOAT_32 ) ; android.os.Trace.traceEnd ( RenderScript.TRACE_TAG ) ; }

Target:
public void copy1DRangeFrom ( int off , int count , float [ ] d ) { validateIsFloat32 ( ) ; copy1DRangeFromUnchecked ( off , count , d , Element.DataType.FLOAT_32 , d.length ) ; }
Source:
private void fetchActiveDevices ( ) { com.android.settingslib.bluetooth.A2dpProfile a2dpProfile = mProfileManager.getA2dpProfile ( ) ; if ( a2dpProfile != null ) { mIsActiveDeviceA2dp = mDevice.equals ( a2dpProfile.getActiveDevice ( ) ) ; } com.android.settingslib.bluetooth.HeadsetProfile headsetProfile = mProfileManager.getHeadsetProfile ( ) ; if ( headsetProfile != null ) { mIsActiveDeviceHeadset = mDevice.equals ( headsetProfile.getActiveDevice ( ) ) ; } }

Target:
private void fetchActiveDevices ( ) { com.android.settingslib.bluetooth.A2dpProfile a2dpProfile = mProfileManager.getA2dpProfile ( ) ; if ( a2dpProfile != null ) { mIsActiveDeviceA2dp = mDevice.equals ( a2dpProfile.getActiveDevice ( ) ) ; } com.android.settingslib.bluetooth.HeadsetProfile headsetProfile = mProfileManager.getHeadsetProfile ( ) ; if ( headsetProfile != null ) { mIsActiveDeviceHeadset = mDevice.equals ( headsetProfile.getActiveDevice ( ) ) ; } com.android.settingslib.bluetooth.HearingAidProfile hearingAidProfile = mProfileManager.getHearingAidProfile ( ) ; if ( hearingAidProfile != null ) { mIsActiveDeviceHearingAid = hearingAidProfile.isActiveDevice ( mDevice ) ; } }
Source:
public int getVersionCode ( ) { int versionCode = ( ( mMergedFlavor.getVersionCode ( ) ) != null ) ? mMergedFlavor.getVersionCode ( ) : - 1 ; if ( ( versionCode == ( - 1 ) ) && ( ( mType ) != ( com.android.builder.core.VariantConfiguration.Type.TEST ) ) ) { versionCode = getVersionCodeFromManifest ( ) ; } return versionCode ; }

Target:
public int getVersionCode ( ) { int versionCode = ( ( mMergedFlavor.getVersionCode ( ) ) != null ) ? mMergedFlavor.getVersionCode ( ) : - 1 ; if ( ( versionCode == ( - 1 ) ) && ( ! ( mType.isForTesting ( ) ) ) ) { versionCode = getVersionCodeFromManifest ( ) ; } return versionCode ; }
Source:
public boolean processMessage ( android.os.Message message ) { switch ( message.what ) { case com.android.bluetooth.pbap.PbapStateMachine.AUTHORIZED : transitionTo ( mConnected ) ; break ; case com.android.bluetooth.pbap.PbapStateMachine.REJECTED : rejectConnection ( ) ; transitionTo ( mFinished ) ; break ; case com.android.bluetooth.pbap.PbapStateMachine.DISCONNECT : mServiceHandler.removeMessages ( BluetoothPbapService.USER_TIMEOUT ) ; android.os.Message msg = mServiceHandler.obtainMessage ( BluetoothPbapService.USER_TIMEOUT ) ; msg.obj = mRemoteDevice ; msg.sendToTarget ( ) ; transitionTo ( mFinished ) ; break ; } return HANDLED ; }

Target:
public boolean processMessage ( android.os.Message message ) { switch ( message.what ) { case com.android.bluetooth.pbap.PbapStateMachine.DISCONNECT : stopObexServerSession ( ) ; break ; case com.android.bluetooth.pbap.PbapStateMachine.CREATE_NOTIFICATION : createPbapNotification ( ) ; break ; case com.android.bluetooth.pbap.PbapStateMachine.REMOVE_NOTIFICATION : android.content.Intent i = new android.content.Intent ( BluetoothPbapService.USER_CONFIRM_TIMEOUT_ACTION ) ; mService.sendBroadcast ( i ) ; notifyAuthCancelled ( ) ; removePbapNotification ( mNotificationId ) ; break ; case com.android.bluetooth.pbap.PbapStateMachine.AUTH_KEY_INPUT : java.lang.String key = ( ( java.lang.String ) ( message.obj ) ) ; notifyAuthKeyInput ( key ) ; break ; case com.android.bluetooth.pbap.PbapStateMachine.AUTH_CANCELLED : notifyAuthCancelled ( ) ; break ; } return HANDLED ; }
Source:
public void testInvalidPackage ( ) throws java.lang.Exception { boolean output = false ; setupTestCase ( ) ; com.android.server.wifi.util.WifiPermissionsUtil codeUnderTest = new com.android.server.wifi.util.WifiPermissionsUtil ( mMockPermissionsWrapper , mMockContext , mMockWifiSettingsStore , mMockUserManager ) ; try { output = codeUnderTest.canAccessScanResults ( com.android.server.wifi.util.WifiPermissionsUtilTest.TEST_PACKAGE_NAME , mUid , mTargetVersion ) ; } catch ( java.lang.SecurityException e ) { throw e ; } }

Target:
public void testInvalidPackage ( ) throws java.lang.Exception { boolean output = false ; setupTestCase ( ) ; com.android.server.wifi.util.WifiPermissionsUtil codeUnderTest = new com.android.server.wifi.util.WifiPermissionsUtil ( mMockPermissionsWrapper , mMockContext , mMockWifiSettingsStore , mMockUserManager , mNetworkScorerAppManager ) ; try { output = codeUnderTest.canAccessScanResults ( com.android.server.wifi.util.WifiPermissionsUtilTest.TEST_PACKAGE_NAME , mUid , mTargetVersion ) ; } catch ( java.lang.SecurityException e ) { throw e ; } }
Source:
public void test_get_TemporalField ( ) { org.testng.Assert.assertEquals ( TEST_2008_06.get ( java.time.temporal.ChronoField.YEAR ) , 2008 ) ; org.testng.Assert.assertEquals ( TEST_2008_06.get ( java.time.temporal.ChronoField.MONTH_OF_YEAR ) , 6 ) ; org.testng.Assert.assertEquals ( TEST_2008_06.get ( java.time.temporal.ChronoField.YEAR_OF_ERA ) , 2008 ) ; org.testng.Assert.assertEquals ( TEST_2008_06.get ( java.time.temporal.ChronoField.ERA ) , 1 ) ; }

Target:
public void test_getLong_TemporalField ( ) { org.testng.Assert.assertEquals ( tck.java.time.TCKYearMonth.TEST_2008_06.getLong ( java.time.temporal.ChronoField.YEAR ) , 2008 ) ; org.testng.Assert.assertEquals ( tck.java.time.TCKYearMonth.TEST_2008_06.getLong ( java.time.temporal.ChronoField.MONTH_OF_YEAR ) , 6 ) ; org.testng.Assert.assertEquals ( tck.java.time.TCKYearMonth.TEST_2008_06.getLong ( java.time.temporal.ChronoField.YEAR_OF_ERA ) , 2008 ) ; org.testng.Assert.assertEquals ( tck.java.time.TCKYearMonth.TEST_2008_06.getLong ( java.time.temporal.ChronoField.ERA ) , 1 ) ; org.testng.Assert.assertEquals ( tck.java.time.TCKYearMonth.TEST_2008_06.getLong ( java.time.temporal.ChronoField.PROLEPTIC_MONTH ) , ( ( ( 2008 * 12 ) + 6 ) - 1 ) ) ; }
Source:
private static java.lang.String getNormalizedNumber ( com.android.dialer.DialerPhoneNumber phoneNumber ) { return phoneNumber.getRawInput ( ) . getNumber ( ) ; }

Target:
private static void addInfo ( java.util.Map < com.android.dialer.DialerPhoneNumber , java.util.Set < com.android.dialer.phonelookup.PhoneLookupInfo.Cp2Info.Cp2ContactInfo > > map , java.util.Set < com.android.dialer.DialerPhoneNumber > dialerPhoneNumbers , com.android.dialer.phonelookup.PhoneLookupInfo.Cp2Info.Cp2ContactInfo cp2ContactInfo ) { for ( com.android.dialer.DialerPhoneNumber dialerPhoneNumber : dialerPhoneNumbers ) { if ( map.containsKey ( dialerPhoneNumber ) ) { map.get ( dialerPhoneNumber ) . add ( cp2ContactInfo ) ; } else { java.util.Set < com.android.dialer.phonelookup.PhoneLookupInfo.Cp2Info.Cp2ContactInfo > cp2ContactInfos = new android.support.v4.util.ArraySet ( ) ; cp2ContactInfos.add ( cp2ContactInfo ) ; map.put ( dialerPhoneNumber , cp2ContactInfos ) ; } } }
Source:
public void test_SCSU_replacement_character ( ) throws java.lang.Exception { assertDecodes ( java.nio.charset.Charset.forName ( "SCSU" ) , "�" , 14 , 255 ) ; assertEncodes ( java.nio.charset.Charset.forName ( "SCSU" ) , "�" , 14 , 255 ) ; }

Target:
public void test_SCSU_replacement_character ( ) throws java.lang.Exception { assertEncodes ( java.nio.charset.Charset.forName ( "SCSU" ) , " � " , ' ' , 14 , 255 , 253 , ' ' ) ; assertDecodes ( java.nio.charset.Charset.forName ( "SCSU" ) , " � " , ' ' , 14 , 255 , 253 , ' ' ) ; }
Source:
public synchronized void printStackTrace ( java.lang.Throwable receiver ) { receiver.printStackTrace ( ) ; for ( java.lang.Throwable suppressed : getSuppressed ( receiver ) ) { java.lang.System.err.print ( com.google.devtools.build.android.desugar.runtime.ThrowableExtension.MimicDesugaringStrategy.SUPPRESSED_PREFIX ) ; suppressed.printStackTrace ( ) ; } }

Target:
public void printStackTrace ( java.lang.Throwable receiver ) { receiver.printStackTrace ( ) ; java.util.List < java.lang.Throwable > suppressedList = map.get ( receiver , false ) ; if ( suppressedList == null ) { return ; } synchronized ( suppressedList ) { for ( java.lang.Throwable suppressed : suppressedList ) { java.lang.System.err.print ( com.google.devtools.build.android.desugar.runtime.ThrowableExtension.MimicDesugaringStrategy.SUPPRESSED_PREFIX ) ; suppressed.printStackTrace ( ) ; } } }
Source:
public void testPackageOverridePackageFromFlavorWithSuffix ( ) { com.android.builder.AndroidBuilder builder = new com.android.builder.AndroidBuilder ( new com.android.builder.DefaultSdkParser ( "" ) , new com.android.utils.StdLogger ( StdLogger.Level.ERROR ) , false ) ; mFlavor.setPackageName ( "foo.bar" ) ; mDebug.setPackageNameSuffix ( ".fortytwo" ) ; builder.setBuildVariant ( mMain , mFlavor , mDebug ) ; assertEquals ( "foo.bar.fortytwo" , builder.getPackageOverride ( "" ) ) ; }

Target:
public void testPackageOverrideNone ( ) { com.android.builder.AndroidBuilder builder = new com.android.builder.AndroidBuilderTest.AndroidBuilderMock ( new com.android.builder.DefaultSdkParser ( "" ) , new com.android.utils.StdLogger ( StdLogger.Level.ERROR ) , false ) ; builder.setBuildVariant ( mMain , mDebug ) ; builder.addProductFlavor ( mFlavor ) ; assertNull ( builder.getPackageOverride ( "" ) ) ; }
Source:
public java.net.URL getEntryUrlOrNull ( java.lang.String entryName ) { java.util.zip.ZipEntry entry = libcore.io.ClassPathURLStreamHandler.findEntryWithDirectoryFallback ( jarFile , entryName ) ; if ( entry != null ) { try { return new java.net.URL ( "jar" , null , ( - 1 ) , ( ( ( fileUri ) + "!/" ) + entryName ) , this ) ; } catch ( java.net.MalformedURLException e ) { throw new java.lang.RuntimeException ( "Invalid entry name" , e ) ; } } return null ; }

Target:
java.util.jar.JarFile getSharedJarFile ( ) throws java.io.IOException { synchronized ( this ) { if ( ( jarFile ) == null ) { jarFile = new java.util.jar.JarFile ( strictJarFile.getName ( ) ) ; } } return jarFile ; }
Source:
private static void addModuleForAccessingCallDetails ( android.content.Context context , java.util.List < com.android.dialer.contactactions.ContactActionModule > modules , com.android.dialer.calllog.model.CoalescedRow row ) { boolean canReportInaccurateNumber = false ; boolean canSupportAssistedDialing = false ; modules.add ( new com.android.dialer.contactactions.IntentModule ( context , com.android.dialer.calldetails.CallDetailsActivity.newInstance ( context , row.coalescedIds ( ) , com.android.dialer.calllog.ui.menu.Modules.createDialerContactFromRow ( row ) , canReportInaccurateNumber , canSupportAssistedDialing ) , R.string.call_details_menu_label , R.drawable.quantum_ic_info_outline_vd_theme_24 ) ) ; }

Target:
private static void addModuleForAccessingCallDetails ( android.content.Context context , java.util.List < com.android.dialer.contactactions.ContactActionModule > modules , com.android.dialer.calllog.model.CoalescedRow row ) { boolean canReportInaccurateNumber = false ; boolean canSupportAssistedDialing = ! ( android.text.TextUtils.isEmpty ( row.lookupUri ( ) ) ) ; modules.add ( new com.android.dialer.contactactions.IntentModule ( context , com.android.dialer.calldetails.CallDetailsActivity.newInstance ( context , row.coalescedIds ( ) , com.android.dialer.calllog.ui.menu.Modules.createDialerContactFromRow ( row ) , canReportInaccurateNumber , canSupportAssistedDialing ) , R.string.call_details_menu_label , R.drawable.quantum_ic_info_outline_vd_theme_24 ) ) ; }
Source:
public static vogar.commands.Jack getJackCompiler ( vogar.Log log ) throws java.lang.IllegalStateException { if ( ( vogar.commands.Jack.JACK_SCRIPT ) != null ) { return new vogar.commands.Jack ( log , com.google.common.collect.Lists.newArrayList ( vogar.commands.Jack.JACK_SCRIPT.getAbsolutePath ( ) ) ) ; } if ( ( vogar.commands.Jack.JACK_JAR ) != null ) { return new vogar.commands.Jack ( log , com.google.common.collect.Lists.newArrayList ( "java" , "-jar" , vogar.commands.Jack.JACK_JAR.getAbsolutePath ( ) ) ) ; } throw new java.lang.IllegalStateException ( "Jack library not found, cannot use jack." ) ; }

Target:
public static vogar.commands.Jack getJackCommand ( vogar.Log log ) throws java.lang.IllegalStateException { if ( ( vogar.commands.Jack.JACK_SCRIPT ) != null ) { return new vogar.commands.Jack ( log , com.google.common.collect.Lists.newArrayList ( vogar.commands.Jack.JACK_SCRIPT.getAbsolutePath ( ) ) ) ; } if ( ( vogar.commands.Jack.JACK_JAR ) != null ) { return new vogar.commands.Jack ( log , com.google.common.collect.Lists.newArrayList ( "java" , "-jar" , vogar.commands.Jack.JACK_JAR.getAbsolutePath ( ) ) ) ; } throw new java.lang.IllegalStateException ( "Jack library not found, cannot use jack." ) ; }
Source:
public void test_getDoInput ( ) throws java.io.IOException { assertTrue ( "Should be set to true by default" , uc.getDoInput ( ) ) ; fileURLCon.setDoInput ( true ) ; assertTrue ( "Should have been set to true" , fileURLCon.getDoInput ( ) ) ; uc2.setDoInput ( false ) ; assertFalse ( "Should have been set to false" , uc2.getDoInput ( ) ) ; fileURLCon.connect ( ) ; fileURLCon.getInputStream ( ) ; uc2.connect ( ) ; try { uc2.getInputStream ( ) ; } catch ( java.lang.Throwable e ) { } }

Target:
public void test_getDoInput ( ) throws java.io.IOException { assertTrue ( "Should be set to true by default" , uc.getDoInput ( ) ) ; fileURLCon.setDoInput ( true ) ; assertTrue ( "Should have been set to true" , fileURLCon.getDoInput ( ) ) ; uc2.setDoInput ( false ) ; assertFalse ( "Should have been set to false" , uc2.getDoInput ( ) ) ; fileURLCon.connect ( ) ; fileURLCon.getInputStream ( ) . close ( ) ; uc2.connect ( ) ; try { uc2.getInputStream ( ) ; } catch ( java.lang.Throwable expected ) { } }
Source:
private long readId ( ) throws java.io.IOException { return readId ( mInput ) ; }

Target:
private long readId ( ) throws java.io.IOException { switch ( mIdSize ) { case 1 : return mInput.readByte ( ) ; case 2 : return mInput.readShort ( ) ; case 4 : return mInput.readInt ( ) ; case 8 : return mInput.readLong ( ) ; } throw new java.lang.IllegalArgumentException ( "ID Length must be 1, 2, 4, or 8" ) ; }
Source:
private static byte [ ] getDigest ( org.bouncycastle.asn1.x509.SubjectPublicKeyInfo spki ) { org.bouncycastle.crypto.Digest digest = org.bouncycastle.crypto.util.DigestFactory.createSHA1 ( ) ; byte [ ] resBuf = new byte [ digest.getDigestSize ( ) ] ; byte [ ] bytes = spki.getPublicKeyData ( ) . getBytes ( ) ; digest.update ( bytes , 0 , bytes.length ) ; digest.doFinal ( resBuf , 0 ) ; return resBuf ; }

Target:
private static byte [ ] getDigest ( org.bouncycastle.asn1.x509.SubjectPublicKeyInfo spki ) { org.bouncycastle.crypto.Digest digest = org.bouncycastle.crypto.digests.AndroidDigestFactory.getSHA1 ( ) ; byte [ ] resBuf = new byte [ digest.getDigestSize ( ) ] ; byte [ ] bytes = spki.getPublicKeyData ( ) . getBytes ( ) ; digest.update ( bytes , 0 , bytes.length ) ; digest.doFinal ( resBuf , 0 ) ; return resBuf ; }
Source:
public void testIsMobile ( ) { assertEquals ( PhoneNumberUtil.PhoneNumberType.MOBILE , phoneUtil.getNumberType ( com.google.i18n.phonenumbers.PhoneNumberUtilTest.BS_MOBILE ) ) ; assertEquals ( PhoneNumberUtil.PhoneNumberType.MOBILE , phoneUtil.getNumberType ( com.google.i18n.phonenumbers.PhoneNumberUtilTest.GB_MOBILE ) ) ; assertEquals ( PhoneNumberUtil.PhoneNumberType.MOBILE , phoneUtil.getNumberType ( com.google.i18n.phonenumbers.PhoneNumberUtilTest.IT_MOBILE ) ) ; assertEquals ( PhoneNumberUtil.PhoneNumberType.MOBILE , phoneUtil.getNumberType ( com.google.i18n.phonenumbers.PhoneNumberUtilTest.AR_MOBILE ) ) ; com.google.i18n.phonenumbers.Phonenumber.PhoneNumber mobileNumber = new com.google.i18n.phonenumbers.Phonenumber.PhoneNumber ( ) ; mobileNumber.setCountryCode ( 49 ) . setNationalNumber ( 15123456789L ) ; assertEquals ( PhoneNumberUtil.PhoneNumberType.MOBILE , phoneUtil.getNumberType ( mobileNumber ) ) ; }

Target:
public void testIsMobile ( ) { assertEquals ( PhoneNumberType.MOBILE , phoneUtil.getNumberType ( com.google.i18n.phonenumbers.PhoneNumberUtilTest.BS_MOBILE ) ) ; assertEquals ( PhoneNumberType.MOBILE , phoneUtil.getNumberType ( com.google.i18n.phonenumbers.PhoneNumberUtilTest.GB_MOBILE ) ) ; assertEquals ( PhoneNumberType.MOBILE , phoneUtil.getNumberType ( com.google.i18n.phonenumbers.PhoneNumberUtilTest.IT_MOBILE ) ) ; assertEquals ( PhoneNumberType.MOBILE , phoneUtil.getNumberType ( com.google.i18n.phonenumbers.PhoneNumberUtilTest.AR_MOBILE ) ) ; com.google.i18n.phonenumbers.Phonenumber.PhoneNumber mobileNumber = new com.google.i18n.phonenumbers.Phonenumber.PhoneNumber ( ) ; mobileNumber.setCountryCode ( 49 ) . setNationalNumber ( 15123456789L ) ; assertEquals ( PhoneNumberType.MOBILE , phoneUtil.getNumberType ( mobileNumber ) ) ; }
Source:
public void testHighPrecisionLong ( ) throws java.io.IOException { java.lang.String json = "[9223372036854775806.000]" ; android.util.JsonReader reader = new android.util.JsonReader ( new java.io.StringReader ( json ) ) ; reader.beginArray ( ) ; assertEquals ( 9223372036854775806L , reader.nextLong ( ) ) ; reader.endArray ( ) ; }

Target:
public void testHighPrecisionDouble_losesPrecision ( ) throws java.io.IOException { java.lang.String json = "[" + ( ( ( "9223372036854775806.000," + "9223372036854775807.000," ) + "9223372036854775808.000" ) + "]" ) ; android.util.JsonReader reader = new android.util.JsonReader ( new java.io.StringReader ( json ) ) ; reader.beginArray ( ) ; assertEquals ( java.lang.Long.MAX_VALUE , reader.nextLong ( ) ) ; assertEquals ( java.lang.Long.MAX_VALUE , reader.nextLong ( ) ) ; assertEquals ( java.lang.Long.MAX_VALUE , reader.nextLong ( ) ) ; reader.endArray ( ) ; }
Source:
private java.lang.StringBuffer subformat ( java.lang.String pluralCount , java.lang.StringBuffer result , java.text.FieldPosition fieldPosition , boolean isNegative , boolean isInteger , boolean parseAttr , int maxIntDig ) { if ( ( style ) == ( NumberFormat.PLURALCURRENCYSTYLE ) ) { java.lang.String currencyPluralPattern = currencyPluralInfo.getCurrencyPluralPattern ( pluralCount ) ; if ( ( formatPattern.equals ( currencyPluralPattern ) ) == false ) { applyPatternWithoutExpandAffix ( currencyPluralPattern , false ) ; } } expandAffixAdjustWidth ( pluralCount ) ; return subformat ( result , fieldPosition , isNegative , isInteger , parseAttr , maxIntDig ) ; }

Target:
private java.lang.StringBuffer subformat ( double number , java.lang.StringBuffer result , java.text.FieldPosition fieldPosition , boolean isNegative , boolean isInteger , boolean parseAttr ) { if ( ( currencySignCount ) == ( android.icu.text.DecimalFormat.CURRENCY_SIGN_COUNT_IN_PLURAL_FORMAT ) ) { return subformat ( currencyPluralInfo.select ( getFixedDecimal ( number ) ) , result , fieldPosition , isNegative , isInteger , parseAttr ) ; } else { return subformat ( result , fieldPosition , isNegative , isInteger , parseAttr ) ; } }
Source:
private void grantPermissionsToService ( ) { android.util.Log.i ( com.android.internal.telephony.ims.ImsServiceController.LOG_TAG , ( "Granting Runtime permissions to:" + ( getComponentName ( ) ) ) ) ; java.lang.String [ ] pkgToGrant = new java.lang.String [ ] { mComponentName.getPackageName ( ) } ; }

Target:
private void grantPermissionsToService ( ) { android.util.Log.i ( com.android.internal.telephony.ims.ImsServiceController.LOG_TAG , ( "Granting Runtime permissions to:" + ( getComponentName ( ) ) ) ) ; java.lang.String [ ] pkgToGrant = new java.lang.String [ ] { mComponentName.getPackageName ( ) } ; try { if ( ( mPackageManager ) != null ) { mPackageManager.grantDefaultPermissionsToEnabledImsServices ( pkgToGrant , mContext.getUserId ( ) ) ; } } catch ( android.os.RemoteException e ) { android.util.Log.w ( com.android.internal.telephony.ims.ImsServiceController.LOG_TAG , "Unable to grant permissions, binder died." ) ; } }
Source:
private void handleRadioProxyExceptionForRR ( com.android.internal.telephony.RILRequest rr , java.lang.String caller , java.lang.Exception e ) { riljLoge ( ( ( caller + ": " ) + e ) ) ; resetProxyAndRequestList ( ) ; }

Target:
private void handleRadioProxyExceptionForRR ( com.android.internal.telephony.RILRequest rr , java.lang.String caller , java.lang.Exception e ) { riljLoge ( ( ( caller + ": " ) + e ) ) ; resetProxyAndRequestList ( ) ; mRilHandler.sendMessageDelayed ( mRilHandler.obtainMessage ( com.android.internal.telephony.RIL.EVENT_RADIO_PROXY_DEAD , mRadioProxyCookie.incrementAndGet ( ) ) , com.android.internal.telephony.RIL.IRADIO_GET_SERVICE_DELAY_MILLIS ) ; }
Source:
BRANCH ( android.appsecurity.cts.cc44ee Merge ) { }

Target:
private static void readLines ( java.io.InputStream in , java.util.List < java.lang.String > lines ) { java.io.BufferedReader br = null ; try { br = new java.io.BufferedReader ( new java.io.InputStreamReader ( in ) ) ; java.lang.String line ; while ( ( line = android.appsecurity.cts.AppSecurityTests.AdbOutputReader.readLineIgnoreException ( br ) ) != null ) { lines.add ( line ) ; } } catch ( java.io.IOException ignore ) { } finally { if ( br != null ) { try { br.close ( ) ; } catch ( java.io.IOException ignore ) { } } } }
Source:
private void fetchPktcntNative ( android.net.wifi.RssiPacketCountInfo info ) { int [ ] counters = null ; try { counters = mClientInterface.getPacketCounters ( ) ; if ( ( counters == null ) || ( ( counters.length ) != 2 ) ) { return ; } } catch ( android.os.RemoteException e1 ) { } info.txgood = counters [ 0 ] ; info.txbad = counters [ 1 ] ; }

Target:
public boolean syncInitialize ( com.android.internal.util.AsyncChannel channel ) { android.os.Message resultMsg = channel.sendMessageSynchronously ( com.android.server.wifi.WifiStateMachine.CMD_INITIALIZE ) ; boolean result = ( resultMsg.arg1 ) != ( com.android.server.wifi.WifiStateMachine.FAILURE ) ; resultMsg.recycle ( ) ; return result ; }
Source:
private static boolean generate ( int minApi , int currentApi , @ com.android.annotations.NonNull java.io.File currentJar , @ com.android.annotations.NonNull java.util.List < java.lang.String > patterns , @ com.android.annotations.NonNull java.lang.String outPath ) throws java.io.IOException { com.android.tools.metalava.apilevels.AndroidJarReader reader = new com.android.tools.metalava.apilevels.AndroidJarReader ( patterns , minApi , currentJar , currentApi ) ; com.android.tools.metalava.apilevels.Api api = reader.getApi ( ) ; return com.android.tools.metalava.apilevels.ApiGenerator.createApiFile ( new java.io.File ( outPath ) , api ) ; }

Target:
private static boolean generate ( int minApi , int currentApi , @ com.android.annotations.NonNull java.io.File currentJar , @ com.android.annotations.NonNull java.util.List < java.lang.String > patterns , @ com.android.annotations.NonNull java.lang.String outPath , @ com.android.annotations.Nullable com.android.tools.metalava.model.Codebase codebase ) throws java.io.IOException { com.android.tools.metalava.apilevels.AndroidJarReader reader = new com.android.tools.metalava.apilevels.AndroidJarReader ( patterns , minApi , currentJar , currentApi , codebase ) ; com.android.tools.metalava.apilevels.Api api = reader.getApi ( ) ; return com.android.tools.metalava.apilevels.ApiGenerator.createApiFile ( new java.io.File ( outPath ) , api ) ; }
Source:
public void setRadioIndicationUpdateMode ( @ android.telephony.TelephonyManager.IndicationFilters int filters , @ android.telephony.TelephonyManager.IndicationUpdateMode int updateMode ) { try { com.android.internal.telephony.ITelephony telephony = getITelephony ( ) ; if ( telephony != null ) { telephony.setRadioIndicationUpdateMode ( getSubId ( ) , filters , updateMode ) ; } } catch ( android.os.RemoteException ex ) { ex.rethrowAsRuntimeException ( ) ; } }

Target:
public void setRadioIndicationUpdateMode ( @ android.telephony.TelephonyManager.IndicationFilters int filters , @ android.telephony.TelephonyManager.IndicationUpdateMode int updateMode ) { try { com.android.internal.telephony.ITelephony telephony = getITelephony ( ) ; if ( telephony != null ) { telephony.setRadioIndicationUpdateMode ( getSubId ( ) , filters , updateMode ) ; } } catch ( android.os.RemoteException ex ) { if ( ! ( isSystemProcess ( ) ) ) { ex.rethrowAsRuntimeException ( ) ; } } }
Source:
public void testAbiOnlyWithMultiMatch ( ) { com.android.build.SplitOutput match ; java.util.List < com.android.build.SplitOutput > list = com.google.common.collect.Lists.newArrayList ( ) ; list.add ( com.android.ide.common.build.SplitOutputMatcherTest.getUniversalOutput ( 1 ) ) ; list.add ( com.android.ide.common.build.SplitOutputMatcherTest.getAbiOutput ( "foo" , 2 ) ) ; list.add ( ( match = com.android.ide.common.build.SplitOutputMatcherTest.getAbiOutput ( "bar" , 3 ) ) ) ; com.android.build.SplitOutput result = com.android.ide.common.build.SplitOutputMatcherTest.computeBestOutput ( list , 160 , "bar" , "foo" ) ; assertEquals ( match , result ) ; }

Target:
public void testWrongVariantLevelAbiFilter ( ) { java.util.List < com.android.build.VariantOutput > list = com.google.common.collect.Lists.newArrayList ( ) ; list.add ( com.android.ide.common.build.SplitOutputMatcherTest.getUniversalOutput ( 1 ) ) ; java.util.List < java.io.File > result = com.android.ide.common.build.SplitOutputMatcherTest.computeBestOutput ( list , com.google.common.collect.Sets.newHashSet ( "bar" , "foo" ) , 160 , "zzz" ) ; assertEquals ( 0 , result.size ( ) ) ; }
Source:
private void buildAvdList ( java.util.ArrayList < com.android.sdklib.internal.avd.AvdInfo > allList , com.android.utils.ILogger log ) throws com.android.prefs.AndroidLocation.AndroidLocationException { java.io.File [ ] avds = buildAvdFilesList ( ) ; if ( avds != null ) { for ( java.io.File avd : avds ) { com.android.sdklib.internal.avd.AvdInfo info = parseAvdInfo ( avd , log ) ; if ( info != null ) { allList.add ( info ) ; } } } }

Target:
private void buildAvdList ( java.util.ArrayList < com.android.sdklib.internal.avd.AvdInfo > allList , com.android.utils.ILogger log ) throws com.android.prefs.AndroidLocation.AndroidLocationException { java.io.File [ ] avds = buildAvdFilesList ( ) ; if ( avds != null ) { for ( java.io.File avd : avds ) { com.android.sdklib.internal.avd.AvdInfo info = parseAvdInfo ( avd , log ) ; if ( ( info != null ) && ( ! ( allList.contains ( info ) ) ) ) { allList.add ( info ) ; } } } }
Source:
public void onReceivedSslError ( final android.webkit.ValueCallback < java.lang.Boolean > callback , android.net.http.SslError error ) { android.webkit.SslErrorHandler handler = new android.webkit.SslErrorHandler ( ) { @ java.lang.Override public void proceed ( ) { callback.onReceiveValue ( true ) ; } @ java.lang.Override public void cancel ( ) { callback.onReceiveValue ( false ) ; } } ; org.chromium.base.TraceEvent.begin ( ) ; if ( com.android.webview.chromium.WebViewContentsClientAdapter.TRACE ) android.util.Log.d ( com.android.webview.chromium.WebViewContentsClientAdapter.TAG , "onReceivedSslError" ) ; mWebViewClient.onReceivedSslError ( mWebView , handler , error ) ; org.chromium.base.TraceEvent.end ( ) ; }

Target:
public void onReceivedSslError ( final android.webkit.ValueCallback < java.lang.Boolean > callback , android.net.http.SslError error ) { try { org.chromium.base.TraceEvent.begin ( "WebViewContentsClientAdapter.onReceivedSslError" ) ; android.webkit.SslErrorHandler handler = new android.webkit.SslErrorHandler ( ) { @ java.lang.Override public void proceed ( ) { callback.onReceiveValue ( true ) ; } @ java.lang.Override public void cancel ( ) { callback.onReceiveValue ( false ) ; } } ; if ( com.android.webview.chromium.WebViewContentsClientAdapter.TRACE ) android.util.Log.d ( com.android.webview.chromium.WebViewContentsClientAdapter.TAG , "onReceivedSslError" ) ; mWebViewClient.onReceivedSslError ( mWebView , handler , error ) ; } finally { org.chromium.base.TraceEvent.end ( "WebViewContentsClientAdapter.onReceivedSslError" ) ; } }
Source:
public boolean isDeviceManaged ( ) { return ( getDeviceOwnerComponentOnAnyUser ( ) ) != null ; }

Target:
public java.util.List < java.lang.String > getDelegatePackages ( @ android.annotation.NonNull android.content.ComponentName admin , @ android.annotation.NonNull java.lang.String delegationScope ) { throwIfParentInstance ( "getDelegatePackages" ) ; if ( ( mService ) != null ) { try { return mService.getDelegatePackages ( admin , delegationScope ) ; } catch ( android.os.RemoteException e ) { throw e.rethrowFromSystemServer ( ) ; } } return null ; }
Source:
public void testAospPropertyContexts ( ) throws java.lang.Exception { devicePcFile = java.io.File.createTempFile ( "property_contexts" , ".tmp" ) ; devicePcFile.deleteOnExit ( ) ; mDevice.pullFile ( "/plat_property_contexts" , devicePcFile ) ; aospPcFile = copyResourceToTempFile ( "/plat_property_contexts" ) ; assertFileEquals ( aospPcFile , devicePcFile ) ; }

Target:
public void testAospPropertyContexts ( ) throws java.lang.Exception { devicePcFile = java.io.File.createTempFile ( "plat_property_contexts" , ".tmp" ) ; devicePcFile.deleteOnExit ( ) ; if ( ! ( mDevice.pullFile ( "/system/etc/selinux/plat_property_contexts" , devicePcFile ) ) ) { mDevice.pullFile ( "/plat_property_contexts" , devicePcFile ) ; } aospPcFile = copyResourceToTempFile ( "/plat_property_contexts" ) ; assertFileEquals ( aospPcFile , devicePcFile ) ; }
Source:
public static float rawCopySign ( float magnitude , float sign ) { return java.lang.Float.intBitsToFloat ( ( ( ( java.lang.Float.floatToRawIntBits ( sign ) ) & ( sun.misc.FloatConsts.SIGN_BIT_MASK ) ) | ( ( java.lang.Float.floatToRawIntBits ( magnitude ) ) & ( ( sun.misc.FloatConsts.EXP_BIT_MASK ) | ( sun.misc.FloatConsts.SIGNIF_BIT_MASK ) ) ) ) ) ; }

Target:
public static float rawCopySign ( float magnitude , float sign ) { return java.lang.Math.copySign ( magnitude , sign ) ; }
Source:
public boolean sendExtraCommand ( java.lang.String provider , java.lang.String command , android.os.Bundle extras ) { if ( provider == null ) { throw new java.lang.NullPointerException ( ) ; } checkPermissionsSafe ( provider , null ) ; if ( ( mContext.checkCallingOrSelfPermission ( com.android.server.LocationManagerService.ACCESS_LOCATION_EXTRA_COMMANDS ) ) != ( android.content.pm.PackageManager.PERMISSION_GRANTED ) ) { throw new java.lang.SecurityException ( "Requires ACCESS_LOCATION_EXTRA_COMMANDS permission" ) ; } synchronized ( mLock ) { com.android.server.location.LocationProviderInterface p = mProvidersByName.get ( provider ) ; if ( p == null ) { return false ; } return p.sendExtraCommand ( command , extras ) ; } }

Target:
public boolean sendExtraCommand ( java.lang.String provider , java.lang.String command , android.os.Bundle extras ) { if ( provider == null ) { throw new java.lang.NullPointerException ( ) ; } checkResolutionLevelIsSufficientForProviderUse ( getCallerAllowedResolutionLevel ( ) , provider ) ; if ( ( mContext.checkCallingOrSelfPermission ( com.android.server.LocationManagerService.ACCESS_LOCATION_EXTRA_COMMANDS ) ) != ( android.content.pm.PackageManager.PERMISSION_GRANTED ) ) { throw new java.lang.SecurityException ( "Requires ACCESS_LOCATION_EXTRA_COMMANDS permission" ) ; } synchronized ( mLock ) { com.android.server.location.LocationProviderInterface p = mProvidersByName.get ( provider ) ; if ( p == null ) return false ; return p.sendExtraCommand ( command , extras ) ; } }
Source:
public com.android.sched.vfs.InputVFile getFile ( @ javax.annotation.Nonnull com.android.jack.library.FileType fileType , @ javax.annotation.Nonnull com.android.sched.vfs.VPath typePath ) throws com.android.jack.library.FileTypeDoesNotExistException { try { return getSectionVFS ( fileType ) . getRootInputVDir ( ) . getInputVFile ( buildFileVPath ( fileType , typePath ) ) ; } catch ( com.android.sched.util.file.NotFileOrDirectoryException e ) { throw new com.android.jack.library.FileTypeDoesNotExistException ( getLocation ( ) , typePath , fileType ) ; } catch ( com.android.sched.util.file.NoSuchFileException e ) { throw new com.android.jack.library.FileTypeDoesNotExistException ( getLocation ( ) , typePath , fileType ) ; } catch ( com.android.sched.util.file.CannotCreateFileException e ) { throw new com.android.jack.library.FileTypeDoesNotExistException ( getLocation ( ) , typePath , fileType ) ; } }

Target:
public com.android.sched.vfs.InputOutputVFile getFile ( @ javax.annotation.Nonnull com.android.jack.library.FileType fileType , @ javax.annotation.Nonnull com.android.sched.vfs.VPath typePath ) throws com.android.jack.library.FileTypeDoesNotExistException { try { return getSectionVFS ( fileType ) . getRootInputOutputVDir ( ) . getInputVFile ( buildFileVPath ( fileType , typePath ) ) ; } catch ( com.android.sched.util.file.NotFileOrDirectoryException e ) { throw new com.android.jack.library.FileTypeDoesNotExistException ( getLocation ( ) , typePath , fileType ) ; } catch ( com.android.sched.util.file.NoSuchFileException e ) { throw new com.android.jack.library.FileTypeDoesNotExistException ( getLocation ( ) , typePath , fileType ) ; } catch ( com.android.sched.util.file.CannotCreateFileException e ) { throw new com.android.jack.library.FileTypeDoesNotExistException ( getLocation ( ) , typePath , fileType ) ; } }
Source:
private com.android.draw9patch.ui.ImageViewer.UpdateRegionInfo getVerticalPatchLeft ( int y ) { return getContainingPatch ( patchInfo.verticalPatchMarkers , y , com.android.draw9patch.ui.ImageViewer.UpdateRegion.LEFT_PATCH ) ; }

Target:
private com.android.draw9patch.ui.ImageViewer.UpdateRegionInfo findVerticalPatch ( int x , int y ) { java.util.List < com.android.draw9patch.ui.Pair < java.lang.Integer > > markers ; com.android.draw9patch.ui.ImageViewer.UpdateRegion region ; if ( x < ( ( image.getWidth ( ) ) / 2 ) ) { markers = patchInfo.verticalPatchMarkers ; region = com.android.draw9patch.ui.ImageViewer.UpdateRegion.LEFT_PATCH ; } else { markers = patchInfo.verticalPaddingMarkers ; region = com.android.draw9patch.ui.ImageViewer.UpdateRegion.RIGHT_PADDING ; } return getContainingPatch ( markers , y , region ) ; }
Source:
public android.content.pm.ConfigurationInfo getDeviceConfigurationInfo ( ) { android.content.pm.ConfigurationInfo config = new android.content.pm.ConfigurationInfo ( ) ; synchronized ( this ) { config.reqTouchScreen = mConfiguration.touchscreen ; config.reqKeyboardType = mConfiguration.keyboard ; config.reqNavigation = mConfiguration.navigation ; if ( ( mConfiguration.navigation ) != ( android.content.res.Configuration.NAVIGATION_NONAV ) ) { config.reqInputFeatures |= android.content.pm.ConfigurationInfo.INPUT_FEATURE_FIVE_WAY_NAV ; } if ( ( mConfiguration.keyboard ) != ( android.content.res.Configuration.KEYBOARD_UNDEFINED ) ) { config.reqInputFeatures |= android.content.pm.ConfigurationInfo.INPUT_FEATURE_HARD_KEYBOARD ; } } return config ; }

Target:
public android.content.pm.ConfigurationInfo getDeviceConfigurationInfo ( ) { android.content.pm.ConfigurationInfo config = new android.content.pm.ConfigurationInfo ( ) ; synchronized ( this ) { config.reqTouchScreen = mConfiguration.touchscreen ; config.reqKeyboardType = mConfiguration.keyboard ; config.reqNavigation = mConfiguration.navigation ; if ( ( ( mConfiguration.navigation ) == ( android.content.res.Configuration.NAVIGATION_DPAD ) ) || ( ( mConfiguration.navigation ) == ( android.content.res.Configuration.NAVIGATION_TRACKBALL ) ) ) { config.reqInputFeatures |= android.content.pm.ConfigurationInfo.INPUT_FEATURE_FIVE_WAY_NAV ; } if ( ( ( mConfiguration.keyboard ) != ( android.content.res.Configuration.KEYBOARD_UNDEFINED ) ) && ( ( mConfiguration.keyboard ) != ( android.content.res.Configuration.KEYBOARD_NOKEYS ) ) ) { config.reqInputFeatures |= android.content.pm.ConfigurationInfo.INPUT_FEATURE_HARD_KEYBOARD ; } config.reqGlEsVersion = GL_ES_VERSION ; } return config ; }
Source:
public final void activityDestroyed ( android.os.IBinder token ) { if ( DEBUG_SWITCH ) android.util.Slog.v ( com.android.server.am.ActivityManagerService.TAG_SWITCH , ( "ACTIVITY DESTROYED: " + token ) ) ; synchronized ( this ) { com.android.server.am.ActivityStack stack = com.android.server.am.ActivityRecord.getStackLocked ( token ) ; if ( stack != null ) { stack.activityDestroyedLocked ( token , "activityDestroyed" ) ; } } }

Target:
public final void activityDestroyed ( android.os.IBinder token ) { if ( com.android.server.am.ActivityManagerDebugConfig.DEBUG_SWITCH ) android.util.Slog.v ( com.android.server.am.ActivityManagerService.TAG_SWITCH , ( "ACTIVITY DESTROYED: " + token ) ) ; synchronized ( this ) { com.android.server.am.ActivityStack stack = com.android.server.am.ActivityRecord.getStackLocked ( token ) ; if ( stack != null ) { stack.activityDestroyedLocked ( token , "activityDestroyed" ) ; } } }
Source:
public void setAbsoluteVolume ( int volume ) { int avrcpVolume = convertToAvrcpVolume ( volume ) ; avrcpVolume = java.lang.Math.min ( com.android.bluetooth.avrcp.Avrcp.AVRCP_MAX_VOL , java.lang.Math.max ( 0 , avrcpVolume ) ) ; mHandler.removeMessages ( com.android.bluetooth.avrcp.Avrcp.MESSAGE_ADJUST_VOLUME ) ; android.os.Message msg = mHandler.obtainMessage ( com.android.bluetooth.avrcp.Avrcp.MESSAGE_SET_ABSOLUTE_VOLUME , avrcpVolume , 0 ) ; mHandler.sendMessage ( msg ) ; }

Target:
public void setAbsoluteVolume ( int volume ) { if ( volume == ( mLocalVolume ) ) { if ( com.android.bluetooth.avrcp.Avrcp.DEBUG ) android.util.Log.v ( com.android.bluetooth.avrcp.Avrcp.TAG , ( "setAbsoluteVolume is setting same index, ignore " + volume ) ) ; return ; } mHandler.removeMessages ( com.android.bluetooth.avrcp.Avrcp.MESSAGE_ADJUST_VOLUME ) ; android.os.Message msg = mHandler.obtainMessage ( com.android.bluetooth.avrcp.Avrcp.MESSAGE_SET_ABSOLUTE_VOLUME , volume , 0 ) ; mHandler.sendMessage ( msg ) ; }
Source:
void setBeamShareActivityState ( boolean enabled ) { mContext.getPackageManager ( ) . setComponentEnabledSetting ( new android.content.ComponentName ( "com.android.nfc" , "com.android.nfc.BeamShareActivity" ) , ( enabled ? android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_ENABLED : android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED ) , PackageManager.DONT_KILL_APP ) ; }

Target:
void setBeamShareActivityState ( boolean enabled ) { android.os.UserManager um = ( ( android.os.UserManager ) ( mContext.getSystemService ( Context.USER_SERVICE ) ) ) ; java.util.List < android.os.UserHandle > luh = um.getUserProfiles ( ) ; for ( android.os.UserHandle uh : luh ) { enforceBeamShareActivityPolicy ( mContext , uh , enabled ) ; } }
Source:
public void testProcessChldTypeReleaseHeldRinging ( ) throws java.lang.Exception { com.android.server.telecom.Call ringingCall = createRingingCall ( ) ; boolean didProcess = mBluetoothPhoneService.mBinder.processChld ( com.android.server.telecom.tests.BluetoothPhoneServiceTest.CHLD_TYPE_RELEASEHELD ) ; org.mockito.Mockito.verify ( mMockCallsManager ) . rejectCall ( org.mockito.Matchers.eq ( ringingCall ) , org.mockito.Matchers.eq ( false ) , org.mockito.ArgumentMatchers.nullable ( java.lang.String.class ) ) ; assertEquals ( didProcess , true ) ; }

Target:
private com.android.server.telecom.Call createDisconnectedCall ( ) { com.android.server.telecom.Call call = org.mockito.Mockito.mock ( com.android.server.telecom.Call.class ) ; org.mockito.Mockito.when ( mMockCallsManager.getFirstCallWithState ( CallState.DISCONNECTED ) ) . thenReturn ( call ) ; return call ; }
Source:
public void logp ( java.util.logging.Level level , java.lang.String sourceClass , java.lang.String sourceMethod , java.lang.String msg , java.lang.Object [ ] params ) { if ( ( ( level.intValue ( ) ) < ( levelValue ) ) || ( ( levelValue ) == ( java.util.logging.Logger.offValue ) ) ) { return ; } java.util.logging.LogRecord lr = new java.util.logging.LogRecord ( level , msg ) ; lr.setSourceClassName ( sourceClass ) ; lr.setSourceMethodName ( sourceMethod ) ; lr.setParameters ( params ) ; doLog ( lr ) ; }

Target:
public void logp ( java.util.logging.Level level , java.lang.String sourceClass , java.lang.String sourceMethod , java.lang.String msg , java.lang.Object param1 ) { if ( ! ( isLoggable ( level ) ) ) { return ; } java.util.logging.LogRecord lr = new java.util.logging.LogRecord ( level , msg ) ; lr.setSourceClassName ( sourceClass ) ; lr.setSourceMethodName ( sourceMethod ) ; java.lang.Object [ ] params = new java.lang.Object [ ] { param1 } ; lr.setParameters ( params ) ; doLog ( lr ) ; }