auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void test ( ) throws java.lang.Exception { assertEquals ( ( "" + ( ( ( ( ( ( "src/test/pkg/DetachedFromWindow.java:7: Warning: Overriding method should call super.onDetachedFromWindow [MissingSuperCall]\n" + " protected void onDetachedFromWindow() {\n" ) + " ~~~~~~~~~~~~~~~~~~~~~~\n" ) + "src/test/pkg/DetachedFromWindow.java:26: Warning: Overriding method should call super.onDetachedFromWindow [MissingSuperCall]\n" ) + " protected void onDetachedFromWindow() {\n" ) + " ~~~~~~~~~~~~~~~~~~~~~~\n" ) + "0 errors, 2 warnings\n" ) ) , lintProject ( ( "src/test/pkg/DetachedFromWindow.java.txt=>" + "src/test/pkg/DetachedFromWindow.java" ) ) ) ; }

Target:
public void testDetachFromWindow ( ) throws java.lang.Exception { assertEquals ( ( "" + ( ( ( ( ( ( "src/test/pkg/DetachedFromWindow.java:7: Warning: Overriding method should call super.onDetachedFromWindow [MissingSuperCall]\n" + " protected void onDetachedFromWindow() {\n" ) + " ~~~~~~~~~~~~~~~~~~~~~~\n" ) + "src/test/pkg/DetachedFromWindow.java:26: Warning: Overriding method should call super.onDetachedFromWindow [MissingSuperCall]\n" ) + " protected void onDetachedFromWindow() {\n" ) + " ~~~~~~~~~~~~~~~~~~~~~~\n" ) + "0 errors, 2 warnings\n" ) ) , lintProject ( ( "src/test/pkg/DetachedFromWindow.java.txt=>" + "src/test/pkg/DetachedFromWindow.java" ) ) ) ; }
Source:
public void setCallerDisplayName ( java.lang.String callId , java.lang.String callerDisplayName , int presentation ) { android.telecom.Log.startSession ( "CSW.sCDN" ) ; long token = android.os.Binder.clearCallingIdentity ( ) ; try { synchronized ( mLock ) { logIncoming ( "setCallerDisplayName %s %s %d" , callId , callerDisplayName , presentation ) ; com.android.server.telecom.Call call = mCallIdMapper.getCall ( callId ) ; if ( call != null ) { call.setCallerDisplayName ( callerDisplayName , presentation ) ; } } } finally { android.os.Binder.restoreCallingIdentity ( token ) ; android.telecom.Log.endSession ( ) ; } }

Target:
public void setCallerDisplayName ( java.lang.String callId , java.lang.String callerDisplayName , int presentation , android.telecom.Logging.Session.Info sessionInfo ) { android.telecom.Log.startSession ( sessionInfo , "CSW.sCDN" ) ; long token = android.os.Binder.clearCallingIdentity ( ) ; try { synchronized ( mLock ) { logIncoming ( "setCallerDisplayName %s %s %d" , callId , callerDisplayName , presentation ) ; com.android.server.telecom.Call call = mCallIdMapper.getCall ( callId ) ; if ( call != null ) { call.setCallerDisplayName ( callerDisplayName , presentation ) ; } } } finally { android.os.Binder.restoreCallingIdentity ( token ) ; android.telecom.Log.endSession ( ) ; } }
Source:
public void copyFrom ( short [ ] d ) { mRS.validate ( ) ; if ( ( mCurrentDimZ ) > 0 ) { copy3DRangeFrom ( 0 , 0 , 0 , mCurrentDimX , mCurrentDimY , mCurrentDimZ , d ) ; } else if ( ( mCurrentDimY ) > 0 ) { copy2DRangeFrom ( 0 , 0 , mCurrentDimX , mCurrentDimY , d ) ; } else { copy1DRangeFrom ( 0 , mCurrentCount , d ) ; } }

Target:
public void copyFrom ( int [ ] d ) { validateIsInt32 ( ) ; copyFromUnchecked ( d , Element.DataType.SIGNED_32 , d.length ) ; }
Source:
private int deleteCodeCacheDirsLI ( java.lang.String volumeUuid , java.lang.String packageName ) { int [ ] users = com.android.server.pm.PackageManagerService.sUserManager.getUserIds ( ) ; int res = 0 ; for ( int user : users ) { int resInner = mInstaller.deleteCodeCacheFiles ( volumeUuid , packageName , user ) ; if ( resInner < 0 ) { res = resInner ; } } return res ; }

Target:
public boolean isEphemeralApplication ( java.lang.String packageName , int userId ) { enforceCrossUserPermission ( android.os.Binder.getCallingUid ( ) , userId , true , false , "isEphemeral" ) ; if ( com.android.server.pm.PackageManagerService.DISABLE_EPHEMERAL_APPS ) { return false ; } if ( ! ( isCallerSameApp ( packageName ) ) ) { return false ; } synchronized ( mPackages ) { android.content.pm.PackageParser.Package pkg = mPackages.get ( packageName ) ; if ( pkg != null ) { return pkg.applicationInfo.isEphemeralApp ( ) ; } } return false ; }
Source:
public void testGetBundleVersion ( ) throws java.lang.Exception { libcore.tzdata.update2.BundleVersion bundleVersion = new libcore.tzdata.update2.BundleVersion ( BundleVersion.FULL_BUNDLE_FORMAT_VERSION , "2016c" , "001" ) ; java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream ( ) ; try ( java.util.zip.ZipOutputStream zipOutputStream = new java.util.zip.ZipOutputStream ( baos ) ) { libcore.tzdata.update2.TimeZoneBundleTest.addZipEntry ( zipOutputStream , TimeZoneBundle.BUNDLE_VERSION_FILE_NAME , bundleVersion.getBytes ( ) ) ; } libcore.tzdata.update2.TimeZoneBundle bundle = new libcore.tzdata.update2.TimeZoneBundle ( baos.toByteArray ( ) ) ; assertEquals ( bundleVersion , bundle.getBundleVersion ( ) ) ; }

Target:
public void testGetBundleVersion ( ) throws java.lang.Exception { libcore.tzdata.update2.BundleVersion bundleVersion = new libcore.tzdata.update2.BundleVersion ( BundleVersion.CURRENT_FORMAT_MAJOR_VERSION , BundleVersion.CURRENT_FORMAT_MINOR_VERSION , "2016c" , 1 ) ; java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream ( ) ; try ( java.util.zip.ZipOutputStream zipOutputStream = new java.util.zip.ZipOutputStream ( baos ) ) { libcore.tzdata.update2.TimeZoneBundleTest.addZipEntry ( zipOutputStream , TimeZoneBundle.BUNDLE_VERSION_FILE_NAME , bundleVersion.toBytes ( ) ) ; } libcore.tzdata.update2.TimeZoneBundle bundle = new libcore.tzdata.update2.TimeZoneBundle ( baos.toByteArray ( ) ) ; assertEquals ( bundleVersion , bundle.getBundleVersion ( ) ) ; }
Source:
synchronized void nAllocationData2D ( long id , int xoff , int yoff , int mip , int face , int w , int h , byte [ ] d , int sizeBytes ) { validate ( ) ; rsnAllocationData2D ( mContext , id , xoff , yoff , mip , face , w , h , d , sizeBytes ) ; }

Target:
native void rsnScriptSetTimeZone ( long con , long script , byte [ ] timeZone , boolean mUseInc ) ;
Source:
boolean markChecked ( com.android.server.timezone.CheckToken checkToken , boolean succeeded ) { synchronized ( this ) { int optimisticLockId = checkToken.mOptimisticLockId ; int newOptimisticLockId = optimisticLockId + 1 ; int status = ( succeeded ) ? com.android.server.timezone.PackageStatus.CHECK_COMPLETED_SUCCESS : com.android.server.timezone.PackageStatus.CHECK_COMPLETED_FAILURE ; return writeStatusRow ( optimisticLockId , newOptimisticLockId , status , checkToken.mPackageVersions ) ; } }

Target:
boolean markChecked ( com.android.server.timezone.CheckToken checkToken , boolean succeeded ) { synchronized ( this ) { int optimisticLockId = checkToken.mOptimisticLockId ; int newOptimisticLockId = optimisticLockId + 1 ; int status = ( succeeded ) ? com.android.server.timezone.PackageStatus.CHECK_COMPLETED_SUCCESS : com.android.server.timezone.PackageStatus.CHECK_COMPLETED_FAILURE ; try { return writePackageStatusWithOptimisticLockCheck ( optimisticLockId , newOptimisticLockId , status , checkToken.mPackageVersions ) ; } catch ( java.io.IOException e ) { throw new java.lang.IllegalStateException ( e ) ; } } }
Source:
public void getModemActivityInfo ( android.os.Message response ) { com.android.internal.telephony.RILRequest rr = com.android.internal.telephony.RILRequest.obtain ( com.android.internal.telephony.RIL_REQUEST_GET_ACTIVITY_INFO , response ) ; if ( com.android.internal.telephony.RIL.RILJ_LOGD ) { riljLog ( ( ( ( rr.serialString ( ) ) + "> " ) + ( com.android.internal.telephony.RIL.requestToString ( rr.mRequest ) ) ) ) ; } send ( rr ) ; android.os.Message msg = mSender.obtainMessage ( com.android.internal.telephony.RIL.EVENT_BLOCKING_RESPONSE_TIMEOUT ) ; msg.obj = null ; msg.arg1 = rr.mSerial ; mSender.sendMessageDelayed ( msg , com.android.internal.telephony.RIL.DEFAULT_BLOCKING_MESSAGE_RESPONSE_TIMEOUT_MS ) ; }

Target:
public void getModemActivityInfo ( android.os.Message response ) { com.android.internal.telephony.RILRequest rr = com.android.internal.telephony.RILRequest.obtain ( com.android.internal.telephony.RIL_REQUEST_GET_ACTIVITY_INFO , response , mRILDefaultWorkSource ) ; if ( com.android.internal.telephony.RIL.RILJ_LOGD ) { riljLog ( ( ( ( rr.serialString ( ) ) + "> " ) + ( com.android.internal.telephony.RIL.requestToString ( rr.mRequest ) ) ) ) ; } send ( rr ) ; android.os.Message msg = mSender.obtainMessage ( com.android.internal.telephony.RIL.EVENT_BLOCKING_RESPONSE_TIMEOUT ) ; msg.obj = null ; msg.arg1 = rr.mSerial ; mSender.sendMessageDelayed ( msg , com.android.internal.telephony.RIL.DEFAULT_BLOCKING_MESSAGE_RESPONSE_TIMEOUT_MS ) ; }
Source:
private java.util.List < java.awt.Rectangle > getHorizontalRectangles ( java.awt.image.BufferedImage image , java.util.List < com.android.ninepatch.NinePatchChunk.Pair < java.lang.Integer > > leftPairs ) { java.util.List < java.awt.Rectangle > rectangles = new java.util.ArrayList < java.awt.Rectangle > ( ) ; for ( com.android.ninepatch.NinePatchChunk.Pair < java.lang.Integer > left : leftPairs ) { int y = left.mFirst ; int height = ( left.mSecond ) - ( left.mFirst ) ; rectangles.add ( new java.awt.Rectangle ( 1 , y , ( ( image.getWidth ( ) ) - 2 ) , height ) ) ; } return rectangles ; }

Target:
private java.util.List < java.awt.Rectangle > getHorizontalRectangles ( int imageWidth , java.util.List < com.android.ninepatch.NinePatchChunk.Pair < java.lang.Integer > > leftPairs ) { java.util.List < java.awt.Rectangle > rectangles = new java.util.ArrayList < java.awt.Rectangle > ( ) ; for ( com.android.ninepatch.NinePatchChunk.Pair < java.lang.Integer > left : leftPairs ) { int y = left.mFirst ; int height = ( left.mSecond ) - ( left.mFirst ) ; rectangles.add ( new java.awt.Rectangle ( 0 , y , imageWidth , height ) ) ; } return rectangles ; }
Source:
private boolean isRoamIndForHomeSystem ( java.lang.String roamInd ) { java.lang.String [ ] homeRoamIndicators = mPhone.getContext ( ) . getResources ( ) . getStringArray ( com.android.internal.R.array.config_cdma_home_system ) ; if ( homeRoamIndicators != null ) { for ( java.lang.String homeRoamInd : homeRoamIndicators ) { if ( homeRoamInd.equals ( roamInd ) ) { return true ; } } return false ; } return false ; }

Target:
private boolean isRoamIndForHomeSystem ( java.lang.String roamInd ) { log ( ( "isRoamIndForHomeSystem: " + ( mPhone.getContext ( ) . getResources ( ) . getConfiguration ( ) . toString ( ) ) ) ) ; java.lang.String [ ] homeRoamIndicators = mPhone.getContext ( ) . getResources ( ) . getStringArray ( com.android.internal.R.array.config_cdma_home_system ) ; if ( homeRoamIndicators != null ) { for ( java.lang.String homeRoamInd : homeRoamIndicators ) { if ( homeRoamInd.equals ( roamInd ) ) { return true ; } } return false ; } return false ; }
Source:
public void addFieldAnnotations ( com.android.dx.rop.cst.CstFieldRef field , com.android.dx.rop.annotation.Annotations annotations ) { if ( ( fieldAnnotations ) == null ) { fieldAnnotations = new java.util.ArrayList < com.android.dx.dex.file.FieldAnnotationStruct > ( ) ; } fieldAnnotations.add ( new com.android.dx.dex.file.FieldAnnotationStruct ( field , new com.android.dx.dex.file.AnnotationSetItem ( annotations ) ) ) ; }

Target:
public void addFieldAnnotations ( com.android.dx.rop.cst.CstFieldRef field , com.android.dx.rop.annotation.Annotations annotations , com.android.dx.dex.file.DexFile dexFile ) { if ( ( fieldAnnotations ) == null ) { fieldAnnotations = new java.util.ArrayList < com.android.dx.dex.file.FieldAnnotationStruct > ( ) ; } fieldAnnotations.add ( new com.android.dx.dex.file.FieldAnnotationStruct ( field , new com.android.dx.dex.file.AnnotationSetItem ( annotations , dexFile ) ) ) ; }
Source:
public void setup ( ) throws android.os.RemoteException { mFeature = new android.telephony.ims.internal.TestMmTelFeature ( ) ; mFeatureBinder = mFeature.getBinder ( ) ; mCapabilityCallback = org.mockito.Mockito.spy ( new android.telephony.ims.internal.feature.ImsFeature.CapabilityCallback ( ) ) ; mListener = org.mockito.Mockito.spy ( new android.telephony.ims.internal.feature.MmTelFeature.Listener ( ) ) ; mFeatureBinder.setListener ( mListener ) ; }

Target:
public void setup ( ) throws android.os.RemoteException { mFeature = new android.telephony.ims.TestMmTelFeature ( ) ; mFeatureBinder = mFeature.getBinder ( ) ; mCapabilityCallback = org.mockito.Mockito.spy ( new android.telephony.ims.feature.ImsFeature.CapabilityCallback ( ) ) ; mListener = org.mockito.Mockito.spy ( new android.telephony.ims.feature.MmTelFeature.Listener ( ) ) ; mFeatureBinder.setListener ( mListener ) ; }
Source:
public static int EqualTrueRhs ( boolean arg ) { return arg != true ? 3 : 5 ; }

Target:
public static void assertStringEquals ( java.lang.String expected , java.lang.String result ) { if ( expected == null ? result != null : ! ( expected.equals ( result ) ) ) { throw new java.lang.Error ( ( ( ( "Expected: " + expected ) + ", found: " ) + result ) ) ; } }
Source:
void createDefaultBuildTypes ( @ org.gradle.model.Path ( value = "android.buildTypes" ) org.gradle.model.collection.ManagedSet < com.android.build.gradle.managed.BuildType > buildTypes ) { buildTypes.create = $missing$ ; { it.name = com.android.builder.core.BuilderConstants.DEBUG ; it.setIsDebuggable ( true ) ; it.setIsEmbedMicroApp ( false ) ; } buildTypes.create = $missing$ ; it.name = com.android.builder.core.BuilderConstants.RELEASE ; }

Target:
public void createDefaultBuildTypes ( @ org.gradle.model.Path ( value = "android.buildTypes" ) org.gradle.model.collection.ManagedSet < com.android.build.gradle.managed.BuildType > buildTypes ) { buildTypes.create ( new org.gradle.api.Action < com.android.build.gradle.managed.BuildType > ( ) { @ java.lang.Override public void execute ( com.android.build.gradle.managed.BuildType buildType ) { buildType.setName ( BuilderConstants.DEBUG ) ; buildType.setIsDebuggable ( true ) ; buildType.setIsEmbedMicroApp ( false ) ; } } ) ; buildTypes.create ( new org.gradle.api.Action < com.android.build.gradle.managed.BuildType > ( ) { @ java.lang.Override public void execute ( com.android.build.gradle.managed.BuildType buildType ) { buildType.setName ( BuilderConstants.RELEASE ) ; } } ) ; }
Source:
public void testGetOpacity ( ) { android.graphics.drawable.Drawable d = mContext.getResources ( ) . getDrawable ( R.drawable.pass ) ; android.graphics.drawable.InsetDrawable insetDrawable = new android.graphics.drawable.InsetDrawable ( d , 0 ) ; assertEquals ( PixelFormat.OPAQUE , insetDrawable.getOpacity ( ) ) ; d = mContext.getResources ( ) . getDrawable ( R.drawable.testimage ) ; insetDrawable = new android.graphics.drawable.InsetDrawable ( d , 0 ) ; assertEquals ( PixelFormat.OPAQUE , insetDrawable.getOpacity ( ) ) ; }

Target:
public void testGetOpacity ( ) { android.graphics.drawable.Drawable d = mContext.getResources ( ) . getDrawable ( R.drawable.testimage ) ; android.graphics.drawable.InsetDrawable insetDrawable = new android.graphics.drawable.InsetDrawable ( d , 0 ) ; insetDrawable.setAlpha ( 255 ) ; assertEquals ( PixelFormat.OPAQUE , insetDrawable.getOpacity ( ) ) ; insetDrawable.setAlpha ( 100 ) ; assertEquals ( PixelFormat.TRANSLUCENT , insetDrawable.getOpacity ( ) ) ; }
Source:
void onTargetPackageRemoved ( @ android.annotation.NonNull final java.lang.String packageName , final int userId ) { if ( com.android.server.om.OverlayManagerService.DEBUG ) { android.util.Slog.d ( com.android.server.om.OverlayManagerService.TAG , ( ( ( "onTargetPackageRemoved packageName=" + packageName ) + " userId=" ) + userId ) ) ; } updateAllOverlaysForTarget ( packageName , userId , null ) ; }

Target:
void onTargetPackageRemoved ( @ android.annotation.NonNull final java.lang.String packageName , final int userId ) { if ( com.android.server.om.OverlayManagerService.DEBUG ) { android.util.Slog.d ( com.android.server.om.OverlayManagerService.TAG , ( ( ( "onTargetPackageRemoved packageName=" + packageName ) + " userId=" ) + userId ) ) ; } if ( updateAllOverlaysForTarget ( packageName , userId , null ) ) { mListener.onOverlaysChanged ( packageName , userId ) ; } }
Source:
public void testPackageOverridePackageFromFlavor ( ) { com.android.builder.AndroidBuilder builder = new com.android.builder.AndroidBuilder ( new com.android.builder.DefaultSdkParser ( "" ) , new com.android.utils.StdLogger ( StdLogger.Level.ERROR ) , false ) ; mFlavor.setPackageName ( "foo.bar" ) ; builder.setBuildVariant ( mMain , mFlavor , mDebug ) ; assertEquals ( "foo.bar" , 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 onReceive ( android.content.Context context , android.content.Intent intent ) { android.util.Log.d ( com.android.bluetooth.btservice.RemoteDevices.TAG , ( "Received intent: " + intent ) ) ; java.lang.String action = intent.getAction ( ) ; switch ( action ) { case android.bluetooth.BluetoothHeadset.ACTION_HF_INDICATORS_VALUE_CHANGED : onHfIndicatorValueChanged ( intent ) ; break ; case android.bluetooth.BluetoothHeadset.ACTION_VENDOR_SPECIFIC_HEADSET_EVENT : onVendorSpecificHeadsetEvent ( intent ) ; break ; default : android.util.Log.w ( com.android.bluetooth.btservice.RemoteDevices.TAG , ( "Unhandled intent: " + intent ) ) ; break ; } }

Target:
public void onReceive ( android.content.Context context , android.content.Intent intent ) { java.lang.String action = intent.getAction ( ) ; switch ( action ) { case android.bluetooth.BluetoothHeadset.ACTION_HF_INDICATORS_VALUE_CHANGED : onHfIndicatorValueChanged ( intent ) ; break ; case android.bluetooth.BluetoothHeadset.ACTION_VENDOR_SPECIFIC_HEADSET_EVENT : onVendorSpecificHeadsetEvent ( intent ) ; break ; case android.bluetooth.BluetoothHeadset.ACTION_CONNECTION_STATE_CHANGED : onHeadsetConnectionStateChanged ( intent ) ; break ; default : android.util.Log.w ( com.android.bluetooth.btservice.RemoteDevices.TAG , ( "Unhandled intent: " + intent ) ) ; break ; } }
Source:
public void write ( java.io.OutputStream out ) throws java.io.IOException { @ java.lang.SuppressWarnings ( value = "IOResourceOpenedButNotSafelyClosed" ) java.io.DataOutputStream dataOut = new java.io.DataOutputStream ( out ) ; try { dataOut.writeUTF ( myOldBuild ) ; dataOut.writeUTF ( myNewBuild ) ; dataOut.writeBoolean ( myIsBinary ) ; dataOut.writeBoolean ( myIsStrict ) ; dataOut.writeBoolean ( myIsNormalized ) ; com.intellij.updater.Patch.writeMap ( dataOut , myWarnings ) ; com.intellij.updater.Patch.writeList ( dataOut , myDeleteFiles ) ; writeActions ( dataOut , myActions ) ; } finally { dataOut.flush ( ) ; } }

Target:
public void write ( java.io.OutputStream out ) throws java.io.IOException { @ java.lang.SuppressWarnings ( value = "IOResourceOpenedButNotSafelyClosed" ) java.io.DataOutputStream dataOut = new java.io.DataOutputStream ( out ) ; try { dataOut.writeUTF ( myOldBuild ) ; dataOut.writeUTF ( myNewBuild ) ; dataOut.writeUTF ( myRoot ) ; dataOut.writeBoolean ( myIsBinary ) ; dataOut.writeBoolean ( myIsStrict ) ; dataOut.writeBoolean ( myIsNormalized ) ; com.intellij.updater.Patch.writeMap ( dataOut , myWarnings ) ; com.intellij.updater.Patch.writeList ( dataOut , myDeleteFiles ) ; writeActions ( dataOut , myActions ) ; } finally { dataOut.flush ( ) ; } }
Source:
private static WifiNanNative.Capabilities getCapabilities ( ) { com.android.server.wifi.nan.WifiNanNative.Capabilities cap = new com.android.server.wifi.nan.WifiNanNative.Capabilities ( ) ; cap.maxConcurrentNanClusters = 1 ; cap.maxPublishes = 2 ; cap.maxSubscribes = 2 ; cap.maxServiceNameLen = 255 ; cap.maxMatchFilterLen = 255 ; cap.maxTotalMatchFilterLen = 255 ; cap.maxServiceSpecificInfoLen = 255 ; cap.maxVsaDataLen = 255 ; cap.maxMeshDataLen = 255 ; cap.maxNdiInterfaces = 1 ; cap.maxNdpSessions = 1 ; cap.maxAppInfoLen = 255 ; cap.maxQueuedTransmitMessages = 6 ; return cap ; }

Target:
private static WifiAwareNative.Capabilities getCapabilities ( ) { com.android.server.wifi.aware.WifiAwareNative.Capabilities cap = new com.android.server.wifi.aware.WifiAwareNative.Capabilities ( ) ; cap.maxConcurrentAwareClusters = 1 ; cap.maxPublishes = 2 ; cap.maxSubscribes = 2 ; cap.maxServiceNameLen = 255 ; cap.maxMatchFilterLen = 255 ; cap.maxTotalMatchFilterLen = 255 ; cap.maxServiceSpecificInfoLen = 255 ; cap.maxVsaDataLen = 255 ; cap.maxMeshDataLen = 255 ; cap.maxNdiInterfaces = 1 ; cap.maxNdpSessions = 1 ; cap.maxAppInfoLen = 255 ; cap.maxQueuedTransmitMessages = 6 ; return cap ; }
Source:
public void run ( ) { com.android.mms.data.ContactList recipients = ( isRecipientsEditorVisible ( ) ) ? mRecipientsEditor.constructContactsFromInput ( false ) : getRecipients ( ) ; if ( android.util.Log.isLoggable ( LogTag.APP , Log.VERBOSE ) ) { com.android.mms.ui.ComposeMessageActivity.log ( ( "[CMA] onUpdate contact updated: " + updated ) ) ; com.android.mms.ui.ComposeMessageActivity.log ( ( "[CMA] onUpdate recipients: " + recipients ) ) ; } updateTitle ( recipients ) ; this . mMsgListAdapter.notifyDataSetChanged ( ) ; if ( ( mRecipientsEditor ) != null ) { mRecipientsEditor.populate ( recipients ) ; } }

Target:
public void run ( ) { addVideo ( uri , append ) ; }
Source:
public void updatePublish ( @ android.annotation.NonNull android.net.wifi.nan.PublishConfig publishConfig ) { if ( mTerminated ) { android.util.Log.w ( android.net.wifi.nan.WifiNanPublishSession.TAG , "updatePublish: called on terminated session" ) ; return ; } else { android.net.wifi.nan.WifiNanManager mgr = mMgr.get ( ) ; if ( mgr == null ) { android.util.Log.w ( android.net.wifi.nan.WifiNanPublishSession.TAG , "updatePublish: called post GC on WifiNanManager" ) ; return ; } mgr.updatePublish ( mSessionId , publishConfig ) ; } }

Target:
public void updatePublish ( @ android.annotation.NonNull android.net.wifi.nan.PublishConfig publishConfig ) { if ( mTerminated ) { android.util.Log.w ( android.net.wifi.nan.WifiNanPublishDiscoverySession.TAG , "updatePublish: called on terminated session" ) ; return ; } else { android.net.wifi.nan.WifiNanManager mgr = mMgr.get ( ) ; if ( mgr == null ) { android.util.Log.w ( android.net.wifi.nan.WifiNanPublishDiscoverySession.TAG , "updatePublish: called post GC on WifiNanManager" ) ; return ; } mgr.updatePublish ( mSessionId , publishConfig ) ; } }
Source:
public void dismissPendingDialogs ( ) { if ( ( mDialog ) != null ) { mDialog.dismiss ( ) ; mDialog = null ; } if ( ( mAnswerFragment ) != null ) { mAnswerFragment.dismissPendingDialogs ( ) ; } }

Target:
public void dismissPendingDialogs ( ) { if ( ( mDialog ) != null ) { mDialog.dismiss ( ) ; mDialog = null ; } if ( ( mAnswerFragment ) != null ) { mAnswerFragment.dismissPendingDialogs ( ) ; } com.android.contacts.common.widget.SelectPhoneAccountDialogFragment dialogFragment = ( ( com.android.contacts.common.widget.SelectPhoneAccountDialogFragment ) ( getFragmentManager ( ) . findFragmentByTag ( com.android.incallui.InCallActivity.TAG_SELECT_ACCT_FRAGMENT ) ) ) ; if ( dialogFragment != null ) { dialogFragment.dismiss ( ) ; } }
Source:
public int relayout ( android.view.IWindow window , android.view.WindowManager.LayoutParams attrs , int requestedWidth , int requestedHeight , int viewFlags , boolean insetsPending , android.graphics.Rect outFrame , android.graphics.Rect outContentInsets , android.graphics.Rect outVisibleInsets , android.view.Surface outSurface ) { return relayoutWindow ( this , window , attrs , requestedWidth , requestedHeight , viewFlags , insetsPending , outFrame , outContentInsets , outVisibleInsets , outSurface ) ; }

Target:
public android.os.Bundle sendWallpaperCommand ( android.os.IBinder window , java.lang.String action , int x , int y , int z , android.os.Bundle extras , boolean sync ) { synchronized ( mWindowMap ) { long ident = android.os.Binder.clearCallingIdentity ( ) ; try { return sendWindowWallpaperCommandLocked ( windowForClientLocked ( this , window , true ) , action , x , y , z , extras , sync ) ; } finally { android.os.Binder.restoreCallingIdentity ( ident ) ; } } }
Source:
public int compare ( java.util.Map.Entry < java.lang.Long , com.android.tools.perflib.vmtrace.MethodInfo > o1 , java.util.Map.Entry < java.lang.Long , com.android.tools.perflib.vmtrace.MethodInfo > o2 ) { long diff = ( o2.getValue ( ) . getInclusiveTime ( thread , ClockType.THREAD ) ) - ( o1.getValue ( ) . getInclusiveTime ( thread , ClockType.THREAD ) ) ; return com.google.common.primitives.Ints.saturatedCast ( diff ) ; }

Target:
public int compare ( java.util.Map.Entry < java.lang.Long , com.android.tools.perflib.vmtrace.MethodInfo > o1 , java.util.Map.Entry < java.lang.Long , com.android.tools.perflib.vmtrace.MethodInfo > o2 ) { long diff = ( o2.getValue ( ) . getProfileData ( ) . getInclusiveTime ( thread , ClockType.THREAD , java.util.concurrent.TimeUnit.NANOSECONDS ) ) - ( o1.getValue ( ) . getProfileData ( ) . getInclusiveTime ( thread , ClockType.THREAD , java.util.concurrent.TimeUnit.NANOSECONDS ) ) ; return com.google.common.primitives.Ints.saturatedCast ( diff ) ; }
Source:
public boolean connect ( android.bluetooth.BluetoothDevice device ) { if ( ! ( com.android.bluetooth.Utils.checkCaller ( ) ) ) { android.util.Log.w ( com.android.bluetooth.pbap.BluetoothPbapService.TAG , "connect(): not allowed for non-active user" ) ; return false ; } enforceCallingOrSelfPermission ( com.android.bluetooth.pbap.BluetoothPbapService.BLUETOOTH_ADMIN_PERM , "Need BLUETOOTH_ADMIN permission" ) ; return false ; }

Target:
public boolean isConnected ( android.bluetooth.BluetoothDevice device ) { if ( com.android.bluetooth.pbap.BluetoothPbapService.DEBUG ) android.util.Log.d ( com.android.bluetooth.pbap.BluetoothPbapService.TAG , ( "isConnected " + device ) ) ; com.android.bluetooth.pbap.BluetoothPbapService service = getService ( com.android.bluetooth.pbap.BluetoothPbapService.BLUETOOTH_PERM ) ; if ( service == null ) return false ; return ( ( service.getState ( ) ) == ( android.bluetooth.BluetoothPbap.STATE_CONNECTED ) ) && ( service.getRemoteDevice ( ) . equals ( device ) ) ; }
Source:
public void test_socket_accept_Blocking_Bound ( ) throws java.io.IOException { serverChannel.configureBlocking ( true ) ; java.net.ServerSocket gotSocket = serverChannel.socket ( ) ; gotSocket.bind ( null ) ; serverChannel.close ( ) ; try { gotSocket.accept ( ) ; fail ( "Should throw a ClosedChannelException" ) ; } catch ( java.nio.channels.ClosedChannelException e ) { } }

Target:
public void test_socket_accept_Blocking_NotBound ( ) throws java.io.IOException { java.net.ServerSocket gotSocket = serverChannel.socket ( ) ; serverChannel.configureBlocking ( true ) ; try { gotSocket.accept ( ) ; fail ( "Should throw an IllegalBlockingModeException" ) ; } catch ( java.nio.channels.IllegalBlockingModeException expected ) { } serverChannel.close ( ) ; try { gotSocket.accept ( ) ; fail ( "Should throw an IllegalBlockingModeException" ) ; } catch ( java.nio.channels.IllegalBlockingModeException expected ) { } }
Source:
public android.bluetooth.BluetoothDevice getClient ( ) { if ( com.android.bluetooth.pbap.BluetoothPbapService.DEBUG ) android.util.Log.d ( com.android.bluetooth.pbap.BluetoothPbapService.TAG , ( "getClient" + ( mRemoteDevice ) ) ) ; if ( ! ( com.android.bluetooth.Utils.checkCaller ( ) ) ) { android.util.Log.w ( com.android.bluetooth.pbap.BluetoothPbapService.TAG , "getClient(): not allowed for non-active user" ) ; return null ; } enforceCallingOrSelfPermission ( com.android.bluetooth.pbap.BluetoothPbapService.BLUETOOTH_PERM , "Need BLUETOOTH permission" ) ; if ( ( mState ) == ( android.bluetooth.BluetoothPbap.STATE_DISCONNECTED ) ) { return null ; } return mRemoteDevice ; }

Target:
protected boolean stop ( ) { android.util.Log.v ( com.android.bluetooth.pbap.BluetoothPbapService.TAG , "stop()" ) ; if ( ! ( mIsRegistered ) ) { android.util.Log.i ( com.android.bluetooth.pbap.BluetoothPbapService.TAG , "Avoid unregister when receiver it is not registered" ) ; return true ; } try { mIsRegistered = false ; unregisterReceiver ( mPbapReceiver ) ; } catch ( java.lang.Exception e ) { android.util.Log.w ( com.android.bluetooth.pbap.BluetoothPbapService.TAG , "Unable to unregister pbap receiver" , e ) ; } setState ( BluetoothPbap.STATE_DISCONNECTED , BluetoothPbap.RESULT_CANCELED ) ; closeService ( ) ; if ( ( mSessionStatusHandler ) != null ) { mSessionStatusHandler.removeCallbacksAndMessages ( null ) ; } return true ; }
Source:
public void testUnocclude ( ) throws java.lang.Exception { if ( ! ( supportsKeyguard ( ) ) ) { return ; } gotoKeyguard ( ) ; launchActivity ( "ShowWhenLockedActivity" ) ; launchActivity ( "TestActivity" ) ; mAmWmState.waitForKeyguardShowingAndNotOccluded ( mDevice ) ; mAmWmState.computeState ( mDevice , null ) ; assertEquals ( "Picked wrong transition" , android.server.cts.WindowManagerState.TRANSIT_KEYGUARD_UNOCCLUDE , mAmWmState.getWmState ( ) . getLastTransition ( ) ) ; }

Target:
public void testUnocclude ( ) throws java.lang.Exception { if ( ( ! ( isHandheld ( ) ) ) || ( isUiModeLockedToVrHeadset ( ) ) ) { return ; } gotoKeyguard ( ) ; launchActivity ( "ShowWhenLockedActivity" ) ; launchActivity ( "TestActivity" ) ; mAmWmState.waitForKeyguardShowingAndNotOccluded ( mDevice ) ; mAmWmState.computeState ( mDevice , null ) ; assertEquals ( "Picked wrong transition" , android.server.cts.WindowManagerState.TRANSIT_KEYGUARD_UNOCCLUDE , mAmWmState.getWmState ( ) . getLastTransition ( ) ) ; }
Source:
private void transformTries ( com.android.dx.io.DexBuffer.Section out , com.android.dx.io.Code [ ] tries , int [ ] catchHandlerOffsets ) { for ( com.android.dx.io.Code.Try tryItem : tries ) { out.writeInt ( tryItem.getStartAddress ( ) ) ; out.writeUnsignedShort ( tryItem.getInstructionCount ( ) ) ; out.writeUnsignedShort ( catchHandlerOffsets [ tryItem.getCatchHandlerIndex ( ) ] ) ; } }

Target:
private void transformTries ( com.android.dex.Dex.Section out , com.android.dex.Code [ ] tries , int [ ] catchHandlerOffsets ) { for ( com.android.dex.Code.Try tryItem : tries ) { out.writeInt ( tryItem.getStartAddress ( ) ) ; out.writeUnsignedShort ( tryItem.getInstructionCount ( ) ) ; out.writeUnsignedShort ( catchHandlerOffsets [ tryItem.getCatchHandlerIndex ( ) ] ) ; } }
Source:
public final void testPkgTypePlatformTool ( ) { com.android.sdklib.repository.descriptors.IPkgCapabilities p = PkgType.PKG_PLATFORM_TOOLS ; assertFalse ( p.hasMajorRevision ( ) ) ; assertTrue ( p.hasFullRevision ( ) ) ; assertFalse ( p.hasAndroidVersion ( ) ) ; assertFalse ( p.hasPath ( ) ) ; assertFalse ( p.hasVendorId ( ) ) ; assertFalse ( p.hasMinToolsRev ( ) ) ; assertFalse ( p.hasMinPlatformToolsRev ( ) ) ; }

Target:
public final void testPkgTypePlatformTool ( ) { com.android.sdklib.repository.descriptors.IPkgCapabilities p = PkgType.PKG_PLATFORM_TOOLS ; assertFalse ( p.hasMajorRevision ( ) ) ; assertTrue ( p.hasFullRevision ( ) ) ; assertFalse ( p.hasAndroidVersion ( ) ) ; assertFalse ( p.hasPath ( ) ) ; assertFalse ( p.hasVendor ( ) ) ; assertFalse ( p.hasMinToolsRev ( ) ) ; assertFalse ( p.hasMinPlatformToolsRev ( ) ) ; }
Source:
public void cancelMissedCallsNotification ( java.lang.String callingPackage ) { try { com.android.server.telecom.Log.startSession ( "TSI.cMCN" ) ; synchronized ( mLock ) { enforcePermissionOrPrivilegedDialer ( android.Manifest.permission.MODIFY_PHONE_STATE , callingPackage ) ; android.os.UserHandle userHandle = android.os.Binder.getCallingUserHandle ( ) ; long token = android.os.Binder.clearCallingIdentity ( ) ; try { mCallsManager.getMissedCallNotifier ( ) . clearMissedCalls ( userHandle ) ; } finally { android.os.Binder.restoreCallingIdentity ( token ) ; } } } finally { com.android.server.telecom.Log.endSession ( ) ; } }

Target:
public void cancelMissedCallsNotification ( java.lang.String callingPackage ) { try { android.telecom.Log.startSession ( "TSI.cMCN" ) ; synchronized ( mLock ) { enforcePermissionOrPrivilegedDialer ( android.Manifest.permission.MODIFY_PHONE_STATE , callingPackage ) ; android.os.UserHandle userHandle = android.os.Binder.getCallingUserHandle ( ) ; long token = android.os.Binder.clearCallingIdentity ( ) ; try { mCallsManager.getMissedCallNotifier ( ) . clearMissedCalls ( userHandle ) ; } finally { android.os.Binder.restoreCallingIdentity ( token ) ; } } } finally { android.telecom.Log.endSession ( ) ; } }
Source:
public boolean isConnected ( android.bluetooth.BluetoothDevice device ) { if ( com.android.bluetooth.pbap.BluetoothPbapService.DEBUG ) android.util.Log.d ( com.android.bluetooth.pbap.BluetoothPbapService.TAG , ( "isConnected " + device ) ) ; com.android.bluetooth.pbap.BluetoothPbapService service = getService ( com.android.bluetooth.pbap.BluetoothPbapService.BLUETOOTH_PERM ) ; if ( service == null ) return false ; return ( ( service.getState ( ) ) == ( android.bluetooth.BluetoothPbap.STATE_CONNECTED ) ) && ( service.getRemoteDevice ( ) . equals ( device ) ) ; }

Target:
public boolean isConnected ( android.bluetooth.BluetoothDevice device ) { if ( com.android.bluetooth.pbap.BluetoothPbapService.DEBUG ) android.util.Log.d ( com.android.bluetooth.pbap.BluetoothPbapService.TAG , ( "isConnected " + device ) ) ; com.android.bluetooth.pbap.BluetoothPbapService service = getService ( com.android.bluetooth.pbap.BluetoothPbapService.BLUETOOTH_PERM ) ; if ( service == null ) return false ; return ( ( service.getState ( ) ) == ( android.bluetooth.BluetoothProfile.STATE_CONNECTED ) ) && ( service.getRemoteDevice ( ) . equals ( device ) ) ; }
Source:
public void exit ( ) { try { mBatteryStats.noteWifiScanStoppedFromSource ( mScanWorkSource ) ; } catch ( android.os.RemoteException e ) { loge ( e.toString ( ) ) ; } mWifiMetrics.incrementScanReturnEntry ( WifiMetricsProto.WifiLog.SCAN_UNKNOWN , mActiveScans.size ( ) ) ; sendOpFailedToAllAndClear ( mActiveScans , WifiScanner.REASON_UNSPECIFIED , "Scan was interrupted" ) ; }

Target:
public void exit ( ) { mActiveScanSettings = null ; try { mBatteryStats.noteWifiScanStoppedFromSource ( mScanWorkSource ) ; } catch ( android.os.RemoteException e ) { loge ( e.toString ( ) ) ; } mWifiMetrics.incrementScanReturnEntry ( WifiMetricsProto.WifiLog.SCAN_UNKNOWN , mActiveScans.size ( ) ) ; sendOpFailedToAllAndClear ( mActiveScans , WifiScanner.REASON_UNSPECIFIED , "Scan was interrupted" ) ; }
Source:
private void agentDisconnect ( android.net.NetworkInfo networkInfo , android.net.NetworkAgent networkAgent ) { networkInfo.setIsAvailable ( false ) ; networkInfo.setDetailedState ( DetailedState.DISCONNECTED , null , null ) ; if ( networkAgent != null ) { networkAgent.sendNetworkInfo ( networkInfo ) ; } }

Target:
private void agentDisconnect ( android.net.NetworkAgent networkAgent ) { if ( networkAgent != null ) { android.net.NetworkInfo networkInfo = new android.net.NetworkInfo ( mNetworkInfo ) ; networkInfo.setIsAvailable ( false ) ; networkInfo.setDetailedState ( DetailedState.DISCONNECTED , null , null ) ; networkAgent.sendNetworkInfo ( networkInfo ) ; } }
Source:
public void testInstall_withBadlyFormedAndroidRevision ( ) throws java.lang.Exception { java.lang.String invalidAndroidRevision = "A01" ; byte [ ] versionBytes = libcore.tzdata.update2.BundleVersion.getBytes ( BundleVersion.FULL_BUNDLE_FORMAT_VERSION , libcore.tzdata.update2.TimeZoneBundleInstallerTest.NEW_RULES_VERSION , invalidAndroidRevision ) ; libcore.tzdata.update2.TimeZoneBundle bundle = libcore.tzdata.update2.TimeZoneBundleInstallerTest.createTimeZoneBundleWithVersionBytes ( versionBytes ) ; assertFalse ( installer.install ( bundle.getBytes ( ) ) ) ; assertNoContentInstalled ( ) ; }

Target:
public void testInstall_withBadlyFormedRevision ( ) throws java.lang.Exception { libcore.tzdata.update2.BundleVersion validBundleVersion = new libcore.tzdata.update2.BundleVersion ( 1 , 1 , libcore.tzdata.update2.TimeZoneBundleInstallerTest.NEW_RULES_VERSION , 1 ) ; byte [ ] invalidRevisionBytes = validBundleVersion.toBytes ( ) ; invalidRevisionBytes [ ( ( invalidRevisionBytes.length ) - 3 ) ] = 'A' ; libcore.tzdata.update2.TimeZoneBundle bundle = libcore.tzdata.update2.TimeZoneBundleInstallerTest.createTimeZoneBundleWithVersionBytes ( invalidRevisionBytes ) ; assertEquals ( TimeZoneBundleInstaller.INSTALL_FAIL_BAD_BUNDLE_STRUCTURE , installer.installWithErrorCode ( bundle.getBytes ( ) ) ) ; assertNoContentInstalled ( ) ; }
Source:
public void onMessageWaitingIndicatorChanged ( boolean visible ) { if ( com.android.phone.CallNotifier.VDBG ) log ( ( ( ( "onMessageWaitingIndicatorChanged(): " + ( this . mSubId ) ) + " " ) + visible ) ) ; mMWIStatus.put ( this . mSubId , visible ) ; updatePhoneStateListeners ( false ) ; }

Target:
public void onCallForwardingIndicatorChanged ( boolean visible ) { android.util.Log.i ( com.android.phone.CallNotifier.LOG_TAG , ( ( ( "onCallForwardingIndicatorChanged(): subId=" + ( this . mSubId ) ) + ", visible=" ) + ( visible ? "Y" : "N" ) ) ) ; mCFIStatus.put ( this . mSubId , visible ) ; updatePhoneStateListeners ( false , com.android.phone.CallNotifier.UPDATE_TYPE_CFI , this . mSubId ) ; }
Source:
void foo9 ( int [ ] array ) { for ( int i = 0 ; i < 10 ; i ++ ) { sum += array [ i ] ; } }

Target:
void foo3 ( int [ ] array , int end , boolean expectInterpreter ) { for ( int i = 3 ; i <= end ; i ++ ) { if ( expectInterpreter ) { Main.assertIsInterpreted ( ) ; } else { Main.assertIsManaged ( ) ; } array [ i ] = 1 ; sum += array [ i ] ; } }
Source:
synchronized void nAllocationData1D ( long id , int off , int mip , int count , float [ ] d , int sizeBytes ) { validate ( ) ; rsnAllocationData1D ( mContext , id , off , mip , count , d , sizeBytes ) ; }

Target:
synchronized void nAllocationData2D ( long id , int xoff , int yoff , int mip , int face , int w , int h , java.lang.Object d , int sizeBytes , android.support.v8.renderscript.Element.DataType dt , int mSize , boolean usePadding ) { validate ( ) ; rsnAllocationData2D ( mContext , id , xoff , yoff , mip , face , w , h , d , sizeBytes , dt.mID , mSize , usePadding ) ; }
Source:
public byte [ ] getOpaqueData ( ) { try { java.io.ByteArrayOutputStream byteArrayOutputStream = new java.io.ByteArrayOutputStream ( ) ; java.io.ObjectOutputStream stream = new java.io.ObjectOutputStream ( byteArrayOutputStream ) ; android.telephony.mbms.DownloadRequest.OpaqueDataContainer container = new android.telephony.mbms.DownloadRequest.OpaqueDataContainer ( serializedResultIntentForApp , version ) ; stream.writeObject ( container ) ; stream.flush ( ) ; return byteArrayOutputStream.toByteArray ( ) ; } catch ( java.io.IOException e ) { android.util.Log.e ( android.telephony.mbms.DownloadRequest.LOG_TAG , "Got IOException trying to serialize opaque data" ) ; return null ; } }

Target:
public byte [ ] toByteArray ( ) { try { java.io.ByteArrayOutputStream byteArrayOutputStream = new java.io.ByteArrayOutputStream ( ) ; java.io.ObjectOutputStream stream = new java.io.ObjectOutputStream ( byteArrayOutputStream ) ; android.telephony.mbms.DownloadRequest.SerializationDataContainer container = new android.telephony.mbms.DownloadRequest.SerializationDataContainer ( this ) ; stream.writeObject ( container ) ; stream.flush ( ) ; return byteArrayOutputStream.toByteArray ( ) ; } catch ( java.io.IOException e ) { android.util.Log.e ( android.telephony.mbms.DownloadRequest.LOG_TAG , "Got IOException trying to serialize opaque data" ) ; return null ; } }
Source:
private static boolean isMethodOnFragmentClass ( @ com.android.annotations.NonNull com.android.tools.lint.detector.api.JavaContext context , @ com.android.annotations.NonNull lombok.ast.MethodInvocation call , @ com.android.annotations.NonNull java.lang.String fragmentClass , @ com.android.annotations.NonNull java.lang.String v4FragmentClass , boolean returnForUnresolved ) { com.android.tools.lint.client.api.JavaParser.ResolvedNode resolved = context.resolve ( call ) ; if ( resolved instanceof com.android.tools.lint.client.api.JavaParser.ResolvedMethod ) { com.android.tools.lint.client.api.JavaParser.ResolvedClass containingClass = ( ( com.android.tools.lint.client.api.JavaParser.ResolvedMethod ) ( resolved ) ) . getContainingClass ( ) ; return ( containingClass.isSubclassOf ( fragmentClass , false ) ) || ( containingClass.isSubclassOf ( v4FragmentClass , false ) ) ; } else if ( resolved == null ) { return returnForUnresolved ; } return false ; }

Target:
private static boolean isMethodOnFragmentClass ( @ com.android.annotations.NonNull com.android.tools.lint.detector.api.JavaContext context , @ com.android.annotations.NonNull com.intellij.psi.PsiMethodCallExpression call , @ com.android.annotations.NonNull java.lang.String fragmentClass , @ com.android.annotations.NonNull java.lang.String v4FragmentClass , boolean returnForUnresolved ) { com.intellij.psi.PsiMethod method = call.resolveMethod ( ) ; if ( method != null ) { com.intellij.psi.PsiClass containingClass = method.getContainingClass ( ) ; com.android.tools.lint.client.api.JavaEvaluator evaluator = context.getEvaluator ( ) ; return ( evaluator.extendsClass ( containingClass , fragmentClass , false ) ) || ( evaluator.extendsClass ( containingClass , v4FragmentClass , false ) ) ; } else { return returnForUnresolved ; } }
Source:
public void testFlagFExistingI ( ) { int iFlags = PackageManager.INSTALL_INTERNAL ; int rFlags = ( PackageManager.INSTALL_FORWARD_LOCK ) | ( PackageManager.INSTALL_REPLACE_EXISTING ) ; installFromRawResource ( "install.apk" , R.raw.install , iFlags , false , false , ( - 1 ) , ( - 1 ) ) ; installFromRawResource ( "install.apk" , R.raw.install , rFlags , true , false , ( - 1 ) , ( - 1 ) ) ; }

Target:
public void testFlagIExistingE ( ) { if ( android.os.Environment.isExternalStorageEmulated ( ) ) { return ; } int iFlags = android.content.pm.PackageManager.INSTALL_EXTERNAL ; int rFlags = ( android.content.pm.PackageManager.INSTALL_INTERNAL ) | ( android.content.pm.PackageManager.INSTALL_REPLACE_EXISTING ) ; installFromRawResource ( "install.apk" , R.raw.install , iFlags , false , false , ( - 1 ) , ( - 1 ) ) ; installFromRawResource ( "install.apk" , R.raw.install , rFlags , true , false , ( - 1 ) , ( - 1 ) ) ; }
Source:
public void validateUserCredentialWithoutRealm ( ) throws java.lang.Exception { android.net.wifi.hotspot2.pps.Credential cred = new android.net.wifi.hotspot2.pps.Credential ( ) ; 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 ; org.junit.Assert.assertFalse ( cred.validate ( ) ) ; }

Target:
public void validateCertCredentialWithMismatchFingerprint ( ) throws java.lang.Exception { android.net.wifi.hotspot2.pps.Credential cred = android.net.wifi.hotspot2.pps.CredentialTest.createCredentialWithCertificateCredential ( ) ; cred.getCertCredential ( ) . setCertSha256Fingerprint ( new byte [ 32 ] ) ; org.junit.Assert.assertFalse ( cred.validate ( ) ) ; }
Source:
public void onImsDisconnected ( com.android.ims.ImsReasonInfo imsReasonInfo ) { if ( com.android.internal.telephony.imsphone.ImsPhoneCallTracker.DBG ) log ( ( "onImsDisconnected imsReasonInfo=" + imsReasonInfo ) ) ; resetImsCapabilities ( ) ; mPhone.setServiceState ( ServiceState.STATE_OUT_OF_SERVICE ) ; mPhone.setImsRegistered ( false ) ; mPhone.processDisconnectReason ( imsReasonInfo ) ; mMetrics.writeOnImsConnectionState ( mPhone.getPhoneId ( ) , ImsConnectionState.State.DISCONNECTED , imsReasonInfo ) ; }

Target:
public void onDeregistered ( android.telephony.ims.ImsReasonInfo imsReasonInfo ) { if ( com.android.internal.telephony.imsphone.ImsPhoneCallTracker.DBG ) log ( ( "onImsDisconnected imsReasonInfo=" + imsReasonInfo ) ) ; resetImsCapabilities ( ) ; mPhone.setServiceState ( ServiceState.STATE_OUT_OF_SERVICE ) ; mPhone.setImsRegistered ( false ) ; mPhone.processDisconnectReason ( imsReasonInfo ) ; mMetrics.writeOnImsConnectionState ( mPhone.getPhoneId ( ) , ImsConnectionState.State.DISCONNECTED , imsReasonInfo ) ; }
Source:
private static java.lang.String getVersion ( java.lang.String prefix , java.lang.String jarName , java.lang.String defaultVersion ) { if ( jarName.matches ( ( prefix + "([\\d\\.]+)\\.jar" ) ) ) { return jarName.substring ( prefix.length ( ) , ( ( jarName.length ( ) ) - 4 ) ) ; } return defaultVersion ; }

Target:
private java.lang.String getVersion ( java.io.File jar , java.lang.String prefix , java.lang.String jarName , java.lang.String defaultVersion ) { if ( jarName.matches ( ( prefix + "([\\d\\.]+)\\.jar" ) ) ) { java.lang.String version = jarName.substring ( prefix.length ( ) , ( ( jarName.length ( ) ) - 4 ) ) ; if ( ! ( defaultVersion.equals ( version ) ) ) { mImporter.getSummary ( ) . reportGuessedVersion ( jar ) ; } return version ; } return defaultVersion ; }
Source:
void connect ( android.content.Context context ) { if ( ! ( mBound ) ) { android.content.Intent service = new android.content.Intent ( ) ; service.setComponent ( mComponentName ) ; mBound = context.bindServiceAsUser ( service , this , ( ( android.content.Context.BIND_AUTO_CREATE ) | ( android.content.Context.BIND_FOREGROUND_SERVICE ) ) , UserHandle.SYSTEM ) ; if ( ! ( mBound ) ) { android.util.Log.w ( com.android.server.NetworkScoreService.TAG , ( "Bind call failed for " + service ) ) ; } else { if ( com.android.server.NetworkScoreService.DBG ) android.util.Log.d ( com.android.server.NetworkScoreService.TAG , "ScoringServiceConnection bound." ) ; } } }

Target:
void connect ( android.content.Context context ) { if ( ! ( mBound ) ) { android.content.Intent service = new android.content.Intent ( android.net.NetworkScoreManager.ACTION_RECOMMEND_NETWORKS ) ; service.setComponent ( mComponentName ) ; mBound = context.bindServiceAsUser ( service , this , ( ( android.content.Context.BIND_AUTO_CREATE ) | ( android.content.Context.BIND_FOREGROUND_SERVICE ) ) , UserHandle.SYSTEM ) ; if ( ! ( mBound ) ) { android.util.Log.w ( com.android.server.NetworkScoreService.TAG , ( "Bind call failed for " + service ) ) ; } else { if ( com.android.server.NetworkScoreService.DBG ) android.util.Log.d ( com.android.server.NetworkScoreService.TAG , "ScoringServiceConnection bound." ) ; } } }
Source:
protected int beginMmsConnectivity ( ) throws java.io.IOException { createWakeLock ( ) ; int result = mConnMgr.startUsingNetworkFeature ( ConnectivityManager.TYPE_MOBILE , Phone.FEATURE_ENABLE_MMS ) ; if ( android.util.Log.isLoggable ( LogTag.TRANSACTION , Log.VERBOSE ) ) { android.util.Log.v ( com.android.mms.transaction.TransactionService.TAG , ( "beginMmsConnectivity: result=" + result ) ) ; } switch ( result ) { case com.android.internal.telephony.Phone.APN_ALREADY_ACTIVE : case com.android.internal.telephony.Phone.APN_REQUEST_STARTED : acquireWakeLock ( ) ; return result ; } throw new java.io.IOException ( "Cannot establish MMS connectivity" ) ; }

Target:
protected int beginMmsConnectivity ( ) throws java.io.IOException { createWakeLock ( ) ; int result = mConnMgr.startUsingNetworkFeature ( ConnectivityManager.TYPE_MOBILE , Phone.FEATURE_ENABLE_MMS ) ; if ( android.util.Log.isLoggable ( LogTag.TRANSACTION , Log.VERBOSE ) ) { android.util.Log.v ( com.android.mms.transaction.TransactionService.TAG , ( "beginMmsConnectivity: result=" + result ) ) ; } switch ( result ) { case com.android.internal.telephony.PhoneConstants.APN_ALREADY_ACTIVE : case com.android.internal.telephony.PhoneConstants.APN_REQUEST_STARTED : acquireWakeLock ( ) ; return result ; } throw new java.io.IOException ( "Cannot establish MMS connectivity" ) ; }
Source:
char [ ] getDigitsLocal ( ) { if ( ( digits ) != null ) { return digits ; } else { char [ ] digitArray = new char [ 10 ] ; for ( int i = 0 ; i < 10 ; i ++ ) { digitArray [ i ] = ( ( char ) ( ( zeroDigit ) + i ) ) ; } return digitArray ; } }

Target:
public void setGroupingSeparatorString ( java.lang.String groupingSeparatorString ) { if ( groupingSeparatorString == null ) { throw new java.lang.NullPointerException ( "The input grouping separator is null" ) ; } this . groupingSeparatorString = groupingSeparatorString ; if ( ( groupingSeparatorString.length ( ) ) == 1 ) { this . groupingSeparator = groupingSeparatorString.charAt ( 0 ) ; } else { this . groupingSeparator = android.icu.text.DecimalFormatSymbols.DEF_GROUPING_SEPARATOR ; } }