auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.lang.PrologException { engine.setB0 ( ) ; com.googlecode.prolog_cafe.lang.Term a1 = arg1.dereference ( ) ; com.google.gerrit.rules.PrologEnvironment env = ( ( com.google.gerrit.rules.PrologEnvironment ) ( engine.control ) ) ; com.google.gerrit.reviewdb.Change change = StoredValues.CHANGE.get ( engine ) ; com.google.gerrit.reviewdb.Branch.NameKey name = change.getDest ( ) ; if ( ! ( a1.unify ( com.googlecode.prolog_cafe.lang.SymbolTerm.create ( name.get ( ) ) , engine.trail ) ) ) { return engine.fail ( ) ; } return cont ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.lang.PrologException { engine.setB0 ( ) ; com.googlecode.prolog_cafe.lang.Term a1 = arg1.dereference ( ) ; com.google.gerrit.reviewdb.Change change = StoredValues.CHANGE.get ( engine ) ; com.google.gerrit.reviewdb.Branch.NameKey name = change.getDest ( ) ; if ( ! ( a1.unify ( com.googlecode.prolog_cafe.lang.SymbolTerm.create ( name.get ( ) ) , engine.trail ) ) ) { return engine.fail ( ) ; } return cont ; }
Source:
public com.googlecode.prolog_cafe.lang.Operation jtry ( com.googlecode.prolog_cafe.lang.Operation p , com.googlecode.prolog_cafe.lang.Operation next , com.googlecode.prolog_cafe.lang.ChoicePointFrame entry ) { entry.cont = cont ; entry.b0 = B0 ; entry.bp = next ; entry.tr = trail.top ( ) ; entry.timeStamp = ++ ( CPFTimeStamp ) ; stack.push ( entry ) ; return p ; }

Target:
private com.googlecode.prolog_cafe.lang.Operation jtry ( com.googlecode.prolog_cafe.lang.Operation p , com.googlecode.prolog_cafe.lang.Operation next , com.googlecode.prolog_cafe.lang.ChoicePointFrame entry ) { entry.cont = cont ; entry.b0 = B0 ; entry.bp = next ; entry.tr = trail.top ( ) ; entry.timeStamp = ++ ( CPFTimeStamp ) ; stack.push ( entry ) ; return p ; }
Source:
public void submitOnPushSuccessfulMerge ( ) throws java.lang.Exception { java.lang.String master = "refs/heads/master" ; org.eclipse.jgit.lib.ObjectId objectId = git.getRepository ( ) . getRef ( "HEAD" ) . getObjectId ( ) ; push ( master , "one change" , "a.txt" , "some content" ) ; testRepo.reset ( objectId ) ; grant ( Permission.SUBMIT , project , "refs/for/refs/heads/master" ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = push ( "refs/for/master%submit" , "other change" , "b.txt" , "other content" ) ; r.assertOkStatus ( ) ; r.assertChange ( Change.Status.MERGED , null , admin ) ; assertMergeCommit ( master , "other change" ) ; }

Target:
public void submitOnPushSuccessfulMerge ( ) throws java.lang.Exception { java.lang.String master = "refs/heads/master" ; org.eclipse.jgit.lib.ObjectId objectId = repo ( ) . getRef ( "HEAD" ) . getObjectId ( ) ; push ( master , "one change" , "a.txt" , "some content" ) ; testRepo.reset ( objectId ) ; grant ( Permission.SUBMIT , project , "refs/for/refs/heads/master" ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = push ( "refs/for/master%submit" , "other change" , "b.txt" , "other content" ) ; r.assertOkStatus ( ) ; r.assertChange ( Change.Status.MERGED , null , admin ) ; assertMergeCommit ( master , "other change" ) ; }
Source:
private void set ( com.google.gerrit.client.changes.CommentInfo info ) { date.setInnerText ( com.google.gerrit.client.FormatUtil.shortFormatDayTime ( info.updated ( ) ) ) ; if ( ( info.message ( ) ) != null ) { java.lang.String msg = info.message ( ) . trim ( ) ; summary.setInnerText ( msg ) ; message.setHTML ( linkProcessor.apply ( new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) . append ( msg ) . wikify ( ) ) ) ; } this . comment = info ; }

Target:
private void set ( com.google.gerrit.client.changes.CommentInfo info ) { date.setInnerText ( com.google.gerrit.client.FormatUtil.shortFormatDayTime ( info.updated ( ) ) ) ; if ( ( info.message ( ) ) != null ) { java.lang.String msg = info.message ( ) . trim ( ) ; summary.setInnerText ( msg ) ; message.setHTML ( linkProcessor.apply ( new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) . append ( msg ) . wikify ( ) ) ) ; } comment = info ; }
Source:
public boolean isDirectChild ( ) { com.google.gerrit.server.project.ProjectState firstParent = com.google.common.collect.Iterables.getFirst ( child.getProjectState ( ) . parents ( ) , null ) ; return ( firstParent != null ) && ( parent.getNameKey ( ) . equals ( firstParent.getProject ( ) . getNameKey ( ) ) ) ; }

Target:
public boolean isDirectChild ( ) { com.google.gerrit.server.project.ProjectState firstParent = com.google.common.collect.Iterables.getFirst ( child.parents ( ) , null ) ; return ( firstParent != null ) && ( parent.getNameKey ( ) . equals ( firstParent.getProject ( ) . getNameKey ( ) ) ) ; }
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 ) ; try ( java.io.Writer writer = com.google.gitiles.BaseServlet.newWriter ( req , res ) ) { newGsonBuilder ( req ) . create ( ) . toJson ( src , typeOfSrc , writer ) ; writer.write ( '\n' ) ; } }

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 ( req , res , com.google.gitiles.FormatType.JSON ) ; res.setStatus ( javax.servlet.http.HttpServletResponse.SC_OK ) ; try ( java.io.Writer writer = com.google.gitiles.BaseServlet.newWriter ( req , res ) ) { newGsonBuilder ( req ) . create ( ) . toJson ( src , typeOfSrc , writer ) ; writer.write ( '\n' ) ; } }
Source:
public void testNameCaseMismatchAfterRestart ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( ( ( com.google.gerrit.server.util.HostPlatform.isWin32 ( ) ) || ( com.google.gerrit.server.util.HostPlatform.isMac ( ) ) ) ) . isTrue ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey name = new com.google.gerrit.reviewdb.client.Project.NameKey ( "a" ) ; repoManager.createRepository ( name ) ; com.google.gerrit.server.git.LocalDiskRepositoryManager newRepoManager = new com.google.gerrit.server.git.LocalDiskRepositoryManager ( site , cfg ) ; newRepoManager.start ( ) ; newRepoManager.createRepository ( new com.google.gerrit.reviewdb.client.Project.NameKey ( "A" ) ) ; }

Target:
public void testNameCaseMismatchAfterRestart ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( ( ( com.google.gerrit.server.util.HostPlatform.isWin32 ( ) ) || ( com.google.gerrit.server.util.HostPlatform.isMac ( ) ) ) ) . isTrue ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey name = new com.google.gerrit.reviewdb.client.Project.NameKey ( "a" ) ; repoManager.createRepository ( name ) ; com.google.gerrit.server.git.LocalDiskRepositoryManager newRepoManager = new com.google.gerrit.server.git.LocalDiskRepositoryManager ( site , cfg ) ; newRepoManager.createRepository ( new com.google.gerrit.reviewdb.client.Project.NameKey ( "A" ) ) ; }
Source:
public void byProjectPrefix ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo1 = createProject ( "repo1" ) ; org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo2 = createProject ( "repo2" ) ; com.google.gerrit.reviewdb.client.Change change1 = insert ( newChange ( repo1 ) ) ; com.google.gerrit.reviewdb.client.Change change2 = insert ( newChange ( repo2 ) ) ; assertQuery ( "projects:foo" ) ; assertQuery ( "projects:repo1" , change1 ) ; assertQuery ( "projects:repo2" , change2 ) ; assertQuery ( "projects:repo" , change2 , change1 ) ; }

Target:
public void byProjectPrefix ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo1 = createProject ( "repo1" ) ; org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo2 = createProject ( "repo2" ) ; com.google.gerrit.reviewdb.client.Change change1 = insert ( repo1 , newChange ( repo1 ) ) ; com.google.gerrit.reviewdb.client.Change change2 = insert ( repo2 , newChange ( repo2 ) ) ; assertQuery ( "projects:foo" ) ; assertQuery ( "projects:repo1" , change1 ) ; assertQuery ( "projects:repo2" , change2 ) ; assertQuery ( "projects:repo" , change2 , change1 ) ; }
Source:
private com.google.gerrit.server.config.GetServerInfo.GitWebInfo getGitWebInfo ( com.google.gerrit.server.config.GitWebConfig cfg ) { return ( ( cfg.getUrl ( ) ) != null ) && ( ( cfg.getGitWebType ( ) ) != null ) ? new com.google.gerrit.server.config.GetServerInfo.GitWebInfo ( cfg ) : null ; }

Target:
private com.google.gerrit.server.config.GetServerInfo.GitWebInfo getGitWebInfo ( com.google.gerrit.server.config.GitWebConfig cfg ) { if ( ( ( cfg.getUrl ( ) ) == null ) || ( ( cfg.getGitWebType ( ) ) == null ) ) { return null ; } com.google.gerrit.server.config.GetServerInfo.GitWebInfo info = new com.google.gerrit.server.config.GetServerInfo.GitWebInfo ( ) ; info.url = cfg.getUrl ( ) ; info.type = cfg.getGitWebType ( ) ; return info ; }
Source:
private com.google.gerrit.server.account.AuthResult byUserName ( final java.lang.String userName ) { try { final com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ; try { com.google.gerrit.reviewdb.client.AccountExternalId.Key key = new com.google.gerrit.reviewdb.client.AccountExternalId.Key ( com.google.gerrit.reviewdb.client.AccountExternalId.SCHEME_USERNAME , userName ) ; return auth ( db.accountExternalIds ( ) . get ( key ) ) ; } finally { db.close ( ) ; } } catch ( com.google.gwtorm.server.OrmException e ) { getServletContext ( ) . log ( "cannot query database" , e ) ; return null ; } }

Target:
private com.google.gerrit.server.account.AuthResult byUserName ( final java.lang.String userName ) { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { com.google.gerrit.reviewdb.client.AccountExternalId.Key key = new com.google.gerrit.reviewdb.client.AccountExternalId.Key ( com.google.gerrit.reviewdb.client.AccountExternalId.SCHEME_USERNAME , userName ) ; return auth ( db.accountExternalIds ( ) . get ( key ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { getServletContext ( ) . log ( "cannot query database" , e ) ; return null ; } }
Source:
public void addRemoveMember ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = PUT ( "/groups/Administrators/members/user" ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_CREATED , r.getStatusCode ( ) ) ; com.google.gerrit.extensions.common.AccountInfo ai = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.AccountInfo.class ) ; com.google.gerrit.acceptance.rest.account.AccountAssert.assertAccountInfo ( user , ai ) ; assertMembers ( "Administrators" , admin , user ) ; r.consume ( ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_NO_CONTENT , DELETE ( "/groups/Administrators/members/user" ) ) ; assertMembers ( "Administrators" , admin ) ; }

Target:
public void addRemoveMember ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = PUT ( "/groups/Administrators/members/user" ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_CREATED ) ; com.google.gerrit.extensions.common.AccountInfo ai = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.AccountInfo.class ) ; com.google.gerrit.acceptance.rest.account.AccountAssert.assertAccountInfo ( user , ai ) ; assertMembers ( "Administrators" , admin , user ) ; r.consume ( ) ; com.google.common.truth.Truth.assertThat ( DELETE ( "/groups/Administrators/members/user" ) ) . isEqualTo ( HttpStatus.SC_NO_CONTENT ) ; assertMembers ( "Administrators" , admin ) ; }
Source:
public com.google.gerrit.testutil.TestNotesMigration setFromEnv ( ) { switch ( com.google.gerrit.testutil.NoteDbMode.get ( ) ) { case READ_WRITE : setWriteChanges ( true ) ; setReadChanges ( true ) ; break ; case WRITE : setWriteChanges ( true ) ; setReadChanges ( false ) ; break ; case CHECK : case OFF : default : break ; } return this ; }

Target:
public com.google.gerrit.testutil.TestNotesMigration setFromEnv ( ) { switch ( com.google.gerrit.testutil.NoteDbMode.get ( ) ) { case READ_WRITE : setWriteChanges ( true ) ; setReadChanges ( true ) ; break ; case WRITE : setWriteChanges ( true ) ; setReadChanges ( false ) ; break ; case CHECK : case OFF : default : setWriteChanges ( false ) ; setReadChanges ( false ) ; break ; } return this ; }
Source:
public void testReplaceTwoLinks ( ) { com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.html ( "A\nissue 42\nissue 9918\nB" ) ; com.google.gwtexpui.safehtml.client.SafeHtml n = o.replaceAll ( com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.repls ( new com.google.gwtexpui.safehtml.client.RawFindReplace ( "(issue\\s(\\d+))" , "<a href=\"?$2\">$1</a>" ) ) ) ; assertNotSame ( o , n ) ; assertEquals ( ( "A\n" + ( ( "<a href=\"?42\">issue 42</a>\n" + "<a href=\"?9918\">issue 9918</a>\n" ) + "B" ) ) , n.asString ( ) ) ; }

Target:
public void testReplaceTwoLinks ( ) { com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.html ( "A\nissue 42\nissue 9918\nB" ) ; com.google.gwtexpui.safehtml.client.SafeHtml n = o.replaceAll ( com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.repls ( new com.google.gwtexpui.safehtml.client.RawFindReplace ( "(issue\\s(\\d+))" , "<a href=\"?$2\">$1</a>" ) ) ) ; org.junit.Assert.assertNotSame ( o , n ) ; org.junit.Assert.assertEquals ( ( "A\n" + ( ( "<a href=\"?42\">issue 42</a>\n" + "<a href=\"?9918\">issue 9918</a>\n" ) + "B" ) ) , n.asString ( ) ) ; }
Source:
private void ccApprovals ( final boolean includeZero ) throws javax.mail.MessagingException { if ( ( db ) != null ) { try { for ( com.google.gerrit.client.reviewdb.ChangeApproval ap : db.changeApprovals ( ) . byChange ( change.getId ( ) ) ) { if ( ( ! includeZero ) && ( ( ap.getValue ( ) ) == 0 ) ) { continue ; } add ( RecipientType.CC , ap.getAccountId ( ) ) ; } } catch ( com.google.gwtorm.client.OrmException err ) { } } }

Target:
private void ccApprovals ( final boolean includeZero ) { if ( ( db ) != null ) { try { for ( com.google.gerrit.client.reviewdb.ChangeApproval ap : db.changeApprovals ( ) . byChange ( change.getId ( ) ) ) { if ( ( ! includeZero ) && ( ( ap.getValue ( ) ) == 0 ) ) { continue ; } add ( RecipientType.CC , ap.getAccountId ( ) ) ; } } catch ( com.google.gwtorm.client.OrmException err ) { } } }
Source:
protected synchronized void startThread ( final com.google.gerrit.sshd.BaseCommand.CommandRunnable thunk ) { final java.util.List < org.apache.sshd.server.Command > active = com.google.gerrit.sshd.SshScopes.getContext ( ) . session.getAttribute ( SshUtil.ACTIVE ) ; synchronized ( active ) { active.add ( this ) ; } final com.google.gerrit.sshd.BaseCommand.TaskThunk tt = new com.google.gerrit.sshd.BaseCommand.TaskThunk ( thunk ) ; if ( isAdminCommand ( ) ) { new java.lang.Thread ( tt , tt.toString ( ) ) . start ( ) ; } else { task = executor.submit ( tt ) ; } }

Target:
protected synchronized void startThread ( final com.google.gerrit.sshd.BaseCommand.CommandRunnable thunk ) { final com.google.gerrit.sshd.BaseCommand.TaskThunk tt = new com.google.gerrit.sshd.BaseCommand.TaskThunk ( thunk ) ; if ( isAdminCommand ( ) ) { new java.lang.Thread ( tt , tt.toString ( ) ) . start ( ) ; } else { task = executor.submit ( tt ) ; } }
Source:
public static com.google.gerrit.server.index.IndexConfig create ( int maxLimit , int maxPages , int maxTerms , int maxPrefixTerms ) { return new com.google.gerrit.server.index.AutoValue_IndexConfig ( com.google.gerrit.server.index.IndexConfig.checkLimit ( maxLimit , "maxLimit" , java.lang.Integer.MAX_VALUE ) , com.google.gerrit.server.index.IndexConfig.checkLimit ( maxPages , "maxPages" , java.lang.Integer.MAX_VALUE ) , com.google.gerrit.server.index.IndexConfig.checkLimit ( maxTerms , "maxTerms" , java.lang.Integer.MAX_VALUE ) , com.google.gerrit.server.index.IndexConfig.checkLimit ( maxPrefixTerms , "maxPrefixTerms" , com.google.gerrit.server.index.IndexConfig.DEFAULT_MAX_PREFIX_TERMS ) ) ; }

Target:
public static com.google.gerrit.server.index.IndexConfig create ( int maxLimit , int maxPages , int maxTerms ) { return new com.google.gerrit.server.index.AutoValue_IndexConfig ( com.google.gerrit.server.index.IndexConfig.checkLimit ( maxLimit , "maxLimit" , java.lang.Integer.MAX_VALUE ) , com.google.gerrit.server.index.IndexConfig.checkLimit ( maxPages , "maxPages" , java.lang.Integer.MAX_VALUE ) , com.google.gerrit.server.index.IndexConfig.checkLimit ( maxTerms , "maxTerms" , java.lang.Integer.MAX_VALUE ) ) ; }
Source:
public T load ( ) throws com.google.gwtorm.server.OrmException { if ( loaded ) { return self ( ) ; } if ( ! ( migration.enabled ( ) ) ) { loadDefaults ( ) ; return self ( ) ; } try ( org.eclipse.jgit.lib.Repository repo = repoManager.openMetadataRepository ( getProjectName ( ) ) ) { load ( repo ) ; loaded = true ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException | java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } return self ( ) ; }

Target:
public T load ( ) throws com.google.gwtorm.server.OrmException { if ( loaded ) { return self ( ) ; } if ( ( ! ( migration.enabled ( ) ) ) || ( ( changeId ) == null ) ) { loadDefaults ( ) ; return self ( ) ; } try ( org.eclipse.jgit.lib.Repository repo = repoManager.openMetadataRepository ( getProjectName ( ) ) ) { load ( repo ) ; loaded = true ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException | java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } return self ( ) ; }
Source:
private void initRepository ( ) throws java.io.IOException { if ( ( repo ) == null ) { this . repo = repoManager.openRepository ( project ) ; closeRepo = true ; inserter = repo.newObjectInserter ( ) ; revWalk = new org.eclipse.jgit.revwalk.RevWalk ( inserter.newReader ( ) ) ; commands = new com.google.gerrit.server.update.ChainedReceiveCommands ( repo ) ; } }

Target:
protected void initRepository ( ) throws java.io.IOException { if ( ( repo ) == null ) { this . repo = repoManager.openRepository ( project ) ; closeRepo = true ; inserter = repo.newObjectInserter ( ) ; revWalk = new org.eclipse.jgit.revwalk.RevWalk ( inserter.newReader ( ) ) ; commands = new com.google.gerrit.server.update.ChainedReceiveCommands ( repo ) ; } }
Source:
public java.util.List < com.google.gerrit.reviewdb.Patch > toPatchList ( final com.google.gerrit.reviewdb.PatchSet.Id setId ) { final java.util.ArrayList < com.google.gerrit.reviewdb.Patch > r = new java.util.ArrayList < com.google.gerrit.reviewdb.Patch > ( patches.length ) ; for ( final com.google.gerrit.server.patch.PatchListEntry e : patches ) { r.add ( e.toPatch ( setId ) ) ; } return r ; }

Target:
public java.util.List < com.google.gerrit.reviewdb.Patch > toPatchList ( final com.google.gerrit.reviewdb.PatchSet.Id setId ) { final java.util.ArrayList < com.google.gerrit.reviewdb.Patch > r = new java.util.ArrayList < com.google.gerrit.reviewdb.Patch > ( patches.size ( ) ) ; for ( final com.google.gerrit.server.patch.PatchListEntry e : patches ) { r.add ( e.toPatch ( setId ) ) ; } return r ; }
Source:
public org.eclipse.jgit.transport.ReceivePack create ( javax.servlet.http.HttpServletRequest req , org.eclipse.jgit.lib.Repository db ) throws org.eclipse.jgit.transport.resolver.ServiceNotAuthorizedException { final com.google.gerrit.server.project.ProjectControl pc = ( ( com.google.gerrit.server.project.ProjectControl ) ( req.getAttribute ( com.google.gerrit.httpd.GitOverHttpServlet.ATT_CONTROL ) ) ) ; if ( ! ( pc.getUser ( ) . isIdentifiedUser ( ) ) ) { throw new org.eclipse.jgit.transport.resolver.ServiceNotAuthorizedException ( ) ; } com.google.gerrit.server.git.receive.AsyncReceiveCommits arc = factory.create ( pc , db , com.google.common.collect.ImmutableSetMultimap.of ( ) ) ; org.eclipse.jgit.transport.ReceivePack rp = arc.getReceivePack ( ) ; req.setAttribute ( com.google.gerrit.httpd.GitOverHttpServlet.ATT_ARC , arc ) ; return rp ; }

Target:
public org.eclipse.jgit.transport.ReceivePack create ( javax.servlet.http.HttpServletRequest req , org.eclipse.jgit.lib.Repository db ) throws org.eclipse.jgit.transport.resolver.ServiceNotAuthorizedException { final com.google.gerrit.server.project.ProjectControl pc = ( ( com.google.gerrit.server.project.ProjectControl ) ( req.getAttribute ( com.google.gerrit.httpd.GitOverHttpServlet.ATT_CONTROL ) ) ) ; if ( ! ( pc.getUser ( ) . isIdentifiedUser ( ) ) ) { throw new org.eclipse.jgit.transport.resolver.ServiceNotAuthorizedException ( ) ; } com.google.gerrit.server.git.receive.AsyncReceiveCommits arc = factory.create ( pc , db , null , com.google.common.collect.ImmutableSetMultimap.of ( ) ) ; org.eclipse.jgit.transport.ReceivePack rp = arc.getReceivePack ( ) ; req.setAttribute ( com.google.gerrit.httpd.GitOverHttpServlet.ATT_ARC , arc ) ; return rp ; }
Source:
public SiteIndexer.Result indexAll ( final com.google.gerrit.server.index.account.AccountIndex index ) { org.eclipse.jgit.lib.ProgressMonitor progress = new org.eclipse.jgit.lib.TextProgressMonitor ( new java.io.PrintWriter ( progressOut ) ) ; progress.start ( 2 ) ; com.google.common.base.Stopwatch sw = com.google.common.base.Stopwatch.createStarted ( ) ; java.util.List < com.google.gerrit.reviewdb.client.Account.Id > ids ; try { ids = collectAccounts ( progress ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.index.account.AllAccountsIndexer.log.error ( "Error collecting accounts" , e ) ; return new com.google.gerrit.server.index.SiteIndexer.Result ( sw , false , 0 , 0 ) ; } return reindexAccounts ( index , ids , progress ) ; }

Target:
public SiteIndexer.Result indexAll ( final com.google.gerrit.server.index.account.AccountIndex index ) { org.eclipse.jgit.lib.ProgressMonitor progress = new org.eclipse.jgit.lib.TextProgressMonitor ( new java.io.PrintWriter ( progressOut ) ) ; progress.start ( 2 ) ; com.google.common.base.Stopwatch sw = com.google.common.base.Stopwatch.createStarted ( ) ; java.util.List < com.google.gerrit.reviewdb.client.Account.Id > ids ; try { ids = collectAccounts ( progress ) ; } catch ( java.io.IOException e ) { com.google.gerrit.server.index.account.AllAccountsIndexer.log.error ( "Error collecting accounts" , e ) ; return new com.google.gerrit.server.index.SiteIndexer.Result ( sw , false , 0 , 0 ) ; } return reindexAccounts ( index , ids , progress ) ; }
Source:
void onRefReplicatedToOneNode ( java.lang.String project , java.lang.String ref , org.eclipse.jgit.transport.URIish uri , com.googlesource.gerrit.plugins.replication.ReplicationState.RefPushResult status , org.eclipse.jgit.transport.RemoteRefUpdate.Status refStatus ) { com.googlesource.gerrit.plugins.replication.RefReplicatedEvent event = new com.googlesource.gerrit.plugins.replication.RefReplicatedEvent ( project , ref , com.googlesource.gerrit.plugins.replication.PushResultProcessing.resolveNodeName ( uri ) , status , refStatus ) ; postEvent ( project , ref , event ) ; }

Target:
void onRefReplicatedToOneNode ( java.lang.String project , java.lang.String ref , org.eclipse.jgit.transport.URIish uri , com.googlesource.gerrit.plugins.replication.ReplicationState.RefPushResult status , org.eclipse.jgit.transport.RemoteRefUpdate.Status refStatus ) { postEvent ( new com.googlesource.gerrit.plugins.replication.RefReplicatedEvent ( project , ref , com.googlesource.gerrit.plugins.replication.PushResultProcessing.resolveNodeName ( uri ) , status , refStatus ) ) ; }
Source:
public com.google.gerrit.server.project.ChangeControl changeControl ( ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { if ( ( changeControl ) == null ) { com.google.gerrit.reviewdb.client.Change c = change ( ) ; changeControl = changeControlFactory.controlFor ( c , userFactory.create ( c.getOwner ( ) ) ) ; } return changeControl ; }

Target:
public com.google.gerrit.server.project.ChangeControl changeControl ( ) throws com.google.gwtorm.server.OrmException { if ( ( changeControl ) == null ) { com.google.gerrit.reviewdb.client.Change c = change ( ) ; try { changeControl = changeControlFactory.controlFor ( c , userFactory.create ( c.getOwner ( ) ) ) ; } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } } return changeControl ; }
Source:
protected void configureServlets ( ) { install ( new com.google.gerrit.server.config.FactoryModule ( ) { @ java.lang.Override protected void configure ( ) { factory ( AgreementInfoFactory.Factory.class ) ; factory ( DeleteExternalIds.Factory.class ) ; factory ( ExternalIdDetailFactory.Factory.class ) ; factory ( GroupDetailHandler.Factory.class ) ; factory ( RegisterNewEmailSender.Factory.class ) ; } } ) ; rpc ( com.google.gerrit.httpd.rpc.account.AccountSecurityImpl.class ) ; rpc ( com.google.gerrit.httpd.rpc.account.AccountServiceImpl.class ) ; rpc ( com.google.gerrit.httpd.rpc.account.GroupAdminServiceImpl.class ) ; }

Target:
protected void configureServlets ( ) { install ( new com.google.gerrit.server.config.FactoryModule ( ) { @ java.lang.Override protected void configure ( ) { factory ( AgreementInfoFactory.Factory.class ) ; factory ( DeleteExternalIds.Factory.class ) ; factory ( ExternalIdDetailFactory.Factory.class ) ; factory ( RegisterNewEmailSender.Factory.class ) ; } } ) ; rpc ( com.google.gerrit.httpd.rpc.account.AccountSecurityImpl.class ) ; rpc ( com.google.gerrit.httpd.rpc.account.AccountServiceImpl.class ) ; }
Source:
private static com.google.gerrit.client.rpc.RestApi contentEditOrPs ( boolean editExists , com.google.gerrit.reviewdb.client.PatchSet.Id id , java.lang.String filename ) { return editExists ? com.google.gerrit.client.changes.ChangeFileApi.contentEdit ( id.getParentKey ( ) , filename ) : com.google.gerrit.client.changes.ChangeApi.revision ( id ) . view ( "files" ) . id ( filename ) . view ( "content" ) ; }

Target:
private static com.google.gerrit.client.rpc.RestApi contentEditOrPs ( com.google.gerrit.reviewdb.client.PatchSet.Id id , java.lang.String filename ) { return ( id.get ( ) ) == 0 ? com.google.gerrit.client.changes.ChangeFileApi.contentEdit ( id.getParentKey ( ) , filename ) : com.google.gerrit.client.changes.ChangeApi.revision ( id ) . view ( "files" ) . id ( filename ) . view ( "content" ) ; }
Source:
private void testGetAccount ( java.lang.String url , com.google.gerrit.acceptance.TestAccount expectedAccount ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = adminSession.get ( url ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; com.google.gerrit.acceptance.rest.account.AccountAssert.assertAccountInfo ( expectedAccount , newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.AccountInfo.class ) ) ; }

Target:
private void testGetAccount ( java.lang.String url , com.google.gerrit.acceptance.TestAccount expectedAccount ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = adminSession.get ( url ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; com.google.gerrit.acceptance.rest.account.AccountAssert.assertAccountInfo ( expectedAccount , newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.AccountInfo.class ) ) ; }
Source:
public boolean updateChange ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) { com.google.gerrit.reviewdb.client.Change change = ctx.getChange ( ) ; if ( ( change.getStatus ( ) ) == from ) { change.setStatus ( to ) ; ctx.saveChange ( ) ; return true ; } return false ; }

Target:
public boolean updateChange ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) { com.google.gerrit.reviewdb.client.Change change = ctx.getChange ( ) ; if ( ( change.getStatus ( ) ) == from ) { change.setStatus ( to ) ; return true ; } return false ; }
Source:
void onTabWidth ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.String > e ) { java.lang.String v = e.getValue ( ) ; if ( ( v != null ) && ( ( v.length ( ) ) > 0 ) ) { prefs.tabSize ( java.lang.Math.max ( 1 , java.lang.Integer.parseInt ( v ) ) ) ; view.getEditor ( ) . setOption ( "tabSize" , v ) ; } }

Target:
void onTabWidth ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.String > e ) { java.lang.String v = e.getValue ( ) ; if ( ( v != null ) && ( ( v.length ( ) ) > 0 ) ) { prefs.tabSize ( java.lang.Math.max ( 1 , java.lang.Integer.parseInt ( v ) ) ) ; if ( ( view ) != null ) { view.getEditor ( ) . setOption ( "tabSize" , v ) ; } } }
Source:
com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult post ( java.lang.String endpoint , java.lang.String content ) throws java.io.IOException { org.apache.http.client.methods.HttpPost post = new org.apache.http.client.methods.HttpPost ( ( ( peerInfo.getDirectUrl ( ) ) + endpoint ) ) ; if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( content ) ) ) { post.addHeader ( "Content-Type" , com.google.common.net.MediaType.JSON_UTF_8.toString ( ) ) ; post.setEntity ( new org.apache.http.entity.StringEntity ( content , java.nio.charset.StandardCharsets.UTF_8 ) ) ; } return httpClient.execute ( post , new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler ( ) ) ; }

Target:
com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult post ( java.lang.String endpoint , java.lang.String content ) throws java.io.IOException { org.apache.http.client.methods.HttpPost post = new org.apache.http.client.methods.HttpPost ( ( ( peerInfo.get ( ) . getDirectUrl ( ) ) + endpoint ) ) ; if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( content ) ) ) { post.addHeader ( "Content-Type" , com.google.common.net.MediaType.JSON_UTF_8.toString ( ) ) ; post.setEntity ( new org.apache.http.entity.StringEntity ( content , java.nio.charset.StandardCharsets.UTF_8 ) ) ; } return httpClient.execute ( post , new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler ( ) ) ; }
Source:
public com.google.gerrit.client.ui.InlineHyperlink getPreviousPatchLink ( int index , com.google.gerrit.client.patches.PatchScreen.Type patchType ) { int previousPatchIndex = getPreviousPatch ( index , PREFERENCE_VALIDATOR ) ; if ( previousPatchIndex < 0 ) { return null ; } return createLink ( previousPatchIndex , patchType , com.google.gwtexpui.safehtml.client.SafeHtml.asis ( Util.C.prevPatchLinkIcon ( ) ) , null ) ; }

Target:
public com.google.gerrit.client.ui.InlineHyperlink getPreviousPatchLink ( int index ) { int previousPatchIndex = getPreviousPatch ( index , PREFERENCE_VALIDATOR ) ; if ( previousPatchIndex < 0 ) { return null ; } return createLink ( previousPatchIndex , com.google.gwtexpui.safehtml.client.SafeHtml.asis ( Util.C.prevPatchLinkIcon ( ) ) , null ) ; }
Source:
private static com.google.gerrit.server.account.AccountState missing ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( accountId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; account.setActive ( false ) ; java.util.Collection < com.google.gerrit.reviewdb.client.AccountExternalId > ids = java.util.Collections.emptySet ( ) ; java.util.Collection < com.google.gerrit.reviewdb.client.AccountProjectWatch > projectWatches = java.util.Collections.emptySet ( ) ; java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > anon = com.google.common.collect.ImmutableSet.of ( ) ; return new com.google.gerrit.server.account.AccountState ( account , anon , ids , projectWatches ) ; }

Target:
private static com.google.gerrit.server.account.AccountState missing ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( accountId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; account.setActive ( false ) ; java.util.Collection < com.google.gerrit.reviewdb.client.AccountExternalId > ids = java.util.Collections.emptySet ( ) ; java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > anon = com.google.common.collect.ImmutableSet.of ( ) ; return new com.google.gerrit.server.account.AccountState ( account , anon , ids ) ; }
Source:
private void init ( java.lang.String project , java.lang.String branch , com.googlesource.gerrit.plugins.repositoryuse.RefUpdateHandlerFactory refUpdateHandlerFactory , com.google.gerrit.server.project.ProjectControl.GenericFactory p , com.google.gerrit.server.CurrentUser user , com.google.gerrit.server.git.GitRepositoryManager repoManager ) { this . project = project ; this . branch = branch ; this . refUpdateHandlerFactory = refUpdateHandlerFactory ; this . projectControl = p ; this . user = user ; this . repoManager = repoManager ; }

Target:
private void init ( java.lang.String project , java.lang.String branch , com.googlesource.gerrit.plugins.repositoryuse.RefUpdateHandlerFactory refUpdateHandlerFactory , com.google.gerrit.server.git.GitRepositoryManager repoManager ) { this . project = project ; this . branch = branch ; this . refUpdateHandlerFactory = refUpdateHandlerFactory ; this . repoManager = repoManager ; }
Source:
public void systemGroupsCreated_ssh ( ) throws com.jcraft.jsch.JSchException , java.io.IOException { com.google.gerrit.acceptance.SshSession session = new com.google.gerrit.acceptance.SshSession ( admin ) ; java.lang.String result = session.exec ( "gerrit ls-groups" ) ; org.junit.Assert.assertTrue ( result.contains ( "Administrators" ) ) ; org.junit.Assert.assertTrue ( result.contains ( "Anonymous Users" ) ) ; org.junit.Assert.assertTrue ( result.contains ( "Non-Interactive Users" ) ) ; org.junit.Assert.assertTrue ( result.contains ( "Project Owners" ) ) ; org.junit.Assert.assertTrue ( result.contains ( "Registered Users" ) ) ; session.close ( ) ; }

Target:
public void systemGroupsCreated_ssh ( ) throws com.jcraft.jsch.JSchException , java.io.IOException { com.google.gerrit.acceptance.SshSession session = new com.google.gerrit.acceptance.SshSession ( server , admin ) ; java.lang.String result = session.exec ( "gerrit ls-groups" ) ; org.junit.Assert.assertTrue ( result.contains ( "Administrators" ) ) ; org.junit.Assert.assertTrue ( result.contains ( "Anonymous Users" ) ) ; org.junit.Assert.assertTrue ( result.contains ( "Non-Interactive Users" ) ) ; org.junit.Assert.assertTrue ( result.contains ( "Project Owners" ) ) ; org.junit.Assert.assertTrue ( result.contains ( "Registered Users" ) ) ; session.close ( ) ; }
Source:
public java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > load ( java.lang.String username ) throws java.lang.Exception { final javax.naming.directory.DirContext ctx = helper.open ( ) ; try { return helper.queryForGroups ( ctx , username , null ) ; } finally { try { ctx.close ( ) ; } catch ( javax.naming.NamingException e ) { com.google.gerrit.server.auth.ldap.LdapRealm.log.warn ( "Cannot close LDAP query handle" , e ) ; } } }

Target:
public java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > load ( java.lang.String username ) throws java.lang.Exception { final javax.naming.directory.DirContext ctx = helper.open ( ) ; try { return helper.queryForGroups ( ctx , username , null ) ; } finally { helper.close ( ctx ) ; } }
Source:
public static com.google.gerrit.client.rpc.RestApi change ( @ com.google.gerrit.common.Nullable java.lang.String project , int id ) { if ( project == null ) { return new com.google.gerrit.client.rpc.RestApi ( "/changes/" ) . id ( java.lang.String.valueOf ( id ) ) ; } else { return new com.google.gerrit.client.rpc.RestApi ( "/changes/" ) . id ( project , id ) ; } }

Target:
public static com.google.gerrit.client.rpc.RestApi change ( @ com.google.gerrit.common.Nullable java.lang.String project , int id ) { if ( project == null ) { return new com.google.gerrit.client.rpc.RestApi ( "/changes/" ) . id ( java.lang.String.valueOf ( id ) ) ; } return new com.google.gerrit.client.rpc.RestApi ( "/changes/" ) . id ( project , id ) ; }
Source:
public void noConflictingChanges ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result change = createChange ( git , true ) ; createChange ( git , false ) ; java.util.Set < java.lang.String > changes = queryConflictingChanges ( change ) ; com.google.common.truth.Truth.assertThat ( ( ( java.lang.Iterable < ? > ) ( changes ) ) ) . isEmpty ( ) ; }

Target:
public void noConflictingChanges ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result change = createChange ( true ) ; createChange ( false ) ; java.util.Set < java.lang.String > changes = queryConflictingChanges ( change ) ; com.google.common.truth.Truth.assertThat ( ( ( java.lang.Iterable < ? > ) ( changes ) ) ) . isEmpty ( ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.pgm.http.jetty.JettyEnv.class ) . toInstance ( env ) ; bind ( com.google.gerrit.pgm.http.jetty.JettyServer.class ) ; install ( new com.google.gerrit.lifecycle.LifecycleModule ( ) { @ java.lang.Override protected void configure ( ) { listener ( ) . to ( JettyServer.Lifecycle.class ) ; } } ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.pgm.http.jetty.JettyEnv.class ) . toInstance ( env ) ; bind ( com.google.gerrit.pgm.http.jetty.JettyServer.class ) ; listener ( ) . to ( JettyServer.Lifecycle.class ) ; }
Source:
protected TestRepository < ? > . CommitBuilder amendBuilder ( ) throws java.lang.Exception { org.eclipse.jgit.lib.ObjectId head = testRepo.getRepository ( ) . getRef ( "HEAD" ) . getObjectId ( ) ; TestRepository < ? > . CommitBuilder b = testRepo.amendRef ( "HEAD" ) ; com.google.common.base.Optional < java.lang.String > id = com.google.gerrit.acceptance.GitUtil.getChangeId ( testRepo , head ) ; if ( id.isPresent ( ) ) { b.insertChangeId ( id.get ( ) . substring ( 1 ) ) ; } else { b.insertChangeId ( ) ; } return b ; }

Target:
protected TestRepository < ? > . CommitBuilder amendBuilder ( ) throws java.lang.Exception { org.eclipse.jgit.lib.ObjectId head = repo ( ) . getRef ( "HEAD" ) . getObjectId ( ) ; TestRepository < ? > . CommitBuilder b = testRepo.amendRef ( "HEAD" ) ; com.google.common.base.Optional < java.lang.String > id = com.google.gerrit.acceptance.GitUtil.getChangeId ( testRepo , head ) ; if ( id.isPresent ( ) ) { b.insertChangeId ( id.get ( ) . substring ( 1 ) ) ; } else { b.insertChangeId ( ) ; } return b ; }
Source:
public void testFindConflictingSubtree2 ( ) throws java.lang.Exception { changedPaths = com.google.common.collect.Sets.newHashSet ( "f2/sf1" , "F1/a" ) ; runCheck ( com.googlesource.gerrit.plugins.uploadvalidator.DuplicatePathnameValidatorTest.INITIAL_PATHNAMES , changedPaths , messages , vistedPaths ) ; com.google.common.truth.Truth.assertThat ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessages ( messages ) ) . containsExactly ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessage ( com.googlesource.gerrit.plugins.uploadvalidator.DuplicatePathnameValidator.conflict ( "F1" , "f1" ) ) , com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessage ( com.googlesource.gerrit.plugins.uploadvalidator.DuplicatePathnameValidator.conflict ( "f2/sf1" , "f2/sF1" ) ) ) ; com.google.common.truth.Truth.assertThat ( vistedPaths ) . containsExactlyElementsIn ( com.google.common.collect.ImmutableList.of ( "a" , "ab" , "f1" , "f2" , "f2/a" , "f2/ab" , "f2/sF1" ) ) ; }

Target:
public void testFindConflictingSubtree2 ( ) throws java.lang.Exception { changedPaths = com.google.common.collect.Sets.newHashSet ( "f2/sf1" , "F1/a" ) ; runCheck ( com.googlesource.gerrit.plugins.uploadvalidator.DuplicatePathnameValidatorTest.INITIAL_PATHNAMES , changedPaths , messages , vistedPaths ) ; com.google.common.truth.Truth.assertThat ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessages ( messages ) ) . containsExactly ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessage ( com.googlesource.gerrit.plugins.uploadvalidator.DuplicatePathnameValidator.conflict ( "F1" , "f1" ) ) , com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessage ( com.googlesource.gerrit.plugins.uploadvalidator.DuplicatePathnameValidator.conflict ( "f2/sf1" , "f2/sF1" ) ) ) ; com.google.common.truth.Truth.assertThat ( vistedPaths ) . containsExactly ( "a" , "ab" , "f1" , "f2" , "f2/a" , "f2/ab" , "f2/sF1" ) ; }
Source:
public boolean hasNext ( ) { if ( ( next ) != null ) { return true ; } if ( ! ( itr.hasNext ( ) ) ) { return false ; } com.google.gerrit.reviewdb.client.Project.NameKey r = itr.next ( ) ; if ( r.get ( ) . startsWith ( pfx ) ) { next = r ; return true ; } else { itr = java.util.Collections.< com.google.gerrit.reviewdb.client.Project.NameKey > emptyList ( ) . iterator ( ) ; return false ; } }

Target:
public boolean hasNext ( ) { if ( ( next ) != null ) { return true ; } if ( ! ( itr.hasNext ( ) ) ) { return false ; } com.google.gerrit.reviewdb.client.Project.NameKey r = itr.next ( ) ; if ( r.get ( ) . startsWith ( pfx ) ) { next = r ; return true ; } itr = java.util.Collections.< com.google.gerrit.reviewdb.client.Project.NameKey > emptyList ( ) . iterator ( ) ; return false ; }
Source:
public void run ( ) { int line = ( cm.extras ( ) . hasActiveLine ( ) ) ? cm.getLineNumber ( cm.extras ( ) . activeLine ( ) ) : 0 ; int res = java.util.Collections.binarySearch ( chunks , new com.google.gerrit.client.diff.UnifiedDiffChunkInfo ( cm.side ( ) , 0 , 0 , 0 , line , false ) , getDiffChunkComparatorCmLine ( ) ) ; diffChunkNavHelper ( chunks , host , res , dir ) ; }

Target:
public void run ( ) { int line = ( cm.extras ( ) . hasActiveLine ( ) ) ? cm.getLineNumber ( cm.extras ( ) . activeLine ( ) ) : 0 ; int res = java.util.Collections.binarySearch ( chunks , new com.google.gerrit.client.diff.UnifiedDiffChunkInfo ( cm.side ( ) , 0 , 0 , line , false ) , getDiffChunkComparatorCmLine ( ) ) ; diffChunkNavHelper ( chunks , host , res , dir ) ; }
Source:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.common.CommitInfo > apply ( com.google.gerrit.server.change.RevisionResource resource ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { try { com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.common.CommitInfo > r = com.google.gerrit.extensions.restapi.Response.ok ( json.toCommit ( resource.getPatchSet ( ) , resource.getChange ( ) . getProject ( ) , addLinks ) ) ; if ( resource.isCacheable ( ) ) { r.caching ( com.google.gerrit.extensions.restapi.CacheControl.PRIVATE ( 7 , java.util.concurrent.TimeUnit.DAYS ) ) ; } return r ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( e.getMessage ( ) ) ; } }

Target:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.common.CommitInfo > apply ( com.google.gerrit.server.change.RevisionResource resource ) throws com.google.gwtorm.server.OrmException { try { com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.common.CommitInfo > r = com.google.gerrit.extensions.restapi.Response.ok ( json.toCommit ( resource.getPatchSet ( ) , resource.getChange ( ) . getProject ( ) , addLinks ) ) ; if ( resource.isCacheable ( ) ) { r.caching ( com.google.gerrit.extensions.restapi.CacheControl.PRIVATE ( 7 , java.util.concurrent.TimeUnit.DAYS ) ) ; } return r ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } }
Source:
private void fireRefUpdated ( org.eclipse.jgit.lib.RefUpdate branchUpdate ) { gitRefUpdated.fire ( destBranch.getParentKey ( ) , branchUpdate ) ; com.google.gerrit.reviewdb.client.Account account = null ; com.google.gerrit.reviewdb.client.PatchSetApproval submitter = approvalsUtil.getSubmitter ( db , mergeTip.notes ( ) , mergeTip.getPatchsetId ( ) ) ; if ( submitter != null ) { account = accountCache.get ( submitter.getAccountId ( ) ) . getAccount ( ) ; } hooks.doRefUpdatedHook ( destBranch , branchUpdate , account ) ; }

Target:
private void fireRefUpdated ( org.eclipse.jgit.lib.RefUpdate branchUpdate ) { gitRefUpdated.fire ( destBranch.getParentKey ( ) , branchUpdate ) ; hooks.doRefUpdatedHook ( destBranch , branchUpdate , getAccount ( mergeTip ) ) ; }
Source:
public java.lang.String getStatusDescription ( ) { if ( ( exception ) != null ) { return getErrorDescription ( exception ) ; } else { switch ( status ) { case COMPLETE : return "Cloned (100%)" ; case CANCELLED : return "Cancelled" ; default : return ( ( ( ( ( "Phase-" + ( currTask ) ) + " / " ) + ( task ) ) + " (" ) + ( lastPercentage ) ) + "%)" ; } } }

Target:
public java.lang.String getStatusDescription ( ) { if ( ( exception ) != null ) { return getErrorDescription ( exception ) ; } else { switch ( status.getStatus ( ) ) { case COMPLETE : return "Cloned (100%)" ; case CANCELLED : return "Cancelled" ; default : return ( ( ( ( ( "Phase-" + ( currTask ) ) + " / " ) + ( task ) ) + " (" ) + ( lastPercentage ) ) + "%)" ; } } }
Source:
private void parsePostRequest ( final CallType call ) throws java.io.IOException , java.io.UnsupportedEncodingException { try { final com.google.gson.GsonBuilder gb = createGsonBuilder ( ) ; gb.registerTypeAdapter ( com.google.gwtjsonrpc.server.ActiveCall.class , new com.google.gwtjsonrpc.server.CallDeserializer < CallType > ( call , this ) ) ; gb.create ( ) . fromJson ( com.google.gwtjsonrpc.server.JsonServlet.readBody ( call ) , com.google.gwtjsonrpc.server.ActiveCall.class ) ; } catch ( com.google.gson.JsonParseException err ) { call.method = null ; call.params = null ; throw err ; } }

Target:
private void parsePostRequest ( final CallType call ) throws java.io.IOException , java.io.UnsupportedEncodingException { try { final com.google.gson.GsonBuilder gb = createGsonBuilder ( ) ; gb.registerTypeAdapter ( com.google.gwtjsonrpc.server.ActiveCall.class , new com.google.gwtjsonrpc.server.CallDeserializer < CallType > ( call , this ) ) ; gb.create ( ) . fromJson ( readBody ( call ) , com.google.gwtjsonrpc.server.ActiveCall.class ) ; } catch ( com.google.gson.JsonParseException err ) { call.method = null ; call.params = null ; throw err ; } }
Source:
private java.util.SortedSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > getScopes ( java.lang.String baseScopeKey , com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope ... scopes ) { java.util.HashSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > fullScopes = new java.util.HashSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > ( scopesForKey ( baseScopeKey ) ) ; fullScopes.addAll ( java.util.Arrays.asList ( scopes ) ) ; return new java.util.TreeSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > ( fullScopes ) ; }

Target:
private java.util.SortedSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > getScopes ( java.lang.String baseScopeKey , com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope ... scopes ) { java.util.HashSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > fullScopes = new java.util.HashSet ( scopesForKey ( baseScopeKey ) ) ; fullScopes.addAll ( java.util.Arrays.asList ( scopes ) ) ; return new java.util.TreeSet ( fullScopes ) ; }