auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static java.util.Map < java.lang.String , org.eclipse.jgit.lib.ObjectId > getChangedContent ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevCommit c ) throws java.io.IOException { final java.util.Map < java.lang.String , org.eclipse.jgit.lib.ObjectId > content = new java.util.HashMap < > ( ) ; com.googlesource.gerrit.plugins.uploadvalidator.CommitUtils.visitChangedEntries ( repo , c , new com.googlesource.gerrit.plugins.uploadvalidator.TreeWalkVisitor ( ) { @ java.lang.Override public void onVisit ( org.eclipse.jgit.treewalk.TreeWalk tw ) { if ( com.googlesource.gerrit.plugins.uploadvalidator.CommitUtils.isFile ( tw ) ) { content.put ( tw.getPathString ( ) , tw.getObjectId ( 0 ) ) ; } } } ) ; return content ; }

Target:
public static java.util.Map < java.lang.String , org.eclipse.jgit.lib.ObjectId > getChangedContent ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevCommit c , org.eclipse.jgit.revwalk.RevWalk revWalk ) throws java.io.IOException { final java.util.Map < java.lang.String , org.eclipse.jgit.lib.ObjectId > content = new java.util.HashMap < > ( ) ; com.googlesource.gerrit.plugins.uploadvalidator.CommitUtils.visitChangedEntries ( repo , c , revWalk , new com.googlesource.gerrit.plugins.uploadvalidator.TreeWalkVisitor ( ) { @ java.lang.Override public void onVisit ( org.eclipse.jgit.treewalk.TreeWalk tw ) { if ( com.googlesource.gerrit.plugins.uploadvalidator.CommitUtils.isFile ( tw ) ) { content.put ( tw.getPathString ( ) , tw.getObjectId ( 0 ) ) ; } } } ) ; return content ; }
Source:
public void rejectWhenFeatureIsDisabled ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; cfg.setEnableReviewerByEmail ( false ) ; saveProjectConfig ( project , cfg ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; exception.expect ( com.google.gerrit.extensions.restapi.UnprocessableEntityException.class ) ; exception.expectMessage ( "Foo Bar <foo.bar@gerritcodereview.com> does not identify a registered user or group" ) ; gApi.changes ( ) . id ( r.getChangeId ( ) ) . addReviewer ( "Foo Bar <foo.bar@gerritcodereview.com>" ) ; }

Target:
public void rejectWhenFeatureIsDisabled ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.extensions.api.projects.ConfigInput conf = new com.google.gerrit.extensions.api.projects.ConfigInput ( ) ; conf.enableReviewerByEmail = com.google.gerrit.extensions.client.InheritableBoolean.FALSE ; gApi.projects ( ) . name ( project.get ( ) ) . config ( conf ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; exception.expect ( com.google.gerrit.extensions.restapi.UnprocessableEntityException.class ) ; exception.expectMessage ( "Foo Bar <foo.bar@gerritcodereview.com> does not identify a registered user or group" ) ; gApi.changes ( ) . id ( r.getChangeId ( ) ) . addReviewer ( "Foo Bar <foo.bar@gerritcodereview.com>" ) ; }
Source:
public void testCreate_NotDirectory ( ) throws java.io.IOException { final java.nio.file.Path root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; try { java.nio.file.Files.createFile ( root ) ; try { new com.google.gerrit.server.config.SitePaths ( root ) ; org.junit.Assert.fail ( "Did not throw exception" ) ; } catch ( java.io.FileNotFoundException e ) { org.junit.Assert.assertEquals ( ( "Not a directory: " + root ) , e.getMessage ( ) ) ; } } finally { java.nio.file.Files.delete ( root ) ; } }

Target:
public void testCreate_NotDirectory ( ) throws java.io.IOException { final java.nio.file.Path root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; try { java.nio.file.Files.createFile ( root ) ; try { new com.google.gerrit.server.config.SitePaths ( root ) ; org.junit.Assert.fail ( "Did not throw exception" ) ; } catch ( java.nio.file.NotDirectoryException e ) { } } finally { java.nio.file.Files.delete ( root ) ; } }
Source:
private java.lang.String getByAccountName ( com.google.gerrit.server.git.CodeReviewCommit codeReviewCommit ) { com.google.gerrit.reviewdb.client.Account account = getAccount ( codeReviewCommit ) ; if ( ( account != null ) && ( ( account.getFullName ( ) ) != null ) ) { return " by " + ( account.getFullName ( ) ) ; } return "" ; }

Target:
public java.util.List < com.google.gerrit.common.data.SubmitRecord > getSubmitRecords ( com.google.gerrit.reviewdb.client.Change.Id id ) { com.google.gerrit.server.query.change.ChangeData cd = com.google.common.base.Preconditions.checkNotNull ( changes.get ( id ) , "ChangeData for %s" , id ) ; return com.google.common.base.Preconditions.checkNotNull ( cd.getSubmitRecords ( ) , "getSubmitRecord only valid after submit rules are evalutated" ) ; }
Source:
public void subsetOfBranchesVisibleNotIncludingHead ( ) throws java.lang.Exception { deny ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/master" ) ; allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/branch" ) ; assertRefs ( "refs/changes/02/2/1" , "refs/changes/02/2/meta" , "refs/heads/branch" ) ; }

Target:
public void allRefsVisibleNoRefsMetaConfig ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.server.project.Util.allow ( cfg , Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.allow ( cfg , Permission.READ , admins , "refs/meta/config" ) ; com.google.gerrit.server.project.Util.doNotInherit ( cfg , Permission.READ , "refs/meta/config" ) ; saveProjectConfig ( project , cfg ) ; assertRefs ( "HEAD" , "refs/changes/01/1/1" , "refs/changes/01/1/meta" , "refs/changes/02/2/1" , "refs/changes/02/2/meta" , "refs/heads/branch" , "refs/heads/master" , "refs/tags/branch-tag" , "refs/tags/master-tag" ) ; }
Source:
private Account.Id toAccountId ( final java.lang.String nameOrEmail ) throws com.google.gerrit.common.errors.NoSuchAccountException , com.google.gwtorm.client.OrmException { final com.google.gerrit.reviewdb.Account a = accountResolver.find ( nameOrEmail ) ; if ( a == null ) { throw new com.google.gerrit.common.errors.NoSuchAccountException ( ( ( "\"" + nameOrEmail ) + "\" is not registered" ) ) ; } return a.getId ( ) ; }

Target:
private Account.Id toAccountId ( final java.lang.String nameOrEmail ) throws com.google.gerrit.common.errors.NoSuchAccountException , com.google.gwtorm.client.OrmException { final com.google.gerrit.reviewdb.Account a = accountResolver.findByNameOrEmail ( nameOrEmail ) ; if ( a == null ) { throw new com.google.gerrit.common.errors.NoSuchAccountException ( ( ( "\"" + nameOrEmail ) + "\" is not registered" ) ) ; } return a.getId ( ) ; }
Source:
protected void migrateData ( com.google.gerrit.reviewdb.ReviewDb db , com.google.gerrit.server.schema.UpdateUI ui ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { systemConfig = db.systemConfig ( ) . get ( new com.google.gerrit.reviewdb.SystemConfig.Key ( ) ) ; assignGroupUUIDs ( db ) ; exportProjectConfig ( db ) ; }

Target:
protected void migrateData ( com.google.gerrit.reviewdb.ReviewDb db , com.google.gerrit.server.schema.UpdateUI ui ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { systemConfig = db.systemConfig ( ) . get ( new com.google.gerrit.reviewdb.SystemConfig.Key ( ) ) ; categoryMap = db.approvalCategories ( ) . toMap ( db.approvalCategories ( ) . all ( ) ) ; assignGroupUUIDs ( db ) ; readOldRefRights ( db ) ; readProjectParents ( db ) ; exportProjectConfig ( db ) ; deleteActionCategories ( db ) ; }
Source:
public void init ( final javax.servlet.ServletConfig config ) throws javax.servlet.ServletException { super . init ( config ) ; try { server = com.google.gerrit.server.GerritServer.getInstance ( ) ; } catch ( com.google.gwtorm.client.OrmException e ) { throw new javax.servlet.ServletException ( "Cannot load GerritServer" , e ) ; } catch ( com.google.gwtjsonrpc.server.XsrfException e ) { throw new javax.servlet.ServletException ( "Cannot load GerritServer" , e ) ; } rng = new java.security.SecureRandom ( ) ; }

Target:
public void init ( final javax.servlet.ServletConfig config ) throws javax.servlet.ServletException { super . init ( config ) ; try { server = com.google.gerrit.server.GerritServer.getInstance ( ) ; } catch ( com.google.gwtorm.client.OrmException e ) { throw new javax.servlet.ServletException ( "Cannot load GerritServer" , e ) ; } catch ( com.google.gwtjsonrpc.server.XsrfException e ) { throw new javax.servlet.ServletException ( "Cannot load GerritServer" , e ) ; } rng = new java.security.SecureRandom ( ) ; registry = com.google.gerrit.server.FileTypeRegistry.getInstance ( ) ; }
Source:
public void onRevisionCreated ( com.google.gerrit.extensions.events.RevisionCreatedListener.Event event ) { com.google.gerrit.extensions.common.ChangeInfo c = event.getChange ( ) ; if ( ( ignoreDrafts ) && ( ( c.status ) == ( com.google.gerrit.extensions.client.ChangeStatus.DRAFT ) ) ) { com.googlesource.gerrit.plugins.reviewers.ChangeEventListener.log.debug ( "Ignoring draft change" ) ; return ; } }

Target:
public void onRevisionCreated ( com.google.gerrit.extensions.events.RevisionCreatedListener.Event event ) { com.google.gerrit.extensions.common.ChangeInfo c = event.getChange ( ) ; if ( ( ignoreDrafts ) && ( ( c.status ) == ( com.google.gerrit.extensions.client.ChangeStatus.DRAFT ) ) ) { com.googlesource.gerrit.plugins.reviewers.ChangeEventListener.log.debug ( "Ignoring draft change" ) ; return ; } onEvent ( new com.google.gerrit.reviewdb.client.Project.NameKey ( c.project ) , c._number , event.getWho ( ) ) ; }
Source:
public void index ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change change ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.query.change.ChangeData cd ; if ( notesMigration.readChanges ( ) ) { cd = changeDataFactory.create ( db , change ) ; } else if ( notesMigration.writeChanges ( ) ) { com.google.gerrit.server.notedb.ChangeNotes notes = changeNotesFactory.createWithAutoRebuildingDisabled ( change , null ) ; cd = changeDataFactory.create ( db , notes ) ; } else { cd = changeDataFactory.create ( db , change ) ; } index ( cd ) ; }

Target:
public void index ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException , java.io.IOException { index ( newChangeData ( db , project , changeId ) ) ; }
Source:
public static java.lang.String getTargetOAuthFinal ( javax.servlet.http.HttpServletRequest httpRequest ) { java.lang.String targetUrl = com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getTargetUrl ( httpRequest ) ; java.lang.String code = com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getURLEncoded ( httpRequest.getParameter ( "code" ) ) ; java.lang.String state = com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getURLEncoded ( httpRequest.getParameter ( "state" ) ) ; return ( ( ( ( targetUrl + ( ( targetUrl.indexOf ( '?' ) ) < 0 ? '?' : '&' ) ) + "code=" ) + code ) + "&state=" ) + state ; }

Target:
public static java.lang.String getTargetOAuthFinal ( javax.servlet.http.HttpServletRequest httpRequest ) { java.lang.String targetUrl = com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getTargetUrl ( httpRequest ) ; java.lang.String code = com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getURLEncodedParameter ( "code=" , httpRequest.getParameter ( "code" ) ) ; java.lang.String state = com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getURLEncodedParameter ( "&state=" , httpRequest.getParameter ( "state" ) ) ; return ( ( targetUrl + ( ( targetUrl.indexOf ( '?' ) ) < 0 ? '?' : '&' ) ) + code ) + state ; }
Source:
static boolean refsAreStale ( com.google.gerrit.server.git.GitRepositoryManager repoManager , com.google.gerrit.reviewdb.client.Change.Id id , com.google.common.collect.SetMultimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.server.index.change.StalenessChecker.RefState > states , com.google.common.collect.Multimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.server.index.change.StalenessChecker.RefStatePattern > patterns ) { java.util.Set < com.google.gerrit.reviewdb.client.Project.NameKey > projects = com.google.common.collect.Sets.union ( states.keySet ( ) , patterns.keySet ( ) ) ; for ( com.google.gerrit.reviewdb.client.Project.NameKey p : projects ) { if ( com.google.gerrit.server.index.change.StalenessChecker.refsAreStale ( repoManager , id , p , states , patterns ) ) { return true ; } } return false ; }

Target:
static boolean refsAreStale ( com.google.gerrit.server.git.GitRepositoryManager repoManager , com.google.gerrit.reviewdb.client.Change.Id id , com.google.common.collect.SetMultimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.server.index.change.StalenessChecker.RefState > states , com.google.common.collect.ListMultimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.server.index.change.StalenessChecker.RefStatePattern > patterns ) { java.util.Set < com.google.gerrit.reviewdb.client.Project.NameKey > projects = com.google.common.collect.Sets.union ( states.keySet ( ) , patterns.keySet ( ) ) ; for ( com.google.gerrit.reviewdb.client.Project.NameKey p : projects ) { if ( com.google.gerrit.server.index.change.StalenessChecker.refsAreStale ( repoManager , id , p , states , patterns ) ) { return true ; } } return false ; }
Source:
private void expandAfter ( ) { net.codemirror.lib.TextMarker.FromTo range = textMarker.find ( ) ; int start = range.getFrom ( ) . getLine ( ) ; int oldEnd = range.getTo ( ) . getLine ( ) ; int newEnd = oldEnd - ( com.google.gerrit.client.diff.SkipBar.NUM_ROWS_TO_EXPAND ) ; textMarker.clear ( ) ; collapse ( start , newEnd , false ) ; updateSelection ( ) ; }

Target:
private void expandAfter ( ) { net.codemirror.lib.TextMarker.FromTo range = textMarker.find ( ) ; int start = range.getFrom ( ) . getLine ( ) ; int oldEnd = range.getTo ( ) . getLine ( ) ; int newEnd = oldEnd - ( com.google.gerrit.client.diff.SkipBar.NUM_ROWS_TO_EXPAND ) ; boolean attach = start == 0 ; if ( attach ) { clearMarkerAndWidget ( ) ; } else { textMarker.clear ( ) ; } collapse ( start , newEnd , attach ) ; updateSelection ( ) ; }
Source:
public void unblockForce ( ) { com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; r.setForce ( true ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertCanForceUpdate ( "refs/heads/master" , u ) ; }

Target:
public void unblockForce ( ) { com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.project.testing.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; r.setForce ( true ) ; com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.testing.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.testing.Util.DEVS ) ; assertCanForceUpdate ( "refs/heads/master" , u ) ; }
Source:
public void deleteBranchByProjectOwnerForcePushBlocked_Forbidden ( ) throws java.lang.Exception { grantOwner ( ) ; blockForcePush ( ) ; com.google.gerrit.acceptance.RestResponse r = userSession.delete ( ( ( ( "/projects/" + ( project.get ( ) ) ) + "/branches/" ) + ( branch.getShortName ( ) ) ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_FORBIDDEN ) ; r.consume ( ) ; }

Target:
public void deleteBranchByProjectOwnerForcePushBlocked_Forbidden ( ) throws java.lang.Exception { grantOwner ( ) ; blockForcePush ( ) ; setApiUser ( user ) ; assertDeleteForbidden ( ) ; }
Source:
private com.google.gerrit.server.change.SuggestReviewers.VisibilityControl getVisibility ( final com.google.gerrit.server.change.ChangeResource rsrc ) { if ( rsrc.getControl ( ) . getRefControl ( ) . isVisibleByRegisteredUsers ( ) ) { return new com.google.gerrit.server.change.SuggestReviewers.VisibilityControl ( ) { @ java.lang.Override public boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Account.Id account ) throws com.google.gwtorm.server.OrmException { return true ; } } ; } else { return new com.google.gerrit.server.change.SuggestReviewers.VisibilityControl ( ) { @ java.lang.Override public boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Account.Id account ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.IdentifiedUser who = identifiedUserFactory.create ( dbProvider , account ) ; return rsrc.getControl ( ) . forUser ( who ) . isRefVisible ( ) ; } } ; } }

Target:
public boolean getSuggestAccounts ( ) { return suggestAccounts ; }
Source:
public com.google.gerrit.extensions.api.accounts.AccountApi self ( ) throws com.google.gerrit.extensions.restapi.RestApiException { if ( ! ( self.get ( ) . isIdentifiedUser ( ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Authentication required" ) ; } return api.create ( new com.google.gerrit.server.account.AccountResource ( ( ( com.google.gerrit.server.IdentifiedUser ) ( self.get ( ) ) ) ) ) ; }

Target:
public com.google.gerrit.extensions.api.accounts.AccountApi self ( ) throws com.google.gerrit.extensions.restapi.RestApiException { if ( ! ( self.get ( ) . isIdentifiedUser ( ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Authentication required" ) ; } return api.create ( new com.google.gerrit.server.account.AccountResource ( self.get ( ) . asIdentifiedUser ( ) ) ) ; }
Source:
public com.google.gerrit.server.account.GroupControl controlFor ( final com.google.gerrit.reviewdb.AccountGroup.Id groupId ) throws com.google.gerrit.server.account.NoSuchGroupException { final com.google.gerrit.reviewdb.AccountGroup group = groupCache.get ( groupId ) ; if ( group == null ) { throw new com.google.gerrit.server.account.NoSuchGroupException ( groupId ) ; } return new com.google.gerrit.server.account.GroupControl ( user.get ( ) , group ) ; }

Target:
public com.google.gerrit.server.account.GroupControl controlFor ( final com.google.gerrit.reviewdb.AccountGroup.Id groupId ) throws com.google.gerrit.server.account.NoSuchGroupException { com.google.gerrit.reviewdb.AccountGroup group = com.google.gerrit.server.util.FutureUtil.getOrNull ( groupCache.get ( groupId ) ) ; if ( group == null ) { throw new com.google.gerrit.server.account.NoSuchGroupException ( groupId ) ; } return new com.google.gerrit.server.account.GroupControl ( user.get ( ) , group ) ; }
Source:
public void testPreformat3 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.html ( "A\n\n Q\n <R>\n S\n\nB" ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; org.junit.Assert.assertNotSame ( o , n ) ; org.junit.Assert.assertEquals ( ( ( ( ( ( ( "<p>A</p>" + "<p>" ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " Q" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " &lt;R&gt;" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " S" ) ) ) + "</p>" ) + "<p>B</p>" ) , n.asString ( ) ) ; }

Target:
public void testPreformat3 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.html ( "A\n\n Q\n <R>\n S\n\nB" ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; com.google.common.truth.Truth.assertThat ( o ) . isNotSameAs ( n ) ; com.google.common.truth.Truth.assertThat ( n.asString ( ) ) . isEqualTo ( ( ( ( ( ( ( "<p>A</p>" + "<p>" ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " Q" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " &lt;R&gt;" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyPreformatTest.pre ( " S" ) ) ) + "</p>" ) + "<p>B</p>" ) ) ; }
Source:
private boolean canPerformOnAllRefs ( com.google.gerrit.reviewdb.ApprovalCategory.Id actionId , short requireValue ) { return canPerform ( actionId , requireValue , "refs/*" ) ; }

Target:
private boolean canPerformOnAllRefs ( com.google.gerrit.reviewdb.ApprovalCategory.Id actionId , short requireValue ) { boolean canPerform = false ; final java.util.Set < java.lang.String > patterns = allRefPatterns ( actionId ) ; if ( patterns.contains ( RefRight.ALL ) ) { for ( final java.lang.String pattern : patterns ) { if ( controlForRef ( pattern ) . canPerform ( actionId , requireValue ) ) { canPerform = true ; } else { return false ; } } } return canPerform ; }
Source:
private void removeOldLib ( com.google.gerrit.server.config.SitePaths sitePaths , java.lang.String currentSecureStoreName ) { java.io.File oldSecureStore = findJarWithSecureStore ( sitePaths , currentSecureStoreName ) ; if ( oldSecureStore != null ) { com.google.gerrit.pgm.SwitchSecureStore.log.info ( "Removing old SecureStore ({}) from lib/ directory" , oldSecureStore.getName ( ) ) ; if ( ! ( oldSecureStore.delete ( ) ) ) { com.google.gerrit.pgm.SwitchSecureStore.log.error ( "Cannot remove {}" , oldSecureStore.getAbsolutePath ( ) ) ; } } else { com.google.gerrit.pgm.SwitchSecureStore.log.info ( "Cannot find jar with old SecureStore ({}) in lib/ directory" , currentSecureStoreName ) ; } }

Target:
private void removeOldLib ( com.google.gerrit.server.config.SitePaths sitePaths , java.lang.String currentSecureStoreName ) throws java.io.IOException { java.nio.file.Path oldSecureStore = findJarWithSecureStore ( sitePaths , currentSecureStoreName ) ; if ( oldSecureStore != null ) { com.google.gerrit.pgm.SwitchSecureStore.log.info ( "Removing old SecureStore ({}) from lib/ directory" , oldSecureStore.getFileName ( ) ) ; try { java.nio.file.Files.delete ( oldSecureStore ) ; } catch ( java.io.IOException e ) { com.google.gerrit.pgm.SwitchSecureStore.log.error ( "Cannot remove {}" , oldSecureStore.toAbsolutePath ( ) , e ) ; } } else { com.google.gerrit.pgm.SwitchSecureStore.log.info ( "Cannot find jar with old SecureStore ({}) in lib/ directory" , currentSecureStoreName ) ; } }
Source:
public void submitMultipleCommitsToEmptyRepoAsFastForward ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result change1 = createChange ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result change2 = createChange ( ) ; approve ( change1.getChangeId ( ) ) ; submit ( change2.getChangeId ( ) ) ; com.google.common.truth.Truth.assertThat ( getRemoteHead ( ) . getId ( ) ) . isEqualTo ( change2.getCommitId ( ) ) ; }

Target:
public void submitMultipleCommitsToEmptyRepoAsFastForward ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result change1 = createChange ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result change2 = createChange ( ) ; approve ( change1.getChangeId ( ) ) ; submit ( change2.getChangeId ( ) ) ; com.google.common.truth.Truth.assertThat ( getRemoteHead ( ) . getId ( ) ) . isEqualTo ( change2.getCommit ( ) ) ; }
Source:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.change.RevisionResource rsrc , com.google.gerrit.server.change.PublishDraftPatchSet.Input input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.update.UpdateException { return apply ( rsrc.getUser ( ) , rsrc.getChange ( ) , rsrc.getPatchSet ( ) . getId ( ) , rsrc.getPatchSet ( ) ) ; }

Target:
protected com.google.gerrit.extensions.restapi.Response < ? > applyImpl ( com.google.gerrit.server.update.BatchUpdate.Factory updateFactory , com.google.gerrit.server.change.RevisionResource rsrc , com.google.gerrit.server.change.PublishDraftPatchSet.Input input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.update.UpdateException { return apply ( updateFactory , rsrc.getUser ( ) , rsrc.getChange ( ) , rsrc.getPatchSet ( ) . getId ( ) , rsrc.getPatchSet ( ) ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.changes.ApprovalTable.PostResult result ) { addMemberBox.setEnabled ( true ) ; addMemberBox.setText ( "" ) ; if ( ( result.error ( ) ) == null ) { reload ( ) ; } else if ( result.confirm ( ) ) { askForConfirmation ( result.error ( ) ) ; } else { new com.google.gerrit.client.ErrorDialog ( new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) . append ( result.error ( ) ) ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.change.Reviewers.PostResult result ) { addMemberBox.setEnabled ( true ) ; addMemberBox.setText ( "" ) ; if ( ( result.error ( ) ) == null ) { reload ( ) ; } else if ( result.confirm ( ) ) { askForConfirmation ( result.error ( ) ) ; } else { new com.google.gerrit.client.ErrorDialog ( new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) . append ( result.error ( ) ) ) ; } }
Source:
private void readObject ( java.io.ObjectInputStream in ) throws java.io.IOException { oldId = org.eclipse.jgit.lib.ObjectIdSerializer.read ( in ) ; int n = in.readInt ( ) ; parentNum = ( n == 0 ) ? null : java.lang.Integer.valueOf ( n ) ; newId = org.eclipse.jgit.lib.ObjectIdSerializer.read ( in ) ; char t = in.readChar ( ) ; whitespace = PatchListKey.WHITESPACE_TYPES.inverse ( ) . get ( t ) ; if ( ( whitespace ) == null ) { throw new java.io.IOException ( ( "Invalid whitespace type code: " + t ) ) ; } }

Target:
private void readObject ( java.io.ObjectInputStream in ) throws java.io.IOException { oldId = org.eclipse.jgit.lib.ObjectIdSerialization.readCanBeNull ( in ) ; int n = in.readInt ( ) ; parentNum = ( n == 0 ) ? null : java.lang.Integer.valueOf ( n ) ; newId = org.eclipse.jgit.lib.ObjectIdSerialization.readNotNull ( in ) ; char t = in.readChar ( ) ; whitespace = PatchListKey.WHITESPACE_TYPES.inverse ( ) . get ( t ) ; if ( ( whitespace ) == null ) { throw new java.io.IOException ( ( "Invalid whitespace type code: " + t ) ) ; } }
Source:
public void currentRevision ( ) throws java.lang.Exception { com.google.gerrit.server.change.ChangeJson.ChangeInfo c = getChange ( changeId , com.google.gerrit.extensions.common.ListChangesOption.CURRENT_REVISION ) ; org.junit.Assert.assertEquals ( commitId ( 2 ) , c.currentRevision ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableSet.of ( commitId ( 2 ) ) , c.revisions.keySet ( ) ) ; org.junit.Assert.assertEquals ( 3 , c.revisions.get ( commitId ( 2 ) ) . _number ) ; }

Target:
public void currentRevision ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo c = get ( changeId , com.google.gerrit.extensions.common.ListChangesOption.CURRENT_REVISION ) ; org.junit.Assert.assertEquals ( commitId ( 2 ) , c.currentRevision ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableSet.of ( commitId ( 2 ) ) , c.revisions.keySet ( ) ) ; org.junit.Assert.assertEquals ( 3 , c.revisions.get ( commitId ( 2 ) ) . _number ) ; }
Source:
private boolean equals ( com.google.gerrit.reviewdb.client.PatchSet p , java.lang.String id ) { boolean exact = ( getField ( ) ) == ( com.google.gerrit.server.index.ChangeField.EXACT_COMMIT ) ; java.lang.String rev = ( ( p.getRevision ( ) ) != null ) ? p.getRevision ( ) . get ( ) : null ; return ( exact && ( id.equals ( rev ) ) ) || ( ( ( ! exact ) && ( rev != null ) ) && ( rev.startsWith ( id ) ) ) ; }

Target:
private boolean equals ( com.google.gerrit.reviewdb.client.PatchSet p , java.lang.String id ) { boolean exact = ( getField ( ) ) == ( com.google.gerrit.server.index.change.ChangeField.EXACT_COMMIT ) ; java.lang.String rev = ( ( p.getRevision ( ) ) != null ) ? p.getRevision ( ) . get ( ) : null ; return ( exact && ( id.equals ( rev ) ) ) || ( ( ( ! exact ) && ( rev != null ) ) && ( rev.startsWith ( id ) ) ) ; }
Source:
private void updateScreenHeader ( net.codemirror.lib.ScrollInfo si ) { if ( ( ( si.top ( ) ) == 0 ) && ( ! ( diffTable.isHeaderVisible ( ) ) ) ) { diffTable.setHeaderVisible ( true ) ; } else if ( ( ( si.top ( ) ) > ( 0.5 * ( si.clientHeight ( ) ) ) ) && ( diffTable.isHeaderVisible ( ) ) ) { diffTable.setHeaderVisible ( false ) ; } }

Target:
private void updateDiffTableHeader ( net.codemirror.lib.ScrollInfo si ) { if ( ( si.top ( ) ) == 0 ) { diffTable.setHeaderVisible ( true ) ; } else if ( ( si.top ( ) ) > ( 0.5 * ( si.clientHeight ( ) ) ) ) { diffTable.setHeaderVisible ( false ) ; } }
Source:
public boolean match ( com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { try { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > p = com.google.gerrit.server.query.Predicate.and ( new com.google.gerrit.server.query.change.LegacyChangeIdPredicate ( object.getId ( ) ) , this ) ; for ( com.google.gerrit.server.query.change.ChangeData cData : index.getSource ( p , com.google.gerrit.server.query.change.QueryOptions.oneResult ( ) ) . read ( ) ) { if ( cData.getId ( ) . equals ( object.getId ( ) ) ) { return true ; } } } catch ( com.google.gerrit.server.query.QueryParseException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } return false ; }

Target:
public boolean match ( com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { try { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > p = com.google.gerrit.server.query.Predicate.and ( new com.google.gerrit.server.query.change.LegacyChangeIdPredicate ( object.getId ( ) ) , this ) ; for ( com.google.gerrit.server.query.change.ChangeData cData : index.getSource ( p , com.google.gerrit.server.index.change.IndexedChangeQuery.oneResult ( ) ) . read ( ) ) { if ( cData.getId ( ) . equals ( object.getId ( ) ) ) { return true ; } } } catch ( com.google.gerrit.server.query.QueryParseException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } return false ; }
Source:
public void onSuccess ( final com.google.gerrit.common.data.HostPageData result ) { com.google.gwt.dom.client.Document.get ( ) . getElementById ( "gerrit_hostpagedata" ) . removeFromParent ( ) ; com.google.gerrit.client.Gerrit.myConfig = result.config ; com.google.gerrit.client.Gerrit.myTheme = result.theme ; if ( ( result.account ) != null ) { com.google.gerrit.client.Gerrit.myAccount = result.account ; com.google.gerrit.client.Gerrit.xGerritAuth = result.xGerritAuth ; } if ( ( result.accountDiffPref ) != null ) { com.google.gerrit.client.Gerrit.myAccountDiffPref = result.accountDiffPref ; com.google.gerrit.client.Gerrit.applyUserPreferences ( ) ; } onModuleLoad2 ( result ) ; }

Target:
public void onSuccess ( final com.google.gerrit.common.data.HostPageData result ) { com.google.gwt.dom.client.Document.get ( ) . getElementById ( "gerrit_hostpagedata" ) . removeFromParent ( ) ; com.google.gerrit.client.Gerrit.myConfig = result.config ; com.google.gerrit.client.Gerrit.myTheme = result.theme ; com.google.gerrit.client.Gerrit.isNoteDbEnabled = result.isNoteDbEnabled ; if ( ( result.account ) != null ) { com.google.gerrit.client.Gerrit.myAccount = result.account ; com.google.gerrit.client.Gerrit.xGerritAuth = result.xGerritAuth ; } if ( ( result.accountDiffPref ) != null ) { com.google.gerrit.client.Gerrit.myAccountDiffPref = result.accountDiffPref ; com.google.gerrit.client.Gerrit.applyUserPreferences ( ) ; } onModuleLoad2 ( result ) ; }
Source:
public void testSingleHeadText ( ) throws java.lang.Exception { com.google.gitiles.FakeHttpServletRequest req = com.google.gitiles.FakeHttpServletRequest.newRequest ( ) ; req.setPathInfo ( "/test/+refs/heads/master" ) ; req.setQueryString ( "format=TEXT" ) ; com.google.gitiles.FakeHttpServletResponse res = new com.google.gitiles.FakeHttpServletResponse ( ) ; servlet.service ( req , res ) ; assertEquals ( 200 , res.getStatus ( ) ) ; assertEquals ( ( ( id ( "refs/heads/master" ) ) + " refs/heads/master\n" ) , res.getActualBodyString ( ) ) ; }

Target:
public void singleHeadText ( ) throws java.lang.Exception { com.google.gitiles.FakeHttpServletRequest req = com.google.gitiles.FakeHttpServletRequest.newRequest ( ) ; req.setPathInfo ( "/test/+refs/heads/master" ) ; req.setQueryString ( "format=TEXT" ) ; com.google.gitiles.FakeHttpServletResponse res = new com.google.gitiles.FakeHttpServletResponse ( ) ; servlet.service ( req , res ) ; org.junit.Assert.assertEquals ( 200 , res.getStatus ( ) ) ; org.junit.Assert.assertEquals ( ( ( id ( "refs/heads/master" ) ) + " refs/heads/master\n" ) , res.getActualBodyString ( ) ) ; }
Source:
public java.util.Set < com.google.gerrit.reviewdb.Account > call ( ) throws com.google.gerrit.common.errors.NoSuchGroupException , com.google.gerrit.server.project.NoSuchProjectException , com.google.gwtorm.client.OrmException { if ( AccountGroup.PROJECT_OWNERS.equals ( groupUUID ) ) { return getProjectOwners ( ) ; } return getAllGroupMembers ( groupCache.get ( groupUUID ) , new java.util.HashSet < com.google.gerrit.reviewdb.AccountGroup.Id > ( ) ) ; }

Target:
public java.util.Set < com.google.gerrit.reviewdb.Account > call ( ) throws com.google.gerrit.common.errors.NoSuchGroupException , com.google.gerrit.server.project.NoSuchProjectException , com.google.gwtorm.client.OrmException { return listAccounts ( groupUUID , new java.util.HashSet < com.google.gerrit.reviewdb.AccountGroup.UUID > ( ) ) ; }
Source:
public static com.google.gerrit.common.data.Capable checkMagicBranchRefs ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.reviewdb.Project project ) { com.google.gerrit.common.data.Capable result = com.google.gerrit.server.util.MagicBranch.checkMagicBranchRef ( com.google.gerrit.server.util.MagicBranch.NEW_CHANGE , repo , project ) ; if ( result != ( com.google.gerrit.common.data.Capable.OK ) ) { return result ; } result = com.google.gerrit.server.util.MagicBranch.checkMagicBranchRef ( com.google.gerrit.server.util.MagicBranch.NEW_DRAFT_CHANGE , repo , project ) ; if ( result != ( com.google.gerrit.common.data.Capable.OK ) ) { return result ; } result = com.google.gerrit.server.util.MagicBranch.checkMagicBranchRef ( com.google.gerrit.server.util.MagicBranch.NEW_PUBLISH_CHANGE , repo , project ) ; if ( result != ( com.google.gerrit.common.data.Capable.OK ) ) { return result ; } return com.google.gerrit.common.data.Capable.OK ; }

Target:
public static java.lang.String getMagicRefNamePrefix ( java.lang.String refName ) { if ( refName.startsWith ( com.google.gerrit.server.util.MagicBranch.NEW_DRAFT_CHANGE ) ) { return com.google.gerrit.server.util.MagicBranch.NEW_DRAFT_CHANGE ; } if ( refName.startsWith ( com.google.gerrit.server.util.MagicBranch.NEW_PUBLISH_CHANGE ) ) { return com.google.gerrit.server.util.MagicBranch.NEW_PUBLISH_CHANGE ; } if ( refName.startsWith ( com.google.gerrit.server.util.MagicBranch.NEW_CHANGE ) ) { return com.google.gerrit.server.util.MagicBranch.NEW_CHANGE ; } return null ; }
Source:
public void assertHasPackFile ( com.google.gerrit.reviewdb.client.Project ... projects ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { for ( com.google.gerrit.reviewdb.client.Project.NameKey p : projects ) { com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( ( ( "Project " + ( p.get ( ) ) ) + " has no pack files." ) ) . that ( getPackFiles ( p ) ) . isNotEmpty ( ) ; } }

Target:
public void assertHasPackFile ( com.google.gerrit.reviewdb.client.Project ... projects ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { for ( com.google.gerrit.reviewdb.client.Project.NameKey p : projects ) { com.google.common.truth.Truth.assert_ ( ) . withMessage ( ( ( "Project " + ( p.get ( ) ) ) + " has no pack files." ) ) . that ( getPackFiles ( p ) ) . isNotEmpty ( ) ; } }
Source:
public void configureServlets ( ) { serveRegex ( "^/gerrit_ui/(?!rpc/)(.*)$" ) . with ( com.google.inject.Key.get ( javax.servlet.http.HttpServlet.class , com.google.inject.name.Names.named ( com.google.gerrit.httpd.raw.StaticModule.GWT_UI_SERVLET ) ) ) ; com.google.gerrit.httpd.raw.StaticModule.Paths p = getPaths ( ) ; if ( ( ( p.warFs ) == null ) && ( ( p.buckOut ) != null ) ) { filter ( "/" ) . through ( new com.google.gerrit.httpd.raw.RecompileGwtUiFilter ( p.buckOut , p.unpackedWar ) ) ; } }

Target:
public void configureServlets ( ) { serveRegex ( "^/gerrit_ui/(?!rpc/)(.*)$" ) . with ( com.google.inject.Key.get ( javax.servlet.http.HttpServlet.class , com.google.inject.name.Names.named ( com.google.gerrit.httpd.raw.StaticModule.GWT_UI_SERVLET ) ) ) ; com.google.gerrit.httpd.raw.StaticModule.Paths p = getPaths ( ) ; if ( p.isDev ( ) ) { filter ( "/" ) . through ( new com.google.gerrit.httpd.raw.RecompileGwtUiFilter ( p.buckOut , p.unpackedWar ) ) ; } }
Source:
public void testSyncUrlProvider ( ) { com.ericsson.gerrit.plugins.syncindex.Configuration configMock = org.mockito.Mockito.mock ( com.ericsson.gerrit.plugins.syncindex.Configuration.class ) ; java.lang.String expected = "someUrl" ; org.mockito.Mockito.when ( configMock.getUrl ( ) ) . thenReturn ( expected ) ; com.ericsson.gerrit.plugins.syncindex.Module module = new com.ericsson.gerrit.plugins.syncindex.Module ( ) ; com.google.common.truth.Truth.assertThat ( module.syncUrl ( configMock ) ) . isEqualTo ( expected ) ; }

Target:
public void testSyncUrlProvider ( ) { com.ericsson.gerrit.plugins.multimaster.Configuration configMock = org.mockito.Mockito.mock ( com.ericsson.gerrit.plugins.multimaster.Configuration.class ) ; java.lang.String expected = "someUrl" ; org.mockito.Mockito.when ( configMock.getUrl ( ) ) . thenReturn ( expected ) ; com.ericsson.gerrit.plugins.multimaster.Module module = new com.ericsson.gerrit.plugins.multimaster.Module ( ) ; com.google.common.truth.Truth.assertThat ( module.syncUrl ( configMock ) ) . isEqualTo ( expected ) ; }
Source:
public void start ( ) throws java.io.IOException { if ( ( acceptor ) == null ) { checkConfig ( ) ; final org.apache.mina.transport.socket.nio.NioSocketAcceptor ain = new org.apache.mina.transport.socket.nio.NioSocketAcceptor ( ) ; final org.apache.sshd.server.SessionFactory handler = getSessionFactory ( ) ; handler.setServer ( this ) ; ain.setHandler ( handler ) ; ain.setReuseAddress ( reuseAddress ) ; ain.bind ( new java.net.InetSocketAddress ( getPort ( ) ) ) ; acceptor = ain ; } }

Target:
public void start ( ) throws java.io.IOException { if ( ( acceptor ) == null ) { checkConfig ( ) ; final org.apache.mina.transport.socket.nio.NioSocketAcceptor ain = new org.apache.mina.transport.socket.nio.NioSocketAcceptor ( ) ; final org.apache.sshd.server.SessionFactory handler = getSessionFactory ( ) ; handler.setServer ( this ) ; ain.setHandler ( handler ) ; ain.setReuseAddress ( reuseAddress ) ; ain.bind ( listen ) ; acceptor = ain ; } }
Source:
private java.lang.String threadName ( ) { final org.apache.sshd.server.session.ServerSession session = com.google.gerrit.sshd.SshScopes.getContext ( ) . session ; final java.lang.String who = session.getUsername ( ) ; final com.google.gerrit.reviewdb.Account.Id id = session.getAttribute ( SshUtil.CURRENT_ACCOUNT ) ; return ( ( ( ( "SSH " + ( getFullCommandLine ( ) ) ) + " / " ) + who ) + " " ) + id ; }

Target:
public java.lang.String toString ( ) { final org.apache.sshd.server.session.ServerSession session = context.session ; final java.lang.String who = session.getUsername ( ) ; final com.google.gerrit.reviewdb.Account.Id id = session.getAttribute ( SshUtil.CURRENT_ACCOUNT ) ; return ( ( ( ( "SSH " + ( getFullCommandLine ( ) ) ) + " / " ) + who ) + " " ) + id ; }
Source:
private void initIncludedInAction ( com.google.gerrit.client.changes.ChangeInfo info ) { if ( ( info.status ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.MERGED ) ) { includedInAction = new com.google.gerrit.client.change.IncludedInAction ( info.legacy_id ( ) , style , headerLine , includedIn ) ; includedIn.setVisible ( true ) ; } }

Target:
private void initIncludedInAction ( com.google.gerrit.client.info.ChangeInfo info ) { if ( ( info.status ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.MERGED ) ) { includedInAction = new com.google.gerrit.client.change.IncludedInAction ( info.legacyId ( ) , style , headerLine , includedIn ) ; includedIn.setVisible ( true ) ; } }
Source:
public java.util.Map < java.lang.String , com.google.gerrit.server.config.ListCaches.CacheInfo > apply ( com.google.gerrit.server.config.ConfigResource rsrc ) { java.util.Map < java.lang.String , com.google.gerrit.server.config.ListCaches.CacheInfo > cacheInfos = new java.util.TreeMap < > ( ) ; for ( java.util.Map.Entry < java.lang.String , com.google.common.cache.Cache < ? , ? > > entry : getCaches ( ) . entrySet ( ) ) { cacheInfos.put ( entry.getKey ( ) , new com.google.gerrit.server.config.ListCaches.CacheInfo ( entry.getValue ( ) ) ) ; } return cacheInfos ; }

Target:
public java.util.Map < java.lang.String , com.google.gerrit.server.config.ListCaches.CacheInfo > apply ( com.google.gerrit.server.config.ConfigResource rsrc ) { java.util.Map < java.lang.String , com.google.gerrit.server.config.ListCaches.CacheInfo > cacheInfos = new java.util.TreeMap < > ( ) ; for ( com.google.gerrit.extensions.registration.DynamicMap.Entry < com.google.common.cache.Cache < ? , ? > > e : cacheMap ) { cacheInfos.put ( com.google.gerrit.server.config.CacheResource.cacheNameOf ( e.getPluginName ( ) , e.getExportName ( ) ) , new com.google.gerrit.server.config.ListCaches.CacheInfo ( e.getProvider ( ) . get ( ) ) ) ; } return cacheInfos ; }
Source:
public void removeNonexisting ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key1 = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithoutExpiration ( ) ; store.add ( key1.getPublicKeyRing ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , store.save ( newCommitBuilder ( ) ) ) ; com.google.gerrit.gpg.testutil.TestKey key2 = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithExpiration ( ) ; store.remove ( key2.getPublicKey ( ) . getFingerprint ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NO_CHANGE , store.save ( newCommitBuilder ( ) ) ) ; assertKeys ( key1.getKeyId ( ) , key1 ) ; }

Target:
public void removeNonexisting ( ) throws java.lang.Exception { com.google.gerrit.gpg.testing.TestKey key1 = com.google.gerrit.gpg.testing.TestKeys.validKeyWithoutExpiration ( ) ; store.add ( key1.getPublicKeyRing ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , store.save ( newCommitBuilder ( ) ) ) ; com.google.gerrit.gpg.testing.TestKey key2 = com.google.gerrit.gpg.testing.TestKeys.validKeyWithExpiration ( ) ; store.remove ( key2.getPublicKey ( ) . getFingerprint ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NO_CHANGE , store.save ( newCommitBuilder ( ) ) ) ; assertKeys ( key1.getKeyId ( ) , key1 ) ; }
Source:
public void copyInReviewDb ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet ps , @ com.google.gerrit.common.Nullable org.eclipse.jgit.revwalk.RevWalk rw , @ com.google.gerrit.common.Nullable org.eclipse.jgit.lib.Config repoConfig , java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > dontCopy ) throws com.google.gwtorm.server.OrmException { if ( ( com.google.gerrit.server.notedb.NoteDbChangeState.PrimaryStorage.of ( ctl.getChange ( ) ) ) == ( com.google.gerrit.server.notedb.NoteDbChangeState.PrimaryStorage.REVIEW_DB ) ) { db.patchSetApprovals ( ) . insert ( getForPatchSet ( db , ctl , ps , rw , repoConfig , dontCopy ) ) ; } }

Target:
public void copyInReviewDb ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.server.CurrentUser user , com.google.gerrit.reviewdb.client.PatchSet ps , @ com.google.gerrit.common.Nullable org.eclipse.jgit.revwalk.RevWalk rw , @ com.google.gerrit.common.Nullable org.eclipse.jgit.lib.Config repoConfig , java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > dontCopy ) throws com.google.gwtorm.server.OrmException { if ( ( com.google.gerrit.server.notedb.NoteDbChangeState.PrimaryStorage.of ( notes.getChange ( ) ) ) == ( com.google.gerrit.server.notedb.NoteDbChangeState.PrimaryStorage.REVIEW_DB ) ) { db.patchSetApprovals ( ) . insert ( getForPatchSet ( db , notes , user , ps , rw , repoConfig , dontCopy ) ) ; } }
Source:
javax.servlet.http.HttpServlet getGwtUiServlet ( @ com.google.inject.name.Named ( value = com.google.gerrit.httpd.raw.StaticModule.CACHE ) com.google.common.cache.Cache < java.nio.file.Path , com.google.gerrit.httpd.raw.ResourceServlet.Resource > cache ) throws java.io.IOException { com.google.gerrit.httpd.raw.Paths p = getPaths ( ) ; if ( ( p.warFs ) != null ) { return new com.google.gerrit.httpd.raw.WarGwtUiServlet ( cache , p.warFs ) ; } else { return new com.google.gerrit.httpd.raw.DeveloperGwtUiServlet ( cache , p.unpackedWar ) ; } }

Target:
public void configureServlets ( ) { serveRegex ( "^/gerrit_ui/(?!rpc/)(.*)$" ) . with ( com.google.inject.Key.get ( javax.servlet.http.HttpServlet.class , com.google.inject.name.Names.named ( com.google.gerrit.httpd.raw.StaticModule.GWT_UI_SERVLET ) ) ) ; com.google.gerrit.httpd.raw.StaticModule.Paths p = getPaths ( ) ; if ( ( ( p.warFs ) == null ) && ( ( p.buckOut ) != null ) ) { filter ( "/" ) . through ( new com.google.gerrit.httpd.raw.RecompileGwtUiFilter ( p.buckOut , p.unpackedWar ) ) ; } }
Source:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.ChangeInfo revertChange , java.sql.Timestamp when ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.ChangeReverted.Event event = new com.google.gerrit.server.extensions.events.ChangeReverted.Event ( change , revertChange , when ) ; for ( com.google.gerrit.extensions.events.ChangeRevertedListener l : listeners ) { try { l.onChangeReverted ( event ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.extensions.events.ChangeReverted.log.warn ( "Error in event listener" , e ) ; } } }

Target:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.ChangeInfo revertChange , java.sql.Timestamp when ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.ChangeReverted.Event event = new com.google.gerrit.server.extensions.events.ChangeReverted.Event ( change , revertChange , when ) ; for ( com.google.gerrit.extensions.events.ChangeRevertedListener l : listeners ) { try { l.onChangeReverted ( event ) ; } catch ( java.lang.Exception e ) { util.logEventListenerError ( com.google.gerrit.server.extensions.events.ChangeReverted.log , e ) ; } } }