auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void computeLogb ( android.renderscript.cts.TestLogb.ArgumentsFloatFloat args , android.renderscript.cts.Target t ) { t.setPrecision ( 0 , 0 , false ) ; android.renderscript.cts.Target.Floaty in = t.new32 ( args.in ) ; args.out = t.new32 ( android.renderscript.cts.CoreMathVerifier.logb ( in.mid32 ( ) ) , android.renderscript.cts.CoreMathVerifier.logb ( in.min32 ( ) ) , android.renderscript.cts.CoreMathVerifier.logb ( in.max32 ( ) ) ) ; }

Target:
public static void computeLogb ( android.renderscript.cts.TestLogb.ArgumentsFloatFloat args , android.renderscript.cts.Target t ) { t.setPrecision ( 0 , 0 , false ) ; android.renderscript.cts.Target.Floaty in = t.new32 ( args.inV ) ; args.out = t.new32 ( android.renderscript.cts.CoreMathVerifier.logb ( in.mid32 ( ) ) , android.renderscript.cts.CoreMathVerifier.logb ( in.min32 ( ) ) , android.renderscript.cts.CoreMathVerifier.logb ( in.max32 ( ) ) ) ; }
Source:
public void testNewInstanceString_ByteArrayCharsetConstructor ( ) { runTestNewInstanceString ( "([BLjava/nio/charset/Charset;)V" , "my test string" , new org.apache.harmony.jpda.tests.jdwp.ClassType.ConstructorArgumentsProvider ( ) { @ java.lang.Override public void provideConstructorArguments ( java.util.List < org.apache.harmony.jpda.tests.framework.jdwp.Value > constructorArguments ) { long debuggeeClassId = getClassIDBySignature ( getDebuggeeClassSignature ( ) ) ; org.apache.harmony.jpda.tests.framework.jdwp.Value byteArrayValue = getStaticFieldValue ( debuggeeClassId , "BYTE_ARRAY" ) ; org.apache.harmony.jpda.tests.framework.jdwp.Value charsetValue = getStaticFieldValue ( debuggeeClassId , "CHARSET" ) ; constructorArguments.add ( byteArrayValue ) ; constructorArguments.add ( charsetValue ) ; } } ) ; }

Target:
public void testNewInstanceString_ByteArrayCharsetConstructor ( ) { runTestNewInstanceString ( "([BLjava/nio/charset/Charset;)V" , new org.apache.harmony.jpda.tests.jdwp.ClassType.ConstructorArgumentsProvider ( ) { @ java.lang.Override public void provideConstructorArguments ( java.util.List < org.apache.harmony.jpda.tests.framework.jdwp.Value > constructorArguments ) { long debuggeeClassId = getClassIDBySignature ( getDebuggeeClassSignature ( ) ) ; org.apache.harmony.jpda.tests.framework.jdwp.Value byteArrayValue = getStaticFieldValue ( debuggeeClassId , "BYTE_ARRAY" ) ; org.apache.harmony.jpda.tests.framework.jdwp.Value charsetValue = getStaticFieldValue ( debuggeeClassId , "CHARSET" ) ; constructorArguments.add ( byteArrayValue ) ; constructorArguments.add ( charsetValue ) ; } } ) ; }
Source:
public void testSingleByteReadIsSigned ( ) throws java.io.IOException { server.enqueue ( new com.google.mockwebserver.MockResponse ( ) . setBody ( new byte [ ] { - 2 , - 1 } ) ) ; server.play ( ) ; java.net.URLConnection connection = server.getUrl ( "/" ) . openConnection ( ) ; java.io.InputStream in = connection.getInputStream ( ) ; assertEquals ( 254 , in.read ( ) ) ; assertEquals ( 255 , in.read ( ) ) ; assertEquals ( ( - 1 ) , in.read ( ) ) ; }

Target:
public void testSingleByteReadIsSigned ( ) throws java.io.IOException { server.enqueue ( new com.google.mockwebserver.MockResponse ( ) . setBody ( new byte [ ] { - 2 , - 1 } ) ) ; server.play ( ) ; java.net.URLConnection connection = server.getUrl ( "/" ) . openConnection ( ) ; java.io.InputStream in = connection.getInputStream ( ) ; org.junit.Assert.assertEquals ( 254 , in.read ( ) ) ; org.junit.Assert.assertEquals ( 255 , in.read ( ) ) ; org.junit.Assert.assertEquals ( ( - 1 ) , in.read ( ) ) ; }
Source:
private void addLocalFile ( org.eclipse.core.resources.IProject project , java.io.File source , java.lang.String destName , org.eclipse.core.runtime.IProgressMonitor monitor ) throws java.io.FileNotFoundException , org.eclipse.core.runtime.CoreException { org.eclipse.core.resources.IFile dest = project.getFile ( destName ) ; if ( ( dest.exists ( ) ) == false ) { java.io.FileInputStream stream = new java.io.FileInputStream ( source ) ; dest.create ( stream , false , new org.eclipse.core.runtime.SubProgressMonitor ( monitor , 10 ) ) ; } }

Target:
public static void addLocalFile ( org.eclipse.core.resources.IProject project , java.io.File source , java.lang.String destName , org.eclipse.core.runtime.IProgressMonitor monitor ) throws java.io.FileNotFoundException , org.eclipse.core.runtime.CoreException { org.eclipse.core.resources.IFile dest = project.getFile ( destName ) ; if ( ( dest.exists ( ) ) == false ) { java.io.FileInputStream stream = new java.io.FileInputStream ( source ) ; dest.create ( stream , false , new org.eclipse.core.runtime.SubProgressMonitor ( monitor , 10 ) ) ; } }
Source:
private static java.math.BigInteger trace ( org.bouncycastle.math.ec.ECFieldElement fe ) { org.bouncycastle.math.ec.ECFieldElement t = fe ; for ( int i = 0 ; i < ( ( fe.getFieldSize ( ) ) - 1 ) ; i ++ ) { t = t.square ( ) . add ( fe ) ; } return t.toBigInteger ( ) ; }

Target:
private static org.bouncycastle.math.ec.ECFieldElement trace ( org.bouncycastle.math.ec.ECFieldElement fe ) { org.bouncycastle.math.ec.ECFieldElement t = fe ; for ( int i = 1 ; i < ( fe.getFieldSize ( ) ) ; ++ i ) { t = t.square ( ) . add ( fe ) ; } return t ; }
Source:
public java.lang.String getCdmaEriTextForSubscriber ( int subId , java.lang.String callingPackage ) { if ( ! ( com.android.internal.telephony.TelephonyPermissions.checkCallingOrSelfReadPhoneState ( mApp , callingPackage , "getCdmaEriIconTextForSubscriber" ) ) ) { return null ; } final com.android.internal.telephony.Phone phone = getPhone ( subId ) ; if ( phone != null ) { return phone.getCdmaEriText ( ) ; } else { return null ; } }

Target:
public java.lang.String getCdmaEriTextForSubscriber ( int subId , java.lang.String callingPackage ) { if ( ! ( com.android.internal.telephony.TelephonyPermissions.checkCallingOrSelfReadPhoneState ( mApp , subId , callingPackage , "getCdmaEriIconTextForSubscriber" ) ) ) { return null ; } final com.android.internal.telephony.Phone phone = getPhone ( subId ) ; if ( phone != null ) { return phone.getCdmaEriText ( ) ; } else { return null ; } }
Source:
private void liveOutAtBlock ( ) { if ( ! ( visitedBlocks.get ( blockN.getIndex ( ) ) ) ) { visitedBlocks.set ( blockN.getIndex ( ) ) ; blockN.addLiveOut ( regV ) ; java.util.ArrayList < com.android.jack.dx.ssa.SsaInsn > insns ; insns = blockN.getInsns ( ) ; statementIndex = ( insns.size ( ) ) - 1 ; nextFunction = com.android.jack.dx.ssa.back.LivenessAnalyzer.NextFunction.LIVE_OUT_AT_STATEMENT ; } }

Target:
private void liveOutAtBlock ( ) { if ( ! ( visitedBlocks.get ( blockN.getIndex ( ) ) ) ) { visitedBlocks.set ( blockN.getIndex ( ) ) ; blockN.addLiveOut ( regV ) ; java.util.List < com.android.jack.dx.ssa.SsaInsn > insns ; insns = blockN.getInsns ( ) ; statementIndex = ( insns.size ( ) ) - 1 ; nextFunction = com.android.jack.dx.ssa.back.LivenessAnalyzer.NextFunction.LIVE_OUT_AT_STATEMENT ; } }
Source:
private boolean isPlayingState ( android.media.session.PlaybackState state ) { return ( ( state.getState ( ) ) == ( android.media.session.PlaybackState.STATE_PLAYING ) ) || ( ( state.getState ( ) ) == ( android.media.session.PlaybackState.STATE_BUFFERING ) ) ; }

Target:
private boolean isPlayingState ( @ android.annotation.Nullable android.media.session.PlaybackState state ) { if ( state == null ) return false ; return ( ( state != null ) && ( ( state.getState ( ) ) == ( android.media.session.PlaybackState.STATE_PLAYING ) ) ) || ( ( state.getState ( ) ) == ( android.media.session.PlaybackState.STATE_BUFFERING ) ) ; }
Source:
public void testParse_testFailed ( ) { java.lang.StringBuilder output = buildCommonResult ( ) ; addStackTrace ( output ) ; addFailureCode ( output ) ; mMockListener.testRunStarted ( com.android.ddmlib.testrunner.InstrumentationResultParserTest.RUN_NAME , 1 ) ; mMockListener.testStarted ( com.android.ddmlib.testrunner.InstrumentationResultParserTest.TEST_ID ) ; mMockListener.testFailed ( TestFailure.FAILURE , com.android.ddmlib.testrunner.InstrumentationResultParserTest.TEST_ID , com.android.ddmlib.testrunner.InstrumentationResultParserTest.STACK_TRACE ) ; mMockListener.testEnded ( com.android.ddmlib.testrunner.InstrumentationResultParserTest.TEST_ID , java.util.Collections.EMPTY_MAP ) ; mMockListener.testRunEnded ( 0 , java.util.Collections.EMPTY_MAP ) ; injectAndVerifyTestString ( output.toString ( ) ) ; }

Target:
public void testParse_testFailed ( ) { java.lang.StringBuilder output = buildCommonResult ( ) ; addStackTrace ( output ) ; addFailureCode ( output ) ; mMockListener.testRunStarted ( com.android.ddmlib.testrunner.InstrumentationResultParserTest.RUN_NAME , 1 ) ; mMockListener.testStarted ( com.android.ddmlib.testrunner.InstrumentationResultParserTest.TEST_ID ) ; mMockListener.testFailed ( com.android.ddmlib.testrunner.InstrumentationResultParserTest.TEST_ID , com.android.ddmlib.testrunner.InstrumentationResultParserTest.STACK_TRACE ) ; mMockListener.testEnded ( com.android.ddmlib.testrunner.InstrumentationResultParserTest.TEST_ID , java.util.Collections.EMPTY_MAP ) ; mMockListener.testRunEnded ( 0 , java.util.Collections.EMPTY_MAP ) ; injectAndVerifyTestString ( output.toString ( ) ) ; }
Source:
protected boolean cleanup ( ) { unregisterReceiver ( mConnectionStateChangedReceiver ) ; if ( ( mStateMachine ) != null ) { mStateMachine.cleanup ( ) ; } if ( ( mAvrcp ) != null ) { mAvrcp.cleanup ( ) ; mAvrcp = null ; } com.android.bluetooth.a2dp.A2dpService.clearA2dpService ( ) ; return true ; }

Target:
protected boolean cleanup ( ) { if ( ( mConnectionStateChangedReceiver ) != null ) { unregisterReceiver ( mConnectionStateChangedReceiver ) ; mConnectionStateChangedReceiver = null ; } if ( ( mStateMachine ) != null ) { mStateMachine.cleanup ( ) ; mStateMachine = null ; } if ( ( mAvrcp ) != null ) { mAvrcp.cleanup ( ) ; mAvrcp = null ; } com.android.bluetooth.a2dp.A2dpService.clearA2dpService ( ) ; return true ; }
Source:
static void native_drawCircle ( int nativeCanvas , float cx , float cy , float radius , int paint ) { android.graphics.Canvas_Delegate.native_drawOval ( nativeCanvas , new android.graphics.RectF ( ( cx - radius ) , ( cy - radius ) , ( cx + radius ) , ( cy + radius ) ) , paint ) ; }

Target:
static void native_drawCircle ( long nativeCanvas , float cx , float cy , float radius , long paint ) { android.graphics.Canvas_Delegate.native_drawOval ( nativeCanvas , new android.graphics.RectF ( ( cx - radius ) , ( cy - radius ) , ( cx + radius ) , ( cy + radius ) ) , paint ) ; }
Source:
private static boolean isIncrementalCompilation ( @ javax.annotation.Nonnull com.android.jack.Options options ) { if ( ( ( ( ! ( options.getEcjArguments ( ) . isEmpty ( ) ) ) && ( com.android.sched.util.config.ThreadConfig.get ( Options.GENERATE_DEX_FILE ) . booleanValue ( ) ) ) && ( com.android.sched.util.config.ThreadConfig.get ( com.android.jack.experimental.incremental.JackIncremental.GENERATE_COMPILER_STATE ) . booleanValue ( ) ) ) && ( com.android.jack.experimental.incremental.JackIncremental.getCompilerState ( ) . exists ( ) ) ) { return true ; } return false ; }

Target:
private static boolean isIncrementalCompilation ( @ javax.annotation.Nonnull com.android.jack.Options options ) { if ( ( ! ( options.getEcjArguments ( ) . isEmpty ( ) ) ) && ( com.android.jack.experimental.incremental.JackIncremental.getCompilerState ( ) . exists ( ) ) ) { return true ; } return false ; }
Source:
private void registerNotificationRequestFromNative ( byte [ ] address , int eventId , int param ) { if ( com.android.bluetooth.avrcp.Avrcp.DEBUG ) android.util.Log.v ( com.android.bluetooth.avrcp.Avrcp.TAG , ( "registerNotificationRequestFromNative: eventId=" + eventId ) ) ; android.os.Message msg = mHandler.obtainMessage ( com.android.bluetooth.avrcp.Avrcp.MSG_NATIVE_REQ_REGISTER_NOTIFICATION , eventId , param ) ; msg.obj = address ; mHandler.sendMessage ( msg ) ; }

Target:
private void registerNotificationRequestFromNative ( byte [ ] address , int eventId , int param ) { android.os.Message msg = mHandler.obtainMessage ( com.android.bluetooth.avrcp.Avrcp.MSG_NATIVE_REQ_REGISTER_NOTIFICATION , eventId , param ) ; msg.obj = address ; mHandler.sendMessage ( msg ) ; }
Source:
public static void assertEquals ( java.lang.String message , java.lang.Object expected , java.lang.Object actual ) { if ( actual == null ? expected != null : ! ( actual.equals ( expected ) ) ) { junit.framework.Assert.fail ( message , ( ( ( "expected " + expected ) + " but was " ) + actual ) ) ; } }

Target:
public static void assertEquals ( java.lang.String message , java.lang.Object expected , java.lang.Object actual ) { if ( ( expected == null ) && ( actual == null ) ) { return ; } if ( ( expected != null ) && ( expected.equals ( actual ) ) ) { return ; } junit.framework.Assert.fail ( message , ( ( ( "expected " + expected ) + " but was " ) + actual ) ) ; }
Source:
public static com.android.cts.verifier.TestListAdapter.TestListItem newTest ( android.content.Context context , int titleResId , java.lang.String testName , android.content.Intent intent , java.lang.String [ ] requiredFeatures , java.lang.String [ ] excludedFeatures , java.lang.String [ ] applicableFeatures ) { return com.android.cts.verifier.TestListAdapter.TestListItem.newTest ( context.getString ( titleResId ) , testName , intent , requiredFeatures , excludedFeatures , applicableFeatures ) ; }

Target:
public static com.android.cts.verifier.TestListAdapter.TestListItem newTest ( android.content.Context context , int titleResId , java.lang.String testName , android.content.Intent intent ) { return com.android.cts.verifier.TestListAdapter.TestListItem.newTest ( context.getString ( titleResId ) , testName , intent ) ; }
Source:
public boolean p2pGroupAdd ( boolean persistent ) { if ( ( com.android.server.wifi.WifiNative.HIDL_P2P_ENABLE ) && ( ( mSupplicantP2pIfaceHal ) != null ) ) { return mSupplicantP2pIfaceHal.groupAdd ( persistent ) ; } else { if ( persistent ) { return doBooleanCommand ( "P2P_GROUP_ADD persistent" ) ; } return doBooleanCommand ( "P2P_GROUP_ADD" ) ; } }

Target:
public boolean p2pGroupAdd ( boolean persistent ) { return mSupplicantP2pIfaceHal.groupAdd ( persistent ) ; }
Source:
private static void check ( int actual , int expected , java.lang.String msg ) { if ( actual != expected ) { java.lang.System.out.println ( ( ( ( ( msg + " : " ) + actual ) + " != " ) + expected ) ) ; java.lang.System.exit ( ( - 1 ) ) ; } }

Target:
private static void check ( int actual , int expected , java.lang.String msg ) { if ( actual != expected ) { java.lang.System.out.println ( ( ( ( ( msg + " : " ) + actual ) + " != " ) + expected ) ) ; java.lang.System.exit ( 1 ) ; } }
Source:
static com.android.ide.common.res2.ResourceItem getResource ( org.w3c.dom.Node node ) { com.android.resources.ResourceType type = com.android.ide.common.res2.ValueResourceParser2.getType ( node ) ; java.lang.String name = com.android.ide.common.res2.ValueResourceParser2.getName ( node ) ; if ( ( type != null ) && ( name != null ) ) { return new com.android.ide.common.res2.ResourceItem ( name , type , node ) ; } return null ; }

Target:
static com.android.ide.common.res2.ResourceItem getResource ( @ com.android.annotations.NonNull org.w3c.dom.Node node , @ com.android.annotations.Nullable java.io.File from ) { com.android.resources.ResourceType type = com.android.ide.common.res2.ValueResourceParser2.getType ( node , from ) ; java.lang.String name = com.android.ide.common.res2.ValueResourceParser2.getName ( node ) ; if ( name != null ) { if ( type != null ) { return new com.android.ide.common.res2.ResourceItem ( name , type , node ) ; } } return null ; }
Source:
public java.lang.String startWpsPinDisplay ( java.lang.String iface , java.lang.String bssid ) { if ( ( com.android.server.wifi.WifiNative.HIDL_P2P_ENABLE ) && ( ( mSupplicantP2pIfaceHal ) != null ) ) { return mSupplicantP2pIfaceHal.startWpsPinDisplay ( iface , bssid ) ; } else { synchronized ( com.android.server.wifi.WifiNative.sLock ) { if ( android.text.TextUtils.isEmpty ( bssid ) ) { return doStringCommandNative ( ( ( "IFNAME=" + iface ) + " WPS_PIN any" ) ) ; } else { return doStringCommandNative ( ( ( ( "IFNAME=" + iface ) + " WPS_PIN " ) + bssid ) ) ; } } } }

Target:
public java.lang.String startWpsPinDisplay ( java.lang.String iface , java.lang.String bssid ) { return mSupplicantP2pIfaceHal.startWpsPinDisplay ( iface , bssid ) ; }
Source:
public static void sort ( long [ ] a , int fromIndex , int toIndex ) { java.util.Arrays.rangeCheck ( a.length , fromIndex , toIndex ) ; java.util.DualPivotQuicksort.sort ( a , fromIndex , ( toIndex - 1 ) ) ; }

Target:
public static void sort ( double [ ] a , int fromIndex , int toIndex ) { java.util.Arrays.rangeCheck ( a.length , fromIndex , toIndex ) ; java.util.DualPivotQuicksort.sort ( a , fromIndex , ( toIndex - 1 ) , null , 0 , 0 ) ; }
Source:
public static com.android.manifmerger.XmlNode.NodeName fromXmlName ( java.lang.String name ) { return name.contains ( ":" ) ? new com.android.manifmerger.XmlNode.NamespaceAwareName ( com.android.SdkConstants.ANDROID_URI , name.substring ( 0 , ( ( name.indexOf ( ':' ) ) - 1 ) ) , name.substring ( ( ( name.indexOf ( ':' ) ) + 1 ) ) ) : new com.android.manifmerger.XmlNode.Name ( name ) ; }

Target:
public static com.android.manifmerger.XmlNode.NodeName fromXmlName ( java.lang.String name ) { return name.contains ( ":" ) ? new com.android.manifmerger.XmlNode.NamespaceAwareName ( com.android.SdkConstants.ANDROID_URI , name.substring ( 0 , name.indexOf ( ':' ) ) , name.substring ( ( ( name.indexOf ( ':' ) ) + 1 ) ) ) : new com.android.manifmerger.XmlNode.Name ( name ) ; }
Source:
public int checkRightsStatus ( java.lang.String path , int action ) { if ( ( ( null == path ) || ( path.equals ( "" ) ) ) || ( ! ( DrmStore.Action.isValid ( action ) ) ) ) { throw new java.lang.IllegalArgumentException ( "Given path or action is not valid" ) ; } else if ( ( getState ( ) ) == ( android.drm.DrmManagerClient.STATE_UNINITIALIZED ) ) { throw new java.lang.IllegalStateException ( "Not Initialized yet" ) ; } return _checkRightsStatus ( mUniqueId , path , action ) ; }

Target:
public int checkRightsStatus ( java.lang.String path , int action ) { if ( ( ( null == path ) || ( path.equals ( "" ) ) ) || ( ! ( DrmStore.Action.isValid ( action ) ) ) ) { throw new java.lang.IllegalArgumentException ( "Given path or action is not valid" ) ; } else if ( ( android.drm.DrmManagerClient.STATE_UNINITIALIZED ) == ( getState ( ) ) ) { throw new java.lang.IllegalStateException ( "Not Initialized yet" ) ; } return _checkRightsStatus ( mUniqueId , path , action ) ; }
Source:
public void testLaunchToSide ( ) throws java.lang.Exception { if ( ! ( supportsMultiWindowMode ( ) ) ) { com.android.tradefed.log.LogUtil.CLog.logAndDisplay ( LogLevel.INFO , "Skipping test: no multi-window support" ) ; return ; } launchActivityInDockStack ( android.server.cts.LAUNCHING_ACTIVITY ) ; launchActivityToSide ( ) ; mAmWmState.computeState ( mDevice , new java.lang.String [ ] { LAUNCHING_ACTIVITY , android.server.cts.ActivityManagerDockedStackTests.TEST_ACTIVITY_NAME } ) ; mAmWmState.assertContainsStack ( "Must contain fullscreen stack." , android.server.cts.FULLSCREEN_WORKSPACE_STACK_ID ) ; mAmWmState.assertContainsStack ( "Must contain docked stack." , android.server.cts.DOCKED_STACK_ID ) ; }

Target:
public void testLaunchToSide ( ) throws java.lang.Exception { if ( ! ( supportsMultiWindowMode ( ) ) ) { com.android.tradefed.log.LogUtil.CLog.logAndDisplay ( LogLevel.INFO , "Skipping test: no multi-window support" ) ; return ; } launchActivityInDockStack ( android.server.cts.LAUNCHING_ACTIVITY ) ; mAmWmState.computeState ( mDevice , new java.lang.String [ ] { LAUNCHING_ACTIVITY } ) ; launchActivityToSide ( ) ; mAmWmState.computeState ( mDevice , new java.lang.String [ ] { LAUNCHING_ACTIVITY , android.server.cts.ActivityManagerDockedStackTests.TEST_ACTIVITY_NAME } ) ; mAmWmState.assertContainsStack ( "Must contain fullscreen stack." , android.server.cts.FULLSCREEN_WORKSPACE_STACK_ID ) ; mAmWmState.assertContainsStack ( "Must contain docked stack." , android.server.cts.DOCKED_STACK_ID ) ; }
Source:
private android.net.wifi.WifiScanner.ScanSettings cloneScanSettings ( android.net.wifi.WifiScanner.ScanSettings originalSettings ) { android.net.wifi.WifiScanner.ScanSettings settings = new android.net.wifi.WifiScanner.ScanSettings ( ) ; settings.band = originalSettings.band ; settings.channels = originalSettings.channels ; settings.hiddenNetworkIds = originalSettings.hiddenNetworkIds ; settings.periodInMs = originalSettings.periodInMs ; settings.reportEvents = originalSettings.reportEvents ; settings.numBssidsPerScan = originalSettings.numBssidsPerScan ; settings.maxScansToCache = originalSettings.maxScansToCache ; settings.maxPeriodInMs = originalSettings.maxPeriodInMs ; settings.stepCount = originalSettings.stepCount ; settings.isPnoScan = originalSettings.isPnoScan ; return settings ; }

Target:
private android.net.wifi.WifiScanner.ScanSettings cloneScanSettings ( android.net.wifi.WifiScanner.ScanSettings originalSettings ) { android.net.wifi.WifiScanner.ScanSettings settings = new android.net.wifi.WifiScanner.ScanSettings ( ) ; settings.band = originalSettings.band ; settings.channels = originalSettings.channels ; settings.periodInMs = originalSettings.periodInMs ; settings.reportEvents = originalSettings.reportEvents ; settings.numBssidsPerScan = originalSettings.numBssidsPerScan ; settings.maxScansToCache = originalSettings.maxScansToCache ; settings.maxPeriodInMs = originalSettings.maxPeriodInMs ; settings.stepCount = originalSettings.stepCount ; settings.isPnoScan = originalSettings.isPnoScan ; return settings ; }
Source:
private int radioTechnologyToDataServiceState ( int code ) { int retVal = android.telephony.ServiceState.STATE_OUT_OF_SERVICE ; switch ( code ) { case 0 : case 1 : case 2 : case 3 : case 4 : case 5 : break ; case 6 : case 7 : case 8 : retVal = android.telephony.ServiceState.STATE_IN_SERVICE ; break ; default : android.util.Log.e ( com.android.internal.telephony.cdma.CdmaServiceStateTracker.LOG_TAG , "Wrong radioTechnology code." ) ; break ; } return retVal ; }

Target:
private int radioTechnologyToDataServiceState ( int code ) { int retVal = android.telephony.ServiceState.STATE_OUT_OF_SERVICE ; switch ( code ) { case 0 : case 1 : case 2 : case 3 : case 4 : case 5 : break ; case 6 : case 7 : case 8 : case 12 : retVal = android.telephony.ServiceState.STATE_IN_SERVICE ; break ; default : android.util.Log.e ( com.android.internal.telephony.cdma.CdmaServiceStateTracker.LOG_TAG , "Wrong radioTechnology code." ) ; break ; } return retVal ; }
Source:
void load ( java.io.InputStream in ) throws java.io.IOException , javax.crypto.CryptoPolicyParser.ParsingException { javax.crypto.CryptoPolicyParser parser = new javax.crypto.CryptoPolicyParser ( ) ; parser.read ( new java.io.BufferedReader ( new java.io.InputStreamReader ( in , "UTF-8" ) ) ) ; javax.crypto.CryptoPermission [ ] parsingResult = parser.getPermissions ( ) ; for ( int i = 0 ; i < ( parsingResult.length ) ; i ++ ) { this . add ( parsingResult [ i ] ) ; } }

Target:
void load ( java.io.InputStream in ) throws java.io.IOException , javax.crypto.CryptoPolicyParser.ParsingException { }
Source:
public java.lang.String getPackageForIntentSender ( android.content.IIntentSender pendingResult ) { if ( ! ( pendingResult instanceof com.android.server.am.PendingIntentRecord ) ) { return null ; } synchronized ( this ) { try { com.android.server.am.PendingIntentRecord res = ( ( com.android.server.am.PendingIntentRecord ) ( pendingResult ) ) ; return res.key.packageName ; } catch ( java.lang.ClassCastException e ) { } } return null ; }

Target:
public java.lang.String getPackageForIntentSender ( android.content.IIntentSender pendingResult ) { if ( ! ( pendingResult instanceof com.android.server.am.PendingIntentRecord ) ) { return null ; } try { com.android.server.am.PendingIntentRecord res = ( ( com.android.server.am.PendingIntentRecord ) ( pendingResult ) ) ; return res.key.packageName ; } catch ( java.lang.ClassCastException e ) { } return null ; }
Source:
public java.lang.String getHexString ( ) { java.lang.String out = "0x" ; byte [ ] ssidbytes = getOctets ( ) ; for ( int i = 0 ; i < ( octets.size ( ) ) ; i ++ ) { out += java.lang.String.format ( java.util.Locale.US , "%02x" , ssidbytes [ i ] ) ; } return out ; }

Target:
public java.lang.String getHexString ( ) { java.lang.String out = "0x" ; byte [ ] ssidbytes = getOctets ( ) ; for ( int i = 0 ; i < ( octets.size ( ) ) ; i ++ ) { out += java.lang.String.format ( java.util.Locale.US , "%02x" , ssidbytes [ i ] ) ; } return ( octets.size ( ) ) > 0 ? out : null ; }
Source:
protected com.android.music.utils.MusicProvider.State doInBackground ( java.lang.Void ... params ) { mCurrentState = com.android.music.utils.MusicProvider.State.INITIALIZING ; if ( retrieveMedia ( ) ) { mCurrentState = com.android.music.utils.MusicProvider.State.INITIALIZED ; } else { mCurrentState = com.android.music.utils.MusicProvider.State.NON_INITIALIZED ; } return mCurrentState ; }

Target:
protected com.android.music.utils.MusicProvider.State doInBackground ( java.lang.Void ... params ) { if ( ( mCurrentState ) == ( com.android.music.utils.MusicProvider.State.INITIALIZED ) ) { return mCurrentState ; } mCurrentState = com.android.music.utils.MusicProvider.State.INITIALIZING ; if ( retrieveMedia ( ) ) { mCurrentState = com.android.music.utils.MusicProvider.State.INITIALIZED ; } else { mCurrentState = com.android.music.utils.MusicProvider.State.NON_INITIALIZED ; } return mCurrentState ; }
Source:
public void visitDocument ( @ com.android.annotations.NonNull com.android.tools.lint.detector.api.XmlContext context , @ com.android.annotations.NonNull org.w3c.dom.Document document ) { org.w3c.dom.Element root = document.getDocumentElement ( ) ; if ( ( root != null ) && ( root.getTagName ( ) . equals ( com.android.tools.lint.detector.api.LintConstants.TAG_RESOURCES ) ) ) { context.report ( com.android.tools.lint.checks.WrongLocationDetector.ISSUE , context.getLocation ( root ) , "This file should be placed in a values/ folder, not a layout/ folder" , null ) ; } }

Target:
public void visitDocument ( @ com.android.annotations.NonNull com.android.tools.lint.detector.api.XmlContext context , @ com.android.annotations.NonNull org.w3c.dom.Document document ) { org.w3c.dom.Element root = document.getDocumentElement ( ) ; if ( ( root != null ) && ( root.getTagName ( ) . equals ( com.android.tools.lint.detector.api.LintConstants.TAG_RESOURCES ) ) ) { context.report ( com.android.tools.lint.checks.WrongLocationDetector.ISSUE , root , context.getLocation ( root ) , "This file should be placed in a values/ folder, not a layout/ folder" , null ) ; } }
Source:
public void applyBorder ( android.support.v8.renderscript.Allocation in , android.support.v8.renderscript.Allocation out , boolean copyOut , com.android.gallery3d.filtershow.pipeline.FilterEnvironment environment ) { com.android.gallery3d.filtershow.filters.FilterRepresentation border = getFilterRepresentationForType ( FilterRepresentation.TYPE_BORDER ) ; if ( ( border != null ) && ( mDoApplyGeometry ) ) { android.support.v8.renderscript.Allocation bitmapIn = in ; if ( copyOut ) { bitmapIn = android.support.v8.renderscript.Allocation.createTyped ( com.android.gallery3d.filtershow.pipeline.CachingPipeline.getRenderScriptContext ( ) , in.getType ( ) ) ; bitmapIn.copyFrom ( out ) ; } environment.applyRepresentation ( border , bitmapIn , out ) ; } }

Target:
public void applyBorder ( android.renderscript.Allocation in , android.renderscript.Allocation out , boolean copyOut , com.android.gallery3d.filtershow.pipeline.FilterEnvironment environment ) { com.android.gallery3d.filtershow.filters.FilterRepresentation border = getFilterRepresentationForType ( FilterRepresentation.TYPE_BORDER ) ; if ( ( border != null ) && ( mDoApplyGeometry ) ) { android.renderscript.Allocation bitmapIn = in ; if ( copyOut ) { bitmapIn = android.renderscript.Allocation.createTyped ( com.android.gallery3d.filtershow.pipeline.CachingPipeline.getRenderScriptContext ( ) , in.getType ( ) ) ; bitmapIn.copyFrom ( out ) ; } environment.applyRepresentation ( border , bitmapIn , out ) ; } }
Source:
protected void engineInit ( int opmode , java.security.Key key , java.security.spec.AlgorithmParameterSpec params , java.security.SecureRandom random ) throws java.security.InvalidAlgorithmParameterException , java.security.InvalidKeyException { final byte [ ] iv ; if ( params instanceof javax.crypto.spec.IvParameterSpec ) { javax.crypto.spec.IvParameterSpec ivParams = ( ( javax.crypto.spec.IvParameterSpec ) ( params ) ) ; iv = ivParams.getIV ( ) ; } else { iv = null ; } engineInitInternal ( opmode , key , iv ) ; }

Target:
protected void engineInit ( int opmode , java.security.Key key , java.security.SecureRandom random ) throws java.security.InvalidKeyException { try { engineInitInternal ( opmode , key , null , random ) ; } catch ( java.security.InvalidAlgorithmParameterException e ) { throw new java.lang.RuntimeException ( e ) ; } }
Source:
boolean equalNameAndParameters ( java.lang.reflect.Method m ) { java.lang.reflect.ArtMethod nonProxyThis = java.lang.Class.findOverriddenMethodIfProxy ( this . artMethod ) ; java.lang.reflect.ArtMethod nonProxyM = java.lang.Class.findOverriddenMethodIfProxy ( m.artMethod ) ; return ( java.lang.reflect.ArtMethod.getMethodName ( nonProxyThis ) . equals ( java.lang.reflect.ArtMethod.getMethodName ( nonProxyM ) ) ) && ( java.lang.reflect.ArtMethod.equalMethodParameters ( nonProxyThis , nonProxyM.getParameterTypes ( ) ) ) ; }

Target:
boolean equalNameAndParameters ( java.lang.reflect.Method m ) { return ( getName ( ) . equals ( m.getName ( ) ) ) && ( equalMethodParameters ( m.getParameterTypes ( ) ) ) ; }
Source:
public static android.hardware.cts.helpers.sensorverification.EventTimestampSynchronizationVerification getDefault ( android.hardware.cts.helpers.TestSensorEnvironment environment ) { int reportLatencyUs = environment.getMaxReportLatencyUs ( ) ; int fifoMaxEventCount = environment.getSensor ( ) . getFifoMaxEventCount ( ) ; if ( fifoMaxEventCount > 0 ) { int fifoBasedReportLatencyUs = fifoMaxEventCount * ( environment.getMaximumExpectedSamplingPeriodUs ( ) ) ; reportLatencyUs = java.lang.Math.min ( reportLatencyUs , fifoBasedReportLatencyUs ) ; } long reportLatencyNs = java.util.concurrent.TimeUnit.MICROSECONDS.toNanos ( reportLatencyUs ) ; return new android.hardware.cts.helpers.sensorverification.EventTimestampSynchronizationVerification ( android.hardware.cts.helpers.sensorverification.EventTimestampSynchronizationVerification.DEFAULT_THRESHOLD_NS , reportLatencyNs ) ; }

Target:
public static android.hardware.cts.helpers.sensorverification.EventTimestampSynchronizationVerification getDefault ( android.hardware.cts.helpers.TestSensorEnvironment environment ) { long reportLatencyUs = environment.getMaxReportLatencyUs ( ) ; long fifoMaxEventCount = environment.getSensor ( ) . getFifoMaxEventCount ( ) ; if ( fifoMaxEventCount > 0 ) { long fifoBasedReportLatencyUs = fifoMaxEventCount * ( environment.getMaximumExpectedSamplingPeriodUs ( ) ) ; reportLatencyUs = java.lang.Math.min ( reportLatencyUs , fifoBasedReportLatencyUs ) ; } long reportLatencyNs = java.util.concurrent.TimeUnit.MICROSECONDS.toNanos ( reportLatencyUs ) ; return new android.hardware.cts.helpers.sensorverification.EventTimestampSynchronizationVerification ( android.hardware.cts.helpers.sensorverification.EventTimestampSynchronizationVerification.DEFAULT_THRESHOLD_NS , reportLatencyNs ) ; }
Source:
private java.nio.channels.SocketChannel openAdbConnection ( ) { com.android.ddmlib.Log.d ( "DeviceMonitor" , "Connecting to adb for Device List Monitoring..." ) ; java.nio.channels.SocketChannel adbChannel = null ; try { adbChannel = java.nio.channels.SocketChannel.open ( com.android.ddmlib.AndroidDebugBridge.getSocketAddress ( ) ) ; adbChannel.socket ( ) . setTcpNoDelay ( true ) ; } catch ( java.io.IOException e ) { } return adbChannel ; }

Target:
private static java.nio.channels.SocketChannel openAdbConnection ( ) { com.android.ddmlib.Log.d ( "DeviceMonitor" , "Connecting to adb for Device List Monitoring..." ) ; java.nio.channels.SocketChannel adbChannel = null ; try { adbChannel = java.nio.channels.SocketChannel.open ( com.android.ddmlib.AndroidDebugBridge.getSocketAddress ( ) ) ; adbChannel.socket ( ) . setTcpNoDelay ( true ) ; } catch ( java.io.IOException e ) { } return adbChannel ; }
Source:
public void testStageInstallWithErrorCode_unsuccessfulFollowOnUpdate_olderVersion ( ) throws java.lang.Exception { com.android.timezone.distro.TimeZoneDistro distro1 = libcore.tzdata.update2.TimeZoneDistroInstallerTest.createValidTimeZoneDistro ( libcore.tzdata.update2.TimeZoneDistroInstallerTest.NEW_RULES_VERSION , 2 ) ; assertEquals ( TimeZoneDistroInstaller.INSTALL_SUCCESS , installer.stageInstallWithErrorCode ( distro1.getBytes ( ) ) ) ; assertInstallDistroStaged ( distro1 ) ; com.android.timezone.distro.TimeZoneDistro distro2 = libcore.tzdata.update2.TimeZoneDistroInstallerTest.createValidTimeZoneDistro ( libcore.tzdata.update2.TimeZoneDistroInstallerTest.OLDER_RULES_VERSION , 1 ) ; assertEquals ( TimeZoneDistroInstaller.INSTALL_FAIL_RULES_TOO_OLD , installer.stageInstallWithErrorCode ( distro2.getBytes ( ) ) ) ; assertInstallDistroStaged ( distro1 ) ; assertNoInstalledDistro ( ) ; }

Target:
public void testStageInstallWithErrorCode_unsuccessfulFollowOnUpdate_olderVersion ( ) throws java.lang.Exception { com.android.timezone.distro.TimeZoneDistro distro1 = libcore.tzdata.update2.TimeZoneDistroInstallerTest.createValidTimeZoneDistro ( libcore.tzdata.update2.TimeZoneDistroInstallerTest.NEW_RULES_VERSION , 2 ) ; assertEquals ( TimeZoneDistroInstaller.INSTALL_SUCCESS , installer.stageInstallWithErrorCode ( distro1 ) ) ; assertInstallDistroStaged ( distro1 ) ; com.android.timezone.distro.TimeZoneDistro distro2 = libcore.tzdata.update2.TimeZoneDistroInstallerTest.createValidTimeZoneDistro ( libcore.tzdata.update2.TimeZoneDistroInstallerTest.OLDER_RULES_VERSION , 1 ) ; assertEquals ( TimeZoneDistroInstaller.INSTALL_FAIL_RULES_TOO_OLD , installer.stageInstallWithErrorCode ( distro2 ) ) ; assertInstallDistroStaged ( distro1 ) ; assertNoInstalledDistro ( ) ; }
Source:
public void testNonBlockingAccept ( ) throws java.lang.Exception { java.nio.channels.ServerSocketChannel ssc = java.nio.channels.ServerSocketChannel.open ( ) ; try { ssc.configureBlocking ( false ) ; ssc.socket ( ) . bind ( null ) ; assertNull ( ssc.accept ( ) ) ; } finally { ssc.close ( ) ; } }

Target:
public void testNonBlockingAccept ( ) throws java.lang.Exception { java.nio.channels.ServerSocketChannel ssc = java.nio.channels.ServerSocketChannel.open ( ) ; try { ssc.configureBlocking ( false ) ; ssc.bind ( null ) ; assertNull ( ssc.accept ( ) ) ; } finally { ssc.close ( ) ; } }
Source:
boolean checkAllowNonWakeupDelayLocked ( long nowELAPSED ) { if ( mInteractive ) { return false ; } if ( ( mLastAlarmDeliveryTime ) <= 0 ) { return false ; } if ( ( ( mPendingNonWakeupAlarms.size ( ) ) > 0 ) && ( ( mNextNonWakeupDeliveryTime ) > nowELAPSED ) ) { return false ; } long timeSinceLast = nowELAPSED - ( mLastAlarmDeliveryTime ) ; return timeSinceLast <= ( currentNonWakeupFuzzLocked ( nowELAPSED ) ) ; }

Target:
boolean checkAllowNonWakeupDelayLocked ( long nowELAPSED ) { if ( mInteractive ) { return false ; } if ( ( mLastAlarmDeliveryTime ) <= 0 ) { return false ; } if ( ( ( mPendingNonWakeupAlarms.size ( ) ) > 0 ) && ( ( mNextNonWakeupDeliveryTime ) < nowELAPSED ) ) { return false ; } long timeSinceLast = nowELAPSED - ( mLastAlarmDeliveryTime ) ; return timeSinceLast <= ( currentNonWakeupFuzzLocked ( nowELAPSED ) ) ; }
Source:
public com.android.jack.test.toolchain.LegacyToolchain build ( ) { return isDesugarEnabled ? new com.android.jack.test.toolchain.LegacyToolchain ( com.android.jack.test.toolchain.AbstractTestTools.getPrebuilt ( "legacy-java-compiler" ) , com.android.jack.test.toolchain.AbstractTestTools.getPrebuiltsAsClasspath ( "legacy-java-compiler.bootclasspath" ) , com.android.jack.test.toolchain.AbstractTestTools.getPrebuilt ( "jarjar" ) , com.android.jack.test.toolchain.AbstractTestTools.getPrebuilt ( "proguard" ) , com.android.jack.test.toolchain.AbstractTestTools.getPrebuilt ( "dx" ) ) : new com.android.jack.test.toolchain.LegacyNoDesugarToolchain ( com.android.jack.test.toolchain.AbstractTestTools.getPrebuilt ( "legacy-java-compiler" ) , com.android.jack.test.toolchain.AbstractTestTools.getPrebuiltsAsClasspath ( "legacy-java-compiler.bootclasspath" ) , com.android.jack.test.toolchain.AbstractTestTools.getPrebuilt ( "jarjar" ) , com.android.jack.test.toolchain.AbstractTestTools.getPrebuilt ( "proguard" ) , com.android.jack.test.toolchain.AbstractTestTools.getPrebuilt ( "dx" ) ) ; }

Target:
public com.android.jack.test.toolchain.LegacyToolchain build ( ) { return new com.android.jack.test.toolchain.LegacyToolchain ( com.android.jack.test.toolchain.AbstractTestTools.getPrebuilt ( "legacy-java-compiler" ) , com.android.jack.test.toolchain.AbstractTestTools.getPrebuiltsAsClasspath ( "legacy-java-compiler.bootclasspath" ) , com.android.jack.test.toolchain.AbstractTestTools.getPrebuilt ( "jarjar" ) , com.android.jack.test.toolchain.AbstractTestTools.getPrebuilt ( "proguard" ) , com.android.jack.test.toolchain.AbstractTestTools.getPrebuilt ( "dx" ) , isDesugarEnabled ) ; }
Source:
static java.math.BigInteger generateK ( java.math.BigInteger n , java.security.SecureRandom random ) { int nBitLength = n.bitLength ( ) ; java.math.BigInteger k = new java.math.BigInteger ( nBitLength , random ) ; while ( ( k.equals ( ECConstants.ZERO ) ) || ( ( k.compareTo ( n ) ) >= 0 ) ) { k = new java.math.BigInteger ( nBitLength , random ) ; } return k ; }

Target:
static java.math.BigInteger generateK ( java.math.BigInteger n , java.security.SecureRandom random ) { int nBitLength = n.bitLength ( ) ; java.math.BigInteger k ; do { k = new java.math.BigInteger ( nBitLength , random ) ; } while ( ( k.equals ( ECConstants.ZERO ) ) || ( ( k.compareTo ( n ) ) >= 0 ) ) ; return k ; }
Source:
private static double getWifiPowerPerPacket ( com.android.internal.os.PowerProfile profile ) { final long WIFI_BPS = 1000000 ; final double WIFI_POWER = ( profile.getAveragePower ( PowerProfile.POWER_WIFI_ACTIVE ) ) / 3600 ; return ( WIFI_POWER / ( ( ( ( double ) ( WIFI_BPS ) ) / 8 ) / 2048 ) ) / ( 60 * 60 ) ; }

Target:
private static double getWifiPowerPerPacket ( com.android.internal.os.PowerProfile profile ) { final long WIFI_BPS = 1000000 ; final double WIFI_POWER = ( profile.getAveragePower ( PowerProfile.POWER_WIFI_ACTIVE ) ) / 3600 ; return WIFI_POWER / ( ( ( ( double ) ( WIFI_BPS ) ) / 8 ) / 2048 ) ; }
Source:
java.lang.Object newInstance ( ) throws java.lang.InstantiationException , java.lang.UnsupportedOperationException , java.lang.reflect.InvocationTargetException { if ( ( cons ) != null ) { try { return cons.newInstance ( ) ; } catch ( java.lang.IllegalAccessException ex ) { throw new java.lang.InternalError ( ) ; } } else { throw new java.lang.UnsupportedOperationException ( ) ; } }

Target:
java.lang.Object newInstance ( ) throws java.lang.InstantiationException , java.lang.UnsupportedOperationException , java.lang.reflect.InvocationTargetException { if ( ( cons ) != null ) { try { return cons.newInstance ( ) ; } catch ( java.lang.IllegalAccessException ex ) { throw new java.lang.InternalError ( ex ) ; } } else { throw new java.lang.UnsupportedOperationException ( ) ; } }
Source:
public static java.lang.String getShortID ( android.icu.util.TimeZone tz ) { java.lang.String canonicalID = null ; if ( tz instanceof android.icu.impl.OlsonTimeZone ) { canonicalID = ( ( android.icu.impl.OlsonTimeZone ) ( tz ) ) . getCanonicalID ( ) ; } canonicalID = android.icu.impl.ZoneMeta.getCanonicalCLDRID ( tz.getID ( ) ) ; if ( canonicalID == null ) { return null ; } return android.icu.impl.ZoneMeta.getShortIDFromCanonical ( canonicalID ) ; }

Target:
public static java.lang.String getShortID ( android.icu.util.TimeZone tz ) { java.lang.String canonicalID = null ; if ( tz instanceof android.icu.impl.OlsonTimeZone ) { canonicalID = ( ( android.icu.impl.OlsonTimeZone ) ( tz ) ) . getCanonicalID ( ) ; } else { canonicalID = android.icu.impl.ZoneMeta.getCanonicalCLDRID ( tz.getID ( ) ) ; } if ( canonicalID == null ) { return null ; } return android.icu.impl.ZoneMeta.getShortIDFromCanonical ( canonicalID ) ; }
Source:
public void testAbiOnlyWithMultiMatch ( ) { com.android.build.SplitOutput match ; java.util.List < com.android.build.SplitOutput > list = com.google.common.collect.Lists.newArrayList ( ) ; list.add ( com.android.ide.common.build.SplitOutputMatcherTest.getUniversalOutput ( ) ) ; list.add ( com.android.ide.common.build.SplitOutputMatcherTest.getAbiOutput ( "foo" ) ) ; list.add ( ( match = com.android.ide.common.build.SplitOutputMatcherTest.getAbiOutput ( "bar" ) ) ) ; com.android.build.SplitOutput result = com.android.ide.common.build.SplitOutputMatcherTest.computeBestOutput ( list , 160 , "bar" , "foo" ) ; assertEquals ( match , result ) ; }

Target:
public void testAbiOnlyWithMultiMatch ( ) { com.android.build.SplitOutput match ; java.util.List < com.android.build.SplitOutput > list = com.google.common.collect.Lists.newArrayList ( ) ; list.add ( com.android.ide.common.build.SplitOutputMatcherTest.getUniversalOutput ( 1 ) ) ; list.add ( com.android.ide.common.build.SplitOutputMatcherTest.getAbiOutput ( "foo" , 2 ) ) ; list.add ( ( match = com.android.ide.common.build.SplitOutputMatcherTest.getAbiOutput ( "bar" , 3 ) ) ) ; com.android.build.SplitOutput result = com.android.ide.common.build.SplitOutputMatcherTest.computeBestOutput ( list , 160 , "bar" , "foo" ) ; assertEquals ( match , result ) ; }
Source:
public void testGetPropReceiver ( ) { com.android.ddmlib.PropertyFetcher.GetPropReceiver receiver = new com.android.ddmlib.PropertyFetcher.GetPropReceiver ( ) ; byte [ ] byteData = com.android.ddmlib.PropertyFetcherTest.GETPROP_RESPONSE.getBytes ( ) ; receiver.addOutput ( byteData , 0 , byteData.length ) ; org.junit.Assert.assertEquals ( "480" , receiver.getCollectedProperties ( ) . get ( "ro.sf.lcd_density" ) ) ; }

Target:
public void testGetPropReceiver ( ) { com.android.ddmlib.PropertyFetcher.GetPropReceiver receiver = new com.android.ddmlib.PropertyFetcher.GetPropReceiver ( ) ; byte [ ] byteData = com.android.ddmlib.PropertyFetcherTest.GETPROP_RESPONSE.getBytes ( ) ; receiver.addOutput ( byteData , 0 , byteData.length ) ; assertEquals ( "480" , receiver.getCollectedProperties ( ) . get ( "ro.sf.lcd_density" ) ) ; }
Source:
public void dump ( java.io.FileDescriptor fd , java.lang.String [ ] args ) { java.io.PrintWriter writer = new java.io.PrintWriter ( new java.io.FileOutputStream ( fd ) ) ; com.android.bluetooth.btservice.AdapterService service = getService ( ) ; service.dump ( fd , writer , args ) ; }

Target:
public void dump ( java.io.FileDescriptor fd , java.lang.String [ ] args ) { java.io.PrintWriter writer = new java.io.PrintWriter ( new java.io.FileOutputStream ( fd ) ) ; com.android.bluetooth.btservice.AdapterService service = getService ( ) ; if ( service == null ) return ; service.dump ( fd , writer , args ) ; }
Source:
public final java.io.InputStream open ( java.lang.String fileName , int accessMode ) throws java.io.IOException { synchronized ( this ) { if ( ! ( mOpen ) ) { throw new java.lang.RuntimeException ( "Assetmanager has been closed" ) ; } int asset = openAsset ( fileName , accessMode ) ; if ( asset != 0 ) { android.content.res.AssetManager.AssetInputStream res = new android.content.res.AssetManager.AssetInputStream ( asset ) ; incRefsLocked ( res.hashCode ( ) ) ; return res ; } } throw new java.io.FileNotFoundException ( ( "Asset file: " + fileName ) ) ; }

Target:
public final java.io.InputStream open ( java.lang.String fileName , int accessMode ) throws java.io.IOException { synchronized ( this ) { if ( ! ( mOpen ) ) { throw new java.lang.RuntimeException ( "Assetmanager has been closed" ) ; } long asset = openAsset ( fileName , accessMode ) ; if ( asset != 0 ) { android.content.res.AssetManager.AssetInputStream res = new android.content.res.AssetManager.AssetInputStream ( asset ) ; incRefsLocked ( res.hashCode ( ) ) ; return res ; } } throw new java.io.FileNotFoundException ( ( "Asset file: " + fileName ) ) ; }
Source:
public void testSendCallEventNull ( ) throws java.lang.Exception { com.android.server.telecom.tests.IdPair ids = startAndMakeActiveIncomingCall ( "650-555-1212" , mPhoneAccountA0.getAccountHandle ( ) , mConnectionServiceFixtureA ) ; assertEquals ( Call.STATE_ACTIVE , mInCallServiceFixtureX.getCall ( ids.mCallId ) . getState ( ) ) ; mInCallServiceFixtureX.mInCallAdapter.sendCallEvent ( ids.mCallId , com.android.server.telecom.tests.BasicCallTests.TEST_EVENT , null ) ; org.mockito.Mockito.verify ( mConnectionServiceFixtureA.getTestDouble ( ) , org.mockito.Mockito.timeout ( com.android.server.telecom.tests.TEST_TIMEOUT ) ) . sendCallEvent ( org.mockito.Matchers.eq ( ids.mConnectionId ) , org.mockito.Matchers.eq ( com.android.server.telecom.tests.BasicCallTests.TEST_EVENT ) , org.mockito.Matchers.isNull ( android.os.Bundle.class ) , org.mockito.Matchers.any ( ) ) ; }

Target:
public void testSendCallEventNull ( ) throws java.lang.Exception { com.android.server.telecom.tests.IdPair ids = startAndMakeActiveIncomingCall ( "650-555-1212" , mPhoneAccountA0.getAccountHandle ( ) , mConnectionServiceFixtureA ) ; org.junit.Assert.assertEquals ( Call.STATE_ACTIVE , mInCallServiceFixtureX.getCall ( ids.mCallId ) . getState ( ) ) ; mInCallServiceFixtureX.mInCallAdapter.sendCallEvent ( ids.mCallId , com.android.server.telecom.tests.BasicCallTests.TEST_EVENT , null ) ; org.mockito.Mockito.verify ( mConnectionServiceFixtureA.getTestDouble ( ) , org.mockito.Mockito.timeout ( com.android.server.telecom.tests.TEST_TIMEOUT ) ) . sendCallEvent ( org.mockito.Matchers.eq ( ids.mConnectionId ) , org.mockito.Matchers.eq ( com.android.server.telecom.tests.BasicCallTests.TEST_EVENT ) , org.mockito.Matchers.isNull ( android.os.Bundle.class ) , org.mockito.Matchers.any ( ) ) ; }
Source:
public void test_getHostNameCaches ( ) throws java.lang.Exception { java.net.InetAddress inetAddress = java.net.InetAddress.getByAddress ( libcore.java.net.InetAddressTest.LOOPBACK6_BYTES ) ; libcore.java.net.InetAddressTest.assertEquals ( "::1" , libcore.java.net.InetAddressTest.getHostStringWithoutReverseDns ( inetAddress ) ) ; libcore.java.net.InetAddressTest.assertEquals ( "ip6-localhost" , inetAddress.getHostName ( ) ) ; libcore.java.net.InetAddressTest.assertEquals ( "ip6-localhost" , libcore.java.net.InetAddressTest.getHostStringWithoutReverseDns ( inetAddress ) ) ; }

Target:
public void test_getHostNameCaches ( ) throws java.lang.Exception { java.net.InetAddress inetAddress = java.net.InetAddress.getByAddress ( libcore.java.net.InetAddressTest.LOOPBACK6_BYTES ) ; org.junit.Assert.assertEquals ( "::1" , libcore.java.net.InetAddressTest.getHostStringWithoutReverseDns ( inetAddress ) ) ; org.junit.Assert.assertEquals ( "ip6-localhost" , inetAddress.getHostName ( ) ) ; org.junit.Assert.assertEquals ( "ip6-localhost" , libcore.java.net.InetAddressTest.getHostStringWithoutReverseDns ( inetAddress ) ) ; }
Source:
public int onStartCommand ( android.content.Intent intent , int flags , int startId ) { if ( com.android.bluetooth.hfpclient.connserv.HfpClientConnectionService.DBG ) { android.util.Log.d ( com.android.bluetooth.hfpclient.connserv.HfpClientConnectionService.TAG , ( "onStartCommand " + intent ) ) ; } if ( intent.getBooleanExtra ( HeadsetClientService.HFP_CLIENT_STOP_TAG , false ) ) { stopSelf ( ) ; return 0 ; } else { android.content.IntentFilter filter = new android.content.IntentFilter ( ) ; filter.addAction ( BluetoothHeadsetClient.ACTION_CONNECTION_STATE_CHANGED ) ; filter.addAction ( BluetoothHeadsetClient.ACTION_CALL_CHANGED ) ; registerReceiver ( mBroadcastReceiver , filter ) ; return START_STICKY ; } }

Target:
public int onStartCommand ( android.content.Intent intent , int flags , int startId ) { if ( com.android.bluetooth.hfpclient.connserv.HfpClientConnectionService.DBG ) { android.util.Log.d ( com.android.bluetooth.hfpclient.connserv.HfpClientConnectionService.TAG , ( "onStartCommand " + intent ) ) ; } if ( ( intent != null ) && ( intent.getBooleanExtra ( HeadsetClientService.HFP_CLIENT_STOP_TAG , false ) ) ) { stopSelf ( ) ; return 0 ; } else { android.content.IntentFilter filter = new android.content.IntentFilter ( ) ; filter.addAction ( BluetoothHeadsetClient.ACTION_CONNECTION_STATE_CHANGED ) ; filter.addAction ( BluetoothHeadsetClient.ACTION_CALL_CHANGED ) ; registerReceiver ( mBroadcastReceiver , filter ) ; return START_STICKY ; } }