auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void createTag ( com.google.gerrit.reviewdb.client.Project.NameKey name , java.lang.String ref , java.lang.String revision , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.projects.TagInfo > cb ) { com.google.gerrit.client.projects.ProjectApi.TagInput input = com.google.gerrit.client.projects.ProjectApi.TagInput.create ( ) ; input.setRevision ( revision ) ; com.google.gerrit.client.projects.ProjectApi.project ( name ) . view ( "tags" ) . id ( ref ) . ifNoneMatch ( ) . put ( input , cb ) ; }

Target:
public static void createTag ( com.google.gerrit.reviewdb.client.Project.NameKey name , java.lang.String ref , java.lang.String revision , java.lang.String annotation , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.projects.TagInfo > cb ) { com.google.gerrit.client.projects.ProjectApi.TagInput input = com.google.gerrit.client.projects.ProjectApi.TagInput.create ( ) ; input.setRevision ( revision ) ; input.setMessage ( annotation ) ; com.google.gerrit.client.projects.ProjectApi.project ( name ) . view ( "tags" ) . id ( ref ) . ifNoneMatch ( ) . put ( input , cb ) ; }
Source:
void markReviewed ( com.google.gwt.core.client.JsArrayString reviewed ) { for ( int i = 0 ; i < ( reviewed.length ( ) ) ; i ++ ) { com.google.gerrit.client.diff.FileInfo info = map.get ( reviewed.get ( i ) ) ; if ( info != null ) { getReviewed ( info ) . setChecked ( true ) ; } } }

Target:
void markReviewed ( com.google.gwt.core.client.JsArrayString reviewed ) { for ( int i = 0 ; i < ( reviewed.length ( ) ) ; i ++ ) { com.google.gerrit.client.info.FileInfo info = map.get ( reviewed.get ( i ) ) ; if ( info != null ) { getReviewed ( info ) . setChecked ( true ) ; } } }
Source:
public final V call ( ) throws java.lang.Exception { try ( com.google.gerrit.server.util.ManualRequestContext ctx = requestContext.open ( ) ) { return impl ( ctx ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.index.change.ReindexAfterUpdate.log.error ( ( "Failed to reindex changes after " + ( event ) ) , e ) ; throw e ; } }

Target:
public final V call ( ) throws java.lang.Exception { try ( com.google.gerrit.server.util.ManualRequestContext ctx = requestContext.open ( ) ) { return impl ( ctx ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.index.change.ReindexAfterRefUpdate.log.error ( ( "Failed to reindex changes after " + ( event ) ) , e ) ; throw e ; } }
Source:
public java.util.Collection < java.lang.String > getWarnings ( com.google.gerrit.reviewdb.client.Project project ) throws com.google.gwtorm.server.OrmException ;

Target:
public void delete ( com.google.gerrit.reviewdb.client.Project project ) throws com.google.gwtorm.server.OrmException { java.sql.Connection conn = ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) . getConnection ( ) ; try { conn.setAutoCommit ( false ) ; try { atomicDelete ( project ) ; conn.commit ( ) ; } finally { conn.setAutoCommit ( true ) ; } } catch ( java.sql.SQLException e ) { try { conn.rollback ( ) ; } catch ( java.sql.SQLException ex ) { throw new com.google.gwtorm.server.OrmException ( ex ) ; } throw new com.google.gwtorm.server.OrmException ( e ) ; } }
Source:
public java.lang.Object createTest ( ) throws java.lang.Exception { java.lang.Object test = getTestClass ( ) . getJavaClass ( ) . newInstance ( ) ; parameterField.set ( test , new com.google.gerrit.testutil.Config ( cfg ) ) ; if ( ( nameField ) != null ) { nameField.set ( test , name ) ; } return test ; }

Target:
public java.lang.Object createTest ( ) throws java.lang.Exception { java.lang.Object test = getTestClass ( ) . getJavaClass ( ) . newInstance ( ) ; parameterField.set ( test , new com.google.gerrit.testing.Config ( cfg ) ) ; if ( ( nameField ) != null ) { nameField.set ( test , name ) ; } return test ; }
Source:
protected void run ( ) throws com.google.gerrit.sshd.plugin.UnloggedFailure , java.lang.Exception { com.google.gerrit.sshd.plugin.LfsPluginAuthCommand.LfsSshPluginAuth pluginAuth = auth.get ( ) ; }

Target:
protected void run ( ) throws com.google.gerrit.sshd.plugin.UnloggedFailure , java.lang.Exception { com.google.gerrit.sshd.plugin.LfsPluginAuthCommand.LfsSshPluginAuth pluginAuth = auth.get ( ) ; if ( pluginAuth == null ) { com.google.gerrit.sshd.plugin.LfsPluginAuthCommand.log.warn ( com.google.gerrit.sshd.plugin.LfsPluginAuthCommand.CONFIGURATION_ERROR ) ; throw new com.google.gerrit.sshd.plugin.UnloggedFailure ( 1 , com.google.gerrit.sshd.plugin.LfsPluginAuthCommand.CONFIGURATION_ERROR ) ; } stdout.print ( pluginAuth.authenticate ( user.get ( ) , args ) ) ; }
Source:
void finish ( ) { try { id = com.google.common.base.Joiner.on ( '~' ) . join ( java.net.URLEncoder.encode ( project , "UTF-8" ) , java.net.URLEncoder.encode ( branch , "UTF-8" ) , java.net.URLEncoder.encode ( changeId , "UTF-8" ) ) ; } catch ( java.io.UnsupportedEncodingException e ) { com.google.gerrit.server.query.change.ListChanges.log.error ( "Cannot encode components for id" , e ) ; } }

Target:
void finish ( ) { try { id = com.google.common.base.Joiner.on ( '~' ) . join ( java.net.URLEncoder.encode ( project , "UTF-8" ) , java.net.URLEncoder.encode ( branch , "UTF-8" ) , java.net.URLEncoder.encode ( changeId , "UTF-8" ) ) ; } catch ( java.io.UnsupportedEncodingException e ) { com.google.gerrit.server.change.ChangeJson.log.error ( "Cannot encode components for id" , e ) ; } }
Source:
public void dropColumn ( com.google.gwtorm.client.StatementExecutor e , java.lang.String tableName , java.lang.String column ) throws com.google.gwtorm.client.OrmException { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( "ALTER TABLE " ) ; r.append ( tableName ) ; r.append ( " DROP COLUMN " ) ; r.append ( column ) ; e.execute ( r.toString ( ) ) ; }

Target:
public void dropColumn ( com.google.gwtorm.server.StatementExecutor e , java.lang.String tableName , java.lang.String column ) throws com.google.gwtorm.server.OrmException { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( "ALTER TABLE " ) ; r.append ( tableName ) ; r.append ( " DROP COLUMN " ) ; r.append ( column ) ; e.execute ( r.toString ( ) ) ; }
Source:
private java.lang.String createServiceUserNote ( java.lang.String branch , com.googlesource.gerrit.plugins.serviceuser.GetServiceUser.ServiceUserInfo serviceUser ) throws com.google.gwtorm.server.OrmException { com.googlesource.gerrit.plugins.serviceuser.HeaderFormatter fmt = new com.googlesource.gerrit.plugins.serviceuser.HeaderFormatter ( gerritServerIdent.getTimeZone ( ) , anonymousCowardName ) ; fmt.appendDate ( ) ; fmt.append ( "Project" , project.get ( ) ) ; fmt.append ( "Branch" , branch ) ; fmt.appendUser ( com.googlesource.gerrit.plugins.serviceuser.CreateServiceUser.KEY_CREATED_BY , serviceUser.createdBy ) ; for ( com.google.gerrit.server.account.AccountInfo owner : serviceUserResolver.listActiveOwners ( serviceUser ) ) { fmt.appendUser ( com.googlesource.gerrit.plugins.serviceuser.CreateServiceUser.KEY_OWNER , owner ) ; } return fmt.toString ( ) ; }

Target:
private java.lang.String createServiceUserNote ( java.lang.String branch , com.googlesource.gerrit.plugins.serviceuser.GetServiceUser.ServiceUserInfo serviceUser ) throws com.google.gwtorm.server.OrmException { com.googlesource.gerrit.plugins.serviceuser.HeaderFormatter fmt = new com.googlesource.gerrit.plugins.serviceuser.HeaderFormatter ( gerritServerIdent.getTimeZone ( ) , anonymousCowardName ) ; fmt.appendDate ( ) ; fmt.append ( "Project" , project.get ( ) ) ; fmt.append ( "Branch" , branch ) ; fmt.appendUser ( com.googlesource.gerrit.plugins.serviceuser.CreateServiceUser.KEY_CREATED_BY , serviceUser.createdBy ) ; for ( com.google.gerrit.extensions.common.AccountInfo owner : serviceUserResolver.listActiveOwners ( serviceUser ) ) { fmt.appendUser ( com.googlesource.gerrit.plugins.serviceuser.CreateServiceUser.KEY_OWNER , owner ) ; } return fmt.toString ( ) ; }
Source:
private void logWarn ( java.lang.String msg ) { if ( com.google.gerrit.server.git.MergeOp.log.isWarnEnabled ( ) ) { com.google.gerrit.server.git.MergeOp.log.warn ( ( ( ( "[" + ( submissionId ) ) + "]" ) + msg ) ) ; } }

Target:
private void logError ( java.lang.String msg , java.lang.Throwable t ) { if ( com.google.gerrit.server.git.MergeOp.log.isErrorEnabled ( ) ) { if ( t != null ) { com.google.gerrit.server.git.MergeOp.log.error ( ( ( submissionId ) + msg ) , t ) ; } else { com.google.gerrit.server.git.MergeOp.log.error ( ( ( submissionId ) + msg ) ) ; } } }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; Util.DETAIL_SVC.patchSetPublishDetail ( patchSetId , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.common.data.PatchSetPublishDetail > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gerrit.common.data.PatchSetPublishDetail result ) { send.setEnabled ( true ) ; display ( result ) ; } @ java.lang.Override protected void postDisplay ( ) { message.setFocus ( true ) ; } } ) ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; com.google.gerrit.client.rpc.CallbackGroup cbs = new com.google.gerrit.client.rpc.CallbackGroup ( ) ; Util.DETAIL_SVC.patchSetPublishDetail ( patchSetId , cbs.addGwtjsonrpc ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.common.data.PatchSetPublishDetail > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gerrit.common.data.PatchSetPublishDetail result ) { send.setEnabled ( true ) ; display ( result ) ; } @ java.lang.Override protected void postDisplay ( ) { message.setFocus ( true ) ; } } ) ) ; }
Source:
public void queryChangesNoResults ( ) throws java.lang.Exception { createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = query ( "status:open" ) ; com.google.common.truth.Truth.assertThat ( results ) . hasSize ( 1 ) ; results = query ( "status:closed" ) ; com.google.common.truth.Truth.assertThat ( results ) . isEmpty ( ) ; }

Target:
public void queryChangesNoResults ( ) throws java.lang.Exception { createChange ( ) ; com.google.common.truth.Truth.assertThat ( query ( "message:test" ) ) . isNotEmpty ( ) ; com.google.common.truth.Truth.assertThat ( query ( ( ( "message:{" + ( getClass ( ) . getName ( ) ) ) + "fhqwhgads}" ) ) ) . isEmpty ( ) ; }
Source:
public static java.lang.String toLongString ( final com.google.gerrit.reviewdb.client.Project.SubmitType type ) { if ( type == null ) { return "" ; } switch ( type ) { case FAST_FORWARD_ONLY : return com.google.gerrit.client.admin.Util.C.projectSubmitType_FAST_FORWARD_ONLY ( ) ; case MERGE_IF_NECESSARY : return com.google.gerrit.client.admin.Util.C.projectSubmitType_MERGE_IF_NECESSARY ( ) ; case MERGE_ALWAYS : return com.google.gerrit.client.admin.Util.C.projectSubmitType_MERGE_ALWAYS ( ) ; case CHERRY_PICK : return com.google.gerrit.client.admin.Util.C.projectSubmitType_CHERRY_PICK ( ) ; default : return type.name ( ) ; } }

Target:
public static java.lang.String toLongString ( final com.google.gerrit.reviewdb.client.Project.SubmitType type ) { if ( type == null ) { return "" ; } switch ( type ) { case FAST_FORWARD_ONLY : return com.google.gerrit.client.admin.Util.C.projectSubmitType_FAST_FORWARD_ONLY ( ) ; case MERGE_IF_NECESSARY : return com.google.gerrit.client.admin.Util.C.projectSubmitType_MERGE_IF_NECESSARY ( ) ; case REBASE_IF_NECESSARY : return com.google.gerrit.client.admin.Util.C.projectSubmitType_REBASE_IF_NECESSARY ( ) ; case MERGE_ALWAYS : return com.google.gerrit.client.admin.Util.C.projectSubmitType_MERGE_ALWAYS ( ) ; case CHERRY_PICK : return com.google.gerrit.client.admin.Util.C.projectSubmitType_CHERRY_PICK ( ) ; default : return type.name ( ) ; } }
Source:
public void abandonWipChangeInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; abandon ( sc.changeId , sc.owner ) ; assertThat ( sender ) . notSent ( ) ; }

Target:
public void abandonWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; abandon ( sc.changeId , sc.owner ) ; assertThat ( sender ) . notSent ( ) ; }
Source:
public boolean isNotify ( final com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType type ) { switch ( type ) { case NEW_CHANGES : return notifyNewChanges ; case NEW_PATCHSETS : return notifyNewPatchSets ; case ALL_COMMENTS : return notifyAllComments ; case SUBMITTED_CHANGES : return notifySubmittedChanges ; case ALL : break ; } return false ; }

Target:
public boolean isNotify ( final com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType type ) { switch ( type ) { case NEW_CHANGES : return notifyNewChanges ; case NEW_PATCHSETS : return notifyNewPatchSets ; case ALL_COMMENTS : return notifyAllComments ; case SUBMITTED_CHANGES : return notifySubmittedChanges ; case ABANDONED_CHANGES : return notifyAbandonedChanges ; case ALL : break ; } return false ; }
Source:
private static java.lang.String get ( org.eclipse.jgit.lib.Config cfg , java.lang.String name , java.lang.String key ) { java.lang.String val = cfg.getString ( "library" , name , key ) ; if ( ( val == null ) || ( val.isEmpty ( ) ) ) { throw new java.lang.IllegalStateException ( ( ( ( ( ( "Variable library." + name ) + "." ) + key ) + " is required within " ) + ( com.google.gerrit.pgm.util.Libraries.RESOURCE_FILE ) ) ) ; } return val ; }

Target:
private static java.lang.String get ( org.eclipse.jgit.lib.Config cfg , java.lang.String name , java.lang.String key ) { java.lang.String val = cfg.getString ( "library" , name , key ) ; if ( ( val == null ) || ( val.isEmpty ( ) ) ) { throw new java.lang.IllegalStateException ( ( ( ( ( ( "Variable library." + name ) + "." ) + key ) + " is required within " ) + ( com.google.gerrit.pgm.init.Libraries.RESOURCE_FILE ) ) ) ; } return val ; }
Source:
public void setUpMocks ( ) { changeId = Change.Id.parse ( java.lang.Integer.toString ( com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandlerTest.CHANGE_ID ) ) ; accountId = Account.Id.parse ( java.lang.Integer.toString ( com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandlerTest.ACCOUNT_ID ) ) ; accountGroupUUID = AccountGroup.UUID.parse ( com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandlerTest.UUID ) ; indexEventHandler = new com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandler ( com.google.common.util.concurrent.MoreExecutors.directExecutor ( ) , com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandlerTest.PLUGIN_NAME , forwarder ) ; }

Target:
public void setUpMocks ( ) { changeId = Change.Id.parse ( java.lang.Integer.toString ( com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandlerTest.CHANGE_ID ) ) ; accountId = Account.Id.tryParse ( java.lang.Integer.toString ( com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandlerTest.ACCOUNT_ID ) ) . get ( ) ; accountGroupUUID = AccountGroup.UUID.parse ( com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandlerTest.UUID ) ; indexEventHandler = new com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandler ( com.google.common.util.concurrent.MoreExecutors.directExecutor ( ) , com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandlerTest.PLUGIN_NAME , forwarder ) ; }
Source:
private void starChange ( boolean on , com.google.gerrit.reviewdb.client.Change.Id id ) throws java.io.IOException { java.lang.String url = "/accounts/self/starred.changes/" + ( id.get ( ) ) ; if ( on ) { com.google.gerrit.acceptance.RestResponse r = adminSession.put ( url ) ; org.junit.Assert.assertEquals ( 204 , r.getStatusCode ( ) ) ; } else { com.google.gerrit.acceptance.RestResponse r = adminSession.delete ( url ) ; org.junit.Assert.assertEquals ( 204 , r.getStatusCode ( ) ) ; } }

Target:
private void starChange ( boolean on , com.google.gerrit.reviewdb.client.Change.Id id ) throws java.io.IOException { java.lang.String url = "/accounts/self/starred.changes/" + ( id.get ( ) ) ; if ( on ) { com.google.gerrit.acceptance.RestResponse r = adminSession.put ( url ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_NO_CONTENT ) ; } else { com.google.gerrit.acceptance.RestResponse r = adminSession.delete ( url ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_NO_CONTENT ) ; } }
Source:
public UiAction.Description getDescription ( com.google.gerrit.server.change.RevisionResource resource ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Rebase" ) . setTitle ( "Rebase onto tip of branch or parent change" ) . setVisible ( ( ( ( resource.getChange ( ) . getStatus ( ) . isOpen ( ) ) && ( resource.getControl ( ) . canRebase ( ) ) ) && ( rebaseChange.get ( ) . canRebase ( resource ) ) ) ) ; }

Target:
public UiAction.Description getDescription ( com.google.gerrit.server.change.RevisionResource resource ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Rebase" ) . setTitle ( "Rebase onto tip of branch or parent change" ) . setVisible ( ( ( ( ( resource.getChange ( ) . getStatus ( ) . isOpen ( ) ) && ( resource.isCurrent ( ) ) ) && ( resource.getControl ( ) . canRebase ( ) ) ) && ( hasOneParent ( resource.getPatchSet ( ) . getId ( ) ) ) ) ) ; }
Source:
private void addMessage ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx , com.google.gerrit.server.notedb.ChangeUpdate update ) throws com.google.gwtorm.server.OrmException { java.lang.StringBuilder msg = new java.lang.StringBuilder ( ) ; appendHashtagMessage ( msg , "added" , toAdd ) ; appendHashtagMessage ( msg , "removed" , toRemove ) ; com.google.gerrit.reviewdb.client.ChangeMessage cmsg = com.google.gerrit.server.ChangeMessagesUtil.newMessage ( ctx , msg.toString ( ) ) ; cmUtil.addChangeMessage ( ctx.getDb ( ) , update , cmsg ) ; }

Target:
private void addMessage ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx , com.google.gerrit.server.notedb.ChangeUpdate update ) throws com.google.gwtorm.server.OrmException { java.lang.StringBuilder msg = new java.lang.StringBuilder ( ) ; appendHashtagMessage ( msg , "added" , toAdd ) ; appendHashtagMessage ( msg , "removed" , toRemove ) ; com.google.gerrit.reviewdb.client.ChangeMessage cmsg = com.google.gerrit.server.ChangeMessagesUtil.newMessage ( ctx , msg.toString ( ) , ChangeMessagesUtil.TAG_SET_HASHTAGS ) ; cmUtil.addChangeMessage ( ctx.getDb ( ) , update , cmsg ) ; }
Source:
public static void setNotCacheable ( javax.servlet.http.HttpServletResponse res ) { java.lang.String cc = "no-cache, no-store, max-age=0, must-revalidate" ; res.setHeader ( "Cache-Control" , cc ) ; res.setHeader ( "Pragma" , "no-cache" ) ; res.setHeader ( "Expires" , "Fri, 01 Jan 1990 00:00:00 GMT" ) ; res.setDateHeader ( "Date" , java.lang.System.currentTimeMillis ( ) ) ; }

Target:
public static void setNotCacheable ( javax.servlet.http.HttpServletResponse res ) { java.lang.String cc = "no-cache, no-store, max-age=0, must-revalidate" ; res.setHeader ( "Cache-Control" , cc ) ; res.setHeader ( "Pragma" , "no-cache" ) ; res.setHeader ( "Expires" , "Mon, 01 Jan 1990 00:00:00 GMT" ) ; res.setDateHeader ( "Date" , java.lang.System.currentTimeMillis ( ) ) ; }
Source:
private static org.apache.lucene.search.Sort getSort ( ) { return new org.apache.lucene.search.Sort ( new org.apache.lucene.search.SortField ( ChangeField.UPDATED.getName ( ) , SortField.Type.LONG , true ) , new org.apache.lucene.search.SortField ( ChangeField.LEGACY_ID.getName ( ) , SortField.Type.INT , true ) ) ; }

Target:
private org.apache.lucene.search.Sort getSort ( ) { if ( useDocValuesForSorting ) { return new org.apache.lucene.search.Sort ( new org.apache.lucene.search.SortField ( com.google.gerrit.lucene.LuceneChangeIndex.UPDATED_SORT_FIELD , SortField.Type.LONG , true ) , new org.apache.lucene.search.SortField ( com.google.gerrit.lucene.LuceneChangeIndex.ID_SORT_FIELD , SortField.Type.LONG , true ) ) ; } else { return new org.apache.lucene.search.Sort ( new org.apache.lucene.search.SortField ( ChangeField.UPDATED.getName ( ) , SortField.Type.LONG , true ) , new org.apache.lucene.search.SortField ( ChangeField.LEGACY_ID.getName ( ) , SortField.Type.INT , true ) ) ; } }
Source:
private com.google.gerrit.server.notedb.NoteDbUpdateManager.OpenRepo openRepo ( com.google.gerrit.reviewdb.client.Project.NameKey p ) throws java.io.IOException { org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( p ) ; org.eclipse.jgit.lib.ObjectInserter ins = repo.newObjectInserter ( ) ; return new com.google.gerrit.server.notedb.NoteDbUpdateManager.OpenRepo ( repo , new org.eclipse.jgit.revwalk.RevWalk ( ins.newReader ( ) ) , ins , new com.google.gerrit.server.update.ChainedReceiveCommands ( repo ) , true ) ; }

Target:
public void close ( ) { reader.close ( ) ; super . close ( ) ; }
Source:
public java.util.List < com.google.gerrit.extensions.common.SshKeyInfo > apply ( com.google.gerrit.server.account.AccountResource rsrc ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException , org.eclipse.jgit.errors.RepositoryNotFoundException { if ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) { permissionBackend.user ( self ) . check ( GlobalPermission.MODIFY_ACCOUNT ) ; } return apply ( rsrc.getUser ( ) ) ; }

Target:
public java.util.List < com.google.gerrit.extensions.common.SshKeyInfo > apply ( com.google.gerrit.server.account.AccountResource rsrc ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException , org.eclipse.jgit.errors.RepositoryNotFoundException { if ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) { permissionBackend.currentUser ( ) . check ( GlobalPermission.MODIFY_ACCOUNT ) ; } return apply ( rsrc.getUser ( ) ) ; }
Source:
private void startPoller ( ) { if ( ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) && ( 0 < ( com.google.gerrit.client.Gerrit.getConfig ( ) . getChangeUpdateDelay ( ) ) ) ) { updateCheck = new com.google.gerrit.client.change.UpdateCheckTimer ( this ) ; updateCheck.schedule ( ) ; handlers.add ( com.google.gerrit.client.ui.UserActivityMonitor.addValueChangeHandler ( updateCheck ) ) ; } }

Target:
private void startPoller ( ) { if ( ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) && ( 0 < ( com.google.gerrit.client.Gerrit.info ( ) . change ( ) . updateDelay ( ) ) ) ) { updateCheck = new com.google.gerrit.client.change.UpdateCheckTimer ( this ) ; updateCheck.schedule ( ) ; handlers.add ( com.google.gerrit.client.ui.UserActivityMonitor.addValueChangeHandler ( updateCheck ) ) ; } }
Source:
public void testUsernamePatternCanUploadToAnyRef ( ) { grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/users/${username}/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , "a-registered-user" ) ; org.junit.Assert.assertTrue ( "can upload" , ( ( u.canPushToAtLeastOneRef ( ) ) == ( com.google.gerrit.common.data.Capable.OK ) ) ) ; }

Target:
public void testUsernamePatternCanUploadToAnyRef ( ) { com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/users/${username}/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , "a-registered-user" ) ; org.junit.Assert.assertTrue ( "can upload" , ( ( u.canPushToAtLeastOneRef ( ) ) == ( com.google.gerrit.common.data.Capable.OK ) ) ) ; }
Source:
void display ( final java.util.List < com.google.gerrit.client.reviewdb.AccountGroup > result ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.client.reviewdb.AccountGroup k : result ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; populate ( row , k ) ; } }

Target:
void display ( final java.util.List < com.google.gerrit.client.reviewdb.AccountGroup > result ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.client.reviewdb.AccountGroup k : result ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , k ) ; } }
Source:
public void onKeyDown ( com.google.gwt.event.dom.client.KeyDownEvent event ) { if ( ( event.getNativeKeyCode ( ) ) == ( com.google.gwt.event.dom.client.KeyCodes.KEY_ENTER ) ) { if ( ( userPopup.isShowing ( ) ) && ( userPopup.isVisible ( ) ) ) { userPopup.hide ( ) ; } else { userPopup.showRelativeTo ( l ) ; } event.preventDefault ( ) ; } }

Target:
public void onKeyDown ( com.google.gwt.event.dom.client.KeyDownEvent event ) { if ( ( event.getNativeKeyCode ( ) ) == ( com.google.gwt.event.dom.client.KeyCodes.KEY_ENTER ) ) { showHidePopup ( ) ; event.preventDefault ( ) ; } }
Source:
public static org.eclipse.jgit.transport.PushResult pushHead ( org.eclipse.jgit.api.Git git , java.lang.String ref , boolean pushTags ) throws org.eclipse.jgit.api.errors.GitAPIException { org.eclipse.jgit.api.PushCommand pushCmd = git.push ( ) ; pushCmd.setRefSpecs ( new org.eclipse.jgit.transport.RefSpec ( ( "HEAD:" + ref ) ) ) ; if ( pushTags ) { pushCmd.setPushTags ( ) ; } java.lang.Iterable < org.eclipse.jgit.transport.PushResult > r = pushCmd.call ( ) ; return com.google.common.collect.Iterables.getOnlyElement ( r ) ; }

Target:
public static org.eclipse.jgit.transport.PushResult pushHead ( org.eclipse.jgit.api.Git git , java.lang.String ref , boolean pushTags , boolean force ) throws org.eclipse.jgit.api.errors.GitAPIException { org.eclipse.jgit.api.PushCommand pushCmd = git.push ( ) ; pushCmd.setForce ( force ) ; pushCmd.setRefSpecs ( new org.eclipse.jgit.transport.RefSpec ( ( "HEAD:" + ref ) ) ) ; if ( pushTags ) { pushCmd.setPushTags ( ) ; } java.lang.Iterable < org.eclipse.jgit.transport.PushResult > r = pushCmd.call ( ) ; return com.google.common.collect.Iterables.getOnlyElement ( r ) ; }
Source:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; if ( sshd ) { modules.add ( sysInjector.getInstance ( com.google.gerrit.sshd.SshModule.class ) ) ; if ( slave ) { modules.add ( new com.google.gerrit.sshd.commands.SlaveCommandModule ( ) ) ; } else { modules.add ( new com.google.gerrit.sshd.commands.MasterCommandModule ( ) ) ; } } else { modules.add ( new com.google.gerrit.server.ssh.NoSshModule ( ) ) ; } return sysInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; if ( sshd ) { modules.add ( sysInjector.getInstance ( com.google.gerrit.sshd.SshModule.class ) ) ; if ( ! ( test ) ) { modules.add ( new com.google.gerrit.sshd.SshHostKeyModule ( ) ) ; } if ( slave ) { modules.add ( new com.google.gerrit.sshd.commands.SlaveCommandModule ( ) ) ; } else { modules.add ( new com.google.gerrit.sshd.commands.MasterCommandModule ( ) ) ; } } else { modules.add ( new com.google.gerrit.server.ssh.NoSshModule ( ) ) ; } return sysInjector.createChildInjector ( modules ) ; }
Source:
public boolean equals ( final java.lang.Object o ) { if ( o instanceof com.google.gerrit.server.patch.IntraLineDiffKey ) { final com.google.gerrit.server.patch.IntraLineDiffKey k = ( ( com.google.gerrit.server.patch.IntraLineDiffKey ) ( o ) ) ; return ( aId.equals ( k.aId ) ) && ( bId.equals ( k.bId ) ) ; } return false ; }

Target:
public boolean equals ( final java.lang.Object o ) { if ( o instanceof com.google.gerrit.server.patch.IntraLineDiffKey ) { final com.google.gerrit.server.patch.IntraLineDiffKey k = ( ( com.google.gerrit.server.patch.IntraLineDiffKey ) ( o ) ) ; return ( ( aId.equals ( k.aId ) ) && ( bId.equals ( k.bId ) ) ) && ( ( ignoreWhitespace ) == ( k.ignoreWhitespace ) ) ; } return false ; }
Source:
static byte [ ] toByteArray ( com.google.gerrit.reviewdb.client.Project.NameKey project , java.lang.String pat ) { return ( ( ( project.toString ( ) ) + ':' ) + pat ) . getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ; }

Target:
byte [ ] toByteArray ( com.google.gerrit.reviewdb.client.Project.NameKey project ) { byte [ ] a = ( ( ( ( project.toString ( ) ) + ':' ) + ( ref ( ) ) ) + ':' ) . getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ; byte [ ] b = new byte [ ( a.length ) + ( org.eclipse.jgit.lib.Constants.OBJECT_ID_STRING_LENGTH ) ] ; java.lang.System.arraycopy ( a , 0 , b , 0 , a.length ) ; id ( ) . copyTo ( b , a.length ) ; return b ; }
Source:
public boolean equals ( java.lang.Object other ) { if ( other == null ) { return false ; } if ( ( getClass ( ) ) == ( other.getClass ( ) ) ) { final com.google.gerrit.server.query.OperatorPredicate < ? > p = ( ( com.google.gerrit.server.query.OperatorPredicate < ? > ) ( other ) ) ; return ( getOperator ( ) . equals ( p.getOperator ( ) ) ) && ( getValue ( ) . equals ( p.getValue ( ) ) ) ; } return false ; }

Target:
public boolean equals ( java.lang.Object other ) { if ( other == null ) { return false ; } if ( ( getClass ( ) ) == ( other.getClass ( ) ) ) { final com.google.gerrit.index.query.OperatorPredicate < ? > p = ( ( com.google.gerrit.index.query.OperatorPredicate < ? > ) ( other ) ) ; return ( getOperator ( ) . equals ( p.getOperator ( ) ) ) && ( getValue ( ) . equals ( p.getValue ( ) ) ) ; } return false ; }
Source:
public void setHttpInjector ( com.google.inject.Injector injector ) { httpModule = copy ( injector ) ; httpGen = injector.getProvider ( com.google.gerrit.server.plugins.ModuleGenerator.class ) ; httpItems = com.google.gerrit.extensions.registration.PrivateInternals_DynamicTypes.dynamicItemsOf ( injector ) ; httpSets = com.google.gerrit.extensions.registration.PrivateInternals_DynamicTypes.dynamicSetsOf ( injector ) ; httpMaps = com.google.gerrit.extensions.registration.PrivateInternals_DynamicTypes.dynamicMapsOf ( injector ) ; onStart.addAll ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.listeners ( injector , com.google.gerrit.server.plugins.StartPluginListener.class ) ) ; onStop.addAll ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.listeners ( injector , com.google.gerrit.server.plugins.StopPluginListener.class ) ) ; onReload.addAll ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.listeners ( injector , com.google.gerrit.server.plugins.ReloadPluginListener.class ) ) ; }

Target:
public void setHttpInjector ( com.google.inject.Injector injector ) { httpModule = copy ( injector ) ; httpGen = injector.getProvider ( com.google.gerrit.server.plugins.HttpModuleGenerator.class ) ; httpItems = com.google.gerrit.extensions.registration.PrivateInternals_DynamicTypes.dynamicItemsOf ( injector ) ; httpSets = com.google.gerrit.extensions.registration.PrivateInternals_DynamicTypes.dynamicSetsOf ( injector ) ; httpMaps = com.google.gerrit.extensions.registration.PrivateInternals_DynamicTypes.dynamicMapsOf ( injector ) ; onStart.addAll ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.listeners ( injector , com.google.gerrit.server.plugins.StartPluginListener.class ) ) ; onStop.addAll ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.listeners ( injector , com.google.gerrit.server.plugins.StopPluginListener.class ) ) ; onReload.addAll ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.listeners ( injector , com.google.gerrit.server.plugins.ReloadPluginListener.class ) ) ; }
Source:
public void fire ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.Change revertChange ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } try { fire ( util.changeInfo ( change ) , util.changeInfo ( revertChange ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.extensions.events.ChangeReverted.log.error ( "Couldn't fire event" , e ) ; } }

Target:
public void fire ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.Change revertChange , java.sql.Timestamp when ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } try { fire ( util.changeInfo ( change ) , util.changeInfo ( revertChange ) , when ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.extensions.events.ChangeReverted.log.error ( "Couldn't fire event" , e ) ; } }
Source:
public int compare ( com.google.gerrit.reviewdb.AccountExternalId a , com.google.gerrit.reviewdb.AccountExternalId b ) { return emailOf ( a ) . compareTo ( emailOf ( b ) ) ; }

Target:
public void onSuccess ( final java.util.Set < com.google.gerrit.reviewdb.AccountExternalId.Key > removed ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { final com.google.gerrit.reviewdb.AccountExternalId k = getRowItem ( row ) ; if ( ( k != null ) && ( removed.contains ( k.getKey ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } updateDeleteButton ( ) ; }
Source:
public void testParseNonVisibleCommitSha ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit other = repo.commit ( ) . create ( ) ; assertEquals ( null , parser.parse ( other.name ( ) ) ) ; repo.branch ( "other" ) . update ( other ) ; assertEquals ( new com.google.gitiles.RevisionParser.Result ( com.google.gitiles.Revision.peeled ( other.name ( ) , other ) ) , parser.parse ( other.name ( ) ) ) ; }

Target:
public void testParseNonVisibleCommitSha ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit other = repo.commit ( ) . create ( ) ; repo.branch ( "master" ) . commit ( ) . create ( ) ; assertEquals ( null , parser.parse ( other.name ( ) ) ) ; repo.branch ( "other" ) . update ( other ) ; assertEquals ( new com.google.gitiles.RevisionParser.Result ( com.google.gitiles.Revision.peeled ( other.name ( ) , other ) ) , parser.parse ( other.name ( ) ) ) ; }
Source:
public void testPatternNullMatch ( ) { com.googlesource.gerrit.plugins.hooks.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "commentLink" , "ItsTestName" , "match" ) ) . andReturn ( null ) . atLeastOnce ( ) ; replayMocks ( ) ; assertNull ( "Pattern for null match is not null" , itsConfig.getIssuePattern ( ) ) ; }

Target:
public void testPatternNullMatch ( ) { com.googlesource.gerrit.plugins.hooks.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "commentlink" , "ItsTestName" , "match" ) ) . andReturn ( null ) . atLeastOnce ( ) ; replayMocks ( ) ; assertNull ( "Pattern for null match is not null" , itsConfig.getIssuePattern ( ) ) ; }
Source:
public java.lang.String getPassword ( java.lang.String username ) { for ( com.google.gerrit.reviewdb.AccountExternalId id : getExternalIds ( ) ) { if ( ( id.isScheme ( AccountExternalId.SCHEME_USERNAME ) ) && ( username.equals ( id.getSchemeRest ( ) ) ) ) { return id.getPassword ( ) ; } } return null ; }

Target:
public java.util.Collection < com.google.gerrit.reviewdb.AccountExternalId > getExternalIds ( java.lang.String emailAddress ) { java.util.List < com.google.gerrit.reviewdb.AccountExternalId > r = com.google.common.collect.Lists.newArrayListWithCapacity ( externalIds.size ( ) ) ; for ( com.google.gerrit.reviewdb.AccountExternalId extId : externalIds ) { java.lang.String accEmail = extId.getEmailAddress ( ) ; if ( ( accEmail != null ) && ( accEmail.equals ( emailAddress ) ) ) { r.add ( extId ) ; } } return r ; }
Source:
protected void configure ( ) { bind ( com.googlesource.gerrit.plugins.serviceuser.ServiceUserCollection.class ) ; child ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "serviceusers" ) . to ( com.googlesource.gerrit.plugins.serviceuser.ServiceUserCollection.class ) ; install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . build ( CreateServiceUser.Factory.class ) ) ; }

Target:
protected void configure ( ) { bind ( com.googlesource.gerrit.plugins.serviceuser.ServiceUserCollection.class ) ; child ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "serviceusers" ) . to ( com.googlesource.gerrit.plugins.serviceuser.ServiceUserCollection.class ) ; install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . build ( CreateServiceUser.Factory.class ) ) ; get ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "messages" ) . to ( com.googlesource.gerrit.plugins.serviceuser.GetMessages.class ) ; }
Source:
void addReviewer ( final java.lang.String nameOrEmail ) throws org.kohsuke.args4j.CmdLineException { try { reviewerId.add ( toAccountId ( nameOrEmail ) ) ; } catch ( javax.security.auth.login.AccountNotFoundException e ) { throw new org.kohsuke.args4j.CmdLineException ( e.getMessage ( ) ) ; } catch ( com.google.gwtorm.client.OrmException e ) { throw new org.kohsuke.args4j.CmdLineException ( "database is down" ) ; } }

Target:
void addReviewer ( final java.lang.String nameOrEmail ) throws org.kohsuke.args4j.CmdLineException { try { reviewerId.add ( toAccountId ( nameOrEmail ) ) ; } catch ( com.google.gerrit.client.rpc.NoSuchAccountException e ) { throw new org.kohsuke.args4j.CmdLineException ( e.getMessage ( ) ) ; } catch ( com.google.gwtorm.client.OrmException e ) { throw new org.kohsuke.args4j.CmdLineException ( "database is down" ) ; } }
Source:
private com.google.inject.Injector createSshInjector ( final com.google.inject.Injector sysInjector ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( new com.google.gerrit.sshd.SshModule ( ) ) ; if ( slave ) { modules.add ( new com.google.gerrit.sshd.commands.SlaveCommandModule ( ) ) ; } else { modules.add ( new com.google.gerrit.sshd.commands.MasterCommandModule ( ) ) ; modules.add ( new com.google.gerrit.server.config.GerritMasterLifecycle ( ) ) ; } return sysInjector.createChildInjector ( modules ) ; }

Target:
void setDisableSshd ( final boolean arg ) { sshd = false ; }
Source:
public void newPatchSetOnWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%wip" , sc.owner ) ; assertThat ( sender ) . notSent ( ) ; }

Target:
public void newPatchSetOnWipChangeNotifyAllInReviewDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; pushTo ( sc , "refs/for/master%wip,notify=ALL" , sc.owner ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . to ( sc.reviewer , sc.ccer ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) . noOneElse ( ) ; }
Source:
java.lang.String getPath ( ) { return path ; }

Target:
java.lang.Runnable maybeNextCmSearch ( final net.codemirror.lib.CodeMirror cm ) { return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { if ( cm.hasSearchHighlight ( ) ) { cm.execCommand ( "findNext" ) ; } else { cm.execCommand ( "clearSearch" ) ; getCommentManager ( ) . toggleOpenBox ( cm ) . run ( ) ; } } } ; }
Source:
private static void base64 ( javax.servlet.http.HttpServletResponse res , com.google.gerrit.extensions.restapi.BinaryResult bin ) { res.setContentType ( "text/plain; charset=ISO-8859-1" ) ; res.setHeader ( "X-FYI-Content-Encoding" , "base64" ) ; res.setHeader ( "X-FYI-Content-Type" , bin.getContentType ( ) ) ; }

Target:
private static com.google.gerrit.extensions.restapi.BinaryResult compress ( com.google.gerrit.extensions.restapi.BinaryResult bin ) throws java.io.IOException { org.eclipse.jgit.util.TemporaryBuffer.Heap buf = com.google.gerrit.httpd.restapi.RestApiServlet.heap ( ( 20 << 20 ) ) ; java.util.zip.GZIPOutputStream gz = new java.util.zip.GZIPOutputStream ( buf ) ; bin.writeTo ( gz ) ; gz.close ( ) ; return com.google.gerrit.httpd.restapi.RestApiServlet.asBinaryResult ( buf ) . setContentType ( bin.getContentType ( ) ) ; }
Source:
public final java.util.Set < com.google.gerrit.client.info.DownloadInfo.DownloadCommandInfo > cloneCommands ( java.lang.String project ) { java.util.Set < com.google.gerrit.client.info.DownloadInfo.DownloadCommandInfo > commands = new java.util.HashSet < > ( ) ; for ( java.lang.String commandName : cloneCommandNames ( ) ) { commands.add ( new com.google.gerrit.client.info.DownloadInfo.DownloadCommandInfo ( commandName , cloneCommand ( commandName , project ) ) ) ; } return commands ; }

Target:
public final java.util.List < com.google.gerrit.client.info.DownloadInfo.DownloadCommandInfo > cloneCommands ( java.lang.String project ) { java.util.List < java.lang.String > commandNames = cloneCommandNames ( ) ; java.util.List < com.google.gerrit.client.info.DownloadInfo.DownloadCommandInfo > commands = new java.util.ArrayList < > ( commandNames.size ( ) ) ; for ( java.lang.String commandName : commandNames ) { commands.add ( new com.google.gerrit.client.info.DownloadInfo.DownloadCommandInfo ( commandName , cloneCommand ( commandName , project ) ) ) ; } return commands ; }
Source:
private void deleteProject ( org.eclipse.jgit.transport.URIish replicateURI ) { if ( ! ( replicateURI.isRemote ( ) ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.deleteLocally ( replicateURI ) ; com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.info ( ( "Deleted local repository: " + replicateURI ) ) ; } else if ( com.googlesource.gerrit.plugins.replication.ReplicationQueue.isSSH ( replicateURI ) ) { deleteRemoteSsh ( replicateURI ) ; com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.info ( ( "Deleted remote repository: " + replicateURI ) ) ; } else { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.warn ( java.lang.String.format ( ( "Cannot delete project on remote site %s." + ( " Only local paths and SSH URLs are supported" + " for remote repository deletion" ) ) , replicateURI ) ) ; } }

Target:
private static void deleteLocally ( org.eclipse.jgit.transport.URIish uri ) { try { com.googlesource.gerrit.plugins.replication.ReplicationQueue.recursivelyDelete ( new java.io.File ( uri.getPath ( ) ) ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.error ( "Error deleting local repository {}:\n" , uri.getPath ( ) , e ) ; } }
Source:
public void changeToIndexDoNotExist ( ) throws java.lang.Exception { setupPostMocks ( com.ericsson.gerrit.plugins.syncindex.SyncIndexRestApiServletTest.CHANGE_DOES_NOT_EXIST ) ; verifyPost ( ) ; }

Target:
public void changeToIndexDoNotExist ( ) throws java.lang.Exception { setupPostMocks ( com.ericsson.gerrit.plugins.syncindex.SyncIndexRestApiServletTest.CHANGE_DOES_NOT_EXIST ) ; syncIndexRestApiServlet.doPost ( req , rsp ) ; org.mockito.Mockito.verify ( indexer , org.mockito.Mockito.times ( 1 ) ) . delete ( id ) ; org.mockito.Mockito.verify ( rsp ) . setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; }
Source:
public void parseCommit ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Patch-set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Subject: Some subject of a change\n" ) + "Commit: abcd1234abcd1234abcd1234abcd1234abcd1234" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( ( ( "\n" + "Patch-set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Subject: Some subject of a change\n" ) + "Commit: abcd1234abcd1234abcd1234abcd1234abcd1234\n" ) + "Commit: deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) ) ) ; assertParseFails ( ( "Update patch set 1\n" + ( ( ( ( "Uploaded patch set 1.\n" + "Patch-set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Subject: Some subject of a change\n" ) + "Commit: beef" ) ) ) ; }

Target:
public void parsePatchSetGroups ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( ( ( "\n" + "Patch-set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Commit: abcd1234abcd1234abcd1234abcd1234abcd1234\n" ) + "Subject: Change subject\n" ) + "Groups: a,b,c\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( ( "\n" + "Patch-set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Subject: Change subject\n" ) + "Groups: a,b,c\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( ( ( ( "\n" + "Patch-set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Commit: abcd1234abcd1234abcd1234abcd1234abcd1234\n" ) + "Subject: Change subject\n" ) + "Groups: a,b,c\n" ) + "Groups: d,e,f\n" ) ) ) ; }
Source:
private void renderLinks ( com.google.gerrit.client.editor.EditFileInfo info , com.google.gerrit.client.diff.DiffInfo diffInfo ) { for ( com.google.gerrit.client.ui.InlineHyperlink link : getLinks ( ) ) { linkPanel.add ( link ) ; } if ( info != null ) { renderPluginLinks ( com.google.gerrit.client.rpc.Natives.asList ( info.web_links ( ) ) ) ; } else if ( diffInfo != null ) { renderPluginLinks ( com.google.gerrit.client.rpc.Natives.asList ( diffInfo.web_links ( ) ) ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.diff.DiffInfo diffInfo ) { diffLinks = diffInfo.web_links ( ) ; }
Source:
public boolean updateChange ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) { com.google.gerrit.reviewdb.client.Change change = ctx.getChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = ctx.getUpdate ( psId ) ; if ( ( change.getStatus ( ) ) == from ) { change.setStatus ( to ) ; update.setStatus ( change.getStatus ( ) ) ; return true ; } return false ; }

Target:
public boolean updateChange ( com.google.gerrit.server.update.ChangeContext ctx ) { com.google.gerrit.reviewdb.client.Change change = ctx.getChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = ctx.getUpdate ( psId ) ; if ( ( change.getStatus ( ) ) == from ) { change.setStatus ( to ) ; update.setStatus ( change.getStatus ( ) ) ; return true ; } return false ; }
Source:
com.google.gerrit.client.diff.DisplaySide getSide ( ) { return side ; }

Target:
public int compareTo ( com.google.gerrit.client.diff.DiffChunkInfo o ) { if ( ( side ) == ( o.side ) ) { return ( start ) - ( o.start ) ; } else if ( ( side ) == ( DisplaySide.A ) ) { int comp = ( startOnOther ) - ( o.start ) ; return comp == 0 ? - 1 : comp ; } else { int comp = ( start ) - ( o.startOnOther ) ; return comp == 0 ? 1 : comp ; } }
Source:
public void setUp ( ) throws java.lang.Exception { repo = com.google.gerrit.acceptance.GitUtil.newTestRepository ( repoManager.openRepository ( project ) ) ; com.google.gerrit.server.git.ProjectConfig pc = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; for ( com.google.gerrit.common.data.AccessSection sec : pc.getAccessSections ( ) ) { sec.removePermission ( Permission.READ ) ; } saveProjectConfig ( allProjects , pc ) ; }

Target:
private void unblockRead ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig pc = projectCache.checkedGet ( project ) . getConfig ( ) ; pc.getAccessSection ( "refs/*" ) . remove ( new com.google.gerrit.common.data.Permission ( com.google.gerrit.common.data.Permission.READ ) ) ; saveProjectConfig ( project , pc ) ; }