auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void fireEvent ( final com.google.gerrit.reviewdb.client.Change change , final com.google.gerrit.server.events.Event event , final com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.common.ChangeHookRunner.ChangeListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( change , holder.user , db ) ) { holder.listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }

Target:
private void fireEvent ( final com.google.gerrit.reviewdb.client.Change change , final com.google.gerrit.server.events.Event event , final com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.common.ChangeHookRunner.EventListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( change , holder.user , db ) ) { holder.listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }
Source:
public boolean deleteKey ( int seq ) { com.google.common.base.Preconditions.checkState ( ( ( keys ) != null ) , "SSH keys not loaded yet" ) ; if ( ( keys.containsKey ( seq ) ) && ( keys.get ( seq ) . isPresent ( ) ) ) { keys.put ( seq , com.google.common.base.Optional.< com.google.gerrit.reviewdb.client.AccountSshKey > absent ( ) ) ; return true ; } return false ; }

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:
protected void run ( ) throws com.google.gerrit.sshd.commands.Failure , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { try { com.google.gerrit.server.group.GroupResource rsrc = createGroup ( ) ; if ( ! ( initialMembers.isEmpty ( ) ) ) { addMembers ( rsrc ) ; } if ( ! ( initialGroups.isEmpty ( ) ) ) { addIncludedGroups ( rsrc ) ; } } catch ( com.google.gerrit.extensions.restapi.RestApiException e ) { throw die ( e ) ; } }

Target:
protected void run ( ) throws com.google.gerrit.sshd.commands.Failure , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { try { com.google.gerrit.server.group.GroupResource rsrc = createGroup ( ) ; if ( ! ( initialMembers.isEmpty ( ) ) ) { addMembers ( rsrc ) ; } if ( ! ( initialGroups.isEmpty ( ) ) ) { addSubgroups ( rsrc ) ; } } catch ( com.google.gerrit.extensions.restapi.RestApiException e ) { throw die ( e ) ; } }
Source:
public void setUp ( ) throws java.lang.Exception { admin2 = accounts.admin2 ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { admin2 = accounts.admin2 ( ) ; com.google.gerrit.extensions.api.groups.GroupInput gi = new com.google.gerrit.extensions.api.groups.GroupInput ( ) ; gi.name = name ( "New-Group" ) ; gi.members = com.google.common.collect.ImmutableList.of ( user.id.toString ( ) ) ; newGroup = gApi.groups ( ) . create ( gi ) . get ( ) ; }
Source:
public void createdOnIsPopulatedForGroupsCreatedBeforeAudit ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.AccountGroup.Id groupId = createGroup ( "Ancient group for schema migration" ) ; setCreatedOnToVeryOldTimestamp ( groupId ) ; removeAuditEntriesFor ( groupId ) ; schema151.migrateData ( db , new com.google.gerrit.testutil.TestUpdateUI ( ) ) ; com.google.gerrit.reviewdb.client.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; com.google.common.truth.Truth.assertThat ( group.getCreatedOn ( ) ) . isEqualTo ( com.google.gerrit.reviewdb.client.AccountGroup.auditCreationInstantTs ( ) ) ; }

Target:
public void createdOnIsPopulatedForGroupsCreatedBeforeAudit ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.AccountGroup.Id groupId = createGroup ( "Ancient group for schema migration" ) ; setCreatedOnToVeryOldTimestamp ( groupId ) ; removeAuditEntriesFor ( groupId ) ; schema151.migrateData ( db , new com.google.gerrit.testing.TestUpdateUI ( ) ) ; java.sql.Timestamp createdOn = getCreatedOn ( groupId ) ; com.google.common.truth.Truth.assertThat ( createdOn ) . isEqualTo ( com.google.gerrit.reviewdb.client.AccountGroup.auditCreationInstantTs ( ) ) ; }
Source:
public void filterOutAllResults ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.InMemoryRepository > repo = createProject ( "repo" ) ; int user2 = accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "anotheruser" ) ) . getAccountId ( ) . get ( ) ; for ( int i = 0 ; i < 5 ; i ++ ) { newChange ( repo , null , null , user2 , null ) . insert ( ) ; } com.google.common.truth.Truth.assertThat ( query ( "status:new ownerin:Administrators" ) ) . isEmpty ( ) ; com.google.common.truth.Truth.assertThat ( query ( "status:new ownerin:Administrators limit:2" ) ) . isEmpty ( ) ; }

Target:
public void byPathRegex ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.InMemoryRepository > repo = createProject ( "repo" ) ; org.eclipse.jgit.revwalk.RevCommit commit = repo.parseBody ( repo.commit ( ) . message ( "one" ) . add ( "dir/file1" , "contents1" ) . add ( "dir/file2" , "contents2" ) . create ( ) ) ; com.google.gerrit.reviewdb.client.Change change = newChange ( repo , commit , null , null , null ) . insert ( ) ; assertQuery ( "path:.*file.*" ) ; assertQuery ( "path:^dir.file.*" , change ) ; }
Source:
public java.lang.String getSqlType ( final com.google.gwtorm.schema.ColumnModel col ) { final com.google.gwtorm.client.Column column = col.getColumnAnnotation ( ) ; final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( "DATE" ) ; if ( column.notNull ( ) ) { r.append ( " DEFAULT '1900-01-01'" ) ; r.append ( " NOT NULL" ) ; } return r.toString ( ) ; }

Target:
public java.lang.String getSqlType ( final com.google.gwtorm.schema.ColumnModel col , final com.google.gwtorm.schema.sql.SqlDialect dialect ) { final com.google.gwtorm.client.Column column = col.getColumnAnnotation ( ) ; final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( dialect.getSqlTypeName ( getSqlTypeConstant ( ) ) ) ; if ( column.notNull ( ) ) { r.append ( " DEFAULT '1900-01-01'" ) ; r.append ( " NOT NULL" ) ; } return r.toString ( ) ; }
Source:
public void sortWithRegex ( ) { com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "^refs/heads/.*" ) ; com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "^refs/heads/.*-QA-.*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertCanRead ( "refs/heads/foo-QA-bar" , u ) ; assertCanRead ( "refs/heads/foo-QA-bar" , d ) ; }

Target:
public void sortWithRegex ( ) { com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.testing.Util.DEVS , "^refs/heads/.*" ) ; com.google.gerrit.server.project.testing.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "^refs/heads/.*-QA-.*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.testing.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = user ( local , com.google.gerrit.server.project.testing.Util.DEVS ) ; assertCanRead ( "refs/heads/foo-QA-bar" , u ) ; assertCanRead ( "refs/heads/foo-QA-bar" , d ) ; }
Source:
public boolean canDelete ( ) { if ( GitRepositoryManager.REF_CONFIG.equals ( refName ) ) { return false ; } switch ( getCurrentUser ( ) . getAccessPath ( ) ) { case WEB_UI : return ( isOwner ( ) ) || ( canPushWithForce ( ) ) ; case GIT : return canPushWithForce ( ) ; default : return false ; } }

Target:
private boolean canPushWithForce ( ) { if ( ( ! ( canWrite ( ) ) ) || ( ( GitRepositoryManager.REF_CONFIG.equals ( refName ) ) && ( ! ( projectControl.isOwner ( ) ) ) ) ) { return false ; } boolean result = false ; for ( com.google.gerrit.common.data.PermissionRule rule : access ( Permission.PUSH ) ) { if ( rule.isBlock ( ) ) { return false ; } if ( rule.getForce ( ) ) { result = true ; } } return result ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { cm.setCursor ( net.codemirror.lib.LineCharacter.create ( line ) ) ; cm.scrollToY ( ( height - ( 0.5 * scrollbarHeight ) ) ) ; cm.focus ( ) ; }

Target:
void onMouseUp ( com.google.gwt.event.dom.client.MouseUpEvent e ) { if ( dragging ) { dragging = false ; com.google.gwt.user.client.DOM.releaseCapture ( viewport.getElement ( ) ) ; viewport.removeStyleName ( style.viewportDrag ( ) ) ; e.preventDefault ( ) ; e.stopPropagation ( ) ; } }
Source:
private boolean containsMissingCommits ( final java.util.Map < com.google.gerrit.reviewdb.client.Project.SubmitType , java.util.List < com.google.gerrit.server.git.CodeReviewCommit > > map , final com.google.gerrit.server.git.CodeReviewCommit commit ) { if ( ! ( isSubmitForMissingCommitsStillPossible ( commit ) ) ) { return false ; } for ( final com.google.gerrit.server.git.CodeReviewCommit missingCommit : commit.missing ) { boolean found = false ; for ( final java.util.List < com.google.gerrit.server.git.CodeReviewCommit > list : map.values ( ) ) { if ( list.contains ( missingCommit ) ) { found = true ; break ; } } if ( ! found ) { return false ; } } return true ; }

Target:
private boolean containsMissingCommits ( final com.google.common.collect.ListMultimap < com.google.gerrit.reviewdb.client.Project.SubmitType , com.google.gerrit.server.git.CodeReviewCommit > map , final com.google.gerrit.server.git.CodeReviewCommit commit ) { if ( ! ( isSubmitForMissingCommitsStillPossible ( commit ) ) ) { return false ; } for ( final com.google.gerrit.server.git.CodeReviewCommit missingCommit : commit.missing ) { if ( ! ( map.containsValue ( missingCommit ) ) ) { return false ; } } return true ; }
Source:
public void login ( final com.google.gerrit.client.reviewdb.Account.Id id , final boolean rememberMe ) { logout ( ) ; key = manager.createKey ( id ) ; val = manager.createVal ( key , id ) ; final int age ; if ( rememberMe ) { manager.updateRefreshCookieAt ( val ) ; age = val.getCookieAge ( ) ; } else { val.refreshCookieAt = java.lang.Long.MAX_VALUE ; age = - 1 ; } saveCookie ( key.token , age ) ; }

Target:
public void logout ( ) { if ( ( val ) != null ) { manager.destroy ( key ) ; key = null ; val = null ; saveCookie ( ) ; } }
Source:
public void setUp ( ) throws java.sql.SQLException { conn = java.sql.DriverManager.getConnection ( path ) ; stat = conn.createStatement ( ) ; easyMock = new org.easymock.EasyMockSupport ( ) ; pcFactoryMock = easyMock.createNiceMock ( ProjectControl.GenericFactory.class ) ; userProviderMock = easyMock.createNiceMock ( com.google.inject.Provider.class ) ; cfgMock = easyMock.createNiceMock ( com.ericsson.gerrit.plugins.eventslog.EventsLogConfig.class ) ; easyMock.replayAll ( ) ; }

Target:
public void setUp ( ) throws java.sql.SQLException { conn = java.sql.DriverManager.getConnection ( path ) ; stat = conn.createStatement ( ) ; results = new java.util.ArrayList < > ( ) ; poolMock = new com.ericsson.gerrit.plugins.eventslog.SQLStoreTest.PoolMock ( 1 ) ; easyMock = new org.easymock.EasyMockSupport ( ) ; pcFactoryMock = easyMock.createNiceMock ( ProjectControl.GenericFactory.class ) ; userProviderMock = easyMock.createNiceMock ( com.google.inject.Provider.class ) ; cfgMock = easyMock.createNiceMock ( com.ericsson.gerrit.plugins.eventslog.EventsLogConfig.class ) ; easyMock.replayAll ( ) ; }
Source:
public java.util.List < com.google.gerrit.extensions.common.SshKeyInfo > listSshKeys ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return getSshKeys.apply ( account ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot list SSH keys" , e ) ; } }

Target:
public void setStars ( java.lang.String changeId , com.google.gerrit.extensions.api.changes.StarsInput input ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.account.AccountResource.Star rsrc = stars.parse ( account , com.google.gerrit.extensions.restapi.IdString.fromUrl ( changeId ) ) ; starsPost.apply ( rsrc , input ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot post stars" , e ) ; } }
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 ( ) { initChangeRefMaps ( ) ; return refsById ; }
Source:
private static org.apache.lucene.search.Query booleanQuery ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > p , org.apache.lucene.search.BooleanClause.Occur o ) throws com.google.gerrit.server.query.QueryParseException { org.apache.lucene.search.BooleanQuery q = new org.apache.lucene.search.BooleanQuery ( ) ; for ( int i = 0 ; i < ( p.getChildCount ( ) ) ; i ++ ) { q.add ( com.google.gerrit.lucene.QueryBuilder.toQuery ( p.getChild ( i ) ) , o ) ; } return q ; }

Target:
private static org.apache.lucene.search.Query or ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > p ) throws com.google.gerrit.server.query.QueryParseException { try { org.apache.lucene.search.BooleanQuery q = new org.apache.lucene.search.BooleanQuery ( ) ; for ( int i = 0 ; i < ( p.getChildCount ( ) ) ; i ++ ) { q.add ( com.google.gerrit.lucene.QueryBuilder.toQuery ( p.getChild ( i ) ) , org.apache.lucene.search.BooleanClause.Occur.SHOULD ) ; } return q ; } catch ( org.apache.lucene.search.BooleanQuery e ) { throw new com.google.gerrit.server.query.QueryParseException ( ( "cannot create query for index: " + p ) , e ) ; } }
Source:
public boolean isRunning ( ) { return running ; }

Target:
public com.google.gerrit.server.git.WorkQueue.Task.State getState ( ) { if ( isCancelled ( ) ) { return com.google.gerrit.server.git.WorkQueue.Task.State.CANCELLED ; } else if ( ( isDone ( ) ) && ( ! ( isPeriodic ( ) ) ) ) { return com.google.gerrit.server.git.WorkQueue.Task.State.DONE ; } else if ( running.get ( ) ) { return com.google.gerrit.server.git.WorkQueue.Task.State.RUNNING ; } final long delay = getDelay ( java.util.concurrent.TimeUnit.MILLISECONDS ) ; if ( delay <= 0 ) { return com.google.gerrit.server.git.WorkQueue.Task.State.READY ; } else if ( 0 < delay ) { return com.google.gerrit.server.git.WorkQueue.Task.State.SLEEPING ; } return com.google.gerrit.server.git.WorkQueue.Task.State.OTHER ; }
Source:
com.google.gerrit.server.notedb.ChangeNotesState parseAll ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { walk.markStart ( walk.parseCommit ( tip ) ) ; try ( com.google.gerrit.metrics.Timer1.Context timer = metrics.parseLatency.start ( com.google.gerrit.server.notedb.NoteDbTable.CHANGES ) ) { com.google.gerrit.server.notedb.ChangeNotesCommit commit ; while ( ( commit = walk.next ( ) ) != null ) { parse ( commit ) ; } parseNotes ( ) ; allPastReviewers.addAll ( reviewers.rowKeySet ( ) ) ; pruneReviewers ( ) ; updatePatchSetStates ( ) ; checkMandatoryFooters ( ) ; } return buildState ( ) ; }

Target:
com.google.gerrit.server.notedb.ChangeNotesState parseAll ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { walk.reset ( ) ; walk.markStart ( walk.parseCommit ( tip ) ) ; try ( com.google.gerrit.metrics.Timer1.Context timer = metrics.parseLatency.start ( com.google.gerrit.server.notedb.NoteDbTable.CHANGES ) ) { com.google.gerrit.server.notedb.ChangeNotesCommit commit ; while ( ( commit = walk.next ( ) ) != null ) { parse ( commit ) ; } parseNotes ( ) ; allPastReviewers.addAll ( reviewers.rowKeySet ( ) ) ; pruneReviewers ( ) ; updatePatchSetStates ( ) ; checkMandatoryFooters ( ) ; } return buildState ( ) ; }
Source:
public void onSend ( ) { Util.MANAGE_SVC.createNewPatchSet ( patchSetId , getMessageText ( ) , createCallback ( ) ) ; }

Target:
public void onSend ( ) { Util.MANAGE_SVC.createNewPatchSet ( patchSetId , getMessageText ( ) , new com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.common.data.ChangeDetail > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.common.data.ChangeDetail result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId ) ) ; hide ( ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { enableButtons ( true ) ; new com.google.gerrit.client.ErrorDialog ( caught.getMessage ( ) ) . center ( ) ; } } ) ; }
Source:
public com.google.gerrit.server.change.GetRelated.RelatedInfo apply ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { java.util.List < java.lang.String > thisPatchSetGroups = com.google.gerrit.server.git.GroupCollector.getGroups ( rsrc ) ; if ( ( ( byAncestorsOnly ) || ( thisPatchSetGroups == null ) ) || ( ! ( indexes.getSearchIndex ( ) . getSchema ( ) . hasField ( ChangeField.GROUP ) ) ) ) { return byAncestors.getRelated ( rsrc ) ; } com.google.gerrit.server.change.GetRelated.RelatedInfo relatedInfo = new com.google.gerrit.server.change.GetRelated.RelatedInfo ( ) ; relatedInfo.changes = getRelated ( rsrc , thisPatchSetGroups ) ; return relatedInfo ; }

Target:
public com.google.gerrit.server.change.GetRelated.RelatedInfo apply ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { java.util.List < java.lang.String > thisPatchSetGroups = com.google.gerrit.server.git.GroupCollector.getGroups ( rsrc ) ; if ( ( ( byAncestorsOnly ) || ( thisPatchSetGroups == null ) ) || ( ! ( indexes.getSearchIndex ( ) . getSchema ( ) . hasField ( com.google.gerrit.server.index.ChangeField.GROUP ) ) ) ) { return byAncestors.getRelated ( rsrc ) ; } com.google.gerrit.server.change.GetRelated.RelatedInfo relatedInfo = new com.google.gerrit.server.change.GetRelated.RelatedInfo ( ) ; relatedInfo.changes = getRelated ( rsrc , thisPatchSetGroups ) ; return relatedInfo ; }
Source:
public void setSshInjector ( com.google.inject.Injector injector ) { sshModule = copy ( injector ) ; sshGen = injector.getProvider ( com.google.gerrit.server.plugins.ModuleGenerator.class ) ; sshItems = com.google.gerrit.extensions.registration.PrivateInternals_DynamicTypes.dynamicItemsOf ( injector ) ; sshSets = com.google.gerrit.extensions.registration.PrivateInternals_DynamicTypes.dynamicSetsOf ( injector ) ; sshMaps = com.google.gerrit.extensions.registration.PrivateInternals_DynamicTypes.dynamicMapsOf ( injector ) ; onStart.addAll ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.listeners ( injector , com.google.gerrit.server.plugins.StartPluginListener.class ) ) ; onReload.addAll ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.listeners ( injector , com.google.gerrit.server.plugins.ReloadPluginListener.class ) ) ; }

Target:
public void setSshInjector ( com.google.inject.Injector injector ) { sshModule = copy ( injector ) ; sshGen = injector.getProvider ( com.google.gerrit.server.plugins.ModuleGenerator.class ) ; sshItems = com.google.gerrit.extensions.registration.PrivateInternals_DynamicTypes.dynamicItemsOf ( injector ) ; sshSets = com.google.gerrit.extensions.registration.PrivateInternals_DynamicTypes.dynamicSetsOf ( injector ) ; sshMaps = com.google.gerrit.extensions.registration.PrivateInternals_DynamicTypes.dynamicMapsOf ( injector ) ; onStart.addAll ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.listeners ( injector , com.google.gerrit.server.plugins.StartPluginListener.class ) ) ; onStop.addAll ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.listeners ( injector , com.google.gerrit.server.plugins.StopPluginListener.class ) ) ; onReload.addAll ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.listeners ( injector , com.google.gerrit.server.plugins.ReloadPluginListener.class ) ) ; }
Source:
public void testFindInCommon ( ) { com.google.gerrit.client.diff.LineMapper mapper = new com.google.gerrit.client.diff.LineMapper ( ) ; mapper.appendCommon ( 10 ) ; org.junit.Assert.assertEquals ( 9 , mapper.lineOnOther ( Side.PARENT , 9 ) ) ; }

Target:
public void testFindInCommon ( ) { com.google.gerrit.client.diff.LineMapper mapper = new com.google.gerrit.client.diff.LineMapper ( ) ; mapper.appendCommon ( 10 ) ; org.junit.Assert.assertEquals ( new com.google.gerrit.client.diff.LineMapper.LineOnOtherInfo ( 9 , true ) , mapper.lineOnOther ( Side.PARENT , 9 ) ) ; org.junit.Assert.assertEquals ( new com.google.gerrit.client.diff.LineMapper.LineOnOtherInfo ( 9 , true ) , mapper.lineOnOther ( Side.REVISION , 9 ) ) ; }
Source:
public void create_NonEmpty ( ) throws java.io.IOException { final java.nio.file.Path root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; final java.nio.file.Path txt = root.resolve ( "test.txt" ) ; try { java.nio.file.Files.createDirectory ( root ) ; java.nio.file.Files.createFile ( txt ) ; final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( root ) ; org.junit.Assert.assertFalse ( site.isNew ) ; org.junit.Assert.assertEquals ( root , site.site_path ) ; } finally { java.nio.file.Files.delete ( txt ) ; java.nio.file.Files.delete ( root ) ; } }

Target:
public void create_NonEmpty ( ) throws java.io.IOException { final java.nio.file.Path root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; final java.nio.file.Path txt = root.resolve ( "test.txt" ) ; try { java.nio.file.Files.createDirectory ( root ) ; java.nio.file.Files.createFile ( txt ) ; final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( root ) ; com.google.common.truth.Truth.assertThat ( site.isNew ) . isFalse ( ) ; com.google.gerrit.extensions.common.PathSubject.assertThat ( site.site_path ) . isEqualTo ( root ) ; } finally { java.nio.file.Files.delete ( txt ) ; java.nio.file.Files.delete ( root ) ; } }
Source:
public void insert ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { org.apache.lucene.index.Term id = idTerm ( cd ) ; org.apache.lucene.document.Document doc = toDocument ( cd ) ; if ( readOnly ) { return ; } if ( cd.getChange ( ) . getStatus ( ) . isOpen ( ) ) { closedIndex.delete ( id ) ; openIndex.insert ( doc ) ; } else { openIndex.delete ( id ) ; closedIndex.insert ( doc ) ; } }

Target:
public com.google.common.util.concurrent.ListenableFuture < java.lang.Void > delete ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { org.apache.lucene.index.Term id = com.google.gerrit.lucene.QueryBuilder.idTerm ( cd ) ; if ( readOnly ) { return com.google.common.util.concurrent.Futures.immediateFuture ( null ) ; } return com.google.gerrit.lucene.LuceneChangeIndex.allOf ( openIndex.delete ( id ) , closedIndex.delete ( id ) ) ; }
Source:
private java.util.List < com.google.gerrit.extensions.common.WebLinkInfo > getFileWebLinks ( com.google.gerrit.reviewdb.client.Project project , java.lang.String rev , java.lang.String file ) { java.util.List < com.google.gerrit.extensions.common.WebLinkInfo > links = webLinks.getFileLinks ( project.getName ( ) , rev , file ) ; return ! ( links.isEmpty ( ) ) ? links : null ; }

Target:
private java.util.List < com.google.gerrit.extensions.common.WebLinkInfo > getFileWebLinks ( com.google.gerrit.reviewdb.client.Project project , java.lang.String rev , java.lang.String file ) { com.google.common.collect.FluentIterable < com.google.gerrit.extensions.common.WebLinkInfo > links = webLinks.getFileLinks ( project.getName ( ) , rev , file ) ; return links.isEmpty ( ) ? null : links.toList ( ) ; }
Source:
public void testAppend_float ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; org.junit.Assert.assertSame ( b , b.append ( 0.0F ) ) ; org.junit.Assert.assertEquals ( "0.0" , b.asString ( ) ) ; }

Target:
public void testAppend_long ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; com.google.common.truth.Truth.assertThat ( b ) . isSameAs ( b.append ( 4L ) ) ; com.google.common.truth.Truth.assertThat ( b ) . isSameAs ( b.append ( 2L ) ) ; com.google.common.truth.Truth.assertThat ( b.asString ( ) ) . isEqualTo ( "42" ) ; }
Source:
private static java.lang.String addInvalidKey ( java.util.List < java.util.Optional < com.google.gerrit.server.account.AccountSshKey > > keys , java.lang.String pub ) { com.google.gerrit.server.account.AccountSshKey.Id keyId = new com.google.gerrit.server.account.AccountSshKey.Id ( new com.google.gerrit.reviewdb.client.Account.Id ( 1 ) , ( ( keys.size ( ) ) + 1 ) ) ; com.google.gerrit.server.account.AccountSshKey key = new com.google.gerrit.server.account.AccountSshKey ( keyId , pub ) ; key.setInvalid ( ) ; keys.add ( java.util.Optional.of ( key ) ) ; return ( ( AuthorizedKeys.INVALID_KEY_COMMENT_PREFIX ) + ( key.getSshPublicKey ( ) ) ) + "\n" ; }

Target:
private static java.lang.String addInvalidKey ( java.util.List < java.util.Optional < com.google.gerrit.server.account.AccountSshKey > > keys , java.lang.String pub ) { com.google.gerrit.server.account.AccountSshKey key = com.google.gerrit.server.account.AccountSshKey.createInvalid ( new com.google.gerrit.reviewdb.client.Account.Id ( 1 ) , ( ( keys.size ( ) ) + 1 ) , pub ) ; keys.add ( java.util.Optional.of ( key ) ) ; return ( ( AuthorizedKeys.INVALID_KEY_COMMENT_PREFIX ) + ( key.sshPublicKey ( ) ) ) + "\n" ; }
Source:
protected void renderJson ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , java.lang.Object src , java.lang.reflect.Type typeOfSrc ) throws java.io.IOException { setApiHeaders ( res , com.google.gitiles.FormatType.JSON ) ; res.setStatus ( javax.servlet.http.HttpServletResponse.SC_OK ) ; java.io.Writer writer = getWriter ( res ) ; newGsonBuilder ( req ) . create ( ) . toJson ( src , typeOfSrc , writer ) ; writer.write ( '\n' ) ; writer.close ( ) ; }

Target:
protected void renderJson ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , java.lang.Object src , java.lang.reflect.Type typeOfSrc ) throws java.io.IOException { setApiHeaders ( res , com.google.gitiles.FormatType.JSON ) ; res.setStatus ( javax.servlet.http.HttpServletResponse.SC_OK ) ; java.io.Writer writer = newWriter ( res ) ; newGsonBuilder ( req ) . create ( ) . toJson ( src , typeOfSrc , writer ) ; writer.write ( '\n' ) ; writer.close ( ) ; }
Source:
public void revisionActions ( ) throws java.lang.Exception { java.lang.String changeId = createChangeWithTopic ( ) . getChangeId ( ) ; java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > actions = getActions ( changeId ) ; com.google.common.truth.Truth.assertThat ( actions ) . hasSize ( 2 ) ; }

Target:
public void revisionActionsOneChangePerTopicUnapproved ( ) throws java.lang.Exception { java.lang.String changeId = createChangeWithTopic ( "foo1" ) . getChangeId ( ) ; java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > actions = getActions ( changeId ) ; com.google.common.truth.Truth.assertThat ( actions ) . containsKey ( "cherrypick" ) ; com.google.common.truth.Truth.assertThat ( actions ) . hasSize ( 1 ) ; }
Source:
public void head ( java.lang.String head ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.extensions.common.HeadInput input = new com.google.gerrit.extensions.common.HeadInput ( ) ; input.ref = head ; try { setHead.apply ( checkExists ( ) , input ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot set HEAD" , e ) ; } }

Target:
public void head ( java.lang.String head ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.extensions.api.projects.HeadInput input = new com.google.gerrit.extensions.api.projects.HeadInput ( ) ; input.ref = head ; try { setHead.apply ( checkExists ( ) , input ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot set HEAD" , e ) ; } }
Source:
private java.lang.String emailOf ( final com.google.gerrit.reviewdb.client.AccountExternalId a ) { return ( a.getEmailAddress ( ) ) != null ? a.getEmailAddress ( ) : "" ; }

Target:
void display ( final com.google.gwt.core.client.JsArray < com.google.gerrit.client.account.ExternalIdInfo > results ) { java.util.List < com.google.gerrit.client.account.ExternalIdInfo > idList = com.google.gerrit.client.rpc.Natives.asList ( results ) ; java.util.Collections.sort ( idList ) ; while ( 1 < ( table.getRowCount ( ) ) ) { table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; } for ( final com.google.gerrit.client.account.ExternalIdInfo k : idList ) { addOneId ( k ) ; } updateDeleteButton ( ) ; }
Source:
public void parseNoteDbPrimary ( ) { com.google.gerrit.server.notedb.NoteDbChangeState state = com.google.gerrit.server.notedb.NoteDbChangeState.parse ( new com.google.gerrit.reviewdb.client.Change.Id ( 1 ) , "N" ) ; com.google.common.truth.Truth.assertThat ( state.getPrimaryStorage ( ) ) . isEqualTo ( PrimaryStorage.NOTE_DB ) ; com.google.common.truth.Truth.assertThat ( state.getRefState ( ) . isPresent ( ) ) . isFalse ( ) ; }

Target:
public void parseNoteDbPrimary ( ) { com.google.gerrit.server.notedb.NoteDbChangeState state = com.google.gerrit.server.notedb.NoteDbChangeState.parse ( new com.google.gerrit.reviewdb.client.Change.Id ( 1 ) , "N" ) ; com.google.common.truth.Truth.assertThat ( state.getPrimaryStorage ( ) ) . isEqualTo ( PrimaryStorage.NOTE_DB ) ; com.google.common.truth.Truth.assertThat ( state.getRefState ( ) . isPresent ( ) ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( state.getReadOnlyUntil ( ) . isPresent ( ) ) . isFalse ( ) ; }
Source:
public void updateRepo ( com.google.gerrit.server.git.BatchUpdate.RepoContext ctx ) throws java.lang.Exception { changeKind = changeKindCache.getChangeKind ( projectControl.getProjectState ( ) , ctx.getRepository ( ) , priorCommit , commit ) ; }

Target:
public void updateRepo ( com.google.gerrit.server.git.BatchUpdate.RepoContext ctx ) throws java.lang.Exception { changeKind = changeKindCache.getChangeKind ( projectControl.getProjectState ( ) , ctx.getRepository ( ) , priorCommit , commit ) ; if ( checkMergedInto ) { org.eclipse.jgit.lib.Ref mergedInto = findMergedInto ( ctx , dest.get ( ) , commit ) ; if ( mergedInto != null ) { mergedByPushOp = mergedByPushOpFactory.create ( requestScopePropagator , patchSetId , mergedInto.getName ( ) ) ; } } }
Source:
public void pushWithInvalidChangeIdFromEgit ( ) throws java.lang.Exception { com.google.gerrit.acceptance.git.AbstractPushForReview.createCommit ( testRepo , ( "Message with invalid Change-Id\n" + ( "\n" + "Change-Id: I0000000000000000000000000000000000000000\n" ) ) ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id" ) ; com.google.gerrit.server.git.ProjectConfig config = projectCache.checkedGet ( project ) . getConfig ( ) ; config.getProject ( ) . setRequireChangeID ( InheritableBoolean.FALSE ) ; saveProjectConfig ( project , config ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id" ) ; }

Target:
public void pushWithInvalidChangeIdFromEgit ( ) throws java.lang.Exception { com.google.gerrit.acceptance.git.AbstractPushForReview.createCommit ( testRepo , ( "Message with invalid Change-Id\n" + ( "\n" + "Change-Id: I0000000000000000000000000000000000000000\n" ) ) ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format in commit message footer" ) ; com.google.gerrit.server.git.ProjectConfig config = projectCache.checkedGet ( project ) . getConfig ( ) ; config.getProject ( ) . setRequireChangeID ( InheritableBoolean.FALSE ) ; saveProjectConfig ( project , config ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "invalid Change-Id line format in commit message footer" ) ; }
Source:
protected void configure ( ) { final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.client.reviewdb.AccountGroup.Id , com.google.gerrit.client.reviewdb.AccountGroup > > type = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.client.reviewdb.AccountGroup.Id , com.google.gerrit.client.reviewdb.AccountGroup > > ( ) { } ; core ( type , com.google.gerrit.server.account.GroupCache.CACHE_NAME ) ; bind ( com.google.gerrit.server.account.GroupCache.class ) ; }

Target:
protected void configure ( ) { final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gwtorm.client.Key < ? > , com.google.gerrit.client.reviewdb.AccountGroup > > byId = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gwtorm.client.Key < ? > , com.google.gerrit.client.reviewdb.AccountGroup > > ( ) { } ; core ( byId , com.google.gerrit.server.account.GroupCache.CACHE_NAME ) ; bind ( com.google.gerrit.server.account.GroupCache.class ) ; }
Source:
public void index ( com.google.gerrit.reviewdb.client.Account.Id id ) throws java.io.IOException { for ( com.google.gerrit.index.Index < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.server.account.AccountState > i : getWriteIndexes ( ) ) { com.google.gerrit.server.account.AccountState accountState = byIdCache.getOrNull ( id ) ; if ( accountState != null ) { i.replace ( accountState ) ; } else { i.delete ( id ) ; } } fireAccountIndexedEvent ( id.get ( ) ) ; }

Target:
public void index ( com.google.gerrit.reviewdb.client.Account.Id id ) throws java.io.IOException { for ( com.google.gerrit.index.Index < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.server.account.AccountState > i : getWriteIndexes ( ) ) { com.google.gerrit.server.account.AccountState accountState = byIdCache.getOrNull ( id ) ; if ( accountState != null ) { i.replace ( accountState ) ; } else { i.delete ( id ) ; } } fireAccountIndexedEvent ( id.get ( ) ) ; com.google.gerrit.server.index.account.AccountIndexerImpl.autoReindexIfStale ( id ) ; }
Source:
public com.google.gwtorm.server.OrmException apply ( java.lang.Exception e ) { if ( e instanceof com.google.gwtorm.server.OrmException ) { return ( ( com.google.gwtorm.server.OrmException ) ( e ) ) ; } return new com.google.gwtorm.server.OrmException ( e ) ; }

Target:
public com.google.gerrit.server.notedb.ChangeNotes createChecked ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.reviewdb.server.ReviewDbUtil.unwrapDb ( db ) . changes ( ) . get ( changeId ) ; if ( ( change == null ) || ( ! ( change.getProject ( ) . equals ( project ) ) ) ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( changeId ) ; } return new com.google.gerrit.server.notedb.ChangeNotes ( args , change ) . load ( ) ; }
Source:
public void testGetUrl ( ) throws java.lang.Exception { initializeConfiguration ( ) ; com.google.common.truth.Truth.assertThat ( configuration.peerInfo ( ) . url ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.EMPTY ) ; org.mockito.Mockito.when ( configMock.getString ( com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , null , com.ericsson.gerrit.plugins.highavailability.Configuration.URL_KEY ) ) . thenReturn ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.URL ) ; initializeConfiguration ( ) ; com.google.common.truth.Truth.assertThat ( configuration.peerInfo ( ) . url ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.URL ) ; }

Target:
public void testGetUrl ( ) throws java.lang.Exception { initializeConfiguration ( ) ; com.google.common.truth.Truth.assertThat ( configuration.peerInfoStatic ( ) . url ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.EMPTY ) ; org.mockito.Mockito.when ( configMock.getString ( 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 ) ) . thenReturn ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.URL ) ; initializeConfiguration ( ) ; com.google.common.truth.Truth.assertThat ( configuration.peerInfoStatic ( ) . url ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.URL ) ; }
Source:
protected java.io.OutputStream startRenderStreamingHtml ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , java.lang.String templateName , java.util.Map < java.lang.String , ? > soyData ) throws java.io.IOException { return renderer.renderStreaming ( res , templateName , startHtmlResponse ( req , res , soyData ) ) ; }

Target:
protected java.io.OutputStream startRenderStreamingHtml ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , java.lang.String templateName , java.util.Map < java.lang.String , ? > soyData ) throws java.io.IOException { req.setAttribute ( com.google.gitiles.BaseServlet.STREAMING_ATTRIBUTE , true ) ; return renderer.renderStreaming ( res , templateName , startHtmlResponse ( req , res , soyData ) ) ; }
Source:
private boolean canPushWithForce ( ) { if ( ( ! ( canWrite ( ) ) ) || ( ( RefNames.REFS_CONFIG.equals ( refName ) ) && ( ! ( projectControl.isOwner ( ) ) ) ) ) { return false ; } return canForcePerform ( Permission.PUSH ) ; }

Target:
private boolean canPushWithForce ( ) { if ( ( ! ( isProjectStatePermittingWrite ( ) ) ) || ( ( RefNames.REFS_CONFIG.equals ( refName ) ) && ( ! ( projectControl.isOwner ( ) ) ) ) ) { return false ; } return canForcePerform ( Permission.PUSH ) ; }
Source:
public com.google.gerrit.server.account.GroupMembership membershipsOf ( com.google.gerrit.server.IdentifiedUser user ) { java.lang.String id = com.google.gerrit.server.auth.ldap.LdapGroupBackend.findId ( user.state ( ) . getExternalIds ( ) ) ; if ( id == null ) { return com.google.gerrit.server.account.GroupMembership.EMPTY ; } try { return new com.google.gerrit.server.account.ListGroupMembership ( membershipCache.get ( id ) ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.server.auth.ldap.LdapGroupBackend.log.warn ( java.lang.String.format ( "Cannot lookup membershipsOf %s in LDAP" , id ) , e ) ; return com.google.gerrit.server.account.GroupMembership.EMPTY ; } }

Target:
public com.google.gerrit.server.account.GroupMembership membershipsOf ( com.google.gerrit.server.IdentifiedUser user ) { if ( ! ( helper.hasLdapConfiguration ( ) ) ) { return com.google.gerrit.server.account.GroupMembership.EMPTY ; } java.lang.String id = com.google.gerrit.server.auth.ldap.LdapGroupBackend.findId ( user.state ( ) . getExternalIds ( ) ) ; if ( id == null ) { return com.google.gerrit.server.account.GroupMembership.EMPTY ; } try { return new com.google.gerrit.server.account.ListGroupMembership ( membershipCache.get ( id ) ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.server.auth.ldap.LdapGroupBackend.log.warn ( java.lang.String.format ( "Cannot lookup membershipsOf %s in LDAP" , id ) , e ) ; return com.google.gerrit.server.account.GroupMembership.EMPTY ; } }
Source:
private boolean onTime ( java.lang.String dateTime , java.lang.String operation , java.lang.String id ) { org.joda.time.DateTime deadline = org.joda.time.format.ISODateTimeFormat.dateTimeParser ( ) . parseDateTime ( dateTime ) ; if ( deadline.isBeforeNow ( ) ) { com.googlesource.gerrit.plugins.lfs.fs.LfsFsRequestAuthorizer.log.info ( "Operation on id timed out" , operation , id ) ; return false ; } return true ; }

Target:
boolean onTime ( java.lang.String dateTime , java.lang.String operation , java.lang.String id ) { java.lang.String now = com.googlesource.gerrit.plugins.lfs.fs.LfsFsRequestAuthorizer.DATE_TIME.print ( now ( ) ) ; if ( ( now.compareTo ( dateTime ) ) > 0 ) { com.googlesource.gerrit.plugins.lfs.fs.LfsFsRequestAuthorizer.log.info ( "Operation on id timed out" , operation , id ) ; return false ; } return true ; }
Source:
private void displayFile ( com.google.reviewit.app.Change change , java.lang.String path , com.google.gerrit.extensions.common.FileInfo file ) { java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > files = new java.util.HashMap < > ( ) ; files.put ( path , file ) ; displayFiles ( change , files ) ; }

Target:
private void displayFile ( com.google.reviewit.app.Change change , java.lang.String path , com.google.gerrit.extensions.common.FileInfo file , int fileNumber , int totalFileCount ) { java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > files = new java.util.HashMap < > ( ) ; files.put ( path , file ) ; displayFiles ( change , files , fileNumber , totalFileCount ) ; }
Source:
private static boolean eq ( final org.eclipse.jgit.lib.ObjectId a , final org.eclipse.jgit.lib.ObjectId b ) { if ( ( a == null ) && ( b == null ) ) { return true ; } return ( ( a != null ) && ( b != null ) ) && ( org.eclipse.jgit.lib.AnyObjectId.equals ( a , b ) ) ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( oldId , parentNum , newId , whitespace ) ; }
Source:
public void deleteBranch_Forbidden ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = userSession.delete ( ( ( ( "/projects/" + ( project.get ( ) ) ) + "/branches/" ) + ( branch.getShortName ( ) ) ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_FORBIDDEN ) ; r.consume ( ) ; }

Target:
public void deleteBranch_Forbidden ( ) throws java.lang.Exception { setApiUser ( user ) ; assertDeleteForbidden ( ) ; }
Source:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.client.OrmException { com.google.gerrit.reviewdb.Change change = object.change ( dbProvider ) ; if ( change == null ) { return false ; } return shortName.equals ( change.getDest ( ) . getShortName ( ) ) ; }

Target:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.client.OrmException { com.google.gerrit.reviewdb.Change change = object.change ( dbProvider ) ; if ( change == null ) { return false ; } return ( change.getDest ( ) . get ( ) . startsWith ( Branch.R_HEADS ) ) && ( shortName.equals ( change.getDest ( ) . getShortName ( ) ) ) ; }
Source:
private static boolean onOpen ( com.google.gwt.dom.client.NativeEvent evt , com.google.gwt.user.client.Element e ) { if ( com.google.gerrit.client.change.RelatedChangesTab.LINK.handleAsClick ( evt.< com.google.gwt.user.client.Event > cast ( ) ) ) { com.google.gerrit.client.Gerrit.display ( e.getAttribute ( "href" ) . substring ( 1 ) ) ; evt.preventDefault ( ) ; return false ; } return true ; }

Target:
private static boolean onOpen ( com.google.gwt.dom.client.NativeEvent evt , com.google.gwt.dom.client.Element e ) { if ( com.google.gerrit.client.change.RelatedChangesTab.LINK.handleAsClick ( evt.< com.google.gwt.user.client.Event > cast ( ) ) ) { com.google.gerrit.client.Gerrit.display ( e.getAttribute ( "href" ) . substring ( 1 ) ) ; evt.preventDefault ( ) ; return false ; } return true ; }
Source:
public com.google.gerrit.extensions.common.ChangeInfo apply ( com.google.gerrit.server.change.ChangeResource req , com.google.gerrit.extensions.api.changes.AbandonInput input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gerrit.server.update.UpdateException , com.google.gwtorm.server.OrmException { req.permissions ( ) . database ( dbProvider ) . check ( ChangePermission.ABANDON ) ; com.google.gerrit.reviewdb.client.Change change = abandon ( req.getControl ( ) , input.message , input.notify , notifyUtil.resolveAccounts ( input.notifyDetails ) ) ; return json.noOptions ( ) . format ( change ) ; }

Target:
protected com.google.gerrit.extensions.common.ChangeInfo applyImpl ( com.google.gerrit.server.update.BatchUpdate.Factory updateFactory , com.google.gerrit.server.change.ChangeResource req , com.google.gerrit.extensions.api.changes.AbandonInput input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gerrit.server.update.UpdateException , com.google.gwtorm.server.OrmException { req.permissions ( ) . database ( dbProvider ) . check ( ChangePermission.ABANDON ) ; com.google.gerrit.reviewdb.client.Change change = abandon ( updateFactory , req.getControl ( ) , input.message , input.notify , notifyUtil.resolveAccounts ( input.notifyDetails ) ) ; return json.noOptions ( ) . format ( change ) ; }