auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean acquireWakeLock ( java.lang.String lockName ) { if ( ( mWakeLock ) == null ) { mWakeLockName = lockName ; mWakeLock = mPowerManager.newWakeLock ( PowerManager.PARTIAL_WAKE_LOCK , lockName ) ; } if ( ! ( mWakeLock.isHeld ( ) ) ) mWakeLock.acquire ( ) ; return true ; }

Target:
private boolean acquireWakeLock ( java.lang.String lockName ) { synchronized ( this ) { if ( ( mWakeLock ) == null ) { mWakeLockName = lockName ; mWakeLock = mPowerManager.newWakeLock ( PowerManager.PARTIAL_WAKE_LOCK , lockName ) ; } if ( ! ( mWakeLock.isHeld ( ) ) ) mWakeLock.acquire ( ) ; } return true ; }
Source:
public com.google.common.collect.ImmutableMap < K , V > getAllPresent ( java.lang.Iterable < ? > keys ) { java.util.Map < K , V > result = com.google.common.collect.Maps.newLinkedHashMap ( ) ; for ( java.lang.Object key : keys ) { if ( ! ( result.containsKey ( key ) ) ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) K castKey = ( ( K ) ( key ) ) ; result.put ( castKey , getIfPresent ( key ) ) ; } } return com.google.common.collect.ImmutableMap.copyOf ( result ) ; }

Target:
public com.google.common.collect.ImmutableMap < K , V > getAllPresent ( java.lang.Iterable < ? > keys ) { java.util.Map < K , V > result = com.google.common.collect.Maps.newLinkedHashMap ( ) ; for ( java.lang.Object key : keys ) { if ( ! ( result.containsKey ( key ) ) ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) K castKey = ( ( K ) ( key ) ) ; V value = getIfPresent ( key ) ; if ( value != null ) { result.put ( castKey , value ) ; } } } return com.google.common.collect.ImmutableMap.copyOf ( result ) ; }
Source:
private void closeSocket ( ) { try { if ( ( mSocket ) != null ) { mSocket.close ( ) ; mSocket = null ; } } catch ( java.io.IOException e ) { android.util.Log.e ( com.android.bluetooth.pbapclient.PbapClientConnectionHandler.TAG , "Error when closing socket" , e ) ; } }

Target:
private void closeSocket ( ) { try { if ( ( mSocket ) != null ) { mSocket.close ( ) ; mSocket = null ; } } catch ( java.io.IOException e ) { android.util.Log.e ( com.android.bluetooth.pbapclient.PbapClientConnectionHandler.TAG , "Error when closing socket" , e ) ; mSocket = null ; } }
Source:
static void getUsage ( java.lang.Class < ? extends com.google.devtools.common.options.OptionsBase > optionsClass , java.lang.StringBuilder usage ) { java.util.List < java.lang.reflect.Field > optionFields = com.google.common.collect.Lists.newArrayList ( com.google.devtools.common.options.OptionsParser.getAllAnnotatedFields ( optionsClass ) ) ; java.util.Collections.sort ( optionFields , com.google.devtools.common.options.OptionsUsage.BY_NAME ) ; for ( java.lang.reflect.Field optionField : optionFields ) { com.google.devtools.common.options.OptionsUsage.getUsage ( optionField , usage , OptionsParser.HelpVerbosity.LONG ) ; } }

Target:
static void getUsage ( java.lang.Class < ? extends com.google.devtools.common.options.OptionsBase > optionsClass , java.lang.StringBuilder usage ) { java.util.List < java.lang.reflect.Field > optionFields = com.google.common.collect.Lists.newArrayList ( com.google.devtools.common.options.OptionsParser.getAllAnnotatedFields ( optionsClass ) ) ; java.util.Collections.sort ( optionFields , com.google.devtools.common.options.OptionsUsage.BY_NAME ) ; for ( java.lang.reflect.Field optionField : optionFields ) { com.google.devtools.common.options.OptionsUsage.getUsage ( optionField , usage , OptionsParser.HelpVerbosity.LONG , null ) ; } }
Source:
private void selectConfiguration ( com.android.ide.common.resources.configuration.FolderConfiguration fileConfig ) { assert com.android.ide.eclipse.adt.AdtUtils.isUiThread ( ) ; try { java.lang.String current = mEditedFile.getParent ( ) . getName ( ) ; if ( current.equals ( com.android.SdkConstants.FD_RES_LAYOUT ) ) { current = "default" ; } mConfigCombo.setText ( current ) ; resizeToolBar ( ) ; } finally { ( mDisableUpdates ) -- ; } }

Target:
private void selectConfiguration ( com.android.ide.common.resources.configuration.FolderConfiguration fileConfig ) { }
Source:
private static void startTimer ( ) { synchronized ( com.android.jack.server.Server.lockTimer ) { if ( ( com.android.jack.server.Server.timer ) != null ) { com.android.jack.server.Server.cancelTimer ( ) ; } com.android.jack.server.Server.logger.log ( java.util.logging.Level.INFO , "Start timer" ) ; com.android.jack.server.Server.timer = new java.util.Timer ( "jack-server-timeout" ) ; com.android.jack.server.Server.timer.schedule ( new java.util.TimerTask ( ) { @ java.lang.Override public void run ( ) { com.android.jack.server.Server.shutdownFifo ( ) ; com.android.jack.server.Server.cancelTimer ( ) ; } } , com.android.jack.server.Server.timeout ) ; } }

Target:
private static void startTimer ( ) { synchronized ( com.android.jack.server.Server.lockTimer ) { if ( ( com.android.jack.server.Server.timer ) != null ) { com.android.jack.server.Server.cancelTimer ( ) ; } com.android.jack.server.Server.logger.log ( java.util.logging.Level.INFO , "Start timer" ) ; com.android.jack.server.Server.timer = new java.util.Timer ( "jack-server-timeout" ) ; assert ( com.android.jack.server.Server.timer ) != null ; com.android.jack.server.Server.timer.schedule ( new java.util.TimerTask ( ) { @ java.lang.Override public void run ( ) { com.android.jack.server.Server.shutdownFifo ( ) ; com.android.jack.server.Server.cancelTimer ( ) ; } } , com.android.jack.server.Server.timeout ) ; } }
Source:
public void testNoNumberSupplied ( ) { android.net.Uri handle = android.net.Uri.parse ( "tel:" ) ; android.content.Intent intent = new android.content.Intent ( android.content.Intent.ACTION_CALL , handle ) ; int result = processIntent ( intent , true ) ; assertEquals ( DisconnectCause.NO_PHONE_NUMBER_SUPPLIED , result ) ; verifyNoBroadcastSent ( ) ; verifyNoCallPlaced ( ) ; }

Target:
public void testNoNumberSupplied ( ) { android.net.Uri handle = android.net.Uri.parse ( "tel:" ) ; android.content.Intent intent = new android.content.Intent ( android.content.Intent.ACTION_CALL , handle ) ; int result = processIntent ( intent , true ) ; org.junit.Assert.assertEquals ( DisconnectCause.NO_PHONE_NUMBER_SUPPLIED , result ) ; verifyNoBroadcastSent ( ) ; verifyNoCallPlaced ( ) ; }
Source:
public void setVisible ( boolean visible ) { super . setVisible ( visible ) ; if ( com.android.tools.lint.detector.api.LintUtils.assertionsEnabled ( ) ) { java.lang.String uniqueProjectName = com.android.ide.eclipse.adt.AdtUtils.getUniqueProjectName ( "Test" , "" ) ; mProjectText.setText ( uniqueProjectName ) ; mPackageText.setText ( "test.pkg" ) ; } validatePage ( ) ; }

Target:
public void setVisible ( boolean visible ) { super . setVisible ( visible ) ; validatePage ( ) ; }
Source:
public void deletePlaylist ( java.lang.String playlistname ) throws java.lang.Exception { android.app.Instrumentation inst = getInstrumentation ( ) ; inst.sendStringSync ( playlistname ) ; java.lang.Thread.sleep ( MusicPlayerNames.WAIT_SHORT_TIME ) ; inst.sendKeyDownUpSync ( KeyEvent.KEYCODE_DPAD_DOWN ) ; inst.invokeContextMenuAction ( getActivity ( ) , ( ( MusicUtils.Defs.CHILD_MENU_BASE ) + 1 ) , 0 ) ; java.lang.Thread.sleep ( MusicPlayerNames.WAIT_SHORT_TIME ) ; clearSearchString ( playlistname.length ( ) ) ; }

Target:
public void deletePlaylist ( java.lang.String playlistname ) throws java.lang.Exception { android.app.Instrumentation inst = getInstrumentation ( ) ; inst.sendStringSync ( playlistname ) ; java.lang.Thread.sleep ( MusicPlayerNames.WAIT_SHORT_TIME ) ; inst.sendKeyDownUpSync ( KeyEvent.KEYCODE_DPAD_DOWN ) ; inst.invokeContextMenuAction ( getActivity ( ) , ( 0 + 1 ) , 0 ) ; java.lang.Thread.sleep ( MusicPlayerNames.WAIT_SHORT_TIME ) ; clearSearchString ( playlistname.length ( ) ) ; }
Source:
public static void main ( java.lang.String [ ] args ) { junit.textui.TestRunner tr = new junit.textui.TestRunner ( ) ; junit.framework.TestResult result = tr.doRun ( com.android.monkeyrunner.AllTests.suite ( com.android.monkeyrunner.ImageUtilsTest.class , com.android.monkeyrunner.JythonUtilsTest.class , com.android.monkeyrunner.MonkeyRunnerOptionsTest.class , com.android.monkeyrunner.adb.LinearInterpolatorTest.class , com.android.monkeyrunner.adb.AdbMonkeyDeviceTest.class ) ) ; if ( result.wasSuccessful ( ) ) { java.lang.System.exit ( 0 ) ; } else { java.lang.System.exit ( 1 ) ; } }

Target:
public static void main ( java.lang.String [ ] args ) { junit.textui.TestRunner tr = new junit.textui.TestRunner ( ) ; junit.framework.TestResult result = tr.doRun ( com.android.monkeyrunner.AllTests.suite ( com.android.monkeyrunner.JythonUtilsTest.class , com.android.monkeyrunner.MonkeyRunnerOptionsTest.class ) ) ; if ( result.wasSuccessful ( ) ) { java.lang.System.exit ( 0 ) ; } else { java.lang.System.exit ( 1 ) ; } }
Source:
public void onItemClick ( android.widget.AdapterView < ? > parent , android.view.View view , int position , long id ) { if ( com.android.bluetooth.opp.BluetoothOppTransferHistory.V ) android.util.Log.v ( com.android.bluetooth.opp.BluetoothOppTransferHistory.TAG , ( "onItemClick: ContextMenu = " + ( mContextMenu ) ) ) ; if ( ! ( mContextMenu ) ) { mTransferCursor.moveToPosition ( position ) ; openCompleteTransfer ( ) ; updateNotificationWhenBtDisabled ( ) ; } mContextMenu = false ; }

Target:
public void onItemClick ( android.widget.AdapterView < ? > parent , android.view.View view , int position , long id ) { if ( com.android.bluetooth.opp.BluetoothOppTransferHistory.V ) { android.util.Log.v ( com.android.bluetooth.opp.BluetoothOppTransferHistory.TAG , ( "onItemClick: ContextMenu = " + ( mContextMenu ) ) ) ; } if ( ! ( mContextMenu ) ) { mTransferCursor.moveToPosition ( position ) ; openCompleteTransfer ( ) ; updateNotificationWhenBtDisabled ( ) ; } mContextMenu = false ; }
Source:
public void test_SSL_check_private_key_no_key_no_cert ( ) throws java.lang.Exception { int c = org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_CTX_new ( ) ; int s = org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_new ( c ) ; try { org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_check_private_key ( s ) ; fail ( ) ; } catch ( javax.net.ssl.SSLException expected ) { } org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_free ( s ) ; org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_CTX_free ( c ) ; org.apache.harmony.xnet.provider.jsse.NativeCryptoTest.assertNoErrors ( ) ; }

Target:
public void test_SSL_check_private_key_no_key_no_cert ( ) throws java.lang.Exception { int c = org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_CTX_new ( ) ; int s = org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_new ( c ) ; try { org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_check_private_key ( s ) ; fail ( ) ; } catch ( javax.net.ssl.SSLException expected ) { } org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_free ( s ) ; org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_CTX_free ( c ) ; }
Source:
public int [ ] blend ( int [ ] src , int [ ] dst ) { return new int [ ] { dst [ 0 ] , src [ 1 ] , dst [ 2 ] , java.lang.Math.min ( 255 , ( ( src [ 3 ] ) + ( dst [ 3 ] ) ) ) } ; }

Target:
public int [ ] blend ( int [ ] src , int [ ] dst , int [ ] result ) { for ( int i = 0 ; i < 3 ; i ++ ) { result [ i ] = ( ( src [ i ] ) + ( dst [ i ] ) ) > > 1 ; } result [ 3 ] = java.lang.Math.min ( 255 , ( ( src [ 3 ] ) + ( dst [ 3 ] ) ) ) ; return result ; }
Source:
protected void setViewerInput ( ) { java.util.List < com.android.sdkuilib.internal.repository.core.PkgCategory > cats = mDiffLogic.getCategories ( isSortByApi ( ) ) ; if ( ( mITreeViewer.getInput ( ) ) != cats ) { mITreeViewer.setInput ( cats ) ; } else { mITreeViewer.refresh ( ) ; } }

Target:
protected void setViewerInput ( ) { java.util.List < com.android.sdkuilib.internal.repository.core.PkgCategory > cats = mDiffLogic.getCategories ( ) ; if ( ( mITreeViewer.getInput ( ) ) != cats ) { mITreeViewer.setInput ( cats ) ; } else { mITreeViewer.refresh ( ) ; } }
Source:
public java.util.Map < java.lang.String , com.android.builder.model.AndroidProject > executeAndReturnMultiModel ( boolean emulateStudio_1_0 , java.lang.String ... tasks ) { org.gradle.tooling.ProjectConnection connection = getProjectConnection ( ) ; try { executeBuild ( java.util.Collections.< java.lang.String > emptyList ( ) , connection , tasks , com.android.build.gradle.integration.common.fixture.GradleTestProject.ExpectedBuildResult.SUCCESS ) ; return buildModel ( connection , new com.android.build.gradle.integration.common.fixture.GetAndroidModelAction ( ) , emulateStudio_1_0 ) ; } finally { connection.close ( ) ; } }

Target:
public java.util.Map < java.lang.String , com.android.builder.model.AndroidProject > executeAndReturnMultiModel ( boolean emulateStudio_1_0 , java.lang.String ... tasks ) { org.gradle.tooling.ProjectConnection connection = getProjectConnection ( ) ; try { executeBuild ( java.util.Collections.< java.lang.String > emptyList ( ) , connection , tasks , com.android.build.gradle.integration.common.fixture.GradleTestProject.ExpectedBuildResult.SUCCESS ) ; return buildModel ( connection , new com.android.build.gradle.integration.common.fixture.GetAndroidModelAction ( ) , emulateStudio_1_0 , null , null ) ; } finally { connection.close ( ) ; } }
Source:
public void binderDied ( ) { if ( com.android.server.am.ActivityManagerService.localLOGV ) android.util.Slog.v ( com.android.server.am.ActivityManagerService.TAG , ( ( ( "Death received in " + ( this ) ) + " for thread " ) + ( mAppThread.asBinder ( ) ) ) ) ; synchronized ( this ) { appDiedLocked ( mApp , mPid , mAppThread ) ; } }

Target:
public void binderDied ( ) { if ( com.android.server.am.ActivityManagerService.localLOGV ) android.util.Slog.v ( com.android.server.am.ActivityManagerService.TAG , ( ( ( "Death received in " + ( this ) ) + " for thread " ) + ( mAppThread.asBinder ( ) ) ) ) ; synchronized ( this ) { appDiedLocked ( mApp , mPid , mAppThread , true ) ; } }
Source:
public com.android.ims.ImsUtInterface getSupplementaryServiceConfiguration ( int sessionId ) throws com.android.ims.ImsException { if ( ( ( mUt ) == null ) || ( ! ( mImsServiceProxy.isBinderAlive ( ) ) ) ) { checkAndThrowExceptionIfServiceUnavailable ( ) ; try { com.android.ims.internal.IImsUt iUt = mImsServiceProxy.getUtInterface ( sessionId ) ; if ( iUt == null ) { throw new com.android.ims.ImsException ( "getSupplementaryServiceConfiguration()" , ImsReasonInfo.CODE_UT_NOT_SUPPORTED ) ; } mUt = new com.android.ims.ImsUt ( iUt ) ; } catch ( android.os.RemoteException e ) { throw new com.android.ims.ImsException ( "getSupplementaryServiceConfiguration()" , e , ImsReasonInfo.CODE_LOCAL_IMS_SERVICE_DOWN ) ; } } return mUt ; }

Target:
public com.android.ims.ImsUtInterface getSupplementaryServiceConfiguration ( ) throws com.android.ims.ImsException { if ( ( ( mUt ) == null ) || ( ! ( mImsServiceProxy.isBinderAlive ( ) ) ) ) { checkAndThrowExceptionIfServiceUnavailable ( ) ; try { com.android.ims.internal.IImsUt iUt = mImsServiceProxy.getUtInterface ( ) ; if ( iUt == null ) { throw new com.android.ims.ImsException ( "getSupplementaryServiceConfiguration()" , ImsReasonInfo.CODE_UT_NOT_SUPPORTED ) ; } mUt = new com.android.ims.ImsUt ( iUt ) ; } catch ( android.os.RemoteException e ) { throw new com.android.ims.ImsException ( "getSupplementaryServiceConfiguration()" , e , ImsReasonInfo.CODE_LOCAL_IMS_SERVICE_DOWN ) ; } } return mUt ; }
Source:
private void start ( ) { android.os.HandlerThread thread = new android.os.HandlerThread ( "BluetoothAvrcpHandler" ) ; thread.start ( ) ; android.os.Looper looper = thread.getLooper ( ) ; mHandler = new com.android.bluetooth.avrcp.Avrcp.AvrcpMessageHandler ( looper ) ; mSessionChangeListener = new com.android.bluetooth.avrcp.Avrcp.MediaSessionChangeListener ( ) ; mMediaSessionManager.addOnActiveSessionsChangedListener ( mSessionChangeListener , null , mHandler ) ; updateCurrentMediaControllers ( mMediaSessionManager.getActiveSessions ( null ) ) ; mMediaControllerCb = new com.android.bluetooth.avrcp.Avrcp.MediaControllerListener ( ) ; }

Target:
private void start ( ) { android.os.HandlerThread thread = new android.os.HandlerThread ( "BluetoothAvrcpHandler" ) ; thread.start ( ) ; android.os.Looper looper = thread.getLooper ( ) ; mHandler = new com.android.bluetooth.avrcp.Avrcp.AvrcpMessageHandler ( looper ) ; mSessionChangeListener = new com.android.bluetooth.avrcp.Avrcp.MediaSessionChangeListener ( ) ; mMediaControllerCb = new com.android.bluetooth.avrcp.Avrcp.MediaControllerListener ( ) ; mMediaSessionManager.addOnActiveSessionsChangedListener ( mSessionChangeListener , null , mHandler ) ; updateCurrentMediaControllers ( mMediaSessionManager.getActiveSessions ( null ) ) ; }
Source:
private boolean readNotifyBufferMessage ( ) { try { org.chromium.mojo.system.ResultAnd < org.chromium.mojo.system.MessagePipeHandle.ReadMessageResult > readMessageResult = mReadHandle.readMessage ( org.chromium.mojo.bindings.ExecutorFactory.NOTIFY_BUFFER , 0 , MessagePipeHandle.ReadFlags.NONE ) ; if ( ( readMessageResult.getMojoResult ( ) ) == ( org.chromium.mojo.system.MojoResult.OK ) ) { asyncWait ( ) ; return true ; } } catch ( org.chromium.mojo.system.MojoException e ) { } return false ; }

Target:
private boolean readNotifyBufferMessage ( ) { try { org.chromium.mojo.system.ResultAnd < org.chromium.mojo.system.MessagePipeHandle.ReadMessageResult > readMessageResult = mReadHandle.readMessage ( org.chromium.mojo.bindings.ExecutorFactory.NOTIFY_BUFFER , 0 , MessagePipeHandle.ReadFlags.NONE ) ; if ( ( readMessageResult.getMojoResult ( ) ) == ( org.chromium.mojo.system.MojoResult.OK ) ) { return true ; } } catch ( org.chromium.mojo.system.MojoException e ) { } return false ; }
Source:
public void testEvaluateNetworks_untrustedNetworksAllowed_onlyDeletedEphemeral ( ) { org.mockito.Mockito.when ( mWifiConfigManager.wasEphemeralNetworkDeleted ( com.android.server.wifi.util.ScanResultUtil.createQuotedSSID ( mUntrustedScanDetail.getScanResult ( ) . SSID ) ) ) . thenReturn ( true ) ; android.net.wifi.WifiConfiguration result = mRecommendedNetworkEvaluator.evaluateNetworks ( com.google.android.collect.Lists.newArrayList ( mUntrustedScanDetail ) , null , null , false , true , null ) ; junit.framework.Assert.assertNull ( result ) ; org.mockito.Mockito.verifyZeroInteractions ( mNetworkScoreManager ) ; }

Target:
public void testEvaluateNetworks_untrustedNetworksAllowed_onlyDeletedEphemeral ( ) { when ( mWifiConfigManager.wasEphemeralNetworkDeleted ( com.android.server.wifi.util.ScanResultUtil.createQuotedSSID ( mUntrustedScanDetail.getScanResult ( ) . SSID ) ) ) . thenReturn ( true ) ; android.net.wifi.WifiConfiguration result = mRecommendedNetworkEvaluator.evaluateNetworks ( com.google.android.collect.Lists.newArrayList ( mUntrustedScanDetail ) , null , null , false , true , null ) ; junit.framework.Assert.assertNull ( result ) ; verifyZeroInteractions ( mNetworkScoreManager ) ; }
Source:
private static void splitAndAdd ( java.lang.String searchPath , boolean directoriesOnly , java.util.List < java.io.File > resultList ) { if ( searchPath == null ) { return ; } for ( java.lang.String path : searchPath.split ( ":" ) ) { try { android.system.StructStat sb = Libcore.os.stat ( path ) ; if ( ( ! directoriesOnly ) || ( android.system.OsConstants.S_ISDIR ( sb.st_mode ) ) ) { resultList.add ( new java.io.File ( path ) ) ; } } catch ( android.system.ErrnoException ignored ) { } } }

Target:
private static void splitAndAdd ( java.lang.String searchPath , boolean directoriesOnly , java.util.List < java.io.File > resultList ) { if ( searchPath == null ) { return ; } for ( java.lang.String path : searchPath.split ( ":" ) ) { try { android.system.StructStat sb = Libcore.os.stat ( path ) ; if ( ( ! directoriesOnly ) || ( S_ISDIR ( sb.st_mode ) ) ) { resultList.add ( new java.io.File ( path ) ) ; } } catch ( android.system.ErrnoException ignored ) { } } }
Source:
public void testAspectRatio ( ) throws java.lang.Exception { double aspectRatio = getRealAspectRatio ( getActivity ( ) ) ; android.util.Log.i ( android.dpi.cts.AspectRatioTest.TAG , ( "Aspect Ratio: " + aspectRatio ) ) ; if ( ( aspectRatio >= 1.333 ) && ( aspectRatio <= 1.86 ) ) { return ; } if ( getActivity ( ) . getPackageManager ( ) . hasSystemFeature ( PackageManager.FEATURE_WATCH ) ) { if ( ( aspectRatio >= 1.0 ) && ( aspectRatio <= 1.86 ) ) { return ; } } fail ( ( "Aspect ratio was not between 1.333 and 1.86: " + aspectRatio ) ) ; }

Target:
public void testAspectRatio ( ) throws java.lang.Exception { double aspectRatio = getRealAspectRatio ( getActivity ( ) ) ; if ( ( aspectRatio >= 1.333 ) && ( aspectRatio <= 1.86 ) ) { return ; } if ( getActivity ( ) . getPackageManager ( ) . hasSystemFeature ( PackageManager.FEATURE_WATCH ) ) { if ( ( aspectRatio >= 1.0 ) && ( aspectRatio <= 1.86 ) ) { return ; } } fail ( ( "Aspect ratio was not between 1.333 and 1.86: " + aspectRatio ) ) ; }
Source:
public synchronized void write ( int b ) throws java.io.IOException { buffer.put ( ( ( byte ) ( b ) ) ) ; if ( b == '\n' ) { synchronized ( out ) { com.android.jack.server.type.CommandOutPrintStream.CommandOutOutputStream.writeBuffer ( prefix , out ) ; buffer.flip ( ) ; com.android.jack.server.type.CommandOutPrintStream.CommandOutOutputStream.writeBuffer ( buffer , out ) ; buffer.clear ( ) ; } } if ( ( buffer.remaining ( ) ) == 1 ) { write ( '\n' ) ; } }

Target:
public synchronized void write ( int b ) throws java.io.IOException { buffer.put ( ( ( byte ) ( b ) ) ) ; if ( b == '\n' ) { synchronized ( out ) { try { com.android.jack.server.type.CommandOutPrintStream.CommandOutOutputStream.writeBuffer ( prefix , out ) ; buffer.flip ( ) ; com.android.jack.server.type.CommandOutPrintStream.CommandOutOutputStream.writeBuffer ( buffer , out ) ; } finally { buffer.clear ( ) ; } } } if ( ( buffer.remaining ( ) ) == 1 ) { write ( '\n' ) ; } }
Source:
public vogar.target.TargetRunner newRunner ( vogar.monitor.TargetMonitor monitor , java.lang.String qualification , java.lang.Class < ? > klass , java.util.concurrent.atomic.AtomicReference < java.lang.String > skipPastReference , vogar.target.TestEnvironment testEnvironment , int timeoutSeconds , boolean profile , java.lang.String [ ] args ) { if ( supports ( klass ) ) { return new vogar.target.junit.JUnitTargetRunner ( monitor , skipPastReference , testEnvironment , timeoutSeconds , klass , qualification , args ) ; } else { return null ; } }

Target:
public vogar.target.TargetRunner newRunner ( vogar.monitor.TargetMonitor monitor , java.lang.String qualification , java.lang.Class < ? > klass , java.util.concurrent.atomic.AtomicReference < java.lang.String > skipPastReference , vogar.target.TestEnvironment testEnvironment , int timeoutSeconds , java.lang.String [ ] args ) { if ( supports ( klass ) ) { return new vogar.target.junit.JUnitTargetRunner ( monitor , skipPastReference , testEnvironment , timeoutSeconds , klass , qualification , args ) ; } else { return null ; } }
Source:
public com.android.server.wifi.SoftApManager makeSoftApManager ( com.android.server.wifi.WifiNative wifiNative , android.os.INetworkManagementService nmService , android.net.ConnectivityManager cm , java.lang.String countryCode , java.util.ArrayList < java.lang.Integer > allowed2GChannels , com.android.server.wifi.SoftApManager.Listener listener , android.net.wifi.IApInterface apInterface ) { return new com.android.server.wifi.SoftApManager ( mWifiServiceHandlerThread.getLooper ( ) , wifiNative , countryCode , allowed2GChannels , listener , apInterface ) ; }

Target:
public com.android.server.wifi.SoftApManager makeSoftApManager ( com.android.server.wifi.WifiNative wifiNative , android.os.INetworkManagementService nmService , android.net.ConnectivityManager cm , java.lang.String countryCode , java.util.ArrayList < java.lang.Integer > allowed2GChannels , com.android.server.wifi.SoftApManager.Listener listener , android.net.wifi.IApInterface apInterface ) { return new com.android.server.wifi.SoftApManager ( mWifiServiceHandlerThread.getLooper ( ) , wifiNative , countryCode , allowed2GChannels , listener , apInterface , nmService ) ; }
Source:
public void testNotifySecondaryForeign ( ) { java.util.List < java.lang.String > barSecondaries = mBarUser0.getSecondaryDexPaths ( ) ; notifyDexLoad ( mFooUser0 , barSecondaries , mUser0 ) ; com.android.server.pm.dex.PackageDexUsage.PackageUseInfo pui = getPackageUseInfo ( mBarUser0 ) ; org.junit.Assert.assertNotNull ( pui ) ; org.junit.Assert.assertFalse ( pui.isUsedByOtherApps ( ) ) ; org.junit.Assert.assertEquals ( barSecondaries.size ( ) , pui.getDexUseInfoMap ( ) . size ( ) ) ; assertSecondaryUse ( mFooUser0 , pui , barSecondaries , true , mUser0 ) ; }

Target:
public void testNotifySecondaryForeign ( ) { java.util.List < java.lang.String > barSecondaries = mBarUser0.getSecondaryDexPaths ( ) ; notifyDexLoad ( mFooUser0 , barSecondaries , mUser0 ) ; com.android.server.pm.dex.PackageDexUsage.PackageUseInfo pui = getPackageUseInfo ( mBarUser0 ) ; org.junit.Assert.assertFalse ( pui.isUsedByOtherApps ( ) ) ; org.junit.Assert.assertEquals ( barSecondaries.size ( ) , pui.getDexUseInfoMap ( ) . size ( ) ) ; assertSecondaryUse ( mFooUser0 , pui , barSecondaries , true , mUser0 ) ; }
Source:
public static com.android.tools.lint.detector.api.Issue create ( @ com.android.annotations.NonNull java.lang.String id , @ com.android.annotations.NonNull java.lang.String briefDescription , @ com.android.annotations.NonNull java.lang.String description , @ com.android.annotations.NonNull java.lang.String explanation , @ com.android.annotations.NonNull com.android.tools.lint.detector.api.Category category , int priority , @ com.android.annotations.NonNull com.android.tools.lint.detector.api.Severity severity , @ com.android.annotations.NonNull com.android.tools.lint.detector.api.Implementation implementation ) { return new com.android.tools.lint.detector.api.Issue ( id , briefDescription , description , explanation , category , priority , severity , implementation ) ; }

Target:
public static com.android.tools.lint.detector.api.Issue create ( @ com.android.annotations.NonNull java.lang.String id , @ com.android.annotations.NonNull java.lang.String briefDescription , @ com.android.annotations.NonNull java.lang.String explanation , @ com.android.annotations.NonNull com.android.tools.lint.detector.api.Category category , int priority , @ com.android.annotations.NonNull com.android.tools.lint.detector.api.Severity severity , @ com.android.annotations.NonNull com.android.tools.lint.detector.api.Implementation implementation ) { return new com.android.tools.lint.detector.api.Issue ( id , briefDescription , explanation , category , priority , severity , implementation ) ; }
Source:
public void afterHandshake ( int session , int s , int c , java.net.Socket sock , java.io.FileDescriptor fd , org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSLHandshakeCallbacks callback ) throws java.lang.Exception { org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_read ( s , fd , callback , new byte [ 1 ] , 0 , 1 , 0 ) ; fail ( ) ; super . afterHandshake ( session , s , c , sock , fd , callback ) ; }

Target:
public void afterHandshake ( long session , long s , long c , java.net.Socket sock , java.io.FileDescriptor fd , org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSLHandshakeCallbacks callback ) throws java.lang.Exception { org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_read ( s , fd , callback , new byte [ 1 ] , 0 , 1 , 0 ) ; fail ( ) ; super . afterHandshake ( session , s , c , sock , fd , callback ) ; }
Source:
private void addRemoteSysImg ( com.android.sdklib.AndroidVersion version , com.android.sdklib.repository.MajorRevision revision , com.android.sdklib.repository.descriptors.IdDisplay tag , java.lang.String abi ) { com.android.sdklib.repository.descriptors.IPkgDesc d = PkgDesc.Builder.newSysImg ( version , tag , abi , revision ) . create ( ) ; com.android.sdklib.repository.remote.RemotePkgInfo r = new com.android.sdklib.repository.remote.RemotePkgInfo ( d , mSource ) ; mRemotePkgs.put ( d.getType ( ) , r ) ; }

Target:
private void addRemoteSysImg ( com.android.sdklib.AndroidVersion version , com.android.sdklib.repository.MajorRevision revision , com.android.sdklib.repository.descriptors.IdDisplay tag , java.lang.String abi ) { com.android.sdklib.repository.descriptors.IPkgDesc d = PkgDesc.Builder.newSysImg ( version , tag , abi , revision ) . create ( ) ; com.android.sdklib.repository.remote.RemotePkgInfo r = new com.android.sdklib.repository.remote.RemotePkgInfo ( d , mSource , 0 ) ; mRemotePkgs.put ( d.getType ( ) , r ) ; }
Source:
public com.android.jack.ir.ast.JClassLiteral exportAsJast ( @ javax.annotation.Nonnull com.android.jack.jayce.v0004.io.ExportSession exportSession ) throws com.android.jack.ir.ast.JTypeLookupException { assert ( sourceInfo ) != null ; assert ( refType ) != null ; return new com.android.jack.ir.ast.JClassLiteral ( sourceInfo , exportSession.getLookup ( ) . getType ( refType ) , exportSession.getLookup ( ) . getClass ( com.android.jack.jayce.v0004.nodes.NClassLiteral.JAVA_LANG_CLASS ) ) ; }

Target:
public com.android.jack.ir.ast.JClassLiteral exportAsJast ( @ javax.annotation.Nonnull com.android.jack.jayce.v0004.io.ExportSession exportSession ) throws com.android.jack.ir.ast.JTypeLookupException { assert ( sourceInfo ) != null ; assert ( refType ) != null ; return new com.android.jack.ir.ast.JClassLiteral ( sourceInfo , exportSession.getLookup ( ) . getType ( refType ) ) ; }
Source:
public static java.net.URI uri ( java.lang.String format , java.lang.Object ... args ) { java.lang.String uriString = java.lang.String.format ( format , args ) ; try { return new java.net.URI ( uriString ) ; } catch ( java.net.URISyntaxException e ) { throw new java.lang.IllegalStateException ( ( "Known good uri has syntax error: " + uriString ) , e ) ; } }

Target:
public static java.net.URI uri ( java.lang.String uriString ) { try { return new java.net.URI ( uriString ) ; } catch ( java.net.URISyntaxException e ) { throw new java.lang.IllegalStateException ( ( "Known good uri has syntax error: " + uriString ) , e ) ; } }
Source:
private void initPrefs ( android.content.Context context ) { final android.content.ContentResolver contentResolver = context.getContentResolver ( ) ; mResolver = new java.lang.ref.WeakReference < android.content.ContentResolver > ( contentResolver ) ; mObserver = new android.text.method.TextKeyListener.SettingsObserver ( ) ; contentResolver.registerContentObserver ( Settings.System.CONTENT_URI , true , mObserver ) ; updatePrefs ( contentResolver ) ; mPrefsInited = true ; }

Target:
private void initPrefs ( android.content.Context context ) { final android.content.ContentResolver contentResolver = context.getContentResolver ( ) ; mResolver = new java.lang.ref.WeakReference < android.content.ContentResolver > ( contentResolver ) ; if ( ( mObserver ) == null ) { mObserver = new android.text.method.TextKeyListener.SettingsObserver ( ) ; contentResolver.registerContentObserver ( Settings.System.CONTENT_URI , true , mObserver ) ; } updatePrefs ( contentResolver ) ; mPrefsInited = true ; }
Source:
private java.io.File getWrittenResources ( ) throws com.android.ide.common.res2.MergingException , java.io.IOException { com.android.ide.common.res2.ResourceMerger resourceMerger = com.android.ide.common.res2.ResourceMergerTest.getResourceMerger ( ) ; java.io.File folder = com.google.common.io.Files.createTempDir ( ) ; com.android.ide.common.res2.MergedResourceWriter writer = new com.android.ide.common.res2.MergedResourceWriter ( folder , mPngCruncher , false , false ) ; resourceMerger.mergeData ( writer , false ) ; return folder ; }

Target:
private java.io.File getWrittenResources ( ) throws com.android.ide.common.res2.MergingException , java.io.IOException { com.android.ide.common.res2.ResourceMerger resourceMerger = com.android.ide.common.res2.ResourceMergerTest.getResourceMerger ( false ) ; java.io.File folder = com.google.common.io.Files.createTempDir ( ) ; com.android.ide.common.res2.MergedResourceWriter writer = new com.android.ide.common.res2.MergedResourceWriter ( folder , mPngCruncher , false , false ) ; resourceMerger.mergeData ( writer , false ) ; return folder ; }
Source:
public final java.lang.Object getValue ( @ javax.annotation.Nonnegative int columnIdx ) { if ( ( this ) instanceof com.android.sched.util.table.DataRow ) { com.android.sched.util.table.DataRow data = ( ( com.android.sched.util.table.DataRow ) ( this ) ) ; return com.google.common.collect.Iterators.get ( data.iterator ( ) , columnIdx ) ; } throw new java.lang.AssertionError ( ) ; }

Target:
public final java.lang.Object getValue ( @ javax.annotation.Nonnegative int columnIdx ) { return com.google.common.collect.Iterators.get ( iterator ( ) , columnIdx ) ; }
Source:
public com.android.jack.ir.ast.JAnnotation exportAsJast ( @ javax.annotation.Nonnull com.android.jack.jayce.v0002.io.ExportSession exportSession ) throws com.android.jack.ir.ast.JTypeLookupException , com.android.jack.lookup.JMethodLookupException { assert ( retentionPolicy ) != null ; assert ( sourceInfo ) != null ; assert ( annotationType ) != null ; com.android.jack.ir.sourceinfo.SourceInfo jSourceInfo = sourceInfo.exportAsJast ( exportSession ) ; com.android.jack.ir.ast.JAnnotationType type = exportSession.getLookup ( ) . getAnnotationType ( annotationType ) ; com.android.jack.ir.ast.JAnnotation jAnnotation = new com.android.jack.ir.ast.JAnnotation ( jSourceInfo , retentionPolicy , type ) ; for ( com.android.jack.jayce.v0002.nodes.NNameValuePair valuePair : elements ) { jAnnotation.put ( valuePair.exportAsJast ( exportSession ) ) ; } return jAnnotation ; }

Target:
public com.android.jack.ir.ast.JAnnotation exportAsJast ( @ javax.annotation.Nonnull com.android.jack.jayce.v0002.io.ExportSession exportSession ) throws com.android.jack.ir.ast.JTypeLookupException , com.android.jack.lookup.JMethodLookupException { assert ( retentionPolicy ) != null ; assert ( sourceInfo ) != null ; assert ( annotationType ) != null ; com.android.jack.ir.sourceinfo.SourceInfo jSourceInfo = sourceInfo.exportAsJast ( exportSession ) ; com.android.jack.ir.ast.JAnnotationType type = exportSession.getLookup ( ) . getAnnotationType ( annotationType ) ; com.android.jack.ir.ast.JAnnotation jAnnotation = new com.android.jack.ir.ast.JAnnotation ( jSourceInfo , retentionPolicy , type ) ; for ( com.android.jack.jayce.v0002.nodes.NNameValuePair valuePair : elements ) { jAnnotation.put ( valuePair.exportAsJast ( exportSession , type ) ) ; } return jAnnotation ; }
Source:
protected boolean cleanup ( ) { if ( mNativeAvailable ) { cleanupNative ( ) ; mNativeAvailable = false ; } if ( ( mPanDevices ) != null ) { java.util.List < android.bluetooth.BluetoothDevice > devList = getConnectedDevices ( ) ; for ( android.bluetooth.BluetoothDevice dev : devList ) { handlePanDeviceStateChange ( dev , mPanIfName , BluetoothProfile.STATE_DISCONNECTED , BluetoothPan.LOCAL_PANU_ROLE , BluetoothPan.REMOTE_NAP_ROLE ) ; } mPanDevices.clear ( ) ; } return true ; }

Target:
protected void cleanup ( ) { if ( mNativeAvailable ) { cleanupNative ( ) ; mNativeAvailable = false ; } if ( ( mPanDevices ) != null ) { java.util.List < android.bluetooth.BluetoothDevice > devList = getConnectedDevices ( ) ; for ( android.bluetooth.BluetoothDevice dev : devList ) { handlePanDeviceStateChange ( dev , mPanIfName , BluetoothProfile.STATE_DISCONNECTED , BluetoothPan.LOCAL_PANU_ROLE , BluetoothPan.REMOTE_NAP_ROLE ) ; } mPanDevices.clear ( ) ; } }
Source:
public void testConstructor_SkipPastJUnitRunner ( ) throws java.lang.Exception { java.lang.String failingTestName = ( vogar.target.TestRunnerTest.JUnit3Test.class . getName ( ) ) + "#testMethodName" ; vogar.target.TestRunner runner = testRunnerRule.createTestRunner ( "--skipPast" , failingTestName ) ; java.lang.String skipPast = runner.skipPastReference.get ( ) ; org.junit.Assert.assertEquals ( failingTestName , skipPast ) ; runner.run ( ) ; org.junit.Assert.assertEquals ( ( ( ( ( ( ( ( ( "" + "//00xx{\"outcome\":\"" ) + ( vogar.target.TestRunnerTest.JUnit3Test.class . getName ( ) ) ) + "#testOtherName\"," ) + "\"runner\":\"" ) + ( vogar.target.junit.JUnitRunner.class . getName ( ) ) ) + "\"}\n" ) + "//00xx{\"result\":\"SUCCESS\"}\n" ) + "//00xx{\"completedNormally\":true}\n" ) , ios.contents ( Stream.OUT ) ) ; }

Target:
public void testConstructor_SkipPastJUnitRunner ( ) throws java.lang.Exception { java.lang.String failingTestName = ( vogar.target.TestRunnerTest.JUnit3Test.class . getName ( ) ) + "#testMethodName" ; vogar.target.TestRunner runner = testRunnerRule.createTestRunner ( "--skipPast" , failingTestName ) ; java.lang.String skipPast = runner.skipPastReference.get ( ) ; org.junit.Assert.assertEquals ( failingTestName , skipPast ) ; runner.run ( ) ; org.junit.Assert.assertEquals ( ( ( ( ( ( "" + "//00xx{\"outcome\":\"" ) + ( vogar.target.TestRunnerTest.JUnit3Test.class . getName ( ) ) ) + "#testOtherName\"}\n" ) + "//00xx{\"result\":\"SUCCESS\"}\n" ) + "//00xx{\"completedNormally\":true}\n" ) , ios.contents ( Stream.OUT ) ) ; }
Source:
public void afterHandshake ( long session , long ssl , long context , java.net.Socket socket , java.io.FileDescriptor fd , org.conscrypt.NativeCrypto.SSLHandshakeCallbacks callback ) throws java.lang.Exception { byte [ ] negotiated = org.conscrypt.NativeCrypto.SSL_get0_alpn_selected ( ssl ) ; assertEquals ( "spdy/2" , new java.lang.String ( negotiated ) ) ; if ( ! ( NativeCrypto.isBoringSSL ) ) { assertEquals ( "ALPN should not enable cutthrough on the client" , 0 , ( ( org.conscrypt.NativeCrypto.SSL_get_mode ( ssl ) ) & ( org.conscrypt.NativeConstants.SSL_MODE_HANDSHAKE_CUTTHROUGH ) ) ) ; } super . afterHandshake ( session , ssl , context , socket , fd , callback ) ; }

Target:
public void afterHandshake ( long session , long ssl , long context , java.net.Socket socket , java.io.FileDescriptor fd , org.conscrypt.NativeCrypto.SSLHandshakeCallbacks callback ) throws java.lang.Exception { byte [ ] negotiated = org.conscrypt.NativeCrypto.SSL_get0_alpn_selected ( ssl ) ; assertEquals ( "spdy/2" , new java.lang.String ( negotiated ) ) ; super . afterHandshake ( session , ssl , context , socket , fd , callback ) ; }
Source:
private void addBoldText ( org.eclipse.swt.custom.StyledText styledText , java.lang.String text ) { java.lang.String s = styledText.getText ( ) ; int start = ( s == null ) ? 0 : s.length ( ) ; styledText.append ( text ) ; org.eclipse.swt.custom.StyleRange sr = new com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.ClassLinkStyleRange ( ) ; sr.start = start ; sr.length = text.length ( ) ; sr.fontStyle = org.eclipse.swt.SWT.BOLD ; styledText.setStyleRange ( sr ) ; }

Target:
private void addBoldText ( org.eclipse.swt.custom.StyledText styledText , java.lang.String text ) { java.lang.String s = styledText.getText ( ) ; int start = ( s == null ) ? 0 : s.length ( ) ; styledText.append ( text ) ; org.eclipse.swt.custom.StyleRange sr = new org.eclipse.swt.custom.StyleRange ( ) ; sr.start = start ; sr.length = text.length ( ) ; sr.fontStyle = org.eclipse.swt.SWT.BOLD ; styledText.setStyleRange ( sr ) ; }
Source:
public void testStageInstallWithErrorCode_badTzLookupFile ( ) throws java.lang.Exception { com.android.timezone.distro.TimeZoneDistro stagedDistro = libcore.tzdata.update2.TimeZoneDistroInstallerTest.createValidTimeZoneDistro ( libcore.tzdata.update2.TimeZoneDistroInstallerTest.NEW_RULES_VERSION , 1 ) ; assertEquals ( TimeZoneDistroInstaller.INSTALL_SUCCESS , installer.stageInstallWithErrorCode ( stagedDistro.getBytes ( ) ) ) ; assertInstallDistroStaged ( stagedDistro ) ; com.android.timezone.distro.TimeZoneDistro incompleteDistro = libcore.tzdata.update2.TimeZoneDistroInstallerTest.createValidTimeZoneDistroBuilder ( libcore.tzdata.update2.TimeZoneDistroInstallerTest.NEWER_RULES_VERSION , 1 ) . setTzLookupXml ( "<foo />" ) . buildUnvalidated ( ) ; assertEquals ( TimeZoneDistroInstaller.INSTALL_FAIL_VALIDATION_ERROR , installer.stageInstallWithErrorCode ( incompleteDistro.getBytes ( ) ) ) ; assertInstallDistroStaged ( stagedDistro ) ; assertNoInstalledDistro ( ) ; }

Target:
public void testStageInstallWithErrorCode_badTzLookupFile ( ) throws java.lang.Exception { com.android.timezone.distro.TimeZoneDistro stagedDistro = libcore.tzdata.update2.TimeZoneDistroInstallerTest.createValidTimeZoneDistro ( libcore.tzdata.update2.TimeZoneDistroInstallerTest.NEW_RULES_VERSION , 1 ) ; assertEquals ( TimeZoneDistroInstaller.INSTALL_SUCCESS , installer.stageInstallWithErrorCode ( stagedDistro ) ) ; assertInstallDistroStaged ( stagedDistro ) ; com.android.timezone.distro.TimeZoneDistro incompleteDistro = libcore.tzdata.update2.TimeZoneDistroInstallerTest.createValidTimeZoneDistroBuilder ( libcore.tzdata.update2.TimeZoneDistroInstallerTest.NEWER_RULES_VERSION , 1 ) . setTzLookupXml ( "<foo />" ) . buildUnvalidated ( ) ; assertEquals ( TimeZoneDistroInstaller.INSTALL_FAIL_VALIDATION_ERROR , installer.stageInstallWithErrorCode ( incompleteDistro ) ) ; assertInstallDistroStaged ( stagedDistro ) ; assertNoInstalledDistro ( ) ; }
Source:
public void test_socket_accept_Nonblocking_Bound ( ) throws java.io.IOException { serverChannel.configureBlocking ( false ) ; serverChannel.bind ( null ) ; java.net.ServerSocket gotSocket = serverChannel.socket ( ) ; try { gotSocket.accept ( ) ; fail ( "Should throw an IllegalBlockingModeException" ) ; } catch ( java.nio.channels.IllegalBlockingModeException expected ) { } serverChannel.close ( ) ; try { gotSocket.accept ( ) ; fail ( "Should throw a ClosedChannelException" ) ; } catch ( java.nio.channels.ClosedChannelException expected ) { } }

Target:
public void test_socket_accept_Nonblocking_Bound ( ) throws java.io.IOException { serverChannel.configureBlocking ( false ) ; serverChannel.socket ( ) . bind ( null ) ; java.net.ServerSocket gotSocket = serverChannel.socket ( ) ; try { gotSocket.accept ( ) ; fail ( "Should throw an IllegalBlockingModeException" ) ; } catch ( java.nio.channels.IllegalBlockingModeException expected ) { } serverChannel.close ( ) ; try { gotSocket.accept ( ) ; fail ( "Should throw a ClosedChannelException" ) ; } catch ( java.nio.channels.ClosedChannelException expected ) { } }
Source:
private void cancelUserTimeoutAlarm ( ) { if ( com.android.bluetooth.map.BluetoothMapService.DEBUG ) android.util.Log.d ( com.android.bluetooth.map.BluetoothMapService.TAG , "cancelUserTimeOutAlarm()" ) ; android.content.Intent timeoutIntent = new android.content.Intent ( com.android.bluetooth.map.BluetoothMapService.USER_CONFIRM_TIMEOUT_ACTION ) ; android.app.PendingIntent pIntent = android.app.PendingIntent.getBroadcast ( this , 0 , timeoutIntent , 0 ) ; android.app.AlarmManager alarmManager = ( ( android.app.AlarmManager ) ( this . getSystemService ( Context.ALARM_SERVICE ) ) ) ; pIntent.cancel ( ) ; alarmManager.cancel ( pIntent ) ; mRemoveTimeoutMsg = false ; }

Target:
private void cancelUserTimeoutAlarm ( ) { if ( com.android.bluetooth.map.BluetoothMapService.DEBUG ) android.util.Log.d ( com.android.bluetooth.map.BluetoothMapService.TAG , "cancelUserTimeOutAlarm()" ) ; android.content.Intent timeoutIntent = new android.content.Intent ( com.android.bluetooth.map.BluetoothMapService.USER_CONFIRM_TIMEOUT_ACTION ) ; android.app.PendingIntent pIntent = android.app.PendingIntent.getBroadcast ( this , 0 , timeoutIntent , 0 ) ; pIntent.cancel ( ) ; android.app.AlarmManager alarmManager = ( ( android.app.AlarmManager ) ( this . getSystemService ( Context.ALARM_SERVICE ) ) ) ; alarmManager.cancel ( pIntent ) ; mRemoveTimeoutMsg = false ; }
Source:
private void addTestCase ( com.android.cts.verifier.ArrayTestListAdapter adapter , com.android.cts.verifier.p2p.testcase.TestCase testcase ) { android.content.Intent intent = new android.content.Intent ( this , getRequesterActivityClass ( ) ) ; intent.putExtra ( TestCase.EXTRA_TEST_NAME , testcase.getTestId ( ) ) ; adapter.add ( com.android.cts.verifier.TestListAdapter.TestListItem.newTest ( testcase.getTestName ( ) , testcase.getTestId ( ) , intent ) ) ; }

Target:
private void addTestCase ( com.android.cts.verifier.ArrayTestListAdapter adapter , com.android.cts.verifier.p2p.testcase.TestCase testcase ) { android.content.Intent intent = new android.content.Intent ( this , getRequesterActivityClass ( ) ) ; intent.putExtra ( TestCase.EXTRA_TEST_NAME , testcase.getTestId ( ) ) ; adapter.add ( com.android.cts.verifier.TestListAdapter.TestListItem.newTest ( testcase.getTestName ( ) , testcase.getTestId ( ) , intent , null ) ) ; }
Source:
public java.security.PrivateKey getPrivateKeyById ( java.lang.String id ) throws java.security.InvalidKeyException { if ( id == null ) { throw new java.lang.NullPointerException ( "id == null" ) ; } final int keyRef = org.apache.harmony.xnet.provider.jsse.NativeCrypto.ENGINE_load_private_key ( ctx , id ) ; if ( keyRef == 0 ) { return null ; } org.apache.harmony.xnet.provider.jsse.OpenSSLKey pkey = new org.apache.harmony.xnet.provider.jsse.OpenSSLKey ( keyRef , this , id ) ; try { return pkey.getPrivateKey ( ) ; } catch ( java.security.NoSuchAlgorithmException e ) { throw new java.security.InvalidKeyException ( e ) ; } }

Target:
public java.security.PrivateKey getPrivateKeyById ( java.lang.String id ) throws java.security.InvalidKeyException { if ( id == null ) { throw new java.lang.NullPointerException ( "id == null" ) ; } final long keyRef = org.apache.harmony.xnet.provider.jsse.NativeCrypto.ENGINE_load_private_key ( ctx , id ) ; if ( keyRef == 0 ) { return null ; } org.apache.harmony.xnet.provider.jsse.OpenSSLKey pkey = new org.apache.harmony.xnet.provider.jsse.OpenSSLKey ( keyRef , this , id ) ; try { return pkey.getPrivateKey ( ) ; } catch ( java.security.NoSuchAlgorithmException e ) { throw new java.security.InvalidKeyException ( e ) ; } }
Source:
public static int MultiplePhis ( ) { int x = 0 ; int y = 1 ; while ( ( y ++ ) < 10 ) { if ( y > 1 ) { x = 13 ; } else { x = 42 ; } } return x ; }

Target:
public static int MultiplePhis ( ) { int x = 0 ; int y = 1 ; while ( ( y ++ ) < 10 ) { if ( y > 1 ) { x = 13 ; continue ; } else { x = 42 ; continue ; } } return x ; }
Source:
public android.database.Cursor query ( android.net.Uri uri , java.lang.String [ ] projection , java.lang.String selection , java.lang.String [ ] selectionArgs , java.lang.String sortOrder ) { if ( ( mSubscriptionArray.size ( ) ) > 0 ) { return convertFromContentToCursor ( mSubscriptionArray.get ( 0 ) ) ; } return null ; }

Target:
public android.database.Cursor query ( android.net.Uri uri , java.lang.String [ ] projection , java.lang.String selection , java.lang.String [ ] selectionArgs , java.lang.String sortOrder ) { if ( ( mSubscriptionArray.size ( ) ) > 0 ) { return convertFromContentToCursor ( mSubscriptionArray.get ( 0 ) , projection ) ; } return null ; }
Source:
public static void computeFabs ( android.renderscript.cts.TestFabs.ArgumentsFloatFloat args , android.renderscript.cts.Target t ) { t.setPrecision ( 0 , 0 , false ) ; android.renderscript.cts.Target.Floaty in = t.new32 ( args.inX ) ; args.out = t.new32 ( java.lang.Math.abs ( args.inX ) , java.lang.Math.abs ( in.min32 ( ) ) , java.lang.Math.abs ( in.max32 ( ) ) ) ; }

Target:
public static void computeFabs ( android.renderscript.cts.TestFabs.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 ( java.lang.Math.abs ( args.inV ) , java.lang.Math.abs ( in.min32 ( ) ) , java.lang.Math.abs ( in.max32 ( ) ) ) ; }
Source:
private void handlePassthroughCmdRequestFromNative ( byte [ ] address , int id , int keyState ) { switch ( id ) { case android.bluetooth.BluetoothAvrcp.PASSTHROUGH_ID_REWIND : rewind ( address , keyState ) ; return ; case android.bluetooth.BluetoothAvrcp.PASSTHROUGH_ID_FAST_FOR : fastForward ( address , keyState ) ; return ; } android.os.Message msg = mHandler.obtainMessage ( com.android.bluetooth.avrcp.Avrcp.MSG_NATIVE_REQ_PASS_THROUGH , id , keyState , address ) ; mHandler.sendMessage ( msg ) ; }

Target:
private void handlePassthroughCmdRequestFromNative ( byte [ ] address , int id , int keyState ) { android.os.Message msg = mHandler.obtainMessage ( com.android.bluetooth.avrcp.Avrcp.MSG_NATIVE_REQ_PASS_THROUGH , id , keyState ) ; mHandler.sendMessage ( msg ) ; }