auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > onCommitReceived ( com.google.gerrit.server.events.CommitReceivedEvent receiveEvent ) throws com.google.gerrit.server.git.validators.CommitValidationException { if ( itsConfig.isEnabled ( receiveEvent.project.getName ( ) , receiveEvent.refName ) ) { return validCommit ( receiveEvent.commit ) ; } else { return java.util.Collections.emptyList ( ) ; } }

Target:
public java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > onCommitReceived ( com.google.gerrit.server.events.CommitReceivedEvent receiveEvent ) throws com.google.gerrit.server.git.validators.CommitValidationException { if ( itsConfig.isEnabled ( receiveEvent.getProjectNameKey ( ) , receiveEvent.getRefName ( ) ) ) { return validCommit ( receiveEvent.commit ) ; } else { return java.util.Collections.emptyList ( ) ; } }
Source:
private synchronized void recheck ( final com.google.gerrit.server.git.ChangeMergeQueue.RecheckJob e ) { final long remainingDelay = ( e.recheckAt ) - ( com.google.gerrit.server.util.TimeUtil.nowMs ( ) ) ; if ( ( java.util.concurrent.TimeUnit.MILLISECONDS.convert ( 10 , java.util.concurrent.TimeUnit.SECONDS ) ) < remainingDelay ) { workQueue.getDefaultQueue ( ) . schedule ( e , remainingDelay , java.util.concurrent.TimeUnit.MILLISECONDS ) ; } else { schedule ( e.dest ) ; } }

Target:
private synchronized void recheck ( final com.google.gerrit.server.git.ChangeMergeQueue.RecheckJob e ) { final long remainingDelay = ( e.recheckAt ) - ( com.google.gerrit.common.TimeUtil.nowMs ( ) ) ; if ( ( java.util.concurrent.TimeUnit.MILLISECONDS.convert ( 10 , java.util.concurrent.TimeUnit.SECONDS ) ) < remainingDelay ) { workQueue.getDefaultQueue ( ) . schedule ( e , remainingDelay , java.util.concurrent.TimeUnit.MILLISECONDS ) ; } else { schedule ( e.dest ) ; } }
Source:
public void doClaSignupHook ( com.google.gerrit.reviewdb.client.Account account , java.lang.String claName ) { if ( account != null ) { java.util.List < java.lang.String > args = new java.util.ArrayList < > ( ) ; addArg ( args , "--submitter" , getDisplayName ( account ) ) ; addArg ( args , "--user-id" , account.getId ( ) . toString ( ) ) ; addArg ( args , "--cla-name" , claName ) ; runHook ( claSignedHook , args ) ; } }

Target:
public void doClaSignupHook ( com.google.gerrit.reviewdb.client.Account account , java.lang.String claName ) { if ( ! ( claSignedHook.isPresent ( ) ) ) { return ; } if ( account != null ) { java.util.List < java.lang.String > args = new java.util.ArrayList < > ( ) ; addArg ( args , "--submitter" , getDisplayName ( account ) ) ; addArg ( args , "--user-id" , account.getId ( ) . toString ( ) ) ; addArg ( args , "--cla-name" , claName ) ; runHook ( claSignedHook , args ) ; } }
Source:
void onRenderEntireFile ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > e ) { prefs.renderEntireFile ( e.getValue ( ) ) ; if ( ( view ) != null ) { view.updateRenderEntireFile ( ) ; } }

Target:
void onMatchBrackets ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > e ) { prefs.matchBrackets ( e.getValue ( ) ) ; view.getCmFromSide ( DisplaySide.A ) . setOption ( "matchBrackets" , prefs.matchBrackets ( ) ) ; view.getCmFromSide ( DisplaySide.B ) . setOption ( "matchBrackets" , prefs.matchBrackets ( ) ) ; }
Source:
void setHeaderVisible ( boolean show ) { headerVisible = show ; com.google.gwt.user.client.ui.UIObject.setVisible ( patchSetNavRow , show ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( diffHeaderRow , ( show && ( header ) ) ) ; if ( show ) { parent.header.removeStyleName ( com.google.gerrit.client.diff.DiffTable.style.fullscreen ( ) ) ; } else { parent.header.addStyleName ( com.google.gerrit.client.diff.DiffTable.style.fullscreen ( ) ) ; } parent.resizeCodeMirror ( ) ; }

Target:
void setHeaderVisible ( boolean show ) { headerVisible = ( ! ( autoHideHeader ) ) || show ; showHeader ( headerVisible ) ; }
Source:
public com.google.gwtjsonrpc.client.VoidResult run ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.Account a = db.accounts ( ) . get ( com.google.gerrit.client.rpc.RpcUtil.getAccountId ( ) ) ; a.setDefaultContext ( newSetting ) ; db.accounts ( ) . update ( java.util.Collections.singleton ( a ) ) ; return com.google.gwtjsonrpc.client.VoidResult.INSTANCE ; }

Target:
public com.google.gwtjsonrpc.client.VoidResult run ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.Account a = db.accounts ( ) . get ( com.google.gerrit.client.rpc.Common.getAccountId ( ) ) ; a.setDefaultContext ( newSetting ) ; db.accounts ( ) . update ( java.util.Collections.singleton ( a ) ) ; return com.google.gwtjsonrpc.client.VoidResult.INSTANCE ; }
Source:
private void assertCanEdit ( com.google.gerrit.server.notedb.ChangeNotes notes ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException { if ( ! ( currentUser.get ( ) . isIdentifiedUser ( ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Authentication required" ) ; } try { permissionBackend.user ( currentUser ) . database ( reviewDb ) . change ( notes ) . check ( ChangePermission.ADD_PATCH_SET ) ; projectCache.checkedGet ( notes.getProjectName ( ) ) . checkStatePermitsWrite ( ) ; } catch ( com.google.gerrit.extensions.restapi.AuthException denied ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "edit not permitted" , denied ) ; } }

Target:
private void assertCanEdit ( com.google.gerrit.server.notedb.ChangeNotes notes ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException { if ( ! ( currentUser.get ( ) . isIdentifiedUser ( ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Authentication required" ) ; } try { permissionBackend.currentUser ( ) . database ( reviewDb ) . change ( notes ) . check ( ChangePermission.ADD_PATCH_SET ) ; projectCache.checkedGet ( notes.getProjectName ( ) ) . checkStatePermitsWrite ( ) ; } catch ( com.google.gerrit.extensions.restapi.AuthException denied ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "edit not permitted" , denied ) ; } }
Source:
private void serveGwtUi ( ) { serve ( "/gerrit_ui/*" ) . 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 ) ) ) ; if ( ( warFs ) == null ) { filter ( "/" ) . through ( new com.google.gerrit.httpd.raw.RecompileGwtUiFilter ( buckOut , unpackedWar ) ) ; } }

Target:
protected void configureServlets ( ) { serve ( "/static/*" ) . with ( com.google.gerrit.httpd.raw.SiteStaticDirectoryServlet.class ) ; install ( new com.google.gerrit.server.cache.CacheModule ( ) { @ java.lang.Override protected void configure ( ) { cache ( com.google.gerrit.httpd.raw.StaticModule.CACHE , java.nio.file.Path.class , com.google.gerrit.httpd.raw.ResourceServlet.Resource.class ) . maximumWeight ( ( 1 << 20 ) ) . weigher ( ResourceServlet.Weigher.class ) ; } } ) ; if ( options.enablePolyGerrit ( ) ) { servePolyGerritUi ( ) ; } else if ( options.enableDefaultUi ( ) ) { serveGwtUi ( ) ; } }
Source:
public static void patch ( java.lang.String token , com.google.gerrit.reviewdb.client.PatchSet.Id base , com.google.gerrit.reviewdb.client.Patch.Key id , int patchIndex , com.google.gerrit.common.data.PatchSetDetail patchSetDetail , com.google.gerrit.client.changes.PatchTable patchTable , java.lang.String panelType ) { com.google.gerrit.client.Dispatcher.patch ( token , base , id , patchIndex , patchSetDetail , patchTable , null , panelType ) ; }

Target:
public void onSuccess ( ) { com.google.gerrit.client.patches.UnifiedPatchScreen.TopView top = com.google.gerrit.client.Gerrit.getPatchScreenTopView ( ) ; com.google.gerrit.client.Gerrit.display ( token , new com.google.gerrit.client.patches.UnifiedPatchScreen ( id , top , baseId ) ) ; }
Source:
private boolean isMergeable ( com.google.gerrit.reviewdb.client.Change c ) { final com.google.gerrit.server.git.CodeReviewCommit commit = commits.get ( c.getId ( ) ) ; final com.google.gerrit.server.git.CommitMergeStatus s = ( commit != null ) ? commit.statusCode : null ; boolean isMergeable = false ; if ( ( s != null ) && ( ( ( s.equals ( CommitMergeStatus.CLEAN_MERGE ) ) || ( s.equals ( CommitMergeStatus.CLEAN_PICK ) ) ) || ( s.equals ( CommitMergeStatus.ALREADY_MERGED ) ) ) ) { isMergeable = true ; } return isMergeable ; }

Target:
private void preMerge ( final com.google.gerrit.server.git.SubmitStrategy strategy , final java.util.List < com.google.gerrit.server.git.CodeReviewCommit > toMerge ) throws com.google.gerrit.server.git.MergeException { mergeTip = strategy.run ( branchTip , toMerge ) ; refLogIdent = strategy.getRefLogIdent ( ) ; commits.putAll ( strategy.getNewCommits ( ) ) ; }
Source:
public void setNotify ( final com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType type , final boolean v ) { switch ( type ) { case NEW_CHANGES : notifyNewChanges = v ; break ; case NEW_PATCHSETS : notifyNewPatchSets = v ; break ; case ALL_COMMENTS : notifyAllComments = v ; break ; case SUBMITTED_CHANGES : notifySubmittedChanges = v ; break ; case ALL : notifyNewChanges = v ; notifyNewPatchSets = v ; notifyAllComments = v ; notifySubmittedChanges = v ; break ; } }

Target:
public void setNotify ( final com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType type , final boolean v ) { switch ( type ) { case NEW_CHANGES : notifyNewChanges = v ; break ; case NEW_PATCHSETS : notifyNewPatchSets = v ; break ; case ALL_COMMENTS : notifyAllComments = v ; break ; case SUBMITTED_CHANGES : notifySubmittedChanges = v ; break ; case ABANDONED_CHANGES : notifyAbandonedChanges = v ; break ; case ALL : notifyNewChanges = v ; notifyNewPatchSets = v ; notifyAllComments = v ; notifySubmittedChanges = v ; notifyAbandonedChanges = v ; break ; } }
Source:
private com.google.gwtexpui.safehtml.client.SafeHtml showTabAfterSpace ( com.google.gwtexpui.safehtml.client.SafeHtml src ) { final java.lang.String m = "( ( |<span[^>]*>|</span>)*\t)" ; final java.lang.String r = "<span class=\"wse\">$1</span>" ; src = src.replaceFirst ( ( "^" + m ) , r ) ; src = src.replaceAll ( ( "\n" + m ) , ( "\n" + r ) ) ; return src ; }

Target:
private com.google.gwtexpui.safehtml.client.SafeHtml showTabAfterSpace ( com.google.gwtexpui.safehtml.client.SafeHtml src ) { final java.lang.String m = "( ( |<span[^>]*>|</span>)*\t)" ; final java.lang.String r = ( ( ( "<span class=\"wse\"" + " title=\"" ) + ( PrettifyConstants.C.wseTabAfterSpace ( ) ) ) + "\"" ) + ">$1</span>" ; src = src.replaceFirst ( ( "^" + m ) , r ) ; src = src.replaceAll ( ( "\n" + m ) , ( "\n" + r ) ) ; return src ; }
Source:
public boolean deleteKey ( int seq ) { com.google.common.base.Preconditions.checkState ( ( ( keys ) != null ) , "SSH keys not loaded yet" ) ; if ( ( keys.containsKey ( seq ) ) && ( keys.get ( seq ) . isPresent ( ) ) ) { keys.put ( seq , com.google.common.base.Optional.< com.google.gerrit.reviewdb.client.AccountSshKey > absent ( ) ) ; return true ; } return false ; }

Target:
private boolean deleteKey ( int seq ) { checkLoaded ( ) ; if ( ( seq <= ( keys.size ( ) ) ) && ( keys.get ( ( seq - 1 ) ) . isPresent ( ) ) ) { keys.set ( ( seq - 1 ) , com.google.common.base.Optional.< com.google.gerrit.reviewdb.client.AccountSshKey > absent ( ) ) ; return true ; } return false ; }
Source:
public void run ( ) { try { for ( com.googlesrouce.gerrit.plugins.github.git.ImportStep importStep : importSteps ) { importStep.doImport ( this ) ; } status = GitJobStatus.COMPLETE ; } catch ( java.lang.Exception e ) { if ( ( status ) == ( GitJobStatus.SYNC ) ) { this . exception = e ; status = GitJobStatus.FAILED ; } rollback ( ) ; } }

Target:
public void run ( ) { try { status.update ( Code.SYNC , "Init" , "Initializing import steps ..." ) ; for ( com.googlesrouce.gerrit.plugins.github.git.ImportStep importStep : importSteps ) { importStep.doImport ( this ) ; } status.update ( GitJobStatus.Code.COMPLETE , "Done" , "Done: repository replicated to Gerrit." ) ; } catch ( java.lang.Exception e ) { if ( ( status.getStatus ( ) ) == ( com.googlesrouce.gerrit.plugins.github.git.GitJobStatus.Code.SYNC ) ) { this . exception = e ; status.update ( GitJobStatus.Code.FAILED , "Failed" , getStatusDescription ( ) ) ; } rollback ( ) ; } }
Source:
private java.lang.String url ( com.google.gerrit.client.info.FileInfo info ) { return info.binary ( ) ? com.google.gerrit.client.Dispatcher.toUnified ( base , curr , info.path ( ) ) : ( mode ) == ( com.google.gerrit.client.change.FileTable.Mode.REVIEW ) ? com.google.gerrit.client.Dispatcher.toPatch ( base , curr , info.path ( ) ) : com.google.gerrit.client.Dispatcher.toEditScreen ( curr , info.path ( ) ) ; }

Target:
private void setReviewed ( com.google.gerrit.client.info.FileInfo info , boolean r ) { com.google.gerrit.client.rpc.RestApi api = com.google.gerrit.client.changes.ChangeApi.revision ( project.get ( ) , curr ) . view ( "files" ) . id ( info.path ( ) ) . view ( "reviewed" ) ; if ( r ) { api.put ( com.google.gerrit.client.rpc.CallbackGroup.< com.google.gerrit.client.changes.ReviewInfo > emptyCallback ( ) ) ; } else { api.delete ( com.google.gerrit.client.rpc.CallbackGroup.< com.google.gerrit.client.changes.ReviewInfo > emptyCallback ( ) ) ; } }
Source:
public void onValueChange ( final com.google.gwt.event.logical.shared.ValueChangeEvent < com.google.gerrit.common.data.ChangeDetail > event ) { if ( isAttached ( ) ) { com.google.gerrit.client.changes.ChangeApi.detail ( event.getValue ( ) . getChange ( ) . getId ( ) . get ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.common.data.com.google.gerrit.client.changes.ChangeInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.common.data.com.google.gerrit.client.changes.ChangeInfo result ) { changeInfo = result ; display ( event.getValue ( ) ) ; } } ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.projects.ConfigInfo result ) { commentLinkProcessor = new com.google.gerrit.client.ui.CommentLinkProcessor ( result.commentlinks ( ) ) ; }
Source:
protected void authorizeUser ( com.google.gerrit.server.project.ProjectControl control ) throws org.eclipse.jgit.lfs.errors.LfsUnauthorized { try { permissionBackend.user ( control.getUser ( ) ) . project ( control.getProject ( ) . getNameKey ( ) ) . check ( com.google.gerrit.server.permissions.ProjectPermission.ACCESS ) ; } catch ( com.google.gerrit.extensions.restapi.AuthException | com.google.gerrit.server.permissions.PermissionBackendException e ) { throwUnauthorizedOp ( "list locks" , control ) ; } }

Target:
protected void authorizeUser ( com.google.gerrit.server.project.ProjectState state , com.google.gerrit.server.CurrentUser user ) throws org.eclipse.jgit.lfs.errors.LfsUnauthorized { try { permissionBackend.user ( user ) . project ( state.getProject ( ) . getNameKey ( ) ) . check ( com.google.gerrit.server.permissions.ProjectPermission.ACCESS ) ; } catch ( com.google.gerrit.extensions.restapi.AuthException | com.google.gerrit.server.permissions.PermissionBackendException e ) { throwUnauthorizedOp ( "list locks" , state , user ) ; } }
Source:
public com.google.gerrit.server.notedb.ChangeNotes create ( 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 { com.google.gerrit.reviewdb.client.Change change = db.changes ( ) . get ( changeId ) ; com.google.common.base.Preconditions.checkArgument ( change.getProject ( ) . equals ( project ) , ( "passed project %s when creating ChangeNotes for %s, but actual" + " project is %s" ) , project , changeId , change.getProject ( ) ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( repoManager , migration , allUsers , project , change ) . load ( ) ; }

Target:
public com.google.gerrit.server.notedb.ChangeNotes create ( 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 { com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.server.notedb.ChangeNotes.Factory.unwrap ( db ) . changes ( ) . get ( changeId ) ; com.google.common.base.Preconditions.checkArgument ( change.getProject ( ) . equals ( project ) , ( "passed project %s when creating ChangeNotes for %s, but actual" + " project is %s" ) , project , changeId , change.getProject ( ) ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( repoManager , migration , allUsers , changeNoteUtil , commentsUtil , project , change ) . load ( ) ; }
Source:
public void start ( ) { names = list ( ) ; }

Target:
public java.util.SortedSet < com.google.gerrit.reviewdb.client.Project.NameKey > list ( ) { com.google.gerrit.server.git.LocalDiskRepositoryManager.ProjectVisitor visitor = new com.google.gerrit.server.git.LocalDiskRepositoryManager.ProjectVisitor ( basePath ) ; scanProjects ( visitor ) ; namesUpdateLock.lock ( ) ; try { names = java.util.Collections.unmodifiableSortedSet ( visitor.found ) ; } finally { namesUpdateLock.unlock ( ) ; } return names ; }
Source:
public T call ( ) throws java.lang.Exception { com.google.gerrit.server.util.RequestContext old = local.setContext ( context ) ; try { return callable.call ( ) ; } finally { local.setContext ( old ) ; } }

Target:
public T call ( ) throws java.lang.Exception { com.google.gerrit.server.util.RequestContext old = local.setContext ( new com.google.gerrit.server.util.RequestContext ( ) { @ java.lang.Override public com.google.gerrit.server.CurrentUser getCurrentUser ( ) { return user ; } @ java.lang.Override public com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > getReviewDbProvider ( ) { return dbProviderProvider.get ( ) ; } } ) ; try { return callable.call ( ) ; } finally { local.setContext ( old ) ; } }
Source:
private static void a2b ( com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.actions.ActionInfo > actions , java.lang.String a , com.google.gwt.user.client.ui.Button b ) { if ( actions.containsKey ( a ) ) { b.setVisible ( true ) ; com.google.gerrit.client.actions.ActionInfo actionInfo = actions.get ( a ) ; b.setTitle ( actionInfo.title ( ) ) ; b.setEnabled ( actionInfo.enabled ( ) ) ; } }

Target:
private static void a2b ( com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.info.ActionInfo > actions , java.lang.String a , com.google.gwt.user.client.ui.Button b ) { if ( actions.containsKey ( a ) ) { b.setVisible ( true ) ; com.google.gerrit.client.info.ActionInfo actionInfo = actions.get ( a ) ; b.setTitle ( actionInfo.title ( ) ) ; b.setEnabled ( actionInfo.enabled ( ) ) ; } }
Source:
public boolean hasEmailAddress ( com.google.gerrit.server.IdentifiedUser user , java.lang.String email ) { for ( com.google.gerrit.reviewdb.client.AccountExternalId ext : user.state ( ) . getExternalIds ( ) ) { if ( ( email != null ) && ( email.equalsIgnoreCase ( ext.getEmailAddress ( ) ) ) ) { return true ; } } return false ; }

Target:
public boolean hasEmailAddress ( com.google.gerrit.server.IdentifiedUser user , java.lang.String email ) { for ( com.google.gerrit.server.account.ExternalId ext : user.state ( ) . getExternalIds ( ) ) { if ( ( email != null ) && ( email.equalsIgnoreCase ( ext.email ( ) ) ) ) { return true ; } } return false ; }
Source:
public boolean apply ( com.google.gerrit.server.events.RefEvent input ) { com.google.common.truth.Truth.assertThat ( input ) . isInstanceOf ( com.google.gerrit.server.events.ChangeMergedEvent.class ) ; com.google.gerrit.server.events.ChangeMergedEvent e = ( ( com.google.gerrit.server.events.ChangeMergedEvent ) ( input ) ) ; return e.change.get ( ) . number.equals ( changeNumber ) ; }

Target:
public void assertChangeMergedEvents ( java.lang.String project , java.lang.String branch , java.lang.String ... expected ) throws java.lang.Exception { com.google.common.collect.ImmutableList < com.google.gerrit.server.events.ChangeMergedEvent > events = getChangeMergedEvents ( project , branch , ( ( expected.length ) / 2 ) ) ; int i = 0 ; for ( com.google.gerrit.server.events.ChangeMergedEvent event : events ) { java.lang.String id = event.change.get ( ) . id ; com.google.common.truth.Truth.assertThat ( id ) . isEqualTo ( expected [ i ] ) ; com.google.common.truth.Truth.assertThat ( event.newRev ) . isEqualTo ( expected [ ( i + 1 ) ] ) ; i += 2 ; } }
Source:
public void trailingSlashes ( ) { org.junit.Assert.assertEquals ( "/foo/bar/" , com.google.gerrit.util.http.RequestUtil.getEncodedPathInfo ( mockRequest ( "/c/s/foo/bar/" , "/c" , "/s" ) ) ) ; org.junit.Assert.assertEquals ( "/foo/bar/" , com.google.gerrit.util.http.RequestUtil.getEncodedPathInfo ( mockRequest ( "/c/s/foo/bar///" , "/c" , "/s" ) ) ) ; org.junit.Assert.assertEquals ( "/foo%2Fbar/" , com.google.gerrit.util.http.RequestUtil.getEncodedPathInfo ( mockRequest ( "/c/s/foo%2Fbar/" , "/c" , "/s" ) ) ) ; org.junit.Assert.assertEquals ( "/foo%2Fbar/" , com.google.gerrit.util.http.RequestUtil.getEncodedPathInfo ( mockRequest ( "/c/s/foo%2Fbar///" , "/c" , "/s" ) ) ) ; }

Target:
public void trailingSlashes ( ) { com.google.common.truth.Truth.assertThat ( com.google.gerrit.util.http.RequestUtil.getEncodedPathInfo ( mockRequest ( "/c/s/foo/bar/" , "/c" , "/s" ) ) ) . isEqualTo ( "/foo/bar/" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.util.http.RequestUtil.getEncodedPathInfo ( mockRequest ( "/c/s/foo/bar///" , "/c" , "/s" ) ) ) . isEqualTo ( "/foo/bar/" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.util.http.RequestUtil.getEncodedPathInfo ( mockRequest ( "/c/s/foo%2Fbar/" , "/c" , "/s" ) ) ) . isEqualTo ( "/foo%2Fbar/" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.util.http.RequestUtil.getEncodedPathInfo ( mockRequest ( "/c/s/foo%2Fbar///" , "/c" , "/s" ) ) ) . isEqualTo ( "/foo%2Fbar/" ) ; }
Source:
protected void approve ( java.lang.String changeId ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = adminSession.post ( ( ( "/changes/" + changeId ) + "/revisions/current/review" ) , new com.google.gerrit.extensions.api.changes.ReviewInput ( ) . label ( "Code-Review" , 2 ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; r.consume ( ) ; }

Target:
protected void approve ( java.lang.String id ) throws java.lang.Exception { gApi.changes ( ) . id ( id ) . revision ( "current" ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.approve ( ) ) ; }
Source:
public void testIsEnabledRefNoParentNonMatchingBranchDisabled ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/foo.*" } ; setupIsEnabled ( "false" , null , branches ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey projectNK = new com.google.gerrit.reviewdb.client.Project.NameKey ( "testProject" ) ; assertFalse ( itsConfig.isEnabled ( projectNK , "refs/heads/testBranch" ) ) ; }

Target:
public void BROKEN_testIsEnabledRefNoParentNonMatchingBranchDisabled ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/foo.*" } ; setupIsEnabled ( "false" , null , branches ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey projectNK = new com.google.gerrit.reviewdb.client.Project.NameKey ( "testProject" ) ; assertFalse ( itsConfig.isEnabled ( projectNK , "refs/heads/testBranch" ) ) ; }
Source:
public static com.google.gerrit.common.data.PermissionRule grant ( com.google.gerrit.server.git.ProjectConfig project , java.lang.String permissionName , com.google.gerrit.reviewdb.client.AccountGroup.UUID group , java.lang.String ref ) { return com.google.gerrit.server.project.Util.grant ( project , permissionName , com.google.gerrit.server.project.Util.newRule ( project , group ) , ref ) ; }

Target:
public static com.google.gerrit.common.data.PermissionRule block ( com.google.gerrit.server.git.ProjectConfig project , java.lang.String permissionName , int min , int max , com.google.gerrit.reviewdb.client.AccountGroup.UUID group , java.lang.String ref ) { com.google.gerrit.common.data.PermissionRule rule = com.google.gerrit.server.project.Util.newRule ( project , group ) ; rule.setMin ( min ) ; rule.setMax ( max ) ; com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.project.Util.grant ( project , permissionName , rule , ref ) ; r.setBlock ( ) ; return r ; }
Source:
public void unmute ( com.google.gerrit.reviewdb.client.Account.Id accountId , com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Change change ) throws com.google.gerrit.server.StarredChangesUtil.IllegalLabelException , com.google.gwtorm.server.OrmException { star ( accountId , project , change.getId ( ) , com.google.common.collect.ImmutableSet.of ( ) , com.google.common.collect.ImmutableSet.of ( com.google.gerrit.server.StarredChangesUtil.getMuteLabel ( change ) ) ) ; }

Target:
public void unmute ( com.google.gerrit.server.change.ChangeResource rsrc ) throws com.google.gerrit.server.StarredChangesUtil.IllegalLabelException , com.google.gwtorm.server.OrmException { star ( rsrc.getUser ( ) . asIdentifiedUser ( ) . getAccountId ( ) , rsrc.getProject ( ) , rsrc.getChange ( ) . getId ( ) , com.google.common.collect.ImmutableSet.of ( ) , com.google.common.collect.ImmutableSet.of ( com.google.gerrit.server.StarredChangesUtil.getMuteLabel ( rsrc.getChange ( ) ) ) ) ; }
Source:
public void visit ( org.pegdown.ast.RefLinkNode node ) { org.pegdown.ast.ReferenceNode ref = references.get ( node.referenceKey , com.google.gitiles.doc.MarkdownHelper.getInnerText ( node ) ) ; if ( ref != null ) { html.open ( "a" ) . attribute ( "href" , href ( ref.getUrl ( ) ) ) . attribute ( "title" , ref.getTitle ( ) ) ; visitChildren ( node ) ; html.close ( "a" ) ; } else { visitChildren ( node ) ; } }

Target:
public void visit ( org.pegdown.ast.RefLinkNode node ) { org.pegdown.ast.ReferenceNode ref = references.get ( node.referenceKey , com.google.gitiles.doc.MarkdownUtil.getInnerText ( node ) ) ; if ( ref != null ) { html.open ( "a" ) . attribute ( "href" , href ( ref.getUrl ( ) ) ) . attribute ( "title" , ref.getTitle ( ) ) ; visitChildren ( node ) ; html.close ( "a" ) ; } else { visitChildren ( node ) ; } }
Source:
public void run ( ) { if ( ( active ) == null ) { active = this ; fixup.scheduleRepeating ( 20 ) ; } if ( ( active ) == ( this ) ) { updateScreenHeader ( src ) ; dst.scrollToY ( src.getScrollInfo ( ) . getTop ( ) ) ; state = 0 ; } }

Target:
public void run ( ) { if ( ( active ) == null ) { active = this ; fixup.scheduleRepeating ( 20 ) ; } if ( ( active ) == ( this ) ) { net.codemirror.lib.ScrollInfo si = src.getScrollInfo ( ) ; updateScreenHeader ( si ) ; dst.scrollTo ( si.getLeft ( ) , si.getTop ( ) ) ; state = 0 ; } }
Source:
protected com.google.gerrit.server.notedb.AbstractChangeNotes.LoadHandle openHandle ( org.eclipse.jgit.lib.Repository repo ) throws java.io.IOException { org.eclipse.jgit.lib.Ref ref = repo.getRefDatabase ( ) . exactRef ( getRefName ( ) ) ; return com.google.gerrit.server.notedb.AbstractChangeNotes.LoadHandle.create ( new org.eclipse.jgit.revwalk.RevWalk ( repo ) , ( ref != null ? ref.getObjectId ( ) : null ) ) ; }

Target:
protected org.eclipse.jgit.lib.ObjectId readRef ( org.eclipse.jgit.lib.Repository repo ) throws java.io.IOException { org.eclipse.jgit.lib.Ref ref = repo.getRefDatabase ( ) . exactRef ( getRefName ( ) ) ; return ref != null ? ref.getObjectId ( ) : null ; }
Source:
private static java.lang.String parseDirective ( com.googlesource.gerrit.plugins.findowners.OwnersDb db , java.lang.String pathGlob , java.lang.String file , java.lang.String line , int num ) { if ( com.googlesource.gerrit.plugins.findowners.Parser.PatEmail.matcher ( line ) . find ( ) ) { java.util.regex.Matcher m = com.googlesource.gerrit.plugins.findowners.Parser.PatEmail.matcher ( line ) ; m.find ( ) ; db.addOwnerPathPair ( m.group ( 1 ) , pathGlob ) ; return null ; } return com.googlesource.gerrit.plugins.findowners.Parser.errorMsg ( file , num , "ignored unknown line" , line ) ; }

Target:
private static void parseDirective ( com.googlesource.gerrit.plugins.findowners.Parser.Result result , java.lang.String pathGlob , java.lang.String file , java.lang.String line , int num ) { if ( com.googlesource.gerrit.plugins.findowners.Parser.patEmail.matcher ( line ) . find ( ) ) { java.util.regex.Matcher m = com.googlesource.gerrit.plugins.findowners.Parser.patEmail.matcher ( line ) ; m.find ( ) ; com.googlesource.gerrit.plugins.findowners.Util.addToMap ( result.owner2paths , m.group ( 1 ) , pathGlob ) ; } else { result.errors.add ( com.googlesource.gerrit.plugins.findowners.Parser.errorMsg ( file , num , "ignored unknown line" , line ) ) ; } }
Source:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.server.git.validators.CommitValidationListener.class ) . to ( com.googlesource.gerrit.plugins.uploadvalidator.InvalidLineEndingValidator.class ) ; bind ( com.google.gerrit.server.config.ProjectConfigEntry.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.Exports.named ( com.googlesource.gerrit.plugins.uploadvalidator.InvalidLineEndingValidator.KEY_CHECK_REJECT_WINDOWS_LINE_ENDINGS ) ) . toInstance ( new com.google.gerrit.server.config.ProjectConfigEntry ( "Reject Windows Line Endings" , "false" , ProjectConfigEntry.Type.BOOLEAN , null , false , ( "Windows line endings. Pushes of commits that include files " + ( "containing carriage return (CR) characters will be " + "rejected." ) ) ) ) ; }

Target:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.server.git.validators.CommitValidationListener.class ) . to ( com.googlesource.gerrit.plugins.uploadvalidator.InvalidLineEndingValidator.class ) ; bind ( com.google.gerrit.server.config.ProjectConfigEntry.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.Exports.named ( com.googlesource.gerrit.plugins.uploadvalidator.InvalidLineEndingValidator.KEY_CHECK_REJECT_WINDOWS_LINE_ENDINGS ) ) . toInstance ( new com.google.gerrit.server.config.ProjectConfigEntry ( "Reject Windows Line Endings" , "false" , com.google.gerrit.extensions.api.projects.ProjectConfigEntryType.BOOLEAN , null , false , ( "Windows line endings. Pushes of commits that include files " + ( "containing carriage return (CR) characters will be " + "rejected." ) ) ) ) ; }
Source:
public com.google.gerrit.server.patch.PatchList call ( ) throws com.google.gerrit.server.patch.PatchListNotAvailableException , java.io.IOException { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ) { return readPatchList ( key , repo ) ; } }

Target:
public com.google.gerrit.server.patch.PatchList call ( ) throws com.google.gerrit.server.patch.PatchListNotAvailableException , java.io.IOException { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ; org.eclipse.jgit.lib.ObjectInserter ins = newInserter ( repo ) ; org.eclipse.jgit.lib.ObjectReader reader = ins.newReader ( ) ; org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( reader ) ) { return readPatchList ( repo , rw , ins ) ; } }
Source:
public void addStringSetTest ( ) { com.googlesource.gerrit.plugins.findowners.Util.StringSet s = new com.googlesource.gerrit.plugins.findowners.Util.StringSet ( ) ; com.google.common.truth.Truth.assertThat ( s.size ( ) ) . isEqualTo ( 0 ) ; s.add ( "s1" ) ; com.google.common.truth.Truth.assertThat ( s.contains ( "s1" ) ) . isEqualTo ( true ) ; com.google.common.truth.Truth.assertThat ( s.contains ( "s2" ) ) . isEqualTo ( false ) ; com.google.common.truth.Truth.assertThat ( s.size ( ) ) . isEqualTo ( 1 ) ; }

Target:
public void addStringSetTest ( ) { java.util.Set < java.lang.String > s = new java.util.HashSet < > ( ) ; com.google.common.truth.Truth.assertThat ( s ) . isEmpty ( ) ; s.add ( "s1" ) ; com.google.common.truth.Truth.assertThat ( s.contains ( "s1" ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( s.contains ( "s2" ) ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( s ) . hasSize ( 1 ) ; }
Source:
private void initTopicLink ( com.google.gerrit.client.info.ChangeInfo info ) { if ( ( ( info.topic ( ) ) != null ) && ( ! ( info.topic ( ) . isEmpty ( ) ) ) ) { text.setText ( info.topic ( ) ) ; text.setTargetHistoryToken ( com.google.gerrit.common.PageLinks.toChangeQuery ( com.google.gerrit.common.PageLinks.op ( "topic" , info.topic ( ) ) ) ) ; } }

Target:
private void initTopicLink ( com.google.gerrit.client.info.ChangeInfo info ) { if ( ( ( info.topic ( ) ) != null ) && ( ! ( info.topic ( ) . isEmpty ( ) ) ) ) { java.lang.String topic = info.topic ( ) ; text.setText ( topic ) ; text.setTargetHistoryToken ( com.google.gerrit.common.PageLinks.topicQuery ( info.status ( ) , topic ) ) ; } }
Source:
protected void run ( ) { final com.google.gerrit.sshd.commands.QueryShell shell = factory.create ( in , out ) ; shell.setOutputFormat ( format ) ; if ( ( query ) != null ) { shell.execute ( query ) ; } else { shell.run ( ) ; } }

Target:
protected void run ( ) throws com.google.gerrit.sshd.commands.Failure { try { checkPermission ( ) ; final com.google.gerrit.sshd.commands.QueryShell shell = factory.create ( in , out ) ; shell.setOutputFormat ( format ) ; if ( ( query ) != null ) { shell.execute ( query ) ; } else { shell.run ( ) ; } } catch ( com.google.gerrit.common.errors.PermissionDeniedException err ) { throw new com.google.gerrit.sshd.commands.UnloggedFailure ( ( "fatal: " + ( err.getMessage ( ) ) ) ) ; } }
Source:
private < K , V > com.google.gerrit.server.cache.UnnamedCacheBinding core ( final com.google.inject.Key < com.google.gerrit.server.cache.Cache < K , V > > key ) { final boolean disk = false ; final com.google.gerrit.server.cache.CacheProvider < K , V > b = new com.google.gerrit.server.cache.CacheProvider < K , V > ( disk ) ; bind ( key ) . toProvider ( b ) ; return b ; }

Target:
private < K , V > com.google.gerrit.server.cache.UnnamedCacheBinding < K , V > core ( final com.google.inject.Key < com.google.gerrit.server.cache.Cache < K , V > > key ) { final boolean disk = false ; final com.google.gerrit.server.cache.CacheProvider < K , V > b = new com.google.gerrit.server.cache.CacheProvider < K , V > ( disk , this ) ; bind ( key ) . toProvider ( b ) . in ( Scopes.SINGLETON ) ; return b ; }
Source:
protected void preDisplay ( final com.google.gerrit.common.data.GroupDetail result ) { enableForm ( result.canModify ) ; saveName.setVisible ( result.canModify ) ; saveOwner.setVisible ( result.canModify ) ; saveDesc.setVisible ( result.canModify ) ; saveGroupOptions.setVisible ( result.canModify ) ; delMember.setVisible ( result.canModify ) ; members.setEnabled ( result.canModify ) ; saveType.setVisible ( result.canModify ) ; display ( result ) ; }

Target:
protected void preDisplay ( final com.google.gerrit.common.data.GroupDetail result ) { enableForm ( result.canModify ) ; saveName.setVisible ( result.canModify ) ; saveOwner.setVisible ( result.canModify ) ; saveDesc.setVisible ( result.canModify ) ; saveGroupOptions.setVisible ( result.canModify ) ; delMember.setVisible ( result.canModify ) ; saveType.setVisible ( result.canModify ) ; delInclude.setVisible ( result.canModify ) ; display ( result ) ; }
Source:
public com.google.gerrit.server.project.ProjectResource parse ( com.google.gerrit.extensions.restapi.TopLevelResource parent , java.lang.String id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException { com.google.gerrit.server.project.ProjectControl ctl ; try { ctl = controlFactory.controlFor ( new com.google.gerrit.reviewdb.client.Project.NameKey ( com.google.gerrit.server.util.Url.decode ( id ) ) , user.get ( ) ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } if ( ( ! ( ctl.isVisible ( ) ) ) && ( ! ( ctl.isOwner ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } return new com.google.gerrit.server.project.ProjectResource ( ctl ) ; }

Target:
public com.google.gerrit.server.project.ProjectResource parse ( com.google.gerrit.extensions.restapi.TopLevelResource parent , java.lang.String id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException { com.google.gerrit.server.project.ProjectControl ctl ; try { ctl = controlFactory.controlFor ( new com.google.gerrit.reviewdb.client.Project.NameKey ( com.google.gerrit.extensions.restapi.Url.decode ( id ) ) , user.get ( ) ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } if ( ( ! ( ctl.isVisible ( ) ) ) && ( ! ( ctl.isOwner ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } return new com.google.gerrit.server.project.ProjectResource ( ctl ) ; }
Source:
void onCtrlS ( com.google.gwt.event.dom.client.KeyDownEvent e ) { if ( ( ( ( e.isControlKeyDown ( ) ) || ( e.isMetaKeyDown ( ) ) ) && ( ! ( e.isAltKeyDown ( ) ) ) ) && ( ! ( e.isShiftKeyDown ( ) ) ) ) { switch ( e.getNativeKeyCode ( ) ) { case 's' : case 'S' : e.preventDefault ( ) ; onSave ( null ) ; return ; } } expandTimer.schedule ( 250 ) ; }

Target:
void onSave ( com.google.gwt.event.dom.client.ClickEvent e ) { e.stopPropagation ( ) ; onSave ( ) ; }
Source:
private void login ( javax.servlet.ServletRequest request , javax.servlet.http.HttpServletRequest httpRequest , javax.servlet.http.HttpServletResponse httpResponse , com.googlesource.gerrit.plugins.github.oauth.GitHubLogin ghLogin ) throws java.io.IOException { if ( ghLogin.login ( httpRequest , httpResponse ) ) { org.kohsuke.github.GHMyself myself = ghLogin.getMyself ( ) ; java.lang.String user = myself.getLogin ( ) ; updateSecureConfigWithRetry ( ghLogin.hub.getMyOrganizations ( ) . keySet ( ) , user , ghLogin.token.access_token ) ; } }

Target:
private void login ( javax.servlet.ServletRequest request , javax.servlet.http.HttpServletRequest httpRequest , javax.servlet.http.HttpServletResponse httpResponse , com.googlesource.gerrit.plugins.github.oauth.GitHubLogin ghLogin ) throws java.io.IOException { if ( ghLogin.login ( httpRequest , httpResponse ) ) { org.kohsuke.github.GHMyself myself = ghLogin.getMyself ( ) ; java.lang.String user = myself.getLogin ( ) ; updateSecureConfigWithRetry ( ghLogin.hub.getMyOrganizations ( ) . keySet ( ) , user , ghLogin.token.accessToken ) ; } }
Source:
public void onSuccess ( com.google.gerrit.client.diff.DiffInfo info ) { new net.codemirror.lib.ModeInjector ( ) . add ( getContentType ( info.meta_a ( ) ) ) . add ( getContentType ( info.meta_b ( ) ) ) . inject ( com.google.gerrit.client.rpc.CallbackGroup.< java.lang.Void > emptyCallback ( ) ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.diff.DiffInfo diffInfo ) { if ( ( id == ( reloadVersionId ) ) && ( isAttached ( ) ) ) { diff = diffInfo ; operation ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { clearSkipBars ( ) ; clearMarkers ( ) ; diffTable.sidePanel.clearDiffGutters ( ) ; setShowIntraline ( prefs.intralineDifference ( ) ) ; render ( diff ) ; renderSkips ( prefs.context ( ) ) ; } } ) ; } }
Source:
protected void configure ( ) { bind ( DataSourceProvider.Context.class ) . toInstance ( DataSourceProvider.Context.MULTI_USER ) ; bind ( com.google.inject.Key.get ( javax.sql.DataSource.class , com.google.inject.name.Names.named ( "ReviewDb" ) ) ) . toProvider ( com.google.gerrit.server.schema.DataSourceProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; listener ( ) . to ( com.google.gerrit.server.schema.DataSourceProvider.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.inject.Key.get ( javax.sql.DataSource.class , com.google.inject.name.Names.named ( "ReviewDb" ) ) ) . toProvider ( com.google.gerrit.httpd.ReviewDbDataSourceProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; listener ( ) . to ( com.google.gerrit.httpd.ReviewDbDataSourceProvider.class ) ; }
Source:
private boolean isMember ( com.google.gerrit.reviewdb.client.AccountGroup parent , com.google.gerrit.common.data.GroupDescription.Basic member ) throws com.google.gwtorm.server.OrmException { return ( dbProvider.get ( ) . accountGroupById ( ) . get ( new com.google.gerrit.reviewdb.client.AccountGroupById.Key ( parent.getId ( ) , member.getGroupUUID ( ) ) ) ) != null ; }

Target:
private boolean isMember ( com.google.gerrit.reviewdb.client.AccountGroup parent , com.google.gerrit.common.data.GroupDescription.Basic member ) throws com.google.gwtorm.server.OrmException { return groups.isIncluded ( dbProvider.get ( ) , parent.getId ( ) , member.getGroupUUID ( ) ) ; }
Source:
public com.google.gerrit.server.project.RefControl controlForRef ( java.lang.String refName ) { if ( ( refControls ) == null ) { refControls = new java.util.HashMap < java.lang.String , com.google.gerrit.server.project.RefControl > ( ) ; } com.google.gerrit.server.project.RefControl ctl = refControls.get ( refName ) ; if ( ctl == null ) { com.google.gerrit.server.project.PermissionCollection relevant = com.google.gerrit.server.project.PermissionCollection.filter ( access ( ) , refName , user.getUserName ( ) ) ; ctl = new com.google.gerrit.server.project.RefControl ( this , refName , relevant ) ; refControls.put ( refName , ctl ) ; } return ctl ; }

Target:
public com.google.gerrit.server.project.RefControl controlForRef ( java.lang.String refName ) { if ( ( refControls ) == null ) { refControls = new java.util.HashMap < java.lang.String , com.google.gerrit.server.project.RefControl > ( ) ; } com.google.gerrit.server.project.RefControl ctl = refControls.get ( refName ) ; if ( ctl == null ) { com.google.gerrit.server.project.PermissionCollection relevant = permissionFilter.filter ( access ( ) , refName , user.getUserName ( ) ) ; ctl = new com.google.gerrit.server.project.RefControl ( this , refName , relevant ) ; refControls.put ( refName , ctl ) ; } return ctl ; }
Source:
public void go ( ) { if ( ( com.google.gerrit.client.Gerrit.patchScreen ) != null ) { com.google.gerrit.client.Gerrit.patchScreen.setTopView ( PatchScreen.TopView.MAIN ) ; if ( type == ( com.google.gerrit.client.Gerrit.patchScreen.getPatchScreenType ( ) ) ) { com.google.gwt.dom.client.AnchorElement.as ( getElement ( ) ) . blur ( ) ; } else { new com.google.gerrit.client.ui.PatchLink ( "" , type , com.google.gerrit.client.Gerrit.patchScreen ) . go ( ) ; } } }

Target:
private static void addMenuLink ( com.google.gerrit.client.ui.LinkMenuBar m , com.google.gerrit.client.info.TopMenuItem item ) { if ( item.getUrl ( ) . contains ( com.google.gerrit.client.Gerrit.PROJECT_NAME_MENU_VAR ) ) { com.google.gerrit.client.Gerrit.addProjectLink ( m , item ) ; } else { com.google.gerrit.client.Gerrit.addExtensionLink ( m , item ) ; } }
Source:
public com.google.gerrit.server.change.AccountInfo get ( com.google.gerrit.reviewdb.client.Account.Id id ) { if ( id == null ) { return null ; } com.google.gerrit.server.change.AccountInfo info = created.get ( id ) ; if ( info == null ) { info = new com.google.gerrit.server.change.AccountInfo ( id ) ; created.put ( id , info ) ; } return info ; }

Target:
public com.google.gerrit.server.account.AccountInfo get ( com.google.gerrit.reviewdb.client.Account.Id id ) { if ( id == null ) { return null ; } com.google.gerrit.server.account.AccountInfo info = created.get ( id ) ; if ( info == null ) { info = new com.google.gerrit.server.account.AccountInfo ( id ) ; created.put ( id , info ) ; } return info ; }
Source:
public com.google.gerrit.server.git.LabelNormalizer.Result normalize ( com.google.gerrit.server.notedb.ChangeNotes notes , java.util.Collection < com.google.gerrit.reviewdb.client.PatchSetApproval > approvals ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.IdentifiedUser user = userFactory.create ( notes.getChange ( ) . getOwner ( ) ) ; return normalize ( notes , user , approvals ) ; }

Target:
public com.google.gerrit.server.change.LabelNormalizer.Result normalize ( com.google.gerrit.server.notedb.ChangeNotes notes , java.util.Collection < com.google.gerrit.reviewdb.client.PatchSetApproval > approvals ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.IdentifiedUser user = userFactory.create ( notes.getChange ( ) . getOwner ( ) ) ; return normalize ( notes , user , approvals ) ; }
Source:
public void getDetail ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = adminSession.get ( ( ( "/accounts/" + ( admin.username ) ) + "/detail/" ) ) ; com.google.gerrit.server.account.GetDetail.AccountDetailInfo info = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.server.account.GetDetail.AccountDetailInfo.class ) ; com.google.gerrit.acceptance.rest.account.AccountAssert.assertAccountInfo ( admin , info ) ; com.google.gerrit.reviewdb.client.Account account = accountCache.get ( admin.getId ( ) ) . getAccount ( ) ; com.google.common.truth.Truth.assertThat ( info.registeredOn ) . isEqualTo ( account.getRegisteredOn ( ) ) ; }

Target:
public void getDetail ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = adminRestSession.get ( ( ( "/accounts/" + ( admin.username ) ) + "/detail/" ) ) ; com.google.gerrit.server.account.GetDetail.AccountDetailInfo info = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.server.account.GetDetail.AccountDetailInfo.class ) ; com.google.gerrit.acceptance.rest.account.AccountAssert.assertAccountInfo ( admin , info ) ; com.google.gerrit.reviewdb.client.Account account = accountCache.get ( admin.getId ( ) ) . getAccount ( ) ; com.google.common.truth.Truth.assertThat ( info.registeredOn ) . isEqualTo ( account.getRegisteredOn ( ) ) ; }
Source:
public void testPostResponseWithContentOK ( ) throws java.lang.Exception { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.wireMockRule.givenThat ( com.github.tomakehurst.wiremock.client.WireMock.post ( com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ENDPOINT ) ) . withRequestBody ( com.github.tomakehurst.wiremock.client.WireMock.equalTo ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.BODY ) ) . willReturn ( com.github.tomakehurst.wiremock.client.WireMock.aResponse ( ) . withStatus ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.OK ) ) ) ; com.google.common.truth.Truth.assertThat ( httpSession.post ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ENDPOINT , com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.BODY ) . isSuccessful ( ) ) . isTrue ( ) ; }

Target:
public void testPostResponseWithContentOK ( ) throws java.lang.Exception { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.wireMockRule.givenThat ( com.github.tomakehurst.wiremock.client.WireMock.post ( com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ENDPOINT ) ) . withRequestBody ( com.github.tomakehurst.wiremock.client.WireMock.equalTo ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.BODY ) ) . willReturn ( com.github.tomakehurst.wiremock.client.WireMock.aResponse ( ) . withStatus ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.NO_CONTENT ) ) ) ; com.google.common.truth.Truth.assertThat ( httpSession.post ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ENDPOINT , com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.BODY ) . isSuccessful ( ) ) . isTrue ( ) ; }