auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void commit ( org.eclipse.jgit.lib.Repository allUsersRepo , com.google.gerrit.server.group.db.GroupConfig groupConfig , com.google.gerrit.server.group.db.GroupNameNotes groupNameNotes ) throws java.io.IOException { org.eclipse.jgit.lib.BatchRefUpdate batchRefUpdate = allUsersRepo.getRefDatabase ( ) . newBatchUpdate ( ) ; try ( com.google.gerrit.server.git.MetaDataUpdate metaDataUpdate = createMetaDataUpdate ( allUsersRepo , batchRefUpdate ) ) { groupConfig.commit ( metaDataUpdate ) ; } try ( com.google.gerrit.server.git.MetaDataUpdate metaDataUpdate = createMetaDataUpdate ( allUsersRepo , batchRefUpdate ) ) { groupNameNotes.commit ( metaDataUpdate ) ; } try ( org.eclipse.jgit.revwalk.RevWalk revWalk = new org.eclipse.jgit.revwalk.RevWalk ( allUsersRepo ) ) { com.google.gerrit.server.update.RefUpdateUtil.executeChecked ( batchRefUpdate , revWalk ) ; } }

Target:
private void commit ( org.eclipse.jgit.lib.Repository allUsersRepo , com.google.gerrit.server.group.db.GroupConfig groupConfig , com.google.gerrit.server.group.db.GroupNameNotes groupNameNotes ) throws java.io.IOException { org.eclipse.jgit.lib.BatchRefUpdate batchRefUpdate = allUsersRepo.getRefDatabase ( ) . newBatchUpdate ( ) ; try ( com.google.gerrit.server.git.MetaDataUpdate metaDataUpdate = createMetaDataUpdate ( allUsersRepo , batchRefUpdate ) ) { groupConfig.commit ( metaDataUpdate ) ; } try ( com.google.gerrit.server.git.MetaDataUpdate metaDataUpdate = createMetaDataUpdate ( allUsersRepo , batchRefUpdate ) ) { groupNameNotes.commit ( metaDataUpdate ) ; } com.google.gerrit.server.update.RefUpdateUtil.executeChecked ( batchRefUpdate , allUsersRepo ) ; }
Source:
void schedule ( final com.google.gerrit.client.reviewdb.Project.NameKey project , final java.lang.String ref , final org.spearce.jgit.transport.URIish uri ) { synchronized ( pending ) { com.google.gerrit.git.PushOp e = pending.get ( uri ) ; if ( e == null ) { e = new com.google.gerrit.git.PushOp ( this , project.get ( ) , remote , uri ) ; pool.schedule ( e , delay , java.util.concurrent.TimeUnit.SECONDS ) ; pending.put ( uri , e ) ; } e.addRef ( ref ) ; } }

Target:
void schedule ( final com.google.gerrit.client.reviewdb.Project.NameKey project , final java.lang.String ref , final org.spearce.jgit.transport.URIish uri ) { synchronized ( pending ) { com.google.gerrit.git.PushOp e = pending.get ( uri ) ; if ( e == null ) { e = new com.google.gerrit.git.PushOp ( server , this , project.get ( ) , remote , uri ) ; pool.schedule ( e , delay , java.util.concurrent.TimeUnit.SECONDS ) ; pending.put ( uri , e ) ; } e.addRef ( ref ) ; } }
Source:
private static Account.Id toAccountId ( final com.google.gerrit.server.account.AccountResolver accountResolver , final java.lang.String nameOrEmail ) throws com.google.gerrit.common.errors.NoSuchAccountException , com.google.gwtorm.server.OrmException { final com.google.gerrit.reviewdb.client.Account a = accountResolver.findByNameOrEmail ( nameOrEmail ) ; if ( a == null ) { throw new com.google.gerrit.common.errors.NoSuchAccountException ( ( ( "\"" + nameOrEmail ) + "\" is not registered" ) ) ; } return a.getId ( ) ; }

Target:
private static Account.Id toAccountId ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.account.AccountResolver accountResolver , java.lang.String nameOrEmail ) throws com.google.gerrit.common.errors.NoSuchAccountException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Account a = accountResolver.findByNameOrEmail ( db , nameOrEmail ) ; if ( a == null ) { throw new com.google.gerrit.common.errors.NoSuchAccountException ( ( ( "\"" + nameOrEmail ) + "\" is not registered" ) ) ; } return a.getId ( ) ; }
Source:
public void testChildString ( ) { final long pId = 21281821821821881L ; final long cId = 18218181281818888L ; final com.google.gwtorm.client.LongKeyTestCase.Child c1 = new com.google.gwtorm.client.LongKeyTestCase.Child ( new com.google.gwtorm.client.LongKeyTestCase.Parent ( pId ) , cId ) ; assertEquals ( ( ( pId + "," ) + cId ) , c1.toString ( ) ) ; final com.google.gwtorm.client.LongKeyTestCase.Child c2 = new com.google.gwtorm.client.LongKeyTestCase.Child ( new com.google.gwtorm.client.LongKeyTestCase.Parent ( 0 ) , 0 ) ; c2.fromString ( c1.toString ( ) ) ; assertEquals ( c1 , c2 ) ; }

Target:
public void testChildString ( ) { final long pId = 21281821821821881L ; final long cId = 18218181281818888L ; final com.google.gwtorm.client.LongKeyTestCase.Child c1 = new com.google.gwtorm.client.LongKeyTestCase.Child ( new com.google.gwtorm.client.LongKeyTestCase.Parent ( pId ) , cId ) ; org.junit.Assert.assertEquals ( ( ( pId + "," ) + cId ) , c1.toString ( ) ) ; final com.google.gwtorm.client.LongKeyTestCase.Child c2 = new com.google.gwtorm.client.LongKeyTestCase.Child ( new com.google.gwtorm.client.LongKeyTestCase.Parent ( 0 ) , 0 ) ; c2.fromString ( c1.toString ( ) ) ; org.junit.Assert.assertEquals ( c1 , c2 ) ; }
Source:
private org.eclipse.jgit.internal.storage.file.LockFile lockForDelete ( com.google.gerrit.reviewdb.client.Project.NameKey project ) throws com.google.gerrit.extensions.restapi.ResourceConflictException { java.io.File importStatus = projects.FS_LAYOUT.getImportStatusFile ( project.get ( ) ) ; org.eclipse.jgit.internal.storage.file.LockFile lockFile = new org.eclipse.jgit.internal.storage.file.LockFile ( importStatus ) ; try { if ( lockFile.lock ( ) ) { return lockFile ; } else { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "project is being imported from another session" ) ; } } catch ( java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "failed to lock project for delete" ) ; } }

Target:
private org.eclipse.jgit.internal.storage.file.LockFile lockForDelete ( com.google.gerrit.reviewdb.client.Project.NameKey project ) throws com.google.gerrit.extensions.restapi.ResourceConflictException { java.io.File importStatus = projects.FS_LAYOUT.getImportStatusFile ( project.get ( ) ) ; org.eclipse.jgit.internal.storage.file.LockFile lockFile = new org.eclipse.jgit.internal.storage.file.LockFile ( importStatus ) ; try { if ( lockFile.lock ( ) ) { return lockFile ; } throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "project is being imported from another session" ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "failed to lock project for delete" ) ; } }
Source:
public java.lang.Void get ( long timeout , java.util.concurrent.TimeUnit unit ) throws java.lang.InterruptedException , java.util.concurrent.ExecutionException , java.util.concurrent.TimeoutException { if ( ! ( isDone ( ) ) ) { reopenThread.waitForGeneration ( gen , ( ( int ) ( java.util.concurrent.TimeUnit.MILLISECONDS.convert ( timeout , unit ) ) ) ) ; set ( null ) ; } return super . get ( timeout , unit ) ; }

Target:
public java.lang.Void get ( long timeout , java.util.concurrent.TimeUnit unit ) throws java.lang.InterruptedException , java.util.concurrent.ExecutionException , java.util.concurrent.TimeoutException { if ( ! ( isDone ( ) ) ) { if ( reopenThread.waitForGeneration ( gen , ( ( int ) ( java.util.concurrent.TimeUnit.MILLISECONDS.convert ( timeout , unit ) ) ) ) ) { set ( null ) ; } else { throw new java.util.concurrent.TimeoutException ( ) ; } } return super . get ( timeout , unit ) ; }
Source:
public void index ( com.google.gerrit.reviewdb.client.Account.Id id ) throws java.io.IOException { for ( com.google.gerrit.index.Index < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.server.account.AccountState > i : getWriteIndexes ( ) ) { java.util.Optional < com.google.gerrit.server.account.AccountState > accountState = byIdCache.maybeGet ( id ) ; if ( accountState.isPresent ( ) ) { i.replace ( accountState.get ( ) ) ; } else { i.delete ( id ) ; } } fireAccountIndexedEvent ( id.get ( ) ) ; com.google.gerrit.server.index.account.AccountIndexerImpl.autoReindexIfStale ( id ) ; }

Target:
public void index ( com.google.gerrit.reviewdb.client.Account.Id id ) throws java.io.IOException { for ( com.google.gerrit.index.Index < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.server.account.AccountState > i : getWriteIndexes ( ) ) { java.util.Optional < com.google.gerrit.server.account.AccountState > accountState = byIdCache.get ( id ) ; if ( accountState.isPresent ( ) ) { i.replace ( accountState.get ( ) ) ; } else { i.delete ( id ) ; } } fireAccountIndexedEvent ( id.get ( ) ) ; com.google.gerrit.server.index.account.AccountIndexerImpl.autoReindexIfStale ( id ) ; }
Source:
protected void doGetText ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException { java.lang.String name = describe ( org.eclipse.jgit.http.server.ServletUtils.getRepository ( req ) , com.google.gitiles.ViewFilter.getView ( req ) , req , res ) ; if ( name == null ) { return ; } java.io.Writer out = startRenderText ( req , res ) ; out.write ( com.google.gitiles.RefServlet.sanitizeRefForText ( name ) ) ; out.close ( ) ; }

Target:
protected void doGetText ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException { java.lang.String name = describe ( org.eclipse.jgit.http.server.ServletUtils.getRepository ( req ) , com.google.gitiles.ViewFilter.getView ( req ) , req , res ) ; if ( name == null ) { return ; } try ( java.io.Writer out = startRenderText ( req , res ) ) { out.write ( com.google.gitiles.RefServlet.sanitizeRefForText ( name ) ) ; } }
Source:
private org.eclipse.jgit.revwalk.RevCommit makeCommit ( ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.util.Set < java.io.File > files = new java.util.HashSet < > ( ) ; files.add ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.createEmptyFile ( com.googlesource.gerrit.plugins.uploadvalidator.MaxPathLengthValidatorTest.TOO_LONG , repo ) ) ; files.add ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.createEmptyFile ( com.googlesource.gerrit.plugins.uploadvalidator.MaxPathLengthValidatorTest.GOOD , repo ) ) ; return com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.makeCommit ( repo , "Commit with empty test files." , files ) ; }

Target:
private org.eclipse.jgit.revwalk.RevCommit makeCommit ( org.eclipse.jgit.revwalk.RevWalk rw ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.util.Set < java.io.File > files = new java.util.HashSet < > ( ) ; files.add ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.createEmptyFile ( com.googlesource.gerrit.plugins.uploadvalidator.MaxPathLengthValidatorTest.TOO_LONG , repo ) ) ; files.add ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.createEmptyFile ( com.googlesource.gerrit.plugins.uploadvalidator.MaxPathLengthValidatorTest.GOOD , repo ) ) ; return com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.makeCommit ( rw , repo , "Commit with empty test files." , files ) ; }
Source:
private org.eclipse.jgit.revwalk.RevCommit squashEdit ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.lib.ObjectInserter inserter , org.eclipse.jgit.revwalk.RevCommit edit , com.google.gerrit.reviewdb.client.PatchSet basePatchSet ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , java.io.IOException { org.eclipse.jgit.revwalk.RevCommit parent = rw.parseCommit ( org.eclipse.jgit.lib.ObjectId.fromString ( basePatchSet.getRevision ( ) . get ( ) ) ) ; if ( parent.getTree ( ) . equals ( edit.getTree ( ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "identical tree" ) ; } return com.google.gerrit.server.edit.ChangeEditUtil.writeSquashedCommit ( rw , inserter , parent , edit ) ; }

Target:
private org.eclipse.jgit.revwalk.RevCommit squashEdit ( org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.lib.ObjectInserter inserter , org.eclipse.jgit.revwalk.RevCommit edit , com.google.gerrit.reviewdb.client.PatchSet basePatchSet ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , java.io.IOException { org.eclipse.jgit.revwalk.RevCommit parent = rw.parseCommit ( org.eclipse.jgit.lib.ObjectId.fromString ( basePatchSet.getRevision ( ) . get ( ) ) ) ; if ( parent.getTree ( ) . equals ( edit.getTree ( ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "identical tree" ) ; } return com.google.gerrit.server.edit.ChangeEditUtil.writeSquashedCommit ( rw , inserter , parent , edit ) ; }
Source:
public com.google.gerrit.server.notedb.ChangeNotes call ( ) throws java.lang.Exception { 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 ( args , project , change ) . load ( ) ; }

Target:
public com.google.gerrit.server.notedb.ChangeNotes call ( ) throws java.lang.Exception { 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 ( args , change ) . load ( ) ; }
Source:
public void onSend ( ) { com.google.gerrit.client.changes.ChangeApi.createChange ( project , getDestinationBranch ( ) , message.getText ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.changes.ChangeInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { sent = true ; hide ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( result.legacy_id ( ) ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { enableButtons ( true ) ; super . onFailure ( caught ) ; } } ) ; }

Target:
public void onSend ( ) { com.google.gerrit.client.changes.ChangeApi.createChange ( project , getDestinationBranch ( ) , message.getText ( ) , null , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.changes.ChangeInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { sent = true ; hide ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( result.legacy_id ( ) ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { enableButtons ( true ) ; super . onFailure ( caught ) ; } } ) ; }
Source:
public void addFileOwners ( java.lang.String file , java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > owners ) { java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > set = fileOwners.get ( file ) ; if ( set != null ) { set.addAll ( owners ) ; } else { fileOwners.put ( file , com.google.common.collect.Sets.newHashSet ( owners ) ) ; } }

Target:
public void addFileOwners ( java.lang.String file , java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > owners ) { if ( owners.isEmpty ( ) ) { return ; } java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > set = fileOwners.get ( file ) ; if ( set != null ) { set.addAll ( owners ) ; } else { fileOwners.put ( file , com.google.common.collect.Sets.newHashSet ( owners ) ) ; } }
Source:
protected void configure ( ) { bind ( com.google.gerrit.pgm.util.ConsoleUI.class ) . toInstance ( ui ) ; bind ( java.io.File.class ) . annotatedWith ( com.google.gerrit.server.config.SitePath.class ) . toInstance ( sitePath ) ; bind ( com.google.gerrit.pgm.init.ReloadSiteLibrary.class ) . toInstance ( new com.google.gerrit.pgm.init.ReloadSiteLibrary ( ) { @ java.lang.Override public void reload ( ) { com.google.gerrit.pgm.Init.super . loadSiteLib ( ) ; } } ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.pgm.util.ConsoleUI.class ) . toInstance ( ui ) ; bind ( java.io.File.class ) . annotatedWith ( com.google.gerrit.server.config.SitePath.class ) . toInstance ( sitePath ) ; }
Source:
public void incompleteHtmlIsLiteral ( ) throws java.lang.Exception { java.lang.String markdown = "Incomplete <html is literal." ; repo.branch ( "master" ) . commit ( ) . add ( "index.md" , markdown ) . create ( ) ; java.lang.String html = buildHtml ( "/repo/+doc/master/index.md" ) ; org.junit.Assert.assertTrue ( html.contains ( "Incomplete &lt;html is literal." ) ) ; }

Target:
public void incompleteHtmlIsLiteral ( ) throws java.lang.Exception { java.lang.String markdown = "Incomplete <html is literal." ; repo.branch ( "master" ) . commit ( ) . add ( "index.md" , markdown ) . create ( ) ; java.lang.String html = buildHtml ( "/repo/+doc/master/index.md" ) ; com.google.common.truth.Truth.assertThat ( html ) . contains ( "Incomplete &lt;html is literal." ) ; }
Source:
public com.google.gerrit.server.project.SubmitRuleEvaluator setPatchSet ( com.google.gerrit.reviewdb.client.PatchSet ps ) { com.google.common.base.Preconditions.checkArgument ( ps.getId ( ) . getParentKey ( ) . equals ( cd.getId ( ) ) , "Patch set %s does not match change %s" , ps.getId ( ) , cd.getId ( ) ) ; return this ; }

Target:
public com.google.gerrit.server.project.SubmitRuleEvaluator setPatchSet ( com.google.gerrit.reviewdb.client.PatchSet ps ) { com.google.common.base.Preconditions.checkArgument ( ps.getId ( ) . getParentKey ( ) . equals ( cd.getId ( ) ) , "Patch set %s does not match change %s" , ps.getId ( ) , cd.getId ( ) ) ; patchSet = ps ; return this ; }
Source:
public int insertRow ( final int beforeRow ) { for ( final com.google.gerrit.client.changes.ChangeTable.Section s : sections ) { boolean dirty = false ; if ( beforeRow <= ( s.titleRow ) ) { ( s.titleRow ) ++ ; } if ( beforeRow < ( s.dataBegin ) ) { ( s.dataBegin ) ++ ; } } return super . insertRow ( beforeRow ) ; }

Target:
private int insertRow ( final int beforeRow ) { for ( final com.google.gerrit.client.changes.ChangeTable.Section s : sections ) { boolean dirty = false ; if ( beforeRow <= ( s.titleRow ) ) { ( s.titleRow ) ++ ; } if ( beforeRow < ( s.dataBegin ) ) { ( s.dataBegin ) ++ ; } } return table.insertRow ( beforeRow ) ; }
Source:
public void deleteBranchesNotFound ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.DeleteBranchesInput input = new com.google.gerrit.extensions.api.projects.DeleteBranchesInput ( ) ; java.util.List < java.lang.String > branches = com.google.common.collect.Lists.newArrayList ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ; branches.add ( "refs/heads/does-not-exist" ) ; input.branches = branches ; try { project ( ) . deleteBranches ( input ) ; fail ( "Expected ResourceConflictException" ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceConflictException e ) { com.google.common.truth.Truth.assertThat ( e ) . hasMessageThat ( ) . isEqualTo ( errorMessageForBranches ( com.google.common.collect.ImmutableList.of ( "refs/heads/does-not-exist" ) ) ) ; } assertBranchesDeleted ( ) ; }

Target:
public void deleteBranchesNotFound ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.DeleteBranchesInput input = new com.google.gerrit.extensions.api.projects.DeleteBranchesInput ( ) ; java.util.List < java.lang.String > branches = com.google.common.collect.Lists.newArrayList ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ; branches.add ( "refs/heads/does-not-exist" ) ; input.branches = branches ; try { project ( ) . deleteBranches ( input ) ; fail ( "Expected ResourceConflictException" ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceConflictException e ) { com.google.common.truth.Truth.assertThat ( e ) . hasMessageThat ( ) . isEqualTo ( errorMessageForBranches ( com.google.common.collect.ImmutableList.of ( "refs/heads/does-not-exist" ) ) ) ; } assertBranchesDeleted ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ; }
Source:
void doReply ( ) { if ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { com.google.gerrit.client.Gerrit.doSignIn ( parent.getToken ( ) ) ; } else if ( ( replyBox ) == null ) { com.google.gerrit.client.diff.DraftBox box = addReplyBox ( ) ; if ( ! ( getCommentInfo ( ) . has_line ( ) ) ) { parent.addFileCommentBox ( box , comment.side ( ) ) ; } } else { openReplyBox ( ) ; } }

Target:
void doReply ( ) { if ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { com.google.gerrit.client.Gerrit.doSignIn ( parent.getToken ( ) ) ; } else if ( ( replyBox ) == null ) { com.google.gerrit.client.diff.DraftBox box = addReplyBox ( ) ; if ( ! ( getCommentInfo ( ) . has_line ( ) ) ) { parent.addFileCommentBox ( box ) ; } } else { openReplyBox ( ) ; } }
Source:
public void deleteVoteFromReviewableChangeWithSelfCc ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; selfCc ( ) ; deleteVote ( sc , voter ) ; assertThat ( sender ) . sent ( "deleteVote" , sc ) . to ( sc.owner ) . to ( sc.reviewerByEmail ) . cc ( sc.reviewer , sc.ccer , voter ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void deleteVoteFromReviewableChangeWithSelfCc ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; selfCc ( ) ; deleteVote ( sc , voter ) ; assertThat ( sender ) . sent ( "deleteVote" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer , voter ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }
Source:
public boolean canReadCommit ( com.google.gerrit.reviewdb.server.ReviewDb db , org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.revwalk.RevCommit commit ) { try ( org.eclipse.jgit.lib.Repository repo = openRepository ( ) ) { return isMergedIntoVisibleRef ( repo , db , rw , commit , repo.getAllRefs ( ) . values ( ) ) ; } catch ( java.io.IOException e ) { java.lang.String msg = java.lang.String.format ( "Cannot verify permissions to commit object %s in repository %s" , commit.name ( ) , getProject ( ) . getNameKey ( ) ) ; com.google.gerrit.server.project.ProjectControl.log.error ( msg , e ) ; return false ; } }

Target:
public boolean canReadCommit ( com.google.gerrit.reviewdb.server.ReviewDb db , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevCommit commit ) { try ( org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { return isMergedIntoVisibleRef ( repo , db , rw , commit , repo.getAllRefs ( ) . values ( ) ) ; } catch ( java.io.IOException e ) { java.lang.String msg = java.lang.String.format ( "Cannot verify permissions to commit object %s in repository %s" , commit.name ( ) , getProject ( ) . getNameKey ( ) ) ; com.google.gerrit.server.project.ProjectControl.log.error ( msg , e ) ; return false ; } }
Source:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.change.ChangeResource resource , com.google.gerrit.server.change.ChangeEdits.Put.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gwtorm.server.OrmException , java.io.IOException { if ( com.google.common.base.Strings.isNullOrEmpty ( path ) ) { createEdit ( resource ) ; } else { putEdit.apply ( resource.getControl ( ) , path , input.content ) ; } return com.google.gerrit.extensions.restapi.Response.none ( ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.change.ChangeResource resource , com.google.gerrit.server.change.ChangeEdits.Put.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gwtorm.server.OrmException , java.io.IOException { putEdit.apply ( resource.getControl ( ) , path , input.content ) ; return com.google.gerrit.extensions.restapi.Response.none ( ) ; }
Source:
void onTopMenu ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > e ) { prefs.hideTopMenu ( ( ! ( e.getValue ( ) ) ) ) ; com.google.gerrit.client.Gerrit.setHeaderVisible ( ( ( view.diffTable.isHeaderVisible ( ) ) && ( ! ( prefs.hideTopMenu ( ) ) ) ) ) ; view.resizeCodeMirror ( ) ; }

Target:
void onTopMenu ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > e ) { prefs.hideTopMenu ( ( ! ( e.getValue ( ) ) ) ) ; com.google.gerrit.client.Gerrit.setHeaderVisible ( ( ! ( prefs.hideTopMenu ( ) ) ) ) ; view.resizeCodeMirror ( ) ; }
Source:
public static org.eclipse.jgit.revwalk.RevCommit makeCommit ( org.eclipse.jgit.lib.Repository repo , java.lang.String message , java.util.Set < java.io.File > files ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.util.Map < java.io.File , byte [ ] > tmp = new java.util.HashMap < > ( ) ; for ( java.io.File f : files ) { tmp.put ( f , null ) ; } return com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.makeCommit ( repo , message , tmp ) ; }

Target:
public static org.eclipse.jgit.revwalk.RevCommit makeCommit ( org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.lib.Repository repo , java.lang.String message , java.util.Set < java.io.File > files ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.util.Map < java.io.File , byte [ ] > tmp = new java.util.HashMap < > ( ) ; for ( java.io.File f : files ) { tmp.put ( f , null ) ; } return com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.makeCommit ( rw , repo , message , tmp ) ; }
Source:
public void start ( final org.apache.sshd.server.Environment env ) throws java.io.IOException { com.google.gerrit.sshd.SshScope.Context old = sshScope.set ( context ) ; java.lang.String message ; try { message = messageFactory.get ( ) . getMessage ( ) ; } finally { sshScope.set ( old ) ; } err.write ( org.eclipse.jgit.lib.Constants.encode ( message.toString ( ) ) ) ; err.flush ( ) ; in.close ( ) ; out.close ( ) ; err.close ( ) ; exit.onExit ( 127 ) ; }

Target:
public void start ( final org.apache.sshd.server.Environment env ) throws java.io.IOException { com.google.gerrit.sshd.SshScope.Context old = sshScope.set ( context ) ; java.lang.String message ; try { message = messageFactory.get ( ) . getMessage ( ) ; } finally { sshScope.set ( old ) ; } err.write ( org.eclipse.jgit.lib.Constants.encode ( message ) ) ; err.flush ( ) ; in.close ( ) ; out.close ( ) ; err.close ( ) ; exit.onExit ( 127 ) ; }
Source:
public static java.lang.String getTargetUrl ( javax.servlet.ServletRequest request ) { int meEnd = com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.state ( request ) . indexOf ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.ME_SEPARATOR ) ; java.lang.String finalUrlSuffix = ( "?" + ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.FINAL_URL_PARAM ) ) + "=true" ; if ( meEnd > 0 ) { return ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.state ( request ) . substring ( ( meEnd + 1 ) ) ) + finalUrlSuffix ; } else { return finalUrlSuffix ; } }

Target:
public static java.lang.String getTargetUrl ( javax.servlet.ServletRequest request ) { int meEnd = com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.state ( request ) . indexOf ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.ME_SEPARATOR ) ; java.lang.String finalUrlSuffix = ( "?" + ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.FINAL_URL_PARAM ) ) + "=true" ; if ( meEnd > 0 ) { return ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.state ( request ) . substring ( ( meEnd + 1 ) ) ) + finalUrlSuffix ; } return finalUrlSuffix ; }
Source:
protected void configure ( ) { bind ( java.util.concurrent.ScheduledThreadPoolExecutor.class ) . annotatedWith ( com.googlesource.gerrit.plugins.webhooks.WebHooksExecutor.class ) . toProvider ( com.googlesource.gerrit.plugins.webhooks.ExecutorProvider.class ) ; bind ( com.googlesource.gerrit.plugins.webhooks.Configuration.class ) . in ( Scopes.SINGLETON ) ; bind ( org.apache.http.impl.client.CloseableHttpClient.class ) . toProvider ( com.googlesource.gerrit.plugins.webhooks.HttpClientProvider.class ) . in ( Scopes.SINGLETON ) ; factory ( PostTask.Factory.class ) ; factory ( RemoteConfig.Factory.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.common.EventListener.class ) . to ( com.googlesource.gerrit.plugins.webhooks.EventHandler.class ) ; install ( processors ) ; }

Target:
protected void configure ( ) { bind ( java.util.concurrent.ScheduledThreadPoolExecutor.class ) . annotatedWith ( com.googlesource.gerrit.plugins.webhooks.WebHooksExecutor.class ) . toProvider ( com.googlesource.gerrit.plugins.webhooks.ExecutorProvider.class ) . in ( Scopes.SINGLETON ) ; bind ( com.googlesource.gerrit.plugins.webhooks.Configuration.class ) . in ( Scopes.SINGLETON ) ; bind ( org.apache.http.impl.client.CloseableHttpClient.class ) . toProvider ( com.googlesource.gerrit.plugins.webhooks.HttpClientProvider.class ) . in ( Scopes.SINGLETON ) ; factory ( PostTask.Factory.class ) ; factory ( RemoteConfig.Factory.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.common.EventListener.class ) . to ( com.googlesource.gerrit.plugins.webhooks.EventHandler.class ) ; install ( processors ) ; }
Source:
public java.util.Collection < com.google.gerrit.reviewdb.client.PatchLineComment > comments ( com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > db ) throws com.google.gwtorm.server.OrmException { if ( ( comments ) == null ) { comments = db.get ( ) . patchComments ( ) . byChange ( legacyId ) . toList ( ) ; } return comments ; }

Target:
public java.util.Collection < com.google.gerrit.reviewdb.client.PatchLineComment > comments ( ) throws com.google.gwtorm.server.OrmException { if ( ( comments ) == null ) { comments = db.patchComments ( ) . byChange ( legacyId ) . toList ( ) ; } return comments ; }
Source:
void doReply ( ) { if ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { com.google.gerrit.client.Gerrit.doSignIn ( getCommentManager ( ) . getSideBySide2 ( ) . getToken ( ) ) ; } else if ( ( replyBox ) == null ) { com.google.gerrit.client.diff.DraftBox box = addReplyBox ( ) ; if ( ! ( getCommentInfo ( ) . has_line ( ) ) ) { getCommentManager ( ) . addFileCommentBox ( box ) ; } } else { openReplyBox ( ) ; } }

Target:
void doReply ( ) { if ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { com.google.gerrit.client.Gerrit.doSignIn ( getCommentManager ( ) . getSideBySide2 ( ) . getToken ( ) ) ; } else if ( ( replyBox ) == null ) { addReplyBox ( ) ; } else { openReplyBox ( ) ; } }
Source:
public void addPatchSets ( com.google.gerrit.server.events.ChangeAttribute a , java.util.Collection < com.google.gerrit.reviewdb.PatchSet > ps ) { if ( ! ( ps.isEmpty ( ) ) ) { a.patchSets = new java.util.ArrayList < com.google.gerrit.server.events.PatchSetAttribute > ( ps.size ( ) ) ; for ( com.google.gerrit.reviewdb.PatchSet p : ps ) { a.patchSets.add ( asPatchSetAttribute ( p ) ) ; } } }

Target:
public void addPatchSets ( com.google.gerrit.server.events.ChangeAttribute a , java.util.Collection < com.google.gerrit.reviewdb.PatchSet > ps ) { addPatchSets ( a , ps , null ) ; }
Source:
public void testWhitelist ( ) throws java.lang.Exception { java.lang.String [ ] patterns = new java.lang.String [ ] { "application/pdf" , "application/xml" } ; java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m = validator.performValidation ( repo , makeCommit ( ) , patterns , true ) ; com.google.common.truth.Truth.assertThat ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessages ( m ) ) . containsExactly ( "ERROR: found blocked content type (text/html) in file: foo.html" ) ; }

Target:
public void testWhitelist ( ) throws java.lang.Exception { java.lang.String [ ] patterns = new java.lang.String [ ] { "application/pdf" , "application/xml" } ; try ( org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m = validator.performValidation ( repo , makeCommit ( rw ) , rw , patterns , true ) ; com.google.common.truth.Truth.assertThat ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessages ( m ) ) . containsExactly ( "ERROR: found blocked content type (text/html) in file: foo.html" ) ; } }
Source:
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 ( ) ) ; }

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 ( ) ) ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_NOT_FOUND ) ; }
Source:
private org.eclipse.jgit.dircache.DirCacheEntry file ( final java.lang.String name ) throws java.io.IOException { org.eclipse.jgit.lib.ObjectInserter oi = repository.newObjectInserter ( ) ; final org.eclipse.jgit.dircache.DirCacheEntry e = new org.eclipse.jgit.dircache.DirCacheEntry ( name ) ; e.setFileMode ( FileMode.REGULAR_FILE ) ; e.setObjectId ( oi.insert ( Constants.OBJ_BLOB , org.eclipse.jgit.lib.Constants.encode ( name ) ) ) ; oi.flush ( ) ; return e ; HEAD ( 14422 ) ; com.google.gerrit.server.tools.hooks.a Update ; com.google.gerrit.server.tools.hooks.plugin to ; com.google.gerrit.server.tools.hooks.latest revision ; }

Target:
private org.eclipse.jgit.dircache.DirCacheEntry file ( final java.lang.String name ) throws java.io.IOException { try ( org.eclipse.jgit.lib.ObjectInserter oi = repository.newObjectInserter ( ) ) { final org.eclipse.jgit.dircache.DirCacheEntry e = new org.eclipse.jgit.dircache.DirCacheEntry ( name ) ; e.setFileMode ( FileMode.REGULAR_FILE ) ; e.setObjectId ( oi.insert ( Constants.OBJ_BLOB , org.eclipse.jgit.lib.Constants.encode ( name ) ) ) ; oi.flush ( ) ; return e ; } }
Source:
public void testUnblockInLocalVisibilityByRegisteredUsers_Fails ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.REGISTERED , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.REGISTERED ) ; assertFalse ( "u can't read" , u.controlForRef ( "refs/heads/master" ) . isVisibleByRegisteredUsers ( ) ) ; }

Target:
public void testUnblockInLocalVisibilityByRegisteredUsers_Fails ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.REGISTERED , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.REGISTERED ) ; org.junit.Assert.assertFalse ( "u can't read" , u.controlForRef ( "refs/heads/master" ) . isVisibleByRegisteredUsers ( ) ) ; }
Source:
private net.codemirror.lib.LineWidget addLineWidget ( net.codemirror.lib.CodeMirror cm , int line , final com.google.gwt.user.client.ui.Widget widget , net.codemirror.lib.Configuration options ) { widget.setVisible ( false ) ; net.codemirror.lib.LineWidget lineWidget = cm.addLineWidget ( line , widget.getElement ( ) , options ) ; lineWidget.onFirstRedraw ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { widget.setVisible ( true ) ; } } ) ; return lineWidget ; }

Target:
net.codemirror.lib.LineWidget addLineWidget ( net.codemirror.lib.CodeMirror cm , int line , final com.google.gwt.user.client.ui.Widget widget , net.codemirror.lib.Configuration options ) { widget.setVisible ( false ) ; net.codemirror.lib.LineWidget lineWidget = cm.addLineWidget ( line , widget.getElement ( ) , options ) ; lineWidget.onFirstRedraw ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { widget.setVisible ( true ) ; } } ) ; return lineWidget ; }
Source:
private void fail ( java.lang.String error , boolean failed , java.lang.Exception e ) { if ( failed ) { this . failed.update ( 1 ) ; } if ( e != null ) { com.google.gerrit.server.index.change.AllChangesIndexer.log.warn ( error , e ) ; } else { com.google.gerrit.server.index.change.AllChangesIndexer.log.warn ( error ) ; } if ( ( verboseWriter ) != null ) { verboseWriter.println ( error ) ; } }

Target:
private void fail ( java.lang.String error , boolean failed , java.lang.Exception e ) { if ( failed ) { this . failed.update ( 1 ) ; } if ( e != null ) { com.google.gerrit.server.index.change.AllChangesIndexer.log.warn ( error , e ) ; } else { com.google.gerrit.server.index.change.AllChangesIndexer.log.warn ( error ) ; } verboseWriter.println ( error ) ; }
Source:
public org.kohsuke.github.GHRepository getGHRepository ( ) throws java.io.IOException { if ( ghLogin.getMyself ( ) . getLogin ( ) . equals ( organisation ) ) { return ghLogin.getMyself ( ) . getRepository ( repoName ) ; } return ghLogin.getHub ( ) . getOrganization ( organisation ) . getRepository ( repoName ) ; }

Target:
public org.kohsuke.github.GHRepository getGHRepository ( ) throws java.io.IOException { if ( ghLogin.getMyself ( ) . getLogin ( ) . equals ( organisation ) ) { return ghLogin.getMyself ( ) . getRepository ( repoName ) ; } else { return ghLogin.getHub ( ) . getOrganization ( organisation ) . getRepository ( repoName ) ; } }
Source:
public void listBranchesHeadHidden ( ) throws com.google.gwtorm.server.OrmException , com.jcraft.jsch.JSchException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException , org.eclipse.jgit.errors.ConfigInvalidException { blockRead ( project , "refs/heads/master" ) ; com.google.gerrit.acceptance.RestSession session = new com.google.gerrit.acceptance.RestSession ( accounts.create ( "user" , "user@example.com" , "User" ) ) ; pushTo ( "refs/heads/master" ) ; pushTo ( "refs/heads/dev" ) ; java.lang.String devCommit = git.getRepository ( ) . getRef ( "master" ) . getTarget ( ) . getObjectId ( ) . getName ( ) ; com.google.gerrit.acceptance.RestResponse r = session.get ( ( ( "/projects/" + ( project.get ( ) ) ) + "/branches" ) ) ; java.util.List < com.google.gerrit.acceptance.rest.project.BranchInfo > result = new com.google.gson.Gson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.acceptance.rest.project.BranchInfo > > ( ) { } . getType ( ) ) ; com.google.gerrit.acceptance.rest.project.BranchAssert.assertBranches ( java.util.Collections.singletonList ( new com.google.gerrit.acceptance.rest.project.BranchInfo ( "refs/heads/dev" , devCommit , false ) ) , result ) ; }

Target:
public void listBranchesHeadHidden ( ) throws com.google.gwtorm.server.OrmException , com.jcraft.jsch.JSchException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException , org.eclipse.jgit.errors.ConfigInvalidException { blockRead ( project , "refs/heads/master" ) ; com.google.gerrit.acceptance.RestSession session = new com.google.gerrit.acceptance.RestSession ( server , accounts.create ( "user" , "user@example.com" , "User" ) ) ; pushTo ( "refs/heads/master" ) ; pushTo ( "refs/heads/dev" ) ; java.lang.String devCommit = git.getRepository ( ) . getRef ( "master" ) . getTarget ( ) . getObjectId ( ) . getName ( ) ; com.google.gerrit.acceptance.RestResponse r = session.get ( ( ( "/projects/" + ( project.get ( ) ) ) + "/branches" ) ) ; java.util.List < com.google.gerrit.acceptance.rest.project.BranchInfo > result = new com.google.gson.Gson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.acceptance.rest.project.BranchInfo > > ( ) { } . getType ( ) ) ; com.google.gerrit.acceptance.rest.project.BranchAssert.assertBranches ( java.util.Collections.singletonList ( new com.google.gerrit.acceptance.rest.project.BranchInfo ( "refs/heads/dev" , devCommit , false ) ) , result ) ; }
Source:
private void saveChange ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { change = ctx.getChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = ctx.getUpdate ( psId ) ; wasDraftChange = ( change.getStatus ( ) ) == ( Change.Status.DRAFT ) ; if ( wasDraftChange ) { change.setStatus ( Change.Status.NEW ) ; update.setStatus ( change.getStatus ( ) ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; ctx.getDb ( ) . changes ( ) . update ( java.util.Collections.singleton ( change ) ) ; } }

Target:
private void saveChange ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) { change = ctx.getChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = ctx.getUpdate ( psId ) ; wasDraftChange = ( change.getStatus ( ) ) == ( Change.Status.DRAFT ) ; if ( wasDraftChange ) { change.setStatus ( Change.Status.NEW ) ; update.setStatus ( change.getStatus ( ) ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; ctx.saveChange ( ) ; } }
Source:
private static org.apache.lucene.store.Directory dir ( com.google.gerrit.server.index.Schema < com.google.gerrit.server.account.AccountState > schema , org.eclipse.jgit.lib.Config cfg , com.google.gerrit.server.config.SitePaths sitePaths ) throws java.io.IOException { if ( com.google.gerrit.lucene.LuceneIndexModule.isInMemoryTest ( cfg ) ) { return new org.apache.lucene.store.RAMDirectory ( ) ; } java.nio.file.Path indexDir = com.google.gerrit.lucene.LuceneVersionManager.getDir ( sitePaths , ( ( com.google.gerrit.lucene.LuceneAccountIndex.ACCOUNTS ) + "_" ) , schema ) ; return org.apache.lucene.store.FSDirectory.open ( indexDir ) ; }

Target:
private static org.apache.lucene.store.Directory dir ( com.google.gerrit.server.index.Schema < com.google.gerrit.server.account.AccountState > schema , org.eclipse.jgit.lib.Config cfg , com.google.gerrit.server.config.SitePaths sitePaths ) throws java.io.IOException { if ( com.google.gerrit.lucene.LuceneIndexModule.isInMemoryTest ( cfg ) ) { return new org.apache.lucene.store.RAMDirectory ( ) ; } java.nio.file.Path indexDir = com.google.gerrit.lucene.LuceneVersionManager.getDir ( sitePaths , com.google.gerrit.lucene.LuceneAccountIndex.ACCOUNTS , schema ) ; return org.apache.lucene.store.FSDirectory.open ( indexDir ) ; }
Source:
private void initParent ( final com.google.gwt.user.client.ui.Panel body ) { parentPanel = new com.google.gwt.user.client.ui.VerticalPanel ( ) ; parentPanel.add ( new com.google.gerrit.client.ui.SmallHeading ( Util.C.headingParentProjectName ( ) ) ) ; parentName = new com.google.gerrit.client.ui.Hyperlink ( "" , "" ) ; parentPanel.add ( parentName ) ; body.add ( parentPanel ) ; }

Target:
private void initParent ( ) { parentPanel = new com.google.gwt.user.client.ui.VerticalPanel ( ) ; parentPanel.add ( new com.google.gerrit.client.ui.SmallHeading ( Util.C.headingParentProjectName ( ) ) ) ; parentName = new com.google.gerrit.client.ui.Hyperlink ( "" , "" ) ; parentPanel.add ( parentName ) ; add ( parentPanel ) ; }
Source:
public void activate ( final com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId ) { if ( ( indexOf ( patchSetId ) ) != ( - 1 ) ) { if ( ! ( patchSetId.equals ( activePatchSetId ) ) ) { deactivate ( ) ; com.google.gerrit.client.changes.PatchSetComplexDisclosurePanel patchSetPanel = patchSetPanels.get ( patchSetId ) ; patchSetPanel.setOpen ( true ) ; patchSetPanel.setActive ( true ) ; activePatchSetId = patchSetId ; } } else { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( patchSetId.getParentKey ( ) ) ) ; } }

Target:
public void activate ( final com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId ) { if ( ( indexOf ( patchSetId ) ) != ( - 1 ) ) { if ( ! ( patchSetId.equals ( activePatchSetId ) ) ) { deactivate ( ) ; com.google.gerrit.client.changes.PatchSetComplexDisclosurePanel patchSetPanel = patchSetPanels.get ( patchSetId ) ; patchSetPanel.setActive ( true ) ; activePatchSetId = patchSetId ; } } else { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( patchSetId.getParentKey ( ) ) ) ; } }
Source:
protected PushOneCommit.Result createChange ( org.eclipse.jgit.api.Git git , java.lang.String subject , java.lang.String fileName , java.lang.String content ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , subject , fileName , content ) ; return push.to ( git , "refs/for/master" ) ; }

Target:
protected PushOneCommit.Result createChange ( org.eclipse.jgit.api.Git git , java.lang.String subject , java.lang.String fileName , java.lang.String content ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , git , subject , fileName , content ) ; return push.to ( "refs/for/master" ) ; }
Source:
void initMeter ( ) { if ( ( meter ) == null ) { meter = new com.google.gwtexpui.progress.client.ProgressBar ( Util.M.loadingPatchSet ( psid.get ( ) ) ) ; myBody.clear ( ) ; myBody.add ( meter ) ; } updateMeter ( ) ; }

Target:
void initMeter ( ) { if ( ( meter ) == null ) { meter = new com.google.gwtexpui.progress.client.ProgressBar ( Util.M.loadingPatchSet ( psid.get ( ) ) ) ; this . myBody.clear ( ) ; this . myBody.add ( meter ) ; } updateMeter ( ) ; }
Source:
static boolean needsQuotedPrintableWithinPhrase ( final int cp ) { switch ( cp ) { case '!' : case '*' : case '+' : case '-' : case '/' : case '=' : case '_' : return false ; default : if ( ( ( ( 'a' <= cp ) && ( cp <= 'z' ) ) || ( ( 'A' <= cp ) && ( cp <= 'Z' ) ) ) || ( ( '0' <= cp ) && ( cp <= '9' ) ) ) { return false ; } else { return true ; } } }

Target:
static boolean needsQuotedPrintableWithinPhrase ( final int cp ) { switch ( cp ) { case '!' : case '*' : case '+' : case '-' : case '/' : case '=' : case '_' : return false ; default : if ( ( ( ( 'a' <= cp ) && ( cp <= 'z' ) ) || ( ( 'A' <= cp ) && ( cp <= 'Z' ) ) ) || ( ( '0' <= cp ) && ( cp <= '9' ) ) ) { return false ; } return true ; } }
Source:
protected void configure ( ) { factory ( AlterTopicHandler.Factory.class ) ; factory ( RestoreChangeHandler.Factory.class ) ; factory ( RevertChange.Factory.class ) ; factory ( RebaseChangeHandler.Factory.class ) ; factory ( ChangeDetailFactory.Factory.class ) ; factory ( IncludedInDetailFactory.Factory.class ) ; factory ( PatchSetDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; factory ( SubmitAction.Factory.class ) ; factory ( PublishAction.Factory.class ) ; factory ( DeleteDraftChange.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( RestoreChangeHandler.Factory.class ) ; factory ( RevertChange.Factory.class ) ; factory ( RebaseChangeHandler.Factory.class ) ; factory ( ChangeDetailFactory.Factory.class ) ; factory ( IncludedInDetailFactory.Factory.class ) ; factory ( PatchSetDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; factory ( SubmitAction.Factory.class ) ; factory ( PublishAction.Factory.class ) ; factory ( DeleteDraftChange.Factory.class ) ; }
Source:
public void stop ( ) { if ( ( task ) != null ) { task.cancel ( true ) ; } try { eventsDb.close ( ) ; } catch ( java.sql.SQLException e ) { com.ericsson.gerrit.plugins.eventslog.sql.SQLStore.log.warn ( "Cannot close datasource " , e ) ; } try { localEventsDb.close ( ) ; } catch ( java.sql.SQLException e ) { com.ericsson.gerrit.plugins.eventslog.sql.SQLStore.log.warn ( "Cannot close datasource " , e ) ; } }

Target:
public void stop ( ) { if ( ( task ) != null ) { task.cancel ( true ) ; } eventsDb.close ( ) ; localEventsDb.close ( ) ; }