auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private com.android.dex.Dex mergeDexes ( ) throws java.io.IOException { mergeStringIds ( ) ; mergeTypeIds ( ) ; mergeTypeLists ( ) ; mergeProtoIds ( ) ; mergeFieldIds ( ) ; mergeMethodIds ( ) ; mergeAnnotations ( ) ; unionAnnotationSetsAndDirectories ( ) ; mergeClassDefs ( ) ; contentsOut.header.off = 0 ; contentsOut.header.size = 1 ; contentsOut.fileSize = dexOut.getLength ( ) ; contentsOut.computeSizesFromOffsets ( ) ; contentsOut.writeHeader ( headerOut ) ; contentsOut.writeMap ( mapListOut ) ; dexOut.writeHashes ( ) ; return dexOut ; }

Target:
private com.android.dex.Dex mergeDexes ( ) throws java.io.IOException { mergeStringIds ( ) ; mergeTypeIds ( ) ; mergeTypeLists ( ) ; mergeProtoIds ( ) ; mergeFieldIds ( ) ; mergeMethodIds ( ) ; mergeAnnotations ( ) ; unionAnnotationSetsAndDirectories ( ) ; mergeClassDefs ( ) ; contentsOut.header.off = 0 ; contentsOut.header.size = 1 ; contentsOut.fileSize = dexOut.getLength ( ) ; contentsOut.computeSizesFromOffsets ( ) ; contentsOut.writeHeader ( headerOut , mergeApiLevels ( ) ) ; contentsOut.writeMap ( mapListOut ) ; dexOut.writeHashes ( ) ; return dexOut ; }
Source:
private java.util.Map < java.lang.String , java.lang.String > getFilesByNameEntryFilter ( java.util.List < java.lang.String > folders , java.lang.String filter ) { java.util.Map < java.lang.String , java.lang.String > sourceFiles = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; for ( java.lang.String folder : folders ) { java.util.Iterator < ? > iterator = getFilesByNameEntryFilter ( folder , filter ) ; while ( iterator.hasNext ( ) ) { sourceFiles.put ( iterator.next ( ) . toString ( ) , folder ) ; } } return sourceFiles ; }

Target:
private java.util.Map < java.lang.String , java.lang.String > getFilesByNameEntryFilter ( java.util.List < java.lang.String > folders , java.lang.String [ ] filters ) { java.util.Map < java.lang.String , java.lang.String > sourceFiles = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; for ( java.lang.String folder : folders ) { java.util.Iterator < ? > iterator = getFilesByNameEntryFilter ( folder , filters ) ; while ( iterator.hasNext ( ) ) { sourceFiles.put ( iterator.next ( ) . toString ( ) , folder ) ; } } return sourceFiles ; }
Source:
public void exit ( ) { if ( ( mPhone ) != null ) { mPhone.mCi.unregisterForRilConnected ( getHandler ( ) ) ; mPhone.mCi.unregisterForDataCallListChanged ( getHandler ( ) ) ; } if ( ( mDcTesterDeactivateAll ) != null ) { mDcTesterDeactivateAll.dispose ( ) ; } if ( ( mNetworkPolicyManager ) != null ) { mNetworkPolicyManager.unregisterListener ( mListener ) ; } }

Target:
public void enter ( ) { if ( ( ( mPhone ) != null ) && ( ( mDataServiceManager.getTransportType ( ) ) == ( android.telephony.AccessNetworkConstants.TransportType.WWAN ) ) ) { mPhone.mCi.registerForRilConnected ( getHandler ( ) , DataConnection.EVENT_RIL_CONNECTED , null ) ; } mDataServiceManager.registerForDataCallListChanged ( getHandler ( ) , DataConnection.EVENT_DATA_STATE_CHANGED ) ; if ( ( mNetworkPolicyManager ) != null ) { mNetworkPolicyManager.registerListener ( mListener ) ; } }
Source:
public static void closeDrawer ( int drawerLayoutId , int gravity ) { if ( android.support.test.espresso.contrib.DrawerActions.checkDrawer ( drawerLayoutId , android.support.test.espresso.contrib.DrawerMatchers.isClosed ( gravity ) ) ) { return ; } android.support.test.espresso.Espresso.onView ( android.support.test.espresso.matcher.ViewMatchers.withId ( drawerLayoutId ) ) . perform ( android.support.test.espresso.contrib.DrawerActions.registerListener ( ) ) . perform ( android.support.test.espresso.contrib.DrawerActions.actionCloseDrawer ( gravity ) ) . perform ( android.support.test.espresso.contrib.DrawerActions.unregisterListener ( ) ) ; }

Target:
public static android.support.test.espresso.ViewAction open ( ) { return android.support.test.espresso.contrib.DrawerActions.open ( GravityCompat.START ) ; }
Source:
protected void onCreate ( android.os.Bundle icicle ) { super . onCreate ( icicle ) ; addPreferencesFromResource ( R.xml.gsm_umts_options ) ; }

Target:
protected void onCreate ( android.os.Bundle icicle ) { super . onCreate ( icicle ) ; addPreferencesFromResource ( R.xml.gsm_umts_options ) ; android.preference.PreferenceScreen prefSet = getPreferenceScreen ( ) ; mButtonAPNExpand = ( ( android.preference.PreferenceScreen ) ( prefSet.findPreference ( com.android.phone.GsmUmtsOptions.BUTTON_APN_EXPAND_KEY ) ) ) ; mButtonOperatorSelectionExpand = ( ( android.preference.PreferenceScreen ) ( prefSet.findPreference ( com.android.phone.GsmUmtsOptions.BUTTON_OPERATOR_SELECTION_EXPAND_KEY ) ) ) ; if ( com.android.internal.telephony.PhoneFactory.getDefaultPhone ( ) . getPhoneName ( ) . equals ( "CDMA" ) ) { mButtonAPNExpand.setEnabled ( false ) ; mButtonOperatorSelectionExpand.setEnabled ( false ) ; } }
Source:
public void testIpReachabilityEventSerialization ( ) { android.net.ConnectivityMetricsEvent ev = com.android.server.connectivity.MetricsTestUtil.describeIpEvent ( com.android.server.connectivity.MetricsTestUtil.aType ( android.net.metrics.IpReachabilityEvent.class ) , com.android.server.connectivity.MetricsTestUtil.aString ( "wlan0" ) , com.android.server.connectivity.MetricsTestUtil.anInt ( IpReachabilityEvent.NUD_FAILED ) ) ; java.lang.String want = com.android.server.connectivity.IpConnectivityEventBuilderTest.joinLines ( "dropped_events: 0" , "events <" , " ip_reachability_event <" , " event_type: 512" , " if_name: \"wlan0\"" , " >" , " time_ms: 1" , ">" ) ; com.android.server.connectivity.IpConnectivityEventBuilderTest.verifySerialization ( want , ev ) ; }

Target:
public void testIpReachabilityEventSerialization ( ) { android.net.ConnectivityMetricsEvent ev = com.android.server.connectivity.MetricsTestUtil.describeIpEvent ( com.android.server.connectivity.MetricsTestUtil.aType ( android.net.metrics.IpReachabilityEvent.class ) , com.android.server.connectivity.MetricsTestUtil.aString ( "wlan0" ) , com.android.server.connectivity.MetricsTestUtil.anInt ( IpReachabilityEvent.NUD_FAILED ) ) ; java.lang.String want = com.android.server.connectivity.IpConnectivityEventBuilderTest.joinLines ( "dropped_events: 0" , "events <" , " ip_reachability_event <" , " event_type: 512" , " if_name: \"wlan0\"" , " >" , " time_ms: 1" , ">" , "version: 2" ) ; com.android.server.connectivity.IpConnectivityEventBuilderTest.verifySerialization ( want , ev ) ; }
Source:
public void updateAggregateData ( long contactId ) { if ( ! ( mEnabled ) ) { return ; } final android.database.sqlite.SQLiteDatabase db = mDbHelper.getWritableDatabase ( ) ; computeAggregateData ( db , contactId , mContactUpdate ) ; mContactUpdate.bindLong ( com.android.providers.contacts.ContactAggregator.ContactReplaceSqlStatement.CONTACT_ID , contactId ) ; mContactUpdate.execute ( ) ; mDbHelper.updateContactVisible ( contactId ) ; updateAggregatedPresence ( contactId ) ; }

Target:
public void updateAggregateData ( com.android.providers.contacts.TransactionContext txContext , long contactId ) { if ( ! ( mEnabled ) ) { return ; } final android.database.sqlite.SQLiteDatabase db = mDbHelper.getWritableDatabase ( ) ; computeAggregateData ( db , contactId , mContactUpdate ) ; mContactUpdate.bindLong ( com.android.providers.contacts.ContactAggregator.ContactReplaceSqlStatement.CONTACT_ID , contactId ) ; mContactUpdate.execute ( ) ; mDbHelper.updateContactVisible ( txContext , contactId ) ; updateAggregatedStatusUpdate ( contactId ) ; }
Source:
private boolean isUserMobileDataEnabled ( int subId ) { boolean retVal = false ; try { com.android.internal.telephony.ITelephony telephony = getITelephony ( ) ; if ( telephony != null ) retVal = telephony.isUserDataEnabled ( subId ) ; } catch ( android.os.RemoteException e ) { android.util.Log.e ( android.telephony.TelephonyManager.TAG , "Error calling ITelephony#isUserDataEnabled" , e ) ; } catch ( java.lang.NullPointerException e ) { } return retVal ; }

Target:
public boolean getDataEnabled ( int subId ) { boolean retVal = false ; try { com.android.internal.telephony.ITelephony telephony = getITelephony ( ) ; if ( telephony != null ) retVal = telephony.isUserDataEnabled ( subId ) ; } catch ( android.os.RemoteException e ) { android.util.Log.e ( android.telephony.TelephonyManager.TAG , "Error calling ITelephony#isUserDataEnabled" , e ) ; } catch ( java.lang.NullPointerException e ) { } return retVal ; }
Source:
public static java.lang.Iterable < java.lang.Object [ ] > data ( ) throws java.io.IOException , javax.xml.parsers.ParserConfigurationException , org.xml.sax.SAXException { java.util.List < java.lang.Object [ ] > params = new java.util.ArrayList < > ( ) ; com.android.graphics.benchmark.ApkListXmlParser parser = new com.android.graphics.benchmark.ApkListXmlParser ( ) ; java.util.List < com.android.graphics.benchmark.ApkInfo > apks = parser.parse ( new java.io.File ( com.android.graphics.benchmark.ApkInfo.APK_LIST_LOCATION ) ) ; for ( com.android.graphics.benchmark.ApkInfo apk : apks ) { params.add ( new java.lang.Object [ ] { apk.getName ( ) , apk } ) ; } return params ; }

Target:
public static java.lang.Iterable < java.lang.Object [ ] > data ( ) throws java.io.IOException , javax.xml.parsers.ParserConfigurationException , org.xml.sax.SAXException { java.util.List < java.lang.Object [ ] > params = new java.util.ArrayList < > ( ) ; com.android.game.qualification.ApkListXmlParser parser = new com.android.game.qualification.ApkListXmlParser ( ) ; java.util.List < com.android.game.qualification.ApkInfo > apks = parser.parse ( new java.io.File ( com.android.game.qualification.ApkInfo.APK_LIST_LOCATION ) ) ; for ( com.android.game.qualification.ApkInfo apk : apks ) { params.add ( new java.lang.Object [ ] { apk.getName ( ) , apk } ) ; } return params ; }
Source:
public boolean connect ( android.bluetooth.BluetoothDevice device ) { com.android.bluetooth.pbap.BluetoothPbapService service = getService ( com.android.bluetooth.pbap.BluetoothPbapService.BLUETOOTH_ADMIN_PERM ) ; return false ; }

Target:
public java.util.List < android.bluetooth.BluetoothDevice > getDevicesMatchingConnectionStates ( int [ ] states ) { if ( com.android.bluetooth.pbap.BluetoothPbapService.DEBUG ) { android.util.Log.d ( com.android.bluetooth.pbap.BluetoothPbapService.TAG , "getDevicesMatchingConnectionStates" ) ; } com.android.bluetooth.pbap.BluetoothPbapService service = getService ( ) ; if ( service == null ) { return new java.util.ArrayList < > ( 0 ) ; } return service.getDevicesMatchingConnectionStates ( states ) ; }
Source:
public void testAcceptRingingCallWithValidVideoState ( ) throws java.lang.Exception { com.android.server.telecom.Call call = org.mockito.Mockito.mock ( com.android.server.telecom.Call.class ) ; org.mockito.Mockito.when ( mFakeCallsManager.getFirstCallWithState ( org.mockito.Matchers.any ( int [ ] . class ) ) ) . thenReturn ( call ) ; int fakeVideoState = 29578215 ; int realVideoState = ( android.telecom.VideoProfile.STATE_RX_ENABLED ) | ( android.telecom.VideoProfile.STATE_TX_ENABLED ) ; org.mockito.Mockito.when ( call.getVideoState ( ) ) . thenReturn ( fakeVideoState ) ; mTSIBinder.acceptRingingCallWithVideoState ( realVideoState ) ; org.mockito.Mockito.verify ( call ) . answer ( realVideoState ) ; }

Target:
public void testAcceptRingingCallWithValidVideoState ( ) throws java.lang.Exception { com.android.server.telecom.Call call = org.mockito.Mockito.mock ( com.android.server.telecom.Call.class ) ; org.mockito.Mockito.when ( mFakeCallsManager.getFirstCallWithState ( org.mockito.Matchers.anyInt ( ) ) ) . thenReturn ( call ) ; int fakeVideoState = 29578215 ; int realVideoState = ( android.telecom.VideoProfile.STATE_RX_ENABLED ) | ( android.telecom.VideoProfile.STATE_TX_ENABLED ) ; org.mockito.Mockito.when ( call.getVideoState ( ) ) . thenReturn ( fakeVideoState ) ; mTSIBinder.acceptRingingCallWithVideoState ( realVideoState ) ; org.mockito.Mockito.verify ( call ) . answer ( realVideoState ) ; }
Source:
public void snapshotRuntimeProfile ( @ android.annotation.NonNull java.lang.String packageName , @ android.annotation.NonNull java.lang.String codePath , @ android.annotation.NonNull android.content.pm.dex.ArtManager.SnapshotRuntimeProfileCallback callback , @ android.annotation.NonNull android.os.Handler handler ) { android.util.Slog.d ( android.content.pm.dex.ArtManager.TAG , ( ( ( "Requesting profile snapshot for " + packageName ) + ":" ) + codePath ) ) ; android.content.pm.dex.ArtManager.SnapshotRuntimeProfileCallbackDelegate delegate = new android.content.pm.dex.ArtManager.SnapshotRuntimeProfileCallbackDelegate ( callback , handler.getLooper ( ) ) ; try { mArtManager.snapshotRuntimeProfile ( packageName , codePath , delegate ) ; } catch ( android.os.RemoteException e ) { e.rethrowAsRuntimeException ( ) ; } }

Target:
public boolean isRuntimeProfilingEnabled ( @ android.content.pm.dex.ArtManager.ProfileType int profileType ) { try { return mArtManager.isRuntimeProfilingEnabled ( profileType ) ; } catch ( android.os.RemoteException e ) { e.rethrowAsRuntimeException ( ) ; } return false ; }
Source:
public boolean onCreate ( ) { android.util.Log.d ( com.android.providers.telephony.CarrierIdProvider.TAG , "onCreate" ) ; mDbHelper = new com.android.providers.telephony.CarrierIdProvider.CarrierIdDatabaseHelper ( getContext ( ) ) ; mDbHelper.getReadableDatabase ( ) ; com.android.providers.telephony.CarrierIdProvider.s_urlMatcher.addURI ( com.android.providers.telephony.CarrierIdProvider.AUTHORITY , "update_db" , com.android.providers.telephony.CarrierIdProvider.URL_UPDATE_FROM_PB ) ; initDatabaseFromPb ( mDbHelper.getWritableDatabase ( ) ) ; return true ; }

Target:
public boolean onCreate ( ) { android.util.Log.d ( com.android.providers.telephony.CarrierIdProvider.TAG , "onCreate" ) ; mDbHelper = new com.android.providers.telephony.CarrierIdProvider.CarrierIdDatabaseHelper ( getContext ( ) ) ; mDbHelper.getReadableDatabase ( ) ; com.android.providers.telephony.CarrierIdProvider.s_urlMatcher.addURI ( com.android.providers.telephony.CarrierIdProvider.AUTHORITY , "update_db" , com.android.providers.telephony.CarrierIdProvider.URL_UPDATE_FROM_PB ) ; com.android.providers.telephony.CarrierIdProvider.s_urlMatcher.addURI ( com.android.providers.telephony.CarrierIdProvider.AUTHORITY , "get_version" , com.android.providers.telephony.CarrierIdProvider.URL_GET_VERSION ) ; initDatabaseFromPb ( mDbHelper.getWritableDatabase ( ) ) ; return true ; }
Source:
private java.io.File createEmptyLibrary ( ) throws java.io.IOException , java.lang.Exception { com.android.jack.test.toolchain.AndroidToolchain toolchain = com.android.jack.test.toolchain.AbstractTestTools.getCandidateToolchain ( com.android.jack.test.toolchain.AndroidToolchain.class ) ; java.io.File emptyLib = com.android.jack.test.toolchain.AbstractTestTools.createTempFile ( "empty" , toolchain.getLibraryExtension ( ) ) ; toolchain.srcToLib ( emptyLib , true ) ; return emptyLib ; }

Target:
private java.io.File createEmptyLibrary ( ) throws java.io.IOException , java.lang.Exception { java.util.List < java.lang.Class < ? extends com.android.jack.test.toolchain.IToolchain > > excludeList = new java.util.ArrayList < java.lang.Class < ? extends com.android.jack.test.toolchain.IToolchain > > ( 1 ) ; excludeList.add ( com.android.jack.test.toolchain.LegacyToolchain.class ) ; com.android.jack.test.toolchain.AndroidToolchain toolchain = com.android.jack.test.toolchain.AbstractTestTools.getCandidateToolchain ( com.android.jack.test.toolchain.AndroidToolchain.class , excludeList ) ; java.io.File emptyLib = com.android.jack.test.toolchain.AbstractTestTools.createTempFile ( "empty" , toolchain.getLibraryExtension ( ) ) ; toolchain.srcToLib ( emptyLib , true ) ; return emptyLib ; }
Source:
public boolean visit ( org.eclipse.jdt.internal.compiler.ast.TryStatement x , org.eclipse.jdt.internal.compiler.lookup.BlockScope scope ) { try { if ( ( x.catchBlocks ) != null ) { for ( org.eclipse.jdt.internal.compiler.ast.Argument argument : x.catchArguments ) { createLocal ( argument ) ; } } return true ; } catch ( java.lang.RuntimeException e ) { throw translateException ( x , e ) ; } }

Target:
public boolean visit ( org.eclipse.jdt.internal.compiler.ast.TryStatement x , org.eclipse.jdt.internal.compiler.lookup.BlockScope scope ) { try { if ( ( x.catchBlocks ) != null ) { for ( org.eclipse.jdt.internal.compiler.ast.Argument argument : x.catchArguments ) { createLocal ( argument ) ; } } return true ; } catch ( com.android.jack.ir.ast.JTypeLookupException e ) { throw translateException ( x , e ) ; } catch ( java.lang.RuntimeException e ) { throw translateException ( x , e ) ; } }
Source:
private void removeDeletedSchedules ( com.android.tv.dvr.ScheduledRecording ... addedSchedules ) { java.util.List < com.android.tv.dvr.ScheduledRecording > schedulesToDelete = new java.util.ArrayList < > ( ) ; for ( com.android.tv.dvr.ScheduledRecording r : addedSchedules ) { com.android.tv.dvr.ScheduledRecording deleted = getDeletedScheduleMap ( ) . remove ( r.getProgramId ( ) ) ; if ( deleted != null ) { schedulesToDelete.add ( deleted ) ; } } if ( ! ( schedulesToDelete.isEmpty ( ) ) ) { new com.android.tv.dvr.provider.AsyncDvrDbTask.AsyncDeleteScheduleTask ( mContext ) . executeOnDbThread ( com.android.tv.dvr.ScheduledRecording.toArray ( schedulesToDelete ) ) ; } }

Target:
private void removeDeletedSchedules ( com.android.tv.dvr.data.ScheduledRecording ... addedSchedules ) { java.util.List < com.android.tv.dvr.data.ScheduledRecording > schedulesToDelete = new java.util.ArrayList < > ( ) ; for ( com.android.tv.dvr.data.ScheduledRecording r : addedSchedules ) { com.android.tv.dvr.data.ScheduledRecording deleted = getDeletedScheduleMap ( ) . remove ( r.getProgramId ( ) ) ; if ( deleted != null ) { schedulesToDelete.add ( deleted ) ; } } if ( ! ( schedulesToDelete.isEmpty ( ) ) ) { new com.android.tv.dvr.provider.AsyncDvrDbTask.AsyncDeleteScheduleTask ( mContext ) . executeOnDbThread ( com.android.tv.dvr.data.ScheduledRecording.toArray ( schedulesToDelete ) ) ; } }
Source:
public com.android.tools.lint.client.api.JavaParser.ResolvedAnnotation getAnnotation ( @ com.android.annotations.NonNull com.android.tools.lint.client.api.JavaParser.ResolvedMethod method , int parameterIndex , @ com.android.annotations.NonNull java.lang.String type ) { com.android.tools.lint.ExternalAnnotationRepository.MethodInfo m = findMethod ( method ) ; if ( m == null ) { return null ; } if ( ( m.parameterAnnotations ) != null ) { java.util.Collection < com.android.tools.lint.client.api.JavaParser.ResolvedAnnotation > annotations = m.parameterAnnotations.get ( parameterIndex ) ; if ( annotations != null ) { for ( com.android.tools.lint.client.api.JavaParser.ResolvedAnnotation annotation : annotations ) { if ( type.equals ( annotation.getSignature ( ) ) ) { return annotation ; } } } } return null ; }

Target:
public java.util.Collection < com.intellij.psi.PsiAnnotation > getParameterAnnotations ( @ com.android.annotations.NonNull org.eclipse.jdt.internal.compiler.lookup.MethodBinding method , int parameterIndex ) { for ( com.android.tools.lint.ExternalAnnotationRepository.AnnotationsDatabase database : mDatabases ) { java.util.Collection < com.intellij.psi.PsiAnnotation > annotations = database.getAnnotations ( method , parameterIndex ) ; if ( annotations != null ) { return annotations ; } } return null ; }
Source:
public void execute ( com.android.build.gradle.model.DefaultAndroidBinary binary ) { java.util.Collection < org.gradle.nativeplatform.SharedLibraryBinarySpec > nativeBinaries = com.android.build.gradle.model.NdkComponentModelPlugin.getNativeBinaries ( library , binary.getBuildType ( ) , binary.getProductFlavors ( ) ) ; binary.getNativeBinaries ( ) . addAll ( nativeBinaries ) ; }

Target:
public void execute ( com.android.build.gradle.model.DefaultAndroidBinary binary ) { binary.computeMergedNdk ( ndkConfig , binary.getProductFlavors ( ) , binary.getBuildType ( ) ) ; java.util.Collection < org.gradle.nativeplatform.SharedLibraryBinarySpec > nativeBinaries = com.android.build.gradle.model.NdkComponentModelPlugin.getNativeBinaries ( library , binary.getBuildType ( ) , binary.getProductFlavors ( ) ) ; binary.getNativeBinaries ( ) . addAll ( nativeBinaries ) ; for ( org.gradle.nativeplatform.SharedLibraryBinarySpec nativeBin : nativeBinaries ) { com.android.build.gradle.ndk.internal.NdkConfiguration.configureBinary ( nativeBin , buildDir , binary.getMergedNdkConfig ( ) , ndkHandler ) ; } }
Source:
public com.google.mockwebserver.MockResponse setBody ( byte [ ] body ) { if ( ( this . body ) == ( com.google.mockwebserver.MockResponse.EMPTY_BODY ) ) { headers.remove ( com.google.mockwebserver.MockResponse.EMPTY_BODY_HEADER ) ; } this . headers.add ( ( "Content-Length: " + ( body.length ) ) ) ; this . body = body ; return this ; }

Target:
public com.google.mockwebserver.MockResponse setBody ( java.io.InputStream body , long bodyLength ) { if ( ( this . body ) == null ) { headers.remove ( com.google.mockwebserver.MockResponse.EMPTY_BODY_HEADER ) ; } this . headers.add ( ( "Content-Length: " + bodyLength ) ) ; this . body = body ; this . bodyLength = bodyLength ; return this ; }
Source:
public void test_bind_closed ( ) throws java.lang.Exception { java.nio.channels.DatagramChannel dc = java.nio.channels.DatagramChannel.open ( ) ; dc.close ( ) ; try { dc.bind ( null ) ; fail ( ) ; } catch ( java.nio.channels.ClosedChannelException expected ) { } finally { dc.close ( ) ; } }

Target:
public void test_bind_closed ( ) throws java.lang.Exception { java.nio.channels.DatagramChannel dc = java.nio.channels.DatagramChannel.open ( ) ; dc.close ( ) ; try { dc.socket ( ) . bind ( null ) ; fail ( ) ; } catch ( java.io.IOException expected ) { } finally { dc.close ( ) ; } }
Source:
public void dumpProto ( com.android.bluetooth.btservice.BluetoothProto.BluetoothLog proto ) { mClientMap.dumpProto ( proto ) ; mServerMap.dumpProto ( proto ) ; }

Target:
void addScanResult ( ) { if ( mScanEvents.isEmpty ( ) ) return ; com.android.bluetooth.btservice.BluetoothProto.ScanEvent curr = mScanEvents.get ( ( ( mScanEvents.size ( ) ) - 1 ) ) ; curr.setNumberResults ( ( ( curr.getNumberResults ( ) ) + 1 ) ) ; }
Source:
boolean sendData ( android.bluetooth.BluetoothDevice device , java.lang.String report ) { enforceCallingOrSelfPermission ( com.android.bluetooth.hid.BLUETOOTH_ADMIN_PERM , "Need BLUETOOTH_ADMIN permission" ) ; if ( com.android.bluetooth.hid.HidService.DBG ) { android.util.Log.d ( com.android.bluetooth.hid.HidService.TAG , ( "sendData: " + ( device.getAddress ( ) ) ) ) ; } int state = this . getConnectionState ( device ) ; if ( state != ( android.bluetooth.BluetoothHidHost.STATE_CONNECTED ) ) { return false ; } return sendDataNative ( com.android.bluetooth.Utils.getByteAddress ( device ) , report ) ; }

Target:
boolean sendData ( android.bluetooth.BluetoothDevice device , java.lang.String report ) { enforceCallingOrSelfPermission ( com.android.bluetooth.hid.BLUETOOTH_ADMIN_PERM , "Need BLUETOOTH_ADMIN permission" ) ; if ( com.android.bluetooth.hid.HidHostService.DBG ) { android.util.Log.d ( com.android.bluetooth.hid.HidHostService.TAG , ( "sendData: " + ( device.getAddress ( ) ) ) ) ; } int state = this . getConnectionState ( device ) ; if ( state != ( android.bluetooth.BluetoothHidHost.STATE_CONNECTED ) ) { return false ; } return sendDataNative ( com.android.bluetooth.Utils.getByteAddress ( device ) , report ) ; }
Source:
public static void onBatteryChargingChanged ( android.content.Intent intent ) { if ( ( org.chromium.base.PowerMonitor.sInstance ) == null ) { return ; } int chargePlug = intent.getIntExtra ( BatteryManager.EXTRA_PLUGGED , ( - 1 ) ) ; org.chromium.base.PowerMonitor.sInstance.mIsBatteryPower = ( chargePlug != ( android.os.BatteryManager.BATTERY_PLUGGED_USB ) ) && ( chargePlug != ( android.os.BatteryManager.BATTERY_PLUGGED_AC ) ) ; org.chromium.base.PowerMonitor.nativeOnBatteryChargingChanged ( ) ; }

Target:
private static boolean isBatteryPower ( ) { if ( ( org.chromium.base.PowerMonitor.sInstance ) == null ) org.chromium.base.PowerMonitor.create ( ) ; return org.chromium.base.PowerMonitor.sInstance.mIsBatteryPower ; }
Source:
protected boolean isOrIsSubClassOf ( @ javax.annotation.Nonnull com.android.jack.ir.ast.JClassOrInterface rootType , @ javax.annotation.Nonnull com.android.jack.ir.ast.JReferenceType searchedType ) { if ( rootType.equals ( searchedType ) ) { return true ; } else if ( rootType instanceof com.android.jack.ir.ast.JDefinedClass ) { return ( ( com.android.jack.ir.ast.JDefinedClass ) ( rootType ) ) . isSubTypeOf ( searchedType ) ; } return false ; }

Target:
protected boolean isOrIsSubClassOf ( @ javax.annotation.Nonnull com.android.jack.ir.ast.JClassOrInterface rootType , @ javax.annotation.Nonnull com.android.jack.ir.ast.JReferenceType searchedType ) { if ( rootType.isSameType ( searchedType ) ) { return true ; } else if ( rootType instanceof com.android.jack.ir.ast.JDefinedClass ) { return ( ( com.android.jack.ir.ast.JDefinedClass ) ( rootType ) ) . isSubTypeOf ( searchedType ) ; } return false ; }
Source:
public static void writeUint32 ( long i , java.io.OutputStream output ) throws java.io.IOException { output.write ( ( ( int ) ( i > > 24 ) ) ) ; output.write ( ( ( int ) ( i > > 16 ) ) ) ; output.write ( ( ( int ) ( i > > 8 ) ) ) ; output.write ( ( ( int ) ( i ) ) ) ; }

Target:
public static void writeUint16 ( int i , java.io.OutputStream output ) throws java.io.IOException { output.write ( ( i > > > 8 ) ) ; output.write ( i ) ; }
Source:
public void test_readyOps ( ) throws java.io.IOException { int port = tests.support.Support_PortManager.getNextPort ( ) ; java.net.ServerSocket ss = new java.net.ServerSocket ( port ) ; try { sc.connect ( new java.net.InetSocketAddress ( org.apache.harmony.tests.java.nio.channels.SelectionKeyTest.LOCAL_ADDR , port ) ) ; assertEquals ( 0 , selectionKey.readyOps ( ) ) ; assertFalse ( selectionKey.isConnectable ( ) ) ; selector.select ( ) ; assertEquals ( java.nio.channels.SelectionKey.OP_CONNECT , selectionKey.readyOps ( ) ) ; } finally { ss.close ( ) ; ss = null ; } }

Target:
public void test_readyOps ( ) throws java.io.IOException { java.net.ServerSocket ss = new java.net.ServerSocket ( 0 ) ; try { sc.connect ( new java.net.InetSocketAddress ( org.apache.harmony.tests.java.nio.channels.SelectionKeyTest.LOCAL_ADDR , ss.getLocalPort ( ) ) ) ; assertEquals ( 0 , selectionKey.readyOps ( ) ) ; assertFalse ( selectionKey.isConnectable ( ) ) ; selector.select ( ) ; assertEquals ( java.nio.channels.SelectionKey.OP_CONNECT , selectionKey.readyOps ( ) ) ; } finally { ss.close ( ) ; ss = null ; } }
Source:
public com.ibm.icu.util.CurrencyAmount parseCurrency ( java.lang.CharSequence text , java.text.ParsePosition parsePosition ) { try { com.ibm.icu.util.CurrencyAmount result = com.ibm.icu.impl.number.Parse.parseCurrency ( text , parsePosition , properties , symbols ) ; if ( result == null ) return null ; java.lang.Number number = result.getNumber ( ) ; if ( number instanceof java.math.BigDecimal ) { number = new com.ibm.icu.math.BigDecimal ( ( ( java.math.BigDecimal ) ( number ) ) ) ; result = new com.ibm.icu.util.CurrencyAmount ( number , result.getCurrency ( ) ) ; } return result ; } catch ( java.text.ParseException e ) { return null ; } }

Target:
public com.ibm.icu.util.CurrencyAmount parseCurrency ( java.lang.CharSequence text , java.text.ParsePosition parsePosition ) { try { com.ibm.icu.util.CurrencyAmount result = com.ibm.icu.impl.number.Parse.parseCurrency ( text , parsePosition , properties , symbols ) ; if ( result == null ) return null ; java.lang.Number number = result.getNumber ( ) ; if ( number instanceof java.math.BigDecimal ) { number = safeConvertBigDecimal ( ( ( java.math.BigDecimal ) ( number ) ) ) ; result = new com.ibm.icu.util.CurrencyAmount ( number , result.getCurrency ( ) ) ; } return result ; } catch ( java.text.ParseException e ) { return null ; } }
Source:
public void onCopy ( org.eclipse.swt.dnd.Clipboard clipboard ) { }

Target:
private void copyActionAttributes ( org.eclipse.jface.action.Action action , org.eclipse.ui.actions.ActionFactory factory ) { org.eclipse.ui.actions.ActionFactory.IWorkbenchAction wa = factory.create ( mLayoutEditor.getEditorSite ( ) . getWorkbenchWindow ( ) ) ; action.setEnabled ( false ) ; action.setText ( wa.getText ( ) ) ; action.setDescription ( wa.getDescription ( ) ) ; action.setImageDescriptor ( wa.getImageDescriptor ( ) ) ; action.setHoverImageDescriptor ( wa.getHoverImageDescriptor ( ) ) ; action.setDisabledImageDescriptor ( wa.getDisabledImageDescriptor ( ) ) ; }
Source:
public static void main ( java.lang.String [ ] args ) { art.Main.bindAgentJNIForClass ( Main.class ) ; java.util.OptionalLong ol = java.util.OptionalLong.of ( - 559038737 ) ; java.lang.System.out.println ( ( ( "ol.toString() -> '" + ( ol.toString ( ) ) ) + "'" ) ) ; java.lang.System.out.println ( "Redefining OptionalLong!" ) ; Main.doCommonClassRedefinition ( java.util.OptionalLong.class , Main.CLASS_BYTES , Main.DEX_BYTES ) ; java.lang.System.out.println ( ( ( "ol.toString() -> '" + ( ol.toString ( ) ) ) + "'" ) ) ; }

Target:
public static void main ( java.lang.String [ ] args ) { java.util.OptionalLong ol = java.util.OptionalLong.of ( - 559038737 ) ; java.lang.System.out.println ( ( ( "ol.toString() -> '" + ( ol.toString ( ) ) ) + "'" ) ) ; java.lang.System.out.println ( "Redefining OptionalLong!" ) ; art.Redefinition.doCommonClassRedefinition ( java.util.OptionalLong.class , Main.CLASS_BYTES , Main.DEX_BYTES ) ; java.lang.System.out.println ( ( ( "ol.toString() -> '" + ( ol.toString ( ) ) ) + "'" ) ) ; }
Source:
public void start ( org.osgi.framework.BundleContext context ) throws java.lang.Exception { super . start ( context ) ; com.android.ide.eclipse.hierarchyviewer.HierarchyViewerPlugin.plugin = this ; }

Target:
public void run ( ) { org.eclipse.swt.widgets.Shell shell = org.eclipse.swt.widgets.Display.getDefault ( ) . getActiveShell ( ) ; if ( logLevel == ( com.android.ddmlib.Log.LogLevel.ERROR ) ) { org.eclipse.jface.dialogs.MessageDialog.openError ( shell , tag , message ) ; } else { org.eclipse.jface.dialogs.MessageDialog.openWarning ( shell , tag , message ) ; } }
Source:
public void onServiceConnected ( android.content.ComponentName classname , android.os.IBinder obj ) { try { unbindService ( this ) ; } catch ( java.lang.IllegalArgumentException e ) { } com.android.music.IMediaPlaybackService serv = IMediaPlaybackService.Stub.asInterface ( obj ) ; if ( serv != null ) { try { serv.setShuffleMode ( MediaPlaybackService.SHUFFLE_AUTO ) ; } catch ( android.os.RemoteException ex ) { } } }

Target:
public void onDestroy ( ) { com.android.music.utils.LogHelper.d ( com.android.music.MusicBrowserActivity.TAG , "onDestroy()" ) ; super . onDestroy ( ) ; }
Source:
public android.telephony.IccOpenLogicalChannelResponse iccOpenLogicalChannel ( int subId , java.lang.String AID ) { enforceModifyPermissionOrCarrierPrivilege ( subId ) ; if ( com.android.phone.PhoneInterfaceManager.DBG ) com.android.phone.PhoneInterfaceManager.log ( ( ( ( "iccOpenLogicalChannel: subId=" + subId ) + " aid=" ) + AID ) ) ; android.telephony.IccOpenLogicalChannelResponse response = ( ( android.telephony.IccOpenLogicalChannelResponse ) ( sendRequest ( com.android.phone.PhoneInterfaceManager.CMD_OPEN_CHANNEL , AID , subId ) ) ) ; if ( com.android.phone.PhoneInterfaceManager.DBG ) com.android.phone.PhoneInterfaceManager.log ( ( "iccOpenLogicalChannel: " + response ) ) ; return response ; }

Target:
public android.telephony.IccOpenLogicalChannelResponse iccOpenLogicalChannel ( int subId , java.lang.String AID , int p2 ) { enforceModifyPermissionOrCarrierPrivilege ( subId ) ; if ( com.android.phone.PhoneInterfaceManager.DBG ) com.android.phone.PhoneInterfaceManager.log ( ( ( ( ( ( "iccOpenLogicalChannel: subId=" + subId ) + " aid=" ) + AID ) + " p2=" ) + p2 ) ) ; android.telephony.IccOpenLogicalChannelResponse response = ( ( android.telephony.IccOpenLogicalChannelResponse ) ( sendRequest ( com.android.phone.PhoneInterfaceManager.CMD_OPEN_CHANNEL , new android.util.Pair < java.lang.String , java.lang.Integer > ( AID , p2 ) , subId ) ) ) ; if ( com.android.phone.PhoneInterfaceManager.DBG ) com.android.phone.PhoneInterfaceManager.log ( ( "iccOpenLogicalChannel: " + response ) ) ; return response ; }
Source:
private java.util.Set < com.android.jack.analysis.DefinitionMarker > getDefinitions ( @ javax.annotation.Nonnull java.util.List < com.android.jack.analysis.DefinitionMarker > definitions , @ javax.annotation.Nonnull java.util.BitSet in ) { java.util.Set < com.android.jack.analysis.DefinitionMarker > reachingDefs = new java.util.HashSet < com.android.jack.analysis.DefinitionMarker > ( ) ; for ( int i = in.nextSetBit ( 0 ) ; i >= 0 ; i = in.nextSetBit ( ( i + 1 ) ) ) { reachingDefs.add ( definitions.get ( i ) ) ; } return reachingDefs ; }

Target:
private java.util.List < com.android.jack.analysis.DefinitionMarker > getDefinitions ( @ javax.annotation.Nonnull java.util.List < com.android.jack.analysis.DefinitionMarker > definitions , @ javax.annotation.Nonnull java.util.BitSet in ) { java.util.List < com.android.jack.analysis.DefinitionMarker > reachingDefs = new java.util.ArrayList < com.android.jack.analysis.DefinitionMarker > ( ) ; for ( int i = in.nextSetBit ( 0 ) ; i >= 0 ; i = in.nextSetBit ( ( i + 1 ) ) ) { assert ! ( reachingDefs.contains ( definitions.get ( i ) ) ) ; reachingDefs.add ( definitions.get ( i ) ) ; } return reachingDefs ; }
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:
protected com.intellij.updater.Patch createPatch ( ) throws com.intellij.updater.OperationCancelledException , java.io.IOException { com.intellij.updater.Patch patch = com.intellij.updater.PatchFileCreator.create ( myPatchSpec , myFile , com.intellij.updater.TEST_UI ) ; assertTrue ( myFile.exists ( ) ) ; return patch ; }
Source:
public java.lang.String getShortDescription ( ) { if ( ( ( mUiName ) != null ) && ( ( mUiName.length ( ) ) > 0 ) ) { return mUiName ; } return mUrl ; }

Target:
public java.lang.String getShortDescription ( ) { if ( ( ( mUiName ) != null ) && ( ( mUiName.length ( ) ) > 0 ) ) { java.lang.String host = "malformed URL" ; try { java.net.URL u = new java.net.URL ( mUrl ) ; host = u.getHost ( ) ; } catch ( java.net.MalformedURLException e ) { } return java.lang.String.format ( "%1$s (%2$s)" , mUiName , host ) ; } return mUrl ; }
Source:
android.os.ParcelFileDescriptor createSocketChannel ( int type , java.lang.String serviceName , android.os.ParcelUuid uuid , int port , int flag ) { enforceCallingOrSelfPermission ( com.android.bluetooth.btservice.AdapterService.BLUETOOTH_PERM , "Need BLUETOOTH permission" ) ; int fd = createSocketChannelNative ( type , serviceName , com.android.bluetooth.Utils.uuidToByteArray ( uuid ) , port , flag ) ; if ( fd < 0 ) { errorLog ( "Failed to create socket channel" ) ; return null ; } return android.os.ParcelFileDescriptor.adoptFd ( fd ) ; }

Target:
android.os.ParcelFileDescriptor createSocketChannel ( int type , java.lang.String serviceName , android.os.ParcelUuid uuid , int port , int flag ) { enforceCallingOrSelfPermission ( com.android.bluetooth.btservice.AdapterService.BLUETOOTH_PERM , "Need BLUETOOTH permission" ) ; int fd = createSocketChannelNative ( type , serviceName , com.android.bluetooth.Utils.uuidToByteArray ( uuid ) , port , flag , android.os.Binder.getCallingUid ( ) ) ; if ( fd < 0 ) { errorLog ( "Failed to create socket channel" ) ; return null ; } return android.os.ParcelFileDescriptor.adoptFd ( fd ) ; }
Source:
static void fieldOrAnyMember ( @ javax.annotation.Nonnull com.android.jack.shrob.spec.ClassSpecification classSpec , @ javax.annotation.CheckForNull com.android.jack.shrob.spec.AnnotationSpecification annotationType , @ javax.annotation.CheckForNull java.lang.String typeSig , java.lang.String name , @ javax.annotation.Nonnull com.android.jack.shrob.spec.ModifierSpecification modifier ) { assert name != null ; if ( typeSig == null ) { assert name.equals ( "*" ) ; com.android.jack.shrob.proguard.GrammarActions.method ( classSpec , annotationType , com.android.jack.shrob.proguard.GrammarActions.getSignature ( "***" , 0 ) , "*" , ( ( "(" + ( com.android.jack.shrob.proguard.GrammarActions.getSignature ( "..." , 0 ) ) ) + ")" ) , modifier ) ; } com.android.jack.shrob.proguard.GrammarActions.field ( classSpec , annotationType , typeSig , name , modifier ) ; }

Target:
static void fieldOrAnyMember ( @ javax.annotation.Nonnull com.android.jack.shrob.spec.ClassSpecification classSpec , @ javax.annotation.CheckForNull com.android.jack.shrob.spec.AnnotationSpecification annotationType , @ javax.annotation.CheckForNull java.lang.String typeSig , java.lang.String name , @ javax.annotation.Nonnull com.android.jack.shrob.spec.ModifierSpecification modifier ) { assert name != null ; if ( typeSig == null ) { assert name.equals ( "*" ) ; com.android.jack.shrob.proguard.GrammarActions.method ( classSpec , annotationType , com.android.jack.shrob.proguard.GrammarActions.getSignature ( "***" , 0 ) , "*" , ( ( "\\(" + ( com.android.jack.shrob.proguard.GrammarActions.getSignature ( "..." , 0 ) ) ) + "\\)" ) , modifier ) ; } com.android.jack.shrob.proguard.GrammarActions.field ( classSpec , annotationType , typeSig , name , modifier ) ; }
Source:
public void add ( int placeholderId , int offset ) { placeholderIdsOrderedByOffset.add ( offset ) ; placeholderIdsOrderedByOffset.add ( placeholderId ) ; if ( placeholderId >= ( placeholderCount ) ) { placeholderCount = placeholderId + 1 ; } }

Target:
public void add ( int placeholderId , int offset ) { placeholderIdsOrderedByOffset.add ( offset ) ; placeholderIdsOrderedByOffset.add ( placeholderId ) ; if ( placeholderId >= ( placeholderCount ) ) { placeholderCount = placeholderId + 1 ; } int len = placeholderIdsOrderedByOffset.size ( ) ; if ( ( len > 2 ) && ( placeholderIdsOrderedByOffset.get ( ( len - 1 ) ) . equals ( placeholderIdsOrderedByOffset.get ( 1 ) ) ) ) { firstPlaceholderReused = true ; } }
Source:
private int getUrlChoice ( ) { if ( useProd.isSelected ( ) ) { return 0 ; } if ( useStaging.isSelected ( ) ) { return 1 ; } if ( useTest.isSelected ( ) ) { return 2 ; } if ( useCustom.isSelected ( ) ) { return 3 ; } throw new java.lang.RuntimeException ( "No URL option is selected!" ) ; }

Target:
private com.google.gct.testing.config.GoogleCloudTestingConfigurable.BackendOption getBackendOption ( ) { if ( useProd.isSelected ( ) ) { return com.google.gct.testing.config.GoogleCloudTestingConfigurable.BackendOption.PROD ; } if ( useStaging.isSelected ( ) ) { return com.google.gct.testing.config.GoogleCloudTestingConfigurable.BackendOption.STAGING ; } if ( useTest.isSelected ( ) ) { return com.google.gct.testing.config.GoogleCloudTestingConfigurable.BackendOption.TEST ; } if ( useCustom.isSelected ( ) ) { return com.google.gct.testing.config.GoogleCloudTestingConfigurable.BackendOption.CUSTOM ; } throw new java.lang.RuntimeException ( "No URL option is selected!" ) ; }
Source:
public boolean isVideoCallingEnabled ( java.lang.String callingPackage ) { if ( ! ( canReadPhoneState ( callingPackage , "isVideoCallingEnabled" ) ) ) { return false ; } com.android.ims.ImsManager imsManager = com.android.ims.ImsManager.getInstance ( mPhone.getContext ( ) , mPhone.getPhoneId ( ) ) ; return ( ( imsManager.isVtEnabledByPlatform ( ) ) && ( imsManager.isEnhanced4gLteModeSettingEnabledByUser ( ) ) ) && ( imsManager.isVtEnabledByUser ( ) ) ; }

Target:
public boolean isWifiCallingAvailable ( int subId ) { com.android.internal.telephony.Phone phone = getPhone ( subId ) ; if ( phone != null ) { return phone.isWifiCallingEnabled ( ) ; } else { return false ; } }
Source:
public java.util.List < android.service.carrier.CarrierIdentifier > getAllowedCarriers ( int slotId ) { try { com.android.internal.telephony.ITelephony service = getITelephony ( ) ; if ( service != null ) { return service.getAllowedCarriers ( slotId ) ; } } catch ( android.os.RemoteException e ) { android.util.Log.e ( android.telephony.TelephonyManager.TAG , "Error calling ITelephony#getAllowedCarriers" , e ) ; } catch ( java.lang.NullPointerException e ) { android.util.Log.e ( android.telephony.TelephonyManager.TAG , "Error calling ITelephony#setAllowedCarriers" , e ) ; } return new java.util.ArrayList < android.service.carrier.CarrierIdentifier > ( 0 ) ; }

Target:
public android.telephony.SignalStrength getSignalStrength ( ) { try { com.android.internal.telephony.ITelephony service = getITelephony ( ) ; if ( service != null ) { return service.getSignalStrength ( getSubId ( ) ) ; } } catch ( android.os.RemoteException e ) { android.util.Log.e ( android.telephony.TelephonyManager.TAG , "Error calling ITelephony#getSignalStrength" , e ) ; } return null ; }
Source:
java.lang.String getExampleShortNumber ( java.lang.String regionCode ) { com.google.i18n.phonenumbers.Phonemetadata.PhoneMetadata phoneMetadata = com.google.i18n.phonenumbers.MetadataManager.getShortNumberMetadataForRegion ( regionCode ) ; if ( phoneMetadata == null ) { return "" ; } com.google.i18n.phonenumbers.Phonemetadata.PhoneNumberDesc desc = phoneMetadata.getShortCode ( ) ; if ( desc.hasExampleNumber ( ) ) { return desc.getExampleNumber ( ) ; } return "" ; }

Target:
java.lang.String getExampleShortNumber ( java.lang.String regionCode ) { com.google.i18n.phonenumbers.nano.Phonemetadata.PhoneMetadata phoneMetadata = com.google.i18n.phonenumbers.MetadataManager.getShortNumberMetadataForRegion ( regionCode ) ; if ( phoneMetadata == null ) { return "" ; } com.google.i18n.phonenumbers.nano.Phonemetadata.PhoneNumberDesc desc = phoneMetadata.shortCode ; if ( ! ( desc.exampleNumber.equals ( "" ) ) ) { return desc.exampleNumber ; } return "" ; }
Source:
public void reverseReferencesAreNotUnreachable ( ) throws java.io.IOException { com.android.ahat.TestDump dump = com.android.ahat.TestDump.getTestDump ( ) ; com.android.ahat.heapdump.AhatInstance obj = dump.getDumpedAhatInstance ( "basicString" ) ; org.junit.Assert.assertEquals ( 2 , obj.getHardReverseReferences ( ) . size ( ) ) ; org.junit.Assert.assertEquals ( 0 , obj.getSoftReverseReferences ( ) . size ( ) ) ; }

Target:
public void asStringEmbeddedZero ( ) throws java.io.IOException { com.android.ahat.TestDump dump = com.android.ahat.TestDump.getTestDump ( ) ; com.android.ahat.heapdump.AhatInstance str = dump.getDumpedAhatInstance ( "embeddedZero" ) ; org.junit.Assert.assertEquals ( "embedded..." , str.asString ( ) ) ; }
Source:
public int getDataNetworkTypeForSubscriber ( int subId , java.lang.String callingPackage ) { if ( ! ( canReadPhoneState ( callingPackage , "getDataNetworkTypeForSubscriber" ) ) ) { return android.telephony.TelephonyManager.NETWORK_TYPE_UNKNOWN ; } final com.android.internal.telephony.Phone phone = getPhone ( subId ) ; if ( phone != null ) { return phone.getServiceState ( ) . getDataNetworkType ( ) ; } else { return android.telephony.TelephonyManager.NETWORK_TYPE_UNKNOWN ; } }

Target:
public int getNetworkTypeForSubscriber ( int subId , java.lang.String callingPackage ) { if ( ! ( com.android.internal.telephony.TelephonyPermissions.checkCallingOrSelfReadPhoneState ( mApp , callingPackage , "getNetworkTypeForSubscriber" ) ) ) { return android.telephony.TelephonyManager.NETWORK_TYPE_UNKNOWN ; } final com.android.internal.telephony.Phone phone = getPhone ( subId ) ; if ( phone != null ) { return phone.getServiceState ( ) . getDataNetworkType ( ) ; } else { return android.telephony.TelephonyManager.NETWORK_TYPE_UNKNOWN ; } }
Source:
public void writeToParcel ( android.os.Parcel dest , int flags ) { dest.writeInt ( scanType ) ; dest.writeParcelableArray ( specifiers , flags ) ; }

Target:
public void writeToParcel ( android.os.Parcel dest , int flags ) { dest.writeInt ( scanType ) ; dest.writeParcelableArray ( specifiers , flags ) ; dest.writeInt ( searchPeriodicity ) ; dest.writeInt ( maxSearchTime ) ; dest.writeBoolean ( incrementalResults ) ; dest.writeInt ( incrementalResultsPeriodicity ) ; dest.writeStringList ( mccMncs ) ; }
Source:
public void validatePolicyWithRoamingPartnerWithoutCountries ( ) throws java.lang.Exception { android.net.wifi.hotspot2.pps.Policy policy = android.net.wifi.hotspot2.pps.PolicyTest.createPolicy ( ) ; android.net.wifi.hotspot2.pps.Policy.RoamingPartner partner = new android.net.wifi.hotspot2.pps.Policy.RoamingPartner ( ) ; partner.fqdn = "test.com" ; partner.fqdnExactMatch = true ; partner.priority = 12 ; policy.preferredRoamingPartnerList.add ( partner ) ; org.junit.Assert.assertFalse ( policy.validate ( ) ) ; }

Target:
public void validatePolicyWithRoamingPartnerWithoutFQDN ( ) throws java.lang.Exception { android.net.wifi.hotspot2.pps.Policy policy = android.net.wifi.hotspot2.pps.PolicyTest.createPolicy ( ) ; android.net.wifi.hotspot2.pps.Policy.RoamingPartner partner = new android.net.wifi.hotspot2.pps.Policy.RoamingPartner ( ) ; partner.setFqdnExactMatch ( true ) ; partner.setPriority ( 12 ) ; partner.setCountries ( "us,jp" ) ; policy.getPreferredRoamingPartnerList ( ) . add ( partner ) ; org.junit.Assert.assertFalse ( policy.validate ( ) ) ; }
Source:
private void enableVerboseLoggingInternal ( int verbose ) { mWifiStateMachine.enableVerboseLogging ( verbose ) ; mWifiLockManager.enableVerboseLogging ( verbose ) ; mWifiMulticastLockManager.enableVerboseLogging ( verbose ) ; mWifiInjector.getWifiLastResortWatchdog ( ) . enableVerboseLogging ( verbose ) ; mWifiInjector.getWifiBackupRestore ( ) . enableVerboseLogging ( verbose ) ; }

Target:
void enableVerboseLoggingInternal ( int verbose ) { mWifiStateMachine.enableVerboseLogging ( verbose ) ; mWifiLockManager.enableVerboseLogging ( verbose ) ; mWifiMulticastLockManager.enableVerboseLogging ( verbose ) ; mWifiInjector.getWifiLastResortWatchdog ( ) . enableVerboseLogging ( verbose ) ; mWifiInjector.getWifiBackupRestore ( ) . enableVerboseLogging ( verbose ) ; com.android.server.wifi.LogcatLog.enableVerboseLogging ( verbose ) ; }
Source:
public void onLooperPrepared ( ) { mEuiccCard = new com.android.internal.telephony.uicc.euicc.EuiccCard ( mContextFixture.getTestDouble ( ) , mMockCi , mMockIccCardStatus , 0 ) ; mHandler = new android.os.Handler ( mTestHandlerThread.getLooper ( ) ) ; setReady ( true ) ; }

Target:
public void onLooperPrepared ( ) { mEuiccCard = new com.android.internal.telephony.uicc.euicc.EuiccCard ( mContextFixture.getTestDouble ( ) , mMockCi , mMockIccCardStatus , 0 ) { @ java.lang.Override protected byte [ ] getDeviceId ( ) { return com.android.internal.telephony.uicc.IccUtils.bcdToBytes ( "987654321012345" ) ; } } ; mHandler = new android.os.Handler ( mTestHandlerThread.getLooper ( ) ) ; setReady ( true ) ; }
Source:
public static synchronized com.android.bluetooth.btservice.AdapterService getAdapterService ( ) { if ( ( ( com.android.bluetooth.btservice.AdapterService.sAdapterService ) != null ) && ( ! ( com.android.bluetooth.btservice.AdapterService.sAdapterService.mCleaningUp ) ) ) { android.util.Log.d ( com.android.bluetooth.btservice.AdapterService.TAG , ( "getAdapterService() - returning " + ( com.android.bluetooth.btservice.AdapterService.sAdapterService ) ) ) ; return com.android.bluetooth.btservice.AdapterService.sAdapterService ; } if ( com.android.bluetooth.btservice.AdapterService.DBG ) { if ( ( com.android.bluetooth.btservice.AdapterService.sAdapterService ) == null ) { android.util.Log.d ( com.android.bluetooth.btservice.AdapterService.TAG , "getAdapterService() - Service not available" ) ; } else if ( com.android.bluetooth.btservice.AdapterService.sAdapterService.mCleaningUp ) { android.util.Log.d ( com.android.bluetooth.btservice.AdapterService.TAG , "getAdapterService() - Service is cleaning up" ) ; } } return null ; }

Target:
private static synchronized void clearAdapterService ( com.android.bluetooth.btservice.AdapterService current ) { if ( ( com.android.bluetooth.btservice.AdapterService.sAdapterService ) == current ) { com.android.bluetooth.btservice.AdapterService.sAdapterService = null ; } }