auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void setAssigneeOnWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; assign ( sc , sc.owner , sc.assignee ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . notTo ( sc.owner , sc.reviewer , sc.ccer , sc.starrer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . to ( sc.assignee ) ; }

Target:
public void changeAssigneeOnReviewableChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; com.google.gerrit.acceptance.TestAccount other = accountCreator.create ( "other" , "other@example.com" , "other" ) ; assign ( sc , sc.owner , other ) ; sender.clear ( ) ; assign ( sc , sc.owner , sc.assignee ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . to ( sc.assignee ) . noOneElse ( ) ; }
Source:
private com.google.gerrit.server.ssh.AbstractCommand create ( final java.lang.String cmd ) { return new com.google.gerrit.server.ssh.AbstractCommand ( ) { @ java.lang.Override protected void run ( final java.lang.String [ ] argv ) throws com.google.gerrit.server.ssh.Failure { throw new com.google.gerrit.server.ssh.Failure ( 127 , ( ( "gerrit: " + ( getName ( ) ) ) + ": not found" ) ) ; } } ; }

Target:
private com.google.gerrit.server.ssh.AbstractCommand create ( final java.lang.String cmd ) { if ( ( "git-receive-pack" . equals ( cmd ) ) || ( "gerrit-receive-pack" . equals ( cmd ) ) ) { return new com.google.gerrit.server.ssh.Receive ( ) ; } return new com.google.gerrit.server.ssh.AbstractCommand ( ) { @ java.lang.Override protected void run ( final java.lang.String [ ] argv ) throws com.google.gerrit.server.ssh.Failure { throw new com.google.gerrit.server.ssh.Failure ( 127 , ( ( "gerrit: " + ( getName ( ) ) ) + ": not found" ) ) ; } } ; }
Source:
public void testParseSimple ( ) throws java.lang.Exception { com.google.gerrit.server.git.DestinationList dl = new com.google.gerrit.server.git.DestinationList ( ) ; dl.parseLabel ( com.google.gerrit.server.git.DestinationListTest.LABEL , com.google.gerrit.server.git.DestinationListTest.F_SIMPLE , null ) ; java.util.Set < com.google.gerrit.reviewdb.client.Branch.NameKey > branches = dl.getDestinations ( com.google.gerrit.server.git.DestinationListTest.LABEL ) ; com.google.common.truth.Truth.assertThat ( branches ) . containsExactlyElementsIn ( com.google.gerrit.server.git.DestinationListTest.D_SIMPLE ) ; }

Target:
public void testParseSimple ( ) throws java.lang.Exception { com.google.gerrit.server.account.DestinationList dl = new com.google.gerrit.server.account.DestinationList ( ) ; dl.parseLabel ( com.google.gerrit.server.account.DestinationListTest.LABEL , com.google.gerrit.server.account.DestinationListTest.F_SIMPLE , null ) ; java.util.Set < com.google.gerrit.reviewdb.client.Branch.NameKey > branches = dl.getDestinations ( com.google.gerrit.server.account.DestinationListTest.LABEL ) ; com.google.common.truth.Truth.assertThat ( branches ) . containsExactlyElementsIn ( com.google.gerrit.server.account.DestinationListTest.D_SIMPLE ) ; }
Source:
public void mergeByReviewerCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS , com.google.gerrit.server.account.WatchConfig.NotifyType.SUBMITTED_CHANGES ) ; merge ( sc.changeId , sc.reviewer , EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "merged" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS , com.google.gerrit.server.account.WatchConfig.NotifyType.SUBMITTED_CHANGES ) ; }

Target:
public void mergeByReviewerCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageChange ( ) ; merge ( sc.changeId , sc.reviewer , EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "merged" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS , com.google.gerrit.server.account.WatchConfig.NotifyType.SUBMITTED_CHANGES ) . noOneElse ( ) ; }
Source:
public void create ( ) throws java.lang.Exception { for ( com.google.gerrit.acceptance.rest.project.PushTagIT.TagType tagType : com.google.gerrit.acceptance.rest.project.PushTagIT.TagType.values ( ) ) { pushTagForExistingCommit ( tagType , Status.REJECTED_OTHER_REASON ) ; allowTagCreation ( tagType ) ; pushTagForExistingCommit ( tagType , Status.OK ) ; pushTagForNewCommit ( tagType , Status.REJECTED_OTHER_REASON ) ; } allowPushOnRefsTags ( ) ; for ( com.google.gerrit.acceptance.rest.project.PushTagIT.TagType tagType : com.google.gerrit.acceptance.rest.project.PushTagIT.TagType.values ( ) ) { pushTagForNewCommit ( tagType , Status.OK ) ; } }

Target:
public void createTagForNewCommit ( ) throws java.lang.Exception { for ( com.google.gerrit.acceptance.rest.project.PushTagIT.TagType tagType : com.google.gerrit.acceptance.rest.project.PushTagIT.TagType.values ( ) ) { pushTagForNewCommit ( tagType , Status.REJECTED_OTHER_REASON ) ; allowTagCreation ( tagType ) ; pushTagForNewCommit ( tagType , Status.REJECTED_OTHER_REASON ) ; allowPushOnRefsTags ( ) ; pushTagForNewCommit ( tagType , Status.OK ) ; removePushFromRefsTags ( ) ; } }
Source:
public com.google.common.base.Optional < com.google.gerrit.server.plugins.PluginEntry > getEntry ( java.lang.String resourcePath ) throws java.io.IOException { java.util.jar.JarEntry jarEntry = jarFile.getJarEntry ( resourcePath ) ; if ( ( jarEntry == null ) || ( ( jarEntry.getSize ( ) ) == 0 ) ) { return com.google.common.base.Optional.absent ( ) ; } return com.google.common.base.Optional.of ( resourceOf ( jarEntry ) ) ; }

Target:
public java.util.Optional < com.google.gerrit.server.plugins.PluginEntry > getEntry ( java.lang.String resourcePath ) throws java.io.IOException { java.util.jar.JarEntry jarEntry = jarFile.getJarEntry ( resourcePath ) ; if ( ( jarEntry == null ) || ( ( jarEntry.getSize ( ) ) == 0 ) ) { return java.util.Optional.empty ( ) ; } return java.util.Optional.of ( resourceOf ( jarEntry ) ) ; }
Source:
public com.google.gerrit.common.data.Capable canUpload ( ) { com.google.gerrit.common.data.Capable result = projectControl.canPushToAtLeastOneRef ( ) ; if ( result != ( com.google.gerrit.common.data.Capable.OK ) ) { return result ; } if ( receiveConfig.checkMagicRefs ) { result = com.google.gerrit.server.util.MagicBranch.checkMagicBranchRefs ( repo , projectControl.getProject ( ) ) ; } return result ; }

Target:
public com.google.gerrit.common.data.Capable canUpload ( ) throws java.io.IOException { com.google.gerrit.common.data.Capable result = projectControl.canPushToAtLeastOneRef ( ) ; if ( result != ( com.google.gerrit.common.data.Capable.OK ) ) { return result ; } try { contributorAgreements.check ( projectControl.getProject ( ) . getNameKey ( ) , projectControl.getUser ( ) ) ; } catch ( com.google.gerrit.extensions.restapi.AuthException e ) { return new com.google.gerrit.common.data.Capable ( e.getMessage ( ) ) ; } if ( receiveConfig.checkMagicRefs ) { return com.google.gerrit.server.util.MagicBranch.checkMagicBranchRefs ( repo , projectControl.getProject ( ) ) ; } return com.google.gerrit.common.data.Capable.OK ; }
Source:
protected java.lang.String getChangeMessageThreadId ( ) { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( '<' ) ; r.append ( "gerrit" ) ; r.append ( '.' ) ; r.append ( change.getCreatedOn ( ) . getTime ( ) ) ; r.append ( '.' ) ; r.append ( change.getKey ( ) . get ( ) ) ; r.append ( '@' ) ; r.append ( getGerritHost ( ) ) ; r.append ( '>' ) ; return r.toString ( ) ; }

Target:
protected void setupVelocityContext ( ) { super . setupVelocityContext ( ) ; velocityContext.put ( "change" , change ) ; velocityContext.put ( "changeId" , change.getKey ( ) ) ; velocityContext.put ( "coverLetter" , getCoverLetter ( ) ) ; velocityContext.put ( "branch" , change.getDest ( ) ) ; velocityContext.put ( "fromName" , getNameFor ( fromId ) ) ; velocityContext.put ( "projectName" , projectName ) ; velocityContext.put ( "patchSet" , patchSet ) ; velocityContext.put ( "patchSetInfo" , patchSetInfo ) ; }
Source:
private com.google.inject.AbstractModule createIndexModule ( ) { com.google.gerrit.server.index.IndexModule.IndexType indexType = com.google.gerrit.server.index.IndexModule.getIndexType ( cfgInjector ) ; switch ( indexType ) { case LUCENE : return ( luceneModule ) != null ? luceneModule : new com.google.gerrit.lucene.LuceneIndexModule ( ) ; case SOLR : return new com.google.gerrit.solr.SolrIndexModule ( ) ; default : throw new java.lang.IllegalStateException ( ( "unsupported index.type = " + indexType ) ) ; } }

Target:
private void initIndexType ( ) { indexType = com.google.gerrit.server.index.IndexModule.getIndexType ( cfgInjector ) ; switch ( indexType ) { case LUCENE : case ELASTICSEARCH : break ; default : throw new java.lang.IllegalStateException ( ( "unsupported index.type = " + ( indexType ) ) ) ; } }
Source:
private void assertEditPreferences ( com.google.gerrit.extensions.client.EditPreferencesInfo out , com.google.gerrit.extensions.client.EditPreferencesInfo in ) { com.google.common.truth.Truth.assertThat ( out.lineLength ) . isEqualTo ( in.lineLength ) ; com.google.common.truth.Truth.assertThat ( out.tabSize ) . isEqualTo ( in.tabSize ) ; com.google.common.truth.Truth.assertThat ( out.hideTopMenu ) . isEqualTo ( in.hideTopMenu ) ; com.google.common.truth.Truth.assertThat ( out.showTabs ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( out.showWhitespaceErrors ) . isEqualTo ( in.showWhitespaceErrors ) ; com.google.common.truth.Truth.assertThat ( out.syntaxHighlighting ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( out.hideLineNumbers ) . isEqualTo ( in.hideLineNumbers ) ; com.google.common.truth.Truth.assertThat ( out.theme ) . isEqualTo ( in.theme ) ; }

Target:
private void assertEditPreferences ( com.google.gerrit.extensions.client.EditPreferencesInfo out , com.google.gerrit.extensions.client.EditPreferencesInfo in ) { com.google.common.truth.Truth.assertThat ( out.lineLength ) . isEqualTo ( in.lineLength ) ; com.google.common.truth.Truth.assertThat ( out.tabSize ) . isEqualTo ( in.tabSize ) ; com.google.common.truth.Truth.assertThat ( out.hideTopMenu ) . isEqualTo ( in.hideTopMenu ) ; com.google.common.truth.Truth.assertThat ( out.showTabs ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( out.showWhitespaceErrors ) . isEqualTo ( in.showWhitespaceErrors ) ; com.google.common.truth.Truth.assertThat ( out.syntaxHighlighting ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( out.hideLineNumbers ) . isEqualTo ( in.hideLineNumbers ) ; com.google.common.truth.Truth.assertThat ( out.theme ) . isEqualTo ( in.theme ) ; com.google.common.truth.Truth.assertThat ( out.keyMapType ) . isEqualTo ( in.keyMapType ) ; }
Source:
PatchSet.Id getPatchSetId ( ) { com.google.gerrit.reviewdb.client.PatchSet.Id id = get ( 0 ) . psId ; for ( int i = 1 ; i < ( size ( ) ) ; i ++ ) { com.google.common.base.Preconditions.checkState ( java.util.Objects.equals ( id , get ( i ) . psId ) , "mismatched patch sets in EventList: %s != %s" , id , get ( i ) . psId ) ; } return id ; }

Target:
PatchSet.Id getPatchSetId ( ) { com.google.gerrit.reviewdb.client.PatchSet.Id id = com.google.common.base.Preconditions.checkNotNull ( get ( 0 ) . psId ) ; for ( int i = 1 ; i < ( size ( ) ) ; i ++ ) { com.google.common.base.Preconditions.checkState ( get ( i ) . psId.equals ( id ) , "mismatched patch sets in EventList: %s != %s" , id , get ( i ) . psId ) ; } return id ; }
Source:
protected void respondWithJobStatusJson ( javax.servlet.http.HttpServletResponse resp , com.googlesource.gerrit.plugins.github.git.BatchImporter cloner ) throws java.io.IOException { java.util.Collection < com.googlesource.gerrit.plugins.github.git.GitJob > jobs = cloner.getJobs ( ) ; java.util.List < com.googlesource.gerrit.plugins.github.git.GitJobStatus > jobListStatus = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.googlesource.gerrit.plugins.github.git.GitJob job : jobs ) { jobListStatus.add ( job.getStatus ( ) ) ; } new com.google.gson.Gson ( ) . toJson ( jobListStatus , jobListStatus.getClass ( ) , new com.google.gson.stream.JsonWriter ( resp.getWriter ( ) ) ) ; }

Target:
protected void respondWithJobStatusJson ( javax.servlet.http.HttpServletResponse resp , com.googlesource.gerrit.plugins.github.git.BatchImporter cloner ) throws java.io.IOException { java.util.Collection < com.googlesource.gerrit.plugins.github.git.GitJob > jobs = cloner.getJobs ( ) ; java.util.List < com.googlesource.gerrit.plugins.github.git.GitJobStatus > jobListStatus = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.googlesource.gerrit.plugins.github.git.GitJob job : jobs ) { jobListStatus.add ( job.getStatus ( ) ) ; } try ( com.google.gson.stream.JsonWriter writer = new com.google.gson.stream.JsonWriter ( resp.getWriter ( ) ) ) { new com.google.gson.Gson ( ) . toJson ( jobListStatus , jobListStatus.getClass ( ) , writer ) ; } }
Source:
private void decodeChangedLines ( org.apache.lucene.document.Document doc , com.google.gerrit.server.query.change.ChangeData cd ) { org.apache.lucene.index.IndexableField added = doc.getField ( com.google.gerrit.lucene.LuceneChangeIndex.ADDED_FIELD ) ; org.apache.lucene.index.IndexableField deleted = doc.getField ( com.google.gerrit.lucene.LuceneChangeIndex.DELETED_FIELD ) ; if ( ( added != null ) && ( deleted != null ) ) { cd.setChangedLines ( added.numericValue ( ) . intValue ( ) , deleted.numericValue ( ) . intValue ( ) ) ; } }

Target:
private void decodeChangedLines ( org.apache.lucene.document.Document doc , com.google.gerrit.server.query.change.ChangeData cd ) { org.apache.lucene.index.IndexableField added = doc.getField ( com.google.gerrit.lucene.LuceneChangeIndex.ADDED_FIELD ) ; org.apache.lucene.index.IndexableField deleted = doc.getField ( com.google.gerrit.lucene.LuceneChangeIndex.DELETED_FIELD ) ; if ( ( added != null ) && ( deleted != null ) ) { cd.setChangedLines ( added.numericValue ( ) . intValue ( ) , deleted.numericValue ( ) . intValue ( ) ) ; } else { cd.setNoChangedLines ( ) ; } }
Source:
public void onSuccess ( final java.util.Set < com.google.gerrit.reviewdb.AccountExternalId.Key > removed ) { deleteIdentity.setEnabled ( true ) ; 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 ++ ; } } }

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 synchronized void stop ( ) { if ( ( ds ) != null ) { closeDataSource ( ds ) ; } }

Target:
public synchronized com.google.gwtorm.client.SchemaFactory < com.google.gerrit.reviewdb.ReviewDb > get ( ) { if ( ( dataSource ) == null ) { dataSource = open ( ) ; } if ( ( ds ) == null ) { try { ds = new com.google.gwtorm.jdbc.Database < com.google.gerrit.reviewdb.ReviewDb > ( dataSource , com.google.gerrit.reviewdb.ReviewDb.class ) ; } catch ( com.google.gwtorm.client.OrmException err ) { throw new com.google.inject.ProvisionException ( "Cannot initialize database" , err ) ; } } return ds ; }
Source:
void updateFileCommentVisibility ( boolean forceHide ) { com.google.gwt.user.client.ui.UIObject.setVisible ( patchSetNavRow , ( ! forceHide ) ) ; if ( forceHide || ( ( ( fileCommentPanelA.getBoxCount ( ) ) == 0 ) && ( ( fileCommentPanelB.getBoxCount ( ) ) == 0 ) ) ) { com.google.gwt.user.client.ui.UIObject.setVisible ( fileCommentRow , false ) ; } else { com.google.gwt.user.client.ui.UIObject.setVisible ( fileCommentRow , true ) ; } host.resizeCodeMirror ( ) ; }

Target:
void setHeaderVisible ( boolean show ) { com.google.gerrit.client.Gerrit.setHeaderVisible ( show ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( patchSetNavRow , show ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( fileCommentRow , ( show && ( ( ( fileCommentPanelA.getBoxCount ( ) ) > 0 ) || ( ( fileCommentPanelB.getBoxCount ( ) ) > 0 ) ) ) ) ; host.resizeCodeMirror ( ) ; }
Source:
private com.google.gerrit.server.ssh.AbstractCommand create ( final java.lang.String cmd ) { final com.google.inject.Provider < ? extends com.google.gerrit.server.ssh.AbstractCommand > f = commands.get ( cmd ) ; if ( f != null ) { return f.get ( ) ; } return new com.google.gerrit.server.ssh.AbstractCommand ( ) { @ java.lang.Override protected void run ( ) throws com.google.gerrit.server.ssh.Failure { throw new com.google.gerrit.server.ssh.UnloggedFailure ( 127 , ( ( "gerrit: " + ( getName ( ) ) ) + ": not found" ) ) ; } } ; }

Target:
public void setInputStream ( final java.io.InputStream in ) { }
Source:
public void parseAuthor ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Patch-Set: 1\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( writeCommit ( ( "Update change\n" + ( "\n" + "Patch-Set: 1\n" ) ) , new org.eclipse.jgit.lib.PersonIdent ( "Change Owner" , "owner@example.com" , serverIdent.getWhen ( ) , serverIdent.getTimeZone ( ) ) ) ) ; assertParseFails ( writeCommit ( ( "Update change\n" + ( "\n" + "Patch-Set: 1\n" ) ) , new org.eclipse.jgit.lib.PersonIdent ( "Change Owner" , "x@gerrit" , serverIdent.getWhen ( ) , serverIdent.getTimeZone ( ) ) ) ) ; }

Target:
public void parseAuthor ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Patch-Set: 1\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( writeCommit ( ( "Update change\n" + ( "\n" + "Patch-Set: 1\n" ) ) , new org.eclipse.jgit.lib.PersonIdent ( "Change Owner" , "owner@example.com" , serverIdent.getWhen ( ) , serverIdent.getTimeZone ( ) ) ) ) ; assertParseFails ( writeCommit ( ( "Update change\n" + ( "\n" + "Patch-Set: 1\n" ) ) , new org.eclipse.jgit.lib.PersonIdent ( "Change Owner" , "x@gerrit" , serverIdent.getWhen ( ) , serverIdent.getTimeZone ( ) ) ) ) ; }
Source:
public void emptyExceptSubject ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.commit ( ) ; org.junit.Assert.assertNull ( update.getRevision ( ) ) ; update = newUpdate ( c , changeOwner ) ; update.setSubject ( "Create change" ) ; update.commit ( ) ; org.junit.Assert.assertNotNull ( update.getRevision ( ) ) ; }

Target:
public void emptyChangeUpdate ( ) throws java.lang.Exception { com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( newChange ( ) , changeOwner ) ; update.commit ( ) ; org.junit.Assert.assertNull ( update.getRevision ( ) ) ; }
Source:
private void assertParseFails ( org.eclipse.jgit.revwalk.RevCommit commit ) throws java.lang.Exception { try ( com.google.gerrit.server.notedb.ChangeNotesParser parser = newParser ( commit ) ) { parser.parseAll ( ) ; org.junit.Assert.fail ( ( "Expected parse to fail:\n" + ( commit.getFullMessage ( ) ) ) ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException e ) { } }

Target:
private void assertParseFails ( org.eclipse.jgit.revwalk.RevCommit commit ) throws java.lang.Exception { try ( com.google.gerrit.server.notedb.ChangeNotesParser parser = newParser ( commit ) ) { exception.expect ( org.eclipse.jgit.errors.ConfigInvalidException.class ) ; parser.parseAll ( ) ; } }
Source:
private com.google.gerrit.server.change.ReviewerJson.PostResult putAccount ( com.google.gerrit.server.change.ReviewerResource rsrc ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Account member = rsrc.getReviewerUser ( ) . getAccount ( ) ; com.google.gerrit.server.project.ChangeControl control = rsrc.getReviewerControl ( ) ; com.google.gerrit.server.change.ReviewerJson.PostResult result = new com.google.gerrit.server.change.ReviewerJson.PostResult ( ) ; if ( isValidReviewer ( member , control ) ) { addReviewers ( rsrc.getChangeResource ( ) , result , com.google.common.collect.ImmutableMap.of ( member.getId ( ) , control ) ) ; } return result ; }

Target:
private com.google.gerrit.server.change.PostReviewers.Addition putAccount ( java.lang.String reviewer , com.google.gerrit.server.change.ReviewerResource rsrc , com.google.gerrit.extensions.client.ReviewerState state ) throws com.google.gerrit.extensions.restapi.UnprocessableEntityException { com.google.gerrit.reviewdb.client.Account member = rsrc.getReviewerUser ( ) . getAccount ( ) ; com.google.gerrit.server.project.ChangeControl control = rsrc.getReviewerControl ( ) ; if ( isValidReviewer ( member , control ) ) { return new com.google.gerrit.server.change.PostReviewers.Addition ( reviewer , rsrc.getChangeResource ( ) , com.google.common.collect.ImmutableMap.of ( member.getId ( ) , control ) , state ) ; } throw new com.google.gerrit.extensions.restapi.UnprocessableEntityException ( ( "Change not visible to " + reviewer ) ) ; }
Source:
protected void configure ( ) { factory ( ReviewerResource.Factory.class ) ; factory ( AccountInfo.Loader.Factory.class ) ; factory ( EmailReviewComments.Factory.class ) ; factory ( ChangeInserter.Factory.class ) ; factory ( PatchSetInserter.Factory.class ) ; factory ( ChangeEdits.Create.Factory.class ) ; factory ( ChangeEdits.DeleteEdit.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( ReviewerResource.Factory.class ) ; factory ( AccountInfo.Loader.Factory.class ) ; factory ( EmailReviewComments.Factory.class ) ; factory ( ChangeInserter.Factory.class ) ; factory ( PatchSetInserter.Factory.class ) ; factory ( ChangeEdits.Create.Factory.class ) ; factory ( ChangeEdits.DeleteFile.Factory.class ) ; }
Source:
public void messagesNotReturnedByDefault ( ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createChange ( ) ; postMessage ( changeId , "Some nits need to be fixed." ) ; com.google.gerrit.server.change.ChangeJson.ChangeInfo c = getChange ( changeId ) ; org.junit.Assert.assertNull ( c.messages ) ; }

Target:
public void messagesNotReturnedByDefault ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createChange ( ) ; postMessage ( changeId , "Some nits need to be fixed." ) ; com.google.gerrit.extensions.common.ChangeInfo c = getChange ( ( "p~master~" + changeId ) , java.util.EnumSet.noneOf ( com.google.gerrit.extensions.common.ListChangesOption.class ) ) ; org.junit.Assert.assertNull ( c.messages ) ; }
Source:
public boolean cancel ( boolean mayInterruptIfRunning ) { return task.cancel ( mayInterruptIfRunning ) ; }

Target:
public boolean cancel ( boolean mayInterruptIfRunning ) { if ( task.cancel ( mayInterruptIfRunning ) ) { if ( ( ( runnable ) instanceof com.google.gerrit.server.git.WorkQueue.CancelableRunnable ) && ( running.compareAndSet ( false , true ) ) ) { ( ( com.google.gerrit.server.git.WorkQueue.CancelableRunnable ) ( runnable ) ) . cancel ( ) ; } executor.remove ( this ) ; executor.purge ( ) ; return true ; } else { return false ; } }
Source:
public com.google.gerrit.extensions.registration.RegistrationHandle replace ( final com.google.gerrit.sshd.CommandName name , final com.google.inject.Provider < org.apache.sshd.server.Command > cmd ) { final java.util.concurrent.ConcurrentMap < java.lang.String , com.google.gerrit.sshd.CommandProvider > m = getMap ( ) ; m.put ( name.value ( ) , new com.google.gerrit.sshd.CommandProvider ( cmd , null ) ) ; return new com.google.gerrit.extensions.registration.RegistrationHandle ( ) { @ java.lang.Override public void remove ( ) { m.remove ( name.value ( ) , cmd ) ; } } ; }

Target:
public com.google.gerrit.extensions.registration.RegistrationHandle replace ( final com.google.gerrit.sshd.CommandName name , final com.google.inject.Provider < org.apache.sshd.server.Command > cmd ) { final java.util.concurrent.ConcurrentMap < java.lang.String , com.google.gerrit.sshd.CommandProvider > m = getMap ( ) ; final com.google.gerrit.sshd.CommandProvider commandProvider = new com.google.gerrit.sshd.CommandProvider ( cmd , null ) ; m.put ( name.value ( ) , commandProvider ) ; return new com.google.gerrit.extensions.registration.RegistrationHandle ( ) { @ java.lang.Override public void remove ( ) { m.remove ( name.value ( ) , commandProvider ) ; } } ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toProjectDefaultDashboard ( info.project_name_key ( ) ) ) ; }

Target:
private void initProjectLinks ( final com.google.gerrit.client.changes.ChangeInfo info ) { projectSettings.addDomHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toProject ( info.project_name_key ( ) ) ) ; } } , com.google.gwt.event.dom.client.ClickEvent.getType ( ) ) ; projectLink.setText ( info.project ( ) ) ; projectLink.setTargetHistoryToken ( com.google.gerrit.common.PageLinks.toProjectDefaultDashboard ( info.project_name_key ( ) ) ) ; }
Source:
public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > event ) { saveProject.setEnabled ( true ) ; }

Target:
private void initAgreements ( ) { agreementsPanel = new com.google.gwt.user.client.ui.VerticalPanel ( ) ; agreementsPanel.add ( new com.google.gerrit.client.ui.SmallHeading ( Util.C.headingAgreements ( ) ) ) ; useContributorAgreements = new com.google.gwt.user.client.ui.CheckBox ( Util.C.useContributorAgreements ( ) ) ; saveEnabler.listenTo ( useContributorAgreements ) ; agreementsPanel.add ( useContributorAgreements ) ; useSignedOffBy = new com.google.gwt.user.client.ui.CheckBox ( Util.C.useSignedOffBy ( ) , true ) ; saveEnabler.listenTo ( useSignedOffBy ) ; agreementsPanel.add ( useSignedOffBy ) ; add ( agreementsPanel ) ; }
Source:
protected PushOneCommit.Result createChange ( org.eclipse.jgit.junit.TestRepository < ? > repo , java.lang.String subject , java.lang.String fileName , java.lang.String content , java.lang.String topic ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , repo , subject , fileName , content ) ; return push.to ( ( "refs/for/master/" + ( name ( topic ) ) ) ) ; }

Target:
protected PushOneCommit.Result createChange ( org.eclipse.jgit.junit.TestRepository < ? > repo , java.lang.String branch , java.lang.String subject , java.lang.String fileName , java.lang.String content , java.lang.String topic ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , repo , subject , fileName , content ) ; return push.to ( ( ( ( "refs/for/" + branch ) + "/" ) + ( name ( topic ) ) ) ) ; }
Source:
private void appendHunkHeader ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , final com.google.gerrit.prettify.common.EditList.Hunk hunk ) { openLine ( m ) ; padLineNumber ( m ) ; padLineNumber ( m ) ; m.openTd ( ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffText ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffTextHunkHeader ( ) ) ; m.append ( "@@ -" ) ; appendRange ( m , ( ( hunk.getCurA ( ) ) + 1 ) , ( ( hunk.getEndA ( ) ) - ( hunk.getCurA ( ) ) ) ) ; m.append ( " +" ) ; appendRange ( m , ( ( hunk.getCurB ( ) ) + 1 ) , ( ( hunk.getEndB ( ) ) - ( hunk.getCurB ( ) ) ) ) ; m.append ( " @@" ) ; m.closeTd ( ) ; closeLine ( m ) ; }

Target:
private void appendHunkHeader ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , final com.google.gerrit.prettify.common.EditList.Hunk hunk ) { openLine ( m ) ; padLineNumberForSideA ( m ) ; padLineNumberForSideB ( m ) ; m.openTd ( ) ; m.setStyleName ( Gerrit.RESOURCES.css ( ) . fileLine ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffText ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffTextHunkHeader ( ) ) ; m.append ( "@@ -" ) ; appendRange ( m , ( ( hunk.getCurA ( ) ) + 1 ) , ( ( hunk.getEndA ( ) ) - ( hunk.getCurA ( ) ) ) ) ; m.append ( " +" ) ; appendRange ( m , ( ( hunk.getCurB ( ) ) + 1 ) , ( ( hunk.getEndB ( ) ) - ( hunk.getCurB ( ) ) ) ) ; m.append ( " @@" ) ; m.closeTd ( ) ; closeLine ( m ) ; }
Source:
public void preferDeleteAtLineBreak ( ) throws java.lang.Exception { java.lang.String a = " abc\n def\n" ; java.lang.String b = " abc\n def\n" ; java.util.List < org.eclipse.jgit.diff.Edit > expected = new org.eclipse.jgit.diff.EditList ( ) ; expected.add ( new org.eclipse.jgit.diff.Edit ( 0 , 2 , 0 , 0 ) ) ; expected.add ( new org.eclipse.jgit.diff.Edit ( 8 , 10 , 6 , 6 ) ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.patch.IntraLineLoaderTest.intraline ( a , b ) ) . isEqualTo ( expected ) ; }

Target:
com.google.gerrit.server.patch.IntraLineLoaderTest.Reference remove ( java.lang.String s ) { return replace ( s , "" ) ; }
Source:
public void testIsEnabledRefNoParentMatchingBranchMiddleDisabled ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/foo.*" , "^refs/heads/test.*" , "^refs/heads/baz.*" } ; setupIsEnabled ( "false" , null , branches ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertFalse ( itsConfig.isEnabled ( "testProject" , "refs/heads/testBranch" ) ) ; }

Target:
public void testIsEnabledRefNoParentMatchingBranchMiddleDisabled ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/foo.*" , "^refs/heads/test.*" , "^refs/heads/baz.*" } ; setupIsEnabled ( "false" , null , branches ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey projectNK = new com.google.gerrit.reviewdb.client.Project.NameKey ( "testProject" ) ; assertFalse ( itsConfig.isEnabled ( projectNK , "refs/heads/testBranch" ) ) ; }
Source:
public void setUp ( ) throws java.sql.SQLException { java.sql.Connection conn = java.sql.DriverManager.getConnection ( ( ( ( com.ericsson.gerrit.plugins.eventslog.sql.SQLStoreTest.TEST_URL ) + ";" ) + ( com.ericsson.gerrit.plugins.eventslog.sql.SQLStoreTest.TEST_OPTIONS ) ) ) ; stat = conn.createStatement ( ) ; poolMock = new com.ericsson.gerrit.plugins.eventslog.sql.SQLStoreTest.PoolMock ( ) ; org.mockito.Mockito.when ( cfgMock.getMaxAge ( ) ) . thenReturn ( 5 ) ; org.mockito.Mockito.when ( cfgMock.getLocalStorePath ( ) ) . thenReturn ( testFolder.getRoot ( ) . toPath ( ) ) ; }

Target:
public void setUp ( ) throws java.sql.SQLException { java.sql.Connection conn = java.sql.DriverManager.getConnection ( ( ( ( com.ericsson.gerrit.plugins.eventslog.sql.SQLStoreTest.TEST_URL ) + ";" ) + ( com.ericsson.gerrit.plugins.eventslog.sql.SQLStoreTest.TEST_OPTIONS ) ) ) ; mockEvent = new com.ericsson.gerrit.plugins.eventslog.sql.SQLStoreTest.MockEvent ( ) ; stat = conn.createStatement ( ) ; poolMock = new com.ericsson.gerrit.plugins.eventslog.sql.SQLStoreTest.PoolMock ( ) ; org.mockito.Mockito.when ( cfgMock.getMaxAge ( ) ) . thenReturn ( 5 ) ; org.mockito.Mockito.when ( cfgMock.getLocalStorePath ( ) ) . thenReturn ( testFolder.getRoot ( ) . toPath ( ) ) ; }
Source:
public void testItsAssociationPolicySuggested ( ) { com.googlesource.gerrit.plugins.hooks.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getEnum ( "commentLink" , "ItsTestName" , "association" , ItsAssociationPolicy.OPTIONAL ) ) . andReturn ( ItsAssociationPolicy.SUGGESTED ) . atLeastOnce ( ) ; replayMocks ( ) ; assertEquals ( "Expected and generated associated policy do not match" , ItsAssociationPolicy.SUGGESTED , itsConfig.getItsAssociationPolicy ( ) ) ; }

Target:
public void testPattern ( ) { com.googlesource.gerrit.plugins.hooks.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "commentlink" , "ItsTestName" , "match" ) ) . andReturn ( "TestPattern" ) . atLeastOnce ( ) ; replayMocks ( ) ; assertEquals ( "Expected and generated pattern are not equal" , "TestPattern" , itsConfig.getIssuePattern ( ) . pattern ( ) ) ; }
Source:
public void delete ( com.google.gerrit.reviewdb.client.Project project , boolean preserveGitRepository ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { org.eclipse.jgit.lib.Repository repository = repoManager.openRepository ( project.getNameKey ( ) ) ; cleanCache ( repository ) ; if ( ! preserveGitRepository ) { deleteGitRepository ( project.getNameKey ( ) , repository ) ; } }

Target:
public void delete ( com.google.gerrit.reviewdb.client.Project project , boolean preserveGitRepository ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { org.eclipse.jgit.lib.Repository repository = repoManager.openRepository ( project.getNameKey ( ) ) ; java.io.File repoParentFile = repository.getDirectory ( ) . getParentFile ( ) ; cleanCache ( repository ) ; if ( ! preserveGitRepository ) { deleteGitRepository ( project.getNameKey ( ) , repoParentFile ) ; } }
Source:
protected void assertApproved ( java.lang.String changeId ) throws java.io.IOException { com.google.gerrit.server.change.ChangeJson.ChangeInfo c = getChange ( changeId , com.google.gerrit.extensions.common.ListChangesOption.DETAILED_LABELS ) ; com.google.gerrit.server.change.ChangeJson.LabelInfo cr = c.labels.get ( "Code-Review" ) ; org.junit.Assert.assertEquals ( 1 , cr.all.size ( ) ) ; org.junit.Assert.assertEquals ( 2 , cr.all.get ( 0 ) . value.intValue ( ) ) ; org.junit.Assert.assertEquals ( "Administrator" , cr.all.get ( 0 ) . name ) ; }

Target:
protected void assertApproved ( java.lang.String changeId ) throws java.io.IOException { com.google.gerrit.extensions.common.ChangeInfo c = getChange ( changeId , com.google.gerrit.extensions.common.ListChangesOption.DETAILED_LABELS ) ; com.google.gerrit.extensions.common.LabelInfo cr = c.labels.get ( "Code-Review" ) ; com.google.common.truth.Truth.assertThat ( cr.all ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( cr.all.get ( 0 ) . value.intValue ( ) ) . isEqualTo ( 2 ) ; com.google.common.truth.Truth.assertThat ( new com.google.gerrit.reviewdb.client.Account.Id ( cr.all.get ( 0 ) . _accountId ) ) . isEqualTo ( admin.getId ( ) ) ; }
Source:
private java.util.List < com.google.gerrit.extensions.api.projects.CommentLinkInfo > getCommitLinkInfo ( final java.lang.String commentlinkName ) { com.google.gerrit.reviewdb.client.Project.NameKey projectName = com.googlesource.gerrit.plugins.its.base.its.ItsConfig.currentProjectName.get ( ) ; if ( projectName != null ) { java.util.List < com.google.gerrit.extensions.api.projects.CommentLinkInfo > commentlinks = projectCache.get ( projectName ) . getCommentLinks ( ) ; return com.google.common.collect.FluentIterable.from ( commentlinks ) . filter ( new com.google.common.base.Predicate < com.google.gerrit.extensions.api.projects.CommentLinkInfo > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.extensions.api.projects.CommentLinkInfo input ) { return input.name.equals ( commentlinkName ) ; } } ) . toList ( ) ; } return java.util.Collections.emptyList ( ) ; }

Target:
private java.util.List < com.google.gerrit.extensions.api.projects.CommentLinkInfo > getCommentLinkInfo ( final java.lang.String commentlinkName ) { com.google.gerrit.reviewdb.client.Project.NameKey projectName = com.googlesource.gerrit.plugins.its.base.its.ItsConfig.currentProjectName.get ( ) ; if ( projectName != null ) { java.util.List < com.google.gerrit.extensions.api.projects.CommentLinkInfo > commentlinks = projectCache.get ( projectName ) . getCommentLinks ( ) ; return com.google.common.collect.FluentIterable.from ( commentlinks ) . filter ( new com.google.common.base.Predicate < com.google.gerrit.extensions.api.projects.CommentLinkInfo > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.extensions.api.projects.CommentLinkInfo input ) { return input.name.equals ( commentlinkName ) ; } } ) . toList ( ) ; } return java.util.Collections.emptyList ( ) ; }
Source:
public void loginPhase1 ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response , com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope ... scopes ) throws java.io.IOException { response.sendRedirect ( java.lang.String.format ( "%s?client_id=%s%s&redirect_uri=%s&state=%s%s" , config.gitHubOAuthUrl , config.gitHubClientId , getScope ( scopes ) , getURLEncoded ( config.oAuthFinalRedirectUrl ) , me ( ) , getURLEncoded ( request.getRequestURI ( ) . toString ( ) ) ) ) ; }

Target:
public void loginPhase1 ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response , com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope ... scopes ) throws java.io.IOException { response.sendRedirect ( java.lang.String.format ( "%s?client_id=%s%s&redirect_uri=%s&state=%s%s" , config.gitHubOAuthUrl , config.gitHubClientId , getScope ( scopes ) , com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getURLEncoded ( config.oAuthFinalRedirectUrl ) , me ( ) , com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getURLEncoded ( request.getRequestURI ( ) . toString ( ) ) ) ) ; }
Source:
public void testAppend_String ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; org.junit.Assert.assertSame ( b , b.append ( ( ( java.lang.String ) ( null ) ) ) ) ; org.junit.Assert.assertEquals ( "" , b.asString ( ) ) ; org.junit.Assert.assertSame ( b , b.append ( "foo" ) ) ; org.junit.Assert.assertSame ( b , b.append ( "bar" ) ) ; org.junit.Assert.assertEquals ( "foobar" , b.asString ( ) ) ; }

Target:
public void testAppend_double ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; com.google.common.truth.Truth.assertThat ( b ) . isSameAs ( b.append ( 0.0 ) ) ; com.google.common.truth.Truth.assertThat ( b.asString ( ) ) . isEqualTo ( "0.0" ) ; }
Source:
protected static final java.net.URL toFileURL ( java.lang.String filename ) { if ( filename == null ) { return null ; } try { return new java.io.File ( filename ) . toURI ( ) . toURL ( ) ; } catch ( java.net.MalformedURLException e ) { throw new java.lang.IllegalArgumentException ( e ) ; } }

Target:
public java.net.URL apply ( java.lang.String filename ) { if ( filename == null ) { return null ; } try { return new java.io.File ( ( ( prefix ) + filename ) ) . toURI ( ) . toURL ( ) ; } catch ( java.net.MalformedURLException e ) { throw new java.lang.IllegalArgumentException ( e ) ; } }
Source:
private com.google.gerrit.server.git.strategy.SubmitStrategy createStrategy ( com.google.gerrit.server.git.MergeOp.OpenRepo or , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.extensions.client.SubmitType submitType , com.google.gerrit.server.git.CodeReviewCommit branchTip ) throws com.google.gerrit.server.git.IntegrationException { return submitStrategyFactory.create ( submitType , db , or.repo , or.rw , or.ins , or.canMergeFlag , getAlreadyAccepted ( or , branchTip ) , destBranch , caller , commits ) ; }

Target:
private com.google.gerrit.server.git.strategy.SubmitStrategy createStrategy ( com.google.gerrit.server.git.MergeOp.OpenRepo or , com.google.gerrit.server.git.MergeTip mergeTip , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.extensions.client.SubmitType submitType , com.google.gerrit.server.git.CodeReviewCommit branchTip ) throws com.google.gerrit.server.git.IntegrationException { return submitStrategyFactory.create ( submitType , db , or.repo , or.rw , or.ins , or.canMergeFlag , getAlreadyAccepted ( or , branchTip ) , destBranch , caller , mergeTip , commits , submissionId ) ; }
Source:
public com.google.gerrit.extensions.common.AccountInfo getAssignee ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.common.AccountInfo > r = getAssignee.apply ( change ) ; return r.isNone ( ) ? null : r.value ( ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot get assignee" , e ) ; } }

Target:
public com.google.gerrit.extensions.common.AccountInfo getAssignee ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.common.AccountInfo > r = getAssignee.apply ( change ) ; return r.isNone ( ) ? null : r.value ( ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot get assignee" , e ) ; } }
Source:
public boolean isDraftVisible ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { return ( ( isOwner ( ) ) || ( isReviewer ( db , cd ) ) ) || ( getRefControl ( ) . canViewDrafts ( ) ) ; }

Target:
public boolean isDraftVisible ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { return ( ( ( isOwner ( ) ) || ( isReviewer ( db , cd ) ) ) || ( getRefControl ( ) . canViewDrafts ( ) ) ) || ( getCurrentUser ( ) . isInternalUser ( ) ) ; }
Source:
private void setNew ( com.google.gerrit.reviewdb.Change c , com.google.gerrit.reviewdb.ChangeMessage msg ) { sendMergeFail ( c , msg , true , true ) ; }

Target:
private void updateSubscriptions ( ) throws com.google.gerrit.server.git.MergeException { if ( ( ( mergeTip ) != null ) && ( ( ( branchTip ) == null ) || ( ( branchTip ) != ( mergeTip ) ) ) ) { com.google.gerrit.server.git.SubmoduleOp subOp = subOpFactory.create ( destBranch , mergeTip , rw , db , destProject , submitted , commits ) ; try { subOp.update ( ) ; } catch ( com.google.gerrit.server.git.SubmoduleException e ) { com.google.gerrit.server.git.MergeOp.log.error ( ( "The gitLinks were not updated according to the subscriptions " + ( e.getMessage ( ) ) ) ) ; } } }
Source:
public boolean equals ( java.lang.Object o ) { if ( o instanceof com.google.gerrit.server.patch.PatchListKey ) { com.google.gerrit.server.patch.PatchListKey k = ( ( com.google.gerrit.server.patch.PatchListKey ) ( o ) ) ; return ( ( ( java.util.Objects.equals ( oldId , k.oldId ) ) && ( java.util.Objects.equals ( parentNum , k.parentNum ) ) ) && ( java.util.Objects.equals ( newId , k.newId ) ) ) && ( ( whitespace ) == ( k.whitespace ) ) ; } return false ; }

Target:
public boolean equals ( java.lang.Object o ) { if ( o instanceof com.google.gerrit.server.patch.PatchListKey ) { com.google.gerrit.server.patch.PatchListKey k = ( ( com.google.gerrit.server.patch.PatchListKey ) ( o ) ) ; return ( ( ( ( java.util.Objects.equals ( oldId , k.oldId ) ) && ( java.util.Objects.equals ( parentNum , k.parentNum ) ) ) && ( java.util.Objects.equals ( newId , k.newId ) ) ) && ( ( whitespace ) == ( k.whitespace ) ) ) && ( ( algorithm ) == ( k.algorithm ) ) ; } return false ; }
Source:
public void onShowView ( ) { super . onShowView ( ) ; int rest = ( com.google.gerrit.client.Gerrit.getHeaderFooterHeight ( ) ) + 30 ; cm.setHeight ( ( ( com.google.gwt.user.client.Window.getClientHeight ( ) ) - rest ) ) ; cm.refresh ( ) ; cm.focus ( ) ; }

Target:
public void handle ( net.codemirror.lib.CodeMirror cm ) { setClean ( cm.isClean ( generation ) ) ; }
Source:
public void testPushForMasterWithMessage ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = pushTo ( "refs/for/master/%m=my_test_message" ) ; r.assertOkStatus ( ) ; r.assertChange ( Change.Status.NEW , null ) ; com.google.gerrit.extensions.common.ChangeInfo ci = get ( r.getChangeId ( ) ) ; java.util.Collection < com.google.gerrit.extensions.common.ChangeMessageInfo > changeMessages = ci.messages ; com.google.common.truth.Truth.assertThat ( changeMessages ) . hasSize ( 1 ) ; for ( com.google.gerrit.extensions.common.ChangeMessageInfo cm : changeMessages ) { com.google.common.truth.Truth.assertThat ( cm.message ) . isEqualTo ( "Uploaded patch set 1.\nmy test message" ) ; } }

Target:
public void pushForMasterWithMessage ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = pushTo ( "refs/for/master/%m=my_test_message" ) ; r.assertOkStatus ( ) ; r.assertChange ( Change.Status.NEW , null ) ; com.google.gerrit.extensions.common.ChangeInfo ci = get ( r.getChangeId ( ) ) ; java.util.Collection < com.google.gerrit.extensions.common.ChangeMessageInfo > changeMessages = ci.messages ; com.google.common.truth.Truth.assertThat ( changeMessages ) . hasSize ( 1 ) ; for ( com.google.gerrit.extensions.common.ChangeMessageInfo cm : changeMessages ) { com.google.common.truth.Truth.assertThat ( cm.message ) . isEqualTo ( "Uploaded patch set 1.\nmy test message" ) ; } }
Source:
protected void command ( final com.google.gerrit.sshd.CommandName parent , final java.lang.Class < ? extends com.google.gerrit.sshd.BaseCommand > clazz ) { com.google.gerrit.sshd.CommandMetaData meta = ( ( com.google.gerrit.sshd.CommandMetaData ) ( clazz.getAnnotation ( com.google.gerrit.sshd.CommandMetaData.class ) ) ) ; if ( meta == null ) { throw new java.lang.IllegalStateException ( "no CommandMetaData annotation found" ) ; } bind ( com.google.gerrit.sshd.Commands.key ( parent , meta.name ( ) , meta.descr ( ) ) ) . to ( clazz ) ; }

Target:
protected void command ( final com.google.gerrit.sshd.CommandName parent , final java.lang.Class < ? extends com.google.gerrit.sshd.BaseCommand > clazz ) { com.google.gerrit.sshd.CommandMetaData meta = ( ( com.google.gerrit.sshd.CommandMetaData ) ( clazz.getAnnotation ( com.google.gerrit.sshd.CommandMetaData.class ) ) ) ; if ( meta == null ) { throw new java.lang.IllegalStateException ( "no CommandMetaData annotation found" ) ; } bind ( com.google.gerrit.sshd.Commands.key ( parent , meta.name ( ) , com.google.gerrit.sshd.CommandModule.description ( meta ) ) ) . to ( clazz ) ; }
Source:
public void emptyServletPath ( ) { com.google.common.truth.Truth.assertThat ( com.google.gerrit.util.http.RequestUtil.getEncodedPathInfo ( mockRequest ( "/c/foo/bar" , "" , "/c" ) ) ) . isEqualTo ( "/foo/bar" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.util.http.RequestUtil.getEncodedPathInfo ( mockRequest ( "/c/foo%2Fbar" , "" , "/c" ) ) ) . isEqualTo ( "/foo%2Fbar" ) ; }

Target:
public void trailingSlashes ( ) { com.google.common.truth.Truth.assertThat ( com.google.gerrit.util.http.RequestUtil.getEncodedPathInfo ( fakeRequest ( "/c" , "/s" , "/foo/bar/" ) ) ) . isEqualTo ( "/foo/bar/" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.util.http.RequestUtil.getEncodedPathInfo ( fakeRequest ( "/c" , "/s" , "/foo/bar///" ) ) ) . isEqualTo ( "/foo/bar/" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.util.http.RequestUtil.getEncodedPathInfo ( fakeRequest ( "/c" , "/s" , "/foo%2Fbar/" ) ) ) . isEqualTo ( "/foo%2Fbar/" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.util.http.RequestUtil.getEncodedPathInfo ( fakeRequest ( "/c" , "/s" , "/foo%2Fbar///" ) ) ) . isEqualTo ( "/foo%2Fbar/" ) ; }