auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean equals ( final java.lang.Object other ) { return ( ( getClass ( ) ) == ( other.getClass ( ) ) ) && ( getChildren ( ) . equals ( ( ( com.google.gerrit.server.query.Predicate < ? > ) ( other ) ) . getChildren ( ) ) ) ; }

Target:
public boolean equals ( final java.lang.Object other ) { if ( other == null ) return false ; return ( ( getClass ( ) ) == ( other.getClass ( ) ) ) && ( getChildren ( ) . equals ( ( ( com.google.gerrit.server.query.Predicate < ? > ) ( other ) ) . getChildren ( ) ) ) ; }
Source:
private static org.eclipse.jgit.revwalk.RevCommit createCommit ( org.eclipse.jgit.junit.TestRepository < ? > testRepo , java.lang.String message ) throws java.lang.Exception { return testRepo.branch ( "HEAD" ) . commit ( ) . message ( message ) . add ( "a.txt" , "content" ) . create ( ) ; BRANCH ( fcc660 ) ; version = $missing$ ; }

Target:
private static org.eclipse.jgit.revwalk.RevCommit createCommit ( org.eclipse.jgit.junit.TestRepository < ? > testRepo , java.lang.String message ) throws java.lang.Exception { return testRepo.branch ( "HEAD" ) . commit ( ) . message ( message ) . add ( "a.txt" , "content" ) . create ( ) ; }
Source:
private com.google.gerrit.extensions.common.CommentInfo getDraftComment ( java.lang.String changeId , java.lang.String revId , java.lang.String uuid ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = userSession.get ( ( ( ( ( ( "/changes/" + changeId ) + "/revisions/" ) + revId ) + "/drafts/" ) + uuid ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; return newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.CommentInfo.class ) ; }

Target:
private com.google.gerrit.extensions.common.CommentInfo getDraftComment ( java.lang.String changeId , java.lang.String revId , java.lang.String uuid ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = userSession.get ( ( ( ( ( ( "/changes/" + changeId ) + "/revisions/" ) + revId ) + "/drafts/" ) + uuid ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; return newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.CommentInfo.class ) ; }
Source:
public void afterRefUpdates ( ) throws com.google.gerrit.extensions.restapi.ResourceConflictException { if ( failAfterRefUpdates ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "Failing after ref updates" ) ; } for ( com.google.gerrit.server.git.strategy.SubmitStrategy strategy : strategies ) { com.google.gerrit.server.git.strategy.SubmitStrategy.Arguments args = strategy.args ; if ( args.mergeTip.getCurrentTip ( ) . equals ( args.mergeTip.getInitialTip ( ) ) ) { continue ; } com.google.gerrit.reviewdb.client.Account account = args.accountCache.get ( args.caller.getAccountId ( ) ) . getAccount ( ) ; args.hooks.doRefUpdatedHook ( args.destBranch , args.mergeTip.getInitialTip ( ) , args.mergeTip.getCurrentTip ( ) , account ) ; } }

Target:
public void afterRefUpdates ( ) throws com.google.gerrit.extensions.restapi.ResourceConflictException { if ( failAfterRefUpdates ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "Failing after ref updates" ) ; } for ( com.google.gerrit.server.git.strategy.SubmitStrategy strategy : strategies ) { com.google.gerrit.server.git.strategy.SubmitStrategy.Arguments args = strategy.args ; if ( args.mergeTip.getCurrentTip ( ) . equals ( args.mergeTip.getInitialTip ( ) ) ) { continue ; } args.hooks.doRefUpdatedHook ( args.destBranch , args.mergeTip.getInitialTip ( ) , args.mergeTip.getCurrentTip ( ) , args.accountCache.get ( args.caller.getAccountId ( ) ) . getAccount ( ) ) ; } }
Source:
private void updateAccountInNoteDb ( org.eclipse.jgit.lib.Repository allUsersRepo , com.google.gerrit.reviewdb.client.Account account ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.git.MetaDataUpdate md = new com.google.gerrit.server.git.MetaDataUpdate ( com.google.gerrit.server.extensions.events.GitReferenceUpdated.DISABLED , allUsersName , allUsersRepo ) ; org.eclipse.jgit.lib.PersonIdent ident = serverIdent.get ( ) ; md.getCommitBuilder ( ) . setAuthor ( ident ) ; md.getCommitBuilder ( ) . setCommitter ( ident ) ; com.google.gerrit.server.account.AccountConfig accountConfig = new com.google.gerrit.server.account.AccountConfig ( null , account.getId ( ) ) ; accountConfig.load ( allUsersRepo ) ; accountConfig.setAccount ( account ) ; accountConfig.commit ( md ) ; }

Target:
private void updateAccountInNoteDb ( org.eclipse.jgit.lib.Repository allUsersRepo , com.google.gerrit.reviewdb.client.Account account ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.git.MetaDataUpdate md = new com.google.gerrit.server.git.MetaDataUpdate ( com.google.gerrit.server.extensions.events.GitReferenceUpdated.DISABLED , allUsersName , allUsersRepo ) ; org.eclipse.jgit.lib.PersonIdent ident = serverIdent.get ( ) ; md.getCommitBuilder ( ) . setAuthor ( ident ) ; md.getCommitBuilder ( ) . setCommitter ( ident ) ; com.google.gerrit.server.account.AccountConfig accountConfig = new com.google.gerrit.server.account.AccountConfig ( account.getId ( ) ) ; accountConfig.load ( allUsersRepo ) ; accountConfig.setAccount ( account ) ; accountConfig.commit ( md ) ; }
Source:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.reviewdb.client.PatchSetApproval p : object.approvals ( ) ) { final com.google.gerrit.server.IdentifiedUser reviewer = userFactory.create ( dbProvider , p.getAccountId ( ) ) ; if ( reviewer.getEffectiveGroups ( ) . contains ( uuid ) ) { return true ; } } return false ; }

Target:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.reviewdb.client.PatchSetApproval p : object.approvals ( ) . values ( ) ) { final com.google.gerrit.server.IdentifiedUser reviewer = userFactory.create ( dbProvider , p.getAccountId ( ) ) ; if ( reviewer.getEffectiveGroups ( ) . contains ( uuid ) ) { return true ; } } return false ; }
Source:
private com.google.gerrit.server.query.change.ChangeData changeData ( ) { if ( ( cd ) == null ) { com.google.gerrit.reviewdb.server.ReviewDb reviewDb = db ( ) ; com.google.common.base.Preconditions.checkState ( ( reviewDb != null ) , "need ReviewDb" ) ; cd = changeDataFactory.create ( reviewDb , getNotes ( ) ) ; } return cd ; }

Target:
private com.google.gerrit.server.query.change.ChangeData changeData ( ) { if ( ( cd ) == null ) { com.google.gerrit.reviewdb.server.ReviewDb reviewDb = db ( ) ; com.google.common.base.Preconditions.checkState ( ( reviewDb != null ) , "need ReviewDb" ) ; cd = changeDataFactory.create ( reviewDb , notes ) ; } return cd ; }
Source:
static com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > create ( com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema , java.util.Collection < com.google.gerrit.reviewdb.client.Account.Id > ids ) throws com.google.gerrit.server.query.QueryParseException { if ( ( com.google.gerrit.server.query.change.IsReviewedPredicate.getField ( schema ) ) == ( com.google.gerrit.server.index.ChangeField.LEGACY_REVIEWED ) ) { throw new com.google.gerrit.server.query.QueryParseException ( "Only is:reviewed is supported" ) ; } java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > predicates = new java.util.ArrayList ( ids.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.Account.Id id : ids ) { predicates.add ( new com.google.gerrit.server.query.change.IsReviewedPredicate ( id ) ) ; } return com.google.gerrit.server.query.Predicate.or ( predicates ) ; }

Target:
static com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > create ( java.util.Collection < com.google.gerrit.reviewdb.client.Account.Id > ids ) { java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > predicates = new java.util.ArrayList ( ids.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.Account.Id id : ids ) { predicates.add ( new com.google.gerrit.server.query.change.IsReviewedPredicate ( id ) ) ; } return com.google.gerrit.server.query.Predicate.or ( predicates ) ; }
Source:
public void createEmptyChange_InvalidStatus ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo ci = newChangeInfo ( ChangeStatus.SUBMITTED ) ; com.google.gerrit.acceptance.RestResponse r = adminSession.post ( "/changes/" , ci ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_BAD_REQUEST , r.getStatusCode ( ) ) ; org.junit.Assert.assertTrue ( r.getEntityContent ( ) . contains ( "unsupported change status" ) ) ; }

Target:
public void createEmptyChange_InvalidStatus ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo ci = newChangeInfo ( ChangeStatus.SUBMITTED ) ; com.google.gerrit.acceptance.RestResponse r = adminSession.post ( "/changes/" , ci ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_BAD_REQUEST ) ; com.google.common.truth.Truth.assertThat ( r.getEntityContent ( ) ) . contains ( "unsupported change status" ) ; }
Source:
protected void configureServlets ( ) { install ( new com.google.gerrit.extensions.config.FactoryModule ( ) { @ java.lang.Override protected void configure ( ) { factory ( AgreementInfoFactory.Factory.class ) ; factory ( DeleteExternalIds.Factory.class ) ; factory ( ExternalIdDetailFactory.Factory.class ) ; } } ) ; rpc ( com.google.gerrit.httpd.rpc.account.AccountSecurityImpl.class ) ; rpc ( com.google.gerrit.httpd.rpc.account.AccountServiceImpl.class ) ; }

Target:
protected void configureServlets ( ) { install ( new com.google.gerrit.extensions.config.FactoryModule ( ) { @ java.lang.Override protected void configure ( ) { factory ( AgreementInfoFactory.Factory.class ) ; factory ( DeleteExternalIds.Factory.class ) ; factory ( ExternalIdDetailFactory.Factory.class ) ; } } ) ; rpc ( com.google.gerrit.httpd.rpc.account.AccountSecurityImpl.class ) ; }
Source:
public static boolean isValid ( java.lang.String addr ) { if ( ! ( com.google.gerrit.server.mail.OutgoingEmailValidator.initialized.getAndSet ( true ) ) ) { org.apache.commons.validator.routines.DomainValidator.updateTLDOverride ( org.apache.commons.validator.routines.DomainValidator.ArrayType.GENERIC_PLUS , new java.lang.String [ ] { "local" } ) ; } return org.apache.commons.validator.routines.EmailValidator.getInstance ( true , true ) . isValid ( addr ) ; }

Target:
public static boolean isValid ( java.lang.String addr ) { return org.apache.commons.validator.routines.EmailValidator.getInstance ( true , true ) . isValid ( addr ) ; }
Source:
public com.google.gerrit.reviewdb.client.AccountSshKey create ( com.google.gerrit.reviewdb.client.AccountSshKey.Id id , java.lang.String encoded ) throws com.google.gerrit.common.errors.InvalidSshKeyException { try { final com.google.gerrit.reviewdb.client.AccountSshKey key = new com.google.gerrit.reviewdb.client.AccountSshKey ( id , com.google.gerrit.sshd.SshUtil.toOpenSshPublicKey ( encoded ) ) ; com.google.gerrit.sshd.SshUtil.parse ( key ) ; return key ; } catch ( java.security.NoSuchAlgorithmException e ) { throw new com.google.gerrit.common.errors.InvalidSshKeyException ( ) ; } catch ( java.security.spec.InvalidKeySpecException e ) { throw new com.google.gerrit.common.errors.InvalidSshKeyException ( ) ; } catch ( java.security.NoSuchProviderException e ) { com.google.gerrit.sshd.SshKeyCacheImpl.log.error ( "Cannot parse SSH key" , e ) ; throw new com.google.gerrit.common.errors.InvalidSshKeyException ( ) ; } }

Target:
public com.google.gerrit.reviewdb.client.AccountSshKey create ( com.google.gerrit.reviewdb.client.AccountSshKey.Id id , java.lang.String encoded ) throws com.google.gerrit.common.errors.InvalidSshKeyException { try { final com.google.gerrit.reviewdb.client.AccountSshKey key = new com.google.gerrit.reviewdb.client.AccountSshKey ( id , com.google.gerrit.sshd.SshUtil.toOpenSshPublicKey ( encoded ) ) ; com.google.gerrit.sshd.SshUtil.parse ( key ) ; return key ; } catch ( java.security.NoSuchAlgorithmException | java.security.spec.InvalidKeySpecException e ) { throw new com.google.gerrit.common.errors.InvalidSshKeyException ( ) ; } catch ( java.security.NoSuchProviderException e ) { com.google.gerrit.sshd.SshKeyCacheImpl.log.error ( "Cannot parse SSH key" , e ) ; throw new com.google.gerrit.common.errors.InvalidSshKeyException ( ) ; } }
Source:
public static com.google.gerrit.server.config.ScheduleConfig.Builder builder ( org.eclipse.jgit.lib.Config config , java.lang.String section , @ com.google.gerrit.common.Nullable java.lang.String subsection ) { return new com.google.gerrit.server.config.AutoValue_ScheduleConfig.Builder ( ) . setNow ( java.time.ZonedDateTime.now ( java.time.ZoneId.systemDefault ( ) ) ) . setKeyInterval ( com.google.gerrit.server.config.ScheduleConfig.KEY_INTERVAL ) . setKeyStartTime ( com.google.gerrit.server.config.ScheduleConfig.KEY_STARTTIME ) . setConfig ( config ) . setSection ( section ) . setSubsection ( subsection ) ; }

Target:
public static com.google.gerrit.server.config.ScheduleConfig.Builder builder ( org.eclipse.jgit.lib.Config config , java.lang.String section ) { return new com.google.gerrit.server.config.AutoValue_ScheduleConfig.Builder ( ) . setNow ( java.time.ZonedDateTime.now ( java.time.ZoneId.systemDefault ( ) ) ) . setKeyInterval ( com.google.gerrit.server.config.ScheduleConfig.KEY_INTERVAL ) . setKeyStartTime ( com.google.gerrit.server.config.ScheduleConfig.KEY_STARTTIME ) . setConfig ( config ) . setSection ( section ) ; }
Source:
public void testChildHashCode ( ) { final java.lang.String pName = "foo" ; final java.lang.String cName = "bar" ; final com.google.gwtorm.client.StringKeyTestCase.Parent p = new com.google.gwtorm.client.StringKeyTestCase.Parent ( pName ) ; final com.google.gwtorm.client.StringKeyTestCase.Child c = new com.google.gwtorm.client.StringKeyTestCase.Child ( p , cName ) ; assertSame ( p , c.getParentKey ( ) ) ; assertTrue ( ( ( cName.hashCode ( ) ) != ( c.hashCode ( ) ) ) ) ; }

Target:
public void testChildHashCode ( ) { final java.lang.String pName = "foo" ; final java.lang.String cName = "bar" ; final com.google.gwtorm.client.StringKeyTestCase.Parent p = new com.google.gwtorm.client.StringKeyTestCase.Parent ( pName ) ; final com.google.gwtorm.client.StringKeyTestCase.Child c = new com.google.gwtorm.client.StringKeyTestCase.Child ( p , cName ) ; org.junit.Assert.assertSame ( p , c.getParentKey ( ) ) ; org.junit.Assert.assertTrue ( ( ( cName.hashCode ( ) ) != ( c.hashCode ( ) ) ) ) ; }
Source:
public void testChangeIdAfterBugOrIssue ( ) throws java.lang.Exception { assertEquals ( ( ( "a\n" + ( ( "\n" + "Bug: 42\n" ) + "Change-Id: I8c0321227c4324e670b9ae8cf40eccc87af21b1b\n" ) ) + ( SOB1 ) ) , call ( ( ( "a\n" + ( "\n" + "Bug: 42\n" ) ) + ( SOB1 ) ) ) ) ; assertEquals ( ( ( "a\n" + ( ( "\n" + "Issue: 42\n" ) + "Change-Id: Ie66e07d89ae5b114c0975b49cf326e90331dd822\n" ) ) + ( SOB1 ) ) , call ( ( ( "a\n" + ( "\n" + "Issue: 42\n" ) ) + ( SOB1 ) ) ) ) ; }

Target:
public void testChangeIdAfterBugOrIssue ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( ( ( "a\n" + ( ( "\n" + "Bug: 42\n" ) + "Change-Id: I8c0321227c4324e670b9ae8cf40eccc87af21b1b\n" ) ) + ( SOB1 ) ) , call ( ( ( "a\n" + ( "\n" + "Bug: 42\n" ) ) + ( SOB1 ) ) ) ) ; org.junit.Assert.assertEquals ( ( ( "a\n" + ( ( "\n" + "Issue: 42\n" ) + "Change-Id: Ie66e07d89ae5b114c0975b49cf326e90331dd822\n" ) ) + ( SOB1 ) ) , call ( ( ( "a\n" + ( "\n" + "Issue: 42\n" ) ) + ( SOB1 ) ) ) ) ; }
Source:
protected void configure ( ) { bind ( new com.google.inject.TypeLiteral < com.google.gwtorm.server.SchemaFactory < com.google.gerrit.reviewdb.server.ReviewDb > > ( ) { } ) . toInstance ( db ) ; bind ( com.google.gerrit.server.config.SitePaths.class ) . toInstance ( paths ) ; install ( new com.google.gerrit.server.schema.SchemaVersion.Module ( ) ) ; org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; cfg.setString ( "gerrit" , null , "basePath" , "git" ) ; cfg.setString ( "user" , null , "name" , "Gerrit Code Review" ) ; cfg.setString ( "user" , null , "email" , "gerrit@localhost" ) ; bind ( org.eclipse.jgit.lib.Config.class ) . annotatedWith ( com.google.gerrit.server.config.GerritServerConfig.class ) . toInstance ( cfg ) ; bind ( org.eclipse.jgit.lib.PersonIdent.class ) . annotatedWith ( com.google.gerrit.server.GerritPersonIdent.class ) . toProvider ( com.google.gerrit.server.GerritPersonIdentProvider.class ) ; bind ( com.google.gerrit.server.config.AllProjectsName.class ) . toInstance ( new com.google.gerrit.server.config.AllProjectsName ( "All-Projects" ) ) ; bind ( com.google.gerrit.server.git.GitRepositoryManager.class ) . to ( com.google.gerrit.server.git.LocalDiskRepositoryManager.class ) ; bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.server.config.AnonymousCowardName.class ) . toProvider ( com.google.gerrit.server.config.AnonymousCowardNameProvider.class ) ; bind ( com.google.gerrit.server.schema.DataSourceType.class ) . to ( com.google.gerrit.testutil.InMemoryH2Type.class ) ; }

Target:
protected void configure ( ) { bind ( new com.google.inject.TypeLiteral < com.google.gwtorm.server.SchemaFactory < com.google.gerrit.reviewdb.server.ReviewDb > > ( ) { } ) . toInstance ( db ) ; bind ( com.google.gerrit.server.config.SitePaths.class ) . toInstance ( paths ) ; install ( new com.google.gerrit.server.schema.SchemaVersion.Module ( ) ) ; org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; cfg.setString ( "user" , null , "name" , "Gerrit Code Review" ) ; cfg.setString ( "user" , null , "email" , "gerrit@localhost" ) ; bind ( org.eclipse.jgit.lib.Config.class ) . annotatedWith ( com.google.gerrit.server.config.GerritServerConfig.class ) . toInstance ( cfg ) ; bind ( org.eclipse.jgit.lib.PersonIdent.class ) . annotatedWith ( com.google.gerrit.server.GerritPersonIdent.class ) . toProvider ( com.google.gerrit.server.GerritPersonIdentProvider.class ) ; bind ( com.google.gerrit.server.config.AllProjectsName.class ) . toInstance ( new com.google.gerrit.server.config.AllProjectsName ( "All-Projects" ) ) ; bind ( com.google.gerrit.server.git.GitRepositoryManager.class ) . toInstance ( new com.google.gerrit.testutil.InMemoryRepositoryManager ( ) ) ; bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.server.config.AnonymousCowardName.class ) . toProvider ( com.google.gerrit.server.config.AnonymousCowardNameProvider.class ) ; bind ( com.google.gerrit.server.schema.DataSourceType.class ) . to ( com.google.gerrit.testutil.InMemoryH2Type.class ) ; }
Source:
public void display ( final com.google.gerrit.reviewdb.Patch.Key k , final com.google.gerrit.reviewdb.PatchSet.Id a , final com.google.gerrit.reviewdb.PatchSet.Id b , final com.google.gerrit.common.data.PatchScript s ) { patchKey = k ; idSideA = a ; idSideB = b ; final java.lang.String pathName = patchKey.get ( ) ; int ext = pathName.lastIndexOf ( '.' ) ; render ( s ) ; }

Target:
public void display ( final com.google.gerrit.reviewdb.Patch.Key k , final com.google.gerrit.reviewdb.PatchSet.Id a , final com.google.gerrit.reviewdb.PatchSet.Id b , final com.google.gerrit.common.data.PatchScript s ) { patchKey = k ; idSideA = a ; idSideB = b ; render ( s ) ; }
Source:
protected java.lang.Object createServiceHandle ( ) throws java.lang.Exception { final com.google.gerrit.server.GerritServer gs = com.google.gerrit.server.GerritServer.getInstance ( ) ; final com.google.gwtorm.client.SchemaFactory < com.google.gerrit.client.reviewdb.ReviewDb > rdf = gs.getDatabase ( ) ; final com.google.gerrit.client.data.GroupCache groups = gs.getGroupCache ( ) ; final com.google.gerrit.client.data.GerritConfig config = gs.getGerritConfig ( ) ; return new com.google.gerrit.client.changes.ChangeDetailServiceImpl ( rdf , groups , config ) ; }

Target:
protected java.lang.Object createServiceHandle ( ) throws java.lang.Exception { final com.google.gerrit.server.GerritServer gs = com.google.gerrit.server.GerritServer.getInstance ( ) ; final com.google.gwtorm.client.SchemaFactory < com.google.gerrit.client.reviewdb.ReviewDb > rdf = gs.getDatabase ( ) ; final com.google.gerrit.client.data.GroupCache groups = gs.getGroupCache ( ) ; return new com.google.gerrit.client.changes.ChangeDetailServiceImpl ( rdf , groups ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo info ) { info.revisions ( ) . copyKeysIntoChildren ( "name" ) ; com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.ChangeInfo.RevisionInfo > list = info.revisions ( ) . values ( ) ; com.google.gerrit.client.changes.ChangeInfo.RevisionInfo.sortRevisionInfoByNumber ( list ) ; diffTable.setUpPatchSetNav ( list , diff ) ; header.setChangeInfo ( info ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo info ) { info.revisions ( ) . copyKeysIntoChildren ( "name" ) ; com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.ChangeInfo.RevisionInfo > list = info.revisions ( ) . values ( ) ; com.google.gerrit.client.changes.ChangeInfo.RevisionInfo.sortRevisionInfoByNumber ( list ) ; diffTable.setUpPatchSetNav ( list , diff ) ; }
Source:
private void mockUnconnectableStoryboard ( ) { org.easymock.EasyMock.expect ( serverConfig.getString ( "its-storyboard" , null , "url" ) ) . andReturn ( "<no-url>" ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "its-storyboard" , null , "username" ) ) . andReturn ( "none" ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "its-storyboard" , null , "password" ) ) . andReturn ( "none" ) . anyTimes ( ) ; }

Target:
private void mockUnconnectableStoryboard ( ) { org.easymock.EasyMock.expect ( serverConfig.getString ( "its-storyboard" , null , "url" ) ) . andReturn ( "<no-url>" ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "its-storyboard" , null , "password" ) ) . andReturn ( "none" ) . anyTimes ( ) ; }
Source:
public static com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > open ( com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > dbProvider ) { java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > r = new java.util.ArrayList < > ( 4 ) ; for ( final com.google.gerrit.reviewdb.client.Change.Status e : Change.Status.values ( ) ) { if ( e.isOpen ( ) ) { r.add ( new com.google.gerrit.server.query.change.ChangeStatusPredicate ( e ) ) ; } } return ( r.size ( ) ) == 1 ? r.get ( 0 ) : or ( r ) ; }

Target:
public static com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > open ( ) { java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > r = new java.util.ArrayList < > ( 4 ) ; for ( final com.google.gerrit.reviewdb.client.Change.Status e : Change.Status.values ( ) ) { if ( e.isOpen ( ) ) { r.add ( new com.google.gerrit.server.query.change.ChangeStatusPredicate ( e ) ) ; } } return ( r.size ( ) ) == 1 ? r.get ( 0 ) : or ( r ) ; }
Source:
private org.eclipse.jgit.revwalk.RevCommit getHead ( org.eclipse.jgit.lib.Repository repo , java.lang.String name ) throws java.io.IOException { try { org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ; try { return rw.parseCommit ( repo.getRef ( name ) . getObjectId ( ) ) ; } finally { rw.release ( ) ; } } finally { repo.close ( ) ; } }

Target:
private org.eclipse.jgit.revwalk.RevCommit getHead ( org.eclipse.jgit.lib.Repository repo , java.lang.String name ) throws java.io.IOException { try { org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ; try { return rw.parseCommit ( repo.getRef ( name ) . getObjectId ( ) ) ; } finally { rw.close ( ) ; } } finally { repo.close ( ) ; } }
Source:
public void addReviewer ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.api.changes.AddReviewerInput in = new com.google.gerrit.extensions.api.changes.AddReviewerInput ( ) ; in.reviewer = user.email ; com.google.gerrit.extensions.api.changes.ChangeApi cApi = gApi.changes ( ) . id ( ( "p~master~" + ( r.getChangeId ( ) ) ) ) ; cApi.addReviewer ( in ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableSet.of ( user.id ) , com.google.gerrit.acceptance.api.change.ChangeIT.getReviewers ( cApi.get ( ) ) ) ; }

Target:
public void addReviewer ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.api.changes.AddReviewerInput in = new com.google.gerrit.extensions.api.changes.AddReviewerInput ( ) ; in.reviewer = user.email ; com.google.gerrit.extensions.api.changes.ChangeApi cApi = gApi.changes ( ) . id ( r.getChangeId ( ) ) ; cApi.addReviewer ( in ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableSet.of ( user.id ) , com.google.gerrit.acceptance.api.change.ChangeIT.getReviewers ( cApi.get ( ) ) ) ; }
Source:
public void init ( final javax.servlet.FilterConfig config ) throws javax.servlet.ServletException { this . config = config ; try { com.google.gerrit.server.GerritServer.getInstance ( ) ; } catch ( com.google.gwtorm.client.OrmException e ) { throw new javax.servlet.ServletException ( "Cannot initialize GerritServer" , e ) ; } catch ( com.google.gwtjsonrpc.server.XsrfException e ) { throw new javax.servlet.ServletException ( "Cannot initialize GerritServer" , e ) ; } }

Target:
public void init ( final javax.servlet.FilterConfig config ) { this . config = config ; }
Source:
protected void onLoad ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.lib.ObjectId rev = getRevision ( ) ; if ( rev == null ) { return ; } org.eclipse.jgit.revwalk.RevWalk walk = new org.eclipse.jgit.revwalk.RevWalk ( reader ) ; com.google.gerrit.server.notedb.DraftCommentNotes.Parser parser = new com.google.gerrit.server.notedb.DraftCommentNotes.Parser ( getChange ( ) , walk , rev , repoManager , draftsProject , author ) ; parser.parseDraftComments ( ) ; buildCommentTable ( draftBaseComments , parser.draftBaseComments ) ; buildCommentTable ( draftPsComments , parser.draftPsComments ) ; noteMap = parser.noteMap ; }

Target:
protected void onLoad ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.lib.ObjectId rev = getRevision ( ) ; if ( rev == null ) { return ; } org.eclipse.jgit.revwalk.RevWalk walk = new org.eclipse.jgit.revwalk.RevWalk ( reader ) ; com.google.gerrit.server.notedb.DraftCommentNotes.Parser parser = new com.google.gerrit.server.notedb.DraftCommentNotes.Parser ( getChangeId ( ) , walk , rev , repoManager , draftsProject , author ) ; parser.parseDraftComments ( ) ; buildCommentTable ( draftBaseComments , parser.draftBaseComments ) ; buildCommentTable ( draftPsComments , parser.draftPsComments ) ; noteMap = parser.noteMap ; }
Source:
public void testUnblockInLocalForceEditTopicName_Fails ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.REGISTERED ) ; assertFalse ( "u can't edit topic name" , u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) ; }

Target:
public void testUnblockInLocalForceEditTopicName_Fails ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.REGISTERED ) ; org.junit.Assert.assertFalse ( "u can't edit topic name" , u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) ; }
Source:
private static long parseSortKey ( com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema , java.lang.String value ) { com.google.gerrit.server.index.FieldDef < com.google.gerrit.server.query.change.ChangeData , ? > field = schema.getFields ( ) . get ( ChangeField.SORTKEY.getName ( ) ) ; if ( field == ( com.google.gerrit.server.index.ChangeField.SORTKEY ) ) { return com.google.gerrit.server.ChangeUtil.parseSortKey ( value ) ; } else { return com.google.gerrit.server.index.ChangeField.legacyParseSortKey ( value ) ; } }

Target:
private static long parseSortKey ( com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema , java.lang.String value ) { com.google.gerrit.server.index.FieldDef < com.google.gerrit.server.query.change.ChangeData , ? > field = schema.getFields ( ) . get ( com.google.gerrit.server.index.ChangeField.SORTKEY.getName ( ) ) ; if ( field == ( com.google.gerrit.server.index.ChangeField.SORTKEY ) ) { return com.google.gerrit.server.ChangeUtil.parseSortKey ( value ) ; } else { return com.google.gerrit.server.index.ChangeField.legacyParseSortKey ( value ) ; } }
Source:
private Account.Id user ( java.lang.String name , java.lang.String email ) { final com.google.gerrit.server.account.AccountState s = makeUser ( name , email ) ; org.easymock.EasyMock.expect ( accountCache.maybeGet ( org.easymock.EasyMock.eq ( s.getAccount ( ) . getId ( ) ) ) ) . andReturn ( java.util.Optional.of ( s ) ) ; return s.getAccount ( ) . getId ( ) ; }

Target:
private Account.Id user ( java.lang.String name , java.lang.String email ) { final com.google.gerrit.server.account.AccountState s = makeUser ( name , email ) ; org.easymock.EasyMock.expect ( accountCache.get ( org.easymock.EasyMock.eq ( s.getAccount ( ) . getId ( ) ) ) ) . andReturn ( java.util.Optional.of ( s ) ) ; return s.getAccount ( ) . getId ( ) ; }
Source:
public int compare ( com.google.gerrit.server.query.change.ChangeData a , com.google.gerrit.server.query.change.ChangeData b ) { try { return b.change ( db ) . getSortKey ( ) . compareTo ( a.change ( db ) . getSortKey ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { return 0 ; } }

Target:
public int compare ( com.google.gerrit.server.query.change.ChangeData a , com.google.gerrit.server.query.change.ChangeData b ) { try { return b.change ( ) . getSortKey ( ) . compareTo ( a.change ( ) . getSortKey ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { return 0 ; } }
Source:
public void run ( ) { try { com.google.gerrit.server.mail.CreateChangeSender cm = createChangeSenderFactory.create ( change ) ; cm.setFrom ( change.getOwner ( ) ) ; cm.setPatchSet ( patchSet , patchSetInfo ) ; cm.addReviewers ( reviewers ) ; cm.addExtraCC ( extraCC ) ; cm.send ( ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.change.ChangeInserter.log.error ( ( "Cannot send email for new change " + ( change.getId ( ) ) ) , e ) ; } }

Target:
public void run ( ) { try { com.google.gerrit.server.mail.CreateChangeSender cm = createChangeSenderFactory.create ( change.getId ( ) ) ; cm.setFrom ( change.getOwner ( ) ) ; cm.setPatchSet ( patchSet , patchSetInfo ) ; cm.addReviewers ( reviewers ) ; cm.addExtraCC ( extraCC ) ; cm.send ( ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.change.ChangeInserter.log.error ( ( "Cannot send email for new change " + ( change.getId ( ) ) ) , e ) ; } }
Source:
public boolean testRemoveReviewer ( com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.server.CurrentUser currentUser , com.google.gerrit.reviewdb.client.Account.Id reviewer , int value ) throws com.google.gerrit.server.permissions.PermissionBackendException , com.google.gerrit.server.project.NoSuchChangeException { if ( canRemoveReviewerWithoutPermissionCheck ( notes , currentUser , reviewer , value ) ) { return true ; } return permissionBackend.user ( currentUser ) . change ( notes ) . database ( dbProvider ) . test ( ChangePermission.REMOVE_REVIEWER ) ; }

Target:
public boolean testRemoveReviewer ( com.google.gerrit.server.query.change.ChangeData cd , com.google.gerrit.server.CurrentUser currentUser , com.google.gerrit.reviewdb.client.Account.Id reviewer , int value ) throws com.google.gerrit.server.permissions.PermissionBackendException , com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { if ( canRemoveReviewerWithoutPermissionCheck ( cd.change ( ) , currentUser , reviewer , value ) ) { return true ; } return permissionBackend.user ( currentUser ) . change ( cd ) . database ( dbProvider ) . test ( ChangePermission.REMOVE_REVIEWER ) ; }
Source:
public void submitWithFastForward ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit oldHead = getRemoteHead ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result change = createChange ( git ) ; submit ( change.getChangeId ( ) ) ; org.eclipse.jgit.revwalk.RevCommit head = getRemoteHead ( ) ; com.google.common.truth.Truth.assertThat ( head.getId ( ) ) . isEqualTo ( change.getCommitId ( ) ) ; com.google.common.truth.Truth.assertThat ( head.getParent ( 0 ) ) . isEqualTo ( oldHead ) ; assertSubmitter ( change.getChangeId ( ) , 1 ) ; }

Target:
public void submitWithFastForward ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit oldHead = getRemoteHead ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result change = createChange ( ) ; submit ( change.getChangeId ( ) ) ; org.eclipse.jgit.revwalk.RevCommit head = getRemoteHead ( ) ; com.google.common.truth.Truth.assertThat ( head.getId ( ) ) . isEqualTo ( change.getCommitId ( ) ) ; com.google.common.truth.Truth.assertThat ( head.getParent ( 0 ) ) . isEqualTo ( oldHead ) ; assertSubmitter ( change.getChangeId ( ) , 1 ) ; }
Source:
private java.util.List < com.google.gerrit.reviewdb.RefRight > filter ( java.util.Collection < com.google.gerrit.reviewdb.RefRight > all , com.google.gerrit.reviewdb.ApprovalCategory.Id actionId ) { java.util.List < com.google.gerrit.reviewdb.RefRight > mine = new java.util.ArrayList < com.google.gerrit.reviewdb.RefRight > ( all.size ( ) ) ; for ( com.google.gerrit.reviewdb.RefRight right : all ) { if ( ( com.google.gerrit.server.project.RefControl.matches ( getRefName ( ) , right.getRefPattern ( ) ) ) && ( right.getApprovalCategoryId ( ) . equals ( actionId ) ) ) { mine.add ( right ) ; } } return mine ; }

Target:
private java.util.List < com.google.gerrit.reviewdb.RefRight > filter ( java.util.Collection < com.google.gerrit.reviewdb.RefRight > all ) { java.util.List < com.google.gerrit.reviewdb.RefRight > mine = new java.util.ArrayList < com.google.gerrit.reviewdb.RefRight > ( all.size ( ) ) ; for ( com.google.gerrit.reviewdb.RefRight right : all ) { if ( com.google.gerrit.server.project.RefControl.matches ( getRefName ( ) , right.getRefPattern ( ) ) ) { mine.add ( right ) ; } } return mine ; }
Source:
private void set ( java.lang.String branch , org.eclipse.jgit.lib.ObjectId id ) throws java.io.IOException { final org.eclipse.jgit.lib.RefUpdate u = realDb.updateRef ( ( ( org.eclipse.jgit.lib.Constants.R_HEADS ) + branch ) ) ; u.setForceUpdate ( true ) ; u.setNewObjectId ( id ) ; switch ( u.update ( ) ) { case NEW : case FAST_FORWARD : case FORCED : break ; default : fail ( ( ( ( "unexpected update failure " + branch ) + " " ) + ( u.getResult ( ) ) ) ) ; } }

Target:
private void set ( java.lang.String branch , org.eclipse.jgit.lib.ObjectId id ) throws java.io.IOException { final org.eclipse.jgit.lib.RefUpdate u = realDb.updateRef ( ( ( org.eclipse.jgit.lib.Constants.R_HEADS ) + branch ) ) ; u.setForceUpdate ( true ) ; u.setNewObjectId ( id ) ; switch ( u.update ( ) ) { case NEW : case FAST_FORWARD : case FORCED : break ; default : org.junit.Assert.fail ( ( ( ( "unexpected update failure " + branch ) + " " ) + ( u.getResult ( ) ) ) ) ; } }
Source:
protected com.google.gerrit.client.reviewdb.ReviewDb openReviewDb ( ) throws com.google.gerrit.server.ssh.AbstractCommand.Failure { try { return com.google.gerrit.client.rpc.Common.getSchemaFactory ( ) . open ( ) ; } catch ( com.google.gwtorm.client.OrmException e ) { throw new com.google.gerrit.server.ssh.AbstractCommand.Failure ( 1 , "fatal: Gerrit database is offline" , e ) ; } }

Target:
protected com.google.gerrit.client.reviewdb.ReviewDb openReviewDb ( ) throws com.google.gerrit.server.ssh.AbstractCommand.Failure { if ( ( db ) == null ) { try { db = com.google.gerrit.client.rpc.Common.getSchemaFactory ( ) . open ( ) ; } catch ( com.google.gwtorm.client.OrmException e ) { throw new com.google.gerrit.server.ssh.AbstractCommand.Failure ( 1 , "fatal: Gerrit database is offline" , e ) ; } } return db ; }
Source:
void setMaxHeight ( int height ) { maxHeight = height - ( getTabBar ( ) . getOffsetHeight ( ) ) ; for ( int i = 0 ; i < ( getTabBar ( ) . getTabCount ( ) ) ; i ++ ) { tabs.get ( i ) . setMaxHeight ( maxHeight ) ; } }

Target:
void setMaxHeight ( int height ) { maxHeight = height - ( ( getTabBar ( ) . getOffsetHeight ( ) ) + 2 ) ; for ( int i = 0 ; i < ( getTabBar ( ) . getTabCount ( ) ) ; i ++ ) { tabs.get ( i ) . setMaxHeight ( maxHeight ) ; } }
Source:
private static java.util.TreeSet < java.lang.String > filterNonCore ( com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.actions.ActionInfo > m ) { java.util.TreeSet < java.lang.String > ids = new java.util.TreeSet < java.lang.String > ( m.keySet ( ) ) ; for ( java.lang.String id : com.google.gerrit.client.change.Actions.CORE ) { ids.remove ( id ) ; } return ids ; }

Target:
private static java.util.TreeSet < java.lang.String > filterNonCore ( com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.actions.ActionInfo > m ) { java.util.TreeSet < java.lang.String > ids = new java.util.TreeSet ( m.keySet ( ) ) ; for ( java.lang.String id : com.google.gerrit.client.change.Actions.CORE ) { ids.remove ( id ) ; } return ids ; }
Source:
protected void configure ( ) { factory ( RebaseChangeHandler.Factory.class ) ; factory ( ChangeDetailFactory.Factory.class ) ; factory ( IncludedInDetailFactory.Factory.class ) ; factory ( PatchSetDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; factory ( PublishAction.Factory.class ) ; factory ( DeleteDraftChange.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( RebaseChangeHandler.Factory.class ) ; factory ( ChangeDetailFactory.Factory.class ) ; factory ( IncludedInDetailFactory.Factory.class ) ; factory ( PatchSetDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; factory ( PublishAction.Factory.class ) ; }
Source:
public void createProjectWithGitSuffix ( ) throws java.lang.Exception { java.lang.String name = name ( "foo" ) ; com.google.common.truth.Truth.assertThat ( name ) . isEqualTo ( gApi.projects ( ) . create ( ( name + ".git" ) ) . get ( ) . name ) ; org.eclipse.jgit.revwalk.RevCommit head = getRemoteHead ( name , RefNames.REFS_CONFIG ) ; eventRecorder.assertRefUpdatedEvents ( name , RefNames.REFS_CONFIG , null , head ) ; eventRecorder.assertRefUpdatedEvents ( name , "refs/heads/master" , new java.lang.String [ ] { } ) ; }

Target:
public void createProjectWithGitSuffix ( ) throws java.lang.Exception { java.lang.String name = name ( "foo" ) ; com.google.common.truth.Truth.assertThat ( gApi.projects ( ) . create ( ( name + ".git" ) ) . get ( ) . name ) . isEqualTo ( name ) ; org.eclipse.jgit.revwalk.RevCommit head = getRemoteHead ( name , RefNames.REFS_CONFIG ) ; eventRecorder.assertRefUpdatedEvents ( name , RefNames.REFS_CONFIG , null , head ) ; eventRecorder.assertRefUpdatedEvents ( name , "refs/heads/master" , new java.lang.String [ ] { } ) ; }
Source:
public void testCreateProjectApi ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException { final java.lang.String newProjectName = "newProject" ; com.google.gerrit.extensions.api.projects.ProjectApi projectApi = gApi.projects ( ) . name ( newProjectName ) . create ( ) ; com.google.gerrit.extensions.common.ProjectInfo p = projectApi.get ( ) ; org.junit.Assert.assertEquals ( newProjectName , p.name ) ; com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( new com.google.gerrit.reviewdb.client.Project.NameKey ( newProjectName ) ) ; org.junit.Assert.assertNotNull ( projectState ) ; com.google.gerrit.acceptance.rest.project.ProjectAssert.assertProjectInfo ( projectState.getProject ( ) , p ) ; assertHead ( newProjectName , "refs/heads/master" ) ; }

Target:
public void testCreateProjectApi ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException { final java.lang.String newProjectName = "newProject" ; com.google.gerrit.extensions.common.ProjectInfo p = gApi.projects ( ) . name ( newProjectName ) . create ( ) . get ( ) ; org.junit.Assert.assertEquals ( newProjectName , p.name ) ; com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( new com.google.gerrit.reviewdb.client.Project.NameKey ( newProjectName ) ) ; org.junit.Assert.assertNotNull ( projectState ) ; com.google.gerrit.acceptance.rest.project.ProjectAssert.assertProjectInfo ( projectState.getProject ( ) , p ) ; assertHead ( newProjectName , "refs/heads/master" ) ; }
Source:
public com.google.gerrit.extensions.common.AccountInfo deleteAssignee ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.common.AccountInfo > r = deleteAssignee.apply ( change , null ) ; return r.isNone ( ) ? null : r.value ( ) ; } catch ( com.google.gerrit.server.git.UpdateException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot delete assignee" , e ) ; } }

Target:
public com.google.gerrit.extensions.common.AccountInfo deleteAssignee ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.common.AccountInfo > r = deleteAssignee.apply ( change , null ) ; return r.isNone ( ) ? null : r.value ( ) ; } catch ( com.google.gerrit.server.git.UpdateException | com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot delete assignee" , e ) ; } }
Source:
protected void run ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { try { com.google.gerrit.extensions.api.projects.BranchInput in = new com.google.gerrit.extensions.api.projects.BranchInput ( ) ; in.revision = revision ; gApi.projects ( ) . name ( project.getProject ( ) . getNameKey ( ) . get ( ) ) . branch ( name ) . create ( in ) ; } catch ( com.google.gerrit.extensions.restapi.RestApiException e ) { throw die ( e ) ; } }

Target:
protected void run ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { try { com.google.gerrit.extensions.api.projects.BranchInput in = new com.google.gerrit.extensions.api.projects.BranchInput ( ) ; in.revision = revision ; gApi.projects ( ) . name ( project.getName ( ) ) . branch ( name ) . create ( in ) ; } catch ( com.google.gerrit.extensions.restapi.RestApiException e ) { throw die ( e ) ; } }
Source:
public void tearDownInjector ( ) { lifecycle.stop ( ) ; requestContext.setContext ( null ) ; db.close ( ) ; com.google.gerrit.testutil.InMemoryDatabase.drop ( schemaFactory ) ; }

Target:
public void tearDownInjector ( ) { if ( ( lifecycle ) != null ) { lifecycle.stop ( ) ; } requestContext.setContext ( null ) ; if ( ( db ) != null ) { db.close ( ) ; } com.google.gerrit.testutil.InMemoryDatabase.drop ( schemaFactory ) ; }
Source:
private void writeBlobText ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , com.google.gitiles.PathServlet.WalkResult wr ) throws java.io.IOException { setModeHeader ( res , wr.type ) ; try ( java.io.Writer writer = startRenderText ( req , res , null ) ; java.io.OutputStream out = com.google.common.io.BaseEncoding.base64 ( ) . encodingStream ( writer ) ) { wr.getObjectReader ( ) . open ( wr.id ) . copyTo ( out ) ; } }

Target:
private void writeBlobText ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , com.google.gitiles.PathServlet.WalkResult wr ) throws java.io.IOException { setModeHeader ( res , wr.type ) ; try ( java.io.Writer writer = startRenderText ( req , res ) ; java.io.OutputStream out = com.google.common.io.BaseEncoding.base64 ( ) . encodingStream ( writer ) ) { wr.getObjectReader ( ) . open ( wr.id ) . copyTo ( out ) ; } }
Source:
private GitilesView.Builder parseShowCommand ( javax.servlet.http.HttpServletRequest req , java.lang.String repoName , java.lang.String path ) throws java.io.IOException { path = com.google.gitiles.ViewFilter.trimLeadingSlash ( path ) ; com.google.gitiles.RevisionParser.Result result = parseRevision ( req , path ) ; if ( result == null ) { return null ; } return parseShowCommand ( repoName , result , path ) ; }

Target:
private GitilesView.Builder parseShowCommand ( javax.servlet.http.HttpServletRequest req , java.lang.String repoName , java.lang.String path ) throws java.io.IOException { return parseShowCommand ( repoName , parseRevision ( req , path ) ) ; }
Source:
private static java.lang.String owner ( com.google.gerrit.client.account.AccountInfo ai ) { if ( ( ai.email ( ) ) != null ) { return ai.email ( ) ; } else if ( ( ai.name ( ) ) != null ) { return ai.name ( ) ; } else if ( ( ai._account_id ( ) ) != 0 ) { return "" + ( ai._account_id ( ) ) ; } else { return "" ; } }

Target:
public static java.lang.String owner ( com.google.gerrit.client.account.AccountInfo ai ) { if ( ( ai.email ( ) ) != null ) { return ai.email ( ) ; } else if ( ( ai.name ( ) ) != null ) { return ai.name ( ) ; } else if ( ( ai._account_id ( ) ) != 0 ) { return "" + ( ai._account_id ( ) ) ; } else { return "" ; } }
Source:
public void revisionActionsOneChangePerTopicUnapproved ( ) throws java.lang.Exception { java.lang.String changeId = createChangeWithTopic ( "foo1" ) . getChangeId ( ) ; java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > actions = getActions ( changeId ) ; com.google.common.truth.Truth.assertThat ( actions ) . containsKey ( "cherrypick" ) ; com.google.common.truth.Truth.assertThat ( actions ) . containsKey ( "rebase" ) ; com.google.common.truth.Truth.assertThat ( actions ) . hasSize ( 2 ) ; }

Target:
public void revisionActionsOneChangePerTopicUnapproved ( ) throws java.lang.Exception { java.lang.String changeId = createChangeWithTopic ( name ( "foo1" ) ) . getChangeId ( ) ; java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > actions = getActions ( changeId ) ; com.google.common.truth.Truth.assertThat ( actions ) . containsKey ( "cherrypick" ) ; com.google.common.truth.Truth.assertThat ( actions ) . containsKey ( "rebase" ) ; com.google.common.truth.Truth.assertThat ( actions ) . hasSize ( 2 ) ; }
Source:
public com.google.gerrit.reviewdb.Change update ( com.google.gerrit.reviewdb.Change change ) { if ( change.getStatus ( ) . isOpen ( ) ) { if ( ( destTopicName ) != null ) { change.setTopic ( ( destTopicName.isEmpty ( ) ? null : destTopicName ) ) ; } change.setStatus ( Change.Status.NEW ) ; change.setCurrentPatchSet ( result.info ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; return change ; } else { return null ; } }

Target:
public com.google.gerrit.reviewdb.Change update ( com.google.gerrit.reviewdb.Change change ) { if ( change.getStatus ( ) . isOpen ( ) ) { if ( ( destTopicName ) != null ) { change.setTopic ( destTopicName ) ; } change.setStatus ( Change.Status.NEW ) ; change.setCurrentPatchSet ( result.info ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; return change ; } else { return null ; } }