auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testMergedResourcesByName ( ) throws java.lang.Exception { com.android.ide.common.res2.ResourceMerger merger = com.android.ide.common.res2.ResourceMergerTest.getResourceMerger ( ) ; verifyResourceExists ( merger , "drawable/icon" , "drawable-ldpi/icon" , "drawable/icon2" , "drawable/patch" , "raw/foo" , "layout/main" , "layout/layout_ref" , "layout/alias_replaced_by_file" , "layout/file_replaced_by_alias" , "drawable/color_drawable" , "drawable/drawable_ref" , "color/color" , "string/basic_string" , "string/xliff_string" , "string/styled_string" , "style/style" , "array/string_array" , "attr/dimen_attr" , "attr/string_attr" , "attr/enum_attr" , "attr/flag_attr" , "attr/blah" , "attr/blah2" , "declare-styleable/declare_styleable" , "dimen/dimen" , "id/item_id" , "integer/integer" ) ; }

Target:
public void testMergedResourcesByName ( ) throws java.lang.Exception { com.android.ide.common.res2.ResourceMerger merger = com.android.ide.common.res2.ResourceMergerTest.getResourceMerger ( ) ; verifyResourceExists ( merger , "drawable/icon" , "drawable-ldpi/icon" , "drawable/icon2" , "drawable/patch" , "raw/foo" , "layout/main" , "layout/layout_ref" , "layout/alias_replaced_by_file" , "layout/file_replaced_by_alias" , "drawable/color_drawable" , "drawable/drawable_ref" , "color/color" , "string/basic_string" , "string/xliff_string" , "string/styled_string" , "style/style" , "array/string_array" , "attr/dimen_attr" , "attr/string_attr" , "attr/enum_attr" , "attr/flag_attr" , "attr/blah" , "attr/blah2" , "attr/flagAttr" , "declare-styleable/declare_styleable" , "dimen/dimen" , "id/item_id" , "integer/integer" ) ; }
Source:
private static java.util.Set < ? > cloneSet ( java.util.Set < ? > set ) { if ( set instanceof java.util.HashSet ) { java.lang.Object clone = ( ( java.util.HashSet < ? > ) ( set ) ) . clone ( ) ; return ( ( java.util.Set < ? > ) ( clone ) ) ; } else { return new java.util.HashSet < java.lang.Object > ( set ) ; } }

Target:
private static < T > java.util.Set < T > cloneSet ( java.util.Set < T > set ) { if ( set instanceof java.util.HashSet ) { java.lang.Object clone = ( ( java.util.HashSet < T > ) ( set ) ) . clone ( ) ; return ( ( java.util.Set < T > ) ( clone ) ) ; } else { return new java.util.HashSet < T > ( set ) ; } }
Source:
private com.googlecode.android_scripting.facade.telephony.TelephonyManagerFacade.StateChangeListener getStateChangeListenerForSubscription ( int subId , boolean createIfNeeded ) { if ( ( mStateChangeListeners.get ( subId ) ) == null ) { if ( createIfNeeded == false ) { return null ; } if ( ( mSubscriptionManager.getActiveSubscriptionInfo ( subId ) ) == null ) { com.googlecode.android_scripting.Log.e ( "Cannot get listener for invalid/inactive subId" ) ; return null ; } mStateChangeListeners.put ( subId , new com.googlecode.android_scripting.facade.telephony.TelephonyManagerFacade.StateChangeListener ( subId ) ) ; } return mStateChangeListeners.get ( subId ) ; }

Target:
private com.googlecode.android_scripting.facade.telephony.TelephonyManagerFacade.StateChangeListener getStateChangeListenerForSubscription ( int subId , boolean createIfNeeded ) { if ( ( mStateChangeListeners.get ( subId ) ) == null ) { if ( createIfNeeded == false ) { return null ; } if ( ( mSubscriptionManager.isValidSubscriptionId ( subId ) ) == false ) { com.googlecode.android_scripting.Log.e ( "Cannot get listener for invalid/inactive subId" ) ; return null ; } mStateChangeListeners.put ( subId , new com.googlecode.android_scripting.facade.telephony.TelephonyManagerFacade.StateChangeListener ( subId ) ) ; } return mStateChangeListeners.get ( subId ) ; }
Source:
private void loadDraft ( ) { if ( mWorkingMessage.isWorthSaving ( ) ) { android.util.Log.w ( com.android.mms.ui.ComposeMessageActivity.TAG , "called with non-empty working message" ) ; return ; } if ( android.util.Log.isLoggable ( LogTag.APP , Log.VERBOSE ) ) { com.android.mms.ui.ComposeMessageActivity.log ( "call WorkingMessage.loadDraft" ) ; } mWorkingMessage = com.android.mms.data.WorkingMessage.loadDraft ( this , mConversation ) ; }

Target:
private void loadDraft ( ) { if ( mWorkingMessage.isWorthSaving ( ) ) { android.util.Log.w ( com.android.mms.ui.ComposeMessageActivity.TAG , "called with non-empty working message" ) ; return ; } if ( android.util.Log.isLoggable ( LogTag.APP , Log.VERBOSE ) ) { com.android.mms.ui.ComposeMessageActivity.log ( "call WorkingMessage.loadDraft" ) ; } mWorkingMessage = com.android.mms.data.WorkingMessage.loadDraft ( this , mConversation , new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { drawTopPanel ( false ) ; drawBottomPanel ( ) ; } } ) ; }
Source:
public void onServiceConnected ( int profile , android.bluetooth.BluetoothProfile proxy ) { com.android.server.telecom.Log.startSession ( "BMSL.oSC" ) ; try { if ( profile == ( android.bluetooth.BluetoothProfile.HEADSET ) ) { mBluetoothHeadset = new com.android.server.telecom.BluetoothHeadsetProxy ( ( ( android.bluetooth.BluetoothHeadset ) ( proxy ) ) ) ; com.android.server.telecom.Log.v ( this , ( "- Got BluetoothHeadset: " + ( mBluetoothHeadset ) ) ) ; } else { com.android.server.telecom.Log.w ( this , ( "Connected to non-headset bluetooth service. Not changing" + " bluetooth headset." ) ) ; } updateListenerOfBluetoothState ( true ) ; } finally { com.android.server.telecom.Log.endSession ( ) ; } }

Target:
public void onServiceConnected ( int profile , android.bluetooth.BluetoothProfile proxy ) { android.telecom.Log.startSession ( "BMSL.oSC" ) ; try { if ( profile == ( android.bluetooth.BluetoothProfile.HEADSET ) ) { mBluetoothHeadset = new com.android.server.telecom.BluetoothHeadsetProxy ( ( ( android.bluetooth.BluetoothHeadset ) ( proxy ) ) ) ; android.telecom.Log.v ( this , ( "- Got BluetoothHeadset: " + ( mBluetoothHeadset ) ) ) ; } else { android.telecom.Log.w ( this , ( "Connected to non-headset bluetooth service. Not changing" + " bluetooth headset." ) ) ; } updateListenerOfBluetoothState ( true ) ; } finally { android.telecom.Log.endSession ( ) ; } }
Source:
public boolean getRoamingCapabilities ( com.android.server.wifi.WifiNative.RoamingCapabilities capabilities ) { android.util.Log.d ( com.android.server.wifi.WifiNative.TAG , "getRoamingCapabilities " ) ; try { if ( ( mWifiVendorHal ) != null ) { return mWifiVendorHal.getRoamingCapabilities ( capabilities ) ; } } catch ( java.lang.UnsupportedOperationException e ) { } return false ; }

Target:
public byte [ ] getDriverStateDump ( ) { if ( com.android.server.wifi.WifiNative.HIDL_VENDOR_ENABLE ) { return mWifiVendorHal.getDriverStateDump ( ) ; } else { synchronized ( com.android.server.wifi.WifiNative.sLock ) { if ( isHalStarted ( ) ) { return com.android.server.wifi.WifiNative.getDriverStateDumpNative ( com.android.server.wifi.WifiNative.sWlan0Index ) ; } else { return null ; } } } }
Source:
private static java.lang.String readFile ( com.android.ide.eclipse.adt.internal.resources.manager.ResourceFile file ) { java.io.InputStream contents = null ; try { contents = file.getFile ( ) . getContents ( ) ; return com.android.ide.eclipse.adt.internal.editors.layout.gle2.IncludeFinder.readFile ( new java.io.InputStreamReader ( contents ) ) ; } catch ( com.android.sdklib.io.StreamException e ) { } finally { try { if ( contents != null ) { contents.close ( ) ; } } catch ( java.io.IOException e ) { com.android.ide.eclipse.adt.AdtPlugin.log ( e , "Can't read layout file" ) ; } } return null ; }

Target:
private static java.lang.String getMapKey ( java.lang.String folderName , java.lang.String name ) { int baseEnd = ( ( name.length ( ) ) - ( com.android.ide.eclipse.adt.AndroidConstants.EXT_XML.length ( ) ) ) - 1 ; if ( baseEnd > 0 ) { name = name.substring ( 0 , baseEnd ) ; } if ( com.android.sdklib.SdkConstants.FD_LAYOUT.equals ( folderName ) ) { return name ; } else { return ( folderName + ( com.android.ide.eclipse.adt.AndroidConstants.WS_SEP ) ) + name ; } }
Source:
public static void floatTest ( ) { float f = 0 ; float fc = 1.0F ; for ( int i = 0 ; i < 2 ; i ++ ) { f -= fc ; f = - f ; } java.lang.System.out.println ( f ) ; }

Target:
public static void floatTest ( ) { float f = 0 ; float fc = 1.0F ; for ( int i = 0 ; i < 2 ; i ++ ) { f -= fc ; f = - f ; } java.lang.System.out.println ( f ) ; java.lang.System.out.println ( ( f + 0.0F ) ) ; java.lang.System.out.println ( ( f - ( - 0.0F ) ) ) ; }
Source:
public boolean onKeyDown ( int keyCode , android.view.KeyEvent event ) { switch ( keyCode ) { case android.view.KeyEvent.KEYCODE_CALL : { if ( android.text.TextUtils.isEmpty ( mDigits.getText ( ) . toString ( ) ) ) { finish ( ) ; } else { placeCall ( ) ; } return true ; } } return super . onKeyDown ( keyCode , event ) ; }

Target:
protected void onPostCreate ( android.os.Bundle savedInstanceState ) { super . onPostCreate ( savedInstanceState ) ; mDigits.addTextChangedListener ( this ) ; }
Source:
public void onP2pInRange ( ) { mNfcService.playSound ( NfcService.SOUND_START ) ; mNdefSent = false ; mNdefReceived = false ; mInDebounce = false ; mVibrator.vibrate ( com.android.nfc.P2pEventManager.VIBRATION_PATTERN , ( - 1 ) ) ; if ( ( mSendUi ) != null ) { mSendUi.takeScreenshot ( ) ; } }

Target:
public void onP2pSendConfirmationRequested ( ) { mNfcService.playSound ( NfcService.SOUND_START ) ; mVibrator.vibrate ( com.android.nfc.P2pEventManager.VIBRATION_PATTERN , ( - 1 ) ) ; if ( ( mSendUi ) != null ) { mSendUi.showPreSend ( false ) ; } else { mCallback.onP2pSendConfirmed ( ) ; } }
Source:
public java.lang.String getIsimChallengeResponse ( java.lang.String nonce ) { try { com.android.internal.telephony.IPhoneSubInfo info = getSubscriberInfo ( ) ; if ( info == null ) return null ; return info.getIsimChallengeResponse ( nonce ) ; } catch ( android.os.RemoteException ex ) { return null ; } catch ( java.lang.NullPointerException ex ) { return null ; } }

Target:
public int getAndroidCarrierIdForSubscription ( ) { try { com.android.internal.telephony.ITelephony service = getITelephony ( ) ; return service.getSubscriptionCarrierId ( getSubId ( ) ) ; } catch ( android.os.RemoteException ex ) { ex.rethrowAsRuntimeException ( ) ; } catch ( java.lang.NullPointerException ex ) { throw new java.lang.IllegalStateException ( "Telephony service unavailable" ) ; } return android.telephony.TelephonyManager.UNKNOWN_CARRIER_ID ; }
Source:
public void test_lockJJZ_Long_MAX_VALUE ( ) throws java.lang.Exception { final long POSITION = 0 ; final long SIZE = java.lang.Long.MAX_VALUE ; fileLock = readOnlyFileChannel.lock ( POSITION , SIZE , true ) ; assertTrue ( fileLock.isValid ( ) ) ; assertTrue ( fileLock.isShared ( ) ) ; assertEquals ( POSITION , fileLock.position ( ) ) ; assertEquals ( SIZE , fileLock.size ( ) ) ; assertSame ( readOnlyFileChannel , fileLock.channel ( ) ) ; }

Target:
public void test_lockJJZ_Long_MAX_VALUE ( ) throws java.lang.Exception { final long POSITION = 0 ; final long SIZE = java.lang.Long.MAX_VALUE ; fileLock = readOnlyFileChannel.lock ( POSITION , SIZE , true ) ; assertTrue ( fileLock.isValid ( ) ) ; assertTrue ( fileLock.isShared ( ) ) ; assertEquals ( POSITION , fileLock.position ( ) ) ; assertEquals ( SIZE , fileLock.size ( ) ) ; assertSame ( readOnlyFileChannel , fileLock.channel ( ) ) ; assertSame ( readOnlyFileChannel , fileLock.acquiredBy ( ) ) ; }
Source:
java.util.Collection < V2 > transform ( final K key , java.util.Collection < V1 > values ) { return com.google.common.collect.Collections2.transform ( values , new com.google.common.base.Function < V1 , V2 > ( ) { @ java.lang.Override public V2 apply ( V1 value ) { return transformer.transformEntry ( key , value ) ; } } ) ; }

Target:
java.util.Collection < V2 > transform ( K key , java.util.Collection < V1 > values ) { com.google.common.base.Function < ? super V1 , V2 > function = com.google.common.collect.Maps.asValueToValueFunction ( transformer , key ) ; if ( values instanceof java.util.List ) { return com.google.common.collect.Lists.transform ( ( ( java.util.List < V1 > ) ( values ) ) , function ) ; } else { return com.google.common.collect.Collections2.transform ( values , function ) ; } }
Source:
private static java.nio.file.Path createAndRegisterLambdaDumpDirectory ( ) throws java.io.IOException { java.lang.String propertyValue = java.lang.System.getProperty ( LambdaClassMaker.LAMBDA_METAFACTORY_DUMPER_PROPERTY ) ; if ( propertyValue != null ) { return java.nio.file.Paths.get ( propertyValue ) ; } java.nio.file.Path dumpDirectory = java.nio.file.Files.createTempDirectory ( "lambdas" ) ; java.lang.System.setProperty ( LambdaClassMaker.LAMBDA_METAFACTORY_DUMPER_PROPERTY , dumpDirectory.toString ( ) ) ; com.google.devtools.build.android.desugar.Desugar.deleteTreeOnExit ( dumpDirectory ) ; return dumpDirectory ; }

Target:
private static java.nio.file.Path createAndRegisterLambdaDumpDirectory ( ) throws java.io.IOException { java.lang.String propertyValue = java.lang.System.getProperty ( LambdaClassMaker.LAMBDA_METAFACTORY_DUMPER_PROPERTY ) ; if ( propertyValue != null ) { return java.nio.file.Paths.get ( propertyValue ) . toAbsolutePath ( ) ; } java.nio.file.Path dumpDirectory = java.nio.file.Files.createTempDirectory ( "lambdas" ) ; java.lang.System.setProperty ( LambdaClassMaker.LAMBDA_METAFACTORY_DUMPER_PROPERTY , dumpDirectory.toString ( ) ) ; com.google.devtools.build.android.desugar.Desugar.deleteTreeOnExit ( dumpDirectory ) ; return dumpDirectory ; }
Source:
private void verifyMeasurements ( float ... expectations ) throws java.lang.Throwable { java.lang.Thread.sleep ( 500 ) ; android.hardware.cts.helpers.sensoroperations.VerifySensorOperation verifyMeasurements = new android.hardware.cts.helpers.sensoroperations.VerifySensorOperation ( getApplicationContext ( ) , android.hardware.Sensor.TYPE_ACCELEROMETER , android.hardware.SensorManager.SENSOR_DELAY_FASTEST , 0 , 100 ) ; verifyMeasurements.verifyMean ( expectations , new float [ ] { 1.95F , 1.95F , 1.95F } ) ; verifyMeasurements.execute ( ) ; logSuccess ( ) ; }

Target:
private void verifyMeasurements ( float ... expectations ) throws java.lang.Throwable { java.lang.Thread.sleep ( 500 ) ; android.hardware.cts.helpers.sensoroperations.TestSensorOperation verifyMeasurements = new android.hardware.cts.helpers.sensoroperations.TestSensorOperation ( getApplicationContext ( ) , android.hardware.Sensor.TYPE_ACCELEROMETER , android.hardware.SensorManager.SENSOR_DELAY_FASTEST , 0 , 100 ) ; verifyMeasurements.addVerification ( new android.hardware.cts.helpers.sensorverification.MeanVerification ( expectations , new float [ ] { 1.95F , 1.95F , 1.95F } ) ) ; verifyMeasurements.execute ( ) ; logSuccess ( ) ; }
Source:
public void onCreate ( android.os.Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; mView = new android.opengl.GLSurfaceView ( this ) ; if ( android.opengl.cts.GLSurfaceViewStubActivity.mGlVersionSet ) { mView.setEGLContextClientVersion ( android.opengl.cts.GLSurfaceViewStubActivity.mGlVersion ) ; } if ( ( android.opengl.cts.GLSurfaceViewStubActivity.mRenderer ) == null ) { mView.setRenderer ( new android.opengl.cts.GLSurfaceViewStubActivity.Renderer ( ) ) ; } else { mView.setRenderer ( android.opengl.cts.GLSurfaceViewStubActivity.mRenderer ) ; } if ( android.opengl.cts.GLSurfaceViewStubActivity.mRenderModeSet ) { mView.setRenderMode ( android.opengl.cts.GLSurfaceViewStubActivity.mRenderMode ) ; } setContentView ( mView ) ; }

Target:
public void onCreate ( android.os.Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; mView = new android.opengl.GLSurfaceView ( this ) ; if ( android.opengl.cts.GLSurfaceViewStubActivity.mGlVersionSet ) { mView.setEGLContextClientVersion ( android.opengl.cts.GLSurfaceViewStubActivity.mGlVersion ) ; } if ( ( android.opengl.cts.GLSurfaceViewStubActivity.mRenderer ) == null ) { mView.setRenderer ( new android.opengl.cts.GLSurfaceViewStubActivity.Renderer ( ) ) ; } else { mView.setRenderer ( android.opengl.cts.GLSurfaceViewStubActivity.mRenderer ) ; } if ( android.opengl.cts.GLSurfaceViewStubActivity.mRenderModeSet ) { mView.setRenderMode ( android.opengl.cts.GLSurfaceViewStubActivity.mRenderMode ) ; } this . requestWindowFeature ( Window.FEATURE_NO_TITLE ) ; setContentView ( mView ) ; }
Source:
public boolean getDataEnabled ( int subId ) { boolean retVal = false ; try { com.android.internal.telephony.ITelephony telephony = getITelephony ( ) ; if ( telephony != null ) retVal = telephony.getDataEnabled ( subId ) ; } catch ( android.os.RemoteException e ) { android.util.Log.e ( android.telephony.TelephonyManager.TAG , "Error calling ITelephony#getDataEnabled" , e ) ; } catch ( java.lang.NullPointerException e ) { } return retVal ; }

Target:
private boolean isUserMobileDataEnabled ( int subId ) { boolean retVal = false ; try { com.android.internal.telephony.ITelephony telephony = getITelephony ( ) ; if ( telephony != null ) retVal = telephony.isUserDataEnabled ( subId ) ; } catch ( android.os.RemoteException e ) { android.util.Log.e ( android.telephony.TelephonyManager.TAG , "Error calling ITelephony#isUserDataEnabled" , e ) ; } catch ( java.lang.NullPointerException e ) { } return retVal ; }
Source:
public static android.net.MacAddress getRandomAddress ( android.net.MacAddress base , java.util.Random r ) { long longAddr = ( ( ( base.mAddr ) & ( android.net.MacAddress.OUI_MASK ) ) | ( ( android.net.MacAddress.NIC_MASK ) & ( r.nextLong ( ) ) ) ) | ( android.net.MacAddress.LOCALLY_ASSIGNED_MASK ) ; return new android.net.MacAddress ( longAddr ) ; }

Target:
public static android.net.MacAddress createRandomUnicastAddress ( android.net.MacAddress base , java.util.Random r ) { long addr = ( ( base.mAddr ) & ( android.net.MacAddress.OUI_MASK ) ) | ( ( android.net.MacAddress.NIC_MASK ) & ( r.nextLong ( ) ) ) ; addr = addr | ( android.net.MacAddress.LOCALLY_ASSIGNED_MASK ) ; addr = addr & ( ~ ( android.net.MacAddress.MULTICAST_MASK ) ) ; return new android.net.MacAddress ( addr ) ; }
Source:
public void lockNow ( ) { mContext.enforceCallingOrSelfPermission ( android.Manifest.permission.DEVICE_POWER , null ) ; mHandler.removeCallbacks ( mScreenLockTimeout ) ; mHandler.post ( mScreenLockTimeout ) ; }

Target:
public void systemReady ( ) { if ( ( mKeyguardMediator ) != null ) { mKeyguardMediator.onSystemReady ( ) ; } synchronized ( mLock ) { updateOrientationListenerLp ( ) ; mSystemReady = true ; mHandler.post ( new java.lang.Runnable ( ) { public void run ( ) { updateSettings ( ) ; } } ) ; } }
Source:
private java.lang.String getNameForCall ( com.android.incallui.ContactInfoCache.ContactCacheEntry contactInfo ) { java.lang.String preferredName = com.android.contacts.common.util.ContactDisplayUtils.getPreferredDisplayName ( contactInfo.namePrimary , contactInfo.nameAlternative , contactsPreferences ) ; if ( android.text.TextUtils.isEmpty ( preferredName ) ) { return contactInfo.number ; } return preferredName ; }

Target:
private java.lang.String getNameForCall ( com.android.incallui.ContactInfoCache.ContactCacheEntry contactInfo ) { java.lang.String preferredName = com.android.contacts.common.util.ContactDisplayUtils.getPreferredDisplayName ( contactInfo.namePrimary , contactInfo.nameAlternative , contactsPreferences ) ; if ( android.text.TextUtils.isEmpty ( preferredName ) ) { return android.text.TextUtils.isEmpty ( contactInfo.number ) ? null : android.text.BidiFormatter.getInstance ( ) . unicodeWrap ( contactInfo.number , TextDirectionHeuristics.LTR ) ; } return preferredName ; }
Source:
public void testParseLargeFile ( ) throws java.lang.Exception { org.apache.harmony.tests.java.util.ScannerParseLargeFileBenchmarkTest.MyReader reader = new org.apache.harmony.tests.java.util.ScannerParseLargeFileBenchmarkTest.MyReader ( ) ; java.lang.String delimiter = "\r?\n" ; java.util.Scanner scanner = new java.util.Scanner ( reader ) . useDelimiter ( delimiter ) ; while ( scanner.hasNext ( ) ) { scanner.next ( ) ; } scanner.close ( ) ; reader.close ( ) ; }

Target:
public void testParseLargeFile ( ) throws java.lang.Exception { org.apache.harmony.tests.java.util.ScannerParseLargeFileBenchmarkTest.FakeLargeFile reader = new org.apache.harmony.tests.java.util.ScannerParseLargeFileBenchmarkTest.FakeLargeFile ( ) ; java.lang.String delimiter = "\r?\n" ; java.util.Scanner scanner = new java.util.Scanner ( reader ) . useDelimiter ( delimiter ) ; while ( scanner.hasNext ( ) ) { scanner.next ( ) ; } scanner.close ( ) ; reader.close ( ) ; }
Source:
public java.util.Collection < java.lang.String > getSubPackageNames ( @ javax.annotation.Nonnull com.android.jack.ir.ast.JPackage loading ) { java.util.List < java.lang.String > subs = new java.util.ArrayList < java.lang.String > ( ) ; for ( com.android.sched.vfs.InputVElement sub : packageVDir.list ( ) ) { if ( sub.isVDir ( ) ) { subs.add ( sub.getName ( ) ) ; } } return subs ; }

Target:
public java.util.Collection < java.lang.String > getSubClassNames ( @ javax.annotation.Nonnull com.android.jack.ir.ast.JPackage loading ) { return collections.getUnmodifiableCollection ( jayceFileCache.keySet ( ) ) ; }
Source:
public void onCompletion ( android.media.MediaPlayer mp ) { assertEquals ( mMediaPlayer , mp ) ; mOnCompletionCalled.signal ( ) ; }

Target:
public void run ( ) { long startTime = android.os.SystemClock.elapsedRealtime ( ) ; while ( true ) { android.os.SystemClock.sleep ( android.media.cts.SLEEP_TIME ) ; if ( mTestCompleted.isSignalled ( ) ) { return ; } long now = android.os.SystemClock.elapsedRealtime ( ) ; if ( ( now - startTime ) > 25000 ) { android.os.Process.sendSignal ( android.os.Process.myPid ( ) , 3 ) ; android.os.SystemClock.sleep ( 2000 ) ; fail ( ( "Test is stuck, see ANR stack trace for more info. You may need to" + " create /data/anr first" ) ) ; return ; } } }
Source:
static java.lang.String getContentType ( java.lang.String fileName ) throws java.io.IOException { java.lang.String resourceName = "resources/" + fileName ; java.net.URL url = java.lang.ClassLoader.getSystemClassLoader ( ) . getResource ( resourceName ) ; assertNotNull ( ( "Cannot find test resource " + resourceName ) , url ) ; return new libcore.net.url.FileURLConnection ( url ) . getContentType ( ) ; }

Target:
private java.net.URL createTempFileWithContent ( java.lang.String resourceName ) throws java.io.IOException { java.io.InputStream is = null ; java.io.OutputStream os = null ; try { final java.net.URL url = loader.getResource ( resourceName ) ; assertNotNull ( ( "Cannot find test resource " + resourceName ) , url ) ; is = url.openStream ( ) ; java.io.File file = java.io.File.createTempFile ( "FileURLConnectionTest" , resourceName.substring ( resourceName.indexOf ( "." ) ) ) ; os = new java.io.BufferedOutputStream ( new java.io.FileOutputStream ( file ) ) ; libcore.io.Streams.copy ( is , os ) ; return new java.net.URL ( ( "file://" + ( file.getAbsolutePath ( ) ) ) ) ; } finally { if ( is != null ) { is.close ( ) ; } if ( os != null ) { os.close ( ) ; } } }
Source:
private boolean createRemoteDir ( java.lang.String remoteFilePath ) throws com.android.tradefed.device.DeviceNotAvailableException { if ( mDevice.doesFileExist ( remoteFilePath ) ) { return true ; } java.io.File remoteFile = new java.io.File ( remoteFilePath ) ; java.lang.String parentPath = remoteFile.getParent ( ) ; if ( parentPath != null ) { if ( ! ( createRemoteDir ( parentPath ) ) ) { return false ; } } mDevice.executeShellCommand ( java.lang.String.format ( "mkdir %s" , remoteFilePath ) ) ; return mDevice.doesFileExist ( remoteFilePath ) ; }

Target:
private boolean createRemoteDir ( java.lang.String remoteFilePath ) throws com.android.tradefed.device.DeviceNotAvailableException { if ( mDevice.doesFileExist ( remoteFilePath ) ) { return true ; } if ( ! ( mDevice.doesFileExist ( com.android.cts.tradefed.testtype.GeeTest.NATIVE_TESTS_DIRECTORY_TMP ) ) ) { com.android.tradefed.log.LogUtil.CLog.e ( "Could not find the /data/local/tmp directory" ) ; return false ; } mDevice.executeShellCommand ( java.lang.String.format ( "mkdir %s" , remoteFilePath ) ) ; return mDevice.doesFileExist ( remoteFilePath ) ; }
Source:
public boolean needsPreprocessing ( java.io.File resourceFile ) { return ( ( resourceFile.getPath ( ) . endsWith ( ".xml" ) ) && ( isInDrawable ( resourceFile ) ) ) && ( ( getEffectiveVersion ( resourceFile ) ) < ( com.android.builder.png.VectorDrawableRenderer.MIN_SDK_WITH_VECTOR_SUPPORT ) ) ; }

Target:
public boolean needsPreprocessing ( java.io.File resourceFile ) { return ( ( ( resourceFile.getPath ( ) . endsWith ( ".xml" ) ) && ( isInDrawable ( resourceFile ) ) ) && ( ( getEffectiveVersion ( resourceFile ) ) < ( com.android.builder.png.VectorDrawableRenderer.MIN_SDK_WITH_VECTOR_SUPPORT ) ) ) && ( isRootVector ( resourceFile ) ) ; }
Source:
public void onAttachToProcess ( @ org.jetbrains.annotations.NotNull com.intellij.execution.process.ProcessHandler processHandler ) { com.intellij.execution.testframework.sm.runner.TestProxyPrinterProvider printerProvider = null ; if ( filterProvider != null ) { printerProvider = new com.intellij.execution.testframework.sm.runner.TestProxyPrinterProvider ( consoleView , filterProvider ) ; } com.google.gct.testing.results.GoogleCloudTestingResultsForm resultsForm = consoleView.getResultsViewer ( ) ; com.google.gct.testing.results.GoogleCloudTestResultsConnectionUtil.attachEventsProcessors ( consoleView.getProperties ( ) , resultsForm , resultsForm.getStatisticsPane ( ) , processHandler , testFrameworkName , locator , idBasedTreeConstruction , printerProvider ) ; }

Target:
public void onAttachToProcess ( @ org.jetbrains.annotations.NotNull com.intellij.execution.process.ProcessHandler processHandler ) { com.intellij.execution.testframework.sm.runner.TestProxyPrinterProvider printerProvider = null ; if ( filterProvider != null ) { printerProvider = new com.intellij.execution.testframework.sm.runner.TestProxyPrinterProvider ( consoleView , filterProvider ) ; } com.google.gct.testing.results.GoogleCloudTestingResultsForm resultsForm = consoleView.getResultsViewer ( ) ; com.google.gct.testing.results.GoogleCloudTestResultsConnectionUtil.attachEventsProcessors ( consoleView.getProperties ( ) , resultsForm , resultsForm.getStatisticsPane ( ) , processHandler , testFrameworkName , locator , idBasedTreeConstruction , printerProvider , matrixExecutionCancellator ) ; }
Source:
public void addPages ( ) { mValues = new com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectWizardState ( com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectWizardState.Mode.ANY ) ; mImportPage = new com.android.ide.eclipse.adt.internal.wizards.newproject.ImportPage ( mValues ) ; addPage ( mImportPage ) ; }

Target:
public void addPages ( ) { mValues = new com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectWizardState ( com.android.ide.eclipse.adt.internal.wizards.newproject.NewProjectWizardState.Mode.ANY ) ; mImportPage = new com.android.ide.eclipse.adt.internal.wizards.newproject.ImportPage ( mValues ) ; if ( ( mSelection ) != null ) { mImportPage.init ( mSelection , com.android.ide.eclipse.adt.AdtUtils.getActivePart ( ) ) ; } addPage ( mImportPage ) ; }
Source:
public void visitProgramClass ( proguard.optimize.peephole.ProgramClass programClass ) { if ( ( ( ( ( programClass.u2accessFlags ) & ( ( ( ClassConstants.INTERNAL_ACC_FINAL ) | ( ClassConstants.INTERNAL_ACC_INTERFACE ) ) | ( ClassConstants.INTERNAL_ACC_ABSTRACT ) ) ) == 0 ) && ( ! ( proguard.optimize.KeepMarker.isKept ( programClass ) ) ) ) && ( ( programClass.subClasses ) == null ) ) { programClass.u2accessFlags |= ClassConstants.INTERNAL_ACC_FINAL ; if ( ( extraClassVisitor ) != null ) { extraClassVisitor.visitProgramClass ( programClass ) ; } } }

Target:
public void visitProgramClass ( proguard.optimize.peephole.ProgramClass programClass ) { if ( ( ( ( ( programClass.u2accessFlags ) & ( ( ( ClassConstants.ACC_FINAL ) | ( ClassConstants.ACC_INTERFACE ) ) | ( ClassConstants.ACC_ABSTRACT ) ) ) == 0 ) && ( ! ( proguard.optimize.KeepMarker.isKept ( programClass ) ) ) ) && ( ( programClass.subClasses ) == null ) ) { programClass.u2accessFlags |= ClassConstants.ACC_FINAL ; if ( ( extraClassVisitor ) != null ) { extraClassVisitor.visitProgramClass ( programClass ) ; } } }
Source:
public void goForward ( ) { if ( checkNeedsPost ( ) ) { mRunQueue.addTask ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { goForward ( ) ; } } ) ; return ; } mAwContents.goForward ( ) ; }

Target:
public boolean canGoForward ( ) { mFactory.startYourEngines ( true ) ; if ( checkNeedsPost ( ) ) { java.lang.Boolean ret = runOnUiThreadBlocking ( new java.util.concurrent.Callable < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean call ( ) { return canGoForward ( ) ; } } ) ; return ret ; } return mAwContents.canGoForward ( ) ; }
Source:
public com.google.common.base.Optional < com.android.manifmerger.XmlDocument > merge ( com.android.manifmerger.XmlDocument lowerPriorityDocument , com.android.manifmerger.MergingReport.Builder mergingReportBuilder ) { mergingReportBuilder.getActionRecorder ( ) . recordDefaultNodeAction ( getRootNode ( ) ) ; getRootNode ( ) . mergeWithLowerPriorityNode ( lowerPriorityDocument.getRootNode ( ) , mergingReportBuilder ) ; return com.google.common.base.Optional.of ( new com.android.manifmerger.XmlDocument ( mPositionXmlParser , mSourceLocation , mRootElement ) ) ; }

Target:
public com.google.common.base.Optional < com.android.manifmerger.XmlDocument > merge ( com.android.manifmerger.XmlDocument lowerPriorityDocument , com.android.manifmerger.MergingReport.Builder mergingReportBuilder ) { mergingReportBuilder.getActionRecorder ( ) . recordDefaultNodeAction ( getRootNode ( ) ) ; getRootNode ( ) . mergeWithLowerPriorityNode ( lowerPriorityDocument.getRootNode ( ) , mergingReportBuilder ) ; return com.google.common.base.Optional.of ( reparse ( ) ) ; }
Source:
public int getRawPixelInt ( org.python.core.PyObject [ ] args , java.lang.String [ ] kws ) { org.python.core.ArgParser ap = com.android.monkeyrunner.JythonUtils.createArgParser ( args , kws ) ; com.google.common.base.Preconditions.checkNotNull ( ap ) ; int x = ap.getInt ( 0 ) ; int y = ap.getInt ( 1 ) ; return getPixel ( x , y ) ; }

Target:
public int getRawPixelInt ( org.python.core.PyObject [ ] args , java.lang.String [ ] kws ) { org.python.core.ArgParser ap = com.android.monkeyrunner.JythonUtils.createArgParser ( args , kws ) ; com.google.common.base.Preconditions.checkNotNull ( ap ) ; int x = ap.getInt ( 0 ) ; int y = ap.getInt ( 1 ) ; return impl.getPixel ( x , y ) ; }
Source:
public void testDisplaySkinList ( ) { com.android.sdkmanager.Main main = new com.android.sdkmanager.Main ( ) ; main.setLogger ( getLog ( ) ) ; main.setSdkManager ( getSdkManager ( ) ) ; getLog ( ) . clear ( ) ; main.displaySkinList ( mTarget , "Skins: " ) ; assertEquals ( "P Skins: HVGA (default), Tag1ArmSkin, Tag1X86Skin\n" , getLog ( ) . toString ( ) ) ; }

Target:
public void testDisplaySkinList ( ) { com.android.sdkmanager.Main main = new com.android.sdkmanager.Main ( ) ; main.setupForTest ( getSdkManager ( ) , getLog ( ) , null ) ; getLog ( ) . clear ( ) ; main.displaySkinList ( mTarget , "Skins: " ) ; assertEquals ( "P Skins: HVGA (default), Tag1ArmSkin, Tag1X86Skin\n" , getLog ( ) . toString ( ) ) ; }
Source:
public com.android.builder.VariantConfiguration setJarDependencies ( java.util.List < com.android.builder.JarDependency > jars ) { mJars.addAll ( jars ) ; return this ; }

Target:
public com.android.builder.VariantConfiguration setDependencies ( @ com.android.annotations.NonNull java.util.List < ? extends com.android.builder.DependencyContainer > containers ) { for ( com.android.builder.DependencyContainer container : containers ) { mDirectLibraries.addAll ( container.getAndroidDependencies ( ) ) ; mJars.addAll ( container.getJarDependencies ( ) ) ; mJars.addAll ( container.getLocalDependencies ( ) ) ; } resolveIndirectLibraryDependencies ( mDirectLibraries , mFlatLibraries ) ; for ( com.android.builder.AndroidDependency androidDependency : mFlatLibraries ) { mJars.addAll ( androidDependency.getLocalDependencies ( ) ) ; } return this ; }
Source:
private static libcore.io.MemoryMappedFile mapData ( java.lang.String directory ) { try { return libcore.io.MemoryMappedFile.mmapRO ( ( directory + "tzdata" ) ) ; } catch ( libcore.io.ErrnoException errnoException ) { return null ; } }

Target:
private boolean loadData ( java.lang.String path ) { try { mappedFile = libcore.io.MemoryMappedFile.mmapRO ( path ) ; } catch ( libcore.io.ErrnoException errnoException ) { return false ; } try { readHeader ( ) ; return true ; } catch ( java.lang.Exception ex ) { java.lang.System.logE ( ( ( "tzdata file \"" + path ) + "\" was present but invalid!" ) , ex ) ; return false ; } }
Source:
public void waitForGc ( ) { allowCollection ( ) ; do { try { java.lang.Thread.sleep ( 10 ) ; } catch ( java.lang.Exception e ) { } java.lang.System.gc ( ) ; java.lang.System.runFinalization ( ) ; java.lang.System.gc ( ) ; } while ( isLive ( ) ) ; reset ( ) ; }

Target:
public void waitForGc ( ) { java.lang.Runtime.getRuntime ( ) . gc ( ) ; allowCollection ( ) ; java.lang.Runtime.getRuntime ( ) . gc ( ) ; do { java.lang.System.runFinalization ( ) ; java.lang.Runtime.getRuntime ( ) . gc ( ) ; try { java.lang.Thread.sleep ( 10 ) ; } catch ( java.lang.Exception e ) { } } while ( isLive ( ) ) ; try { mQueue.remove ( ) ; } catch ( java.lang.Exception e ) { } markerRef = null ; reset ( ) ; }
Source:
public byte [ ] getEncoded ( ) throws java.security.cert.CertificateEncodingException { if ( ( pkiPathEncoding ) == null ) { pkiPathEncoding = org.apache.harmony.security.provider.cert.X509CertPathImpl.ASN1.encode ( this ) ; } byte [ ] result = new byte [ pkiPathEncoding.length ] ; java.lang.System.arraycopy ( pkiPathEncoding , 0 , result , 0 , pkiPathEncoding.length ) ; return result ; }

Target:
private byte [ ] getEncoded ( org.apache.harmony.security.provider.cert.X509CertPathImpl.Encoding encoding ) throws java.security.cert.CertificateEncodingException { switch ( encoding ) { case PKI_PATH : if ( ( pkiPathEncoding ) == null ) { pkiPathEncoding = org.apache.harmony.security.provider.cert.X509CertPathImpl.ASN1.encode ( this ) ; } return pkiPathEncoding.clone ( ) ; case PKCS7 : if ( ( pkcs7Encoding ) == null ) { pkcs7Encoding = org.apache.harmony.security.provider.cert.X509CertPathImpl.PKCS7_SIGNED_DATA_OBJECT.encode ( this ) ; } return pkcs7Encoding.clone ( ) ; default : throw new java.security.cert.CertificateEncodingException ( ( "Unsupported encoding: " + encoding ) ) ; } }
Source:
public void handle ( com.android.ide.common.api.INode node ) { int insertPos = initialInsertPos ; for ( com.android.ide.common.api.IDragElement element : elements ) { java.lang.String fqcn = element.getFqcn ( ) ; com.android.ide.common.api.INode newChild = targetNode.insertChildAt ( fqcn , insertPos ) ; if ( insertPos >= 0 ) { insertPos ++ ; } addAttributes ( newChild , element , idMap , com.android.ide.common.layout.DEFAULT_ATTR_FILTER ) ; addInnerElements ( newChild , element , idMap ) ; } }

Target:
public void onDropped ( final com.android.ide.common.api.INode targetNode , final com.android.ide.common.api.IDragElement [ ] elements , final com.android.ide.common.api.DropFeedback feedback , final com.android.ide.common.api.Point p ) { com.android.ide.common.layout.LinearLayoutRule.LinearDropData data = ( ( com.android.ide.common.layout.LinearLayoutRule.LinearDropData ) ( feedback.userData ) ) ; final int initialInsertPos = data.getInsertPos ( ) ; insertAt ( targetNode , elements , ( ( feedback.isCopy ) || ( ! ( feedback.sameCanvas ) ) ) , initialInsertPos ) ; }
Source:
public void setModel ( com.android.ide.eclipse.adt.internal.editors.layout.gle2.CanvasViewInfo rootViewInfo ) { if ( ! ( mActive ) ) { return ; } mRootWrapper.setRoot ( rootViewInfo ) ; org.eclipse.jface.viewers.TreeViewer tv = getTreeViewer ( ) ; if ( tv != null ) { java.lang.Object [ ] expanded = tv.getExpandedElements ( ) ; tv.refresh ( ) ; tv.setExpandedElements ( expanded ) ; tv.expandToLevel ( rootViewInfo , 2 ) ; } }

Target:
public void setModel ( com.android.ide.eclipse.adt.internal.editors.layout.gle2.CanvasViewInfo rootViewInfo ) { if ( ! ( mActive ) ) { return ; } mRootWrapper.setRoot ( rootViewInfo ) ; org.eclipse.jface.viewers.TreeViewer tv = getTreeViewer ( ) ; if ( ( tv != null ) && ( ! ( tv.getTree ( ) . isDisposed ( ) ) ) ) { java.lang.Object [ ] expanded = tv.getExpandedElements ( ) ; tv.refresh ( ) ; tv.setExpandedElements ( expanded ) ; tv.expandToLevel ( rootViewInfo , 2 ) ; } }
Source:
public void testCallerDisplayName ( ) { if ( ! ( mShouldTestTelecom ) ) { return ; } org.junit.Assert.assertThat ( mCall.getDetails ( ) . getCallerDisplayName ( ) , org.hamcrest.CoreMatchers.is ( java.lang.String.class ) ) ; assertEquals ( android.telecom.cts.CallDetailsTest.CALLER_DISPLAY_NAME , mCall.getDetails ( ) . getCallerDisplayName ( ) ) ; }

Target:
public void testCallerDisplayName ( ) { if ( ! ( mShouldTestTelecom ) ) { return ; } org.junit.Assert.assertThat ( mCall.getDetails ( ) . getCallerDisplayName ( ) , org.hamcrest.CoreMatchers.instanceOf ( java.lang.String.class ) ) ; assertEquals ( android.telecom.cts.CallDetailsTest.CALLER_DISPLAY_NAME , mCall.getDetails ( ) . getCallerDisplayName ( ) ) ; }
Source:
public void deleteTempDir ( ) throws java.lang.Exception { java.nio.file.Files.walkFileTree ( mTempDir.toPath ( ) , new java.nio.file.SimpleFileVisitor < java.nio.file.Path > ( ) { @ java.lang.Override public java.nio.file.FileVisitResult visitFile ( java.nio.file.Path file , java.nio.file.attribute.BasicFileAttributes attrs ) throws java.io.IOException { java.nio.file.Files.delete ( file ) ; return java.nio.file.FileVisitResult.CONTINUE ; } @ java.lang.Override public java.nio.file.FileVisitResult postVisitDirectory ( java.nio.file.Path dir , java.io.IOException exc ) throws java.io.IOException { java.nio.file.Files.delete ( dir ) ; return java.nio.file.FileVisitResult.CONTINUE ; } } ) ; }

Target:
public void deleteTempDir ( ) throws java.lang.Exception { com.android.tradefed.util.FileUtil.recursiveDelete ( mTempDir ) ; }
Source:
public void add ( com.android.jack.dx.rop.annotation.Annotation annotation ) { throwIfImmutable ( ) ; if ( annotation == null ) { throw new java.lang.NullPointerException ( "annotation == null" ) ; } com.android.jack.dx.rop.cst.CstType type = annotation.getType ( ) ; if ( annotations.containsKey ( type ) ) { throw new java.lang.IllegalArgumentException ( ( "duplicate type: " + ( type.toHuman ( ) ) ) ) ; } annotations.put ( type , annotation ) ; }

Target:
public void add ( com.android.jack.dx.rop.annotation.Annotation annotation ) { assert annotation != null ; throwIfImmutable ( ) ; com.android.jack.dx.rop.type.Type type = annotation.getType ( ) ; if ( annotations.containsKey ( type ) ) { throw new java.lang.IllegalArgumentException ( ( "duplicate type: " + ( type.toHuman ( ) ) ) ) ; } annotations.put ( type , annotation ) ; }
Source:
private void dumpProto ( java.io.FileDescriptor fd ) { final android.util.proto.ProtoOutputStream proto = new android.util.proto.ProtoOutputStream ( fd ) ; com.android.server.net.NetworkStatsService.dumpInterfaces ( proto , NetworkStatsServiceDumpProto.ACTIVE_INTERFACES , mActiveIfaces ) ; com.android.server.net.NetworkStatsService.dumpInterfaces ( proto , NetworkStatsServiceDumpProto.ACTIVE_UID_INTERFACES , mActiveUidIfaces ) ; mDevRecorder.writeToProtoLocked ( proto , NetworkStatsServiceDumpProto.DEV_STATS ) ; mXtRecorder.writeToProtoLocked ( proto , NetworkStatsServiceDumpProto.XT_STATS ) ; mUidRecorder.writeToProtoLocked ( proto , NetworkStatsServiceDumpProto.UID_STATS ) ; mUidTagRecorder.writeToProtoLocked ( proto , NetworkStatsServiceDumpProto.UID_TAG_STATS ) ; proto.flush ( ) ; }

Target:
private void dumpProtoLocked ( java.io.FileDescriptor fd ) { final android.util.proto.ProtoOutputStream proto = new android.util.proto.ProtoOutputStream ( fd ) ; com.android.server.net.NetworkStatsService.dumpInterfaces ( proto , NetworkStatsServiceDumpProto.ACTIVE_INTERFACES , mActiveIfaces ) ; com.android.server.net.NetworkStatsService.dumpInterfaces ( proto , NetworkStatsServiceDumpProto.ACTIVE_UID_INTERFACES , mActiveUidIfaces ) ; mDevRecorder.writeToProtoLocked ( proto , NetworkStatsServiceDumpProto.DEV_STATS ) ; mXtRecorder.writeToProtoLocked ( proto , NetworkStatsServiceDumpProto.XT_STATS ) ; mUidRecorder.writeToProtoLocked ( proto , NetworkStatsServiceDumpProto.UID_STATS ) ; mUidTagRecorder.writeToProtoLocked ( proto , NetworkStatsServiceDumpProto.UID_TAG_STATS ) ; proto.flush ( ) ; }
Source:
public void onAudioStateChanged ( android.telecom.CallAudioState audioState ) { this . audioState = audioState ; if ( ( bubble ) != null ) { bubble.updateActions ( generateActions ( ) ) ; } }

Target:
public void onAudioStateChanged ( android.telecom.CallAudioState audioState ) { if ( ! ( com.android.incallui.ReturnToCallController.isEnabled ( context ) ) ) { hide ( ) ; return ; } this . audioState = audioState ; if ( ( bubble ) != null ) { bubble.updateActions ( generateActions ( ) ) ; } }
Source:
protected static java.io.File getMergedBlobFolder ( java.io.File folder ) throws java.io.IOException { java.io.File originalMerger = new java.io.File ( folder , DataMerger.FN_MERGER_XML ) ; java.lang.String content = com.google.common.io.Files.toString ( originalMerger , com.google.common.base.Charsets.UTF_8 ) ; content = content.replaceAll ( "\\$TOP\\$" , java.util.regex.Matcher.quoteReplacement ( folder.getAbsolutePath ( ) ) ) . replaceAll ( "\\$SEP\\$" , java.util.regex.Matcher.quoteReplacement ( java.io.File.separator ) ) ; java.io.File tempFolder = com.google.common.io.Files.createTempDir ( ) ; com.google.common.io.Files.write ( content , new java.io.File ( tempFolder , DataMerger.FN_MERGER_XML ) , com.google.common.base.Charsets.UTF_8 ) ; return tempFolder ; }

Target:
protected static java.io.File getMergedBlobFolder ( @ com.android.annotations.NonNull java.io.File folder , @ com.android.annotations.NonNull java.io.File mergerFile ) throws java.io.IOException { java.lang.String content = com.google.common.io.Files.toString ( mergerFile , com.google.common.base.Charsets.UTF_8 ) ; content = content.replaceAll ( "\\$TOP\\$" , java.util.regex.Matcher.quoteReplacement ( folder.getAbsolutePath ( ) ) ) . replaceAll ( "\\$SEP\\$" , java.util.regex.Matcher.quoteReplacement ( java.io.File.separator ) ) ; java.io.File tempFolder = com.google.common.io.Files.createTempDir ( ) ; com.google.common.io.Files.write ( content , new java.io.File ( tempFolder , DataMerger.FN_MERGER_XML ) , com.google.common.base.Charsets.UTF_8 ) ; return tempFolder ; }
Source:
public final int getOutputSize ( int inputLen ) { if ( ( mode ) == 0 ) { throw new java.lang.IllegalStateException ( "Cipher has not yet been initialized" ) ; } return spiImpl.engineGetOutputSize ( inputLen ) ; }

Target:
private javax.crypto.CipherSpi getSpi ( java.security.Key key ) { synchronized ( initLock ) { if ( ( spiImpl ) != null ) { return spiImpl ; } final org.apache.harmony.security.fortress.Engine.SpiAndProvider sap = javax.crypto.Cipher.tryCombinations ( key , provider , transformParts ) ; if ( sap == null ) { throw new java.security.ProviderException ( ( "No provider for " + ( transformation ) ) ) ; } spiImpl = ( ( javax.crypto.CipherSpi ) ( sap.spi ) ) ; provider = sap.provider ; return spiImpl ; } }
Source:
public void testInnerClassStatic ( ) throws java.lang.Exception { mScopes = null ; assertEquals ( ( "src/test/pkg/Foo.java:8: Warning: This inner class should be static (test.pkg.Foo.Baz) [Instantiatable]\n" + ( ( " public class Baz extends Activity {\n" + " ^\n" ) + "0 errors, 1 warnings\n" ) ) , lintProject ( "registration/AndroidManifest.xml=>AndroidManifest.xml" , "bytecode/.classpath=>.classpath" , "registration/Foo.java.txt=>src/test/pkg/Foo.java" , "registration/Foo.class.data=>bin/classes/test/pkg/Foo.class" , "registration/Foo$Bar.class.data=>bin/classes/test/pkg/Foo$Bar.class" , "registration/Foo$Baz.class.data=>bin/classes/test/pkg/Foo$Baz.class" ) ) ; }

Target:
public void testInnerClassStatic ( ) throws java.lang.Exception { mScopes = null ; mEnabled = com.google.common.collect.Sets.newHashSet ( com.android.tools.lint.checks.MissingClassDetector.MISSING , com.android.tools.lint.checks.MissingClassDetector.INSTANTIATABLE , com.android.tools.lint.checks.MissingClassDetector.INNERCLASS ) ; assertEquals ( ( "src/test/pkg/Foo.java:8: Warning: This inner class should be static (test.pkg.Foo.Baz) [Instantiatable]\n" + ( ( " public class Baz extends Activity {\n" + " ^\n" ) + "0 errors, 1 warnings\n" ) ) , lintProject ( "registration/AndroidManifest.xml=>AndroidManifest.xml" , "bytecode/.classpath=>.classpath" , "registration/Foo.java.txt=>src/test/pkg/Foo.java" , "registration/Foo.class.data=>bin/classes/test/pkg/Foo.class" , "registration/Foo$Bar.class.data=>bin/classes/test/pkg/Foo$Bar.class" , "registration/Foo$Baz.class.data=>bin/classes/test/pkg/Foo$Baz.class" ) ) ; }
Source:
private void verifyNoInsertionInUser ( int userId ) { try { android.net.Uri uri = android.content.ContentProvider.maybeAddUserId ( CallLog.Calls.CONTENT_URI , userId ) ; java.lang.Thread.sleep ( com.android.server.telecom.tests.CallLogManagerTest.TEST_TIMEOUT_MILLIS ) ; org.mockito.Mockito.verify ( getContentProviderForUser ( userId ) , org.mockito.Mockito.never ( ) ) . insert ( org.mockito.Matchers.any ( java.lang.String.class ) , org.mockito.Matchers.eq ( uri ) , org.mockito.Matchers.any ( android.content.ContentValues.class ) ) ; } catch ( com.android.server.telecom.tests.android e ) { fail ( "Remote exception occurred during test execution" ) ; } catch ( java.lang.InterruptedException e ) { e.printStackTrace ( ) ; } }

Target:
private void verifyNoInsertionInUser ( int userId ) { try { android.net.Uri uri = android.content.ContentProvider.maybeAddUserId ( CallLog.Calls.CONTENT_URI , userId ) ; java.lang.Thread.sleep ( com.android.server.telecom.tests.CallLogManagerTest.TEST_TIMEOUT_MILLIS ) ; org.mockito.Mockito.verify ( getContentProviderForUser ( userId ) , org.mockito.Mockito.never ( ) ) . insert ( org.mockito.Matchers.any ( java.lang.String.class ) , org.mockito.Matchers.eq ( uri ) , org.mockito.Matchers.any ( android.content.ContentValues.class ) ) ; } catch ( com.android.server.telecom.tests.android e ) { org.junit.Assert.fail ( "Remote exception occurred during test execution" ) ; } catch ( java.lang.InterruptedException e ) { e.printStackTrace ( ) ; } }
Source:
public org.eclipse.jdt.core.dom.BodyDeclaration find ( org.eclipse.jdt.core.dom.CompilationUnit cu ) { org.eclipse.jdt.core.dom.AbstractTypeDeclaration typeDeclaration = enumTypeLocater.find ( cu ) ; if ( ( typeDeclaration == null ) || ( ! ( typeDeclaration instanceof org.eclipse.jdt.core.dom.EnumDeclaration ) ) ) { return null ; } for ( org.eclipse.jdt.core.dom.EnumConstantDeclaration enumConstantDeclaration : ( ( java.util.List < org.eclipse.jdt.core.dom.EnumConstantDeclaration > ) ( ( ( org.eclipse.jdt.core.dom.EnumDeclaration ) ( typeDeclaration ) ) . enumConstants ( ) ) ) ) { if ( enumConstantDeclaration.getName ( ) . getFullyQualifiedName ( ) . equals ( constantName ) ) { return enumConstantDeclaration ; } } return null ; }

Target:
public org.eclipse.jdt.core.dom.BodyDeclaration find ( org.eclipse.jdt.core.dom.CompilationUnit cu ) { org.eclipse.jdt.core.dom.AbstractTypeDeclaration typeDeclaration = typeLocator.find ( cu ) ; if ( ( typeDeclaration == null ) || ( ! ( typeDeclaration instanceof org.eclipse.jdt.core.dom.EnumDeclaration ) ) ) { return null ; } for ( org.eclipse.jdt.core.dom.EnumConstantDeclaration enumConstantDeclaration : ( ( java.util.List < org.eclipse.jdt.core.dom.EnumConstantDeclaration > ) ( ( ( org.eclipse.jdt.core.dom.EnumDeclaration ) ( typeDeclaration ) ) . enumConstants ( ) ) ) ) { if ( enumConstantDeclaration.getName ( ) . getFullyQualifiedName ( ) . equals ( constantName ) ) { return enumConstantDeclaration ; } } return null ; }
Source:
private void writeMethods ( @ javax.annotation.Nonnull org.objectweb.asm.tree.ClassNode cn ) throws java.io.IOException { writer.writeOpenNodeList ( ) ; for ( org.objectweb.asm.tree.MethodNode mn : cn.methods ) { new com.android.jill.frontend.java.MethodBodyWriter ( writer , annotWriter , cn , mn , sourceInfoWriter ) . write ( ) ; } writer.writeCloseNodeList ( ) ; }

Target:
private void writeAnnotationMethods ( @ javax.annotation.Nonnull org.objectweb.asm.tree.ClassNode cn ) throws java.io.IOException { assert com.android.jill.frontend.java.AsmHelper.isAnnotation ( cn ) ; writer.writeOpenNodeList ( ) ; for ( org.objectweb.asm.tree.MethodNode mn : cn.methods ) { new com.android.jill.frontend.java.MethodBodyWriter ( writer , annotWriter , cn , mn , sourceInfoWriter , options ) . write ( ) ; } writer.writeCloseNodeList ( ) ; }