auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicMap.mapOf ( binder ( ) , com.googlesource.gerrit.plugins.imagare.ImageResource.IMAGE_KIND ) ; bind ( com.googlesource.gerrit.plugins.imagare.ImagesCollection.class ) ; child ( com.google.gerrit.server.project.ProjectResource.PROJECT_KIND , "images" ) . to ( com.googlesource.gerrit.plugins.imagare.ImagesCollection.class ) ; delete ( com.googlesource.gerrit.plugins.imagare.ImageResource.IMAGE_KIND ) . to ( com.googlesource.gerrit.plugins.imagare.DeleteImage.class ) ; get ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "config" ) . to ( com.googlesource.gerrit.plugins.imagare.GetConfig.class ) ; put ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "config" ) . to ( com.googlesource.gerrit.plugins.imagare.PutConfig.class ) ; get ( com.google.gerrit.server.account.AccountResource.ACCOUNT_KIND , "preference" ) . to ( com.googlesource.gerrit.plugins.imagare.GetPreference.class ) ; put ( com.google.gerrit.server.account.AccountResource.ACCOUNT_KIND , "preference" ) . to ( com.googlesource.gerrit.plugins.imagare.PutPreference.class ) ; }

Target:
protected void configure ( ) { get ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "config" ) . to ( com.googlesource.gerrit.plugins.imagare.GetConfig.class ) ; put ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "config" ) . to ( com.googlesource.gerrit.plugins.imagare.PutConfig.class ) ; get ( com.google.gerrit.server.account.AccountResource.ACCOUNT_KIND , "preference" ) . to ( com.googlesource.gerrit.plugins.imagare.GetPreference.class ) ; put ( com.google.gerrit.server.account.AccountResource.ACCOUNT_KIND , "preference" ) . to ( com.googlesource.gerrit.plugins.imagare.PutPreference.class ) ; }
Source:
io.searchbox.client.http.JestHttpClient build ( ) { io.searchbox.client.JestClientFactory factory = new io.searchbox.client.JestClientFactory ( ) ; factory.setHttpClientConfig ( new io.searchbox.client.config.HttpClientConfig.Builder ( url ) . multiThreaded ( true ) . discoveryEnabled ( ( ! ( refresh ) ) ) . discoveryFrequency ( 1L , java.util.concurrent.TimeUnit.MINUTES ) . build ( ) ) ; return ( ( io.searchbox.client.http.JestHttpClient ) ( factory.getObject ( ) ) ) ; }

Target:
io.searchbox.client.http.JestHttpClient build ( ) { io.searchbox.client.JestClientFactory factory = new io.searchbox.client.JestClientFactory ( ) ; factory.setHttpClientConfig ( new io.searchbox.client.config.HttpClientConfig.Builder ( url ) . multiThreaded ( true ) . discoveryEnabled ( false ) . discoveryFrequency ( 1L , java.util.concurrent.TimeUnit.MINUTES ) . build ( ) ) ; return ( ( io.searchbox.client.http.JestHttpClient ) ( factory.getObject ( ) ) ) ; }
Source:
private boolean canAbandon ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { return ( ( ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) || ( getRefControl ( ) . canAbandon ( ) ) ) && ( ! ( isPatchSetLocked ( db ) ) ) ; }

Target:
public boolean canAbandon ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { return ( ( ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) || ( getRefControl ( ) . canAbandon ( ) ) ) && ( ! ( isPatchSetLocked ( db ) ) ) ; }
Source:
public void run ( ) throws java.lang.Exception { parseCommandLine ( impl ) ; if ( ( ( impl.getUser ( ) ) != null ) && ( ! ( impl.getProjects ( ) . isEmpty ( ) ) ) ) { throw new com.google.gerrit.sshd.commands.UnloggedFailure ( 1 , "fatal: --user and --project options are not compatible." ) ; } final java.io.PrintWriter stdout = toPrintWriter ( out ) ; try { impl.display ( stdout ) ; } finally { stdout.flush ( ) ; } }

Target:
public void run ( ) throws java.lang.Exception { if ( ( ( impl.getUser ( ) ) != null ) && ( ! ( impl.getProjects ( ) . isEmpty ( ) ) ) ) { throw new com.google.gerrit.sshd.commands.UnloggedFailure ( 1 , "fatal: --user and --project options are not compatible." ) ; } impl.display ( stdout ) ; }
Source:
public void createEmptyChange_MissingMessage ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo ci = new com.google.gerrit.extensions.common.ChangeInfo ( ) ; ci.project = project.get ( ) ; ci.branch = "master" ; com.google.gerrit.acceptance.RestResponse r = adminSession.post ( "/changes/" , ci ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_BAD_REQUEST , r.getStatusCode ( ) ) ; org.junit.Assert.assertTrue ( r.getEntityContent ( ) . contains ( "commit message must be non-empty" ) ) ; }

Target:
public void createEmptyChange_MissingMessage ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo ci = new com.google.gerrit.extensions.common.ChangeInfo ( ) ; ci.project = project.get ( ) ; ci.branch = "master" ; com.google.gerrit.acceptance.RestResponse r = adminSession.post ( "/changes/" , ci ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_BAD_REQUEST ) ; com.google.common.truth.Truth.assertThat ( r.getEntityContent ( ) ) . contains ( "commit message must be non-empty" ) ; }
Source:
protected void alias ( final com.google.gerrit.sshd.CommandName parent , final java.lang.String name , final java.lang.Class < ? extends com.google.gerrit.sshd.BaseCommand > clazz ) { com.google.gerrit.sshd.CommandMetaData meta = clazz.getAnnotation ( com.google.gerrit.sshd.CommandMetaData.class ) ; if ( meta == null ) { throw new java.lang.IllegalStateException ( "no CommandMetaData annotation found" ) ; } bind ( com.google.gerrit.sshd.Commands.key ( parent , name , com.google.gerrit.sshd.CommandModule.description ( meta ) ) ) . to ( clazz ) ; }

Target:
protected void alias ( final com.google.gerrit.sshd.CommandName parent , final java.lang.String name , final java.lang.Class < ? extends com.google.gerrit.sshd.BaseCommand > clazz ) { com.google.gerrit.sshd.CommandMetaData meta = clazz.getAnnotation ( com.google.gerrit.sshd.CommandMetaData.class ) ; if ( meta == null ) { throw new java.lang.IllegalStateException ( "no CommandMetaData annotation found" ) ; } bind ( com.google.gerrit.sshd.Commands.key ( parent , name , meta.description ( ) ) ) . to ( clazz ) ; }
Source:
private com.google.gwt.user.client.ui.Widget createEditIcon ( ) { com.google.gerrit.reviewdb.client.PatchSet.Id id = ( idActive.isBaseOrAutoMerge ( ) ) ? other.idActive.asPatchSetId ( ) : idActive.asPatchSetId ( ) ; com.google.gwt.user.client.ui.Anchor anchor = new com.google.gwt.user.client.ui.Anchor ( new com.google.gwt.user.client.ui.ImageResourceRenderer ( ) . render ( Gerrit.RESOURCES.edit ( ) ) , ( "#" + ( com.google.gerrit.client.Dispatcher.toEditScreen ( id , path ) ) ) ) ; anchor.setTitle ( PatchUtil.C.edit ( ) ) ; return anchor ; }

Target:
private com.google.gwt.user.client.ui.Widget createEditIcon ( ) { com.google.gerrit.reviewdb.client.PatchSet.Id id = ( idActive.isBaseOrAutoMerge ( ) ) ? other.idActive.asPatchSetId ( ) : idActive.asPatchSetId ( ) ; com.google.gwt.user.client.ui.Anchor anchor = new com.google.gwt.user.client.ui.Anchor ( new com.google.gwt.user.client.ui.ImageResourceRenderer ( ) . render ( Gerrit.RESOURCES.edit ( ) ) , ( "#" + ( com.google.gerrit.client.Dispatcher.toEditScreen ( project , id , path ) ) ) ) ; anchor.setTitle ( PatchUtil.C.edit ( ) ) ; return anchor ; }
Source:
public void testTagDiv ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; assertSame ( b , b.openDiv ( ) ) ; assertSame ( b , b.append ( "d<a>ta" ) ) ; assertSame ( b , b.closeDiv ( ) ) ; assertEquals ( "<div>d&lt;a&gt;ta</div>" , b.asString ( ) ) ; }

Target:
public void testTagDiv ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; org.junit.Assert.assertSame ( b , b.openDiv ( ) ) ; org.junit.Assert.assertSame ( b , b.append ( "d<a>ta" ) ) ; org.junit.Assert.assertSame ( b , b.closeDiv ( ) ) ; org.junit.Assert.assertEquals ( "<div>d&lt;a&gt;ta</div>" , b.asString ( ) ) ; }
Source:
private void insertNoneRow ( final int row ) { insertRow ( row ) ; setText ( row , 0 , Util.C.changeTableNone ( ) ) ; getFlexCellFormatter ( ) . setColSpan ( row , 0 , com.google.gerrit.client.changes.ChangeTable.COLUMNS ) ; setStyleName ( row , 0 , "gerrit-ChangeTable-EmptySectionRow" ) ; }

Target:
private void insertNoneRow ( final int row ) { insertRow ( row ) ; table.setText ( row , 0 , Util.C.changeTableNone ( ) ) ; table.getFlexCellFormatter ( ) . setColSpan ( row , 0 , com.google.gerrit.client.changes.ChangeTable.COLUMNS ) ; setStyleName ( row , 0 , "gerrit-ChangeTable-EmptySectionRow" ) ; }
Source:
com.google.gerrit.client.changes.CommentInfo createReply ( com.google.gerrit.client.changes.CommentInfo replyTo ) { if ( ! ( replyTo.has_line ( ) ) ) { return com.google.gerrit.client.changes.CommentInfo.createFile ( path , replyTo.side ( ) , replyTo.id ( ) , null ) ; } else { return com.google.gerrit.client.changes.CommentInfo.createLine ( path , replyTo.side ( ) , replyTo.line ( ) , replyTo.id ( ) , null ) ; } }

Target:
com.google.gerrit.client.changes.CommentInfo createReply ( com.google.gerrit.client.changes.CommentInfo replyTo ) { return com.google.gerrit.client.changes.CommentInfo.create ( path , replyTo.side ( ) , replyTo.line ( ) , replyTo.id ( ) , null ) ; }
Source:
public static com.google.gerrit.server.util.LabelVote parseWithEquals ( java.lang.String text ) { com.google.common.base.Preconditions.checkArgument ( ( ! ( com.google.common.base.Strings.isNullOrEmpty ( text ) ) ) , "Empty label vote" ) ; int e = text.lastIndexOf ( '=' ) ; com.google.common.base.Preconditions.checkArgument ( ( e >= 0 ) , "Label vote missing '=': %s" , text ) ; return new com.google.gerrit.server.util.LabelVote ( text.substring ( 0 , e ) , java.lang.Short.parseShort ( text.substring ( ( e + 1 ) ) , text.length ( ) ) ) ; }

Target:
public static com.google.gerrit.server.util.LabelVote parseWithEquals ( java.lang.String text ) { com.google.common.base.Preconditions.checkArgument ( ( ! ( com.google.common.base.Strings.isNullOrEmpty ( text ) ) ) , "Empty label vote" ) ; int e = text.lastIndexOf ( '=' ) ; com.google.common.base.Preconditions.checkArgument ( ( e >= 0 ) , "Label vote missing '=': %s" , text ) ; return com.google.gerrit.server.util.LabelVote.create ( text.substring ( 0 , e ) , java.lang.Short.parseShort ( text.substring ( ( e + 1 ) ) , text.length ( ) ) ) ; }
Source:
public void addComment ( final java.lang.String issueKey , final java.lang.String comment ) throws java.io.IOException { execute ( new java.util.concurrent.Callable < java.lang.String > ( ) { @ java.lang.Override public java.lang.String call ( ) throws java.lang.Exception { log.debug ( "Adding comment to issue {}" , comment , issueKey ) ; client ( ) . addComment ( issueKey , comment ) ; log.debug ( "Added comment to issue {}" , comment , issueKey ) ; return issueKey ; } } ) ; }

Target:
public void addComment ( final java.lang.String issueKey , final java.lang.String comment ) throws java.io.IOException { execute ( ( ) -> { log.debug ( "Adding comment to issue {}" , comment , issueKey ) ; client ( ) . addComment ( issueKey , comment ) ; log.debug ( "Added comment to issue {}" , comment , issueKey ) ; return issueKey ; } ) ; }
Source:
public com.googlesource.gerrit.plugins.replication.SecureCredentialsProvider create ( java.lang.String remoteName ) { if ( needsReload ( ) ) { try { secureCredentialsFactory.compareAndSet ( secureCredentialsFactory.get ( ) , new com.googlesource.gerrit.plugins.replication.SecureCredentialsFactory ( site ) ) ; secureCredentialsFactoryLoadTs = getSecureConfigLastEditTs ( ) ; com.googlesource.gerrit.plugins.replication.AutoReloadSecureCredentialsFactoryDecorator.log.info ( "secure.config reloaded as it was updated on the file system" ) ; } catch ( java.lang.Exception e ) { com.googlesource.gerrit.plugins.replication.AutoReloadSecureCredentialsFactoryDecorator.log.error ( ( "Unexpected error while trying to reload " + "secure.config: keeping existing credentials" ) , e ) ; } } return secureCredentialsFactory.get ( ) . create ( remoteName ) ; }

Target:
public com.googlesource.gerrit.plugins.replication.SecureCredentialsProvider create ( java.lang.String remoteName ) { try { if ( needsReload ( ) ) { secureCredentialsFactory.compareAndSet ( secureCredentialsFactory.get ( ) , new com.googlesource.gerrit.plugins.replication.SecureCredentialsFactory ( site ) ) ; secureCredentialsFactoryLoadTs = getSecureConfigLastEditTs ( ) ; com.googlesource.gerrit.plugins.replication.AutoReloadSecureCredentialsFactoryDecorator.log.info ( "secure.config reloaded as it was updated on the file system" ) ; } } catch ( java.lang.Exception e ) { com.googlesource.gerrit.plugins.replication.AutoReloadSecureCredentialsFactoryDecorator.log.error ( ( "Unexpected error while trying to reload " + "secure.config: keeping existing credentials" ) , e ) ; } return secureCredentialsFactory.get ( ) . create ( remoteName ) ; }
Source:
public void testInheritRead_AppendWithDenyOfRef ( ) { grant ( parent , com.google.gerrit.common.data.Permission.READ , registered , "refs/*" ) ; grant ( local , com.google.gerrit.common.data.Permission.READ , registered , "refs/heads/*" ) . setDeny ( true ) ; com.google.gerrit.server.project.ProjectControl u = user ( ) ; assertTrue ( "can read" , u.isVisible ( ) ) ; assertTrue ( "can read" , u.controlForRef ( "refs/master" ) . isVisible ( ) ) ; assertTrue ( "can read" , u.controlForRef ( "refs/tags/foobar" ) . isVisible ( ) ) ; assertTrue ( "no master" , u.controlForRef ( "refs/heads/master" ) . isVisible ( ) ) ; }

Target:
public void testInheritRead_AppendWithDenyOfRef ( ) { grant ( parent , com.google.gerrit.common.data.Permission.READ , registered , "refs/*" ) ; grant ( local , com.google.gerrit.common.data.Permission.READ , registered , "refs/heads/*" ) . setDeny ( ) ; com.google.gerrit.server.project.ProjectControl u = user ( ) ; assertTrue ( "can read" , u.isVisible ( ) ) ; assertTrue ( "can read" , u.controlForRef ( "refs/master" ) . isVisible ( ) ) ; assertTrue ( "can read" , u.controlForRef ( "refs/tags/foobar" ) . isVisible ( ) ) ; assertTrue ( "no master" , u.controlForRef ( "refs/heads/master" ) . isVisible ( ) ) ; }
Source:
com.google.gerrit.server.git.strategy.SubmitStrategy.Arguments create ( com.google.gerrit.extensions.client.SubmitType submitType , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.server.git.MergeOp.CommitStatus commitStatus , com.google.gerrit.server.git.CodeReviewCommit.CodeReviewRevWalk rw , com.google.gerrit.server.IdentifiedUser caller , com.google.gerrit.server.git.MergeTip mergeTip , org.eclipse.jgit.lib.ObjectInserter inserter , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevFlag canMergeFlag , com.google.gerrit.reviewdb.server.ReviewDb db , java.util.Set < org.eclipse.jgit.revwalk.RevCommit > alreadyAccepted , java.util.Set < com.google.gerrit.server.git.CodeReviewCommit > incoming , com.google.gerrit.server.util.RequestId submissionId , com.google.gerrit.extensions.api.changes.NotifyHandling notifyHandling , com.google.common.collect.ListMultimap < com.google.gerrit.extensions.api.changes.RecipientType , com.google.gerrit.reviewdb.client.Account.Id > accountsToNotify , com.google.gerrit.server.git.SubmoduleOp submoduleOp , boolean dryrun ) ;

Target:
com.google.gerrit.server.git.strategy.SubmitStrategy.Arguments create ( com.google.gerrit.extensions.client.SubmitType submitType , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.server.git.MergeOp.CommitStatus commitStatus , com.google.gerrit.server.git.CodeReviewCommit.CodeReviewRevWalk rw , com.google.gerrit.server.IdentifiedUser caller , com.google.gerrit.server.git.MergeTip mergeTip , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevFlag canMergeFlag , com.google.gerrit.reviewdb.server.ReviewDb db , java.util.Set < org.eclipse.jgit.revwalk.RevCommit > alreadyAccepted , java.util.Set < com.google.gerrit.server.git.CodeReviewCommit > incoming , com.google.gerrit.server.util.RequestId submissionId , com.google.gerrit.extensions.api.changes.NotifyHandling notifyHandling , com.google.common.collect.ListMultimap < com.google.gerrit.extensions.api.changes.RecipientType , com.google.gerrit.reviewdb.client.Account.Id > accountsToNotify , com.google.gerrit.server.git.SubmoduleOp submoduleOp , boolean dryrun ) ;
Source:
public static java.lang.String refsEditPrefix ( com.google.gerrit.reviewdb.client.Account.Id accountId , com.google.gerrit.reviewdb.client.Change.Id changeId ) { return new java.lang.StringBuilder ( com.google.gerrit.reviewdb.client.RefNames.refsUsers ( accountId ) ) . append ( '/' ) . append ( com.google.gerrit.reviewdb.client.RefNames.EDIT_PREFIX ) . append ( changeId.get ( ) ) . append ( '/' ) . toString ( ) ; }

Target:
public static java.lang.String refsEditPrefix ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { return ( ( com.google.gerrit.reviewdb.client.RefNames.refsUsers ( accountId ) ) + '/' ) + ( com.google.gerrit.reviewdb.client.RefNames.EDIT_PREFIX ) ; }
Source:
public void testSubsequentGetReads ( ) throws com.google.gwtorm.client.OrmException { db.create ( ) ; final com.google.gerrit.reviewdb.SystemConfig exp = getSystemConfig ( ) ; final com.google.gerrit.reviewdb.SystemConfig act = getSystemConfig ( ) ; assertNotSame ( exp , act ) ; assertEquals ( exp.adminGroupId , act.adminGroupId ) ; assertEquals ( exp.anonymousGroupId , act.anonymousGroupId ) ; assertEquals ( exp.registeredGroupId , act.registeredGroupId ) ; assertEquals ( exp.sitePath , act.sitePath ) ; assertEquals ( exp.registerEmailPrivateKey , act.registerEmailPrivateKey ) ; }

Target:
public void testSubsequentGetReads ( ) throws com.google.gwtorm.client.OrmException { db.create ( ) ; final com.google.gerrit.reviewdb.SystemConfig exp = db.getSystemConfig ( ) ; final com.google.gerrit.reviewdb.SystemConfig act = db.getSystemConfig ( ) ; assertNotSame ( exp , act ) ; assertEquals ( exp.adminGroupId , act.adminGroupId ) ; assertEquals ( exp.anonymousGroupId , act.anonymousGroupId ) ; assertEquals ( exp.registeredGroupId , act.registeredGroupId ) ; assertEquals ( exp.sitePath , act.sitePath ) ; assertEquals ( exp.registerEmailPrivateKey , act.registerEmailPrivateKey ) ; }
Source:
public void clear ( ) { for ( com.google.reviewit.widget.ScrollWithHeadingsView.Content content : contents ) { removeView ( content.getHeading ( ) . getView ( ) ) ; scrollContent.removeView ( content.getContent ( ) ) ; } contents.clear ( ) ; scroll.getViewTreeObserver ( ) . removeOnScrollChangedListener ( onScrollListener ) ; onScrollListener = null ; }

Target:
private void clear ( ) { for ( com.google.reviewit.widget.ScrollWithHeadingsView.Content content : contents ) { removeView ( content.getHeading ( ) . getView ( ) ) ; scrollContent.removeView ( content.getContent ( ) ) ; } contents.clear ( ) ; scroll.getViewTreeObserver ( ) . removeOnScrollChangedListener ( onScrollListener ) ; onScrollListener = null ; }
Source:
public void abandonReviewableWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; abandon ( sc.changeId , sc.owner ) ; assertThat ( sender ) . sent ( "abandon" , sc ) . notTo ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; }

Target:
public void abandonReviewableWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; abandon ( sc.changeId , sc.owner ) ; assertThat ( sender ) . sent ( "abandon" , sc ) . notTo ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . to ( sc.reviewerByEmail ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; }
Source:
public void resetHtml ( final com.google.gwt.user.client.ui.FlexTable myTable , final com.google.gwtexpui.safehtml.client.SafeHtml bodyHtml ) { final com.google.gwt.user.client.Element oldBody = getBodyElement ( myTable ) ; final com.google.gwt.user.client.Element newBody = com.google.gerrit.client.ui.FancyFlexTableImplIE6.parseBody ( bodyHtml ) ; assert newBody != null ; final com.google.gwt.user.client.Element tableElem = com.google.gwt.user.client.DOM.getParent ( oldBody ) ; com.google.gwt.user.client.DOM.removeChild ( tableElem , oldBody ) ; com.google.gerrit.client.ui.FancyFlexTableImplIE6.setBodyElement ( myTable , newBody ) ; com.google.gwt.user.client.DOM.appendChild ( tableElem , newBody ) ; }

Target:
public void resetHtml ( final com.google.gwt.user.client.ui.FlexTable myTable , final com.google.gwtexpui.safehtml.client.SafeHtml bodyHtml ) { final com.google.gwt.user.client.Element oldBody = getBodyElement ( myTable ) ; final com.google.gwt.user.client.Element newBody = com.google.gerrit.client.ui.FancyFlexTableImplIE6.parseBody ( bodyHtml ) ; assert newBody != null ; final com.google.gwt.user.client.Element tableElem = com.google.gwt.user.client.DOM.getParent ( oldBody ) ; tableElem.removeChild ( oldBody ) ; com.google.gerrit.client.ui.FancyFlexTableImplIE6.setBodyElement ( myTable , newBody ) ; com.google.gwt.user.client.DOM.appendChild ( tableElem , newBody ) ; }
Source:
private org.eclipse.jgit.treewalk.AbstractTreeIterator getTreeIterator ( org.eclipse.jgit.lib.Repository repo , java.lang.String name ) throws java.io.IOException { org.eclipse.jgit.treewalk.CanonicalTreeParser p = new org.eclipse.jgit.treewalk.CanonicalTreeParser ( ) ; org.eclipse.jgit.lib.ObjectReader or = repo.newObjectReader ( ) ; try { p.reset ( or , new org.eclipse.jgit.revwalk.RevWalk ( repo ) . parseTree ( repo.resolve ( name ) ) ) ; return p ; } finally { or.release ( ) ; } }

Target:
private org.eclipse.jgit.treewalk.AbstractTreeIterator getTreeIterator ( org.eclipse.jgit.lib.Repository repo , java.lang.String name ) throws java.io.IOException { org.eclipse.jgit.treewalk.CanonicalTreeParser p = new org.eclipse.jgit.treewalk.CanonicalTreeParser ( ) ; org.eclipse.jgit.lib.ObjectReader or = repo.newObjectReader ( ) ; try { p.reset ( or , new org.eclipse.jgit.revwalk.RevWalk ( repo ) . parseTree ( repo.resolve ( name ) ) ) ; return p ; } finally { or.close ( ) ; } }
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 = insert ( newChange ( repo1 , null , null , null , null ) ) ; com.google.gerrit.reviewdb.client.Change change2 = insert ( newChange ( repo2 , null , null , null , null ) ) ; assertQuery ( "project:foo" ) ; assertQuery ( "project:repo" ) ; assertQuery ( "project:repo1" , change1 ) ; assertQuery ( "project:repo2" , change2 ) ; }

Target:
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 = insert ( newChange ( repo1 ) ) ; com.google.gerrit.reviewdb.client.Change change2 = insert ( newChange ( repo2 ) ) ; assertQuery ( "project:foo" ) ; assertQuery ( "project:repo" ) ; assertQuery ( "project:repo1" , change1 ) ; assertQuery ( "project:repo2" , change2 ) ; }
Source:
public com.google.gitiles.GitilesView.Builder copyFrom ( com.google.gitiles.GitilesView other ) { hostName = other.hostName ; servletPath = other.servletPath ; switch ( type ) { case LOG : case DIFF : oldRevision = other.oldRevision ; case PATH : path = other.path ; case REVISION : revision = other.revision ; case REPOSITORY_INDEX : repositoryName = other.repositoryName ; } return this ; }

Target:
public com.google.gitiles.GitilesView.Builder copyFrom ( com.google.gitiles.GitilesView other ) { hostName = other.hostName ; servletPath = other.servletPath ; switch ( type ) { case LOG : case DIFF : oldRevision = other.oldRevision ; case PATH : path = other.path ; case REVISION : revision = other.revision ; case REPOSITORY_INDEX : repositoryName = other.repositoryName ; default : break ; } return this ; }
Source:
protected void configure ( ) { propertyExtractor = createMock ( com.googlesource.gerrit.plugins.hooks.util.PropertyExtractor.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.util.PropertyExtractor.class ) . toInstance ( propertyExtractor ) ; ruleBase = createMock ( com.googlesource.gerrit.plugins.hooks.workflow.RuleBase.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.workflow.RuleBase.class ) . toInstance ( ruleBase ) ; actionExecutor = createMock ( com.googlesource.gerrit.plugins.hooks.workflow.ActionExecutor.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.workflow.ActionExecutor.class ) . toInstance ( actionExecutor ) ; bind ( com.googlesource.gerrit.plugins.hooks.its.ItsConfig.class ) . toInstance ( new com.googlesource.gerrit.plugins.hooks.its.ItsConfig ( null , null , null ) { @ java.lang.Override public boolean isEnabled ( com.google.gerrit.server.events.ChangeEvent event ) { return true ; } } ) ; }

Target:
protected void configure ( ) { propertyExtractor = createMock ( com.googlesource.gerrit.plugins.hooks.util.PropertyExtractor.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.util.PropertyExtractor.class ) . toInstance ( propertyExtractor ) ; ruleBase = createMock ( com.googlesource.gerrit.plugins.hooks.workflow.RuleBase.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.workflow.RuleBase.class ) . toInstance ( ruleBase ) ; actionExecutor = createMock ( com.googlesource.gerrit.plugins.hooks.workflow.ActionExecutor.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.workflow.ActionExecutor.class ) . toInstance ( actionExecutor ) ; bind ( com.googlesource.gerrit.plugins.hooks.its.ItsConfig.class ) . toInstance ( new com.googlesource.gerrit.plugins.hooks.its.ItsConfig ( null , null , null , null ) { @ java.lang.Override public boolean isEnabled ( com.google.gerrit.server.events.ChangeEvent event ) { return true ; } } ) ; }
Source:
public com.google.gerrit.extensions.common.AccountInfo accountInfo ( com.google.gerrit.reviewdb.client.Account a ) { com.google.gerrit.extensions.common.AccountInfo ai = new com.google.gerrit.extensions.common.AccountInfo ( a.getId ( ) . get ( ) ) ; ai.email = a.getPreferredEmail ( ) ; ai.name = a.getFullName ( ) ; ai.username = a.getUserName ( ) ; return ai ; }

Target:
public com.google.gerrit.extensions.common.AccountInfo accountInfo ( com.google.gerrit.reviewdb.client.Account a ) { if ( ( a == null ) || ( ( a.getId ( ) ) == null ) ) { return null ; } com.google.gerrit.extensions.common.AccountInfo ai = new com.google.gerrit.extensions.common.AccountInfo ( a.getId ( ) . get ( ) ) ; ai.email = a.getPreferredEmail ( ) ; ai.name = a.getFullName ( ) ; ai.username = a.getUserName ( ) ; return ai ; }
Source:
public boolean contains ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) { com.google.gerrit.server.account.GroupMembership m = membership ( uuid ) ; if ( m == null ) { com.google.gerrit.server.account.UniversalGroupBackend.log.warn ( ( "Unknown GroupMembership for UUID: " + uuid ) ) ; return false ; } return m.contains ( uuid ) ; }

Target:
public boolean contains ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) { if ( uuid == null ) { return false ; } com.google.gerrit.server.account.GroupMembership m = membership ( uuid ) ; if ( m == null ) { com.google.gerrit.server.account.UniversalGroupBackend.log.warn ( ( "Unknown GroupMembership for UUID: " + uuid ) ) ; return false ; } return m.contains ( uuid ) ; }
Source:
public java.io.File get ( ) { if ( ! ( ready ) ) { synchronized ( dataDir ) { if ( ( ! ( dataDir.exists ( ) ) ) && ( ! ( dataDir.mkdirs ( ) ) ) ) { throw new com.google.inject.ProvisionException ( java.lang.String.format ( "Cannot create %s for plugin %s" , dataDir.getAbsolutePath ( ) , getName ( ) ) ) ; } ready = true ; } } return dataDir ; }

Target:
public java.io.File get ( ) { if ( ! ( ready ) ) { synchronized ( dataDir ) { if ( ! ( ready ) ) { if ( ( ! ( dataDir.exists ( ) ) ) && ( ! ( dataDir.mkdirs ( ) ) ) ) { throw new com.google.inject.ProvisionException ( java.lang.String.format ( "Cannot create %s for plugin %s" , dataDir.getAbsolutePath ( ) , getName ( ) ) ) ; } ready = true ; } } } return dataDir ; }
Source:
public void queryChangesNoResults ( ) throws java.lang.Exception { createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = gApi.changes ( ) . query ( "status:open" ) . get ( ) ; org.junit.Assert.assertEquals ( 1 , results.size ( ) ) ; results = gApi.changes ( ) . query ( "status:closed" ) . get ( ) ; org.junit.Assert.assertTrue ( results.isEmpty ( ) ) ; }

Target:
public void queryChangesNoResults ( ) throws java.lang.Exception { createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = query ( "status:open" ) ; org.junit.Assert.assertEquals ( 1 , results.size ( ) ) ; results = query ( "status:closed" ) ; org.junit.Assert.assertTrue ( results.isEmpty ( ) ) ; }
Source:
public boolean match ( com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { java.util.List < java.lang.String > files = object.currentFilePaths ( ) ; return ( files != null ) && ( ( java.util.Collections.binarySearch ( files , value ) ) >= 0 ) ; }

Target:
public boolean match ( com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { java.util.List < java.lang.String > files ; try { files = object.currentFilePaths ( ) ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } return ( java.util.Collections.binarySearch ( files , value ) ) >= 0 ; }
Source:
public com.google.gerrit.client.ui.InlineHyperlink getNextPatchLink ( int index , com.google.gerrit.client.patches.PatchScreen.Type patchType ) { int nextPatchIndex = getNextPatch ( index , false , PREFERENCE_VALIDATOR ) ; if ( nextPatchIndex < 0 ) { return null ; } return createLink ( nextPatchIndex , patchType , null , com.google.gwtexpui.safehtml.client.SafeHtml.asis ( Util.C.nextPatchLinkIcon ( ) ) ) ; }

Target:
public com.google.gerrit.client.ui.InlineHyperlink getNextPatchLink ( int index ) { int nextPatchIndex = getNextPatch ( index , false , PREFERENCE_VALIDATOR ) ; if ( nextPatchIndex < 0 ) { return null ; } return createLink ( nextPatchIndex , null , com.google.gwtexpui.safehtml.client.SafeHtml.asis ( Util.C.nextPatchLinkIcon ( ) ) ) ; }
Source:
private java.net.InetSocketAddress computePreferredAddress ( ) { for ( final java.net.SocketAddress addr : listen ) { if ( ! ( addr instanceof java.net.InetSocketAddress ) ) { continue ; } java.net.InetSocketAddress inetAddr = ( ( java.net.InetSocketAddress ) ( addr ) ) ; if ( inetAddr.getAddress ( ) . isLoopbackAddress ( ) ) { continue ; } return inetAddr ; } return null ; }

Target:
private java.net.InetSocketAddress computePreferredAddress ( ) { for ( final java.net.SocketAddress addr : listen ) { if ( ! ( addr instanceof java.net.InetSocketAddress ) ) { continue ; } java.net.InetSocketAddress inetAddr = ( ( java.net.InetSocketAddress ) ( addr ) ) ; if ( inetAddr.getAddress ( ) . isLoopbackAddress ( ) ) { continue ; } return inetAddr ; } for ( final java.net.SocketAddress addr : listen ) { if ( addr instanceof java.net.InetSocketAddress ) { return ( ( java.net.InetSocketAddress ) ( addr ) ) ; } } return null ; }
Source:
private void setDefaultConfig ( javax.servlet.FilterConfig filterConfig ) throws javax.servlet.ServletException { if ( ( config ) == null ) { try { config = com.google.gitiles.GitilesConfig.loadDefault ( filterConfig ) ; } catch ( java.io.IOException e ) { throw new javax.servlet.ServletException ( e ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException e ) { throw new javax.servlet.ServletException ( e ) ; } } }

Target:
private void setDefaultConfig ( javax.servlet.FilterConfig filterConfig ) throws javax.servlet.ServletException { if ( ( config ) == null ) { try { config = com.google.gitiles.GitilesConfig.loadDefault ( filterConfig ) ; } catch ( java.io.IOException | org.eclipse.jgit.errors.ConfigInvalidException e ) { throw new javax.servlet.ServletException ( e ) ; } } }
Source:
private static void assertInvalid ( final java.lang.String in ) { try { com.google.gerrit.server.mail.Address.parse ( in ) ; fail ( ( "Incorrectly accepted " + in ) ) ; } catch ( java.lang.IllegalArgumentException e ) { assertEquals ( ( "Invalid email address: " + in ) , e.getMessage ( ) ) ; } }

Target:
private static void assertInvalid ( final java.lang.String in ) { try { com.google.gerrit.server.mail.Address.parse ( in ) ; org.junit.Assert.fail ( ( "Incorrectly accepted " + in ) ) ; } catch ( java.lang.IllegalArgumentException e ) { org.junit.Assert.assertEquals ( ( "Invalid email address: " + in ) , e.getMessage ( ) ) ; } }
Source:
public static com.google.gerrit.server.index.IndexConfig fromConfig ( org.eclipse.jgit.lib.Config cfg ) { return com.google.gerrit.server.index.IndexConfig.create ( cfg.getInt ( "index" , null , "maxLimit" , 0 ) , cfg.getInt ( "index" , null , "maxPages" , 0 ) , cfg.getInt ( "index" , null , "maxTerms" , 0 ) , cfg.getInt ( "index" , null , "maxPrefixTerms" , com.google.gerrit.server.index.IndexConfig.DEFAULT_MAX_PREFIX_TERMS ) ) ; }

Target:
public static com.google.gerrit.server.index.IndexConfig fromConfig ( org.eclipse.jgit.lib.Config cfg ) { return com.google.gerrit.server.index.IndexConfig.create ( cfg.getInt ( "index" , null , "maxLimit" , 0 ) , cfg.getInt ( "index" , null , "maxPages" , 0 ) , cfg.getInt ( "index" , null , "maxTerms" , 0 ) ) ; }
Source:
Project.NameKey projectName ( org.eclipse.jgit.lib.Repository repo ) { java.nio.file.Path gitDir = repo.getDirectory ( ) . toPath ( ) ; if ( gitDir.startsWith ( basePath ) ) { java.lang.String p = basePath.relativize ( gitDir ) . toString ( ) ; java.lang.String n = p.substring ( 0 , ( ( p.length ( ) ) - ( ".git" . length ( ) ) ) ) ; return new com.google.gerrit.reviewdb.client.Project.NameKey ( n ) ; } else { com.googlesource.gerrit.plugins.quota.ProjectNameResolver.log.warn ( ( "Couldn't determine the project name from " + gitDir ) ) ; return null ; } }

Target:
Project.NameKey projectName ( org.eclipse.jgit.lib.Repository repo ) { java.nio.file.Path gitDir = repo.getDirectory ( ) . toPath ( ) ; if ( gitDir.startsWith ( basePath ) ) { java.lang.String p = basePath.relativize ( gitDir ) . toString ( ) ; java.lang.String n = p.substring ( 0 , ( ( p.length ( ) ) - ( ".git" . length ( ) ) ) ) ; return new com.google.gerrit.reviewdb.client.Project.NameKey ( n ) ; } com.googlesource.gerrit.plugins.quota.ProjectNameResolver.log.warn ( ( "Couldn't determine the project name from " + gitDir ) ) ; return null ; }
Source:
protected com.google.gerrit.server.GerritServer getGerritServer ( ) throws com.google.gerrit.server.ssh.AbstractCommand.Failure { try { return com.google.gerrit.server.GerritServer.getInstance ( ) ; } catch ( com.google.gwtorm.client.OrmException e ) { throw new com.google.gerrit.server.ssh.AbstractCommand.Failure ( 128 , "fatal: Gerrit is not available" ) ; } catch ( com.google.gwtjsonrpc.server.XsrfException e ) { throw new com.google.gerrit.server.ssh.AbstractCommand.Failure ( 128 , "fatal: Gerrit is not available" ) ; } }

Target:
protected com.google.gerrit.server.GerritServer getGerritServer ( ) throws com.google.gerrit.server.ssh.AbstractCommand.Failure { try { return com.google.gerrit.server.GerritServer.getInstance ( ) ; } catch ( com.google.gwtorm.client.OrmException e ) { throw new com.google.gerrit.server.ssh.AbstractCommand.Failure ( 128 , "fatal: Gerrit is not available" , e ) ; } catch ( com.google.gwtjsonrpc.server.XsrfException e ) { throw new com.google.gerrit.server.ssh.AbstractCommand.Failure ( 128 , "fatal: Gerrit is not available" , e ) ; } }
Source:
protected void configure ( ) { bind ( com.google.gerrit.server.index.IndexConfig.class ) . toInstance ( com.google.gerrit.server.index.IndexConfig.createDefault ( ) ) ; install ( new com.google.gerrit.server.index.IndexModule ( threads ) ) ; bind ( com.google.gerrit.server.index.ChangeIndex.class ) . to ( com.google.gerrit.solr.SolrChangeIndex.class ) ; listener ( ) . to ( com.google.gerrit.solr.SolrChangeIndex.class ) ; if ( checkVersion ) { listener ( ) . to ( com.google.gerrit.solr.IndexVersionCheck.class ) ; } }

Target:
protected void configure ( ) { install ( new com.google.gerrit.server.index.IndexModule ( threads ) ) ; bind ( com.google.gerrit.server.index.ChangeIndex.class ) . to ( com.google.gerrit.solr.SolrChangeIndex.class ) ; listener ( ) . to ( com.google.gerrit.solr.SolrChangeIndex.class ) ; if ( checkVersion ) { listener ( ) . to ( com.google.gerrit.solr.IndexVersionCheck.class ) ; } }
Source:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { new com.google.gerrit.client.changes.AbandonChangeDialog ( patchSet.getId ( ) , new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.common.data.ChangeDetail > ( ) { public void onSuccess ( com.google.gerrit.common.data.ChangeDetail result ) { changeScreen.update ( result ) ; } public void onFailure ( java.lang.Throwable caught ) { b.setEnabled ( true ) ; } } ) . center ( ) ; }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { b.setEnabled ( false ) ; new com.google.gerrit.client.changes.AbandonChangeDialog ( patchSet.getId ( ) , new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.common.data.ChangeDetail > ( ) { public void onSuccess ( com.google.gerrit.common.data.ChangeDetail result ) { changeScreen.update ( result ) ; } public void onFailure ( java.lang.Throwable caught ) { b.setEnabled ( true ) ; } } ) . center ( ) ; }
Source:
public boolean isLoggedIn ( java.util.Set < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > scopes ) { boolean loggedIn = ( ( scopesSet.equals ( scopes ) ) && ( ( token ) != null ) ) && ( ( hub ) != null ) ; if ( loggedIn ) { try { myself = hub.getMyself ( ) ; } catch ( java.lang.Throwable e ) { com.googlesource.gerrit.plugins.github.oauth.GitHubLogin.log.error ( "Connection to GitHub broken: logging out" , e ) ; logout ( ) ; loggedIn = false ; } } return loggedIn ; }

Target:
public boolean isLoggedIn ( java.util.Set < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > scopes ) { boolean loggedIn = ( ( scopesSet.equals ( scopes ) ) && ( ( token ) != null ) ) && ( ( hub ) != null ) ; if ( loggedIn && ( ( myself ) == null ) ) { try { myself = hub.getMyself ( ) ; } catch ( java.lang.Throwable e ) { com.googlesource.gerrit.plugins.github.oauth.GitHubLogin.log.error ( "Connection to GitHub broken: logging out" , e ) ; logout ( ) ; loggedIn = false ; } } return loggedIn ; }
Source:
private static boolean autoReindexIfStale ( org.eclipse.jgit.lib.Config cfg ) { HEAD ( d5b111 ) ; Update ( submodules ) ; return cfg.getBoolean ( "index" , null , "testAutoReindexIfStale" , true ) ; return cfg.getBoolean ( "index" , null , "autoReindexIfStale" , true ) ; BRANCH ( auto ) ; }

Target:
private static boolean autoReindexIfStale ( org.eclipse.jgit.lib.Config cfg ) { return cfg.getBoolean ( "index" , null , "autoReindexIfStale" , true ) ; }
Source:
public void checkRemoveReviewer ( com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.server.CurrentUser currentUser , com.google.gerrit.reviewdb.client.PatchSetApproval approval ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gerrit.server.project.NoSuchChangeException { if ( canRemoveReviewerWithoutPermissionCheck ( notes , currentUser , approval.getAccountId ( ) , approval.getValue ( ) ) ) { return ; } permissionBackend.user ( currentUser ) . change ( notes ) . database ( dbProvider ) . check ( ChangePermission.REMOVE_REVIEWER ) ; }

Target:
public void checkRemoveReviewer ( com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.server.CurrentUser currentUser , com.google.gerrit.reviewdb.client.PatchSetApproval approval ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { if ( canRemoveReviewerWithoutPermissionCheck ( notes.getChange ( ) , currentUser , approval.getAccountId ( ) , approval.getValue ( ) ) ) { return ; } permissionBackend.user ( currentUser ) . change ( notes ) . database ( dbProvider ) . check ( ChangePermission.REMOVE_REVIEWER ) ; }
Source:
public java.lang.String encode ( com.google.gerrit.reviewdb.client.Account.Id accountId , java.lang.String emailAddress ) { try { java.lang.String payload = java.lang.String.format ( "%s:%s" , accountId , emailAddress ) ; byte [ ] utf8 = payload.getBytes ( "UTF-8" ) ; java.lang.String base64 = org.eclipse.jgit.util.Base64.encodeBytes ( utf8 ) ; return emailRegistrationToken.newToken ( base64 ) ; } catch ( com.google.gwtjsonrpc.server.XsrfException e ) { throw new java.lang.IllegalArgumentException ( e ) ; } catch ( java.io.UnsupportedEncodingException e ) { throw new java.lang.IllegalArgumentException ( e ) ; } }

Target:
public java.lang.String encode ( com.google.gerrit.reviewdb.client.Account.Id accountId , java.lang.String emailAddress ) { try { java.lang.String payload = java.lang.String.format ( "%s:%s" , accountId , emailAddress ) ; byte [ ] utf8 = payload.getBytes ( "UTF-8" ) ; java.lang.String base64 = org.eclipse.jgit.util.Base64.encodeBytes ( utf8 ) ; return emailRegistrationToken.newToken ( base64 ) ; } catch ( com.google.gwtjsonrpc.server.XsrfException | java.io.UnsupportedEncodingException e ) { throw new java.lang.IllegalArgumentException ( e ) ; } }
Source:
public com.google.gerrit.server.data.AccountAttribute get ( ) { HEAD ( 80 ) ; com.google.gerrit.server.events.ce3f Merge ; com.google.gerrit.server.events.into stab ; return account != null ? eventFactory.asAccountAttribute ( new com.google.gerrit.reviewdb.client.Account.Id ( account._accountId ) ) : null ; return account != null ? eventFactory.asAccountAttribute ( new com.google.gerrit.reviewdb.client.Account.Id ( account._accountId ) ) : null ; BRANCH ( 2.0F ) ; com.google.gerrit.server.events.ee1f Set ; com.google.gerrit.server.events.version to ; }

Target:
public com.google.gerrit.server.data.AccountAttribute get ( ) { return account != null ? eventFactory.asAccountAttribute ( new com.google.gerrit.reviewdb.client.Account.Id ( account._accountId ) ) : null ; }
Source:
private com.google.gerrit.client.ui.Screen createScreen ( ) { return ( info ) != null ? new com.google.gerrit.client.changes.ChangeScreen ( info ) : new com.google.gerrit.client.changes.ChangeScreen ( id ) ; }

Target:
private com.google.gerrit.client.ui.Screen createScreen ( ) { if ( ( info ) != null ) { return new com.google.gerrit.client.changes.ChangeScreen ( info ) ; } else if ( ( ps ) != null ) { return new com.google.gerrit.client.changes.ChangeScreen ( ps ) ; } else { return new com.google.gerrit.client.changes.ChangeScreen ( id ) ; } }
Source:
public void symlinkText ( ) throws java.lang.Exception { final org.eclipse.jgit.revwalk.RevBlob link = repo.blob ( "foo" ) ; repo.branch ( "master" ) . commit ( ) . edit ( new org.eclipse.jgit.dircache.DirCacheEditor.PathEdit ( "baz" ) { @ java.lang.Override public void apply ( org.eclipse.jgit.dircache.DirCacheEntry ent ) { ent.setFileMode ( FileMode.SYMLINK ) ; ent.setObjectId ( link ) ; } } ) . create ( ) ; java.lang.String text = buildBlob ( "/repo/+/master/baz" , "120000" ) ; org.junit.Assert.assertEquals ( "foo" , text ) ; }

Target:
public void symlinkText ( ) throws java.lang.Exception { final org.eclipse.jgit.revwalk.RevBlob link = repo.blob ( "foo" ) ; repo.branch ( "master" ) . commit ( ) . edit ( new org.eclipse.jgit.dircache.DirCacheEditor.PathEdit ( "baz" ) { @ java.lang.Override public void apply ( org.eclipse.jgit.dircache.DirCacheEntry ent ) { ent.setFileMode ( FileMode.SYMLINK ) ; ent.setObjectId ( link ) ; } } ) . create ( ) ; java.lang.String text = buildBlob ( "/repo/+/master/baz" , "120000" ) ; com.google.common.truth.Truth.assertThat ( text ) . isEqualTo ( "foo" ) ; }
Source:
public void run ( ) { synchronized ( cleanup ) { for ( final java.util.Iterator < java.lang.Runnable > i = cleanup.iterator ( ) ; i.hasNext ( ) ; ) { try { i.next ( ) . run ( ) ; } catch ( java.lang.Throwable err ) { com.google.gerrit.server.RequestCleanup.log.error ( "Failed to execute per-request cleanup" , err ) ; } i.remove ( ) ; } } }

Target:
public void run ( ) { synchronized ( cleanup ) { run = true ; for ( final java.util.Iterator < java.lang.Runnable > i = cleanup.iterator ( ) ; i.hasNext ( ) ; ) { try { i.next ( ) . run ( ) ; } catch ( java.lang.Throwable err ) { com.google.gerrit.server.RequestCleanup.log.error ( "Failed to execute per-request cleanup" , err ) ; } i.remove ( ) ; } } }
Source:
private boolean isDraftPatchSet ( com.google.gerrit.reviewdb.PatchSet.Id id , com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { com.google.gerrit.reviewdb.PatchSet ps = db.patchSets ( ) . get ( id ) ; if ( ps == null ) { throw new com.google.gwtorm.client.OrmException ( ( ( "Patch set " + id ) + " not found" ) ) ; } return ps.isDraft ( ) ; }

Target:
private boolean isDraftPatchSet ( com.google.gerrit.reviewdb.client.PatchSet.Id id , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet ps = db.patchSets ( ) . get ( id ) ; if ( ps == null ) { throw new com.google.gwtorm.server.OrmException ( ( ( "Patch set " + id ) + " not found" ) ) ; } return ps.isDraft ( ) ; }
Source:
private java.util.Set < java.lang.String > getRefNames ( java.lang.String prefix ) throws com.google.gwtorm.server.OrmException { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allUsers ) ) { org.eclipse.jgit.lib.RefDatabase refDb = repo.getRefDatabase ( ) ; return refDb.getRefs ( prefix ) . keySet ( ) ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } }

Target:
private static java.util.Set < java.lang.String > getRefNames ( org.eclipse.jgit.lib.Repository repo , java.lang.String prefix ) throws java.io.IOException { org.eclipse.jgit.lib.RefDatabase refDb = repo.getRefDatabase ( ) ; return refDb.getRefs ( prefix ) . keySet ( ) ; }
Source:
public void visit ( org.pegdown.ast.HeaderNode node ) { java.lang.String tag = "h" + ( node.getLevel ( ) ) ; html.open ( tag ) ; if ( toc.include ( node ) ) { html.attribute ( "id" , toc.idFromHeader ( node ) ) ; } visitChildren ( node ) ; html.close ( tag ) ; }

Target:
public void visit ( org.pegdown.ast.HeaderNode node ) { java.lang.String tag = "h" + ( node.getLevel ( ) ) ; html.open ( tag ) ; html.attribute ( "id" , toc.idFromHeader ( node ) ) ; visitChildren ( node ) ; html.close ( tag ) ; }
Source:
public void setParent_Forbidden ( ) throws java.lang.Exception { java.lang.String parent = "parent" ; createProject ( parent , null , true ) ; com.google.gerrit.acceptance.RestResponse r = userSession.put ( ( ( "/projects/" + ( project.get ( ) ) ) + "/parent" ) , newParentInput ( parent ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_FORBIDDEN ) ; r.consume ( ) ; }

Target:
public void setParent_Forbidden ( ) throws java.lang.Exception { java.lang.String parent = createProject ( "parent" , null , true ) . get ( ) ; com.google.gerrit.acceptance.RestResponse r = userSession.put ( ( ( "/projects/" + ( project.get ( ) ) ) + "/parent" ) , newParentInput ( parent ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_FORBIDDEN ) ; r.consume ( ) ; }