auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void updateConfigurationCountLabel ( ) { int numberOfConfigurations = configuration.countCombinations ( ) ; double coverage = ( computeCoverage ( configuration.countCombinationsCollapsingOrientation ( ) ) ) * 100.0 ; myConfigurationCountLabel.setText ( ( ( "<html>Tests will run on <b>" + numberOfConfigurations ) + " configurations</b>.</html>" ) ) ; if ( numberOfConfigurations < 1 ) { myConfigurationCountLabel.setForeground ( JBColor.RED ) ; } else { myConfigurationCountLabel.setForeground ( com.intellij.util.ui.UIUtil.getActiveTextColor ( ) ) ; } }

Target:
private void updateConfigurationCountLabel ( ) { int numberOfConfigurations = configuration.count ( ) ; double coverage = ( computeCoverage ( configuration.countCombinationsCollapsingOrientation ( ) ) ) * 100.0 ; myConfigurationCountLabel.setText ( ( ( "<html>Tests will run on <b>" + numberOfConfigurations ) + " configurations</b>.</html>" ) ) ; if ( numberOfConfigurations < 1 ) { myConfigurationCountLabel.setForeground ( JBColor.RED ) ; } else { myConfigurationCountLabel.setForeground ( com.intellij.util.ui.UIUtil.getActiveTextColor ( ) ) ; } }
Source:
public boolean hasResourceItem ( @ com.android.annotations.NonNull java.lang.String url ) { assert url.startsWith ( "@" ) : url ; int typeEnd = url.indexOf ( '/' , 1 ) ; if ( typeEnd != ( - 1 ) ) { int nameBegin = typeEnd + 1 ; int typeBegin = ( url.startsWith ( "@+" ) ) ? 2 : 1 ; int colon = url.lastIndexOf ( ':' , typeEnd ) ; if ( colon != ( - 1 ) ) { typeBegin = colon + 1 ; } java.lang.String typeName = url.substring ( typeBegin , typeEnd ) ; com.android.resources.ResourceType type = com.android.resources.ResourceType.getEnum ( typeName ) ; if ( type != null ) { java.lang.String name = url.substring ( nameBegin ) ; return hasResourceItem ( type , name ) ; } } return false ; }

Target:
public boolean hasResourceItem ( @ com.android.annotations.NonNull java.lang.String url ) { assert ( url.startsWith ( "@" ) ) || ( url.startsWith ( "?" ) ) : url ; int typeEnd = url.indexOf ( '/' , 1 ) ; if ( typeEnd != ( - 1 ) ) { int nameBegin = typeEnd + 1 ; int typeBegin = ( url.startsWith ( "@+" ) ) ? 2 : 1 ; int colon = url.lastIndexOf ( ':' , typeEnd ) ; if ( colon != ( - 1 ) ) { typeBegin = colon + 1 ; } java.lang.String typeName = url.substring ( typeBegin , typeEnd ) ; com.android.resources.ResourceType type = com.android.resources.ResourceType.getEnum ( typeName ) ; if ( type != null ) { java.lang.String name = url.substring ( nameBegin ) ; return hasResourceItem ( type , name ) ; } } return false ; }
Source:
public static java.nio.MemoryBlock allocate ( int byteCount ) { dalvik.system.VMRuntime runtime = dalvik.system.VMRuntime.getRuntime ( ) ; byte [ ] array = ( ( byte [ ] ) ( runtime.newNonMovableArray ( byte . class , byteCount ) ) ) ; int address = ( ( int ) ( runtime.addressOf ( array ) ) ) ; return new java.nio.MemoryBlock.NonMovableHeapBlock ( array , address , byteCount ) ; }

Target:
public static java.nio.MemoryBlock allocate ( int byteCount ) { dalvik.system.VMRuntime runtime = dalvik.system.VMRuntime.getRuntime ( ) ; byte [ ] array = ( ( byte [ ] ) ( runtime.newNonMovableArray ( byte . class , byteCount ) ) ) ; long address = runtime.addressOf ( array ) ; return new java.nio.MemoryBlock.NonMovableHeapBlock ( array , address , byteCount ) ; }
Source:
public void testWildcardsRejectedForIpAddress ( ) { assertFalse ( verifyWithServerCertificate ( "1.2.3.4" , new libcore.javax.net.ssl.DefaultHostnameVerifierTest.StubX509Certificate ( "cn=*.2.3.4" ) ) ) ; assertFalse ( verifyWithServerCertificate ( "1.2.3.4" , new libcore.javax.net.ssl.DefaultHostnameVerifierTest.StubX509Certificate ( "cn=*.2.3.4" ) . addSubjectAlternativeName ( libcore.javax.net.ssl.DefaultHostnameVerifierTest.ALT_IPA_NAME , "*.2.3.4" ) . addSubjectAlternativeName ( libcore.javax.net.ssl.DefaultHostnameVerifierTest.ALT_DNS_NAME , "*.2.3.4" ) ) ) ; assertFalse ( verifyWithServerCertificate ( "2001:1234::1" , new libcore.javax.net.ssl.DefaultHostnameVerifierTest.StubX509Certificate ( "cn=*:1234::1" ) ) ) ; assertFalse ( verifyWithServerCertificate ( "2001:1234::1" , new libcore.javax.net.ssl.DefaultHostnameVerifierTest.StubX509Certificate ( "cn=*:1234::1" ) . addSubjectAlternativeName ( libcore.javax.net.ssl.DefaultHostnameVerifierTest.ALT_IPA_NAME , "*:1234::1" ) . addSubjectAlternativeName ( libcore.javax.net.ssl.DefaultHostnameVerifierTest.ALT_DNS_NAME , "*:1234::1" ) ) ) ; }

Target:
public void testWildcardsRejectedForIpAddress ( ) { assertFalse ( verifyWithServerCertificate ( "1.2.3.4" , new libcore.javax.net.ssl.DefaultHostnameVerifierTest.StubX509Certificate ( "*.2.3.4" ) ) ) ; assertFalse ( verifyWithServerCertificate ( "1.2.3.4" , new libcore.javax.net.ssl.DefaultHostnameVerifierTest.StubX509Certificate ( "*.2.3.4" ) . addSubjectAlternativeName ( libcore.javax.net.ssl.DefaultHostnameVerifierTest.ALT_IPA_NAME , "*.2.3.4" ) . addSubjectAlternativeName ( libcore.javax.net.ssl.DefaultHostnameVerifierTest.ALT_DNS_NAME , "*.2.3.4" ) ) ) ; assertFalse ( verifyWithServerCertificate ( "2001:1234::1" , new libcore.javax.net.ssl.DefaultHostnameVerifierTest.StubX509Certificate ( "*:1234::1" ) ) ) ; assertFalse ( verifyWithServerCertificate ( "2001:1234::1" , new libcore.javax.net.ssl.DefaultHostnameVerifierTest.StubX509Certificate ( "*:1234::1" ) . addSubjectAlternativeName ( libcore.javax.net.ssl.DefaultHostnameVerifierTest.ALT_IPA_NAME , "*:1234::1" ) . addSubjectAlternativeName ( libcore.javax.net.ssl.DefaultHostnameVerifierTest.ALT_DNS_NAME , "*:1234::1" ) ) ) ; }
Source:
protected boolean installPackage ( java.lang.String path ) { try { java.lang.String result = device.installPackage ( path , true ) ; if ( result != null ) { com.android.monkeyrunner.adb.AdbMonkeyDevice.LOG.log ( java.util.logging.Level.SEVERE , ( "Got error installing package: " + result ) ) ; return false ; } return true ; } catch ( com.android.ddmlib.InstallException e ) { com.android.monkeyrunner.adb.AdbMonkeyDevice.LOG.log ( java.util.logging.Level.SEVERE , ( "Error installing package: " + path ) , e ) ; return false ; } }

Target:
public boolean installPackage ( java.lang.String path ) { try { java.lang.String result = device.installPackage ( path , true ) ; if ( result != null ) { com.android.monkeyrunner.adb.AdbMonkeyDevice.LOG.log ( java.util.logging.Level.SEVERE , ( "Got error installing package: " + result ) ) ; return false ; } return true ; } catch ( com.android.ddmlib.InstallException e ) { com.android.monkeyrunner.adb.AdbMonkeyDevice.LOG.log ( java.util.logging.Level.SEVERE , ( "Error installing package: " + path ) , e ) ; return false ; } }
Source:
public java.util.Set < java.lang.String > getApplicableFilters ( @ com.android.annotations.NonNull java.util.Set < java.lang.String > allFilters ) { java.util.Set < java.lang.String > list = super . getApplicableFilters ( allFilters ) ; if ( ( isEnable ( ) ) && ( universalApk ) ) { list.add ( com.android.build.OutputFile.NO_FILTER ) ; } return list ; }

Target:
public java.util.Set < java.lang.String > getApplicableFilters ( ) { java.util.Set < java.lang.String > list = super . getApplicableFilters ( ) ; if ( ( isEnable ( ) ) && ( universalApk ) ) { list.add ( com.android.build.OutputFile.NO_FILTER ) ; } return list ; }
Source:
public void run ( ) { com.android.rs.test_v16.RenderScript pRS = com.android.rs.test_v16.RenderScript.create ( mCtx ) ; pRS.setMessageHandler ( mRsMessage ) ; com.android.rs.test_v16.ScriptC_refcount s = new com.android.rs.test_v16.ScriptC_refcount ( pRS , mRes , R.raw.refcount ) ; initializeGlobals ( pRS , s ) ; s.invoke_refcount_test ( ) ; pRS.finish ( ) ; waitForMessage ( ) ; pRS.destroy ( ) ; }

Target:
public void run ( ) { com.android.rs.test_v16.RenderScript pRS = com.android.rs.test_v16.RenderScript.create ( mCtx ) ; pRS.setMessageHandler ( mRsMessage ) ; com.android.rs.test_v16.ScriptC_refcount s = new com.android.rs.test_v16.ScriptC_refcount ( pRS ) ; initializeGlobals ( pRS , s ) ; s.invoke_refcount_test ( ) ; pRS.finish ( ) ; waitForMessage ( ) ; pRS.destroy ( ) ; }
Source:
public int createOppOpsRecord ( java.lang.String serviceName , int rfcommChannel , int l2capPsm , int version , byte [ ] formatsList ) { if ( ( com.android.bluetooth.sdp.SdpManager.sNativeAvailable ) == false ) { throw new java.lang.RuntimeException ( ( ( com.android.bluetooth.sdp.SdpManager.TAG ) + " sNativeAvailable == false - native not initialized" ) ) ; } return sdpCreateOppOpsRecordNative ( serviceName , rfcommChannel , l2capPsm , version , formatsList ) ; }

Target:
public int createOppOpsRecord ( java.lang.String serviceName , int rfcommChannel , int l2capPsm , int version , byte [ ] formatsList ) { if ( ! ( com.android.bluetooth.sdp.SdpManager.sNativeAvailable ) ) { throw new java.lang.RuntimeException ( ( ( com.android.bluetooth.sdp.SdpManager.TAG ) + " sNativeAvailable == false - native not initialized" ) ) ; } return sdpCreateOppOpsRecordNative ( serviceName , rfcommChannel , l2capPsm , version , formatsList ) ; }
Source:
static void getFloat ( java.lang.invoke.MethodHandle m , Main.ValueHolder v , float value , boolean expectFailure ) throws java.lang.Throwable { boolean exceptionThrown = false ; try { final float got = ( v == null ) ? ( ( float ) ( m.invokeExact ( ) ) ) : ( ( float ) ( m.invokeExact ( v ) ) ) ; Main.Tester.assertTrue ( ( got == value ) ) ; } catch ( java.lang.invoke.WrongMethodTypeException e ) { exceptionThrown = true ; } Main.Tester.assertActualAndExpectedMatch ( exceptionThrown , expectFailure ) ; }

Target:
static void getFloat ( java.lang.invoke.MethodHandle m , Main.ValueHolder v , float value , boolean expectFailure ) throws java.lang.Throwable { boolean exceptionThrown = false ; try { final float got = ( v == null ) ? ( ( float ) ( m.invokeExact ( ) ) ) : ( ( float ) ( m.invokeExact ( v ) ) ) ; Main.Tester.assertTrue ( ( got == value ) ) ; } catch ( java.lang.invoke.WrongMethodTypeException e ) { exceptionThrown = true ; } Main.Tester.assertEquals ( exceptionThrown , expectFailure ) ; }
Source:
public static com.android.jack.dx.rop.cst.CstNat createSignature ( @ javax.annotation.Nonnull com.android.jack.ir.ast.JFieldId field ) { java.lang.String fieldName = field.getName ( ) ; java.lang.String fieldSignature = com.android.jack.backend.dex.rop.RopHelper.formatter.getName ( field.getType ( ) ) ; com.android.jack.dx.rop.cst.CstString name = new com.android.jack.dx.rop.cst.CstString ( fieldName ) ; com.android.jack.dx.rop.cst.CstString descriptor = new com.android.jack.dx.rop.cst.CstString ( fieldSignature ) ; com.android.jack.dx.rop.cst.CstNat signature = new com.android.jack.dx.rop.cst.CstNat ( name , descriptor ) ; return signature ; }

Target:
public static com.android.jack.dx.rop.cst.CstNat createSignature ( @ javax.annotation.Nonnull com.android.jack.ir.ast.JFieldId field ) { java.lang.String fieldSignature = com.android.jack.backend.dex.rop.RopHelper.formatter.getName ( field.getType ( ) ) ; com.android.jack.dx.rop.cst.CstString descriptor = new com.android.jack.dx.rop.cst.CstString ( fieldSignature ) ; com.android.jack.dx.rop.cst.CstNat signature = new com.android.jack.dx.rop.cst.CstNat ( descriptor ) ; return signature ; }
Source:
private final synchronized void sendIntent ( boolean isUnplug ) { android.content.Intent intent = new android.content.Intent ( android.content.Intent.ACTION_HEADSET_PLUG ) ; intent.addFlags ( Intent.FLAG_RECEIVER_REGISTERED_ONLY ) ; intent.putExtra ( "state" , mHeadsetState ) ; intent.putExtra ( "name" , mHeadsetName ) ; android.app.ActivityManagerNative.broadcastStickyIntent ( intent , null ) ; if ( isUnplug ) { intent = new android.content.Intent ( android.media.AudioManager.ACTION_AUDIO_BECOMING_NOISY ) ; mContext.sendBroadcast ( intent ) ; } }

Target:
private final synchronized void sendIntent ( boolean isUnplug ) { android.content.Intent intent = new android.content.Intent ( android.content.Intent.ACTION_HEADSET_PLUG ) ; intent.addFlags ( Intent.FLAG_RECEIVER_REGISTERED_ONLY ) ; intent.putExtra ( "state" , ( isUnplug ? 0 : 1 ) ) ; intent.putExtra ( "name" , mHeadsetName ) ; android.app.ActivityManagerNative.broadcastStickyIntent ( intent , null ) ; if ( isUnplug ) { intent = new android.content.Intent ( android.media.AudioManager.ACTION_AUDIO_BECOMING_NOISY ) ; mContext.sendBroadcast ( intent ) ; } }
Source:
public java.nio.ByteBuffer putChar ( char x ) { if ( isReadOnly ) { throw new java.nio.ReadOnlyBufferException ( ) ; } if ( ! ( memoryRef.isAccessible ) ) { throw new java.lang.IllegalStateException ( "buffer is inaccessible" ) ; } putChar ( ix ( nextPutIndex ( SizeOf.CHAR ) ) , x ) ; return this ; }

Target:
public final java.nio.ByteBuffer putChar ( char x ) { if ( isReadOnly ) { throw new java.nio.ReadOnlyBufferException ( ) ; } if ( ! ( memoryRef.isAccessible ) ) { throw new java.lang.IllegalStateException ( "buffer is inaccessible" ) ; } putChar ( ix ( nextPutIndex ( SizeOf.CHAR ) ) , x ) ; return this ; }
Source:
public void run ( @ javax.annotation.Nonnull java.lang.String mainClass , @ javax.annotation.Nonnull java.lang.String expected ) throws java.lang.Exception { java.util.List < com.android.jack.test.runner.RuntimeRunner > runnerList = com.android.jack.test.toolchain.AbstractTestTools.listRuntimeTestRunners ( null ) ; for ( com.android.jack.test.runner.RuntimeRunner runner : runnerList ) { java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream ( ) ; ( ( com.android.jack.test.runner.AbstractRuntimeRunner ) ( runner ) ) . setOutputStream ( out ) ; junit.framework.Assert.assertEquals ( 0 , runner.run ( new java.lang.String [ 0 ] , mainClass , dexFile ) ) ; junit.framework.Assert.assertEquals ( expected , out.toString ( ) ) ; } }

Target:
public void run ( @ javax.annotation.Nonnull java.lang.String mainClass , @ javax.annotation.Nonnull java.lang.String expected ) throws java.lang.Exception { java.util.List < com.android.jack.test.runner.RuntimeRunner > runnerList = com.android.jack.test.toolchain.AbstractTestTools.listRuntimeTestRunners ( ) ; for ( com.android.jack.test.runner.RuntimeRunner runner : runnerList ) { java.io.ByteArrayOutputStream out = new java.io.ByteArrayOutputStream ( ) ; ( ( com.android.jack.test.runner.AbstractRuntimeRunner ) ( runner ) ) . setOutputStream ( out ) ; junit.framework.Assert.assertEquals ( 0 , runner.run ( new java.lang.String [ 0 ] , mainClass , dexFile ) ) ; junit.framework.Assert.assertEquals ( expected , out.toString ( ) ) ; } }
Source:
private void loadUrlOnUiThread ( final org.chromium.content.browser.LoadUrlParams loadUrlParams ) { mFactory.startYourEngines ( true ) ; if ( checkNeedsPost ( ) ) { assert ( mAppTargetSdkVersion ) < ( Build.VERSION_CODES.JELLY_BEAN_MR2 ) ; mRunQueue.addTask ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { mAwContents.loadUrl ( loadUrlParams ) ; } } ) ; return ; } mAwContents.loadUrl ( loadUrlParams ) ; }

Target:
public void run ( ) { mAwContents.loadUrl ( loadUrlParams ) ; }
Source:
public void outcomeStarted ( java.lang.Class < ? extends vogar.target.Runner > runnerClass , java.lang.String outcomeName ) { com.google.gson.JsonObject jsonObject = new com.google.gson.JsonObject ( ) ; jsonObject.addProperty ( "outcome" , outcomeName ) ; if ( runnerClass != null ) { jsonObject.addProperty ( "runner" , runnerClass.getName ( ) ) ; } writer.print ( ( ( ( marker ) + ( gson.toJson ( jsonObject ) ) ) + "\n" ) ) ; }

Target:
public void outcomeStarted ( java.lang.String outcomeName ) { com.google.gson.JsonObject jsonObject = new com.google.gson.JsonObject ( ) ; jsonObject.addProperty ( "outcome" , outcomeName ) ; writer.print ( ( ( ( marker ) + ( gson.toJson ( jsonObject ) ) ) + "\n" ) ) ; }
Source:
public void run ( ) { try { synchronized ( mCancelWaiter ) { mCancelWaiter.wait ( mTimeout ) ; if ( mCanceled ) { return ; } } } catch ( java.lang.InterruptedException e ) { android.util.Log.w ( com.android.nfc.NfcService.TAG , "Watchdog thread interruped." ) ; interrupt ( ) ; } android.util.Log.e ( com.android.nfc.NfcService.TAG , "Watchdog triggered, aborting." ) ; mDeviceHost.doAbort ( ) ; }

Target:
public void run ( ) { try { synchronized ( mCancelWaiter ) { mCancelWaiter.wait ( mTimeout ) ; if ( mCanceled ) { return ; } } } catch ( java.lang.InterruptedException e ) { android.util.Log.w ( com.android.nfc.NfcService.TAG , "Watchdog thread interruped." ) ; interrupt ( ) ; } android.util.Log.e ( com.android.nfc.NfcService.TAG , "Watchdog triggered, aborting." ) ; mDeviceHost.doAbort ( getName ( ) ) ; }
Source:
public void test_write_I ( ) throws java.io.IOException { int length = compressToBytes ( testString ) ; java.util.zip.InflaterOutputStream ios = new java.util.zip.InflaterOutputStream ( os ) ; for ( int i = 0 ; i < length ; i ++ ) { ios.write ( compressedBytes [ i ] ) ; } java.lang.String result = new java.lang.String ( os.toByteArray ( ) ) ; assertEquals ( testString , result ) ; }

Target:
public void test_write_I ( ) throws java.io.IOException { int length = compressToBytes ( testString ) ; try ( java.util.zip.InflaterOutputStream ios = new java.util.zip.InflaterOutputStream ( os ) ) { for ( int i = 0 ; i < length ; i ++ ) { ios.write ( compressedBytes [ i ] ) ; } java.lang.String result = new java.lang.String ( os.toByteArray ( ) ) ; assertEquals ( testString , result ) ; } }
Source:
public void testOverlappingNANPANumber ( ) { assertTrue ( com.google.i18n.phonenumbers.ShortNumberInfoTest.shortInfo.isEmergencyNumber ( "211" , RegionCode.BB ) ) ; assertEquals ( ShortNumberInfo.ShortNumberCost.TOLL_FREE , com.google.i18n.phonenumbers.ShortNumberInfoTest.shortInfo.getExpectedCostForRegion ( parse ( "211" , RegionCode.BB ) , RegionCode.BB ) ) ; assertFalse ( com.google.i18n.phonenumbers.ShortNumberInfoTest.shortInfo.isEmergencyNumber ( "211" , RegionCode.US ) ) ; assertEquals ( ShortNumberInfo.ShortNumberCost.UNKNOWN_COST , com.google.i18n.phonenumbers.ShortNumberInfoTest.shortInfo.getExpectedCostForRegion ( parse ( "211" , RegionCode.US ) , RegionCode.US ) ) ; assertFalse ( com.google.i18n.phonenumbers.ShortNumberInfoTest.shortInfo.isEmergencyNumber ( "211" , RegionCode.CA ) ) ; assertEquals ( ShortNumberInfo.ShortNumberCost.UNKNOWN_COST , com.google.i18n.phonenumbers.ShortNumberInfoTest.shortInfo.getExpectedCostForRegion ( parse ( "211" , RegionCode.CA ) , RegionCode.CA ) ) ; }

Target:
public void testOverlappingNANPANumber ( ) { assertTrue ( com.google.i18n.phonenumbers.ShortNumberInfoTest.shortInfo.isEmergencyNumber ( "211" , RegionCode.BB ) ) ; assertEquals ( ShortNumberInfo.ShortNumberCost.TOLL_FREE , com.google.i18n.phonenumbers.ShortNumberInfoTest.shortInfo.getExpectedCostForRegion ( parse ( "211" , RegionCode.BB ) , RegionCode.BB ) ) ; assertFalse ( com.google.i18n.phonenumbers.ShortNumberInfoTest.shortInfo.isEmergencyNumber ( "211" , RegionCode.US ) ) ; assertEquals ( ShortNumberInfo.ShortNumberCost.UNKNOWN_COST , com.google.i18n.phonenumbers.ShortNumberInfoTest.shortInfo.getExpectedCostForRegion ( parse ( "211" , RegionCode.US ) , RegionCode.US ) ) ; assertFalse ( com.google.i18n.phonenumbers.ShortNumberInfoTest.shortInfo.isEmergencyNumber ( "211" , RegionCode.CA ) ) ; assertEquals ( ShortNumberInfo.ShortNumberCost.TOLL_FREE , com.google.i18n.phonenumbers.ShortNumberInfoTest.shortInfo.getExpectedCostForRegion ( parse ( "211" , RegionCode.CA ) , RegionCode.CA ) ) ; }
Source:
public void testSetSelection ( ) { mGridView = new android.widget.GridView ( mActivity ) ; mGridView.setSelection ( 0 ) ; assertEquals ( 0 , mGridView.getSelectedItemPosition ( ) ) ; mGridView.setSelection ( ( - 1 ) ) ; assertEquals ( ( - 1 ) , mGridView.getSelectedItemPosition ( ) ) ; mGridView.setSelection ( mGridView.getCount ( ) ) ; assertEquals ( mGridView.getCount ( ) , mGridView.getSelectedItemPosition ( ) ) ; }

Target:
public void testSetSelection ( ) { mGridView = new android.widget.GridView ( mActivity ) ; mGridView.setSelection ( 0 ) ; org.junit.Assert.assertEquals ( 0 , mGridView.getSelectedItemPosition ( ) ) ; mGridView.setSelection ( ( - 1 ) ) ; org.junit.Assert.assertEquals ( ( - 1 ) , mGridView.getSelectedItemPosition ( ) ) ; mGridView.setSelection ( mGridView.getCount ( ) ) ; org.junit.Assert.assertEquals ( mGridView.getCount ( ) , mGridView.getSelectedItemPosition ( ) ) ; }
Source:
public boolean matchesSafely ( java.util.Map < K , V > map ) { for ( java.util.Map.Entry < K , V > entry : map.entrySet ( ) ) { if ( ( keyMatcher.matches ( entry.getKey ( ) ) ) && ( valueMatcher.matches ( entry.getValue ( ) ) ) ) { return true ; } } return false ; }

Target:
public boolean matchesSafely ( java.util.Map < ? extends K , ? extends V > map ) { for ( java.util.Map.Entry < ? extends K , ? extends V > entry : map.entrySet ( ) ) { if ( ( keyMatcher.matches ( entry.getKey ( ) ) ) && ( valueMatcher.matches ( entry.getValue ( ) ) ) ) { return true ; } } return false ; }
Source:
public static org.eclipse.ui.IEditorPart getActiveEditor ( ) { org.eclipse.ui.IWorkbench workbench = org.eclipse.ui.PlatformUI.getWorkbench ( ) ; org.eclipse.ui.IWorkbenchWindow window = workbench.getActiveWorkbenchWindow ( ) ; if ( window == null ) { org.eclipse.ui.IWorkbenchWindow [ ] windows = workbench.getWorkbenchWindows ( ) ; if ( ( windows.length ) > 0 ) { window = windows [ 0 ] ; } } if ( window != null ) { org.eclipse.ui.IWorkbenchPage page = window.getActivePage ( ) ; if ( page != null ) { return page.getActiveEditor ( ) ; } } return null ; }

Target:
public static org.eclipse.ui.IWorkbenchWindow getActiveWorkbenchWindow ( ) { org.eclipse.ui.IWorkbench workbench = org.eclipse.ui.PlatformUI.getWorkbench ( ) ; org.eclipse.ui.IWorkbenchWindow window = workbench.getActiveWorkbenchWindow ( ) ; if ( window == null ) { org.eclipse.ui.IWorkbenchWindow [ ] windows = workbench.getWorkbenchWindows ( ) ; if ( ( windows.length ) > 0 ) { window = windows [ 0 ] ; } } return window ; }
Source:
public void testHeadsetHangupCallNull ( ) throws java.lang.Exception { org.mockito.Mockito.when ( mMockCallsManager.getForegroundCall ( ) ) . thenReturn ( null ) ; boolean callHungup = mBluetoothPhoneService.mBinder.hangupCall ( ) ; org.mockito.Mockito.verify ( mMockCallsManager , org.mockito.Mockito.never ( ) ) . disconnectCall ( org.mockito.Matchers.any ( com.android.server.telecom.Call.class ) ) ; assertEquals ( callHungup , false ) ; }

Target:
public void testHeadsetHangupCallNull ( ) throws java.lang.Exception { org.mockito.Mockito.when ( mMockCallsManager.getForegroundCall ( ) ) . thenReturn ( null ) ; boolean callHungup = mBluetoothPhoneService.mBinder.hangupCall ( ) ; org.mockito.Mockito.verify ( mMockCallsManager , org.mockito.Mockito.never ( ) ) . disconnectCall ( org.mockito.Matchers.any ( com.android.server.telecom.Call.class ) ) ; org.junit.Assert.assertEquals ( callHungup , false ) ; }
Source:
public static void writeUint24 ( int i , java.io.OutputStream output ) throws java.io.IOException { output.write ( ( i > > 16 ) ) ; output.write ( ( i > > 8 ) ) ; output.write ( i ) ; }

Target:
public static void writeUint24 ( int i , java.io.OutputStream output ) throws java.io.IOException { output.write ( ( ( byte ) ( i > > > 16 ) ) ) ; output.write ( ( ( byte ) ( i > > > 8 ) ) ) ; output.write ( ( ( byte ) ( i ) ) ) ; }
Source:
public void report ( @ com.android.annotations.NonNull com.android.tools.lint.detector.api.Issue issue , @ com.android.annotations.Nullable org.w3c.dom.Node scope , @ com.android.annotations.Nullable com.android.tools.lint.detector.api.Location location , @ com.android.annotations.NonNull java.lang.String message , @ com.android.annotations.Nullable java.lang.Object data ) { if ( ( scope != null ) && ( mDriver.isSuppressed ( issue , scope ) ) ) { return ; } super . report ( issue , location , message , data ) ; }

Target:
public void report ( @ com.android.annotations.NonNull com.android.tools.lint.detector.api.Issue issue , @ com.android.annotations.Nullable org.w3c.dom.Node scope , @ com.android.annotations.Nullable com.android.tools.lint.detector.api.Location location , @ com.android.annotations.NonNull java.lang.String message , @ com.android.annotations.Nullable java.lang.Object data ) { if ( ( scope != null ) && ( mDriver.isSuppressed ( this , issue , scope ) ) ) { return ; } super . report ( issue , location , message , data ) ; }
Source:
public static int frequency ( java.lang.Iterable < ? > iterable , @ javax.annotation.Nullable java.lang.Object element ) { if ( iterable instanceof com.google.common.collect.Multiset ) { return ( ( com.google.common.collect.Multiset < ? > ) ( iterable ) ) . count ( element ) ; } if ( iterable instanceof java.util.Set ) { return ( ( java.util.Set < ? > ) ( iterable ) ) . contains ( element ) ? 1 : 0 ; } return com.google.common.collect.Iterators.frequency ( iterable.iterator ( ) , element ) ; }

Target:
public static int frequency ( java.lang.Iterable < ? > iterable , @ javax.annotation.Nullable java.lang.Object element ) { if ( iterable instanceof com.google.common.collect.Multiset ) { return ( ( com.google.common.collect.Multiset < ? > ) ( iterable ) ) . count ( element ) ; } else if ( iterable instanceof java.util.Set ) { return ( ( java.util.Set < ? > ) ( iterable ) ) . contains ( element ) ? 1 : 0 ; } return com.google.common.collect.Iterators.frequency ( iterable.iterator ( ) , element ) ; }
Source:
public void testAttachLayoutAnimationParameters ( ) { android.widget.cts.GridViewTest.MockGridView mockGridView = new android.widget.cts.GridViewTest.MockGridView ( mActivity ) ; android.view.ViewGroup.LayoutParams p = new android.view.ViewGroup.LayoutParams ( 320 , 480 ) ; mockGridView.attachLayoutAnimationParameters ( null , p , 1 , 2 ) ; android.view.animation.GridLayoutAnimationController.AnimationParameters animationParams = ( ( android.view.animation.GridLayoutAnimationController.AnimationParameters ) ( p.layoutAnimationParameters ) ) ; org.junit.Assert.assertEquals ( 1 , animationParams.index ) ; org.junit.Assert.assertEquals ( 2 , animationParams.count ) ; }

Target:
public void testAttachLayoutAnimationParameters ( ) { android.widget.cts.GridViewTest.MockGridView mockGridView = new android.widget.cts.GridViewTest.MockGridView ( mActivity ) ; android.view.ViewGroup.LayoutParams p = new android.view.ViewGroup.LayoutParams ( 320 , 480 ) ; mockGridView.attachLayoutAnimationParameters ( null , p , 1 , 2 ) ; android.view.animation.GridLayoutAnimationController.AnimationParameters animationParams = ( ( android.view.animation.GridLayoutAnimationController.AnimationParameters ) ( p.layoutAnimationParameters ) ) ; assertEquals ( 1 , animationParams.index ) ; assertEquals ( 2 , animationParams.count ) ; }
Source:
public void testMergeBlob ( ) throws java.lang.Exception { com.android.ide.common.res2.ResourceMerger merger = com.android.ide.common.res2.ResourceMergerTest.getResourceMerger ( ) ; java.io.File folder = com.google.common.io.Files.createTempDir ( ) ; merger.writeBlobTo ( folder , new com.android.ide.common.res2.MergedResourceWriter ( com.google.common.io.Files.createTempDir ( ) , null ) ) ; com.android.ide.common.res2.ResourceMerger loadedMerger = new com.android.ide.common.res2.ResourceMerger ( ) ; loadedMerger.loadFromBlob ( folder , true ) ; compareResourceMaps ( merger , loadedMerger , true ) ; }

Target:
public void testMergeBlob ( ) throws java.lang.Exception { com.android.ide.common.res2.ResourceMerger merger = com.android.ide.common.res2.ResourceMergerTest.getResourceMerger ( ) ; java.io.File folder = com.google.common.io.Files.createTempDir ( ) ; merger.writeBlobTo ( folder , new com.android.ide.common.res2.MergedResourceWriter ( com.google.common.io.Files.createTempDir ( ) , null ) ) ; com.android.ide.common.res2.ResourceMerger loadedMerger = new com.android.ide.common.res2.ResourceMerger ( ) ; assertTrue ( loadedMerger.loadFromBlob ( folder , true ) ) ; compareResourceMaps ( merger , loadedMerger , true ) ; }
Source:
public void testDisconnectBeforeConnect ( ) throws java.io.IOException { server.enqueue ( new com.google.mockwebserver.MockResponse ( ) . setBody ( "A" ) ) ; server.play ( ) ; java.net.HttpURLConnection connection = ( ( java.net.HttpURLConnection ) ( server.getUrl ( "/" ) . openConnection ( ) ) ) ; connection.disconnect ( ) ; assertContent ( "A" , connection ) ; assertEquals ( 200 , connection.getResponseCode ( ) ) ; }

Target:
public void testDisconnectBeforeConnect ( ) throws java.io.IOException { server.enqueue ( new com.google.mockwebserver.MockResponse ( ) . setBody ( "A" ) ) ; server.play ( ) ; java.net.HttpURLConnection connection = ( ( java.net.HttpURLConnection ) ( server.getUrl ( "/" ) . openConnection ( ) ) ) ; connection.disconnect ( ) ; assertContent ( "A" , connection ) ; org.junit.Assert.assertEquals ( 200 , connection.getResponseCode ( ) ) ; }
Source:
public void testRegistrationConfigParcel ( ) { android.telephony.ims.stub.ImsFeatureConfiguration testConfig = new android.telephony.ims.stub.ImsFeatureConfiguration.Builder ( ) . addFeature ( ImsFeature.FEATURE_MMTEL ) . addFeature ( ImsFeature.FEATURE_RCS ) . build ( ) ; android.os.Parcel p = android.os.Parcel.obtain ( ) ; testConfig.writeToParcel ( p , 0 ) ; p.setDataPosition ( 0 ) ; android.telephony.ims.stub.ImsFeatureConfiguration result = ImsFeatureConfiguration.CREATOR.createFromParcel ( p ) ; p.recycle ( ) ; junit.framework.Assert.assertEquals ( testConfig , result ) ; }

Target:
public void testRegistrationConfigParcel ( ) { android.telephony.ims.stub.ImsFeatureConfiguration testConfig = new android.telephony.ims.stub.ImsFeatureConfiguration.Builder ( ) . addFeature ( 0 , ImsFeature.FEATURE_MMTEL ) . addFeature ( 0 , ImsFeature.FEATURE_RCS ) . build ( ) ; android.os.Parcel p = android.os.Parcel.obtain ( ) ; testConfig.writeToParcel ( p , 0 ) ; p.setDataPosition ( 0 ) ; android.telephony.ims.stub.ImsFeatureConfiguration result = ImsFeatureConfiguration.CREATOR.createFromParcel ( p ) ; p.recycle ( ) ; junit.framework.Assert.assertEquals ( testConfig , result ) ; }
Source:
private void checkPreparationPhasesForPackage ( java.lang.String expectedPackage , int numPreparation ) { org.mockito.Mockito.verify ( mTestSystemImpl , org.mockito.Mockito.times ( numPreparation ) ) . onWebViewProviderChanged ( org.mockito.Mockito.argThat ( new com.android.server.webkit.WebViewUpdateServiceTest.IsPackageInfoWithName ( expectedPackage ) ) ) ; mWebViewUpdateServiceImpl.notifyRelroCreationCompleted ( ) ; android.webkit.WebViewProviderResponse response = mWebViewUpdateServiceImpl.waitForAndGetProvider ( ) ; assertEquals ( WebViewFactory.LIBLOAD_SUCCESS , response.status ) ; assertEquals ( expectedPackage , response.packageInfo.packageName ) ; }

Target:
private void checkPreparationPhasesForPackage ( java.lang.String expectedPackage , int numPreparation ) { org.mockito.Mockito.verify ( mTestSystemImpl , org.mockito.Mockito.times ( numPreparation ) ) . onWebViewProviderChanged ( org.mockito.Mockito.argThat ( new com.android.server.webkit.WebViewUpdateServiceTest.IsPackageInfoWithName ( expectedPackage ) ) ) ; mWebViewUpdateServiceImpl.notifyRelroCreationCompleted ( ) ; android.webkit.WebViewProviderResponse response = mWebViewUpdateServiceImpl.waitForAndGetProvider ( ) ; org.junit.Assert.assertEquals ( WebViewFactory.LIBLOAD_SUCCESS , response.status ) ; org.junit.Assert.assertEquals ( expectedPackage , response.packageInfo.packageName ) ; }
Source:
public void testBasics ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( CHECKSUMS.README_TXT , com.intellij.updater.Digester.digestRegularFile ( new java.io.File ( getDataDir ( ) , "Readme.txt" ) ) ) ; org.junit.Assert.assertEquals ( CHECKSUMS.FOCUSKILLER_DLL , com.intellij.updater.Digester.digestRegularFile ( new java.io.File ( getDataDir ( ) , "/bin/focuskiller.dll" ) ) ) ; org.junit.Assert.assertEquals ( CHECKSUMS.BOOTSTRAP_JAR , com.intellij.updater.Digester.digestZipFile ( new java.io.File ( getDataDir ( ) , "/lib/bootstrap.jar" ) ) ) ; org.junit.Assert.assertEquals ( CHECKSUMS.BOOTSTRAP_JAR_BINARY , com.intellij.updater.Digester.digestRegularFile ( new java.io.File ( getDataDir ( ) , "/lib/bootstrap.jar" ) ) ) ; }

Target:
public void testBasics ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( CHECKSUMS.README_TXT , com.intellij.updater.Digester.digestRegularFile ( new java.io.File ( getDataDir ( ) , "Readme.txt" ) , false ) ) ; org.junit.Assert.assertEquals ( CHECKSUMS.FOCUSKILLER_DLL , com.intellij.updater.Digester.digestRegularFile ( new java.io.File ( getDataDir ( ) , "/bin/focuskiller.dll" ) , false ) ) ; org.junit.Assert.assertEquals ( CHECKSUMS.BOOTSTRAP_JAR , com.intellij.updater.Digester.digestZipFile ( new java.io.File ( getDataDir ( ) , "/lib/bootstrap.jar" ) ) ) ; org.junit.Assert.assertEquals ( CHECKSUMS.BOOTSTRAP_JAR_BINARY , com.intellij.updater.Digester.digestRegularFile ( new java.io.File ( getDataDir ( ) , "/lib/bootstrap.jar" ) , false ) ) ; }
Source:
private boolean isPlayingState ( @ android.annotation.Nullable android.media.session.PlaybackState state ) { if ( state == null ) return false ; return ( ( state != null ) && ( ( state.getState ( ) ) == ( android.media.session.PlaybackState.STATE_PLAYING ) ) ) || ( ( state.getState ( ) ) == ( android.media.session.PlaybackState.STATE_BUFFERING ) ) ; }

Target:
private boolean isPlayingState ( @ android.annotation.Nullable android.media.session.PlaybackState state ) { if ( state == null ) return false ; return ( state != null ) && ( ( state.getState ( ) ) == ( android.media.session.PlaybackState.STATE_PLAYING ) ) ; }
Source:
public static libcore.javax.net.ssl.TestSSLContext create ( libcore.java.security.TestKeyStore client , libcore.java.security.TestKeyStore server ) { java.lang.String protocol = "TLS" ; javax.net.ssl.SSLContext clientContext = libcore.javax.net.ssl.TestSSLContext.createSSLContext ( protocol , client.keyManagers , client.trustManagers ) ; javax.net.ssl.SSLContext serverContext = libcore.javax.net.ssl.TestSSLContext.createSSLContext ( protocol , server.keyManagers , server.trustManagers ) ; return libcore.javax.net.ssl.TestSSLContext.create ( client.keyStore , client.storePassword , server.keyStore , server.storePassword , client.keyManagers [ 0 ] , server.keyManagers [ 0 ] , client.trustManagers [ 0 ] , server.trustManagers [ 0 ] , clientContext , serverContext ) ; }

Target:
public static libcore.javax.net.ssl.TestSSLContext create ( libcore.java.security.TestKeyStore client , libcore.java.security.TestKeyStore server ) { java.lang.String protocol = "TLS" ; javax.net.ssl.SSLContext clientContext = libcore.javax.net.ssl.TestSSLContext.createSSLContext ( protocol , client.keyManagers , client.trustManagers ) ; javax.net.ssl.SSLContext serverContext = libcore.javax.net.ssl.TestSSLContext.createSSLContext ( protocol , server.keyManagers , server.trustManagers ) ; return libcore.javax.net.ssl.TestSSLContext.create ( client.keyStore , client.storePassword , server.keyStore , server.storePassword , client.keyManagers , server.keyManagers , client.trustManagers [ 0 ] , server.trustManagers [ 0 ] , clientContext , serverContext ) ; }