auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public org.eclipse.jgit.transport.UploadPack create ( javax.servlet.http.HttpServletRequest req , org.eclipse.jgit.lib.Repository db ) throws org.eclipse.jgit.http.server.resolver.ServiceNotEnabledException { com.google.gerrit.server.project.ProjectControl pc = com.google.gerrit.httpd.ProjectServlet.getProjectControl ( req ) ; org.eclipse.jgit.transport.UploadPack up = new org.eclipse.jgit.transport.UploadPack ( db ) ; return up ; }

Target:
public org.eclipse.jgit.transport.UploadPack create ( javax.servlet.http.HttpServletRequest req , org.eclipse.jgit.lib.Repository repo ) throws org.eclipse.jgit.http.server.resolver.ServiceNotEnabledException { com.google.gerrit.server.project.ProjectControl pc = com.google.gerrit.httpd.ProjectServlet.getProjectControl ( req ) ; org.eclipse.jgit.transport.UploadPack up = new org.eclipse.jgit.transport.UploadPack ( repo ) ; if ( ! ( pc.allRefsAreVisible ( ) ) ) { up.setRefFilter ( new com.google.gerrit.server.git.VisibleRefFilter ( repo , pc , db.get ( ) ) ) ; } return up ; }
Source:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.RevisionInfo revision , com.google.gerrit.extensions.common.AccountInfo reviewer , com.google.gerrit.extensions.common.AccountInfo adder , java.sql.Timestamp when ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.ReviewerAdded.Event event = new com.google.gerrit.server.extensions.events.ReviewerAdded.Event ( change , revision , reviewer , adder , when ) ; for ( com.google.gerrit.extensions.events.ReviewerAddedListener l : listeners ) { try { l.onReviewerAdded ( event ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.extensions.events.ReviewerAdded.log.warn ( "Error in event listener, e" ) ; } } }

Target:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.RevisionInfo revision , com.google.gerrit.extensions.common.AccountInfo reviewer , com.google.gerrit.extensions.common.AccountInfo adder , java.sql.Timestamp when ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.ReviewerAdded.Event event = new com.google.gerrit.server.extensions.events.ReviewerAdded.Event ( change , revision , reviewer , adder , when ) ; for ( com.google.gerrit.extensions.events.ReviewerAddedListener l : listeners ) { try { l.onReviewerAdded ( event ) ; } catch ( java.lang.Exception e ) { util.logEventListenerError ( com.google.gerrit.server.extensions.events.ReviewerAdded.log , e ) ; } } }
Source:
public java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > guessRelevantGroupUUIDs ( ) { java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > groups = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.reviewdb.client.Project.NameKey n : all ( ) ) { com.google.gerrit.server.project.ProjectState p = byName.getIfPresent ( n.get ( ) ) ; if ( p != null ) { groups.addAll ( p.getConfig ( ) . getAllGroupUUIDs ( ) ) ; } } return groups ; }

Target:
public java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > guessRelevantGroupUUIDs ( ) { java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > groups = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.reviewdb.client.Project.NameKey n : all ( ) ) { com.google.gerrit.server.project.ProjectState p = byName.getIfPresent ( n.get ( ) ) ; if ( p != null ) { groups.addAll ( com.google.common.collect.FluentIterable.from ( p.getConfig ( ) . getAllGroupUUIDs ( ) ) . filter ( com.google.gerrit.server.project.ProjectCacheImpl.NON_NULL_UUID ) . toSet ( ) ) ; } } return groups ; }
Source:
protected void parseCommandLine ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { processor.setOutput ( out , OutputFormat.TEXT ) ; super . parseCommandLine ( ) ; if ( ( processor.getIncludeFiles ( ) ) && ( ! ( ( processor.getIncludePatchSets ( ) ) || ( processor.getIncludeCurrentPatchSet ( ) ) ) ) ) { throw new com.google.gerrit.sshd.commands.UnloggedFailure ( 1 , "--files option needs --patch-sets or --current-patch-set" ) ; } }

Target:
protected void parseCommandLine ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { processor.setOutput ( out , OutputFormat.TEXT ) ; super . parseCommandLine ( ) ; if ( ( processor.getIncludeFiles ( ) ) && ( ! ( ( processor.getIncludePatchSets ( ) ) || ( processor.getIncludeCurrentPatchSet ( ) ) ) ) ) { throw die ( "--files option needs --patch-sets or --current-patch-set" ) ; } }
Source:
public void commentOnReviewableWipChangeByBotNotifyAll ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; com.google.gerrit.acceptance.TestAccount bot = sc.testAccount ( "bot" ) ; review ( bot , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED , com.google.gerrit.extensions.api.changes.NotifyHandling.ALL , "tag" ) ; assertThat ( sender ) . sent ( "comment" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void commentOnReviewableWipChangeByOwner ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableWipChange ( ) ; review ( sc.owner , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED ) ; assertThat ( sender ) . sent ( "comment" , sc ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) . noOneElse ( ) ; }
Source:
private com.google.gerrit.server.change.ReviewerJson.PostResult putAccount ( com.google.gerrit.server.change.ReviewerResource rsrc ) throws com.google.gerrit.common.errors.EmailException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.change.ReviewerJson.PostResult result = new com.google.gerrit.server.change.ReviewerJson.PostResult ( ) ; addReviewers ( rsrc , result , com.google.common.collect.ImmutableSet.of ( rsrc.getUser ( ) ) ) ; return result ; }

Target:
private com.google.gerrit.server.change.ReviewerJson.PostResult putAccount ( com.google.gerrit.server.change.ReviewerResource rsrc ) throws com.google.gerrit.common.errors.EmailException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.Account.Id id = rsrc.getUser ( ) . getAccountId ( ) ; com.google.gerrit.server.project.ChangeControl control = rsrc.getControl ( ) . forUser ( identifiedUserFactory.create ( id ) ) ; com.google.gerrit.server.change.ReviewerJson.PostResult result = new com.google.gerrit.server.change.ReviewerJson.PostResult ( ) ; addReviewers ( rsrc , result , com.google.common.collect.ImmutableMap.of ( id , control ) ) ; return result ; }
Source:
static int getMinOwnerVoteLevel ( com.google.gerrit.reviewdb.client.Project.NameKey project ) { try { return ( null == ( com.googlesource.gerrit.plugins.findowners.Config.config ) ) || ( null == project ) ? com.googlesource.gerrit.plugins.findowners.Config.minOwnerVoteLevel : com.googlesource.gerrit.plugins.findowners.Config.config.getFromProjectConfigWithInheritance ( project , com.googlesource.gerrit.plugins.findowners.Config.PLUGIN_NAME ) . getInt ( com.googlesource.gerrit.plugins.findowners.Config.MIN_OWNER_VOTE_LEVEL , com.googlesource.gerrit.plugins.findowners.Config.minOwnerVoteLevel ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { com.googlesource.gerrit.plugins.findowners.Config.log.error ( ( "Cannot find project: " + project ) ) ; return com.googlesource.gerrit.plugins.findowners.Config.minOwnerVoteLevel ; } }

Target:
static int getMinOwnerVoteLevel ( com.google.gerrit.server.query.change.ChangeData changeData ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Project.NameKey project = changeData.change ( ) . getProject ( ) ; try { return ( ( com.googlesource.gerrit.plugins.findowners.Config.config ) == null ) || ( project == null ) ? com.googlesource.gerrit.plugins.findowners.Config.minOwnerVoteLevel : com.googlesource.gerrit.plugins.findowners.Config.config.getFromProjectConfigWithInheritance ( project , com.googlesource.gerrit.plugins.findowners.Config.PLUGIN_NAME ) . getInt ( com.googlesource.gerrit.plugins.findowners.Config.MIN_OWNER_VOTE_LEVEL , com.googlesource.gerrit.plugins.findowners.Config.minOwnerVoteLevel ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { com.googlesource.gerrit.plugins.findowners.Config.log.error ( ( "Cannot find project: " + project ) ) ; return com.googlesource.gerrit.plugins.findowners.Config.minOwnerVoteLevel ; } }
Source:
public void onLoad ( ) { super . onLoad ( ) ; Util.ACCOUNT_SEC.mySshKeys ( new com.google.gerrit.client.rpc.GerritCallback < java.util.List < com.google.gerrit.client.reviewdb.AccountSshKey > > ( ) { public void onSuccess ( final java.util.List < com.google.gerrit.client.reviewdb.AccountSshKey > result ) { keys.display ( result ) ; keys.finishDisplay ( true ) ; } } ) ; }

Target:
public void onLoad ( ) { super . onLoad ( ) ; Util.ACCOUNT_SEC.mySshKeys ( new com.google.gerrit.client.rpc.GerritCallback < java.util.List < com.google.gerrit.client.reviewdb.AccountSshKey > > ( ) { public void onSuccess ( final java.util.List < com.google.gerrit.client.reviewdb.AccountSshKey > result ) { keys.display ( result ) ; keys.finishDisplay ( true ) ; if ( result.isEmpty ( ) ) { showAddKeyBlock ( true ) ; } } } ) ; }
Source:
public void onFocus ( final com.google.gwt.event.dom.client.FocusEvent event ) { if ( Util.C.defaultAccountName ( ) . equals ( nameTxtBox.getText ( ) ) ) { nameTxtBox.setText ( "" ) ; nameTxtBox.removeStyleName ( "gerrit-InputFieldTypeHint" ) ; } }

Target:
public void onFocus ( final com.google.gwt.event.dom.client.FocusEvent event ) { if ( Util.C.defaultAccountName ( ) . equals ( nameTxtBox.getText ( ) ) ) { nameTxtBox.setText ( "" ) ; nameTxtBox.removeStyleName ( Gerrit.RESOURCES.css ( ) . inputFieldTypeHint ( ) ) ; } }
Source:
public void onLoad ( ) { if ( ( projects ) == null ) { initUI ( ) ; } Util.PROJECT_SVC.ownedProjects ( new com.google.gerrit.client.rpc.GerritCallback < java.util.List < com.google.gerrit.client.reviewdb.Project > > ( ) { public void onSuccess ( final java.util.List < com.google.gerrit.client.reviewdb.Project > result ) { if ( isAttached ( ) ) { projects.display ( result ) ; projects.finishDisplay ( true ) ; } } } ) ; }

Target:
public void onLoad ( ) { if ( ( projects ) == null ) { initUI ( ) ; } Util.PROJECT_SVC.ownedProjects ( new com.google.gerrit.client.rpc.ScreenLoadCallback < java.util.List < com.google.gerrit.client.reviewdb.Project > > ( this ) { @ java.lang.Override protected void preDisplay ( final java.util.List < com.google.gerrit.client.reviewdb.Project > result ) { projects.display ( result ) ; projects.finishDisplay ( true ) ; } } ) ; }
Source:
private int insert ( final java.util.List < com.google.gerrit.client.reviewdb.PatchLineComment > in , int row ) { for ( java.util.Iterator < com.google.gerrit.client.reviewdb.PatchLineComment > ci = in.iterator ( ) ; ci.hasNext ( ) ; ) { final com.google.gerrit.client.reviewdb.PatchLineComment c = ci.next ( ) ; table.insertRow ( row ) ; table.getCellFormatter ( ) . setStyleName ( row , 0 , com.google.gerrit.client.patches.S_ICON_CELL ) ; bindComment ( row , com.google.gerrit.client.patches.UnifiedDiffTable.PC , c , ( ! ( ci.hasNext ( ) ) ) ) ; row ++ ; } return row ; }

Target:
protected void insertRow ( final int row ) { super . insertRow ( row ) ; final com.google.gwt.user.client.ui.HTMLTable.CellFormatter fmt = table.getCellFormatter ( ) ; fmt.addStyleName ( row , ( ( com.google.gerrit.client.patches.UnifiedDiffTable.PC ) - 2 ) , "LineNumber" ) ; fmt.addStyleName ( row , ( ( com.google.gerrit.client.patches.UnifiedDiffTable.PC ) - 1 ) , "LineNumber" ) ; fmt.addStyleName ( row , com.google.gerrit.client.patches.UnifiedDiffTable.PC , "DiffText" ) ; }
Source:
public java.util.SortedSet < com.google.gerrit.reviewdb.Project.NameKey > list ( ) { java.util.SortedSet < com.google.gerrit.reviewdb.Project.NameKey > names = new java.util.TreeSet < com.google.gerrit.reviewdb.Project.NameKey > ( ) ; scanProjects ( basePath , "" , names ) ; return java.util.Collections.unmodifiableSortedSet ( names ) ; }

Target:
public java.util.SortedSet < com.google.gerrit.reviewdb.Project.NameKey > list ( ) { namesUpdateLock.lock ( ) ; try { java.util.SortedSet < com.google.gerrit.reviewdb.Project.NameKey > n = new java.util.TreeSet < com.google.gerrit.reviewdb.Project.NameKey > ( ) ; scanProjects ( basePath , "" , n ) ; names = java.util.Collections.unmodifiableSortedSet ( n ) ; return n ; } finally { namesUpdateLock.unlock ( ) ; } }
Source:
public void configure ( ) { factory ( LuceneChangeIndex.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( LuceneChangeIndex.Factory.class ) ; install ( new com.google.gerrit.server.index.IndexModule ( threads ) ) ; if ( ( ( singleVersion ) == null ) && ( ( base ) == null ) ) { install ( new com.google.gerrit.lucene.LuceneIndexModule.MultiVersionModule ( ) ) ; } else { install ( new com.google.gerrit.lucene.LuceneIndexModule.SingleVersionModule ( ) ) ; } }
Source:
private static boolean isFile ( org.eclipse.jgit.revwalk.RevWalk walk , com.google.gitiles.GitilesView view ) throws java.io.IOException { if ( view.getPathPart ( ) . equals ( "" ) ) { return false ; } org.eclipse.jgit.treewalk.TreeWalk tw = org.eclipse.jgit.treewalk.TreeWalk.forPath ( walk.getObjectReader ( ) , view.getPathPart ( ) , walk.parseTree ( view.getRevision ( ) . getId ( ) ) ) ; try { return ( ( tw.getRawMode ( 0 ) ) & ( org.eclipse.jgit.lib.FileMode.TYPE_FILE ) ) > 0 ; } finally { tw.release ( ) ; } }

Target:
private static org.eclipse.jgit.treewalk.TreeWalk newTreeWalk ( org.eclipse.jgit.revwalk.RevWalk walk , com.google.gitiles.GitilesView view ) throws java.io.IOException { if ( view.getPathPart ( ) . isEmpty ( ) ) { return null ; } return org.eclipse.jgit.treewalk.TreeWalk.forPath ( walk.getObjectReader ( ) , view.getPathPart ( ) , walk.parseTree ( view.getRevision ( ) . getId ( ) ) ) ; }
Source:
public com.google.gerrit.extensions.restapi.Response < java.lang.String > apply ( com.google.gerrit.server.config.CacheResource rsrc , com.google.gerrit.server.config.FlushCache.Input input ) throws com.google.gerrit.extensions.restapi.AuthException { if ( ( com.google.gerrit.server.config.FlushCache.WEB_SESSIONS.equals ( rsrc.getName ( ) ) ) && ( ! ( self.get ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( java.lang.String.format ( "only site administrators can flush %s" , com.google.gerrit.server.config.FlushCache.WEB_SESSIONS ) ) ; } rsrc.getCache ( ) . invalidateAll ( ) ; return com.google.gerrit.extensions.restapi.Response.ok ( "" ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < java.lang.String > apply ( com.google.gerrit.server.config.CacheResource rsrc , com.google.gerrit.server.config.FlushCache.Input input ) throws com.google.gerrit.extensions.restapi.AuthException { if ( ( com.google.gerrit.server.config.FlushCache.WEB_SESSIONS.equals ( rsrc.getName ( ) ) ) && ( ! ( self.get ( ) . getCapabilities ( ) . canMaintainServer ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( java.lang.String.format ( "only site maintainers can flush %s" , com.google.gerrit.server.config.FlushCache.WEB_SESSIONS ) ) ; } rsrc.getCache ( ) . invalidateAll ( ) ; return com.google.gerrit.extensions.restapi.Response.ok ( "" ) ; }
Source:
public java.util.List < com.google.gerrit.server.query.change.QueryResult > queryChanges ( java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > queries ) throws com.google.gerrit.server.query.QueryParseException , com.google.gwtorm.server.OrmException { return queryChanges ( null , queries ) ; }

Target:
public java.util.List < com.google.gerrit.server.query.change.QueryResult > queryChanges ( java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > queries ) throws com.google.gerrit.server.query.QueryParseException , com.google.gwtorm.server.OrmException { try { return queryChanges ( null , queries ) ; } catch ( com.google.gwtorm.server.OrmRuntimeException e ) { throw new com.google.gwtorm.server.OrmException ( e.getMessage ( ) , e ) ; } }
Source:
private com.google.common.collect.SetMultimap < org.eclipse.jgit.lib.ObjectId , org.eclipse.jgit.lib.Ref > changeRefsById ( ) throws java.io.IOException { if ( ( refsById ) == null ) { refsById = com.google.common.collect.HashMultimap.create ( ) ; for ( org.eclipse.jgit.lib.Ref r : refsByChange ( ) . values ( ) ) { refsById.put ( r.getObjectId ( ) , r ) ; } } return refsById ; }

Target:
private com.google.common.collect.ListMultimap < com.google.gerrit.reviewdb.client.Change.Id , org.eclipse.jgit.lib.Ref > refsByChange ( ) { initChangeRefMaps ( ) ; return refsByChange ; }
Source:
public java.util.Map < com.google.gerrit.client.reviewdb.ApprovalCategory.Id , com.google.gerrit.client.reviewdb.ChangeApproval > getApprovalMap ( ) { final java.util.HashMap < com.google.gerrit.client.reviewdb.ApprovalCategory.Id , com.google.gerrit.client.reviewdb.ChangeApproval > r ; r = new java.util.HashMap < com.google.gerrit.client.reviewdb.ApprovalCategory.Id , com.google.gerrit.client.reviewdb.ChangeApproval > ( ) ; for ( final com.google.gerrit.client.reviewdb.ChangeApproval ca : approvals ) { r.put ( ca.getCategoryId ( ) , ca ) ; } return r ; }

Target:
public java.util.Map < com.google.gerrit.client.reviewdb.ApprovalCategory.Id , com.google.gerrit.client.reviewdb.PatchSetApproval > getApprovalMap ( ) { final java.util.HashMap < com.google.gerrit.client.reviewdb.ApprovalCategory.Id , com.google.gerrit.client.reviewdb.PatchSetApproval > r ; r = new java.util.HashMap < com.google.gerrit.client.reviewdb.ApprovalCategory.Id , com.google.gerrit.client.reviewdb.PatchSetApproval > ( ) ; for ( final com.google.gerrit.client.reviewdb.PatchSetApproval ca : approvals ) { r.put ( ca.getCategoryId ( ) , ca ) ; } return r ; }
Source:
private java.lang.String amendChange ( org.eclipse.jgit.lib.PersonIdent ident , java.lang.String changeId ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = HEAD ( 0 ) ; com.google.gerrit.acceptance.edit.Merge changes ; }

Target:
private java.lang.String amendChange ( org.eclipse.jgit.lib.PersonIdent ident , java.lang.String changeId ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , ident , testRepo , PushOneCommit.SUBJECT , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME2 , new java.lang.String ( com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_NEW2 , java.nio.charset.StandardCharsets.UTF_8 ) , changeId ) ; return push.to ( "refs/for/master" ) . getChangeId ( ) ; }
Source:
com.google.gerrit.client.diff.DraftBox addReply ( com.google.gerrit.client.changes.CommentInfo replyTo , java.lang.String initMessage , boolean doSave ) { com.google.gerrit.common.changes.Side side = replyTo.side ( ) ; int line = replyTo.line ( ) ; com.google.gerrit.client.changes.CommentInfo info = com.google.gerrit.client.changes.CommentInfo.create ( path , side , line , replyTo.id ( ) , initMessage ) ; return addDraftBox ( info , doSave ) ; }

Target:
com.google.gerrit.client.changes.CommentInfo createReply ( com.google.gerrit.client.changes.CommentInfo replyTo ) { return com.google.gerrit.client.changes.CommentInfo.create ( path , replyTo.side ( ) , replyTo.line ( ) , replyTo.id ( ) , null ) ; }
Source:
public java.util.List < com.googlecode.prolog_cafe.lang.Term > evaluate ( ) throws com.google.gerrit.server.project.RuleEvalException { return evaluateImpl ( "locate_submit_rule" , "can_submit" , "locate_submit_filter" , "filter_submit_results" ) ; }

Target:
private java.util.List < com.google.gerrit.common.data.SubmitRecord > invalidResult ( com.googlecode.prolog_cafe.lang.Term rule , com.googlecode.prolog_cafe.lang.Term record , java.lang.String reason ) { return ruleError ( java.lang.String.format ( ( "Submit rule %s for change %s of %s output " + "invalid result: %s%s" ) , rule , cd.getId ( ) , getProjectName ( ) , record , ( reason == null ? "" : ". Reason: " + reason ) ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key1 = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithoutExpiration ( ) ; com.google.gerrit.gpg.testutil.TestKey key3 = com.google.gerrit.gpg.testutil.TestKeys.expiredKey ( ) ; repo = new org.eclipse.jgit.internal.storage.dfs.InMemoryRepository ( new org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription ( "repo" ) ) ; store = new com.google.gerrit.gpg.PublicKeyStore ( repo ) ; store.add ( key1.getPublicKeyRing ( ) ) ; store.add ( key3.getPublicKeyRing ( ) ) ; org.eclipse.jgit.lib.PersonIdent ident = new org.eclipse.jgit.lib.PersonIdent ( "A U Thor" , "author@example.com" ) ; org.eclipse.jgit.lib.CommitBuilder cb = new org.eclipse.jgit.lib.CommitBuilder ( ) ; cb.setAuthor ( ident ) ; cb.setCommitter ( ident ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , store.save ( cb ) ) ; signedPushConfig = new org.eclipse.jgit.transport.SignedPushConfig ( ) ; signedPushConfig.setCertNonceSeed ( "sekret" ) ; signedPushConfig.setCertNonceSlopLimit ( ( 60 * 24 ) ) ; checker = newChecker ( true ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { com.google.gerrit.gpg.testing.TestKey key1 = com.google.gerrit.gpg.testing.TestKeys.validKeyWithoutExpiration ( ) ; com.google.gerrit.gpg.testing.TestKey key3 = com.google.gerrit.gpg.testing.TestKeys.expiredKey ( ) ; repo = new org.eclipse.jgit.internal.storage.dfs.InMemoryRepository ( new org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription ( "repo" ) ) ; store = new com.google.gerrit.gpg.PublicKeyStore ( repo ) ; store.add ( key1.getPublicKeyRing ( ) ) ; store.add ( key3.getPublicKeyRing ( ) ) ; org.eclipse.jgit.lib.PersonIdent ident = new org.eclipse.jgit.lib.PersonIdent ( "A U Thor" , "author@example.com" ) ; org.eclipse.jgit.lib.CommitBuilder cb = new org.eclipse.jgit.lib.CommitBuilder ( ) ; cb.setAuthor ( ident ) ; cb.setCommitter ( ident ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , store.save ( cb ) ) ; signedPushConfig = new org.eclipse.jgit.transport.SignedPushConfig ( ) ; signedPushConfig.setCertNonceSeed ( "sekret" ) ; signedPushConfig.setCertNonceSlopLimit ( ( 60 * 24 ) ) ; checker = newChecker ( true ) ; }
Source:
protected void configure ( ) { if ( ( gerritConfig.getString ( pluginName , null , "url" ) ) != null ) { com.googlesource.gerrit.plugins.its.jira.JiraModule.LOG.info ( "JIRA is configured as ITS" ) ; bind ( com.googlesource.gerrit.plugins.hooks.its.ItsFacade.class ) . toInstance ( new com.googlesource.gerrit.plugins.its.jira.JiraItsFacade ( pluginName , gerritConfig ) ) ; install ( new com.googlesource.gerrit.plugins.hooks.ItsHookModule ( pluginName , pluginCfgFactory ) ) ; } }

Target:
protected void configure ( ) { if ( ( gerritConfig.getString ( pluginName , null , "url" ) ) != null ) { com.googlesource.gerrit.plugins.its.jira.JiraModule.LOG.info ( "JIRA is configured as ITS" ) ; bind ( com.googlesource.gerrit.plugins.its.base.its.ItsFacade.class ) . toInstance ( new com.googlesource.gerrit.plugins.its.jira.JiraItsFacade ( pluginName , gerritConfig ) ) ; install ( new com.googlesource.gerrit.plugins.its.base.ItsHookModule ( pluginName , pluginCfgFactory ) ) ; } }
Source:
public void testConvertOptions ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( com.google.gerrit.server.index.change.IndexRewriterTest.options ( 0 , 3 ) , com.google.gerrit.server.index.change.IndexedChangeQuery.convertOptions ( com.google.gerrit.server.index.change.IndexRewriterTest.options ( 0 , 3 ) ) ) ; org.junit.Assert.assertEquals ( com.google.gerrit.server.index.change.IndexRewriterTest.options ( 0 , 4 ) , com.google.gerrit.server.index.change.IndexedChangeQuery.convertOptions ( com.google.gerrit.server.index.change.IndexRewriterTest.options ( 1 , 3 ) ) ) ; org.junit.Assert.assertEquals ( com.google.gerrit.server.index.change.IndexRewriterTest.options ( 0 , 5 ) , com.google.gerrit.server.index.change.IndexedChangeQuery.convertOptions ( com.google.gerrit.server.index.change.IndexRewriterTest.options ( 2 , 3 ) ) ) ; }

Target:
public void testConvertOptions ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( com.google.gerrit.server.index.change.ChangeIndexRewriterTest.options ( 0 , 3 ) , com.google.gerrit.server.index.change.IndexedChangeQuery.convertOptions ( com.google.gerrit.server.index.change.ChangeIndexRewriterTest.options ( 0 , 3 ) ) ) ; org.junit.Assert.assertEquals ( com.google.gerrit.server.index.change.ChangeIndexRewriterTest.options ( 0 , 4 ) , com.google.gerrit.server.index.change.IndexedChangeQuery.convertOptions ( com.google.gerrit.server.index.change.ChangeIndexRewriterTest.options ( 1 , 3 ) ) ) ; org.junit.Assert.assertEquals ( com.google.gerrit.server.index.change.ChangeIndexRewriterTest.options ( 0 , 5 ) , com.google.gerrit.server.index.change.IndexedChangeQuery.convertOptions ( com.google.gerrit.server.index.change.ChangeIndexRewriterTest.options ( 2 , 3 ) ) ) ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; com.google.gerrit.client.groups.GroupMap.all ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.groups.GroupMap > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gerrit.client.groups.GroupMap result ) { groups.display ( result ) ; groups.finishDisplay ( ) ; } } ) ; }

Target:
protected void preDisplay ( final com.google.gerrit.client.groups.GroupMap result ) { if ( ( ( mySubname == null ) && ( ( subname ) == null ) ) || ( ( mySubname != null ) && ( mySubname.equals ( subname ) ) ) ) { display ( result ) ; } }
Source:
public void run ( ) { store.put ( key , h ) ; }

Target:
public com.google.gerrit.server.cache.h2.H2CacheImpl.ValueHolder < V > load ( final K key ) throws java.lang.Exception { if ( store.mightContain ( key ) ) { com.google.gerrit.server.cache.h2.H2CacheImpl.ValueHolder < V > h = store.getIfPresent ( key ) ; if ( h != null ) { return h ; } } final com.google.gerrit.server.cache.h2.H2CacheImpl.ValueHolder < V > h = new com.google.gerrit.server.cache.h2.H2CacheImpl.ValueHolder < > ( loader.load ( key ) ) ; h.created = com.google.gerrit.common.TimeUtil.nowMs ( ) ; executor.execute ( ( ) -> store.put ( key , h ) ) ; return h ; }
Source:
public void visit ( com.google.gitiles.doc.ColsNode.Column node ) { if ( ( 1 <= ( node.span ) ) && ( ( node.span ) <= ( ColsNode.GRID_WIDTH ) ) ) { html.open ( "div" ) . attribute ( "class" , ( "col-" + ( node.span ) ) ) ; visitChildren ( node ) ; html.close ( "div" ) ; } }

Target:
private void visit ( com.google.gitiles.doc.MultiColumnBlock.Column node ) { if ( ( 1 <= ( node.span ) ) && ( ( node.span ) <= ( MultiColumnBlock.GRID_WIDTH ) ) ) { html.open ( "div" ) . attribute ( "class" , ( "col-" + ( node.span ) ) ) ; visitChildren ( node ) ; html.close ( "div" ) ; } }
Source:
public void testResponseOK ( ) throws java.lang.Exception { com.ericsson.gerrit.plugins.syncindex.HttpSessionTest.wireMockRule.givenThat ( com.github.tomakehurst.wiremock.client.WireMock.post ( com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo ( com.ericsson.gerrit.plugins.syncindex.HttpSessionTest.ENDPOINT ) ) . willReturn ( com.github.tomakehurst.wiremock.client.WireMock.aResponse ( ) . withStatus ( com.ericsson.gerrit.plugins.syncindex.HttpSessionTest.OK ) ) ) ; com.google.common.truth.Truth.assertThat ( httpSession.post ( com.ericsson.gerrit.plugins.syncindex.HttpSessionTest.ENDPOINT ) . isSuccessful ( ) ) . isTrue ( ) ; }

Target:
public void testPostResponseOK ( ) throws java.lang.Exception { com.ericsson.gerrit.plugins.syncindex.HttpSessionTest.wireMockRule.givenThat ( com.github.tomakehurst.wiremock.client.WireMock.post ( com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo ( com.ericsson.gerrit.plugins.syncindex.HttpSessionTest.ENDPOINT ) ) . willReturn ( com.github.tomakehurst.wiremock.client.WireMock.aResponse ( ) . withStatus ( com.ericsson.gerrit.plugins.syncindex.HttpSessionTest.OK ) ) ) ; com.google.common.truth.Truth.assertThat ( httpSession.post ( com.ericsson.gerrit.plugins.syncindex.HttpSessionTest.ENDPOINT ) . isSuccessful ( ) ) . isTrue ( ) ; }
Source:
public void ignore ( com.google.gerrit.server.change.ChangeResource rsrc ) throws com.google.gwtorm.server.OrmException { star ( rsrc.getUser ( ) . getAccountId ( ) , rsrc.getProject ( ) , rsrc.getChange ( ) . getId ( ) , com.google.common.collect.ImmutableSet.of ( com.google.gerrit.server.StarredChangesUtil.IGNORE_LABEL ) , com.google.common.collect.ImmutableSet.of ( ) ) ; }

Target:
public void ignore ( com.google.gerrit.server.change.ChangeResource rsrc ) throws com.google.gwtorm.server.OrmException { star ( rsrc.getUser ( ) . asIdentifiedUser ( ) . getAccountId ( ) , rsrc.getProject ( ) , rsrc.getChange ( ) . getId ( ) , com.google.common.collect.ImmutableSet.of ( com.google.gerrit.server.StarredChangesUtil.IGNORE_LABEL ) , com.google.common.collect.ImmutableSet.of ( ) ) ; }
Source:
public boolean value ( ) { return ( a.value ( ) ) || ( b.value ( ) ) ; }

Target:
public boolean value ( ) { if ( ( com.google.gerrit.extensions.conditions.BooleanCondition.evaluatesTriviallyToExpectedValue ( a , true ) ) || ( com.google.gerrit.extensions.conditions.BooleanCondition.evaluatesTriviallyToExpectedValue ( b , true ) ) ) { return true ; } return ( a.value ( ) ) || ( b.value ( ) ) ; }
Source:
public java.lang.String apply ( org.eclipse.jgit.lib.ObjectId oid ) { return oid.getName ( ) ; }

Target:
protected void run ( ) throws com.google.gerrit.sshd.commands.Failure { try { com.google.gerrit.server.project.BanCommit.Input input = BanCommit.Input.fromCommits ( com.google.common.collect.Lists.transform ( commitsToBan , ObjectId :: getName ) ) ; input.reason = reason ; com.google.gerrit.server.project.BanCommit.BanResultInfo r = banCommit.apply ( new com.google.gerrit.server.project.ProjectResource ( projectControl ) , input ) ; printCommits ( r.newlyBanned , "The following commits were banned" ) ; printCommits ( r.alreadyBanned , "The following commits were already banned" ) ; printCommits ( r.ignored , "The following ids do not represent commits and were ignored" ) ; } catch ( com.google.gerrit.extensions.restapi.RestApiException | java.io.IOException e ) { throw die ( e ) ; } }
Source:
public void isEnabledForMultipleRefs ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig config = getConfig ( ( "[plugin \"uploadvalidator\"]\n" + ( ( " ref = refs/heads/branch1\n" + " ref = refs/heads/branch2\n" ) + " blockedFileExtension = jar" ) ) ) ; com.google.common.truth.Truth.assertThat ( config.isEnabledForRef ( projectName , "refs/heads/branch1" , "blockedFileExtension" ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( config.isEnabledForRef ( projectName , "refs/heads/branch2" , "blockedFileExtension" ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( config.isEnabledForRef ( projectName , "refs/heads/branch3" , "blockedFileExtension" ) ) . isFalse ( ) ; }

Target:
public void isEnabledForMultipleRefs ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig config = getConfig ( ( "[plugin \"uploadvalidator\"]\n" + ( ( " ref = refs/heads/branch1\n" + " ref = refs/heads/branch2\n" ) + " blockedFileExtension = jar" ) ) ) ; com.google.common.truth.Truth.assertThat ( config.isEnabledForRef ( anyUser , projectName , "refs/heads/branch1" , "blockedFileExtension" ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( config.isEnabledForRef ( anyUser , projectName , "refs/heads/branch2" , "blockedFileExtension" ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( config.isEnabledForRef ( anyUser , projectName , "refs/heads/branch3" , "blockedFileExtension" ) ) . isFalse ( ) ; }
Source:
public java.util.List < com.google.gerrit.extensions.common.ChangeInfo > apply ( com.google.gerrit.server.account.AccountResource rsrc ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gwtorm.server.OrmException { if ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "not allowed to list stars of another account" ) ; } com.google.gerrit.server.query.change.QueryChanges query = changes.list ( ) ; query.addQuery ( "has:stars" ) ; return ( ( java.util.List < com.google.gerrit.extensions.common.ChangeInfo > ) ( query.apply ( TopLevelResource.INSTANCE ) ) ) ; }

Target:
public java.util.List < com.google.gerrit.extensions.common.ChangeInfo > apply ( com.google.gerrit.server.account.AccountResource rsrc ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gwtorm.server.OrmException { if ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "not allowed to list stars of another account" ) ; } com.google.gerrit.server.change.QueryChanges query = changes.list ( ) ; query.addQuery ( "has:stars" ) ; return ( ( java.util.List < com.google.gerrit.extensions.common.ChangeInfo > ) ( query.apply ( TopLevelResource.INSTANCE ) ) ) ; }
Source:
public java.util.Set < com.google.gerrit.reviewdb.client.Change.Id > getStarredChanges ( ) { return null ; }

Target:
public com.google.gerrit.server.CurrentUser getUser ( ) { return new com.google.gerrit.server.CurrentUser ( null ) { @ java.lang.Override public com.google.gerrit.server.account.GroupMembership getEffectiveGroups ( ) { return new com.google.gerrit.server.account.GroupMembership ( ) { @ java.lang.Override public java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > intersection ( java.lang.Iterable < com.google.gerrit.reviewdb.client.AccountGroup.UUID > groupIds ) { return null ; } @ java.lang.Override public java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > getKnownGroups ( ) { return null ; } @ java.lang.Override public boolean containsAnyOf ( java.lang.Iterable < com.google.gerrit.reviewdb.client.AccountGroup.UUID > groupIds ) { return true ; } @ java.lang.Override public boolean contains ( com.google.gerrit.reviewdb.client.AccountGroup.UUID groupId ) { return true ; } } ; } } ; }
Source:
public com.google.gerrit.server.project.ProjectControl controlFor ( final com.google.gerrit.reviewdb.Project.NameKey nameKey ) throws com.google.gerrit.server.project.NoSuchProjectException { final com.google.gerrit.server.project.ProjectState p = projectCache.get ( nameKey ) ; if ( p == null ) { throw new com.google.gerrit.server.project.NoSuchProjectException ( nameKey ) ; } return p.controlFor ( user.get ( ) ) ; }

Target:
public com.google.gerrit.server.project.ProjectControl controlFor ( final com.google.gerrit.reviewdb.Project.NameKey nameKey ) throws com.google.gerrit.server.project.NoSuchProjectException { final com.google.gerrit.server.project.ProjectState p = com.google.gerrit.server.util.FutureUtil.getOrNull ( projectCache.get ( nameKey ) ) ; if ( p == null ) { throw new com.google.gerrit.server.project.NoSuchProjectException ( nameKey ) ; } return p.controlFor ( user.get ( ) ) ; }
Source:
private void bccWatchesNotifySubmittedChanges ( ) { if ( ( db ) != null ) { try { final com.google.gerrit.server.project.ProjectState ps = getProjectState ( ) ; if ( ps != null ) { for ( com.google.gerrit.reviewdb.AccountProjectWatch w : db.accountProjectWatches ( ) . notifySubmittedChanges ( ps.getProject ( ) . getNameKey ( ) ) ) { add ( RecipientType.BCC , w.getAccountId ( ) ) ; } } } catch ( com.google.gwtorm.client.OrmException err ) { } } }

Target:
private void bccWatchesNotifySubmittedChanges ( ) { 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.isNotifySubmittedChanges ( ) ) { add ( RecipientType.BCC , w.getAccountId ( ) ) ; } } } } catch ( com.google.gwtorm.client.OrmException err ) { } } }
Source:
public java.util.SortedMap < java.lang.String , com.google.gerrit.extensions.common.PluginInfo > getAsMap ( ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.plugins.ListPlugins list = listProvider.get ( ) ; list.setAll ( this . getAll ( ) ) ; return list.apply ( ) ; }

Target:
public java.util.SortedMap < java.lang.String , com.google.gerrit.extensions.common.PluginInfo > getAsMap ( ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.plugins.ListPlugins list = listProvider.get ( ) ; list.setAll ( this . getAll ( ) ) ; list.setStart ( this . getStart ( ) ) ; list.setLimit ( this . getLimit ( ) ) ; return list.apply ( ) ; }
Source:
public final boolean hasEditBasedOnCurrentPatchSet ( ) { com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.ChangeInfo.RevisionInfo > revList = revisions ( ) . values ( ) ; com.google.gerrit.client.changes.ChangeInfo.RevisionInfo.sortRevisionInfoByNumber ( revList ) ; return revList.get ( ( ( revList.length ( ) ) - 1 ) ) . is_edit ( ) ; }

Target:
public final boolean hasEditBasedOnCurrentPatchSet ( ) { com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.ChangeInfo.RevisionInfo > revList = revisions ( ) . values ( ) ; com.google.gerrit.client.changes.ChangeInfo.RevisionInfo.sortRevisionInfoByNumber ( revList ) ; return revList.get ( ( ( revList.length ( ) ) - 1 ) ) . isEdit ( ) ; }
Source:
protected void preDisplay ( final com.google.gerrit.client.groups.GroupMap result ) { if ( ( ( mySubname == null ) && ( ( subname ) == null ) ) || ( ( mySubname != null ) && ( mySubname.equals ( subname ) ) ) ) { display ( result ) ; } }

Target:
public java.lang.String getCurrentFilter ( ) { return subname ; }
Source:
private java.util.List < com.google.gerrit.extensions.api.projects.BranchInfo > listBranches ( com.google.gerrit.server.api.projects.ListBranchesRequest request ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.project.ListBranches list = listBranchesProvider.get ( ) ; list.setLimit ( request.getLimit ( ) ) ; list.setStart ( request.getStart ( ) ) ; list.setMatchSubstring ( request.getSubstring ( ) ) ; list.setMatchRegex ( request.getRegex ( ) ) ; try { return list.apply ( checkExists ( ) ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot list branches" , e ) ; } }

Target:
private java.util.List < com.google.gerrit.extensions.api.projects.BranchInfo > listBranches ( com.google.gerrit.server.api.projects.ListRefsRequest < com.google.gerrit.extensions.api.projects.BranchInfo > request ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.project.ListBranches list = listBranchesProvider.get ( ) ; list.setLimit ( request.getLimit ( ) ) ; list.setStart ( request.getStart ( ) ) ; list.setMatchSubstring ( request.getSubstring ( ) ) ; list.setMatchRegex ( request.getRegex ( ) ) ; try { return list.apply ( checkExists ( ) ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot list branches" , e ) ; } }
Source:
private static long getFileSize ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.lib.ObjectReader reader , org.eclipse.jgit.lib.FileMode mode , java.lang.String path , org.eclipse.jgit.revwalk.RevTree t ) throws java.io.IOException { if ( ! ( com.google.gerrit.server.patch.PatchListLoader.isBlob ( mode ) ) ) { return 0 ; } try ( org.eclipse.jgit.treewalk.TreeWalk tw = org.eclipse.jgit.treewalk.TreeWalk.forPath ( reader , path , t ) ) { return tw != null ? repo.open ( tw.getObjectId ( 0 ) , org.eclipse.jgit.lib.Constants.OBJ_BLOB ) . getSize ( ) : 0 ; } }

Target:
private org.eclipse.jgit.lib.ObjectInserter newInserter ( org.eclipse.jgit.lib.Repository repo ) { return save ? repo.newObjectInserter ( ) : new com.google.gerrit.server.git.InMemoryInserter ( repo ) ; }
Source:
public com.google.gerrit.testutil.TestDatabase create ( ) throws com.google.gwtorm.client.OrmException { if ( ! ( created ) ) { created = true ; final com.google.gerrit.reviewdb.ReviewDb c = open ( ) ; try { new com.google.gerrit.server.schema.SchemaCreator ( new java.io.File ( "." ) , schemaVersion ) . create ( c ) ; } finally { c.close ( ) ; } } return this ; }

Target:
public com.google.gerrit.testutil.InMemoryDatabase create ( ) throws com.google.gwtorm.client.OrmException { if ( ! ( created ) ) { created = true ; final com.google.gerrit.reviewdb.ReviewDb c = open ( ) ; try { new com.google.gerrit.server.schema.SchemaCreator ( new java.io.File ( "." ) , schemaVersion ) . create ( c ) ; } finally { c.close ( ) ; } } return this ; }
Source:
public void dispatchAddGroupsToGroup ( com.google.gerrit.reviewdb.client.Account.Id actor , java.util.Collection < com.google.gerrit.reviewdb.client.AccountGroupById > added ) { for ( com.google.gerrit.server.audit.GroupMemberAuditListener auditListener : groupMemberAuditListeners ) { try { auditListener.onAddGroupsToGroup ( actor , added ) ; } catch ( java.lang.RuntimeException e ) { com.google.gerrit.server.audit.AuditService.log.error ( "failed to log add groups to group event" , e ) ; } } }

Target:
public void dispatchAddGroupsToGroup ( com.google.gerrit.reviewdb.client.Account.Id actor , java.util.Collection < com.google.gerrit.reviewdb.client.AccountGroupById > added , java.sql.Timestamp addedOn ) { for ( com.google.gerrit.server.audit.GroupMemberAuditListener auditListener : groupMemberAuditListeners ) { try { auditListener.onAddGroupsToGroup ( actor , added , addedOn ) ; } catch ( java.lang.RuntimeException e ) { com.google.gerrit.server.audit.AuditService.log.error ( "failed to log add groups to group event" , e ) ; } } }
Source:
public void testUnblockMoreSpecificRef_Fails ( ) { grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/master" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertFalse ( "u can't push" , u.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }

Target:
public void testUnblockForceWithAllowNoForce_NotPossible ( ) { com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) ; r.setBlock ( ) ; r.setForce ( true ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertFalse ( "u can't force push" , u.controlForRef ( "refs/heads/master" ) . canForceUpdate ( ) ) ; }
Source:
public static com.google.gerrit.server.group.InternalGroup create ( com.google.gerrit.reviewdb.client.AccountGroup accountGroup , com.google.common.collect.ImmutableSet < com.google.gerrit.reviewdb.client.Account.Id > members , com.google.common.collect.ImmutableSet < com.google.gerrit.reviewdb.client.AccountGroup.UUID > includes ) { return new com.google.gerrit.server.group.AutoValue_InternalGroup ( accountGroup.getId ( ) , accountGroup.getNameKey ( ) , accountGroup.getDescription ( ) , accountGroup.getOwnerGroupUUID ( ) , accountGroup.isVisibleToAll ( ) , accountGroup.getGroupUUID ( ) , accountGroup.getCreatedOn ( ) , members , includes ) ; }

Target:
public static com.google.gerrit.server.group.InternalGroup create ( com.google.gerrit.reviewdb.client.AccountGroup accountGroup , com.google.common.collect.ImmutableSet < com.google.gerrit.reviewdb.client.Account.Id > members , com.google.common.collect.ImmutableSet < com.google.gerrit.reviewdb.client.AccountGroup.UUID > subgroups ) { return new com.google.gerrit.server.group.AutoValue_InternalGroup ( accountGroup.getId ( ) , accountGroup.getNameKey ( ) , accountGroup.getDescription ( ) , accountGroup.getOwnerGroupUUID ( ) , accountGroup.isVisibleToAll ( ) , accountGroup.getGroupUUID ( ) , accountGroup.getCreatedOn ( ) , members , subgroups ) ; }
Source:
public void emptyValue ( ) { java.util.List < java.lang.Integer > expected = new java.util.ArrayList < > ( ) ; if ( ( com.google.gerrit.testutil.IndexVersionsTest.SCHEMA_DEF.getPrevious ( ) ) != null ) { expected.add ( com.google.gerrit.testutil.IndexVersionsTest.SCHEMA_DEF.getPrevious ( ) . getVersion ( ) ) ; } expected.add ( com.google.gerrit.testutil.IndexVersionsTest.SCHEMA_DEF.getLatest ( ) . getVersion ( ) ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.testutil.IndexVersionsTest.get ( "" ) ) . containsExactlyElementsIn ( expected ) . inOrder ( ) ; }

Target:
public void emptyValue ( ) { java.util.List < java.lang.Integer > expected = new java.util.ArrayList < > ( ) ; if ( ( com.google.gerrit.testing.IndexVersionsTest.SCHEMA_DEF.getPrevious ( ) ) != null ) { expected.add ( com.google.gerrit.testing.IndexVersionsTest.SCHEMA_DEF.getPrevious ( ) . getVersion ( ) ) ; } expected.add ( com.google.gerrit.testing.IndexVersionsTest.SCHEMA_DEF.getLatest ( ) . getVersion ( ) ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.testing.IndexVersionsTest.get ( "" ) ) . containsExactlyElementsIn ( expected ) . inOrder ( ) ; }
Source:
public org.eclipse.jgit.lib.Config getFromPluginConfig ( 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 ( ( pluginName + ".config" ) ) . get ( ) ; }

Target:
private com.google.gerrit.server.git.ProjectLevelConfig getPluginConfig ( 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 ( pluginName ) ; }
Source:
public void createDraftChangeNotAllowed ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( isAllowDrafts ( ) ) . isFalse ( ) ; com.google.gerrit.extensions.common.ChangeInfo ci = newChangeInfo ( ChangeStatus.DRAFT ) ; com.google.gerrit.acceptance.RestResponse r = adminSession.post ( "/changes/" , ci ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_METHOD_NOT_ALLOWED ) ; com.google.common.truth.Truth.assertThat ( r.getEntityContent ( ) ) . contains ( "cannot upload drafts" ) ; }

Target:
public void createDraftChangeNotAllowed ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( isAllowDrafts ( ) ) . isFalse ( ) ; com.google.gerrit.extensions.common.ChangeInfo ci = newChangeInfo ( ChangeStatus.DRAFT ) ; com.google.gerrit.acceptance.RestResponse r = adminSession.post ( "/changes/" , ci ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_METHOD_NOT_ALLOWED ) ; com.google.common.truth.Truth.assertThat ( r.getEntityContent ( ) ) . contains ( "draft workflow is disabled" ) ; }