auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public com.android.tools.lint.client.api.JavaParser.ResolvedAnnotation getAnnotation ( @ com.android.annotations.NonNull com.android.tools.lint.client.api.JavaParser.ResolvedClass cls , @ com.android.annotations.NonNull java.lang.String type ) { com.android.tools.lint.ExternalAnnotationRepository.ClassInfo c = findClass ( cls ) ; if ( c == null ) { return null ; } if ( ( c.annotations ) != null ) { for ( com.android.tools.lint.client.api.JavaParser.ResolvedAnnotation annotation : c.annotations ) { if ( type.equals ( annotation.getSignature ( ) ) ) { return annotation ; } } } return null ; }

Target:
public com.android.tools.lint.client.api.JavaParser.ResolvedAnnotation getAnnotation ( @ com.android.annotations.NonNull com.android.tools.lint.client.api.JavaParser.ResolvedClass cls , @ com.android.annotations.NonNull java.lang.String type ) { com.android.tools.lint.ExternalAnnotationRepository.ClassInfo c = findClass ( cls ) ; if ( c == null ) { return null ; } java.util.List < com.android.tools.lint.client.api.JavaParser.ResolvedAnnotation > annotations = c.getAnnotations ( ) ; if ( annotations != null ) { for ( com.android.tools.lint.client.api.JavaParser.ResolvedAnnotation annotation : annotations ) { if ( type.equals ( annotation.getSignature ( ) ) ) { return annotation ; } } } return null ; }
Source:
static int getMaxLengthValuesArray ( android.hardware.Sensor sensor , int sdkLevel ) { int len = android.hardware.Sensor.sMaxLengthValuesArray [ ( ( sensor.mType ) - 1 ) ] ; if ( ( ( sensor.getType ( ) ) == ( android.hardware.Sensor.TYPE_ROTATION_VECTOR ) ) && ( sdkLevel <= ( Build.VERSION_CODES.JELLY_BEAN_MR1 ) ) ) { len = 3 ; } return len ; }

Target:
static int getMaxLengthValuesArray ( android.hardware.Sensor sensor , int sdkLevel ) { int type = sensor.mType ; if ( ( type == ( android.hardware.Sensor.TYPE_ROTATION_VECTOR ) ) && ( sdkLevel <= ( Build.VERSION_CODES.JELLY_BEAN_MR1 ) ) ) { return 3 ; } int offset = ( type * 2 ) + 1 ; if ( offset >= ( android.hardware.Sensor.sSensorReportingModes.length ) ) { return 16 ; } return android.hardware.Sensor.sSensorReportingModes [ offset ] ; }
Source:
public void dragSetData ( org.eclipse.swt.dnd.DragSourceEvent e ) { if ( org.eclipse.swt.dnd.TextTransfer.getInstance ( ) . isSupportedType ( e.dataType ) ) { e.data = com.android.ide.eclipse.adt.internal.editors.layout.gle2.CanvasSelection.getAsText ( mCanvas , mDragSelection ) ; return ; } if ( com.android.ide.eclipse.adt.internal.editors.layout.gle2.SimpleXmlTransfer.getInstance ( ) . isSupportedType ( e.dataType ) ) { e.data = mDragElements ; return ; } e.detail = org.eclipse.swt.dnd.DND.DROP_NONE ; e.doit = false ; }

Target:
public void dragSetData ( org.eclipse.swt.dnd.DragSourceEvent e ) { if ( org.eclipse.swt.dnd.TextTransfer.getInstance ( ) . isSupportedType ( e.dataType ) ) { e.data = com.android.ide.eclipse.adt.internal.editors.layout.gle2.SelectionItem.getAsText ( mCanvas , mDragSelection ) ; return ; } if ( com.android.ide.eclipse.adt.internal.editors.layout.gle2.SimpleXmlTransfer.getInstance ( ) . isSupportedType ( e.dataType ) ) { e.data = mDragElements ; return ; } e.detail = org.eclipse.swt.dnd.DND.DROP_NONE ; e.doit = false ; }
Source:
public void done ( ) { if ( ( mCurrentName ) != null ) { mValues.put ( mCurrentName , mCurrentValue ) ; mCurrentName = null ; mCurrentValue = null ; } if ( ( mValues ) != null ) { mListener.handleStatus ( mValues ) ; mValues = null ; } }

Target:
public void done ( ) { if ( ( mCurrentName ) != null ) { mValues.put ( mCurrentName , mCurrentValue ) ; mCurrentName = null ; mCurrentValue = null ; } if ( ( mValues ) != null ) { mParseSuccessful &= mListener.handleStatus ( mValues ) ; mValues = null ; } }
Source:
public void put ( android.icu.impl.UResource.Key key , android.icu.impl.UResource.Value value ) { if ( key.contentEquals ( "dnam" ) ) { } else if ( key.contentEquals ( "per" ) ) { setFormatterIfAbsent ( android.icu.text.MeasureFormat.MeasureFormatData.PER_UNIT_INDEX , value , 1 ) ; } else { setFormatterIfAbsent ( android.icu.impl.StandardPlural.indexFromString ( key ) , value , 0 ) ; } }

Target:
void consumePattern ( android.icu.impl.UResource.Key key , android.icu.impl.UResource.Value value ) { if ( key.contentEquals ( "dnam" ) ) { setDnamIfAbsent ( value ) ; } else if ( key.contentEquals ( "per" ) ) { setFormatterIfAbsent ( android.icu.text.MeasureFormat.MeasureFormatData.PER_UNIT_INDEX , value , 1 ) ; } else { setFormatterIfAbsent ( android.icu.impl.StandardPlural.indexFromString ( key ) , value , 0 ) ; } }
Source:
public void testNoCallbackAfterUnregisteredNetworkRequest ( ) { android.net.NetworkRequest nr = new android.net.NetworkRequest.Builder ( ) . addTransportType ( NetworkCapabilities.TRANSPORT_WIFI ) . build ( ) ; final com.android.server.ConnectivityServiceTest.TestNetworkCallback networkCallback = new com.android.server.ConnectivityServiceTest.TestNetworkCallback ( ) ; final int timeoutMs = 10 ; mCm.requestNetwork ( nr , networkCallback , timeoutMs ) ; mCm.unregisterNetworkCallback ( networkCallback ) ; networkCallback.assertNoCallback ( ) ; mWiFiNetworkAgent = new com.android.server.ConnectivityServiceTest.MockNetworkAgent ( TRANSPORT_WIFI ) ; mWiFiNetworkAgent.connect ( false ) ; networkCallback.assertNoCallback ( ) ; }

Target:
public void testTimedoutNetworkRequest ( ) { android.net.NetworkRequest nr = new android.net.NetworkRequest.Builder ( ) . addTransportType ( NetworkCapabilities.TRANSPORT_WIFI ) . build ( ) ; final com.android.server.ConnectivityServiceTest.TestNetworkCallback networkCallback = new com.android.server.ConnectivityServiceTest.TestNetworkCallback ( ) ; final int timeoutMs = 10 ; mCm.requestNetwork ( nr , networkCallback , timeoutMs ) ; networkCallback.expectCallback ( com.android.server.ConnectivityServiceTest.CallbackState.UNAVAILABLE , null ) ; mWiFiNetworkAgent = new com.android.server.ConnectivityServiceTest.MockNetworkAgent ( android.net.NetworkCapabilities.TRANSPORT_WIFI ) ; mWiFiNetworkAgent.connect ( false ) ; networkCallback.assertNoCallback ( ) ; }
Source:
protected junit.framework.TestSuite createCopyOfSuite ( junit.framework.TestSuite s ) { if ( s instanceof com.android.test.runner.junit3.AndroidTestSuite ) { com.android.test.runner.junit3.AndroidTestSuite a = ( ( com.android.test.runner.junit3.AndroidTestSuite ) ( s ) ) ; return new com.android.test.runner.junit3.AndroidTestSuite ( a.getName ( ) , a.getInstrumentation ( ) ) ; } else { return super . createCopyOfSuite ( s ) ; } }

Target:
protected junit.framework.TestSuite createCopyOfSuite ( junit.framework.TestSuite s ) { if ( s instanceof com.android.test.runner.junit3.AndroidTestSuite ) { com.android.test.runner.junit3.AndroidTestSuite a = ( ( com.android.test.runner.junit3.AndroidTestSuite ) ( s ) ) ; return new com.android.test.runner.junit3.AndroidTestSuite ( a.getName ( ) , a.getBundle ( ) , a.getInstrumentation ( ) ) ; } else { return super . createCopyOfSuite ( s ) ; } }
Source:
public com.android.sched.vfs.InputVDir getDir ( @ javax.annotation.Nonnull com.android.jack.library.FileType fileType , @ javax.annotation.Nonnull com.android.sched.vfs.VPath typePath ) throws com.android.jack.library.FileTypeDoesNotExistException { try { return vfs.getRootDir ( ) . getInputVDir ( fileType.buildDirVPath ( typePath ) ) ; } catch ( com.android.sched.util.file.NotFileOrDirectoryException e ) { throw new com.android.jack.library.FileTypeDoesNotExistException ( getLocation ( ) , typePath , fileType ) ; } catch ( com.android.sched.util.file.NoSuchFileException e ) { throw new com.android.jack.library.FileTypeDoesNotExistException ( getLocation ( ) , typePath , fileType ) ; } }

Target:
public com.android.sched.vfs.InputVDir getDir ( @ javax.annotation.Nonnull com.android.jack.library.FileType fileType , @ javax.annotation.Nonnull com.android.sched.vfs.VPath typePath ) throws com.android.jack.library.FileTypeDoesNotExistException { try { return vfs.getRootInputVDir ( ) . getInputVDir ( fileType.buildDirVPath ( typePath ) ) ; } catch ( com.android.sched.util.file.NotFileOrDirectoryException e ) { throw new com.android.jack.library.FileTypeDoesNotExistException ( getLocation ( ) , typePath , fileType ) ; } catch ( com.android.sched.util.file.NoSuchFileException e ) { throw new com.android.jack.library.FileTypeDoesNotExistException ( getLocation ( ) , typePath , fileType ) ; } }
Source:
public void testConsideringOptions ( ) throws java.lang.Exception { createPatch ( ) ; com.intellij.updater.PatchFileCreator.PreparationResult preparationResult = com.intellij.updater.PatchFileCreator.prepareAndValidate ( myFile , myOlderDir , com.intellij.updater.TEST_UI ) ; java.util.Map < java.lang.String , com.intellij.updater.ValidationResult.Option > options = new java.util.HashMap < java.lang.String , com.intellij.updater.ValidationResult.Option > ( ) ; for ( com.intellij.updater.PatchAction each : preparationResult.patch.getActions ( ) ) { options.put ( each.getPath ( ) , ValidationResult.Option.IGNORE ) ; } assertNothingHasChanged ( preparationResult , options ) ; }

Target:
public void testConsideringOptions ( ) throws java.lang.Exception { com.intellij.updater.Patch patch = createPatch ( ) ; com.intellij.updater.PatchFileCreator.PreparationResult preparationResult = com.intellij.updater.PatchFileCreator.prepareAndValidate ( myFile , myOlderDir , com.intellij.updater.TEST_UI ) ; java.util.Map < java.lang.String , com.intellij.updater.ValidationResult.Option > options = new java.util.HashMap < java.lang.String , com.intellij.updater.ValidationResult.Option > ( ) ; for ( com.intellij.updater.PatchAction each : preparationResult.patch.getActions ( ) ) { options.put ( each.getPath ( ) , ValidationResult.Option.IGNORE ) ; } assertNothingHasChanged ( patch , preparationResult , options ) ; }
Source:
public boolean visit ( org.eclipse.jdt.internal.compiler.ast.TypeDeclaration typeDeclaration , org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope scope ) { org.eclipse.jdt.internal.compiler.ast.Annotation [ ] annotations = typeDeclaration.annotations ; if ( hasRelevantAnnotations ( annotations ) ) { org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding binding = typeDeclaration.binding ; if ( binding == null ) { return true ; } java.lang.String fqn = new java.lang.String ( typeDeclaration.binding.readableName ( ) ) ; com.android.build.gradle.tasks.annotations.Extractor.Item item = com.android.build.gradle.tasks.annotations.Extractor.ClassItem.create ( fqn ) ; addItem ( fqn , item ) ; addAnnotations ( annotations , item ) ; } return true ; }

Target:
public boolean visit ( org.eclipse.jdt.internal.compiler.ast.TypeDeclaration typeDeclaration , org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope scope ) { org.eclipse.jdt.internal.compiler.ast.Annotation [ ] annotations = typeDeclaration.annotations ; if ( hasRelevantAnnotations ( annotations ) ) { org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding binding = typeDeclaration.binding ; if ( binding == null ) { return true ; } java.lang.String fqn = new java.lang.String ( typeDeclaration.binding.readableName ( ) ) ; com.android.build.gradle.tasks.annotations.Extractor.Item item = com.android.build.gradle.tasks.annotations.Extractor.ClassItem.create ( fqn , com.android.build.gradle.tasks.annotations.Extractor.ClassKind.forType ( typeDeclaration ) ) ; addItem ( fqn , item ) ; addAnnotations ( annotations , item ) ; } return true ; }
Source:
private void onCurrentCalls ( int index , int dir , int state , int mparty , java.lang.String number ) { com.android.bluetooth.hfpclient.HeadsetClientStateMachine.StackEvent event = new com.android.bluetooth.hfpclient.HeadsetClientStateMachine.StackEvent ( com.android.bluetooth.hfpclient.HeadsetClientStateMachine.EVENT_TYPE_CURRENT_CALLS ) ; event.valueInt = index ; event.valueInt2 = dir ; event.valueInt3 = state ; event.valueInt4 = mparty ; event.valueString = number ; android.util.Log.d ( com.android.bluetooth.hfpclient.HeadsetClientStateMachine.TAG , ( "incoming " + event ) ) ; sendMessage ( com.android.bluetooth.hfpclient.HeadsetClientStateMachine.STACK_EVENT , event ) ; }

Target:
private void onCurrentCalls ( int index , int dir , int state , int mparty , java.lang.String number ) { com.android.bluetooth.hfpclient.HeadsetClientStateMachine.StackEvent event = new com.android.bluetooth.hfpclient.HeadsetClientStateMachine.StackEvent ( com.android.bluetooth.hfpclient.HeadsetClientStateMachine.EVENT_TYPE_CURRENT_CALLS ) ; event.valueInt = index ; event.valueInt2 = dir ; event.valueInt3 = state ; event.valueInt4 = mparty ; event.valueString = number ; if ( com.android.bluetooth.hfpclient.HeadsetClientStateMachine.DBG ) { android.util.Log.d ( com.android.bluetooth.hfpclient.HeadsetClientStateMachine.TAG , ( "incoming" + event ) ) ; } sendMessage ( com.android.bluetooth.hfpclient.HeadsetClientStateMachine.STACK_EVENT , event ) ; }
Source:
static com.android.bluetooth.a2dp.A2dpStateMachine make ( android.bluetooth.BluetoothDevice device , com.android.bluetooth.a2dp.A2dpService svc , android.content.Context context , com.android.bluetooth.a2dp.A2dpNativeInterface a2dpNativeInterface , android.os.Looper looper ) { if ( com.android.bluetooth.a2dp.A2dpStateMachine.DBG ) { android.util.Log.d ( com.android.bluetooth.a2dp.A2dpStateMachine.TAG , ( "make for device " + device ) ) ; } com.android.bluetooth.a2dp.A2dpStateMachine a2dpSm = new com.android.bluetooth.a2dp.A2dpStateMachine ( device , svc , context , a2dpNativeInterface , looper ) ; a2dpSm.start ( ) ; return a2dpSm ; }

Target:
static com.android.bluetooth.a2dp.A2dpStateMachine make ( android.bluetooth.BluetoothDevice device , com.android.bluetooth.a2dp.A2dpService a2dpService , com.android.bluetooth.a2dp.A2dpNativeInterface a2dpNativeInterface , android.os.Looper looper ) { if ( com.android.bluetooth.a2dp.A2dpStateMachine.DBG ) { android.util.Log.d ( com.android.bluetooth.a2dp.A2dpStateMachine.TAG , ( "make for device " + device ) ) ; } com.android.bluetooth.a2dp.A2dpStateMachine a2dpSm = new com.android.bluetooth.a2dp.A2dpStateMachine ( device , a2dpService , a2dpNativeInterface , looper ) ; a2dpSm.start ( ) ; return a2dpSm ; }
Source:
private static void deleteSubElement ( @ javax.annotation.Nonnull java.io.File dir ) { if ( dir.isDirectory ( ) ) { for ( java.io.File sub : dir.listFiles ( ) ) { com.android.sched.util.file.FileUtils.deleteSubElement ( sub ) ; } } dir.delete ( ) ; }

Target:
private static void deleteSubElement ( @ javax.annotation.Nonnull java.io.File dir ) { if ( dir.isDirectory ( ) ) { java.io.File [ ] fileList = dir.listFiles ( ) ; if ( fileList == null ) { throw new com.android.sched.util.ConcurrentIOException ( new com.android.sched.vfs.ListDirException ( dir ) ) ; } for ( java.io.File sub : fileList ) { com.android.sched.util.file.FileUtils.deleteSubElement ( sub ) ; } } dir.delete ( ) ; }
Source:
public void testAddAll1_IndexOutOfBoundsException ( ) { try { java.util.concurrent.CopyOnWriteArrayList c = new java.util.concurrent.CopyOnWriteArrayList ( ) ; c.addAll ( ( - 1 ) , new java.util.LinkedList ( ) ) ; shouldThrow ( ) ; } catch ( java.lang.IndexOutOfBoundsException success ) { } }

Target:
public void testSet2 ( ) { java.util.concurrent.CopyOnWriteArrayList c = jsr166.CopyOnWriteArrayListTest.populatedArray ( 5 ) ; java.util.List [ ] lists = new java.util.List [ ] { c , c.subList ( 1 , ( ( c.size ( ) ) - 1 ) ) } ; for ( java.util.List list : lists ) { try { list.set ( list.size ( ) , "qwerty" ) ; shouldThrow ( ) ; } catch ( java.lang.IndexOutOfBoundsException success ) { } } }
Source:
public java.util.List < java.io.File > getRenderscriptSourceList ( ) { java.util.List < java.io.File > sourceList = com.google.common.collect.Lists.newArrayList ( ) ; sourceList.addAll ( mDefaultSourceProvider.getRenderscriptDirectories ( ) ) ; if ( ( mType ) != ( com.android.builder.VariantConfiguration.Type.TEST ) ) { sourceList.addAll ( mBuildTypeSourceProvider.getRenderscriptDirectories ( ) ) ; } if ( hasFlavors ( ) ) { for ( com.android.builder.SourceProvider flavorSourceSet : mFlavorSourceProviders ) { sourceList.addAll ( flavorSourceSet.getRenderscriptDirectories ( ) ) ; } } return sourceList ; }

Target:
public java.util.List < java.io.File > getRenderscriptSourceList ( ) { java.util.List < java.io.File > sourceList = com.google.common.collect.Lists.newArrayList ( ) ; sourceList.addAll ( mDefaultSourceProvider.getRenderscriptDirectories ( ) ) ; if ( ( mType ) != ( com.android.builder.VariantConfiguration.Type.TEST ) ) { sourceList.addAll ( mBuildTypeSourceProvider.getRenderscriptDirectories ( ) ) ; } if ( hasFlavors ( ) ) { for ( com.android.builder.model.SourceProvider flavorSourceSet : mFlavorSourceProviders ) { sourceList.addAll ( flavorSourceSet.getRenderscriptDirectories ( ) ) ; } } return sourceList ; }
Source:
public void enable ( java.util.List < ? extends com.google.gct.testing.dimension.CloudTestingType > types , java.lang.Iterable < java.lang.String > ids ) { checkIsEditable ( ) ; java.util.Set < java.lang.String > idsSet = com.google.common.collect.Sets.newHashSet ( ids ) ; for ( com.google.gct.testing.dimension.CloudTestingType type : types ) { if ( idsSet.contains ( type.getId ( ) ) ) { validateType ( type ) ; enableType ( type ) ; } } }

Target:
public void enable ( java.util.List < ? extends com.google.gct.testing.dimension.CloudTestingType > types , java.lang.Iterable < java.lang.String > ids ) { checkIsEditable ( ) ; java.util.Set < java.lang.String > idsSet = com.google.common.collect.Sets.newHashSet ( ids ) ; for ( com.google.gct.testing.dimension.CloudTestingType type : types ) { if ( ( getSupportedDomain ( ) . contains ( type ) ) && ( idsSet.contains ( type.getId ( ) ) ) ) { enableType ( type ) ; } } }
Source:
public void verifyCallbackChannelRetuned ( ) { android.media.tv.cts.TvInputServiceTest.CountingTvInputService.CountingSession session = android.media.tv.cts.TvInputServiceTest.CountingTvInputService.sSession ; assertNotNull ( session ) ; android.net.Uri fakeChannelUri = android.media.tv.TvContract.buildChannelUri ( 0 ) ; session.notifyChannelRetuned ( fakeChannelUri ) ; new android.cts.util.PollingCheck ( android.media.tv.cts.TvInputServiceTest.TIME_OUT ) { @ java.lang.Override protected boolean check ( ) { return ( mCallback.mChannelRetunedCount ) > 0 ; } } . run ( ) ; }

Target:
public void verifyCallbackChannelRetuned ( ) { resetCounts ( ) ; android.media.tv.cts.TvInputServiceTest.CountingTvInputService.CountingSession session = android.media.tv.cts.TvInputServiceTest.CountingTvInputService.sSession ; assertNotNull ( session ) ; android.net.Uri fakeChannelUri = android.media.tv.TvContract.buildChannelUri ( 0 ) ; session.notifyChannelRetuned ( fakeChannelUri ) ; new android.cts.util.PollingCheck ( android.media.tv.cts.TvInputServiceTest.TIME_OUT ) { @ java.lang.Override protected boolean check ( ) { return ( mCallback.mChannelRetunedCount ) > 0 ; } } . run ( ) ; }
Source:
public static java.lang.String stringAddrFromLongAddr ( long addr ) { addr = ( java.lang.Long.reverseBytes ( addr ) ) > > 16 ; java.util.StringJoiner j = new java.util.StringJoiner ( ":" ) ; for ( int i = 0 ; i < ( android.net.MacAddress.ETHER_ADDR_LEN ) ; i ++ ) { j.add ( java.lang.Integer.toHexString ( ( ( byte ) ( addr ) ) ) ) ; addr = addr > > 8 ; } return j.toString ( ) ; }

Target:
public static android.net.MacAddress fromString ( java.lang.String addr ) { return new android.net.MacAddress ( android.net.MacAddress.longAddrFromStringAddr ( addr ) ) ; }
Source:
public void testInstallWithMissingBundleVersionFile ( ) throws java.lang.Exception { java.io.File workingDir = new java.io.File ( testInstallDir , TzDataBundleInstaller.WORKING_DIR_NAME ) ; assertTrue ( workingDir.mkdir ( ) ) ; libcore.tzdata.update2.ConfigBundle tzData = createTzDataBundleWithoutFormatVersionFile ( "2030a" ) ; assertFalse ( install ( tzData ) ) ; assertNoContentInstalled ( ) ; }

Target:
public void testSuccessfulFollowOnUpdate_newerVersion ( ) throws java.lang.Exception { libcore.tzdata.update2.ConfigBundle tzData1 = createValidTzDataBundle ( libcore.tzdata.update2.TzDataBundleInstallerTest.NEW_RULES_VERSION ) ; assertTrue ( installer.install ( tzData1.getBundleBytes ( ) ) ) ; assertTzDataInstalled ( tzData1 ) ; libcore.tzdata.update2.ConfigBundle tzData2 = createValidTzDataBundle ( libcore.tzdata.update2.TzDataBundleInstallerTest.NEWER_RULES_VERSION ) ; assertTrue ( installer.install ( tzData2.getBundleBytes ( ) ) ) ; assertTzDataInstalled ( tzData2 ) ; }
Source:
protected void tearDown ( ) { try { if ( ( zfile ) != null ) { zfile.close ( ) ; } java.io.File f = new java.io.File ( org.apache.harmony.tests.java.util.zip.ZipEntryTest.tempFileName ) ; f.delete ( ) ; } catch ( java.io.IOException e ) { java.lang.System.out.println ( "Exception during tearDown" ) ; } }

Target:
protected void tearDown ( ) { try { if ( ( zfile ) != null ) { zfile.close ( ) ; } } catch ( java.io.IOException ignored ) { } }
Source:
private void copyResource ( java.io.InputStream is , java.io.OutputStream os , java.lang.String name ) throws java.io.IOException { java.io.OutputStream resourceOS = null ; byte [ ] buffer = new byte [ 4096 ] ; int bytesRead ; while ( ( bytesRead = is.read ( buffer ) ) >= 0 ) { os.write ( buffer , 0 , bytesRead ) ; } os.flush ( ) ; }

Target:
private void copyResource ( java.io.InputStream is , java.io.OutputStream os ) throws java.io.IOException { jackLibraryProperties.put ( com.android.jill.frontend.java.JavaTransformer.KEY_RSC , java.lang.String.valueOf ( true ) ) ; java.io.OutputStream resourceOS = null ; byte [ ] buffer = new byte [ 4096 ] ; int bytesRead ; while ( ( bytesRead = is.read ( buffer ) ) >= 0 ) { os.write ( buffer , 0 , bytesRead ) ; } os.flush ( ) ; }
Source:
public void onServiceStateChanged ( android.telephony.ServiceState state ) { if ( DEBUG ) { android.util.Log.d ( mTag , ( ( ( "onServiceStateChanged voiceState=" + ( state.getVoiceRegState ( ) ) ) + " dataState=" ) + ( state.getDataRegState ( ) ) ) ) ; } mServiceState = state ; mDataNetType = state.getDataNetworkType ( ) ; updateTelephony ( ) ; }

Target:
public void onServiceStateChanged ( android.telephony.ServiceState state ) { if ( DEBUG ) { android.util.Log.d ( mTag , ( ( ( "onServiceStateChanged voiceState=" + ( state.getVoiceRegState ( ) ) ) + " dataState=" ) + ( state.getDataRegState ( ) ) ) ) ; } mServiceState = state ; mDataNetType = state.getDataNetworkType ( ) ; if ( ( ( ( mDataNetType ) == ( android.telephony.TelephonyManager.NETWORK_TYPE_LTE ) ) && ( ( mServiceState ) != null ) ) && ( mServiceState.isUsingCarrierAggregation ( ) ) ) { mDataNetType = android.telephony.TelephonyManager.NETWORK_TYPE_LTE_CA ; } updateTelephony ( ) ; }
Source:
private java.net.HttpURLConnection openConnection ( java.net.URL url , com.android.volley.Request < ? > request ) throws java.io.IOException { java.net.HttpURLConnection connection = ( ( java.net.HttpURLConnection ) ( url.openConnection ( ) ) ) ; int timeoutMs = request.getTimeoutMs ( ) ; connection.setConnectTimeout ( timeoutMs ) ; connection.setReadTimeout ( timeoutMs ) ; connection.setUseCaches ( false ) ; connection.setDoInput ( true ) ; return connection ; }

Target:
protected java.net.HttpURLConnection createConnection ( java.net.URL url ) throws java.io.IOException { return ( ( java.net.HttpURLConnection ) ( url.openConnection ( ) ) ) ; }
Source:
private com.android.cts.appsecurity.AppSecurityTests.CollectingTestRunListener doRunTests ( java.lang.String pkgName , java.lang.String testClassName , java.lang.String testMethodName ) { BRANCH ( 0 ) ; com.android.cts.appsecurity.a739d Merge ; com.android.cts.appsecurity.into froyo ; com.android.ddmlib.testrunner.RemoteAndroidTestRunner testRunner = new com.android.ddmlib.testrunner.RemoteAndroidTestRunner ( pkgName , getDevice ( ) ) ; if ( ( testClassName != null ) && ( testMethodName != null ) ) { testRunner.setMethodName ( testClassName , testMethodName ) ; } com.android.cts.appsecurity.AppSecurityTests.CollectingTestRunListener listener = new com.android.cts.appsecurity.AppSecurityTests.CollectingTestRunListener ( ) ; testRunner.run ( listener ) ; return listener ; }

Target:
private com.android.cts.appsecurity.AppSecurityTests.CollectingTestRunListener doRunTests ( java.lang.String pkgName , java.lang.String testClassName , java.lang.String testMethodName ) throws com.android.ddmlib.AdbCommandRejectedException , com.android.ddmlib.ShellCommandUnresponsiveException , com.android.ddmlib.TimeoutException , java.io.IOException { com.android.ddmlib.testrunner.RemoteAndroidTestRunner testRunner = new com.android.ddmlib.testrunner.RemoteAndroidTestRunner ( pkgName , getDevice ( ) ) ; if ( ( testClassName != null ) && ( testMethodName != null ) ) { testRunner.setMethodName ( testClassName , testMethodName ) ; } com.android.cts.appsecurity.AppSecurityTests.CollectingTestRunListener listener = new com.android.cts.appsecurity.AppSecurityTests.CollectingTestRunListener ( ) ; testRunner.run ( listener ) ; return listener ; }
Source:
public void cellInfoList ( int indicationType , java.util.ArrayList < com.android.internal.telephony.V1_0.CellInfo > var2 ) { }

Target:
public void cellInfoList ( int indicationType , java.util.ArrayList < com.android.internal.telephony.V1_0.CellInfo > records ) { mRil.processIndication ( indicationType ) ; java.util.ArrayList < android.telephony.CellInfo > response = com.android.internal.telephony.RIL.responseCellInfoList ( records ) ; if ( RIL.RILJ_LOGD ) mRil.unsljLogRet ( com.android.internal.telephony.RILConstants.RIL_UNSOL_CELL_INFO_LIST , response ) ; mRil.mRilCellInfoListRegistrants.notifyRegistrants ( new android.os.AsyncResult ( null , response , null ) ) ; }
Source:
public void onReceive ( android.content.Context context , android.content.Intent intent ) { java.lang.String action = intent.getAction ( ) ; if ( action.equals ( AppInterface.CAT_CMD_ACTION ) ) { handleCommandMessage ( context , intent ) ; } else if ( action.equals ( AppInterface.CAT_SESSION_END_ACTION ) ) { handleSessionEnd ( context , intent ) ; } }

Target:
public void onReceive ( android.content.Context context , android.content.Intent intent ) { java.lang.String action = intent.getAction ( ) ; if ( action.equals ( AppInterface.CAT_CMD_ACTION ) ) { handleCommandMessage ( context , intent ) ; } else if ( action.equals ( AppInterface.CAT_SESSION_END_ACTION ) ) { handleSessionEnd ( context , intent ) ; } else if ( action.equals ( AppInterface.CAT_ICC_STATUS_CHANGE ) ) { handleCardStatusChange ( context , intent ) ; } }
Source:
public boolean stopFilteringMulticastV6Packets ( ) { return ( ( doBooleanCommand ( "DRIVER RXFILTER-STOP" ) ) && ( doBooleanCommand ( "DRIVER RXFILTER-ADD 3" ) ) ) && ( doBooleanCommand ( "DRIVER RXFILTER-START" ) ) ; }

Target:
public boolean stopFilteringMulticastV6Packets ( ) { if ( com.android.server.wifi.WifiNative.HIDL_SUP_ENABLE ) { return ( ( mSupplicantStaIfaceHal.stopRxFilter ( ) ) && ( mSupplicantStaIfaceHal.addRxFilter ( SupplicantStaIfaceHal.RX_FILTER_TYPE_V6_MULTICAST ) ) ) && ( mSupplicantStaIfaceHal.stopRxFilter ( ) ) ; } else { return ( ( doBooleanCommand ( "DRIVER RXFILTER-STOP" ) ) && ( doBooleanCommand ( "DRIVER RXFILTER-ADD 3" ) ) ) && ( doBooleanCommand ( "DRIVER RXFILTER-START" ) ) ; } }
Source:
public void callSessionMergeComplete ( com.android.ims.internal.IImsCallSession newSession ) { if ( ( mListener ) != null ) { if ( newSession != null ) { com.android.ims.internal.ImsCallSession validActiveSession = this ; try { if ( ! ( java.util.Objects.equals ( miSession.getCallId ( ) , newSession.getCallId ( ) ) ) ) { validActiveSession = new com.android.ims.internal.ImsCallSession ( newSession ) ; } } catch ( android.os.RemoteException rex ) { android.util.Log.e ( com.android.ims.internal.ImsCallSession.TAG , "callSessionMergeComplete: exception for getCallId!" ) ; } mListener.callSessionMergeComplete ( validActiveSession ) ; } else { mListener.callSessionMergeComplete ( null ) ; } } }

Target:
public void callSessionMergeComplete ( com.android.ims.internal.IImsCallSession newSession ) { if ( ( mListener ) != null ) { if ( newSession != null ) { android.telephony.ims.ImsCallSession validActiveSession = this ; try { if ( ! ( java.util.Objects.equals ( miSession.getCallId ( ) , newSession.getCallId ( ) ) ) ) { validActiveSession = new android.telephony.ims.ImsCallSession ( newSession ) ; } } catch ( android.os.RemoteException rex ) { android.util.Log.e ( android.telephony.ims.ImsCallSession.TAG , "callSessionMergeComplete: exception for getCallId!" ) ; } mListener.callSessionMergeComplete ( validActiveSession ) ; } else { mListener.callSessionMergeComplete ( null ) ; } } }
Source:
private boolean needsCoverage ( @ javax.annotation.Nonnull com.android.jack.ir.ast.JDefinedClassOrInterface declaredType ) { if ( declaredType.isExternal ( ) ) { return false ; } if ( declaredType instanceof com.android.jack.ir.ast.JDefinedInterface ) { return false ; } java.lang.String typeName = com.android.jack.coverage.CodeCoverageSelector.formatter.getName ( declaredType ) ; return filter.matches ( typeName ) ; }

Target:
private boolean needsCoverage ( @ javax.annotation.Nonnull com.android.jack.ir.ast.JDefinedClassOrInterface declaredType ) { if ( ! ( declaredType.isToEmit ( ) ) ) { return false ; } if ( declaredType instanceof com.android.jack.ir.ast.JDefinedInterface ) { return false ; } java.lang.String typeName = com.android.jack.coverage.CodeCoverageSelector.formatter.getName ( declaredType ) ; return filter.matches ( typeName ) ; }
Source:
protected void disableService ( ) { if ( ! ( android.autofillservice.cts.Helper.hasAutofillFeature ( ) ) ) return ; android.autofillservice.cts.Helper.disableAutofillService ( android.autofillservice.cts.Helper.getContext ( ) , android.autofillservice.cts.InstrumentedAutoFillService.SERVICE_NAME ) ; android.autofillservice.cts.InstrumentedAutoFillService.setIgnoreUnexpectedRequests ( true ) ; }

Target:
protected void enableService ( ) { if ( android.autofillservice.cts.AutoFillServiceTestCase.isServiceEnabled ( ) ) return ; final android.autofillservice.cts.OneTimeSettingsListener observer = new android.autofillservice.cts.OneTimeSettingsListener ( android.autofillservice.cts.AutoFillServiceTestCase.getContext ( ) , android.provider.Settings.Secure.AUTOFILL_SERVICE ) ; android.autofillservice.cts.Helper.runShellCommand ( "settings put secure %s %s default" , android.provider.Settings.Secure.AUTOFILL_SERVICE , android.autofillservice.cts.AutoFillServiceTestCase.SERVICE_NAME ) ; observer.assertCalled ( ) ; android.autofillservice.cts.AutoFillServiceTestCase.assertServiceEnabled ( ) ; }
Source:
public com.android.sched.vfs.InputVFS checkString ( @ javax.annotation.Nonnull com.android.sched.util.codec.CodecContext context , @ javax.annotation.Nonnull final java.lang.String string ) throws com.android.sched.util.codec.ParsingException { try { com.android.sched.vfs.VFS vfs = new com.android.sched.vfs.DirectFS ( new com.android.sched.util.file.Directory ( context.getWorkingDirectory ( ) , string , context.getRunnableHooks ( ) , com.android.sched.util.file.FileOrDirectory.Existence.MUST_EXIST , com.android.sched.util.file.FileOrDirectory.Permission.READ , change ) , com.android.sched.util.file.FileOrDirectory.Permission.READ ) ; return new com.android.sched.vfs.GenericInputVFS ( vfs ) ; } catch ( java.io.IOException e ) { throw new com.android.sched.util.codec.ParsingException ( e.getMessage ( ) , e ) ; } }

Target:
public com.android.sched.vfs.InputVFS parseString ( @ javax.annotation.Nonnull com.android.sched.util.codec.CodecContext context , @ javax.annotation.Nonnull java.lang.String string ) { try { return checkString ( context , string ) ; } catch ( com.android.sched.util.codec.ParsingException e ) { throw new com.android.sched.util.config.ConfigurationError ( e ) ; } }
Source:
public void run ( ) { try { assertNull ( android.os.Looper.myQueue ( ) ) ; fail ( "should throw exception" ) ; } catch ( java.lang.Throwable e ) { } android.os.Looper.prepare ( ) ; android.os.MessageQueue mq = android.os.Looper.myQueue ( ) ; assertNotNull ( mq ) ; }

Target:
public void run ( ) { boolean didThrow = false ; try { assertNull ( android.os.Looper.myQueue ( ) ) ; } catch ( java.lang.Throwable e ) { didThrow = true ; } if ( ! didThrow ) { fail ( "should throw exception" ) ; } android.os.Looper.prepare ( ) ; android.os.MessageQueue mq = android.os.Looper.myQueue ( ) ; assertNotNull ( mq ) ; }
Source:
public void setFeatureValue ( int feature , int network , int value , com.android.ims.ImsConfigListener listener ) throws android.os.RemoteException { listener.onSetFeatureResponse ( feature , network , value , ImsConfig.OperationStatusConstants.SUCCESS ) ; }

Target:
public void replaceConfig ( com.android.phone.testapps.imstestapp.TestImsConfigImpl.ConfigItem configItem ) { com.android.phone.testapps.imstestapp.TestImsConfigImpl.ConfigItem config = mArrayOfConfigs.stream ( ) . filter ( ( configElem ) -> ( configElem.item ) == ( configItem.item ) ) . findFirst ( ) . orElse ( null ) ; if ( config != null ) { mArrayOfConfigs.remove ( config ) ; } mArrayOfConfigs.add ( configItem ) ; if ( ( mListener ) != null ) { mListener.notifyConfigChanged ( ) ; } }
Source:
public boolean isVisualVoicemailEnabled ( java.lang.String callingPackage , android.telecom.PhoneAccountHandle phoneAccountHandle ) { if ( ! ( canReadPhoneState ( callingPackage , "isVisualVoicemailEnabled" ) ) ) { return false ; } return com.android.phone.settings.VisualVoicemailSettingsUtil.isEnabled ( mPhone.getContext ( ) , phoneAccountHandle ) ; }

Target:
public void sendDialerSpecialCode ( java.lang.String callingPackage , java.lang.String inputCode ) { mAppOps.checkPackage ( android.os.Binder.getCallingUid ( ) , callingPackage ) ; java.lang.String defaultDialer = android.telecom.TelecomManager.from ( mPhone.getContext ( ) ) . getDefaultDialerPackage ( ) ; if ( ! ( android.text.TextUtils.equals ( callingPackage , defaultDialer ) ) ) { enforceCarrierPrivilege ( getDefaultSubscription ( ) ) ; } mPhone.sendDialerSpecialCode ( inputCode ) ; }
Source:
public void timeStringCharArrayCopy ( int reps ) { final int len = arrayLength ; char [ ] dst = new char [ len ] ; java.lang.String str = new java.lang.String ( new char [ len ] ) ; for ( int rep = 0 ; rep < reps ; ++ rep ) { str.getChars ( 0 , len , dst , 0 ) ; } }

Target:
public void timeSystemCharArrayCopy ( int reps ) { final int len = arrayLength ; char [ ] src = new char [ len ] ; char [ ] dst = new char [ len ] ; for ( int rep = 0 ; rep < reps ; ++ rep ) { java.lang.System.arraycopy ( src , 0 , dst , 0 , len ) ; } }
Source:
public static void setUpClassOnlyOnce ( ) throws java.lang.Exception { com.android.bluetooth.hid.HidDeviceTest.sAdapterService = mock ( com.android.bluetooth.btservice.AdapterService.class ) ; java.lang.reflect.Method method = com.android.bluetooth.btservice.AdapterService.class . getDeclaredMethod ( "setAdapterService" , com.android.bluetooth.btservice.AdapterService.class ) ; method.setAccessible ( true ) ; method.invoke ( com.android.bluetooth.hid.HidDeviceTest.sAdapterService , com.android.bluetooth.hid.HidDeviceTest.sAdapterService ) ; com.android.bluetooth.hid.HidDeviceTest.sHidDeviceNativeInterface = mock ( com.android.bluetooth.hid.HidDeviceNativeInterface.class ) ; method = com.android.bluetooth.hid.HidDeviceNativeInterface.class . getDeclaredMethod ( "setInstance" , com.android.bluetooth.hid.HidDeviceNativeInterface.class ) ; method.setAccessible ( true ) ; method.invoke ( null , com.android.bluetooth.hid.HidDeviceTest.sHidDeviceNativeInterface ) ; }

Target:
private static void setHidDeviceNativeInterfaceInstance ( com.android.bluetooth.hid.HidDeviceNativeInterface instance ) throws java.lang.Exception { java.lang.reflect.Method method = com.android.bluetooth.hid.HidDeviceNativeInterface.class . getDeclaredMethod ( "setInstance" , com.android.bluetooth.hid.HidDeviceNativeInterface.class ) ; method.setAccessible ( true ) ; method.invoke ( null , instance ) ; }
Source:
public final java.nio.ShortBuffer asShortBuffer ( ) { if ( ! ( memoryRef.isAccessible ) ) { throw new java.lang.IllegalStateException ( "buffer is inaccessible" ) ; } int off = this . position ( ) ; int lim = this . limit ( ) ; assert off <= lim ; int rem = ( off <= lim ) ? lim - off : 0 ; int size = rem > > 1 ; return new java.nio.ByteBufferAsShortBuffer ( this , ( - 1 ) , 0 , size , size , off , order ( ) ) ; }

Target:
void putShortUnchecked ( int i , short x ) { if ( ! ( memoryRef.isAccessible ) ) { throw new java.lang.IllegalStateException ( "buffer is inaccessible" ) ; } putShort ( ix ( i ) , x ) ; }
Source:
public void testCompile022 ( ) throws java.lang.Exception { java.lang.String packageName = "com.android.jack.switchstatement.test022.jack" ; java.util.Map < java.lang.String , com.android.jack.switchstatement.SwitchstatementTests.VerifierInfo > input = com.google.common.collect.Maps.newHashMap ( ) ; { input.put ( "Switch1" , new com.android.jack.switchstatement.SwitchstatementTests.VerifierInfo ( true ) . specifyInfo ( "java-lang-Thread$State" , true ) ) ; } checkCompiledCode ( packageName , input ) ; }

Target:
public void testCompile022b ( ) throws java.lang.Exception { java.lang.String packageName = "com.android.jack.switchstatement.test022.jack" ; java.util.Map < java.lang.String , com.android.jack.switchstatement.SwitchstatementTests.VerifierInfo > input = com.google.common.collect.Maps.newHashMap ( ) ; input.put ( "Switch1" , new com.android.jack.switchstatement.SwitchstatementTests.VerifierInfo ( true ) . specifyInfo ( "java-lang-Thread$State" , true ) ) ; compileCodeIncremental ( packageName , input ) ; }
Source:
public com.android.tools.lint.detector.api.Location getLocation ( @ com.android.annotations.NonNull com.android.tools.lint.detector.api.XmlContext context , @ com.android.annotations.NonNull org.w3c.dom.Node node , int start , int end ) { com.android.tools.lint.LintCliXmlParser.OffsetPosition pos = ( ( com.android.tools.lint.LintCliXmlParser.OffsetPosition ) ( getPosition ( node , start , end ) ) ) ; if ( pos != null ) { return com.android.tools.lint.detector.api.Location.create ( context.file , pos , ( ( com.android.tools.lint.LintCliXmlParser.OffsetPosition ) ( pos.getEnd ( ) ) ) ) ; } return com.android.tools.lint.detector.api.Location.create ( context.file ) ; }

Target:
public com.android.tools.lint.detector.api.Location getLocation ( @ com.android.annotations.NonNull com.android.tools.lint.detector.api.XmlContext context , @ com.android.annotations.NonNull org.w3c.dom.Node node ) { com.android.tools.lint.LintCliXmlParser.OffsetPosition pos = ( ( com.android.tools.lint.LintCliXmlParser.OffsetPosition ) ( mParser.getPosition ( node , ( - 1 ) , ( - 1 ) ) ) ) ; if ( pos != null ) { return com.android.tools.lint.detector.api.Location.create ( context.file , pos , ( ( com.android.tools.lint.LintCliXmlParser.OffsetPosition ) ( pos.getEnd ( ) ) ) ) ; } return com.android.tools.lint.detector.api.Location.create ( context.file ) ; }
Source:
private com.android.layoutlib.api.LayoutScene convertToScene ( com.android.layoutlib.api.ILayoutResult result ) { com.android.layoutlib.api.SceneResult sceneResult ; com.android.layoutlib.api.ViewInfo rootViewInfo ; if ( ( result.getSuccess ( ) ) == ( com.android.layoutlib.api.ILayoutResult.SUCCESS ) ) { sceneResult = com.android.layoutlib.api.SceneResult.SUCCESS ; rootViewInfo = convertToViewInfo ( result.getRootView ( ) ) ; } else { sceneResult = new com.android.layoutlib.api.SceneResult ( result.getErrorMessage ( ) ) ; rootViewInfo = null ; } return new com.android.ide.common.layoutlib.BasicLayoutScene ( sceneResult , rootViewInfo , result.getImage ( ) ) ; }

Target:
private com.android.layoutlib.api.LayoutScene convertToScene ( com.android.layoutlib.api.ILayoutResult result ) { com.android.layoutlib.api.SceneResult sceneResult ; com.android.layoutlib.api.ViewInfo rootViewInfo ; if ( ( result.getSuccess ( ) ) == ( com.android.layoutlib.api.ILayoutResult.SUCCESS ) ) { sceneResult = SceneStatus.SUCCESS.getResult ( ) ; rootViewInfo = convertToViewInfo ( result.getRootView ( ) ) ; } else { sceneResult = new com.android.layoutlib.api.SceneResult ( com.android.layoutlib.api.SceneResult.SceneStatus.ERROR_UNKNOWN , result.getErrorMessage ( ) ) ; rootViewInfo = null ; } return new com.android.ide.common.layoutlib.BasicLayoutScene ( sceneResult , rootViewInfo , result.getImage ( ) ) ; }
Source:
public void testRunFailed ( java.lang.String errorMessage ) { }

Target:
private void runAndVerify ( java.lang.String expectedCmd ) throws java.lang.Exception { mMockDevice.executeShellCommand ( expectedCmd , ( ( com.android.ddmlib.IShellOutputReceiver ) ( org.easymock.EasyMock.anyObject ( ) ) ) , org.easymock.EasyMock.eq ( 0 ) ) ; org.easymock.EasyMock.replay ( mMockDevice ) ; mRunner.run ( mMockListener ) ; org.easymock.EasyMock.verify ( mMockDevice ) ; }
Source:
public void testEndCallWithRingingForegroundCall ( ) throws java.lang.Exception { com.android.server.telecom.Call call = org.mockito.Mockito.mock ( com.android.server.telecom.Call.class ) ; org.mockito.Mockito.when ( call.getState ( ) ) . thenReturn ( CallState.RINGING ) ; org.mockito.Mockito.when ( mFakeCallsManager.getForegroundCall ( ) ) . thenReturn ( call ) ; org.junit.Assert.assertTrue ( mTSIBinder.endCall ( null ) ) ; org.mockito.Mockito.verify ( call ) . reject ( false , null ) ; }

Target:
public void testEndCallWithNoForegroundCall ( ) throws java.lang.Exception { com.android.server.telecom.Call call = org.mockito.Mockito.mock ( com.android.server.telecom.Call.class ) ; org.mockito.Mockito.when ( call.getState ( ) ) . thenReturn ( CallState.ACTIVE ) ; org.mockito.Mockito.when ( mFakeCallsManager.getFirstCallWithState ( org.mockito.Matchers.any ( ) ) ) . thenReturn ( call ) ; org.junit.Assert.assertTrue ( mTSIBinder.endCall ( com.android.server.telecom.tests.TelecomServiceImplTest.TEST_PACKAGE ) ) ; org.mockito.Mockito.verify ( call ) . disconnect ( org.mockito.Matchers.eq ( 0L ) , org.mockito.Matchers.eq ( com.android.server.telecom.tests.TelecomServiceImplTest.TEST_PACKAGE ) ) ; }
Source:
public void testGradleOverrides ( ) throws java.lang.Exception { mEnabled = java.util.Collections.singleton ( ManifestDetector.GRADLE_OVERRIDES ) ; assertEquals ( ( "" + ( ( ( ( ( ( ( ( ( ( ( ( "AndroidManifest.xml:4: Warning: This versionCode value (1) is not used; it is always overridden by the value specified in the Gradle build script (2) [GradleOverrides]\n" + " android:versionCode=\"1\"\n" ) + " ~~~~~~~~~~~~~~~~~~~~~~~\n" ) + "AndroidManifest.xml:5: Warning: This versionName value (1.0) is not used; it is always overridden by the value specified in the Gradle build script (MyName) [GradleOverrides]\n" ) + " android:versionName=\"1.0\" >\n" ) + " ~~~~~~~~~~~~~~~~~~~~~~~~~\n" ) + "AndroidManifest.xml:7: Warning: This minSdkVersion value (14) is not used; it is always overridden by the value specified in the Gradle build script (5) [GradleOverrides]\n" ) + " <uses-sdk android:minSdkVersion=\"14\" android:targetSdkVersion=\"17\" />\n" ) + " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ) + "AndroidManifest.xml:7: Warning: This targetSdkVersion value (17) is not used; it is always overridden by the value specified in the Gradle build script (16) [GradleOverrides]\n" ) + " <uses-sdk android:minSdkVersion=\"14\" android:targetSdkVersion=\"17\" />\n" ) + " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ) + "0 errors, 4 warnings\n" ) ) , lintProject ( "gradle_override.xml=>AndroidManifest.xml" , "multiproject/library.properties=>build.gradle" ) ) ; }

Target:
public void testGradleOverrides ( ) throws java.lang.Exception { mEnabled = java.util.Collections.singleton ( ManifestDetector.GRADLE_OVERRIDES ) ; assertEquals ( ( "" + ( ( ( ( ( ( ( ( ( ( ( ( "AndroidManifest.xml:4: Warning: This versionCode value (1) is not used; it is always overridden by the value specified in the Gradle build script (2) [GradleOverrides]\n" + " android:versionCode=\"1\"\n" ) + " ~~~~~~~~~~~~~~~~~~~~~~~\n" ) + "AndroidManifest.xml:5: Warning: This versionName value (1.0) is not used; it is always overridden by the value specified in the Gradle build script (MyName) [GradleOverrides]\n" ) + " android:versionName=\"1.0\" >\n" ) + " ~~~~~~~~~~~~~~~~~~~~~~~~~\n" ) + "AndroidManifest.xml:7: Warning: This minSdkVersion value (14) is not used; it is always overridden by the value specified in the Gradle build script (5) [GradleOverrides]\n" ) + " <uses-sdk android:minSdkVersion=\"14\" android:targetSdkVersion=\"17\" />\n" ) + " ~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ) + "AndroidManifest.xml:7: Warning: This targetSdkVersion value (17) is not used; it is always overridden by the value specified in the Gradle build script (16) [GradleOverrides]\n" ) + " <uses-sdk android:minSdkVersion=\"14\" android:targetSdkVersion=\"17\" />\n" ) + " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" ) + "0 errors, 4 warnings\n" ) ) , lintProject ( "gradle_override.xml=>AndroidManifest.xml" , "multiproject/library.properties=>build.gradle" ) ) ; }
Source:
protected void networkStatus ( int status ) { if ( status == ( android.net.NetworkAgent.INVALID_NETWORK ) ) { if ( com.android.server.wifi.WifiStateMachine.DBG ) log ( ( "WifiNetworkAgent -> Wifi networkStatus invalid score " + ( java.lang.Integer.toString ( mWifiInfo.score ) ) ) ) ; unwantedNetwork ( com.android.server.wifi.WifiStateMachine.network_status_unwanted_disable_autojoin ) ; } }

Target:
protected void networkStatus ( int status , java.lang.String redirectUrl ) { if ( ( this ) != ( mNetworkAgent ) ) return ; if ( status == ( android.net.NetworkAgent.INVALID_NETWORK ) ) { if ( mVerboseLoggingEnabled ) { log ( ( "WifiNetworkAgent -> Wifi networkStatus invalid, score=" + ( java.lang.Integer.toString ( mWifiInfo.score ) ) ) ) ; } unwantedNetwork ( com.android.server.wifi.WifiStateMachine.NETWORK_STATUS_UNWANTED_VALIDATION_FAILED ) ; } else if ( status == ( android.net.NetworkAgent.VALID_NETWORK ) ) { if ( mVerboseLoggingEnabled ) { log ( ( "WifiNetworkAgent -> Wifi networkStatus valid, score= " + ( java.lang.Integer.toString ( mWifiInfo.score ) ) ) ) ; } doNetworkStatus ( status ) ; } }
Source:
private static boolean isBooleanField ( java.lang.reflect.Field field , com.google.devtools.common.options.Converter < ? > converter ) { return ( ( field.getType ( ) . equals ( boolean . class ) ) || ( field.getType ( ) . equals ( com.google.devtools.common.options.TriState.class ) ) ) || ( converter instanceof com.google.devtools.common.options.BoolOrEnumConverter ) ; }

Target:
private static com.google.common.collect.ImmutableList < com.google.devtools.common.options.OptionDefinition > getAllOptionDefinitionsSorted ( java.lang.Class < ? extends com.google.devtools.common.options.OptionsBase > optionsClass ) { return java.util.Arrays.stream ( optionsClass.getFields ( ) ) . map ( ( field ) -> { try { return com.google.devtools.common.options.OptionDefinition.extractOptionDefinition ( field ) ; } catch ( com.google.devtools.common.options.OptionsParser.ConstructionException e ) { return null ; } } ) . filter ( java.util.Objects :: nonNull ) . sorted ( OptionDefinition.BY_OPTION_NAME ) . collect ( com.google.common.collect.ImmutableList.toImmutableList ( com.google.common.collect.ImmutableList ) ) ; }
Source:
public void setUseColor ( boolean useColor , int passColor , int warnColor , int failColor ) { this . useColor = useColor ; vogar.Console.Color.PASS.setCode ( passColor ) ; vogar.Console.Color.WARN.setCode ( warnColor ) ; vogar.Console.Color.FAIL.setCode ( failColor ) ; vogar.Console.Color.COMMENT.setCode ( 34 ) ; }

Target:
public void setUseColor ( boolean useColor , int passColor , int skipColor , int failColor , int warnColor ) { this . useColor = useColor ; vogar.Console.Color.PASS.setCode ( passColor ) ; vogar.Console.Color.SKIP.setCode ( skipColor ) ; vogar.Console.Color.FAIL.setCode ( failColor ) ; vogar.Console.Color.WARN.setCode ( warnColor ) ; vogar.Console.Color.COMMENT.setCode ( 34 ) ; }
Source:
private void handleSuccessfulIpConfiguration ( ) { mLastSignalLevel = - 1 ; com.android.server.wifi.WifiConfiguration c = getCurrentWifiConfiguration ( ) ; if ( c != null ) { c.numConnectionFailures = 0 ; } if ( c != null ) { com.android.server.wifi.ScanResult result = getCurrentScanResult ( ) ; if ( result == null ) { loge ( ( "WifiStateMachine: handleSuccessfulIpConfiguration and no scan results" + ( c.configKey ( ) ) ) ) ; } else { result.numIpConfigFailures = 0 ; mWifiNative.clearBlacklist ( ) ; } } }

Target:
void registerConnected ( ) { if ( ( mLastNetworkId ) != ( android.net.wifi.WifiConfiguration.INVALID_NETWORK_ID ) ) { mWifiConfigManager.updateNetworkAfterConnect ( mLastNetworkId ) ; mWifiScoreReport.reset ( ) ; } }