auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testInheritRead_OverrideWithDeny ( ) { grant ( parent , com.google.gerrit.reviewdb.ApprovalCategory.READ , registered , "refs/*" , 1 ) ; grant ( local , com.google.gerrit.reviewdb.ApprovalCategory.READ , registered , "refs/*" , 0 ) ; com.google.gerrit.server.project.ProjectControl u = user ( ) ; assertFalse ( "can't read" , u.isVisible ( ) ) ; }

Target:
public void testInheritRead_SingleBranchDoesNotOverrideInherited ( ) { grant ( parent , com.google.gerrit.common.data.Permission.READ , registered , "refs/*" ) ; grant ( parent , com.google.gerrit.common.data.Permission.PUSH , registered , "refs/for/refs/*" ) ; grant ( local , com.google.gerrit.common.data.Permission.READ , registered , "refs/heads/foobar" ) ; com.google.gerrit.server.project.ProjectControl u = user ( ) ; assertTrue ( "can upload" , u.canPushToAtLeastOneRef ( ) ) ; assertTrue ( "can upload refs/heads/master" , u.controlForRef ( "refs/heads/master" ) . canUpload ( ) ) ; assertTrue ( "can upload refs/heads/foobar" , u.controlForRef ( "refs/heads/foobar" ) . canUpload ( ) ) ; }
Source:
java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > getForPatchSet ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet ps = psUtil.get ( db , ctl.getNotes ( ) , psId ) ; if ( ps == null ) { return java.util.Collections.emptyList ( ) ; } return getForPatchSet ( db , ctl , ps ) ; }

Target:
java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > getForPatchSet ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { return getForPatchSet ( db , ctl , psId , java.util.Collections.< com.google.gerrit.reviewdb.client.PatchSetApproval > emptyList ( ) ) ; }
Source:
public boolean canRestore ( ) { return ( canAbandon ( ) ) && ( getRefControl ( ) . canUpload ( ) ) ; }

Target:
public boolean canRebase ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { return ( ( ( isOwner ( ) ) || ( getRefControl ( ) . canSubmit ( ) ) ) || ( getRefControl ( ) . canRebase ( ) ) ) && ( ! ( isPatchSetLocked ( db ) ) ) ; }
Source:
public void lastInGroup ( ) { if ( ! ( getItems ( ) . isEmpty ( ) ) ) { final com.google.gwt.user.client.ui.MenuItem i = getItems ( ) . get ( ( ( getItems ( ) . size ( ) ) - 1 ) ) ; i.removeStyleDependentName ( "NormalItem" ) ; i.addStyleDependentName ( "LastItem" ) ; } }

Target:
public void add ( final com.google.gwt.user.client.ui.Widget i ) { if ( ( body.getWidgetCount ( ) ) > 0 ) { final com.google.gwt.user.client.ui.Widget p = body.getWidget ( ( ( body.getWidgetCount ( ) ) - 1 ) ) ; p.addStyleName ( "gerrit-LinkMenuItem-NotLast" ) ; } i.addStyleName ( "gerrit-LinkMenuItem" ) ; body.add ( i ) ; }
Source:
void set ( com.google.gerrit.client.info.ChangeInfo info , java.lang.String revision ) { canEdit = ( info.hasActions ( ) ) && ( info.actions ( ) . containsKey ( "topic" ) ) ; psId = new com.google.gerrit.reviewdb.client.PatchSet.Id ( info.legacyId ( ) , info.revisions ( ) . get ( revision ) . _number ( ) ) ; initTopicLink ( info ) ; editIcon.setVisible ( canEdit ) ; if ( ! ( canEdit ) ) { show.setTitle ( null ) ; } }

Target:
void set ( com.google.gerrit.client.info.ChangeInfo info , java.lang.String revision ) { canEdit = ( info.hasActions ( ) ) && ( info.actions ( ) . containsKey ( "topic" ) ) ; psId = new com.google.gerrit.reviewdb.client.PatchSet.Id ( info.legacyId ( ) , info.revisions ( ) . get ( revision ) . _number ( ) ) ; project = info.projectNameKey ( ) ; initTopicLink ( info ) ; editIcon.setVisible ( canEdit ) ; if ( ! ( canEdit ) ) { show.setTitle ( null ) ; } }
Source:
private com.google.gerrit.reviewdb.client.PatchSet insertPatchSet ( com.google.gerrit.reviewdb.client.Change c ) throws java.lang.Exception { db.changes ( ) . upsert ( java.util.Collections.singleton ( c ) ) ; org.eclipse.jgit.revwalk.RevCommit commit = repo.branch ( c.currentPatchSetId ( ) . toRefName ( ) ) . commit ( ) . parent ( tip ) . create ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.testutil.TestChanges.newPatchSet ( c.currentPatchSetId ( ) , commit , userId ) ; updatePatchSetRef ( ps ) ; db.patchSets ( ) . insert ( java.util.Collections.singleton ( ps ) ) ; return ps ; }

Target:
private com.google.gerrit.reviewdb.client.PatchSet insertPatchSet ( com.google.gerrit.reviewdb.client.Change c ) throws java.lang.Exception { db.changes ( ) . upsert ( java.util.Collections.singleton ( c ) ) ; org.eclipse.jgit.revwalk.RevCommit commit = testRepo.branch ( c.currentPatchSetId ( ) . toRefName ( ) ) . commit ( ) . parent ( tip ) . create ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.testutil.TestChanges.newPatchSet ( c.currentPatchSetId ( ) , commit , adminId ) ; updatePatchSetRef ( ps ) ; db.patchSets ( ) . insert ( java.util.Collections.singleton ( ps ) ) ; return ps ; }
Source:
public void onValueChange ( final com.google.gwt.event.logical.shared.ValueChangeEvent < com.google.gerrit.common.data.ChangeDetail > event ) { if ( isAttached ( ) ) { com.google.gerrit.client.changes.ChangeApi.detail ( event.getValue ( ) . getChange ( ) . getId ( ) . get ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.common.data.com.google.gerrit.client.changes.ChangeInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.common.data.com.google.gerrit.client.changes.ChangeInfo result ) { changeInfo = result ; display ( event.getValue ( ) ) ; } } ) ; } }

Target:
public void onValueChange ( final com.google.gwt.event.logical.shared.ValueChangeEvent < com.google.gerrit.common.data.ChangeDetail > event ) { if ( ( isAttached ( ) ) && ( isLastValueChangeHandler ( ) ) ) { com.google.gerrit.client.changes.ChangeApi.detail ( event.getValue ( ) . getChange ( ) . getId ( ) . get ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.common.data.com.google.gerrit.client.changes.ChangeInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.common.data.com.google.gerrit.client.changes.ChangeInfo result ) { changeInfo = result ; display ( event.getValue ( ) ) ; } } ) ; } }
Source:
public void topic ( java.lang.String topic ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.change.PutTopic.Input in = new com.google.gerrit.server.change.PutTopic.Input ( ) ; in.topic = topic ; try { putTopic.apply ( change , in ) ; } catch ( com.google.gerrit.server.git.UpdateException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot set topic" , e ) ; } }

Target:
public void topic ( java.lang.String topic ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.change.PutTopic.Input in = new com.google.gerrit.server.change.PutTopic.Input ( ) ; in.topic = topic ; try { putTopic.apply ( change , in ) ; } catch ( com.google.gerrit.server.update.UpdateException | com.google.gerrit.server.permissions.PermissionBackendException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot set topic" , e ) ; } }
Source:
public void onFailure ( java.lang.Throwable caught ) { if ( failed ) { return ; } failed = true ; failedThrowable = caught ; for ( com.google.gerrit.client.rpc.CallbackGroup.CallbackImpl < ? > cb : callbacks ) { cb.delegate.onFailure ( failedThrowable ) ; cb.delegate = null ; cb.result = null ; } callbacks.clear ( ) ; remaining.clear ( ) ; }

Target:
private void applyAllFailed ( ) { if ( ( ( failed ) && ( finalAdded ) ) && ( remaining.isEmpty ( ) ) ) { for ( com.google.gerrit.client.rpc.CallbackGroup.CallbackImpl < ? > cb : callbacks ) { cb.applyFailed ( ) ; } callbacks.clear ( ) ; } }
Source:
public int compare ( com.google.gerrit.extensions.common.AccountInfo a , com.google.gerrit.extensions.common.AccountInfo b ) { return com.google.common.collect.ComparisonChain.start ( ) . compare ( a.name , b.name , com.google.common.collect.Ordering.natural ( ) . nullsFirst ( ) ) . compare ( a.email , b.email , com.google.common.collect.Ordering.natural ( ) . nullsFirst ( ) ) . compare ( a._accountId , b._accountId , com.google.common.collect.Ordering.natural ( ) . nullsFirst ( ) ) . result ( ) ; }

Target:
public java.util.List < com.google.gerrit.extensions.common.AccountInfo > apply ( com.google.gerrit.reviewdb.client.AccountGroup.UUID groupId ) throws com.google.gwtorm.server.OrmException { final java.util.Map < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.extensions.common.AccountInfo > members = getMembers ( groupId , new java.util.HashSet < com.google.gerrit.reviewdb.client.AccountGroup.UUID > ( ) ) ; final java.util.List < com.google.gerrit.extensions.common.AccountInfo > memberInfos = com.google.common.collect.Lists.newArrayList ( members.values ( ) ) ; java.util.Collections.sort ( memberInfos , AccountInfoComparator.ORDER_NULLS_FIRST ) ; return memberInfos ; }
Source:
private org.apache.lucene.search.Query exactQuery ( com.google.gerrit.server.index.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > p ) { return new org.apache.lucene.search.TermQuery ( new org.apache.lucene.index.Term ( p.getOperator ( ) , p.getValue ( ) ) ) ; }

Target:
private static org.apache.lucene.search.Query timestampQuery ( com.google.gerrit.server.index.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > p ) throws com.google.gerrit.server.query.QueryParseException { if ( p instanceof com.google.gerrit.server.index.TimestampRangePredicate ) { com.google.gerrit.server.index.TimestampRangePredicate < com.google.gerrit.server.query.change.ChangeData > r = ( ( com.google.gerrit.server.index.TimestampRangePredicate < com.google.gerrit.server.query.change.ChangeData > ) ( p ) ) ; return org.apache.lucene.search.NumericRangeQuery.newIntRange ( r.getField ( ) . getName ( ) , com.google.gerrit.lucene.LuceneChangeIndex.toIndexTime ( r.getMinTimestamp ( ) ) , com.google.gerrit.lucene.LuceneChangeIndex.toIndexTime ( r.getMaxTimestamp ( ) ) , true , true ) ; } throw new com.google.gerrit.server.query.QueryParseException ( ( "not a timestamp: " + p ) ) ; }
Source:
public void run ( ) { try { com.google.gerrit.server.mail.MergedSender cm = mergedSenderFactory.create ( ps.getId ( ) . getParentKey ( ) ) ; cm.setFrom ( user.getAccountId ( ) ) ; cm.setPatchSet ( ps , info ) ; cm.send ( ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.git.ReceiveCommits.log.error ( ( "Cannot send email for submitted patch set " + ( ps.getId ( ) ) ) , e ) ; } }

Target:
public void run ( ) { try { com.google.gerrit.server.mail.MergedSender cm = mergedSenderFactory.create ( project.getNameKey ( ) , ps.getId ( ) . getParentKey ( ) ) ; cm.setFrom ( user.getAccountId ( ) ) ; cm.setPatchSet ( ps , info ) ; cm.send ( ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.git.ReceiveCommits.log.error ( ( "Cannot send email for submitted patch set " + ( ps.getId ( ) ) ) , e ) ; } }
Source:
static void postSignIn ( final boolean success ) { final com.google.gerrit.client.SignInDialog d = com.google.gerrit.client.SignInDialog.current ; assert d != null ; if ( success ) { com.google.gerrit.client.Gerrit.postSignIn ( ) ; d.hide ( ) ; if ( ( d.callback ) != null ) { d.callback.onSuccess ( null ) ; } } else { d.hide ( ) ; } }

Target:
static void postSignIn ( final boolean success ) { final com.google.gerrit.client.SignInDialog d = com.google.gerrit.client.SignInDialog.current ; assert d != null ; if ( success ) { com.google.gerrit.client.Gerrit.postSignIn ( ) ; d.hide ( ) ; final com.google.gwt.user.client.rpc.AsyncCallback < ? > ac = d.callback ; if ( ac != null ) { com.google.gwt.user.client.DeferredCommand.addCommand ( new com.google.gwt.user.client.Command ( ) { public void execute ( ) { ac.onSuccess ( null ) ; } } ) ; } } else { d.hide ( ) ; } }
Source:
private void saveChange ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { change = ctx.getChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = ctx.getChangeUpdate ( ) ; wasDraftChange = ( change.getStatus ( ) ) == ( Change.Status.DRAFT ) ; if ( wasDraftChange ) { change.setStatus ( Change.Status.NEW ) ; update.setStatus ( change.getStatus ( ) ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; ctx.getDb ( ) . changes ( ) . update ( java.util.Collections.singleton ( change ) ) ; } }

Target:
private void saveChange ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { change = ctx.getChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = ctx.getUpdate ( ) ; wasDraftChange = ( change.getStatus ( ) ) == ( Change.Status.DRAFT ) ; if ( wasDraftChange ) { change.setStatus ( Change.Status.NEW ) ; update.setStatus ( change.getStatus ( ) ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; ctx.getDb ( ) . changes ( ) . update ( java.util.Collections.singleton ( change ) ) ; } }
Source:
public com.google.gerrit.reviewdb.client.AccountSshKey getKey ( int seq ) { com.google.common.base.Preconditions.checkState ( ( ( keys ) != null ) , "SSH keys not loaded yet" ) ; com.google.common.base.Optional < com.google.gerrit.reviewdb.client.AccountSshKey > key = keys.get ( seq ) ; return key.isPresent ( ) ? key.get ( ) : null ; }

Target:
private com.google.gerrit.reviewdb.client.AccountSshKey getKey ( int seq ) { checkLoaded ( ) ; com.google.common.base.Optional < com.google.gerrit.reviewdb.client.AccountSshKey > key = keys.get ( ( seq - 1 ) ) ; return key.orNull ( ) ; }
Source:
public java.lang.String getDefaultQuery ( ) { return ( ( ( ( ( ( ( ( "SELECT * FROM(SELECT TOP " + ( returnLimit ) ) + " * FROM " ) + ( com.ericsson.gerrit.plugins.eventslog.SQLTable.TABLE_NAME ) ) + " ORDER BY " ) + ( com.ericsson.gerrit.plugins.eventslog.SQLTable.PRIMARY_ENTRY ) ) + " DESC)" ) + " a ORDER BY " ) + ( com.ericsson.gerrit.plugins.eventslog.SQLTable.PRIMARY_ENTRY ) ) + " ASC" ; }

Target:
public java.lang.String getDefaultQuery ( ) { return ( ( ( ( ( ( ( ( "SELECT * FROM(SELECT * FROM " + ( com.ericsson.gerrit.plugins.eventslog.SQLTable.TABLE_NAME ) ) + " ORDER BY " ) + ( com.ericsson.gerrit.plugins.eventslog.SQLTable.PRIMARY_ENTRY ) ) + " DESC LIMIT " ) + ( returnLimit ) ) + ")" ) + " a ORDER BY " ) + ( com.ericsson.gerrit.plugins.eventslog.SQLTable.PRIMARY_ENTRY ) ) + " ASC" ; }
Source:
public boolean canDelete ( ) { switch ( getCurrentUser ( ) . getAccessPath ( ) ) { case WEB_UI : return ( isOwner ( ) ) || ( canPerform ( com.google.gerrit.reviewdb.ApprovalCategory.PUSH_HEAD , com.google.gerrit.reviewdb.ApprovalCategory.PUSH_HEAD_REPLACE ) ) ; case GIT : return canPerform ( com.google.gerrit.reviewdb.ApprovalCategory.PUSH_HEAD , com.google.gerrit.reviewdb.ApprovalCategory.PUSH_HEAD_REPLACE ) ; default : return false ; } }

Target:
public boolean canDelete ( ) { switch ( getCurrentUser ( ) . getAccessPath ( ) ) { case WEB_UI : return ( isOwner ( ) ) || ( canPushWithForce ( ) ) ; case GIT : return canPushWithForce ( ) ; default : return false ; } }
Source:
public void onSend ( ) { Util.MANAGE_SVC.abandonChange ( patchSet.getId ( ) , getMessageText ( ) , createCallback ( ) ) ; }

Target:
public void onSend ( ) { com.google.gerrit.client.changes.ChangeApi.abandon ( changeDetail.getChange ( ) . getChangeId ( ) , getMessageText ( ) , new com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { sent = true ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( new com.google.gerrit.reviewdb.client.Change.Id ( result._number ( ) ) ) ) ; hide ( ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { enableButtons ( true ) ; } } ) ; }
Source:
private void decodeMergeable ( org.apache.lucene.document.Document doc , com.google.gerrit.server.query.change.ChangeData cd ) { java.lang.String mergeable = doc.get ( com.google.gerrit.lucene.LuceneChangeIndex.MERGEABLE_FIELD ) ; if ( "1" . equals ( mergeable ) ) { cd.setMergeable ( true ) ; } else if ( "0" . equals ( mergeable ) ) { cd.setMergeable ( false ) ; } }

Target:
private void decodeMergeable ( com.google.common.collect.Multimap < java.lang.String , org.apache.lucene.index.IndexableField > doc , com.google.gerrit.server.query.change.ChangeData cd ) { org.apache.lucene.index.IndexableField f = com.google.common.collect.Iterables.getFirst ( doc.get ( com.google.gerrit.lucene.LuceneChangeIndex.MERGEABLE_FIELD ) , null ) ; if ( f != null ) { java.lang.String mergeable = f.stringValue ( ) ; if ( "1" . equals ( mergeable ) ) { cd.setMergeable ( true ) ; } else if ( "0" . equals ( mergeable ) ) { cd.setMergeable ( false ) ; } } }
Source:
public void setUp ( ) throws java.lang.Exception { normalProject = createProject ( "normal" ) ; secretProject = createProject ( "secret" ) ; secretRefProject = createProject ( "secretRef" ) ; privilegedGroup = groupCache.get ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( createGroup ( "privilegedGroup" ) ) ) ; privilegedUser = accountCreator.create ( "privilegedUser" , "snowden@nsa.gov" , "Ed Snowden" ) ; gApi.groups ( ) . id ( privilegedGroup.getGroupUUID ( ) . get ( ) ) . addMembers ( privilegedUser.username ) ; com.google.common.truth.Truth.assertThat ( gApi.groups ( ) . id ( privilegedGroup.getGroupUUID ( ) . get ( ) ) . members ( ) . get ( 0 ) . email ) . contains ( "snowden" ) ; grant ( secretProject , "refs/*" , Permission.READ , false , privilegedGroup.getGroupUUID ( ) ) ; block ( secretProject , "refs/*" , Permission.READ , SystemGroupBackend.REGISTERED_USERS ) ; deny ( secretRefProject , "refs/*" , Permission.READ , SystemGroupBackend.ANONYMOUS_USERS ) ; grant ( secretRefProject , "refs/heads/secret/*" , Permission.READ , false , privilegedGroup.getGroupUUID ( ) ) ; block ( secretRefProject , "refs/heads/secret/*" , Permission.READ , SystemGroupBackend.REGISTERED_USERS ) ; grant ( secretRefProject , "refs/heads/*" , Permission.READ , false , SystemGroupBackend.REGISTERED_USERS ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { normalProject = createProject ( "normal" ) ; secretProject = createProject ( "secret" ) ; secretRefProject = createProject ( "secretRef" ) ; privilegedGroup = groupCache.get ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( createGroup ( "privilegedGroup" ) ) ) . orElse ( null ) ; privilegedUser = accountCreator.create ( "privilegedUser" , "snowden@nsa.gov" , "Ed Snowden" ) ; gApi.groups ( ) . id ( privilegedGroup.getGroupUUID ( ) . get ( ) ) . addMembers ( privilegedUser.username ) ; com.google.common.truth.Truth.assertThat ( gApi.groups ( ) . id ( privilegedGroup.getGroupUUID ( ) . get ( ) ) . members ( ) . get ( 0 ) . email ) . contains ( "snowden" ) ; grant ( secretProject , "refs/*" , Permission.READ , false , privilegedGroup.getGroupUUID ( ) ) ; block ( secretProject , "refs/*" , Permission.READ , SystemGroupBackend.REGISTERED_USERS ) ; deny ( secretRefProject , "refs/*" , Permission.READ , SystemGroupBackend.ANONYMOUS_USERS ) ; grant ( secretRefProject , "refs/heads/secret/*" , Permission.READ , false , privilegedGroup.getGroupUUID ( ) ) ; block ( secretRefProject , "refs/heads/secret/*" , Permission.READ , SystemGroupBackend.REGISTERED_USERS ) ; grant ( secretRefProject , "refs/heads/*" , Permission.READ , false , SystemGroupBackend.REGISTERED_USERS ) ; }
Source:
private void setListIdHeader ( ) { final java.lang.StringBuilder listid = new java.lang.StringBuilder ( ) ; listid.append ( "gerrit-" ) ; listid.append ( projectName.replace ( '/' , '-' ) ) ; listid.append ( "@" ) ; listid.append ( getGerritHost ( ) ) ; final java.lang.String listidStr = listid.toString ( ) ; setHeader ( "Mailing-List" , ( "list " + listidStr ) ) ; setHeader ( "List-Id" , ( ( "<" + ( listidStr.replace ( '@' , '.' ) ) ) + ">" ) ) ; if ( ( getSettingsUrl ( ) ) != null ) { setHeader ( "List-Unsubscribe" , ( ( "<" + ( getSettingsUrl ( ) ) ) + ">" ) ) ; } }

Target:
private void setChangeSubjectHeader ( ) throws com.google.gerrit.server.mail.EmailException { setHeader ( "Subject" , velocifyFile ( "ChangeSubject.vm" ) ) ; }
Source:
boolean index ( int changeId ) { try { com.ericsson.gerrit.plugins.multimaster.IndexResponseHandler.IndexResult result = httpSession.post ( buildEndpoint ( changeId ) ) ; if ( result.isSuccessful ( ) ) { return true ; } com.ericsson.gerrit.plugins.multimaster.RestSession.log.error ( "Unable to index change {}. Cause: {}" , changeId , result.getMessage ( ) ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.multimaster.RestSession.log.error ( ( "Error trying to index change " + changeId ) , e ) ; } return false ; }

Target:
boolean index ( int changeId ) { try { com.ericsson.gerrit.plugins.multimaster.HttpResponseHandler.HttpResult result = httpSession.post ( buildEndpoint ( changeId ) ) ; if ( result.isSuccessful ( ) ) { return true ; } com.ericsson.gerrit.plugins.multimaster.RestSession.log.error ( "Unable to index change {}. Cause: {}" , changeId , result.getMessage ( ) ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.multimaster.RestSession.log.error ( ( "Error trying to index change " + changeId ) , e ) ; } return false ; }
Source:
public java.util.List < com.googlesource.gerrit.plugins.xdocs.MenuEntry > getEntries ( ) { java.lang.StringBuilder url = new java.lang.StringBuilder ( ) ; url.append ( "/plugins/" ) ; url.append ( pluginName ) ; url.append ( XDocServlet.PATH_PREFIX ) ; url.append ( "${projectName}/README.md" ) ; return com.google.common.collect.Lists.newArrayList ( new com.googlesource.gerrit.plugins.xdocs.MenuEntry ( com.google.gerrit.extensions.webui.GerritTopMenu.PROJECTS , com.google.common.collect.Lists.newArrayList ( new com.googlesource.gerrit.plugins.xdocs.MenuItem ( "Readme" , url.toString ( ) ) ) ) ) ; }

Target:
public java.util.List < com.googlesource.gerrit.plugins.xdocs.MenuEntry > getEntries ( ) { java.lang.StringBuilder url = new java.lang.StringBuilder ( ) ; url.append ( "/plugins/" ) ; url.append ( pluginName ) ; url.append ( XDocServlet.PATH_PREFIX ) ; url.append ( "${projectName}" ) ; return com.google.common.collect.Lists.newArrayList ( new com.googlesource.gerrit.plugins.xdocs.MenuEntry ( com.google.gerrit.extensions.webui.GerritTopMenu.PROJECTS , com.google.common.collect.Lists.newArrayList ( new com.googlesource.gerrit.plugins.xdocs.MenuItem ( "Readme" , url.toString ( ) ) ) ) ) ; }
Source:
public com.google.gerrit.client.data.PatchSetDetail run ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gerrit.client.changes.Failure , com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.PatchSet ps = db.patchSets ( ) . get ( id ) ; if ( ps == null ) { throw new com.google.gerrit.client.changes.Failure ( new com.google.gerrit.client.rpc.NoSuchEntityException ( ) ) ; } final com.google.gerrit.client.data.PatchSetDetail d = new com.google.gerrit.client.data.PatchSetDetail ( ) ; d.load ( db , ps ) ; return d ; }

Target:
public com.google.gerrit.client.data.PatchSetDetail run ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gerrit.client.changes.Failure , com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.PatchSet ps = db.patchSets ( ) . get ( id ) ; if ( ps == null ) { throw new com.google.gerrit.client.changes.Failure ( new com.google.gerrit.client.rpc.NoSuchEntityException ( ) ) ; } assertCanRead ( db.changes ( ) . get ( ps.getId ( ) . getParentKey ( ) ) ) ; final com.google.gerrit.client.data.PatchSetDetail d = new com.google.gerrit.client.data.PatchSetDetail ( ) ; d.load ( db , ps ) ; return d ; }
Source:
public int compareTo ( com.googlecode.prolog_cafe.lang.Term anotherTerm ) { if ( ( anotherTerm.isVariable ( ) ) || ( anotherTerm.isDouble ( ) ) ) return AFTER ; if ( ! ( anotherTerm.isInteger ( ) ) ) return BEFORE ; int v = ( ( com.googlecode.prolog_cafe.lang.IntegerTerm ) ( anotherTerm ) ) . value ( ) ; if ( ( this . val ) == v ) return EQUAL ; if ( ( this . val ) > v ) return AFTER ; return BEFORE ; }

Target:
public int compareTo ( com.googlecode.prolog_cafe.lang.Term anotherTerm ) { if ( ( anotherTerm instanceof com.googlecode.prolog_cafe.lang.VariableTerm ) || ( anotherTerm instanceof com.googlecode.prolog_cafe.lang.DoubleTerm ) ) return AFTER ; if ( ! ( anotherTerm instanceof com.googlecode.prolog_cafe.lang.IntegerTerm ) ) return BEFORE ; int v = ( ( com.googlecode.prolog_cafe.lang.IntegerTerm ) ( anotherTerm ) ) . value ( ) ; if ( ( this . val ) == v ) return EQUAL ; if ( ( this . val ) > v ) return AFTER ; return BEFORE ; }
Source:
public Change.Id cherryPick ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet patch , java.lang.String message , java.lang.String ref , com.google.gerrit.server.project.RefControl refControl , int parent ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.IntegrationException , com.google.gerrit.server.project.InvalidChangeOperationException , com.google.gerrit.server.update.UpdateException , com.google.gwtorm.server.OrmException , java.io.IOException { return cherryPick ( change.getId ( ) , patch.getId ( ) , change.getDest ( ) , change.getTopic ( ) , change.getProject ( ) , org.eclipse.jgit.lib.ObjectId.fromString ( patch.getRevision ( ) . get ( ) ) , message , ref , refControl , parent ) ; }

Target:
public Change.Id cherryPick ( com.google.gerrit.server.update.BatchUpdate.Factory batchUpdateFactory , com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet patch , com.google.gerrit.extensions.api.changes.CherryPickInput input , com.google.gerrit.server.project.RefControl refControl ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.IntegrationException , com.google.gerrit.server.project.InvalidChangeOperationException , com.google.gerrit.server.update.UpdateException , com.google.gwtorm.server.OrmException , java.io.IOException { return cherryPick ( batchUpdateFactory , change.getId ( ) , patch.getId ( ) , change.getDest ( ) , change.getTopic ( ) , change.getProject ( ) , org.eclipse.jgit.lib.ObjectId.fromString ( patch.getRevision ( ) . get ( ) ) , input , refControl ) ; }
Source:
private void displayHasContact ( final com.google.gerrit.reviewdb.client.Account userAccount ) { if ( userAccount.isContactFiled ( ) ) { final java.sql.Timestamp dt = userAccount.getContactFiledOn ( ) ; hasContact.setText ( Util.M.contactOnFile ( new java.util.Date ( dt.getTime ( ) ) ) ) ; hasContact.setVisible ( true ) ; } else { hasContact.setVisible ( false ) ; } }

Target:
private void displayHasContact ( com.google.gerrit.client.info.AccountInfo account ) { if ( ( account.contactFiledOn ( ) ) != null ) { java.sql.Timestamp dt = account.contactFiledOn ( ) ; hasContact.setText ( Util.M.contactOnFile ( new java.util.Date ( dt.getTime ( ) ) ) ) ; hasContact.setVisible ( true ) ; } else { hasContact.setVisible ( false ) ; } }
Source:
public void destroy ( ) { hooks.removeChangeListener ( listener ) ; final boolean exit ; synchronized ( taskLock ) { if ( ( task ) != null ) { task.cancel ( true ) ; exit = false ; } else { exit = ! ( done ) ; } done = true ; } if ( exit ) { onExit ( 0 ) ; } }

Target:
public void destroy ( ) { hooks.removeEventListener ( listener ) ; final boolean exit ; synchronized ( taskLock ) { if ( ( task ) != null ) { task.cancel ( true ) ; exit = false ; } else { exit = ! ( done ) ; } done = true ; } if ( exit ) { onExit ( 0 ) ; } }
Source:
public < T > T execute ( com.google.gerrit.server.update.RetryHelper.Action < T > action ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.update.UpdateException { return execute ( action , com.google.gerrit.server.update.RetryHelper.defaults ( ) ) ; }

Target:
public < T > T execute ( com.google.gerrit.server.update.RetryHelper.Action < T > action ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { try { return execute ( action , com.google.gerrit.server.update.RetryHelper.defaults ( ) , ( t ) -> t instanceof com.google.gerrit.server.git.LockFailureException ) ; } catch ( java.lang.Throwable t ) { com.google.common.base.Throwables.throwIfUnchecked ( t ) ; com.google.common.base.Throwables.throwIfInstanceOf ( t , java.io.IOException.class ) ; com.google.common.base.Throwables.throwIfInstanceOf ( t , org.eclipse.jgit.errors.ConfigInvalidException.class ) ; com.google.common.base.Throwables.throwIfInstanceOf ( t , com.google.gwtorm.server.OrmException.class ) ; throw new com.google.gwtorm.server.OrmException ( t ) ; } }
Source:
public java.util.Map < com.google.gerrit.reviewdb.ApprovalCategory.Id , com.google.gerrit.reviewdb.PatchSetApproval > getApprovalMap ( ) { final java.util.HashMap < com.google.gerrit.reviewdb.ApprovalCategory.Id , com.google.gerrit.reviewdb.PatchSetApproval > r ; r = new java.util.HashMap < com.google.gerrit.reviewdb.ApprovalCategory.Id , com.google.gerrit.reviewdb.PatchSetApproval > ( ) ; for ( final com.google.gerrit.reviewdb.PatchSetApproval ca : approvals ) { r.put ( ca.getCategoryId ( ) , ca ) ; } return r ; }

Target:
public boolean isApproved ( java.lang.String label ) { return ( ( approved ) != null ) && ( approved.contains ( label ) ) ; }
Source:
protected void authorizeUser ( com.google.gerrit.server.project.ProjectControl control ) throws org.eclipse.jgit.lfs.errors.LfsUnauthorized { if ( ! ( control.isReadable ( ) ) ) { throwUnauthorizedOp ( "list locks" , control ) ; } }

Target:
protected void authorizeUser ( com.google.gerrit.server.project.ProjectControl control ) throws org.eclipse.jgit.lfs.errors.LfsUnauthorized { try { permissionBackend.user ( control.getUser ( ) ) . project ( control.getProject ( ) . getNameKey ( ) ) . check ( com.google.gerrit.server.permissions.ProjectPermission.ACCESS ) ; } catch ( com.google.gerrit.extensions.restapi.AuthException | com.google.gerrit.server.permissions.PermissionBackendException e ) { throwUnauthorizedOp ( "list locks" , control ) ; } }
Source:
private void configureHttp ( ) { ui.header ( "Http section" ) ; promptAndSetString ( "User" , com.ericsson.gerrit.plugins.highavailability.HTTP_SECTION , com.ericsson.gerrit.plugins.highavailability.USER_KEY , null ) ; promptAndSetString ( "Password" , com.ericsson.gerrit.plugins.highavailability.HTTP_SECTION , com.ericsson.gerrit.plugins.highavailability.PASSWORD_KEY , null ) ; promptAndSetString ( "Max number of tries to forward to remote peer" , com.ericsson.gerrit.plugins.highavailability.HTTP_SECTION , com.ericsson.gerrit.plugins.highavailability.MAX_TRIES_KEY , com.ericsson.gerrit.plugins.highavailability.Setup.str ( com.ericsson.gerrit.plugins.highavailability.DEFAULT_MAX_TRIES ) ) ; promptAndSetString ( "Retry interval [ms]" , com.ericsson.gerrit.plugins.highavailability.HTTP_SECTION , com.ericsson.gerrit.plugins.highavailability.RETRY_INTERVAL_KEY , com.ericsson.gerrit.plugins.highavailability.Setup.str ( com.ericsson.gerrit.plugins.highavailability.DEFAULT_RETRY_INTERVAL ) ) ; promptAndSetString ( "Connection timeout [ms]" , com.ericsson.gerrit.plugins.highavailability.HTTP_SECTION , com.ericsson.gerrit.plugins.highavailability.CONNECTION_TIMEOUT_KEY , com.ericsson.gerrit.plugins.highavailability.Setup.str ( com.ericsson.gerrit.plugins.highavailability.DEFAULT_TIMEOUT_MS ) ) ; promptAndSetString ( "Socket timeout [ms]" , com.ericsson.gerrit.plugins.highavailability.HTTP_SECTION , com.ericsson.gerrit.plugins.highavailability.SOCKET_TIMEOUT_KEY , com.ericsson.gerrit.plugins.highavailability.Setup.str ( com.ericsson.gerrit.plugins.highavailability.DEFAULT_TIMEOUT_MS ) ) ; }

Target:
private void configurePeerInfoSection ( ) { ui.header ( "PeerInfo section" ) ; com.ericsson.gerrit.plugins.highavailability.Configuration.PeerInfoStrategy strategy = ui.readEnum ( PeerInfoStrategy.JGROUPS , "Peer info strategy" ) ; config.setEnum ( com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , null , com.ericsson.gerrit.plugins.highavailability.Configuration.STRATEGY_KEY , strategy ) ; if ( strategy == ( com.ericsson.gerrit.plugins.highavailability.Configuration.PeerInfoStrategy.STATIC ) ) { promptAndSetString ( "Peer URL" , com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , com.ericsson.gerrit.plugins.highavailability.Configuration.STATIC_SUBSECTION , com.ericsson.gerrit.plugins.highavailability.Configuration.URL_KEY , null ) ; } else { promptAndSetString ( "JGroups cluster name" , com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , com.ericsson.gerrit.plugins.highavailability.Configuration.JGROUPS_SUBSECTION , com.ericsson.gerrit.plugins.highavailability.Configuration.CLUSTER_NAME_KEY , com.ericsson.gerrit.plugins.highavailability.Configuration.DEFAULT_CLUSTER_NAME ) ; } }
Source:
private com.google.common.collect.SetMultimap < org.eclipse.jgit.lib.ObjectId , org.eclipse.jgit.lib.Ref > changeRefsById ( ) throws java.io.IOException { if ( ( refsById ) == null ) { refsById = com.google.common.collect.HashMultimap.create ( ) ; for ( org.eclipse.jgit.lib.Ref r : repo.getRefDatabase ( ) . getRefs ( com.google.gerrit.reviewdb.client.RefNames.REFS_CHANGES ) . values ( ) ) { if ( com.google.gerrit.reviewdb.client.PatchSet.isRef ( r.getName ( ) ) ) { refsById.put ( r.getObjectId ( ) , r ) ; } } } return refsById ; }

Target:
private com.google.common.collect.SetMultimap < org.eclipse.jgit.lib.ObjectId , org.eclipse.jgit.lib.Ref > changeRefsById ( ) { if ( ( refsById ) == null ) { refsById = com.google.common.collect.HashMultimap.create ( ) ; for ( org.eclipse.jgit.lib.Ref r : refsByChange ( ) . values ( ) ) { refsById.put ( r.getObjectId ( ) , r ) ; } } return refsById ; }
Source:
public void visit ( org.pegdown.ast.StrongEmphSuperNode node ) { if ( node.isClosed ( ) ) { wrapChildren ( ( node.isStrong ( ) ? "strong" : "em" ) , node ) ; } else { html.appendAndEscape ( node.getChars ( ) ) ; visitChildren ( node ) ; } }

Target:
public void visit ( org.commonmark.node.Emphasis node ) { wrapChildren ( "em" , node ) ; }
Source:
private com.google.gerrit.acceptance.RestResponse GET ( java.lang.String changeId ) throws java.io.IOException { return adminSession.get ( ( ( "/changes/" + changeId ) + "/hashtags/" ) ) ; }

Target:
private com.google.common.truth.IterableSubject < ? extends com.google.common.truth.IterableSubject < ? , java.lang.String , java.lang.Iterable < java.lang.String > > , java.lang.String , java.lang.Iterable < java.lang.String > > assertThatGet ( com.google.gerrit.acceptance.PushOneCommit.Result r ) throws java.lang.Exception { return com.google.common.truth.Truth.assertThat ( ( ( java.lang.Iterable < java.lang.String > ) ( gApi.changes ( ) . id ( r.getChange ( ) . getId ( ) . get ( ) ) . getHashtags ( ) ) ) ) ; }
Source:
public static void stopElasticsearchServer ( ) { if ( ( com.google.gerrit.elasticsearch.ElasticQueryChangesTest.node ) != null ) { com.google.gerrit.elasticsearch.ElasticQueryChangesTest.node.close ( ) ; com.google.gerrit.elasticsearch.ElasticQueryChangesTest.node = null ; } if ( ( ( com.google.gerrit.elasticsearch.ElasticQueryChangesTest.elasticDir ) != null ) && ( com.google.gerrit.elasticsearch.ElasticQueryChangesTest.elasticDir.delete ( ) ) ) { com.google.gerrit.elasticsearch.ElasticQueryChangesTest.elasticDir = null ; } }

Target:
public static void stopElasticsearchServer ( ) { if ( ( com.google.gerrit.elasticsearch.ElasticQueryChangesTest.nodeInfo ) != null ) { com.google.gerrit.elasticsearch.ElasticQueryChangesTest.nodeInfo.node.close ( ) ; com.google.gerrit.elasticsearch.ElasticQueryChangesTest.nodeInfo.elasticDir.delete ( ) ; com.google.gerrit.elasticsearch.ElasticQueryChangesTest.nodeInfo = null ; } }
Source:
public void cleanUp ( ) { for ( java.nio.file.Path path : listFiles ( ) ) { com.google.gerrit.httpd.WebSessionManager.Val val = readFile ( path ) ; org.joda.time.DateTime expires = new org.joda.time.DateTime ( val.getExpiresAt ( ) ) ; if ( expires.isBefore ( new org.joda.time.DateTime ( ) ) ) { deleteFile ( path ) ; } } }

Target:
public void cleanUp ( ) { for ( java.nio.file.Path path : listFiles ( ) ) { com.google.gerrit.httpd.WebSessionManager.Val val = readFile ( path ) ; long expires = val.getExpiresAt ( ) ; if ( expires < ( java.lang.System.currentTimeMillis ( ) ) ) { deleteFile ( path ) ; } } }
Source:
public int compare ( java.lang.String left , java.lang.String right ) { java.lang.Integer lp = positions.get ( left ) ; java.lang.Integer rp = positions.get ( right ) ; if ( lp == rp ) { return 0 ; } else if ( lp == null ) { return - 1 ; } else if ( rp == null ) { return 1 ; } else { return lp - rp ; } }

Target:
public int compare ( java.lang.String left , java.lang.String right ) { int lp = position ( left ) ; int rp = position ( right ) ; int cmp = lp - rp ; if ( cmp == 0 ) { cmp = left.compareTo ( right ) ; } return cmp ; }
Source:
public void sendErrorThrowsIOException ( ) throws java.lang.Exception { org.mockito.Mockito.doThrow ( new java.io.IOException ( "someError" ) ) . when ( rsp ) . sendError ( javax.servlet.http.HttpServletResponse.SC_NOT_FOUND , "Error trying to find a change \n" ) ; setupPostMocks ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexChangeRestApiServletTest.CHANGE_EXISTS , com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexChangeRestApiServletTest.THROW_ORM_EXCEPTION ) ; indexRestApiServlet.doPost ( req , rsp ) ; org.mockito.Mockito.verify ( rsp ) . sendError ( javax.servlet.http.HttpServletResponse.SC_NOT_FOUND , "Error trying to find a change \n" ) ; org.mockito.Mockito.verifyZeroInteractions ( indexer ) ; }

Target:
public void sendErrorThrowsIOException ( ) throws java.lang.Exception { org.mockito.Mockito.doThrow ( new java.io.IOException ( "someError" ) ) . when ( rsp ) . sendError ( javax.servlet.http.HttpServletResponse.SC_NOT_FOUND , "Error trying to find change \n" ) ; setupPostMocks ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexChangeRestApiServletTest.CHANGE_EXISTS , com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexChangeRestApiServletTest.THROW_ORM_EXCEPTION ) ; indexRestApiServlet.doPost ( req , rsp ) ; org.mockito.Mockito.verify ( rsp ) . sendError ( javax.servlet.http.HttpServletResponse.SC_NOT_FOUND , "Error trying to find change \n" ) ; org.mockito.Mockito.verifyZeroInteractions ( indexer ) ; }
Source:
private void loadOrganisations ( java.lang.String username , com.google.common.collect.Multimap < java.lang.String , java.lang.String > orgsTeams , com.googlesource.gerrit.plugins.github.oauth.GitHubLogin ghLogin ) throws java.io.IOException { com.googlesource.gerrit.plugins.github.group.GitHubGroupsCache.OrganisationLoader.log.debug ( "Getting list of public organisations for user '{}'" , username ) ; java.util.Set < java.lang.String > organisations = ghLogin.getMyOrganisationsLogins ( ) ; for ( java.lang.String org : organisations ) { orgsTeams.put ( org , com.googlesource.gerrit.plugins.github.group.GitHubGroupsCache.EVERYONE_TEAM_NAME ) ; } }

Target:
private void loadOrganisations ( java.lang.String username , com.google.common.collect.Multimap < java.lang.String , java.lang.String > orgsTeams , com.googlesource.gerrit.plugins.github.oauth.GitHubLogin ghLogin ) throws java.io.IOException { com.googlesource.gerrit.plugins.github.group.GitHubGroupsCache.OrganisationLoader.logger.debug ( "Getting list of public organisations for user '{}'" , username ) ; java.util.Set < java.lang.String > organisations = ghLogin.getMyOrganisationsLogins ( ) ; for ( java.lang.String org : organisations ) { orgsTeams.put ( org , com.googlesource.gerrit.plugins.github.group.GitHubGroupsCache.EVERYONE_TEAM_NAME ) ; } }
Source:
protected void doGet ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse resp ) throws java.io.IOException , javax.servlet.ServletException { com.googlesource.gerrit.plugins.lfs.locks.LfsLocksServlet.Action action = new com.googlesource.gerrit.plugins.lfs.locks.LfsLocksServlet.Action ( req , resp ) ; java.util.regex.Matcher matcher = com.googlesource.gerrit.plugins.lfs.locks.LfsLocksServlet.LFS_LOCKS_URL.matcher ( action.path ) ; if ( matcher.matches ( ) ) { java.lang.String project = matcher.group ( 1 ) ; listLocks ( project , action ) ; return ; } action.sendError ( org.apache.http.HttpStatus.SC_INTERNAL_SERVER_ERROR , java.lang.String.format ( "Unsupported path %s was provided" , action.path ) ) ; }

Target:
protected void doPost ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse resp ) throws java.io.IOException , javax.servlet.ServletException { com.googlesource.gerrit.plugins.lfs.locks.LfsLocksContext context = new com.googlesource.gerrit.plugins.lfs.locks.LfsLocksContext ( req , resp ) ; putters.create ( context ) . run ( ) ; }
Source:
private void assertReviewers ( com.google.gerrit.reviewdb.client.Change c , com.google.gerrit.acceptance.TestAccount ... expectedReviewers ) throws com.google.gwtorm.server.OrmException { java.lang.Iterable < com.google.gerrit.reviewdb.client.Account.Id > actualIds = approvalsUtil.getReviewers ( db , notesFactory.create ( c ) ) . values ( ) ; com.google.common.truth.Truth.assertThat ( actualIds ) . containsExactlyElementsIn ( com.google.common.collect.Sets.newHashSet ( com.google.gerrit.acceptance.TestAccount.ids ( expectedReviewers ) ) ) ; }

Target:
private void assertReviewers ( com.google.gerrit.reviewdb.client.Change c , com.google.gerrit.acceptance.TestAccount ... expectedReviewers ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { java.lang.Iterable < com.google.gerrit.reviewdb.client.Account.Id > actualIds = approvalsUtil.getReviewers ( db , notesFactory.createChecked ( db , c ) ) . values ( ) ; com.google.common.truth.Truth.assertThat ( actualIds ) . containsExactlyElementsIn ( com.google.common.collect.Sets.newHashSet ( com.google.gerrit.acceptance.TestAccount.ids ( expectedReviewers ) ) ) ; }
Source:
public void configure ( ) { com.google.gerrit.server.plugins.PluginMetricMaker metrics = new com.google.gerrit.server.plugins.PluginMetricMaker ( serverMetrics , plugin.getName ( ) ) ; bind ( com.google.gerrit.metrics.MetricMaker.class ) . toInstance ( metrics ) ; listener ( ) . toInstance ( metrics ) ; }

Target:
public void configure ( ) { com.google.gerrit.server.plugins.PluginMetricMaker metrics = new com.google.gerrit.server.plugins.PluginMetricMaker ( serverMetrics , com.google.common.base.MoreObjects.firstNonNull ( plugin.getMetricsPrefix ( ) , java.lang.String.format ( "plugins/%s/" , plugin.getName ( ) ) ) ) ; bind ( com.google.gerrit.metrics.MetricMaker.class ) . toInstance ( metrics ) ; listener ( ) . toInstance ( metrics ) ; }
Source:
static com.google.gerrit.server.index.FieldDef < com.google.gerrit.server.query.change.ChangeData , ? > topicField ( com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema ) { if ( schema == null ) { return com.google.gerrit.server.index.ChangeField.LEGACY_TOPIC ; } com.google.gerrit.server.index.FieldDef < com.google.gerrit.server.query.change.ChangeData , ? > f = schema.getFields ( ) . get ( com.google.gerrit.server.index.ChangeField.TOPIC.getName ( ) ) ; if ( f != null ) { return f ; } return schema.getFields ( ) . get ( ChangeField.LEGACY_TOPIC.getName ( ) ) ; }

Target:
static com.google.gerrit.server.index.FieldDef < com.google.gerrit.server.query.change.ChangeData , ? > topicField ( com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema ) { if ( schema == null ) { return com.google.gerrit.server.index.ChangeField.LEGACY_TOPIC2 ; } if ( schema.hasField ( com.google.gerrit.server.index.ChangeField.FUZZY_TOPIC ) ) { return schema.getFields ( ) . get ( com.google.gerrit.server.index.ChangeField.FUZZY_TOPIC.getName ( ) ) ; } if ( schema.hasField ( com.google.gerrit.server.index.ChangeField.LEGACY_TOPIC3 ) ) { return schema.getFields ( ) . get ( com.google.gerrit.server.index.ChangeField.LEGACY_TOPIC3.getName ( ) ) ; } return schema.getFields ( ) . get ( com.google.gerrit.server.index.ChangeField.LEGACY_TOPIC2.getName ( ) ) ; }
Source:
public com.google.gerrit.client.reviewdb.RevId max ( ) { if ( isComplete ( ) ) { return this ; } final java.lang.StringBuilder revEnd = new java.lang.StringBuilder ( com.google.gerrit.client.reviewdb.RevId.LEN ) ; revEnd.append ( get ( ) ) ; while ( ( revEnd.length ( ) ) < ( com.google.gerrit.client.reviewdb.RevId.LEN ) ) { revEnd.append ( '~' ) ; } return new com.google.gerrit.client.reviewdb.RevId ( revEnd.toString ( ) ) ; }

Target:
public com.google.gerrit.client.reviewdb.RevId max ( ) { if ( isComplete ( ) ) { return this ; } final java.lang.StringBuilder revEnd = new java.lang.StringBuilder ( ( ( get ( ) . length ( ) ) + 1 ) ) ; revEnd.append ( get ( ) ) ; revEnd.append ( 'z' ) ; return new com.google.gerrit.client.reviewdb.RevId ( revEnd.toString ( ) ) ; }
Source:
protected final com.google.gerrit.server.mail.send.ProjectWatch.Watchers getWatchers ( com.google.gerrit.server.account.WatchConfig.NotifyType type ) throws com.google.gwtorm.server.OrmException { if ( ! ( NotifyHandling.ALL.equals ( notify ) ) ) { return new com.google.gerrit.server.mail.send.ProjectWatch.Watchers ( ) ; } com.google.gerrit.server.mail.send.ProjectWatch watch = new com.google.gerrit.server.mail.send.ProjectWatch ( args , branch.getParentKey ( ) , projectState , changeData ) ; return watch.getWatchers ( type ) ; }

Target:
protected final com.google.gerrit.server.mail.send.ProjectWatch.Watchers getWatchers ( com.google.gerrit.server.account.WatchConfig.NotifyType type , boolean includeWatchersFromNotifyConfig ) throws com.google.gwtorm.server.OrmException { if ( ! ( NotifyHandling.ALL.equals ( notify ) ) ) { return new com.google.gerrit.server.mail.send.ProjectWatch.Watchers ( ) ; } com.google.gerrit.server.mail.send.ProjectWatch watch = new com.google.gerrit.server.mail.send.ProjectWatch ( args , branch.getParentKey ( ) , projectState , changeData ) ; return watch.getWatchers ( type , includeWatchersFromNotifyConfig ) ; }
Source:
public void testPatternNullMatch ( ) { com.googlesource.gerrit.plugins.hooks.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "ItsTestName" , null , "commentlink" ) ) . andReturn ( null ) . atLeastOnce ( ) ; 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 testGetIssuePatternNullMatch ( ) { com.googlesource.gerrit.plugins.hooks.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "ItsTestName" , null , "commentlink" ) ) . andReturn ( null ) . atLeastOnce ( ) ; 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 void onlyDeleteNewlyCreatedWithOverlappingRefPatterns ( ) throws java.lang.Exception { org.eclipse.jgit.lib.Ref matchingRef ; try ( com.google.gerrit.acceptance.ProjectResetter resetProject = builder ( ) . reset ( project , "refs/match/*" , "refs/match/test" ) . build ( ) ) { matchingRef = createRef ( "refs/match/test" ) ; } assertDeletedRef ( matchingRef ) ; }

Target:
public void onlyDeleteNewlyCreatedWithOverlappingRefPatterns ( ) throws java.lang.Exception { org.eclipse.jgit.lib.Ref matchingRef ; try ( com.google.gerrit.acceptance.ProjectResetter resetProject = builder ( ) . build ( new com.google.gerrit.acceptance.ProjectResetter.Config ( ) . reset ( project , "refs/match/*" , "refs/match/test" ) ) ) { matchingRef = createRef ( "refs/match/test" ) ; } assertDeletedRef ( matchingRef ) ; }