auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testCleartextTrafficPolicyWithHttpURLConnection ( ) throws java.lang.Exception { libcore.net.NetworkSecurityPolicy.setCleartextTrafficPermitted ( true ) ; try ( libcore.net.NetworkSecurityPolicyTest.CapturingServerSocket server = new libcore.net.NetworkSecurityPolicyTest.CapturingServerSocket ( ) ) { java.net.URL url = new java.net.URL ( ( ( "http://localhost:" + ( server.getPort ( ) ) ) + "/test.txt" ) ) ; try { url.openConnection ( ) . getContent ( ) ; fail ( ) ; } catch ( java.io.IOException expected ) { } server.assertDataTransmittedByClient ( ) ; } libcore.net.NetworkSecurityPolicy.setCleartextTrafficPermitted ( false ) ; try ( libcore.net.NetworkSecurityPolicyTest.CapturingServerSocket server = new libcore.net.NetworkSecurityPolicyTest.CapturingServerSocket ( ) ) { java.net.URL url = new java.net.URL ( ( ( "http://localhost:" + ( server.getPort ( ) ) ) + "/test.txt" ) ) ; try { url.openConnection ( ) . getContent ( ) ; fail ( ) ; } catch ( java.io.IOException expected ) { } server.assertNoDataTransmittedByClient ( ) ; } }

Target:
public void testCleartextTrafficPolicyWithHttpURLConnection ( ) throws java.lang.Exception { libcore.net.NetworkSecurityPolicy.setInstance ( new libcore.net.NetworkSecurityPolicyTest.TestNetworkSecurityPolicy ( true ) ) ; try ( libcore.net.NetworkSecurityPolicyTest.CapturingServerSocket server = new libcore.net.NetworkSecurityPolicyTest.CapturingServerSocket ( ) ) { java.net.URL url = new java.net.URL ( ( ( "http://localhost:" + ( server.getPort ( ) ) ) + "/test.txt" ) ) ; try { url.openConnection ( ) . getContent ( ) ; fail ( ) ; } catch ( java.io.IOException expected ) { } server.assertDataTransmittedByClient ( ) ; } libcore.net.NetworkSecurityPolicy.setInstance ( new libcore.net.NetworkSecurityPolicyTest.TestNetworkSecurityPolicy ( false ) ) ; try ( libcore.net.NetworkSecurityPolicyTest.CapturingServerSocket server = new libcore.net.NetworkSecurityPolicyTest.CapturingServerSocket ( ) ) { java.net.URL url = new java.net.URL ( ( ( "http://localhost:" + ( server.getPort ( ) ) ) + "/test.txt" ) ) ; try { url.openConnection ( ) . getContent ( ) ; fail ( ) ; } catch ( java.io.IOException expected ) { } server.assertNoDataTransmittedByClient ( ) ; } }
Source:
private int capacity ( int expectedMaxSize ) { int minCapacity = ( 3 * expectedMaxSize ) / 2 ; int result ; if ( ( minCapacity > ( java.util.IdentityHashMap.MAXIMUM_CAPACITY ) ) || ( minCapacity < 0 ) ) { result = java.util.IdentityHashMap.MAXIMUM_CAPACITY ; } else { result = java.util.IdentityHashMap.MINIMUM_CAPACITY ; while ( result < minCapacity ) result <<= 1 ; } return result ; }

Target:
private static int capacity ( int expectedMaxSize ) { return expectedMaxSize > ( ( java.util.IdentityHashMap.MAXIMUM_CAPACITY ) / 3 ) ? java.util.IdentityHashMap.MAXIMUM_CAPACITY : expectedMaxSize <= ( ( 2 * ( java.util.IdentityHashMap.MINIMUM_CAPACITY ) ) / 3 ) ? java.util.IdentityHashMap.MINIMUM_CAPACITY : java.lang.Integer.highestOneBit ( ( expectedMaxSize + ( expectedMaxSize << 1 ) ) ) ; }
Source:
public static int getHtmlColor ( java.lang.String color ) { java.lang.Integer i = android.graphics.Color.sColorNameMap.get ( color.toLowerCase ( ) ) ; if ( i != null ) { return i ; } else { try { return com.android.internal.util.XmlUtils.convertValueToInt ( color , ( - 1 ) ) ; } catch ( java.lang.NumberFormatException nfe ) { return - 1 ; } } }

Target:
public static int getHtmlColor ( java.lang.String color ) { java.lang.Integer i = android.graphics.Color.sColorNameMap.get ( color.toLowerCase ( java.util.Locale.ROOT ) ) ; if ( i != null ) { return i ; } else { try { return com.android.internal.util.XmlUtils.convertValueToInt ( color , ( - 1 ) ) ; } catch ( java.lang.NumberFormatException nfe ) { return - 1 ; } } }
Source:
private java.util.List < org.conscrypt.ct.SignedCertificateTimestamp > getSCTsFromX509Extension ( org.conscrypt.OpenSSLX509Certificate leaf ) { byte [ ] extData = leaf.getExtensionValue ( CTConstants.X509_SCT_LIST_OID ) ; if ( extData == null ) { return java.util.Collections.EMPTY_LIST ; } try { return getSCTsFromSCTList ( org.conscrypt.ct.Serialization.readDEROctetString ( org.conscrypt.ct.Serialization.readDEROctetString ( extData ) ) , SignedCertificateTimestamp.Origin.EMBEDDED ) ; } catch ( org.conscrypt.ct.SerializationException e ) { return java.util.Collections.EMPTY_LIST ; } }

Target:
private java.util.List < org.conscrypt.ct.SignedCertificateTimestamp > getSCTsFromX509Extension ( org.conscrypt.OpenSSLX509Certificate leaf ) { byte [ ] extData = leaf.getExtensionValue ( CTConstants.X509_SCT_LIST_OID ) ; if ( extData == null ) { return java.util.Collections.emptyList ( ) ; } try { return getSCTsFromSCTList ( org.conscrypt.ct.Serialization.readDEROctetString ( org.conscrypt.ct.Serialization.readDEROctetString ( extData ) ) , SignedCertificateTimestamp.Origin.EMBEDDED ) ; } catch ( org.conscrypt.ct.SerializationException e ) { return java.util.Collections.emptyList ( ) ; } }
Source:
public void flatTestMethodStructure ( ) throws java.lang.Exception { java.lang.System.setProperty ( "JUnitParams.flat" , "true" ) ; org.junit.runner.Description description = plainTestMethod.describe ( ) ; assertEquals ( "for_others_to_work(junitparams.internal.TestMethodTest)" , description.getDisplayName ( ) ) ; assertTrue ( description.getChildren ( ) . isEmpty ( ) ) ; java.lang.System.clearProperty ( "JUnitParams.flat" ) ; }

Target:
public void flatTestMethodStructure ( ) throws java.lang.Exception { java.lang.System.setProperty ( "JUnitParams.flat" , "true" ) ; org.junit.runner.Description description = plainTestMethod.describableFrameworkMethod ( ) . getDescription ( ) ; assertEquals ( "for_others_to_work(junitparams.internal.TestMethodTest)" , description.getDisplayName ( ) ) ; assertTrue ( description.getChildren ( ) . isEmpty ( ) ) ; java.lang.System.clearProperty ( "JUnitParams.flat" ) ; }
Source:
private static void edgeSplitSuccessors ( com.android.jack.ir.ast.cfg.JControlFlowGraph cfg ) { for ( com.android.jack.ir.ast.cfg.JBasicBlock block : cfg.getInternalBlocksUnordered ( ) ) { for ( com.android.jack.ir.ast.cfg.JBasicBlock succ : block.getSuccessors ( ) ) { if ( com.android.jack.transformations.ssa.SsaBasicBlockSplitter.needsNewSuccessor ( block , succ ) ) { if ( ( succ instanceof com.android.jack.ir.ast.cfg.JCatchBasicBlock ) || ( succ instanceof com.android.jack.ir.ast.cfg.JCaseBasicBlock ) ) { block.split ( ( - 1 ) ) ; } else { com.android.jack.transformations.ssa.SsaBasicBlockSplitter.insertNewSimpleSuccessor ( block , succ ) ; } } } } }

Target:
private static void edgeSplitSuccessors ( com.android.jack.ir.ast.cfg.JControlFlowGraph cfg ) { for ( com.android.jack.ir.ast.cfg.JBasicBlock block : cfg.getReachableBlocksDepthFirst ( ) ) { for ( com.android.jack.ir.ast.cfg.JBasicBlock succ : block.getSuccessors ( ) ) { if ( com.android.jack.transformations.ssa.SsaBasicBlockSplitter.needsNewSuccessor ( block , succ ) ) { if ( ( succ instanceof com.android.jack.ir.ast.cfg.JCatchBasicBlock ) || ( succ instanceof com.android.jack.ir.ast.cfg.JCaseBasicBlock ) ) { block.split ( ( - 1 ) ) ; } else { com.android.jack.transformations.ssa.SsaBasicBlockSplitter.insertNewSimpleSuccessor ( block , succ ) ; } } } } }
Source:
public int read ( byte [ ] b , int off , int len ) throws java.io.IOException { int bytesRead = in.read ( b , off , len ) ; if ( ( isOn ) && ( bytesRead != ( - 1 ) ) ) { digest.update ( b , off , bytesRead ) ; } return bytesRead ; }

Target:
public int read ( byte [ ] buffer , int byteOffset , int byteCount ) throws java.io.IOException { int bytesRead = in.read ( buffer , byteOffset , byteCount ) ; if ( ( isOn ) && ( bytesRead != ( - 1 ) ) ) { digest.update ( buffer , byteOffset , bytesRead ) ; } return bytesRead ; }
Source:
public static com.android.ide.eclipse.adt.internal.resources.configurations.ScreenDimensionQualifier getQualifier ( java.lang.String size1 , java.lang.String size2 ) { try { int s1 = java.lang.Integer.parseInt ( size1 ) ; int s2 = java.lang.Integer.parseInt ( size2 ) ; com.android.ide.eclipse.adt.internal.resources.configurations.ScreenDimensionQualifier qualifier = new com.android.ide.eclipse.adt.internal.resources.configurations.ScreenDimensionQualifier ( ) ; if ( s1 > s2 ) { qualifier.mValue1 = s1 ; qualifier.mValue2 = s2 ; } else { qualifier.mValue1 = s2 ; qualifier.mValue2 = s1 ; } return qualifier ; } catch ( java.lang.NumberFormatException e ) { } return null ; }

Target:
public static com.android.ide.common.resources.configuration.ScreenDimensionQualifier getQualifier ( java.lang.String size1 , java.lang.String size2 ) { try { int s1 = java.lang.Integer.parseInt ( size1 ) ; int s2 = java.lang.Integer.parseInt ( size2 ) ; com.android.ide.common.resources.configuration.ScreenDimensionQualifier qualifier = new com.android.ide.common.resources.configuration.ScreenDimensionQualifier ( ) ; if ( s1 > s2 ) { qualifier.mValue1 = s1 ; qualifier.mValue2 = s2 ; } else { qualifier.mValue1 = s2 ; qualifier.mValue2 = s1 ; } return qualifier ; } catch ( java.lang.NumberFormatException e ) { } return null ; }
Source:
void startBonding ( ) { mState = com.android.nfc.handover.BluetoothPeripheralHandover.STATE_BONDING ; toast ( getToastString ( R.string.pairing_peripheral ) ) ; if ( ! ( mDevice.createBond ( mTransport ) ) ) { toast ( getToastString ( R.string.pairing_peripheral_failed ) ) ; complete ( false ) ; } }

Target:
void startBonding ( ) { mState = com.android.nfc.handover.BluetoothPeripheralHandover.STATE_BONDING ; if ( ( mRetryCount ) == 0 ) { toast ( getToastString ( R.string.pairing_peripheral ) ) ; } if ( ( mOobData ) != null ) { if ( ! ( mDevice.createBondOutOfBand ( mTransport , mOobData ) ) ) { toast ( getToastString ( R.string.pairing_peripheral_failed ) ) ; complete ( false ) ; } } else if ( ! ( mDevice.createBond ( mTransport ) ) ) { toast ( getToastString ( R.string.pairing_peripheral_failed ) ) ; complete ( false ) ; } }
Source:
synchronized com.android.sched.vfs.CaseInsensitiveFS.CaseInsensitiveVDir createVDir ( @ javax.annotation.Nonnull com.android.sched.vfs.CaseInsensitiveFS.CaseInsensitiveVDir parent , @ javax.annotation.Nonnull java.lang.String name ) throws com.android.sched.util.file.CannotCreateFileException { assert ! ( isClosed ( ) ) ; try { return getVDir ( parent , name ) ; } catch ( com.android.sched.util.file.NoSuchFileException e ) { com.android.sched.vfs.CaseInsensitiveFS.CaseInsensitiveVDir dir = new com.android.sched.vfs.CaseInsensitiveFS.CaseInsensitiveVDir ( this , parent , name ) ; parent.putInCache ( name , dir ) ; return dir ; } catch ( com.android.sched.util.file.NotDirectoryException e ) { throw new com.android.sched.util.file.CannotCreateFileException ( getVDirLocation ( parent , name ) ) ; } }

Target:
com.android.sched.vfs.CaseInsensitiveFS.CaseInsensitiveVDir createVDir ( @ javax.annotation.Nonnull com.android.sched.vfs.CaseInsensitiveFS.CaseInsensitiveVDir parent , @ javax.annotation.Nonnull java.lang.String name ) throws com.android.sched.util.file.CannotCreateFileException { assert ! ( isClosed ( ) ) ; try { return loadVDir ( parent , name ) ; } catch ( com.android.sched.util.file.NotDirectoryException e ) { throw new com.android.sched.util.file.CannotCreateFileException ( getVDirLocation ( parent , name ) ) ; } }
Source:
private static byte [ ] loadBitmapByteArray ( android.graphics.Bitmap bitmap ) { int bytes = bitmap.getByteCount ( ) ; java.nio.ByteBuffer buffer = java.nio.ByteBuffer.allocate ( bytes ) ; bitmap.copyPixelsToBuffer ( buffer ) ; byte [ ] array = buffer.array ( ) ; return array ; }

Target:
private static double luma ( int pixel ) { final int R = android.graphics.Color.red ( pixel ) ; final int G = android.graphics.Color.green ( pixel ) ; final int B = android.graphics.Color.blue ( pixel ) ; return ( ( 0.299 * R ) + ( 0.587 * G ) ) + ( 0.114 * B ) ; }
Source:
private com.android.ims.ImsStreamMediaProfile createResumeMediaProfile ( ) { com.android.ims.ImsStreamMediaProfile mediaProfile = new com.android.ims.ImsStreamMediaProfile ( ) ; if ( ( mCallProfile ) == null ) { return mediaProfile ; } mediaProfile.mAudioQuality = mCallProfile.mMediaProfile.mAudioQuality ; mediaProfile.mVideoQuality = mCallProfile.mMediaProfile.mVideoQuality ; mediaProfile.mAudioDirection = ImsStreamMediaProfile.DIRECTION_SEND_RECEIVE ; if ( ( mediaProfile.mVideoQuality ) != ( ImsStreamMediaProfile.VIDEO_QUALITY_NONE ) ) { mediaProfile.mVideoDirection = ImsStreamMediaProfile.DIRECTION_SEND_RECEIVE ; } return mediaProfile ; }

Target:
private android.telephony.ims.ImsStreamMediaProfile createResumeMediaProfile ( ) { android.telephony.ims.ImsStreamMediaProfile mediaProfile = new android.telephony.ims.ImsStreamMediaProfile ( ) ; if ( ( mCallProfile ) == null ) { return mediaProfile ; } mediaProfile.mAudioQuality = mCallProfile.mMediaProfile.mAudioQuality ; mediaProfile.mVideoQuality = mCallProfile.mMediaProfile.mVideoQuality ; mediaProfile.mAudioDirection = android.telephony.ims.ImsStreamMediaProfile.DIRECTION_SEND_RECEIVE ; if ( ( mediaProfile.mVideoQuality ) != ( android.telephony.ims.ImsStreamMediaProfile.VIDEO_QUALITY_NONE ) ) { mediaProfile.mVideoDirection = android.telephony.ims.ImsStreamMediaProfile.DIRECTION_SEND_RECEIVE ; } return mediaProfile ; }
Source:
public java.lang.String toString ( ) { java.lang.StringBuilder result = new java.lang.StringBuilder ( ) ; result.append ( ( "A2dpStackEvent {type:" + ( com.android.bluetooth.a2dp.A2dpStackEvent.eventTypeToString ( type ) ) ) ) ; result.append ( ( ", value1:" + ( valueInt ) ) ) ; result.append ( ( ( ", device:" + ( device ) ) + "}" ) ) ; return result.toString ( ) ; }

Target:
public java.lang.String toString ( ) { java.lang.StringBuilder result = new java.lang.StringBuilder ( ) ; result.append ( ( "A2dpStackEvent {type:" + ( com.android.bluetooth.a2dp.A2dpStackEvent.eventTypeToString ( type ) ) ) ) ; result.append ( ( ", device:" + ( device ) ) ) ; result.append ( ( ", value1:" + ( valueInt ) ) ) ; if ( ( codecStatus ) != null ) { result.append ( ( ", codecStatus:" + ( codecStatus ) ) ) ; } result.append ( "}" ) ; return result.toString ( ) ; }
Source:
private void removeFilterIfExisits ( java.util.Set < java.lang.Integer > clients , int clientIf , int filterIndex ) { if ( ! ( clients.contains ( clientIf ) ) ) { return ; } clients.remove ( clientIf ) ; if ( clients.isEmpty ( ) ) { resetCountDownLatch ( ) ; gattClientScanFilterParamDeleteNative ( clientIf , filterIndex ) ; waitForCallback ( ) ; } }

Target:
private void removeFilterIfExisits ( java.util.Set < java.lang.Integer > clients , int scannerId , int filterIndex ) { if ( ! ( clients.contains ( scannerId ) ) ) { return ; } clients.remove ( scannerId ) ; if ( clients.isEmpty ( ) ) { resetCountDownLatch ( ) ; gattClientScanFilterParamDeleteNative ( scannerId , filterIndex ) ; waitForCallback ( ) ; } }
Source:
public < T extends com.android.sched.marker.Marker > T addMarker ( @ javax.annotation.Nonnull T marker ) { assert isValidMarker ( marker ) : ( ( ( "Marker '" + ( com.android.sched.item.Items.getName ( marker.getClass ( ) ) ) ) + "' is not supported for class '" ) + ( this . getClass ( ) . getName ( ) ) ) + "'" ; ensureMap ( ) ; assert ( markers ) != null ; return ( ( T ) ( markers.put ( marker.getClass ( ) , marker ) ) ) ; }

Target:
public < T extends com.android.sched.marker.Marker > T addMarker ( @ javax.annotation.Nonnull T marker ) { synchronized ( lock ) { assert isValidMarker ( marker ) : ( ( ( "Marker '" + ( com.android.sched.item.Items.getName ( marker.getClass ( ) ) ) ) + "' is not supported for class '" ) + ( this . getClass ( ) . getName ( ) ) ) + "'" ; ensureMap ( ) ; assert ( markers ) != null ; return ( ( T ) ( markers.put ( marker.getClass ( ) , marker ) ) ) ; } }
Source:
public static void setUpClass ( ) { com.android.jack.compile.androidtree.services.ServicesCompilationTest.class . getClassLoader ( ) . setDefaultAssertionStatus ( true ) ; }

Target:
public static void setUpClass ( ) { com.android.jack.compile.androidtree.services.ServicesCompilationTest.class . getClassLoader ( ) . setDefaultAssertionStatus ( true ) ; com.android.jack.compile.androidtree.services.ServicesCompilationTest.BOOTCLASSPATH = new java.io.File [ ] { com.android.jack.TestTools.getFromAndroidTree ( "out/target/common/obj/JAVA_LIBRARIES/core_intermediates/classes.jar" ) } ; com.android.jack.compile.androidtree.services.ServicesCompilationTest.CLASSPATH = new java.io.File [ ] { com.android.jack.TestTools.getFromAndroidTree ( "out/target/common/obj/JAVA_LIBRARIES/android.policy_intermediates/classes.jar" ) , com.android.jack.TestTools.getFromAndroidTree ( "out/target/common/obj/JAVA_LIBRARIES/core-junit_intermediates/classes.jar" ) , com.android.jack.TestTools.getFromAndroidTree ( "out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/classes.jar" ) , com.android.jack.TestTools.getFromAndroidTree ( "out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jar" ) , com.android.jack.TestTools.getFromAndroidTree ( "out/target/common/obj/JAVA_LIBRARIES/telephony-common_intermediates/classes.jar" ) } ; com.android.jack.compile.androidtree.services.ServicesCompilationTest.SOURCELIST = com.android.jack.TestTools.getTargetLibSourcelist ( "services" ) ; }
Source:
public void test_ConstructorLjava_io_OutputStreamI ( ) { try { java.io.FileOutputStream outFile = new java.io.FileOutputStream ( "GZIPOutCon.txt" ) ; org.apache.harmony.tests.java.util.zip.GZIPOutputStreamTest.TestGZIPOutputStream outGZIP = new org.apache.harmony.tests.java.util.zip.GZIPOutputStreamTest.TestGZIPOutputStream ( outFile , 100 ) ; assertNotNull ( "the constructor for GZIPOutputStream is null" , outGZIP ) ; assertEquals ( "the CRC value of the outputStream is not zero" , 0 , outGZIP.getChecksum ( ) . getValue ( ) ) ; outGZIP.close ( ) ; } catch ( java.io.IOException e ) { fail ( "an IO error occured while trying to find the output file or creating GZIP constructor" ) ; } }

Target:
public void test_ConstructorLjava_io_OutputStreamI ( ) { try { java.io.FileOutputStream outFile = new java.io.FileOutputStream ( java.io.File.createTempFile ( "GZIPOutCon" , ".txt" ) ) ; org.apache.harmony.tests.java.util.zip.GZIPOutputStreamTest.TestGZIPOutputStream outGZIP = new org.apache.harmony.tests.java.util.zip.GZIPOutputStreamTest.TestGZIPOutputStream ( outFile , 100 ) ; assertNotNull ( "the constructor for GZIPOutputStream is null" , outGZIP ) ; assertEquals ( "the CRC value of the outputStream is not zero" , 0 , outGZIP.getChecksum ( ) . getValue ( ) ) ; outGZIP.close ( ) ; } catch ( java.io.IOException e ) { fail ( "an IO error occured while trying to find the output file or creating GZIP constructor" ) ; } }
Source:
private void doFinalize ( java.lang.ref.FinalizerReference < ? > reference ) { java.lang.ref.FinalizerReference.remove ( reference ) ; java.lang.Object object = reference.get ( ) ; reference.clear ( ) ; try { object.finalize ( ) ; } catch ( java.lang.Throwable ex ) { java.lang.System.logE ( "Uncaught exception thrown by finalizer" , ex ) ; } }

Target:
private void doFinalize ( java.lang.ref.FinalizerReference < ? > reference ) { java.lang.ref.FinalizerReference.remove ( reference ) ; java.lang.Object object = reference.get ( ) ; reference.clear ( ) ; try { object.finalize ( ) ; } catch ( java.lang.Throwable ex ) { java.lang.System.logE ( "Uncaught exception thrown by finalizer" , ex ) ; } finally { finalizingObject = null ; } }
Source:
public void onCreate ( android.os.Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; startService ( new android.content.Intent ( this , android.perfetto.producer.ProducerService.class ) ) ; startService ( new android.content.Intent ( this , android.perfetto.producer.ProducerIsolatedService.class ) ) ; java.lang.System.loadLibrary ( "perfettocts_jni" ) ; new java.lang.Thread ( new java.lang.Runnable ( ) { public void run ( ) { try { android.perfetto.producer.ProducerActivity.setupProducer ( ) ; } catch ( java.lang.Exception ex ) { ex.printStackTrace ( ) ; } } } ) . start ( ) ; }

Target:
public void onResume ( ) { super . onResume ( ) ; startService ( new android.content.Intent ( this , android.perfetto.producer.ProducerService.class ) ) ; startService ( new android.content.Intent ( this , android.perfetto.producer.ProducerIsolatedService.class ) ) ; java.lang.System.loadLibrary ( "perfettocts_jni" ) ; new java.lang.Thread ( new java.lang.Runnable ( ) { public void run ( ) { try { android.perfetto.producer.ProducerActivity.setupProducer ( ) ; } catch ( java.lang.Exception ex ) { ex.printStackTrace ( ) ; } } } ) . start ( ) ; }
Source:
public void testHasParamWithValueMatcherDoesNotMatch ( ) { org.hamcrest.Matcher < android.net.Uri > hasParamWithValue = android.support.test.espresso.intent.matcher.UriMatchers.hasParamWithValue ( org.hamcrest.CoreMatchers.equalTo ( "sourceid" ) , org.hamcrest.CoreMatchers.equalTo ( "google" ) ) ; assertFalse ( "HasParamWithValue Matched, But it shouldn't have" , android.support.test.espresso.intent.matcher.UriMatchers.hasParamWithValue ( "sourceid" , "google" ) . matches ( uri ) ) ; assertFalse ( "HasParamWithValue Matched, But it shouldn't have" , hasParamWithValue.matches ( uri ) ) ; }

Target:
public void hasParamWithValueMatcherDoesNotMatch ( ) { org.hamcrest.Matcher < android.net.Uri > hasParamWithValue = android.support.test.espresso.intent.matcher.UriMatchers.hasParamWithValue ( org.hamcrest.CoreMatchers.equalTo ( "sourceid" ) , org.hamcrest.CoreMatchers.equalTo ( "google" ) ) ; org.junit.Assert.assertFalse ( "HasParamWithValue Matched, But it shouldn't have" , android.support.test.espresso.intent.matcher.UriMatchers.hasParamWithValue ( "sourceid" , "google" ) . matches ( uri ) ) ; org.junit.Assert.assertFalse ( "HasParamWithValue Matched, But it shouldn't have" , hasParamWithValue.matches ( uri ) ) ; }
Source:
public java.io.File call ( ) { java.lang.String rootLocation = scope.getGlobalScope ( ) . getExtension ( ) . getTestOptions ( ) . getResultsDir ( ) ; if ( rootLocation == null ) { rootLocation = ( ( ( ( scope.getGlobalScope ( ) . getBuildDir ( ) ) + "/" ) + ( com.android.builder.model.AndroidProject.FD_OUTPUTS ) ) + "/" ) + ( FD_ANDROID_RESULTS ) ; } return scope.getGlobalScope ( ) . getProject ( ) . file ( ( rootLocation + subFolder ) ) ; }

Target:
public java.io.File call ( ) { java.lang.String rootLocation = scope.getGlobalScope ( ) . getExtension ( ) . getTestOptions ( ) . getResultsDir ( ) ; if ( rootLocation == null ) { rootLocation = ( ( ( ( scope.getGlobalScope ( ) . getBuildDir ( ) ) + "/" ) + ( com.android.builder.model.AndroidProject.FD_OUTPUTS ) ) + "/" ) + ( com.android.builder.core.BuilderConstants.FD_ANDROID_RESULTS ) ; } return scope.getGlobalScope ( ) . getProject ( ) . file ( ( rootLocation + subFolder ) ) ; }
Source:
public void createDefaultBuildTypes ( @ org.gradle.model.Path ( value = "android.buildTypes" ) org.gradle.model.ModelSet < com.android.build.gradle.managed.BuildType > buildTypes ) { buildTypes.create ( new org.gradle.api.Action < com.android.build.gradle.managed.BuildType > ( ) { @ java.lang.Override public void execute ( com.android.build.gradle.managed.BuildType buildType ) { buildType.setName ( BuilderConstants.DEBUG ) ; buildType.setIsDebuggable ( true ) ; buildType.setIsEmbedMicroApp ( false ) ; } } ) ; buildTypes.create ( new org.gradle.api.Action < com.android.build.gradle.managed.BuildType > ( ) { @ java.lang.Override public void execute ( com.android.build.gradle.managed.BuildType buildType ) { buildType.setName ( BuilderConstants.RELEASE ) ; } } ) ; }

Target:
public void createDefaultBuildTypes ( @ org.gradle.model.Path ( value = "android.buildTypes" ) org.gradle.model.ModelMap < com.android.build.gradle.managed.BuildType > buildTypes ) { buildTypes.create ( BuilderConstants.DEBUG , new org.gradle.api.Action < com.android.build.gradle.managed.BuildType > ( ) { @ java.lang.Override public void execute ( com.android.build.gradle.managed.BuildType buildType ) { buildType.setIsDebuggable ( true ) ; buildType.setIsEmbedMicroApp ( false ) ; } } ) ; buildTypes.create ( BuilderConstants.RELEASE ) ; }
Source:
public void testMakeTimeZone_TooManyOffsets ( ) throws java.lang.Exception { int [ ] [ ] times = new int [ ] [ ] { new int [ ] { - 2000 , 255 } } ; int [ ] [ ] offsets = new int [ 257 ] [ ] ; java.util.Arrays.fill ( offsets , new int [ 2 ] ) ; offsets [ 255 ] = new int [ ] { 3600 , 0 } ; try { createZoneInfo ( times , offsets ) ; fail ( "Did not detect too many offsets" ) ; } catch ( java.lang.IllegalStateException expected ) { } }

Target:
public void testReadTimeZone_badMagic ( ) throws java.lang.Exception { libcore.util.ZoneInfoTestHelper.ZoneInfoDataBuilder builder = new libcore.util.ZoneInfoTestHelper.ZoneInfoDataBuilder ( ) ; builder.initializeToValid ( ) ; builder.setMagic ( - 559038737 ) ; try { createZoneInfo ( getName ( ) , java.lang.System.currentTimeMillis ( ) , builder.build ( ) ) ; fail ( ) ; } catch ( java.io.IOException expected ) { } }
Source:
public void sendTerminalResponse ( java.lang.String contents , android.os.Message response ) { com.android.internal.telephony.RILRequest rr = com.android.internal.telephony.RILRequest.obtain ( RILConstants.RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE , response ) ; if ( com.android.internal.telephony.RIL.RILJ_LOGD ) riljLog ( ( ( ( rr.serialString ( ) ) + "> " ) + ( com.android.internal.telephony.RIL.requestToString ( rr.mRequest ) ) ) ) ; rr.mParcel.writeString ( contents ) ; send ( rr ) ; }

Target:
public void getSmscAddress ( android.os.Message result ) { com.android.internal.telephony.RILRequest rr = com.android.internal.telephony.RILRequest.obtain ( com.android.internal.telephony.RIL_REQUEST_GET_SMSC_ADDRESS , result , mRILDefaultWorkSource ) ; if ( com.android.internal.telephony.RIL.RILJ_LOGD ) riljLog ( ( ( ( rr.serialString ( ) ) + "> " ) + ( com.android.internal.telephony.RIL.requestToString ( rr.mRequest ) ) ) ) ; send ( rr ) ; }
Source:
private static java.util.Properties createProps ( com.android.sdklib.internal.repository.packages.PreviewVersion previewVersion , int minPlatformToolsRev ) { java.util.Properties props = new java.util.Properties ( ) ; props.setProperty ( PkgProps.MIN_PLATFORM_TOOLS_REV , java.lang.Integer.toString ( minPlatformToolsRev ) ) ; if ( previewVersion != null ) { props.setProperty ( PkgProps.PKG_MINOR_REV , java.lang.Integer.toString ( previewVersion.getMinor ( ) ) ) ; props.setProperty ( PkgProps.PKG_MICRO_REV , java.lang.Integer.toString ( previewVersion.getMicro ( ) ) ) ; props.setProperty ( PkgProps.PKG_PREVIEW_REV , java.lang.Integer.toString ( previewVersion.getPreview ( ) ) ) ; } return props ; }

Target:
private static java.util.Properties createProps ( com.android.sdklib.internal.repository.packages.FullRevision revision , int minPlatformToolsRev ) { java.util.Properties props = new java.util.Properties ( ) ; props.setProperty ( PkgProps.MIN_PLATFORM_TOOLS_REV , java.lang.Integer.toString ( minPlatformToolsRev ) ) ; if ( revision != null ) { props.setProperty ( PkgProps.PKG_MINOR_REV , java.lang.Integer.toString ( revision.getMinor ( ) ) ) ; props.setProperty ( PkgProps.PKG_MICRO_REV , java.lang.Integer.toString ( revision.getMicro ( ) ) ) ; props.setProperty ( PkgProps.PKG_PREVIEW_REV , java.lang.Integer.toString ( revision.getPreview ( ) ) ) ; } return props ; }
Source:
public android.net.NetworkScorerAppManager.NetworkScorerAppData getScorer ( java.lang.String packageName ) { if ( android.text.TextUtils.isEmpty ( packageName ) ) { return null ; } java.util.Collection < android.net.NetworkScorerAppManager.NetworkScorerAppData > applications = getAllValidScorers ( ) ; for ( android.net.NetworkScorerAppManager.NetworkScorerAppData app : applications ) { if ( packageName.equals ( app.mPackageName ) ) { return app ; } } return null ; }

Target:
public android.net.NetworkScorerAppManager.NetworkScorerAppData getActiveScorer ( ) { if ( isNetworkRecommendationsDisabled ( ) ) { return null ; } return getNetworkRecommendationProviderData ( ) ; }
Source:
private boolean hasTag ( java.io.File dexFile ) throws java.io.IOException { com.android.jack.dx.io.DexBuffer dex = new com.android.jack.dx.io.DexBuffer ( dexFile ) ; return dex.strings ( ) . contains ( com.android.jack.backend.dex.DexWriter.getJackDexTag ( ) ) ; }

Target:
private boolean hasTag ( @ javax.annotation.Nonnull java.io.File dexFile ) throws java.io.IOException { java.util.Iterator < java.lang.String > stringsIt = new com.android.jack.dx.io.DexBuffer ( dexFile ) . strings ( ) . iterator ( ) ; while ( stringsIt.hasNext ( ) ) { if ( com.android.jack.backend.dex.DexWriter.isJackDexTag ( stringsIt.next ( ) ) ) { return true ; } } return false ; }
Source:
private void makeFakeSysImgInternal ( java.io.File imagesDir , java.lang.String tag , java.lang.String abiType ) throws java.io.IOException { imagesDir.mkdirs ( ) ; new java.io.File ( imagesDir , "userdata.img" ) . createNewFile ( ) ; createSourceProps ( imagesDir , PkgProps.PKG_REVISION , "0" , PkgProps.VERSION_API_LEVEL , "0" , PkgProps.SYS_IMG_TAG_ID , tag , PkgProps.SYS_IMG_ABI , abiType ) ; }

Target:
private void makeFakeSysImgInternal ( @ com.android.annotations.NonNull java.io.File sysImgDir , @ com.android.annotations.Nullable java.lang.String tagId , @ com.android.annotations.NonNull java.lang.String abiType ) throws java.io.IOException { sysImgDir.mkdirs ( ) ; new java.io.File ( sysImgDir , "userdata.img" ) . createNewFile ( ) ; if ( tagId == null ) { createSourceProps ( sysImgDir , PkgProps.PKG_REVISION , "0" , PkgProps.VERSION_API_LEVEL , "0" , PkgProps.SYS_IMG_ABI , abiType ) ; } else { createSourceProps ( sysImgDir , PkgProps.PKG_REVISION , "0" , PkgProps.VERSION_API_LEVEL , "0" , PkgProps.SYS_IMG_TAG_ID , tagId , PkgProps.SYS_IMG_TAG_DISPLAY , com.android.sdklib.repository.local.LocalSysImgPkgInfo.tagIdToDisplay ( tagId ) , PkgProps.SYS_IMG_ABI , abiType ) ; } }
Source:
public boolean equals ( java.lang.Object o ) { if ( ( this ) == o ) return true ; if ( ! ( o instanceof android.telephony.ims.internal.feature.CapabilityChangeRequest.CapabilityPair ) ) return false ; android.telephony.ims.internal.feature.CapabilityChangeRequest.CapabilityPair that = ( ( android.telephony.ims.internal.feature.CapabilityChangeRequest.CapabilityPair ) ( o ) ) ; if ( ( getCapability ( ) ) != ( that.getCapability ( ) ) ) return false ; return ( getRadioTech ( ) ) == ( that.getRadioTech ( ) ) ; }

Target:
public boolean equals ( java.lang.Object o ) { if ( ( this ) == o ) return true ; if ( ! ( o instanceof android.telephony.ims.feature.CapabilityChangeRequest.CapabilityPair ) ) return false ; android.telephony.ims.feature.CapabilityChangeRequest.CapabilityPair that = ( ( android.telephony.ims.feature.CapabilityChangeRequest.CapabilityPair ) ( o ) ) ; if ( ( getCapability ( ) ) != ( that.getCapability ( ) ) ) return false ; return ( getRadioTech ( ) ) == ( that.getRadioTech ( ) ) ; }
Source:
private void onDoubleClick ( org.eclipse.swt.events.MouseEvent e ) { }

Target:
private void onDoubleClick ( org.eclipse.swt.events.MouseEvent e ) { int x = mHScale.inverseTranslate ( e.x ) ; int y = mVScale.inverseTranslate ( e.y ) ; com.android.ide.eclipse.adt.internal.editors.layout.gle2.CanvasViewInfo vi = findViewInfoAt ( x , y ) ; if ( vi == null ) { return ; } org.w3c.dom.Node xmlNode = vi.getXmlNode ( ) ; if ( xmlNode != null ) { boolean found = mLayoutEditor.show ( xmlNode ) ; if ( ! found ) { getDisplay ( ) . beep ( ) ; } } }
Source:
protected static java.lang.String cstComment ( com.android.jack.dx.dex.code.DalvInsn insn ) { com.android.jack.dx.dex.code.CstInsn ci = ( ( com.android.jack.dx.dex.code.CstInsn ) ( insn ) ) ; if ( ! ( ci.hasIndex ( ) ) ) { return "" ; } java.lang.StringBuilder sb = new java.lang.StringBuilder ( 20 ) ; int index = ci.getIndex ( ) ; sb.append ( ci.getConstant ( ) . typeName ( ) ) ; sb.append ( '@' ) ; if ( index < 65536 ) { sb.append ( com.android.jack.dx.util.Hex.u2 ( index ) ) ; } else { sb.append ( com.android.jack.dx.util.Hex.u4 ( index ) ) ; } return sb.toString ( ) ; }

Target:
protected static java.lang.String cstComment ( @ javax.annotation.Nonnull com.android.jack.dx.dex.code.DualCstInsn insn ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( 20 ) ; sb.append ( com.android.jack.dx.dex.code.InsnFormat.insnCommentCstWithIndex ( insn.getFirstConstant ( ) , insn.getFirstIndex ( ) ) ) ; sb.append ( ", " ) ; sb.append ( com.android.jack.dx.dex.code.InsnFormat.insnCommentCstWithIndex ( insn.getSecondConstant ( ) , insn.getSecondIndex ( ) ) ) ; return sb.toString ( ) ; }
Source:
public boolean isValidSelection ( ) { com.google.gct.testing.GoogleCloudTestingConfiguration selection = getSelection ( ) ; return ( selection != null ) && ( ( selection.countCombinations ( ) ) > 0 ) ; }

Target:
public boolean isValidSelection ( ) { com.google.gct.testing.GoogleCloudTestingConfiguration selection = getSelection ( ) ; return ( ( selection != null ) && ( ( selection.countCombinations ( ) ) > 0 ) ) && ( ! ( myCloudProjectNameLabel.getText ( ) . equals ( com.google.gct.testing.CloudTestOptionPanel.CLOUD_PROJECT_PROMPT ) ) ) ; }
Source:
public java.lang.String [ ] getForbiddenPlmns ( int subId , int appType ) { try { com.android.internal.telephony.IPhoneSubInfo info = getSubscriberInfo ( ) ; if ( info == null ) return null ; return info.getForbiddenPlmns ( subId , appType ) ; } catch ( android.os.RemoteException ex ) { return null ; } catch ( java.lang.NullPointerException ex ) { return null ; } }

Target:
public java.lang.String [ ] getForbiddenPlmns ( ) { return getForbiddenPlmns ( getSubId ( ) , android.telephony.TelephonyManager.APPTYPE_USIM ) ; }
Source:
public void drawTextRun ( android.graphics.Canvas c , int start , int end , int contextStart , int contextEnd , float x , float y , int flags , android.graphics.Paint p ) { int count = end - start ; int contextCount = contextEnd - contextStart ; c.drawTextRun ( mChars , ( start + ( mStart ) ) , count , ( contextStart + ( mStart ) ) , contextCount , x , y , flags , p ) ; }

Target:
public void drawTextRun ( android.graphics.Canvas c , int start , int end , int contextStart , int contextEnd , float x , float y , boolean isRtl , android.graphics.Paint p ) { int count = end - start ; int contextCount = contextEnd - contextStart ; c.drawTextRun ( mChars , ( start + ( mStart ) ) , count , ( contextStart + ( mStart ) ) , contextCount , x , y , isRtl , p ) ; }
Source:
public java.lang.String [ ] saw ( java.lang.String prefix ) { byte [ ] [ ] values = saw ( android.security.KeyStore.getKeyBytes ( prefix ) ) ; if ( values == null ) { return null ; } java.lang.String [ ] strings = new java.lang.String [ values.length ] ; for ( int i = 0 ; i < ( values.length ) ; ++ i ) { strings [ i ] = android.security.KeyStore.toKeyString ( values [ i ] ) ; } return strings ; }

Target:
public java.lang.String [ ] saw ( java.lang.String prefix ) { try { return mBinder.saw ( prefix ) ; } catch ( android.os.RemoteException e ) { android.util.Log.w ( android.security.KeyStore.TAG , "Cannot connect to keystore" , e ) ; return null ; } }
Source:
final void moveHomeToFrontFromLaunchLocked ( int launchFlags ) { if ( ( launchFlags & ( ( android.content.Intent.FLAG_ACTIVITY_NEW_TASK ) | ( android.content.Intent.FLAG_ACTIVITY_TASK_ON_HOME ) ) ) == ( ( android.content.Intent.FLAG_ACTIVITY_NEW_TASK ) | ( android.content.Intent.FLAG_ACTIVITY_TASK_ON_HOME ) ) ) { moveHomeToFrontLocked ( ) ; } }

Target:
final boolean finishActivityAffinityLocked ( com.android.server.am.ActivityRecord r ) { java.util.ArrayList < com.android.server.am.ActivityRecord > activities = r.task.mActivities ; for ( int index = activities.indexOf ( r ) ; index >= 0 ; -- index ) { com.android.server.am.ActivityRecord cur = activities.get ( index ) ; if ( ! ( java.util.Objects.equals ( cur.taskAffinity , r.taskAffinity ) ) ) { break ; } finishActivityLocked ( cur , Activity.RESULT_CANCELED , null , "request-affinity" , true ) ; } return true ; }
Source:
public com.android.internal.telephony.gsm.DataActivityState getDataActivityState ( ) { com.android.internal.telephony.gsm.DataActivityState ret = DataActivityState.NONE ; if ( ( mSST.getCurrentGprsState ( ) ) == ( android.telephony.ServiceState.STATE_IN_SERVICE ) ) { switch ( mDataConnectionTracker.getActivity ( ) ) { case DATAIN : ret = DataActivityState.DATAIN ; break ; case DATAOUT : ret = DataActivityState.DATAOUT ; break ; case DATAINANDOUT : ret = DataActivityState.DATAINANDOUT ; break ; } } return ret ; }

Target:
public com.android.internal.telephony.gsm.DataActivityState getDataActivityState ( ) { com.android.internal.telephony.gsm.DataActivityState ret = DataActivityState.NONE ; if ( ( mSST.getCurrentGprsState ( ) ) == ( android.telephony.ServiceState.STATE_IN_SERVICE ) ) { switch ( mDataConnectionTracker.getActivity ( ) ) { case DATAIN : ret = DataActivityState.DATAIN ; break ; case DATAOUT : ret = DataActivityState.DATAOUT ; break ; case DATAINANDOUT : ret = DataActivityState.DATAINANDOUT ; break ; case DORMANT : ret = DataActivityState.DORMANT ; break ; } } return ret ; }
Source:
public void paint ( java.awt.Graphics g ) { if ( myEnableAntialiasing ) { com.intellij.ui.table.GraphicsUtil.setupAntialiasing ( g ) ; } super . paint ( g ) ; }

Target:
public void paint ( java.awt.Graphics g ) { if ( myEnableAntialiasing ) { com.intellij.ui.table.GraphicsUtil.setupAntialiasing ( g ) ; } if ( ! ( this . isEnabled ( ) ) ) { g = new com.intellij.ui.table.JBTable.TableGrayer ( ( ( java.awt.Graphics2D ) ( g ) ) ) ; } super . paint ( g ) ; }
Source:
synchronized void nScriptSetVarObj ( long id , int slot , long val ) { validate ( ) ; rsnScriptSetVarObj ( mContext , id , slot , val ) ; }

Target:
synchronized void nScriptInvokeV ( long id , int slot , byte [ ] params , boolean mUseInc ) { validate ( ) ; long curCon = mContext ; if ( mUseInc ) { curCon = mIncCon ; } rsnScriptInvokeV ( curCon , id , slot , params , mUseInc ) ; }
Source:
public void testMergedResourcesByName ( ) throws java.lang.Exception { com.android.ide.common.res2.ResourceRepository repo = getResourceRepository ( ) ; verifyResourceExists ( repo , "drawable/icon" , "drawable?ldpi/icon" , "drawable/icon2" , "drawable/patch" , "drawable/color_drawable" , "drawable/drawable_ref" , "raw/foo" , "layout/main" , "layout/layout_ref" , "layout/alias_replaced_by_file" , "layout/file_replaced_by_alias" , "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" , "declare-styleable/declare_styleable" , "dimen/dimen" , "id/item_id" , "integer/integer" ) ; }

Target:
public void testMergedResourcesByName ( ) throws java.lang.Exception { com.android.ide.common.res2.ResourceRepository repo = getResourceRepository ( ) ; verifyResourceExists ( repo , "drawable/icon" , "drawable?ldpi/icon" , "drawable/icon2" , "drawable/patch" , "drawable/color_drawable" , "drawable/drawable_ref" , "raw/foo" , "layout/main" , "layout/layout_ref" , "layout/alias_replaced_by_file" , "layout/file_replaced_by_alias" , "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" ) ; }
Source:
public void beforeTextChanged ( java.lang.CharSequence s , int start , int count , int after ) { }

Target:
public void beforeTextChanged ( java.lang.CharSequence s , int start , int count , int after ) { if ( ! ( DataKind.PSEUDO_MIME_TYPE_NAME.equals ( getKind ( ) . mimeType ) ) ) { return ; } if ( needInputInitialize ) { mFixedPhonetic = getPhonetic ( column ) ; mFixedDisplayName = getNameField ( column ) ; needInputInitialize = false ; } }
Source:
public static android.hardware.cts.helpers.sensorverification.MeanVerification getDefault ( android.hardware.cts.helpers.TestSensorEnvironment environment ) { int sensorType = environment.getSensor ( ) . getType ( ) ; if ( ! ( android.hardware.cts.helpers.sensorverification.MeanVerification.DEFAULTS.containsKey ( sensorType ) ) ) { return null ; } float [ ] expected = ( ( float [ ] ) ( android.hardware.cts.helpers.sensorverification.MeanVerification.DEFAULTS.get ( sensorType ) [ 0 ] ) ) ; float [ ] threshold = ( ( float [ ] ) ( android.hardware.cts.helpers.sensorverification.MeanVerification.DEFAULTS.get ( sensorType ) [ 1 ] ) ) ; return new android.hardware.cts.helpers.sensorverification.MeanVerification ( expected , threshold ) ; }

Target:
public static android.hardware.cts.helpers.sensorverification.MeanVerification getDefault ( android.hardware.cts.helpers.TestSensorEnvironment environment ) { int sensorType = environment.getSensor ( ) . getType ( ) ; if ( ! ( android.hardware.cts.helpers.sensorverification.MeanVerification.DEFAULTS.containsKey ( sensorType ) ) ) { return null ; } float [ ] expected = android.hardware.cts.helpers.sensorverification.MeanVerification.DEFAULTS.get ( sensorType ) . mExpectedValues ; float [ ] upperThresholds = android.hardware.cts.helpers.sensorverification.MeanVerification.DEFAULTS.get ( sensorType ) . mUpperThresholds ; float [ ] lowerThresholds = android.hardware.cts.helpers.sensorverification.MeanVerification.DEFAULTS.get ( sensorType ) . mLowerThresholds ; return new android.hardware.cts.helpers.sensorverification.MeanVerification ( expected , upperThresholds , lowerThresholds ) ; }
Source:
private void runQuickFixTest ( java.lang.String parameterText , java.lang.String expectedString ) { com.intellij.openapi.project.Project myProject = myFixture.getProject ( ) ; com.intellij.psi.PsiParameter parameter = com.intellij.psi.JavaPsiFacade.getInstance ( myProject ) . getElementFactory ( ) . createParameterFromText ( parameterText , null ) ; com.google.gct.intellij.endpoints.validation.ApiParameterInspection.MyQuickFix myQuickFix = new com.google.gct.intellij.endpoints.validation.ApiParameterInspection ( ) . new com.google.gct.intellij.endpoints.validation.MyQuickFix ( ) ; com.intellij.testFramework.MockProblemDescriptor problemDescriptor = new com.intellij.testFramework.MockProblemDescriptor ( parameter , "" , com.intellij.codeInspection.ProblemHighlightType.ERROR , null ) ; myQuickFix.applyFix ( myFixture.getProject ( ) , problemDescriptor ) ; junit.framework.Assert.assertEquals ( expectedString , parameter.getText ( ) ) ; }

Target:
private void runQuickFixTest ( java.lang.String parameterText , java.lang.String expectedString ) { com.intellij.openapi.project.Project myProject = myFixture.getProject ( ) ; com.intellij.psi.PsiParameter parameter = com.intellij.psi.JavaPsiFacade.getInstance ( myProject ) . getElementFactory ( ) . createParameterFromText ( parameterText , null ) ; com.google.gct.idea.appengine.validation.ApiParameterInspection.MyQuickFix myQuickFix = new com.google.gct.idea.appengine.validation.ApiParameterInspection ( ) . new com.google.gct.idea.appengine.validation.MyQuickFix ( ) ; com.intellij.testFramework.MockProblemDescriptor problemDescriptor = new com.intellij.testFramework.MockProblemDescriptor ( parameter , "" , com.intellij.codeInspection.ProblemHighlightType.ERROR , null ) ; myQuickFix.applyFix ( myFixture.getProject ( ) , problemDescriptor ) ; junit.framework.Assert.assertEquals ( expectedString , parameter.getText ( ) ) ; }
Source:
public void testUpdate_emptyScanList ( ) { mRecommendedNetworkEvaluator.update ( new java.util.ArrayList < com.android.server.wifi.ScanDetail > ( ) ) ; org.mockito.Mockito.verifyZeroInteractions ( mNetworkScoreManager ) ; org.mockito.Mockito.verify ( mWifiConfigManager ) . updateNetworkNotRecommended ( mTrustedWifiConfiguration.networkId , false ) ; }

Target:
public void testUpdate_recommendationsDisabled ( ) { java.util.ArrayList < com.android.server.wifi.ScanDetail > scanDetails = new java.util.ArrayList < > ( ) ; when ( mFrameworkFacade.getIntegerSetting ( mContext , Settings.Global.NETWORK_RECOMMENDATIONS_ENABLED , 0 ) ) . thenReturn ( 0 ) ; mContentObserver.onChange ( false ) ; mRecommendedNetworkEvaluator.update ( scanDetails ) ; verifyZeroInteractions ( mNetworkScoreManager ) ; verify ( mWifiConfigManager ) . updateNetworkNotRecommended ( mTrustedWifiConfiguration.networkId , false ) ; }
Source:
public java.lang.String getListDescription ( ) { return java.lang.String.format ( "%1$s System Image%2$s" , getAbiDisplayName ( ) , ( isObsolete ( ) ? " (Obsolete)" : "" ) ) ; }

Target:
public java.lang.String getListDescription ( ) { boolean isDefaultTag = SystemImage.DEFAULT_TAG.equals ( mTag ) ; return java.lang.String.format ( "%1$s%2$s System Image%3$s" , ( isDefaultTag ? "" : ( mTag.getDisplay ( ) ) + " " ) , getAbiDisplayName ( ) , ( isObsolete ( ) ? " (Obsolete)" : "" ) ) ; }
Source:
boolean recordUidIfAuthorized ( android.net.wifi.WifiConfiguration config , int uid , boolean onlyAnnotate ) { if ( ! ( mWifiConfigManager.isNetworkConfigured ( config ) ) ) { config.creatorUid = uid ; config.creatorName = mContext.getPackageManager ( ) . getNameForUid ( uid ) ; } else if ( ! ( mWifiConfigManager.canModifyNetwork ( uid , config , onlyAnnotate ) ) ) { return false ; } config.lastUpdateUid = uid ; config.lastUpdateName = mContext.getPackageManager ( ) . getNameForUid ( uid ) ; return true ; }

Target:
private boolean connectToUserSelectNetwork ( int netId , int uid ) { if ( ! ( setUserSelectNetwork ( netId , uid ) ) ) { return false ; } if ( ! ( mWifiConfigManager.checkAndUpdateLastConnectUid ( netId , uid ) ) ) { loge ( ( ( ( "connectToUserSelectNetwork uid " + uid ) + " did not have the permissions to connect=" ) + netId ) ) ; return false ; } startConnectToNetwork ( netId , com.android.server.wifi.WifiStateMachine.SUPPLICANT_BSSID_ANY ) ; return true ; }
Source:
public void createControl ( org.eclipse.swt.widgets.Composite parent ) { org.eclipse.swt.widgets.Tree tree = new org.eclipse.swt.widgets.Tree ( parent , org.eclipse.swt.SWT.MULTI ) ; mTreeViewer = new org.eclipse.jface.viewers.TreeViewer ( tree ) ; mTreeViewer.setContentProvider ( new com.android.ide.eclipse.adt.internal.editors.layout.gle2.OutlinePage2.ContentProvider ( ) ) ; mTreeViewer.setLabelProvider ( new com.android.ide.eclipse.adt.internal.editors.layout.gle2.OutlinePage2.LabelProvider ( ) ) ; }

Target:
public int hashCode ( java.lang.Object element ) { if ( element instanceof com.android.ide.eclipse.adt.internal.editors.layout.gle2.CanvasViewInfo ) { com.android.ide.eclipse.adt.internal.editors.layout.uimodel.UiViewElementNode key = ( ( com.android.ide.eclipse.adt.internal.editors.layout.gle2.CanvasViewInfo ) ( element ) ) . getUiViewKey ( ) ; if ( key != null ) { return key.hashCode ( ) ; } } if ( element != null ) { return element.hashCode ( ) ; } return 0 ; }
Source:
static void writeXml ( com.android.libcore.timezone.tzlookup.TzLookupFile.Country country , javax.xml.stream.XMLStreamWriter writer ) throws javax.xml.stream.XMLStreamException { writer.writeStartElement ( com.android.libcore.timezone.tzlookup.TzLookupFile.COUNTRY_ELEMENT ) ; writer.writeAttribute ( com.android.libcore.timezone.tzlookup.TzLookupFile.COUNTRY_CODE_ATTRIBUTE , country.isoCode ) ; writer.writeAttribute ( com.android.libcore.timezone.tzlookup.TzLookupFile.DEFAULT_ATTRIBUTE , country.defaultTimeZoneId ) ; writer.writeAttribute ( com.android.libcore.timezone.tzlookup.TzLookupFile.EVER_USES_UTC_ATTRIBUTE , ( country.everUsesUtc ? "y" : "n" ) ) ; for ( com.android.libcore.timezone.tzlookup.TzLookupFile.TimeZoneIdentifier timeZoneId : country.timeZoneIds ) { com.android.libcore.timezone.tzlookup.TzLookupFile.TimeZoneIdentifier.writeXml ( timeZoneId , writer ) ; } writer.writeEndElement ( ) ; }

Target:
static void writeXml ( com.android.libcore.timezone.tzlookup.TzLookupFile.Country country , javax.xml.stream.XMLStreamWriter writer ) throws javax.xml.stream.XMLStreamException { writer.writeStartElement ( com.android.libcore.timezone.tzlookup.TzLookupFile.COUNTRY_ELEMENT ) ; writer.writeAttribute ( com.android.libcore.timezone.tzlookup.TzLookupFile.COUNTRY_CODE_ATTRIBUTE , country.isoCode ) ; writer.writeAttribute ( com.android.libcore.timezone.tzlookup.TzLookupFile.DEFAULT_ATTRIBUTE , country.defaultTimeZoneId ) ; writer.writeAttribute ( com.android.libcore.timezone.tzlookup.TzLookupFile.EVER_USES_UTC_ATTRIBUTE , com.android.libcore.timezone.tzlookup.TzLookupFile.encodeBooleanAttribute ( country.everUsesUtc ) ) ; for ( com.android.libcore.timezone.tzlookup.TzLookupFile.TimeZoneMapping timeZoneId : country.timeZoneIds ) { com.android.libcore.timezone.tzlookup.TzLookupFile.TimeZoneMapping.writeXml ( timeZoneId , writer ) ; } writer.writeEndElement ( ) ; }