auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static boolean isDrawableFile ( java.lang.String name ) { return ( ( ( ( com.android.tools.lint.detector.api.LintUtils.endsWith ( name , com.android.SdkConstants.DOT_PNG ) ) || ( com.android.tools.lint.detector.api.LintUtils.endsWith ( name , com.android.SdkConstants.DOT_JPG ) ) ) || ( com.android.tools.lint.detector.api.LintUtils.endsWith ( name , com.android.SdkConstants.DOT_GIF ) ) ) || ( com.android.tools.lint.detector.api.LintUtils.endsWith ( name , com.android.SdkConstants.DOT_XML ) ) ) || ( com.android.tools.lint.detector.api.LintUtils.endsWith ( name , com.android.SdkConstants.DOT_JPEG ) ) ; }

Target:
private static boolean isDrawableFile ( java.lang.String name ) { return ( ( ( ( ( com.android.tools.lint.detector.api.LintUtils.endsWith ( name , com.android.SdkConstants.DOT_PNG ) ) || ( com.android.tools.lint.detector.api.LintUtils.endsWith ( name , com.android.SdkConstants.DOT_JPG ) ) ) || ( com.android.tools.lint.detector.api.LintUtils.endsWith ( name , com.android.SdkConstants.DOT_GIF ) ) ) || ( com.android.tools.lint.detector.api.LintUtils.endsWith ( name , com.android.SdkConstants.DOT_XML ) ) ) || ( com.android.tools.lint.detector.api.LintUtils.endsWith ( name , com.android.SdkConstants.DOT_JPEG ) ) ) || ( com.android.tools.lint.detector.api.LintUtils.endsWith ( name , com.android.SdkConstants.DOT_WEBP ) ) ; }
Source:
private void mergeAnnotationsXml ( @ com.android.annotations.NonNull java.lang.String xml ) { try { org.w3c.dom.Document document = com.android.utils.XmlUtils.parseDocument ( xml , false ) ; mergeDocument ( document ) ; } catch ( java.lang.Exception e ) { com.android.build.gradle.tasks.annotations.Extractor.warning ( e.toString ( ) ) ; } }

Target:
private void mergeAnnotationsXml ( @ com.android.annotations.NonNull java.lang.String path , @ com.android.annotations.NonNull java.lang.String xml ) { try { org.w3c.dom.Document document = com.android.utils.XmlUtils.parseDocument ( xml , false ) ; mergeDocument ( document ) ; } catch ( java.lang.Exception e ) { com.android.build.gradle.tasks.annotations.Extractor.warning ( ( ( ( "Failed to merge " + path ) + ": " ) + ( e.toString ( ) ) ) ) ; if ( ! ( e instanceof java.io.IOException ) ) { e.printStackTrace ( ) ; } } }
Source:
public void err ( @ com.android.annotations.Nullable java.lang.String line ) { if ( line != null ) { mLogger.warning ( "AAPT warning(%1$s): %2$s" , mJob , line ) ; } }

Target:
public void err ( @ com.android.annotations.Nullable java.lang.String line ) { if ( line != null ) { mLogger.verbose ( "AAPT warning(%1$s), Job(%2$s): %3$s" , mOwner.getProcess ( ) . hashCode ( ) , mJob , line ) ; mLogger.warning ( "AAPT: %3$s" , mOwner.getProcess ( ) . hashCode ( ) , mJob , line ) ; } }
Source:
public void loggedRun ( ) { synchronized ( mLock ) { if ( mPendingCallsToDisconnect.remove ( call ) ) { android.telecom.Log.i ( this , "Delayed disconnection of call: %s" , call ) ; call.disconnect ( ) ; } } }

Target:
public boolean onCanceledViaNewOutgoingCallBroadcast ( final com.android.server.telecom.Call call ) { mPendingCallsToDisconnect.add ( call ) ; mHandler.postDelayed ( new java.lang.Runnable ( "CM.oCVNOCB" , mLock ) { @ java.lang.Override public void loggedRun ( ) { if ( mPendingCallsToDisconnect.remove ( call ) ) { android.telecom.Log.i ( this , "Delayed disconnection of call: %s" , call ) ; call.disconnect ( ) ; } } } . prepare ( ) , com.android.server.telecom.Timeouts.getNewOutgoingCallCancelMillis ( mContext.getContentResolver ( ) ) ) ; return true ; }
Source:
private static boolean isUnsupported ( java.security.KeyStore ks ) { return ( ( ( libcore.java.security.StandardNames.IS_RI ) && ( ks.getProvider ( ) . getName ( ) . equals ( "BC" ) ) ) || ( "AndroidKeyStore" . equalsIgnoreCase ( ks.getType ( ) ) ) ) || ( "TimaKeyStore" . equalsIgnoreCase ( ks.getType ( ) ) ) ; }

Target:
private static boolean isUnsupported ( java.security.KeyStore ks ) { return ( ( ( ( libcore.java.security.StandardNames.IS_RI ) && ( ks.getProvider ( ) . getName ( ) . equals ( "BC" ) ) ) || ( "AndroidKeyStore" . equalsIgnoreCase ( ks.getType ( ) ) ) ) || ( "TimaKeyStore" . equalsIgnoreCase ( ks.getType ( ) ) ) ) || ( "KnoxAndroidKeyStore" . equalsIgnoreCase ( ks.getType ( ) ) ) ; }
Source:
public void testNotRegistered ( ) throws java.lang.Exception { assertEquals ( ( "" + ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "src/test/pkg/MyApplication.java:5: Warning: The <application> test.pkg.MyApplication is not registered in the manifest [Registered]\n" + "public class MyApplication extends Application {\n" ) + " ~~~~~~~~~~~~~\n" ) + "src/test/pkg/TestActivity.java:3: Warning: The <activity> test.pkg.TestActivity is not registered in the manifest [Registered]\n" ) + "public class TestActivity 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, 5 warnings\n" ) ) , lintProject ( mApplication , mTestActivity , mTestService , mTestProvider , mTestProvider2 , mTestReceiver ) ) ; }

Target:
public void testNotRegistered ( ) throws java.lang.Exception { assertEquals ( ( "" + ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "src/test/pkg/MyApplication.java:5: Warning: The <application> test.pkg.MyApplication is not registered in the manifest [Registered]\n" + "public class MyApplication extends Application {\n" ) + " ~~~~~~~~~~~~~\n" ) + "src/test/pkg/TestActivity.java:3: Warning: The <activity> test.pkg.TestActivity is not registered in the manifest [Registered]\n" ) + "public class TestActivity 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, 5 warnings\n" ) ) , lintProject ( mApplication , mTestActivity , mTestService , mTestProvider , mTestProvider2 , mTestReceiver , mSuppressedApplication ) ) ; }
Source:
public java.lang.String iccTransmitApduBasicChannel ( int cla , int instruction , int p1 , int p2 , int p3 , java.lang.String data ) { try { com.android.internal.telephony.ITelephony telephony = getITelephony ( ) ; if ( telephony != null ) return telephony.iccTransmitApduBasicChannel ( cla , instruction , p1 , p2 , p3 , data ) ; } catch ( android.os.RemoteException ex ) { } catch ( java.lang.NullPointerException ex ) { } return "" ; }

Target:
public byte [ ] iccExchangeSimIO ( int fileID , int command , int p1 , int p2 , int p3 , java.lang.String filePath ) { return iccExchangeSimIO ( getSubId ( ) , fileID , command , p1 , p2 , p3 , filePath ) ; }
Source:
public void testMergeWrite ( ) throws java.lang.Exception { com.android.builder.resources.AssetMerger merger = com.android.builder.resources.AssetMergerTest.getAssetMerger ( ) ; java.io.File folder = com.android.builder.resources.AssetMergerTest.getWrittenResources ( ) ; com.android.builder.resources.AssetSet writtenSet = new com.android.builder.resources.AssetSet ( "unused" ) ; writtenSet.addSource ( folder ) ; writtenSet.loadFromFiles ( ) ; compareResourceMaps ( merger , writtenSet , false ) ; }

Target:
public void testMergeWrite ( ) throws java.lang.Exception { com.android.builder.resources.AssetMerger merger = com.android.builder.resources.AssetMergerTest.getAssetMerger ( ) ; java.io.File folder = com.android.builder.resources.AssetMergerTest.getWrittenResources ( ) ; com.android.builder.resources.RecordingLogger logger = new com.android.builder.resources.RecordingLogger ( ) ; com.android.builder.resources.AssetSet writtenSet = new com.android.builder.resources.AssetSet ( "unused" ) ; writtenSet.addSource ( folder ) ; writtenSet.loadFromFiles ( logger ) ; checkLogger ( logger ) ; compareResourceMaps ( merger , writtenSet , false ) ; }
Source:
public static java.lang.String getGMSVersionCode ( android.content.Context context ) { java.lang.String msg = "gms versionCode not available." ; try { android.content.pm.PackageManager packageManager = context.getPackageManager ( ) ; android.content.pm.PackageInfo packageInfo = packageManager.getPackageInfo ( "com.google.android.gms" , 0 ) ; msg = java.lang.Integer.toString ( packageInfo.versionCode ) ; } catch ( android.content.pm.PackageManager.NameNotFoundException e ) { org.chromium.base.Log.d ( org.chromium.base.BuildInfo.TAG , "GMS package is not found." , e ) ; } return msg ; }

Target:
public static java.lang.String getGMSVersionCode ( android.content.Context context ) { java.lang.String msg = "gms versionCode not available." ; try { android.content.pm.PackageManager packageManager = context.getPackageManager ( ) ; android.content.pm.PackageInfo packageInfo = packageManager.getPackageInfo ( "com.google.android.gms" , 0 ) ; msg = java.lang.Integer.toString ( packageInfo.versionCode ) ; } catch ( android.content.pm.PackageManager.NameNotFoundException e ) { android.util.Log.d ( org.chromium.base.BuildInfo.TAG , "GMS package is not found: %s" , e ) ; } return msg ; }
Source:
public void setVideoProvider ( java.lang.String callId , com.android.internal.telecom.IVideoProvider videoProvider ) { android.telecom.Log.startSession ( "CSW.sVP" ) ; long token = android.os.Binder.clearCallingIdentity ( ) ; try { synchronized ( mLock ) { logIncoming ( "setVideoProvider %s" , callId ) ; com.android.server.telecom.Call call = mCallIdMapper.getCall ( callId ) ; if ( call != null ) { call.setVideoProvider ( videoProvider ) ; } } } finally { android.os.Binder.restoreCallingIdentity ( token ) ; android.telecom.Log.endSession ( ) ; } }

Target:
public void setVideoProvider ( java.lang.String callId , com.android.internal.telecom.IVideoProvider videoProvider , android.telecom.Logging.Session.Info sessionInfo ) { android.telecom.Log.startSession ( sessionInfo , "CSW.sVP" ) ; long token = android.os.Binder.clearCallingIdentity ( ) ; try { synchronized ( mLock ) { logIncoming ( "setVideoProvider %s" , callId ) ; com.android.server.telecom.Call call = mCallIdMapper.getCall ( callId ) ; if ( call != null ) { call.setVideoProvider ( videoProvider ) ; } } } finally { android.os.Binder.restoreCallingIdentity ( token ) ; android.telecom.Log.endSession ( ) ; } }
Source:
static void cancelCurrentJobs ( boolean wait ) { org.eclipse.core.runtime.jobs.Job [ ] currentJobs = com.android.ide.eclipse.adt.internal.lint.EclipseLintRunner.getCurrentJobs ( ) ; for ( org.eclipse.core.runtime.jobs.Job job : currentJobs ) { job.cancel ( ) ; } if ( wait ) { for ( org.eclipse.core.runtime.jobs.Job job : currentJobs ) { try { job.join ( ) ; } catch ( java.lang.InterruptedException e ) { com.android.ide.eclipse.adt.AdtPlugin.log ( e , null ) ; } } } }

Target:
static void cancelCurrentJobs ( boolean wait ) { org.eclipse.core.runtime.jobs.Job [ ] currentJobs = com.android.ide.eclipse.adt.internal.lint.LintJob.getCurrentJobs ( ) ; for ( org.eclipse.core.runtime.jobs.Job job : currentJobs ) { job.cancel ( ) ; } if ( wait ) { for ( org.eclipse.core.runtime.jobs.Job job : currentJobs ) { try { job.join ( ) ; } catch ( java.lang.InterruptedException e ) { com.android.ide.eclipse.adt.AdtPlugin.log ( e , null ) ; } } } }
Source:
public static java.util.Date getDate ( android.security.keymaster.KeyCharacteristics keyCharacteristics , int tag ) { java.util.Date result = keyCharacteristics.hwEnforced.getDate ( tag , null ) ; if ( result == null ) { result = keyCharacteristics.swEnforced.getDate ( tag , null ) ; } return result ; }

Target:
public static java.lang.String getJcaBlockModeFromKeymasterBlockMode ( int keymasterBlockMode ) { switch ( keymasterBlockMode ) { case android.security.keymaster.KeymasterDefs.KM_MODE_ECB : return "ECB" ; case android.security.keymaster.KeymasterDefs.KM_MODE_CBC : return "CBC" ; case android.security.keymaster.KeymasterDefs.KM_MODE_CTR : return "CTR" ; case android.security.keymaster.KeymasterDefs.KM_MODE_GCM : return "GCM" ; default : throw new java.lang.IllegalArgumentException ( ( "Unsupported block mode: " + keymasterBlockMode ) ) ; } }
Source:
private boolean isSupportedDevice ( ) throws java.lang.Exception { final java.lang.String featureList = getDevice ( ) . executeShellCommand ( "pm list features" ) ; if ( ( featureList.contains ( "feature:android.hardware.type.watch\n" ) ) || ( featureList.contains ( "feature:android.hardware.type.television\n" ) ) ) { return false ; } else { return true ; } }

Target:
private boolean isSupportedDevice ( ) throws java.lang.Exception { final java.lang.String featureList = getDevice ( ) . executeShellCommand ( "pm list features" ) ; return featureList.contains ( "feature:android.software.device_admin\n" ) ; }
Source:
private java.lang.String describe ( java.lang.String tag , java.lang.String message ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( ) ; if ( tag != null ) { sb.append ( tag ) ; } if ( message != null ) { if ( ( sb.length ( ) ) > 0 ) { sb.append ( ": " ) ; } sb.append ( message ) ; } return sb.toString ( ) ; }

Target:
private void addTag ( java.lang.String tag ) { if ( tag != null ) { if ( ( mTags ) == null ) { mTags = new java.util.ArrayList < java.lang.String > ( ) ; } mTags.add ( tag ) ; } }
Source:
public static void sendOptionsResponse ( java.lang.String allowHeaders , org.jetbrains.io.HttpRequest request , io.netty.channel.ChannelHandlerContext context ) { org.jetbrains.io.HttpResponse response = org.jetbrains.io.Responses.response ( HttpResponseStatus.OK ) ; response.headers ( ) . set ( org.jetbrains.io.ACCESS_CONTROL_ALLOW_METHODS , allowHeaders ) ; response.headers ( ) . set ( org.jetbrains.io.ALLOW , allowHeaders ) ; org.jetbrains.io.Responses.send ( response , context.channel ( ) , request ) ; }

Target:
public static void sendOptionsResponse ( java.lang.String allowHeaders , org.jetbrains.io.HttpRequest request , io.netty.channel.ChannelHandlerContext context ) { org.jetbrains.io.HttpResponse response = org.jetbrains.io.Responses.response ( HttpResponseStatus.OK ) ; response.headers ( ) . set ( HttpHeaders.Names.ACCESS_CONTROL_ALLOW_METHODS , allowHeaders ) ; response.headers ( ) . set ( HttpHeaders.Names.ALLOW , allowHeaders ) ; org.jetbrains.io.Responses.send ( response , context.channel ( ) , request ) ; }
Source:
public java.lang.String getFileName ( ) { return ( mFileNameTextField ) == null ? "" : mFileNameTextField.getText ( ) ; }

Target:
public java.lang.String getFileName ( ) { java.lang.String fileName ; if ( ( mFileNameTextField ) == null ) { fileName = "" ; } else { fileName = mFileNameTextField.getText ( ) . trim ( ) ; if ( ( ( fileName.length ( ) ) > 0 ) && ( ( fileName.indexOf ( '.' ) ) == ( - 1 ) ) ) { fileName = fileName + ( com.android.ide.eclipse.adt.AndroidConstants.DOT_XML ) ; } } return fileName ; }
Source:
public java.lang.String describeFirstNonRequestableCapability ( ) { if ( hasCapability ( android.net.NetworkCapabilities.NET_CAPABILITY_VALIDATED ) ) return "NET_CAPABILITY_VALIDATED" ; if ( hasCapability ( android.net.NetworkCapabilities.NET_CAPABILITY_CAPTIVE_PORTAL ) ) return "NET_CAPABILITY_CAPTIVE_PORTAL" ; if ( hasCapability ( android.net.NetworkCapabilities.NET_CAPABILITY_FOREGROUND ) ) return "NET_CAPABILITY_FOREGROUND" ; if ( ( ( mNetworkCapabilities ) & ( android.net.NetworkCapabilities.NON_REQUESTABLE_CAPABILITIES ) ) != 0 ) { return "unknown non-requestable capabilities " + ( java.lang.Long.toHexString ( mNetworkCapabilities ) ) ; } if ( ( ( mLinkUpBandwidthKbps ) != 0 ) || ( ( mLinkDownBandwidthKbps ) != 0 ) ) return "link bandwidth" ; if ( hasSignalStrength ( ) ) return "signalStrength" ; return null ; }

Target:
public android.net.NetworkCapabilities setSingleUid ( int uid ) { final android.util.ArraySet < android.net.UidRange > identity = new android.util.ArraySet ( 1 ) ; identity.add ( new android.net.UidRange ( uid , uid ) ) ; setUids ( identity ) ; return this ; }
Source:
public void run ( ) { new android.app.AlertDialog.Builder ( this ) . setTitle ( android.R.string.dialog_alert_title ) . setIconAttribute ( android.R.attr.alertDialogIcon ) . setMessage ( message ) . setPositiveButton ( R.string.alert_dialog_ok , null ) . show ( ) ; }

Target:
public android.app.Dialog onCreateDialog ( android.os.Bundle savedInstanceState ) { java.lang.String message = getArguments ( ) . getString ( com.android.services.telephony.sip.SipEditor.AlertDialogFragment.KEY_MESSAGE ) ; return new android.app.AlertDialog.Builder ( getActivity ( ) ) . setTitle ( android.R.string.dialog_alert_title ) . setIconAttribute ( android.R.attr.alertDialogIcon ) . setMessage ( message ) . setPositiveButton ( R.string.alert_dialog_ok , null ) . create ( ) ; }
Source:
public void destroyBottomActionView ( ) { if ( ( bottomActionView ) == null ) { return ; } bottomActionView.animate ( ) . alpha ( 0.0F ) . setInterpolator ( new android.view.animation.LinearInterpolator ( ) ) . setDuration ( com.android.newbubble.BottomActionViewController.HIDE_TARGET_DURATION ) . withEndAction ( ( ) -> { windowManager.removeViewImmediate ( bottomActionView ) ; bottomActionView = null ; } ) . start ( ) ; }

Target:
public void destroyBottomActionView ( ) { if ( ( bottomActionView ) == null ) { return ; } bottomActionView.animate ( ) . alpha ( 0.0F ) . setInterpolator ( new android.view.animation.LinearInterpolator ( ) ) . setDuration ( com.android.newbubble.BottomActionViewController.SHOW_HIDE_TARGET_DURATION ) . withEndAction ( ( ) -> { windowManager.removeViewImmediate ( bottomActionView ) ; bottomActionView = null ; } ) . start ( ) ; }
Source:
public com.android.incallui.rtt.impl.RttChatMessageViewHolder onCreateViewHolder ( android.view.ViewGroup parent , int viewType ) { android.view.LayoutInflater layoutInflater = android.view.LayoutInflater.from ( context ) ; android.view.View view = layoutInflater.inflate ( R.layout.rtt_chat_list_item , parent , false ) ; return new com.android.incallui.rtt.impl.RttChatMessageViewHolder ( view ) ; }

Target:
public android.support.v7.widget.RecyclerView.ViewHolder onCreateViewHolder ( android.view.ViewGroup parent , @ com.android.incallui.rtt.impl.RttChatAdapter.RowType int viewType ) { android.view.LayoutInflater layoutInflater = android.view.LayoutInflater.from ( context ) ; switch ( viewType ) { case com.android.incallui.rtt.impl.RttChatAdapter.RowType.ADVISORY : android.view.View view = layoutInflater.inflate ( R.layout.rtt_transcript_advisory , parent , false ) ; return new com.android.incallui.rtt.impl.AdvisoryViewHolder ( view ) ; case com.android.incallui.rtt.impl.RttChatAdapter.RowType.MESSAGE : view = layoutInflater.inflate ( R.layout.rtt_chat_list_item , parent , false ) ; return new com.android.incallui.rtt.impl.RttChatMessageViewHolder ( view ) ; default : throw new java.lang.RuntimeException ( "Unknown row type." ) ; } }
Source:
synchronized void nAllocationData1D ( long id , int off , int mip , int count , int [ ] d , int sizeBytes ) { validate ( ) ; rsnAllocationData1D ( mContext , id , off , mip , count , d , sizeBytes ) ; }

Target:
synchronized void nAllocationData1D ( long id , int off , int mip , int count , java.lang.Object d , int sizeBytes , android.support.v8.renderscript.Element.DataType dt , int mSize , boolean usePadding ) { validate ( ) ; rsnAllocationData1D ( mContext , id , off , mip , count , d , sizeBytes , dt.mID , mSize , usePadding ) ; }
Source:
private static org.eclipse.swt.graphics.Font getFont ( int size , boolean bold ) { org.eclipse.swt.graphics.Font systemFont = org.eclipse.swt.widgets.Display.getDefault ( ) . getSystemFont ( ) ; org.eclipse.swt.graphics.FontData [ ] fontData = systemFont.getFontData ( ) ; for ( int i = 0 ; i < ( fontData.length ) ; i ++ ) { fontData [ i ] . setHeight ( size ) ; if ( bold ) { fontData [ i ] . setStyle ( SWT.BOLD ) ; } } return new org.eclipse.swt.graphics.Font ( org.eclipse.swt.widgets.Display.getDefault ( ) , fontData ) ; }

Target:
private static org.eclipse.swt.graphics.Font getFont ( int size , boolean bold ) { org.eclipse.swt.graphics.FontData [ ] fontData = com.android.hierarchyviewerlib.ui.TreeView.systemFont.getFontData ( ) ; for ( int i = 0 ; i < ( fontData.length ) ; i ++ ) { fontData [ i ] . setHeight ( size ) ; if ( bold ) { fontData [ i ] . setStyle ( SWT.BOLD ) ; } } return new org.eclipse.swt.graphics.Font ( org.eclipse.swt.widgets.Display.getDefault ( ) , fontData ) ; }
Source:
public boolean p2pCancelConnect ( ) { if ( ( com.android.server.wifi.WifiNative.HIDL_ENABLE ) && ( ( mSupplicantP2pIfaceHal ) != null ) ) { return mSupplicantP2pIfaceHal.cancelConnect ( ) ; } else { return doBooleanCommand ( "P2P_CANCEL" ) ; } }

Target:
public boolean p2pExtListen ( boolean enable , int period , int interval ) { if ( enable && ( interval < period ) ) { return false ; } if ( ( com.android.server.wifi.WifiNative.HIDL_P2P_ENABLE ) && ( ( mSupplicantP2pIfaceHal ) != null ) ) { return mSupplicantP2pIfaceHal.configureExtListen ( enable , period , interval ) ; } else { return doBooleanCommand ( ( "P2P_EXT_LISTEN" + ( enable ? ( ( " " + period ) + " " ) + interval : "" ) ) ) ; } }
Source:
public void anqpResponseFailure ( ) throws java.lang.Exception { com.android.server.wifi.hotspot2.ANQPNetworkKey anqpKey = com.android.server.wifi.hotspot2.ANQPNetworkKey.buildKey ( com.android.server.wifi.hotspot2.PasspointManagerTest.TEST_SSID , com.android.server.wifi.hotspot2.PasspointManagerTest.TEST_BSSID , com.android.server.wifi.hotspot2.PasspointManagerTest.TEST_HESSID , com.android.server.wifi.hotspot2.PasspointManagerTest.TEST_ANQP_DOMAIN_ID ) ; com.android.server.wifi.ScanDetail scanDetail = createMockScanDetail ( ) ; org.mockito.Mockito.when ( mAnqpRequestManager.onRequestCompleted ( com.android.server.wifi.hotspot2.PasspointManagerTest.TEST_BSSID , false ) ) . thenReturn ( scanDetail ) ; mCallbacks.onANQPResponse ( com.android.server.wifi.hotspot2.PasspointManagerTest.TEST_BSSID , null ) ; org.mockito.Mockito.verify ( mAnqpCache , org.mockito.Mockito.never ( ) ) . addEntry ( org.mockito.Mockito.any ( com.android.server.wifi.hotspot2.ANQPNetworkKey.class ) , org.mockito.Mockito.anyMap ( ) ) ; }

Target:
public void anqpResponseFailure ( ) throws java.lang.Exception { org.mockito.Mockito.when ( mAnqpRequestManager.onRequestCompleted ( com.android.server.wifi.hotspot2.PasspointManagerTest.TEST_BSSID , false ) ) . thenReturn ( com.android.server.wifi.hotspot2.PasspointManagerTest.TEST_ANQP_KEY ) ; mCallbacks.onANQPResponse ( com.android.server.wifi.hotspot2.PasspointManagerTest.TEST_BSSID , null ) ; org.mockito.Mockito.verify ( mAnqpCache , org.mockito.Mockito.never ( ) ) . addEntry ( org.mockito.Mockito.any ( com.android.server.wifi.hotspot2.ANQPNetworkKey.class ) , org.mockito.Mockito.anyMap ( ) ) ; }
Source:
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 e ) { } serverChannel.close ( ) ; try { gotSocket.accept ( ) ; fail ( "Should throw an IllegalBlockingModeException" ) ; } catch ( java.nio.channels.IllegalBlockingModeException e ) { } }

Target:
public void test_socket_accept_Nonblocking_NotBound ( ) throws java.io.IOException { java.net.ServerSocket gotSocket = serverChannel.socket ( ) ; serverChannel.configureBlocking ( false ) ; 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 static int toKeymaster ( int padding ) { switch ( padding ) { case android.security.KeyStoreKeyConstraints.Padding.NONE : return android.security.keymaster.KeymasterDefs.KM_PAD_NONE ; case android.security.KeyStoreKeyConstraints.Padding.PKCS7 : return android.security.keymaster.KeymasterDefs.KM_PAD_PKCS7 ; default : throw new java.lang.IllegalArgumentException ( ( "Unknown padding: " + padding ) ) ; } }

Target:
public static int toKeymaster ( int padding ) { switch ( padding ) { case android.security.KeyStoreKeyConstraints.Padding.NONE : return android.security.keymaster.KeymasterDefs.KM_PAD_NONE ; case android.security.KeyStoreKeyConstraints.Padding.PKCS7 : return android.security.keymaster.KeymasterDefs.KM_PAD_PKCS7 ; case android.security.KeyStoreKeyConstraints.Padding.RSA_PKCS1_ENCRYPTION : return android.security.keymaster.KeymasterDefs.KM_PAD_RSA_PKCS1_1_5_ENCRYPT ; case android.security.KeyStoreKeyConstraints.Padding.RSA_PKCS1_SIGNATURE : return android.security.keymaster.KeymasterDefs.KM_PAD_RSA_PKCS1_1_5_SIGN ; case android.security.KeyStoreKeyConstraints.Padding.RSA_OAEP : return android.security.keymaster.KeymasterDefs.KM_PAD_RSA_OAEP ; case android.security.KeyStoreKeyConstraints.Padding.RSA_PSS : return android.security.keymaster.KeymasterDefs.KM_PAD_RSA_PSS ; default : throw new java.lang.IllegalArgumentException ( ( "Unknown padding: " + padding ) ) ; } }
Source:
public void testJackArchiveToDexDir ( ) throws java.lang.Exception { java.io.File jackAr = createJackArchiveWithResources ( ) ; java.io.File dexDir = com.android.jack.TestTools.createTempDir ( "resourcetestdex" , "dir" ) ; com.android.jack.TestTools.compileJackToDex ( new com.android.jack.Options ( ) , jackAr , dexDir , false ) ; checkResourceContent ( dexDir , com.android.jack.ResourceTest.RESOURCE1_LONGPATH , "Res1" ) ; checkResourceContent ( dexDir , com.android.jack.ResourceTest.RESOURCE2_LONGPATH , "Res2" ) ; checkResourceContent ( dexDir , com.android.jack.ResourceTest.RESOURCE3_LONGPATH , "Res3" ) ; checkResourceContent ( dexDir , com.android.jack.ResourceTest.RESOURCE4_LONGPATH , "Res4" ) ; }

Target:
public void testJackArchiveToDexArchive ( ) throws java.lang.Exception { java.io.File jackAr = createJackArchiveWithResources ( ) ; java.io.File dexAr = com.android.jack.TestTools.createTempFile ( "resourcetestdex" , ".zip" ) ; com.android.jack.TestTools.compileJackToDex ( new com.android.jack.Options ( ) , jackAr , dexAr , true ) ; java.util.zip.ZipFile zipFile = new java.util.zip.ZipFile ( dexAr ) ; checkResourceContentFromZip ( zipFile , com.android.jack.ResourceTest.RESOURCE1_SHORTPATH , "Res1" , false ) ; checkResourceContentFromZip ( zipFile , com.android.jack.ResourceTest.RESOURCE2_SHORTPATH , "Res2" , false ) ; checkResourceContentFromZip ( zipFile , com.android.jack.ResourceTest.RESOURCE3_SHORTPATH , "Res3" , false ) ; checkResourceContentFromZip ( zipFile , com.android.jack.ResourceTest.RESOURCE4_SHORTPATH , "Res4" , false ) ; }
Source:
protected void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; mActivity = getActivity ( ) ; mInstrumentation = getInstrumentation ( ) ; mWelcomeTextView = ( ( android.widget.TextView ) ( mActivity.findViewById ( R.id.welcome ) ) ) ; mWelcomeText = mActivity.getString ( R.string.welcome_text ) ; mContinueButton = ( ( android.widget.Button ) ( mActivity.findViewById ( R.id.continue_button ) ) ) ; mContinueText = mActivity.getString ( R.string.continue_button_text ) ; }

Target:
protected void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; mActivity = getActivity ( ) ; mInstrumentation = getInstrumentation ( ) ; mWelcomeTextView = ( ( android.widget.TextView ) ( mActivity.findViewById ( R.id.welcome_text ) ) ) ; mWelcomeText = mActivity.getString ( R.string.welcome_text ) ; mContinueButton = ( ( android.widget.Button ) ( mActivity.findViewById ( R.id.continue_button ) ) ) ; mContinueText = mActivity.getString ( R.string.continue_button_text ) ; }
Source:
public void log ( java.util.logging.Level level , java.lang.String msg , java.lang.Object [ ] params ) { if ( ( ( level.intValue ( ) ) < ( levelValue ) ) || ( ( levelValue ) == ( java.util.logging.Logger.offValue ) ) ) { return ; } java.util.logging.LogRecord lr = new java.util.logging.LogRecord ( level , msg ) ; lr.setParameters ( params ) ; doLog ( lr ) ; }

Target:
private void doLog ( java.util.logging.LogRecord lr ) { lr.setLoggerName ( name ) ; final java.util.logging.Logger.LoggerBundle lb = getEffectiveLoggerBundle ( ) ; final java.util.ResourceBundle bundle = lb.userBundle ; final java.lang.String ebname = lb.resourceBundleName ; if ( ( ebname != null ) && ( bundle != null ) ) { lr.setResourceBundleName ( ebname ) ; lr.setResourceBundle ( bundle ) ; } log ( lr ) ; }
Source:
public void restoreconAppData ( java.lang.String uuid , java.lang.String packageName , int userId , int flags , int appId , java.lang.String seInfo ) throws com.android.internal.os.InstallerConnection.InstallerException { if ( ! ( checkBeforeRemote ( ) ) ) return ; try { mInstalld.restoreconAppData ( uuid , packageName , userId , flags , appId , seInfo ) ; } catch ( android.os.RemoteException | android.os.ServiceSpecificException e ) { throw new com.android.internal.os.InstallerConnection.InstallerException ( e.getMessage ( ) ) ; } }

Target:
public void restoreconAppData ( java.lang.String uuid , java.lang.String packageName , int userId , int flags , int appId , java.lang.String seInfo ) throws com.android.server.pm.Installer.InstallerException { if ( ! ( checkBeforeRemote ( ) ) ) return ; try { mInstalld.restoreconAppData ( uuid , packageName , userId , flags , appId , seInfo ) ; } catch ( android.os.RemoteException | android.os.ServiceSpecificException e ) { throw com.android.server.pm.Installer.InstallerException.from ( e ) ; } }
Source:
public void run ( ) { java.util.ArrayList < org.apache.harmony.jpda.tests.jdwp.ReferenceType.MockClass > reachableObjs = new java.util.ArrayList < org.apache.harmony.jpda.tests.jdwp.ReferenceType.MockClass > ( ) ; for ( int i = 0 ; i < ( org.apache.harmony.jpda.tests.jdwp.ReferenceType.InstancesDebuggee.reachableObjNum ) ; i ++ ) { reachableObjs.add ( new org.apache.harmony.jpda.tests.jdwp.ReferenceType.MockClass ( true ) ) ; } for ( int i = 0 ; i < ( org.apache.harmony.jpda.tests.jdwp.ReferenceType.InstancesDebuggee.unreachableObjNum ) ; i ++ ) { new org.apache.harmony.jpda.tests.jdwp.ReferenceType.MockClass ( false ) ; } synchronizer.sendMessage ( JPDADebuggeeSynchronizer.SGNL_READY ) ; logWriter.println ( "--> Debuggee: InstancesDebuggee..." ) ; synchronizer.receiveMessage ( JPDADebuggeeSynchronizer.SGNL_CONTINUE ) ; }

Target:
private static void allocateReachableObjects ( java.util.ArrayList < org.apache.harmony.jpda.tests.jdwp.ReferenceType.MockClass > reachableObjs ) { for ( int i = 0 ; i < ( org.apache.harmony.jpda.tests.jdwp.ReferenceType.InstancesDebuggee.reachableObjNum ) ; i ++ ) { reachableObjs.add ( new org.apache.harmony.jpda.tests.jdwp.ReferenceType.MockClass ( true ) ) ; } }
Source:
protected void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; mActivity = getActivity ( ) ; mWelcomeTextView = ( ( android.widget.TextView ) ( mActivity.findViewById ( R.id.welcome ) ) ) ; mWelcomeText = mActivity.getString ( R.string.welcome_text ) ; }

Target:
protected void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; mActivity = getActivity ( ) ; mInstrumentation = getInstrumentation ( ) ; mWelcomeTextView = ( ( android.widget.TextView ) ( mActivity.findViewById ( R.id.welcome ) ) ) ; mWelcomeText = mActivity.getString ( R.string.welcome_text ) ; mContinueButton = ( ( android.widget.Button ) ( mActivity.findViewById ( R.id.continue_button ) ) ) ; mContinueText = mActivity.getString ( R.string.continue_button_text ) ; }
Source:
public java.lang.String getNewName ( @ javax.annotation.Nonnull java.lang.String oldName ) { java.lang.String newName = nameProvider.getNewName ( oldName ) ; while ( names.contains ( newName ) ) { newName = nameProvider.getNewName ( oldName ) ; } names.add ( newName ) ; return newName ; }

Target:
public java.lang.String getNewName ( @ javax.annotation.Nonnull java.lang.String oldName ) { java.lang.String newName = nameProvider.getNewName ( oldName ) ; while ( names.contains ( newName ) ) { java.lang.String candidate = nameProvider.getNewName ( oldName ) ; assert ! ( candidate.equals ( newName ) ) ; newName = candidate ; } names.add ( newName ) ; return newName ; }
Source:
public void test_toPattern ( ) { java.text.DecimalFormat format = new java.text.DecimalFormat ( ) ; format.applyPattern ( "#.#" ) ; assertEquals ( "Wrong pattern 1" , "0.#" , format.toPattern ( ) ) ; format.applyPattern ( "#." ) ; assertEquals ( "Wrong pattern 2" , "0." , format.toPattern ( ) ) ; format.applyPattern ( "#" ) ; assertEquals ( "Wrong pattern 3" , "0" , format.toPattern ( ) ) ; format.applyPattern ( ".#" ) ; assertEquals ( "Wrong pattern 4" , "#.0" , format.toPattern ( ) ) ; }

Target:
public void test_toPattern ( ) { java.text.DecimalFormat format = new java.text.DecimalFormat ( ) ; format.applyPattern ( "#.#" ) ; assertEquals ( "Wrong pattern 1" , "#0.#" , format.toPattern ( ) ) ; format.applyPattern ( "#." ) ; assertEquals ( "Wrong pattern 2" , "#0." , format.toPattern ( ) ) ; format.applyPattern ( "#" ) ; assertEquals ( "Wrong pattern 3" , "#" , format.toPattern ( ) ) ; format.applyPattern ( ".#" ) ; assertEquals ( "Wrong pattern 4" , "#.0" , format.toPattern ( ) ) ; }
Source:
public void erase ( ) { javacard.framework.JCSystem.beginTransaction ( ) ; com.android.weaver.core.CoreSlots.Slot.arrayFill ( mKey , ( ( short ) ( 0 ) ) , Consts.SLOT_KEY_BYTES , ( ( byte ) ( 0 ) ) ) ; com.android.weaver.core.CoreSlots.Slot.arrayFill ( mValue , ( ( short ) ( 0 ) ) , Consts.SLOT_VALUE_BYTES , ( ( byte ) ( 0 ) ) ) ; mFailureCount = 0 ; javacard.framework.JCSystem.commitTransaction ( ) ; }

Target:
public void erase ( ) { javacard.framework.JCSystem.beginTransaction ( ) ; com.android.weaver.core.CoreSlots.Slot.arrayFill ( mKey , ( ( short ) ( 0 ) ) , Consts.SLOT_KEY_BYTES , ( ( byte ) ( 0 ) ) ) ; com.android.weaver.core.CoreSlots.Slot.arrayFill ( mValue , ( ( short ) ( 0 ) ) , Consts.SLOT_VALUE_BYTES , ( ( byte ) ( 0 ) ) ) ; mFailureCount = 0 ; mBackoffTimer.stopTimer ( ) ; javacard.framework.JCSystem.commitTransaction ( ) ; }
Source:
private int getNewSpiResourceId ( int direction , java.lang.String remoteAddress , int returnSpi ) throws java.lang.Exception { org.mockito.Mockito.when ( mMockNetd.ipSecAllocateSpi ( org.mockito.Matchers.anyInt ( ) , org.mockito.Matchers.anyInt ( ) , org.mockito.Matchers.anyString ( ) , org.mockito.Matchers.anyString ( ) , org.mockito.Matchers.anyInt ( ) ) ) . thenReturn ( returnSpi ) ; android.net.IpSecSpiResponse spi = mIpSecService.reserveSecurityParameterIndex ( direction , android.net.NetworkUtils.numericToInetAddress ( remoteAddress ) . getHostAddress ( ) , IpSecManager.INVALID_SECURITY_PARAMETER_INDEX , new android.os.Binder ( ) ) ; return spi.resourceId ; }

Target:
private int getNewSpiResourceId ( java.lang.String remoteAddress , int returnSpi ) throws java.lang.Exception { org.mockito.Mockito.when ( mMockNetd.ipSecAllocateSpi ( org.mockito.Matchers.anyInt ( ) , org.mockito.Matchers.anyString ( ) , org.mockito.Matchers.anyString ( ) , org.mockito.Matchers.anyInt ( ) ) ) . thenReturn ( returnSpi ) ; android.net.IpSecSpiResponse spi = mIpSecService.allocateSecurityParameterIndex ( android.net.NetworkUtils.numericToInetAddress ( remoteAddress ) . getHostAddress ( ) , IpSecManager.INVALID_SECURITY_PARAMETER_INDEX , new android.os.Binder ( ) ) ; return spi.resourceId ; }
Source:
private java.lang.String getDexFileName ( java.io.File inputFile ) { java.lang.String name = inputFile.getName ( ) ; int pos = name.lastIndexOf ( '.' ) ; if ( pos != ( - 1 ) ) { name = name.substring ( 0 , pos ) ; } com.google.common.hash.HashFunction hashFunction = com.google.common.hash.Hashing.md5 ( ) ; com.google.common.hash.HashCode hashCode = hashFunction.hashString ( inputFile.getAbsolutePath ( ) ) ; return ( ( name + "-" ) + ( hashCode.toString ( ) ) ) + ".jar" ; }

Target:
private java.lang.String getDexFileName ( java.io.File inputFile ) { java.lang.String name = inputFile.getName ( ) ; int pos = name.lastIndexOf ( '.' ) ; if ( pos != ( - 1 ) ) { name = name.substring ( 0 , pos ) ; } com.google.common.hash.HashFunction hashFunction = com.google.common.hash.Hashing.md5 ( ) ; com.google.common.hash.HashCode hashCode = hashFunction.hashString ( inputFile.getAbsolutePath ( ) , com.google.common.base.Charsets.UTF_8 ) ; return ( ( name + "-" ) + ( hashCode.toString ( ) ) ) + ".jar" ; }
Source:
void remove ( int id ) { synchronized ( mApps ) { java.util.Iterator < com.android.bluetooth.gatt.ContextMap < T > . App > i = mApps.iterator ( ) ; while ( i.hasNext ( ) ) { com.android.bluetooth.gatt.ContextMap < T > . App entry = i.next ( ) ; if ( ( entry.id ) == id ) { entry.unlinkToDeath ( ) ; entry.appScanStats.isRegistered = false ; i.remove ( ) ; break ; } } } }

Target:
void remove ( int id ) { synchronized ( mApps ) { java.util.Iterator < com.android.bluetooth.gatt.ContextMap < T > . App > i = mApps.iterator ( ) ; while ( i.hasNext ( ) ) { com.android.bluetooth.gatt.ContextMap < T > . App entry = i.next ( ) ; if ( ( entry.id ) == id ) { removeConnectionsByAppId ( id ) ; entry.unlinkToDeath ( ) ; entry.appScanStats.isRegistered = false ; i.remove ( ) ; break ; } } } }
Source:
private synchronized void onCancelRequest ( ) { stopIpManagerLocked ( ) ; mInterfaceName = "" ; mNetworkInfo.setDetailedState ( DetailedState.DISCONNECTED , null , null ) ; if ( ( mNetworkAgent ) != null ) { mNetworkAgent.sendNetworkInfo ( mNetworkInfo ) ; mNetworkAgent = null ; } for ( android.bluetooth.BluetoothDevice device : mPanService.getConnectedDevices ( ) ) { mPanService.disconnect ( device ) ; } }

Target:
private synchronized void onCancelRequest ( ) { stopIpClientLocked ( ) ; mInterfaceName = "" ; mNetworkInfo.setDetailedState ( DetailedState.DISCONNECTED , null , null ) ; if ( ( mNetworkAgent ) != null ) { mNetworkAgent.sendNetworkInfo ( mNetworkInfo ) ; mNetworkAgent = null ; } for ( android.bluetooth.BluetoothDevice device : mPanService.getConnectedDevices ( ) ) { mPanService.disconnect ( device ) ; } }
Source:
public static void startMethodTracing ( java.lang.String traceName , int bufferSize , int flags ) { java.lang.String pathName = traceName ; if ( ( pathName.charAt ( 0 ) ) != '/' ) pathName = ( android.os.Debug.DEFAULT_TRACE_PATH_PREFIX ) + pathName ; if ( ! ( pathName.endsWith ( android.os.Debug.DEFAULT_TRACE_EXTENSION ) ) ) pathName = pathName + ( android.os.Debug.DEFAULT_TRACE_EXTENSION ) ; dalvik.system.VMDebug.startMethodTracing ( pathName , bufferSize , flags ) ; }

Target:
private static java.lang.String fixTraceName ( java.lang.String traceName ) { if ( traceName == null ) traceName = android.os.Debug.DEFAULT_TRACE_FILE_PATH ; if ( ( traceName.charAt ( 0 ) ) != '/' ) traceName = ( android.os.Debug.DEFAULT_TRACE_PATH_PREFIX ) + traceName ; if ( ! ( traceName.endsWith ( android.os.Debug.DEFAULT_TRACE_EXTENSION ) ) ) traceName = traceName + ( android.os.Debug.DEFAULT_TRACE_EXTENSION ) ; return traceName ; }
Source:
public static void atraceDumpAndSend ( android.content.Context context , java.lang.String tags , int bufferSizeKb ) { java.lang.String format = "yyyy-MM-dd-HH-mm-ss" ; java.lang.String now = new java.text.SimpleDateFormat ( format , java.util.Locale.US ) . format ( new java.util.Date ( ) ) ; com.android.traceur.AtraceUtils.ensureBugreportDirectory ( context ) ; java.io.File file = new java.io.File ( java.lang.String.format ( "/bugreports/traceur-%s-%s-%s.txt" , Build.BOARD , Build.ID , now ) ) ; com.android.traceur.FileSender.postCaptureNotification ( context , file ) ; com.android.traceur.AtraceUtils.atraceDump ( tags , bufferSizeKb , file ) ; com.android.traceur.FileSender.postNotification ( context , file ) ; }

Target:
public static void atraceDumpAndSend ( android.content.Context context , java.lang.String tags , int bufferSizeKb ) { java.lang.String format = "yyyy-MM-dd-HH-mm-ss" ; java.lang.String now = new java.text.SimpleDateFormat ( format , java.util.Locale.US ) . format ( new java.util.Date ( ) ) ; java.io.File file = new java.io.File ( com.android.traceur.AtraceUtils.TRACE_DIRECTORY , java.lang.String.format ( "traceur-%s-%s-%s.txt" , Build.BOARD , Build.ID , now ) ) ; com.android.traceur.FileSender.postCaptureNotification ( context , file ) ; com.android.traceur.AtraceUtils.atraceDump ( tags , bufferSizeKb , file ) ; com.android.traceur.FileSender.postNotification ( context , file ) ; }
Source:
public int processBytes ( byte [ ] in , int inOff , int len , byte [ ] out , int outOff ) throws org.bouncycastle.crypto.DataLengthException { initCipher ( ) ; int resultLen = 0 ; for ( int i = 0 ; i != len ; i ++ ) { resultLen += process ( in [ ( inOff + i ) ] , out , ( outOff + resultLen ) ) ; } return resultLen ; }

Target:
public int processBytes ( byte [ ] in , int inOff , int len , byte [ ] out , int outOff ) throws org.bouncycastle.crypto.DataLengthException { initCipher ( ) ; if ( ( in.length ) < ( inOff + len ) ) { throw new org.bouncycastle.crypto.DataLengthException ( "Input buffer too short" ) ; } int resultLen = 0 ; for ( int i = 0 ; i != len ; i ++ ) { resultLen += process ( in [ ( inOff + i ) ] , out , ( outOff + resultLen ) ) ; } return resultLen ; }
Source:
private void startServices ( ) { android.content.Intent startIntent = new android.content.Intent ( mTargetContext , com.android.bluetooth.mapclient.MapClientService.class ) ; startIntent.putExtra ( AdapterService.EXTRA_ACTION , AdapterService.ACTION_SERVICE_STATE_CHANGED ) ; startIntent.putExtra ( BluetoothAdapter.EXTRA_STATE , BluetoothAdapter.STATE_ON ) ; try { mServiceRule.startService ( startIntent ) ; } catch ( java.util.concurrent.TimeoutException e ) { android.util.Log.e ( com.android.bluetooth.mapclient.MapClientTest.TAG , ( "startServices, timeout " + e ) ) ; org.junit.Assert.fail ( ) ; } mService = com.android.bluetooth.mapclient.MapClientService.getMapClientService ( ) ; org.junit.Assert.assertNotNull ( mService ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { mTargetContext = android.support.test.InstrumentationRegistry.getTargetContext ( ) ; org.junit.Assume.assumeTrue ( "Ignore test when MapClientService is not enabled" , mTargetContext.getResources ( ) . getBoolean ( R.bool.profile_supported_mapmce ) ) ; org.mockito.MockitoAnnotations.initMocks ( this ) ; com.android.bluetooth.TestUtils.setAdapterService ( mAdapterService ) ; com.android.bluetooth.mapclient.MapUtils.setMnsService ( mMockMnsService ) ; com.android.bluetooth.TestUtils.startService ( mServiceRule , com.android.bluetooth.mapclient.MapClientService.class ) ; mService = com.android.bluetooth.mapclient.MapClientService.getMapClientService ( ) ; org.junit.Assert.assertNotNull ( mService ) ; cleanUpInstanceMap ( ) ; mAdapter = android.bluetooth.BluetoothAdapter.getDefaultAdapter ( ) ; }
Source:
private void loadFromStoreAndMigrateAfterUserSwitch ( int userId ) { mWifiConfigStore.switchUserStore ( mWifiConfigStore.createUserFile ( userId ) ) ; if ( loadFromStore ( ) ) { saveToStore ( true ) ; } }

Target:
private void loadFromStoreAndMigrateAfterUserSwitch ( int userId ) { if ( mVerboseLoggingEnabled ) { android.util.Log.v ( com.android.server.wifi.WifiConfigManager.TAG , ( "Loading from store after user switch/unlock for " + userId ) ) ; } mWifiConfigStore.switchUserStore ( mWifiConfigStore.createUserFile ( userId ) ) ; if ( loadFromStore ( ) ) { saveToStore ( true ) ; mPendingUnlockStoreRead = false ; } }
Source:
public final short getCByte ( ) { int c = getC ( ) ; if ( ( c & ( ~ 255 ) ) != 0 ) { throw new com.android.jack.dx.util.DexException ( ( "Register C out of range: " + ( com.android.jack.dx.util.Hex.u8 ( c ) ) ) ) ; } return ( ( short ) ( c ) ) ; }

Target:
public final short getFirstIndexUnit ( ) { assert ( firstIndexType ) != ( com.android.jack.dx.io.IndexType.NONE ) ; return ( ( short ) ( firstIndex ) ) ; }
Source:
public void setVisibility ( int visibility ) { super . setVisibility ( visibility ) ; mViewVisibility = visibility == ( VISIBLE ) ; mRequestedVisible = ( mWindowVisibility ) && ( mViewVisibility ) ; updateWindow ( false , false ) ; }

Target:
public void setVisibility ( int visibility ) { super . setVisibility ( visibility ) ; mViewVisibility = visibility == ( VISIBLE ) ; boolean newRequestedVisible = ( mWindowVisibility ) && ( mViewVisibility ) ; if ( newRequestedVisible != ( mRequestedVisible ) ) { requestLayout ( ) ; } mRequestedVisible = newRequestedVisible ; updateWindow ( false , false ) ; }
Source:
public static void assertArrayEquals ( java.lang.String message , java.lang.Object [ ] expecteds , java.lang.Object [ ] actuals ) { java.lang.String expectedString = java.util.Arrays.toString ( expecteds ) ; java.lang.String actualString = java.util.Arrays.toString ( actuals ) ; if ( ! ( expectedString.equals ( actualString ) ) ) { fail ( message , ( ( ( "expected " + expectedString ) + " but was " ) + actualString ) ) ; } }

Target:
public static void assertArrayEquals ( java.lang.String message , char [ ] expecteds , char [ ] actuals ) { java.lang.String expectedString = java.util.Arrays.toString ( expecteds ) ; java.lang.String actualString = java.util.Arrays.toString ( actuals ) ; if ( ! ( expectedString.equals ( actualString ) ) ) { org.junit.Assert.fail ( message , ( ( ( "expected " + expectedString ) + " but was " ) + actualString ) ) ; } }
Source:
public java.lang.String getSimOperatorNumeric ( ) { int subId = android.telephony.SubscriptionManager.getDefaultDataSubId ( ) ; if ( ! ( android.telephony.SubscriptionManager.isUsableSubIdValue ( subId ) ) ) { subId = android.telephony.SubscriptionManager.getDefaultSmsSubId ( ) ; if ( ! ( android.telephony.SubscriptionManager.isUsableSubIdValue ( subId ) ) ) { subId = android.telephony.SubscriptionManager.getDefaultVoiceSubId ( ) ; if ( ! ( android.telephony.SubscriptionManager.isUsableSubIdValue ( subId ) ) ) { subId = android.telephony.SubscriptionManager.getDefaultSubId ( ) ; } } } return getSimOperatorNumericForSubscription ( subId ) ; }

Target:
public java.lang.String getSimOperatorName ( ) { return getSimOperatorNameForPhone ( getPhoneId ( ) ) ; }
Source:
private com.android.internal.telephony.CommandException getCommandException ( java.lang.Throwable e ) { com.android.internal.telephony.CommandException ex = null ; if ( e instanceof com.android.ims.ImsException ) { ex = getCommandException ( ( ( com.android.ims.ImsException ) ( e ) ) . getCode ( ) , e.getMessage ( ) ) ; } else { android.telephony.Rlog.d ( com.android.internal.telephony.imsphone.ImsPhone.LOG_TAG , "getCommandException generic failure" ) ; ex = new com.android.internal.telephony.CommandException ( CommandException.Error.GENERIC_FAILURE ) ; } return ex ; }

Target:
private com.android.internal.telephony.CommandException getCommandException ( java.lang.Throwable e ) { com.android.internal.telephony.CommandException ex = null ; if ( e instanceof com.android.ims.ImsException ) { ex = getCommandException ( ( ( com.android.ims.ImsException ) ( e ) ) . getCode ( ) , e.getMessage ( ) ) ; } else { logd ( "getCommandException generic failure" ) ; ex = new com.android.internal.telephony.CommandException ( CommandException.Error.GENERIC_FAILURE ) ; } return ex ; }