auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void byCommitter ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change1 = insert ( newChange ( repo , null , null , userId.get ( ) , null ) ) ; assertQuery ( "committer:jcommitter@example.com" , change1 ) ; assertQuery ( "committer:jcommitter" , change1 ) ; assertQuery ( "committer:example" , change1 ) ; assertQuery ( "committer:example.com" , change1 ) ; assertQuery ( "committer:Committer" , change1 ) ; assertQuery ( "committer:jauthor@example.com" ) ; assertQuery ( "committer:somewhere.com" ) ; assertQuery ( "committer:jauthor" ) ; assertQuery ( "committer:Author" ) ; }

Target:
public void byCommitter ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change1 = insert ( newChange ( repo , null , null , userId.get ( ) , null ) ) ; assertQuery ( "committer:jcommitter@example.com" , change1 ) ; assertQuery ( "committer:jcommitter" , change1 ) ; assertQuery ( "committer:example" , change1 ) ; assertQuery ( "committer:example.com" , change1 ) ; assertQuery ( "committer:Committer" , change1 ) ; assertQuery ( "committer:jCoMmItTeR" , change1 ) ; assertQuery ( "committer:ExAmPlE" , change1 ) ; assertQuery ( "committer:jauthor@example.com" ) ; assertQuery ( "committer:somewhere.com" ) ; assertQuery ( "committer:jauthor" ) ; assertQuery ( "committer:Author" ) ; }
Source:
public void doesNotPublishWhenExpected ( ) throws java.lang.Exception { mockEvent.change = mockChange ; mockChange.commitMessage = "WIP:This is a title\nAnd a the body." ; com.cisco.gerrit.plugins.slack.message.MessageGenerator messageGenerator ; messageGenerator = com.cisco.gerrit.plugins.slack.message.MessageGeneratorFactory.newInstance ( mockEvent , config ) ; org.junit.Assert.assertThat ( messageGenerator.shouldPublish ( ) , org.hamcrest.core.Is.is ( true ) ) ; }

Target:
public void doesNotPublishWhenExpected ( ) throws java.lang.Exception { mockEvent.change = com.google.common.base.Suppliers.ofInstance ( mockChange ) ; mockChange.commitMessage = "WIP:This is a title\nAnd a the body." ; com.cisco.gerrit.plugins.slack.message.MessageGenerator messageGenerator ; messageGenerator = com.cisco.gerrit.plugins.slack.message.MessageGeneratorFactory.newInstance ( mockEvent , config ) ; org.junit.Assert.assertThat ( messageGenerator.shouldPublish ( ) , org.hamcrest.core.Is.is ( true ) ) ; }
Source:
public void testParseWComments ( ) throws java.lang.Exception { com.google.gerrit.server.git.QueryList ql = com.google.gerrit.server.git.QueryList.parse ( ( ( ( com.google.gerrit.server.git.QueryListTest.C1 ) + ( com.google.gerrit.server.git.QueryListTest.F_SIMPLE ) ) + ( com.google.gerrit.server.git.QueryListTest.C2 ) ) , null ) ; com.google.common.truth.Truth.assertThat ( ql.getQuery ( com.google.gerrit.server.git.QueryListTest.N_FOO ) ) . isEqualTo ( com.google.gerrit.server.git.QueryListTest.Q_P ) ; com.google.common.truth.Truth.assertThat ( ql.getQuery ( com.google.gerrit.server.git.QueryListTest.N_BAR ) ) . isEqualTo ( com.google.gerrit.server.git.QueryListTest.Q_B ) ; }

Target:
public void testParseWComments ( ) throws java.lang.Exception { com.google.gerrit.server.account.QueryList ql = com.google.gerrit.server.account.QueryList.parse ( ( ( ( com.google.gerrit.server.account.QueryListTest.C1 ) + ( com.google.gerrit.server.account.QueryListTest.F_SIMPLE ) ) + ( com.google.gerrit.server.account.QueryListTest.C2 ) ) , null ) ; com.google.common.truth.Truth.assertThat ( ql.getQuery ( com.google.gerrit.server.account.QueryListTest.N_FOO ) ) . isEqualTo ( com.google.gerrit.server.account.QueryListTest.Q_P ) ; com.google.common.truth.Truth.assertThat ( ql.getQuery ( com.google.gerrit.server.account.QueryListTest.N_BAR ) ) . isEqualTo ( com.google.gerrit.server.account.QueryListTest.Q_B ) ; }
Source:
public java.lang.Void call ( ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gwtorm.server.OrmException , java.io.IOException { if ( caller == ( java.lang.Thread.currentThread ( ) ) ) { insertChange ( db ) ; } else { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schemaFactory.open ( ) ) { insertChange ( db ) ; } } synchronized ( newProgress ) { newProgress.update ( 1 ) ; } return null ; }

Target:
public java.lang.Void call ( ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException , com.google.gwtorm.server.OrmException { if ( caller == ( java.lang.Thread.currentThread ( ) ) ) { insertChange ( this . db ) ; } else { try ( com.google.gerrit.reviewdb.server.ReviewDb threadLocalDb = schemaFactory.open ( ) ) { insertChange ( threadLocalDb ) ; } } synchronized ( newProgress ) { newProgress.update ( 1 ) ; } return null ; }
Source:
public com.google.gerrit.server.project.FileResource parse ( com.google.gerrit.server.project.CommitResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { return com.google.gerrit.server.project.FileResource.create ( repoManager , parent.getProject ( ) , parent.getCommit ( ) , id.get ( ) ) ; }

Target:
public com.google.gerrit.server.project.FileResource parse ( com.google.gerrit.server.project.CommitResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { if ( Patch.COMMIT_MSG.equals ( id.get ( ) ) ) { return new com.google.gerrit.server.project.FileResource ( parent.getProject ( ) , parent.getCommit ( ) , id.get ( ) ) ; } return com.google.gerrit.server.project.FileResource.create ( repoManager , parent.getProject ( ) , parent.getCommit ( ) , id.get ( ) ) ; }
Source:
public void byProjectPrefix ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo1 = createProject ( "repo1" ) ; org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo2 = createProject ( "repo2" ) ; com.google.gerrit.reviewdb.client.Change change1 = newChange ( repo1 , null , null , null , null ) . insert ( ) ; com.google.gerrit.reviewdb.client.Change change2 = newChange ( repo2 , null , null , null , null ) . insert ( ) ; assertQuery ( "projects:foo" ) ; assertQuery ( "projects:repo1" , change1 ) ; assertQuery ( "projects:repo2" , change2 ) ; assertQuery ( "projects:repo" , change2 , change1 ) ; }

Target:
public void byProject ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo1 = createProject ( "repo1" ) ; org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo2 = createProject ( "repo2" ) ; com.google.gerrit.reviewdb.client.Change change1 = insert ( newChange ( repo1 , null , null , null , null ) ) ; com.google.gerrit.reviewdb.client.Change change2 = insert ( newChange ( repo2 , null , null , null , null ) ) ; assertQuery ( "project:foo" ) ; assertQuery ( "project:repo" ) ; assertQuery ( "project:repo1" , change1 ) ; assertQuery ( "project:repo2" , change2 ) ; }
Source:
public void inheritRead_AppendWithDenyOfRef ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.deny ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCanAccess ( u ) ; assertCanRead ( "refs/master" , u ) ; assertCanRead ( "refs/tags/foobar" , u ) ; assertCanRead ( "refs/heads/master" , u ) ; }

Target:
public void inheritRead_AppendWithDenyOfRef ( ) { com.google.gerrit.server.project.testing.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.testing.Util.deny ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCanAccess ( u ) ; assertCanRead ( "refs/master" , u ) ; assertCanRead ( "refs/tags/foobar" , u ) ; assertCanRead ( "refs/heads/master" , u ) ; }
Source:
public void start ( ) { queue.getDefaultQueue ( ) . execute ( compressor ) ; java.time.ZoneId zone = java.time.ZoneId.systemDefault ( ) ; java.time.LocalDate now = java.time.LocalDate.now ( zone ) ; long milliSecondsUntil11pm = now.atStartOfDay ( zone ) . plusHours ( 23 ) . toInstant ( ) . toEpochMilli ( ) ; queue.getDefaultQueue ( ) . scheduleAtFixedRate ( compressor , milliSecondsUntil11pm , java.util.concurrent.TimeUnit.HOURS.toMillis ( 24 ) , java.util.concurrent.TimeUnit.MILLISECONDS ) ; }

Target:
public void start ( ) { queue.getDefaultQueue ( ) . execute ( compressor ) ; java.time.ZoneId zone = java.time.ZoneId.systemDefault ( ) ; java.time.LocalDate now = java.time.LocalDate.now ( zone ) ; long milliSecondsUntil11pm = now.atStartOfDay ( zone ) . plusHours ( 23 ) . toInstant ( ) . toEpochMilli ( ) ; @ java.lang.SuppressWarnings ( value = "unused" ) java.util.concurrent.Future < ? > possiblyIgnoredError = queue.getDefaultQueue ( ) . scheduleAtFixedRate ( compressor , milliSecondsUntil11pm , java.util.concurrent.TimeUnit.HOURS.toMillis ( 24 ) , java.util.concurrent.TimeUnit.MILLISECONDS ) ; }
Source:
public com.google.gerrit.server.notedb.ChangeNotes createFromIdOnlyWhenNotedbDisabled ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { com.google.common.base.Preconditions.checkState ( ( ! ( args.migration.readChanges ( ) ) ) , ( "do not call" + " createFromIdOnlyWhenNotedbDisabled when notedb is enabled" ) ) ; com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.server.notedb.ChangeNotes.Factory.unwrap ( db ) . changes ( ) . get ( changeId ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( args , change.getProject ( ) , change ) . load ( ) ; }

Target:
public com.google.gerrit.server.notedb.ChangeNotes createFromIdOnlyWhenNoteDbDisabled ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { com.google.common.base.Preconditions.checkState ( ( ! ( args.migration.readChanges ( ) ) ) , ( "do not call" + " createFromIdOnlyWhenNoteDbDisabled when NoteDb is enabled" ) ) ; com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.server.notedb.ChangeNotes.Factory.unwrap ( db ) . changes ( ) . get ( changeId ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( args , change.getProject ( ) , change ) . load ( ) ; }
Source:
protected java.lang.String buildHtml ( java.lang.String path , boolean assertHasETag ) throws java.lang.Exception { com.google.gitiles.FakeHttpServletResponse res = build ( path ) ; org.junit.Assert.assertEquals ( "text/html" , res.getHeader ( com.google.common.net.HttpHeaders.CONTENT_TYPE ) ) ; if ( assertHasETag ) { org.junit.Assert.assertNotNull ( "has ETag" , res.getHeader ( com.google.common.net.HttpHeaders.ETAG ) ) ; } return res.getActualBodyString ( ) ; }

Target:
protected java.lang.String buildHtml ( java.lang.String path , boolean assertHasETag ) throws java.lang.Exception { com.google.gitiles.FakeHttpServletResponse res = build ( path ) ; com.google.common.truth.Truth.assertThat ( res.getHeader ( com.google.common.net.HttpHeaders.CONTENT_TYPE ) ) . isEqualTo ( "text/html" ) ; if ( assertHasETag ) { com.google.common.truth.Truth.assertWithMessage ( "missing ETag" ) . that ( res.getHeader ( com.google.common.net.HttpHeaders.ETAG ) ) . isNotNull ( ) ; } return res.getActualBodyString ( ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { l.setVisible ( true ) ; edit.setVisible ( true ) ; input.setVisible ( false ) ; input.setValue ( headRevision ) ; save.setVisible ( false ) ; save.setEnabled ( false ) ; cancel.setVisible ( false ) ; }

Target:
void updateDeleteButton ( ) { boolean on = false ; for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; row ++ ) { com.google.gwt.user.client.ui.Widget w = table.getWidget ( row , 1 ) ; if ( ( w != null ) && ( w instanceof com.google.gwt.user.client.ui.CheckBox ) ) { com.google.gwt.user.client.ui.CheckBox sel = ( ( com.google.gwt.user.client.ui.CheckBox ) ( w ) ) ; if ( sel.getValue ( ) ) { on = true ; break ; } } } delTag.setEnabled ( on ) ; }
Source:
public void delete ( com.google.gerrit.reviewdb.client.Project project ) throws com.google.gwtorm.server.OrmException ;

Target:
public java.util.Collection < java.lang.String > getWarnings ( com.google.gerrit.reviewdb.client.Project project ) throws com.google.gwtorm.server.OrmException { java.util.Collection < java.lang.String > ret = com.google.common.collect.Lists.newArrayList ( ) ; java.util.List < com.google.gerrit.server.query.change.ChangeData > openChanges = queryProvider.get ( ) . byProjectOpen ( project.getNameKey ( ) ) ; if ( openChanges.iterator ( ) . hasNext ( ) ) { ret.add ( ( ( project.getName ( ) ) + " has open changes" ) ) ; } return ret ; }
Source:
public boolean equals ( java.lang.Object other ) { return ( other instanceof com.google.gerrit.server.permissions.LabelPermission ) && ( name.equals ( ( ( com.google.gerrit.server.permissions.LabelPermission ) ( other ) ) . name ) ) ; }

Target:
public boolean equals ( java.lang.Object other ) { if ( other instanceof com.google.gerrit.server.permissions.LabelPermission ) { com.google.gerrit.server.permissions.LabelPermission b = ( ( com.google.gerrit.server.permissions.LabelPermission ) ( other ) ) ; return ( ( forUser ) == ( b.forUser ) ) && ( name.equals ( b.name ) ) ; } return false ; }
Source:
public com.google.gerrit.server.group.GroupJson.GroupInfo format ( com.google.gerrit.common.data.GroupDescription.Basic group ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.group.GroupJson.GroupInfo info = init ( group ) ; if ( ( options.contains ( com.google.gerrit.common.groups.ListGroupsOption.MEMBERS ) ) || ( options.contains ( com.google.gerrit.common.groups.ListGroupsOption.INCLUDES ) ) ) { com.google.gerrit.server.group.GroupResource rsrc = new com.google.gerrit.server.group.GroupResource ( groupControlFactory.controlFor ( group ) ) ; initMembersAndIncludes ( rsrc , info ) ; } return info ; }

Target:
public com.google.gerrit.server.group.GroupJson addOption ( com.google.gerrit.extensions.client.ListGroupsOption o ) { options.add ( o ) ; return this ; }
Source:
private boolean isEditModeEnabled ( com.google.gerrit.client.changes.ChangeInfo info , com.google.gerrit.client.changes.ChangeInfo.RevisionInfo rev ) { if ( rev.is_edit ( ) ) { return true ; } if ( ( edit ) == null ) { return revision.equals ( info.current_revision ( ) ) ; } return ( rev._number ( ) ) == ( com.google.gerrit.client.changes.ChangeInfo.RevisionInfo.findEditParent ( info.revisions ( ) . values ( ) ) ) ; }

Target:
private boolean isEditModeEnabled ( com.google.gerrit.client.changes.ChangeInfo info , com.google.gerrit.client.changes.ChangeInfo.RevisionInfo rev ) { if ( rev.isEdit ( ) ) { return true ; } if ( ( edit ) == null ) { return revision.equals ( info.currentRevision ( ) ) ; } return ( rev._number ( ) ) == ( com.google.gerrit.client.changes.ChangeInfo.RevisionInfo.findEditParent ( info.revisions ( ) . values ( ) ) ) ; }
Source:
public final void copyTo ( com.google.gerrit.extensions.client.EditPreferencesInfo p ) { p.tabSize = tabSize ( ) ; p.lineLength = lineLength ( ) ; p.cursorBlinkRate = cursorBlinkRate ( ) ; p.hideTopMenu = hideTopMenu ( ) ; p.showTabs = showTabs ( ) ; p.showWhitespaceErrors = showWhitespaceErrors ( ) ; p.syntaxHighlighting = syntaxHighlighting ( ) ; p.hideLineNumbers = hideLineNumbers ( ) ; p.theme = theme ( ) ; p.keyMapType = keyMapType ( ) ; }

Target:
public final void copyTo ( com.google.gerrit.extensions.client.EditPreferencesInfo p ) { p.tabSize = tabSize ( ) ; p.lineLength = lineLength ( ) ; p.cursorBlinkRate = cursorBlinkRate ( ) ; p.hideTopMenu = hideTopMenu ( ) ; p.showTabs = showTabs ( ) ; p.showWhitespaceErrors = showWhitespaceErrors ( ) ; p.syntaxHighlighting = syntaxHighlighting ( ) ; p.hideLineNumbers = hideLineNumbers ( ) ; p.matchBrackets = matchBrackets ( ) ; p.theme = theme ( ) ; p.keyMapType = keyMapType ( ) ; }
Source:
public java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > byPatchSet ( 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 { if ( ! ( migration.readPatchSetApprovals ( ) ) ) { return com.google.gerrit.server.ApprovalsUtil.sortApprovals ( db.patchSetApprovals ( ) . byPatchSet ( psId ) ) ; } return copier.getForPatchSet ( db , ctl , psId ) ; }

Target:
public java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > byPatchSet ( 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 { if ( ! ( migration.readChanges ( ) ) ) { return com.google.gerrit.server.ApprovalsUtil.sortApprovals ( db.patchSetApprovals ( ) . byPatchSet ( psId ) ) ; } return copier.getForPatchSet ( db , ctl , psId ) ; }
Source:
public void parseOptionMap ( java.util.Map < java.lang.String , java.lang.String [ ] > parameters ) throws org.kohsuke.args4j.CmdLineException { com.google.common.collect.Multimap < java.lang.String , java.lang.String > map = com.google.common.collect.LinkedHashMultimap.create ( ) ; for ( java.util.Map.Entry < java.lang.String , java.lang.String [ ] > ent : parameters.entrySet ( ) ) { for ( java.lang.String val : ent.getValue ( ) ) { map.put ( ent.getKey ( ) , val ) ; } } parseOptionMap ( map ) ; }

Target:
public void parseOptionMap ( java.util.Map < java.lang.String , java.lang.String [ ] > parameters ) throws org.kohsuke.args4j.CmdLineException { com.google.common.collect.ListMultimap < java.lang.String , java.lang.String > map = com.google.common.collect.MultimapBuilder.hashKeys ( ) . arrayListValues ( ) . build ( ) ; for ( java.util.Map.Entry < java.lang.String , java.lang.String [ ] > ent : parameters.entrySet ( ) ) { for ( java.lang.String val : ent.getValue ( ) ) { map.put ( ent.getKey ( ) , val ) ; } } parseOptionMap ( map ) ; }
Source:
public void deleteReviewerFromReviewableChangeByAdminCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; setEmailStrategy ( admin , EmailStrategy.CC_ON_OWN_COMMENTS ) ; setApiUser ( admin ) ; removeReviewer ( sc , extraReviewer ) ; assertThat ( sender ) . sent ( "deleteReviewer" , sc ) . to ( sc.owner , extraReviewer ) . cc ( admin , extraCcer , sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void deleteReviewerFromReviewableChangeByAdminCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChangeWithExtraReviewer ( ) ; setEmailStrategy ( admin , EmailStrategy.CC_ON_OWN_COMMENTS ) ; setApiUser ( admin ) ; removeReviewer ( sc , extraReviewer ) ; assertThat ( sender ) . sent ( "deleteReviewer" , sc ) . to ( sc.owner , extraReviewer ) . cc ( admin , extraCcer , sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) . noOneElse ( ) ; }
Source:
public com.google.gerrit.server.change.ChangeKind getChangeKind ( com.google.gerrit.server.project.ProjectState project , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.lib.ObjectId prior , org.eclipse.jgit.lib.ObjectId next ) { try { com.google.gerrit.server.change.ChangeKindCacheImpl.Key key = new com.google.gerrit.server.change.ChangeKindCacheImpl.Key ( prior , next , useRecursiveMerge ) ; return new com.google.gerrit.server.change.ChangeKindCacheImpl.Loader ( key , repo ) . call ( ) ; } catch ( java.io.IOException e ) { com.google.gerrit.server.change.ChangeKindCacheImpl.log.warn ( ( ( ( "Cannot check trivial rebase of new patch set " + ( next.name ( ) ) ) + " in " ) + ( project.getProject ( ) . getName ( ) ) ) , e ) ; return ChangeKind.REWORK ; } }

Target:
public com.google.gerrit.extensions.client.ChangeKind getChangeKind ( com.google.gerrit.server.project.ProjectState project , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.lib.ObjectId prior , org.eclipse.jgit.lib.ObjectId next ) { try { com.google.gerrit.server.change.ChangeKindCacheImpl.Key key = new com.google.gerrit.server.change.ChangeKindCacheImpl.Key ( prior , next , useRecursiveMerge ) ; return new com.google.gerrit.server.change.ChangeKindCacheImpl.Loader ( key , repo ) . call ( ) ; } catch ( java.io.IOException e ) { com.google.gerrit.server.change.ChangeKindCacheImpl.log.warn ( ( ( ( "Cannot check trivial rebase of new patch set " + ( next.name ( ) ) ) + " in " ) + ( project.getProject ( ) . getName ( ) ) ) , e ) ; return com.google.gerrit.extensions.client.ChangeKind.REWORK ; } }
Source:
private java.util.Optional < com.google.gerrit.common.data.GroupReference > getGroupReference ( org.eclipse.jgit.notes.NoteMap noteMap , com.google.gerrit.reviewdb.client.AccountGroup.NameKey groupName ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.lib.ObjectId noteKey = com.google.gerrit.server.group.db.GroupNameNotes.getNoteKey ( groupName ) ; org.eclipse.jgit.lib.ObjectId blobId = noteMap.get ( noteKey ) ; if ( blobId == null ) { return java.util.Optional.empty ( ) ; } byte [ ] noteData = rw.getObjectReader ( ) . open ( blobId , org.eclipse.jgit.lib.Constants.OBJ_BLOB ) . getCachedBytes ( ) ; com.google.gerrit.common.data.GroupReference groupReference = com.google.gerrit.server.group.db.GroupNameNotes.getFromNoteData ( noteData ) ; return java.util.Optional.of ( groupReference ) ; }

Target:
private static com.google.gerrit.common.data.GroupReference getGroupReference ( org.eclipse.jgit.lib.ObjectReader reader , org.eclipse.jgit.lib.ObjectId noteDataBlobId ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { byte [ ] noteData = reader.open ( noteDataBlobId , org.eclipse.jgit.lib.Constants.OBJ_BLOB ) . getCachedBytes ( ) ; return com.google.gerrit.server.group.db.GroupNameNotes.getFromNoteData ( noteData ) ; }
Source:
public static com.google.gerrit.server.index.IndexConfig create ( int maxLimit , int maxPages , int maxTerms ) { }

Target:
public static com.google.gerrit.server.index.IndexConfig create ( int maxLimit , int maxPages , int maxTerms ) { return new com.google.gerrit.server.index.AutoValue_IndexConfig ( com.google.gerrit.server.index.IndexConfig.checkLimit ( maxLimit , "maxLimit" , java.lang.Integer.MAX_VALUE ) , com.google.gerrit.server.index.IndexConfig.checkLimit ( maxPages , "maxPages" , java.lang.Integer.MAX_VALUE ) , com.google.gerrit.server.index.IndexConfig.checkLimit ( maxTerms , "maxTerms" , com.google.gerrit.server.index.IndexConfig.DEFAULT_MAX_TERMS ) ) ; }
Source:
public java.util.Set < java.lang.String > getEmailAddresses ( com.google.gerrit.server.IdentifiedUser user ) { java.util.Collection < com.google.gerrit.server.account.ExternalId > ids = user.state ( ) . getExternalIds ( ) ; java.util.Set < java.lang.String > emails = com.google.common.collect.Sets.newHashSetWithExpectedSize ( ids.size ( ) ) ; for ( com.google.gerrit.server.account.ExternalId ext : ids ) { if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( ext.email ( ) ) ) ) { emails.add ( ext.email ( ) ) ; } } return emails ; }

Target:
public java.util.Set < java.lang.String > getEmailAddresses ( com.google.gerrit.server.IdentifiedUser user ) { java.util.Collection < com.google.gerrit.server.account.externalids.ExternalId > ids = user.state ( ) . getExternalIds ( ) ; java.util.Set < java.lang.String > emails = com.google.common.collect.Sets.newHashSetWithExpectedSize ( ids.size ( ) ) ; for ( com.google.gerrit.server.account.externalids.ExternalId ext : ids ) { if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( ext.email ( ) ) ) ) { emails.add ( ext.email ( ) ) ; } } return emails ; }
Source:
private java.util.List < com.google.gerrit.acceptance.TestAccount > createAccounts ( int n , java.lang.String emailPrefix ) throws java.lang.Exception { java.util.List < com.google.gerrit.acceptance.TestAccount > result = new java.util.ArrayList < > ( n ) ; for ( int i = 0 ; i < n ; i ++ ) { result.add ( accounts.create ( name ( ( "u" + i ) ) , ( ( ( emailPrefix + "-" ) + i ) + "@example.com" ) , ( "Full Name " + i ) ) ) ; } return result ; }

Target:
private java.util.List < com.google.gerrit.acceptance.TestAccount > createAccounts ( int n , java.lang.String emailPrefix ) throws java.lang.Exception { java.util.List < com.google.gerrit.acceptance.TestAccount > result = new java.util.ArrayList < > ( n ) ; for ( int i = 0 ; i < n ; i ++ ) { result.add ( accountCreator.create ( name ( ( "u" + i ) ) , ( ( ( emailPrefix + "-" ) + i ) + "@example.com" ) , ( "Full Name " + i ) ) ) ; } return result ; }
Source:
public static void deleteDraftChange ( final com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId , com.google.gerrit.server.git.GitRepositoryManager gitManager , final com.google.gerrit.server.extensions.events.GitReferenceUpdated gitRefUpdated , final com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { final com.google.gerrit.reviewdb.client.Change.Id changeId = patchSetId.getParentKey ( ) ; com.google.gerrit.server.ChangeUtil.deleteDraftChange ( changeId , gitManager , gitRefUpdated , db ) ; }

Target:
public static void deleteDraftChange ( com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId , com.google.gerrit.server.git.GitRepositoryManager gitManager , com.google.gerrit.server.extensions.events.GitReferenceUpdated gitRefUpdated , com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.index.ChangeIndexer indexer ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { final com.google.gerrit.reviewdb.client.Change.Id changeId = patchSetId.getParentKey ( ) ; com.google.gerrit.server.ChangeUtil.deleteDraftChange ( changeId , gitManager , gitRefUpdated , db , indexer ) ; }
Source:
public boolean dryRun ( com.google.gerrit.server.git.CodeReviewCommit mergeTip , com.google.gerrit.server.git.CodeReviewCommit toMerge ) throws com.google.gerrit.server.git.IntegrationException { return ( ! ( args.mergeUtil.hasMissingDependencies ( args.mergeSorter , toMerge ) ) ) && ( args.mergeUtil.canCherryPick ( args.mergeSorter , args.repo , mergeTip , args.rw , toMerge ) ) ; }

Target:
static boolean dryRun ( com.google.gerrit.server.git.strategy.SubmitDryRun.Arguments args , com.google.gerrit.server.git.CodeReviewCommit mergeTip , com.google.gerrit.server.git.CodeReviewCommit toMerge ) throws com.google.gerrit.server.git.IntegrationException { return ( ! ( args.mergeUtil.hasMissingDependencies ( args.mergeSorter , toMerge ) ) ) && ( args.mergeUtil.canCherryPick ( args.mergeSorter , args.repo , mergeTip , args.rw , toMerge ) ) ; }
Source:
public void generatesExpectedMessage ( ) throws java.lang.Exception { mockEvent.change = mockChange ; mockEvent.author = mockAccount ; mockEvent.comment = "This is the first line\nAnd the second line." ; mockChange.project = "testproject" ; mockChange.branch = "master" ; mockChange.url = "https://change/" ; mockAccount.name = "Unit Tester" ; com.cisco.gerrit.plugins.slack.message.MessageGenerator messageGenerator ; messageGenerator = com.cisco.gerrit.plugins.slack.message.MessageGeneratorFactory.newInstance ( mockEvent , config ) ; java.lang.String expectedResult ; expectedResult = "{\"text\": \"Unit Tester commented\\n>>>" + ( ( "testproject (master): This is the first line\n" + "And the second line. (https://change/)\"," ) + "\"channel\": \"#testchannel\",\"username\": \"testuser\"}\n" ) ; java.lang.String actualResult ; actualResult = messageGenerator.generate ( ) ; org.junit.Assert.assertThat ( actualResult , org.hamcrest.core.Is.is ( org.hamcrest.CoreMatchers.equalTo ( expectedResult ) ) ) ; }

Target:
public void generatesExpectedMessage ( ) throws java.lang.Exception { mockEvent.change = mockChange ; mockEvent.author = mockAccount ; mockEvent.comment = "This is the first line\nAnd the second line." ; mockChange.project = "testproject" ; mockChange.branch = "master" ; mockChange.url = "https://change/" ; mockChange.owner = mockOwner ; mockOwner.name = "Owner" ; mockAccount.name = "Unit Tester" ; com.cisco.gerrit.plugins.slack.message.MessageGenerator messageGenerator ; messageGenerator = com.cisco.gerrit.plugins.slack.message.MessageGeneratorFactory.newInstance ( mockEvent , config ) ; java.lang.String expectedResult ; expectedResult = "{\"text\": \"Unit Tester commented to Owner\\n>>>" + ( ( "testproject (master): This is the first line\n" + "And the second line. (https://change/)\"," ) + "\"channel\": \"#testchannel\",\"username\": \"testuser\"}\n" ) ; java.lang.String actualResult ; actualResult = messageGenerator.generate ( ) ; org.junit.Assert.assertThat ( actualResult , org.hamcrest.core.Is.is ( org.hamcrest.CoreMatchers.equalTo ( expectedResult ) ) ) ; }
Source:
public void stop ( ) throws com.google.gwt.core.ext.UnableToCompleteException { com.google.gwt.core.ext.TreeLogger branch = logger.branch ( TreeLogger.INFO , "Stopping Jetty server" ) ; org.mortbay.log.Log.setLog ( new com.google.gerrit.gwtdebug.GerritDebugLauncher.JettyTreeLogger ( branch ) ) ; try { server.stop ( ) ; server.setStopAtShutdown ( false ) ; branch.log ( TreeLogger.INFO , "Stopped successfully" ) ; } catch ( java.lang.Exception e ) { branch.log ( TreeLogger.ERROR , "Unable to stop embedded Jetty server" , e ) ; throw new com.google.gwt.core.ext.UnableToCompleteException ( ) ; } finally { org.mortbay.log.Log.setLog ( new com.google.gerrit.gwtdebug.GerritDebugLauncher.JettyTreeLogger ( logger ) ) ; } }

Target:
public void stop ( ) throws com.google.gwt.core.ext.UnableToCompleteException { com.google.gwt.core.ext.TreeLogger branch = logger.branch ( TreeLogger.INFO , "Stopping Jetty server" ) ; org.eclipse.jetty.util.log.Log.setLog ( new com.google.gerrit.gwtdebug.GerritDebugLauncher.JettyTreeLogger ( branch ) ) ; try { server.stop ( ) ; server.setStopAtShutdown ( false ) ; branch.log ( TreeLogger.INFO , "Stopped successfully" ) ; } catch ( java.lang.Exception e ) { branch.log ( TreeLogger.ERROR , "Unable to stop embedded Jetty server" , e ) ; throw new com.google.gwt.core.ext.UnableToCompleteException ( ) ; } finally { org.eclipse.jetty.util.log.Log.setLog ( new com.google.gerrit.gwtdebug.GerritDebugLauncher.JettyTreeLogger ( logger ) ) ; } }
Source:
private java.util.Map < com.google.gerrit.reviewdb.Change.Key , com.google.gerrit.reviewdb.Change.Id > openChangesByKey ( ) throws com.google.gwtorm.client.OrmException { final java.util.Map < com.google.gerrit.reviewdb.Change.Key , com.google.gerrit.reviewdb.Change.Id > r = new java.util.HashMap < com.google.gerrit.reviewdb.Change.Key , com.google.gerrit.reviewdb.Change.Id > ( ) ; for ( com.google.gerrit.reviewdb.Change c : db.changes ( ) . byProjectOpenAll ( project.getNameKey ( ) ) ) { r.put ( c.getKey ( ) , c.getId ( ) ) ; } return r ; }

Target:
private java.util.Map < com.google.gerrit.reviewdb.Change.Key , com.google.gerrit.reviewdb.Change.Id > openChangesByKey ( com.google.gerrit.reviewdb.Branch.NameKey branch ) throws com.google.gwtorm.client.OrmException { final java.util.Map < com.google.gerrit.reviewdb.Change.Key , com.google.gerrit.reviewdb.Change.Id > r = new java.util.HashMap < com.google.gerrit.reviewdb.Change.Key , com.google.gerrit.reviewdb.Change.Id > ( ) ; for ( com.google.gerrit.reviewdb.Change c : db.changes ( ) . byBranchOpenAll ( branch ) ) { r.put ( c.getKey ( ) , c.getId ( ) ) ; } return r ; }
Source:
public void threeLevelTreeWithSomeIndexPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "-foo:a (file:b OR file:c)" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; com.google.common.truth.Truth.assertThat ( out.getClass ( ) ) . isSameAs ( com.google.gerrit.server.query.change.AndChangeSource.class ) ; com.google.common.truth.Truth.assertThat ( out.getChildren ( ) ) . containsExactly ( query ( in.getChild ( 1 ) ) , in.getChild ( 0 ) ) . inOrder ( ) ; }

Target:
public void threeLevelTreeWithSomeIndexPredicates ( ) throws java.lang.Exception { com.google.gerrit.index.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "-foo:a (file:b OR file:c)" ) ; com.google.gerrit.index.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; com.google.common.truth.Truth.assertThat ( out.getClass ( ) ) . isSameAs ( com.google.gerrit.server.query.change.AndChangeSource.class ) ; com.google.common.truth.Truth.assertThat ( out.getChildren ( ) ) . containsExactly ( query ( in.getChild ( 1 ) ) , in.getChild ( 0 ) ) . inOrder ( ) ; }
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 , com.google.gerrit.server.IdentifiedUser caller ) throws com.google.gerrit.server.git.IntegrationException , com.google.gerrit.server.project.NoSuchProjectException { return submitStrategyFactory.create ( submitType , db , or.repo , or.rw , or.ins , or.canMergeFlag , getAlreadyAccepted ( or , branchTip ) , destBranch , caller ) ; }

Target:
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 , com.google.gerrit.server.IdentifiedUser caller ) throws com.google.gerrit.server.git.IntegrationException , com.google.gerrit.server.project.NoSuchProjectException { return submitStrategyFactory.create ( submitType , db , or.repo , or.rw , or.ins , or.canMergeFlag , getAlreadyAccepted ( or , branchTip ) , destBranch , caller , commits ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.rpc.NativeMap < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > > result ) { com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > in = result.get ( path ) ; if ( in != null ) { addAllToCommentList ( in , toDrafts ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.rpc.NativeMap < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > > result ) { com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > in = result.get ( path ) ; if ( in != null ) { if ( toDrafts ) { if ( side == ( com.google.gerrit.client.diff.SideBySide2.DisplaySide.A ) ) { draftsBase = in ; } else { draftsRevision = in ; } } else { if ( side == ( com.google.gerrit.client.diff.SideBySide2.DisplaySide.A ) ) { publishedBase = in ; } else { publishedRevision = in ; } } } }
Source:
public void newPatchSetOnWipChangeSettingReadyInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%ready" , sc.owner ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . notTo ( sc.owner ) . to ( sc.reviewer ) . cc ( sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; assertThat ( sender ) . notSent ( ) ; }

Target:
public void newPatchSetOnWipChangeNotifyAllInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; pushTo ( sc , "refs/for/master%wip,notify=ALL" , sc.owner ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . to ( sc.reviewer ) . cc ( sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) . noOneElse ( ) ; }
Source:
private void parseReviewer ( com.google.gerrit.server.notedb.ReviewerState state , java.lang.String line ) throws org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.lib.PersonIdent ident = org.eclipse.jgit.util.RawParseUtils.parsePersonIdent ( line ) ; if ( ident == null ) { throw parseException ( "invalid %s: %s" , state.getFooterKey ( ) . getName ( ) , line ) ; } com.google.gerrit.reviewdb.client.Account.Id accountId = parseIdent ( ident ) ; if ( ! ( reviewers.containsKey ( accountId ) ) ) { reviewers.put ( accountId , state ) ; } }

Target:
private void parseReviewer ( com.google.gerrit.server.notedb.ReviewerState state , java.lang.String line ) throws org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.lib.PersonIdent ident = org.eclipse.jgit.util.RawParseUtils.parsePersonIdent ( line ) ; if ( ident == null ) { throw invalidFooter ( state.getFooterKey ( ) , line ) ; } com.google.gerrit.reviewdb.client.Account.Id accountId = parseIdent ( ident ) ; if ( ! ( reviewers.containsKey ( accountId ) ) ) { reviewers.put ( accountId , state ) ; } }
Source:
public com.google.gerrit.server.events.MessageAttribute asMessageAttribute ( com.google.gerrit.reviewdb.client.ChangeMessage message ) { com.google.gerrit.server.events.MessageAttribute a = new com.google.gerrit.server.events.MessageAttribute ( ) ; a.timestamp = ( message.getWrittenOn ( ) . getTime ( ) ) / 1000L ; a.reviewer = asAccountAttribute ( message.getAuthor ( ) ) ; a.message = message.getMessage ( ) ; return a ; }

Target:
public com.google.gerrit.server.events.MessageAttribute asMessageAttribute ( com.google.gerrit.reviewdb.client.ChangeMessage message ) { com.google.gerrit.server.events.MessageAttribute a = new com.google.gerrit.server.events.MessageAttribute ( ) ; a.timestamp = ( message.getWrittenOn ( ) . getTime ( ) ) / 1000L ; a.reviewer = ( ( message.getAuthor ( ) ) != null ) ? asAccountAttribute ( message.getAuthor ( ) ) : asAccountAttribute ( myIdent ) ; a.message = message.getMessage ( ) ; return a ; }
Source:
public void remove ( com.google.gerrit.common.data.AccessSection section ) { if ( section != null ) { accessSections.remove ( section.getName ( ) ) ; } }

Target:
public void remove ( com.google.gerrit.common.data.AccessSection section ) { if ( section != null ) { java.lang.String name = section.getName ( ) ; if ( sectionsWithUnknownPermissions.contains ( name ) ) { com.google.gerrit.common.data.AccessSection a = accessSections.get ( name ) ; a.setPermissions ( new java.util.ArrayList < com.google.gerrit.common.data.Permission > ( ) ) ; } else { accessSections.remove ( name ) ; } } }
Source:
public void updateRepo ( com.google.gerrit.server.git.BatchUpdate.RepoContext ctx ) throws com.google.gerrit.server.project.InvalidChangeOperationException , java.io.IOException { validate ( ctx ) ; patchSetInfo = patchSetInfoFactory.get ( ctx.getRevWalk ( ) , commit , patchSet.getId ( ) ) ; change.setCurrentPatchSet ( patchSetInfo ) ; if ( ! ( updateRef ) ) { return ; } ctx.addRefUpdate ( new org.eclipse.jgit.transport.ReceiveCommand ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) , commit , patchSet.getRefName ( ) ) ) ; }

Target:
public com.google.gerrit.server.change.ChangeInserter setDraft ( boolean draft ) { com.google.common.base.Preconditions.checkState ( ( ( change ) == null ) , "setDraft(boolean) only valid before creating change" ) ; return setStatus ( ( draft ? Change.Status.DRAFT : Change.Status.NEW ) ) ; }
Source:
public com.google.gerrit.client.data.ChangeDetail 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.Change change = db.changes ( ) . get ( id ) ; if ( change == null ) { throw new com.google.gerrit.client.changes.Failure ( new com.google.gerrit.client.rpc.NoSuchEntityException ( ) ) ; } final com.google.gerrit.client.data.ChangeDetail d = new com.google.gerrit.client.data.ChangeDetail ( ) ; d.load ( db , new com.google.gerrit.client.data.AccountInfoCacheFactory ( db ) , change ) ; return d ; }

Target:
public com.google.gerrit.client.data.ChangeDetail 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.Change change = db.changes ( ) . get ( id ) ; if ( change == null ) { throw new com.google.gerrit.client.changes.Failure ( new com.google.gerrit.client.rpc.NoSuchEntityException ( ) ) ; } final com.google.gerrit.client.workflow.RightRule rules = new com.google.gerrit.client.workflow.RightRule ( config , groupCache , db ) ; final com.google.gerrit.client.data.ChangeDetail d = new com.google.gerrit.client.data.ChangeDetail ( ) ; d.load ( db , new com.google.gerrit.client.data.AccountInfoCacheFactory ( db ) , rules , change ) ; return d ; }
Source:
public void replace ( com.google.gerrit.server.project.ProjectState projectState ) throws java.io.IOException { io.searchbox.core.Bulk bulk = new io.searchbox.core.Bulk.Builder ( ) . defaultIndex ( indexName ) . defaultType ( com.google.gerrit.elasticsearch.ElasticProjectIndex.PROJECTS ) . addAction ( insert ( com.google.gerrit.elasticsearch.ElasticProjectIndex.PROJECTS , projectState ) ) . refresh ( true ) . build ( ) ; io.searchbox.client.JestResult result = client.execute ( bulk ) ; if ( ! ( result.isSucceeded ( ) ) ) { throw new java.io.IOException ( java.lang.String.format ( "Failed to replace project %s in index %s: %s" , projectState.getProject ( ) . getName ( ) , indexName , result.getErrorMessage ( ) ) ) ; } }

Target:
public void replace ( com.google.gerrit.server.project.ProjectData projectState ) throws java.io.IOException { io.searchbox.core.Bulk bulk = new io.searchbox.core.Bulk.Builder ( ) . defaultIndex ( indexName ) . defaultType ( com.google.gerrit.elasticsearch.ElasticProjectIndex.PROJECTS ) . addAction ( insert ( com.google.gerrit.elasticsearch.ElasticProjectIndex.PROJECTS , projectState ) ) . refresh ( true ) . build ( ) ; io.searchbox.client.JestResult result = client.execute ( bulk ) ; if ( ! ( result.isSucceeded ( ) ) ) { throw new java.io.IOException ( java.lang.String.format ( "Failed to replace project %s in index %s: %s" , projectState.getProject ( ) . getName ( ) , indexName , result.getErrorMessage ( ) ) ) ; } }
Source:
protected void configureServlets ( ) { install ( new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarderServletModule ( ) ) ; install ( new com.ericsson.gerrit.plugins.highavailability.health.HealthServletModule ( ) ) ; if ( config.websession ( ) . synchronize ( ) ) { install ( new com.ericsson.gerrit.plugins.highavailability.websession.file.FileBasedWebsessionModule ( ) ) ; } }

Target:
protected void configureServlets ( ) { install ( new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarderServletModule ( ) ) ; if ( config.healthCheck ( ) . enabled ( ) ) { install ( new com.ericsson.gerrit.plugins.highavailability.health.HealthServletModule ( ) ) ; } if ( config.websession ( ) . synchronize ( ) ) { install ( new com.ericsson.gerrit.plugins.highavailability.websession.file.FileBasedWebsessionModule ( ) ) ; } }
Source:
public com.google.gerrit.extensions.common.AccountInfo accountInfo ( com.google.gerrit.reviewdb.client.Account a ) { if ( ( a == null ) || ( ( a.getId ( ) ) == null ) ) { return null ; } return com.google.gerrit.server.account.AccountJson.toAccountInfo ( a ) ; }

Target:
public com.google.gerrit.extensions.common.AccountInfo accountInfo ( com.google.gerrit.reviewdb.client.Account a ) { if ( ( a == null ) || ( ( a.getId ( ) ) == null ) ) { return null ; } com.google.gerrit.extensions.common.AccountInfo accountInfo = new com.google.gerrit.extensions.common.AccountInfo ( a.getId ( ) . get ( ) ) ; accountInfo.email = a.getPreferredEmail ( ) ; accountInfo.name = a.getFullName ( ) ; accountInfo.username = a.getUserName ( ) ; return accountInfo ; }
Source:
public com.google.gerrit.server.project.ProjectState projectState ( com.google.inject.Provider < com.google.gerrit.reviewdb.ReviewDb > db , com.google.gerrit.server.project.ProjectCache projectCache ) throws com.google.gwtorm.client.OrmException { if ( ( projectState ) == null ) { com.google.gerrit.reviewdb.Change c = change ( db ) ; projectState = projectCache.get ( c.getProject ( ) ) ; } return projectState ; }

Target:
void initProjectState ( com.google.inject.Provider < com.google.gerrit.reviewdb.ReviewDb > db , com.google.gerrit.server.project.ProjectCache projectCache ) throws com.google.gwtorm.client.OrmException { if ( ( projectState ) == null ) { projectState = projectCache.get ( change ( db ) . getProject ( ) ) ; } }
Source:
void doLinkIdentity ( ) { final com.google.gerrit.client.SignInDialog d = new com.google.gerrit.client.SignInDialog ( new com.google.gerrit.client.rpc.GerritCallback < java.lang.Object > ( ) { public void onSuccess ( final java.lang.Object result ) { refresh ( ) ; } } ) ; d.setMode ( SignInDialog.Mode.LINK_IDENTIY ) ; d.show ( ) ; }

Target:
void doLinkIdentity ( ) { final com.google.gerrit.client.SignInDialog d = new com.google.gerrit.client.SignInDialog ( new com.google.gerrit.client.rpc.GerritCallback < java.lang.Object > ( ) { public void onSuccess ( final java.lang.Object result ) { refresh ( ) ; } } ) ; d.setMode ( SignInDialog.Mode.LINK_IDENTIY ) ; d.center ( ) ; }
Source:
public void testOnTime ( ) throws java.lang.Exception { org.joda.time.DateTime now = org.joda.time.DateTime.now ( ) . toDateTime ( DateTimeZone.UTC ) ; com.google.common.truth.Truth.assertThat ( auth.onTime ( com.googlesource.gerrit.plugins.lfs.fs.LfsFsRequestAuthorizer.DATE_TIME.print ( now.plusSeconds ( 1 ) ) , "o" , "id" ) ) . isTrue ( ) ; }

Target:
public void testVerifyAgainstDifferentOperation ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.lfs.fs.LfsFsRequestAuthorizer.AuthInfo info = auth.generateAuthInfo ( "o" , org.eclipse.jgit.lfs.lib.LongObjectId.zeroId ( ) , 1 ) ; com.google.common.truth.Truth.assertThat ( auth.verifyAuthInfo ( info.authToken , "p" , org.eclipse.jgit.lfs.lib.LongObjectId.zeroId ( ) ) ) . isFalse ( ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { for ( com.google.gerrit.reviewdb.Patch p : detail.getPatches ( ) ) { com.google.gwt.user.client.Window.open ( ( ( ( Window.Location.getPath ( ) ) + "#" ) + ( com.google.gerrit.client.Dispatcher.toPatchUnified ( p.getKey ( ) ) ) ) , "_blank" , null ) ; } }

Target:
private void openWindow ( java.lang.String token ) { java.lang.String url = ( ( Window.Location.getPath ( ) ) + "#" ) + token ; com.google.gwt.user.client.Window.open ( url , "_blank" , null ) ; }