auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public byte [ ] encode ( boolean includeThreadId , java.lang.String version ) throws java.io.UnsupportedEncodingException { java.io.StringWriter sw = new java.io.StringWriter ( ) ; org.xmlpull.v1.XmlSerializer xmlMsgElement = new com.android.internal.util.FastXmlSerializer ( ) ; try { xmlMsgElement.setOutput ( sw ) ; xmlMsgElement.startDocument ( "UTF-8" , true ) ; xmlMsgElement.setFeature ( "http://xmlpull.org/v1/doc/features.html#indent-output" , true ) ; xmlMsgElement.startTag ( null , "MAP-msg-listing" ) ; xmlMsgElement.attribute ( null , "version" , version ) ; for ( com.android.bluetooth.map.BluetoothMapMessageListingElement element : mList ) { element.encode ( xmlMsgElement , includeThreadId ) ; } xmlMsgElement.endTag ( null , "MAP-msg-listing" ) ; xmlMsgElement.endDocument ( ) ; } catch ( java.lang.IllegalArgumentException e ) { android.util.Log.w ( com.android.bluetooth.map.BluetoothMapMessageListing.TAG , e ) ; } catch ( java.lang.IllegalStateException e ) { android.util.Log.w ( com.android.bluetooth.map.BluetoothMapMessageListing.TAG , e ) ; } catch ( java.io.IOException e ) { android.util.Log.w ( com.android.bluetooth.map.BluetoothMapMessageListing.TAG , e ) ; } return sw.toString ( ) . getBytes ( "UTF-8" ) ; }

Target:
public byte [ ] encode ( boolean includeThreadId , java.lang.String version ) throws java.io.UnsupportedEncodingException { java.io.StringWriter sw = new java.io.StringWriter ( ) ; org.xmlpull.v1.XmlSerializer xmlMsgElement = new com.android.internal.util.FastXmlSerializer ( ) ; try { xmlMsgElement.setOutput ( sw ) ; xmlMsgElement.startDocument ( "UTF-8" , true ) ; xmlMsgElement.setFeature ( "http://xmlpull.org/v1/doc/features.html#indent-output" , true ) ; xmlMsgElement.startTag ( null , "MAP-msg-listing" ) ; xmlMsgElement.attribute ( null , "version" , version ) ; for ( com.android.bluetooth.map.BluetoothMapMessageListingElement element : mList ) { element.encode ( xmlMsgElement , includeThreadId ) ; } xmlMsgElement.endTag ( null , "MAP-msg-listing" ) ; xmlMsgElement.endDocument ( ) ; } catch ( java.lang.IllegalArgumentException e ) { android.util.Log.w ( com.android.bluetooth.map.BluetoothMapMessageListing.TAG , e ) ; } catch ( java.lang.IllegalStateException e ) { android.util.Log.w ( com.android.bluetooth.map.BluetoothMapMessageListing.TAG , e ) ; } catch ( java.io.IOException e ) { android.util.Log.w ( com.android.bluetooth.map.BluetoothMapMessageListing.TAG , e ) ; } if ( com.android.bluetooth.DeviceWorkArounds.addressStartsWith ( com.android.bluetooth.map.BluetoothMapService.getRemoteDevice ( ) . getAddress ( ) , DeviceWorkArounds.BREZZA_ZDI_CARKIT ) ) { return sw.toString ( ) . replaceAll ( "&amp;" , "&" ) . replaceAll ( "&lt;" , "<" ) . replaceAll ( "&gt;" , ">" ) . getBytes ( "UTF-8" ) ; } return sw.toString ( ) . getBytes ( "UTF-8" ) ; }
Source:
private void sendFailureReport ( android.os.Message result , com.android.ims.ImsReasonInfo error ) { if ( ( result == null ) || ( error == null ) ) { return ; } java.lang.String errorString ; if ( ( error.mExtraMessage ) == null ) { errorString = new java.lang.String ( "IMS UT exception" ) ; } else { errorString = new java.lang.String ( error.mExtraMessage ) ; } android.os.AsyncResult.forMessage ( result , null , new com.android.ims.ImsException ( errorString , error.mCode ) ) ; result.sendToTarget ( ) ; }

Target:
private void sendFailureReport ( android.os.Message result , com.android.ims.ImsReasonInfo error ) { if ( ( result == null ) || ( error == null ) ) { return ; } java.lang.String errorString ; if ( ( error.mExtraMessage ) == null ) { errorString = android.content.res.Resources.getSystem ( ) . getString ( com.android.internal.R.string.mmiError ) ; } else { errorString = new java.lang.String ( error.mExtraMessage ) ; } android.os.AsyncResult.forMessage ( result , null , new com.android.ims.ImsException ( errorString , error.mCode ) ) ; result.sendToTarget ( ) ; }
Source:
public void testRegistered ( ) throws java.lang.Exception { assertEquals ( ( "OnClickActivity.java:8: Warning: The <activity> test.pkg.OnClickActivity is not registered in the manifest\n" + ( ( "TestProvider.java:8: Warning: The <provider> test.pkg.TestProvider is not registered in the manifest\n" + "TestProvider2.java:3: Warning: The <provider> test.pkg.TestProvider2 is not registered in the manifest\n" ) + "TestService.java:7: Warning: The <service> test.pkg.TestService is not registered in the manifest" ) ) , lintProject ( "bytecode/.classpath=>.classpath" , "bytecode/OnClickActivity.java.txt=>src/test/pkg/OnClickActivity.java" , "bytecode/OnClickActivity.class.data=>bin/classes/test/pkg/OnClickActivity.class" , "bytecode/TestService.java.txt=>src/test/pkg/TestService.java" , "bytecode/TestService.class.data=>bin/classes/test/pkg/TestService.class" , "bytecode/TestProvider.java.txt=>src/test/pkg/TestProvider.java" , "bytecode/TestProvider.class.data=>bin/classes/test/pkg/TestProvider.class" , "bytecode/TestProvider2.java.txt=>src/test/pkg/TestProvider2.java" , "bytecode/TestProvider2.class.data=>bin/classes/test/pkg/TestProvider2.class" , "bytecode/TestReceiver.java.txt=>src/test/pkg/TestReceiver.java" , "bytecode/TestReceiver.class.data=>bin/classes/test/pkg/TestReceiver.class" ) ) ; }

Target:
public void testRegistered ( ) throws java.lang.Exception { assertEquals ( ( "src/test/pkg/OnClickActivity.java:8: Warning: The <activity> test.pkg.OnClickActivity is not registered in the manifest [Registered]\n" + ( ( ( ( ( ( ( ( ( ( ( ( "public class OnClickActivity extends Activity {\n" + " ~~~~~~~~~~~~~~~\n" ) + "src/test/pkg/TestProvider.java:8: Warning: The <provider> test.pkg.TestProvider is not registered in the manifest [Registered]\n" ) + "public class TestProvider extends ContentProvider {\n" ) + " ~~~~~~~~~~~~\n" ) + "src/test/pkg/TestProvider2.java:3: Warning: The <provider> test.pkg.TestProvider2 is not registered in the manifest [Registered]\n" ) + "public class TestProvider2 extends TestProvider {\n" ) + "^\n" ) + "src/test/pkg/TestService.java:7: Warning: The <service> test.pkg.TestService is not registered in the manifest [Registered]\n" ) + "public class TestService extends Service {\n" ) + " ~~~~~~~~~~~\n" ) + "0 errors, 4 warnings\n" ) + "" ) ) , lintProject ( "bytecode/.classpath=>.classpath" , "bytecode/OnClickActivity.java.txt=>src/test/pkg/OnClickActivity.java" , "bytecode/OnClickActivity.class.data=>bin/classes/test/pkg/OnClickActivity.class" , "bytecode/TestService.java.txt=>src/test/pkg/TestService.java" , "bytecode/TestService.class.data=>bin/classes/test/pkg/TestService.class" , "bytecode/TestProvider.java.txt=>src/test/pkg/TestProvider.java" , "bytecode/TestProvider.class.data=>bin/classes/test/pkg/TestProvider.class" , "bytecode/TestProvider2.java.txt=>src/test/pkg/TestProvider2.java" , "bytecode/TestProvider2.class.data=>bin/classes/test/pkg/TestProvider2.class" , "bytecode/TestReceiver.java.txt=>src/test/pkg/TestReceiver.java" , "bytecode/TestReceiver.class.data=>bin/classes/test/pkg/TestReceiver.class" ) ) ; }
Source:
android.net.NetworkCapabilities expectCapabilitiesWithout ( int capability , com.android.server.ConnectivityServiceTest.MockNetworkAgent agent ) { com.android.server.ConnectivityServiceTest.CallbackInfo cbi = expectCallback ( com.android.server.ConnectivityServiceTest.CallbackState.NETWORK_CAPABILITIES , agent ) ; android.net.NetworkCapabilities nc = ( ( android.net.NetworkCapabilities ) ( cbi.arg ) ) ; org.junit.Assert.assertFalse ( nc.hasCapability ( capability ) ) ; return nc ; }

Target:
android.net.NetworkCapabilities expectCapabilitiesWithout ( int capability , com.android.server.ConnectivityServiceTest.MockNetworkAgent agent , int timeoutMs ) { com.android.server.ConnectivityServiceTest.CallbackInfo cbi = expectCallback ( com.android.server.ConnectivityServiceTest.CallbackState.NETWORK_CAPABILITIES , agent , timeoutMs ) ; android.net.NetworkCapabilities nc = ( ( android.net.NetworkCapabilities ) ( cbi.arg ) ) ; org.junit.Assert.assertFalse ( nc.hasCapability ( capability ) ) ; return nc ; }
Source:
public boolean checkForCondition ( ) { android.support.test.uiautomator.UiObject skipButton = mDevice.findObject ( new android.support.test.uiautomator.UiSelector ( ) . resourceId ( Res.GOOGLE_NOW_WELCOME_SKIP_RES ) ) ; try { if ( skipButton.exists ( ) ) { skipButton.clickAndWaitForNewWindow ( ) ; return true ; } else { return false ; } } catch ( java.lang.Exception e ) { org.junit.Assert.fail ( e.getStackTrace ( ) . toString ( ) ) ; return false ; } }

Target:
public boolean checkForCondition ( ) { android.support.test.uiautomator.UiObject skipButton = mDevice.findObject ( new android.support.test.uiautomator.UiSelector ( ) . resourceIdMatches ( Res.GOOGLE_NOW_WELCOME_SKIP_RES ) ) ; try { if ( skipButton.exists ( ) ) { skipButton.clickAndWaitForNewWindow ( ) ; return true ; } else { return false ; } } catch ( java.lang.Exception e ) { org.junit.Assert.fail ( e.getStackTrace ( ) . toString ( ) ) ; return false ; } }
Source:
private boolean updateDisplayModeAction ( ) { com.android.tv.ui.TvViewUiManager uiManager = getMainActivity ( ) . getTvViewUiManager ( ) ; boolean oldEnabled = MenuAction.SELECT_DISPLAY_MODE_ACTION.isEnabled ( ) ; boolean newEnabled = ( uiManager.isDisplayModeAvailable ( DisplayMode.MODE_FULL ) ) || ( uiManager.isDisplayModeAvailable ( DisplayMode.MODE_ZOOM ) ) ; if ( oldEnabled != newEnabled ) { MenuAction.SELECT_DISPLAY_MODE_ACTION.setEnabled ( newEnabled ) ; return true ; } return false ; }

Target:
private boolean updateDisplayModeAction ( ) { com.android.tv.ui.TvViewUiManager uiManager = getMainActivity ( ) . getTvViewUiManager ( ) ; boolean enabled = ( uiManager.isDisplayModeAvailable ( DisplayMode.MODE_FULL ) ) || ( uiManager.isDisplayModeAvailable ( DisplayMode.MODE_ZOOM ) ) ; return ( com.android.tv.menu.MenuAction.setEnabled ( MenuAction.SELECT_DISPLAY_MODE_ACTION , enabled ) ) | ( updateActionDescription ( MenuAction.SELECT_DISPLAY_MODE_ACTION ) ) ; }
Source:
protected void onRecordLoaded ( ) { recordsToLoad -= 1 ; if ( com.android.internal.telephony.uicc.SIMRecords.DBG ) log ( ( ( ( "onRecordLoaded " + ( recordsToLoad ) ) + " requested: " ) + ( recordsRequested ) ) ) ; if ( ( ( recordsToLoad ) == 0 ) && ( ( recordsRequested ) == true ) ) { onAllRecordsLoaded ( ) ; } else if ( ( recordsToLoad ) < 0 ) { loge ( "recordsToLoad <0, programmer error suspected" ) ; recordsToLoad = 0 ; } }

Target:
protected void onRecordLoaded ( ) { mRecordsToLoad -= 1 ; if ( DBG ) log ( ( ( ( "onRecordLoaded " + ( mRecordsToLoad ) ) + " requested: " ) + ( mRecordsRequested ) ) ) ; if ( ( ( mRecordsToLoad ) == 0 ) && ( ( mRecordsRequested ) == true ) ) { onAllRecordsLoaded ( ) ; } else if ( ( mRecordsToLoad ) < 0 ) { loge ( "recordsToLoad <0, programmer error suspected" ) ; mRecordsToLoad = 0 ; } }
Source:
java.util.logging.Logger demandLogger ( java.lang.String name , java.lang.String resourceBundleName ) { java.util.logging.Logger result = findLogger ( name ) ; if ( result == null ) { java.util.logging.Logger newLogger = new java.util.logging.Logger ( name , resourceBundleName ) ; do { if ( addLocalLogger ( newLogger ) ) { result = newLogger ; } else { result = findLogger ( name ) ; } } while ( result == null ) ; } return result ; }

Target:
java.util.logging.Logger demandLogger ( java.lang.String name , java.lang.String resourceBundleName ) { java.util.logging.Logger result = findLogger ( name ) ; if ( result == null ) { java.util.logging.Logger newLogger = new java.util.logging.Logger ( name , resourceBundleName , null , getOwner ( ) , true ) ; do { if ( addLocalLogger ( newLogger ) ) { result = newLogger ; } else { result = findLogger ( name ) ; } } while ( result == null ) ; } return result ; }
Source:
public boolean processBytes ( byte [ ] buf , int off , int len ) { checksum.update ( buf , off , len ) ; return true ; }

Target:
public int read ( byte [ ] b , int off , int len ) throws java.io.IOException { if ( ( left ) == 0 ) { return - 1 ; } len = ( ( int ) ( java.lang.Math.min ( len , left ) ) ) ; int result = in.read ( b , off , len ) ; if ( result != ( - 1 ) ) { left -= result ; } return result ; }
Source:
public java.lang.String toString ( ) { if ( ( buffer ) == null ) { return ( ( ( ( shortyIndex ) + " " ) + ( returnTypeIndex ) ) + " " ) + ( parametersOffset ) ; } return ( ( ( ( buffer.strings ( ) . get ( shortyIndex ) ) + ": " ) + ( buffer.typeNames ( ) . get ( returnTypeIndex ) ) ) + " " ) + ( buffer.readTypeList ( parametersOffset ) ) ; }

Target:
public java.lang.String toString ( ) { if ( ( dex ) == null ) { return ( ( ( ( shortyIndex ) + " " ) + ( returnTypeIndex ) ) + " " ) + ( parametersOffset ) ; } return ( ( ( ( dex.strings ( ) . get ( shortyIndex ) ) + ": " ) + ( dex.typeNames ( ) . get ( returnTypeIndex ) ) ) + " " ) + ( dex.readTypeList ( parametersOffset ) ) ; }
Source:
public void tearDown ( com.android.tradefed.device.ITestDevice device , com.android.tradefed.build.IBuildInfo buildInfo , java.lang.Throwable e ) throws com.android.tradefed.device.DeviceNotAvailableException { if ( ( mDeviceInfoPath ) != null ) { com.android.tradefed.util.FileUtil.recursiveDelete ( mDeviceInfoPath ) ; device.executeShellCommand ( ( "rm -r " + ( com.android.tradefed.targetprep.VtsCoveragePreparer.COVERAGE_CONFIGURE_DST ) ) ) ; } }

Target:
public void tearDown ( com.android.tradefed.device.ITestDevice device , com.android.tradefed.build.IBuildInfo buildInfo , java.lang.Throwable e ) throws com.android.tradefed.device.DeviceNotAvailableException { device.executeShellCommand ( "setenforce 1" ) ; if ( ( mDeviceInfoPath ) != null ) { com.android.tradefed.util.FileUtil.recursiveDelete ( mDeviceInfoPath ) ; device.executeShellCommand ( ( "rm -r " + ( com.android.tradefed.targetprep.VtsCoveragePreparer.COVERAGE_CONFIGURE_DST ) ) ) ; } }
Source:
public void testLockAndUnlock ( ) throws java.lang.Exception { if ( ! ( isHandheld ( ) ) ) { return ; } gotoKeyguard ( ) ; mAmWmState.waitForKeyguardShowingAndNotOccluded ( mDevice ) ; assertShowingAndNotOccluded ( ) ; unlockDeviceWithCredential ( ) ; mAmWmState.waitForKeyguardGone ( mDevice ) ; assertKeyguardGone ( ) ; }

Target:
public void testLockAndUnlock ( ) throws java.lang.Exception { if ( ! ( supportsKeyguard ( ) ) ) { return ; } gotoKeyguard ( ) ; mAmWmState.waitForKeyguardShowingAndNotOccluded ( mDevice ) ; assertShowingAndNotOccluded ( ) ; unlockDeviceWithCredential ( ) ; mAmWmState.waitForKeyguardGone ( mDevice ) ; assertKeyguardGone ( ) ; }
Source:
private void createContextMenu ( ) { mMenuManager = new org.eclipse.jface.action.MenuManager ( ) { @ java.lang.Override public boolean isDynamic ( ) { return true ; } } ; setupStaticMenuActions ( mMenuManager ) ; new com.android.ide.eclipse.adt.internal.editors.layout.gle2.DynamicContextMenu ( mLayoutEditor , this , mMenuManager ) ; org.eclipse.swt.widgets.Menu menu = mMenuManager.createContextMenu ( this ) ; setMenu ( menu ) ; }

Target:
private void createContextMenu ( ) { mMenuManager = new org.eclipse.jface.action.MenuManager ( ) { @ java.lang.Override public boolean isDynamic ( ) { return true ; } } ; setupStaticMenuActions ( mMenuManager ) ; new com.android.ide.eclipse.adt.internal.editors.layout.gle2.DynamicContextMenu ( mLayoutEditor , this , mMenuManager ) ; org.eclipse.swt.widgets.Menu menu = mMenuManager.createContextMenu ( this ) ; setMenu ( menu ) ; addMenuDetectListener ( new org.eclipse.swt.events.MenuDetectListener ( ) { public void menuDetected ( org.eclipse.swt.events.MenuDetectEvent e ) { mSelectionManager.menuClick ( e ) ; } } ) ; }
Source:
com.android.ide.eclipse.adt.editors.layout.gscripts.Point displayToCanvasPoint ( int displayX , int displayY ) { com.android.ide.eclipse.adt.editors.layout.gscripts.Point p = this . toControl ( displayX , displayY ) ; int x = mHScale.inverseTranslate ( p.x ) ; int y = mVScale.inverseTranslate ( p.y ) ; return new com.android.ide.eclipse.adt.editors.layout.gscripts.Point ( x , y ) ; }

Target:
com.android.ide.common.api.Point displayToCanvasPoint ( int displayX , int displayY ) { com.android.ide.common.api.Point p = this . toControl ( displayX , displayY ) ; int x = mHScale.inverseTranslate ( p.x ) ; int y = mVScale.inverseTranslate ( p.y ) ; return new com.android.ide.common.api.Point ( x , y ) ; }
Source:
public java.lang.String insnArgString ( com.android.jack.dx.dex.code.DalvInsn insn ) { com.android.jack.dx.rop.code.RegisterSpecList regs = insn.getRegisters ( ) ; return ( ( ( ( regs.get ( 0 ) . regString ( ) ) + ", " ) + ( regs.get ( 1 ) . regString ( ) ) ) + ", " ) + ( cstString ( insn ) ) ; }

Target:
public java.lang.String insnArgString ( com.android.jack.dx.dex.code.DalvInsn insn ) { com.android.jack.dx.rop.code.RegisterSpecList regs = insn.getRegisters ( ) ; return ( ( ( ( regs.get ( 0 ) . regString ( ) ) + ", " ) + ( regs.get ( 1 ) . regString ( ) ) ) + ", " ) + ( cstString ( ( ( com.android.jack.dx.dex.code.CstInsn ) ( insn ) ) ) ) ; }
Source:
private static void testUnloadClass ( java.lang.reflect.Constructor constructor ) throws java.lang.Exception { java.lang.ref.WeakReference < java.lang.Class > klass = Main.setUpUnloadClass ( constructor ) ; java.lang.Runtime.getRuntime ( ) . gc ( ) ; java.lang.ref.WeakReference < java.lang.Class > klass2 = Main.setUpUnloadClass ( constructor ) ; java.lang.Runtime.getRuntime ( ) . gc ( ) ; java.lang.System.out.println ( klass.get ( ) ) ; java.lang.System.out.println ( klass2.get ( ) ) ; }

Target:
private static void testUnloadClass ( java.lang.reflect.Constructor constructor ) throws java.lang.Exception { java.lang.ref.WeakReference < java.lang.Class > klass = Main.setUpUnloadClassWeak ( constructor ) ; java.lang.Runtime.getRuntime ( ) . gc ( ) ; java.lang.ref.WeakReference < java.lang.Class > klass2 = Main.setUpUnloadClassWeak ( constructor ) ; java.lang.Runtime.getRuntime ( ) . gc ( ) ; java.lang.System.out.println ( klass.get ( ) ) ; java.lang.System.out.println ( klass2.get ( ) ) ; }
Source:
public void applySettings ( ) { java.util.Properties props = java.lang.System.getProperties ( ) ; java.lang.String proxyHost = mProperties.getProperty ( ISettingsPage.KEY_HTTP_PROXY_HOST , "" ) ; java.lang.String proxyPort = mProperties.getProperty ( ISettingsPage.KEY_HTTP_PROXY_PORT , "" ) ; props.setProperty ( ISettingsPage.KEY_HTTP_PROXY_HOST , proxyHost ) ; props.setProperty ( ISettingsPage.KEY_HTTP_PROXY_PORT , proxyPort ) ; props.setProperty ( "https.proxyHost" , proxyHost ) ; props.setProperty ( "https.proxyPort" , proxyPort ) ; }

Target:
public void applySettings ( ) { java.util.Properties props = java.lang.System.getProperties ( ) ; java.lang.String proxyHost = mProperties.getProperty ( ISettingsPage.KEY_HTTP_PROXY_HOST , "" ) ; java.lang.String proxyPort = mProperties.getProperty ( ISettingsPage.KEY_HTTP_PROXY_PORT , "" ) ; final java.lang.String JAVA_PROP_HTTP_PROXY_HOST = "http.proxyHost" ; final java.lang.String JAVA_PROP_HTTP_PROXY_PORT = "http.proxyPort" ; final java.lang.String JAVA_PROP_HTTPS_PROXY_HOST = "https.proxyHost" ; final java.lang.String JAVA_PROP_HTTPS_PROXY_PORT = "https.proxyPort" ; props.setProperty ( JAVA_PROP_HTTP_PROXY_HOST , proxyHost ) ; props.setProperty ( JAVA_PROP_HTTP_PROXY_PORT , proxyPort ) ; props.setProperty ( JAVA_PROP_HTTPS_PROXY_HOST , proxyHost ) ; props.setProperty ( JAVA_PROP_HTTPS_PROXY_PORT , proxyPort ) ; }
Source:
void setConferenceableConnections ( java.lang.String callId , java.util.List < java.lang.String > conferenceableCallIds ) { android.telecom.Log.v ( this , "setConferenceableConnections: %s, %s" , callId , conferenceableCallIds ) ; for ( com.android.internal.telecom.IConnectionServiceAdapter adapter : mAdapters ) { try { adapter.setConferenceableConnections ( callId , conferenceableCallIds ) ; } catch ( android.os.RemoteException ignored ) { } } }

Target:
void setVideoState ( java.lang.String callId , int videoState ) { android.telecom.Log.v ( this , "setVideoState: %d" , videoState ) ; for ( com.android.internal.telecom.IConnectionServiceAdapter adapter : mAdapters ) { try { adapter.setVideoState ( callId , videoState , android.telecom.Log.getExternalSession ( ) ) ; } catch ( android.os.RemoteException ignored ) { } } }
Source:
public boolean enablePhoneAccount ( android.telecom.PhoneAccountHandle accountHandle , boolean isEnabled ) { try { com.android.server.telecom.Log.startSession ( "TSI.ePA" ) ; enforceModifyPermission ( ) ; synchronized ( mLock ) { long token = android.os.Binder.clearCallingIdentity ( ) ; try { return mPhoneAccountRegistrar.enablePhoneAccount ( accountHandle , isEnabled ) ; } finally { android.os.Binder.restoreCallingIdentity ( token ) ; } } } finally { com.android.server.telecom.Log.endSession ( ) ; } }

Target:
public boolean enablePhoneAccount ( android.telecom.PhoneAccountHandle accountHandle , boolean isEnabled ) { try { android.telecom.Log.startSession ( "TSI.ePA" ) ; enforceModifyPermission ( ) ; synchronized ( mLock ) { long token = android.os.Binder.clearCallingIdentity ( ) ; try { return mPhoneAccountRegistrar.enablePhoneAccount ( accountHandle , isEnabled ) ; } finally { android.os.Binder.restoreCallingIdentity ( token ) ; } } } finally { android.telecom.Log.endSession ( ) ; } }
Source:
public void onImageLoaded ( int token , android.graphics.drawable.Drawable photo , android.graphics.Bitmap photoIcon , java.lang.Object cookie ) { com.android.dialer.common.Assert.isWorkerThread ( ) ; com.android.incallui.ContactInfoCache.CallerInfoQueryToken myCookie = ( ( com.android.incallui.ContactInfoCache.CallerInfoQueryToken ) ( cookie ) ) ; final java.lang.String callId = myCookie.mCallId ; final int queryId = myCookie.mQueryId ; if ( ! ( isWaitingForThisQuery ( callId , queryId ) ) ) { return ; } loadImage ( photo , photoIcon , cookie ) ; }

Target:
public void onImageLoaded ( int token , android.graphics.drawable.Drawable photo , android.graphics.Bitmap photoIcon , java.lang.Object cookie ) { com.android.dialer.common.Assert.isWorkerThread ( ) ; com.android.incallui.ContactInfoCache.CallerInfoQueryToken myCookie = ( ( com.android.incallui.ContactInfoCache.CallerInfoQueryToken ) ( cookie ) ) ; final java.lang.String callId = myCookie.callId ; final int queryId = myCookie.queryId ; if ( ! ( isWaitingForThisQuery ( callId , queryId ) ) ) { return ; } loadImage ( photo , photoIcon , cookie ) ; }
Source:
public static int compare ( android.text.format.Time a , android.text.format.Time b ) { if ( a == null ) { throw new java.lang.NullPointerException ( "a == null" ) ; } else if ( b == null ) { throw new java.lang.NullPointerException ( "b == null" ) ; } return android.text.format.Time.nativeCompare ( a , b ) ; }

Target:
public static int compare ( android.text.format.Time a , android.text.format.Time b ) { if ( a == null ) { throw new java.lang.NullPointerException ( "a == null" ) ; } else if ( b == null ) { throw new java.lang.NullPointerException ( "b == null" ) ; } a.calculator.copyFieldsFromTime ( a ) ; b.calculator.copyFieldsFromTime ( b ) ; return android.text.format.Time.TimeCalculator.compare ( a.calculator , b.calculator ) ; }
Source:
public void testGetActivities ( ) { assertEquals ( 1 , mManifestTestApp.getActivities ( ) . length ) ; com.android.sdklib.xml.AndroidManifestParser.Activity activity = mManifestTestApp.getActivities ( ) [ 0 ] ; assertEquals ( com.android.ide.eclipse.adt.internal.project.AndroidManifestParserTest.ACTIVITY_NAME , activity.getName ( ) ) ; assertTrue ( activity.hasAction ( ) ) ; assertTrue ( activity.isHomeActivity ( ) ) ; assertTrue ( activity.hasAction ( ) ) ; assertEquals ( activity , mManifestTestApp.getActivities ( ) [ 0 ] ) ; }

Target:
public void testGetActivities ( ) { assertEquals ( 1 , mManifestTestApp.getActivities ( ) . length ) ; com.android.sdklib.xml.ManifestData.Activity activity = mManifestTestApp.getActivities ( ) [ 0 ] ; assertEquals ( com.android.ide.eclipse.adt.internal.project.AndroidManifestParserTest.ACTIVITY_NAME , activity.getName ( ) ) ; assertTrue ( activity.hasAction ( ) ) ; assertTrue ( activity.isHomeActivity ( ) ) ; assertTrue ( activity.hasAction ( ) ) ; assertEquals ( activity , mManifestTestApp.getActivities ( ) [ 0 ] ) ; }
Source:
public org.objectweb.asm.MethodVisitor visitMethod ( final int access , final java.lang.String name , final java.lang.String desc , final java.lang.String signature , final java.lang.String [ ] exceptions ) { if ( name.equals ( "m" ) ) { return new org.objectweb.asm.MethodVisitor ( Opcodes.ASM4 ) { @ java.lang.Override public void visitMaxs ( final int realMaxStack , final int realMaxLocals ) { assertEquals ( "maxStack" , maxStack , realMaxStack ) ; assertEquals ( "maxLocals" , maxLocals , realMaxLocals ) ; } } ; } else { return null ; } }

Target:
public org.objectweb.asm.MethodVisitor visitMethod ( final int access , final java.lang.String name , final java.lang.String desc , final java.lang.String signature , final java.lang.String [ ] exceptions ) { if ( name.equals ( "m" ) ) { return new org.objectweb.asm.MethodVisitor ( Opcodes.ASM5 ) { @ java.lang.Override public void visitMaxs ( final int realMaxStack , final int realMaxLocals ) { assertEquals ( "maxStack" , maxStack , realMaxStack ) ; assertEquals ( "maxLocals" , maxLocals , realMaxLocals ) ; } } ; } else { return null ; } }
Source:
boolean terminateCall ( android.bluetooth.BluetoothDevice device , int index ) { enforceCallingOrSelfPermission ( com.android.bluetooth.hfpclient.BLUETOOTH_PERM , "Need BLUETOOTH permission" ) ; int connectionState = mStateMachine.getConnectionState ( device ) ; if ( ( connectionState != ( android.bluetooth.BluetoothProfile.STATE_CONNECTED ) ) && ( connectionState != ( android.bluetooth.BluetoothProfile.STATE_CONNECTING ) ) ) { return false ; } android.os.Message msg = mStateMachine.obtainMessage ( HeadsetClientStateMachine.TERMINATE_CALL ) ; msg.arg1 = index ; mStateMachine.sendMessage ( msg ) ; return true ; }

Target:
boolean terminateCall ( android.bluetooth.BluetoothDevice device , java.util.UUID uuid ) { enforceCallingOrSelfPermission ( com.android.bluetooth.hfpclient.BLUETOOTH_PERM , "Need BLUETOOTH permission" ) ; int connectionState = mStateMachine.getConnectionState ( device ) ; if ( ( connectionState != ( android.bluetooth.BluetoothProfile.STATE_CONNECTED ) ) && ( connectionState != ( android.bluetooth.BluetoothProfile.STATE_CONNECTING ) ) ) { return false ; } android.os.Message msg = mStateMachine.obtainMessage ( HeadsetClientStateMachine.TERMINATE_CALL ) ; msg.obj = uuid ; mStateMachine.sendMessage ( msg ) ; return true ; }
Source:
public void onSurfaceDestroyed ( com.android.incallui.videosurface.protocol.VideoSurfaceTexture videoCallSurface ) { if ( ( mVideoCall ) == null ) { com.android.dialer.common.LogUtil.e ( "VideoCallPresenter.LocalDelegate.onSurfaceDestroyed" , "no video call" ) ; return ; } boolean isChangingConfigurations = com.android.incallui.InCallPresenter.getInstance ( ) . isChangingConfigurations ( ) ; if ( ! isChangingConfigurations ) { enableCamera ( mVideoCall , false ) ; } else { com.android.dialer.common.LogUtil.i ( "VideoCallPresenter.LocalDelegate.onSurfaceDestroyed" , "activity is being destroyed due to configuration changes. Not closing the camera." ) ; } }

Target:
public void onSurfaceDestroyed ( com.android.incallui.videosurface.protocol.VideoSurfaceTexture videoCallSurface ) { if ( ( mVideoCall ) == null ) { com.android.dialer.common.LogUtil.e ( "VideoCallPresenter.LocalDelegate.onSurfaceDestroyed" , "no video call" ) ; return ; } boolean isChangingConfigurations = com.android.incallui.InCallPresenter.getInstance ( ) . isChangingConfigurations ( ) ; if ( ! isChangingConfigurations ) { enableCamera ( mPrimaryCall , false ) ; } else { com.android.dialer.common.LogUtil.i ( "VideoCallPresenter.LocalDelegate.onSurfaceDestroyed" , "activity is being destroyed due to configuration changes. Not closing the camera." ) ; } }
Source:
public void addReference ( @ com.android.annotations.NonNull com.android.tools.perflib.heap.Instance reference ) { if ( reference.getIsSoftReference ( ) ) { if ( ( mSoftReferences ) == null ) { mSoftReferences = new java.util.ArrayList < com.android.tools.perflib.heap.Instance > ( ) ; } mSoftReferences.add ( reference ) ; } else { mHardReferences.add ( reference ) ; } }

Target:
public void addReference ( @ com.android.annotations.Nullable com.android.tools.perflib.heap.Field field , @ com.android.annotations.NonNull com.android.tools.perflib.heap.Instance reference ) { if ( ( ( reference.getIsSoftReference ( ) ) && ( field != null ) ) && ( field.getName ( ) . equals ( "referent" ) ) ) { if ( ( mSoftReferences ) == null ) { mSoftReferences = new java.util.ArrayList < com.android.tools.perflib.heap.Instance > ( ) ; } mSoftReferences.add ( reference ) ; } else { mHardReferences.add ( reference ) ; } }
Source:
public void test_ConstructorZ ( ) { java.util.Timer t = null ; try { t = new java.util.Timer ( true ) ; tests.api.java.util.TimerTest.TimerTestTask testTask = new tests.api.java.util.TimerTest.TimerTestTask ( ) ; t.schedule ( testTask , 200 ) ; synchronized ( sync ) { try { sync.wait ( 1000 ) ; } catch ( java.lang.InterruptedException e ) { } } assertEquals ( "TimerTask.run() method not called after 200ms" , 1 , testTask.wasRun ( ) ) ; t.cancel ( ) ; } finally { if ( t != null ) t.cancel ( ) ; } }

Target:
private void awaitRun ( tests.api.java.util.TimerTest.TimerTestTask task ) { while ( ( task.wasRun ( ) ) == 0 ) { try { java.lang.Thread.sleep ( 150 ) ; } catch ( java.lang.InterruptedException e ) { } } }
Source:
private void executeRequest ( com.android.bluetooth.mapclient.Request request ) { try { request.execute ( mSession ) ; mCallback.obtainMessage ( MceStateMachine.MSG_MAS_REQUEST_COMPLETED , request ) . sendToTarget ( ) ; } catch ( java.io.IOException e ) { if ( com.android.bluetooth.mapclient.MasClient.DBG ) { android.util.Log.d ( com.android.bluetooth.mapclient.MasClient.TAG , ( "Request failed: " + request ) ) ; } disconnect ( ) ; } }

Target:
private void executeRequest ( com.android.bluetooth.mapclient.Request request ) { try { request.execute ( mSession ) ; mCallback.sendMessage ( MceStateMachine.MSG_MAS_REQUEST_COMPLETED , request ) ; } catch ( java.io.IOException e ) { if ( com.android.bluetooth.mapclient.MasClient.DBG ) { android.util.Log.d ( com.android.bluetooth.mapclient.MasClient.TAG , ( "Request failed: " + request ) ) ; } disconnect ( ) ; } }
Source:
public boolean setApplicationHidden ( @ android.annotation.NonNull android.content.ComponentName admin , java.lang.String packageName , boolean hidden ) { throwIfParentInstance ( "setApplicationHidden" ) ; if ( ( mService ) != null ) { try { return mService.setApplicationHidden ( admin , packageName , hidden ) ; } catch ( android.os.RemoteException e ) { throw e.rethrowFromSystemServer ( ) ; } } return false ; }

Target:
public boolean isApplicationHidden ( @ android.annotation.NonNull android.content.ComponentName admin , java.lang.String packageName ) { throwIfParentInstance ( "isApplicationHidden" ) ; if ( ( mService ) != null ) { try { return mService.isApplicationHidden ( admin , mContext.getPackageName ( ) , packageName ) ; } catch ( android.os.RemoteException e ) { throw e.rethrowFromSystemServer ( ) ; } } return false ; }
Source:
public void setZeroDigit ( char zeroDigit ) { if ( ( digits ) != null ) { this . digits [ 0 ] = zeroDigit ; for ( int i = 1 ; i < 10 ; i ++ ) { this . digits [ i ] = ( ( char ) ( zeroDigit + i ) ) ; } } else { this . zeroDigit = zeroDigit ; } }

Target:
public void setZeroDigit ( char zeroDigit ) { if ( ( digits ) != null ) { digits = digits.clone ( ) ; this . digits [ 0 ] = zeroDigit ; for ( int i = 1 ; i < 10 ; i ++ ) { this . digits [ i ] = ( ( char ) ( zeroDigit + i ) ) ; } } else { this . zeroDigit = zeroDigit ; } }
Source:
private void handleSimError ( int slotId ) { if ( ( ( com.android.internal.telephony.SubscriptionInfoUpdater.mIccId [ slotId ] ) != null ) && ( ! ( com.android.internal.telephony.SubscriptionInfoUpdater.mIccId [ slotId ] . equals ( com.android.internal.telephony.SubscriptionInfoUpdater.ICCID_STRING_FOR_NO_SIM ) ) ) ) { logd ( ( ( "SIM" + ( slotId + 1 ) ) + " Error " ) ) ; } com.android.internal.telephony.SubscriptionInfoUpdater.mIccId [ slotId ] = com.android.internal.telephony.SubscriptionInfoUpdater.ICCID_STRING_FOR_NO_SIM ; if ( isAllIccIdQueryDone ( ) ) { updateSubscriptionInfoByIccId ( ) ; } updateCarrierServices ( slotId , IccCardConstants.INTENT_VALUE_ICC_CARD_IO_ERROR ) ; }

Target:
private void handleSimError ( int slotId ) { if ( ( ( com.android.internal.telephony.SubscriptionInfoUpdater.mIccId [ slotId ] ) != null ) && ( ! ( com.android.internal.telephony.SubscriptionInfoUpdater.mIccId [ slotId ] . equals ( com.android.internal.telephony.SubscriptionInfoUpdater.ICCID_STRING_FOR_NO_SIM ) ) ) ) { logd ( ( ( "SIM" + ( slotId + 1 ) ) + " Error " ) ) ; } com.android.internal.telephony.SubscriptionInfoUpdater.mIccId [ slotId ] = com.android.internal.telephony.SubscriptionInfoUpdater.ICCID_STRING_FOR_NO_SIM ; if ( isAllIccIdQueryDone ( ) ) { updateSubscriptionInfoByIccId ( ) ; } updateCarrierServices ( slotId , IccCardConstants.INTENT_VALUE_ICC_CARD_IO_ERROR ) ; broadcastSimStateChanged ( slotId , IccCardConstants.INTENT_VALUE_ICC_CARD_IO_ERROR , IccCardConstants.INTENT_VALUE_ICC_CARD_IO_ERROR ) ; }
Source:
public void validateCredentialWithUserAndSimCredential ( ) throws java.lang.Exception { android.net.wifi.hotspot2.pps.Credential cred = new android.net.wifi.hotspot2.pps.Credential ( ) ; cred.realm = "realm" ; cred.userCredential = new android.net.wifi.hotspot2.pps.Credential.UserCredential ( ) ; cred.userCredential.username = "username" ; cred.userCredential.password = "password" ; cred.userCredential.eapType = android.net.wifi.EAPConstants.EAP_TTLS ; cred.userCredential.nonEapInnerMethod = "MS-CHAP" ; cred.caCertificate = android.net.wifi.FakeKeys.CA_CERT0 ; cred.simCredential = new android.net.wifi.hotspot2.pps.Credential.SimCredential ( ) ; cred.simCredential.imsi = "1234*" ; cred.simCredential.eapType = android.net.wifi.EAPConstants.EAP_SIM ; org.junit.Assert.assertFalse ( cred.validate ( ) ) ; }

Target:
public void validateCredentialWithUserAndSimCredential ( ) throws java.lang.Exception { android.net.wifi.hotspot2.pps.Credential cred = android.net.wifi.hotspot2.pps.CredentialTest.createCredentialWithUserCredential ( ) ; android.net.wifi.hotspot2.pps.Credential.SimCredential simCredential = new android.net.wifi.hotspot2.pps.Credential.SimCredential ( ) ; simCredential.setImsi ( "1234*" ) ; simCredential.setEapType ( EAPConstants.EAP_SIM ) ; cred.setSimCredential ( simCredential ) ; org.junit.Assert.assertFalse ( cred.validate ( ) ) ; }
Source:
private com.android.bluetooth.map.BluetoothMapUtils.TYPE getSmsType ( ) { com.android.bluetooth.map.BluetoothMapUtils.TYPE smsType = null ; android.telephony.TelephonyManager tm = ( ( android.telephony.TelephonyManager ) ( mContext.getSystemService ( Context.TELEPHONY_SERVICE ) ) ) ; if ( ( tm.getPhoneType ( ) ) == ( android.telephony.TelephonyManager.PHONE_TYPE_CDMA ) ) { smsType = com.android.bluetooth.map.BluetoothMapUtils.TYPE.SMS_CDMA ; } else { smsType = com.android.bluetooth.map.BluetoothMapUtils.TYPE.SMS_GSM ; } return smsType ; }

Target:
private com.android.bluetooth.map.BluetoothMapUtils.TYPE getSmsType ( ) { com.android.bluetooth.map.BluetoothMapUtils.TYPE smsType = null ; android.telephony.TelephonyManager tm = ( ( android.telephony.TelephonyManager ) ( mContext.getSystemService ( Context.TELEPHONY_SERVICE ) ) ) ; if ( ( tm.getPhoneType ( ) ) == ( android.telephony.TelephonyManager.PHONE_TYPE_GSM ) ) { smsType = com.android.bluetooth.map.BluetoothMapUtils.TYPE.SMS_GSM ; } else if ( ( tm.getPhoneType ( ) ) == ( android.telephony.TelephonyManager.PHONE_TYPE_CDMA ) ) { smsType = com.android.bluetooth.map.BluetoothMapUtils.TYPE.SMS_CDMA ; } return smsType ; }
Source:
public void test_setSoTimeoutI ( ) throws java.lang.Exception { java.net.DatagramSocket ds = new java.net.DatagramSocket ( ) ; ds.setSoTimeout ( 100 ) ; assertTrue ( "Set incorrect timeout" , ( ( ds.getSoTimeout ( ) ) >= 100 ) ) ; }

Target:
public void test_setSendBufferSizeI ( ) throws java.lang.Exception { final java.net.DatagramSocket ds = new java.net.DatagramSocket ( 0 ) ; ds.setSendBufferSize ( 134 ) ; assertTrue ( "Incorrect buffer size" , ( ( ds.getSendBufferSize ( ) ) >= 134 ) ) ; ds.close ( ) ; try { ds.setSendBufferSize ( 1 ) ; fail ( "SocketException was not thrown." ) ; } catch ( java.net.SocketException se ) { } }
Source:
public void setUp ( ) throws java.lang.Exception { org.mockito.MockitoAnnotations.initMocks ( this ) ; mTestImsService = new android.telephony.ims.TestImsService ( mMockContext ) ; mTestImsServiceBinder = ( ( com.android.ims.internal.IImsServiceController ) ( mTestImsService.onBind ( new android.content.Intent ( com.android.internal.telephony.ims.ImsResolver.SERVICE_INTERFACE ) ) ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { mMockContext = org.mockito.Mockito.mock ( android.content.Context.class ) ; mTestCallback = org.mockito.Mockito.mock ( com.android.ims.internal.IImsFeatureStatusCallback.class ) ; mTestImsService = new android.telephony.ims.TestImsService ( mMockContext ) ; mTestImsServiceBinder = ( ( android.telephony.ims.aidl.IImsServiceController ) ( mTestImsService.onBind ( new android.content.Intent ( ImsService.SERVICE_INTERFACE ) ) ) ) ; }
Source:
public void requestFocusNodeHref ( final android.os.Message hrefMsg ) { if ( checkNeedsPost ( ) ) { mRunQueue.addTask ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { requestFocusNodeHref ( hrefMsg ) ; } } ) ; return ; } mAwContents.requestFocusNodeHref ( hrefMsg ) ; }

Target:
public WebView.HitTestResult getHitTestResult ( ) { mFactory.startYourEngines ( true ) ; if ( checkNeedsPost ( ) ) { android.webkit.WebView.HitTestResult ret = runOnUiThreadBlocking ( new java.util.concurrent.Callable < android.webkit.WebView.HitTestResult > ( ) { @ java.lang.Override public WebView.HitTestResult call ( ) { return getHitTestResult ( ) ; } } ) ; return ret ; } org.chromium.android_webview.AwContents.HitTestData data = mAwContents.getLastHitTestResult ( ) ; mHitTestResult.setType ( data.hitTestResultType ) ; mHitTestResult.setExtra ( data.hitTestResultExtraData ) ; return mHitTestResult ; }
Source:
public final com.android.tools.perflib.heap.Instance findReference ( long id ) { for ( int i = 0 ; i < ( mHeaps.size ( ) ) ; i ++ ) { com.android.tools.perflib.heap.Instance instance = mHeaps.get ( i ) . getInstance ( id ) ; if ( instance != null ) { return instance ; } } return findClass ( id ) ; }

Target:
public final com.android.tools.perflib.heap.ClassObj findClass ( long id ) { for ( com.android.tools.perflib.heap.Heap mHeap : mHeaps ) { com.android.tools.perflib.heap.ClassObj theClass = mHeap.getClass ( id ) ; if ( theClass != null ) { return theClass ; } } return null ; }
Source:
void clearFormData ( android.content.Context context ) { android.webkit.WebViewDatabase.getInstance ( context ) . clearFormData ( ) ; if ( ( mTabControl ) != null ) { mTabControl.getCurrentTopWebView ( ) . clearFormData ( ) ; } }

Target:
void clearFormData ( android.content.Context context ) { android.webkit.WebViewDatabase.getInstance ( context ) . clearFormData ( ) ; if ( ( mTabControl ) != null ) { android.webkit.WebView currentTopView = mTabControl.getCurrentTopWebView ( ) ; if ( currentTopView != null ) { currentTopView.clearFormData ( ) ; } } }
Source:
public com.android.jack.load.PackageLoader getLoaderForSubPackage ( @ javax.annotation.Nonnull com.android.jack.ir.ast.JPackage loading , @ javax.annotation.Nonnull java.lang.String simpleName ) throws com.android.jack.ir.ast.JPackageLookupException { try { return new com.android.jack.jayce.JaycePackageLoader ( inputJackLibrary , packageVDir.getInputVDir ( new com.android.sched.vfs.VPath ( simpleName , '/' ) ) , lookup , defaultLoadLevel ) ; } catch ( com.android.sched.util.file.NotDirectoryException e ) { throw new com.android.jack.ir.ast.JPackageLookupException ( simpleName , loading ) ; } catch ( com.android.sched.util.file.NoSuchFileException e ) { throw new com.android.jack.ir.ast.JPackageLookupException ( simpleName , loading ) ; } }

Target:
public com.android.jack.load.PackageLoader getLoaderForSubPackage ( @ javax.annotation.Nonnull com.android.jack.ir.ast.JPackage loading , @ javax.annotation.Nonnull java.lang.String simpleName ) throws com.android.jack.ir.ast.JPackageLookupException { for ( com.android.sched.vfs.InputVElement sub : packageVDir.list ( ) ) { if ( ( sub.isVDir ( ) ) && ( sub.getName ( ) . equals ( simpleName ) ) ) { return new com.android.jack.jayce.JaycePackageLoader ( inputJackLibrary , ( ( com.android.sched.vfs.InputVDir ) ( sub ) ) , lookup , defaultLoadLevel ) ; } } throw new com.android.jack.ir.ast.JPackageLookupException ( simpleName , loading ) ; }
Source:
RttManager.RttListener getAndRemoveRangingListener ( int rangingId ) { android.net.wifi.nan.WifiNanManager mgr = mNanManager.get ( ) ; if ( mgr == null ) { android.util.Log.w ( android.net.wifi.nan.WifiNanManager.TAG , "getAndRemoveRangingListener: called post GC" ) ; return null ; } synchronized ( mgr.mLock ) { android.net.wifi.RttManager.RttListener listener = mgr.mRangingListeners.get ( rangingId ) ; mgr.mRangingListeners.delete ( rangingId ) ; return listener ; } }

Target:
RttManager.RttListener getAndRemoveRangingListener ( int rangingId ) { android.net.wifi.aware.WifiAwareManager mgr = mAwareManager.get ( ) ; if ( mgr == null ) { android.util.Log.w ( android.net.wifi.aware.WifiAwareManager.TAG , "getAndRemoveRangingListener: called post GC" ) ; return null ; } synchronized ( mgr.mLock ) { android.net.wifi.RttManager.RttListener listener = mgr.mRangingListeners.get ( rangingId ) ; mgr.mRangingListeners.delete ( rangingId ) ; return listener ; } }
Source:
private void runQuickFixTest ( java.lang.String annotationString , java.lang.String expectedString ) { final com.intellij.openapi.project.Project myProject = myFixture.getProject ( ) ; com.intellij.psi.PsiAnnotation annotation = com.intellij.psi.JavaPsiFacade.getInstance ( myProject ) . getElementFactory ( ) . createAnnotationFromText ( annotationString , null ) ; com.intellij.testFramework.MockProblemDescriptor problemDescriptor = new com.intellij.testFramework.MockProblemDescriptor ( annotation , "" , com.intellij.codeInspection.ProblemHighlightType.ERROR , null ) ; com.google.gct.intellij.endpoints.validation.ApiNamespaceInspection.MyQuickFix myQuickFix = new com.google.gct.intellij.endpoints.validation.ApiNamespaceInspection ( ) . new com.google.gct.intellij.endpoints.validation.MyQuickFix ( ) ; myQuickFix.applyFix ( myProject , problemDescriptor ) ; junit.framework.Assert.assertEquals ( expectedString , annotation.getText ( ) ) ; }

Target:
private void runQuickFixTest ( java.lang.String annotationString , java.lang.String expectedString ) { final com.intellij.openapi.project.Project myProject = myFixture.getProject ( ) ; com.intellij.psi.PsiAnnotation annotation = com.intellij.psi.JavaPsiFacade.getInstance ( myProject ) . getElementFactory ( ) . createAnnotationFromText ( annotationString , null ) ; com.intellij.testFramework.MockProblemDescriptor problemDescriptor = new com.intellij.testFramework.MockProblemDescriptor ( annotation , "" , com.intellij.codeInspection.ProblemHighlightType.ERROR , null ) ; com.google.gct.idea.appengine.validation.ApiNamespaceInspection.MyQuickFix myQuickFix = new com.google.gct.idea.appengine.validation.ApiNamespaceInspection ( ) . new com.google.gct.idea.appengine.validation.MyQuickFix ( ) ; myQuickFix.applyFix ( myProject , problemDescriptor ) ; junit.framework.Assert.assertEquals ( expectedString , annotation.getText ( ) ) ; }
Source:
public android.bluetooth.BluetoothSocket createInsecureRfcommSocket ( int port ) throws java.io.IOException { if ( ( isBluetoothEnabled ( ) ) == false ) { android.util.Log.e ( android.bluetooth.BluetoothDevice.TAG , "Bluetooth is not enabled" ) ; throw new java.io.IOException ( ) ; } return new android.bluetooth.BluetoothSocket ( BluetoothSocket.TYPE_RFCOMM , ( - 1 ) , false , false , this , port , null ) ; }

Target:
public android.bluetooth.BluetoothSocket createInsecureRfcommSocketToServiceRecord ( java.util.UUID uuid ) throws java.io.IOException { if ( ! ( isBluetoothEnabled ( ) ) ) { android.util.Log.e ( android.bluetooth.BluetoothDevice.TAG , "Bluetooth is not enabled" ) ; throw new java.io.IOException ( ) ; } return new android.bluetooth.BluetoothSocket ( BluetoothSocket.TYPE_RFCOMM , ( - 1 ) , false , false , this , ( - 1 ) , new android.os.ParcelUuid ( uuid ) ) ; }
Source:
public void stop ( ) { java.lang.Thread threadToStop ; synchronized ( this ) { threadToStop = thread ; thread = null ; } if ( threadToStop == null ) { throw new java.lang.IllegalStateException ( "not running" ) ; } interrupt ( threadToStop ) ; while ( true ) { try { threadToStop.join ( ) ; return ; } catch ( java.lang.InterruptedException ignored ) { } } }

Target:
public void stop ( ) { java.lang.Thread threadToStop ; synchronized ( this ) { threadToStop = thread ; thread = null ; } if ( threadToStop == null ) { throw new java.lang.IllegalStateException ( "not running" ) ; } interrupt ( threadToStop ) ; while ( true ) { try { threadToStop.join ( ) ; return ; } catch ( java.lang.InterruptedException ignored ) { } catch ( java.lang.OutOfMemoryError ignored ) { } } }
Source:
public final int getSize ( ) { com.android.tools.perflib.heap.Instance instance = null ; if ( ( mType ) == ( RootType.SYSTEM_CLASS ) ) { instance = mHeap.mState.findClass ( mId ) ; } else { instance = mHeap.mState.findReference ( mId ) ; } if ( instance == null ) { return 0 ; } return instance.getSize ( ) ; }

Target:
public com.android.tools.perflib.heap.Instance getReferredInstance ( ) { if ( ( mType ) == ( RootType.SYSTEM_CLASS ) ) { return mHeap.mState.findClass ( mId ) ; } else { return mHeap.mState.findReference ( mId ) ; } }
Source:
public void sendDialerSpecialCode ( java.lang.String inputCode ) { try { final com.android.internal.telephony.ITelephony telephony = getITelephony ( ) ; telephony.sendDialerSpecialCode ( mContext.getOpPackageName ( ) , inputCode ) ; } catch ( android.os.RemoteException ex ) { ex.rethrowFromSystemServer ( ) ; } catch ( java.lang.NullPointerException ex ) { throw new java.lang.IllegalStateException ( "Telephony service unavailable" ) ; } }

Target:
public void sendDialerSpecialCode ( java.lang.String inputCode ) { try { final com.android.internal.telephony.ITelephony telephony = getITelephony ( ) ; if ( telephony == null ) { if ( ! ( isSystemProcess ( ) ) ) { throw new java.lang.RuntimeException ( "Telephony service unavailable" ) ; } return ; } telephony.sendDialerSpecialCode ( mContext.getOpPackageName ( ) , inputCode ) ; } catch ( android.os.RemoteException ex ) { if ( ! ( isSystemProcess ( ) ) ) { ex.rethrowAsRuntimeException ( ) ; } } }
Source:
private com.android.ide.eclipse.adt.internal.resources.manager.ResourceFolder processFolder ( com.android.sdklib.io.IAbstractFolder folder , com.android.ide.eclipse.adt.internal.resources.manager.ProjectResources project ) { java.lang.String [ ] folderSegments = folder.getName ( ) . split ( FolderConfiguration.QUALIFIER_SEP ) ; com.android.ide.eclipse.adt.internal.resources.manager.ResourceFolderType type = com.android.ide.eclipse.adt.internal.resources.manager.ResourceFolderType.getTypeByName ( folderSegments [ 0 ] ) ; if ( type != null ) { com.android.ide.eclipse.adt.internal.resources.configurations.FolderConfiguration config = getConfig ( folderSegments ) ; if ( config != null ) { com.android.ide.eclipse.adt.internal.resources.manager.ResourceFolder configuredFolder = project.add ( type , config , folder ) ; return configuredFolder ; } } return null ; }

Target:
private com.android.ide.eclipse.adt.internal.resources.manager.ResourceFolder processFolder ( com.android.io.IAbstractFolder folder , com.android.ide.eclipse.adt.internal.resources.manager.ProjectResources project ) { java.lang.String [ ] folderSegments = folder.getName ( ) . split ( FolderConfiguration.QUALIFIER_SEP ) ; com.android.ide.eclipse.adt.internal.resources.manager.ResourceFolderType type = com.android.ide.eclipse.adt.internal.resources.manager.ResourceFolderType.getTypeByName ( folderSegments [ 0 ] ) ; if ( type != null ) { com.android.ide.eclipse.adt.internal.resources.configurations.FolderConfiguration config = getConfig ( folderSegments ) ; if ( config != null ) { com.android.ide.eclipse.adt.internal.resources.manager.ResourceFolder configuredFolder = project.add ( type , config , folder ) ; return configuredFolder ; } } return null ; }