auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected java.io.FileDescriptor createSocket ( ) { java.io.FileDescriptor s = null ; try { s = android.system.Os.socket ( android.net.util.AF_INET6 , android.net.util.SOCK_DGRAM , android.net.util.IPPROTO_UDP ) ; android.system.Os.bind ( s , android.net.util.BlockingSocketReaderTest.LOOPBACK6 , 0 ) ; mLocalSockName = ( ( java.net.InetSocketAddress ) ( android.system.Os.getsockname ( s ) ) ) ; android.system.Os.setsockoptTimeval ( s , android.net.util.SOL_SOCKET , android.net.util.SO_SNDTIMEO , android.net.util.BlockingSocketReaderTest.TIMEO ) ; } catch ( android.system.ErrnoException | java.net.SocketException e ) { closeSocket ( s ) ; fail ( ) ; return null ; } mLocalSocket = s ; return s ; }

Target:
protected java.io.FileDescriptor createFd ( ) { java.io.FileDescriptor s = null ; try { s = android.system.Os.socket ( android.net.util.AF_INET6 , android.net.util.SOCK_DGRAM , android.net.util.IPPROTO_UDP ) ; android.system.Os.bind ( s , android.net.util.BlockingSocketReaderTest.LOOPBACK6 , 0 ) ; mLocalSockName = ( ( java.net.InetSocketAddress ) ( android.system.Os.getsockname ( s ) ) ) ; android.system.Os.setsockoptTimeval ( s , android.net.util.SOL_SOCKET , android.net.util.SO_SNDTIMEO , android.net.util.BlockingSocketReaderTest.TIMEO ) ; } catch ( android.system.ErrnoException | java.net.SocketException e ) { closeFd ( s ) ; org.junit.Assert.fail ( ) ; return null ; } mLocalSocket = s ; return s ; }
Source:
public void run ( org.eclipse.jface.action.IAction action ) { final com.android.ide.eclipse.adt.internal.sdk.Sdk sdk = com.android.ide.eclipse.adt.internal.sdk.Sdk.getCurrent ( ) ; if ( sdk != null ) { com.android.sdkuilib.repository.AvdManagerWindow window = new com.android.sdkuilib.repository.AvdManagerWindow ( com.android.ide.eclipse.adt.AdtPlugin.getDisplay ( ) . getActiveShell ( ) , new com.android.ide.eclipse.adt.internal.sdk.AdtConsoleSdkLog ( ) , sdk.getSdkLocation ( ) , com.android.sdkuilib.repository.AvdManagerWindow.AvdInvocationContext.IDE ) ; window.open ( ) ; } else { com.android.ide.eclipse.adt.AdtPlugin.displayError ( "Android SDK" , "Location of the Android SDK has not been setup in the preferences." ) ; } }

Target:
public void run ( org.eclipse.jface.action.IAction action ) { final com.android.ide.eclipse.adt.internal.sdk.Sdk sdk = com.android.ide.eclipse.adt.internal.sdk.Sdk.getCurrent ( ) ; if ( sdk != null ) { com.android.ide.eclipse.adt.AdtPlugin.getDefault ( ) . refreshSdk ( ) ; com.android.sdkuilib.repository.AvdManagerWindow window = new com.android.sdkuilib.repository.AvdManagerWindow ( com.android.ide.eclipse.adt.AdtPlugin.getDisplay ( ) . getActiveShell ( ) , new com.android.ide.eclipse.adt.internal.sdk.AdtConsoleSdkLog ( ) , sdk.getSdkLocation ( ) , com.android.sdkuilib.repository.AvdManagerWindow.AvdInvocationContext.IDE ) ; window.open ( ) ; } else { com.android.ide.eclipse.adt.AdtPlugin.displayError ( "Android SDK" , "Location of the Android SDK has not been setup in the preferences." ) ; } }
Source:
public synchronized void close ( ) throws com.android.sched.util.file.CannotCloseOutputException { if ( ! ( closed ) ) { if ( ( zipFile.getStatus ( ) ) == ( com.android.sched.util.file.StreamFileStatus.OPEN ) ) { try { zipFile.getOutputStream ( ) . close ( ) ; } catch ( java.io.IOException e ) { throw new com.android.sched.util.file.CannotCloseOutputException ( this , e ) ; } } closed = true ; } }

Target:
public synchronized void close ( ) throws com.android.sched.util.file.CannotCloseException { if ( ! ( closed ) ) { if ( ( zipFile.getStatus ( ) ) == ( com.android.sched.util.file.StreamFileStatus.OPEN ) ) { try { zipFile.getOutputStream ( ) . close ( ) ; } catch ( java.io.IOException e ) { throw new com.android.sched.util.file.CannotCloseException ( this , e ) ; } } closed = true ; } }
Source:
public java.lang.String guessZoneIdByCountry ( java.lang.String isoCountryCode , long whenMillis ) { libcore.util.CountryTimeZones countryTimeZones = libcore.util.TimeZoneFinder.getInstance ( ) . lookupCountryTimeZones ( isoCountryCode ) ; if ( countryTimeZones == null ) { return null ; } if ( countryTimeZones.isDefaultOkForCountryTimeZoneDetection ( whenMillis ) ) { return countryTimeZones.getDefaultTimeZoneId ( ) ; } return null ; }

Target:
public com.android.internal.telephony.TimeZoneLookupHelper.OffsetResult lookupByNitzCountry ( com.android.internal.telephony.NitzData nitzData , java.lang.String isoCountryCode ) { libcore.util.CountryTimeZones countryTimeZones = libcore.util.TimeZoneFinder.getInstance ( ) . lookupCountryTimeZones ( isoCountryCode ) ; if ( countryTimeZones == null ) { return null ; } java.util.TimeZone bias = android.icu.util.TimeZone.getDefault ( ) ; libcore.util.CountryTimeZones.OffsetResult offsetResult = countryTimeZones.lookupByOffsetWithBias ( nitzData.getLocalOffsetMillis ( ) , nitzData.isDst ( ) , nitzData.getCurrentTimeInMillis ( ) , bias ) ; if ( offsetResult == null ) { return null ; } return new com.android.internal.telephony.TimeZoneLookupHelper.OffsetResult ( offsetResult.mTimeZone.getID ( ) , offsetResult.mOneMatch ) ; }
Source:
protected char [ ] initialValue ( ) { return new char [ 1024 ] ; }

Target:
static < T extends java.lang.Enum < T > > com.google.common.base.Optional < T > getEnumIfPresent ( java.lang.Class < T > enumClass , java.lang.String value ) { java.lang.ref.WeakReference < ? extends java.lang.Enum < ? > > ref = com.google.common.base.Enums.getEnumConstants ( enumClass ) . get ( value ) ; return ref == null ? com.google.common.base.Optional.< T > absent ( ) : com.google.common.base.Optional.of ( enumClass.cast ( ref.get ( ) ) ) ; }
Source:
public void validateCredentialWithUserAndSimCredential ( ) throws java.lang.Exception { android.net.wifi.hotspot2.pps.Credential cred = new android.net.wifi.hotspot2.pps.Credential ( ) ; cred.realm = "realm" ; cred.userCredential = new android.net.wifi.hotspot2.pps.Credential.UserCredential ( ) ; cred.userCredential.username = "username" ; cred.userCredential.password = "password" ; cred.userCredential.eapType = android.net.wifi.EAPConstants.EAP_TTLS ; cred.userCredential.nonEapInnerMethod = "MS-CHAP" ; cred.caCertificate = android.net.wifi.FakeKeys.CA_CERT0 ; cred.simCredential = new android.net.wifi.hotspot2.pps.Credential.SimCredential ( ) ; cred.simCredential.imsi = "1234*" ; cred.simCredential.eapType = android.net.wifi.EAPConstants.EAP_SIM ; org.junit.Assert.assertFalse ( cred.validate ( ) ) ; }

Target:
public void validateUserCredentialWithoutCaCert ( ) throws java.lang.Exception { android.net.wifi.hotspot2.pps.Credential cred = android.net.wifi.hotspot2.pps.CredentialTest.createCredentialWithUserCredential ( ) ; cred.setCaCertificate ( null ) ; org.junit.Assert.assertFalse ( cred.validate ( ) ) ; }
Source:
protected com.android.jack.test.toolchain.JackBasedToolchain createToolchain ( @ javax.annotation.Nonnull java.util.List < java.lang.Class < ? extends com.android.jack.test.toolchain.IToolchain > > excludeList ) throws org.junit.internal.AssumptionViolatedException { com.android.jack.test.toolchain.JackBasedToolchain jackToolchain = super . createToolchain ( excludeList ) ; jackToolchain.addProperty ( Options.ANDROID_MIN_API_LEVEL.getName ( ) , java.lang.String.valueOf ( AndroidApiLevel.ReleasedLevel.N.getLevel ( ) ) ) ; return jackToolchain ; }

Target:
protected com.android.jack.test.toolchain.JackBasedToolchain createToolchain ( @ javax.annotation.Nonnull java.util.List < java.lang.Class < ? extends com.android.jack.test.toolchain.IToolchain > > excludeList ) throws java.lang.Exception { com.android.jack.test.toolchain.JackBasedToolchain jackToolchain = super . createToolchain ( excludeList ) ; jackToolchain.setAndroidMinApiLevel ( java.lang.String.valueOf ( AndroidApiLevel.ReleasedLevel.N.getLevel ( ) ) ) ; return jackToolchain ; }
Source:
public boolean startWpsRegistrar ( java.lang.String bssid , java.lang.String pin ) { if ( ( android.text.TextUtils.isEmpty ( bssid ) ) || ( android.text.TextUtils.isEmpty ( pin ) ) ) return false ; return doBooleanCommand ( ( ( ( "WPS_REG " + bssid ) + " " ) + pin ) ) ; }

Target:
public boolean startWpsRegistrar ( java.lang.String bssid , java.lang.String pin ) { if ( ( android.text.TextUtils.isEmpty ( bssid ) ) || ( android.text.TextUtils.isEmpty ( pin ) ) ) return false ; if ( com.android.server.wifi.WifiNative.HIDL_SUP_ENABLE ) { return mSupplicantStaIfaceHal.startWpsRegistrar ( bssid , pin ) ; } else { return doBooleanCommand ( ( ( ( "WPS_REG " + bssid ) + " " ) + pin ) ) ; } }
Source:
synchronized java.io.OutputStream openWrite ( @ javax.annotation.Nonnull com.android.sched.vfs.WriteZipFS.ZipVFile file ) { assert ! ( isClosed ( ) ) ; if ( notifyVFileOpenAndReturnPreviousState ( ) ) { throw new java.lang.AssertionError ( ( ( getLocation ( ) . getDescription ( ) ) + " cannot be written to because a previous stream has not been closed." ) ) ; } return new com.android.sched.vfs.WriteZipFS.ZipEntryOutputStream ( this , file.getZipEntry ( ) ) ; }

Target:
synchronized java.io.OutputStream openWrite ( @ javax.annotation.Nonnull com.android.sched.vfs.WriteZipFS.ZipVFile file ) { assert ! ( isClosed ( ) ) ; if ( notifyVFileOpenAndReturnPreviousState ( ) ) { throw new java.lang.AssertionError ( ( ( getLocation ( ) . getDescription ( ) ) + " cannot be written to because a previous stream has not been closed." ) ) ; } if ( ( outputStream ) == null ) { outputStream = zipFile.getOutputStream ( ) ; } return new com.android.sched.vfs.WriteZipFS.ZipEntryOutputStream ( this , file.getZipEntry ( ) ) ; }
Source:
public final byte get ( ) { if ( ( position ) == ( limit ) ) { throw new java.nio.BufferUnderflowException ( ) ; } return this . block.peekByte ( ( ( offset ) + ( ( position ) ++ ) ) ) ; }

Target:
public final byte get ( ) { checkNotFreed ( ) ; if ( ( position ) == ( limit ) ) { throw new java.nio.BufferUnderflowException ( ) ; } return this . block.peekByte ( ( ( offset ) + ( ( position ) ++ ) ) ) ; }
Source:
public void onWindowFocusChanged ( final boolean hasWindowFocus ) { if ( checkNeedsPost ( ) ) { mRunQueue.addTask ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { onWindowFocusChanged ( hasWindowFocus ) ; } } ) ; return ; } mAwContents.onWindowFocusChanged ( hasWindowFocus ) ; }

Target:
public void onFocusChanged ( final boolean focused , final int direction , final android.graphics.Rect previouslyFocusedRect ) { if ( checkNeedsPost ( ) ) { mRunQueue.addTask ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { onFocusChanged ( focused , direction , previouslyFocusedRect ) ; } } ) ; return ; } mAwContents.onFocusChanged ( focused , direction , previouslyFocusedRect ) ; }
Source:
public void testBaseResourceSetByName ( ) throws java.lang.Exception { com.android.builder.resources.ResourceSet resourceSet = com.android.builder.resources.ResourceSetTest.getBaseResourceSet ( ) ; verifyResources ( resourceSet , "drawable/icon" , "drawable/patch" , "raw/foo" , "layout/main" , "layout/layout_ref" , "layout/alias_replaced_by_file" , "layout/file_replaced_by_alias" , "drawable/color_drawable" , "drawable/drawable_ref" , "color/color" , "string/basic_string" , "string/xliff_string" , "string/styled_string" , "style/style" , "array/string_array" , "attr/dimen_attr" , "attr/string_attr" , "attr/enum_attr" , "attr/flag_attr" , "declare-styleable/declare_styleable" , "dimen/dimen" , "id/item_id" , "integer/integer" ) ; }

Target:
public void testBaseResourceSetByName ( ) throws java.lang.Exception { com.android.builder.resources.ResourceSet resourceSet = com.android.builder.resources.ResourceSetTest.getBaseResourceSet ( ) ; verifyResourceExists ( resourceSet , "drawable/icon" , "drawable/patch" , "raw/foo" , "layout/main" , "layout/layout_ref" , "layout/alias_replaced_by_file" , "layout/file_replaced_by_alias" , "drawable/color_drawable" , "drawable/drawable_ref" , "color/color" , "string/basic_string" , "string/xliff_string" , "string/styled_string" , "style/style" , "array/string_array" , "attr/dimen_attr" , "attr/string_attr" , "attr/enum_attr" , "attr/flag_attr" , "declare-styleable/declare_styleable" , "dimen/dimen" , "id/item_id" , "integer/integer" ) ; }
Source:
void onPeriodicAdvertisingEnable ( int advertiser_id , boolean enable , int status ) throws java.lang.Exception { logd ( ( ( ( "onPeriodicAdvertisingEnable() advertiser_id=" + advertiser_id ) + ", status=" ) + status ) ) ; java.util.Map.Entry < android.os.IBinder , com.android.bluetooth.gatt.AdvertiseManager.AdvertiserInfo > entry = findAdvertiser ( advertiser_id ) ; if ( entry == null ) { android.util.Log.i ( com.android.bluetooth.gatt.AdvertiseManager.TAG , ( "onAdvertisingSetEnable() - bad advertiser_id " + advertiser_id ) ) ; return ; } android.bluetooth.le.IAdvertisingSetCallback callback = entry.getValue ( ) . callback ; callback.onPeriodicAdvertisingEnable ( advertiser_id , enable , status ) ; }

Target:
void onPeriodicAdvertisingEnabled ( int advertiser_id , boolean enable , int status ) throws java.lang.Exception { logd ( ( ( ( "onPeriodicAdvertisingEnabled() advertiser_id=" + advertiser_id ) + ", status=" ) + status ) ) ; java.util.Map.Entry < android.os.IBinder , com.android.bluetooth.gatt.AdvertiseManager.AdvertiserInfo > entry = findAdvertiser ( advertiser_id ) ; if ( entry == null ) { android.util.Log.i ( com.android.bluetooth.gatt.AdvertiseManager.TAG , ( "onAdvertisingSetEnable() - bad advertiser_id " + advertiser_id ) ) ; return ; } android.bluetooth.le.IAdvertisingSetCallback callback = entry.getValue ( ) . callback ; callback.onPeriodicAdvertisingEnabled ( advertiser_id , enable , status ) ; }
Source:
static java.lang.String retrieveAlphaId ( com.android.internal.telephony.gsm.stk.ComprehensionTlv ctlv ) throws com.android.internal.telephony.gsm.stk.ResultException { byte [ ] rawValue = ctlv.getRawValue ( ) ; int valueIndex = ctlv.getValueIndex ( ) ; int length = ctlv.getLength ( ) ; if ( length != 0 ) { try { return com.android.internal.telephony.IccUtils.adnStringFieldToString ( rawValue , valueIndex , length ) ; } catch ( java.lang.IndexOutOfBoundsException e ) { throw new com.android.internal.telephony.gsm.stk.ResultException ( ResultCode.CMD_DATA_NOT_UNDERSTOOD ) ; } } return null ; }

Target:
static java.lang.String retrieveAlphaId ( com.android.internal.telephony.cat.ComprehensionTlv ctlv ) throws com.android.internal.telephony.cat.ResultException { byte [ ] rawValue = ctlv.getRawValue ( ) ; int valueIndex = ctlv.getValueIndex ( ) ; int length = ctlv.getLength ( ) ; if ( length != 0 ) { try { return com.android.internal.telephony.IccUtils.adnStringFieldToString ( rawValue , valueIndex , length ) ; } catch ( java.lang.IndexOutOfBoundsException e ) { throw new com.android.internal.telephony.cat.ResultException ( ResultCode.CMD_DATA_NOT_UNDERSTOOD ) ; } } return null ; }
Source:
public void windowClosing ( java.awt.event.WindowEvent e ) { int confirm = javax.swing.JOptionPane.showOptionDialog ( blankFrame , "Are you sure you want to close the window? Closing the window will delete the Google Cloud instance." , "Exit Confirmation" , javax.swing.JOptionPane.YES_NO_OPTION , javax.swing.JOptionPane.QUESTION_MESSAGE , null , null , null ) ; if ( confirm == 0 ) { java.lang.System.out.println ( "Exiting blank VNC Viewer" ) ; blankFrame.setDefaultCloseOperation ( javax.swing.WindowConstants.DISPOSE_ON_CLOSE ) ; } }

Target:
public void windowClosing ( java.awt.event.WindowEvent e ) { int confirm = javax.swing.JOptionPane.showOptionDialog ( blankFrame , "Are you sure you want to close the window? Closing the window will delete the Google Cloud instance." , "Exit Confirmation" , javax.swing.JOptionPane.YES_NO_OPTION , javax.swing.JOptionPane.QUESTION_MESSAGE , null , null , null ) ; if ( confirm == 0 ) { java.lang.System.out.println ( "Exiting blank VNC Viewer" ) ; myBlankVncViewerCallback.viewerClosed ( ) ; blankFrame.setDefaultCloseOperation ( javax.swing.WindowConstants.DISPOSE_ON_CLOSE ) ; } }
Source:
static com.android.builder.resources.ResourceSet getBaseResourceSet ( ) throws com.android.builder.resources.DuplicateResourceException , java.io.IOException { if ( ( com.android.builder.resources.ResourceSetTest.sBaseResourceSet ) == null ) { java.io.File root = getRoot ( "baseResourceSet" ) ; com.android.builder.resources.ResourceSetTest.sBaseResourceSet = new com.android.builder.resources.ResourceSet ( "main" ) ; com.android.builder.resources.ResourceSetTest.sBaseResourceSet.addSource ( root ) ; com.android.builder.resources.ResourceSetTest.sBaseResourceSet.loadFromFiles ( ) ; } return com.android.builder.resources.ResourceSetTest.sBaseResourceSet ; }

Target:
static com.android.builder.resources.ResourceSet getBaseResourceSet ( ) throws com.android.builder.resources.DuplicateResourceException , java.io.IOException { if ( ( com.android.builder.resources.ResourceSetTest.sBaseResourceSet ) == null ) { java.io.File root = com.android.builder.TestUtils.getRoot ( "baseResourceSet" ) ; com.android.builder.resources.ResourceSetTest.sBaseResourceSet = new com.android.builder.resources.ResourceSet ( "main" ) ; com.android.builder.resources.ResourceSetTest.sBaseResourceSet.addSource ( root ) ; com.android.builder.resources.ResourceSetTest.sBaseResourceSet.loadFromFiles ( ) ; } return com.android.builder.resources.ResourceSetTest.sBaseResourceSet ; }
Source:
public void test_ConstructorLjava_io_OutputStreamLjava_util_zip_Checksum ( ) { try { java.io.FileOutputStream outFile = new java.io.FileOutputStream ( "chkOut.txt" ) ; java.util.zip.CheckedOutputStream chkOut = new java.util.zip.CheckedOutputStream ( outFile , new java.util.zip.CRC32 ( ) ) ; assertEquals ( "the checkSum value of the constructor is not 0" , 0 , chkOut.getChecksum ( ) . getValue ( ) ) ; outFile.close ( ) ; } catch ( java.io.IOException e ) { fail ( "Unable to find file" ) ; } catch ( java.lang.SecurityException e ) { fail ( "file cannot be opened for writing due to security reasons" ) ; } }

Target:
public void test_ConstructorLjava_io_OutputStreamLjava_util_zip_Checksum ( ) { try { java.io.FileOutputStream outFile = new java.io.FileOutputStream ( java.io.File.createTempFile ( "CheckedOutputStreamTest" , ".txt" ) ) ; java.util.zip.CheckedOutputStream chkOut = new java.util.zip.CheckedOutputStream ( outFile , new java.util.zip.CRC32 ( ) ) ; assertEquals ( "the checkSum value of the constructor is not 0" , 0 , chkOut.getChecksum ( ) . getValue ( ) ) ; outFile.close ( ) ; } catch ( java.io.IOException e ) { fail ( "Unable to find file" ) ; } catch ( java.lang.SecurityException e ) { fail ( "file cannot be opened for writing due to security reasons" ) ; } }
Source:
public void testFocusedViewWithDisabledActionForward ( ) { mDevice.pressKeyCode ( KeyEvent.KEYCODE_MEDIA_FAST_FORWARD ) ; mMenuHelper.assertWaitForMenu ( ) ; assertButtonHasFocus ( com.android.tv.tests.ui.PlayControlsRowViewTest.BUTTON_INDEX_PLAY_PAUSE ) ; mDevice.pressBack ( ) ; mDevice.pressKeyCode ( KeyEvent.KEYCODE_MEDIA_NEXT ) ; mMenuHelper.assertWaitForMenu ( ) ; assertButtonHasFocus ( com.android.tv.tests.ui.PlayControlsRowViewTest.BUTTON_INDEX_PLAY_PAUSE ) ; mDevice.pressBack ( ) ; }

Target:
public void testFocusedViewWithDisabledActionForward ( ) { mDevice.pressKeyCode ( KeyEvent.KEYCODE_MEDIA_FAST_FORWARD ) ; mMenuHelper.assertWaitForMenu ( ) ; assertButtonHasFocus ( com.android.tv.tests.ui.PlayControlsRowViewTest.BUTTON_ID_PLAY_PAUSE ) ; mDevice.pressBack ( ) ; mDevice.pressKeyCode ( KeyEvent.KEYCODE_MEDIA_NEXT ) ; mMenuHelper.assertWaitForMenu ( ) ; assertButtonHasFocus ( com.android.tv.tests.ui.PlayControlsRowViewTest.BUTTON_ID_PLAY_PAUSE ) ; mDevice.pressBack ( ) ; }
Source:
public static final java.security.cert.CertificateFactory getInstance ( java.lang.String type , java.lang.String provider ) throws java.security.NoSuchProviderException , java.security.cert.CertificateException { try { sun.security.jca.GetInstance.Instance instance = sun.security.jca.GetInstance.getInstance ( "CertificateFactory" , java.security.cert.CertificateFactorySpi.class , type , provider ) ; return new java.security.cert.CertificateFactory ( ( ( java.security.cert.CertificateFactorySpi ) ( instance.impl ) ) , instance.provider , type ) ; } catch ( java.security.NoSuchAlgorithmException e ) { throw new java.security.cert.CertificateException ( ( type + " not found" ) , e ) ; } }

Target:
public static final java.security.cert.CertificateFactory getInstance ( java.lang.String type , java.lang.String provider ) throws java.security.NoSuchProviderException , java.security.cert.CertificateException { try { sun.security.jca.Providers.checkBouncyCastleDeprecation ( provider , "CertificateFactory" , type ) ; sun.security.jca.GetInstance.Instance instance = sun.security.jca.GetInstance.getInstance ( "CertificateFactory" , java.security.cert.CertificateFactorySpi.class , type , provider ) ; return new java.security.cert.CertificateFactory ( ( ( java.security.cert.CertificateFactorySpi ) ( instance.impl ) ) , instance.provider , type ) ; } catch ( java.security.NoSuchAlgorithmException e ) { throw new java.security.cert.CertificateException ( ( type + " not found" ) , e ) ; } }
Source:
private java.util.List < com.android.ide.eclipse.adt.internal.wizards.newproject.ImportedProject > searchForProjects ( java.io.File dir ) { java.util.List < com.android.ide.eclipse.adt.internal.wizards.newproject.ImportedProject > projects = new java.util.ArrayList < com.android.ide.eclipse.adt.internal.wizards.newproject.ImportedProject > ( ) ; addProjects ( dir , projects ) ; return projects ; }

Target:
private java.util.List < com.android.ide.eclipse.adt.internal.wizards.newproject.ImportedProject > searchForProjects ( java.io.File dir ) { java.util.List < com.android.ide.eclipse.adt.internal.wizards.newproject.ImportedProject > projects = new java.util.ArrayList < com.android.ide.eclipse.adt.internal.wizards.newproject.ImportedProject > ( ) ; addProjects ( dir , projects , ( ( dir.getPath ( ) . length ( ) ) + 1 ) ) ; return projects ; }
Source:
public com.android.jack.dx.io.instructions.DecodedInstruction decode ( int opcodeUnit , com.android.jack.dx.io.instructions.CodeInput in ) throws java.io.EOFException { int baseAddress = ( in.cursor ( ) ) - 1 ; int opcode = com.android.jack.dx.io.instructions.InstructionCodec.byte0 ( opcodeUnit ) ; int literal = com.android.jack.dx.io.instructions.InstructionCodec.byte1 ( opcodeUnit ) ; int target = ( ( short ) ( in.read ( ) ) ) ; return new com.android.jack.dx.io.instructions.ZeroRegisterDecodedInstruction ( this , opcode , 0 , null , ( baseAddress + target ) , literal ) ; }

Target:
public com.android.jack.dx.io.instructions.DecodedInstruction decode ( int opcodeUnit , com.android.jack.dx.io.instructions.CodeInput in ) throws java.io.EOFException { int baseAddress = ( in.cursor ( ) ) - 1 ; int opcode = com.android.jack.dx.io.instructions.InstructionCodec.byte0 ( opcodeUnit ) ; int literal = com.android.jack.dx.io.instructions.InstructionCodec.byte1 ( opcodeUnit ) ; int target = ( ( short ) ( in.read ( ) ) ) ; return new com.android.jack.dx.io.instructions.ZeroRegisterDecodedInstruction ( this , opcode , 0 , com.android.jack.dx.io.IndexType.NONE , ( baseAddress + target ) , literal ) ; }
Source:
public static void validate ( @ com.android.annotations.NonNull com.android.manifmerger.XmlDocument xmlDocument , @ com.android.annotations.NonNull com.android.manifmerger.MergingReport.Builder mergingReport ) { com.google.common.base.Preconditions.checkNotNull ( xmlDocument ) ; com.google.common.base.Preconditions.checkNotNull ( mergingReport ) ; com.android.manifmerger.PostValidator.validate ( xmlDocument.getRootNode ( ) , mergingReport.getActionRecorder ( ) . build ( ) , mergingReport ) ; }

Target:
public static void validate ( @ com.android.annotations.NonNull com.android.manifmerger.XmlDocument xmlDocument , @ com.android.annotations.NonNull com.android.manifmerger.MergingReport.Builder mergingReport ) { com.google.common.base.Preconditions.checkNotNull ( xmlDocument ) ; com.google.common.base.Preconditions.checkNotNull ( mergingReport ) ; com.android.manifmerger.PostValidator.reOrderElements ( xmlDocument.getRootNode ( ) ) ; com.android.manifmerger.PostValidator.validate ( xmlDocument.getRootNode ( ) , mergingReport.getActionRecorder ( ) . build ( ) , mergingReport ) ; }
Source:
public void writeToParcel ( android.os.Parcel dest , int flags ) { dest.writeLong ( mNetworkCapabilities ) ; dest.writeLong ( mTransportTypes ) ; dest.writeInt ( mLinkUpBandwidthKbps ) ; dest.writeInt ( mLinkDownBandwidthKbps ) ; dest.writeParcelable ( ( ( android.os.Parcelable ) ( mNetworkSpecifier ) ) , flags ) ; dest.writeInt ( mSignalStrength ) ; dest.writeArraySet ( mUids ) ; }

Target:
public void writeToParcel ( android.os.Parcel dest , int flags ) { dest.writeLong ( mNetworkCapabilities ) ; dest.writeLong ( mUnwantedNetworkCapabilities ) ; dest.writeLong ( mTransportTypes ) ; dest.writeInt ( mLinkUpBandwidthKbps ) ; dest.writeInt ( mLinkDownBandwidthKbps ) ; dest.writeParcelable ( ( ( android.os.Parcelable ) ( mNetworkSpecifier ) ) , flags ) ; dest.writeInt ( mSignalStrength ) ; dest.writeArraySet ( mUids ) ; }
Source:
private static java.io.File createTempFile ( ) throws java.lang.Exception { try { return java.io.File.createTempFile ( "test" , ".trace" ) ; } catch ( java.io.IOException e ) { java.lang.System.setProperty ( "java.io.tmpdir" , "/data/local/tmp" ) ; try { return java.io.File.createTempFile ( "test" , ".trace" ) ; } catch ( java.io.IOException e2 ) { java.lang.System.setProperty ( "java.io.tmpdir" , "/sdcard" ) ; return java.io.File.createTempFile ( "test" , ".trace" ) ; } } }

Target:
private static java.io.File createTempFile ( ) throws java.lang.Exception { try { return java.io.File.createTempFile ( Main.TEMP_FILE_NAME_PREFIX , Main.TEMP_FILE_NAME_SUFFIX ) ; } catch ( java.io.IOException e ) { java.lang.System.setProperty ( "java.io.tmpdir" , "/data/local/tmp" ) ; try { return java.io.File.createTempFile ( Main.TEMP_FILE_NAME_PREFIX , Main.TEMP_FILE_NAME_SUFFIX ) ; } catch ( java.io.IOException e2 ) { java.lang.System.setProperty ( "java.io.tmpdir" , "/sdcard" ) ; return java.io.File.createTempFile ( Main.TEMP_FILE_NAME_PREFIX , Main.TEMP_FILE_NAME_SUFFIX ) ; } } }
Source:
public java.lang.Object [ ] getTestObjects ( ) { java.util.Locale [ ] locales = android.icu.dev.test.serializable.SerializableTest.getLocales ( ) ; android.icu.impl.DateNumberFormat [ ] dnfmts = new android.icu.impl.DateNumberFormat [ locales.length ] ; for ( int i = 0 ; i < ( locales.length ) ; i ++ ) { android.icu.util.ULocale uloc = android.icu.util.ULocale.forLocale ( locales [ i ] ) ; dnfmts [ i ] = new android.icu.impl.DateNumberFormat ( uloc , '0' , "latn" ) ; } return dnfmts ; }

Target:
public java.lang.Object [ ] getTestObjects ( ) { java.util.Locale [ ] locales = android.icu.dev.test.serializable.SerializableTestUtility.getLocales ( ) ; android.icu.impl.DateNumberFormat [ ] dnfmts = new android.icu.impl.DateNumberFormat [ locales.length ] ; for ( int i = 0 ; i < ( locales.length ) ; i ++ ) { android.icu.util.ULocale uloc = android.icu.util.ULocale.forLocale ( locales [ i ] ) ; dnfmts [ i ] = new android.icu.impl.DateNumberFormat ( uloc , '0' , "latn" ) ; } return dnfmts ; }
Source:
public java.util.List < java.io.File > getLocalJars ( ) { java.util.List < java.io.File > localJars = com.google.common.collect.Lists.newArrayList ( ) ; java.io.File [ ] jarList = new java.io.File ( mBundleFolder , com.android.SdkConstants.LIBS_FOLDER ) . listFiles ( ) ; if ( jarList != null ) { for ( java.io.File jars : jarList ) { if ( ( jars.isFile ( ) ) && ( jars.getName ( ) . endsWith ( ".jar" ) ) ) { localJars.add ( jars ) ; } } } return localJars ; }

Target:
protected java.io.File getJarsRootFolder ( ) { return new java.io.File ( mBundleFolder , com.android.SdkConstants.FD_JARS ) ; }
Source:
public void validateCopyConstructorWithValidSource ( ) throws java.lang.Exception { android.net.wifi.hotspot2.PasspointConfiguration sourceConfig = new android.net.wifi.hotspot2.PasspointConfiguration ( ) ; sourceConfig.homeSp = android.net.wifi.hotspot2.PasspointConfigurationTest.createHomeSp ( ) ; sourceConfig.credential = android.net.wifi.hotspot2.PasspointConfigurationTest.createCredential ( ) ; android.net.wifi.hotspot2.PasspointConfiguration copyConfig = new android.net.wifi.hotspot2.PasspointConfiguration ( sourceConfig ) ; org.junit.Assert.assertTrue ( copyConfig.equals ( sourceConfig ) ) ; }

Target:
public void validateConfigWithoutPolicy ( ) throws java.lang.Exception { android.net.wifi.hotspot2.PasspointConfiguration config = android.net.wifi.hotspot2.PasspointConfigurationTest.createConfig ( ) ; config.policy = null ; org.junit.Assert.assertTrue ( config.validate ( ) ) ; }
Source:
public void processNewLines ( java.lang.String [ ] lines ) { for ( java.lang.String line : lines ) { if ( ( line.length ( ) ) > 0 ) { java.util.regex.Matcher m = com.android.ddmlib.FileListingService.sPmPattern.matcher ( line ) ; if ( m.matches ( ) ) { com.android.ddmlib.FileListingService.FileEntry entry = map.get ( m.group ( 1 ) ) ; if ( entry != null ) { entry.info = m.group ( 2 ) ; receiver.refreshEntry ( entry ) ; } } } } }

Target:
public void processNewLines ( java.lang.String [ ] lines ) { for ( java.lang.String line : lines ) { if ( ! ( line.isEmpty ( ) ) ) { java.util.regex.Matcher m = com.android.ddmlib.FileListingService.sPmPattern.matcher ( line ) ; if ( m.matches ( ) ) { com.android.ddmlib.FileListingService.FileEntry entry = map.get ( m.group ( 1 ) ) ; if ( entry != null ) { entry.info = m.group ( 2 ) ; receiver.refreshEntry ( entry ) ; } } } } }
Source:
java.lang.String validateInstrumentationRunner ( java.lang.String instrumentation ) { if ( ! ( mHasRunnerLibrary ) ) { return java.lang.String.format ( LaunchMessages.InstrValidator_NoTestLibMsg_s , AndroidConstants.LIBRARY_TEST_RUNNER ) ; } if ( ! ( instrumentation.equals ( AndroidConstants.CLASS_INSTRUMENTATION_RUNNER ) ) ) { java.lang.String result = com.android.ide.eclipse.adt.internal.project.BaseProjectHelper.testClassForManifest ( mJavaProject , instrumentation , AndroidConstants.CLASS_INSTRUMENTATION_RUNNER , true ) ; if ( result != ( com.android.ide.eclipse.adt.internal.project.BaseProjectHelper.TEST_CLASS_OK ) ) { return java.lang.String.format ( LaunchMessages.InstrValidator_WrongRunnerTypeMsg_s , AndroidConstants.CLASS_INSTRUMENTATION_RUNNER ) ; } } return com.android.ide.eclipse.adt.internal.launch.junit.InstrumentationRunnerValidator.INSTRUMENTATION_OK ; }

Target:
java.lang.String validateInstrumentationRunner ( java.lang.String instrumentation ) { if ( ! ( mHasRunnerLibrary ) ) { return java.lang.String.format ( LaunchMessages.InstrValidator_NoTestLibMsg_s , AndroidConstants.LIBRARY_TEST_RUNNER ) ; } if ( ! ( instrumentation.equals ( SdkConstants.CLASS_INSTRUMENTATION_RUNNER ) ) ) { java.lang.String result = com.android.ide.eclipse.adt.internal.project.BaseProjectHelper.testClassForManifest ( mJavaProject , instrumentation , SdkConstants.CLASS_INSTRUMENTATION_RUNNER , true ) ; if ( result != ( com.android.ide.eclipse.adt.internal.project.BaseProjectHelper.TEST_CLASS_OK ) ) { return java.lang.String.format ( LaunchMessages.InstrValidator_WrongRunnerTypeMsg_s , SdkConstants.CLASS_INSTRUMENTATION_RUNNER ) ; } } return com.android.ide.eclipse.adt.internal.launch.junit.InstrumentationRunnerValidator.INSTRUMENTATION_OK ; }
Source:
public void testConfigurationUpdatesWhenResizedFromDockedStack ( ) throws java.lang.Exception { HEAD ( 5 ) ; android.server.cts.c121a Merge ; }

Target:
public void testConfigurationUpdatesWhenResizedFromDockedStack ( ) throws java.lang.Exception { if ( ! ( supportsSplitScreenMultiWindow ( ) ) ) { com.android.tradefed.log.LogUtil.CLog.logAndDisplay ( LogLevel.INFO , "Skipping test: no multi-window support" ) ; return ; } launchActivityInStack ( android.server.cts.ActivityManagerAppConfigurationTests.RESIZEABLE_ACTIVITY_NAME , android.server.cts.DOCKED_STACK_ID ) ; final android.server.cts.ReportedSizes dockedSizes = getActivityDisplaySize ( android.server.cts.ActivityManagerAppConfigurationTests.RESIZEABLE_ACTIVITY_NAME ) ; moveActivityToStack ( android.server.cts.ActivityManagerAppConfigurationTests.RESIZEABLE_ACTIVITY_NAME , android.server.cts.FULLSCREEN_WORKSPACE_STACK_ID ) ; final android.server.cts.ReportedSizes fullscreenSizes = getActivityDisplaySize ( android.server.cts.ActivityManagerAppConfigurationTests.RESIZEABLE_ACTIVITY_NAME ) ; android.server.cts.ActivityManagerAppConfigurationTests.assertSizesAreSane ( fullscreenSizes , dockedSizes ) ; }
Source:
public void unpark ( ) { synchronized ( lock ) { switch ( parkState ) { case java.lang.Thread.ParkState.PREEMPTIVELY_UNPARKED : { break ; } case java.lang.Thread.ParkState.UNPARKED : { parkState = java.lang.Thread.ParkState.PREEMPTIVELY_UNPARKED ; break ; } default : { parkState = java.lang.Thread.ParkState.UNPARKED ; lock.notifyAll ( ) ; break ; } } } }

Target:
public final void unpark$ ( ) { synchronized ( lock ) { switch ( parkState ) { case java.lang.Thread.ParkState.PREEMPTIVELY_UNPARKED : { break ; } case java.lang.Thread.ParkState.UNPARKED : { parkState = java.lang.Thread.ParkState.PREEMPTIVELY_UNPARKED ; break ; } default : { parkState = java.lang.Thread.ParkState.UNPARKED ; lock.notifyAll ( ) ; break ; } } } }
Source:
public void parseCacheHeaders_headersSet ( ) { headers.put ( "MyCustomHeader" , "42" ) ; com.android.volley.Cache.Entry entry = com.android.volley.toolbox.HttpHeaderParser.parseCacheHeaders ( response ) ; assertNotNull ( entry ) ; assertNotNull ( entry.responseHeaders ) ; assertEquals ( 1 , entry.responseHeaders.size ( ) ) ; assertEquals ( "42" , entry.responseHeaders.get ( "MyCustomHeader" ) ) ; }

Target:
public void parseCacheHeaders_headersSet ( ) { headers.put ( "MyCustomHeader" , "42" ) ; com.android.volley.Cache.Entry entry = com.android.volley.toolbox.HttpHeaderParser.parseCacheHeaders ( response ) ; org.junit.Assert.assertNotNull ( entry ) ; org.junit.Assert.assertNotNull ( entry.responseHeaders ) ; org.junit.Assert.assertEquals ( 1 , entry.responseHeaders.size ( ) ) ; org.junit.Assert.assertEquals ( "42" , entry.responseHeaders.get ( "MyCustomHeader" ) ) ; }
Source:
public static org.eclipse.swt.graphics.Point getAbsoluteCenterOfView ( com.android.hierarchyviewerlib.device.ViewNode node ) { org.eclipse.swt.graphics.Point point = com.android.chimpchat.hierarchyviewer.HierarchyViewer.getAbsolutePositionOfView ( node ) ; return new org.eclipse.swt.graphics.Point ( ( ( point.x ) + ( ( node.width ) / 2 ) ) , ( ( point.y ) + ( ( node.height ) / 2 ) ) ) ; }

Target:
public static org.eclipse.swt.graphics.Point getAbsoluteCenterOfView ( com.android.hierarchyviewerlib.models.ViewNode node ) { org.eclipse.swt.graphics.Point point = com.android.chimpchat.hierarchyviewer.HierarchyViewer.getAbsolutePositionOfView ( node ) ; return new org.eclipse.swt.graphics.Point ( ( ( point.x ) + ( ( node.width ) / 2 ) ) , ( ( point.y ) + ( ( node.height ) / 2 ) ) ) ; }
Source:
public void setA2dpAudioState ( int state ) { android.os.Message msg = mHandler.obtainMessage ( com.android.bluetooth.avrcp.Avrcp.MSG_SET_A2DP_AUDIO_STATE , state , 0 ) ; mHandler.sendMessage ( msg ) ; }

Target:
public void setA2dpAudioState ( int state ) { final com.android.bluetooth.avrcp.Avrcp.AvrcpMessageHandler handler = mHandler ; if ( handler == null ) { if ( com.android.bluetooth.avrcp.Avrcp.DEBUG ) android.util.Log.d ( com.android.bluetooth.avrcp.Avrcp.TAG , "setA2dpAudioState: mHandler is already null" ) ; return ; } android.os.Message msg = handler.obtainMessage ( com.android.bluetooth.avrcp.Avrcp.MSG_SET_A2DP_AUDIO_STATE , state , 0 ) ; handler.sendMessage ( msg ) ; }
Source:
public java.lang.String toString ( ) { return mName ; }

Target:
public java.lang.String toString ( ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( ) ; sb.append ( "Device [mName=" ) ; sb.append ( mName ) ; sb.append ( ", mId=" ) ; sb.append ( mId ) ; sb.append ( ", mManufacturer=" ) ; sb.append ( mManufacturer ) ; sb.append ( ", mSoftware=" ) ; sb.append ( mSoftware ) ; sb.append ( ", mState=" ) ; sb.append ( mState ) ; sb.append ( ", mMeta=" ) ; sb.append ( mMeta ) ; sb.append ( ", mDefaultState=" ) ; sb.append ( mDefaultState ) ; sb.append ( "]" ) ; return sb.toString ( ) ; }
Source:
private void deleteFromSim ( android.database.Cursor cursor ) { java.lang.String messageIndexString = cursor.getString ( cursor.getColumnIndexOrThrow ( "index_on_sim" ) ) ; android.net.Uri simUri = com.android.mms.ui.ManageSimMessages.SIM_URI.buildUpon ( ) . appendPath ( messageIndexString ) . build ( ) ; com.google.android.mms.util.SqliteWrapper.delete ( this , mContentResolver , simUri , null , null ) ; }

Target:
private void deleteFromSim ( android.database.Cursor cursor ) { java.lang.String messageIndexString = cursor.getString ( cursor.getColumnIndexOrThrow ( "index_on_icc" ) ) ; android.net.Uri simUri = com.android.mms.ui.ManageSimMessages.ICC_URI.buildUpon ( ) . appendPath ( messageIndexString ) . build ( ) ; com.google.android.mms.util.SqliteWrapper.delete ( this , mContentResolver , simUri , null , null ) ; }
Source:
private static boolean containsJavaScriptAnnotation ( @ com.android.annotations.NonNull org.objectweb.asm.tree.ClassNode classNode ) { java.util.List methodList = classNode.methods ; for ( java.lang.Object om : methodList ) { org.objectweb.asm.tree.MethodNode m = ( ( org.objectweb.asm.tree.MethodNode ) ( om ) ) ; java.util.List annotations = m.visibleAnnotations ; if ( annotations != null ) { for ( java.lang.Object oa : annotations ) { org.objectweb.asm.tree.AnnotationNode a = ( ( org.objectweb.asm.tree.AnnotationNode ) ( oa ) ) ; if ( a.desc.equals ( "Landroid/webkit/JavascriptInterface;" ) ) { return true ; } } } } return false ; }

Target:
private static boolean isCallOnWebView ( com.android.tools.lint.detector.api.JavaContext context , lombok.ast.MethodInvocation call ) { com.android.tools.lint.client.api.JavaParser.ResolvedNode resolved = context.resolve ( call ) ; if ( ! ( resolved instanceof com.android.tools.lint.client.api.JavaParser.ResolvedMethod ) ) { return false ; } com.android.tools.lint.client.api.JavaParser.ResolvedMethod method = ( ( com.android.tools.lint.client.api.JavaParser.ResolvedMethod ) ( resolved ) ) ; return method.getContainingClass ( ) . matches ( com.android.tools.lint.checks.JavaScriptInterfaceDetector.WEB_VIEW_CLS ) ; }
Source:
synchronized void nAllocationElementData1D ( long id , int xoff , int mip , int compIdx , byte [ ] d , int sizeBytes ) { validate ( ) ; rsnAllocationElementData1D ( mContext , id , xoff , mip , compIdx , d , sizeBytes ) ; }

Target:
synchronized void nAllocationElementData ( long id , int xoff , int yoff , int zoff , int mip , int compIdx , byte [ ] d , int sizeBytes ) { validate ( ) ; rsnAllocationElementData ( mContext , id , xoff , yoff , zoff , mip , compIdx , d , sizeBytes ) ; }
Source:
public void disableProfile ( java.lang.String iccid , boolean refresh , android.telephony.euicc.EuiccCardManager.ResultCallback < java.lang.Void > callback ) { try { getIEuiccCardController ( ) . disableProfile ( mContext.getOpPackageName ( ) , iccid , refresh , new com.android.internal.telephony.euicc.IDisableProfileCallback.Stub ( ) { @ java.lang.Override public void onComplete ( int resultCode ) { callback.onComplete ( resultCode , null ) ; } } ) ; } catch ( android.os.RemoteException e ) { android.util.Log.e ( android.telephony.euicc.EuiccCardManager.TAG , "Error calling disableProfile" , e ) ; throw e.rethrowFromSystemServer ( ) ; } }

Target:
public void disableProfile ( java.lang.String cardId , java.lang.String iccid , boolean refresh , android.telephony.euicc.EuiccCardManager.ResultCallback < java.lang.Void > callback ) { try { getIEuiccCardController ( ) . disableProfile ( mContext.getOpPackageName ( ) , cardId , iccid , refresh , new com.android.internal.telephony.euicc.IDisableProfileCallback.Stub ( ) { @ java.lang.Override public void onComplete ( int resultCode ) { callback.onComplete ( resultCode , null ) ; } } ) ; } catch ( android.os.RemoteException e ) { android.util.Log.e ( android.telephony.euicc.EuiccCardManager.TAG , "Error calling disableProfile" , e ) ; throw e.rethrowFromSystemServer ( ) ; } }
Source:
public java.util.List < com.android.ide.common.res2.ResourceItem > getResourceItem ( @ com.android.annotations.NonNull com.android.resources.ResourceType resourceType , @ com.android.annotations.NonNull java.lang.String resourceName ) { synchronized ( mItems ) { com.google.common.collect.ListMultimap < java.lang.String , com.android.ide.common.res2.ResourceItem > map = mItems.get ( resourceType ) ; if ( map != null ) { return map.get ( resourceName ) ; } } return null ; }

Target:
protected com.google.common.collect.ListMultimap < java.lang.String , com.android.ide.common.res2.ResourceItem > getMap ( com.android.resources.ResourceType type , boolean create ) { com.google.common.collect.ListMultimap < java.lang.String , com.android.ide.common.res2.ResourceItem > multimap = mItems.get ( type ) ; if ( ( multimap == null ) && create ) { multimap = com.google.common.collect.ArrayListMultimap.create ( ) ; mItems.put ( type , multimap ) ; } return multimap ; }
Source:
public void testRefactor7 ( ) throws java.lang.Exception { org.eclipse.core.resources.IProject project = createProject ( com.android.ide.eclipse.adt.internal.refactorings.core.TEST_PROJECT ) ; org.eclipse.core.resources.IFile file = project.getFile ( "res/layout/activity_main.xml" ) ; renameResource ( project , file , true , "newlayout" , ( "CHANGES:\n" + ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "-------\n" + "* MainActivity.java - /testRefactor7/src/com/example/refactoringtest/MainActivity.java\n" ) + " @@ -13 +13\n" ) + " - setContentView(R.layout.activity_main);\n" ) + " + setContentView(R.layout.newlayout);\n" ) + "\n" ) + "\n" ) + "* R.java - /testRefactor7/gen/com/example/refactoringtest/R.java\n" ) + " @@ -23 +23\n" ) + " - public static final int activity_main=0x7f030000;\n" ) + " + public static final int newlayout=0x7f030000;\n" ) + "\n" ) + "\n" ) + "* Rename \'testRefactor7/res/layout-land/activity_main.xml\' to \'newlayout.xml\'\n" ) + "\n" ) + "* Rename 'testRefactor7/res/layout/activity_main.xml' to 'newlayout.xml'" ) ) , null ) ; }

Target:
public void testRefactor7 ( ) throws java.lang.Exception { org.eclipse.core.resources.IProject project = createProject ( com.android.ide.eclipse.adt.internal.refactorings.core.TEST_PROJECT ) ; org.eclipse.core.resources.IFile file = project.getFile ( "res/layout/activity_main.xml" ) ; renameResource ( project , file , true , "newlayout" , ( "CHANGES:\n" + ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "-------\n" + "[x] MainActivity.java - /testRefactor7/src/com/example/refactoringtest/MainActivity.java\n" ) + " @@ -13 +13\n" ) + " - setContentView(R.layout.activity_main);\n" ) + " + setContentView(R.layout.newlayout);\n" ) + "\n" ) + "\n" ) + "[ ] R.java - /testRefactor7/gen/com/example/refactoringtest/R.java\n" ) + " @@ -23 +23\n" ) + " - public static final int activity_main=0x7f030000;\n" ) + " + public static final int newlayout=0x7f030000;\n" ) + "\n" ) + "\n" ) + "[x] Rename \'testRefactor7/res/layout-land/activity_main.xml\' to \'newlayout.xml\'\n" ) + "\n" ) + "[x] Rename 'testRefactor7/res/layout/activity_main.xml' to 'newlayout.xml'" ) ) , null ) ; }
Source:
boolean isListeningForDun ( ) { for ( android.net.NetworkRequest req : listening.values ( ) ) { if ( req.networkCapabilities.hasCapability ( android.net.NetworkCapabilities.NET_CAPABILITY_DUN ) ) { return true ; } } return false ; }

Target:
boolean isListeningForAll ( ) { final android.net.NetworkCapabilities empty = new android.net.NetworkCapabilities ( ) ; empty.clearAll ( ) ; for ( android.net.NetworkRequest req : listening.values ( ) ) { if ( req.networkCapabilities.equalRequestableCapabilities ( empty ) ) { return true ; } } return false ; }
Source:
public org.w3c.dom.Node insertBefore ( org.w3c.dom.Node newChild , org.w3c.dom.Node refChild ) throws org.w3c.dom.DOMException { org.apache.harmony.xml.dom.LeafNodeImpl refChildImpl = ( ( org.apache.harmony.xml.dom.LeafNodeImpl ) ( refChild ) ) ; if ( ( refChildImpl.document ) != ( document ) ) { throw new org.w3c.dom.DOMException ( org.w3c.dom.DOMException.WRONG_DOCUMENT_ERR , null ) ; } if ( ( refChildImpl.parent ) != ( this ) ) { throw new org.w3c.dom.DOMException ( org.w3c.dom.DOMException.HIERARCHY_REQUEST_ERR , null ) ; } return insertChildAt ( newChild , refChildImpl.index ) ; }

Target:
public org.w3c.dom.Node insertBefore ( org.w3c.dom.Node newChild , org.w3c.dom.Node refChild ) throws org.w3c.dom.DOMException { org.apache.harmony.xml.dom.LeafNodeImpl refChildImpl = ( ( org.apache.harmony.xml.dom.LeafNodeImpl ) ( refChild ) ) ; if ( refChildImpl == null ) { return appendChild ( newChild ) ; } if ( ( refChildImpl.document ) != ( document ) ) { throw new org.w3c.dom.DOMException ( org.w3c.dom.DOMException.WRONG_DOCUMENT_ERR , null ) ; } if ( ( refChildImpl.parent ) != ( this ) ) { throw new org.w3c.dom.DOMException ( org.w3c.dom.DOMException.HIERARCHY_REQUEST_ERR , null ) ; } return insertChildAt ( newChild , refChildImpl.index ) ; }
Source:
public synchronized void setMinimumSignificantDigits ( int value ) { properties.setMinimumSignificantDigits ( value ) ; refreshFormatter ( ) ; }

Target:
public synchronized void setMaximumSignificantDigits ( int value ) { int min = properties.getMinimumSignificantDigits ( ) ; if ( ( min >= 0 ) && ( min > value ) ) { properties.setMinimumSignificantDigits ( value ) ; } properties.setMaximumSignificantDigits ( value ) ; refreshFormatter ( ) ; }
Source:
public static void setPrivateDataDirectorySuffix ( java.lang.String suffix ) { if ( ! ( org.chromium.base.PathUtils.sInitializationStarted.getAndSet ( true ) ) ) { assert ( org.chromium.base.ContextUtils.getApplicationContext ( ) ) != null ; org.chromium.base.PathUtils.sDataDirectorySuffix = suffix ; org.chromium.base.PathUtils.sDirPathFetchTask = new android.os.AsyncTask < java.lang.Void , java.lang.Void , java.lang.String [ ] > ( ) { @ java.lang.Override protected java.lang.String [ ] doInBackground ( java.lang.Void ... unused ) { return org.chromium.base.PathUtils.setPrivateDataDirectorySuffixInternal ( ) ; } } . executeOnExecutor ( AsyncTask.THREAD_POOL_EXECUTOR ) ; } }

Target:
public static void setPrivateDataDirectorySuffix ( java.lang.String suffix , android.content.Context context ) { if ( ! ( org.chromium.base.PathUtils.sInitializationStarted.getAndSet ( true ) ) ) { org.chromium.base.PathUtils.sDataDirectorySuffix = suffix ; org.chromium.base.PathUtils.sDataDirectoryAppContext = context.getApplicationContext ( ) ; org.chromium.base.PathUtils.sDirPathFetchTask = new android.os.AsyncTask < java.lang.Void , java.lang.Void , java.lang.String [ ] > ( ) { @ java.lang.Override protected java.lang.String [ ] doInBackground ( java.lang.Void ... unused ) { return org.chromium.base.PathUtils.setPrivateDataDirectorySuffixInternal ( ) ; } } . executeOnExecutor ( AsyncTask.THREAD_POOL_EXECUTOR ) ; } }
Source:
public static boolean BooleanNot ( boolean x ) { return ! x ; }

Target:
public static boolean SmaliBooleanNot ( boolean x ) throws java.lang.Exception { java.lang.Class < ? > c = java.lang.Class.forName ( "BooleanNotSmali" ) ; java.lang.reflect.Method method = c.getMethod ( "BooleanNot" , boolean . class ) ; java.lang.Object retValue = method.invoke ( null , new java.lang.Object [ ] { java.lang.Boolean.valueOf ( x ) } ) ; return ( ( java.lang.Boolean ) ( retValue ) ) . booleanValue ( ) ; }
Source:
public void connectBluetoothAudio ( ) { com.android.server.telecom.Log.v ( this , "connectBluetoothAudio()..." ) ; if ( ( mBluetoothHeadset ) != null ) { if ( ! ( mBluetoothHeadset.connectAudio ( ) ) ) { mHandler.postDelayed ( mRetryConnectAudio.prepare ( ) , com.android.server.telecom.Timeouts.getRetryBluetoothConnectAudioBackoffMillis ( mContext.getContentResolver ( ) ) ) ; } } setBluetoothStatePending ( ) ; }

Target:
public void connectBluetoothAudio ( ) { android.telecom.Log.v ( this , "connectBluetoothAudio()..." ) ; if ( ( mBluetoothHeadset ) != null ) { if ( ! ( mBluetoothHeadset.connectAudio ( ) ) ) { mHandler.postDelayed ( mRetryConnectAudio.prepare ( ) , com.android.server.telecom.Timeouts.getRetryBluetoothConnectAudioBackoffMillis ( mContext.getContentResolver ( ) ) ) ; } } setBluetoothStatePending ( ) ; }