auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( getClass ( ) . getSimpleName ( ) ) ; mCarrierServicesSmsFilterUT = new com.android.internal.telephony.CarrierServicesSmsFilter ( mContext , mPhone.getPhoneId ( ) , mPhone.getSubId ( ) , new byte [ ] [ ] { com.android.internal.telephony.CarrierServicesSmsFilterTest.SMS_PDU } , 0 , null , mFilterCallback , getClass ( ) . getSimpleName ( ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( getClass ( ) . getSimpleName ( ) ) ; mCarrierServicesSmsFilterUT = new com.android.internal.telephony.CarrierServicesSmsFilter ( mContext , mPhone , new byte [ ] [ ] { com.android.internal.telephony.CarrierServicesSmsFilterTest.SMS_PDU } , 0 , null , mFilterCallback , getClass ( ) . getSimpleName ( ) ) ; }
Source:
private int performDexOptLI ( android.content.pm.PackageParser.Package pkg , boolean forceDex , boolean defer , boolean inclDependencies ) { java.util.HashSet < java.lang.String > done ; boolean performed = false ; if ( inclDependencies && ( ( ( pkg.usesLibraries ) != null ) || ( ( pkg.usesOptionalLibraries ) != null ) ) ) { done = new java.util.HashSet < java.lang.String > ( ) ; done.add ( pkg.packageName ) ; } else { done = null ; } return performDexOptLI ( pkg , forceDex , defer , done ) ; }

Target:
private int performDexOptLI ( android.content.pm.PackageParser.Package pkg , boolean forceDex , boolean defer , boolean inclDependencies ) { java.util.HashSet < java.lang.String > done ; if ( inclDependencies && ( ( ( pkg.usesLibraries ) != null ) || ( ( pkg.usesOptionalLibraries ) != null ) ) ) { done = new java.util.HashSet < java.lang.String > ( ) ; done.add ( pkg.packageName ) ; } else { done = null ; } return performDexOptLI ( pkg , null , forceDex , defer , done ) ; }
Source:
public static javax.xml.validation.Schema getSchema ( ) throws org.xml.sax.SAXException { java.io.InputStream xsdStream = com.android.dvlib.DeviceSchema.getXsdStream ( ) ; if ( xsdStream == null ) { return null ; } javax.xml.validation.SchemaFactory factory = javax.xml.validation.SchemaFactory.newInstance ( javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI ) ; javax.xml.validation.Schema schema = factory.newSchema ( new javax.xml.transform.stream.StreamSource ( xsdStream ) ) ; return schema ; }

Target:
public static javax.xml.validation.Schema getSchema ( int version ) throws org.xml.sax.SAXException { java.io.InputStream xsdStream = com.android.dvlib.DeviceSchema.getXsdStream ( version ) ; if ( xsdStream == null ) { return null ; } javax.xml.validation.SchemaFactory factory = javax.xml.validation.SchemaFactory.newInstance ( javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI ) ; javax.xml.validation.Schema schema = factory.newSchema ( new javax.xml.transform.stream.StreamSource ( xsdStream ) ) ; return schema ; }
Source:
private long getPlayPosition ( ) { if ( ( mCurrentPlayState ) == null ) return - 1L ; if ( ( mCurrentPlayState.getPosition ( ) ) == ( android.media.session.PlaybackState.PLAYBACK_POSITION_UNKNOWN ) ) return - 1L ; if ( isPlayingState ( mCurrentPlayState ) ) { return ( ( android.os.SystemClock.elapsedRealtime ( ) ) - ( mLastStateUpdate ) ) + ( mCurrentPlayState.getPosition ( ) ) ; } return - 1L ; }

Target:
private long getPlayPosition ( ) { if ( ( mCurrentPlayState ) == null ) return - 1L ; if ( ( mCurrentPlayState.getPosition ( ) ) == ( android.media.session.PlaybackState.PLAYBACK_POSITION_UNKNOWN ) ) return - 1L ; if ( isPlayingState ( mCurrentPlayState ) ) { return ( ( android.os.SystemClock.elapsedRealtime ( ) ) - ( mLastStateUpdate ) ) + ( mCurrentPlayState.getPosition ( ) ) ; } return mCurrentPlayState.getPosition ( ) ; }
Source:
private java.lang.String normalizeWord ( java.lang.String word ) { switch ( this ) { case LOWER_HYPHEN : return com.google.common.base.Ascii.toLowerCase ( word ) ; case LOWER_UNDERSCORE : return com.google.common.base.Ascii.toLowerCase ( word ) ; case LOWER_CAMEL : return com.google.common.base.CaseFormat.firstCharOnlyToUpper ( word ) ; case UPPER_CAMEL : return com.google.common.base.CaseFormat.firstCharOnlyToUpper ( word ) ; case UPPER_UNDERSCORE : return com.google.common.base.Ascii.toUpperCase ( word ) ; } throw new java.lang.RuntimeException ( ( "unknown case: " + ( this ) ) ) ; }

Target:
java.lang.String normalizeWord ( java.lang.String word ) { return com.google.common.base.CaseFormat.firstCharOnlyToUpper ( word ) ; }
Source:
public void onDisconnect ( final javax.obex.HeaderSet req , final javax.obex.HeaderSet resp ) { if ( com.android.bluetooth.pbap.BluetoothPbapObexServer.D ) { android.util.Log.d ( com.android.bluetooth.pbap.BluetoothPbapObexServer.TAG , "onDisconnect(): enter" ) ; } if ( com.android.bluetooth.pbap.BluetoothPbapObexServer.V ) { com.android.bluetooth.pbap.BluetoothPbapObexServer.logHeader ( req ) ; } notifyUpdateWakeLock ( ) ; resp.responseCode = javax.obex.ResponseCodes.OBEX_HTTP_OK ; if ( ( mCallback ) != null ) { android.os.Message msg = android.os.Message.obtain ( mCallback ) ; msg.what = BluetoothPbapService.MSG_SESSION_DISCONNECTED ; msg.sendToTarget ( ) ; if ( com.android.bluetooth.pbap.BluetoothPbapObexServer.V ) { android.util.Log.v ( com.android.bluetooth.pbap.BluetoothPbapObexServer.TAG , "onDisconnect(): msg MSG_SESSION_DISCONNECTED sent out." ) ; } } }

Target:
public void onDisconnect ( final javax.obex.HeaderSet req , final javax.obex.HeaderSet resp ) { if ( com.android.bluetooth.pbap.BluetoothPbapObexServer.D ) { android.util.Log.d ( com.android.bluetooth.pbap.BluetoothPbapObexServer.TAG , "onDisconnect(): enter" ) ; } if ( com.android.bluetooth.pbap.BluetoothPbapObexServer.V ) { com.android.bluetooth.pbap.BluetoothPbapObexServer.logHeader ( req ) ; } notifyUpdateWakeLock ( ) ; resp.responseCode = javax.obex.ResponseCodes.OBEX_HTTP_OK ; }
Source:
public void finishDrawingWindow ( com.android.server.WindowManagerService.Session session , android.view.IWindow client ) { final long origId = android.os.Binder.clearCallingIdentity ( ) ; synchronized ( mWindowMap ) { com.android.server.WindowManagerService.WindowState win = windowForClientLocked ( session , client ) ; if ( ( win != null ) && ( win.finishDrawingLocked ( ) ) ) { if ( ( ( win.mAttrs.flags ) & ( android.view.WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER ) ) != 0 ) { adjustWallpaperWindowsLocked ( ) ; } mLayoutNeeded = true ; performLayoutAndPlaceSurfacesLocked ( ) ; } } android.os.Binder.restoreCallingIdentity ( origId ) ; }

Target:
public void finishDrawingWindow ( com.android.server.WindowManagerService.Session session , android.view.IWindow client ) { final long origId = android.os.Binder.clearCallingIdentity ( ) ; synchronized ( mWindowMap ) { com.android.server.WindowManagerService.WindowState win = windowForClientLocked ( session , client , false ) ; if ( ( win != null ) && ( win.finishDrawingLocked ( ) ) ) { if ( ( ( win.mAttrs.flags ) & ( android.view.WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER ) ) != 0 ) { adjustWallpaperWindowsLocked ( ) ; } mLayoutNeeded = true ; performLayoutAndPlaceSurfacesLocked ( ) ; } } android.os.Binder.restoreCallingIdentity ( origId ) ; }
Source:
private boolean isLauncherIcon ( java.lang.String name ) { assert ( name.indexOf ( '.' ) ) == ( - 1 ) ; if ( name.startsWith ( "ic_launcher" ) ) { return true ; } return ( ( mLauncherIcons ) != null ) && ( mLauncherIcons.contains ( name ) ) ; }

Target:
private boolean isLauncherIcon ( java.lang.String name ) { assert ( name.indexOf ( '.' ) ) == ( - 1 ) : name ; if ( name.startsWith ( "ic_launcher" ) ) { return true ; } return ( ( mLauncherIcons ) != null ) && ( mLauncherIcons.contains ( name ) ) ; }
Source:
public com.android.jack.ir.ast.JMethodId getMethodId ( @ javax.annotation.Nonnull java.lang.String name , @ javax.annotation.Nonnull java.util.List < ? extends com.android.jack.ir.ast.JType > argsType , @ javax.annotation.Nonnull com.android.jack.ir.ast.MethodKind kind ) { synchronized ( methodIds ) { for ( com.android.jack.ir.ast.JMethodId id : methodIds ) { if ( id.equals ( name , argsType ) ) { return id ; } } com.android.jack.ir.ast.JMethodId newMethod = new com.android.jack.ir.ast.JMethodId ( name , argsType , kind ) ; methodIds.add ( newMethod ) ; return newMethod ; } }

Target:
public com.android.jack.ir.ast.JMethodId getMethodId ( @ javax.annotation.Nonnull java.lang.String name , @ javax.annotation.Nonnull java.util.List < ? extends com.android.jack.ir.ast.JType > argsType , @ javax.annotation.Nonnull com.android.jack.ir.ast.MethodKind kind ) { synchronized ( methodIds ) { for ( com.android.jack.ir.ast.JMethodId id : methodIds ) { if ( id.equals ( name , argsType , kind ) ) { return id ; } } com.android.jack.ir.ast.JMethodId newMethod = new com.android.jack.ir.ast.JMethodId ( name , argsType , kind ) ; methodIds.add ( newMethod ) ; return newMethod ; } }
Source:
public void terminate ( ) { if ( ( image ) != null ) { image.dispose ( ) ; } crosshairColor.dispose ( ) ; transform.dispose ( ) ; if ( ( grid ) != null ) { grid.dispose ( ) ; } }

Target:
public void dispose ( ) { super . dispose ( ) ; if ( ( image ) != null ) { image.dispose ( ) ; } crosshairColor.dispose ( ) ; transform.dispose ( ) ; if ( ( grid ) != null ) { grid.dispose ( ) ; } }
Source:
public java.lang.Boolean bluetoothHidDeviceReportError ( @ com.googlecode.android_scripting.rpc.RpcParameter ( name = "deviceID" , description = "Name or MAC address of a bluetooth device." ) java.lang.String deviceID , @ com.googlecode.android_scripting.rpc.RpcParameter ( name = "error" , description = "Error byte" ) java.lang.Integer error ) throws java.lang.Exception { android.bluetooth.BluetoothDevice device = com.googlecode.android_scripting.facade.bluetooth.BluetoothFacade.getDevice ( com.googlecode.android_scripting.facade.bluetooth.BluetoothHidDeviceFacade.sHidDeviceProfile.getConnectedDevices ( ) , deviceID ) ; return com.googlecode.android_scripting.facade.bluetooth.BluetoothHidDeviceFacade.sHidDeviceProfile.reportError ( device , ( ( byte ) ( ( int ) ( error ) ) ) ) ; }

Target:
public java.lang.Boolean bluetoothHidDeviceReportError ( @ com.googlecode.android_scripting.rpc.RpcParameter ( name = "deviceID" , description = "Name or MAC address of a bluetooth device." ) java.lang.String deviceID , @ com.googlecode.android_scripting.rpc.RpcParameter ( name = "error" , description = "Error byte" ) java.lang.Integer error ) throws java.lang.Exception { if ( ( com.googlecode.android_scripting.facade.bluetooth.BluetoothHidDeviceFacade.sHidDeviceProfile ) == null ) { return false ; } android.bluetooth.BluetoothDevice device = com.googlecode.android_scripting.facade.bluetooth.BluetoothFacade.getDevice ( com.googlecode.android_scripting.facade.bluetooth.BluetoothHidDeviceFacade.sHidDeviceProfile.getConnectedDevices ( ) , deviceID ) ; return com.googlecode.android_scripting.facade.bluetooth.BluetoothHidDeviceFacade.sHidDeviceProfile.reportError ( device , ( ( byte ) ( ( int ) ( error ) ) ) ) ; }
Source:
public void onDeviceOpened ( android.media.midi.IMidiDeviceServer server , android.os.IBinder deviceToken ) { android.media.midi.MidiDevice device = null ; if ( server != null ) { try { android.media.midi.MidiDeviceInfo deviceInfo = server.getDeviceInfo ( ) ; device = new android.media.midi.MidiDevice ( deviceInfo , server , mService , mToken , deviceToken ) ; sendOpenDeviceResponse ( device , listenerF , handlerF ) ; } catch ( android.os.RemoteException e ) { android.util.Log.e ( android.media.midi.MidiManager.TAG , "remote exception in getDeviceInfo()" ) ; } } sendOpenDeviceResponse ( device , listenerF , handlerF ) ; }

Target:
public void onDeviceOpened ( android.media.midi.IMidiDeviceServer server , android.os.IBinder deviceToken ) { android.media.midi.MidiDevice device = null ; if ( server != null ) { try { android.media.midi.MidiDeviceInfo deviceInfo = server.getDeviceInfo ( ) ; device = new android.media.midi.MidiDevice ( deviceInfo , server , mService , mToken , deviceToken ) ; } catch ( android.os.RemoteException e ) { android.util.Log.e ( android.media.midi.MidiManager.TAG , "remote exception in getDeviceInfo()" ) ; } } sendOpenDeviceResponse ( device , listenerF , handlerF ) ; }
Source:
public static com.android.jack.Options buildCommandLineArgs ( @ javax.annotation.Nonnull java.io.File fileOrSourcelist , @ javax.annotation.CheckForNull java.io.File jarjarRules ) throws java.io.IOException { com.android.jack.Options options = com.android.jack.TestTools.buildCommandLineArgs ( null , new java.io.File [ ] { fileOrSourcelist } ) ; options.setJarjarRulesFile ( jarjarRules ) ; return options ; }

Target:
public static com.android.jack.Options buildCommandLineArgs ( @ javax.annotation.Nonnull java.io.File fileOrSourcelist , @ javax.annotation.CheckForNull java.io.File jarjarRules ) throws java.io.IOException { com.android.jack.Options options = com.android.jack.TestTools.buildCommandLineArgs ( null , new java.io.File [ ] { fileOrSourcelist } ) ; if ( jarjarRules != null ) { options.setJarjarRulesFile ( jarjarRules ) ; } return options ; }
Source:
private android.bluetooth.BluetoothGattDescriptor getDescriptor ( ) { android.bluetooth.BluetoothGattCharacteristic characteristic = getCharacteristic ( com.android.cts.verifier.bluetooth.BleServerService.CHARACTERISTIC_UUID ) ; if ( characteristic == null ) return null ; android.bluetooth.BluetoothGattDescriptor descriptor = characteristic.getDescriptor ( com.android.cts.verifier.bluetooth.BleServerService.DESCRIPTOR_UUID ) ; if ( descriptor == null ) { showMessage ( "Descriptor not found" ) ; return null ; } return descriptor ; }

Target:
private android.bluetooth.BluetoothGattDescriptor getDescriptor ( ) { android.bluetooth.BluetoothGattDescriptor descriptor = null ; android.bluetooth.BluetoothGattCharacteristic characteristic = getCharacteristic ( com.android.cts.verifier.bluetooth.BleServerService.CHARACTERISTIC_UUID ) ; if ( characteristic != null ) { descriptor = characteristic.getDescriptor ( com.android.cts.verifier.bluetooth.BleServerService.DESCRIPTOR_UUID ) ; if ( descriptor == null ) { showMessage ( "Descriptor not found" ) ; } } return descriptor ; }
Source:
void handleReturnCode ( ) { targetArgs.doPostInstall ( mRet ) ; int currentStatus = android.content.pm.PackageManager.MOVE_FAILED_INTERNAL_ERROR ; if ( ( mRet ) == ( android.content.pm.PackageManager.INSTALL_SUCCEEDED ) ) { currentStatus = android.content.pm.PackageManager.MOVE_SUCCEEDED ; } else if ( ( mRet ) == ( android.content.pm.PackageManager.INSTALL_FAILED_INSUFFICIENT_STORAGE ) ) { currentStatus = android.content.pm.PackageManager.MOVE_FAILED_INSUFFICIENT_STORAGE ; } processPendingMove ( this , currentStatus ) ; }

Target:
void handleReturnCode ( ) { targetArgs.doPostInstall ( mRet , uid ) ; int currentStatus = android.content.pm.PackageManager.MOVE_FAILED_INTERNAL_ERROR ; if ( ( mRet ) == ( android.content.pm.PackageManager.INSTALL_SUCCEEDED ) ) { currentStatus = android.content.pm.PackageManager.MOVE_SUCCEEDED ; } else if ( ( mRet ) == ( android.content.pm.PackageManager.INSTALL_FAILED_INSUFFICIENT_STORAGE ) ) { currentStatus = android.content.pm.PackageManager.MOVE_FAILED_INSUFFICIENT_STORAGE ; } processPendingMove ( this , currentStatus ) ; }
Source:
private com.android.jack.dx.rop.code.InsnList convertInsns ( java.util.ArrayList < com.android.jack.dx.ssa.SsaInsn > ssaInsns ) { int insnCount = ssaInsns.size ( ) ; com.android.jack.dx.rop.code.InsnList result = new com.android.jack.dx.rop.code.InsnList ( insnCount ) ; for ( int i = 0 ; i < insnCount ; i ++ ) { result.set ( i , ssaInsns.get ( i ) . toRopInsn ( ) ) ; } result.setImmutable ( ) ; return result ; }

Target:
private com.android.jack.dx.rop.code.InsnList convertInsns ( java.util.List < com.android.jack.dx.ssa.SsaInsn > ssaInsns ) { int insnCount = ssaInsns.size ( ) ; com.android.jack.dx.rop.code.InsnList result = new com.android.jack.dx.rop.code.InsnList ( insnCount ) ; for ( int i = 0 ; i < insnCount ; i ++ ) { result.set ( i , ssaInsns.get ( i ) . toRopInsn ( ) ) ; } result.setImmutable ( ) ; return result ; }
Source:
private void tearDown ( ) { android.os.Trace.beginSection ( "InCallServiceImpl.tearDown" ) ; com.android.incallui.Log.v ( this , "tearDown" ) ; com.android.incallui.call.TelecomAdapter.getInstance ( ) . clearInCallService ( ) ; com.android.incallui.InCallPresenter.getInstance ( ) . tearDown ( ) ; if ( ( returnToCallController ) != null ) { returnToCallController.tearDown ( ) ; returnToCallController = null ; } android.os.Trace.endSection ( ) ; }

Target:
private void tearDown ( ) { android.os.Trace.beginSection ( "InCallServiceImpl.tearDown" ) ; com.android.incallui.Log.v ( this , "tearDown" ) ; com.android.incallui.InCallPresenter.getInstance ( ) . tearDown ( ) ; com.android.incallui.call.TelecomAdapter.getInstance ( ) . clearInCallService ( ) ; if ( ( returnToCallController ) != null ) { returnToCallController.tearDown ( ) ; returnToCallController = null ; } android.os.Trace.endSection ( ) ; }
Source:
private static java.lang.StringBuffer getPathFromDirInternal ( @ javax.annotation.Nonnull com.android.sched.vfs.ParentVDir baseDir , @ javax.annotation.Nonnull com.android.sched.vfs.ParentVDir currentDir ) { if ( baseDir == currentDir ) { return new java.lang.StringBuffer ( ) ; } com.android.sched.vfs.ParentVDir currentParent = ( ( com.android.sched.vfs.ParentVDir ) ( currentDir.getParent ( ) ) ) ; assert currentParent != null ; return com.android.sched.vfs.DirectFS.getPathFromDirInternal ( baseDir , currentParent ) . append ( currentDir.getName ( ) ) . append ( '/' ) ; }

Target:
private static java.lang.StringBuilder getPathFromDirInternal ( @ javax.annotation.Nonnull com.android.sched.vfs.ParentVDir baseDir , @ javax.annotation.Nonnull com.android.sched.vfs.ParentVDir currentDir ) { if ( baseDir == currentDir ) { return new java.lang.StringBuilder ( ) ; } com.android.sched.vfs.ParentVDir currentParent = ( ( com.android.sched.vfs.ParentVDir ) ( currentDir.getParent ( ) ) ) ; assert currentParent != null ; return com.android.sched.vfs.DirectFS.getPathFromDirInternal ( baseDir , currentParent ) . append ( currentDir.getName ( ) ) . append ( '/' ) ; }
Source:
static void native_drawRGB ( int nativeCanvas , int r , int g , int b ) { android.graphics.Canvas_Delegate.native_drawColor ( nativeCanvas , ( ( ( - 16777216 | ( r << 16 ) ) | ( ( g & 255 ) << 8 ) ) | ( b & 255 ) ) , PorterDuff.Mode.SRC_OVER.nativeInt ) ; }

Target:
static void native_drawRGB ( long nativeCanvas , int r , int g , int b ) { android.graphics.Canvas_Delegate.native_drawColor ( nativeCanvas , ( ( ( - 16777216 | ( r << 16 ) ) | ( ( g & 255 ) << 8 ) ) | ( b & 255 ) ) , PorterDuff.Mode.SRC_OVER.nativeInt ) ; }
Source:
public boolean isIncomingCallPermitted ( android.telecom.PhoneAccountHandle phoneAccountHandle ) { com.android.internal.telecom.ITelecomService service = getTelecomService ( ) ; if ( service != null ) { try { return service.isIncomingCallPermitted ( phoneAccountHandle ) ; } catch ( android.os.RemoteException e ) { android.util.Log.e ( android.telecom.TelecomManager.TAG , "Error isIncomingCallPermitted" , e ) ; } } return false ; }

Target:
public boolean isIncomingCallPermitted ( android.telecom.PhoneAccountHandle phoneAccountHandle ) { if ( phoneAccountHandle == null ) { return false ; } com.android.internal.telecom.ITelecomService service = getTelecomService ( ) ; if ( service != null ) { try { return service.isIncomingCallPermitted ( phoneAccountHandle ) ; } catch ( android.os.RemoteException e ) { android.util.Log.e ( android.telecom.TelecomManager.TAG , "Error isIncomingCallPermitted" , e ) ; } } return false ; }
Source:
public void testDisconnect ( ) { testSnkPlay ( ) ; mStreamHandler.handleMessage ( mStreamHandler.obtainMessage ( A2dpSinkStreamHandler.DISCONNECT ) ) ; verify ( mMockAudioManager , times ( 1 ) ) . abandonAudioFocus ( any ( ) ) ; verify ( mMockA2dpSink , times ( 1 ) ) . informAudioFocusStateNative ( 0 ) ; }

Target:
public void testDisconnect ( ) { testSnkPlay ( ) ; mStreamHandler.handleMessage ( mStreamHandler.obtainMessage ( A2dpSinkStreamHandler.DISCONNECT ) ) ; verify ( mMockAudioManager , times ( 0 ) ) . abandonAudioFocus ( any ( ) ) ; verify ( mMockA2dpSink , times ( 0 ) ) . informAudioFocusStateNative ( 0 ) ; }
Source:
public static void main ( java.lang.String [ ] args ) throws java.lang.Exception { java.lang.Class < ? > c = java.lang.Class.forName ( "Test" ) ; java.lang.reflect.Method m = c.getMethod ( "SingleGotoStart" , ( ( java.lang.Class [ ] ) ( null ) ) ) ; java.lang.Integer result = ( ( java.lang.Integer ) ( m.invoke ( null ) ) ) ; if ( result != 5 ) { throw new java.lang.Error ( ( "Expected 5, got " + result ) ) ; } }

Target:
public static void main ( java.lang.String [ ] args ) throws java.lang.Exception { java.lang.Class < ? > c = java.lang.Class.forName ( "Test" ) ; java.lang.reflect.Method m = c.getMethod ( "SingleGotoStart" ) ; java.lang.Integer result = ( ( java.lang.Integer ) ( m.invoke ( null ) ) ) ; if ( result != 5 ) { throw new java.lang.Error ( ( "Expected 5, got " + result ) ) ; } }
Source:
public boolean getTxPktFates ( com.android.server.wifi.WifiNative.TxFateReport [ ] reportBufs ) { if ( com.android.server.wifi.WifiNative.HIDL_VENDOR_ENABLE ) { return mWifiVendorHal.getTxPktFates ( reportBufs ) ; } else { synchronized ( com.android.server.wifi.WifiNative.sLock ) { if ( isHalStarted ( ) ) { int res = com.android.server.wifi.WifiNative.getTxPktFatesNative ( com.android.server.wifi.WifiNative.sWlan0Index , reportBufs ) ; if ( res != ( com.android.server.wifi.WifiNative.WIFI_SUCCESS ) ) { android.util.Log.e ( com.android.server.wifi.WifiNative.TAG , ( "getTxPktFatesNative returned " + res ) ) ; return false ; } else { return true ; } } else { return false ; } } } }

Target:
public boolean getTxPktFates ( com.android.server.wifi.WifiNative.TxFateReport [ ] reportBufs ) { return mWifiVendorHal.getTxPktFates ( reportBufs ) ; }
Source:
public void bleSetScanFilterServiceData ( @ com.googlecode.android_scripting.rpc.RpcParameter ( name = "serviceUuid" ) java.lang.String serviceUuid , @ com.googlecode.android_scripting.rpc.RpcParameter ( name = "serviceData" ) java.lang.String serviceData , @ com.googlecode.android_scripting.rpc.RpcParameter ( name = "serviceDataMask" ) java.lang.String serviceDataMask ) { if ( serviceDataMask != null ) { mScanFilterBuilder.setServiceData ( android.os.ParcelUuid.fromString ( serviceUuid ) , com.googlecode.android_scripting.ConvertUtils.convertStringToByteArray ( serviceData ) , com.googlecode.android_scripting.ConvertUtils.convertStringToByteArray ( serviceDataMask ) ) ; } else { mScanFilterBuilder.setServiceData ( android.os.ParcelUuid.fromString ( serviceUuid ) , com.googlecode.android_scripting.ConvertUtils.convertStringToByteArray ( serviceData ) ) ; } }

Target:
public void bleSetScanFilterServiceData ( @ com.googlecode.android_scripting.rpc.RpcParameter ( name = "serviceUuid" ) java.lang.String serviceUuid , @ com.googlecode.android_scripting.rpc.RpcParameter ( name = "serviceData" ) byte [ ] serviceData , @ com.googlecode.android_scripting.rpc.RpcParameter ( name = "serviceDataMask" ) byte [ ] serviceDataMask ) { if ( serviceDataMask != null ) { mScanFilterBuilder.setServiceData ( android.os.ParcelUuid.fromString ( serviceUuid ) , serviceData , serviceDataMask ) ; } else { mScanFilterBuilder.setServiceData ( android.os.ParcelUuid.fromString ( serviceUuid ) , serviceData ) ; } }
Source:
public void registerContentObservers ( android.content.Context appContext ) { com.android.dialer.common.LogUtil.enterBlock ( "CallLogFramework.registerContentObservers" ) ; if ( com.android.dialer.configprovider.ConfigProviderBindings.get ( appContext ) . getBoolean ( "is_nui_shortcut_enabled" , false ) ) { for ( com.android.dialer.calllog.datasources.CallLogDataSource dataSource : dataSources.getDataSourcesIncludingSystemCallLog ( ) ) { dataSource.registerContentObservers ( appContext ) ; } } else { com.android.dialer.common.LogUtil.i ( "CallLogFramework.registerContentObservers" , "not registering content observers" ) ; } }

Target:
public void registerContentObservers ( ) { com.android.dialer.common.LogUtil.enterBlock ( "CallLogFramework.registerContentObservers" ) ; if ( com.android.dialer.configprovider.ConfigProviderBindings.get ( appContext ) . getBoolean ( "is_nui_shortcut_enabled" , false ) ) { for ( com.android.dialer.calllog.datasources.CallLogDataSource dataSource : dataSources.getDataSourcesIncludingSystemCallLog ( ) ) { dataSource.registerContentObservers ( appContext ) ; } } else { com.android.dialer.common.LogUtil.i ( "CallLogFramework.registerContentObservers" , "not registering content observers" ) ; } }
Source:
private final void setProcessTrackerStateLocked ( com.android.server.am.ProcessRecord proc , int memFactor , long now ) { if ( ( proc.thread ) != null ) { if ( ( proc.baseProcessTracker ) != null ) { proc.baseProcessTracker.setState ( proc.repProcState , memFactor , now , proc.pkgList ) ; } if ( ( proc.repProcState ) >= 0 ) { mBatteryStatsService.noteProcessState ( proc.processName , proc.info.uid , proc.repProcState ) ; } } }

Target:
private final void setProcessTrackerStateLocked ( com.android.server.am.ProcessRecord proc , int memFactor , long now ) { if ( ( proc.thread ) != null ) { if ( ( proc.baseProcessTracker ) != null ) { proc.baseProcessTracker.setState ( proc.repProcState , memFactor , now , proc.pkgList ) ; } } }
Source:
private com.android.jack.ir.ast.JFieldId getOrCreateAssertionstatusField ( @ javax.annotation.Nonnull com.android.jack.transformations.request.TransformationRequest request ) { try { com.android.jack.ir.ast.JFieldId id = currentType.getFieldId ( com.android.jack.transformations.assertion.DynamicAssertionTransformer.ASSERTION_FIELD_NAME , JPrimitiveTypeEnum.BOOLEAN.getType ( ) , FieldKind.STATIC ) ; com.android.jack.ir.ast.JField field = id.getField ( ) ; assert field != null ; if ( field.getEnclosingType ( ) . isSameType ( currentType ) ) { return id ; } } catch ( com.android.jack.lookup.JLookupException e ) { } return addAssertionStatusToType ( currentType , request ) ; }

Target:
private com.android.jack.ir.ast.JFieldId getOrCreateAssertionstatusField ( @ javax.annotation.Nonnull com.android.jack.transformations.request.TransformationRequest request ) { try { com.android.jack.ir.ast.JFieldId id = currentType.getFieldId ( com.android.jack.transformations.assertion.DynamicAssertionTransformer.ASSERTION_FIELD_NAME , JPrimitiveTypeEnum.BOOLEAN.getType ( ) , FieldKind.STATIC ) ; com.android.jack.ir.ast.JField field = id.getField ( ) ; if ( ( field != null ) && ( field.getEnclosingType ( ) . isSameType ( currentType ) ) ) { return id ; } } catch ( com.android.jack.lookup.JLookupException e ) { } return addAssertionStatusToType ( currentType , request ) ; }
Source:
public long getTagBits ( ) { long tagBits = com.android.jack.ecj.loader.jast.AnnotationUtils.getTagBits ( jDeclaredType ) ; com.android.jack.ir.ast.JClassOrInterface enclosingType = jDeclaredType.getEnclosingType ( ) ; if ( ( enclosingType != null ) && ( ! ( isAnonymous ( ) ) ) ) { com.android.jack.ecj.loader.jast.JAstBinaryType enclosing = classpathLocation.findType ( enclosingType ) ; if ( enclosing != null ) { if ( com.android.jack.ecj.loader.jast.LoaderUtils.isDeprecated ( enclosing ) ) { tagBits |= org.eclipse.jdt.internal.compiler.lookup.ExtraCompilerModifiers.AccDeprecatedImplicitly ; } } } return tagBits ; }

Target:
public long getTagBits ( ) { return com.android.jack.ecj.loader.jast.AnnotationUtils.getTagBits ( jDeclaredType ) ; }
Source:
private java.security.cert.X509Certificate [ ] setX509Certificate ( ) { try { java.security.cert.CertificateFactory certFact = java.security.cert.CertificateFactory.getInstance ( "X.509" ) ; java.security.cert.X509Certificate pemCert = ( ( java.security.cert.X509Certificate ) ( certFact.generateCertificate ( new java.io.ByteArrayInputStream ( org.apache.harmony.security.tests.support.cert.TestUtils.getX509Certificate_v3 ( ) ) ) ) ) ; java.security.cert.X509Certificate [ ] xcert = new java.security.cert.X509Certificate [ ] { pemCert } ; return xcert ; } catch ( java.lang.Exception ex ) { fail ( ( "Unexpected exception " + ex ) ) ; } return null ; }

Target:
private java.security.cert.X509Certificate [ ] setX509Certificate ( ) throws java.lang.Exception { java.security.cert.CertificateFactory certFact = java.security.cert.CertificateFactory.getInstance ( "X.509" ) ; java.security.cert.X509Certificate pemCert = ( ( java.security.cert.X509Certificate ) ( certFact.generateCertificate ( new java.io.ByteArrayInputStream ( org.apache.harmony.security.tests.support.cert.TestUtils.getX509Certificate_v3 ( ) ) ) ) ) ; java.security.cert.X509Certificate [ ] xcert = new java.security.cert.X509Certificate [ ] { pemCert } ; return xcert ; }
Source:
public void testChangedSynchronized ( ) { java.lang.String [ ] args = new java.lang.String [ ] { "test/api/constants.xml" , "test/api/changed-synchronized.xml" } ; com.google.doclava.apicheck.ApiCheck apiCheck = new com.google.doclava.apicheck.ApiCheck ( ) ; com.google.doclava.apicheck.ApiCheck.Report report = apiCheck.checkApi ( args ) ; assertEquals ( 1 , report.errors ( ) . size ( ) ) ; assertEquals ( Errors.CHANGED_SYNCHRONIZED , report.errors ( ) . iterator ( ) . next ( ) . error ( ) ) ; }

Target:
public void testChangedSynchronized ( ) { java.lang.String [ ] args = new java.lang.String [ ] { "test/api/constants.xml" , "test/api/changed-synchronized.xml" } ; com.google.doclava.apicheck.ApiCheck apiCheck = new com.google.doclava.apicheck.ApiCheck ( ) ; com.google.doclava.apicheck.ApiCheck.Report report = apiCheck.checkApi ( args ) ; assertEquals ( 0 , report.errors ( ) . size ( ) ) ; }
Source:
synchronized void nAllocationData2D ( int id , int xoff , int yoff , int mip , int face , int w , int h , float [ ] d , int sizeBytes ) { validate ( ) ; rsnAllocationData2D ( mContext , id , xoff , yoff , mip , face , w , h , d , sizeBytes ) ; }

Target:
synchronized void nAllocationData2D ( long id , int xoff , int yoff , int mip , int face , int w , int h , float [ ] d , int sizeBytes ) { validate ( ) ; rsnAllocationData2D ( mContext , id , xoff , yoff , mip , face , w , h , d , sizeBytes ) ; }
Source:
private void unregisterForSimRecordEvents ( ) { com.android.internal.telephony.uicc.IccRecords r = mIccRecords.get ( ) ; if ( r == null ) { return ; } r.unregisterForNetworkSelectionModeAutomatic ( this ) ; r.unregisterForNewSms ( this ) ; r.unregisterForRecordsEvents ( this ) ; r.unregisterForRecordsLoaded ( this ) ; }

Target:
private void unregisterForSimRecordEvents ( ) { com.android.internal.telephony.uicc.IccRecords r = mIccRecords.get ( ) ; if ( r == null ) { return ; } r.unregisterForNetworkSelectionModeAutomatic ( this ) ; r.unregisterForRecordsEvents ( this ) ; r.unregisterForRecordsLoaded ( this ) ; }
Source:
private void writeLabelInsn ( @ javax.annotation.Nonnegative int insnIdx ) throws java.io.IOException { sourceInfoWriter.writeDebugBegin ( currentClass , currentLine ) ; writer.writeCatchBlockIds ( currentCatchList ) ; writer.writeKeyword ( Token.LABELED_STATEMENT ) ; writer.writeOpen ( ) ; java.lang.String id = java.lang.Integer.toString ( insnIdx ) ; writer.writeString ( id ) ; writer.writeId ( id ) ; writeEmptyBlock ( ) ; sourceInfoWriter.writeDebugEnd ( currentClass , ( ( currentLine ) + 1 ) ) ; writer.writeClose ( ) ; }

Target:
private void writeLabelInsn ( @ javax.annotation.Nonnegative int insnIdx ) throws java.io.IOException { writeDebugBegin ( currentClass , currentLine ) ; writer.writeCatchBlockIds ( currentCatchList ) ; writer.writeKeyword ( Token.LABELED_STATEMENT ) ; writer.writeOpen ( ) ; java.lang.String id = java.lang.Integer.toString ( insnIdx ) ; writer.writeString ( id ) ; writer.writeId ( id ) ; writeEmptyBlock ( ) ; writeDebugEnd ( currentClass , currentLine ) ; writer.writeClose ( ) ; }
Source:
public void testOutgoingCallSelectPhoneAccountNoVideo ( ) throws java.lang.Exception { startOutgoingPhoneCallPendingCreateConnection ( "650-555-1212" , null , mConnectionServiceFixtureA , java.lang.Process.myUserHandle ( ) , VideoProfile.STATE_BIDIRECTIONAL ) ; android.telecom.com.android.server.telecom.Call call = mTelecomSystem.getCallsManager ( ) . getCalls ( ) . iterator ( ) . next ( ) ; assert call.isVideoCallingSupported ( ) ; assertEquals ( VideoProfile.STATE_BIDIRECTIONAL , call.getVideoState ( ) ) ; call.setTargetPhoneAccount ( mPhoneAccountA2.getAccountHandle ( ) ) ; assert ! ( call.isVideoCallingSupported ( ) ) ; assertEquals ( VideoProfile.STATE_AUDIO_ONLY , call.getVideoState ( ) ) ; }

Target:
public void testOutgoingCallSelectPhoneAccountNoVideo ( ) throws java.lang.Exception { startOutgoingPhoneCallPendingCreateConnection ( "650-555-1212" , null , mConnectionServiceFixtureA , java.lang.Process.myUserHandle ( ) , VideoProfile.STATE_BIDIRECTIONAL ) ; android.telecom.com.android.server.telecom.Call call = mTelecomSystem.getCallsManager ( ) . getCalls ( ) . iterator ( ) . next ( ) ; assert call.isVideoCallingSupported ( ) ; org.junit.Assert.assertEquals ( VideoProfile.STATE_BIDIRECTIONAL , call.getVideoState ( ) ) ; call.setTargetPhoneAccount ( mPhoneAccountA2.getAccountHandle ( ) ) ; assert ! ( call.isVideoCallingSupported ( ) ) ; org.junit.Assert.assertEquals ( VideoProfile.STATE_AUDIO_ONLY , call.getVideoState ( ) ) ; }
Source:
public void test_allAvailableCharsets ( ) throws java.lang.Exception { for ( java.lang.String charsetName : java.nio.charset.Charset.availableCharsets ( ) . keySet ( ) ) { if ( charsetName.equals ( "UTF-32" ) ) { continue ; } java.nio.charset.Charset cs = java.nio.charset.Charset.forName ( charsetName ) ; assertNotNull ( cs.newDecoder ( ) ) ; if ( cs.canEncode ( ) ) { java.nio.charset.CharsetEncoder enc = cs.newEncoder ( ) ; assertNotNull ( enc ) ; assertNotNull ( enc.replacement ( ) ) ; } } }

Target:
public void test_allAvailableCharsets ( ) throws java.lang.Exception { for ( java.lang.String charsetName : java.nio.charset.Charset.availableCharsets ( ) . keySet ( ) ) { java.nio.charset.Charset cs = java.nio.charset.Charset.forName ( charsetName ) ; assertNotNull ( cs.newDecoder ( ) ) ; if ( cs.canEncode ( ) ) { java.nio.charset.CharsetEncoder enc = cs.newEncoder ( ) ; assertNotNull ( enc ) ; assertNotNull ( enc.replacement ( ) ) ; } } }
Source:
public void test_ConstructorLjava_lang_StringI ( ) throws java.io.IOException { java.net.ServerSocket server = new java.net.ServerSocket ( 0 ) ; java.net.Socket client = new java.net.Socket ( java.net.InetAddress.getLocalHost ( ) , server.getLocalPort ( ) ) ; assertEquals ( "Failed to create socket" , server.getLocalPort ( ) , client.getPort ( ) ) ; java.net.ServerSocket ss = new java.net.ServerSocket ( 0 ) ; java.net.Socket s = new java.net.Socket ( "0.0.0.0" , ss.getLocalPort ( ) ) ; ss.close ( ) ; s.close ( ) ; }

Target:
public void test_ConstructorLjava_lang_StringI ( ) throws java.io.IOException { try ( java.net.ServerSocket server = new java.net.ServerSocket ( 0 ) ; java.net.Socket client = new java.net.Socket ( java.net.InetAddress.getLocalHost ( ) , server.getLocalPort ( ) ) ) { assertEquals ( "Failed to create socket" , server.getLocalPort ( ) , client.getPort ( ) ) ; } java.net.ServerSocket ss = new java.net.ServerSocket ( 0 ) ; java.net.Socket s = new java.net.Socket ( "0.0.0.0" , ss.getLocalPort ( ) ) ; ss.close ( ) ; s.close ( ) ; }
Source:
private void doBadPublishConfiguration ( java.lang.String serviceName , byte [ ] ssi , byte [ ] matchFilter ) throws java.lang.IllegalArgumentException { android.net.wifi.aware.PublishConfig publishConfig = new android.net.wifi.aware.PublishConfig ( serviceName.getBytes ( ) , ssi , matchFilter , android.net.wifi.aware.PublishConfig.PUBLISH_TYPE_UNSOLICITED , 0 , 0 , true ) ; int clientId = doConnect ( ) ; android.net.wifi.aware.IWifiAwareDiscoverySessionCallback mockCallback = org.mockito.Mockito.mock ( android.net.wifi.aware.IWifiAwareDiscoverySessionCallback.class ) ; mDut.publish ( clientId , publishConfig , mockCallback ) ; org.mockito.Mockito.verify ( mAwareStateManagerMock ) . publish ( clientId , publishConfig , mockCallback ) ; }

Target:
private void doBadPublishConfiguration ( java.lang.String serviceName , byte [ ] ssi , byte [ ] matchFilter ) throws java.lang.IllegalArgumentException { android.net.wifi.aware.PublishConfig publishConfig = new android.net.wifi.aware.PublishConfig ( serviceName.getBytes ( ) , ssi , matchFilter , android.net.wifi.aware.PublishConfig.PUBLISH_TYPE_UNSOLICITED , 0 , true ) ; int clientId = doConnect ( ) ; android.net.wifi.aware.IWifiAwareDiscoverySessionCallback mockCallback = org.mockito.Mockito.mock ( android.net.wifi.aware.IWifiAwareDiscoverySessionCallback.class ) ; mDut.publish ( clientId , publishConfig , mockCallback ) ; org.mockito.Mockito.verify ( mAwareStateManagerMock ) . publish ( clientId , publishConfig , mockCallback ) ; }
Source:
protected void createContents ( ) { org.eclipse.swt.custom.SashForm sashForm = new org.eclipse.swt.custom.SashForm ( mShell , org.eclipse.swt.SWT.NONE ) ; sashForm.setLayoutData ( new org.eclipse.swt.layout.GridData ( org.eclipse.swt.SWT.FILL , org.eclipse.swt.SWT.FILL , true , true , 2 , 1 ) ) ; mPageList = new org.eclipse.swt.widgets.List ( sashForm , org.eclipse.swt.SWT.BORDER ) ; mPageList.addSelectionListener ( new org.eclipse.swt.events.SelectionAdapter ( ) { @ java.lang.Override public void widgetSelected ( org.eclipse.swt.events.SelectionEvent e ) { onPageListSelected ( ) ; } } ) ; createPagesRoot ( sashForm ) ; sashForm.setWeights ( new int [ ] { 150 , 576 } ) ; }

Target:
private void createContents ( ) { org.eclipse.swt.custom.SashForm sashForm = new org.eclipse.swt.custom.SashForm ( mShell , org.eclipse.swt.SWT.NONE ) ; sashForm.setLayoutData ( new org.eclipse.swt.layout.GridData ( org.eclipse.swt.SWT.FILL , org.eclipse.swt.SWT.FILL , true , true , 2 , 1 ) ) ; mPageList = new org.eclipse.swt.widgets.List ( sashForm , org.eclipse.swt.SWT.BORDER ) ; mPageList.addSelectionListener ( new org.eclipse.swt.events.SelectionAdapter ( ) { @ java.lang.Override public void widgetSelected ( org.eclipse.swt.events.SelectionEvent e ) { onPageListSelected ( ) ; } } ) ; createPagesRoot ( sashForm ) ; sashForm.setWeights ( new int [ ] { 150 , 576 } ) ; }
Source:
public static int allToKeymaster ( java.util.Set < java.lang.Integer > userAuthenticators ) { int result = 0 ; for ( @ android.security.KeyStoreKeyConstraints.UserAuthenticatorEnum int userAuthenticator : userAuthenticators ) { result |= android.security.KeyStoreKeyConstraints.UserAuthenticator.toKeymaster ( userAuthenticator ) ; } return result ; }

Target:
public static int allToKeymaster ( @ android.security.KeyStoreKeyConstraints.UserAuthenticatorEnum int userAuthenticators ) { int result = 0 ; int userAuthenticator = 1 ; while ( userAuthenticators != 0 ) { if ( ( userAuthenticators & 1 ) != 0 ) { result |= android.security.KeyStoreKeyConstraints.UserAuthenticator.toKeymaster ( userAuthenticator ) ; } userAuthenticators >>>= 1 ; userAuthenticator <<= 1 ; } return result ; }
Source:
public void log ( final java.lang.String log ) { if ( acceptLog ( log , false ) ) { syncExec ( mLogDescription , new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { appendLine ( com.android.sdkuilib.internal.repository.sdkman2.LogWindow.TextStyle.DEFAULT , log ) ; } } ) ; if ( ( mSecondaryLog ) != null ) { mSecondaryLog.printf ( " %1$s" , log ) ; } } }

Target:
public void log ( final java.lang.String log ) { if ( acceptLog ( log , false ) ) { syncExec ( mLogDescription , new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { appendLine ( com.android.sdkuilib.internal.repository.sdkman2.LogWindow.TextStyle.DEFAULT , log ) ; } } ) ; if ( ( mSecondaryLog ) != null ) { mSecondaryLog.info ( " %1$s" , log ) ; } } }
Source:
private byte [ ] desugar ( org.objectweb.asm.ClassReader reader ) { org.objectweb.asm.ClassWriter writer = new org.objectweb.asm.ClassWriter ( org.objectweb.asm.ClassWriter.COMPUTE_MAXS ) ; com.google.devtools.build.android.desugar.DefaultMethodClassFixer fixer = new com.google.devtools.build.android.desugar.DefaultMethodClassFixer ( writer , classpathReader , DependencyCollector.NoWriteCollectors.FAIL_ON_MISSING , bootclassPath , classLoader ) ; reader.accept ( fixer , 0 ) ; return writer.toByteArray ( ) ; }

Target:
private byte [ ] desugar ( org.objectweb.asm.ClassReader reader ) { org.objectweb.asm.ClassWriter writer = new org.objectweb.asm.ClassWriter ( org.objectweb.asm.ClassWriter.COMPUTE_MAXS ) ; com.google.devtools.build.android.desugar.DefaultMethodClassFixer fixer = new com.google.devtools.build.android.desugar.DefaultMethodClassFixer ( writer , classpathReader , DependencyCollector.NoWriteCollectors.FAIL_ON_MISSING , null , bootclassPath , classLoader ) ; reader.accept ( fixer , 0 ) ; return writer.toByteArray ( ) ; }
Source:
public void testGroupedByIfaceEmpty ( ) throws java.lang.Exception { final android.net.NetworkStats uidStats = new android.net.NetworkStats ( android.net.NetworkStatsTest.TEST_START , 3 ) ; final android.net.NetworkStats grouped = uidStats.groupedByIface ( ) ; assertEquals ( 0 , uidStats.size ( ) ) ; assertEquals ( 0 , grouped.size ( ) ) ; }

Target:
public void testGroupedByIfaceEmpty ( ) throws java.lang.Exception { final android.net.NetworkStats uidStats = new android.net.NetworkStats ( android.net.NetworkStatsTest.TEST_START , 3 ) ; final android.net.NetworkStats grouped = uidStats.groupedByIface ( ) ; org.junit.Assert.assertEquals ( 0 , uidStats.size ( ) ) ; org.junit.Assert.assertEquals ( 0 , grouped.size ( ) ) ; }
Source:
public void test_getSendBufferSize ( ) throws java.lang.Exception { java.net.ServerSocket server = new java.net.ServerSocket ( 0 ) ; java.net.Socket client = new java.net.Socket ( java.net.InetAddress.getLocalHost ( ) , server.getLocalPort ( ) ) ; client.setSendBufferSize ( 134 ) ; assertTrue ( "Incorrect buffer size" , ( ( client.getSendBufferSize ( ) ) >= 134 ) ) ; client.close ( ) ; server.close ( ) ; }

Target:
public void test_getSendBufferSize ( ) throws java.lang.Exception { try ( java.net.ServerSocket server = new java.net.ServerSocket ( 0 ) ; java.net.Socket client = new java.net.Socket ( java.net.InetAddress.getLocalHost ( ) , server.getLocalPort ( ) ) ) { client.setSendBufferSize ( 134 ) ; assertTrue ( "Incorrect buffer size" , ( ( client.getSendBufferSize ( ) ) >= 134 ) ) ; } }
Source:
public com.android.sdklib.internal.repository.SdkSource [ ] getSources ( com.android.sdklib.internal.repository.SdkSourceCategory category ) { java.util.ArrayList < com.android.sdklib.internal.repository.SdkSource > list = mSources.get ( category ) ; if ( list == null ) { return new com.android.sdklib.internal.repository.SdkSource [ 0 ] ; } else { return list.toArray ( new com.android.sdklib.internal.repository.SdkSource [ list.size ( ) ] ) ; } }

Target:
public com.android.sdklib.internal.repository.SdkSource [ ] getSources ( com.android.sdklib.internal.repository.SdkSourceCategory category ) { synchronized ( mSources ) { java.util.ArrayList < com.android.sdklib.internal.repository.SdkSource > list = mSources.get ( category ) ; if ( list == null ) { return new com.android.sdklib.internal.repository.SdkSource [ 0 ] ; } else { return list.toArray ( new com.android.sdklib.internal.repository.SdkSource [ list.size ( ) ] ) ; } } }
Source:
private static void onBatteryChargingChanged ( android.content.Intent intent ) { assert ( org.chromium.base.PowerMonitor.sInstance ) != null ; 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:
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 ( ) ; }
Source:
public void canBeTethered ( ) throws java.lang.Exception { initStateMachine ( android.net.ConnectivityManager.TETHERING_BLUETOOTH ) ; dispatchCommand ( TetherInterfaceStateMachine.CMD_TETHER_REQUESTED ) ; org.mockito.InOrder inOrder = org.mockito.Mockito.inOrder ( mTetherHelper , mNMService ) ; inOrder.verify ( mNMService ) . tetherInterface ( com.android.server.connectivity.tethering.TetherInterfaceStateMachineTest.IFACE_NAME ) ; inOrder.verify ( mTetherHelper ) . notifyInterfaceStateChange ( com.android.server.connectivity.tethering.TetherInterfaceStateMachineTest.IFACE_NAME , mTestedSm , com.android.server.connectivity.tethering.IControlsTethering.STATE_TETHERED , android.net.ConnectivityManager.TETHER_ERROR_NO_ERROR ) ; org.mockito.Mockito.verifyNoMoreInteractions ( mNMService , mStatsService , mTetherHelper ) ; }

Target:
public void canBeTethered ( ) throws java.lang.Exception { initStateMachine ( android.net.ConnectivityManager.TETHERING_BLUETOOTH ) ; dispatchCommand ( TetherInterfaceStateMachine.CMD_TETHER_REQUESTED , com.android.server.connectivity.tethering.IControlsTethering.STATE_TETHERED ) ; org.mockito.InOrder inOrder = org.mockito.Mockito.inOrder ( mTetherHelper , mNMService ) ; inOrder.verify ( mNMService ) . tetherInterface ( com.android.server.connectivity.tethering.TetherInterfaceStateMachineTest.IFACE_NAME ) ; inOrder.verify ( mTetherHelper ) . notifyInterfaceStateChange ( com.android.server.connectivity.tethering.TetherInterfaceStateMachineTest.IFACE_NAME , mTestedSm , com.android.server.connectivity.tethering.IControlsTethering.STATE_TETHERED , android.net.ConnectivityManager.TETHER_ERROR_NO_ERROR ) ; org.mockito.Mockito.verifyNoMoreInteractions ( mNMService , mStatsService , mTetherHelper ) ; }
Source:
public android.bluetooth.BluetoothSocket createRfcommSocketToServiceRecord ( java.util.UUID uuid ) throws java.io.IOException { if ( ( isBluetoothEnabled ( ) ) == false ) { android.util.Log.e ( android.bluetooth.BluetoothDevice.TAG , "Bluetooth is not enabled" ) ; throw new java.io.IOException ( ) ; } return new android.bluetooth.BluetoothSocket ( BluetoothSocket.TYPE_RFCOMM , ( - 1 ) , true , true , this , ( - 1 ) , new android.os.ParcelUuid ( uuid ) ) ; }

Target:
public android.bluetooth.BluetoothSocket createRfcommSocketToServiceRecord ( java.util.UUID uuid ) throws java.io.IOException { if ( ! ( isBluetoothEnabled ( ) ) ) { android.util.Log.e ( android.bluetooth.BluetoothDevice.TAG , "Bluetooth is not enabled" ) ; throw new java.io.IOException ( ) ; } return new android.bluetooth.BluetoothSocket ( BluetoothSocket.TYPE_RFCOMM , ( - 1 ) , true , true , this , ( - 1 ) , new android.os.ParcelUuid ( uuid ) ) ; }
Source:
public java.util.List < android.bluetooth.BluetoothDevice > getDevicesMatchingConnectionStates ( int [ ] states ) { int clientState = - 1 ; android.bluetooth.BluetoothDevice currentDevice = null ; synchronized ( mLock ) { clientState = getConnectionState ( ) ; currentDevice = getDevice ( ) ; } java.util.List < android.bluetooth.BluetoothDevice > deviceList = new java.util.ArrayList < android.bluetooth.BluetoothDevice > ( ) ; for ( int state : states ) { if ( clientState == state ) { if ( currentDevice != null ) { deviceList.add ( currentDevice ) ; } } } return deviceList ; }

Target:
public java.util.List < android.bluetooth.BluetoothDevice > getDevicesMatchingConnectionStates ( int [ ] states ) { int clientState ; android.bluetooth.BluetoothDevice currentDevice ; synchronized ( mLock ) { clientState = getConnectionState ( ) ; currentDevice = getDevice ( ) ; } java.util.List < android.bluetooth.BluetoothDevice > deviceList = new java.util.ArrayList < android.bluetooth.BluetoothDevice > ( ) ; for ( int state : states ) { if ( clientState == state ) { if ( currentDevice != null ) { deviceList.add ( currentDevice ) ; } } } return deviceList ; }