auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected com.intellij.updater.ValidationResult doValidate ( java.io.File toFile ) throws java.io.IOException { com.intellij.updater.ValidationResult result = doValidateAccess ( toFile , ValidationResult.Action.DELETE ) ; if ( result != null ) return result ; if ( ( toFile.exists ( ) ) && ( isModified ( toFile ) ) ) { return new com.intellij.updater.ValidationResult ( ValidationResult.Kind.CONFLICT , myPath , ValidationResult.Action.DELETE , "Modified" , ValidationResult.Option.DELETE , ValidationResult.Option.KEEP ) ; } return null ; }

Target:
protected boolean isModified ( java.io.File toFile ) throws java.io.IOException { return ( myChecksum ) != ( com.intellij.updater.Digester.digestRegularFile ( toFile ) ) ; }
Source:
private static void println ( com.android.ddmlib.Log.LogLevel logLevel , java.lang.String tag , java.lang.String message ) { if ( ( logLevel.getPriority ( ) ) >= ( com.android.ddmlib.Log.mLevel.getPriority ( ) ) ) { if ( ( com.android.ddmlib.Log.sLogOutput ) != null ) { com.android.ddmlib.Log.sLogOutput.printLog ( logLevel , tag , message ) ; } else { com.android.ddmlib.Log.printLog ( logLevel , tag , message ) ; } } }

Target:
private static void println ( com.android.ddmlib.Log.LogLevel logLevel , java.lang.String tag , java.lang.String message ) { if ( ( logLevel.getPriority ( ) ) >= ( com.android.ddmlib.Log.sLevel.getPriority ( ) ) ) { if ( ( com.android.ddmlib.Log.sLogOutput ) != null ) { com.android.ddmlib.Log.sLogOutput.printLog ( logLevel , tag , message ) ; } else { com.android.ddmlib.Log.printLog ( logLevel , tag , message ) ; } } }
Source:
public void testEmpty ( ) { java.util.concurrent.PriorityBlockingQueue q = new java.util.concurrent.PriorityBlockingQueue ( 2 ) ; assertTrue ( q.isEmpty ( ) ) ; assertEquals ( jsr166.PriorityBlockingQueueTest.NOCAP , q.remainingCapacity ( ) ) ; q.add ( one ) ; assertFalse ( q.isEmpty ( ) ) ; q.add ( two ) ; q.remove ( ) ; q.remove ( ) ; assertTrue ( q.isEmpty ( ) ) ; }

Target:
public void testEmpty ( ) { java.util.concurrent.PriorityBlockingQueue q = new java.util.concurrent.PriorityBlockingQueue ( 2 ) ; assertTrue ( q.isEmpty ( ) ) ; assertEquals ( java.lang.Integer.MAX_VALUE , q.remainingCapacity ( ) ) ; q.add ( one ) ; assertFalse ( q.isEmpty ( ) ) ; q.add ( two ) ; q.remove ( ) ; q.remove ( ) ; assertTrue ( q.isEmpty ( ) ) ; }
Source:
private FieldGap ( int offset , int size ) { this . offset = offset ; this . size = size ; }

Target:
private void swap ( byte [ ] fieldTypes , java.util.List < org.jf.dexlib2.iface.Field > fields , int position1 , int position2 ) { byte tempType = fieldTypes [ position1 ] ; fieldTypes [ position1 ] = fieldTypes [ position2 ] ; fieldTypes [ position2 ] = tempType ; org.jf.dexlib2.iface.Field tempField = fields.set ( position1 , fields.get ( position2 ) ) ; fields.set ( position2 , tempField ) ; }
Source:
private int parseMonth ( java.lang.String string , int offset , int count , int absolute , java.lang.String [ ] longs , java.lang.String [ ] shorts ) { if ( count <= 2 ) { return parseNumber ( absolute , string , offset , java.util.Calendar.MONTH , ( - 1 ) ) ; } int index = parseText ( string , offset , longs , java.util.Calendar.MONTH ) ; if ( index < 0 ) { index = parseText ( string , offset , shorts , java.util.Calendar.MONTH ) ; } return index ; }

Target:
private int parseDayOfWeek ( java.lang.String string , int offset , boolean standAlone ) { libcore.icu.LocaleData ld = formatData.localeData ; int index = parseText ( string , offset , ( standAlone ? ld.longStandAloneWeekdayNames : formatData.weekdays ) , java.util.Calendar.DAY_OF_WEEK ) ; if ( index < 0 ) { index = parseText ( string , offset , ( standAlone ? ld.shortStandAloneWeekdayNames : formatData.shortWeekdays ) , java.util.Calendar.DAY_OF_WEEK ) ; } return index ; }
Source:
private void addIllegalImplicitOverrideMessage ( @ com.android.annotations.NonNull com.android.manifmerger.MergingReport.Builder mergingReport , @ com.android.annotations.NonNull com.android.manifmerger.AttributeModel attributeModel , @ com.android.annotations.NonNull com.android.manifmerger.XmlElement implicitNode ) { java.lang.String error = java.lang.String.format ( ( "Attribute %1$s value=(%2$s) at %3$s" + " cannot override implicit default value=(%4$s) at %5$s" ) , getId ( ) , getValue ( ) , printPosition ( ) , attributeModel.getDefaultValue ( ) , implicitNode.printPosition ( ) ) ; mergingReport.addError ( error ) ; }

Target:
private void addIllegalImplicitOverrideMessage ( @ com.android.annotations.NonNull com.android.manifmerger.MergingReport.Builder mergingReport , @ com.android.annotations.NonNull com.android.manifmerger.AttributeModel attributeModel , @ com.android.annotations.NonNull com.android.manifmerger.XmlElement implicitNode ) { java.lang.String error = java.lang.String.format ( ( "Attribute %1$s value=(%2$s) at %3$s" + " cannot override implicit default value=(%4$s) at %5$s" ) , getId ( ) , getValue ( ) , printPosition ( ) , attributeModel.getDefaultValue ( ) , implicitNode.printPosition ( ) ) ; addMessage ( mergingReport , MergingReport.Record.Severity.ERROR , error ) ; }
Source:
public void close ( ) throws java.io.IOException { mCloseGuard.close ( ) ; }

Target:
public void close ( ) throws java.io.IOException { try { mService.closeUdpEncapsulationSocket ( mResourceId ) ; } catch ( android.os.RemoteException e ) { throw e.rethrowFromSystemServer ( ) ; } try { mPfd.close ( ) ; } catch ( java.io.IOException e ) { android.util.Log.e ( android.net.IpSecManager.TAG , ( "Failed to close UDP Encapsulation Socket with Port= " + ( mPort ) ) ) ; throw e ; } mCloseGuard.close ( ) ; }
Source:
public boolean p2pGroupAdd ( int netId ) { if ( ( com.android.server.wifi.WifiNative.HIDL_ENABLE ) && ( ( mSupplicantP2pIfaceHal ) != null ) ) { return mSupplicantP2pIfaceHal.groupAdd ( netId , true ) ; } else { return doBooleanCommand ( ( "P2P_GROUP_ADD persistent=" + netId ) ) ; } }

Target:
public boolean p2pFind ( int timeout ) { if ( timeout <= 0 ) { return p2pFind ( ) ; } if ( ( com.android.server.wifi.WifiNative.HIDL_P2P_ENABLE ) && ( ( mSupplicantP2pIfaceHal ) != null ) ) { return mSupplicantP2pIfaceHal.find ( timeout ) ; } else { return doBooleanCommand ( ( "P2P_FIND " + timeout ) ) ; } }
Source:
public void test_limiting_to_1method_and_run_for_SuiteTest_should_throw_exception ( ) { java.lang.Class < ? > target = vogar.target.junit3.SuiteTest.class ; try { vogar.target.Runner runner = new vogar.target.junit.JUnitRunner ( monitor , "testSimple" , target , skipPastReference , testEnvironment , 0 ) ; runner.run ( "" , null , null ) ; fail ( "should throw ClassCastException." ) ; } catch ( java.lang.ClassCastException ignored ) { } }

Target:
public void test_limiting_to_1method_and_run_for_SimpleTest2_should_perform_test ( ) { java.lang.Class < ? > target = vogar.target.junit3.SimpleTest2.class ; java.util.List < vogar.target.junit.VogarTest > tests = vogar.target.junit.JUnitRunnerFactory.createVogarTests ( target , "testSimple2" , vogar.target.JUnitRunnerTest.EMPTY_ARGS ) ; vogar.target.Runner runner = new vogar.target.junit.JUnitRunner ( monitor , skipPastReference , testEnvironment , 0 , tests ) ; runner.run ( null ) ; org.mockito.Mockito.verify ( monitor ) . outcomeStarted ( vogar.target.junit.JUnitRunner.class , ( ( target.getName ( ) ) + "#testSimple2" ) ) ; org.mockito.Mockito.verify ( monitor ) . outcomeFinished ( Result.SUCCESS ) ; }
Source:
public void disableDevicePassword ( ) { mLockPatternUtils.clearEncryptionPassword ( ) ; mLockPatternUtils.setLockScreenDisabled ( true , android.os.UserHandle.myUserId ( ) ) ; mLockPatternUtils.setCredentialRequiredToDecrypt ( false ) ; mLockPatternUtils.clearEncryptionPassword ( ) ; mLockPatternUtils.clearLock ( null , android.os.UserHandle.myUserId ( ) ) ; mLockPatternUtils.setLockScreenDisabled ( true , android.os.UserHandle.myUserId ( ) ) ; }

Target:
public void disableDevicePassword ( @ com.googlecode.android_scripting.rpc.RpcParameter ( name = "currentPassword" , description = "The current password used to lock the device" ) java.lang.String currentPassword ) { mLockPatternUtils.clearLock ( currentPassword , android.os.UserHandle.myUserId ( ) ) ; mLockPatternUtils.setLockScreenDisabled ( true , android.os.UserHandle.myUserId ( ) ) ; }
Source:
synchronized void nAllocationData2D ( long id , int xoff , int yoff , int mip , int face , int w , int h , byte [ ] d , int sizeBytes ) { validate ( ) ; rsnAllocationData2D ( mContext , id , xoff , yoff , mip , face , w , h , d , sizeBytes ) ; }

Target:
synchronized void nScriptBindAllocation ( long script , long alloc , int slot , boolean mUseInc ) { validate ( ) ; long curCon = mContext ; if ( mUseInc ) { curCon = mIncCon ; } rsnScriptBindAllocation ( curCon , script , alloc , slot , mUseInc ) ; }
Source:
public void onCreate ( ) { mVibrator = ( ( android.os.Vibrator ) ( getSystemService ( Context.VIBRATOR_SERVICE ) ) ) ; mAudioManager = ( ( android.media.AudioManager ) ( getSystemService ( Context.AUDIO_SERVICE ) ) ) ; mTelephonyManager = ( ( android.telephony.TelephonyManager ) ( getSystemService ( Context.TELEPHONY_SERVICE ) ) ) ; mTelephonyManager.listen ( mPhoneStateListener , PhoneStateListener.LISTEN_CALL_STATE ) ; }

Target:
public void onCreate ( ) { mVibrator = ( ( android.os.Vibrator ) ( getSystemService ( Context.VIBRATOR_SERVICE ) ) ) ; mAudioManager = ( ( android.media.AudioManager ) ( getSystemService ( Context.AUDIO_SERVICE ) ) ) ; mTelephonyManager = ( ( android.telephony.TelephonyManager ) ( getSystemService ( Context.TELEPHONY_SERVICE ) ) ) ; mTelephonyManager.listen ( mPhoneStateListener , PhoneStateListener.LISTEN_CALL_STATE ) ; mPackageManager = getPackageManager ( ) ; }
Source:
public boolean removeForward ( int localPort , int remotePort ) { try { return com.android.ddmlib.AdbHelper.removeForward ( com.android.ddmlib.AndroidDebugBridge.getSocketAddress ( ) , this , localPort , remotePort ) ; } catch ( java.io.IOException e ) { com.android.ddmlib.Log.e ( "adb-remove-forward" , e ) ; return false ; } }

Target:
public boolean removeForward ( int localPort , int remotePort ) { try { return com.android.ddmlib.AdbHelper.removeForward ( com.android.ddmlib.AndroidDebugBridge.getSocketAddress ( ) , this , localPort , remotePort ) ; } catch ( com.android.ddmlib.TimeoutException e ) { com.android.ddmlib.Log.e ( "adb-remove-forward" , "timeout" ) ; return false ; } catch ( java.io.IOException e ) { com.android.ddmlib.Log.e ( "adb-remove-forward" , e ) ; return false ; } }
Source:
public boolean setPriority ( android.bluetooth.BluetoothDevice device , int priority ) { enforceCallingOrSelfPermission ( com.android.bluetooth.hid.BLUETOOTH_ADMIN_PERM , "Need BLUETOOTH_ADMIN permission" ) ; if ( com.android.bluetooth.hid.HidService.DBG ) { android.util.Log.d ( com.android.bluetooth.hid.HidService.TAG , ( "setPriority: " + ( device.getAddress ( ) ) ) ) ; } Settings.Global.putInt ( getContentResolver ( ) , Settings.Global.getBluetoothHidHostPriorityKey ( device.getAddress ( ) ) , priority ) ; if ( com.android.bluetooth.hid.HidService.DBG ) { android.util.Log.d ( com.android.bluetooth.hid.HidService.TAG , ( ( ( "Saved priority " + device ) + " = " ) + priority ) ) ; } return true ; }

Target:
public boolean setPriority ( android.bluetooth.BluetoothDevice device , int priority ) { enforceCallingOrSelfPermission ( com.android.bluetooth.hid.BLUETOOTH_ADMIN_PERM , "Need BLUETOOTH_ADMIN permission" ) ; if ( com.android.bluetooth.hid.HidHostService.DBG ) { android.util.Log.d ( com.android.bluetooth.hid.HidHostService.TAG , ( "setPriority: " + ( device.getAddress ( ) ) ) ) ; } Settings.Global.putInt ( getContentResolver ( ) , Settings.Global.getBluetoothHidHostPriorityKey ( device.getAddress ( ) ) , priority ) ; if ( com.android.bluetooth.hid.HidHostService.DBG ) { android.util.Log.d ( com.android.bluetooth.hid.HidHostService.TAG , ( ( ( "Saved priority " + device ) + " = " ) + priority ) ) ; } return true ; }
Source:
public static java.lang.String getDexCacheLocation ( com.android.tools.perflib.heap.Instance inst ) { if ( com.android.ahat.InstanceUtils.isInstanceOfClass ( inst , "java.lang.DexCache" ) ) { com.android.tools.perflib.heap.Instance location = com.android.ahat.InstanceUtils.getRefField ( inst , "location" ) ; if ( location != null ) { return com.android.ahat.InstanceUtils.asString ( location ) ; } } return null ; }

Target:
public static java.lang.String getDexCacheLocation ( com.android.tools.perflib.heap.Instance inst , int maxChars ) { if ( com.android.ahat.InstanceUtils.isInstanceOfClass ( inst , "java.lang.DexCache" ) ) { com.android.tools.perflib.heap.Instance location = com.android.ahat.InstanceUtils.getRefField ( inst , "location" ) ; if ( location != null ) { return com.android.ahat.InstanceUtils.asString ( location , maxChars ) ; } } return null ; }
Source:
public java.lang.String toString ( ) { return ( ( ( "DexPathList[" + ( java.util.Arrays.toString ( dexElements ) ) ) + ",nativeLibraryDirectories=" ) + ( java.util.Arrays.toString ( nativeLibraryDirectories ) ) ) + "]" ; }

Target:
public java.lang.String toString ( ) { java.io.File [ ] nativeLibraryDirectoriesArray = nativeLibraryDirectories.toArray ( new java.io.File [ nativeLibraryDirectories.size ( ) ] ) ; return ( ( ( "DexPathList[" + ( java.util.Arrays.toString ( dexElements ) ) ) + ",nativeLibraryDirectories=" ) + ( java.util.Arrays.toString ( nativeLibraryDirectoriesArray ) ) ) + "]" ; }
Source:
public void sendUssdResponse ( java.lang.String ussdMessge ) { com.android.internal.telephony.gsm.GsmMmiCode mmi = com.android.internal.telephony.gsm.GsmMmiCode.newFromUssdUserInput ( ussdMessge , this ) ; mPendingMMIs.add ( mmi ) ; mMmiRegistrants.notifyRegistrants ( new android.os.AsyncResult ( null , mmi , null ) ) ; mmi.sendUssd ( ussdMessge ) ; }

Target:
public void sendUssdResponse ( java.lang.String ussdMessge ) { com.android.internal.telephony.gsm.GsmMmiCode mmi = com.android.internal.telephony.gsm.GsmMmiCode.newFromUssdUserInput ( ussdMessge , this , mUiccApplication.get ( ) ) ; mPendingMMIs.add ( mmi ) ; mMmiRegistrants.notifyRegistrants ( new android.os.AsyncResult ( null , mmi , null ) ) ; mmi.sendUssd ( ussdMessge ) ; }
Source:
public static libcore.util.ZoneInfoDB.TzData loadTzDataWithFallback ( java.lang.String ... paths ) { for ( java.lang.String path : paths ) { libcore.util.ZoneInfoDB.TzData tzData = new libcore.util.ZoneInfoDB.TzData ( ) ; if ( tzData.loadData ( path ) ) { return tzData ; } } java.lang.System.logE ( "Couldn't find any tzdata!" ) ; return libcore.util.ZoneInfoDB.TzData.createFallback ( ) ; }

Target:
public static libcore.util.ZoneInfoDB.TzData loadTzDataWithFallback ( java.lang.String ... paths ) { for ( java.lang.String path : paths ) { libcore.util.ZoneInfoDB.TzData tzData = new libcore.util.ZoneInfoDB.TzData ( ) ; if ( tzData.loadData ( path ) ) { return tzData ; } } java.lang.System.logE ( ( ( "Couldn't find any " + ( libcore.util.ZoneInfoDB.TZDATA_FILE ) ) + " file!" ) ) ; return libcore.util.ZoneInfoDB.TzData.createFallback ( ) ; }
Source:
private static java.io.File getWrittenResources ( ) throws com.android.ide.common.res2.DuplicateDataException , java.io.IOException , java.lang.InterruptedException , java.util.concurrent.ExecutionException { com.android.ide.common.res2.AssetMerger assetMerger = com.android.ide.common.res2.AssetMergerTest.getAssetMerger ( ) ; java.io.File folder = com.google.common.io.Files.createTempDir ( ) ; assetMerger.writeDataFolder ( folder ) ; return folder ; }

Target:
private static java.io.File getWrittenResources ( ) throws MergeConsumer.ConsumerException , com.android.ide.common.res2.DuplicateDataException , java.io.IOException { com.android.ide.common.res2.AssetMerger assetMerger = com.android.ide.common.res2.AssetMergerTest.getAssetMerger ( ) ; java.io.File folder = com.google.common.io.Files.createTempDir ( ) ; com.android.ide.common.res2.MergedAssetWriter writer = new com.android.ide.common.res2.MergedAssetWriter ( folder ) ; assetMerger.mergeData ( writer ) ; return folder ; }
Source:
public void testEmptyOverrideFile ( ) throws java.lang.Exception { libcore.util.ZoneInfoDB.TzData data = new libcore.util.ZoneInfoDB.TzData ( libcore.util.ZoneInfoDBTest.makeEmptyFile ( ) , libcore.util.ZoneInfoDBTest.TZDATA_IN_DATA , libcore.util.ZoneInfoDBTest.TZDATA_IN_ROOT ) ; assertEquals ( libcore.util.ZoneInfoDBTest.CURRENT_VERSION , data.getVersion ( ) ) ; assertEquals ( java.util.TimeZone.getAvailableIDs ( ) . length , data.getAvailableIDs ( ) . length ) ; }

Target:
public void testEmptyOverrideFile ( ) throws java.lang.Exception { libcore.util.ZoneInfoDB.TzData data = new libcore.util.ZoneInfoDB.TzData ( libcore.util.ZoneInfoDBTest.TZDATA_IN_ROOT ) ; libcore.util.ZoneInfoDB.TzData dataWithEmptyOverride = new libcore.util.ZoneInfoDB.TzData ( libcore.util.ZoneInfoDBTest.makeEmptyFile ( ) , libcore.util.ZoneInfoDBTest.TZDATA_IN_ROOT ) ; assertEquals ( data.getVersion ( ) , dataWithEmptyOverride.getVersion ( ) ) ; assertEquals ( data.getAvailableIDs ( ) . length , dataWithEmptyOverride.getAvailableIDs ( ) . length ) ; }
Source:
public static int StaticCondition ( ) { int a ; int b ; int c ; a = 7 ; b = 2 ; if ( a < b ) c = a + b ; else c = a - b ; return c ; }

Target:
public static int StaticCondition ( ) { int a ; int b ; int c ; a = Main.$inline$int ( 7 ) ; b = Main.$inline$int ( 2 ) ; if ( a < b ) c = a + b ; else c = a - b ; return c ; }
Source:
public void clearCache ( ) { if ( ( mCacheRoot ) != null ) { java.io.File [ ] files = mCacheRoot.listFiles ( ) ; if ( files != null ) { for ( java.io.File f : files ) { if ( f.isFile ( ) ) { java.lang.String name = f.getName ( ) ; if ( ( name.startsWith ( com.android.sdklib.internal.repository.DownloadCache.BIN_FILE_PREFIX ) ) || ( name.startsWith ( com.android.sdklib.internal.repository.DownloadCache.INFO_FILE_PREFIX ) ) ) { f.delete ( ) ; } } } } } }

Target:
public void clearCache ( ) { if ( ( mCacheRoot ) != null ) { java.io.File [ ] files = mFileOp.listFiles ( mCacheRoot ) ; for ( java.io.File f : files ) { if ( mFileOp.isFile ( f ) ) { java.lang.String name = f.getName ( ) ; if ( ( name.startsWith ( com.android.sdklib.internal.repository.DownloadCache.BIN_FILE_PREFIX ) ) || ( name.startsWith ( com.android.sdklib.internal.repository.DownloadCache.INFO_FILE_PREFIX ) ) ) { mFileOp.delete ( f ) ; } } } } }
Source:
public void packageDeleted ( java.lang.String packageName , int returnCode ) { if ( returnCode != ( android.content.pm.PackageManager.DELETE_SUCCEEDED ) ) { com.android.managedprovisioning.ProvisionLogger.logw ( "Could not finish the provisioning: package deletion failed" ) ; mCallback.onError ( ) ; } int currentPackageCount = mPackageCount.decrementAndGet ( ) ; if ( currentPackageCount == 0 ) { com.android.managedprovisioning.ProvisionLogger.logi ( "All non-required system apps have been uninstalled." ) ; mCallback.onSuccess ( ) ; } }

Target:
public void packageDeleted ( java.lang.String packageName , int returnCode ) { if ( returnCode != ( android.content.pm.PackageManager.DELETE_SUCCEEDED ) ) { com.android.managedprovisioning.ProvisionLogger.logw ( "Could not finish the provisioning: package deletion failed" ) ; mCallback.onError ( ) ; } int currentPackageCount = mPackageCount.decrementAndGet ( ) ; if ( currentPackageCount == 0 ) { com.android.managedprovisioning.ProvisionLogger.logi ( ( "All non-required system apps with launcher icon, " + "and all disallowed apps have been uninstalled." ) ) ; mCallback.onSuccess ( ) ; } }
Source:
public android.os.Bundle hasFeatures ( android.accounts.AccountAuthenticatorResponse r , android.accounts.Account account , java.lang.String [ ] strings ) throws android.accounts.NetworkErrorException { android.util.Log.d ( com.google.android.car.pbapsink.Authenticator.TAG , "got call" , new java.lang.Exception ( ) ) ; final android.os.Bundle result = new android.os.Bundle ( ) ; result.putBoolean ( AccountManager.KEY_BOOLEAN_RESULT , false ) ; return result ; }

Target:
public android.os.Bundle hasFeatures ( android.accounts.AccountAuthenticatorResponse r , android.accounts.Account account , java.lang.String [ ] strings ) throws android.accounts.NetworkErrorException { android.util.Log.d ( com.android.bluetooth.pbapclient.Authenticator.TAG , "got call" , new java.lang.Exception ( ) ) ; final android.os.Bundle result = new android.os.Bundle ( ) ; result.putBoolean ( AccountManager.KEY_BOOLEAN_RESULT , false ) ; return result ; }
Source:
public void testMergeDefaultOnDefault ( ) { com.android.builder.ProductFlavor flavor = mDefault.mergeWith ( mDefault2 ) ; assertEquals ( ( - 1 ) , flavor.getMinSdkVersion ( ) ) ; assertEquals ( ( - 1 ) , flavor.getTargetSdkVersion ( ) ) ; assertEquals ( ( - 1 ) , flavor.getVersionCode ( ) ) ; assertNull ( flavor.getVersionName ( ) ) ; assertNull ( flavor.getPackageName ( ) ) ; assertNull ( flavor.getTestPackageName ( ) ) ; assertNull ( flavor.getTestInstrumentationRunner ( ) ) ; }

Target:
public void testMergeDefaultOnDefault ( ) { com.android.builder.ProductFlavor flavor = mDefault.mergeOver ( mDefault2 ) ; assertEquals ( ( - 1 ) , flavor.getMinSdkVersion ( ) ) ; assertEquals ( ( - 1 ) , flavor.getTargetSdkVersion ( ) ) ; assertEquals ( ( - 1 ) , flavor.getVersionCode ( ) ) ; assertNull ( flavor.getVersionName ( ) ) ; assertNull ( flavor.getPackageName ( ) ) ; assertNull ( flavor.getTestPackageName ( ) ) ; assertNull ( flavor.getTestInstrumentationRunner ( ) ) ; }
Source:
public void testRenderScript ( ) { android.renderscript.RenderScript mRS = android.renderscript.RenderScript.create ( getContext ( ) ) ; android.renderscript.cts.ScriptC_passthrough t = new android.renderscript.cts.ScriptC_passthrough ( mRS ) ; t.invoke_passthrough ( 5 ) ; mRS.destroy ( ) ; }

Target:
public void testRenderScript ( ) { android.renderscript.RenderScript mRS = android.renderscript.RenderScript.create ( getContext ( ) ) ; android.renderscript.cts.ScriptC_passthrough t = new android.renderscript.cts.ScriptC_passthrough ( mRS ) ; t.invoke_passthrough ( 5 ) ; mRS.finish ( ) ; t.destroy ( ) ; mRS.destroy ( ) ; }
Source:
public void onCreate ( android.database.sqlite.SQLiteDatabase db ) { if ( com.android.providers.telephony.TelephonyProvider.DBG ) com.android.providers.telephony.TelephonyProvider.log ( ( "dbh.onCreate:+ db=" + db ) ) ; createSimInfoTable ( db ) ; createCarriersTable ( db , com.android.providers.telephony.TelephonyProvider.CARRIERS_TABLE ) ; initDatabase ( db ) ; if ( com.android.providers.telephony.TelephonyProvider.DBG ) com.android.providers.telephony.TelephonyProvider.log ( ( "dbh.onCreate:- db=" + db ) ) ; }

Target:
public void onCreate ( android.database.sqlite.SQLiteDatabase db ) { if ( com.android.providers.telephony.TelephonyProvider.DBG ) com.android.providers.telephony.TelephonyProvider.log ( ( "dbh.onCreate:+ db=" + db ) ) ; createSimInfoTable ( db ) ; createCarriersTable ( db , com.android.providers.telephony.TelephonyProvider.CARRIERS_TABLE ) ; if ( com.android.providers.telephony.TelephonyProvider.apnSourceServiceExists ( mContext ) ) { com.android.providers.telephony.TelephonyProvider.log ( "dbh.onCreate: Skipping apply APNs from xml." ) ; } else { com.android.providers.telephony.TelephonyProvider.log ( "dbh.onCreate: Apply apns from xml." ) ; initDatabase ( db ) ; } if ( com.android.providers.telephony.TelephonyProvider.DBG ) com.android.providers.telephony.TelephonyProvider.log ( ( "dbh.onCreate:- db=" + db ) ) ; }
Source:
public void checkClientTrusted ( java.security.cert.X509Certificate [ ] chain , java.lang.String authType , java.net.Socket socket ) throws java.security.cert.CertificateException { javax.net.ssl.SSLSession session = null ; javax.net.ssl.SSLParameters parameters = null ; if ( socket instanceof javax.net.ssl.SSLSocket ) { javax.net.ssl.SSLSocket sslSocket = ( ( javax.net.ssl.SSLSocket ) ( socket ) ) ; session = sslSocket.getHandshakeSession ( ) ; if ( session == null ) { throw new java.security.cert.CertificateException ( "Not in handshake; no session available" ) ; } parameters = sslSocket.getSSLParameters ( ) ; } checkTrusted ( chain , authType , session , parameters , true ) ; }

Target:
public void checkServerTrusted ( java.security.cert.X509Certificate [ ] chain , java.lang.String authType ) throws java.security.cert.CertificateException { checkTrusted ( chain , authType , null , false ) ; }
Source:
private static android.net.NetworkState buildWifiState ( ) { final android.net.NetworkInfo info = new android.net.NetworkInfo ( android.net.ConnectivityManager.TYPE_WIFI , 0 , null , null ) ; info.setDetailedState ( DetailedState.CONNECTED , null , null ) ; final android.net.LinkProperties prop = new android.net.LinkProperties ( ) ; prop.setInterfaceName ( com.android.server.net.NetworkStatsServiceTest.TEST_IFACE ) ; return new android.net.NetworkState ( info , prop , null , null , null , com.android.server.net.NetworkStatsServiceTest.TEST_SSID ) ; }

Target:
private static android.net.NetworkState buildWifiState ( ) { final android.net.NetworkInfo info = new android.net.NetworkInfo ( android.net.ConnectivityManager.TYPE_WIFI , 0 , null , null ) ; info.setDetailedState ( DetailedState.CONNECTED , null , null ) ; final android.net.LinkProperties prop = new android.net.LinkProperties ( ) ; prop.setInterfaceName ( com.android.server.net.NetworkStatsServiceTest.TEST_IFACE ) ; final android.net.NetworkCapabilities capabilities = new android.net.NetworkCapabilities ( ) ; return new android.net.NetworkState ( info , prop , capabilities , null , null , com.android.server.net.NetworkStatsServiceTest.TEST_SSID ) ; }
Source:
public void actionPerformed ( java.awt.event.ActionEvent e ) { fieldSpecificationDialog.setMemberSpecification ( new proguard.gui.MemberSpecification ( ) ) ; int returnValue = fieldSpecificationDialog.showDialog ( ) ; if ( returnValue == ( MemberSpecificationDialog.APPROVE_OPTION ) ) { addElement ( new proguard.gui.MemberSpecificationsPanel.MyMemberSpecificationWrapper ( fieldSpecificationDialog.getMemberSpecification ( ) , true ) ) ; } }

Target:
public void actionPerformed ( java.awt.event.ActionEvent e ) { fieldSpecificationDialog.setMemberSpecification ( new proguard.MemberSpecification ( ) ) ; int returnValue = fieldSpecificationDialog.showDialog ( ) ; if ( returnValue == ( MemberSpecificationDialog.APPROVE_OPTION ) ) { addElement ( new proguard.gui.MemberSpecificationsPanel.MyMemberSpecificationWrapper ( fieldSpecificationDialog.getMemberSpecification ( ) , true ) ) ; } }
Source:
public boolean processMessage ( android.os.Message message ) { if ( super . processMessage ( message ) ) return true ; maybeLogMessage ( this , message.what ) ; switch ( message.what ) { case com.android.server.connectivity.tethering.TetherInterfaceStateMachine.CMD_TETHER_REQUESTED : mLog.e ( "CMD_TETHER_REQUESTED while in local-only hotspot mode." ) ; break ; case com.android.server.connectivity.tethering.TetherInterfaceStateMachine.CMD_TETHER_CONNECTION_CHANGED : break ; default : return false ; } return true ; }

Target:
public boolean processMessage ( android.os.Message message ) { if ( super . processMessage ( message ) ) return true ; logMessage ( this , message.what ) ; switch ( message.what ) { case com.android.server.connectivity.tethering.TetherInterfaceStateMachine.CMD_TETHER_REQUESTED : mLog.e ( "CMD_TETHER_REQUESTED while in local-only hotspot mode." ) ; break ; case com.android.server.connectivity.tethering.TetherInterfaceStateMachine.CMD_TETHER_CONNECTION_CHANGED : break ; default : return false ; } return true ; }
Source:
private static boolean isSupportedForWrapping ( java.lang.String algorithm ) { if ( libcore.javax.crypto.CipherTest.isOnlyWrappingAlgorithm ( algorithm ) ) { return true ; } if ( algorithm.equals ( "RSA/ECB/NOPADDING" ) ) { return false ; } if ( algorithm.startsWith ( "AES" ) ) { return false ; } return true ; }

Target:
private static boolean isSupportedForWrapping ( java.lang.String algorithm ) { if ( libcore.javax.crypto.CipherTest.isOnlyWrappingAlgorithm ( algorithm ) ) { return true ; } if ( algorithm.equals ( "RSA/ECB/NOPADDING" ) ) { return false ; } if ( ( algorithm.startsWith ( "AES" ) ) || ( algorithm.startsWith ( "DESEDE" ) ) ) { return false ; } return true ; }
Source:
void prepareEngines ( ) throws java.lang.Exception { java.nio.channels.Pipe clientSendPipe = java.nio.channels.Pipe.open ( ) ; java.nio.channels.Pipe serverSendPipe = java.nio.channels.Pipe.open ( ) ; java.nio.channels.Pipe.SinkChannel clientSink = clientSendPipe.sink ( ) ; java.nio.channels.Pipe.SourceChannel serverSource = clientSendPipe.source ( ) ; java.nio.channels.Pipe.SinkChannel serverSink = serverSendPipe.sink ( ) ; java.nio.channels.Pipe.SourceChannel clientSource = serverSendPipe.source ( ) ; clientEngine = new org.apache.harmony.tests.javax.net.ssl.SSLEngineTest.HandshakeHandler ( true , clientSource , clientSink ) ; serverEngine = new org.apache.harmony.tests.javax.net.ssl.SSLEngineTest.HandshakeHandler ( false , serverSource , serverSink ) ; }

Target:
void prepareEngines ( ) throws java.lang.Exception { java.nio.channels.Pipe clientSendPipe = java.nio.channels.Pipe.open ( ) ; java.nio.channels.Pipe serverSendPipe = java.nio.channels.Pipe.open ( ) ; java.nio.channels.Pipe.SinkChannel clientSink = clientSendPipe.sink ( ) ; java.nio.channels.Pipe.SourceChannel serverSource = clientSendPipe.source ( ) ; java.nio.channels.Pipe.SinkChannel serverSink = serverSendPipe.sink ( ) ; java.nio.channels.Pipe.SourceChannel clientSource = serverSendPipe.source ( ) ; libcore.javax.net.ssl.TestSSLContext context = libcore.javax.net.ssl.TestSSLContext.create ( ) ; clientEngine = new org.apache.harmony.tests.javax.net.ssl.SSLEngineTest.HandshakeHandler ( context.clientContext , true , clientSource , clientSink ) ; serverEngine = new org.apache.harmony.tests.javax.net.ssl.SSLEngineTest.HandshakeHandler ( context.serverContext , false , serverSource , serverSink ) ; }
Source:
protected void addImportedResource ( @ javax.annotation.Nonnull com.android.sched.vfs.InputVFile file , @ javax.annotation.Nonnull com.android.jack.ir.ast.JSession session , @ javax.annotation.Nonnull java.lang.String currentPath , @ javax.annotation.Nonnull com.android.sched.util.location.Location resourceDirLocation ) { com.android.sched.vfs.VPath path = new com.android.sched.vfs.VPath ( currentPath , com.android.jack.resource.ResourceOrMetaImporter.VPATH_SEPARATOR ) ; com.android.jack.meta.Meta newMeta = new com.android.jack.meta.Meta ( path , file , new com.android.jack.meta.MetaImporter.StandaloneMetaLocation ( resourceDirLocation , path ) ) ; session.addMeta ( newMeta ) ; }

Target:
protected void addImportedResource ( @ javax.annotation.Nonnull com.android.sched.vfs.InputVFile file , @ javax.annotation.Nonnull java.lang.String currentPath , @ javax.annotation.Nonnull com.android.sched.util.location.Location resourceDirLocation , @ javax.annotation.Nonnull java.util.List < com.android.jack.resource.ResourceOrMeta > resultList ) { com.android.sched.vfs.VPath path = new com.android.sched.vfs.VPath ( currentPath , com.android.jack.resource.ResourceOrMetaImporter.VPATH_SEPARATOR ) ; com.android.jack.meta.Meta newMeta = new com.android.jack.meta.Meta ( path , file , new com.android.jack.meta.MetaImporter.StandaloneMetaLocation ( resourceDirLocation , path ) ) ; resultList.add ( newMeta ) ; }
Source:
public boolean canHandle ( java.lang.String path , java.lang.String mimeType ) { if ( ( ( null == path ) || ( path.equals ( "" ) ) ) && ( ( null == mimeType ) || ( mimeType.equals ( "" ) ) ) ) { throw new java.lang.IllegalArgumentException ( "Path or the mimetype should be non null" ) ; } else if ( ( getState ( ) ) == ( android.drm.DrmManagerClient.STATE_UNINITIALIZED ) ) { throw new java.lang.IllegalStateException ( "Not Initialized yet" ) ; } return _canHandle ( mUniqueId , path , mimeType ) ; }

Target:
public int checkRightsStatus ( java.lang.String path , int action ) { if ( ( ( null == path ) || ( path.equals ( "" ) ) ) || ( ! ( DrmStore.Action.isValid ( action ) ) ) ) { throw new java.lang.IllegalArgumentException ( "Given path or action is not valid" ) ; } else if ( ( android.drm.DrmManagerClient.STATE_UNINITIALIZED ) == ( getState ( ) ) ) { throw new java.lang.IllegalStateException ( "Not Initialized yet" ) ; } return _checkRightsStatus ( mUniqueId , path , action ) ; }
Source:
public K next ( ) { return iterator.next ( ) . getKey ( ) ; }

Target:
public boolean retainAll ( java.util.Collection < ? > c ) { return com.google.common.collect.Iterators.removeIf ( unfiltered.entrySet ( ) . iterator ( ) , com.google.common.base.Predicates.< java.util.Map.Entry < K , V > > and ( entryPredicate , com.google.common.collect.Maps.< K > keyPredicateOnEntries ( com.google.common.base.Predicates.not ( com.google.common.base.Predicates.in ( c ) ) ) ) ) ; }
Source:
public java.lang.String nextClassName ( ) { int classNameStartIndex = index ; loop : while ( true ) { switch ( descriptor.charAt ( index ) ) { case proguard.classfile.ClassConstants.INTERNAL_TYPE_GENERIC_START : case proguard.classfile.ClassConstants.INTERNAL_TYPE_CLASS_END : case proguard.classfile.ClassConstants.EXTERNAL_INNER_CLASS_SEPARATOR : { break loop ; } } ( index ) ++ ; } java.lang.String className = descriptor.substring ( classNameStartIndex , index ) ; accumulatedClassName = ( isInnerClassName ) ? ( ( accumulatedClassName ) + ( proguard.classfile.ClassConstants.INTERNAL_INNER_CLASS_SEPARATOR ) ) + className : className ; return accumulatedClassName ; }

Target:
public java.lang.String nextClassName ( ) { int classNameStartIndex = index ; loop : while ( true ) { switch ( descriptor.charAt ( index ) ) { case ClassConstants.TYPE_GENERIC_START : case ClassConstants.TYPE_CLASS_END : case JavaConstants.INNER_CLASS_SEPARATOR : { break loop ; } } ( index ) ++ ; } java.lang.String className = descriptor.substring ( classNameStartIndex , index ) ; accumulatedClassName = ( isInnerClassName ) ? ( ( accumulatedClassName ) + ( ClassConstants.INNER_CLASS_SEPARATOR ) ) + className : className ; return accumulatedClassName ; }
Source:
private void retryFingerprint ( ) { if ( mRemovalSidecar.inProgress ( ) ) { return ; } if ( ! ( mInFingerprintLockout ) ) { mFingerprintCancel = new android.os.CancellationSignal ( ) ; mFingerprintManager.authenticate ( null , mFingerprintCancel , 0 , mAuthCallback , null , mUserId ) ; } }

Target:
private void retryFingerprint ( ) { if ( ( mRemovalSidecar.inProgress ( ) ) || ( 0 == ( mFingerprintManager.getEnrolledFingerprints ( mUserId ) . size ( ) ) ) ) { return ; } if ( ! ( mInFingerprintLockout ) ) { mFingerprintCancel = new android.os.CancellationSignal ( ) ; mFingerprintManager.authenticate ( null , mFingerprintCancel , 0 , mAuthCallback , null , mUserId ) ; } }
Source:
public void runCmdLine ( java.lang.String [ ] command ) throws java.io.IOException , java.lang.InterruptedException { printCommand ( command ) ; java.lang.Process process = java.lang.Runtime.getRuntime ( ) . exec ( command ) ; if ( ( grabProcessOutput ( process ) ) != 0 ) { throw new java.lang.RuntimeException ( java.lang.String.format ( "Running %s failed. See output" , command [ 0 ] ) ) ; } }

Target:
public void runCmdLine ( java.lang.String [ ] command ) throws com.android.ide.common.internal.LoggedErrorException , java.io.IOException , java.lang.InterruptedException { printCommand ( command ) ; java.lang.Process process = java.lang.Runtime.getRuntime ( ) . exec ( command ) ; com.android.ide.common.internal.CommandLineRunner.OutputGrabber grabber = new com.android.ide.common.internal.CommandLineRunner.OutputGrabber ( ) ; int returnCode = com.android.sdklib.util.GrabProcessOutput.grabProcessOutput ( process , GrabProcessOutput.Wait.WAIT_FOR_READERS , grabber ) ; if ( returnCode != 0 ) { throw new com.android.ide.common.internal.LoggedErrorException ( returnCode , grabber.mErrors , com.google.common.base.Joiner.on ( ' ' ) . join ( command ) ) ; } }
Source:
private boolean shouldShowLocation ( ) { if ( com.android.incallui.CallCardPresenter.isOutgoingEmergencyCall ( mPrimary ) ) { com.android.dialer.common.LogUtil.i ( "CallCardPresenter.shouldShowLocation" , "new emergency call" ) ; return true ; } else if ( com.android.incallui.CallCardPresenter.isIncomingEmergencyCall ( mPrimary ) ) { com.android.dialer.common.LogUtil.i ( "CallCardPresenter.shouldShowLocation" , "potential emergency callback" ) ; return true ; } else if ( com.android.incallui.CallCardPresenter.isIncomingEmergencyCall ( mSecondary ) ) { com.android.dialer.common.LogUtil.i ( "CallCardPresenter.shouldShowLocation" , "has potential emergency callback" ) ; return true ; } return false ; }

Target:
private boolean isPotentialEmergencyCall ( ) { if ( com.android.incallui.CallCardPresenter.isOutgoingEmergencyCall ( mPrimary ) ) { com.android.dialer.common.LogUtil.i ( "CallCardPresenter.shouldShowLocation" , "new emergency call" ) ; return true ; } else if ( com.android.incallui.CallCardPresenter.isIncomingEmergencyCall ( mPrimary ) ) { com.android.dialer.common.LogUtil.i ( "CallCardPresenter.shouldShowLocation" , "potential emergency callback" ) ; return true ; } else if ( com.android.incallui.CallCardPresenter.isIncomingEmergencyCall ( mSecondary ) ) { com.android.dialer.common.LogUtil.i ( "CallCardPresenter.shouldShowLocation" , "has potential emergency callback" ) ; return true ; } return false ; }
Source:
public void write ( @ javax.annotation.Nonnull com.android.jack.ir.ast.JNode jNode ) throws java.io.IOException { com.android.sched.util.log.Event eventWriting = com.android.jack.jayce.v0002.io.JayceInternalWriterImpl.tracer.start ( JackEventType.NNODE_WRITING ) ; try { com.android.jack.jayce.v0002.io.ImportHelper importHelper = new com.android.jack.jayce.v0002.io.ImportHelper ( new com.android.jack.jayce.v0002.NodeFactory ( ) ) ; com.android.sched.util.log.Event eventConvert = com.android.jack.jayce.v0002.io.JayceInternalWriterImpl.tracer.start ( JackEventType.JNODE_TO_NNODE_CONVERSION ) ; com.android.jack.jayce.v0002.NNode nNode ; try { nNode = importHelper.load ( jNode ) ; } finally { eventConvert.end ( ) ; } writeNode ( nNode ) ; } finally { eventWriting.end ( ) ; } }

Target:
public void write ( @ javax.annotation.Nonnull com.android.jack.ir.ast.JNode jNode ) throws java.io.IOException { com.android.sched.util.log.Event eventWriting = tracer.start ( JackEventType.NNODE_WRITING ) ; try { com.android.jack.jayce.v0002.io.ImportHelper importHelper = new com.android.jack.jayce.v0002.io.ImportHelper ( new com.android.jack.jayce.v0002.NodeFactory ( ) ) ; com.android.sched.util.log.Event eventConvert = tracer.start ( JackEventType.JNODE_TO_NNODE_CONVERSION ) ; com.android.jack.jayce.v0002.NNode nNode ; try { nNode = importHelper.load ( jNode ) ; } finally { eventConvert.end ( ) ; } writeNode ( nNode ) ; } finally { eventWriting.end ( ) ; } }
Source:
public org.eclipse.swt.graphics.Image getImage ( java.lang.Object element ) { if ( element instanceof org.w3c.dom.Element ) { org.w3c.dom.Element e = ( ( org.w3c.dom.Element ) ( element ) ) ; java.lang.String tagName = e.getTagName ( ) ; com.android.ide.eclipse.adt.internal.editors.IconFactory factory = com.android.ide.eclipse.adt.internal.editors.IconFactory.getInstance ( ) ; org.eclipse.swt.graphics.Image img = factory.getIcon ( tagName , null ) ; if ( img != null ) { return img ; } } return super . getImage ( element ) ; }

Target:
public org.eclipse.swt.graphics.Image getImage ( java.lang.Object element ) { if ( element instanceof org.w3c.dom.Element ) { org.w3c.dom.Element e = ( ( org.w3c.dom.Element ) ( element ) ) ; java.lang.String tagName = e.getTagName ( ) ; if ( com.android.SdkConstants.VIEW_TAG.equals ( tagName ) ) { tagName = com.android.SdkConstants.VIEW ; } com.android.ide.eclipse.adt.internal.editors.IconFactory factory = com.android.ide.eclipse.adt.internal.editors.IconFactory.getInstance ( ) ; org.eclipse.swt.graphics.Image img = factory.getIcon ( tagName , null ) ; if ( img != null ) { return img ; } } return super . getImage ( element ) ; }
Source:
public static void loop5 ( boolean incoming ) { while ( ( java.lang.Runtime.getRuntime ( ) ) != null ) { while ( incoming ) { java.lang.System.out.println ( incoming ) ; } } }

Target:
public static void loop5 ( boolean incoming ) { for ( long i = java.lang.System.nanoTime ( ) ; i < 42 ; ++ i ) { for ( long j = java.lang.System.currentTimeMillis ( ) ; j != 42 ; ++ j ) { java.lang.System.out.println ( incoming ) ; } } }
Source:
public void realRun ( ) { java.lang.Thread.currentThread ( ) . interrupt ( ) ; assertEquals ( 0 , phaser.register ( ) ) ; pleaseInterrupt.countDown ( ) ; assertTrue ( java.lang.Thread.currentThread ( ) . isInterrupted ( ) ) ; assertEquals ( 1 , phaser.arriveAndAwaitAdvance ( ) ) ; assertTrue ( java.lang.Thread.currentThread ( ) . isInterrupted ( ) ) ; }

Target:
public void realRun ( ) { java.lang.Thread.currentThread ( ) . interrupt ( ) ; assertEquals ( 0 , phaser.register ( ) ) ; pleaseArrive.countDown ( ) ; assertTrue ( java.lang.Thread.currentThread ( ) . isInterrupted ( ) ) ; assertEquals ( 1 , phaser.arriveAndAwaitAdvance ( ) ) ; assertTrue ( java.lang.Thread.interrupted ( ) ) ; }
Source:
public com.android.ims.internal.IImsMMTelFeature getEmergencyMMTelFeature ( int slotId ) { synchronized ( mLock ) { com.android.internal.telephony.ims.ImsServiceController.ImsFeatureContainer f = getImsFeatureContainer ( slotId , ImsFeature.EMERGENCY_MMTEL ) ; if ( f == null ) { android.util.Log.w ( com.android.internal.telephony.ims.ImsServiceController.LOG_TAG , ( "Requested null Emergency MMTelFeature on slot " + slotId ) ) ; return null ; } return f.resolve ( com.android.ims.internal.IImsMMTelFeature.class ) ; } }

Target:
public void disableIms ( int slotId ) { try { mIImsServiceController.disableIms ( slotId ) ; } catch ( android.os.RemoteException e ) { android.util.Log.w ( com.android.internal.telephony.ims.ImsServiceController.LOG_TAG , ( "Couldn't disable IMS: " + ( e.getMessage ( ) ) ) ) ; } }
Source:
public void testInvalidRead ( ) throws java.lang.Exception { com.android.ide.common.rendering.RenderSecurityManager manager = new com.android.ide.common.rendering.RenderSecurityManager ( null , null ) ; try { manager.setActive ( true ) ; java.io.File file = new java.io.File ( java.lang.System.getProperty ( "user.home" ) ) ; file.lastModified ( ) ; fail ( "Should have thrown security exception" ) ; } catch ( java.lang.SecurityException exception ) { assertEquals ( ( ( "Read access not allowed during rendering (" + ( java.lang.System.getProperty ( "user.home" ) ) ) + ")" ) , exception.toString ( ) ) ; } finally { manager.dispose ( ) ; } }

Target:
public void testReadWrite ( ) throws java.lang.Exception { com.android.ide.common.rendering.RenderSecurityManager manager = new com.android.ide.common.rendering.RenderSecurityManager ( null , null ) ; try { manager.setActive ( true ) ; manager.checkPermission ( new java.io.FilePermission ( "/foo" , "read,write" ) ) ; fail ( "Should have thrown security exception" ) ; } catch ( java.lang.SecurityException exception ) { assertEquals ( "Write access not allowed during rendering (/foo)" , exception.toString ( ) ) ; } finally { manager.dispose ( ) ; } }
Source:
public org.eclipse.swt.graphics.Font getFont ( java.lang.Object element , int columnIndex ) { if ( element instanceof com.android.sdkuilib.internal.repository.PackagesPage.PkgItem ) { if ( ( ( ( com.android.sdkuilib.internal.repository.PackagesPage.PkgItem ) ( element ) ) . getState ( ) ) == ( com.android.sdkuilib.internal.repository.PackagesPage.PkgState.NEW ) ) { return mTreeFontItalic ; } } else if ( element instanceof java.lang.Package ) { return mTreeFontItalic ; } return super . getFont ( element ) ; }

Target:
public org.eclipse.swt.graphics.Font getFont ( java.lang.Object element , int columnIndex ) { if ( element instanceof com.android.sdkuilib.internal.repository.PackageManager.PkgItem ) { if ( ( ( ( com.android.sdkuilib.internal.repository.PackageManager.PkgItem ) ( element ) ) . getState ( ) ) == ( com.android.sdkuilib.internal.repository.PackageManager.PkgState.NEW ) ) { return mTreeFontItalic ; } } else if ( element instanceof java.lang.Package ) { return mTreeFontItalic ; } return super . getFont ( element ) ; }
Source:
private void agentDisconnect ( android.net.NetworkAgent networkAgent ) { android.net.NetworkInfo networkInfo = new android.net.NetworkInfo ( mNetworkInfo ) ; agentDisconnect ( networkInfo , networkAgent ) ; }

Target:
private void agentDisconnect ( android.net.NetworkAgent networkAgent ) { if ( networkAgent != null ) { android.net.NetworkInfo networkInfo = new android.net.NetworkInfo ( mNetworkInfo ) ; networkInfo.setIsAvailable ( false ) ; networkInfo.setDetailedState ( DetailedState.DISCONNECTED , null , null ) ; networkAgent.sendNetworkInfo ( networkInfo ) ; } }
Source:
, @ dalvik.annotation.TestTargetNew ( level = dalvik.annotation.TestLevel.SUFFICIENT , method = "setLoadsImagesAutomatically" , args = { boolean . class } ) } ) public void testAccessLoadsImagesAutomatically ( ) throws java.lang.Exception { mWebView.clearCache ( true ) ; assertTrue ( mSettings.getLoadsImagesAutomatically ( ) ) ; java.lang.String url = TestHtmlConstants.EMBEDDED_IMG_URL ; java.lang.String ext = android.webkit.MimeTypeMap.getFileExtensionFromUrl ( url ) ; loadAssetUrl ( url ) ; assertFalse ( mWebServer.getLastRequestUrl ( ) . endsWith ( ext ) ) ; mWebView.clearCache ( true ) ; mSettings.setLoadsImagesAutomatically ( false ) ; assertFalse ( mSettings.getLoadsImagesAutomatically ( ) ) ; loadAssetUrl ( url ) ; assertTrue ( mWebServer.getLastRequestUrl ( ) . endsWith ( ext ) ) ; }

Target:
, @ dalvik.annotation.TestTargetNew ( level = dalvik.annotation.TestLevel.SUFFICIENT , method = "setLoadsImagesAutomatically" , args = { boolean . class } ) } ) public void testAccessLoadsImagesAutomatically ( ) throws java.lang.Exception { mWebView.clearCache ( true ) ; assertTrue ( mSettings.getLoadsImagesAutomatically ( ) ) ; java.lang.String url = TestHtmlConstants.EMBEDDED_IMG_URL ; java.lang.String ext = android.webkit.MimeTypeMap.getFileExtensionFromUrl ( url ) ; loadAssetUrl ( url ) ; java.lang.Thread.sleep ( 1000 ) ; assertFalse ( mWebServer.getLastRequestUrl ( ) . endsWith ( ext ) ) ; mWebView.clearCache ( true ) ; mSettings.setLoadsImagesAutomatically ( false ) ; assertFalse ( mSettings.getLoadsImagesAutomatically ( ) ) ; loadAssetUrl ( url ) ; java.lang.Thread.sleep ( 1000 ) ; assertTrue ( mWebServer.getLastRequestUrl ( ) . endsWith ( ext ) ) ; }
Source:
synchronized void nAllocationData2D ( long id , int xoff , int yoff , int mip , int face , int w , int h , short [ ] d , int sizeBytes ) { validate ( ) ; rsnAllocationData2D ( mContext , id , xoff , yoff , mip , face , w , h , d , sizeBytes ) ; }

Target:
synchronized void nScriptInvoke ( long id , int slot , boolean mUseInc ) { validate ( ) ; long curCon = mContext ; if ( mUseInc ) { curCon = mIncCon ; } rsnScriptInvoke ( curCon , id , slot , mUseInc ) ; }
Source:
private int ifaceNameToType ( java.lang.String iface ) { if ( isWifi ( iface ) ) { return android.net.ConnectivityManager.TETHERING_WIFI ; } else if ( isUsb ( iface ) ) { return android.net.ConnectivityManager.TETHERING_USB ; } else if ( isBluetooth ( iface ) ) { return android.net.ConnectivityManager.TETHERING_BLUETOOTH ; } return android.net.ConnectivityManager.TETHERING_INVALID ; }

Target:
private int ifaceNameToType ( java.lang.String iface ) { final com.android.server.connectivity.Tethering.TetheringConfiguration cfg = mConfig ; if ( cfg.isWifi ( iface ) ) { return android.net.ConnectivityManager.TETHERING_WIFI ; } else if ( cfg.isUsb ( iface ) ) { return android.net.ConnectivityManager.TETHERING_USB ; } else if ( cfg.isBluetooth ( iface ) ) { return android.net.ConnectivityManager.TETHERING_BLUETOOTH ; } return android.net.ConnectivityManager.TETHERING_INVALID ; }
Source:
public void testOnTearDownRestoreFailed ( ) throws java.lang.Exception { mCmdUtil.mCmdSuccess = false ; try { mPreparer.tearDown ( mDevice , mBuildInfo , null ) ; } catch ( java.lang.RuntimeException e ) { org.junit.Assert.assertEquals ( "Hal restore failed." , e.getMessage ( ) ) ; return ; } org.junit.Assert.fail ( ) ; }

Target:
public void testOnSetupAdapterNotFound ( ) throws java.lang.Exception { try { mPreparer.setUp ( mDevice , mBuildInfo ) ; } catch ( com.android.tradefed.targetprep.TargetSetupError e ) { org.junit.Assert.assertEquals ( "Could not push adapter." , e.getMessage ( ) ) ; return ; } org.junit.Assert.fail ( ) ; }