auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { final com.google.gerrit.reviewdb.client.Change change = object.change ( dbProvider ) ; if ( change == null ) { return false ; } final com.google.gerrit.server.IdentifiedUser owner = userFactory.create ( dbProvider , change.getOwner ( ) ) ; return owner.getEffectiveGroups ( ) . contains ( uuid ) ; }

Target:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { final com.google.gerrit.reviewdb.client.Change change = object.change ( ) ; if ( change == null ) { return false ; } final com.google.gerrit.server.IdentifiedUser owner = userFactory.create ( dbProvider , change.getOwner ( ) ) ; return owner.getEffectiveGroups ( ) . contains ( uuid ) ; }
Source:
protected void configure ( ) { factory ( EditCommitMessageHandler.Factory.class ) ; factory ( RebaseChangeHandler.Factory.class ) ; factory ( ChangeDetailFactory.Factory.class ) ; factory ( IncludedInDetailFactory.Factory.class ) ; factory ( PatchSetDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; factory ( SubmitAction.Factory.class ) ; factory ( PublishAction.Factory.class ) ; factory ( DeleteDraftChange.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( EditCommitMessageHandler.Factory.class ) ; 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 ) ; }
Source:
public void newPatchSetOnWipChangeSettingReadyInReviewDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%ready" , sc.owner ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . notTo ( sc.owner ) . to ( sc.reviewer , sc.ccer ) . to ( sc.reviewerByEmail ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; assertThat ( sender ) . notSent ( ) ; }

Target:
public void newPatchSetOnWipChangeSettingReadyInReviewDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%ready" , sc.owner ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . notTo ( sc.owner ) . to ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; assertThat ( sender ) . notSent ( ) ; }
Source:
public void onSuccess ( final com.google.gerrit.reviewdb.PatchLineComment result ) { if ( isNew ( ) ) { notifyDraftDelta ( 1 ) ; } comment = result ; text.setReadOnly ( false ) ; save.setEnabled ( true ) ; cancel.setEnabled ( true ) ; discard.setEnabled ( true ) ; render ( ) ; onSave.onSuccess ( VoidResult.INSTANCE ) ; }

Target:
public void onSuccess ( final com.google.gerrit.reviewdb.PatchLineComment result ) { notifyDraftDelta ( ( isNew ( ) ? 1 : 0 ) ) ; comment = result ; text.setReadOnly ( false ) ; save.setEnabled ( true ) ; cancel.setEnabled ( true ) ; discard.setEnabled ( true ) ; render ( ) ; onSave.onSuccess ( VoidResult.INSTANCE ) ; }
Source:
public void testUSER_NoPreferredEmailUser ( ) { setFrom ( "USER" ) ; final java.lang.String name = "A U. Thor" ; final com.google.gerrit.reviewdb.client.Account.Id user = user ( name , null ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( user ) ; assertNotNull ( r ) ; assertEquals ( name , r.name ) ; assertEquals ( ident.getEmailAddress ( ) , r.email ) ; org.easymock.EasyMock.verify ( accountCache ) ; }

Target:
public void testUSER_NoPreferredEmailUser ( ) { setFrom ( "USER" ) ; final java.lang.String name = "A U. Thor" ; final com.google.gerrit.reviewdb.client.Account.Id user = user ( name , null ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( user ) ; org.junit.Assert.assertNotNull ( r ) ; org.junit.Assert.assertEquals ( name , r.name ) ; org.junit.Assert.assertEquals ( ident.getEmailAddress ( ) , r.email ) ; org.easymock.EasyMock.verify ( accountCache ) ; }
Source:
private static java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > predicates ( com.google.gerrit.server.query.change.ChangeQueryBuilder.Arguments args , java.util.Set < com.google.gerrit.reviewdb.client.Change.Id > ids ) { java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > r = com.google.common.collect.Lists.newArrayListWithCapacity ( ids.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.Change.Id id : ids ) { r.add ( new com.google.gerrit.server.query.change.LegacyChangeIdPredicate ( args , id ) ) ; } return r ; }

Target:
private static java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > predicates ( java.util.Set < com.google.gerrit.reviewdb.client.Change.Id > ids ) { java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > r = com.google.common.collect.Lists.newArrayListWithCapacity ( ids.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.Change.Id id : ids ) { r.add ( new com.google.gerrit.server.query.change.LegacyChangeIdPredicate ( id ) ) ; } return r ; }
Source:
private void onLineTooLong ( final org.eclipse.jgit.lib.AbbreviatedObjectId id , java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > messagesList , final java.lang.String errorMessage ) throws com.google.gerrit.server.git.validators.CommitValidationException { final java.lang.String message = ( ( id.name ( ) ) + ": " ) + errorMessage ; if ( rejectTooLong ) { messagesList.add ( new com.google.gerrit.server.git.validators.CommitValidationMessage ( message , true ) ) ; throw new com.google.gerrit.server.git.validators.CommitValidationException ( "Commit length validation failed" , messagesList ) ; } else { messagesList.add ( new com.google.gerrit.server.git.validators.CommitValidationMessage ( ( "(W) " + message ) , false ) ) ; } }

Target:
private void onLineTooLong ( final org.eclipse.jgit.lib.AbbreviatedObjectId id , java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > messagesList , final java.lang.String errorMessage ) throws com.google.gerrit.server.git.validators.CommitValidationException { final java.lang.String message = ( ( id.name ( ) ) + ": " ) + errorMessage ; if ( rejectTooLong ) { messagesList.add ( new com.google.gerrit.server.git.validators.CommitValidationMessage ( message , true ) ) ; throw new com.google.gerrit.server.git.validators.CommitValidationException ( "Commit length validation failed" , messagesList ) ; } messagesList.add ( new com.google.gerrit.server.git.validators.CommitValidationMessage ( ( "(W) " + message ) , false ) ) ; }
Source:
public void maxPages ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change = insert ( newChange ( repo ) ) ; com.google.gerrit.extensions.api.changes.Changes.QueryRequest query = newQuery ( "status:new" ) . withLimit ( 10 ) ; assertQuery ( query , change ) ; assertQuery ( query.withStart ( 1 ) ) ; assertQuery ( query.withStart ( 99 ) ) ; assertBadQuery ( query.withStart ( 100 ) ) ; assertQuery ( query.withLimit ( 100 ) . withStart ( 100 ) ) ; }

Target:
public void maxPages ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change = insert ( repo , newChange ( repo ) ) ; com.google.gerrit.extensions.api.changes.Changes.QueryRequest query = newQuery ( "status:new" ) . withLimit ( 10 ) ; assertQuery ( query , change ) ; assertQuery ( query.withStart ( 1 ) ) ; assertQuery ( query.withStart ( 99 ) ) ; assertBadQuery ( query.withStart ( 100 ) ) ; assertQuery ( query.withLimit ( 100 ) . withStart ( 100 ) ) ; }
Source:
private com.google.gerrit.server.ReviewersUtil.VisibilityControl getVisibility ( final com.google.gerrit.server.change.ChangeResource rsrc ) { if ( rsrc.getControl ( ) . getRefControl ( ) . isVisibleByRegisteredUsers ( ) ) { return new com.google.gerrit.server.ReviewersUtil.VisibilityControl ( ) { @ java.lang.Override public boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Account.Id account ) throws com.google.gwtorm.server.OrmException { return true ; } } ; } else { return new com.google.gerrit.server.ReviewersUtil.VisibilityControl ( ) { @ java.lang.Override public boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Account.Id account ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.IdentifiedUser who = identifiedUserFactory.create ( account ) ; return rsrc.getControl ( ) . forUser ( who ) . isRefVisible ( ) ; } } ; } }

Target:
private com.google.gerrit.server.ReviewersUtil.VisibilityControl getVisibility ( final com.google.gerrit.server.change.ChangeResource rsrc ) { if ( rsrc.getControl ( ) . getRefControl ( ) . isVisibleByRegisteredUsers ( ) ) { return new com.google.gerrit.server.ReviewersUtil.VisibilityControl ( ) { @ java.lang.Override public boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Account.Id account ) throws com.google.gwtorm.server.OrmException { return true ; } } ; } return new com.google.gerrit.server.ReviewersUtil.VisibilityControl ( ) { @ java.lang.Override public boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Account.Id account ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.IdentifiedUser who = identifiedUserFactory.create ( account ) ; return rsrc.getControl ( ) . forUser ( who ) . isRefVisible ( ) ; } } ; }
Source:
private static java.util.Set < java.lang.String > parseShowBranch ( javax.servlet.http.HttpServletRequest req ) { java.util.Set < java.lang.String > branches = com.google.common.collect.Sets.newLinkedHashSet ( ) ; java.lang.String [ ] values = req.getParameterValues ( "show-branch" ) ; if ( values != null ) { branches.addAll ( java.util.Arrays.asList ( values ) ) ; } values = req.getParameterValues ( "b" ) ; if ( values != null ) { branches.addAll ( java.util.Arrays.asList ( values ) ) ; } return branches ; }

Target:
private static java.util.Set < java.lang.String > parseShowBranch ( javax.servlet.http.HttpServletRequest req ) { java.util.Set < java.lang.String > branches = com.google.common.collect.Sets.newLinkedHashSet ( ) ; java.lang.String [ ] values = req.getParameterValues ( "show-branch" ) ; if ( values != null ) { java.util.Collections.addAll ( branches , values ) ; } values = req.getParameterValues ( "b" ) ; if ( values != null ) { java.util.Collections.addAll ( branches , values ) ; } return branches ; }
Source:
public void queryChangesLimit ( ) throws java.lang.Exception { createChange ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r2 = createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = gApi.changes ( ) . query ( ) . withLimit ( 1 ) . get ( ) ; org.junit.Assert.assertEquals ( 1 , results.size ( ) ) ; org.junit.Assert.assertEquals ( r2.getChangeId ( ) , com.google.common.collect.Iterables.getOnlyElement ( results ) . changeId ) ; }

Target:
public void queryChangesLimit ( ) throws java.lang.Exception { createChange ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r2 = createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = gApi.changes ( ) . query ( ) . withLimit ( 1 ) . get ( ) ; com.google.common.truth.Truth.assertThat ( results.size ( ) ) . is ( 1 ) ; com.google.common.truth.Truth.assertThat ( com.google.common.collect.Iterables.getOnlyElement ( results ) . changeId ) . isEqualTo ( r2.getChangeId ( ) ) ; }
Source:
private com.google.gerrit.server.git.ReceiveCommits.RequestState requestState ( java.lang.Thread caller ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( caller == ( java.lang.Thread.currentThread ( ) ) ) { return new com.google.gerrit.server.git.ReceiveCommits.RequestState ( db , repo , rp.getRevWalk ( ) ) ; } else { return new com.google.gerrit.server.git.ReceiveCommits.RequestState ( project.getNameKey ( ) ) ; } }

Target:
private com.google.gerrit.server.git.ReceiveCommits.RequestState requestState ( java.lang.Thread caller ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( caller == ( java.lang.Thread.currentThread ( ) ) ) { return new com.google.gerrit.server.git.ReceiveCommits.RequestState ( db , repo , rp.getRevWalk ( ) ) ; } return new com.google.gerrit.server.git.ReceiveCommits.RequestState ( project.getNameKey ( ) ) ; }
Source:
private java.util.Set < com.google.gerrit.reviewdb.client.Account > listAccounts ( final com.google.gerrit.reviewdb.client.AccountGroup.UUID groupUUID , final com.google.gerrit.reviewdb.client.Project.NameKey project , final java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > seen ) throws com.google.gerrit.common.errors.NoSuchGroupException , com.google.gerrit.server.project.NoSuchProjectException , com.google.gwtorm.server.OrmException , java.io.IOException { if ( SystemGroupBackend.PROJECT_OWNERS.equals ( groupUUID ) ) { return getProjectOwners ( project , seen ) ; } else { com.google.gerrit.reviewdb.client.AccountGroup group = groupCache.get ( groupUUID ) ; if ( group != null ) { return getGroupMembers ( group , project , seen ) ; } else { return java.util.Collections.emptySet ( ) ; } } }

Target:
private java.util.Set < com.google.gerrit.reviewdb.client.Account > listAccounts ( final com.google.gerrit.reviewdb.client.AccountGroup.UUID groupUUID , final com.google.gerrit.reviewdb.client.Project.NameKey project , final java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > seen ) throws com.google.gerrit.common.errors.NoSuchGroupException , com.google.gerrit.server.project.NoSuchProjectException , com.google.gwtorm.server.OrmException , java.io.IOException { if ( SystemGroupBackend.PROJECT_OWNERS.equals ( groupUUID ) ) { return getProjectOwners ( project , seen ) ; } com.google.gerrit.reviewdb.client.AccountGroup group = groupCache.get ( groupUUID ) ; if ( group != null ) { return getGroupMembers ( group , project , seen ) ; } return java.util.Collections.emptySet ( ) ; }
Source:
public void replace ( com.google.gerrit.reviewdb.client.AccountGroup group ) throws java.io.IOException { try { replace ( com.google.gerrit.lucene.LuceneGroupIndex.idTerm ( group ) , toDocument ( group , null ) ) . get ( ) ; } catch ( java.util.concurrent.ExecutionException | java.lang.InterruptedException e ) { throw new java.io.IOException ( e ) ; } }

Target:
public void replace ( com.google.gerrit.reviewdb.client.AccountGroup group ) throws java.io.IOException { try { replace ( com.google.gerrit.lucene.LuceneGroupIndex.idTerm ( group ) , toDocument ( group ) ) . get ( ) ; } catch ( java.util.concurrent.ExecutionException | java.lang.InterruptedException e ) { throw new java.io.IOException ( e ) ; } }
Source:
public void testUploaderSkippedAsReviewer ( ) throws java.lang.Exception { java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > reviewers = resolver.resolve ( db , java.util.Collections.singleton ( user.email ) , project , change , gApi.accounts ( ) . id ( user.id.get ( ) ) . get ( ) ) ; com.google.common.truth.Truth.assertThat ( reviewers ) . isEmpty ( ) ; }

Target:
public void testUploaderSkippedAsReviewer ( ) throws java.lang.Exception { java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > reviewers = resolver.resolve ( java.util.Collections.singleton ( user.email ) , project , change , gApi.accounts ( ) . id ( user.id.get ( ) ) . get ( ) ) ; com.google.common.truth.Truth.assertThat ( reviewers ) . isEmpty ( ) ; }
Source:
static void configureHttpProxy ( ) throws java.net.MalformedURLException { final java.lang.String s = java.lang.System.getenv ( "http_proxy" ) ; if ( ( s == null ) || ( s.equals ( "" ) ) ) { return ; } final java.net.URL u = new java.net.URL ( ( ( s.indexOf ( "://" ) ) == ( - 1 ) ? "http://" + s : s ) ) ; if ( ! ( "http" . equals ( u.getProtocol ( ) ) ) ) { throw new java.net.MalformedURLException ( ( ( "Invalid http_proxy: " + s ) + ": Only http supported." ) ) ; } final java.lang.String proxyHost = u.getHost ( ) ; final int proxyPort = u.getPort ( ) ; java.lang.System.setProperty ( "http.proxyHost" , proxyHost ) ; if ( proxyPort > 0 ) { java.lang.System.setProperty ( "http.proxyPort" , java.lang.String.valueOf ( proxyPort ) ) ; } final java.lang.String userpass = u.getUserInfo ( ) ; if ( ( userpass != null ) && ( userpass.contains ( ":" ) ) ) { final int c = userpass.indexOf ( ':' ) ; final java.lang.String user = userpass.substring ( 0 , c ) ; final java.lang.String pass = userpass.substring ( ( c + 1 ) ) ; org.eclipse.jgit.util.CachedAuthenticator.add ( new org.eclipse.jgit.util.CachedAuthenticator.CachedAuthentication ( proxyHost , proxyPort , user , pass ) ) ; } }

Target:
static void configureHttpProxy ( ) throws java.net.MalformedURLException { final java.lang.String s = java.lang.System.getenv ( "http_proxy" ) ; if ( ( s == null ) || ( s.equals ( "" ) ) ) { return ; } final java.net.URL u = new java.net.URL ( ( ! ( s.contains ( "://" ) ) ? "http://" + s : s ) ) ; if ( ! ( "http" . equals ( u.getProtocol ( ) ) ) ) { throw new java.net.MalformedURLException ( ( ( "Invalid http_proxy: " + s ) + ": Only http supported." ) ) ; } final java.lang.String proxyHost = u.getHost ( ) ; final int proxyPort = u.getPort ( ) ; java.lang.System.setProperty ( "http.proxyHost" , proxyHost ) ; if ( proxyPort > 0 ) { java.lang.System.setProperty ( "http.proxyPort" , java.lang.String.valueOf ( proxyPort ) ) ; } final java.lang.String userpass = u.getUserInfo ( ) ; if ( ( userpass != null ) && ( userpass.contains ( ":" ) ) ) { final int c = userpass.indexOf ( ':' ) ; final java.lang.String user = userpass.substring ( 0 , c ) ; final java.lang.String pass = userpass.substring ( ( c + 1 ) ) ; org.eclipse.jgit.util.CachedAuthenticator.add ( new org.eclipse.jgit.util.CachedAuthenticator.CachedAuthentication ( proxyHost , proxyPort , user , pass ) ) ; } }
Source:
public void testChildren ( ) { final com.google.gerrit.server.query.AndPredicateTest.TestPredicate a = com.google.gerrit.server.query.AndPredicateTest.f ( "author" , "alice" ) ; final com.google.gerrit.server.query.AndPredicateTest.TestPredicate b = com.google.gerrit.server.query.AndPredicateTest.f ( "author" , "bob" ) ; final com.google.gerrit.server.query.Predicate < java.lang.String > n = com.google.gerrit.server.query.Predicate.and ( a , b ) ; assertEquals ( 2 , n.getChildCount ( ) ) ; assertSame ( a , n.getChild ( 0 ) ) ; assertSame ( b , n.getChild ( 1 ) ) ; }

Target:
public void testChildren ( ) { final com.google.gerrit.server.query.AndPredicateTest.TestPredicate a = com.google.gerrit.server.query.AndPredicateTest.f ( "author" , "alice" ) ; final com.google.gerrit.server.query.AndPredicateTest.TestPredicate b = com.google.gerrit.server.query.AndPredicateTest.f ( "author" , "bob" ) ; final com.google.gerrit.server.query.Predicate < java.lang.String > n = com.google.gerrit.server.query.Predicate.and ( a , b ) ; org.junit.Assert.assertEquals ( 2 , n.getChildCount ( ) ) ; org.junit.Assert.assertSame ( a , n.getChild ( 0 ) ) ; org.junit.Assert.assertSame ( b , n.getChild ( 1 ) ) ; }
Source:
private com.google.gerrit.reviewdb.client.Change submitToDatabase ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change change , final java.sql.Timestamp timestamp ) throws com.google.gwtorm.server.OrmException { return db.changes ( ) . atomicUpdate ( change.getId ( ) , new com.google.gwtorm.server.AtomicUpdate < com.google.gerrit.reviewdb.client.Change > ( ) { @ java.lang.Override public com.google.gerrit.reviewdb.client.Change update ( com.google.gerrit.reviewdb.client.Change change ) { if ( change.getStatus ( ) . isOpen ( ) ) { change.setStatus ( Change.Status.SUBMITTED ) ; change.setLastUpdatedOn ( timestamp ) ; return change ; } return null ; } } ) ; }

Target:
private com.google.gerrit.reviewdb.client.Change submitToDatabase ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change.Id changeId , final java.sql.Timestamp timestamp ) throws com.google.gwtorm.server.OrmException { return db.changes ( ) . atomicUpdate ( changeId , new com.google.gwtorm.server.AtomicUpdate < com.google.gerrit.reviewdb.client.Change > ( ) { @ java.lang.Override public com.google.gerrit.reviewdb.client.Change update ( com.google.gerrit.reviewdb.client.Change change ) { if ( change.getStatus ( ) . isOpen ( ) ) { change.setStatus ( Change.Status.SUBMITTED ) ; change.setLastUpdatedOn ( timestamp ) ; return change ; } return null ; } } ) ; }
Source:
private java.lang.String amendChange ( org.eclipse.jgit.api.Git git , org.eclipse.jgit.lib.PersonIdent ident , java.lang.String changeId ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , ident , PushOneCommit.SUBJECT , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME2 , new java.lang.String ( com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_NEW2 ) , changeId ) ; return push.to ( git , "refs/for/master" ) . getChangeId ( ) ; }

Target:
private java.lang.String amendChange ( org.eclipse.jgit.api.Git git , org.eclipse.jgit.lib.PersonIdent ident , java.lang.String changeId ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , ident , git , PushOneCommit.SUBJECT , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME2 , new java.lang.String ( com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_NEW2 ) , changeId ) ; return push.to ( "refs/for/master" ) . getChangeId ( ) ; }
Source:
boolean inCharacter ( com.googlecode.prolog_cafe.builtin.Term t ) { if ( ! ( t.isSymbol ( ) ) ) return false ; if ( t.equals ( com.googlecode.prolog_cafe.builtin.PRED_get_char_2.SYM_EOF ) ) return true ; return ( ( ( com.googlecode.prolog_cafe.builtin.SymbolTerm ) ( t ) ) . name ( ) . length ( ) ) == 1 ; }

Target:
boolean inCharacter ( com.googlecode.prolog_cafe.builtin.Term t ) { if ( ! ( t instanceof com.googlecode.prolog_cafe.builtin.SymbolTerm ) ) return false ; if ( t.equals ( com.googlecode.prolog_cafe.builtin.PRED_get_char_2.SYM_EOF ) ) return true ; return ( ( ( com.googlecode.prolog_cafe.builtin.SymbolTerm ) ( t ) ) . name ( ) . length ( ) ) == 1 ; }
Source:
public com.google.gerrit.server.account.GroupMembership membershipsOf ( com.google.gerrit.server.IdentifiedUser user ) { if ( ! ( helper.hasLdapConfiguration ( ) ) ) { return com.google.gerrit.server.account.GroupMembership.EMPTY ; } java.lang.String id = com.google.gerrit.server.auth.ldap.LdapGroupBackend.findId ( user.state ( ) . getExternalIds ( ) ) ; if ( id == null ) { return com.google.gerrit.server.account.GroupMembership.EMPTY ; } try { return new com.google.gerrit.server.account.ListGroupMembership ( membershipCache.get ( id ) ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.server.auth.ldap.LdapGroupBackend.log.warn ( java.lang.String.format ( "Cannot lookup membershipsOf %s in LDAP" , id ) , e ) ; return com.google.gerrit.server.account.GroupMembership.EMPTY ; } }

Target:
public com.google.gerrit.server.account.GroupMembership membershipsOf ( com.google.gerrit.server.IdentifiedUser user ) { java.lang.String id = com.google.gerrit.server.auth.ldap.LdapGroupBackend.findId ( user.state ( ) . getExternalIds ( ) ) ; if ( id == null ) { return com.google.gerrit.server.account.GroupMembership.EMPTY ; } try { return new com.google.gerrit.server.account.ListGroupMembership ( membershipCache.get ( id ) ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.server.auth.ldap.LdapGroupBackend.log.warn ( java.lang.String.format ( "Cannot lookup membershipsOf %s in LDAP" , id ) , e ) ; return com.google.gerrit.server.account.GroupMembership.EMPTY ; } }
Source:
public void testOpenRepositoryCreatedDirectlyOnDisk ( ) throws java.lang.Exception { createRepository ( repoManager.getBasePath ( ) , "projectA" ) ; com.google.gerrit.reviewdb.client.Project.NameKey projectA = new com.google.gerrit.reviewdb.client.Project.NameKey ( "projectA" ) ; try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( projectA ) ) { com.google.common.truth.Truth.assertThat ( repo ) . isNotNull ( ) ; } com.google.common.truth.Truth.assertThat ( ( ( java.lang.Iterable < ? > ) ( repoManager.list ( ) ) ) ) . containsExactly ( projectA ) ; }

Target:
public void testOpenRepositoryCreatedDirectlyOnDisk ( ) throws java.lang.Exception { createRepository ( repoManager.getBasePath ( ) , "projectA" ) ; com.google.gerrit.reviewdb.client.Project.NameKey projectA = new com.google.gerrit.reviewdb.client.Project.NameKey ( "projectA" ) ; try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( projectA ) ) { com.google.common.truth.Truth.assertThat ( repo ) . isNotNull ( ) ; } com.google.common.truth.Truth.assertThat ( repoManager.list ( ) ) . containsExactly ( projectA ) ; }
Source:
public com.googlecode.prolog_cafe.builtin.Operation exec ( com.googlecode.prolog_cafe.builtin.Prolog engine ) { com.googlecode.prolog_cafe.builtin.Term a1 ; a1 = arg1 ; a1 = a1.dereference ( ) ; if ( ! ( a1.isInteger ( ) ) ) { throw new com.googlecode.prolog_cafe.exceptions.IllegalTypeException ( "integer" , a1 ) ; } else { engine.cut ( ( ( com.googlecode.prolog_cafe.builtin.IntegerTerm ) ( a1 ) ) . intValue ( ) ) ; } return cont ; }

Target:
public com.googlecode.prolog_cafe.builtin.Operation exec ( com.googlecode.prolog_cafe.builtin.Prolog engine ) { com.googlecode.prolog_cafe.builtin.Term a1 ; a1 = arg1 ; a1 = a1.dereference ( ) ; if ( ! ( a1 instanceof com.googlecode.prolog_cafe.builtin.IntegerTerm ) ) { throw new com.googlecode.prolog_cafe.exceptions.IllegalTypeException ( "integer" , a1 ) ; } else { engine.cut ( ( ( com.googlecode.prolog_cafe.builtin.IntegerTerm ) ( a1 ) ) . intValue ( ) ) ; } return cont ; }
Source:
public void testGetAddressAccess ( ) throws java.lang.Exception { final com.google.gwtorm.data.PhoneBookDb schema = open ( ) ; assertNotNull ( schema.addresses ( ) ) ; assertEquals ( "addresses" , schema.addresses ( ) . getRelationName ( ) ) ; assertEquals ( 2 , schema.addresses ( ) . getRelationID ( ) ) ; }

Target:
public void testGetAddressAccess ( ) throws java.lang.Exception { final com.google.gwtorm.data.PhoneBookDb schema = open ( ) ; org.junit.Assert.assertNotNull ( schema.addresses ( ) ) ; org.junit.Assert.assertEquals ( "addresses" , schema.addresses ( ) . getRelationName ( ) ) ; org.junit.Assert.assertEquals ( 2 , schema.addresses ( ) . getRelationID ( ) ) ; }
Source:
public boolean updateGroupNames ( com.google.gerrit.server.account.GroupCache groupCache ) { boolean dirty = false ; for ( com.google.gerrit.common.data.GroupReference ref : groupsByUUID.values ( ) ) { com.google.gerrit.reviewdb.AccountGroup g = groupCache.get ( ref.getUUID ( ) ) ; if ( ( g != null ) && ( ! ( g.getName ( ) . equals ( ref.getName ( ) ) ) ) ) { dirty = true ; ref.setName ( g.getName ( ) ) ; } } return dirty ; }

Target:
public boolean updateGroupNames ( com.google.gerrit.server.account.GroupCache groupCache ) { boolean dirty = false ; for ( com.google.gerrit.common.data.GroupReference ref : groupsByUUID.values ( ) ) { com.google.gerrit.reviewdb.client.AccountGroup g = groupCache.get ( ref.getUUID ( ) ) ; if ( ( g != null ) && ( ! ( g.getName ( ) . equals ( ref.getName ( ) ) ) ) ) { dirty = true ; ref.setName ( g.getName ( ) ) ; } } return dirty ; }
Source:
void addLabel ( final java.lang.String token ) throws org.kohsuke.args4j.CmdLineException { com.google.gerrit.server.util.LabelVote v = com.google.gerrit.server.util.LabelVote.parse ( token ) ; try { com.google.gerrit.common.data.LabelType.checkName ( v.getLabel ( ) ) ; com.google.gerrit.server.ApprovalsUtil.checkLabel ( labelTypes , v.getLabel ( ) , v.getValue ( ) ) ; } catch ( java.lang.IllegalArgumentException e ) { throw clp.reject ( e.getMessage ( ) ) ; } labels.put ( v.getLabel ( ) , v.getValue ( ) ) ; }

Target:
void addLabel ( java.lang.String token ) throws org.kohsuke.args4j.CmdLineException { com.google.gerrit.server.util.LabelVote v = com.google.gerrit.server.util.LabelVote.parse ( token ) ; try { com.google.gerrit.common.data.LabelType.checkName ( v.label ( ) ) ; com.google.gerrit.server.ApprovalsUtil.checkLabel ( labelTypes , v.label ( ) , v.value ( ) ) ; } catch ( java.lang.IllegalArgumentException e ) { throw clp.reject ( e.getMessage ( ) ) ; } labels.put ( v.label ( ) , v.value ( ) ) ; }
Source:
public void run ( ) { try { final com.google.gerrit.server.mail.CreateChangeSender cm ; cm = createChangeSenderFactory.create ( change ) ; cm.setFrom ( me ) ; cm.setPatchSet ( ps , info ) ; cm.addReviewers ( reviewers ) ; cm.addExtraCC ( cc ) ; cm.send ( ) ; } catch ( com.google.gerrit.server.mail.EmailException e ) { com.google.gerrit.server.git.ReceiveCommits.log.error ( ( "Cannot send email for new change " + ( change.getId ( ) ) ) , e ) ; } }

Target:
public void run ( ) { try { final com.google.gerrit.server.mail.CreateChangeSender cm ; cm = createChangeSenderFactory.create ( change ) ; cm.setFrom ( me ) ; cm.setPatchSet ( ps , info ) ; cm.addReviewers ( reviewers ) ; cm.addExtraCC ( cc ) ; cm.send ( ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.git.ReceiveCommits.log.error ( ( "Cannot send email for new change " + ( change.getId ( ) ) ) , e ) ; } }
Source:
private com.google.gerrit.server.group.InternalGroup rebuild ( com.google.gerrit.server.group.InternalGroup group ) throws java.lang.Exception { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allUsers ) ) { rebuilder.rebuild ( repo , com.google.gerrit.server.group.db.GroupBundle.fromReviewDb ( db , group.getId ( ) ) ) ; com.google.gerrit.server.group.db.GroupConfig groupConfig = com.google.gerrit.server.group.db.GroupConfig.loadForGroup ( repo , group.getGroupUUID ( ) ) ; java.util.Optional < com.google.gerrit.server.group.InternalGroup > result = groupConfig.getLoadedGroup ( ) ; com.google.common.truth.Truth.assertThat ( result ) . isPresent ( ) ; return result.get ( ) ; } }

Target:
private com.google.gerrit.server.group.InternalGroup rebuild ( com.google.gerrit.server.group.InternalGroup group ) throws java.lang.Exception { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allUsers ) ) { rebuilder.rebuild ( repo , com.google.gerrit.server.group.db.GroupBundle.fromReviewDb ( db , group.getId ( ) ) , null ) ; com.google.gerrit.server.group.db.GroupConfig groupConfig = com.google.gerrit.server.group.db.GroupConfig.loadForGroup ( repo , group.getGroupUUID ( ) ) ; java.util.Optional < com.google.gerrit.server.group.InternalGroup > result = groupConfig.getLoadedGroup ( ) ; com.google.common.truth.Truth.assertThat ( result ) . isPresent ( ) ; return result.get ( ) ; } }
Source:
private static com.google.gerrit.reviewdb.client.AccountGroup missing ( com.google.gerrit.reviewdb.client.AccountGroup.Id key ) { com.google.gerrit.reviewdb.client.AccountGroup.NameKey name = new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( ( "Deleted Group" + key ) ) ; com.google.gerrit.reviewdb.client.AccountGroup g = new com.google.gerrit.reviewdb.client.AccountGroup ( name , key , null ) ; g.setType ( AccountGroup.Type.SYSTEM ) ; return g ; }

Target:
private static com.google.gerrit.reviewdb.client.AccountGroup missing ( com.google.gerrit.reviewdb.client.AccountGroup.Id key ) { com.google.gerrit.reviewdb.client.AccountGroup.NameKey name = new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( ( "Deleted Group" + key ) ) ; return new com.google.gerrit.reviewdb.client.AccountGroup ( name , key , null ) ; }
Source:
private com.google.gerrit.common.data.ChangeInfo newChangeInfo ( final com.google.gerrit.reviewdb.Change ac , java.util.Map < com.google.gerrit.reviewdb.Change.Id , com.google.gerrit.reviewdb.PatchSet.Id > ancestorPatchIds ) { aic.want ( ac.getOwner ( ) ) ; com.google.gerrit.common.data.ChangeInfo ci ; if ( ancestorPatchIds == null ) { ci = new com.google.gerrit.common.data.ChangeInfo ( ac ) ; } else { ci = new com.google.gerrit.common.data.ChangeInfo ( ac , ancestorPatchIds.get ( ac.getId ( ) ) ) ; } ci.setStarred ( isStarred ( ac ) ) ; return ci ; }

Target:
private com.google.gerrit.common.data.ChangeInfo newChangeInfo ( final com.google.gerrit.reviewdb.client.Change ac , java.util.Map < com.google.gerrit.reviewdb.client.Change.Id , com.google.gerrit.reviewdb.client.PatchSet.Id > ancestorPatchIds ) { aic.want ( ac.getOwner ( ) ) ; com.google.gerrit.common.data.ChangeInfo ci ; if ( ancestorPatchIds == null ) { ci = new com.google.gerrit.common.data.ChangeInfo ( ac ) ; } else { ci = new com.google.gerrit.common.data.ChangeInfo ( ac , ancestorPatchIds.get ( ac.getId ( ) ) ) ; } ci.setStarred ( isStarred ( ac ) ) ; return ci ; }
Source:
public com.google.gerrit.client.data.ChangeDetail run ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gerrit.client.changes.Failure , com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.Change change = db.changes ( ) . get ( id ) ; if ( change == null ) { throw new com.google.gerrit.client.changes.Failure ( new com.google.gerrit.client.rpc.NoSuchEntityException ( ) ) ; } final com.google.gerrit.client.workflow.RightRule rules = new com.google.gerrit.client.workflow.RightRule ( ) ; final com.google.gerrit.client.data.ChangeDetail d = new com.google.gerrit.client.data.ChangeDetail ( ) ; d.load ( db , new com.google.gerrit.client.data.AccountInfoCacheFactory ( db ) , rules , change ) ; return d ; }

Target:
public com.google.gerrit.client.data.ChangeDetail run ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gerrit.client.changes.Failure , com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.Change change = db.changes ( ) . get ( id ) ; if ( change == null ) { throw new com.google.gerrit.client.changes.Failure ( new com.google.gerrit.client.rpc.NoSuchEntityException ( ) ) ; } final com.google.gerrit.client.data.ChangeDetail d = new com.google.gerrit.client.data.ChangeDetail ( ) ; d.load ( db , new com.google.gerrit.client.data.AccountInfoCacheFactory ( db ) , change ) ; return d ; }
Source:
public java.util.List < java.lang.String > listPluginNames ( ) throws java.io.FileNotFoundException { java.util.List < java.lang.String > names = com.google.common.collect.Lists.newArrayList ( ) ; java.lang.String [ ] list = getPluginsDir ( ) . list ( ) ; if ( list != null ) { for ( java.lang.String pluginJarName : list ) { java.lang.String pluginName = pluginJarName.substring ( 0 , ( ( pluginJarName.length ( ) ) - ( com.google.gerrit.pgm.init.InitPlugins.JAR.length ( ) ) ) ) ; names.add ( pluginName ) ; } } return names ; }

Target:
public java.util.List < java.lang.String > listPluginNames ( ) throws java.io.FileNotFoundException { java.util.List < java.lang.String > names = new java.util.ArrayList < > ( ) ; java.lang.String [ ] list = getPluginsDir ( ) . list ( ) ; if ( list != null ) { for ( java.lang.String pluginJarName : list ) { java.lang.String pluginName = pluginJarName.substring ( 0 , ( ( pluginJarName.length ( ) ) - ( com.google.gerrit.pgm.init.InitPlugins.JAR.length ( ) ) ) ) ; names.add ( pluginName ) ; } } return names ; }
Source:
public com.google.gerrit.server.query.Predicate < com.google.gerrit.server.account.AccountState > rewrite ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.account.AccountState > in , com.google.gerrit.server.index.QueryOptions opts ) throws com.google.gerrit.server.query.QueryParseException { if ( ! ( com.google.gerrit.server.query.account.AccountPredicates.hasActive ( in ) ) ) { in = com.google.gerrit.server.query.Predicate.and ( in , com.google.gerrit.server.query.account.AccountPredicates.isActive ( ) ) ; } com.google.gerrit.server.index.account.AccountIndex index = indexes.getSearchIndex ( ) ; com.google.common.base.Preconditions.checkNotNull ( index , "no active search index configured for accounts" ) ; return new com.google.gerrit.server.index.account.IndexedAccountQuery ( index , in , opts ) ; }

Target:
public com.google.gerrit.server.query.Predicate < com.google.gerrit.server.account.AccountState > rewrite ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.account.AccountState > in , com.google.gerrit.server.index.QueryOptions opts ) throws com.google.gerrit.server.query.QueryParseException { com.google.gerrit.server.index.account.AccountIndex index = indexes.getSearchIndex ( ) ; com.google.common.base.Preconditions.checkNotNull ( index , "no active search index configured for accounts" ) ; return new com.google.gerrit.server.index.account.IndexedAccountQuery ( index , in , opts ) ; }
Source:
private void assertProblems ( com.google.gerrit.server.git.gpg.TestKey tk , java.lang.String ... expected ) throws java.lang.Exception { com.google.gerrit.server.git.gpg.CheckResult result = checker.check ( tk.getPublicKey ( ) , tk.getKeyId ( ) , tk.getFirstUserId ( ) ) ; org.junit.Assert.assertEquals ( java.util.Arrays.asList ( expected ) , result.getProblems ( ) ) ; }

Target:
private void assertProblems ( com.google.gerrit.server.git.gpg.TestKey tk , java.lang.String ... expected ) throws java.lang.Exception { com.google.gerrit.server.git.gpg.CheckResult result = checker.check ( tk.getPublicKey ( ) , tk.getKeyId ( ) ) ; org.junit.Assert.assertEquals ( java.util.Arrays.asList ( expected ) , result.getProblems ( ) ) ; }
Source:
public com.google.gerrit.server.ContactStore get ( ) { try { return new com.google.gerrit.server.EncryptedContactStore ( server ) ; } catch ( final com.google.gerrit.client.rpc.ContactInformationStoreException initError ) { return new com.google.gerrit.server.ContactStore ( ) { @ java.lang.Override public void store ( com.google.gerrit.client.reviewdb.Account account , com.google.gerrit.client.reviewdb.ContactInformation info ) throws com.google.gerrit.client.rpc.ContactInformationStoreException { throw initError ; } } ; } }

Target:
public com.google.gerrit.server.ContactStore get ( ) { try { return new com.google.gerrit.server.EncryptedContactStore ( server , schema ) ; } catch ( final com.google.gerrit.client.rpc.ContactInformationStoreException initError ) { return new com.google.gerrit.server.ContactStore ( ) { @ java.lang.Override public void store ( com.google.gerrit.client.reviewdb.Account account , com.google.gerrit.client.reviewdb.ContactInformation info ) throws com.google.gerrit.client.rpc.ContactInformationStoreException { throw initError ; } } ; } }
Source:
public void testProjectCreation ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey projectA = new com.google.gerrit.reviewdb.client.Project.NameKey ( "projectA" ) ; try ( org.eclipse.jgit.lib.Repository repo = repoManager.createRepository ( projectA ) ) { com.google.common.truth.Truth.assertThat ( repo ) . isNotNull ( ) ; } try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( projectA ) ) { com.google.common.truth.Truth.assertThat ( repo ) . isNotNull ( ) ; } com.google.common.truth.Truth.assertThat ( ( ( java.lang.Iterable < ? > ) ( repoManager.list ( ) ) ) ) . containsExactly ( projectA ) ; }

Target:
public void testProjectCreation ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey projectA = new com.google.gerrit.reviewdb.client.Project.NameKey ( "projectA" ) ; try ( org.eclipse.jgit.lib.Repository repo = repoManager.createRepository ( projectA ) ) { com.google.common.truth.Truth.assertThat ( repo ) . isNotNull ( ) ; } try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( projectA ) ) { com.google.common.truth.Truth.assertThat ( repo ) . isNotNull ( ) ; } com.google.common.truth.Truth.assertThat ( repoManager.list ( ) ) . containsExactly ( projectA ) ; }
Source:
public void newPatchSetByOtherOnReviewableChangeOwnerSelfCcNotifyOwnerReviewersInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%notify=OWNER_REVIEWERS" , other , EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . notTo ( sc.starrer , other ) . to ( sc.owner , sc.reviewer ) . to ( sc.reviewerByEmail ) . cc ( sc.ccer ) . cc ( sc.ccerByEmail ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }

Target:
public void newPatchSetByOtherOnReviewableChangeOwnerSelfCcNotifyOwnerReviewersInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%notify=OWNER_REVIEWERS" , other , EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . notTo ( sc.starrer , other ) . to ( sc.owner , sc.reviewer ) . cc ( sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }
Source:
public void uploadPackSubsetOfBranchesVisibleNotIncludingHead ( ) throws java.lang.Exception { deny ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/master" ) ; allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/branch" ) ; setApiUser ( user ) ; assertUploadPackRefs ( ( ( r2 ) + "1" ) , ( ( r2 ) + "meta" ) , ( ( r4 ) + "1" ) , ( ( r4 ) + "meta" ) , "refs/heads/branch" , "refs/tags/branch-tag" , "refs/tags/master-tag" ) ; }

Target:
public void uploadPackSubsetOfBranchesVisibleNotIncludingHead ( ) throws java.lang.Exception { deny ( "refs/heads/master" , Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/branch" ) ; setApiUser ( user ) ; assertUploadPackRefs ( ( ( r2 ) + "1" ) , ( ( r2 ) + "meta" ) , ( ( r4 ) + "1" ) , ( ( r4 ) + "meta" ) , "refs/heads/branch" , "refs/tags/branch-tag" , "refs/tags/master-tag" ) ; }
Source:
protected void run ( ) throws java.lang.Exception { com.google.gerrit.server.project.SetHead.Input input = new com.google.gerrit.server.project.SetHead.Input ( ) ; input.ref = newHead ; try { setHead.apply ( new com.google.gerrit.server.project.ProjectResource ( project.getProjectState ( ) , project.getUser ( ) ) , input ) ; } catch ( com.google.gerrit.extensions.restapi.UnprocessableEntityException e ) { throw die ( e ) ; } }

Target:
protected void run ( ) throws java.lang.Exception { com.google.gerrit.server.project.SetHead.Input input = new com.google.gerrit.server.project.SetHead.Input ( ) ; input.ref = newHead ; try { setHead.apply ( new com.google.gerrit.server.project.ProjectResource ( project , user ) , input ) ; } catch ( com.google.gerrit.extensions.restapi.UnprocessableEntityException e ) { throw die ( e ) ; } }
Source:
public void testCreate_NonEmpty ( ) throws java.io.IOException { final java.nio.file.Path root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; final java.nio.file.Path txt = root.resolve ( "test.txt" ) ; try { java.nio.file.Files.createDirectory ( root ) ; java.nio.file.Files.createFile ( txt ) ; final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( root ) ; org.junit.Assert.assertFalse ( site.isNew ) ; org.junit.Assert.assertEquals ( root.toFile ( ) , site.site_path ) ; } finally { java.nio.file.Files.delete ( txt ) ; java.nio.file.Files.delete ( root ) ; } }

Target:
public void testCreate_NonEmpty ( ) throws java.io.IOException { final java.nio.file.Path root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; final java.nio.file.Path txt = root.resolve ( "test.txt" ) ; try { java.nio.file.Files.createDirectory ( root ) ; java.nio.file.Files.createFile ( txt ) ; final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( root ) ; org.junit.Assert.assertFalse ( site.isNew ) ; org.junit.Assert.assertEquals ( root , site.site_path ) ; } finally { java.nio.file.Files.delete ( txt ) ; java.nio.file.Files.delete ( root ) ; } }
Source:
public void testNoMissingDownstreamMerges ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result result = createChange ( "subject" , "filename" , "content" , "testtopic" ) ; java.lang.String projectName = result.getChange ( ) . change ( ) . getProject ( ) . get ( ) ; createBranch ( new com.google.gerrit.reviewdb.client.Branch.NameKey ( projectName , "ds_one" ) ) ; pushConfig ( "automerger.config" , projectName ) ; amendChange ( result.getChangeId ( ) ) ; result.assertOkStatus ( ) ; merge ( result ) ; }

Target:
public void testNoMissingDownstreamMerges ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result result = createChange ( "subject" , "filename" , "content" , "testtopic" ) ; java.lang.String projectName = result.getChange ( ) . change ( ) . getProject ( ) . get ( ) ; createBranch ( new com.google.gerrit.reviewdb.client.Branch.NameKey ( projectName , "ds_one" ) ) ; pushConfig ( "automerger.config" , projectName , "ds_one" ) ; amendChange ( result.getChangeId ( ) ) ; result.assertOkStatus ( ) ; merge ( result ) ; }
Source:
private void printTree ( final com.google.gerrit.sshd.commands.TreeNode node , final int level , final boolean isLast ) { printNode ( node , level , isLast ) ; final java.util.SortedSet < ? extends com.google.gerrit.sshd.commands.TreeNode > childNodes = node.getChildren ( ) ; for ( final com.google.gerrit.sshd.commands.TreeNode childNode : childNodes ) { final boolean isLastChild = childNodes.last ( ) . equals ( childNode ) ; printTree ( childNode , ( level + 1 ) , isLastChild ) ; } }

Target:
private void printTree ( final com.google.gerrit.sshd.commands.TreeNode node , final int level , final boolean isLast ) { printNode ( node , level , isLast ) ; final java.util.SortedSet < ? extends com.google.gerrit.sshd.commands.TreeNode > childNodes = node.getChildren ( ) ; int i = 0 ; for ( final com.google.gerrit.sshd.commands.TreeNode childNode : childNodes ) { final boolean isLastChild = ( ++ i ) == ( childNodes.size ( ) ) ; printTree ( childNode , ( level + 1 ) , isLastChild ) ; } }
Source:
public com.google.common.util.concurrent.CheckedFuture < java.lang.Boolean , java.io.IOException > reindexIfStale ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) { java.util.concurrent.Callable < java.lang.Boolean > task = ( ) -> { if ( stalenessChecker.isStale ( uuid ) ) { index ( uuid ) ; return true ; } return false ; } ; return com.google.common.util.concurrent.Futures.makeChecked ( com.google.common.util.concurrent.Futures.nonCancellationPropagating ( batchExecutor.submit ( task ) ) , IndexUtils.MAPPER ) ; }

Target:
public boolean reindexIfStale ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) throws java.io.IOException { if ( stalenessChecker.isStale ( uuid ) ) { index ( uuid ) ; return true ; } return false ; }