auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
void addEntry ( int hash , K key , V value , int bucketIndex ) { super . addEntry ( hash , key , value , bucketIndex ) ; java.util.LinkedHashMap.LinkedHashMapEntry < K , V > eldest = header.after ; if ( removeEldestEntry ( eldest ) ) { removeEntryForKey ( eldest.key ) ; } }

Target:
void addEntry ( int hash , K key , V value , int bucketIndex ) { java.util.LinkedHashMap.LinkedHashMapEntry < K , V > eldest = header.after ; if ( ( eldest != ( header ) ) && ( removeEldestEntry ( eldest ) ) ) { removeEntryForKey ( eldest.key ) ; } super . addEntry ( hash , key , value , bucketIndex ) ; }
Source:
public void test_isInfiniteF ( ) { assertTrue ( "Infinity check failed" , ( ( ( java.lang.Float.isInfinite ( java.lang.Float.POSITIVE_INFINITY ) ) && ( java.lang.Float.isInfinite ( java.lang.Float.NEGATIVE_INFINITY ) ) ) && ( ! ( java.lang.Float.isInfinite ( 1.0F ) ) ) ) ) ; }

Target:
public void test_isInfiniteF ( ) { assertTrue ( java.lang.Float.isInfinite ( java.lang.Float.POSITIVE_INFINITY ) ) ; assertTrue ( java.lang.Float.isInfinite ( java.lang.Float.NEGATIVE_INFINITY ) ) ; assertFalse ( java.lang.Float.isInfinite ( java.lang.Float.MAX_VALUE ) ) ; assertFalse ( java.lang.Float.isInfinite ( java.lang.Float.MIN_VALUE ) ) ; assertFalse ( java.lang.Float.isInfinite ( java.lang.Float.NaN ) ) ; assertFalse ( java.lang.Float.isInfinite ( 1.0F ) ) ; }
Source:
public java.lang.String getNamespace ( ) { if ( ( mNamespace ) == null ) { com.android.sdklib.xml.ManifestData manifestData = com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper.parseForData ( mProject ) ; if ( manifestData != null ) { java.lang.String javaPackage = manifestData.getPackage ( ) ; mNamespace = java.lang.String.format ( AndroidConstants.NS_CUSTOM_RESOURCES , javaPackage ) ; } } return mNamespace ; }

Target:
public java.lang.String getNamespace ( ) { if ( ( mNamespace ) == null ) { com.android.sdklib.xml.ManifestData manifestData = com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper.parseForData ( mProject ) ; if ( manifestData != null ) { java.lang.String javaPackage = manifestData.getPackage ( ) ; mNamespace = java.lang.String.format ( AdtConstants.NS_CUSTOM_RESOURCES , javaPackage ) ; } } return mNamespace ; }
Source:
public boolean enterIfInterruptibly ( com.google.common.util.concurrent.Monitor.Guard guard ) throws java.lang.InterruptedException { if ( ( guard.monitor ) != ( this ) ) { throw new java.lang.IllegalMonitorStateException ( ) ; } final java.util.concurrent.locks.ReentrantLock lock = this . lock ; lock.lockInterruptibly ( ) ; boolean satisfied = false ; try { satisfied = guard.isSatisfied ( ) ; } finally { if ( ! satisfied ) { lock.unlock ( ) ; } } return satisfied ; }

Target:
public boolean enterIf ( com.google.common.util.concurrent.Monitor.Guard guard ) { if ( ( guard.monitor ) != ( this ) ) { throw new java.lang.IllegalMonitorStateException ( ) ; } final java.util.concurrent.locks.ReentrantLock lock = this . lock ; lock.lock ( ) ; boolean satisfied = false ; try { return satisfied = guard.isSatisfied ( ) ; } finally { if ( ! satisfied ) { lock.unlock ( ) ; } } }
Source:
public void testKeyValueBackupAndRestore ( ) throws java.lang.Exception { checkDeviceTest ( "checkSharedPrefIsEmpty" ) ; checkDeviceTest ( "saveSharedPreferencesAndNotifyBackupManager" ) ; backupNowAndAssertSuccess ( android.cts.backup.KeyValueBackupRestoreHostSideTest.KEY_VALUE_RESTORE_APP_PACKAGE ) ; junit.framework.Assert.assertNull ( uninstallPackage ( android.cts.backup.KeyValueBackupRestoreHostSideTest.KEY_VALUE_RESTORE_APP_PACKAGE ) ) ; installPackage ( android.cts.backup.KeyValueBackupRestoreHostSideTest.KEY_VALUE_RESTORE_APP_APK ) ; checkDeviceTest ( "checkSharedPreferencesAreRestored" ) ; }

Target:
public void testKeyValueBackupAndRestore ( ) throws java.lang.Exception { if ( ! ( mIsBackupSupported ) ) { com.android.tradefed.log.LogUtil.CLog.i ( "android.software.backup feature is not supported on this device" ) ; return ; } checkDeviceTest ( "checkSharedPrefIsEmpty" ) ; checkDeviceTest ( "saveSharedPreferencesAndNotifyBackupManager" ) ; backupNowAndAssertSuccess ( android.cts.backup.KeyValueBackupRestoreHostSideTest.KEY_VALUE_RESTORE_APP_PACKAGE ) ; junit.framework.Assert.assertNull ( uninstallPackage ( android.cts.backup.KeyValueBackupRestoreHostSideTest.KEY_VALUE_RESTORE_APP_PACKAGE ) ) ; installPackage ( android.cts.backup.KeyValueBackupRestoreHostSideTest.KEY_VALUE_RESTORE_APP_APK ) ; checkDeviceTest ( "checkSharedPreferencesAreRestored" ) ; }
Source:
public void setA2dpAudioState ( int state ) { android.os.Message msg = mHandler.obtainMessage ( com.android.bluetooth.avrcp.Avrcp.MSG_SET_A2DP_AUDIO_STATE , state , 0 ) ; mHandler.sendMessage ( msg ) ; }

Target:
private void setBrowsedPlayerRequestFromNative ( byte [ ] address , int playerId ) { final com.android.bluetooth.avrcp.Avrcp.AvrcpMessageHandler handler = mHandler ; if ( handler == null ) { if ( com.android.bluetooth.avrcp.Avrcp.DEBUG ) android.util.Log.d ( com.android.bluetooth.avrcp.Avrcp.TAG , "setBrowsedPlayerRequestFromNative: mHandler is already null" ) ; return ; } android.os.Message msg = handler.obtainMessage ( com.android.bluetooth.avrcp.Avrcp.MSG_NATIVE_REQ_SET_BR_PLAYER , playerId , 0 ) ; msg.obj = address ; handler.sendMessage ( msg ) ; }
Source:
public void testCompatRevoked22 ( ) throws java.lang.Exception { assertNull ( getDevice ( ) . installPackage ( com.android.cts.migration.MigrationHelper.getTestFile ( mCtsBuild , android.appsecurity.cts.PermissionsHostTest.APK_22 ) , false , false ) ) ; try { runDeviceTests ( android.appsecurity.cts.PermissionsHostTest.PKG , "com.android.cts.usepermission.UsePermissionTest22" , "testCompatRevoked_part1" ) ; fail ( "App must be killed on a permission revoke" ) ; } catch ( java.lang.AssertionError expected ) { } runDeviceTests ( android.appsecurity.cts.PermissionsHostTest.PKG , "com.android.cts.usepermission.UsePermissionTest22" , "testCompatRevoked_part2" ) ; }

Target:
public void testKill ( ) throws java.lang.Exception { assertNull ( getDevice ( ) . installPackage ( com.android.cts.migration.MigrationHelper.getTestFile ( mCtsBuild , android.appsecurity.cts.PermissionsHostTest.APK_23 ) , false , false ) ) ; try { runDeviceTests ( android.appsecurity.cts.PermissionsHostTest.USES_PERMISSION_PKG , "com.android.cts.usepermission.UsePermissionTest23" , "testKill" ) ; fail ( "Expected remote failure" ) ; } catch ( java.lang.AssertionError expected ) { } }
Source:
public void testAllowBackup ( ) throws java.lang.Exception { mEnabled = java.util.Collections.singleton ( ManifestOrderDetector.ALLOW_BACKUP ) ; assertEquals ( ( "AndroidManifest.xml:9: Warning: Should explicitly set android:allowBackup to " + ( ( ( ( "true or false (it's true by default, and that can have some security " + "implications for the application\'s data) [AllowBackup]\n" ) + " <application\n" ) + " ^\n" ) + "0 errors, 1 warnings\n" ) ) , lintProject ( "AndroidManifest.xml" , "res/values/strings.xml" ) ) ; }

Target:
public void testAllowBackup ( ) throws java.lang.Exception { mEnabled = java.util.Collections.singleton ( ManifestOrderDetector.ALLOW_BACKUP ) ; assertEquals ( ( "AndroidManifest.xml:9: Warning: Should explicitly set android:allowBackup to " + ( ( ( ( "true or false (it's true by default, and that can have some security " + "implications for the application\'s data) [AllowBackup]\n" ) + " <application\n" ) + " ^\n" ) + "0 errors, 1 warnings\n" ) ) , lintProject ( "AndroidManifest.xml" , "apicheck/minsdk14.xml=>AndroidManifest.xml" , "res/values/strings.xml" ) ) ; }
Source:
public final long getLong ( ) { checkNotFreed ( ) ; int newPosition = ( position ) + ( libcore.io.SizeOf.LONG ) ; if ( newPosition > ( limit ) ) { throw new java.nio.BufferUnderflowException ( ) ; } long result = this . block.peekLong ( ( ( offset ) + ( position ) ) , order ) ; position = newPosition ; return result ; }

Target:
public final long getLong ( ) { checkIsAccessible ( ) ; int newPosition = ( position ) + ( libcore.io.SizeOf.LONG ) ; if ( newPosition > ( limit ) ) { throw new java.nio.BufferUnderflowException ( ) ; } long result = this . block.peekLong ( ( ( offset ) + ( position ) ) , order ) ; position = newPosition ; return result ; }
Source:
private java.lang.StringBuffer subformat ( java.lang.String pluralCount , java.lang.StringBuffer result , java.text.FieldPosition fieldPosition , boolean isNegative , boolean isInteger , boolean parseAttr ) { if ( ( style ) == ( android.icu.text.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 ) ; }

Target:
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 ) ; }
Source:
public static void main ( java.lang.String [ ] args ) { BadFinalizer bf = new BadFinalizer ( ) ; java.lang.System.out.println ( "Constructed object." ) ; bf = null ; java.lang.System.out.println ( "Nulled. Requestion gc." ) ; java.lang.Runtime.getRuntime ( ) . gc ( ) ; for ( int i = 0 ; i < 8 ; i ++ ) { BadFinalizer.snooze ( 4000 ) ; java.lang.System.out.println ( "Requesting another GC." ) ; java.lang.Runtime.getRuntime ( ) . gc ( ) ; } java.lang.System.out.println ( "Done waiting." ) ; java.lang.System.exit ( 0 ) ; }

Target:
public static void main ( java.lang.String [ ] args ) { Main.BadFinalizer bf = new Main.BadFinalizer ( ) ; java.lang.System.out.println ( "About to null reference and request GC." ) ; bf = null ; java.lang.Runtime.getRuntime ( ) . gc ( ) ; for ( int i = 0 ; i < 8 ; i ++ ) { Main.snooze ( 4000 ) ; java.lang.Runtime.getRuntime ( ) . gc ( ) ; } java.lang.System.out.println ( "UNREACHABLE" ) ; java.lang.System.exit ( 0 ) ; }
Source:
void cleanUpResourcesLI ( ) { java.lang.String sourceFile = getCodePath ( ) ; if ( ( instructionSet ) == null ) { throw new java.lang.IllegalStateException ( "instructionSet == null" ) ; } int retCode = mInstaller.rmdex ( sourceFile , instructionSet ) ; if ( retCode < 0 ) { android.util.Slog.w ( com.android.server.pm.PackageManagerService.TAG , ( ( ( ( "Couldn't remove dex file for package: " + " at location " ) + ( sourceFile.toString ( ) ) ) + ", retcode=" ) + retCode ) ) ; } cleanUp ( ) ; }

Target:
void cleanUpResourcesLI ( ) { java.lang.String sourceFile = getCodePath ( ) ; if ( ( instructionSet ) == null ) { throw new java.lang.IllegalStateException ( "instructionSet == null" ) ; } final java.lang.String dexCodeInstructionSet = com.android.server.pm.PackageManagerService.getDexCodeInstructionSet ( instructionSet ) ; int retCode = mInstaller.rmdex ( sourceFile , dexCodeInstructionSet ) ; if ( retCode < 0 ) { android.util.Slog.w ( com.android.server.pm.PackageManagerService.TAG , ( ( ( ( "Couldn't remove dex file for package: " + " at location " ) + ( sourceFile.toString ( ) ) ) + ", retcode=" ) + retCode ) ) ; } cleanUp ( ) ; }
Source:
public boolean processCountryZones ( java.lang.String countryIso , java.lang.String defaultTimeZoneId , boolean everUsesUtc , java.util.List < java.lang.String > timeZoneIds , java.lang.String debugInfo ) throws org.xmlpull.v1.XmlPullParserException { libcore.util.CountryTimeZones countryTimeZones = libcore.util.CountryTimeZones.createValidated ( countryIso , defaultTimeZoneId , everUsesUtc , timeZoneIds , debugInfo ) ; countryTimeZonesList.add ( countryTimeZones ) ; return libcore.util.TimeZoneFinder.TimeZonesProcessor.CONTINUE ; }

Target:
public boolean processCountryZones ( java.lang.String countryIso , java.lang.String defaultTimeZoneId , boolean everUsesUtc , java.util.List < libcore.util.CountryTimeZones.TimeZoneMapping > timeZoneMappings , java.lang.String debugInfo ) throws org.xmlpull.v1.XmlPullParserException { libcore.util.CountryTimeZones countryTimeZones = libcore.util.CountryTimeZones.createValidated ( countryIso , defaultTimeZoneId , everUsesUtc , timeZoneMappings , debugInfo ) ; countryTimeZonesList.add ( countryTimeZones ) ; return libcore.util.TimeZoneFinder.TimeZonesProcessor.CONTINUE ; }
Source:
public java.lang.String getNameForUid ( int uid ) { synchronized ( mPackages ) { java.lang.Object obj = mSettings.getUserIdLPr ( android.os.UserId.getAppId ( uid ) ) ; if ( obj instanceof com.android.server.pm.SharedUserSetting ) { final com.android.server.pm.SharedUserSetting sus = ( ( com.android.server.pm.SharedUserSetting ) ( obj ) ) ; return ( ( sus.name ) + ":" ) + ( sus.userId ) ; } else if ( obj instanceof com.android.server.pm.PackageSetting ) { final com.android.server.pm.PackageSetting ps = ( ( com.android.server.pm.PackageSetting ) ( obj ) ) ; return ps.name ; } } return null ; }

Target:
public java.lang.String getNameForUid ( int uid ) { synchronized ( mPackages ) { java.lang.Object obj = mSettings.getUserIdLPr ( android.os.UserHandle.getAppId ( uid ) ) ; if ( obj instanceof com.android.server.pm.SharedUserSetting ) { final com.android.server.pm.SharedUserSetting sus = ( ( com.android.server.pm.SharedUserSetting ) ( obj ) ) ; return ( ( sus.name ) + ":" ) + ( sus.userId ) ; } else if ( obj instanceof com.android.server.pm.PackageSetting ) { final com.android.server.pm.PackageSetting ps = ( ( com.android.server.pm.PackageSetting ) ( obj ) ) ; return ps.name ; } } return null ; }
Source:
public static java.lang.String quote ( java.lang.String path ) { if ( ( com.android.SdkConstants.CURRENT_PLATFORM ) == ( com.android.SdkConstants.PLATFORM_WINDOWS ) ) { return ( "\"" + path ) + "\"" ; } return path ; }

Target:
public static java.lang.String quote ( java.lang.String path ) { if ( ( com.android.SdkConstants.CURRENT_PLATFORM ) == ( com.android.SdkConstants.PLATFORM_WINDOWS ) ) { if ( path.endsWith ( java.io.File.separator ) ) { path = path.substring ( 0 , ( ( path.length ( ) ) - 1 ) ) ; } return ( "\"" + path ) + "\"" ; } return path ; }
Source:
public void reportStkServiceIsRunning ( android.os.Message result ) { android.hardware.radio.V1_0.IRadio radioProxy = getRadioProxy ( result ) ; if ( radioProxy != null ) { com.android.internal.telephony.RILRequest rr = obtainRequest ( com.android.internal.telephony.RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING , result , mRILDefaultWorkSource ) ; if ( com.android.internal.telephony.RIL.RILJ_LOGD ) riljLog ( ( ( ( rr.serialString ( ) ) + "> " ) + ( com.android.internal.telephony.RIL.requestToString ( rr.mRequest ) ) ) ) ; try { radioProxy.reportStkServiceIsRunning ( rr.mSerial ) ; } catch ( android.os.RemoteException | java.lang.RuntimeException e ) { handleRadioProxyExceptionForRR ( rr , "reportStkServiceIsRunning" , e ) ; } } }

Target:
public void getSmscAddress ( android.os.Message result ) { android.hardware.radio.V1_0.IRadio radioProxy = getRadioProxy ( result ) ; if ( radioProxy != null ) { com.android.internal.telephony.RILRequest rr = obtainRequest ( com.android.internal.telephony.RIL_REQUEST_GET_SMSC_ADDRESS , result , mRILDefaultWorkSource ) ; if ( com.android.internal.telephony.RIL.RILJ_LOGD ) riljLog ( ( ( ( rr.serialString ( ) ) + "> " ) + ( com.android.internal.telephony.RIL.requestToString ( rr.mRequest ) ) ) ) ; try { radioProxy.getSmscAddress ( rr.mSerial ) ; } catch ( android.os.RemoteException | java.lang.RuntimeException e ) { handleRadioProxyExceptionForRR ( rr , "getSmscAddress" , e ) ; } } }
Source:
public com.android.server.wifi.WifiConfigStoreData read ( ) throws java.io.IOException , org.xmlpull.v1.XmlPullParserException { byte [ ] sharedDataBytes = mSharedStore.readRawData ( ) ; byte [ ] userDataBytes = mUserStore.readRawData ( ) ; return com.android.server.wifi.WifiConfigStoreData.parseRawData ( sharedDataBytes , userDataBytes ) ; }

Target:
public com.android.server.wifi.WifiConfigStoreData read ( ) throws java.io.IOException , org.xmlpull.v1.XmlPullParserException { long readStartTime = mClock.getElapsedSinceBootMillis ( ) ; byte [ ] sharedDataBytes = mSharedStore.readRawData ( ) ; byte [ ] userDataBytes = mUserStore.readRawData ( ) ; long readTime = ( mClock.getElapsedSinceBootMillis ( ) ) - readStartTime ; android.util.Log.d ( com.android.server.wifi.WifiConfigStore.TAG , ( ( "Reading from stores completed in " + readTime ) + " ms." ) ) ; return com.android.server.wifi.WifiConfigStoreData.parseRawData ( sharedDataBytes , userDataBytes ) ; }
Source:
public com.android.sched.vfs.InputVDir getDir ( @ 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 baseVFS.getRootInputVDir ( ) . getInputVDir ( typePath ) ; } catch ( com.android.sched.util.file.NotDirectoryException 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 ) ; } }

Target:
public com.android.sched.vfs.InputVDir getDir ( @ 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 inputVFS.getRootInputVDir ( ) . getInputVDir ( typePath ) ; } catch ( com.android.sched.util.file.NotDirectoryException 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 ) ; } }
Source:
private long readId ( ) throws java.io.IOException { switch ( mIdSize ) { case 1 : return mInput.readUnsignedByte ( ) ; case 2 : return mInput.readUnsignedShort ( ) ; case 4 : return ( ( long ) ( mInput.readInt ( ) ) ) & 4294967295L ; case 8 : return mInput.readLong ( ) ; } throw new java.lang.IllegalArgumentException ( "ID Length must be 1, 2, 4, or 8" ) ; }

Target:
private long readId ( java.io.DataInputStream stream ) throws java.io.IOException { switch ( mIdSize ) { case 1 : return stream.readUnsignedByte ( ) ; case 2 : return stream.readUnsignedShort ( ) ; case 4 : return com.google.common.primitives.UnsignedInts.toLong ( stream.readInt ( ) ) ; case 8 : return stream.readLong ( ) ; } throw new java.lang.IllegalArgumentException ( "ID Length must be 1, 2, 4, or 8" ) ; }
Source:
public final void testCollectIds3 ( ) { java.util.Map < java.lang.String , com.android.ide.common.layout.Pair < java.lang.String , java.lang.String > > idMap = new java.util.HashMap < java.lang.String , com.android.ide.common.layout.Pair < java.lang.String , java.lang.String > > ( ) ; com.android.ide.common.api.IDragElement [ ] elements = createSampleElements ( ) ; java.util.Map < java.lang.String , com.android.ide.common.layout.Pair < java.lang.String , java.lang.String > > ids = new com.android.ide.common.layout.BaseLayoutRule ( ) . collectIds ( idMap , elements ) ; assertEquals ( 5 , ids.size ( ) ) ; assertContainsSame ( java.util.Arrays.asList ( "@+id/Button01" , "@+id/Button02" , "@+id/Button011" , "@+id/Button012" , "@+id/LinearLayout01" ) , ids.keySet ( ) ) ; assertEquals ( com.android.ide.common.layout.Pair.of ( "@+id/LinearLayout01" , "android.widget.LinearLayout" ) , ids.get ( "@+id/LinearLayout01" ) ) ; }

Target:
public final void testCollectIds3 ( ) { java.util.Map < java.lang.String , com.android.sdklib.util.Pair < java.lang.String , java.lang.String > > idMap = new java.util.HashMap < java.lang.String , com.android.sdklib.util.Pair < java.lang.String , java.lang.String > > ( ) ; com.android.ide.common.api.IDragElement [ ] elements = createSampleElements ( ) ; java.util.Map < java.lang.String , com.android.sdklib.util.Pair < java.lang.String , java.lang.String > > ids = new com.android.ide.common.layout.BaseLayoutRule ( ) . collectIds ( idMap , elements ) ; assertEquals ( 5 , ids.size ( ) ) ; assertContainsSame ( java.util.Arrays.asList ( "@+id/Button01" , "@+id/Button02" , "@+id/Button011" , "@+id/Button012" , "@+id/LinearLayout01" ) , ids.keySet ( ) ) ; assertEquals ( com.android.sdklib.util.Pair.of ( "@+id/LinearLayout01" , "android.widget.LinearLayout" ) , ids.get ( "@+id/LinearLayout01" ) ) ; }
Source:
public void timeDateIntervalFormat_formatDateRange_DATE_TIME ( int reps ) throws java.lang.Exception { android.icu.util.ULocale l = android.icu.util.ULocale.US ; android.icu.util.TimeZone utc = android.icu.util.TimeZone.getTimeZone ( "UTC" ) ; int flags = ( ( ( FORMAT_SHOW_DATE ) | ( FORMAT_SHOW_WEEKDAY ) ) | ( FORMAT_SHOW_TIME ) ) | ( FORMAT_24HOUR ) ; for ( int rep = 0 ; rep < reps ; ++ rep ) { formatDateRange ( l , utc , 0L , 0L , flags ) ; } }

Target:
public void timeDateIntervalFormat_formatDateRange_DATE_TIME ( int reps ) throws java.lang.Exception { android.icu.util.ULocale l = android.icu.util.ULocale.US ; android.icu.util.TimeZone utc = android.icu.util.TimeZone.getTimeZone ( "UTC" ) ; int flags = ( ( ( FORMAT_SHOW_DATE ) | ( FORMAT_SHOW_WEEKDAY ) ) | ( FORMAT_SHOW_TIME ) ) | ( FORMAT_24HOUR ) ; for ( int rep = 0 ; rep < reps ; ++ rep ) { libcore.icu.DateIntervalFormat.formatDateRange ( l , utc , 0L , 0L , flags ) ; } }
Source:
public void test_d2i_SSL_SESSION ( ) throws java.lang.Exception { try { org.conscrypt.NativeCrypto.d2i_SSL_SESSION ( null ) ; org.junit.Assert.fail ( ) ; } catch ( java.lang.NullPointerException expected ) { } try { org.conscrypt.NativeCrypto.d2i_SSL_SESSION ( new byte [ 0 ] ) ; org.junit.Assert.fail ( "Should throw IOException with invalid SSL_SESSION data" ) ; } catch ( java.io.IOException expected ) { } try { org.conscrypt.NativeCrypto.d2i_SSL_SESSION ( new byte [ 1 ] ) ; org.junit.Assert.fail ( "Should throw IOException with invalid SSL_SESSION data" ) ; } catch ( java.io.IOException expected ) { } }

Target:
public void d2i_SSL_SESSION_InvalidArgument ( ) throws java.lang.Exception { org.conscrypt.NativeCrypto.d2i_SSL_SESSION ( new byte [ 1 ] ) ; }
Source:
public void setVoiceRadioTech ( int radioTech ) { synchronized ( mLock ) { if ( com.android.internal.telephony.uicc.UiccProfile.DBG ) { log ( ( "Setting radio tech " + ( android.telephony.ServiceState.rilRadioTechnologyToString ( radioTech ) ) ) ) ; } setCurrentAppType ( android.telephony.ServiceState.isGsm ( radioTech ) ) ; } }

Target:
public void setVoiceRadioTech ( int radioTech ) { synchronized ( mLock ) { if ( com.android.internal.telephony.uicc.UiccProfile.DBG ) { log ( ( "Setting radio tech " + ( android.telephony.ServiceState.rilRadioTechnologyToString ( radioTech ) ) ) ) ; } setCurrentAppType ( android.telephony.ServiceState.isGsm ( radioTech ) ) ; updateIccAvailability ( false ) ; } }
Source:
public void testVolatileFiled ( ) { android.signature.cts.JDiffClassDescription clz = createNormalClass ( ) ; android.signature.cts.JDiffClassDescription.JDiffField field = new android.signature.cts.JDiffClassDescription.JDiffField ( "VOLATILE_FIELD" , "java.lang.String" , ( ( java.lang.reflect.Modifier.PUBLIC ) | ( java.lang.reflect.Modifier.VOLATILE ) ) ) ; clz.addField ( field ) ; clz.checkSignatureCompliance ( ) ; assertEquals ( field.toSignatureString ( ) , "public volatile java.lang.String VOLATILE_FIELD" ) ; }

Target:
public void testVolatileFiled ( ) { android.signature.cts.JDiffClassDescription clz = createNormalClass ( ) ; android.signature.cts.JDiffClassDescription.JDiffField field = new android.signature.cts.JDiffClassDescription.JDiffField ( "VOLATILE_FIELD" , "java.lang.String" , ( ( java.lang.reflect.Modifier.PUBLIC ) | ( java.lang.reflect.Modifier.VOLATILE ) ) , android.signature.cts.tests.JDiffClassDescriptionTest.VALUE ) ; clz.addField ( field ) ; clz.checkSignatureCompliance ( ) ; assertEquals ( field.toSignatureString ( ) , "public volatile java.lang.String VOLATILE_FIELD" ) ; }
Source:
private void selectItemName ( java.lang.String itemName , com.android.ide.eclipse.adt.internal.resources.ResourceItem [ ] items ) { if ( ( itemName == null ) || ( items == null ) ) { return ; } for ( com.android.ide.eclipse.adt.internal.resources.ResourceItem item : items ) { if ( itemName.equals ( item.getName ( ) ) ) { setSelection ( new java.lang.Object [ ] { item } ) ; break ; } } }

Target:
private void selectItemName ( java.lang.String itemName , com.android.ide.eclipse.adt.internal.resources.manager.ResourceItem [ ] items ) { if ( ( itemName == null ) || ( items == null ) ) { return ; } for ( com.android.ide.eclipse.adt.internal.resources.manager.ResourceItem item : items ) { if ( itemName.equals ( item.getName ( ) ) ) { setSelection ( new java.lang.Object [ ] { item } ) ; break ; } } }
Source:
public void testDependency002 ( ) throws java.lang.Exception { com.android.jack.test.helper.IncrementalTestHelper ite = new com.android.jack.test.helper.IncrementalTestHelper ( com.android.jack.test.toolchain.AbstractTestTools.createTempDir ( ) ) ; ite.addJavaFile ( "jack.incremental" , "A.java" , ( "package jack.incremental; \n" + "public class A implements I \n" ) ) ; java.io.File f = ite.addJavaFile ( "jack.incremental" , "I.java" , ( "package jack.incremental; \n" + "public interface I \n" ) ) ; ite.incrementalBuildFromFolder ( ) ; ite.deleteJavaFile ( f ) ; try { ite.incrementalBuildFromFolder ( ) ; junit.framework.Assert.fail ( ) ; } catch ( com.android.jack.frontend.FrontendCompilationException e ) { } }

Target:
public void testDependency002 ( ) throws java.lang.Exception { com.android.jack.test.helper.IncrementalTestHelper ite = new com.android.jack.test.helper.IncrementalTestHelper ( com.android.jack.test.toolchain.AbstractTestTools.createTempDir ( ) ) ; ite.setIsApiTest ( ) ; ite.addJavaFile ( "jack.incremental" , "A.java" , ( "package jack.incremental; \n" + "public class A implements I \n" ) ) ; java.io.File f = ite.addJavaFile ( "jack.incremental" , "I.java" , ( "package jack.incremental; \n" + "public interface I \n" ) ) ; ite.incrementalBuildFromFolder ( ) ; ite.deleteJavaFile ( f ) ; try { ite.incrementalBuildFromFolder ( ) ; junit.framework.Assert.fail ( ) ; } catch ( com.android.jack.frontend.FrontendCompilationException e ) { } }
Source:
public void test_getProxyClass_caching ( ) throws java.lang.Exception { java.lang.Class < ? > proxy1 = java.lang.reflect.Proxy.getProxyClass ( null , libcore.java.lang.reflect.ProxyTest.Echo.class , libcore.java.lang.reflect.ProxyTest.ReturnsInt.class ) ; java.lang.Class < ? > proxy2 = java.lang.reflect.Proxy.getProxyClass ( null , libcore.java.lang.reflect.ProxyTest.Echo.class , libcore.java.lang.reflect.ProxyTest.ReturnsInt.class ) ; java.lang.Class < ? > proxy3 = java.lang.reflect.Proxy.getProxyClass ( null , libcore.java.lang.reflect.ProxyTest.ReturnsInt.class , libcore.java.lang.reflect.ProxyTest.Echo.class ) ; assertSame ( proxy1 , proxy2 ) ; assertTrue ( ( ! ( proxy2.equals ( proxy3 ) ) ) ) ; }

Target:
public void test_getProxyClass_caching ( ) throws java.lang.Exception { java.lang.Class < ? > proxy1 = java.lang.reflect.Proxy.getProxyClass ( loader , libcore.java.lang.reflect.ProxyTest.Echo.class , libcore.java.lang.reflect.ProxyTest.ReturnsInt.class ) ; java.lang.Class < ? > proxy2 = java.lang.reflect.Proxy.getProxyClass ( loader , libcore.java.lang.reflect.ProxyTest.Echo.class , libcore.java.lang.reflect.ProxyTest.ReturnsInt.class ) ; java.lang.Class < ? > proxy3 = java.lang.reflect.Proxy.getProxyClass ( loader , libcore.java.lang.reflect.ProxyTest.ReturnsInt.class , libcore.java.lang.reflect.ProxyTest.Echo.class ) ; assertSame ( proxy1 , proxy2 ) ; assertTrue ( ( ! ( proxy2.equals ( proxy3 ) ) ) ) ; }
Source:
public boolean isDataVersionAcceptable ( byte [ ] formatVersion ) { return ( ( formatVersion [ 0 ] ) == 1 ) || ( ( formatVersion [ 0 ] ) == 2 ) ; }

Target:
public boolean isDataVersionAcceptable ( byte [ ] formatVersion ) { return ( ( ( formatVersion [ 0 ] ) == 1 ) && ( ( ( formatVersion [ 1 ] ) & 255 ) >= 1 ) ) || ( ( 2 <= ( formatVersion [ 0 ] ) ) && ( ( formatVersion [ 0 ] ) <= 3 ) ) ; }
Source:
public android.net.NetworkStats getNetworkStatsUidDetail ( int uid ) { mContext.enforceCallingOrSelfPermission ( android.Manifest.permission.CONNECTIVITY_INTERNAL , com.android.server.NetworkManagementService.TAG ) ; try { return mStatsFactory.readNetworkStatsDetail ( uid , null , android.net.NetworkStats.TAG_ALL , null ) ; } catch ( java.io.IOException e ) { throw new java.lang.IllegalStateException ( e ) ; } }

Target:
public android.net.NetworkStats getNetworkStatsUidDetail ( int uid , java.lang.String [ ] ifaces ) { mContext.enforceCallingOrSelfPermission ( android.Manifest.permission.CONNECTIVITY_INTERNAL , com.android.server.NetworkManagementService.TAG ) ; try { return mStatsFactory.readNetworkStatsDetail ( uid , ifaces , android.net.NetworkStats.TAG_ALL , null ) ; } catch ( java.io.IOException e ) { throw new java.lang.IllegalStateException ( e ) ; } }
Source:
private boolean isRoamIndForHomeSystem ( java.lang.String roamInd ) { java.lang.String [ ] homeRoamIndicators = mPhone.getContext ( ) . getResources ( ) . getStringArray ( com.android.internal.R.array.config_cdma_home_system ) ; if ( homeRoamIndicators != null ) { for ( java.lang.String homeRoamInd : homeRoamIndicators ) { if ( homeRoamInd.equals ( roamInd ) ) { return true ; } } return false ; } return false ; }

Target:
private boolean isRoamIndForHomeSystem ( java.lang.String roamInd ) { java.lang.String [ ] homeRoamIndicators = mPhone.getContext ( ) . getResources ( ) . getStringArray ( com.android.internal.R.array.config_cdma_home_system ) ; if ( homeRoamIndicators != null ) { for ( java.lang.String homeRoamInd : homeRoamIndicators ) { if ( homeRoamInd.equals ( roamInd ) ) { return true ; } } log ( ( "isRoamIndForHomeSystem: No match found against list for roamInd=" + roamInd ) ) ; return false ; } log ( "isRoamIndForHomeSystem: No list found" ) ; return false ; }
Source:
protected boolean isEnabled ( com.android.tools.lint.detector.api.Issue issue ) { java.lang.Class < ? extends com.android.tools.lint.detector.api.Detector > detectorClass = getDetectorInstance ( ) . getClass ( ) ; if ( ( issue.getDetectorClass ( ) ) == detectorClass ) { return true ; } return false ; }

Target:
protected boolean isEnabled ( com.android.tools.lint.detector.api.Issue issue ) { java.lang.Class < ? extends com.android.tools.lint.detector.api.Detector > detectorClass = getDetectorInstance ( ) . getClass ( ) ; if ( ( issue.getDetectorClass ( ) ) == detectorClass ) { return true ; } if ( ( issue == ( com.android.tools.lint.client.api.IssueRegistry.LINT_ERROR ) ) || ( issue == ( com.android.tools.lint.client.api.IssueRegistry.PARSER_ERROR ) ) ) { return ! ( ignoreSystemErrors ( ) ) ; } return false ; }
Source:
public com.android.jack.dx.io.instructions.DecodedInstruction decode ( int opcodeUnit , com.android.jack.dx.io.instructions.CodeInput in ) throws java.io.EOFException { int baseAddress = ( in.cursor ( ) ) - 1 ; int opcode = com.android.jack.dx.io.instructions.InstructionCodec.byte0 ( opcodeUnit ) ; int a = com.android.jack.dx.io.instructions.InstructionCodec.byte1 ( opcodeUnit ) ; int target = ( ( short ) ( in.read ( ) ) ) ; return new com.android.jack.dx.io.instructions.OneRegisterDecodedInstruction ( this , opcode , 0 , null , ( baseAddress + target ) , 0L , a ) ; }

Target:
public com.android.jack.dx.io.instructions.DecodedInstruction decode ( int opcodeUnit , com.android.jack.dx.io.instructions.CodeInput in ) throws java.io.EOFException { int baseAddress = ( in.cursor ( ) ) - 1 ; int opcode = com.android.jack.dx.io.instructions.InstructionCodec.byte0 ( opcodeUnit ) ; int a = com.android.jack.dx.io.instructions.InstructionCodec.byte1 ( opcodeUnit ) ; int target = ( ( short ) ( in.read ( ) ) ) ; return new com.android.jack.dx.io.instructions.OneRegisterDecodedInstruction ( this , opcode , 0 , com.android.jack.dx.io.IndexType.NONE , ( baseAddress + target ) , 0L , a ) ; }
Source:
protected void loadOutputAndDependencies ( ) { org.eclipse.core.runtime.IProgressMonitor monitor = new org.eclipse.core.runtime.NullProgressMonitor ( ) ; java.util.Collection < com.android.ide.eclipse.adt.internal.build.SourceFileData > dataList = getAllFileData ( ) ; for ( com.android.ide.eclipse.adt.internal.build.SourceFileData data : dataList ) { try { org.eclipse.core.resources.IFile javaFile = getAidlOutputFile ( data.getSourceFile ( ) , false , monitor ) ; data.setOutputFile ( javaFile ) ; } catch ( org.eclipse.core.runtime.CoreException e ) { } } }

Target:
protected void loadOutputAndDependencies ( ) { org.eclipse.core.runtime.IProgressMonitor monitor = new org.eclipse.core.runtime.NullProgressMonitor ( ) ; org.eclipse.core.resources.IFolder genFolder = getGenFolder ( ) ; java.util.Collection < com.android.ide.eclipse.adt.internal.build.SourceFileData > dataList = getAllFileData ( ) ; for ( com.android.ide.eclipse.adt.internal.build.SourceFileData data : dataList ) { try { org.eclipse.core.resources.IFile javaFile = getAidlOutputFile ( data.getSourceFile ( ) , genFolder , true , false , monitor ) ; data.setOutputFile ( javaFile ) ; } catch ( org.eclipse.core.runtime.CoreException e ) { } } }
Source:
public void write ( @ com.android.annotations.NonNull java.io.File projectDir , @ com.android.annotations.Nullable java.lang.String buildScriptContent ) throws java.io.IOException { for ( com.android.build.gradle.integration.common.fixture.app.TestSourceFile srcFile : getAllSourceFiles ( ) ) { srcFile.writeToDir ( projectDir ) ; } }

Target:
public void write ( @ com.android.annotations.NonNull java.io.File projectDir , @ com.android.annotations.Nullable java.lang.String buildScriptContent ) throws java.io.IOException { if ( buildScriptContent != null ) { com.google.common.io.Files.write ( buildScriptContent , new java.io.File ( projectDir , "build.gradle" ) , java.nio.charset.Charset.defaultCharset ( ) ) ; } for ( com.android.build.gradle.integration.common.fixture.app.TestSourceFile srcFile : getAllSourceFiles ( ) ) { srcFile.writeToDir ( projectDir ) ; } }
Source:
public int getApplicationEnabledSetting ( java.lang.String packageName , int userId ) { if ( ! ( com.android.server.pm.PackageManagerService.sUserManager.exists ( userId ) ) ) return android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED ; int uid = android.os.Binder.getCallingUid ( ) ; checkValidCaller ( uid , userId ) ; synchronized ( mPackages ) { return mSettings.getApplicationEnabledSettingLPr ( packageName , userId ) ; } }

Target:
public int getApplicationEnabledSetting ( java.lang.String packageName , int userId ) { if ( ! ( com.android.server.pm.PackageManagerService.sUserManager.exists ( userId ) ) ) return android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DISABLED ; int uid = android.os.Binder.getCallingUid ( ) ; enforceCrossUserPermission ( uid , userId , false , "get enabled" ) ; synchronized ( mPackages ) { return mSettings.getApplicationEnabledSettingLPr ( packageName , userId ) ; } }
Source:
public java.util.Collection < com.android.resources.ResourceType > getResourceTypes ( ) { java.util.ArrayList < com.android.resources.ResourceType > list = new java.util.ArrayList < com.android.resources.ResourceType > ( ) ; if ( ( mFiles ) != null ) { for ( com.android.ide.eclipse.adt.internal.resources.manager.ResourceFile file : mFiles ) { java.util.Collection < com.android.resources.ResourceType > types = file.getResourceTypes ( ) ; for ( com.android.resources.ResourceType resType : types ) { if ( ( list.indexOf ( resType ) ) == ( - 1 ) ) { list.add ( resType ) ; } } } } return list ; }

Target:
public java.util.Collection < com.android.resources.ResourceType > getResourceTypes ( ) { java.util.ArrayList < com.android.resources.ResourceType > list = new java.util.ArrayList < com.android.resources.ResourceType > ( ) ; if ( ( mFiles ) != null ) { for ( com.android.ide.common.resources.ResourceFile file : mFiles ) { java.util.Collection < com.android.resources.ResourceType > types = file.getResourceTypes ( ) ; for ( com.android.resources.ResourceType resType : types ) { if ( ( list.indexOf ( resType ) ) == ( - 1 ) ) { list.add ( resType ) ; } } } } return list ; }
Source:
public void visitLineNumberTableAttribute ( proguard.obfuscate.Clazz clazz , proguard.obfuscate.Method method , proguard.obfuscate.CodeAttribute codeAttribute , proguard.obfuscate.LineNumberTableAttribute lineNumberTableAttribute ) { ps.print ( ( ( ( ( lineNumberTableAttribute.getLowestLineNumber ( ) ) + ":" ) + ( lineNumberTableAttribute.getHighestLineNumber ( ) ) ) + ":" ) ) ; }

Target:
public void visitLineNumberTableAttribute ( proguard.obfuscate.Clazz clazz , proguard.obfuscate.Method method , proguard.obfuscate.CodeAttribute codeAttribute , proguard.obfuscate.LineNumberTableAttribute lineNumberTableAttribute ) { int low ; int high ; low = lineNumberTableAttribute.getLowestLineNumber ( ) ; high = lineNumberTableAttribute.getHighestLineNumber ( ) ; ps.print ( ( ( ( low + ":" ) + high ) + ":" ) ) ; }
Source:
private void processLogLines ( java.lang.String [ ] lines ) { java.util.List < com.android.ddmuilib.logcat.LogCatMessage > newMessages = mLogCatMessageParser.processLogLines ( lines , mPidToNameMapper ) ; if ( ( newMessages.size ( ) ) > 0 ) { java.util.List < com.android.ddmuilib.logcat.LogCatMessage > deletedMessages ; synchronized ( mLogMessages ) { deletedMessages = mLogMessages.ensureSpace ( newMessages.size ( ) ) ; mLogMessages.appendMessages ( newMessages ) ; } sendLogChangedEvent ( newMessages , deletedMessages ) ; } }

Target:
private void processLogMessages ( java.util.List < com.android.ddmuilib.logcat.LogCatMessage > newMessages ) { if ( ( newMessages.size ( ) ) > 0 ) { java.util.List < com.android.ddmuilib.logcat.LogCatMessage > deletedMessages ; synchronized ( mLogMessages ) { deletedMessages = mLogMessages.ensureSpace ( newMessages.size ( ) ) ; mLogMessages.appendMessages ( newMessages ) ; } sendLogChangedEvent ( newMessages , deletedMessages ) ; } }
Source:
public void rmdex ( java.lang.String codePath , java.lang.String instructionSet ) throws com.android.internal.os.InstallerConnection.InstallerException { com.android.server.pm.Installer.assertValidInstructionSet ( instructionSet ) ; mInstaller.execute ( "rmdex" , codePath , instructionSet ) ; }

Target:
public void rmdex ( java.lang.String codePath , java.lang.String instructionSet ) throws com.android.internal.os.InstallerConnection.InstallerException { com.android.server.pm.Installer.assertValidInstructionSet ( instructionSet ) ; checkLock ( ) ; try { mInstalld.rmdex ( codePath , instructionSet ) ; } catch ( android.os.RemoteException | android.os.ServiceSpecificException e ) { throw new com.android.internal.os.InstallerConnection.InstallerException ( e.getMessage ( ) ) ; } }
Source:
public int cancelRequest ( int requestId , android.hardware.camera2.utils.LongParcelable lastFrameNumber ) { if ( android.hardware.camera2.legacy.CameraDeviceUserShim.DEBUG ) { android.util.Log.d ( android.hardware.camera2.legacy.CameraDeviceUserShim.TAG , "cancelRequest called." ) ; } if ( mLegacyDevice.isClosed ( ) ) { android.util.Log.e ( android.hardware.camera2.legacy.CameraDeviceUserShim.TAG , "Cannot cancel request, device has been closed." ) ; return android.hardware.camera2.utils.CameraBinderDecorator.ENODEV ; } synchronized ( mConfigureLock ) { if ( mConfiguring ) { android.util.Log.e ( android.hardware.camera2.legacy.CameraDeviceUserShim.TAG , "Cannot cancel request, configuration change in progress." ) ; return android.hardware.camera2.utils.CameraBinderDecorator.INVALID_OPERATION ; } } long lastFrame = mLegacyDevice.cancelRequest ( requestId ) ; lastFrameNumber.setNumber ( lastFrame ) ; return android.hardware.camera2.utils.CameraBinderDecorator.NO_ERROR ; }

Target:
public int cancelRequest ( int requestId , android.hardware.camera2.utils.LongParcelable lastFrameNumber ) { if ( android.hardware.camera2.legacy.CameraDeviceUserShim.DEBUG ) { android.util.Log.d ( android.hardware.camera2.legacy.CameraDeviceUserShim.TAG , "cancelRequest called." ) ; } if ( mLegacyDevice.isClosed ( ) ) { android.util.Log.e ( android.hardware.camera2.legacy.CameraDeviceUserShim.TAG , "Cannot cancel request, device has been closed." ) ; return - ( android.system.OsConstants.ENODEV ) ; } synchronized ( mConfigureLock ) { if ( mConfiguring ) { android.util.Log.e ( android.hardware.camera2.legacy.CameraDeviceUserShim.TAG , "Cannot cancel request, configuration change in progress." ) ; return android.hardware.camera2.utils.CameraBinderDecorator.INVALID_OPERATION ; } } long lastFrame = mLegacyDevice.cancelRequest ( requestId ) ; lastFrameNumber.setNumber ( lastFrame ) ; return android.hardware.camera2.utils.CameraBinderDecorator.NO_ERROR ; }
Source:
public void testLockScreenWatcher ( ) throws java.lang.Exception { mDevice.sleep ( ) ; mDevice.wakeUp ( ) ; com.android.devtools.systemimage.uitest.utils.AppLauncher.launch ( mInstrumentation , "Email" ) ; }

Target:
public void testLockScreenWatcher ( ) throws java.lang.Exception { android.app.Instrumentation instrumentation = testFramework.getInstrumentation ( ) ; android.support.test.uiautomator.UiDevice device = testFramework.getDevice ( ) ; device.registerWatcher ( com.android.devtools.systemimage.uitest.watchers.LockScreenWatcher.class . getName ( ) , new com.android.devtools.systemimage.uitest.watchers.LockScreenWatcher ( device ) ) ; device.sleep ( ) ; device.wakeUp ( ) ; com.android.devtools.systemimage.uitest.utils.AppLauncher.launch ( instrumentation , "Email" ) ; device.removeWatcher ( com.android.devtools.systemimage.uitest.watchers.LockScreenWatcher.class . getName ( ) ) ; }
Source:
public void testSet1_IndexOutOfBoundsException ( ) { try { java.util.concurrent.CopyOnWriteArrayList c = new java.util.concurrent.CopyOnWriteArrayList ( ) ; c.set ( ( - 1 ) , "qwerty" ) ; shouldThrow ( ) ; } catch ( java.lang.IndexOutOfBoundsException success ) { } }

Target:
public void testRemove1_IndexOutOfBounds ( ) { java.util.concurrent.CopyOnWriteArrayList c = jsr166.CopyOnWriteArrayListTest.populatedArray ( 5 ) ; java.util.List [ ] lists = new java.util.List [ ] { c , c.subList ( 1 , ( ( c.size ( ) ) - 1 ) ) } ; for ( java.util.List list : lists ) { try { list.remove ( ( - 1 ) ) ; shouldThrow ( ) ; } catch ( java.lang.IndexOutOfBoundsException success ) { } } }
Source:
private boolean isRoamIndForHomeSystem ( java.lang.String roamInd ) { java.lang.String [ ] homeRoamIndicators = mPhone.getContext ( ) . getResources ( ) . getStringArray ( com.android.internal.R.array.config_cdma_home_system ) ; if ( homeRoamIndicators != null ) { for ( java.lang.String homeRoamInd : homeRoamIndicators ) { if ( homeRoamInd.equals ( roamInd ) ) { return true ; } } return false ; } return false ; }

Target:
private boolean isRoamIndForHomeSystem ( java.lang.String roamInd ) { log ( ( "isRoamIndForHomeSystem: " + ( android.content.res.Resources.getSystem ( ) . getConfiguration ( ) . toString ( ) ) ) ) ; java.lang.String [ ] homeRoamIndicators = android.content.res.Resources.getSystem ( ) . getStringArray ( com.android.internal.R.array.config_cdma_home_system ) ; if ( homeRoamIndicators != null ) { for ( java.lang.String homeRoamInd : homeRoamIndicators ) { if ( homeRoamInd.equals ( roamInd ) ) { return true ; } } log ( ( "isRoamIndForHomeSystem: No match found against list for roamInd=" + roamInd ) ) ; return false ; } log ( "isRoamIndForHomeSystem: No list found" ) ; return false ; }
Source:
public void testBrokenSet ( ) throws java.lang.Exception { java.io.File root = com.android.testutils.TestUtils.getRoot ( "resources" , "brokenSet" ) ; com.android.ide.common.res2.ResourceSet set = new com.android.ide.common.res2.ResourceSet ( "main" ) ; set.addSource ( root ) ; boolean gotException = false ; com.android.ide.common.res2.RecordingLogger logger = new com.android.ide.common.res2.RecordingLogger ( ) ; try { set.loadFromFiles ( logger ) ; } catch ( java.io.IOException e ) { gotException = true ; } assertTrue ( gotException ) ; assertFalse ( logger.getErrorMsgs ( ) . isEmpty ( ) ) ; }

Target:
public void testBrokenSet ( ) throws java.lang.Exception { java.io.File root = com.android.testutils.TestUtils.getRoot ( "resources" , "brokenSet" ) ; com.android.ide.common.res2.ResourceSet set = new com.android.ide.common.res2.ResourceSet ( "main" ) ; set.addSource ( root ) ; boolean gotException = false ; com.android.ide.common.res2.RecordingLogger logger = new com.android.ide.common.res2.RecordingLogger ( ) ; try { set.loadFromFiles ( logger ) ; } catch ( java.io.IOException e ) { gotException = true ; } assertTrue ( "ResourceSet processing should have failed, but didn't" , gotException ) ; assertFalse ( logger.getErrorMsgs ( ) . isEmpty ( ) ) ; }
Source:
public void copyTo ( int [ ] d ) { android.os.Trace.traceBegin ( RenderScript.TRACE_TAG , "copyTo" ) ; validateIsInt32 ( ) ; mRS.validate ( ) ; mRS.nAllocationRead ( getID ( mRS ) , d ) ; android.os.Trace.traceEnd ( RenderScript.TRACE_TAG ) ; }

Target:
public void copyTo ( int [ ] d ) { android.os.Trace.traceBegin ( RenderScript.TRACE_TAG , "copyTo" ) ; validateIsInt32 ( ) ; mRS.validate ( ) ; mRS.nAllocationRead ( getID ( mRS ) , d , Element.DataType.SIGNED_32 ) ; android.os.Trace.traceEnd ( RenderScript.TRACE_TAG ) ; }
Source:
public void initialize ( int gsmSignalStrength , int gsmBitErrorRate , int cdmaDbm , int cdmaEcio , int evdoDbm , int evdoEcio , int evdoSnr , boolean gsm ) { initialize ( gsmSignalStrength , gsmBitErrorRate , cdmaDbm , cdmaEcio , evdoDbm , evdoEcio , evdoSnr , 99 , android.telephony.SignalStrength.INVALID , android.telephony.SignalStrength.INVALID , android.telephony.SignalStrength.INVALID , android.telephony.SignalStrength.INVALID , 0 , gsm , false ) ; }

Target:
protected void copyFrom ( android.telephony.SignalStrength s ) { mGsmSignalStrength = s.mGsmSignalStrength ; mGsmBitErrorRate = s.mGsmBitErrorRate ; mCdmaDbm = s.mCdmaDbm ; mCdmaEcio = s.mCdmaEcio ; mEvdoDbm = s.mEvdoDbm ; mEvdoEcio = s.mEvdoEcio ; mEvdoSnr = s.mEvdoSnr ; mLteSignalStrength = s.mLteSignalStrength ; mLteRsrp = s.mLteRsrp ; mLteRsrq = s.mLteRsrq ; mLteRssnr = s.mLteRssnr ; mLteCqi = s.mLteCqi ; mTdScdmaRscp = s.mTdScdmaRscp ; mLteRsrpBoost = s.mLteRsrpBoost ; mIsGsm = s.mIsGsm ; mUseOnlyRsrpForLteLevel = s.mUseOnlyRsrpForLteLevel ; setLteRsrpThresholds ( s.mLteRsrpThresholds ) ; }