auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private com.google.gitiles.doc.MarkdownToHtml rootedDoc ( java.lang.String path , java.lang.String file ) { com.google.gitiles.GitilesView view = com.google.gitiles.GitilesView.rootedDoc ( ) . setHostName ( "gerritcodereview.com" ) . setServletPath ( "" ) . setRevision ( RootedDocServlet.BRANCH ) . setPathPart ( path ) . build ( ) ; return new com.google.gitiles.doc.MarkdownToHtml ( view , config , file ) ; }

Target:
private com.google.gitiles.doc.MarkdownToHtml rootedDoc ( java.lang.String path , java.lang.String file ) { return com.google.gitiles.doc.MarkdownToHtml.builder ( ) . setGitilesView ( com.google.gitiles.GitilesView.rootedDoc ( ) . setHostName ( "gerritcodereview.com" ) . setServletPath ( "" ) . setRevision ( RootedDocServlet.BRANCH ) . setPathPart ( path ) . build ( ) ) . setConfig ( new com.google.gitiles.doc.MarkdownConfig ( config ) ) . setFilePath ( file ) . build ( ) ; }
Source:
public void testIsEnabledRefParentNoBranchEnabled ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { } ; setupIsEnabled ( "false" , "true" , branches ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey projectNK = new com.google.gerrit.reviewdb.client.Project.NameKey ( "testProject" ) ; assertFalse ( itsConfig.isEnabled ( projectNK , "refs/heads/testBranch" ) ) ; }

Target:
public void BROKEN_testIsEnabledRefParentNoBranchEnabled ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { } ; setupIsEnabled ( "false" , "true" , branches ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey projectNK = new com.google.gerrit.reviewdb.client.Project.NameKey ( "testProject" ) ; assertFalse ( itsConfig.isEnabled ( projectNK , "refs/heads/testBranch" ) ) ; }
Source:
void addState ( java.lang.String ref , com.googlesource.gerrit.plugins.replication.ReplicationState state ) { stateMap.put ( ref , state ) ; }

Target:
private void statesCleanUp ( ) { if ( ( ! ( stateMap.isEmpty ( ) ) ) && ( ! ( isRetrying ( ) ) ) ) { for ( java.util.Map.Entry < java.lang.String , com.googlesource.gerrit.plugins.replication.ReplicationState > entry : stateMap.entries ( ) ) { entry.getValue ( ) . notifyRefReplicated ( projectName.get ( ) , entry.getKey ( ) , uri , RefPushResult.FAILED , null ) ; } } }
Source:
public boolean isVisible ( com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { if ( ( ( ( change.getStatus ( ) ) == ( Change.Status.DRAFT ) ) && ( ! ( isOwner ( ) ) ) ) && ( ! ( isReviewer ( db ) ) ) ) { return false ; } return isVisible ( ) ; }

Target:
public boolean isVisible ( com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { if ( ( ( change.getStatus ( ) ) == ( Change.Status.DRAFT ) ) && ( ! ( isDraftVisible ( db ) ) ) ) { return false ; } return isRefVisible ( ) ; }
Source:
public java.util.List < com.google.gitiles.blame.Region > get ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.lib.ObjectId commitId , java.lang.String path ) throws java.io.IOException { try { return cache.get ( new com.google.gitiles.blame.BlameCacheImpl.Key ( repo , commitId , path ) ) ; } catch ( java.util.concurrent.ExecutionException e ) { throw new java.io.IOException ( e ) ; } }

Target:
public java.util.List < com.google.gitiles.blame.Region > get ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.lib.ObjectId commitId , java.lang.String path ) throws java.io.IOException { try { com.google.gitiles.blame.BlameCacheImpl.Key key = new com.google.gitiles.blame.BlameCacheImpl.Key ( commitId , path ) ; return cache.get ( key , newLoader ( key , repo ) ) ; } catch ( java.util.concurrent.ExecutionException e ) { throw new java.io.IOException ( e ) ; } }
Source:
public void updateRepo ( com.google.gerrit.server.git.BatchUpdate.RepoContext ctx ) throws java.lang.Exception { changeKind = changeKindCache.getChangeKind ( projectControl.getProjectState ( ) , ctx.getRepository ( ) , priorCommit , commit ) ; if ( checkMergedInto ) { org.eclipse.jgit.lib.Ref mergedInto = findMergedInto ( ctx , dest.get ( ) , commit ) ; if ( mergedInto != null ) { mergedByPushOp = mergedByPushOpFactory.create ( requestScopePropagator , patchSetId , mergedInto.getName ( ) ) ; } } }

Target:
public void updateRepo ( com.google.gerrit.server.git.BatchUpdate.RepoContext ctx ) throws java.lang.Exception { changeKind = changeKindCache.getChangeKind ( projectControl.getProject ( ) . getNameKey ( ) , ctx.getRepository ( ) , priorCommit , commit ) ; if ( checkMergedInto ) { org.eclipse.jgit.lib.Ref mergedInto = findMergedInto ( ctx , dest.get ( ) , commit ) ; if ( mergedInto != null ) { mergedByPushOp = mergedByPushOpFactory.create ( requestScopePropagator , patchSetId , mergedInto.getName ( ) ) ; } } }
Source:
public void addRemote ( java.lang.String name , java.lang.String fetch ) { remotes.put ( name , fetch ) ; }

Target:
public void addRemote ( java.lang.String name , java.lang.String fetch ) { if ( ( fetch != null ) && ( fetch.endsWith ( "/" ) ) ) { fetch = fetch.substring ( 0 , ( ( fetch.length ( ) ) - 1 ) ) ; } remotes.put ( name , fetch ) ; }
Source:
public void testRetrieveRobotCommentsAsList ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.enabled ( ) ) . isTrue ( ) ; com.google.gerrit.extensions.api.changes.ReviewInput.RobotCommentInput robotCommentInput = createRobotCommentInput ( ) ; addRobotComment ( changeId , robotCommentInput ) ; java.util.List < com.google.gerrit.extensions.common.RobotCommentInfo > robotCommentInfos = gApi.changes ( ) . id ( changeId ) . current ( ) . robotCommentsAsList ( ) ; com.google.common.truth.Truth.assertThat ( robotCommentInfos ) . hasSize ( 1 ) ; com.google.gerrit.extensions.common.RobotCommentInfo robotCommentInfo = com.google.common.collect.Iterables.getOnlyElement ( robotCommentInfos ) ; assertRobotComment ( robotCommentInfo , robotCommentInput ) ; }

Target:
public void robotCommentsCanBeRetrievedAsList ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.enabled ( ) ) . isTrue ( ) ; com.google.gerrit.extensions.api.changes.ReviewInput.RobotCommentInput robotCommentInput = createRobotCommentInput ( ) ; addRobotComment ( changeId , robotCommentInput ) ; java.util.List < com.google.gerrit.extensions.common.RobotCommentInfo > robotCommentInfos = gApi.changes ( ) . id ( changeId ) . current ( ) . robotCommentsAsList ( ) ; com.google.common.truth.Truth.assertThat ( robotCommentInfos ) . hasSize ( 1 ) ; com.google.gerrit.extensions.common.RobotCommentInfo robotCommentInfo = com.google.common.collect.Iterables.getOnlyElement ( robotCommentInfos ) ; assertRobotComment ( robotCommentInfo , robotCommentInput ) ; }
Source:
private void selectProtocol ( com.google.gerrit.acceptance.git.PushForReviewIT.Protocol p ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String url ; switch ( p ) { case SSH : url = sshUrl ; break ; case HTTP : url = admin.getHttpUrl ( server ) ; break ; default : throw new java.lang.IllegalArgumentException ( ( "unexpected protocol: " + p ) ) ; } git = com.google.gerrit.acceptance.git.GitUtil.cloneProject ( ( ( url + "/" ) + ( project.get ( ) ) ) ) ; }

Target:
protected void selectProtocol ( com.google.gerrit.acceptance.git.AbstractPushForReview.Protocol p ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String url ; switch ( p ) { case SSH : url = sshUrl ; break ; case HTTP : url = admin.getHttpUrl ( server ) ; break ; default : throw new java.lang.IllegalArgumentException ( ( "unexpected protocol: " + p ) ) ; } git = com.google.gerrit.acceptance.git.GitUtil.cloneProject ( ( ( url + "/" ) + ( project.get ( ) ) ) ) ; }
Source:
private static boolean eq ( final org.eclipse.jgit.lib.ObjectId a , final org.eclipse.jgit.lib.ObjectId b ) { if ( ( a == null ) && ( b == null ) ) { return true ; } return ( ( a != null ) && ( b != null ) ) && ( org.eclipse.jgit.lib.AnyObjectId.equals ( a , b ) ) ; }

Target:
private void refreshObjectIds ( ) { if ( ( ( oldId ) == null ) && ( ( oldIdName ) != null ) ) { oldId = org.eclipse.jgit.lib.ObjectId.fromString ( oldIdName ) ; } if ( ( newId ) == null ) { newId = org.eclipse.jgit.lib.ObjectId.fromString ( newIdName ) ; } }
Source:
public com.google.gerrit.reviewdb.client.PatchSetInfo get ( org.eclipse.jgit.revwalk.RevCommit src , com.google.gerrit.reviewdb.client.PatchSet.Id psi ) { com.google.gerrit.reviewdb.client.PatchSetInfo info = new com.google.gerrit.reviewdb.client.PatchSetInfo ( psi ) ; info.setSubject ( src.getShortMessage ( ) ) ; info.setMessage ( src.getFullMessage ( ) ) ; info.setAuthor ( toUserIdentity ( src.getAuthorIdent ( ) ) ) ; info.setCommitter ( toUserIdentity ( src.getCommitterIdent ( ) ) ) ; info.setRevId ( src.getName ( ) ) ; return info ; }

Target:
public com.google.gerrit.reviewdb.client.PatchSetInfo get ( org.eclipse.jgit.revwalk.RevWalk rw , org.eclipse.jgit.revwalk.RevCommit src , com.google.gerrit.reviewdb.client.PatchSet.Id psi ) throws java.io.IOException { rw.parseBody ( src ) ; com.google.gerrit.reviewdb.client.PatchSetInfo info = new com.google.gerrit.reviewdb.client.PatchSetInfo ( psi ) ; info.setSubject ( src.getShortMessage ( ) ) ; info.setMessage ( src.getFullMessage ( ) ) ; info.setAuthor ( toUserIdentity ( src.getAuthorIdent ( ) ) ) ; info.setCommitter ( toUserIdentity ( src.getCommitterIdent ( ) ) ) ; info.setRevId ( src.getName ( ) ) ; return info ; }
Source:
public com.google.gerrit.reviewdb.client.Comment asComment ( java.lang.String serverId ) { com.google.gerrit.reviewdb.client.Comment c = new com.google.gerrit.reviewdb.client.Comment ( key.asCommentKey ( ) , author , writtenOn , side , message , serverId ) ; c.setRevId ( revId ) ; c.setRange ( range ) ; c.lineNbr = lineNbr ; c.parentUuid = parentUuid ; c.tag = tag ; return c ; }

Target:
public com.google.gerrit.reviewdb.client.Comment asComment ( java.lang.String serverId ) { com.google.gerrit.reviewdb.client.Comment c = new com.google.gerrit.reviewdb.client.Comment ( key.asCommentKey ( ) , author , writtenOn , side , message , serverId ) ; c.setRevId ( revId ) ; c.setRange ( range ) ; c.lineNbr = lineNbr ; c.parentUuid = parentUuid ; c.tag = tag ; c.setRealAuthor ( getRealAuthor ( ) ) ; return c ; }
Source:
public void setUp ( ) throws java.lang.Exception { testRepo = new org.eclipse.jgit.junit.TestRepository ( ( ( org.eclipse.jgit.internal.storage.dfs.InMemoryRepository ) ( repoManager.openRepository ( project ) ) ) ) ; tip = testRepo.getRevWalk ( ) . parseCommit ( testRepo.getRepository ( ) . exactRef ( "HEAD" ) . getObjectId ( ) ) ; adminId = admin.getId ( ) ; checker = checkerProvider.get ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.enabled ( ) ) . isFalse ( ) ; testRepo = new org.eclipse.jgit.junit.TestRepository ( ( ( org.eclipse.jgit.internal.storage.dfs.InMemoryRepository ) ( repoManager.openRepository ( project ) ) ) ) ; tip = testRepo.getRevWalk ( ) . parseCommit ( testRepo.getRepository ( ) . exactRef ( "HEAD" ) . getObjectId ( ) ) ; adminId = admin.getId ( ) ; checker = checkerProvider.get ( ) ; }
Source:
public com.google.gerrit.extensions.common.ChangeInfo get ( java.util.EnumSet < com.google.gerrit.extensions.client.ListChangesOption > s ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.CurrentUser u = user.get ( ) ; if ( u.isIdentifiedUser ( ) ) { ( ( com.google.gerrit.server.IdentifiedUser ) ( u ) ) . clearStarredChanges ( ) ; } return changeJson.create ( s ) . format ( change ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve change" , e ) ; } }

Target:
public com.google.gerrit.extensions.common.ChangeInfo get ( java.util.EnumSet < com.google.gerrit.extensions.client.ListChangesOption > s ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.CurrentUser u = user.get ( ) ; if ( u.isIdentifiedUser ( ) ) { u.asIdentifiedUser ( ) . clearStarredChanges ( ) ; } return changeJson.create ( s ) . format ( change ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve change" , e ) ; } }
Source:
java.lang.String image ( java.lang.String dest ) { if ( ( com.google.gitiles.doc.html.HtmlBuilder.isValidHttpUri ( dest ) ) || ( com.google.gitiles.doc.html.HtmlBuilder.isImageDataUri ( dest ) ) ) { return dest ; } else if ( ( imageLoader ) != null ) { return imageLoader.inline ( filePath , dest ) ; } return FilterImageDataUri.INSTANCE.getInnocuousOutput ( ) ; }

Target:
java.lang.String image ( java.lang.String dest ) { if ( ( com.google.gitiles.doc.html.HtmlBuilder.isValidHttpUri ( dest ) ) || ( com.google.gitiles.doc.html.HtmlBuilder.isImageDataUri ( dest ) ) ) { return dest ; } else if ( ( imageLoader ) != null ) { return imageLoader.inline ( filePath , dest ) ; } return SoyConstants.IMAGE_URI_INNOCUOUS_OUTPUT ; }
Source:
private boolean isHttpTransformPatternrUndefined ( javax.servlet.FilterConfig config ) { return ( ( ( java.lang.System.getProperty ( com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.GLOBAL_HTTP_TRANSFORM_PATTERN ) ) == null ) && ( ( config.getServletContext ( ) . getInitParameter ( com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.GLOBAL_HTTP_TRANSFORM_PATTERN ) ) == null ) ) && ( ( config.getInitParameter ( com.googlesource.gerrit.plugins.javamelody.GerritMonitoringFilter.JavamelodyFilter.HTTP_TRANSFORM_PATTERN ) ) == null ) ; }

Target:
private boolean isPropertyUndefined ( javax.servlet.FilterConfig config , java.lang.String name , java.lang.String globalName ) { return ( ( ( java.lang.System.getProperty ( globalName ) ) == null ) && ( ( config.getServletContext ( ) . getInitParameter ( globalName ) ) == null ) ) && ( ( config.getInitParameter ( name ) ) == null ) ; }
Source:
protected void configure ( ) { bind ( java.io.File.class ) . annotatedWith ( com.google.gerrit.server.config.SitePath.class ) . toProvider ( com.google.gerrit.server.config.SitePathFromSystemConfigProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; }

Target:
protected void configure ( ) { bind ( java.io.File.class ) . annotatedWith ( com.google.gerrit.server.config.SitePath.class ) . toInstance ( sitePath ) ; bind ( DataSourceProvider.Context.class ) . toInstance ( DataSourceProvider.Context.MULTI_USER ) ; bind ( com.google.inject.Key.get ( javax.sql.DataSource.class , com.google.inject.name.Names.named ( "ReviewDb" ) ) ) . toProvider ( com.google.gerrit.server.schema.DataSourceProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; listener ( ) . to ( com.google.gerrit.server.schema.DataSourceProvider.class ) ; }
Source:
public static com.google.gerrit.extensions.client.EditPreferencesInfo defaults ( ) { com.google.gerrit.extensions.client.EditPreferencesInfo i = new com.google.gerrit.extensions.client.EditPreferencesInfo ( ) ; i.tabSize = 8 ; i.lineLength = 100 ; i.hideTopMenu = false ; i.showTabs = true ; i.showWhitespaceErrors = false ; i.syntaxHighlighting = true ; i.hideLineNumbers = false ; i.theme = com.google.gerrit.extensions.client.Theme.DEFAULT ; i.keyMapType = KeyMapType.DEFAULT ; return i ; }

Target:
public static com.google.gerrit.extensions.client.EditPreferencesInfo defaults ( ) { com.google.gerrit.extensions.client.EditPreferencesInfo i = new com.google.gerrit.extensions.client.EditPreferencesInfo ( ) ; i.tabSize = 8 ; i.lineLength = 100 ; i.cursorBlinkRate = 0 ; i.hideTopMenu = false ; i.showTabs = true ; i.showWhitespaceErrors = false ; i.syntaxHighlighting = true ; i.hideLineNumbers = false ; i.theme = Theme.DEFAULT ; i.keyMapType = KeyMapType.DEFAULT ; return i ; }
Source:
public void createdOnIsPopulatedForGroupsCreatedBeforeAudit ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.AccountGroup.Id groupId = createGroup ( "Ancient group for schema migration" ) ; setCreatedOnToVeryOldTimestamp ( groupId ) ; removeAuditEntriesFor ( groupId ) ; schema151.migrateData ( db , new com.google.gerrit.server.schema.Schema_150_to_151_Test.TestUpdateUI ( ) ) ; com.google.gerrit.reviewdb.client.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; com.google.common.truth.Truth.assertThat ( group.getCreatedOn ( ) ) . isEqualTo ( com.google.gerrit.reviewdb.client.AccountGroup.auditCreationInstantTs ( ) ) ; }

Target:
public void createdOnIsPopulatedForGroupsCreatedBeforeAudit ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.AccountGroup.Id groupId = createGroup ( "Ancient group for schema migration" ) ; setCreatedOnToVeryOldTimestamp ( groupId ) ; removeAuditEntriesFor ( groupId ) ; schema151.migrateData ( db , new com.google.gerrit.testutil.TestUpdateUI ( ) ) ; com.google.gerrit.reviewdb.client.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; com.google.common.truth.Truth.assertThat ( group.getCreatedOn ( ) ) . isEqualTo ( com.google.gerrit.reviewdb.client.AccountGroup.auditCreationInstantTs ( ) ) ; }
Source:
public void onLoad ( com.google.gerrit.plugin.client.screen.Screen screen ) { java.lang.String change = com.google.gwt.http.client.URL.decode ( screen.getToken ( 1 ) ) ; java.lang.String patchSet = com.google.gwt.http.client.URL.decode ( screen.getToken ( 2 ) ) ; java.lang.String file = com.google.gwt.http.client.URL.decode ( screen.getToken ( 3 ) ) ; screen.show ( new com.googlesource.gerrit.plugins.xdocs.client.XDocSideBySideDiffScreen ( change , patchSet , file ) ) ; }

Target:
public void onLoad ( com.google.gerrit.plugin.client.screen.Screen screen ) { java.lang.String change = com.google.gwt.http.client.URL.decode ( screen.getToken ( 1 ) ) ; java.lang.String patchSet = com.google.gwt.http.client.URL.decode ( screen.getToken ( 2 ) ) ; java.lang.String path = com.google.gwt.http.client.URL.decode ( screen.getToken ( 4 ) ) ; screen.show ( new com.googlesource.gerrit.plugins.xdocs.client.XDocSideBySideDiffScreen ( change , patchSet , path ) ) ; screen.setWindowTitle ( com.googlesource.gerrit.plugins.xdocs.client.XDocScreen.getFileName ( path ) ) ; }
Source:
private void openLine ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m ) { m.openTr ( ) ; m.setAttribute ( "valign" , "top" ) ; m.openTd ( ) ; m.setStyleName ( com.google.gerrit.client.patches.S_ICON_CELL ) ; m.closeTd ( ) ; }

Target:
private void openLine ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m ) { m.openTr ( ) ; m.setAttribute ( "valign" , "top" ) ; m.openTd ( ) ; m.setStyleName ( Gerrit.RESOURCES.css ( ) . iconCell ( ) ) ; m.closeTd ( ) ; }
Source:
void display ( final com.google.gerrit.common.data.AgreementInfo result ) { while ( 1 < ( table.getRowCount ( ) ) ) { table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; } for ( final java.lang.String k : result.accepted ) { addOne ( result , k ) ; } }

Target:
void display ( java.util.List < com.google.gerrit.client.account.AgreementInfo > result ) { while ( 1 < ( table.getRowCount ( ) ) ) { table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; } for ( com.google.gerrit.client.account.AgreementInfo info : result ) { addOne ( info ) ; } }
Source:
public void run ( ) { cm.scrollToY ( other.getScrollInfo ( ) . getTop ( ) ) ; }

Target:
public void run ( ) { double now = ( ( double ) ( java.lang.System.currentTimeMillis ( ) ) ) ; if ( ( ( cm.getScrollSetBy ( ) ) == other ) && ( ( ( cm.getScrollSetAt ( ) ) + 50 ) > now ) ) { return ; } other.scrollToY ( cm.getScrollInfo ( ) . getTop ( ) ) ; other.setScrollSetBy ( cm ) ; other.setScrollSetAt ( now ) ; }
Source:
public static java.lang.String projectQuery ( com.google.gerrit.reviewdb.client.Project.NameKey proj , com.google.gerrit.reviewdb.client.Change.Status status ) { switch ( status ) { case ABANDONED : return "status:abandoned " + ( com.google.gerrit.common.PageLinks.op ( "project" , proj.get ( ) ) ) ; case MERGED : return "status:merged " + ( com.google.gerrit.common.PageLinks.op ( "project" , proj.get ( ) ) ) ; case NEW : case SUBMITTED : default : return "status:open " + ( com.google.gerrit.common.PageLinks.op ( "project" , proj.get ( ) ) ) ; } }

Target:
private static java.lang.String status ( com.google.gerrit.reviewdb.client.Change.Status status ) { switch ( status ) { case ABANDONED : return "status:abandoned" ; case MERGED : return "status:merged" ; case NEW : case SUBMITTED : default : return "status:open" ; } }
Source:
public void commentOnReviewableChangeByOwnerCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; review ( sc.owner , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "comment" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void commentOnReviewableChangeByOwnerCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; review ( sc.owner , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "comment" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) . noOneElse ( ) ; }
Source:
private void markCleanMerges ( ) throws com.google.gerrit.server.git.IntegrationException { for ( com.google.gerrit.server.git.strategy.SubmitStrategy strategy : strategies ) { com.google.gerrit.server.git.strategy.SubmitStrategy.Arguments args = strategy.args ; args.mergeUtil.markCleanMerges ( args.rw , args.canMergeFlag , args.mergeTip.getCurrentTip ( ) , args.alreadyAccepted ) ; } }

Target:
private void markCleanMerges ( ) throws com.google.gerrit.server.git.IntegrationException { for ( com.google.gerrit.server.git.strategy.SubmitStrategy strategy : strategies ) { com.google.gerrit.server.git.strategy.SubmitStrategy.Arguments args = strategy.args ; org.eclipse.jgit.revwalk.RevCommit initialTip = args.mergeTip.getInitialTip ( ) ; args.mergeUtil.markCleanMerges ( args.rw , args.canMergeFlag , args.mergeTip.getCurrentTip ( ) , ( initialTip == null ? com.google.common.collect.ImmutableSet.< org.eclipse.jgit.revwalk.RevCommit > of ( ) : com.google.common.collect.ImmutableSet.of ( initialTip ) ) ) ; } }
Source:
public void publishEdit ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , modifier.createEdit ( change , getCurrentPatchSet ( changeId ) ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.FORCED , modifier.modifyFile ( editUtil.byChange ( change ) . get ( ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME , com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_NEW2 ) ) ; editUtil.publish ( editUtil.byChange ( change ) . get ( ) ) ; org.junit.Assert.assertFalse ( editUtil.byChange ( change ) . isPresent ( ) ) ; }

Target:
public void publishEdit ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( modifier.createEdit ( change , getCurrentPatchSet ( changeId ) ) ) . isEqualTo ( RefUpdate.Result.NEW ) ; com.google.common.truth.Truth.assertThat ( modifier.modifyFile ( editUtil.byChange ( change ) . get ( ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME , com.google.gerrit.acceptance.RestSession.newRawInput ( com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_NEW2 ) ) ) . isEqualTo ( RefUpdate.Result.FORCED ) ; editUtil.publish ( editUtil.byChange ( change ) . get ( ) ) ; com.google.common.truth.Truth.assertThat ( editUtil.byChange ( change ) . isPresent ( ) ) . isFalse ( ) ; }
Source:
public void nonOwnerCannotSetConfig ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.ConfigInput input = createTestConfigInput ( ) ; setApiUser ( user ) ; exception.expect ( com.google.gerrit.extensions.restapi.AuthException.class ) ; exception.expectMessage ( "restricted to project owner" ) ; gApi.projects ( ) . name ( project.get ( ) ) . config ( input ) ; }

Target:
public void nonOwnerCannotSetConfig ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.ConfigInput input = createTestConfigInput ( ) ; setApiUser ( user ) ; exception.expect ( com.google.gerrit.extensions.restapi.AuthException.class ) ; exception.expectMessage ( "write config not permitted" ) ; gApi.projects ( ) . name ( project.get ( ) ) . config ( input ) ; }
Source:
public java.util.Optional < com.google.gerrit.reviewdb.client.Account.Id > load ( java.lang.String username ) throws java.lang.Exception { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { return java.util.Optional.ofNullable ( com.google.gerrit.server.account.ExternalId.from ( db.accountExternalIds ( ) . get ( ExternalId.Key.create ( com.google.gerrit.server.account.ExternalId.SCHEME_GERRIT , username ) . asAccountExternalIdKey ( ) ) ) ) . map ( ExternalId :: accountId ) ; } }

Target:
public java.util.Optional < com.google.gerrit.reviewdb.client.Account.Id > load ( java.lang.String username ) throws java.lang.Exception { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { return java.util.Optional.ofNullable ( com.google.gerrit.server.account.externalids.ExternalId.from ( db.accountExternalIds ( ) . get ( ExternalId.Key.create ( com.google.gerrit.server.account.externalids.ExternalId.SCHEME_GERRIT , username ) . asAccountExternalIdKey ( ) ) ) ) . map ( ExternalId :: accountId ) ; } }
Source:
public static com.google.gerrit.client.GitwebLink getGitwebLink ( ) { com.google.gerrit.common.data.GitwebConfig gw = com.google.gerrit.client.Gerrit.getConfig ( ) . getGitwebLink ( ) ; return ( gw != null ) && ( ( gw.type ) != null ) ? new com.google.gerrit.client.GitwebLink ( gw ) : null ; }

Target:
public void onSuccess ( com.google.gerrit.client.info.ServerInfo info ) { com.google.gerrit.client.Gerrit.myServerInfo = info ; com.google.gerrit.client.Gerrit.urlAliasMatcher = new com.google.gerrit.client.UrlAliasMatcher ( info.urlAliases ( ) ) ; java.lang.String du = info.gerrit ( ) . docUrl ( ) ; if ( ( du != null ) && ( ! ( du.isEmpty ( ) ) ) ) { com.google.gerrit.client.Gerrit.hasDocumentation = true ; com.google.gerrit.client.Gerrit.docUrl = du ; } com.google.gerrit.client.Gerrit.docSearch = info.gerrit ( ) . docSearch ( ) ; }
Source:
private void beforeTest ( org.eclipse.jgit.lib.Config cfg , boolean memory ) throws java.lang.Exception { server = startServer ( cfg , memory ) ; server.getTestInjector ( ) . injectMembers ( this ) ; }

Target:
private void beforeTest ( org.eclipse.jgit.lib.Config cfg , boolean memory ) throws java.lang.Exception { server = startServer ( cfg , memory ) ; server.getTestInjector ( ) . injectMembers ( this ) ; admin = accounts.admin ( ) ; adminSession = new com.google.gerrit.acceptance.RestSession ( server , admin ) ; com.google.gerrit.acceptance.GitUtil.initSsh ( admin ) ; }
Source:
public static void grant ( com.google.gerrit.server.git.ProjectConfig config , com.google.gerrit.common.data.AccessSection section , java.lang.String permission , boolean force , java.lang.Boolean exclusive , com.google.gerrit.common.data.GroupReference ... groupList ) { com.google.gerrit.common.data.Permission p = section.getPermission ( permission , true ) ; if ( exclusive != null ) { p.setExclusiveGroup ( exclusive ) ; } for ( com.google.gerrit.common.data.GroupReference group : groupList ) { if ( group != null ) { com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.schema.AclUtil.rule ( config , group ) ; r.setForce ( force ) ; p.add ( r ) ; } } }

Target:
public static void grant ( com.google.gerrit.server.project.ProjectConfig config , com.google.gerrit.common.data.AccessSection section , java.lang.String permission , boolean force , java.lang.Boolean exclusive , com.google.gerrit.common.data.GroupReference ... groupList ) { com.google.gerrit.common.data.Permission p = section.getPermission ( permission , true ) ; if ( exclusive != null ) { p.setExclusiveGroup ( exclusive ) ; } for ( com.google.gerrit.common.data.GroupReference group : groupList ) { if ( group != null ) { com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.schema.AclUtil.rule ( config , group ) ; r.setForce ( force ) ; p.add ( r ) ; } } }
Source:
public java.lang.Iterable < com.google.gerrit.prettify.common.EditList.Hunk > getHunks ( ) { int ctx = diffPrefs.context ; if ( ctx == ( com.google.gerrit.extensions.client.DiffPreferencesInfo.WHOLE_FILE_CONTEXT ) ) { ctx = java.lang.Math.max ( a.size ( ) , b.size ( ) ) ; } return new com.google.gerrit.prettify.common.EditList ( edits , ctx , a.size ( ) , b.size ( ) ) . getHunks ( ) ; }

Target:
public java.util.Set < org.eclipse.jgit.diff.Edit > getEditsDueToRebase ( ) { return editsDueToRebase ; }
Source:
public void tearDown ( ) throws java.lang.Exception { if ( ( db ) != null ) { db.close ( ) ; } if ( ( schemaFactory ) != null ) { com.google.gerrit.testutil.InMemoryDatabase.drop ( schemaFactory ) ; } }

Target:
public void tearDown ( ) throws java.lang.Exception { if ( ( db ) != null ) { db.close ( ) ; } if ( ( lifecycle ) != null ) { lifecycle.stop ( ) ; } if ( ( schemaFactory ) != null ) { com.google.gerrit.testutil.InMemoryDatabase.drop ( schemaFactory ) ; } }
Source:
public com.google.gerrit.reviewdb.client.Change update ( com.google.gerrit.reviewdb.client.Change c ) { c.setStatus ( Change.Status.MERGED ) ; c.setMergeable ( true ) ; if ( ! ( merged.equals ( c.currentPatchSetId ( ) ) ) ) { try { c.setCurrentPatchSet ( patchSetInfoFactory.get ( db , merged ) ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e1 ) { com.google.gerrit.server.git.MergeOp.log.error ( ( "Cannot read merged patch set " + merged ) , e1 ) ; } } com.google.gerrit.server.ChangeUtil.updated ( c ) ; return c ; }

Target:
public com.google.gerrit.reviewdb.client.Change update ( com.google.gerrit.reviewdb.client.Change c ) { c.setStatus ( Change.Status.MERGED ) ; c.setMergeable ( true ) ; if ( ! ( merged.equals ( c.currentPatchSetId ( ) ) ) ) { try { c.setCurrentPatchSet ( patchSetInfoFactory.get ( db , merged ) ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e1 ) { logError ( ( "Cannot read merged patch set " + merged ) , e1 ) ; } } com.google.gerrit.server.ChangeUtil.updated ( c ) ; return c ; }
Source:
private void assertCreateFails ( com.google.gerrit.extensions.common.ChangeInfo in , java.lang.Class < ? extends com.google.gerrit.extensions.restapi.RestApiException > errType , java.lang.String errSubstring ) throws java.lang.Exception { try { gApi.changes ( ) . create ( in ) ; org.junit.Assert.fail ( ( "Expected " + ( errType.getSimpleName ( ) ) ) ) ; } catch ( com.google.gerrit.extensions.restapi.RestApiException expected ) { com.google.common.truth.Truth.assertThat ( expected ) . isInstanceOf ( errType ) ; com.google.common.truth.Truth.assertThat ( expected.getMessage ( ) ) . contains ( errSubstring ) ; } }

Target:
private void assertCreateFails ( com.google.gerrit.extensions.common.ChangeInfo in , java.lang.Class < ? extends com.google.gerrit.extensions.restapi.RestApiException > errType , java.lang.String errSubstring ) throws java.lang.Exception { exception.expect ( errType ) ; exception.expectMessage ( errSubstring ) ; gApi.changes ( ) . create ( in ) ; }
Source:
public boolean canUpdate ( ) { if ( ( RefNames.REFS_CONFIG.equals ( refName ) ) && ( ! ( projectControl.isOwner ( ) ) ) ) { if ( ! ( ( projectControl.getProjectState ( ) . isAllProjects ( ) ) && ( getUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) ) { return false ; } } return ( canPerform ( Permission.PUSH ) ) && ( canWrite ( ) ) ; }

Target:
public boolean canUpdate ( ) { if ( ( RefNames.REFS_CONFIG.equals ( refName ) ) && ( ! ( projectControl.isOwner ( ) ) ) ) { if ( ! ( ( projectControl.getProjectState ( ) . isAllProjects ( ) ) && ( getUser ( ) . getCapabilities ( ) . isAdmin_DoNotUse ( ) ) ) ) { return false ; } } return ( canPerform ( Permission.PUSH ) ) && ( canWrite ( ) ) ; }
Source:
public static void deleteGpgKeys ( java.lang.String account , java.lang.Iterable < java.lang.String > fingerprints , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.info.GpgKeyInfo > > cb ) { new com.google.gerrit.client.rpc.RestApi ( "/accounts/" ) . id ( account ) . view ( "gpgkeys" ) . post ( com.google.gerrit.client.account.AccountApi.GpgKeysInput.delete ( fingerprints ) , cb ) ; }

Target:
public static void deleteGpgKeys ( java.lang.String account , java.lang.Iterable < java.lang.String > fingerprints , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.info.GpgKeyInfo > > cb ) { com.google.gerrit.client.account.AccountApi.accounts ( ) . id ( account ) . view ( "gpgkeys" ) . post ( com.google.gerrit.client.account.AccountApi.GpgKeysInput.delete ( fingerprints ) , cb ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo info ) { info.revisions ( ) . copyKeysIntoChildren ( "name" ) ; com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.ChangeInfo.RevisionInfo > list = info.revisions ( ) . values ( ) ; com.google.gerrit.client.changes.ChangeInfo.RevisionInfo.sortRevisionInfoByNumber ( list ) ; diffTable.setUpPatchSetNav ( list , diff ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo info ) { info.revisions ( ) . copyKeysIntoChildren ( "name" ) ; com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.ChangeInfo.RevisionInfo > list = info.revisions ( ) . values ( ) ; com.google.gerrit.client.changes.ChangeInfo.RevisionInfo.sortRevisionInfoByNumber ( list ) ; diffTable.setUpPatchSetNav ( list , diff ) ; header.set ( info ) ; }
Source:
protected void loadDefaults ( ) { approvals = com.google.common.collect.ImmutableListMultimap.of ( ) ; reviewers = com.google.common.collect.ImmutableSetMultimap.of ( ) ; submitRecords = com.google.common.collect.ImmutableList.of ( ) ; allChangeMessages = com.google.common.collect.ImmutableList.of ( ) ; changeMessagesByPatchSet = com.google.common.collect.ImmutableListMultimap.of ( ) ; comments = com.google.common.collect.ImmutableListMultimap.of ( ) ; hashtags = com.google.common.collect.ImmutableSet.of ( ) ; }

Target:
protected void loadDefaults ( ) { approvals = com.google.common.collect.ImmutableListMultimap.of ( ) ; reviewers = com.google.common.collect.ImmutableSetMultimap.of ( ) ; submitRecords = com.google.common.collect.ImmutableList.of ( ) ; allChangeMessages = com.google.common.collect.ImmutableList.of ( ) ; changeMessagesByPatchSet = com.google.common.collect.ImmutableListMultimap.of ( ) ; comments = com.google.common.collect.ImmutableListMultimap.of ( ) ; hashtags = com.google.common.collect.ImmutableSet.of ( ) ; patchSets = com.google.common.collect.ImmutableSortedMap.of ( ) ; allPastReviewers = com.google.common.collect.ImmutableList.of ( ) ; }
Source:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.Index.Input input ) throws java.io.IOException { indexer.index ( db.get ( ) , rsrc.getChange ( ) ) ; return com.google.gerrit.extensions.restapi.Response.none ( ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.Index.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , java.io.IOException { com.google.gerrit.server.project.ChangeControl ctl = rsrc.getControl ( ) ; if ( ( ! ( ctl.isOwner ( ) ) ) && ( ! ( ctl.getCurrentUser ( ) . getCapabilities ( ) . canMaintainServer ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Only change owner or server maintainer can reindex" ) ; } indexer.index ( db.get ( ) , rsrc.getChange ( ) ) ; return com.google.gerrit.extensions.restapi.Response.none ( ) ; }
Source:
public java.util.List < com.google.gerrit.server.query.QueryResult < T > > query ( java.util.List < com.google.gerrit.server.query.Predicate < T > > queries ) throws com.google.gerrit.server.query.QueryParseException , com.google.gwtorm.server.OrmException { try { return query ( null , queries ) ; } catch ( com.google.gwtorm.server.OrmRuntimeException e ) { throw new com.google.gwtorm.server.OrmException ( e.getMessage ( ) , e ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.common.base.Throwables.propagateIfInstanceOf ( e.getCause ( ) , com.google.gerrit.server.query.QueryParseException.class ) ; throw e ; } }

Target:
public java.util.List < com.google.gerrit.server.query.QueryResult < T > > query ( java.util.List < com.google.gerrit.server.query.Predicate < T > > queries ) throws com.google.gerrit.server.query.QueryParseException , com.google.gwtorm.server.OrmException { try { return query ( null , queries ) ; } catch ( com.google.gwtorm.server.OrmRuntimeException e ) { throw new com.google.gwtorm.server.OrmException ( e.getMessage ( ) , e ) ; } catch ( com.google.gwtorm.server.OrmException e ) { if ( ( e.getCause ( ) ) != null ) { com.google.common.base.Throwables.throwIfInstanceOf ( e.getCause ( ) , com.google.gerrit.server.query.QueryParseException.class ) ; } throw e ; } }
Source:
private com.google.gerrit.server.ssh.AbstractCommand create ( final java.lang.String cmd ) { final com.google.inject.Provider < ? extends com.google.gerrit.server.ssh.AbstractCommand > f = commands.get ( cmd ) ; if ( f != null ) { return f.get ( ) ; } return new com.google.gerrit.server.ssh.AbstractCommand ( ) { @ java.lang.Override protected void run ( ) throws com.google.gerrit.server.ssh.Failure { throw new com.google.gerrit.server.ssh.UnloggedFailure ( 127 , ( ( "gerrit: " + ( getName ( ) ) ) + ": not found" ) ) ; } } ; }

Target:
public void setOutputStream ( final java.io.OutputStream out ) { }
Source:
private java.util.Set < java.lang.String > getRefNamesAllUsers ( java.lang.String prefix ) throws com.google.gwtorm.server.OrmException { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openMetadataRepository ( 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 java.util.Collection < org.eclipse.jgit.lib.Ref > getDraftRefs ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws java.io.IOException { return repo.getRefDatabase ( ) . getRefs ( com.google.gerrit.reviewdb.client.RefNames.refsDraftCommentsPrefix ( changeId ) ) . values ( ) ; }
Source:
public void assertHasNoPackFile ( com.google.gerrit.reviewdb.client.Project ... projects ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { for ( com.google.gerrit.reviewdb.client.Project.NameKey p : projects ) { org.junit.Assert.assertTrue ( ( ( "Project " + ( p.get ( ) ) ) + " has pack files." ) , ( ( getPackFiles ( p ) . length ) == 0 ) ) ; } }

Target:
public void assertHasNoPackFile ( com.google.gerrit.reviewdb.client.Project ... projects ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { for ( com.google.gerrit.reviewdb.client.Project.NameKey p : projects ) { com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( ( ( "Project " + ( p.get ( ) ) ) + " has pack files." ) ) . that ( getPackFiles ( p ) ) . isEmpty ( ) ; } }
Source:
public void visit ( org.pegdown.ast.ExpLinkNode node ) { html.open ( "a" ) . attribute ( "href" , href ( node.url ) ) . attribute ( "title" , node.title ) ; visitChildren ( node ) ; html.close ( "a" ) ; }

Target:
public void visit ( org.commonmark.node.Link node ) { html.open ( "a" ) . attribute ( "href" , href ( node.getDestination ( ) ) ) . attribute ( "title" , node.getTitle ( ) ) ; visitChildren ( node ) ; html.close ( "a" ) ; }
Source:
public < V > com.google.gerrit.metrics.CallbackMetric < V > newCallbackMetric ( java.lang.String name , java.lang.Class < V > valueClass , com.google.gerrit.metrics.Description desc ) { checkNotDefined ( name ) ; descriptions.put ( name , desc.getAnnotations ( ) ) ; return new com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.CallbackMetricImpl < V > ( name , valueClass ) ; }

Target:
public synchronized < F1 , F2 , F3 > com.google.gerrit.metrics.Counter3 < F1 , F2 , F3 > newCounter ( java.lang.String name , com.google.gerrit.metrics.Description desc , com.google.gerrit.metrics.Field < F1 > field1 , com.google.gerrit.metrics.Field < F2 > field2 , com.google.gerrit.metrics.Field < F3 > field3 ) { com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.checkCounterDescription ( desc ) ; com.google.gerrit.metrics.dropwizard.CounterImplN m = new com.google.gerrit.metrics.dropwizard.CounterImplN ( this , name , desc , field1 , field2 , field3 ) ; define ( name , desc ) ; bucketed.put ( name , m ) ; return m.counter3 ( ) ; }
Source:
public void testParseWHeader ( ) throws java.lang.Exception { com.google.gerrit.server.git.QueryList ql = com.google.gerrit.server.git.QueryList.parse ( ( ( com.google.gerrit.server.git.QueryListTest.HEADER ) + ( com.google.gerrit.server.git.QueryListTest.F_SIMPLE ) ) , null ) ; com.google.common.truth.Truth.assertThat ( ql.getQuery ( com.google.gerrit.server.git.QueryListTest.N_FOO ) ) . isEqualTo ( com.google.gerrit.server.git.QueryListTest.Q_P ) ; com.google.common.truth.Truth.assertThat ( ql.getQuery ( com.google.gerrit.server.git.QueryListTest.N_BAR ) ) . isEqualTo ( com.google.gerrit.server.git.QueryListTest.Q_B ) ; }

Target:
public void testParseWHeader ( ) throws java.lang.Exception { com.google.gerrit.server.account.QueryList ql = com.google.gerrit.server.account.QueryList.parse ( ( ( com.google.gerrit.server.account.QueryListTest.HEADER ) + ( com.google.gerrit.server.account.QueryListTest.F_SIMPLE ) ) , null ) ; com.google.common.truth.Truth.assertThat ( ql.getQuery ( com.google.gerrit.server.account.QueryListTest.N_FOO ) ) . isEqualTo ( com.google.gerrit.server.account.QueryListTest.Q_P ) ; com.google.common.truth.Truth.assertThat ( ql.getQuery ( com.google.gerrit.server.account.QueryListTest.N_BAR ) ) . isEqualTo ( com.google.gerrit.server.account.QueryListTest.Q_B ) ; }
Source:
private void populateTableHeader ( final com.google.gerrit.common.data.PatchScript script , final com.google.gerrit.common.data.PatchSetDetail detail ) { prepareHeaderWidgets ( script , detail ) ; table.setWidget ( com.google.gerrit.client.patches.R_HEAD , com.google.gerrit.client.patches.SideBySideTable.A , psListOfHeaderA ) ; table.setWidget ( com.google.gerrit.client.patches.R_HEAD , com.google.gerrit.client.patches.SideBySideTable.B , psListOfHeaderB ) ; }

Target:
private void populateTableHeader ( final com.google.gerrit.common.data.PatchScript script , final com.google.gerrit.common.data.PatchSetDetail detail ) { initHeaders ( script , detail ) ; table.setWidget ( com.google.gerrit.client.patches.R_HEAD , com.google.gerrit.client.patches.SideBySideTable.A , headerSideA ) ; table.setWidget ( com.google.gerrit.client.patches.R_HEAD , com.google.gerrit.client.patches.SideBySideTable.B , headerSideB ) ; if ( headerSideA.isFile ( ) ) { table.setWidget ( com.google.gerrit.client.patches.R_HEAD , ( ( com.google.gerrit.client.patches.SideBySideTable.A ) - 1 ) , iconA ) ; } if ( headerSideB.isFile ( ) ) { table.setWidget ( com.google.gerrit.client.patches.R_HEAD , ( ( com.google.gerrit.client.patches.SideBySideTable.B ) + 1 ) , iconB ) ; } }
Source:
public void start ( ) { queue.start ( ) ; if ( ( ( srvInfo.getState ( ) ) == ( ServerInformation.State.STARTUP ) ) && ( queue.replicateAllOnPluginStart ) ) { pushAllFuture.set ( pushAll.create ( null ) . schedule ( 30 , java.util.concurrent.TimeUnit.SECONDS ) ) ; } }

Target:
public void start ( ) { queue.start ( ) ; if ( ( ( srvInfo.getState ( ) ) == ( ServerInformation.State.STARTUP ) ) && ( queue.replicateAllOnPluginStart ) ) { com.googlesource.gerrit.plugins.replication.ReplicationState state = new com.googlesource.gerrit.plugins.replication.ReplicationState ( ReplicationType.STARTUP ) ; pushAllFuture.set ( pushAll.create ( null , state ) . schedule ( 30 , java.util.concurrent.TimeUnit.SECONDS ) ) ; } }
Source:
protected void configure ( ) { bind ( java.io.File.class ) . annotatedWith ( com.google.gerrit.server.config.SitePath.class ) . toProvider ( com.google.gerrit.httpd.SitePathFromSystemConfigProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; }

Target:
protected void configure ( ) { bind ( DataSourceProvider.Context.class ) . toInstance ( DataSourceProvider.Context.MULTI_USER ) ; bind ( com.google.inject.Key.get ( javax.sql.DataSource.class , com.google.inject.name.Names.named ( "ReviewDb" ) ) ) . toProvider ( com.google.gerrit.server.schema.DataSourceProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; listener ( ) . to ( com.google.gerrit.server.schema.DataSourceProvider.class ) ; }
Source:
private void registerCmEvents ( final net.codemirror.lib.CodeMirror cm ) { cm.on ( "beforeSelectionChange" , onSelectionChange ( cm ) ) ; cm.on ( "cursorActivity" , updateActiveLine ( cm ) ) ; cm.on ( "gutterClick" , onGutterClick ( cm ) ) ; cm.on ( "focus" , updateActiveLine ( cm ) ) ; }

Target:
public void run ( ) { switch ( getIntraLineStatus ( ) ) { case OFF : case OK : toggleShowIntraline ( ) ; break ; default : break ; } }
Source:
private void checkOptions ( ) throws com.google.gerrit.extensions.restapi.BadRequestException { int supplied = 0 ; if ( ( base ) != null ) { supplied ++ ; } if ( reviewed ) { supplied ++ ; } if ( ( query ) != null ) { supplied ++ ; } if ( supplied > 1 ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "cannot combine base, reviewed, query" ) ; } }

Target:
private void checkOptions ( ) throws com.google.gerrit.extensions.restapi.BadRequestException { int supplied = 0 ; if ( ( base ) != null ) { supplied ++ ; } if ( ( parentNum ) > 0 ) { supplied ++ ; } if ( reviewed ) { supplied ++ ; } if ( ( query ) != null ) { supplied ++ ; } if ( supplied > 1 ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "cannot combine base, parent, reviewed, query" ) ; } }
Source:
public void evict ( final com.google.gerrit.reviewdb.AccountGroup group ) { byId.remove ( group.getId ( ) ) ; byName.remove ( group.getNameKey ( ) ) ; byExternalName.remove ( group.getExternalNameKey ( ) ) ; }

Target:
public void evict ( final com.google.gerrit.reviewdb.AccountGroup group ) { byId.remove ( group.getId ( ) ) ; byName.remove ( group.getNameKey ( ) ) ; byUUID.remove ( group.getGroupUUID ( ) ) ; byExternalName.remove ( group.getExternalNameKey ( ) ) ; }
Source:
public static java.security.PublicKey parse ( final com.google.gerrit.client.reviewdb.AccountSshKey key ) throws java.security.NoSuchAlgorithmException , java.security.NoSuchProviderException , java.security.spec.InvalidKeySpecException { final java.lang.String s = key.getEncodedKey ( ) ; if ( s == null ) { throw new java.security.spec.InvalidKeySpecException ( "No key string" ) ; } final byte [ ] bin = org.apache.commons.codec.binary.Base64.decodeBase64 ( org.spearce.jgit.lib.Constants.encodeASCII ( s ) ) ; return new org.apache.sshd.common.util.Buffer ( bin ) . getPublicKey ( ) ; }

Target:
public static java.security.PublicKey parse ( final com.google.gerrit.client.reviewdb.AccountSshKey key ) throws java.security.NoSuchAlgorithmException , java.security.NoSuchProviderException , java.security.spec.InvalidKeySpecException { try { final java.lang.String s = key.getEncodedKey ( ) ; if ( s == null ) { throw new java.security.spec.InvalidKeySpecException ( "No key string" ) ; } final byte [ ] bin = org.apache.commons.codec.binary.Base64.decodeBase64 ( org.spearce.jgit.lib.Constants.encodeASCII ( s ) ) ; return new org.apache.sshd.common.util.Buffer ( bin ) . getPublicKey ( ) ; } catch ( java.lang.RuntimeException re ) { throw new java.security.spec.InvalidKeySpecException ( "Cannot parse key" , re ) ; } }