auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void setUp ( ) throws java.lang.Exception { index = new com.google.gerrit.server.index.FakeIndex ( FakeIndex.V2 ) ; indexes = new com.google.gerrit.server.index.IndexCollection ( ) ; indexes.setSearchIndex ( index ) ; queryBuilder = new com.google.gerrit.server.index.FakeQueryBuilder ( indexes ) ; rewrite = new com.google.gerrit.server.index.IndexRewriteImpl ( indexes , new com.google.gerrit.server.query.change.BasicChangeRewrites ( null ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { index = new com.google.gerrit.server.index.FakeIndex ( FakeIndex.V2 ) ; indexes = new com.google.gerrit.server.index.IndexCollection ( ) ; indexes.setSearchIndex ( index ) ; queryBuilder = new com.google.gerrit.server.index.FakeQueryBuilder ( indexes ) ; rewrite = new com.google.gerrit.server.index.IndexRewriteImpl ( indexes , new com.google.gerrit.server.query.change.BasicChangeRewrites ( ) ) ; }
Source:
protected void configure ( ) { factory ( EditCommitMessageHandler.Factory.class ) ; factory ( RestoreChangeHandler.Factory.class ) ; factory ( RevertChange.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 ( RestoreChangeHandler.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 ) ; }
Source:
public void batchAbandon ( com.google.gerrit.server.update.BatchUpdate.Factory updateFactory , com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.server.CurrentUser user , java.util.Collection < com.google.gerrit.server.project.ChangeControl > controls , java.lang.String msgTxt ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.update.UpdateException { batchAbandon ( updateFactory , project , user , controls , msgTxt , NotifyHandling.ALL , com.google.common.collect.ImmutableListMultimap.of ( ) ) ; }

Target:
public void batchAbandon ( com.google.gerrit.server.update.BatchUpdate.Factory updateFactory , com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.server.CurrentUser user , java.util.Collection < com.google.gerrit.server.query.change.ChangeData > changes , java.lang.String msgTxt ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.update.UpdateException { batchAbandon ( updateFactory , project , user , changes , msgTxt , NotifyHandling.ALL , com.google.common.collect.ImmutableListMultimap.of ( ) ) ; }
Source:
private void doTopicEdit ( ) { java.lang.String topic = newTopic.getText ( ) ; com.google.gerrit.client.changes.ChangeApi.topic ( change.getId ( ) . get ( ) , topic , getMessageText ( ) , new com.google.gerrit.client.rpc.GerritCallback < java.lang.String > ( ) { @ java.lang.Override public void onSuccess ( java.lang.String result ) { sent = true ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( change.getId ( ) ) ) ; hide ( ) ; } @ java.lang.Override public void onFailure ( final java.lang.Throwable caught ) { enableButtons ( true ) ; super . onFailure ( caught ) ; } } ) ; }

Target:
private void doTopicEdit ( ) { java.lang.String topic = newTopic.getText ( ) ; com.google.gerrit.client.changes.ChangeApi.topic ( change.getId ( ) . get ( ) , topic , new com.google.gerrit.client.rpc.GerritCallback < java.lang.String > ( ) { @ java.lang.Override public void onSuccess ( java.lang.String result ) { sent = true ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( change.getId ( ) ) ) ; hide ( ) ; } @ java.lang.Override public void onFailure ( final java.lang.Throwable caught ) { enableButtons ( true ) ; super . onFailure ( caught ) ; } } ) ; }
Source:
void doReply ( ) { if ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { com.google.gerrit.client.Gerrit.doSignIn ( getCommentManager ( ) . getSideBySide ( ) . getToken ( ) ) ; } else if ( ( replyBox ) == null ) { addReplyBox ( ) ; } else { openReplyBox ( ) ; } }

Target:
void doReply ( ) { if ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { com.google.gerrit.client.Gerrit.doSignIn ( getCommentManager ( ) . getSideBySide ( ) . getToken ( ) ) ; } else if ( ( replyBox ) == null ) { addReplyBox ( false ) ; } else { openReplyBox ( ) ; } }
Source:
public void byFileRegex ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; org.eclipse.jgit.revwalk.RevCommit commit = repo.parseBody ( repo.commit ( ) . message ( "one" ) . add ( "dir/file1" , "contents1" ) . add ( "dir/file2" , "contents2" ) . create ( ) ) ; com.google.gerrit.reviewdb.client.Change change = insert ( newChangeForCommit ( repo , commit ) ) ; assertQuery ( "file:.*file.*" ) ; assertQuery ( "file:^file.*" ) ; assertQuery ( "file:^dir.file.*" , change ) ; }

Target:
public void byFileRegex ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; org.eclipse.jgit.revwalk.RevCommit commit = repo.parseBody ( repo.commit ( ) . message ( "one" ) . add ( "dir/file1" , "contents1" ) . add ( "dir/file2" , "contents2" ) . create ( ) ) ; com.google.gerrit.reviewdb.client.Change change = insert ( repo , newChangeForCommit ( repo , commit ) ) ; assertQuery ( "file:.*file.*" ) ; assertQuery ( "file:^file.*" ) ; assertQuery ( "file:^dir.file.*" , change ) ; }
Source:
public boolean canReadCommit ( com.google.gerrit.reviewdb.server.ReviewDb db , org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.revwalk.RevCommit commit ) { try { org.eclipse.jgit.lib.Repository repo = openRepository ( ) ; try { return isMergedIntoVisibleRef ( repo , db , rw , commit , repo.getAllRefs ( ) . values ( ) ) ; } finally { repo.close ( ) ; } } catch ( java.io.IOException e ) { java.lang.String msg = java.lang.String.format ( "Cannot verify permissions to commit object %s in repository %s" , commit.name ( ) , getProject ( ) . getNameKey ( ) ) ; com.google.gerrit.server.project.ProjectControl.log.error ( msg , e ) ; return false ; } }

Target:
public boolean canReadCommit ( com.google.gerrit.reviewdb.server.ReviewDb db , org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.revwalk.RevCommit commit ) { try ( org.eclipse.jgit.lib.Repository repo = openRepository ( ) ) { return isMergedIntoVisibleRef ( repo , db , rw , commit , repo.getAllRefs ( ) . values ( ) ) ; } catch ( java.io.IOException e ) { java.lang.String msg = java.lang.String.format ( "Cannot verify permissions to commit object %s in repository %s" , commit.name ( ) , getProject ( ) . getNameKey ( ) ) ; com.google.gerrit.server.project.ProjectControl.log.error ( msg , e ) ; return false ; } }
Source:
protected com.google.template.soy.tofu.SoyTofu getTofu ( ) { com.google.template.soy.SoyFileSet.Builder builder = com.google.template.soy.SoyFileSet.builder ( ) . setCompileTimeGlobals ( globals ) ; for ( java.net.URL template : templates ) { try { com.google.common.base.Preconditions.checkState ( new java.io.File ( template.toURI ( ) ) . exists ( ) , "Missing Soy template %s" , template ) ; } catch ( java.net.URISyntaxException e ) { throw new java.lang.IllegalStateException ( e ) ; } builder.add ( template ) ; } return builder.build ( ) . compileToTofu ( ) ; }

Target:
protected com.google.template.soy.tofu.SoyTofu getTofu ( ) { com.google.template.soy.SoyFileSet.Builder builder = com.google.template.soy.SoyFileSet.builder ( ) . setCompileTimeGlobals ( globals ) ; for ( java.net.URL template : templates.values ( ) ) { try { com.google.common.base.Preconditions.checkState ( new java.io.File ( template.toURI ( ) ) . exists ( ) , "Missing Soy template %s" , template ) ; } catch ( java.net.URISyntaxException e ) { throw new java.lang.IllegalStateException ( e ) ; } builder.add ( template ) ; } return builder.build ( ) . compileToTofu ( ) ; }
Source:
private static org.eclipse.jgit.lib.ObjectId createNewTree ( org.eclipse.jgit.lib.Repository repository , org.eclipse.jgit.revwalk.RevCommit baseCommit , com.google.gerrit.server.edit.tree.TreeModification treeModification ) throws com.google.gerrit.server.project.InvalidChangeOperationException , java.io.IOException { com.google.gerrit.server.edit.tree.TreeCreator treeCreator = new com.google.gerrit.server.edit.tree.TreeCreator ( baseCommit.getTree ( ) ) ; treeCreator.addTreeModification ( treeModification ) ; org.eclipse.jgit.lib.ObjectId newTreeId = treeCreator.createNewTreeAndGetId ( repository ) ; if ( org.eclipse.jgit.lib.ObjectId.equals ( newTreeId , baseCommit.getTree ( ) ) ) { throw new com.google.gerrit.server.project.InvalidChangeOperationException ( "no changes were made" ) ; } return newTreeId ; }

Target:
private static org.eclipse.jgit.lib.ObjectId createNewTree ( org.eclipse.jgit.lib.Repository repository , org.eclipse.jgit.revwalk.RevCommit baseCommit , com.google.gerrit.server.edit.tree.TreeModification treeModification ) throws com.google.gerrit.server.project.InvalidChangeOperationException , java.io.IOException { com.google.gerrit.server.edit.tree.TreeCreator treeCreator = new com.google.gerrit.server.edit.tree.TreeCreator ( baseCommit ) ; treeCreator.addTreeModification ( treeModification ) ; org.eclipse.jgit.lib.ObjectId newTreeId = treeCreator.createNewTreeAndGetId ( repository ) ; if ( org.eclipse.jgit.lib.ObjectId.equals ( newTreeId , baseCommit.getTree ( ) ) ) { throw new com.google.gerrit.server.project.InvalidChangeOperationException ( "no changes were made" ) ; } return newTreeId ; }
Source:
protected void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; java.lang.Class.forName ( com.mysql.jdbc.Driver.class . getName ( ) ) ; final java.lang.String host = "localhost" ; final java.lang.String database = "gwtorm" ; final java.lang.String user = "gwtorm" ; final java.lang.String pass = "gwtorm" ; final java.lang.String url = ( ( "jdbc:mysql://" + host ) + "/" ) + database ; db = java.sql.DriverManager.getConnection ( url , user , pass ) ; executor = new com.google.gwtorm.jdbc.JdbcExecutor ( db ) ; dialect = new com.google.gwtorm.schema.sql.DialectMySQL ( ) . refine ( db ) ; final java.util.Properties p = new java.util.Properties ( ) ; p.setProperty ( "driver" , com.mysql.jdbc.Driver.class . getName ( ) ) ; p.setProperty ( "url" , db.getMetaData ( ) . getURL ( ) ) ; p.setProperty ( "user" , user ) ; p.setProperty ( "password" , pass ) ; phoneBook = new com.google.gwtorm.jdbc.Database < com.google.gwtorm.data.PhoneBookDb > ( new com.google.gwtorm.jdbc.SimpleDataSource ( p ) , com.google.gwtorm.data.PhoneBookDb.class ) ; phoneBook2 = new com.google.gwtorm.jdbc.Database < com.google.gwtorm.data.PhoneBookDb2 > ( new com.google.gwtorm.jdbc.SimpleDataSource ( p ) , com.google.gwtorm.data.PhoneBookDb2.class ) ; drop ( "TABLE address_id" ) ; drop ( "TABLE addresses" ) ; drop ( "TABLE cnt" ) ; drop ( "TABLE foo" ) ; drop ( "TABLE people" ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { java.lang.Class.forName ( com.mysql.jdbc.Driver.class . getName ( ) ) ; final java.lang.String host = "localhost" ; final java.lang.String database = "gwtorm" ; final java.lang.String user = "gwtorm" ; final java.lang.String pass = "gwtorm" ; final java.lang.String url = ( ( "jdbc:mysql://" + host ) + "/" ) + database ; db = java.sql.DriverManager.getConnection ( url , user , pass ) ; executor = new com.google.gwtorm.jdbc.JdbcExecutor ( db ) ; dialect = new com.google.gwtorm.schema.sql.DialectMySQL ( ) . refine ( db ) ; final java.util.Properties p = new java.util.Properties ( ) ; p.setProperty ( "driver" , com.mysql.jdbc.Driver.class . getName ( ) ) ; p.setProperty ( "url" , db.getMetaData ( ) . getURL ( ) ) ; p.setProperty ( "user" , user ) ; p.setProperty ( "password" , pass ) ; phoneBook = new com.google.gwtorm.jdbc.Database < com.google.gwtorm.data.PhoneBookDb > ( new com.google.gwtorm.jdbc.SimpleDataSource ( p ) , com.google.gwtorm.data.PhoneBookDb.class ) ; phoneBook2 = new com.google.gwtorm.jdbc.Database < com.google.gwtorm.data.PhoneBookDb2 > ( new com.google.gwtorm.jdbc.SimpleDataSource ( p ) , com.google.gwtorm.data.PhoneBookDb2.class ) ; drop ( "TABLE address_id" ) ; drop ( "TABLE addresses" ) ; drop ( "TABLE cnt" ) ; drop ( "TABLE foo" ) ; drop ( "TABLE people" ) ; }
Source:
public void byKey ( ) 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 = newChange ( repo , null , null , null , null ) . insert ( ) ; java.lang.String key = change.getKey ( ) . get ( ) ; assertQuery ( "I0000000000000000000000000000000000000000" ) ; for ( int i = 0 ; i <= 36 ; i ++ ) { java.lang.String q = key.substring ( 0 , ( 41 - i ) ) ; assertQuery ( q , change ) ; } }

Target:
public void byKey ( ) 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 , null , null , null , null ) ) ; java.lang.String key = change.getKey ( ) . get ( ) ; assertQuery ( "I0000000000000000000000000000000000000000" ) ; for ( int i = 0 ; i <= 36 ; i ++ ) { java.lang.String q = key.substring ( 0 , ( 41 - i ) ) ; assertQuery ( q , change ) ; } }
Source:
public static com.google.gerrit.reviewdb.client.ChangeMessage newMessage ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx , java.lang.String body , @ com.google.gerrit.common.Nullable java.lang.String tag ) throws com.google.gwtorm.server.OrmException { return com.google.gerrit.server.ChangeMessagesUtil.newMessage ( ctx.getDb ( ) , ctx.getChange ( ) . currentPatchSetId ( ) , ctx.getUser ( ) , ctx.getWhen ( ) , body , tag ) ; }

Target:
public static com.google.gerrit.reviewdb.client.ChangeMessage newMessage ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx , java.lang.String body , @ com.google.gerrit.common.Nullable java.lang.String tag ) { return com.google.gerrit.server.ChangeMessagesUtil.newMessage ( ctx.getChange ( ) . currentPatchSetId ( ) , ctx.getUser ( ) , ctx.getWhen ( ) , body , tag ) ; }
Source:
public void getDetail ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = adminRestSession.get ( ( ( "/accounts/" + ( admin.username ) ) + "/detail/" ) ) ; com.google.gerrit.server.restapi.account.GetDetail.AccountDetailInfo info = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.server.restapi.account.GetDetail.AccountDetailInfo.class ) ; com.google.gerrit.acceptance.rest.account.AccountAssert.assertAccountInfo ( admin , info ) ; com.google.gerrit.reviewdb.client.Account account = accountCache.get ( admin.getId ( ) ) . getAccount ( ) ; com.google.common.truth.Truth.assertThat ( info.registeredOn ) . isEqualTo ( account.getRegisteredOn ( ) ) ; }

Target:
public void getDetail ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = adminRestSession.get ( ( ( "/accounts/" + ( admin.username ) ) + "/detail/" ) ) ; com.google.gerrit.server.restapi.account.GetDetail.AccountDetailInfo info = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.server.restapi.account.GetDetail.AccountDetailInfo.class ) ; com.google.gerrit.acceptance.rest.account.AccountAssert.assertAccountInfo ( admin , info ) ; com.google.gerrit.reviewdb.client.Account account = getAccount ( admin.getId ( ) ) ; com.google.common.truth.Truth.assertThat ( info.registeredOn ) . isEqualTo ( account.getRegisteredOn ( ) ) ; }
Source:
private synchronized com.google.gerrit.testutil.InMemoryRepositoryManager.Repo get ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws org.eclipse.jgit.errors.RepositoryNotFoundException { com.google.gerrit.testutil.InMemoryRepositoryManager.Repo repo = repos.get ( name.get ( ) . toLowerCase ( ) ) ; if ( repo != null ) { return repo ; } else { throw new org.eclipse.jgit.errors.RepositoryNotFoundException ( name.get ( ) ) ; } }

Target:
private synchronized com.google.gerrit.testutil.InMemoryRepositoryManager.Repo get ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws org.eclipse.jgit.errors.RepositoryNotFoundException { com.google.gerrit.testutil.InMemoryRepositoryManager.Repo repo = repos.get ( name.get ( ) . toLowerCase ( ) ) ; if ( repo != null ) { return repo ; } throw new org.eclipse.jgit.errors.RepositoryNotFoundException ( name.get ( ) ) ; }
Source:
protected void configure ( ) { bindScope ( com.google.inject.servlet.RequestScoped.class , PerThreadRequestScope.REQUEST ) ; bind ( PerThreadRequestScope.Propagator.class ) ; bind ( com.google.gerrit.server.project.PerRequestProjectControlCache.class ) . in ( com.google.inject.servlet.RequestScoped.class ) ; bind ( com.googlesource.gerrit.plugins.replication.Destination.class ) . toInstance ( this ) ; bind ( org.eclipse.jgit.transport.RemoteConfig.class ) . toInstance ( config.getRemoteConfig ( ) ) ; install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . build ( PushOne.Factory.class ) ) ; }

Target:
protected void configure ( ) { bindScope ( com.google.inject.servlet.RequestScoped.class , PerThreadRequestScope.REQUEST ) ; bind ( PerThreadRequestScope.Propagator.class ) ; bind ( com.googlesource.gerrit.plugins.replication.Destination.class ) . toInstance ( this ) ; bind ( org.eclipse.jgit.transport.RemoteConfig.class ) . toInstance ( config.getRemoteConfig ( ) ) ; install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . build ( PushOne.Factory.class ) ) ; }
Source:
public void testOwnerProject ( ) { grant ( local , com.google.gerrit.common.data.Permission.OWNER , com.google.gerrit.server.project.Util.ADMIN , "refs/*" ) ; com.google.gerrit.server.project.ProjectControl uBlah = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl uAdmin = util.user ( local , com.google.gerrit.server.project.Util.DEVS , com.google.gerrit.server.project.Util.ADMIN ) ; assertFalse ( "not owner" , uBlah.isOwner ( ) ) ; assertTrue ( "is owner" , uAdmin.isOwner ( ) ) ; }

Target:
public void testBranchDelegation2 ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.OWNER , com.google.gerrit.server.project.Util.ADMIN , "refs/*" ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.OWNER , com.google.gerrit.server.project.Util.DEVS , "refs/heads/x/*" ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.OWNER , fixers , "refs/heads/x/y/*" ) ; com.google.gerrit.server.project.Util.doNotInherit ( local , com.google.gerrit.common.data.Permission.OWNER , "refs/heads/x/y/*" ) ; com.google.gerrit.server.project.ProjectControl uDev = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertFalse ( "not owner" , uDev.isOwner ( ) ) ; assertTrue ( "owns ref" , uDev.isOwnerAnyRef ( ) ) ; com.google.gerrit.server.project.RefControlTest.assertOwner ( "refs/heads/x/*" , uDev ) ; com.google.gerrit.server.project.RefControlTest.assertOwner ( "refs/heads/x/y" , uDev ) ; com.google.gerrit.server.project.RefControlTest.assertOwner ( "refs/heads/x/y/*" , uDev ) ; com.google.gerrit.server.project.RefControlTest.assertNotOwner ( "refs/*" , uDev ) ; com.google.gerrit.server.project.RefControlTest.assertNotOwner ( "refs/heads/master" , uDev ) ; com.google.gerrit.server.project.ProjectControl uFix = util.user ( local , fixers ) ; assertFalse ( "not owner" , uFix.isOwner ( ) ) ; assertTrue ( "owns ref" , uFix.isOwnerAnyRef ( ) ) ; com.google.gerrit.server.project.RefControlTest.assertOwner ( "refs/heads/x/y/*" , uFix ) ; com.google.gerrit.server.project.RefControlTest.assertOwner ( "refs/heads/x/y/bar" , uFix ) ; com.google.gerrit.server.project.RefControlTest.assertNotOwner ( "refs/heads/x/*" , uFix ) ; com.google.gerrit.server.project.RefControlTest.assertNotOwner ( "refs/heads/x/y" , uFix ) ; com.google.gerrit.server.project.RefControlTest.assertNotOwner ( "refs/*" , uFix ) ; com.google.gerrit.server.project.RefControlTest.assertNotOwner ( "refs/heads/master" , uFix ) ; }
Source:
public com.google.gerrit.extensions.common.ChangeInfo apply ( com.google.gerrit.server.change.ChangeResource req , com.google.gerrit.extensions.api.changes.AbandonInput input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.project.ChangeControl control = req.getControl ( ) ; if ( ! ( control.canAbandon ( dbProvider.get ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "abandon not permitted" ) ; } com.google.gerrit.reviewdb.client.Change change = abandon ( control , input.message , control.getUser ( ) . asIdentifiedUser ( ) . getAccount ( ) ) ; return json.create ( ChangeJson.NO_OPTIONS ) . format ( change ) ; }

Target:
public com.google.gerrit.extensions.common.ChangeInfo apply ( com.google.gerrit.server.change.ChangeResource req , com.google.gerrit.extensions.api.changes.AbandonInput input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.project.ChangeControl control = req.getControl ( ) ; if ( ! ( control.canAbandon ( dbProvider.get ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "abandon not permitted" ) ; } com.google.gerrit.reviewdb.client.Change change = abandon ( control , input.message ) ; return json.create ( ChangeJson.NO_OPTIONS ) . format ( change ) ; }
Source:
private com.google.gerrit.server.auth.ldap.LdapType discoverLdapType ( ) { try { final javax.naming.directory.DirContext ctx = open ( ) ; try { return com.google.gerrit.server.auth.ldap.LdapType.guessType ( ctx ) ; } finally { ctx.close ( ) ; } } catch ( javax.naming.NamingException e ) { com.google.gerrit.server.auth.ldap.LdapRealm.log.warn ( ( ( "Cannot discover type of LDAP server at " + ( server ) ) + ", assuming the server is RFC 2307 compliant." ) , e ) ; return LdapType.RFC_2307 ; } }

Target:
com.google.gerrit.server.auth.ldap.LdapType discoverLdapType ( javax.naming.directory.DirContext ctx ) { try { return com.google.gerrit.server.auth.ldap.LdapType.guessType ( ctx ) ; } catch ( javax.naming.NamingException e ) { com.google.gerrit.server.auth.ldap.LdapRealm.log.warn ( ( ( "Cannot discover type of LDAP server at " + ( server ) ) + ", assuming the server is RFC 2307 compliant." ) , e ) ; return LdapType.RFC_2307 ; } }
Source:
private com.google.gerrit.server.git.strategy.SubmitStrategy createStrategy ( com.google.gerrit.server.git.MergeOp.OpenRepo or , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.extensions.client.SubmitType submitType , com.google.gerrit.server.git.CodeReviewCommit branchTip , com.google.gerrit.server.IdentifiedUser caller ) throws com.google.gerrit.server.git.IntegrationException , com.google.gerrit.server.project.NoSuchProjectException { return submitStrategyFactory.create ( submitType , db , or.repo , or.rw , or.ins , or.canMergeFlag , getAlreadyAccepted ( or , branchTip ) , destBranch , caller , commits ) ; }

Target:
private com.google.gerrit.server.git.strategy.SubmitStrategy createStrategy ( com.google.gerrit.server.git.MergeOp.OpenRepo or , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.extensions.client.SubmitType submitType , com.google.gerrit.server.git.CodeReviewCommit branchTip ) throws com.google.gerrit.server.git.IntegrationException , com.google.gerrit.server.project.NoSuchProjectException { return submitStrategyFactory.create ( submitType , db , or.repo , or.rw , or.ins , or.canMergeFlag , getAlreadyAccepted ( or , branchTip ) , destBranch , caller , commits ) ; }
Source:
public void nonexistentPermission ( ) throws java.lang.Exception { exception.expect ( com.google.gerrit.extensions.restapi.BadRequestException.class ) ; exception.expectMessage ( "not recognized" ) ; com.google.gerrit.extensions.api.config.AccessCheckInput in = new com.google.gerrit.extensions.api.config.AccessCheckInput ( ) ; in.account = user.email ; in.permission = "notapermission" ; in.ref = "refs/heads/master" ; gApi.projects ( ) . name ( normalProject.get ( ) ) . checkAccess ( in ) ; }

Target:
public void nonexistentPermission ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.config.AccessCheckInput in = new com.google.gerrit.extensions.api.config.AccessCheckInput ( ) ; in.account = user.email ; in.permission = "notapermission" ; in.ref = "refs/heads/master" ; exception.expect ( com.google.gerrit.extensions.restapi.BadRequestException.class ) ; exception.expectMessage ( "not recognized" ) ; gApi.projects ( ) . name ( normalProject.get ( ) ) . checkAccess ( in ) ; }
Source:
static com.google.gerrit.server.notedb.ChangeNotesState empty ( com.google.gerrit.reviewdb.client.Change change ) { return new com.google.gerrit.server.notedb.AutoValue_ChangeNotesState ( change.getId ( ) , null , com.google.common.collect.ImmutableSet.of ( ) , com.google.common.collect.ImmutableSet.of ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.gerrit.server.ReviewerSet.empty ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.common.collect.ImmutableListMultimap.of ( ) , com.google.common.collect.ImmutableListMultimap.of ( ) ) ; }

Target:
static com.google.gerrit.server.notedb.ChangeNotesState empty ( com.google.gerrit.reviewdb.client.Change change ) { return new com.google.gerrit.server.notedb.AutoValue_ChangeNotesState ( null , change.getId ( ) , null , com.google.common.collect.ImmutableSet.of ( ) , com.google.common.collect.ImmutableSet.of ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.gerrit.server.ReviewerSet.empty ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.common.collect.ImmutableListMultimap.of ( ) , com.google.common.collect.ImmutableListMultimap.of ( ) ) ; }
Source:
public com.google.gerrit.reviewdb.PatchSet getCurrentPatchSet ( ) { if ( ( currentPatchSetId ) != null ) { for ( int i = ( patchSets.size ( ) ) - 1 ; i >= 0 ; i -- ) { final com.google.gerrit.reviewdb.PatchSet ps = patchSets.get ( i ) ; if ( ps.getId ( ) . equals ( currentPatchSetId ) ) { return ps ; } } } return null ; }

Target:
public com.google.gerrit.reviewdb.client.PatchSet getCurrentPatchSet ( ) { if ( ( currentPatchSetId ) != null ) { for ( int i = ( patchSets.size ( ) ) - 1 ; i >= 0 ; i -- ) { final com.google.gerrit.reviewdb.client.PatchSet ps = patchSets.get ( i ) ; if ( ps.getId ( ) . equals ( currentPatchSetId ) ) { return ps ; } } } return null ; }
Source:
protected org.eclipse.jgit.lib.CommitBuilder applyImpl ( org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.lib.ObjectInserter ins , org.eclipse.jgit.lib.ObjectId curr ) throws com.google.gwtorm.server.OrmException , java.io.IOException { org.eclipse.jgit.lib.CommitBuilder cb = new org.eclipse.jgit.lib.CommitBuilder ( ) ; cb.setMessage ( "Update draft comments" ) ; try { org.eclipse.jgit.lib.ObjectId treeId = storeCommentsInNotes ( rw , ins , curr ) ; if ( treeId == null ) { return null ; } cb.setTreeId ( com.google.common.base.Preconditions.checkNotNull ( treeId ) ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } return cb ; }

Target:
protected org.eclipse.jgit.lib.CommitBuilder applyImpl ( org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.lib.ObjectInserter ins , org.eclipse.jgit.lib.ObjectId curr ) throws com.google.gwtorm.server.OrmException , java.io.IOException { org.eclipse.jgit.lib.CommitBuilder cb = new org.eclipse.jgit.lib.CommitBuilder ( ) ; cb.setMessage ( "Update draft comments" ) ; try { return storeCommentsInNotes ( rw , ins , curr , cb ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } }
Source:
public void addReviewer ( ) throws java.lang.Exception { 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 ; gApi.changes ( ) . id ( r.getChangeId ( ) ) . addReviewer ( in ) ; com.google.common.truth.Truth.assertThat ( ( ( java.lang.Iterable < ? > ) ( getReviewers ( r.getChangeId ( ) ) ) ) ) . containsExactlyElementsIn ( com.google.common.collect.ImmutableSet.of ( user.id ) ) ; }

Target:
public void addReviewer ( ) throws java.lang.Exception { 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 ; gApi.changes ( ) . id ( r.getChangeId ( ) ) . addReviewer ( in ) ; com.google.common.truth.Truth.assertThat ( getReviewers ( r.getChangeId ( ) ) ) . containsExactlyElementsIn ( com.google.common.collect.ImmutableSet.of ( user.id ) ) ; }
Source:
public static com.google.gerrit.common.data.LabelType withDefaultValues ( java.lang.String name ) { com.google.gerrit.common.data.LabelType.checkName ( name ) ; java.util.List < com.google.gerrit.common.data.LabelValue > values = new java.util.ArrayList < com.google.gerrit.common.data.LabelValue > ( 2 ) ; values.add ( new com.google.gerrit.common.data.LabelValue ( ( ( short ) ( 0 ) ) , "Rejected" ) ) ; values.add ( new com.google.gerrit.common.data.LabelValue ( ( ( short ) ( 1 ) ) , "Approved" ) ) ; com.google.gerrit.common.data.LabelType type = new com.google.gerrit.common.data.LabelType ( name , values ) ; return type ; }

Target:
public static com.google.gerrit.common.data.LabelType withDefaultValues ( java.lang.String name ) { com.google.gerrit.common.data.LabelType.checkName ( name ) ; java.util.List < com.google.gerrit.common.data.LabelValue > values = new java.util.ArrayList < com.google.gerrit.common.data.LabelValue > ( 2 ) ; values.add ( new com.google.gerrit.common.data.LabelValue ( ( ( short ) ( 0 ) ) , "Rejected" ) ) ; values.add ( new com.google.gerrit.common.data.LabelValue ( ( ( short ) ( 1 ) ) , "Approved" ) ) ; return new com.google.gerrit.common.data.LabelType ( name , values ) ; }
Source:
public void createBranchByProjectOwnerCreateReferenceBlocked_Forbidden ( ) throws java.lang.Exception { grantOwner ( ) ; blockCreateReference ( ) ; com.google.gerrit.acceptance.RestResponse r = userSession.put ( ( ( ( "/projects/" + ( project.get ( ) ) ) + "/branches/" ) + ( branch.getShortName ( ) ) ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_FORBIDDEN , r.getStatusCode ( ) ) ; }

Target:
public void createBranchByProjectOwnerCreateReferenceBlocked_Forbidden ( ) throws java.lang.Exception { grantOwner ( ) ; blockCreateReference ( ) ; com.google.gerrit.acceptance.RestResponse r = userSession.put ( ( ( ( "/projects/" + ( project.get ( ) ) ) + "/branches/" ) + ( branch.getShortName ( ) ) ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_FORBIDDEN ) ; }
Source:
void setLineLength ( int columns ) { columnMarginA.getStyle ( ) . setMarginLeft ( ( ( columns * ( cmA.defaultCharWidth ( ) ) ) + ( cmA.getGutterElement ( ) . getOffsetWidth ( ) ) ) , Unit.PX ) ; columnMarginB.getStyle ( ) . setMarginLeft ( ( ( columns * ( cmB.defaultCharWidth ( ) ) ) + ( cmB.getGutterElement ( ) . getOffsetWidth ( ) ) ) , Unit.PX ) ; }

Target:
void setLineLength ( int columns ) { columnMarginA.getStyle ( ) . setMarginLeft ( ( columns * ( cmA.defaultCharWidth ( ) ) ) , Unit.PX ) ; columnMarginB.getStyle ( ) . setMarginLeft ( ( columns * ( cmB.defaultCharWidth ( ) ) ) , Unit.PX ) ; }
Source:
public void suggestReviewersChange ( ) throws java.io.IOException , java.lang.Exception , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createChange ( admin ) ; java.util.List < com.google.gerrit.server.change.SuggestReviewers.SuggestedReviewerInfo > reviewers = suggestReviewers ( changeId , "u" , 6 ) ; org.junit.Assert.assertEquals ( reviewers.size ( ) , 6 ) ; reviewers = suggestReviewers ( changeId , "u" , 5 ) ; org.junit.Assert.assertEquals ( reviewers.size ( ) , 5 ) ; reviewers = suggestReviewers ( changeId , "users3" , 10 ) ; org.junit.Assert.assertEquals ( reviewers.size ( ) , 1 ) ; }

Target:
public void suggestReviewersChange ( ) throws java.io.IOException , java.lang.Exception , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; java.util.List < com.google.gerrit.server.change.SuggestReviewers.SuggestedReviewerInfo > reviewers = suggestReviewers ( changeId , "u" , 6 ) ; org.junit.Assert.assertEquals ( reviewers.size ( ) , 6 ) ; reviewers = suggestReviewers ( changeId , "u" , 5 ) ; org.junit.Assert.assertEquals ( reviewers.size ( ) , 5 ) ; reviewers = suggestReviewers ( changeId , "users3" , 10 ) ; org.junit.Assert.assertEquals ( reviewers.size ( ) , 1 ) ; }
Source:
private static org.eclipse.jgit.lib.Config config ( org.junit.runner.Description description ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.lib.Config base = com.google.gerrit.acceptance.ConfigAnnotationParser.parseFromSystemProperty ( ) ; com.google.gerrit.acceptance.GerritConfigs cfgs = description.getAnnotation ( com.google.gerrit.acceptance.GerritConfigs.class ) ; com.google.gerrit.acceptance.GerritConfig cfg = description.getAnnotation ( com.google.gerrit.acceptance.GerritConfig.class ) ; if ( ( cfgs != null ) && ( cfg != null ) ) { throw new java.lang.IllegalStateException ( "Use either @GerritConfigs or @GerritConfig not both" ) ; } if ( cfgs != null ) { return com.google.gerrit.acceptance.ConfigAnnotationParser.parse ( base , cfgs ) ; } else if ( cfg != null ) { return com.google.gerrit.acceptance.ConfigAnnotationParser.parse ( base , cfg ) ; } else { return base ; } }

Target:
private org.eclipse.jgit.lib.Config config ( org.junit.runner.Description description ) { com.google.gerrit.acceptance.GerritConfigs cfgs = description.getAnnotation ( com.google.gerrit.acceptance.GerritConfigs.class ) ; com.google.gerrit.acceptance.GerritConfig cfg = description.getAnnotation ( com.google.gerrit.acceptance.GerritConfig.class ) ; if ( ( cfgs != null ) && ( cfg != null ) ) { throw new java.lang.IllegalStateException ( "Use either @GerritConfigs or @GerritConfig not both" ) ; } if ( cfgs != null ) { return com.google.gerrit.acceptance.ConfigAnnotationParser.parse ( baseConfig , cfgs ) ; } else if ( cfg != null ) { return com.google.gerrit.acceptance.ConfigAnnotationParser.parse ( baseConfig , cfg ) ; } else { return baseConfig ; } }
Source:
protected void renameColumn ( com.google.gerrit.reviewdb.server.ReviewDb db , java.lang.String table , java.lang.String from , java.lang.String to ) throws com.google.gwtorm.server.OrmException { final com.google.gwtorm.jdbc.JdbcSchema s = ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) ; final com.google.gwtorm.jdbc.JdbcExecutor e = new com.google.gwtorm.jdbc.JdbcExecutor ( s ) ; try { s.renameField ( e , table , from , to ) ; } finally { e.close ( ) ; } }

Target:
protected static void renameColumn ( com.google.gerrit.reviewdb.server.ReviewDb db , java.lang.String table , java.lang.String from , java.lang.String to ) throws com.google.gwtorm.server.OrmException { com.google.gwtorm.jdbc.JdbcSchema s = ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) ; try ( com.google.gwtorm.jdbc.JdbcExecutor e = new com.google.gwtorm.jdbc.JdbcExecutor ( s ) ) { s.renameField ( e , table , from , to ) ; } }
Source:
protected void bccWatchesNotifyAllComments ( ) { if ( ( db ) != null ) { try { final com.google.gerrit.server.project.ProjectState ps = getProjectState ( ) ; if ( ps != null ) { for ( final com.google.gerrit.reviewdb.AccountProjectWatch w : getProjectWatches ( ) ) { if ( w.isNotifyAllComments ( ) ) { add ( RecipientType.BCC , w.getAccountId ( ) ) ; } } } } catch ( com.google.gwtorm.client.OrmException err ) { } } }

Target:
protected void bccWatchesNotifyAllComments ( ) { if ( ( db ) != null ) { final com.google.gerrit.server.project.ProjectState ps = getProjectState ( ) ; if ( ps != null ) { for ( final com.google.gerrit.reviewdb.AccountProjectWatch w : getProjectWatches ( ) ) { if ( w.isNotifyAllComments ( ) ) { add ( RecipientType.BCC , w.getAccountId ( ) ) ; } } } } }
Source:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < > ( ) ; modules.add ( sysInjector.getInstance ( com.google.gerrit.sshd.SshModule.class ) ) ; modules.add ( new com.google.gerrit.sshd.SshHostKeyModule ( ) ) ; modules.add ( new com.google.gerrit.sshd.commands.DefaultCommandModule ( false , sysInjector.getInstance ( com.google.gerrit.server.config.DownloadConfig.class ) , sysInjector.getInstance ( com.google.inject.Module.class ) ) ) ; if ( ( indexType ) == ( com.google.gerrit.server.index.IndexModule.IndexType.LUCENE ) ) { modules.add ( new com.google.gerrit.sshd.commands.IndexCommandsModule ( ) ) ; } return sysInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < > ( ) ; modules.add ( sysInjector.getInstance ( com.google.gerrit.sshd.SshModule.class ) ) ; modules.add ( new com.google.gerrit.sshd.SshHostKeyModule ( ) ) ; modules.add ( new com.google.gerrit.sshd.commands.DefaultCommandModule ( false , sysInjector.getInstance ( com.google.gerrit.server.config.DownloadConfig.class ) , sysInjector.getInstance ( com.google.inject.Module.class ) ) ) ; modules.add ( new com.google.gerrit.sshd.commands.IndexCommandsModule ( ) ) ; return sysInjector.createChildInjector ( modules ) ; }
Source:
public void testUnblockInParentBlockInLocal ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.ProjectControl d = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertFalse ( "u can't push" , d.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }

Target:
public void testUnblockInParentBlockInLocal ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.ProjectControl d = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't push" , d.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }
Source:
public void deleteVoteFromReviewableChangeByAdmin ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; setApiUser ( admin ) ; deleteVote ( sc , voter ) ; assertThat ( sender ) . sent ( "deleteVote" , sc ) . to ( sc.owner ) . to ( sc.reviewerByEmail ) . cc ( sc.reviewer , sc.ccer , voter ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void deleteVoteFromReviewableChangeByAdmin ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; setApiUser ( admin ) ; deleteVote ( sc , voter ) ; assertThat ( sender ) . sent ( "deleteVote" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer , voter ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }
Source:
private static com.google.gerrit.server.update.Order getOrder ( java.util.Collection < com.google.gerrit.server.update.BatchUpdate > updates ) { com.google.gerrit.server.update.Order o = null ; for ( com.google.gerrit.server.update.BatchUpdate u : updates ) { if ( o == null ) { o = u.order ; } else if ( ( u.order ) != o ) { throw new java.lang.IllegalArgumentException ( "cannot mix execution orders" ) ; } } return o ; }

Target:
protected static com.google.gerrit.server.update.Order getOrder ( java.util.Collection < ? extends com.google.gerrit.server.update.BatchUpdate > updates ) { com.google.gerrit.server.update.Order o = null ; for ( com.google.gerrit.server.update.BatchUpdate u : updates ) { if ( o == null ) { o = u.order ; } else if ( ( u.order ) != o ) { throw new java.lang.IllegalArgumentException ( "cannot mix execution orders" ) ; } } return o ; }
Source:
private boolean isSubmitForMissingCommitsStillPossible ( final com.google.gerrit.server.git.CodeReviewCommit commit ) { if ( ( ( commit.missing ) == null ) || ( commit.missing.isEmpty ( ) ) ) { return false ; } for ( com.google.gerrit.server.git.CodeReviewCommit missingCommit : commit.missing ) { loadChangeInfo ( missingCommit ) ; if ( ( missingCommit.patchsetId ) == null ) { return false ; } if ( ! ( missingCommit.change.currentPatchSetId ( ) . equals ( missingCommit.patchsetId ) ) ) { return false ; } } return true ; }

Target:
private boolean isSubmitForMissingCommitsStillPossible ( final com.google.gerrit.server.git.CodeReviewCommit commit ) { if ( ( ( commit.missing ) == null ) || ( commit.missing.isEmpty ( ) ) ) { return false ; } for ( com.google.gerrit.server.git.CodeReviewCommit missingCommit : commit.missing ) { loadChangeInfo ( missingCommit ) ; if ( ( missingCommit.patchsetId ) == null ) { return false ; } if ( ! ( missingCommit.getChange ( ) . currentPatchSetId ( ) . equals ( missingCommit.patchsetId ) ) ) { return false ; } } return true ; }
Source:
private java.lang.String buildBlob ( java.lang.String path , java.lang.String expectedMode ) throws java.lang.Exception { com.google.gitiles.FakeHttpServletResponse res = buildText ( path ) ; org.junit.Assert.assertEquals ( expectedMode , res.getHeader ( PathServlet.MODE_HEADER ) ) ; java.lang.String base64 = res.getActualBodyString ( ) ; return new java.lang.String ( com.google.common.io.BaseEncoding.base64 ( ) . decode ( base64 ) , java.nio.charset.StandardCharsets.UTF_8 ) ; }

Target:
private java.lang.String buildBlob ( java.lang.String path , java.lang.String expectedMode ) throws java.lang.Exception { com.google.gitiles.FakeHttpServletResponse res = buildText ( path ) ; com.google.common.truth.Truth.assertThat ( res.getHeader ( PathServlet.MODE_HEADER ) ) . isEqualTo ( expectedMode ) ; java.lang.String base64 = res.getActualBodyString ( ) ; return new java.lang.String ( com.google.common.io.BaseEncoding.base64 ( ) . decode ( base64 ) , java.nio.charset.StandardCharsets.UTF_8 ) ; }
Source:
public void testReplaceOverlappingAtFirstCharLongestMatch ( ) { com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.html ( "abcd" ) ; com.google.gwtexpui.safehtml.client.RawFindReplace ab = new com.google.gwtexpui.safehtml.client.RawFindReplace ( "ab" , "AB" ) ; com.google.gwtexpui.safehtml.client.RawFindReplace abc = new com.google.gwtexpui.safehtml.client.RawFindReplace ( "[^d][^d][^d]" , "234" ) ; org.junit.Assert.assertEquals ( "ABcd" , o.replaceAll ( com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.repls ( ab , abc ) ) . asString ( ) ) ; org.junit.Assert.assertEquals ( "234d" , o.replaceAll ( com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.repls ( abc , ab ) ) . asString ( ) ) ; }

Target:
public void testReplaceOverlappingAtFirstCharLongestMatch ( ) { com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.html ( "abcd" ) ; com.google.gwtexpui.safehtml.client.RawFindReplace ab = new com.google.gwtexpui.safehtml.client.RawFindReplace ( "ab" , "AB" ) ; com.google.gwtexpui.safehtml.client.RawFindReplace abc = new com.google.gwtexpui.safehtml.client.RawFindReplace ( "[^d][^d][^d]" , "234" ) ; com.google.common.truth.Truth.assertThat ( o.replaceAll ( com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.repls ( ab , abc ) ) . asString ( ) ) . isEqualTo ( "ABcd" ) ; com.google.common.truth.Truth.assertThat ( o.replaceAll ( com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.repls ( abc , ab ) ) . asString ( ) ) . isEqualTo ( "234d" ) ; }
Source:
static java.lang.String getTargetDisplayName ( java.lang.String target ) { if ( ( target.length ( ) ) <= ( com.google.gitiles.TreeSoyData.MAX_SYMLINK_TARGET_LENGTH ) ) { return target ; } else { int lastSlash = target.lastIndexOf ( '/' ) ; return lastSlash >= 0 ? "..." + ( target.substring ( lastSlash ) ) : target ; } }

Target:
static java.lang.String getTargetDisplayName ( java.lang.String target ) { if ( ( target.length ( ) ) <= ( com.google.gitiles.TreeSoyData.MAX_SYMLINK_TARGET_LENGTH ) ) { return target ; } int lastSlash = target.lastIndexOf ( '/' ) ; return lastSlash >= 0 ? "..." + ( target.substring ( lastSlash ) ) : target ; }
Source:
private boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.CurrentUser user , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.project.ProjectState pe = projectCache.get ( change.getProject ( ) ) ; if ( pe == null ) { return false ; } com.google.gerrit.server.project.ProjectControl pc = pe.controlFor ( user ) ; return pc.controlFor ( db , change ) . isVisible ( db ) ; }

Target:
private boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.CurrentUser user , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { if ( change == null ) { return false ; } com.google.gerrit.server.project.ProjectState pe = projectCache.get ( change.getProject ( ) ) ; if ( pe == null ) { return false ; } com.google.gerrit.server.project.ProjectControl pc = pe.controlFor ( user ) ; return pc.controlFor ( db , change ) . isVisible ( db ) ; }
Source:
public com.google.gerrit.server.config.PluginConfig getFromProjectConfig ( com.google.gerrit.reviewdb.client.Project.NameKey projectName , java.lang.String pluginName ) throws com.google.gerrit.server.project.NoSuchProjectException { com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( projectName ) ; if ( projectState == null ) { throw new com.google.gerrit.server.project.NoSuchProjectException ( projectName ) ; } return projectState.getConfig ( ) . getPluginConfig ( pluginName ) ; }

Target:
public com.google.gerrit.server.config.PluginConfig getFromProjectConfig ( com.google.gerrit.server.project.ProjectState projectState , java.lang.String pluginName ) { return projectState.getConfig ( ) . getPluginConfig ( pluginName ) ; }