auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static double $noinline$returnDouble ( ) { if ( Main.doThrow ) throw new java.lang.Error ( "" ) ; int i = 0 ; for ( ; i < 300000 ; ++ i ) { } while ( ! ( Main.isInOsrCode ( "$noinline$returnDouble" ) ) ) { } java.lang.System.out.println ( i ) ; return java.lang.Double.longBitsToDouble ( - 1152921504606842607L ) ; }

Target:
public static double $noinline$returnDouble ( ) { boolean interpreting = Main.isInInterpreter ( "$noinline$returnDouble" ) ; int i = 0 ; for ( ; i < 300000 ; ++ i ) { } if ( interpreting ) { while ( ! ( Main.isInOsrCode ( "$noinline$returnDouble" ) ) ) { } } java.lang.System.out.println ( i ) ; return java.lang.Double.longBitsToDouble ( - 1152921504606842607L ) ; }
Source:
public void sealApk ( ) throws com.android.sdklib.build.ApkBuilder.ApkCreationException , com.android.sdklib.build.ApkBuilder.SealedApkException { if ( mIsSealed ) { throw new com.android.sdklib.build.ApkBuilder.SealedApkException ( "APK is already sealed" ) ; } try { mBuilder.close ( ) ; mIsSealed = true ; } catch ( java.lang.Exception e ) { throw new com.android.sdklib.build.ApkBuilder.ApkCreationException ( e , "Failed to seal APK" ) ; } }

Target:
public void sealApk ( ) throws com.android.sdklib.build.ApkCreationException , com.android.sdklib.build.SealedApkException { if ( mIsSealed ) { throw new com.android.sdklib.build.SealedApkException ( "APK is already sealed" ) ; } try { mBuilder.close ( ) ; mIsSealed = true ; } catch ( java.lang.Exception e ) { throw new com.android.sdklib.build.ApkCreationException ( e , "Failed to seal APK" ) ; } }
Source:
public void run ( ) { if ( ( result ) == 0 ) { switch ( mID ) { case com.android.rs.test.UnitTest.RS_MSG_TEST_PASSED : result = 1 ; break ; case com.android.rs.test.UnitTest.RS_MSG_TEST_FAILED : result = - 1 ; break ; default : com.android.rs.test.RSTest.log ( "Unit test got unexpected message" ) ; return ; } } updateUI ( ) ; }

Target:
public void passTest ( ) { if ( ( result ) != ( com.android.rs.test.UnitTest.TEST_FAILED ) ) { result = com.android.rs.test.UnitTest.TEST_PASSED ; } updateUI ( ) ; }
Source:
synchronized boolean replyReport ( android.bluetooth.BluetoothDevice device , byte type , byte id , byte [ ] data ) { if ( com.android.bluetooth.hid.HidDeviceService.DBG ) { android.util.Log.d ( com.android.bluetooth.hid.HidDeviceService.TAG , ( ( ( ( ( "replyReport(): device=" + device ) + " type=" ) + type ) + " id=" ) + id ) ) ; } if ( ! ( checkDevice ( device ) ) ) { return false ; } return replyReportNative ( type , id , data ) ; }

Target:
synchronized boolean replyReport ( android.bluetooth.BluetoothDevice device , byte type , byte id , byte [ ] data ) { if ( com.android.bluetooth.hid.HidDeviceService.DBG ) { android.util.Log.d ( com.android.bluetooth.hid.HidDeviceService.TAG , ( ( ( ( ( "replyReport(): device=" + device ) + " type=" ) + type ) + " id=" ) + id ) ) ; } return ( ( checkDevice ( device ) ) && ( checkCallingUid ( ) ) ) && ( mHidDeviceNativeInterface.replyReport ( type , id , data ) ) ; }
Source:
private static void checkMetadataTagAndCategoryRationality ( java.lang.String optionName , com.google.devtools.common.options.proto.OptionFilters.OptionMetadataTag [ ] metadataTags , com.google.devtools.common.options.OptionDocumentationCategory category ) { for ( com.google.devtools.common.options.proto.OptionFilters.OptionMetadataTag tag : metadataTags ) { if ( ( tag == ( com.google.devtools.common.options.proto.OptionFilters.OptionMetadataTag.HIDDEN ) ) || ( tag == ( com.google.devtools.common.options.proto.OptionFilters.OptionMetadataTag.INTERNAL ) ) ) { if ( category != ( OptionDocumentationCategory.UNDOCUMENTED ) ) { throw new com.google.devtools.common.options.OptionsParser.ConstructionException ( ( ( ( ( ( "Option " + optionName ) + " has metadata tag " ) + tag ) + " but does not have category UNDOCUMENTED. " ) + "Please fix." ) ) ; } } } }

Target:
private static void checkMetadataTagAndCategoryRationality ( java.lang.String optionName , com.google.devtools.common.options.OptionMetadataTag [ ] metadataTags , com.google.devtools.common.options.OptionDocumentationCategory category ) { for ( com.google.devtools.common.options.OptionMetadataTag tag : metadataTags ) { if ( ( tag == ( OptionMetadataTag.HIDDEN ) ) || ( tag == ( OptionMetadataTag.INTERNAL ) ) ) { if ( category != ( OptionDocumentationCategory.UNDOCUMENTED ) ) { throw new com.google.devtools.common.options.OptionsParser.ConstructionException ( ( ( ( ( ( "Option " + optionName ) + " has metadata tag " ) + tag ) + " but does not have category UNDOCUMENTED. " ) + "Please fix." ) ) ; } } } }
Source:
void foo9 ( int [ ] array ) { for ( int i = 0 ; i < 10 ; i ++ ) { sum += array [ i ] ; } }

Target:
void foo9 ( int [ ] array , boolean expectInterpreter ) { for ( int i = 0 ; i < 10 ; i ++ ) { if ( expectInterpreter ) { Main.assertIsInterpreted ( ) ; } else { Main.assertIsManaged ( ) ; } sum += array [ i ] ; } }
Source:
private void removeTasksByPackageNameLocked ( java.lang.String packageName , int userId ) { for ( int i = ( mRecentTasks.size ( ) ) - 1 ; i >= 0 ; i -- ) { com.android.server.am.TaskRecord tr = mRecentTasks.get ( i ) ; if ( ( tr.userId ) != userId ) continue ; android.content.ComponentName cn = tr.intent.getComponent ( ) ; if ( ( cn != null ) && ( cn.getPackageName ( ) . equals ( packageName ) ) ) { removeTaskByIdLocked ( tr.taskId , true ) ; } } }

Target:
private void removeTasksByPackageNameLocked ( java.lang.String packageName , int userId ) { for ( int i = ( mRecentTasks.size ( ) ) - 1 ; i >= 0 ; i -- ) { com.android.server.am.TaskRecord tr = mRecentTasks.get ( i ) ; if ( ( tr.userId ) != userId ) continue ; android.content.ComponentName cn = tr.intent.getComponent ( ) ; if ( ( cn != null ) && ( cn.getPackageName ( ) . equals ( packageName ) ) ) { removeTaskByIdLocked ( tr.taskId , true , com.android.server.am.ActivityManagerService.REMOVE_FROM_RECENTS ) ; } } }
Source:
void removeUserLPw ( int userId ) { java.util.Set < java.util.Map.Entry < java.lang.String , com.android.server.pm.PackageSetting > > entries = mPackages.entrySet ( ) ; for ( java.util.Map.Entry < java.lang.String , com.android.server.pm.PackageSetting > entry : entries ) { entry.getValue ( ) . removeUser ( userId ) ; } mPreferredActivities.remove ( userId ) ; java.io.File file = getUserPackagesStateFile ( userId ) ; file.delete ( ) ; file = getUserPackagesStateBackupFile ( userId ) ; file.delete ( ) ; removeCrossProfileIntentFiltersLPw ( userId ) ; }

Target:
void removeUserLPw ( int userId ) { java.util.Set < java.util.Map.Entry < java.lang.String , com.android.server.pm.PackageSetting > > entries = mPackages.entrySet ( ) ; for ( java.util.Map.Entry < java.lang.String , com.android.server.pm.PackageSetting > entry : entries ) { entry.getValue ( ) . removeUser ( userId ) ; } mPreferredActivities.remove ( userId ) ; java.io.File file = getUserPackagesStateFile ( userId ) ; file.delete ( ) ; file = getUserPackagesStateBackupFile ( userId ) ; file.delete ( ) ; removeCrossProfileIntentFiltersLPw ( userId ) ; mRuntimePermissionsPersistence.onUserRemoved ( userId ) ; writePackageListLPr ( ) ; }
Source:
public void visitAnyMember ( proguard.optimize.info.Clazz clazz , proguard.optimize.info.Member member ) { int accessFlags = member.getAccessFlags ( ) ; if ( ( accessFlags & ( ClassConstants.INTERNAL_ACC_PRIVATE ) ) != 0 ) { proguard.optimize.info.AccessMethodMarker.setAccessesPrivateCode ( invokingMethod ) ; } else if ( ( accessFlags & ( ClassConstants.INTERNAL_ACC_PROTECTED ) ) != 0 ) { proguard.optimize.info.AccessMethodMarker.setAccessesProtectedCode ( invokingMethod ) ; } else if ( ( accessFlags & ( ClassConstants.INTERNAL_ACC_PUBLIC ) ) == 0 ) { proguard.optimize.info.AccessMethodMarker.setAccessesPackageCode ( invokingMethod ) ; } }

Target:
public void visitAnyMember ( proguard.optimize.info.Clazz clazz , proguard.optimize.info.Member member ) { int accessFlags = member.getAccessFlags ( ) ; if ( ( accessFlags & ( ClassConstants.ACC_PRIVATE ) ) != 0 ) { proguard.optimize.info.AccessMethodMarker.setAccessesPrivateCode ( invokingMethod ) ; } else if ( ( accessFlags & ( ClassConstants.ACC_PROTECTED ) ) != 0 ) { proguard.optimize.info.AccessMethodMarker.setAccessesProtectedCode ( invokingMethod ) ; } else if ( ( accessFlags & ( ClassConstants.ACC_PUBLIC ) ) == 0 ) { proguard.optimize.info.AccessMethodMarker.setAccessesPackageCode ( invokingMethod ) ; } }
Source:
protected void dump ( java.io.FileDescriptor fd , java.io.PrintWriter pw , java.lang.String [ ] args ) { mContext.enforceCallingOrSelfPermission ( android.Manifest.permission.DUMP , com.android.server.IpSecService.TAG ) ; pw.println ( "IpSecService Log:" ) ; pw.println ( ( "NetdNativeService Connection: " + ( isNetdAlive ( ) ? "alive" : "dead" ) ) ) ; pw.println ( ) ; }

Target:
protected synchronized void dump ( java.io.FileDescriptor fd , java.io.PrintWriter pw , java.lang.String [ ] args ) { mContext.enforceCallingOrSelfPermission ( android.Manifest.permission.DUMP , com.android.server.IpSecService.TAG ) ; pw.println ( "IpSecService dump:" ) ; pw.println ( ( "NetdNativeService Connection: " + ( isNetdAlive ( ) ? "alive" : "dead" ) ) ) ; pw.println ( ) ; pw.println ( "mTransformRecords:" ) ; pw.println ( mTransformRecords ) ; pw.println ( "mUdpSocketRecords:" ) ; pw.println ( mUdpSocketRecords ) ; pw.println ( "mSpiRecords:" ) ; pw.println ( mSpiRecords ) ; }
Source:
protected void readSourceFolder ( java.io.File sourceFolder , com.android.utils.ILogger logger ) throws com.android.ide.common.res2.MergingException { java.io.File [ ] folders = sourceFolder.listFiles ( ) ; if ( folders != null ) { for ( java.io.File folder : folders ) { if ( ( folder.isDirectory ( ) ) && ( com.android.ide.common.packaging.PackagingUtils.checkFolderForPackaging ( folder.getName ( ) ) ) ) { com.android.ide.common.res2.ResourceSet.FolderData folderData = com.android.ide.common.res2.ResourceSet.getFolderData ( folder ) ; if ( folderData != null ) { parseFolder ( sourceFolder , folder , folderData , logger ) ; } } } } }

Target:
protected void readSourceFolder ( java.io.File sourceFolder , com.android.utils.ILogger logger ) throws com.android.ide.common.res2.MergingException { java.io.File [ ] folders = sourceFolder.listFiles ( ) ; if ( folders != null ) { for ( java.io.File folder : folders ) { if ( ( folder.isDirectory ( ) ) && ( ! ( isIgnored ( folder ) ) ) ) { com.android.ide.common.res2.ResourceSet.FolderData folderData = com.android.ide.common.res2.ResourceSet.getFolderData ( folder ) ; if ( folderData != null ) { parseFolder ( sourceFolder , folder , folderData , logger ) ; } } } } }
Source:
private com.android.ide.eclipse.adt.internal.editors.descriptors.AttributeDescriptor [ ] findViewLayoutAttributes ( java.lang.String viewFqcn , java.util.List < com.android.ide.eclipse.adt.internal.editors.layout.descriptors.ViewElementDescriptor > knownViews ) { for ( com.android.ide.eclipse.adt.internal.editors.layout.descriptors.ViewElementDescriptor viewDesc : knownViews ) { if ( viewFqcn.equals ( viewDesc.getFullClassName ( ) ) ) { return viewDesc.getLayoutAttributes ( ) ; } } return null ; }

Target:
public com.android.ide.eclipse.adt.internal.editors.layout.descriptors.ViewElementDescriptor findDescriptorByTag ( java.lang.String tag ) { for ( com.android.ide.eclipse.adt.internal.editors.layout.descriptors.ViewElementDescriptor descriptor : mLayoutDescriptors ) { if ( tag.equals ( descriptor.getXmlLocalName ( ) ) ) { return descriptor ; } } return null ; }
Source:
public java.util.List < java.io.File > getJavaLibraries ( ) { if ( ( mJavaLibraries ) == null ) { java.util.Collection < java.io.File > jars = mVariant.getMainArtifact ( ) . getDependencies ( ) . getJars ( ) ; mJavaLibraries = com.google.common.collect.Lists.newArrayListWithExpectedSize ( jars.size ( ) ) ; for ( java.io.File jar : jars ) { if ( jar.exists ( ) ) { mJavaLibraries.add ( jar ) ; } } } return mJavaLibraries ; }

Target:
public java.util.List < java.io.File > getJavaLibraries ( ) { if ( ( mJavaLibraries ) == null ) { java.util.Collection < com.android.builder.model.JavaLibrary > libs = mVariant.getMainArtifact ( ) . getDependencies ( ) . getJavaLibraries ( ) ; mJavaLibraries = com.google.common.collect.Lists.newArrayListWithExpectedSize ( libs.size ( ) ) ; for ( com.android.builder.model.JavaLibrary lib : libs ) { java.io.File jar = lib.getJarFile ( ) ; if ( jar.exists ( ) ) { mJavaLibraries.add ( jar ) ; } } } return mJavaLibraries ; }
Source:
static void setDevice ( java.nio.channels.SocketChannel adbChan , com.android.ddmlib.IDevice device ) throws com.android.ddmlib.TimeoutException , java.io.IOException { if ( device != null ) { java.lang.String msg = "host:transport:" + ( device.getSerialNumber ( ) ) ; byte [ ] device_query = com.android.ddmlib.AdbHelper.formAdbRequest ( msg ) ; com.android.ddmlib.AdbHelper.write ( adbChan , device_query ) ; com.android.ddmlib.AdbHelper.AdbResponse resp = com.android.ddmlib.AdbHelper.readAdbResponse ( adbChan , false ) ; if ( ! ( resp.okay ) ) throw new java.io.IOException ( ( ( ( "device (" + device ) + ") request rejected: " ) + ( resp.message ) ) ) ; } }

Target:
static void setDevice ( java.nio.channels.SocketChannel adbChan , com.android.ddmlib.IDevice device ) throws com.android.ddmlib.AdbCommandRejectedException , com.android.ddmlib.TimeoutException , java.io.IOException { if ( device != null ) { java.lang.String msg = "host:transport:" + ( device.getSerialNumber ( ) ) ; byte [ ] device_query = com.android.ddmlib.AdbHelper.formAdbRequest ( msg ) ; com.android.ddmlib.AdbHelper.write ( adbChan , device_query ) ; com.android.ddmlib.AdbHelper.AdbResponse resp = com.android.ddmlib.AdbHelper.readAdbResponse ( adbChan , false ) ; if ( ( resp.okay ) == false ) { throw new com.android.ddmlib.AdbCommandRejectedException ( resp.message , true ) ; } } }
Source:
public void setModel ( com.android.uiautomator.UiAutomatorModel model , org.eclipse.swt.graphics.Image screenshot ) { mModel = model ; if ( ( mScreenshot ) != null ) { mScreenshot.dispose ( ) ; } mScreenshot = screenshot ; redrawScreenshot ( ) ; com.android.uiautomator.tree.BasicTreeNode wrapper = new com.android.uiautomator.tree.BasicTreeNode ( ) ; wrapper.addChild ( mModel.getXmlRootNode ( ) ) ; setInputHierarchy ( wrapper ) ; mTreeViewer.getTree ( ) . setFocus ( ) ; }

Target:
public void setModel ( com.android.uiautomator.UiAutomatorModel model , java.io.File modelBackingFile , org.eclipse.swt.graphics.Image screenshot ) { mModel = model ; mModelFile = modelBackingFile ; if ( ( mScreenshot ) != null ) { mScreenshot.dispose ( ) ; } mScreenshot = screenshot ; redrawScreenshot ( ) ; com.android.uiautomator.tree.BasicTreeNode wrapper = new com.android.uiautomator.tree.BasicTreeNode ( ) ; wrapper.addChild ( mModel.getXmlRootNode ( ) ) ; setInputHierarchy ( wrapper ) ; mTreeViewer.getTree ( ) . setFocus ( ) ; }
Source:
public void test_SingletonList_replaceAll ( ) { try { java.util.Collections.singletonList ( 1 ) . replaceAll ( ( k ) -> 2 ) ; fail ( ) ; } catch ( java.lang.UnsupportedOperationException expected ) { } }

Target:
public void test_unmodifiableList_replaceAll ( ) { try { java.util.Collections.unmodifiableList ( new java.util.ArrayList < > ( ) ) . replaceAll ( ( k ) -> 1 ) ; fail ( ) ; } catch ( java.lang.UnsupportedOperationException expected ) { } try { java.util.ArrayList l = new java.util.ArrayList ( ) ; l.add ( 1 ) ; l.add ( 2 ) ; java.util.Collections.unmodifiableList ( l ) . replaceAll ( ( k ) -> 1 ) ; fail ( ) ; } catch ( java.lang.UnsupportedOperationException expected ) { } }
Source:
public static int available ( java.io.FileDescriptor fd ) throws java.io.IOException { try { android.util.MutableInt available = new android.util.MutableInt ( 0 ) ; Libcore.os.ioctlInt ( fd , libcore.io.FIONREAD , available ) ; if ( ( available.value ) < 0 ) { available.value = 0 ; } return available.value ; } catch ( android.system.ErrnoException errnoException ) { if ( ( errnoException.errno ) == ( ENOTTY ) ) { return 0 ; } throw errnoException.rethrowAsIOException ( ) ; } }

Target:
public static int available ( java.io.FileDescriptor fd ) throws java.io.IOException { try { libcore.util.MutableInt available = new libcore.util.MutableInt ( 0 ) ; Libcore.os.ioctlInt ( fd , libcore.io.FIONREAD , available ) ; if ( ( available.value ) < 0 ) { available.value = 0 ; } return available.value ; } catch ( android.system.ErrnoException errnoException ) { if ( ( errnoException.errno ) == ( ENOTTY ) ) { return 0 ; } throw errnoException.rethrowAsIOException ( ) ; } }
Source:
private javax.net.ssl.SSLEngine getEngine ( ) { javax.net.ssl.SSLContext context = null ; try { context = javax.net.ssl.SSLContext.getInstance ( "TLS" ) ; context.init ( null , null , null ) ; } catch ( java.security.KeyManagementException e ) { fail ( ( "Could not get SSLEngine: key management exception " + ( e.getMessage ( ) ) ) ) ; } catch ( java.security.NoSuchAlgorithmException e ) { fail ( ( "Could not get SSLEngine: no such algorithm " + ( e.getMessage ( ) ) ) ) ; } return context.createSSLEngine ( ) ; }

Target:
private javax.net.ssl.SSLEngine getEngine ( java.lang.String host , int port ) throws java.lang.Exception { javax.net.ssl.SSLContext context = javax.net.ssl.SSLContext.getInstance ( "TLS" ) ; context.init ( null , null , null ) ; return context.createSSLEngine ( host , port ) ; }
Source:
java.lang.Integer getNetworkScore ( android.net.wifi.ScanResult scanResult , com.android.server.wifi.WifiNetworkScoreCache scoreCache , boolean active ) { if ( ( scoreCache != null ) && ( scoreCache.isScoredNetwork ( scanResult ) ) ) { int score = scoreCache.getNetworkScore ( scanResult , active ) ; localLog ( ( ( ( ( ( com.android.server.wifi.WifiNetworkSelector.toScanId ( scanResult ) ) + " has score: " ) + score ) + " active network: " ) + active ) ) ; return score ; } return null ; }

Target:
java.lang.Integer getNetworkScore ( android.net.wifi.ScanResult scanResult , android.net.wifi.WifiNetworkScoreCache scoreCache , boolean active ) { if ( ( scoreCache != null ) && ( scoreCache.isScoredNetwork ( scanResult ) ) ) { int score = scoreCache.getNetworkScore ( scanResult , active ) ; localLog ( ( ( ( ( ( com.android.server.wifi.WifiNetworkSelector.toScanId ( scanResult ) ) + " has score: " ) + score ) + " active network: " ) + active ) ) ; return score ; } return null ; }
Source:
public void removeExtras ( java.lang.String callId , java.util.List < java.lang.String > keys ) { android.telecom.Log.startSession ( "CSW.rE" ) ; long token = android.os.Binder.clearCallingIdentity ( ) ; try { synchronized ( mLock ) { logIncoming ( "removeExtra %s %s" , callId , keys ) ; com.android.server.telecom.Call call = mCallIdMapper.getCall ( callId ) ; if ( call != null ) { call.removeExtras ( Call.SOURCE_CONNECTION_SERVICE , keys ) ; } } } finally { android.os.Binder.restoreCallingIdentity ( token ) ; android.telecom.Log.endSession ( ) ; } }

Target:
public void removeExtras ( java.lang.String callId , java.util.List < java.lang.String > keys , android.telecom.Logging.Session.Info sessionInfo ) { android.telecom.Log.startSession ( sessionInfo , "CSW.rE" ) ; long token = android.os.Binder.clearCallingIdentity ( ) ; try { synchronized ( mLock ) { logIncoming ( "removeExtra %s %s" , callId , keys ) ; com.android.server.telecom.Call call = mCallIdMapper.getCall ( callId ) ; if ( call != null ) { call.removeExtras ( Call.SOURCE_CONNECTION_SERVICE , keys ) ; } } } finally { android.os.Binder.restoreCallingIdentity ( token ) ; android.telecom.Log.endSession ( ) ; } }
Source:
private boolean runPlayAV ( int inputResourceId , long lastBufferTimestampUs , boolean audio , boolean video ) { }

Target:
public void onAudioBufferConsumed ( android.media.MediaSync sync , java.nio.ByteBuffer byteBuffer , int bufferIndex ) { android.media.cts.MediaSyncTest.Decoder decoderAudio = mDecoderAudio ; if ( decoderAudio != null ) { decoderAudio.releaseOutputBuffer ( bufferIndex , NO_TIMESTAMP ) ; } synchronized ( conditionFirstAudioBuffer ) { synchronized ( mConditionTaggedAudioBufferIndex ) { if ( ( ( mTaggedAudioBufferIndex ) >= 0 ) && ( ( mTaggedAudioBufferIndex ) == bufferIndex ) ) { conditionFirstAudioBuffer.notify ( ) ; } } } }
Source:
public void testRoundTrip ( ) { for ( com.google.common.hash.HashCodeTest.ExpectedHashCode expected : com.google.common.hash.HashCodeTest.expectedHashCodes ) { java.lang.String string = com.google.common.hash.HashCodes.fromBytes ( expected.bytes ) . toString ( ) ; assertEquals ( expected.toString , string ) ; assertEquals ( expected.toString , com.google.common.hash.HashCodes.fromBytes ( com.google.common.io.BaseEncoding.base16 ( ) . lowerCase ( ) . decode ( string ) ) . toString ( ) ) ; } }

Target:
public void testRoundTrip ( ) { for ( com.google.common.hash.HashCodeTest.ExpectedHashCode expected : com.google.common.hash.HashCodeTest.expectedHashCodes ) { java.lang.String string = com.google.common.hash.HashCode.fromBytes ( expected.bytes ) . toString ( ) ; assertEquals ( expected.toString , string ) ; assertEquals ( expected.toString , com.google.common.hash.HashCode.fromBytes ( com.google.common.io.BaseEncoding.base16 ( ) . lowerCase ( ) . decode ( string ) ) . toString ( ) ) ; } }
Source:
void init ( ) { android.content.IntentFilter filter = new android.content.IntentFilter ( ) ; filter.addAction ( BluetoothHeadset.ACTION_HF_INDICATORS_VALUE_CHANGED ) ; com.android.bluetooth.btservice.RemoteDevices.mAdapterService.registerReceiver ( mReceiver , filter ) ; }

Target:
void init ( ) { android.content.IntentFilter filter = new android.content.IntentFilter ( ) ; filter.addAction ( BluetoothHeadset.ACTION_HF_INDICATORS_VALUE_CHANGED ) ; filter.addAction ( BluetoothHeadset.ACTION_VENDOR_SPECIFIC_HEADSET_EVENT ) ; filter.addCategory ( ( ( ( android.bluetooth.BluetoothHeadset.VENDOR_SPECIFIC_HEADSET_EVENT_COMPANY_ID_CATEGORY ) + "." ) + ( android.bluetooth.BluetoothAssignedNumbers.PLANTRONICS ) ) ) ; com.android.bluetooth.btservice.RemoteDevices.mAdapterService.registerReceiver ( mReceiver , filter ) ; }
Source:
protected void handle ( long taskId , @ javax.annotation.Nonnull org.simpleframework.http.Request request , @ javax.annotation.Nonnull org.simpleframework.http.Response response ) { com.android.jack.server.tasks.ReloadConfig.logger.log ( java.util.logging.Level.INFO , "Reloading configuration" ) ; try { jackServer.reloadConfig ( ) ; response.setStatus ( Status.OK ) ; } catch ( java.io.IOException | com.android.jack.server.api.v01.ServerException e ) { com.android.jack.server.tasks.ReloadConfig.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to reload configuration: " + ( e.getMessage ( ) ) ) ) ; response.setStatus ( Status.INTERNAL_SERVER_ERROR ) ; } }

Target:
protected void handle ( long taskId , @ javax.annotation.Nonnull org.simpleframework.http.Request request , @ javax.annotation.Nonnull org.simpleframework.http.Response response ) { com.android.jack.server.tasks.ReloadConfig.logger.log ( java.util.logging.Level.INFO , "Reloading configuration" ) ; response.setContentLength ( 0 ) ; try { jackServer.reloadConfig ( ) ; response.setStatus ( Status.OK ) ; } catch ( java.io.IOException | com.android.jack.server.api.v01.ServerException e ) { com.android.jack.server.tasks.ReloadConfig.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to reload configuration: " + ( e.getMessage ( ) ) ) ) ; response.setStatus ( Status.INTERNAL_SERVER_ERROR ) ; } }
Source:
private void resetUnreadCountForSelectedFilter ( ) { mLogCatFilters.get ( mCurrentSelectedFilterIndex ) . resetUnreadCount ( ) ; refreshFiltersTable ( ) ; }

Target:
private void filterSelectionChanged ( ) { int idx = mFiltersTableViewer.getTable ( ) . getSelectionIndex ( ) ; if ( idx == ( - 1 ) ) { idx = 0 ; mFiltersTableViewer.getTable ( ) . setSelection ( idx ) ; } mCurrentSelectedFilterIndex = idx ; resetUnreadCountForAllFilters ( ) ; updateFiltersToolBar ( ) ; updateAppliedFilters ( ) ; }
Source:
public void tearDown ( ) { mA2dpService.stop ( ) ; mA2dpService.cleanup ( ) ; mA2dpService = null ; mTargetContext.unregisterReceiver ( mConnectionStateChangedReceiver ) ; mConnectionStateChangedQueue.clear ( ) ; }

Target:
private void startService ( ) throws java.util.concurrent.TimeoutException { android.content.Intent startIntent = new android.content.Intent ( android.support.test.InstrumentationRegistry.getTargetContext ( ) , com.android.bluetooth.a2dp.A2dpService.class ) ; startIntent.putExtra ( AdapterService.EXTRA_ACTION , AdapterService.ACTION_SERVICE_STATE_CHANGED ) ; startIntent.putExtra ( BluetoothAdapter.EXTRA_STATE , BluetoothAdapter.STATE_ON ) ; mServiceRule.startService ( startIntent ) ; verify ( mAdapterService , timeout ( com.android.bluetooth.a2dp.A2dpServiceTest.TIMEOUT_MS ) ) . onProfileServiceStateChanged ( eq ( com.android.bluetooth.a2dp.A2dpService.class . getName ( ) ) , eq ( BluetoothAdapter.STATE_ON ) ) ; mA2dpService = com.android.bluetooth.a2dp.A2dpService.getA2dpService ( ) ; org.junit.Assert.assertNotNull ( mA2dpService ) ; }
Source:
void onAdvertiseParamsSet ( int status , int advertiserId ) { if ( com.android.bluetooth.gatt.GattService.DBG ) android.util.Log.d ( com.android.bluetooth.gatt.GattService.TAG , ( ( ( "onAdvertiseParamsSet() - advertiserId=" + advertiserId ) + ", status=" ) + status ) ) ; mAdvertiseManager.callbackDone ( advertiserId , status ) ; }

Target:
void onAdvertiserStarted ( int status , int advertiserId ) throws android.os.RemoteException { if ( com.android.bluetooth.gatt.GattService.DBG ) android.util.Log.d ( com.android.bluetooth.gatt.GattService.TAG , ( ( ( "onAdvertiserStarted() - advertiserId=" + advertiserId ) + ", status=" ) + status ) ) ; mAdvertiseManager.callbackDone ( advertiserId , status ) ; com.android.bluetooth.gatt.AdvertiserMap.App app = mAdvertiserMap.getById ( advertiserId ) ; if ( app != null ) { if ( status == 0 ) { app.callback.onMultiAdvertiseCallback ( AdvertiseCallback.ADVERTISE_SUCCESS , true , null ) ; } else { app.callback.onMultiAdvertiseCallback ( AdvertiseCallback.ADVERTISE_FAILED_INTERNAL_ERROR , true , null ) ; } } }
Source:
public void testApplyingWithAbsentFileToDelete ( ) throws java.lang.Exception { com.intellij.updater.PatchFileCreator.create ( myOlderDir , myNewerDir , myFile , java.util.Collections.< java.lang.String > emptyList ( ) , java.util.Collections.< java.lang.String > emptyList ( ) , java.util.Collections.< java.lang.String > emptyList ( ) , com.intellij.updater.TEST_UI ) ; new java.io.File ( myOlderDir , "bin/idea.bat" ) . delete ( ) ; assertAppliedAndRevertedCorrectly ( com.intellij.updater.PatchFileCreator.prepareAndValidate ( myFile , myOlderDir , com.intellij.updater.TEST_UI ) ) ; }

Target:
public void testRevertingWithAbsentFileToDelete ( ) throws java.lang.Exception { com.intellij.updater.Patch patch = com.intellij.updater.PatchFileCreator.create ( myPatchSpec , myFile , com.intellij.updater.TEST_UI ) ; new java.io.File ( myOlderDir , "bin/idea.bat" ) . delete ( ) ; com.intellij.updater.PatchFileCreator.PreparationResult preparationResult = com.intellij.updater.PatchFileCreator.prepareAndValidate ( myFile , myOlderDir , com.intellij.updater.TEST_UI ) ; preparationResult.patch.getActions ( ) . add ( new com.intellij.updater.PatchFileCreatorTest.MyFailOnApplyPatchAction ( patch ) ) ; assertNothingHasChanged ( patch , preparationResult , new java.util.HashMap < java.lang.String , com.intellij.updater.ValidationResult.Option > ( ) ) ; }
Source:
protected void setUp ( ) throws java.lang.Exception { mAndroidKeyStore = android.security.android.security.KeyStore.getInstance ( ) ; assertTrue ( mAndroidKeyStore.reset ( ) ) ; assertFalse ( mAndroidKeyStore.isUnlocked ( ) ) ; assertTrue ( mAndroidKeyStore.password ( "1111" ) ) ; assertTrue ( mAndroidKeyStore.isUnlocked ( ) ) ; java.lang.String [ ] aliases = mAndroidKeyStore.saw ( "" ) ; assertNotNull ( aliases ) ; assertEquals ( 0 , aliases.length ) ; mGenerator = java.security.KeyPairGenerator.getInstance ( AndroidKeyPairGenerator.NAME ) ; }

Target:
protected void setUp ( ) throws java.lang.Exception { mAndroidKeyStore = android.security.android.security.KeyStore.getInstance ( ) ; assertTrue ( mAndroidKeyStore.reset ( ) ) ; assertFalse ( mAndroidKeyStore.isUnlocked ( ) ) ; mGenerator = java.security.KeyPairGenerator.getInstance ( "AndroidKeyStore" ) ; }
Source:
public java.lang.String getDeviceId ( java.lang.String callingPackage ) { if ( ! ( canReadPhoneState ( callingPackage , "getDeviceId" ) ) ) { return null ; } final com.android.internal.telephony.Phone phone = com.android.internal.telephony.PhoneFactory.getPhone ( 0 ) ; if ( phone != null ) { return phone.getDeviceId ( ) ; } else { return null ; } }

Target:
public java.lang.String getDeviceId ( java.lang.String callingPackage ) { if ( ! ( com.android.internal.telephony.TelephonyPermissions.checkCallingOrSelfReadPhoneState ( mApp , callingPackage , "getDeviceId" ) ) ) { return null ; } final com.android.internal.telephony.Phone phone = com.android.internal.telephony.PhoneFactory.getPhone ( 0 ) ; if ( phone != null ) { return phone.getDeviceId ( ) ; } else { return null ; } }
Source:
public org.objectweb.asm.MethodVisitor visitMethod ( int access , java.lang.String name , java.lang.String desc , java.lang.String signature , java.lang.String [ ] exceptions ) { return new org.objectweb.asm.MethodVisitor ( org.objectweb.asm.Opcodes.ASM4 ) { @ java.lang.Override public org.objectweb.asm.AnnotationVisitor visitAnnotationDefault ( ) { return av ; } @ java.lang.Override public org.objectweb.asm.AnnotationVisitor visitAnnotation ( java.lang.String desc , boolean visible ) { return av ; } @ java.lang.Override public org.objectweb.asm.AnnotationVisitor visitParameterAnnotation ( int parameter , java.lang.String desc , boolean visible ) { return av ; } } ; }

Target:
public org.objectweb.asm.AnnotationVisitor visitLocalVariableAnnotation ( int typeRef , org.objectweb.asm.TypePath typePath , org.objectweb.asm.Label [ ] start , org.objectweb.asm.Label [ ] end , int [ ] index , java.lang.String desc , boolean visible ) { return av ; }
Source:
public void scheduleDrawable ( android.graphics.drawable.Drawable who , java.lang.Runnable what , long when ) { if ( ( ( verifyDrawable ( who ) ) && ( what != null ) ) && ( ( mAttachInfo ) != null ) ) { mAttachInfo.mHandler.postAtTime ( what , who , when ) ; } }

Target:
public void unscheduleDrawable ( android.graphics.drawable.Drawable who , java.lang.Runnable what ) { if ( ( verifyDrawable ( who ) ) && ( what != null ) ) { if ( ( mAttachInfo ) != null ) { mAttachInfo.mHandler.removeCallbacks ( what , who ) ; } else { android.view.ViewRootImpl.getRunQueue ( ) . removeCallbacks ( what ) ; } } }
Source:
public void testWithId ( ) { android.view.View view = new android.view.View ( context ) ; view.setId ( R.id.testId1 ) ; assertTrue ( android.support.test.espresso.matcher.ViewMatchers.withId ( org.hamcrest.Matchers.is ( R.id.testId1 ) ) . matches ( view ) ) ; assertFalse ( android.support.test.espresso.matcher.ViewMatchers.withId ( org.hamcrest.Matchers.is ( R.id.testId2 ) ) . matches ( view ) ) ; assertFalse ( android.support.test.espresso.matcher.ViewMatchers.withId ( org.hamcrest.Matchers.is ( 1234 ) ) . matches ( view ) ) ; }

Target:
public void withIdTest ( ) { android.view.View view = new android.view.View ( context ) ; view.setId ( R.id.testId1 ) ; org.junit.Assert.assertTrue ( android.support.test.espresso.matcher.ViewMatchers.withId ( org.hamcrest.Matchers.is ( R.id.testId1 ) ) . matches ( view ) ) ; org.junit.Assert.assertFalse ( android.support.test.espresso.matcher.ViewMatchers.withId ( org.hamcrest.Matchers.is ( R.id.testId2 ) ) . matches ( view ) ) ; org.junit.Assert.assertFalse ( android.support.test.espresso.matcher.ViewMatchers.withId ( org.hamcrest.Matchers.is ( 1234 ) ) . matches ( view ) ) ; }
Source:
public void testPackageOverridePackageWithSuffixOnly ( ) { com.android.utils.StdLogger logger = new com.android.utils.StdLogger ( StdLogger.Level.ERROR ) ; com.android.builder.AndroidBuilder builder = new com.android.builder.AndroidBuilder ( new com.android.builder.DefaultSdkParser ( "" ) , new com.android.builder.AndroidBuilderTest.ManifestParserMock ( "fake.package.name" ) , new com.android.builder.CommandLineRunner ( logger ) , logger , false ) ; mDebug.setPackageNameSuffix ( "fortytwo" ) ; builder.setBuildVariant ( mMain , mFlavor , mDebug ) ; assertEquals ( "fake.package.name.fortytwo" , builder.getPackageOverride ( "" ) ) ; }

Target:
public void testPackageOverridePackageFromFlavorWithSuffix2 ( ) { com.android.builder.AndroidBuilder builder = new com.android.builder.AndroidBuilderTest.AndroidBuilderMock ( new com.android.builder.DefaultSdkParser ( "" ) , new com.android.utils.StdLogger ( StdLogger.Level.ERROR ) , false ) ; mFlavor.getProductFlavor ( ) . setPackageName ( "foo.bar" ) ; mDebug.getBuildType ( ) . setPackageNameSuffix ( "fortytwo" ) ; builder.setBuildVariant ( mMain , mDebug ) ; builder.addProductFlavor ( mFlavor ) ; assertEquals ( "foo.bar.fortytwo" , builder.getPackageOverride ( "" ) ) ; }
Source:
public void onSensorChanged ( android.hardware.SensorEvent sensorEvent ) { }

Target:
public void onSensorChanged ( android.hardware.SensorEvent event ) { long timestampNs = android.os.SystemClock.elapsedRealtimeNanos ( ) ; checkHandler ( ) ; synchronized ( mCollectedEvents ) { mCollectedEvents.add ( new android.hardware.cts.helpers.TestSensorEvent ( event , timestampNs ) ) ; } synchronized ( mEventLatches ) { for ( java.util.concurrent.CountDownLatch latch : mEventLatches ) { latch.countDown ( ) ; } } }
Source:
public com.android.emailcommon.mail.Message [ ] getMessages ( int start , int end , com.android.email.mail.store.MessageRetrievalListener listener ) throws com.android.emailcommon.mail.MessagingException { if ( ( ( start < 1 ) || ( end < 1 ) ) || ( end < start ) ) { throw new com.android.emailcommon.mail.MessagingException ( java.lang.String.format ( "Invalid range: %d %d" , start , end ) ) ; } return getMessagesInternal ( searchForUids ( java.lang.String.format ( "%d:%d NOT DELETED" , start , end ) ) , listener ) ; }

Target:
public com.android.emailcommon.mail.Message [ ] getMessages ( int start , int end , com.android.email.mail.store.MessageRetrievalListener listener ) throws com.android.emailcommon.mail.MessagingException { if ( ( ( start < 1 ) || ( end < 1 ) ) || ( end < start ) ) { throw new com.android.emailcommon.mail.MessagingException ( java.lang.String.format ( "Invalid range: %d %d" , start , end ) ) ; } return getMessagesInternal ( searchForUids ( java.lang.String.format ( java.util.Locale.US , "%d:%d NOT DELETED" , start , end ) ) , listener ) ; }
Source:
public void verifyCallbackContentBlocked ( ) { android.media.tv.cts.TvInputServiceTest.CountingTvInputService.CountingSession session = android.media.tv.cts.TvInputServiceTest.CountingTvInputService.sSession ; assertNotNull ( session ) ; android.media.tv.TvContentRating rating = android.media.tv.TvContentRating.createRating ( "android.media.tv" , "US_TVPG" , "US_TVPG_TV_MA" , "US_TVPG_S" , "US_TVPG_V" ) ; session.notifyContentBlocked ( rating ) ; new android.cts.util.PollingCheck ( android.media.tv.cts.TvInputServiceTest.TIME_OUT ) { @ java.lang.Override protected boolean check ( ) { return ( mCallback.mContentBlockedCount ) > 0 ; } } . run ( ) ; }

Target:
public void verifyCallbackContentBlocked ( ) { resetCounts ( ) ; android.media.tv.cts.TvInputServiceTest.CountingTvInputService.CountingSession session = android.media.tv.cts.TvInputServiceTest.CountingTvInputService.sSession ; assertNotNull ( session ) ; android.media.tv.TvContentRating rating = android.media.tv.TvContentRating.createRating ( "android.media.tv" , "US_TVPG" , "US_TVPG_TV_MA" , "US_TVPG_S" , "US_TVPG_V" ) ; session.notifyContentBlocked ( rating ) ; new android.cts.util.PollingCheck ( android.media.tv.cts.TvInputServiceTest.TIME_OUT ) { @ java.lang.Override protected boolean check ( ) { return ( mCallback.mContentBlockedCount ) > 0 ; } } . run ( ) ; }
Source:
private void volumeChangeRequestFromNative ( byte [ ] address , int volume , int ctype ) { android.os.Message msg = mHandler.obtainMessage ( com.android.bluetooth.avrcp.Avrcp.MSG_NATIVE_REQ_VOLUME_CHANGE , volume , ctype ) ; android.os.Bundle data = new android.os.Bundle ( ) ; data.putByteArray ( "BdAddress" , address ) ; msg.setData ( data ) ; mHandler.sendMessage ( msg ) ; }

Target:
private void volumeChangeRequestFromNative ( byte [ ] address , int volume , int ctype ) { final com.android.bluetooth.avrcp.Avrcp.AvrcpMessageHandler handler = mHandler ; if ( handler == null ) { if ( com.android.bluetooth.avrcp.Avrcp.DEBUG ) android.util.Log.d ( com.android.bluetooth.avrcp.Avrcp.TAG , "volumeChangeRequestFromNative: mHandler is already null" ) ; return ; } android.os.Message msg = handler.obtainMessage ( com.android.bluetooth.avrcp.Avrcp.MSG_NATIVE_REQ_VOLUME_CHANGE , volume , ctype ) ; android.os.Bundle data = new android.os.Bundle ( ) ; data.putByteArray ( "BdAddress" , address ) ; msg.setData ( data ) ; handler.sendMessage ( msg ) ; }
Source:
public void testJackArchiveToDexDir ( ) throws java.lang.Exception { java.io.File jackAr = createJackArchiveWithResources ( ) ; java.io.File dexDir = com.android.jack.TestTools.createTempDir ( "resourcetestdex" , "dir" ) ; com.android.jack.TestTools.compileJackToDex ( new com.android.jack.Options ( ) , jackAr , dexDir , false ) ; checkResourceContent ( dexDir , com.android.jack.ResourceTest.RESOURCE1_LONGPATH , "Res1" ) ; checkResourceContent ( dexDir , com.android.jack.ResourceTest.RESOURCE2_LONGPATH , "Res2" ) ; checkResourceContent ( dexDir , com.android.jack.ResourceTest.RESOURCE3_LONGPATH , "Res3" ) ; checkResourceContent ( dexDir , com.android.jack.ResourceTest.RESOURCE4_LONGPATH , "Res4" ) ; }

Target:
public void testJackArchiveToDexDir ( ) throws java.lang.Exception { java.io.File jackAr = createJackArchiveWithResources ( ) ; java.io.File dexDir = com.android.jack.TestTools.createTempDir ( "resourcetestdex" , "dir" ) ; com.android.jack.TestTools.compileJackToDex ( new com.android.jack.Options ( ) , jackAr , dexDir , false ) ; checkResourceContentFromDir ( dexDir , com.android.jack.ResourceTest.RESOURCE1_SHORTPATH , "Res1" , false ) ; checkResourceContentFromDir ( dexDir , com.android.jack.ResourceTest.RESOURCE2_SHORTPATH , "Res2" , false ) ; checkResourceContentFromDir ( dexDir , com.android.jack.ResourceTest.RESOURCE3_SHORTPATH , "Res3" , false ) ; checkResourceContentFromDir ( dexDir , com.android.jack.ResourceTest.RESOURCE4_SHORTPATH , "Res4" , false ) ; }
Source:
public com.intellij.xdebugger.impl.XBreakpoint < ? > getActiveNonLineBreakpoint ( ) { return myActiveNonLineBreakpoint ; }

Target:
public com.intellij.xdebugger.impl.XBreakpoint < ? > getActiveNonLineBreakpoint ( ) { if ( ( myActiveNonLineBreakpoint ) != null ) { com.intellij.xdebugger.impl.XSourcePosition breakpointPosition = myActiveNonLineBreakpoint.getSourcePosition ( ) ; com.intellij.xdebugger.impl.XSourcePosition position = getTopFramePosition ( ) ; if ( ( breakpointPosition == null ) || ( ( position != null ) && ( ! ( ( breakpointPosition.getFile ( ) . equals ( position.getFile ( ) ) ) && ( ( breakpointPosition.getLine ( ) ) == ( position.getLine ( ) ) ) ) ) ) ) { return myActiveNonLineBreakpoint ; } } return null ; }
Source:
private static java.util.List < com.android.jack.optimizations.DefUsesChainsSimplifier.OptInfo > collectCandidates ( @ javax.annotation.Nonnull java.util.Map < com.android.jack.ir.ast.JVariable , com.android.jack.optimizations.DefUsesChainsSimplifier.VarInfo > definitions ) { java.util.ArrayList < com.android.jack.optimizations.DefUsesChainsSimplifier.OptInfo > result = new java.util.ArrayList < > ( ) ; for ( java.util.Map.Entry < com.android.jack.ir.ast.JVariable , com.android.jack.optimizations.DefUsesChainsSimplifier.VarInfo > entry : definitions.entrySet ( ) ) { com.android.jack.optimizations.DefUsesChainsSimplifier.OptInfo info = com.android.jack.optimizations.DefUsesChainsSimplifier.considerCandidate ( entry.getKey ( ) , entry.getValue ( ) ) ; if ( info != null ) { result.add ( info ) ; } } return result ; }

Target:
private void processCandidatesWithDependencies ( @ javax.annotation.Nonnull com.android.jack.ir.ast.JMethod method , @ javax.annotation.Nonnull com.android.jack.cfg.ControlFlowGraph cfg , @ javax.annotation.Nonnull java.util.LinkedHashMap < com.android.jack.ir.ast.JVariable , com.android.jack.optimizations.DefUsesChainsSimplifier.OptInfo > candidates , @ javax.annotation.Nonnull java.util.LinkedHashMap < com.android.jack.ir.ast.JVariable , com.android.jack.optimizations.DefUsesChainsSimplifier.VarInfo > definitions ) { java.util.Set < com.android.jack.optimizations.DefUsesChainsSimplifier.OptInfo > queued = com.google.common.collect.Sets.newIdentityHashSet ( ) ; for ( java.util.Map.Entry < com.android.jack.ir.ast.JVariable , com.android.jack.optimizations.DefUsesChainsSimplifier.OptInfo > entry : candidates.entrySet ( ) ) { processCandidateWithDependencies ( method , cfg , entry.getValue ( ) , candidates , definitions , queued ) ; } }
Source:
public int compare ( org.w3c.dom.Attr attr1 , org.w3c.dom.Attr attr2 ) { if ( com.android.ide.eclipse.adt.internal.editors.descriptors.XmlnsAttributeDescriptor.XMLNS.equals ( attr1.getPrefix ( ) ) ) { if ( com.android.ide.eclipse.adt.internal.editors.descriptors.XmlnsAttributeDescriptor.XMLNS.equals ( attr2.getPrefix ( ) ) ) { return 0 ; } return - 1 ; } else if ( com.android.ide.eclipse.adt.internal.editors.descriptors.XmlnsAttributeDescriptor.XMLNS.equals ( attr2.getPrefix ( ) ) ) { return 1 ; } return com.android.ide.eclipse.adt.internal.editors.uimodel.UiAttributeNode.compareAttributes ( attr1.getPrefix ( ) , attr1.getLocalName ( ) , attr2.getPrefix ( ) , attr2.getLocalName ( ) ) ; }

Target:
public int compare ( org.w3c.dom.Attr attr1 , org.w3c.dom.Attr attr2 ) { if ( com.android.util.XmlUtils.XMLNS.equals ( attr1.getPrefix ( ) ) ) { if ( com.android.util.XmlUtils.XMLNS.equals ( attr2.getPrefix ( ) ) ) { return 0 ; } return - 1 ; } else if ( com.android.util.XmlUtils.XMLNS.equals ( attr2.getPrefix ( ) ) ) { return 1 ; } return com.android.ide.eclipse.adt.internal.editors.uimodel.UiAttributeNode.compareAttributes ( attr1.getPrefix ( ) , attr1.getLocalName ( ) , attr2.getPrefix ( ) , attr2.getLocalName ( ) ) ; }
Source:
private static int indexOf ( java.lang.Object o , java.lang.Object [ ] elements , int index , int fence ) { if ( o == null ) { for ( int i = index ; i < fence ; i ++ ) if ( ( elements [ i ] ) == null ) return i ; } else { for ( int i = index ; i < fence ; i ++ ) if ( o.equals ( elements [ i ] ) ) return i ; } return - 1 ; }

Target:
public boolean contains ( java.lang.Object o ) { return ( indexOf ( o ) ) != ( - 1 ) ; }
Source:
public void TestDump ( ) { android.icu.text.RuleBasedBreakIterator rbbi = new android.icu.text.RuleBasedBreakIterator ( "" ) ; try { rbbi.dump ( ) ; errln ( ( "RuleBasedBreakIterator.dump() was suppose to return " + "an exception for a blank RuleBasedBreakIterator object." ) ) ; } catch ( java.lang.Exception e ) { } }

Target:
public void TestFirst ( ) { android.icu.text.RuleBasedBreakIterator rbbi = new android.icu.text.RuleBasedBreakIterator ( ".;" ) ; rbbi.setText ( ( ( java.text.CharacterIterator ) ( null ) ) ) ; assertEquals ( "RuleBasedBreakIterator.first()" , BreakIterator.DONE , rbbi.first ( ) ) ; rbbi.setText ( "abc" ) ; assertEquals ( "RuleBasedBreakIterator.first()" , 0 , rbbi.first ( ) ) ; assertEquals ( "RuleBasedBreakIterator.next()" , 1 , rbbi.next ( ) ) ; }
Source:
protected int compareTo0 ( com.android.dx.rop.cst.Constant other ) { com.android.dx.rop.cst.CstMethodHandle otherHandle = ( ( com.android.dx.rop.cst.CstMethodHandle ) ( other ) ) ; if ( ( getKind ( ) ) == ( otherHandle.getKind ( ) ) ) { return getRef ( ) . compareTo ( otherHandle.getRef ( ) ) ; } else { return java.lang.Integer.compare ( getKind ( ) , otherHandle.getKind ( ) ) ; } }

Target:
public boolean isAccessor ( ) { return com.android.dx.rop.cst.CstMethodHandle.isAccessor ( type ) ; }
Source:
public void clear ( java.lang.String timezone ) { if ( timezone == null ) { throw new java.lang.NullPointerException ( "timezone is null!" ) ; } this . timezone = timezone ; this . allDay = false ; this . second = 0 ; this . minute = 0 ; this . hour = 0 ; this . monthDay = 0 ; this . month = 0 ; this . year = 0 ; this . weekDay = 0 ; this . yearDay = 0 ; this . gmtoff = 0 ; this . isDst = - 1 ; }

Target:
public void switchTimeZone ( java.lang.String timezone ) { int seconds = wallTime.mktime ( zoneInfo ) ; this . timezone = timezone ; updateZoneInfoFromTimeZone ( ) ; wallTime.localtime ( seconds , zoneInfo ) ; }
Source:
public void test_parkFor_3 ( ) { tests.api.org.apache.harmony.kernel.dalvik.ThreadsTest.Parker parker = new tests.api.org.apache.harmony.kernel.dalvik.ThreadsTest.Parker ( false , 1000 ) ; java.lang.Thread parkerThread = new java.lang.Thread ( parker ) ; tests.api.org.apache.harmony.kernel.dalvik.ThreadsTest.UNSAFE.unpark ( parkerThread ) ; parkerThread.start ( ) ; parker.assertDurationIsInRange ( 0 ) ; }

Target:
public void test_parkFor_3 ( ) { java.util.concurrent.CyclicBarrier barrier = new java.util.concurrent.CyclicBarrier ( 2 ) ; tests.api.org.apache.harmony.kernel.dalvik.ThreadsTest.Parker parker = new tests.api.org.apache.harmony.kernel.dalvik.ThreadsTest.Parker ( barrier , false , 1000 ) ; java.lang.Thread parkerThread = new java.lang.Thread ( parker ) ; tests.api.org.apache.harmony.kernel.dalvik.ThreadsTest.UNSAFE.unpark ( parkerThread ) ; parkerThread.start ( ) ; parker.assertDurationIsInRange ( 0 ) ; }
Source:
public void test_run_for_SimpleTest_should_perform_test ( ) { java.lang.Class < ? > target = vogar.target.junit3.SimpleTest.class ; vogar.target.Runner runner = new vogar.target.junit.JUnitRunner ( monitor , "" , null , target , skipPastReference , testEnvironment , 0 ) ; runner.run ( "" , null , null ) ; org.mockito.Mockito.verify ( monitor ) . outcomeStarted ( runner , ( ( target.getName ( ) ) + "#testSimple" ) , "" ) ; org.mockito.Mockito.verify ( monitor ) . outcomeFinished ( Result.SUCCESS ) ; }

Target:
public void test_run_for_SimpleTest_should_perform_test ( ) { java.lang.Class < ? > target = vogar.target.junit3.SimpleTest.class ; vogar.target.Runner runner = new vogar.target.junit.JUnitRunner ( monitor , null , target , skipPastReference , testEnvironment , 0 ) ; runner.run ( "" , null , null ) ; org.mockito.Mockito.verify ( monitor ) . outcomeStarted ( vogar.target.junit.JUnitRunner.class , ( ( target.getName ( ) ) + "#testSimple" ) ) ; org.mockito.Mockito.verify ( monitor ) . outcomeFinished ( Result.SUCCESS ) ; }
Source:
public void dispose ( ) throws android.telephony.mbms.MbmsException { if ( ( mService ) == null ) { throw new java.lang.IllegalStateException ( "No streaming service attached" ) ; } try { mService.disposeStream ( mSubscriptionId , mServiceInfo.getServiceId ( ) ) ; } catch ( android.os.RemoteException e ) { android.util.Log.w ( android.telephony.mbms.StreamingService.LOG_TAG , "Remote process died" ) ; throw new android.telephony.mbms.MbmsException ( MbmsException.ERROR_MIDDLEWARE_LOST ) ; } catch ( java.lang.IllegalArgumentException e ) { throw new java.lang.IllegalStateException ( "StreamingService state inconsistent with middleware" ) ; } finally { mService = null ; } }

Target:
private void sendErrorToApp ( int errorCode , java.lang.String message ) { try { mCallback.onError ( errorCode , message ) ; } catch ( android.os.RemoteException e ) { } }
Source:
public java.lang.String describeFirstNonRequestableCapability ( ) { if ( hasCapability ( android.net.NetworkCapabilities.NET_CAPABILITY_VALIDATED ) ) return "NET_CAPABILITY_VALIDATED" ; if ( hasCapability ( android.net.NetworkCapabilities.NET_CAPABILITY_CAPTIVE_PORTAL ) ) return "NET_CAPABILITY_CAPTIVE_PORTAL" ; if ( hasCapability ( android.net.NetworkCapabilities.NET_CAPABILITY_FOREGROUND ) ) return "NET_CAPABILITY_FOREGROUND" ; if ( ( ( mNetworkCapabilities ) & ( android.net.NetworkCapabilities.NON_REQUESTABLE_CAPABILITIES ) ) != 0 ) { return "unknown non-requestable capabilities " + ( java.lang.Long.toHexString ( mNetworkCapabilities ) ) ; } if ( ( ( mLinkUpBandwidthKbps ) != 0 ) || ( ( mLinkDownBandwidthKbps ) != 0 ) ) return "link bandwidth" ; if ( hasSignalStrength ( ) ) return "signalStrength" ; return null ; }

Target:
public boolean appliesToUid ( int uid ) { if ( null == ( mUids ) ) return true ; for ( android.net.UidRange range : mUids ) { if ( range.contains ( uid ) ) { return true ; } } return false ; }