auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void newPatchSetByOtherOnReviewableChangeInReviewDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master" , other ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . notTo ( sc.owner ) . to ( sc.reviewer , sc.ccer , other ) . notTo ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }

Target:
public void newPatchSetByOtherOnReviewableChangeInReviewDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; pushTo ( sc , "refs/for/master" , other ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . notTo ( sc.owner ) . to ( sc.reviewer , sc.ccer , other ) . notTo ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) . noOneElse ( ) ; }
Source:
public boolean apply ( java.lang.String refPart ) { return refPart.endsWith ( ( "/" + ( changeId.get ( ) ) ) ) ; }

Target:
public java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > byChange ( com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { return com.google.common.collect.FluentIterable.from ( getRefNames ( com.google.gerrit.reviewdb.client.RefNames.refsStarredChangesPrefix ( changeId ) ) ) . transform ( new com.google.common.base.Function < java.lang.String , com.google.gerrit.reviewdb.client.Account.Id > ( ) { @ java.lang.Override public Account.Id apply ( java.lang.String refPart ) { return Account.Id.parse ( refPart ) ; } } ) . toSet ( ) ; }
Source:
protected org.apache.sshd.common.session.AbstractSession createSession ( final org.apache.mina.core.session.IoSession ioSession ) throws java.lang.Exception { final org.apache.sshd.common.session.AbstractSession s = super . createSession ( ioSession ) ; s.setAttribute ( SshUtil.REMOTE_PEER , ioSession.getRemoteAddress ( ) ) ; return s ; }

Target:
protected org.apache.sshd.common.session.AbstractSession createSession ( final org.apache.mina.core.session.IoSession io ) throws java.lang.Exception { if ( ( io.getConfig ( ) ) instanceof org.apache.mina.transport.socket.SocketSessionConfig ) { final org.apache.mina.transport.socket.SocketSessionConfig c = ( ( org.apache.mina.transport.socket.SocketSessionConfig ) ( io.getConfig ( ) ) ) ; c.setKeepAlive ( keepAlive ) ; } final org.apache.sshd.common.session.AbstractSession s = super . createSession ( io ) ; s.setAttribute ( SshUtil.REMOTE_PEER , io.getRemoteAddress ( ) ) ; return s ; }
Source:
public void testUnblockLargerScope_Fails ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/master" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't push" , u.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }

Target:
public void testUnblockInParentBlockInLocal ( ) { com.google.gerrit.server.project.Util.block ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl d = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't push" , d.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }
Source:
protected void deny ( java.lang.String permission , com.google.gerrit.reviewdb.client.AccountGroup.UUID id , java.lang.String ref ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.server.project.Util.deny ( cfg , permission , id , ref ) ; saveProjectConfig ( project , cfg ) ; }

Target:
protected org.eclipse.jgit.revwalk.RevCommit getRemoteHead ( ) throws java.lang.Exception { return getRemoteHead ( project , "master" ) ; }
Source:
private void addSuggestion ( java.util.Map < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.common.data.AccountInfo > map , com.google.gerrit.reviewdb.client.Account account , com.google.gerrit.common.data.AccountInfo info , java.lang.Boolean active ) { if ( map.containsKey ( account.getId ( ) ) ) { return ; } if ( ( active != null ) && ( active != ( account.isActive ( ) ) ) ) { return ; } if ( accountControlFactory.get ( ) . canSee ( account ) ) { map.put ( account.getId ( ) , info ) ; } }

Target:
private void addSuggestion ( java.util.Map < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.common.data.AccountInfo > map , com.google.gerrit.reviewdb.client.Account account , com.google.gerrit.common.data.AccountInfo info , java.lang.Boolean active , com.google.gerrit.httpd.rpc.SuggestServiceImpl.VisibilityControl visibilityControl ) throws com.google.gwtorm.server.OrmException { if ( map.containsKey ( account.getId ( ) ) ) { return ; } if ( ( active != null ) && ( active != ( account.isActive ( ) ) ) ) { return ; } if ( visibilityControl.isVisible ( account ) ) { map.put ( account.getId ( ) , info ) ; } }
Source:
public void stop ( ) { scanner.end ( ) ; synchronized ( this ) { for ( com.google.gerrit.server.plugins.Plugin p : running.values ( ) ) { p.stop ( ) ; } running.clear ( ) ; broken.clear ( ) ; } }

Target:
public void stop ( ) { scanner.end ( ) ; synchronized ( this ) { boolean clean = ! ( running.isEmpty ( ) ) ; for ( com.google.gerrit.server.plugins.Plugin p : running.values ( ) ) { p.stop ( ) ; } running.clear ( ) ; broken.clear ( ) ; if ( clean ) { java.lang.System.gc ( ) ; processPendingCleanups ( ) ; } } }
Source:
public void testPushForNonExistingBranch ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String branchName = "non-existing" ; com.google.gerrit.acceptance.git.PushOneCommit.Result r = pushTo ( ( "refs/for/" + branchName ) ) ; r.assertErrorStatus ( ( ( "branch " + branchName ) + " not found" ) ) ; }

Target:
private void testPushForNonExistingBranch ( com.google.gerrit.acceptance.git.PushForReviewIT.Protocol p ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { selectProtocol ( p ) ; java.lang.String branchName = "non-existing" ; com.google.gerrit.acceptance.git.PushOneCommit.Result r = pushTo ( ( "refs/for/" + branchName ) ) ; r.assertErrorStatus ( ( ( "branch " + branchName ) + " not found" ) ) ; }
Source:
private void fireRefUpdated ( org.eclipse.jgit.lib.RefUpdate branchUpdate ) { gitRefUpdated.fire ( destBranch.getParentKey ( ) , branchUpdate ) ; com.google.gerrit.reviewdb.client.Account account = null ; com.google.gerrit.reviewdb.client.PatchSetApproval submitter = approvalsUtil.getSubmitter ( db , mergeTip.notes ( ) , mergeTip.getPatchsetId ( ) ) ; if ( submitter != null ) { account = accountCache.get ( submitter.getAccountId ( ) ) . getAccount ( ) ; } hooks.doRefUpdatedHook ( destBranch , branchUpdate , account ) ; }

Target:
private com.google.gerrit.reviewdb.client.Account getAccount ( com.google.gerrit.server.git.CodeReviewCommit codeReviewCommit ) { com.google.gerrit.reviewdb.client.Account account = null ; com.google.gerrit.reviewdb.client.PatchSetApproval submitter = approvalsUtil.getSubmitter ( db , codeReviewCommit.notes ( ) , codeReviewCommit.getPatchsetId ( ) ) ; if ( submitter != null ) { account = accountCache.get ( submitter.getAccountId ( ) ) . getAccount ( ) ; } return account ; }
Source:
protected com.google.gerrit.server.notedb.LoadHandle openHandle ( org.eclipse.jgit.lib.Repository repo ) throws java.io.IOException { if ( autoRebuild ) { com.google.gerrit.server.notedb.NoteDbChangeState state = com.google.gerrit.server.notedb.NoteDbChangeState.parse ( change ) ; if ( ( state == null ) || ( ! ( state.isChangeUpToDate ( repo ) ) ) ) { return rebuildAndOpen ( repo ) ; } } return super . openHandle ( repo ) ; }

Target:
protected com.google.gerrit.server.notedb.LoadHandle openHandle ( org.eclipse.jgit.lib.Repository repo ) throws java.io.IOException { if ( autoRebuild ) { com.google.gerrit.server.notedb.NoteDbChangeState state = com.google.gerrit.server.notedb.NoteDbChangeState.parse ( change ) ; com.google.gerrit.server.git.RefCache refs = ( ( this . refs ) != null ) ? this . refs : new com.google.gerrit.server.git.RepoRefCache ( repo ) ; if ( ( state == null ) || ( ! ( state.isChangeUpToDate ( refs ) ) ) ) { return rebuildAndOpen ( repo ) ; } } return super . openHandle ( repo ) ; }
Source:
protected org.eclipse.jgit.revwalk.RevCommit getRemoteHead ( com.google.gerrit.reviewdb.client.Project ... projects ) throws java.io.IOException { com.google.common.truth.Truth.assertThat ( projects.length ) . isLessThan ( 2 ) ; com.google.gerrit.reviewdb.client.Project.NameKey project = this . project ; if ( ( projects.length ) > 0 ) { project = projects [ 0 ] ; } try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ) { return getHead ( repo , "refs/heads/master" ) ; } }

Target:
protected java.util.List < org.eclipse.jgit.revwalk.RevCommit > getRemoteLog ( ) throws java.io.IOException { return getRemoteLog ( project , "master" ) ; }
Source:
public java.lang.String decode ( java.lang.String s ) { try { javax.crypto.Cipher encoder = getCipher ( ) ; java.security.Key sKey = generateKey ( ) ; encoder.init ( javax.crypto.Cipher.DECRYPT_MODE , sKey , getCipherParameterSpec ( ) ) ; return new java.lang.String ( encoder.doFinal ( java.util.Base64.getDecoder ( ) . decode ( s ) ) , config.getEncoding ( ) ) ; } catch ( java.lang.Exception e ) { com.googlesource.gerrit.plugins.secureconfig.PBECodec.log.error ( "decode() failed" , e ) ; throw new java.lang.IllegalArgumentException ( "encode() failed" , e ) ; } }

Target:
public java.lang.String decode ( java.lang.String s ) { try { javax.crypto.Cipher encoder = getCipher ( ) ; java.security.Key sKey = generateKey ( ) ; encoder.init ( javax.crypto.Cipher.DECRYPT_MODE , sKey , getCipherParameterSpec ( ) ) ; return new java.lang.String ( encoder.doFinal ( org.apache.commons.codec.binary.Base64.decodeBase64 ( s ) ) , config.getEncoding ( ) ) ; } catch ( java.lang.Exception e ) { com.googlesource.gerrit.plugins.secureconfig.PBECodec.log.error ( "decode() failed" , e ) ; throw new java.lang.IllegalArgumentException ( "encode() failed" , e ) ; } }
Source:
private static org.eclipse.jgit.dircache.DirCacheEditor.PathEdit getPathEdit ( com.google.gerrit.server.edit.ChangeEditModifier.TreeOperation op , org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.revwalk.RevCommit base , java.lang.String path , org.eclipse.jgit.lib.ObjectInserter ins , byte [ ] content ) throws com.google.gerrit.server.project.InvalidChangeOperationException , java.io.IOException { final org.eclipse.jgit.lib.ObjectId oid = ( op == ( com.google.gerrit.server.edit.ChangeEditModifier.TreeOperation.CHANGE_ENTRY ) ) ? ins.insert ( Constants.OBJ_BLOB , content ) : com.google.gerrit.server.edit.ChangeEditModifier.getObjectIdForRestoreOperation ( rw , base , path ) ; return new org.eclipse.jgit.dircache.DirCacheEditor.PathEdit ( path ) { @ java.lang.Override public void apply ( org.eclipse.jgit.dircache.DirCacheEntry ent ) { ent.setFileMode ( FileMode.REGULAR_FILE ) ; ent.setObjectId ( oid ) ; } } ; }

Target:
public void apply ( org.eclipse.jgit.dircache.DirCacheEntry ent ) { if ( ( ent.getRawMode ( ) ) == 0 ) { ent.setFileMode ( FileMode.REGULAR_FILE ) ; } ent.setObjectId ( content ) ; }
Source:
public void display ( final java.util.List < com.google.gerrit.common.data.AccountProjectWatchInfo > result ) { while ( 2 < ( table.getRowCount ( ) ) ) { table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; } for ( final com.google.gerrit.common.data.AccountProjectWatchInfo k : result ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , k ) ; } }

Target:
public void display ( final com.google.gwt.core.client.JsArray < com.google.gerrit.client.account.ProjectWatchInfo > result ) { while ( 2 < ( table.getRowCount ( ) ) ) { table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; } for ( com.google.gerrit.client.account.ProjectWatchInfo info : com.google.gerrit.client.rpc.Natives.asList ( result ) ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , info ) ; } }
Source:
public void setStars ( java.lang.String changeId , com.google.gerrit.extensions.api.changes.StarsInput input ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.account.AccountResource.Star rsrc = stars.parse ( account , com.google.gerrit.extensions.restapi.IdString.fromUrl ( changeId ) ) ; starsPost.apply ( rsrc , input ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot post stars" , e ) ; } }

Target:
public void setStars ( java.lang.String changeId , com.google.gerrit.extensions.api.changes.StarsInput input ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.account.AccountResource.Star rsrc = stars.parse ( account , com.google.gerrit.extensions.restapi.IdString.fromUrl ( changeId ) ) ; starsPost.apply ( rsrc , input ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot post stars" , e ) ; } }
Source:
public void createDraftChangeNotAllowed ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( isAllowDrafts ( ) ) . isFalse ( ) ; com.google.gerrit.extensions.common.ChangeInfo ci = newChangeInfo ( ChangeStatus.DRAFT ) ; com.google.gerrit.acceptance.RestResponse r = adminSession.post ( "/changes/" , ci ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_METHOD_NOT_ALLOWED ) ; com.google.common.truth.Truth.assertThat ( r.getEntityContent ( ) ) . contains ( "draft workflow is disabled" ) ; }

Target:
public void createDraftChangeNotAllowed ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( isAllowDrafts ( ) ) . isFalse ( ) ; com.google.gerrit.extensions.common.ChangeInfo ci = newChangeInfo ( ChangeStatus.DRAFT ) ; assertCreateFails ( ci , com.google.gerrit.extensions.restapi.MethodNotAllowedException.class , "draft workflow is disabled" ) ; }
Source:
private com.google.gitiles.GitilesView getView ( java.lang.String pathAndQuery ) throws java.io.IOException , javax.servlet.ServletException { com.google.gitiles.TestViewFilter.Result result = com.google.gitiles.TestViewFilter.service ( repo , pathAndQuery ) ; com.google.gitiles.FakeHttpServletResponse resp = result.getResponse ( ) ; org.junit.Assert.assertTrue ( ( "expected non-redirect status, got " + ( resp.getStatus ( ) ) ) , ( ( ( resp.getStatus ( ) ) < 300 ) || ( ( resp.getStatus ( ) ) >= 400 ) ) ) ; return result.getView ( ) ; }

Target:
private com.google.gitiles.GitilesView getView ( java.lang.String pathAndQuery ) throws java.io.IOException , javax.servlet.ServletException { com.google.gitiles.TestViewFilter.Result result = com.google.gitiles.TestViewFilter.service ( repo , pathAndQuery ) ; com.google.gitiles.FakeHttpServletResponse resp = result.getResponse ( ) ; com.google.common.truth.Truth.assertWithMessage ( ( "expected non-redirect status, got " + ( resp.getStatus ( ) ) ) ) . that ( ( ( ( resp.getStatus ( ) ) < 300 ) || ( ( resp.getStatus ( ) ) >= 400 ) ) ) . isTrue ( ) ; return result.getView ( ) ; }
Source:
protected void authorizeUser ( com.google.gerrit.server.project.ProjectControl control ) throws org.eclipse.jgit.lfs.errors.LfsUnauthorized { if ( ( com.google.gerrit.common.data.Capable.OK ) != ( control.canPushToAtLeastOneRef ( ) ) ) { throwUnauthorizedOp ( action.getName ( ) , 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.getNameKey ( ) ) . check ( com.google.gerrit.server.permissions.ProjectPermission.PUSH_AT_LEAST_ONE_REF ) ; } catch ( com.google.gerrit.extensions.restapi.AuthException | com.google.gerrit.server.permissions.PermissionBackendException e ) { throwUnauthorizedOp ( action.getName ( ) , state , user ) ; } }
Source:
public GroupDescription.Basic parse ( java.lang.String id ) throws com.google.gerrit.extensions.restapi.UnprocessableEntityException { com.google.gerrit.common.data.GroupDescription.Basic group = _parse ( id ) ; if ( ( group == null ) || ( ! ( groupControlFactory.controlFor ( group ) . isVisible ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.UnprocessableEntityException ( java.lang.String.format ( "Group Not Found: %s" , id ) ) ; } return group ; }

Target:
public GroupDescription.Basic parse ( java.lang.String id ) throws com.google.gerrit.extensions.restapi.UnprocessableEntityException { com.google.gerrit.common.data.GroupDescription.Basic group = parseId ( id ) ; if ( ( group == null ) || ( ! ( groupControlFactory.controlFor ( group ) . isVisible ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.UnprocessableEntityException ( java.lang.String.format ( "Group Not Found: %s" , id ) ) ; } return group ; }
Source:
protected void onOpenRow ( final int row ) { final java.lang.Object item = getRowItem ( row ) ; if ( item instanceof com.google.gerrit.client.patches.AbstractPatchContentTable.CommentList ) { for ( final com.google.gerrit.client.ui.ComplexDisclosurePanel p : ( ( com.google.gerrit.client.patches.AbstractPatchContentTable.CommentList ) ( item ) ) . panels ) { p.setOpen ( ( ! ( p.isOpen ( ) ) ) ) ; } } }

Target:
protected void onOpenRow ( final int row ) { final java.lang.Object item = getRowItem ( row ) ; if ( item instanceof com.google.gerrit.client.patches.AbstractPatchContentTable.CommentList ) { for ( final com.google.gerrit.client.ui.CommentPanel p : ( ( com.google.gerrit.client.patches.AbstractPatchContentTable.CommentList ) ( item ) ) . panels ) { p.setOpen ( ( ! ( p.isOpen ( ) ) ) ) ; } } }
Source:
public boolean isCancelled ( ) { if ( cancelled ) { status = GitJobStatus.CANCELLED ; } return cancelled ; }

Target:
public void update ( int completed ) { if ( ( totUnits ) == 0 ) { return ; } currUnit += completed ; int percentage = ( ( currUnit ) * 100 ) / ( totUnits ) ; if ( percentage > ( lastPercentage ) ) { lastPercentage = percentage ; } status.update ( Code.SYNC , status.getShortDescription ( ) , getStatusDescription ( ) ) ; }
Source:
private void initProviderBouncyCastle ( org.eclipse.jgit.lib.Config cfg ) { org.apache.sshd.common.NamedFactory < org.apache.sshd.common.random.Random > factory ; if ( cfg.getBoolean ( "sshd" , null , "testUseInsecureRandom" , false ) ) { factory = new com.google.gerrit.sshd.SshDaemon.InsecureBouncyCastleRandom.Factory ( ) ; } else { factory = org.apache.sshd.common.util.SecurityUtils.getRandomFactory ( ) ; } setRandomFactory ( new org.apache.sshd.common.random.SingletonRandomFactory ( factory ) ) ; }

Target:
private void initProviderBouncyCastle ( org.eclipse.jgit.lib.Config cfg ) { org.apache.sshd.common.NamedFactory < org.apache.sshd.common.random.Random > factory ; if ( cfg.getBoolean ( "sshd" , null , "testUseInsecureRandom" , false ) ) { factory = new com.google.gerrit.sshd.SshDaemon.InsecureBouncyCastleRandom.Factory ( ) ; } else { factory = org.apache.sshd.common.util.security.SecurityUtils.getRandomFactory ( ) ; } setRandomFactory ( new org.apache.sshd.common.random.SingletonRandomFactory ( factory ) ) ; }
Source:
private java.util.List < com.google.gerrit.client.reviewdb.AccountGroup > myOwnedGroups ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.Account.Id me = com.google.gerrit.client.rpc.RpcUtil.getAccountId ( ) ; final java.util.List < com.google.gerrit.client.reviewdb.AccountGroup > own = new java.util.ArrayList < com.google.gerrit.client.reviewdb.AccountGroup > ( ) ; for ( final com.google.gerrit.client.reviewdb.AccountGroup.Id groupId : groupCache.getGroups ( me ) ) { for ( final com.google.gerrit.client.reviewdb.AccountGroup g : db.accountGroups ( ) . ownedByGroup ( groupId ) ) { own.add ( g ) ; } } return own ; }

Target:
private java.util.List < com.google.gerrit.client.reviewdb.AccountGroup > myOwnedGroups ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.Account.Id me = com.google.gerrit.client.rpc.Common.getAccountId ( ) ; final java.util.List < com.google.gerrit.client.reviewdb.AccountGroup > own = new java.util.ArrayList < com.google.gerrit.client.reviewdb.AccountGroup > ( ) ; for ( final com.google.gerrit.client.reviewdb.AccountGroup.Id groupId : groupCache.getGroups ( me ) ) { for ( final com.google.gerrit.client.reviewdb.AccountGroup g : db.accountGroups ( ) . ownedByGroup ( groupId ) ) { own.add ( g ) ; } } return own ; }
Source:
public void rescan ( boolean forceCleanup ) { if ( ( rescanImp ( ) ) || forceCleanup ) { java.lang.System.gc ( ) ; processPendingCleanups ( ) ; } }

Target:
public void stop ( ) { if ( ( scanner ) != null ) { scanner.end ( ) ; } srvInfoImpl.state = ServerInformation.State.SHUTDOWN ; synchronized ( this ) { for ( com.google.gerrit.server.plugins.Plugin p : running.values ( ) ) { p.stop ( ) ; } running.clear ( ) ; broken.clear ( ) ; if ( ( cleanupHandles.size ( ) ) > ( running.size ( ) ) ) { java.lang.System.gc ( ) ; processPendingCleanups ( ) ; } } }
Source:
private static java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ProjectInfo > toProjectInfoMap ( com.google.gerrit.acceptance.RestResponse r ) throws java.io.IOException { java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ProjectInfo > result = newGson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ProjectInfo > > ( ) { } . getType ( ) ) ; return result ; }

Target:
private static void assertBadRequest ( com.google.gerrit.extensions.api.projects.Projects.ListRequest req ) throws java.lang.Exception { try { req.get ( ) ; } catch ( com.google.gerrit.extensions.restapi.BadRequestException expected ) { } }
Source:
public boolean equals ( java.lang.Object obj ) { return java.util.Objects.deepEquals ( this , obj ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj.getClass ( ) ) ) { return false ; } final com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.AccessToken other = ( ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.AccessToken ) ( obj ) ) ; return ( ( java.util.Objects.equals ( this . accessToken , other.accessToken ) ) && ( java.util.Objects.equals ( this . raw , other.raw ) ) ) && ( java.util.Objects.equals ( this . tokenType , other.tokenType ) ) ; }
Source:
private void enableForm ( final boolean canModifyAgreements , final boolean canModifyDescription , final boolean canModifyMergeType ) { submitType.setEnabled ( canModifyMergeType ) ; useContentMerge.setEnabled ( canModifyMergeType ) ; descTxt.setEnabled ( canModifyDescription ) ; useContributorAgreements.setEnabled ( canModifyAgreements ) ; useSignedOffBy.setEnabled ( canModifyAgreements ) ; requireChangeID.setEnabled ( canModifyMergeType ) ; }

Target:
private void enableForm ( final boolean canModifyAgreements , final boolean canModifyDescription , final boolean canModifyMergeType , final boolean canModifyState ) { submitType.setEnabled ( canModifyMergeType ) ; state.setEnabled ( canModifyState ) ; useContentMerge.setEnabled ( canModifyMergeType ) ; descTxt.setEnabled ( canModifyDescription ) ; useContributorAgreements.setEnabled ( canModifyAgreements ) ; useSignedOffBy.setEnabled ( canModifyAgreements ) ; requireChangeID.setEnabled ( canModifyMergeType ) ; }
Source:
private void addExtensionPoints ( com.google.gerrit.client.info.ChangeInfo change , com.google.gerrit.client.info.ChangeInfo.RevisionInfo rev ) { addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER , headerExtension , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER_RIGHT_OF_BUTTONS , headerExtensionMiddle , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER_RIGHT_OF_POP_DOWNS , headerExtensionRight , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_CHANGE_INFO_BLOCK , changeExtension , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_RELATED_INFO_BLOCK , relatedExtension , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_COMMIT_INFO_BLOCK , commitExtension , change , rev ) ; }

Target:
private void addExtensionPoints ( com.google.gerrit.client.info.ChangeInfo change , com.google.gerrit.client.info.ChangeInfo.RevisionInfo rev ) { addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER , headerExtension , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER_RIGHT_OF_BUTTONS , headerExtensionMiddle , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER_RIGHT_OF_POP_DOWNS , headerExtensionRight , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_CHANGE_INFO_BLOCK , changeExtension , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_RELATED_INFO_BLOCK , relatedExtension , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_COMMIT_INFO_BLOCK , commitExtension , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HISTORY_RIGHT_OF_BUTTONS , historyExtensionRight , change , rev ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { normalProject = createProject ( "normal" ) ; secretProject = createProject ( "secret" ) ; secretRefProject = createProject ( "secretRef" ) ; privilegedGroup = groupCache.get ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( createGroup ( "privilegedGroup" ) ) ) ; privilegedUser = accounts.create ( "privilegedUser" , "snowden@nsa.gov" , "Ed Snowden" ) ; gApi.groups ( ) . id ( privilegedGroup.getGroupUUID ( ) . get ( ) ) . addMembers ( privilegedUser.username ) ; com.google.common.truth.Truth.assertThat ( gApi.groups ( ) . id ( privilegedGroup.getGroupUUID ( ) . get ( ) ) . members ( ) . get ( 0 ) . email ) . contains ( "snowden" ) ; grant ( secretProject , "refs/*" , Permission.READ , false , privilegedGroup.getGroupUUID ( ) ) ; block ( secretProject , "refs/*" , Permission.READ , SystemGroupBackend.REGISTERED_USERS ) ; deny ( secretRefProject , "refs/*" , Permission.READ , SystemGroupBackend.ANONYMOUS_USERS ) ; grant ( secretRefProject , "refs/heads/secret/*" , Permission.READ , false , privilegedGroup.getGroupUUID ( ) ) ; block ( secretRefProject , "refs/heads/secret/*" , Permission.READ , SystemGroupBackend.REGISTERED_USERS ) ; grant ( secretRefProject , "refs/heads/*" , Permission.READ , false , SystemGroupBackend.REGISTERED_USERS ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { normalProject = createProject ( "normal" ) ; secretProject = createProject ( "secret" ) ; secretRefProject = createProject ( "secretRef" ) ; privilegedGroup = groupCache.get ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( createGroup ( "privilegedGroup" ) ) ) ; privilegedUser = accountCreator.create ( "privilegedUser" , "snowden@nsa.gov" , "Ed Snowden" ) ; gApi.groups ( ) . id ( privilegedGroup.getGroupUUID ( ) . get ( ) ) . addMembers ( privilegedUser.username ) ; com.google.common.truth.Truth.assertThat ( gApi.groups ( ) . id ( privilegedGroup.getGroupUUID ( ) . get ( ) ) . members ( ) . get ( 0 ) . email ) . contains ( "snowden" ) ; grant ( secretProject , "refs/*" , Permission.READ , false , privilegedGroup.getGroupUUID ( ) ) ; block ( secretProject , "refs/*" , Permission.READ , SystemGroupBackend.REGISTERED_USERS ) ; deny ( secretRefProject , "refs/*" , Permission.READ , SystemGroupBackend.ANONYMOUS_USERS ) ; grant ( secretRefProject , "refs/heads/secret/*" , Permission.READ , false , privilegedGroup.getGroupUUID ( ) ) ; block ( secretRefProject , "refs/heads/secret/*" , Permission.READ , SystemGroupBackend.REGISTERED_USERS ) ; grant ( secretRefProject , "refs/heads/*" , Permission.READ , false , SystemGroupBackend.REGISTERED_USERS ) ; }
Source:
public void byProject ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo1 = createProject ( "repo1" ) ; org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo2 = createProject ( "repo2" ) ; com.google.gerrit.reviewdb.client.Change change1 = newChange ( repo1 , null , null , null , null ) . insert ( ) ; com.google.gerrit.reviewdb.client.Change change2 = newChange ( repo2 , null , null , null , null ) . insert ( ) ; assertQuery ( "project:foo" ) ; assertQuery ( "project:repo" ) ; assertQuery ( "project:repo1" , change1 ) ; assertQuery ( "project:repo2" , change2 ) ; }

Target:
public void byProjectPrefix ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo1 = createProject ( "repo1" ) ; org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo2 = createProject ( "repo2" ) ; com.google.gerrit.reviewdb.client.Change change1 = insert ( newChange ( repo1 , null , null , null , null ) ) ; com.google.gerrit.reviewdb.client.Change change2 = insert ( newChange ( repo2 , null , null , null , null ) ) ; assertQuery ( "projects:foo" ) ; assertQuery ( "projects:repo1" , change1 ) ; assertQuery ( "projects:repo2" , change2 ) ; assertQuery ( "projects:repo" , change2 , change1 ) ; }
Source:
private void dropRemovedDisabledPlugins ( java.util.List < java.io.File > jars ) { java.util.Set < java.lang.String > unload = com.google.common.collect.Sets.newHashSet ( disabled.keySet ( ) ) ; for ( java.io.File jar : jars ) { unload.remove ( com.google.gerrit.server.plugins.PluginLoader.nameOf ( jar ) ) ; } for ( java.lang.String name : unload ) { disabled.remove ( name ) ; } }

Target:
private void dropRemovedDisabledPlugins ( java.util.List < java.io.File > jars ) { java.util.Set < java.lang.String > unload = com.google.common.collect.Sets.newHashSet ( disabled.keySet ( ) ) ; for ( java.io.File jar : jars ) { if ( jar.getName ( ) . endsWith ( ".disabled" ) ) { unload.remove ( com.google.gerrit.server.plugins.PluginLoader.nameOf ( jar ) ) ; } } for ( java.lang.String name : unload ) { disabled.remove ( name ) ; } }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; com.google.gerrit.client.rpc.CallbackGroup cmGroup = new com.google.gerrit.client.rpc.CallbackGroup ( ) ; net.codemirror.lib.CodeMirror.initLibrary ( cmGroup.add ( com.google.gerrit.client.rpc.CallbackGroup.< java.lang.Void > emptyCallback ( ) ) ) ; initPath ( ) ; com.google.gerrit.client.changes.ChangeFileApi.getContentOrMessage ( revision , path , cmGroup.addFinal ( new com.google.gerrit.client.rpc.ScreenLoadCallback < java.lang.String > ( this ) { @ java.lang.Override protected void preDisplay ( java.lang.String content ) { initEditor ( content ) ; } } ) ) ; }

Target:
public void onSuccess ( java.lang.String result ) { type = result ; injectMode ( result , modeInjectorCb ) ; }
Source:
protected void afterExecute ( java.lang.Runnable r , java.lang.Throwable t ) { final com.google.gerrit.server.git.WorkQueue.Task < ? > task = ( ( com.google.gerrit.server.git.WorkQueue.Task < ? > ) ( r ) ) ; if ( ! ( task.isPeriodic ( ) ) ) { remove ( task ) ; } super . afterExecute ( r , t ) ; }

Target:
protected void afterExecute ( java.lang.Runnable r , java.lang.Throwable t ) { if ( r instanceof com.google.gerrit.server.git.WorkQueue.Task ) { final com.google.gerrit.server.git.WorkQueue.Task < ? > task = ( ( com.google.gerrit.server.git.WorkQueue.Task < ? > ) ( r ) ) ; if ( ! ( task.isPeriodic ( ) ) ) { remove ( task ) ; } } else { com.google.gerrit.server.git.WorkQueue.log.error ( ( ( ( "Non task object in queue: " + ( r.getClass ( ) ) ) + ": " ) + r ) ) ; } super . afterExecute ( r , t ) ; }
Source:
void onEdit ( ) { if ( canEdit ) { show.setVisible ( false ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( form , true ) ; input.setText ( text.getText ( ) ) ; input.setFocus ( true ) ; } }

Target:
private void initTopicLink ( com.google.gerrit.client.changes.ChangeInfo info ) { text.setText ( info.topic ( ) ) ; text.setTargetHistoryToken ( com.google.gerrit.common.PageLinks.toChangeQuery ( com.google.gerrit.client.ui.BranchLink.query ( info.project_name_key ( ) , info.status ( ) , info.branch ( ) , info.topic ( ) ) ) ) ; }
Source:
protected void ccExistingReviewers ( ) { if ( ( ! ( NotifyHandling.ALL.equals ( notify ) ) ) && ( ! ( NotifyHandling.OWNER_REVIEWERS.equals ( notify ) ) ) ) { return ; } try { for ( com.google.gerrit.reviewdb.client.Account.Id id : changeData.reviewers ( ) . get ( com.google.gerrit.server.notedb.ReviewerStateInternal.REVIEWER ) ) { add ( RecipientType.CC , id ) ; } } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.ChangeEmail.log.warn ( "Cannot CC users that commented on updated change" , err ) ; } }

Target:
protected void ccExistingReviewers ( ) { if ( ( ! ( NotifyHandling.ALL.equals ( notify ) ) ) && ( ! ( NotifyHandling.OWNER_REVIEWERS.equals ( notify ) ) ) ) { return ; } try { for ( com.google.gerrit.reviewdb.client.Account.Id id : changeData.reviewers ( ) . byState ( com.google.gerrit.server.notedb.ReviewerStateInternal.REVIEWER ) ) { add ( RecipientType.CC , id ) ; } } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.ChangeEmail.log.warn ( "Cannot CC users that commented on updated change" , err ) ; } }
Source:
public boolean canRebase ( ) { return rebaseUtil.canRebase ( revision ) ; }

Target:
public boolean canRebase ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( revision.getProject ( ) ) ; org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { return rebaseUtil.canRebase ( revision.getPatchSet ( ) , revision.getChange ( ) . getDest ( ) , repo , rw ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot check if rebase is possible" , e ) ; } }
Source:
public com.google.gerrit.server.group.GroupJson.GroupInfo format ( com.google.gerrit.server.group.GroupResource rsrc ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.group.GroupJson.GroupInfo info = init ( rsrc.getGroup ( ) ) ; initMembersAndIncludes ( rsrc , info ) ; return info ; }

Target:
public com.google.gerrit.extensions.common.GroupInfo format ( com.google.gerrit.common.data.GroupDescription.Basic group ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.extensions.common.GroupInfo info = init ( group ) ; if ( ( options.contains ( com.google.gerrit.extensions.client.ListGroupsOption.MEMBERS ) ) || ( options.contains ( com.google.gerrit.extensions.client.ListGroupsOption.INCLUDES ) ) ) { com.google.gerrit.server.group.GroupResource rsrc = new com.google.gerrit.server.group.GroupResource ( groupControlFactory.controlFor ( group ) ) ; initMembersAndIncludes ( rsrc , info ) ; } return info ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { cm.setCursor ( net.codemirror.lib.LineCharacter.create ( line ) ) ; cm.scrollToY ( ( height - ( 0.5 * scrollbarHeight ) ) ) ; cm.focus ( ) ; }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { double y = cm.heightAtLine ( line , "local" ) ; double viewport = cm.getScrollInfo ( ) . getClientHeight ( ) ; cm.setCursor ( net.codemirror.lib.LineCharacter.create ( line ) ) ; cm.scrollToY ( ( y - ( 0.5 * viewport ) ) ) ; cm.focus ( ) ; }
Source:
private void deleteAll ( ) throws java.io.IOException { java.io.File file = new java.io.File ( sitePaths.index_dir , "changes" ) ; if ( file.exists ( ) ) { org.apache.lucene.store.Directory dir = org.apache.lucene.store.FSDirectory.open ( file ) ; try { for ( java.lang.String name : dir.listAll ( ) ) { dir.deleteFile ( name ) ; } } finally { dir.close ( ) ; } } }

Target:
private void deleteAll ( ) throws java.io.IOException { for ( java.lang.String index : com.google.gerrit.lucene.IndexVersionCheck.SCHEMA_VERSIONS.keySet ( ) ) { java.io.File file = new java.io.File ( sitePaths.index_dir , index ) ; if ( file.exists ( ) ) { org.apache.lucene.store.Directory dir = org.apache.lucene.store.FSDirectory.open ( file ) ; try { for ( java.lang.String name : dir.listAll ( ) ) { dir.deleteFile ( name ) ; } } finally { dir.close ( ) ; } } } }
Source:
private com.google.gerrit.reviewdb.client.AccountGroup createAccountGroup ( com.google.gerrit.extensions.common.GroupInfo info ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.AccountGroup.Id groupId = new com.google.gerrit.reviewdb.client.AccountGroup.Id ( db.nextAccountGroupId ( ) ) ; com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid = new com.google.gerrit.reviewdb.client.AccountGroup.UUID ( info.id ) ; com.google.gerrit.reviewdb.client.AccountGroup group = new com.google.gerrit.reviewdb.client.AccountGroup ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( info.name ) , groupId , uuid ) ; group.setVisibleToAll ( cfg.getBoolean ( "groups" , "newGroupsVisibleToAll" , false ) ) ; group.setDescription ( info.description ) ; return group ; }

Target:
private com.google.gerrit.reviewdb.client.AccountGroup createAccountGroup ( com.google.gerrit.extensions.common.GroupInfo info ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.AccountGroup.Id groupId = new com.google.gerrit.reviewdb.client.AccountGroup.Id ( db.nextAccountGroupId ( ) ) ; com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid = new com.google.gerrit.reviewdb.client.AccountGroup.UUID ( info.id ) ; com.google.gerrit.reviewdb.client.AccountGroup group = new com.google.gerrit.reviewdb.client.AccountGroup ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( info.name ) , groupId , uuid , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; group.setVisibleToAll ( cfg.getBoolean ( "groups" , "newGroupsVisibleToAll" , false ) ) ; group.setDescription ( info.description ) ; return group ; }
Source:
public void getNonExistingCommit_NotFound ( ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = adminSession.get ( ( ( ( "/projects/" + ( project.get ( ) ) ) + "/commits/" ) + ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) . name ( ) ) ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_NOT_FOUND , r.getStatusCode ( ) ) ; }

Target:
private void assertNotFound ( org.eclipse.jgit.lib.ObjectId id ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = userSession.get ( ( ( ( "/projects/" + ( project.get ( ) ) ) + "/commits/" ) + ( id.name ( ) ) ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_NOT_FOUND , r.getStatusCode ( ) ) ; }
Source:
protected PushOneCommit.Result amendChange ( java.lang.String changeId , java.lang.String ref ) throws java.lang.Exception { java.util.Collections.shuffle ( com.google.gerrit.acceptance.AbstractDaemonTest.RANDOM ) ; com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , testRepo , PushOneCommit.SUBJECT , PushOneCommit.FILE_NAME , new java.lang.String ( com.google.common.primitives.Chars.toArray ( com.google.gerrit.acceptance.AbstractDaemonTest.RANDOM ) ) , changeId ) ; return push.to ( ref ) ; }

Target:
protected PushOneCommit.Result createChange ( java.lang.String subject , java.lang.String fileName , java.lang.String content , java.lang.String topic ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , testRepo , subject , fileName , content ) ; return push.to ( ( "refs/for/master/" + ( name ( topic ) ) ) ) ; }
Source:
private com.google.gerrit.httpd.rpc.patch.PatchScriptBuilder newBuilder ( final com.google.gerrit.server.patch.PatchList list , org.eclipse.jgit.lib.Repository git ) { final com.google.gerrit.reviewdb.AccountDiffPreference dp = new com.google.gerrit.reviewdb.AccountDiffPreference ( diffPrefs ) ; final com.google.gerrit.httpd.rpc.patch.PatchScriptBuilder b = builderFactory.get ( ) ; b.setRepository ( git ) ; b.setChange ( change ) ; b.setDiffPrefs ( dp ) ; b.setTrees ( list.getOldId ( ) , list.getNewId ( ) ) ; return b ; }

Target:
private com.google.gerrit.httpd.rpc.patch.PatchScriptBuilder newBuilder ( final com.google.gerrit.server.patch.PatchList list , org.eclipse.jgit.lib.Repository git ) { final com.google.gerrit.reviewdb.AccountDiffPreference dp = new com.google.gerrit.reviewdb.AccountDiffPreference ( diffPrefs ) ; final com.google.gerrit.httpd.rpc.patch.PatchScriptBuilder b = builderFactory.get ( ) ; b.setRepository ( git ) ; b.setChange ( change ) ; b.setDiffPrefs ( dp ) ; b.setTrees ( list.isAgainstParent ( ) , list.getOldId ( ) , list.getNewId ( ) ) ; return b ; }
Source:
public static com.google.gerrit.reviewdb.server.ReviewDb unwrapDb ( com.google.gerrit.reviewdb.server.ReviewDb db ) { if ( db instanceof com.google.gerrit.reviewdb.server.DisallowReadFromChangesReviewDbWrapper ) { return ( ( com.google.gerrit.reviewdb.server.DisallowReadFromChangesReviewDbWrapper ) ( db ) ) . unsafeGetDelegate ( ) ; } return db ; }

Target:
public static com.google.gerrit.reviewdb.server.ReviewDb unwrapDb ( com.google.gerrit.reviewdb.server.ReviewDb db ) { if ( db instanceof com.google.gerrit.reviewdb.server.DisallowReadFromChangesReviewDbWrapper ) { return com.google.gerrit.reviewdb.server.ReviewDbUtil.unwrapDb ( ( ( com.google.gerrit.reviewdb.server.DisallowReadFromChangesReviewDbWrapper ) ( db ) ) . unsafeGetDelegate ( ) ) ; } if ( db instanceof com.google.gerrit.reviewdb.server.DisallowReadFromGroupsReviewDbWrapper ) { return com.google.gerrit.reviewdb.server.ReviewDbUtil.unwrapDb ( ( ( com.google.gerrit.reviewdb.server.DisallowReadFromGroupsReviewDbWrapper ) ( db ) ) . unsafeGetDelegate ( ) ) ; } return db ; }
Source:
private com.google.gerrit.reviewdb.AccountGroup newGroup ( com.google.gerrit.reviewdb.ReviewDb c , java.lang.String name , com.google.gerrit.reviewdb.AccountGroup.UUID uuid ) throws com.google.gwtorm.client.OrmException { if ( uuid == null ) { uuid = com.google.gerrit.server.account.GroupUUID.make ( name , serverUser ) ; } return new com.google.gerrit.reviewdb.AccountGroup ( new com.google.gerrit.reviewdb.AccountGroup.NameKey ( name ) , new com.google.gerrit.reviewdb.AccountGroup.Id ( c.nextAccountGroupId ( ) ) , uuid ) ; }

Target:
private com.google.gerrit.reviewdb.client.AccountGroup newGroup ( com.google.gerrit.reviewdb.server.ReviewDb c , java.lang.String name , com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) throws com.google.gwtorm.server.OrmException { if ( uuid == null ) { uuid = com.google.gerrit.server.account.GroupUUID.make ( name , serverUser ) ; } return new com.google.gerrit.reviewdb.client.AccountGroup ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( name ) , new com.google.gerrit.reviewdb.client.AccountGroup.Id ( c.nextAccountGroupId ( ) ) , uuid ) ; }
Source:
protected void configureServlets ( ) { java.lang.Class < ? extends javax.servlet.Filter > authFilter ; if ( authConfig.isTrustContainerAuth ( ) ) { authFilter = com.google.gerrit.httpd.ContainerAuthFilter.class ; } else { authFilter = com.google.gerrit.httpd.ProjectDigestFilter.class ; } java.lang.String git = GitOverHttpServlet.URL_REGEX ; filterRegex ( git ) . through ( authFilter ) ; serveRegex ( git ) . with ( com.google.gerrit.httpd.GitOverHttpServlet.class ) ; filter ( "/a/*" ) . through ( authFilter ) ; }

Target:
protected void configureServlets ( ) { java.lang.Class < ? extends javax.servlet.Filter > authFilter ; if ( authConfig.isTrustContainerAuth ( ) ) { authFilter = com.google.gerrit.httpd.ContainerAuthFilter.class ; } else if ( authConfig.isGitBasichAuth ( ) ) { authFilter = com.google.gerrit.httpd.ProjectBasicAuthFilter.class ; } else { authFilter = com.google.gerrit.httpd.ProjectDigestFilter.class ; } java.lang.String git = GitOverHttpServlet.URL_REGEX ; filterRegex ( git ) . through ( authFilter ) ; serveRegex ( git ) . with ( com.google.gerrit.httpd.GitOverHttpServlet.class ) ; filter ( "/a/*" ) . through ( authFilter ) ; }
Source:
public com.google.gerrit.server.notedb.ChangeNotes notes ( ) throws com.google.gwtorm.server.OrmException { if ( ( notes ) == null ) { notes = notesFactory.create ( db , project ( ) , legacyId ) ; } return notes ; }

Target:
public com.google.gerrit.server.notedb.ChangeNotes notes ( ) throws com.google.gwtorm.server.OrmException { if ( ( notes ) == null ) { if ( ! ( lazyLoad ) ) { throw new com.google.gwtorm.server.OrmException ( "ChangeNotes not available, lazyLoad = false" ) ; } notes = notesFactory.create ( db , project ( ) , legacyId ) ; } return notes ; }
Source:
private void extractMailExample ( java.lang.String orig ) throws java.lang.Exception { java.io.File ex = new java.io.File ( site.mail_dir , ( orig + ".example" ) ) ; com.google.gerrit.pgm.init.api.InitUtil.extract ( ex.toPath ( ) , com.google.gerrit.server.mail.OutgoingEmail.class , orig ) ; com.google.gerrit.common.FileUtil.chmod ( 292 , ex ) ; }

Target:
private void extractMailExample ( java.lang.String orig ) throws java.lang.Exception { java.nio.file.Path ex = site.mail_dir.resolve ( ( orig + ".example" ) ) ; com.google.gerrit.pgm.init.api.InitUtil.extract ( ex , com.google.gerrit.server.mail.OutgoingEmail.class , orig ) ; com.google.gerrit.common.FileUtil.chmod ( 292 , ex ) ; }
Source:
private boolean canPushWithForce ( ) { if ( ( GitRepositoryManager.REF_CONFIG.equals ( refName ) ) && ( ! ( projectControl.isOwner ( ) ) ) ) { return false ; } for ( com.google.gerrit.common.data.PermissionRule rule : access ( Permission.PUSH ) ) { if ( rule.getForce ( ) ) { return true ; } } return false ; }

Target:
private boolean canPushWithForce ( ) { if ( ( GitRepositoryManager.REF_CONFIG.equals ( refName ) ) && ( ! ( projectControl.isOwner ( ) ) ) ) { return false ; } boolean result = false ; for ( com.google.gerrit.common.data.PermissionRule rule : access ( Permission.PUSH ) ) { if ( rule.isBlock ( ) ) { return false ; } if ( rule.getForce ( ) ) { result = true ; } } return result ; }