auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public int run ( ) throws java.lang.Exception { final com.google.inject.Injector injector = com.google.inject.Guice.createInjector ( com.google.inject.Stage.PRODUCTION , new com.google.gerrit.server.config.GerritServerModule ( ) , new com.google.gerrit.server.ssh.SshDaemonModule ( ) ) ; com.google.gerrit.client.rpc.Common.setGerritConfig ( injector.getInstance ( com.google.gerrit.client.data.GerritConfig.class ) ) ; injector.getInstance ( com.google.gerrit.server.ssh.GerritSshDaemon.class ) . start ( ) ; return never ( ) ; }

Target:
public int run ( ) throws java.lang.Exception { final com.google.inject.Injector injector = com.google.inject.Guice.createInjector ( com.google.inject.Stage.PRODUCTION , new com.google.gerrit.server.config.GerritServerModule ( ) , new com.google.gerrit.server.ssh.SshDaemonModule ( ) , new com.google.inject.AbstractModule ( ) { @ java.lang.Override protected void configure ( ) { bind ( com.google.gerrit.client.data.GerritConfig.class ) . toProvider ( com.google.gerrit.server.config.GerritConfigProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; } } ) ; com.google.gerrit.client.rpc.Common.setGerritConfig ( injector.getInstance ( com.google.gerrit.client.data.GerritConfig.class ) ) ; injector.getInstance ( com.google.gerrit.server.ssh.Sshd.class ) . start ( ) ; return never ( ) ; }
Source:
private boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.server.events.ProjectCreatedEvent event , com.google.gerrit.server.CurrentUser user ) { com.google.gerrit.server.project.ProjectState pe = projectCache.get ( project ) ; if ( pe == null ) { return false ; } com.google.gerrit.server.project.ProjectControl pc = pe.controlFor ( user ) ; return pc.controlForRef ( event.getHeadName ( ) ) . isVisible ( ) ; }

Target:
public void doClaSignupHook ( com.google.gerrit.reviewdb.client.Account account , java.lang.String claName ) { if ( ! ( claSignedHook.isPresent ( ) ) ) { return ; } if ( account != null ) { java.util.List < java.lang.String > args = new java.util.ArrayList < > ( ) ; addArg ( args , "--submitter" , getDisplayName ( account ) ) ; addArg ( args , "--user-id" , account.getId ( ) . toString ( ) ) ; addArg ( args , "--cla-name" , claName ) ; runHook ( claSignedHook , args ) ; } }
Source:
private com.google.gerrit.extensions.common.CommitInfo getCommit ( org.eclipse.jgit.lib.ObjectId id ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = userSession.get ( ( ( ( "/projects/" + ( project.get ( ) ) ) + "/commits/" ) + ( id.name ( ) ) ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; com.google.gerrit.extensions.common.CommitInfo result = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.CommitInfo.class ) ; r.consume ( ) ; return result ; }

Target:
private void assertNotFound ( org.eclipse.jgit.lib.ObjectId id ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = userSession.get ( ( ( ( "/projects/" + ( project.get ( ) ) ) + "/commits/" ) + ( id.name ( ) ) ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_NOT_FOUND ) ; }
Source:
public java.lang.String apply ( com.google.gerrit.server.change.RevisionResource rev , com.googlesource.gerrit.plugins.cookbook.HelloWorldAction.Input input ) { final java.lang.String greeting = ( input.french ) ? "Bonjour" : "Hello" ; return java.lang.String.format ( "%s %s from change %s, patch set %d!" , greeting , ( com.google.common.base.Strings.isNullOrEmpty ( input.message ) ? com.google.common.base.Objects.firstNonNull ( user.get ( ) . getUserName ( ) , "world" ) : input.message ) , rev.getChange ( ) . getId ( ) . toString ( ) , rev.getPatchSet ( ) . getPatchSetId ( ) ) ; }

Target:
public java.lang.String apply ( com.google.gerrit.server.change.RevisionResource rev , com.googlesource.gerrit.plugins.cookbook.HelloRevisionAction.Input input ) { final java.lang.String greeting = ( input.french ) ? "Bonjour" : "Hello" ; return java.lang.String.format ( "%s %s from change %s, patch set %d!" , greeting , ( com.google.common.base.Strings.isNullOrEmpty ( input.message ) ? com.google.common.base.Objects.firstNonNull ( user.get ( ) . getUserName ( ) , "world" ) : input.message ) , rev.getChange ( ) . getId ( ) . toString ( ) , rev.getPatchSet ( ) . getPatchSetId ( ) ) ; }
Source:
public void queryChangesNoOptions ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.common.ChangeInfo result = com.google.common.collect.Iterables.getOnlyElement ( query ( r.getChangeId ( ) ) ) ; com.google.common.truth.Truth.assertThat ( result.labels ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( result.messages ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( result.revisions ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( result.actions ) . isNull ( ) ; }

Target:
public void queryChangesNoOptions ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.common.ChangeInfo result = com.google.common.collect.Iterables.getOnlyElement ( query ( r.getChangeId ( ) ) ) ; com.google.common.truth.Truth.assertThat ( result.labels ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( ( ( java.lang.Iterable < ? > ) ( result.messages ) ) ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( result.revisions ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( result.actions ) . isNull ( ) ; }
Source:
public void listBranchesSomeHidden ( ) throws java.lang.Exception { blockRead ( "refs/heads/dev" ) ; java.lang.String master = pushTo ( "refs/heads/master" ) . getCommit ( ) . name ( ) ; pushTo ( "refs/heads/dev" ) ; setApiUser ( user ) ; com.google.gerrit.acceptance.rest.project.BranchAssert.assertBranches ( com.google.common.collect.ImmutableList.of ( com.google.gerrit.acceptance.rest.project.ListBranchesIT.branch ( "HEAD" , "master" , false ) , com.google.gerrit.acceptance.rest.project.ListBranchesIT.branch ( "refs/heads/master" , master , false ) ) , list ( ) . get ( ) ) ; }

Target:
public void listBranchesSomeHidden ( ) throws java.lang.Exception { blockRead ( "refs/heads/dev" ) ; java.lang.String master = pushTo ( "refs/heads/master" ) . getCommit ( ) . name ( ) ; pushTo ( "refs/heads/dev" ) ; setApiUser ( user ) ; com.google.gerrit.acceptance.rest.project.RefAssert.assertRefs ( com.google.common.collect.ImmutableList.of ( com.google.gerrit.acceptance.rest.project.ListBranchesIT.branch ( "HEAD" , "master" , false ) , com.google.gerrit.acceptance.rest.project.ListBranchesIT.branch ( "refs/heads/master" , master , false ) ) , list ( ) . get ( ) ) ; }
Source:
public void testGetIssuePattern ( ) { com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "ItsTestName" , null , "commentlink" ) ) . andReturn ( null ) . atLeastOnce ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "commentlink" , "ItsTestName" , "match" ) ) . andReturn ( "TestPattern" ) . atLeastOnce ( ) ; replayMocks ( ) ; assertEquals ( "Expected and generated pattern are not equal" , "TestPattern" , itsConfig.getIssuePattern ( ) . pattern ( ) ) ; }

Target:
public void testGetIssuePattern ( ) { com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "plugin" , "ItsTestName" , "commentlink" ) ) . andReturn ( null ) . atLeastOnce ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "commentlink" , "ItsTestName" , "match" ) ) . andReturn ( "TestPattern" ) . atLeastOnce ( ) ; replayMocks ( ) ; assertEquals ( "Expected and generated pattern are not equal" , "TestPattern" , itsConfig.getIssuePattern ( ) . pattern ( ) ) ; }
Source:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { if ( cd.fastIsVisibleTo ( user ) ) { return true ; } try { com.google.gerrit.reviewdb.client.Change c = cd.change ( db ) ; if ( ( c != null ) && ( changeControl.controlFor ( c , user ) . isVisible ( db.get ( ) ) ) ) { cd.cacheVisibleTo ( user ) ; return true ; } else { return false ; } } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { return false ; } }

Target:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { if ( cd.fastIsVisibleTo ( user ) ) { return true ; } try { com.google.gerrit.reviewdb.client.Change c = cd.change ( db ) ; if ( c == null ) { return false ; } com.google.gerrit.server.project.ChangeControl cc = changeControl.controlFor ( c , user ) ; if ( cc.isVisible ( db.get ( ) ) ) { cd.cacheVisibleTo ( cc ) ; return true ; } } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { } return false ; }
Source:
private void setRefLogIdent ( final com.google.gerrit.client.reviewdb.ChangeApproval submitAudit ) { if ( submitAudit == null ) { return ; } final com.google.gerrit.client.reviewdb.Account a = com.google.gerrit.client.rpc.Common.getAccountCache ( ) . get ( submitAudit.getAccountId ( ) ) ; if ( a == null ) { return ; } branchUpdate.setRefLogIdent ( com.google.gerrit.server.ChangeUtil.toReflogIdent ( a , null ) ) ; }

Target:
private void setRefLogIdent ( final com.google.gerrit.client.reviewdb.ChangeApproval submitAudit ) { if ( submitAudit != null ) { branchUpdate.setRefLogIdent ( identifiedUserFactory.create ( submitAudit.getAccountId ( ) ) . toPersonIdent ( ) ) ; } }
Source:
public void testCreateProjectWithBranches ( ) throws java.lang.Exception { final java.lang.String newProjectName = "newProject" ; com.google.gerrit.extensions.api.projects.ProjectInput in = new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ; in.createEmptyCommit = true ; in.branches = com.google.common.collect.Lists.newArrayListWithCapacity ( 3 ) ; in.branches.add ( "refs/heads/test" ) ; in.branches.add ( "refs/heads/master" ) ; in.branches.add ( "release" ) ; adminSession.put ( ( "/projects/" + newProjectName ) , in ) ; assertHead ( newProjectName , "refs/heads/test" ) ; assertEmptyCommit ( newProjectName , "refs/heads/test" , "refs/heads/master" , "refs/heads/release" ) ; }

Target:
public void testCreateProjectWithBranches ( ) throws java.lang.Exception { final java.lang.String newProjectName = "newProject" ; com.google.gerrit.extensions.api.projects.ProjectInput in = new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ; in.name = newProjectName ; in.createEmptyCommit = true ; in.branches = com.google.common.collect.Lists.newArrayListWithCapacity ( 3 ) ; in.branches.add ( "refs/heads/test" ) ; in.branches.add ( "refs/heads/master" ) ; in.branches.add ( "release" ) ; gApi.projects ( ) . create ( in ) ; assertHead ( newProjectName , "refs/heads/test" ) ; assertEmptyCommit ( newProjectName , "refs/heads/test" , "refs/heads/master" , "refs/heads/release" ) ; }
Source:
private boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.CurrentUser user , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { final com.google.gerrit.server.project.ProjectState pe = projectCache.get ( change.getProject ( ) ) ; if ( pe == null ) { return false ; } final com.google.gerrit.server.project.ProjectControl pc = pe.controlFor ( user ) ; return pc.controlFor ( change ) . isVisible ( db ) ; }

Target:
private boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Branch.NameKey branchName , com.google.gerrit.server.CurrentUser user ) { com.google.gerrit.server.project.ProjectState pe = projectCache.get ( branchName.getParentKey ( ) ) ; if ( pe == null ) { return false ; } com.google.gerrit.server.project.ProjectControl pc = pe.controlFor ( user ) ; return pc.controlForRef ( branchName ) . isVisible ( ) ; }
Source:
private void disableLuceneAutomaticCommit ( ) { if ( ( com.google.gerrit.server.index.IndexModule.getIndexType ( dbInjector ) ) == ( com.google.gerrit.server.index.IndexModule.IndexType.LUCENE ) ) { globalConfig.setLong ( "index" , "changes_open" , "commitWithin" , ( - 1 ) ) ; globalConfig.setLong ( "index" , "changes_closed" , "commitWithin" , ( - 1 ) ) ; } }

Target:
private void overrideConfig ( ) { if ( ( com.google.gerrit.server.index.IndexModule.getIndexType ( dbInjector ) ) == ( com.google.gerrit.server.index.IndexModule.IndexType.LUCENE ) ) { globalConfig.setLong ( "index" , "changes_open" , "commitWithin" , ( - 1 ) ) ; globalConfig.setLong ( "index" , "changes_closed" , "commitWithin" , ( - 1 ) ) ; } globalConfig.setLong ( "cache" , "changes" , "maximumWeight" , 0 ) ; globalConfig.setBoolean ( "index" , null , "autoReindexIfStale" , false ) ; }
Source:
public void index ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change change ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.query.change.ChangeData cd ; if ( notesMigration.commitChangeWrites ( ) ) { com.google.gerrit.server.notedb.ChangeNotes notes = changeNotesFactory.createWithAutoRebuildingDisabled ( change , null ) ; cd = changeDataFactory.create ( db , notes ) ; } else { cd = changeDataFactory.create ( db , change ) ; } index ( cd ) ; }

Target:
private com.google.gerrit.server.query.change.ChangeData newChangeData ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change change ) throws com.google.gwtorm.server.OrmException { if ( ! ( notesMigration.readChanges ( ) ) ) { com.google.gerrit.server.notedb.ChangeNotes notes = changeNotesFactory.createWithAutoRebuildingDisabled ( change , null ) ; return changeDataFactory.create ( db , notes ) ; } return changeDataFactory.create ( db , change ) ; }
Source:
private void initEditor ( ) { net.codemirror.mode.ModeInfo mode = null ; java.lang.String editContent = "" ; if ( ( ( content ) != null ) && ( ( content.getResult ( ) ) != null ) ) { editContent = content.getResult ( ) . asString ( ) ; if ( prefs.syntaxHighlighting ( ) ) { mode = net.codemirror.mode.ModeInfo.findMode ( content.getContentType ( ) , path ) ; } } HEAD ( a41014 ) ; }

Target:
public void run ( net.codemirror.lib.CodeMirror instance ) { save ( ) . run ( ) ; }
Source:
public void testChangeEventShouldBePropagatedToListenerWhenImmediatelyExecuted ( ) { asyncListener = new com.googlesource.gerrit.plugins.hooks.rtc.filters.ChangeListenerAsyncDecorator < com.google.gerrit.common.ChangeListener > ( listener , immediateExecutor ) ; asyncListener.onChangeEvent ( event ) ; verify ( listener ) . onChangeEvent ( event ) ; org.junit.Assert.assertTrue ( asyncListener.getQueue ( ) . isEmpty ( ) ) ; }

Target:
public void testChangeEventShouldBePropagatedToListenerWhenImmediatelyExecuted ( ) { asyncListener = new com.googlesource.gerrit.plugins.hooks.rtc.filters.ChangeListenerAsyncDecorator ( listener , immediateExecutor ) ; asyncListener.onEvent ( event ) ; org.mockito.Mockito.verify ( listener ) . onEvent ( event ) ; org.junit.Assert.assertTrue ( asyncListener.getQueue ( ) . isEmpty ( ) ) ; }
Source:
private boolean can ( com.google.gerrit.server.permissions.LabelPermission.WithValue perm ) { com.google.gerrit.common.data.PermissionRange r = label ( perm.permissionName ( ) ) ; if ( ( ( perm.forUser ( ) ) == ( ForUser.ON_BEHALF_OF ) ) && ( r.isEmpty ( ) ) ) { return false ; } return r.contains ( perm.value ( ) ) ; }

Target:
private boolean can ( com.google.gerrit.server.permissions.LabelPermission.WithValue perm ) { com.google.gerrit.common.data.PermissionRange r = label ( com.google.gerrit.server.permissions.DefaultPermissionMappings.labelPermissionName ( perm ) ) ; if ( ( ( perm.forUser ( ) ) == ( ForUser.ON_BEHALF_OF ) ) && ( r.isEmpty ( ) ) ) { return false ; } return r.contains ( perm.value ( ) ) ; }
Source:
public java.lang.String toString ( ) { final org.apache.sshd.server.session.ServerSession session = context.session ; final java.lang.String who = session.getUsername ( ) ; final com.google.gerrit.reviewdb.Account.Id id = session.getAttribute ( SshUtil.CURRENT_ACCOUNT ) ; return ( ( ( ( "SSH " + ( getFullCommandLine ( ) ) ) + " / " ) + who ) + " " ) + id ; }

Target:
public java.lang.String toString ( ) { final org.apache.sshd.server.session.ServerSession session = context.session ; final java.lang.String who = session.getUsername ( ) ; return ( ( ( getFullCommandLine ( ) ) + " (" ) + who ) + ")" ; }
Source:
public static com.google.gerrit.server.query.Predicate < com.google.gerrit.server.account.AccountState > defaultPredicate ( java.lang.String query ) { java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.account.AccountState > > preds = com.google.common.collect.Lists.newArrayListWithCapacity ( 3 ) ; java.lang.Integer id = com.google.common.primitives.Ints.tryParse ( query ) ; if ( id != null ) { preds.add ( com.google.gerrit.server.query.account.AccountPredicates.id ( new com.google.gerrit.reviewdb.client.Account.Id ( id ) ) ) ; } preds.add ( com.google.gerrit.server.query.account.AccountPredicates.equalsName ( query ) ) ; preds.add ( com.google.gerrit.server.query.account.AccountPredicates.username ( query ) ) ; return com.google.gerrit.server.query.Predicate.or ( preds ) ; }

Target:
public static com.google.gerrit.index.query.Predicate < com.google.gerrit.server.account.AccountState > defaultPredicate ( java.lang.String query ) { java.util.List < com.google.gerrit.index.query.Predicate < com.google.gerrit.server.account.AccountState > > preds = com.google.common.collect.Lists.newArrayListWithCapacity ( 3 ) ; java.lang.Integer id = com.google.common.primitives.Ints.tryParse ( query ) ; if ( id != null ) { preds.add ( com.google.gerrit.server.query.account.AccountPredicates.id ( new com.google.gerrit.reviewdb.client.Account.Id ( id ) ) ) ; } preds.add ( com.google.gerrit.server.query.account.AccountPredicates.equalsName ( query ) ) ; preds.add ( com.google.gerrit.server.query.account.AccountPredicates.username ( query ) ) ; return com.google.gerrit.index.query.Predicate.or ( preds ) ; }
Source:
private java.util.Map < com.google.gerrit.reviewdb.client.Change.Key , com.google.gerrit.reviewdb.client.Change.Id > openChangesByKey ( com.google.gerrit.reviewdb.client.Branch.NameKey branch ) throws com.google.gwtorm.server.OrmException { final java.util.Map < com.google.gerrit.reviewdb.client.Change.Key , com.google.gerrit.reviewdb.client.Change.Id > r = new java.util.HashMap < com.google.gerrit.reviewdb.client.Change.Key , com.google.gerrit.reviewdb.client.Change.Id > ( ) ; for ( com.google.gerrit.reviewdb.client.Change c : db.changes ( ) . byBranchOpenAll ( branch ) ) { r.put ( c.getKey ( ) , c.getId ( ) ) ; } return r ; }

Target:
private java.util.Map < com.google.gerrit.reviewdb.client.Change.Key , com.google.gerrit.reviewdb.client.Change > openChangesByBranch ( com.google.gerrit.reviewdb.client.Branch.NameKey branch ) throws com.google.gwtorm.server.OrmException { final java.util.Map < com.google.gerrit.reviewdb.client.Change.Key , com.google.gerrit.reviewdb.client.Change > r = new java.util.HashMap < > ( ) ; for ( com.google.gerrit.server.query.change.ChangeData cd : queryProvider.get ( ) . byBranchOpen ( branch ) ) { r.put ( cd.change ( ) . getKey ( ) , cd.change ( ) ) ; } return r ; }
Source:
private void executeUpdateRepo ( ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException { try { com.google.gerrit.server.git.BatchUpdate.RepoContext ctx = new com.google.gerrit.server.git.BatchUpdate.RepoContext ( ) ; for ( com.google.gerrit.server.git.BatchUpdate.Op op : ops.values ( ) ) { op.updateRepo ( ctx ) ; } if ( ( inserter ) != null ) { inserter.flush ( ) ; } } catch ( java.lang.Exception e ) { com.google.common.base.Throwables.propagateIfPossible ( e , com.google.gerrit.extensions.restapi.RestApiException.class ) ; throw new com.google.gerrit.server.git.UpdateException ( e ) ; } }

Target:
private void executePostOps ( ) throws java.lang.Exception { com.google.gerrit.server.git.BatchUpdate.Context ctx = new com.google.gerrit.server.git.BatchUpdate.Context ( ) ; for ( com.google.gerrit.server.git.BatchUpdate.Op op : ops.values ( ) ) { op.postUpdate ( ctx ) ; } for ( com.google.gerrit.server.git.BatchUpdate.RepoOnlyOp op : repoOnlyOps ) { op.postUpdate ( ctx ) ; } }
Source:
private java.io.File random ( ) { final java.io.File t = new java.io.File ( "target" ) ; return new java.io.File ( t , ( "random-name-" + ( java.util.UUID.randomUUID ( ) . toString ( ) ) ) ) ; }

Target:
private static java.io.File random ( ) throws java.io.IOException { java.io.File tmp = java.io.File.createTempFile ( "gerrit_test_" , "_site" ) ; if ( ! ( tmp.delete ( ) ) ) { throw new java.io.IOException ( ( "Cannot create " + ( tmp.getPath ( ) ) ) ) ; } return tmp ; }
Source:
protected void setUp ( ) throws java.lang.Exception { repo = new org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.storage.dfs.DfsRepository > ( new org.eclipse.jgit.storage.dfs.InMemoryRepository ( new org.eclipse.jgit.storage.dfs.DfsRepositoryDescription ( "test" ) ) ) ; servlet = new com.google.gitiles.RepositoryIndexServlet ( new com.google.gitiles.DefaultRenderer ( ) , new com.google.gitiles.TestGitilesAccess ( repo.getRepository ( ) ) ) ; }

Target:
protected void setUp ( ) throws java.lang.Exception { repo = new org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.storage.dfs.DfsRepository > ( new org.eclipse.jgit.storage.dfs.InMemoryRepository ( new org.eclipse.jgit.storage.dfs.DfsRepositoryDescription ( "test" ) ) ) ; servlet = new com.google.gitiles.RepositoryIndexServlet ( new com.google.gitiles.DefaultRenderer ( ) , new com.google.gitiles.TestGitilesAccess ( repo.getRepository ( ) ) , new com.google.gitiles.TimeCache ( ) ) ; }
Source:
public com.google.gerrit.server.notedb.ChangeNotes call ( ) throws java.lang.Exception { com.google.common.base.Preconditions.checkArgument ( change.getProject ( ) . equals ( project ) , ( "passed project %s when creating ChangeNotes for %s," + " but actual project is %s" ) , project , changeId , change.getProject ( ) ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( args , change , false , null ) . load ( ) ; }

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 onSuccess ( com.google.gerrit.client.info.AccountInfo result ) { onCloseForm ( ) ; assigneeLink.setText ( result.name ( ) ) ; }

Target:
private void setAssignee ( com.google.gerrit.client.info.AccountInfo assignee ) { currentAssignee = assignee ; assigneeLink.setText ( ( assignee != null ? getName ( assignee ) : null ) ) ; assigneeLink.setTargetHistoryToken ( ( assignee != null ? com.google.gerrit.common.PageLinks.toAssigneeQuery ( ( ( assignee.name ( ) ) != null ? assignee.name ( ) : ( assignee.email ( ) ) != null ? assignee.email ( ) : java.lang.String.valueOf ( assignee._accountId ( ) ) ) ) : "" ) ) ; }
Source:
private java.util.List < com.google.gerrit.common.data.SubmitRecord > submitRecords ( com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { if ( ( cd.getSubmitRecords ( ) ) != null ) { return cd.getSubmitRecords ( ) ; } cd.setSubmitRecords ( new com.google.gerrit.server.project.SubmitRuleEvaluator ( cd ) . setFastEvalLabels ( true ) . setAllowDraft ( true ) . evaluate ( ) ) ; return cd.getSubmitRecords ( ) ; }

Target:
public com.google.gerrit.extensions.common.AccountInfo apply ( com.google.gerrit.reviewdb.client.Account.Id id ) { return accountLoader.get ( id ) ; }
Source:
public void byAuthor ( ) 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 = newChange ( repo , null , null , userId.get ( ) , null ) . insert ( ) ; assertQuery ( "author:jauthor@example.com" , change1 ) ; assertQuery ( "author:jauthor" , change1 ) ; assertQuery ( "author:example" , change1 ) ; assertQuery ( "author:example.com" , change1 ) ; assertQuery ( "author:Author" , change1 ) ; assertQuery ( "author:jcommitter@example.com" ) ; assertQuery ( "author:somewhere.com" ) ; assertQuery ( "author:jcommitter" ) ; assertQuery ( "author:Committer" ) ; }

Target:
public void byOwnerIn ( ) 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 ) ) ; int user2 = accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "anotheruser" ) ) . getAccountId ( ) . get ( ) ; com.google.gerrit.reviewdb.client.Change change2 = insert ( newChange ( repo , null , null , user2 , null ) ) ; assertQuery ( "ownerin:Administrators" , change1 ) ; assertQuery ( "ownerin:\"Registered Users\"" , change2 , change1 ) ; }
Source:
private void enable ( final boolean on ) { showSiteHeader.setEnabled ( on ) ; useFlashClipboard.setEnabled ( on ) ; copySelfOnEmails.setEnabled ( on ) ; maximumPageSize.setEnabled ( on ) ; dateFormat.setEnabled ( on ) ; timeFormat.setEnabled ( on ) ; }

Target:
private void enable ( final boolean on ) { showSiteHeader.setEnabled ( on ) ; useFlashClipboard.setEnabled ( on ) ; copySelfOnEmails.setEnabled ( on ) ; displayPatchSetsInReverseOrder.setEnabled ( on ) ; maximumPageSize.setEnabled ( on ) ; dateFormat.setEnabled ( on ) ; timeFormat.setEnabled ( on ) ; }
Source:
private void redirectToNextStep ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse resp ) throws java.io.IOException { java.lang.String nextUrl = req.getParameter ( "next" ) ; if ( ( com.google.common.base.Strings.emptyToNull ( nextUrl ) ) != null ) { resp.sendRedirect ( nextUrl ) ; } }

Target:
private void redirectToNextStep ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse resp ) throws java.io.IOException { java.lang.String sourcePath = req.getRequestURI ( ) ; java.lang.String sourcePage = sourcePath.substring ( ( ( sourcePath.lastIndexOf ( '/' ) ) + 1 ) ) ; int queryStringStart = sourcePage.indexOf ( '?' ) ; if ( queryStringStart > 0 ) { sourcePage = sourcePage.substring ( 0 , queryStringStart ) ; } java.lang.String nextPage = githubConfig.getNextPage ( sourcePage ) ; if ( nextPage != null ) { resp.sendRedirect ( nextPage ) ; } }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; refresh ( ) ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; Util.ACCOUNT_SEC.myExternalIds ( new com.google.gerrit.client.rpc.GerritCallback < java.util.List < com.google.gerrit.reviewdb.AccountExternalId > > ( ) { public void onSuccess ( final java.util.List < com.google.gerrit.reviewdb.AccountExternalId > result ) { identites.display ( result ) ; } } ) ; }
Source:
private int insert ( final java.util.List < com.google.gerrit.reviewdb.PatchLineComment > in , int row ) { for ( java.util.Iterator < com.google.gerrit.reviewdb.PatchLineComment > ci = in.iterator ( ) ; ci.hasNext ( ) ; ) { final com.google.gerrit.reviewdb.PatchLineComment c = ci.next ( ) ; insertRow ( row ) ; bindComment ( row , com.google.gerrit.client.patches.UnifiedDiffTable.PC , c , ( ! ( ci.hasNext ( ) ) ) ) ; row ++ ; } return row ; }

Target:
private int insert ( final java.util.List < com.google.gerrit.reviewdb.PatchLineComment > in , int row , boolean expandComment ) { for ( java.util.Iterator < com.google.gerrit.reviewdb.PatchLineComment > ci = in.iterator ( ) ; ci.hasNext ( ) ; ) { final com.google.gerrit.reviewdb.PatchLineComment c = ci.next ( ) ; insertRow ( row ) ; bindComment ( row , com.google.gerrit.client.patches.UnifiedDiffTable.PC , c , ( ! ( ci.hasNext ( ) ) ) , expandComment ) ; row ++ ; } return row ; }
Source:
private java.util.Set < com.google.gerrit.reviewdb.client.Project.NameKey > getAllParents ( final com.google.gerrit.reviewdb.client.Project.NameKey projectName ) { final java.util.Set < com.google.gerrit.reviewdb.client.Project.NameKey > parents = new java.util.HashSet < com.google.gerrit.reviewdb.client.Project.NameKey > ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey p = projectName ; while ( ( p != null ) && ( parents.add ( p ) ) ) { final com.google.gerrit.server.project.ProjectState e = projectCache.get ( p ) ; if ( e == null ) { break ; } p = e.getProject ( ) . getParent ( allProjectsName ) ; } return parents ; }

Target:
private java.util.Set < com.google.gerrit.reviewdb.client.Project.NameKey > getAllParents ( final com.google.gerrit.reviewdb.client.Project.NameKey projectName ) { com.google.gerrit.server.project.ProjectState ps = projectCache.get ( projectName ) ; return com.google.common.collect.ImmutableSet.copyOf ( com.google.common.collect.Iterables.transform ( ( ps != null ? ps.parents ( ) : java.util.Collections.< com.google.gerrit.server.project.ProjectState > emptySet ( ) ) , new com.google.common.base.Function < com.google.gerrit.server.project.ProjectState , com.google.gerrit.reviewdb.client.Project.NameKey > ( ) { @ java.lang.Override public Project.NameKey apply ( com.google.gerrit.server.project.ProjectState in ) { return in.getProject ( ) . getNameKey ( ) ; } } ) ) ; }
Source:
public void reviewTriplet ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.git.PushOneCommit.Result r = createChange ( ) ; gApi.changes ( ) . id ( ( "p~master~" + ( r.getChangeId ( ) ) ) ) . revision ( r.getCommit ( ) . name ( ) ) . review ( com.google.gerrit.acceptance.api.revision.ReviewIT.makeReview ( ) ) ; }

Target:
public void abandon ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.git.PushOneCommit.Result r = createChange ( ) ; gApi.changes ( ) . id ( ( "p~master~" + ( r.getChangeId ( ) ) ) ) . abandon ( ) ; }
Source:
public void testGetJGroupsChannel ( ) throws java.lang.Exception { org.mockito.Mockito.when ( configMock.getEnum ( com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , null , com.ericsson.gerrit.plugins.highavailability.Configuration.STRATEGY_KEY , com.ericsson.gerrit.plugins.highavailability.Configuration.DEFAULT_PEER_INFO_STRATEGY ) ) . thenReturn ( Configuration.PeerInfoStrategy.JGROUPS ) ; initializeConfiguration ( ) ; com.google.common.truth.Truth.assertThat ( configuration.peerInfoJGroups ( ) . clusterName ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.highavailability.Configuration.DEFAULT_CLUSTER_NAME ) ; org.mockito.Mockito.when ( configMock.getString ( com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , com.ericsson.gerrit.plugins.highavailability.Configuration.JGROUPS_SUBSECTION , com.ericsson.gerrit.plugins.highavailability.Configuration.CLUSTER_NAME_KEY ) ) . thenReturn ( "foo" ) ; initializeConfiguration ( ) ; com.google.common.truth.Truth.assertThat ( configuration.peerInfoJGroups ( ) . clusterName ( ) ) . isEqualTo ( "foo" ) ; }

Target:
public void testGetJGroupsCluster ( ) throws java.lang.Exception { org.mockito.Mockito.when ( configMock.getEnum ( com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , null , com.ericsson.gerrit.plugins.highavailability.Configuration.STRATEGY_KEY , com.ericsson.gerrit.plugins.highavailability.Configuration.DEFAULT_PEER_INFO_STRATEGY ) ) . thenReturn ( Configuration.PeerInfoStrategy.JGROUPS ) ; initializeConfiguration ( ) ; com.google.common.truth.Truth.assertThat ( configuration.peerInfoJGroups ( ) . clusterName ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.highavailability.Configuration.DEFAULT_CLUSTER_NAME ) ; org.mockito.Mockito.when ( configMock.getString ( com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , com.ericsson.gerrit.plugins.highavailability.Configuration.JGROUPS_SUBSECTION , com.ericsson.gerrit.plugins.highavailability.Configuration.CLUSTER_NAME_KEY ) ) . thenReturn ( "foo" ) ; initializeConfiguration ( ) ; com.google.common.truth.Truth.assertThat ( configuration.peerInfoJGroups ( ) . clusterName ( ) ) . isEqualTo ( "foo" ) ; }
Source:
public void testSortWithRegex ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "^refs/heads/.*" ) ; com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , 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 = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertTrue ( "u can read" , u.controlForRef ( "refs/heads/foo-QA-bar" ) . isVisible ( ) ) ; org.junit.Assert.assertTrue ( "d can read" , d.controlForRef ( "refs/heads/foo-QA-bar" ) . isVisible ( ) ) ; }

Target:
public void testSortWithRegex ( ) { 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 ( util.getParentConfig ( ) , 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 = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertTrue ( "u can read" , u.controlForRef ( "refs/heads/foo-QA-bar" ) . isVisible ( ) ) ; org.junit.Assert.assertTrue ( "d can read" , d.controlForRef ( "refs/heads/foo-QA-bar" ) . isVisible ( ) ) ; }
Source:
public void deleteDraftPatchSetNoACL ( ) throws java.lang.Exception { java.lang.String changeId = createDraftChangeWith2PS ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = getCurrentPatchSet ( changeId ) ; java.lang.String triplet = "p~master~" + changeId ; com.google.gerrit.extensions.common.ChangeInfo c = get ( triplet ) ; org.junit.Assert.assertEquals ( triplet , c.id ) ; org.junit.Assert.assertEquals ( ChangeStatus.DRAFT , c.status ) ; com.google.gerrit.acceptance.RestResponse r = com.google.gerrit.acceptance.rest.change.DeleteDraftPatchSetIT.deletePatchSet ( changeId , ps , userSession ) ; org.junit.Assert.assertEquals ( "Not found" , r.getEntityContent ( ) ) ; org.junit.Assert.assertEquals ( 404 , r.getStatusCode ( ) ) ; }

Target:
public void deleteDraftPatchSetNoACL ( ) throws java.lang.Exception { java.lang.String changeId = createDraftChangeWith2PS ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = getCurrentPatchSet ( changeId ) ; java.lang.String triplet = "p~master~" + changeId ; com.google.gerrit.extensions.common.ChangeInfo c = get ( triplet ) ; org.junit.Assert.assertEquals ( triplet , c.id ) ; org.junit.Assert.assertEquals ( ChangeStatus.DRAFT , c.status ) ; com.google.gerrit.acceptance.RestResponse r = com.google.gerrit.acceptance.rest.change.DeleteDraftPatchSetIT.deletePatchSet ( changeId , ps , userSession ) ; org.junit.Assert.assertEquals ( ( "Not found: " + changeId ) , r.getEntityContent ( ) ) ; org.junit.Assert.assertEquals ( 404 , r.getStatusCode ( ) ) ; }
Source:
private void renderHistory ( com.google.gerrit.client.changes.ChangeInfo info ) { com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.ChangeInfo.MessageInfo > messages = info.messages ( ) ; if ( messages != null ) { for ( int i = 0 ; i < ( messages.length ( ) ) ; i ++ ) { history.add ( new com.google.gerrit.client.change.Message ( commentLinkProcessor , messages.get ( i ) ) ) ; } } }

Target:
private void renderCommitSubject ( com.google.gerrit.client.changes.ChangeInfo info ) { com.google.gerrit.client.changes.ChangeInfo.RevisionInfo rev = info.revision ( revision ) ; java.lang.String sub = rev.commit ( ) . subject ( ) ; commitSubjectText.setInnerSafeHtml ( commentLinkProcessor.apply ( new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) . append ( sub ) . linkify ( ) ) ) ; }
Source:
private void wantGroup ( final com.google.gerrit.reviewdb.AccountGroup.Id id ) { groups.put ( id , null ) ; }

Target:
private java.util.concurrent.Future < com.google.gerrit.reviewdb.AccountGroup > want ( com.google.gerrit.reviewdb.AccountGroup.Id id ) { java.util.concurrent.Future < com.google.gerrit.reviewdb.AccountGroup > f = groups.get ( id ) ; if ( f == null ) { f = groupCache.get ( id ) ; groups.put ( id , f ) ; } return f ; }
Source:
protected PushOneCommit.Result createChange ( org.eclipse.jgit.api.Git git , java.lang.String subject , java.lang.String fileName , java.lang.String content , java.lang.String topic ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , git , subject , fileName , content ) ; return push.to ( ( "refs/for/master/" + topic ) ) ; }

Target:
protected PushOneCommit.Result createChange ( java.lang.String subject , java.lang.String fileName , java.lang.String content , java.lang.String topic ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , testRepo , subject , fileName , content ) ; return push.to ( ( "refs/for/master/" + topic ) ) ; }
Source:
private void readObject ( final java.io.ObjectInputStream in ) throws java.io.IOException { oldId = org.eclipse.jgit.lib.ObjectIdSerialization.readCanBeNull ( in ) ; newId = org.eclipse.jgit.lib.ObjectIdSerialization.readNotNull ( in ) ; char t = in.readChar ( ) ; whitespace = com.google.gerrit.server.patch.PatchListKey.WHITESPACE_TYPES.inverse ( ) . get ( t ) ; if ( ( whitespace ) == null ) { throw new java.io.IOException ( ( "Invalid whitespace type code: " + t ) ) ; } }

Target:
private void readObject ( final java.io.ObjectInputStream in ) throws java.io.IOException { oldId = org.eclipse.jgit.lib.ObjectIdSerialization.readCanBeNull ( in ) ; int n = in.readInt ( ) ; parentNum = ( n == 0 ) ? null : java.lang.Integer.valueOf ( n ) ; newId = org.eclipse.jgit.lib.ObjectIdSerialization.readNotNull ( in ) ; char t = in.readChar ( ) ; whitespace = com.google.gerrit.server.patch.PatchListKey.WHITESPACE_TYPES.inverse ( ) . get ( t ) ; if ( ( whitespace ) == null ) { throw new java.io.IOException ( ( "Invalid whitespace type code: " + t ) ) ; } }
Source:
public static synchronized com.google.gerrit.server.GerritServer getInstance ( ) throws com.google.gwtjsonrpc.server.XsrfException , com.google.gwtorm.client.OrmException { if ( ( com.google.gerrit.server.GerritServer.impl ) == null ) { com.google.gerrit.server.GerritServer.impl = new com.google.gerrit.server.GerritServer ( ) ; } return com.google.gerrit.server.GerritServer.impl ; }

Target:
public static synchronized com.google.gerrit.server.GerritServer getInstance ( ) throws com.google.gwtjsonrpc.server.XsrfException , com.google.gwtorm.client.OrmException { if ( ( com.google.gerrit.server.GerritServer.impl ) == null ) { try { com.google.gerrit.server.GerritServer.impl = new com.google.gerrit.server.GerritServer ( ) ; } catch ( com.google.gwtorm.client.OrmException e ) { e.printStackTrace ( ) ; throw e ; } } return com.google.gerrit.server.GerritServer.impl ; }
Source:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { final com.google.gerrit.reviewdb.client.Change change = object.change ( ) ; if ( change == null ) { return false ; } final com.google.gerrit.server.IdentifiedUser owner = userFactory.create ( dbProvider , change.getOwner ( ) ) ; return owner.getEffectiveGroups ( ) . contains ( uuid ) ; }

Target:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { final com.google.gerrit.reviewdb.client.Change change = object.change ( ) ; if ( change == null ) { return false ; } final com.google.gerrit.server.IdentifiedUser owner = userFactory.create ( dbProvider , change.getOwner ( ) ) ; return owner.memberOf ( uuid ) ; }
Source:
public static com.google.gerrit.reviewdb.client.ChangeMessage newMessage ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx , java.lang.String body ) throws com.google.gwtorm.server.OrmException { return com.google.gerrit.server.ChangeMessagesUtil.newMessage ( ctx.getDb ( ) , ctx.getChange ( ) . currentPatchSetId ( ) , ctx.getUser ( ) , ctx.getWhen ( ) , body ) ; }

Target:
public static com.google.gerrit.reviewdb.client.ChangeMessage newMessage ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx , java.lang.String body , @ com.google.gerrit.common.Nullable java.lang.String tag ) throws com.google.gwtorm.server.OrmException { return com.google.gerrit.server.ChangeMessagesUtil.newMessage ( ctx.getDb ( ) , ctx.getChange ( ) . currentPatchSetId ( ) , ctx.getUser ( ) , ctx.getWhen ( ) , body , tag ) ; }
Source:
public boolean visit ( java.lang.String name , com.google.gerrit.extensions.common.ActionInfo actionInfo , com.google.gerrit.extensions.common.ChangeInfo changeInfo , com.google.gerrit.extensions.common.RevisionInfo revisionInfo ) { com.google.common.truth.Truth.assertThat ( changeInfo ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( changeInfo._number ) . isEqualTo ( origChange._number ) ; com.google.common.truth.Truth.assertThat ( revisionInfo ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( revisionInfo._number ) . isEqualTo ( 1 ) ; if ( name.equals ( "cherrypick" ) ) { return false ; } if ( name.equals ( "rebase" ) ) { actionInfo.label = "All Your Base" ; } return true ; }

Target:
public boolean visit ( java.lang.String name , com.google.gerrit.extensions.common.ActionInfo actionInfo , com.google.gerrit.extensions.common.ChangeInfo changeInfo , com.google.gerrit.extensions.common.RevisionInfo revisionInfo ) { com.google.common.truth.Truth.assertThat ( changeInfo ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( changeInfo._number ) . isEqualTo ( origChange._number ) ; com.google.common.truth.Truth.assertThat ( revisionInfo ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( revisionInfo._number ) . isEqualTo ( 1 ) ; if ( name.equals ( "description" ) ) { actionInfo.label = "Describify" ; } return true ; }
Source:
public com.google.gerrit.extensions.restapi.Response < java.lang.String > apply ( com.google.gerrit.server.account.AccountResource.Email rsrc , com.google.gerrit.server.account.PutPreferred.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { if ( ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) && ( ! ( self.get ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "not allowed to set preferred email address" ) ; } return apply ( rsrc.getUser ( ) , rsrc.getEmail ( ) ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < java.lang.String > apply ( com.google.gerrit.server.account.AccountResource.Email rsrc , com.google.gerrit.server.account.PutPreferred.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { if ( ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) && ( ! ( self.get ( ) . getCapabilities ( ) . canModifyAccount ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "not allowed to set preferred email address" ) ; } return apply ( rsrc.getUser ( ) , rsrc.getEmail ( ) ) ; }
Source:
public void unblockRangeForNotChangeOwner ( ) { com.google.gerrit.server.project.Util.allow ( local , ( ( com.google.gerrit.common.data.Permission.LABEL ) + "Code-Review" ) , ( - 2 ) , ( + 2 ) , com.google.gerrit.server.group.SystemGroupBackend.CHANGE_OWNER , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.common.data.PermissionRange range = u.controlForRef ( "refs/heads/master" ) . getRange ( ( ( com.google.gerrit.common.data.Permission.LABEL ) + "Code-Review" ) ) ; assertCannotVote ( ( - 2 ) , range ) ; assertCannotVote ( 2 , range ) ; }

Target:
public void blockOwner ( ) { com.google.gerrit.server.project.testing.Util.block ( parent , com.google.gerrit.common.data.Permission.OWNER , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.OWNER , com.google.gerrit.server.project.testing.Util.DEVS , "refs/*" ) ; com.google.common.truth.Truth.assertThat ( user ( local , com.google.gerrit.server.project.testing.Util.DEVS ) . isOwner ( ) ) . isFalse ( ) ; }
Source:
protected void configure ( ) { bind ( com.google.inject.Key.get ( javax.sql.DataSource.class , com.google.inject.name.Names.named ( "ReviewDb" ) ) ) . toProvider ( com.google.gerrit.httpd.ReviewDbDataSourceProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; listener ( ) . to ( com.google.gerrit.httpd.ReviewDbDataSourceProvider.class ) ; }

Target:
protected void configure ( ) { bind ( java.io.File.class ) . annotatedWith ( com.google.gerrit.server.config.SitePath.class ) . toInstance ( sitePath ) ; bind ( DataSourceProvider.Context.class ) . toInstance ( DataSourceProvider.Context.MULTI_USER ) ; bind ( com.google.inject.Key.get ( javax.sql.DataSource.class , com.google.inject.name.Names.named ( "ReviewDb" ) ) ) . toProvider ( com.google.gerrit.server.schema.DataSourceProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; listener ( ) . to ( com.google.gerrit.server.schema.DataSourceProvider.class ) ; }
Source:
protected abstract void onCellSingleClick ( int row , int column ) ;

Target:
protected void initHeaders ( com.google.gerrit.common.data.PatchScript script , com.google.gerrit.common.data.PatchSetDetail detail ) { com.google.gerrit.client.patches.PatchScreen.Type type = getPatchScreenType ( ) ; headerSideA = new com.google.gerrit.client.patches.PatchSetSelectBox ( PatchSetSelectBox.Side.A , type ) ; headerSideB = new com.google.gerrit.client.patches.PatchSetSelectBox ( PatchSetSelectBox.Side.B , type ) ; headerSideA.display ( detail , script , patchKey , idSideA , idSideB ) ; headerSideB.display ( detail , script , patchKey , idSideA , idSideB ) ; }
Source:
void onExpandAll ( com.google.gwt.event.dom.client.ClickEvent e ) { int n = history.getWidgetCount ( ) ; for ( int i = 0 ; i < n ; i ++ ) { ( ( com.google.gerrit.client.change.Message ) ( history.getWidget ( i ) ) ) . setOpen ( true ) ; } expandAll.setVisible ( false ) ; collapseAll.setVisible ( true ) ; }

Target:
void onCollapseAll ( com.google.gwt.event.dom.client.ClickEvent e ) { int n = history.getWidgetCount ( ) ; for ( int i = 0 ; i < n ; i ++ ) { ( ( com.google.gerrit.client.change.Message ) ( history.getWidget ( i ) ) ) . setOpen ( false ) ; } expandAll.setVisible ( true ) ; collapseAll.setVisible ( false ) ; }