auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void addExtensionPoints ( com.google.gerrit.client.info.ChangeInfo change , com.google.gerrit.client.info.ChangeInfo.RevisionInfo rev ) { addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER , headerExtension , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER_RIGHT_OF_BUTTONS , headerExtensionMiddle , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER_RIGHT_OF_POP_DOWNS , headerExtensionRight , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_CHANGE_INFO_BLOCK , changeExtension , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_RELATED_INFO_BLOCK , relatedExtension , change , rev ) ; }

Target:
private void addExtensionPoints ( com.google.gerrit.client.info.ChangeInfo change , com.google.gerrit.client.info.ChangeInfo.RevisionInfo rev ) { addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER , headerExtension , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER_RIGHT_OF_BUTTONS , headerExtensionMiddle , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER_RIGHT_OF_POP_DOWNS , headerExtensionRight , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_CHANGE_INFO_BLOCK , changeExtension , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_RELATED_INFO_BLOCK , relatedExtension , change , rev ) ; addExtensionPoint ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_COMMIT_INFO_BLOCK , commitExtension , change , rev ) ; }
Source:
public void testPattern ( ) { com.googlesource.gerrit.plugins.hooks.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "ItsTestName" , null , "commentlink" ) ) . andReturn ( null ) . atLeastOnce ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "commentlink" , "ItsTestName" , "match" ) ) . andReturn ( "TestPattern" ) . atLeastOnce ( ) ; replayMocks ( ) ; assertEquals ( "Expected and generated pattern are not equal" , "TestPattern" , itsConfig.getIssuePattern ( ) . pattern ( ) ) ; }

Target:
public void testGetIssuePattern ( ) { com.googlesource.gerrit.plugins.hooks.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "ItsTestName" , null , "commentlink" ) ) . andReturn ( null ) . atLeastOnce ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "commentlink" , "ItsTestName" , "match" ) ) . andReturn ( "TestPattern" ) . atLeastOnce ( ) ; replayMocks ( ) ; assertEquals ( "Expected and generated pattern are not equal" , "TestPattern" , itsConfig.getIssuePattern ( ) . pattern ( ) ) ; }
Source:
public void upsertOneExisting ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.UPDATE , 1 ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.INSERT ) ; classUnderTest.upsert ( oneRow ) ; assertCorrectUpdating ( update , 1 ) ; com.google.gwtorm.jdbc.AbstractTestJdbcAccess.assertNotUsed ( insert ) ; }

Target:
public void upsertOneExisting ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.UPDATE , 1 ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.INSERT ) ; classUnderTest.upsert ( oneRow ) ; assertCorrectAttempting ( update , 1 ) ; com.google.gwtorm.jdbc.AbstractTestJdbcAccess.assertNotUsed ( insert ) ; }
Source:
public void noExternalIds ( ) throws java.lang.Exception { db.accountExternalIds ( ) . delete ( db.accountExternalIds ( ) . byAccount ( user.getAccountId ( ) ) ) ; reloadUser ( ) ; com.google.gerrit.gpg.testutil.TestKey key = com.google.gerrit.gpg.testutil.TestKeys.key5 ( ) ; com.google.gerrit.gpg.GerritPublicKeyChecker checker = checkerFactory.create ( user ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , ( "No identities found for user; check" + " http://test/#/settings/web-identities" ) ) ; checker = checkerFactory.create ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , "Key is not associated with any users" ) ; db.accountExternalIds ( ) . insert ( java.util.Collections.singleton ( new com.google.gerrit.reviewdb.client.AccountExternalId ( user.getAccountId ( ) , com.google.gerrit.gpg.GerritPublicKeyChecker.toExtIdKey ( key.getPublicKey ( ) ) ) ) ) ; reloadUser ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , "No identities found for user" ) ; }

Target:
public void noExternalIds ( ) throws java.lang.Exception { db.accountExternalIds ( ) . delete ( db.accountExternalIds ( ) . byAccount ( user.getAccountId ( ) ) ) ; reloadUser ( ) ; com.google.gerrit.gpg.testutil.TestKey key = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithSecondUserId ( ) ; com.google.gerrit.gpg.GerritPublicKeyChecker checker = checkerFactory.create ( user ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , ( "No identities found for user; check" + " http://test/#/settings/web-identities" ) ) ; checker = checkerFactory.create ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , "Key is not associated with any users" ) ; db.accountExternalIds ( ) . insert ( java.util.Collections.singleton ( new com.google.gerrit.reviewdb.client.AccountExternalId ( user.getAccountId ( ) , com.google.gerrit.gpg.GerritPublicKeyChecker.toExtIdKey ( key.getPublicKey ( ) ) ) ) ) ; reloadUser ( ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , "No identities found for user" ) ; }
Source:
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 ) ; }

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 ( new com.google.inject.TypeLiteral < com.google.gwtorm.client.SchemaFactory < com.google.gerrit.reviewdb.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:
protected void onLoad ( ) { super . onLoad ( ) ; display ( ) ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; com.google.gerrit.client.account.AccountCapabilities.all ( new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.account.AccountCapabilities > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.account.AccountCapabilities ac ) { if ( ac.canPerform ( com.google.gerrit.common.data.GlobalCapability.CREATE_PROJECT ) ) { display ( ) ; } else { com.google.gerrit.client.Gerrit.display ( PageLinks.ADMIN_CREATE_PROJECT , new com.google.gerrit.client.NotFoundScreen ( ) ) ; } } } , com.google.gerrit.common.data.GlobalCapability.CREATE_PROJECT ) ; }
Source:
public static void validateMy ( java.util.List < com.google.gerrit.extensions.client.MenuItem > my ) throws com.google.gerrit.extensions.restapi.BadRequestException { if ( my == null ) { return ; } for ( com.google.gerrit.extensions.client.MenuItem item : my ) { com.google.gerrit.server.account.PreferencesConfig.checkRequiredMenuItemField ( item.name , "name" ) ; com.google.gerrit.server.account.PreferencesConfig.checkRequiredMenuItemField ( item.url , "URL" ) ; } }

Target:
public static void validateMy ( java.util.List < com.google.gerrit.extensions.client.MenuItem > my ) throws com.google.gerrit.extensions.restapi.BadRequestException { if ( my == null ) { return ; } for ( com.google.gerrit.extensions.client.MenuItem item : my ) { com.google.gerrit.server.account.Preferences.checkRequiredMenuItemField ( item.name , "name" ) ; com.google.gerrit.server.account.Preferences.checkRequiredMenuItemField ( item.url , "URL" ) ; } }
Source:
public void createSyncEventsRestApiServlet ( ) throws java.lang.Exception { syncEventsRestApiServlet = new com.ericsson.gerrit.plugins.syncevents.SyncEventsRestApiServlet ( dispatcher ) ; req = createNiceMock ( javax.servlet.http.HttpServletRequest.class ) ; rsp = createNiceMock ( javax.servlet.http.HttpServletResponse.class ) ; org.easymock.EasyMock.expect ( req.getContentType ( ) ) . andReturn ( com.google.common.net.MediaType.JSON_UTF_8.toString ( ) ) ; }

Target:
public void createSyncEventsRestApiServlet ( ) throws java.lang.Exception { syncEventsRestApiServlet = new com.ericsson.gerrit.plugins.syncevents.SyncEventsRestApiServlet ( dispatcher ) ; org.mockito.Mockito.when ( req.getContentType ( ) ) . thenReturn ( com.google.common.net.MediaType.JSON_UTF_8.toString ( ) ) ; }
Source:
private void fixup ( ) { switch ( state ) { case 0 : state = 1 ; dst.scrollToY ( align ( src.getScrollInfo ( ) . getTop ( ) ) ) ; break ; case 1 : state = 2 ; break ; case 2 : active = null ; fixup.cancel ( ) ; break ; } }

Target:
private void fixup ( ) { switch ( state ) { case 0 : state = 1 ; dst.scrollToY ( align ( src.getScrollInfo ( ) . top ( ) ) ) ; break ; case 1 : state = 2 ; break ; case 2 : active = null ; fixup.cancel ( ) ; break ; } }
Source:
void display ( final com.google.gerrit.common.data.ProjectDetail result ) { project = result.project ; descTxt.setText ( project.getDescription ( ) ) ; setBool ( contributorAgreements , result.useContributorAgreements ) ; setBool ( signedOffBy , result.useSignedOffBy ) ; setBool ( contentMerge , result.useContentMerge ) ; setBool ( requireChangeID , result.requireChangeID ) ; setSubmitType ( project.getSubmitType ( ) ) ; setState ( project.getState ( ) ) ; maxObjectSizeLimit.setText ( project.getMaxObjectSizeLimit ( ) ) ; saveProject.setEnabled ( false ) ; }

Target:
void display ( final com.google.gerrit.common.data.ProjectDetail result ) { project = result.project ; descTxt.setText ( project.getDescription ( ) ) ; setBool ( contributorAgreements , result.useContributorAgreements ) ; setBool ( signedOffBy , result.useSignedOffBy ) ; setBool ( contentMerge , result.useContentMerge ) ; setBool ( requireChangeID , result.requireChangeID ) ; setSubmitType ( project.getSubmitType ( ) ) ; setState ( project.getState ( ) ) ; maxObjectSizeLimit.setText ( project.getMaxObjectSizeLimit ( ) ) ; saveProject.setEnabled ( false ) ; projectDetail = result ; }
Source:
public org.eclipse.jgit.transport.UploadPack create ( javax.servlet.http.HttpServletRequest req , org.eclipse.jgit.lib.Repository repo ) throws org.eclipse.jgit.http.server.resolver.ServiceNotEnabledException { com.google.gerrit.server.project.ProjectControl pc = com.google.gerrit.httpd.ProjectServlet.getProjectControl ( req ) ; org.eclipse.jgit.transport.UploadPack up = new org.eclipse.jgit.transport.UploadPack ( repo ) ; if ( ! ( pc.allRefsAreVisible ( ) ) ) { up.setRefFilter ( new com.google.gerrit.server.git.VisibleRefFilter ( repo , pc , db.get ( ) ) ) ; } return up ; }

Target:
public org.eclipse.jgit.transport.UploadPack create ( javax.servlet.http.HttpServletRequest req , org.eclipse.jgit.lib.Repository repo ) throws org.eclipse.jgit.http.server.resolver.ServiceNotEnabledException { com.google.gerrit.server.project.ProjectControl pc = com.google.gerrit.httpd.ProjectServlet.getProjectControl ( req ) ; org.eclipse.jgit.transport.UploadPack up = new org.eclipse.jgit.transport.UploadPack ( repo ) ; up.setPackConfig ( packConfig ) ; if ( ! ( pc.allRefsAreVisible ( ) ) ) { up.setRefFilter ( new com.google.gerrit.server.git.VisibleRefFilter ( repo , pc , db.get ( ) ) ) ; } return up ; }
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 commits , 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 , com.google.gerrit.server.util.RequestId submissionId , com.google.gerrit.extensions.api.changes.NotifyHandling notifyHandling , com.google.gerrit.server.git.SubmoduleOp submoduleOp ) ;

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 commits , 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 , com.google.gerrit.server.util.RequestId submissionId , com.google.gerrit.extensions.api.changes.NotifyHandling notifyHandling , com.google.gerrit.server.git.SubmoduleOp submoduleOp , boolean dryrun ) ;
Source:
public void testUnblockInParentBlockInLocal ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.ProjectControl d = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't push" , d.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }

Target:
public void testUnblockInParentBlockInLocal ( ) { com.google.gerrit.server.project.Util.block ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl d = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't push" , d.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }
Source:
public void onFailure ( java.lang.Throwable caught ) { if ( failed ) { return ; } failed = true ; failedThrowable = caught ; for ( com.google.gerrit.client.rpc.CallbackGroup.CallbackImpl < ? > cb : callbacks ) { cb.delegate.onFailure ( failedThrowable ) ; cb.delegate = null ; cb.result = null ; } callbacks.clear ( ) ; remaining.clear ( ) ; }

Target:
public void onFailure ( java.lang.Throwable caught ) { if ( ! ( failed ) ) { failed = true ; failedThrowable = caught ; } remaining.remove ( this ) ; this . applyAllFailed ( ) ; }
Source:
private java.util.List < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > scopesForKey ( java.lang.String baseScopeKey ) { return com.google.common.base.Objects.firstNonNull ( config.scopes.get ( baseScopeKey ) , com.googlesource.gerrit.plugins.github.oauth.GitHubLogin.DEFAULT_SCOPES ) ; }

Target:
private java.util.SortedSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > getScopes ( java.lang.String baseScopeKey , com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope ... scopes ) { java.util.HashSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > fullScopes = ( ( oAuthCookie ) == null ) ? new java.util.HashSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > ( config.scopes.get ( baseScopeKey ) ) : new java.util.HashSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > ( oAuthCookie.scopes ) ; fullScopes.addAll ( java.util.Arrays.asList ( scopes ) ) ; return new java.util.TreeSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > ( fullScopes ) ; }
Source:
private java.util.List < com.google.gerrit.server.data.ChangeAttribute > executeSuccessfulQuery ( java.lang.String params ) throws java.lang.Exception { java.lang.String rawResponse = sshSession.exec ( ( "gerrit query --format=JSON " + params ) ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( sshSession.getError ( ) ) . that ( sshSession.hasError ( ) ) . isFalse ( ) ; return com.google.gerrit.acceptance.ssh.QueryIT.getChanges ( rawResponse ) ; }

Target:
private java.util.List < com.google.gerrit.server.data.ChangeAttribute > executeSuccessfulQuery ( java.lang.String params ) throws java.lang.Exception { java.lang.String rawResponse = adminSshSession.exec ( ( "gerrit query --format=JSON " + params ) ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( adminSshSession.getError ( ) ) . that ( adminSshSession.hasError ( ) ) . isFalse ( ) ; return com.google.gerrit.acceptance.ssh.QueryIT.getChanges ( rawResponse ) ; }
Source:
public void delete ( ) throws java.lang.Exception { for ( com.google.gerrit.acceptance.rest.project.PushTagIT.TagType tagType : com.google.gerrit.acceptance.rest.project.PushTagIT.TagType.values ( ) ) { allowTagCreation ( tagType ) ; java.lang.String tagRef = pushTagForExistingCommit ( tagType , Status.OK ) ; pushTagDeletion ( tagType , tagRef , Status.REJECTED_OTHER_REASON ) ; allowFastForwardTagUpdate ( ) ; pushTagDeletion ( tagType , tagRef , Status.REJECTED_OTHER_REASON ) ; } allowTagDeletion ( ) ; for ( com.google.gerrit.acceptance.rest.project.PushTagIT.TagType tagType : com.google.gerrit.acceptance.rest.project.PushTagIT.TagType.values ( ) ) { java.lang.String tagRef = pushTagForExistingCommit ( tagType , Status.OK ) ; pushTagDeletion ( tagType , tagRef , Status.OK ) ; } }

Target:
public void createTagForExistingCommit ( ) throws java.lang.Exception { for ( com.google.gerrit.acceptance.rest.project.PushTagIT.TagType tagType : com.google.gerrit.acceptance.rest.project.PushTagIT.TagType.values ( ) ) { pushTagForExistingCommit ( tagType , Status.REJECTED_OTHER_REASON ) ; allowTagCreation ( tagType ) ; pushTagForExistingCommit ( tagType , Status.OK ) ; allowPushOnRefsTags ( ) ; pushTagForExistingCommit ( tagType , Status.OK ) ; removePushFromRefsTags ( ) ; } }
Source:
public void usernamePatternWithRegex ( ) { com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "^refs/sb/${username}/heads/.*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , "d.v" , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = user ( local , "dev" , com.google.gerrit.server.project.Util.DEVS ) ; assertCannotRead ( "refs/sb/dev/heads/foobar" , u ) ; assertCanRead ( "refs/sb/dev/heads/foobar" , d ) ; }

Target:
public void usernamePatternWithRegex ( ) { com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.testing.Util.DEVS , "^refs/sb/${username}/heads/.*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , "d.v" , com.google.gerrit.server.project.testing.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = user ( local , "dev" , com.google.gerrit.server.project.testing.Util.DEVS ) ; assertCannotRead ( "refs/sb/dev/heads/foobar" , u ) ; assertCanRead ( "refs/sb/dev/heads/foobar" , d ) ; }
Source:
public java.lang.Iterable < com.google.gerrit.extensions.common.WebLinkInfo > getPatchLinks ( java.lang.String project , java.lang.String revision , java.lang.String file ) { java.util.List < com.google.gerrit.extensions.common.WebLinkInfo > links = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.extensions.webui.FileWebLink webLink : fileLinks ) { links.add ( new com.google.gerrit.extensions.common.WebLinkInfo ( webLink.getLinkName ( ) , webLink.getImageUrl ( ) , webLink.getFileUrl ( project , revision , file ) , webLink.getTarget ( ) ) ) ; } return links ; }

Target:
public java.lang.Iterable < com.google.gerrit.extensions.common.WebLinkInfo > getFileLinks ( java.lang.String project , java.lang.String revision , java.lang.String file ) { java.util.List < com.google.gerrit.extensions.common.WebLinkInfo > links = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.extensions.webui.FileWebLink webLink : fileLinks ) { links.add ( new com.google.gerrit.extensions.common.WebLinkInfo ( webLink.getLinkName ( ) , webLink.getImageUrl ( ) , webLink.getFileUrl ( project , revision , file ) , webLink.getTarget ( ) ) ) ; } return links ; }
Source:
public java.lang.Iterable < com.google.gerrit.prettify.common.EditList.Hunk > getHunks ( ) { int ctx = settings.getContext ( ) ; if ( ctx == ( 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.lang.Iterable < com.google.gerrit.prettify.common.EditList.Hunk > getHunks ( ) { int ctx = settings.getContext ( ) ; if ( ctx == ( com.google.gerrit.reviewdb.AccountGeneralPreferences.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 ( ) ; }
Source:
public java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > apply ( com.google.gerrit.server.change.ChangeResource rsrc ) throws com.google.gerrit.extensions.restapi.BadRequestException , com.google.gwtorm.server.OrmException , java.io.IOException { return reviewersUtil.suggestReviewers ( rsrc.getNotes ( ) , this , rsrc.getControl ( ) . getProjectControl ( ) , getVisibility ( rsrc ) , excludeGroups ) ; }

Target:
public java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > apply ( com.google.gerrit.server.change.ChangeResource rsrc ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gwtorm.server.OrmException , java.io.IOException { if ( ! ( self.get ( ) . isIdentifiedUser ( ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Authentication required" ) ; } return reviewersUtil.suggestReviewers ( rsrc.getNotes ( ) , this , rsrc.getControl ( ) . getProjectControl ( ) , getVisibility ( rsrc ) , excludeGroups ) ; }
Source:
public void submitWithErrorMessage ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.setSubject ( "Submit patch set 1" ) ; update.merge ( com.google.common.collect.ImmutableList.of ( submitRecord ( "RULE_ERROR" , "Problem with patch set:\n1" ) ) ) ; update.commit ( ) ; assertBodyEquals ( ( "Submit patch set 1\n" + ( ( ( "\n" + "Patch-set: 1\n" ) + "Status: merged\n" ) + "Submitted-with: RULE_ERROR Problem with patch set: 1\n" ) ) , update.getRevision ( ) ) ; }

Target:
public void submitWithErrorMessage ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.setSubject ( "Submit patch set 1" ) ; update.merge ( "1-1453387607626-96fabc25" , com.google.common.collect.ImmutableList.of ( submitRecord ( "RULE_ERROR" , "Problem with patch set:\n1" ) ) ) ; update.commit ( ) ; assertBodyEquals ( ( "Submit patch set 1\n" + ( ( ( ( "\n" + "Patch-set: 1\n" ) + "Status: merged\n" ) + "Submission-id: 1-1453387607626-96fabc25\n" ) + "Submitted-with: RULE_ERROR Problem with patch set: 1\n" ) ) , update.getRevision ( ) ) ; }
Source:
protected static java.util.List < com.google.gerrit.reviewdb.client.Comment > defaultComments ( ) { java.util.List < com.google.gerrit.reviewdb.client.Comment > comments = new java.util.ArrayList < > ( ) ; comments.add ( com.google.gerrit.server.mail.receive.AbstractParserTest.newComment ( "c1" , "gerrit-server/test.txt" , "comment" , 0 ) ) ; comments.add ( com.google.gerrit.server.mail.receive.AbstractParserTest.newComment ( "c2" , "gerrit-server/test.txt" , "comment" , 2 ) ) ; comments.add ( com.google.gerrit.server.mail.receive.AbstractParserTest.newComment ( "c3" , "gerrit-server/test.txt" , "comment" , 3 ) ) ; comments.add ( com.google.gerrit.server.mail.receive.AbstractParserTest.newComment ( "c4" , "gerrit-server/readme.txt" , "comment" , 3 ) ) ; return comments ; }

Target:
protected static java.util.List < com.google.gerrit.reviewdb.client.Comment > defaultComments ( ) { java.util.List < com.google.gerrit.reviewdb.client.Comment > comments = new java.util.ArrayList < > ( ) ; comments.add ( com.google.gerrit.server.mail.receive.AbstractParserTest.newComment ( "c1" , "gerrit-server/test.txt" , "comment" , 0 ) ) ; comments.add ( com.google.gerrit.server.mail.receive.AbstractParserTest.newComment ( "c2" , "gerrit-server/test.txt" , "comment" , 2 ) ) ; comments.add ( com.google.gerrit.server.mail.receive.AbstractParserTest.newComment ( "c3" , "gerrit-server/test.txt" , "comment" , 3 ) ) ; comments.add ( com.google.gerrit.server.mail.receive.AbstractParserTest.newRangeComment ( "c4" , "gerrit-server/readme.txt" , "comment" , 3 ) ) ; return comments ; }
Source:
public void defaultGpgCertificationMatchesEmail ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key = com.google.gerrit.gpg.testutil.TestKeys.key5 ( ) ; com.google.gerrit.gpg.GerritPublicKeyChecker checker = checkerFactory.create ( user ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , ( "Key must contain a valid certification for one of the following " + ( ( "identities:\n" + " gerrit:user\n" ) + " username:user" ) ) ) ; addExternalId ( "test" , "test" , "test5@example.com" ) ; checker = checkerFactory.create ( user ) ; assertNoProblems ( checker.check ( key.getPublicKey ( ) ) ) ; }

Target:
public void defaultGpgCertificationMatchesEmail ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithSecondUserId ( ) ; com.google.gerrit.gpg.GerritPublicKeyChecker checker = checkerFactory.create ( user ) ; assertProblems ( checker.check ( key.getPublicKey ( ) ) , Status.BAD , ( "Key must contain a valid certification for one of the following " + ( ( "identities:\n" + " gerrit:user\n" ) + " username:user" ) ) ) ; addExternalId ( "test" , "test" , "test5@example.com" ) ; checker = checkerFactory.create ( user ) ; assertNoProblems ( checker.check ( key.getPublicKey ( ) ) ) ; }
Source:
private static java.lang.String hashOf ( java.lang.String data ) { try { java.security.MessageDigest hash = java.security.MessageDigest.getInstance ( "MD5" ) ; byte [ ] bytes = hash.digest ( data.getBytes ( com.google.common.base.Charsets.UTF_8 ) ) ; return org.apache.commons.codec.binary.Base64.encodeBase64URLSafeString ( bytes ) ; } catch ( java.security.NoSuchAlgorithmException e ) { throw new java.lang.RuntimeException ( "No MD5 available" , e ) ; } }

Target:
private static java.lang.String hashOf ( java.lang.String data ) { try { java.security.MessageDigest hash = java.security.MessageDigest.getInstance ( "MD5" ) ; byte [ ] bytes = hash.digest ( data.getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ; return org.apache.commons.codec.binary.Base64.encodeBase64URLSafeString ( bytes ) ; } catch ( java.security.NoSuchAlgorithmException e ) { throw new java.lang.RuntimeException ( "No MD5 available" , e ) ; } }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { setReviewedByCurrentUser ( true ) ; }

Target:
public void onSuccess ( com.google.gerrit.common.data.PatchSetDetail result ) { patchSetDetail = result ; if ( ( fileList ) == null ) { fileList = new com.google.gerrit.client.changes.PatchTable ( prefs ) ; fileList.display ( idSideA , result ) ; patchIndex = fileList.indexOf ( patchKey ) ; } refresh ( true ) ; }
Source:
public void mergeReview ( java.lang.String project , int changeNumber ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { final com.google.gerrit.extensions.api.changes.SubmitInput input = new com.google.gerrit.extensions.api.changes.SubmitInput ( ) ; input.waitForMerge = true ; final com.google.gerrit.server.change.RevisionResource r = getRevisionResource ( project , changeNumber ) ; submitter.apply ( r , input ) ; BRANCH ( f1d0f4 ) ; com.criteo.gerrit.plugins.automerge.Format all ; files ( ( ( ( google ) - ( java ) ) - ( format ) ) ) ; }

Target:
public void mergeReview ( java.lang.String project , int number ) throws java.lang.Exception { submitter.apply ( getRevisionResource ( project , number ) , new com.google.gerrit.extensions.api.changes.SubmitInput ( ) ) ; }
Source:
public void onPreReceive ( final org.spearce.jgit.transport.ReceivePack arg0 , final java.util.Collection < org.spearce.jgit.transport.ReceiveCommand > commands ) { parseCommands ( commands ) ; createNewChanges ( ) ; appendPatchSets ( ) ; }

Target:
public void onPreReceive ( final org.spearce.jgit.transport.ReceivePack arg0 , final java.util.Collection < org.spearce.jgit.transport.ReceiveCommand > commands ) { parseCommands ( commands ) ; if ( ( ( newChange ) != null ) && ( ( newChange.getResult ( ) ) == ( org.spearce.jgit.transport.ReceiveCommand.Result.NOT_ATTEMPTED ) ) ) { createNewChanges ( ) ; } appendPatchSets ( ) ; }
Source:
private com.google.gwt.http.client.RequestBuilder request ( com.google.gwt.http.client.RequestBuilder.Method method ) { com.google.gwt.http.client.RequestBuilder req = new com.google.gwt.http.client.RequestBuilder ( method , url ( ) ) ; if ( ( ifNoneMatch ) != null ) { req.setHeader ( "If-None-Match" , ifNoneMatch ) ; } req.setHeader ( "Accept" , com.google.gerrit.client.rpc.RestApi.JSON_TYPE ) ; if ( ( com.google.gerrit.client.Gerrit.getXGerritAuth ( ) ) != null ) { req.setHeader ( "X-Gerrit-Auth" , com.google.gerrit.client.Gerrit.getXGerritAuth ( ) ) ; } return req ; }

Target:
private com.google.gwt.http.client.RequestBuilder request ( com.google.gwt.http.client.RequestBuilder.Method method ) { com.google.gwt.http.client.RequestBuilder req = new com.google.gwt.http.client.RequestBuilder ( method , url ( ) ) ; if ( ( ifNoneMatch ) != null ) { req.setHeader ( "If-None-Match" , ifNoneMatch ) ; } req.setHeader ( "Accept" , com.google.gerrit.client.rpc.RestApi.JSON_TYPE ) ; if ( ( com.google.gerrit.client.Gerrit.getXGerritAuth ( ) ) != null ) { req.setHeader ( HostPageData.XSRF_HEADER_NAME , com.google.gerrit.client.Gerrit.getXGerritAuth ( ) ) ; } return req ; }
Source:
static com.google.gerrit.server.project.ProjectControl getProjectControl ( javax.servlet.http.HttpServletRequest req ) throws org.eclipse.jgit.http.server.resolver.ServiceNotEnabledException { com.google.gerrit.server.project.ProjectControl pc = ( ( com.google.gerrit.server.project.ProjectControl ) ( req.getAttribute ( com.google.gerrit.httpd.ProjectServlet.ATT_CONTROL ) ) ) ; if ( pc == null ) { com.google.gerrit.httpd.ProjectServlet.log.error ( ( ( "No " + ( com.google.gerrit.httpd.ProjectServlet.ATT_CONTROL ) ) + " in request" ) , new java.lang.Exception ( "here" ) ) ; throw new org.eclipse.jgit.http.server.resolver.ServiceNotEnabledException ( ) ; } return pc ; }

Target:
static com.google.gerrit.server.project.ProjectControl getProjectControl ( javax.servlet.http.HttpServletRequest req ) throws org.eclipse.jgit.transport.resolver.ServiceNotEnabledException { com.google.gerrit.server.project.ProjectControl pc = ( ( com.google.gerrit.server.project.ProjectControl ) ( req.getAttribute ( com.google.gerrit.httpd.ProjectServlet.ATT_CONTROL ) ) ) ; if ( pc == null ) { com.google.gerrit.httpd.ProjectServlet.log.error ( ( ( "No " + ( com.google.gerrit.httpd.ProjectServlet.ATT_CONTROL ) ) + " in request" ) , new java.lang.Exception ( "here" ) ) ; throw new org.eclipse.jgit.transport.resolver.ServiceNotEnabledException ( ) ; } return pc ; }
Source:
public com.google.gerrit.server.guice.RegistrationHandle register ( final com.google.gerrit.sshd.CommandName name , final com.google.inject.Provider < org.apache.sshd.server.Command > cmd ) { final java.util.concurrent.ConcurrentMap < java.lang.String , com.google.inject.Provider < org.apache.sshd.server.Command > > m = getMap ( ) ; if ( ( m.putIfAbsent ( name.value ( ) , cmd ) ) != null ) { throw new java.lang.IllegalArgumentException ( ( ( name.value ( ) ) + " exists" ) ) ; } return new com.google.gerrit.server.guice.RegistrationHandle ( ) { @ java.lang.Override public void remove ( ) { m.remove ( name.value ( ) , cmd ) ; } } ; }

Target:
public com.google.gerrit.server.plugins.RegistrationHandle register ( final com.google.gerrit.sshd.CommandName name , final com.google.inject.Provider < org.apache.sshd.server.Command > cmd ) { final java.util.concurrent.ConcurrentMap < java.lang.String , com.google.inject.Provider < org.apache.sshd.server.Command > > m = getMap ( ) ; if ( ( m.putIfAbsent ( name.value ( ) , cmd ) ) != null ) { throw new java.lang.IllegalArgumentException ( ( ( name.value ( ) ) + " exists" ) ) ; } return new com.google.gerrit.server.plugins.RegistrationHandle ( ) { @ java.lang.Override public void remove ( ) { m.remove ( name.value ( ) , cmd ) ; } } ; }
Source:
private com.google.gerrit.reviewdb.client.PatchSet updateDraftPatchSet ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { return dbProvider.get ( ) . patchSets ( ) . atomicUpdate ( rsrc.getPatchSet ( ) . getId ( ) , new com.google.gwtorm.server.AtomicUpdate < com.google.gerrit.reviewdb.client.PatchSet > ( ) { @ java.lang.Override public com.google.gerrit.reviewdb.client.PatchSet update ( com.google.gerrit.reviewdb.client.PatchSet patchset ) { patchset.setDraft ( false ) ; return patchset ; } } ) ; }

Target:
private void sendCreateChange ( com.google.gerrit.server.git.BatchUpdate.Context ctx ) throws com.google.gerrit.common.errors.EmailException { com.google.gerrit.server.mail.CreateChangeSender cm = createChangeSenderFactory.create ( change.getId ( ) ) ; cm.setFrom ( ctx.getUser ( ) . getAccountId ( ) ) ; cm.setPatchSet ( patchSet , patchSetInfo ) ; cm.addReviewers ( recipients.getReviewers ( ) ) ; cm.addExtraCC ( recipients.getCcOnly ( ) ) ; cm.send ( ) ; }
Source:
private java.lang.String getCommentLinePrefix ( com.google.gerrit.reviewdb.client.Comment comment ) { int lineNbr = ( ( comment.range ) == null ) ? comment.lineNbr : comment.range.startLine ; return ( ( ( "PS" + ( comment.key.patchSetId ) ) + ", Line " ) + lineNbr ) + ": " ; }

Target:
private java.lang.String getCommentLinePrefix ( com.google.gerrit.reviewdb.client.Comment comment ) { int lineNbr = ( ( comment.range ) == null ) ? comment.lineNbr : comment.range.startLine ; java.lang.StringBuilder sb = new java.lang.StringBuilder ( ) ; sb.append ( "PS" ) . append ( comment.key.patchSetId ) ; if ( lineNbr != 0 ) { sb.append ( ", Line " ) . append ( lineNbr ) ; } sb.append ( ": " ) ; return sb.toString ( ) ; }
Source:
public void onLoad ( ) { if ( ( members ) == null ) { initUI ( ) ; } enableForm ( false ) ; saveDesc.setEnabled ( false ) ; super . onLoad ( ) ; Util.GROUP_SVC.groupDetail ( groupId , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.admin.AccountGroupDetail > ( ) { public void onSuccess ( final com.google.gerrit.client.admin.AccountGroupDetail result ) { enableForm ( true ) ; saveDesc.setEnabled ( false ) ; display ( result ) ; } } ) ; }

Target:
public void onLoad ( ) { if ( ( members ) == null ) { initUI ( ) ; } enableForm ( false ) ; saveName.setEnabled ( false ) ; saveDesc.setEnabled ( false ) ; super . onLoad ( ) ; Util.GROUP_SVC.groupDetail ( groupId , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.admin.AccountGroupDetail > ( ) { public void onSuccess ( final com.google.gerrit.client.admin.AccountGroupDetail result ) { enableForm ( true ) ; saveName.setEnabled ( false ) ; saveDesc.setEnabled ( false ) ; display ( result ) ; } } ) ; }
Source:
public static com.google.common.cache.CacheBuilder < java.lang.Object , java.lang.Object > newBuilder ( ) { return com.google.common.cache.CacheBuilder.newBuilder ( ) . maximumWeight ( ( 10 << 10 ) ) ; }

Target:
public static com.google.common.cache.CacheBuilder < com.google.gitiles.BlameCacheImpl.Key , java.util.List < com.google.gitiles.Region > > newBuilder ( ) { return com.google.common.cache.CacheBuilder.newBuilder ( ) . weigher ( new com.google.common.cache.Weigher < com.google.gitiles.BlameCacheImpl.Key , java.util.List < com.google.gitiles.BlameCache.Region > > ( ) { @ java.lang.Override public int weigh ( com.google.gitiles.BlameCacheImpl.Key key , java.util.List < com.google.gitiles.BlameCache.Region > value ) { return value.size ( ) ; } } ) . maximumWeight ( ( 10 << 10 ) ) ; }
Source:
public java.lang.String getPluginName ( java.nio.file.Path srcPath ) { try { return com.google.common.base.MoreObjects.firstNonNull ( com.google.gerrit.server.plugins.JarPluginProvider.getJarPluginName ( srcPath ) , com.google.gerrit.server.plugins.PluginLoader.nameOf ( srcPath ) ) ; } catch ( java.io.IOException e ) { throw new java.lang.IllegalArgumentException ( ( ( "Invalid plugin file " + srcPath ) + ": cannot get plugin name" ) , e ) ; } }

Target:
public java.lang.String getPluginName ( java.nio.file.Path srcPath ) { try { return com.google.common.base.MoreObjects.firstNonNull ( com.google.gerrit.server.plugins.JarPluginProvider.getJarPluginName ( srcPath ) , com.google.gerrit.server.plugins.PluginUtil.nameOf ( srcPath ) ) ; } catch ( java.io.IOException e ) { throw new java.lang.IllegalArgumentException ( ( ( "Invalid plugin file " + srcPath ) + ": cannot get plugin name" ) , e ) ; } }
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 ) ) ; com.google.gerrit.reviewdb.client.Change change2 = insert ( newChange ( repo2 ) ) ; assertQuery ( "project:foo" ) ; assertQuery ( "project:repo" ) ; assertQuery ( "project:repo1" , change1 ) ; assertQuery ( "project:repo2" , change2 ) ; }

Target:
public void byOwnerIn ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change1 = insert ( repo , newChange ( repo ) , userId ) ; com.google.gerrit.reviewdb.client.Account.Id user2 = accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "anotheruser" ) ) . getAccountId ( ) ; com.google.gerrit.reviewdb.client.Change change2 = insert ( repo , newChange ( repo ) , user2 ) ; assertQuery ( "ownerin:Administrators" , change1 ) ; assertQuery ( "ownerin:\"Registered Users\"" , change2 , change1 ) ; }
Source:
private void sendResource ( java.util.jar.JarFile jar , java.util.jar.JarEntry entry , javax.servlet.http.HttpServletResponse res , java.lang.String pluginName ) throws java.io.IOException { sendResource ( jar , entry , res , pluginName , false ) ; }

Target:
private static java.lang.String extractTitleFromMarkdown ( java.util.jar.JarFile jar , java.util.jar.JarEntry entry ) throws java.io.IOException { java.lang.String charEnc = null ; java.util.jar.Attributes atts = entry.getAttributes ( ) ; if ( atts != null ) { charEnc = com.google.common.base.Strings.emptyToNull ( atts.getValue ( "Character-Encoding" ) ) ; } if ( charEnc == null ) { charEnc = "UTF-8" ; } return new com.google.gerrit.server.documentation.MarkdownFormatter ( ) . extractTitleFromMarkdown ( com.google.gerrit.httpd.plugins.HttpPluginServlet.readWholeEntry ( jar , entry ) , charEnc ) ; }
Source:
public void run ( ) { cache.prune ( cleanup ) ; }

Target:
public void start ( ) { if ( ( executor ) != null ) { for ( final com.google.gerrit.server.cache.h2.H2CacheImpl < ? , ? > cache : caches ) { executor.execute ( cache :: start ) ; cleanup.schedule ( ( ) -> cache.prune ( cleanup ) , 30 , java.util.concurrent.TimeUnit.SECONDS ) ; } } }
Source:
public java.lang.String toString ( ) { return name ; }

Target:
public java.lang.String toString ( ) { if ( ( fullName ) != null ) { return fullName ; } com.google.gerrit.server.CurrentUser who = user.get ( ) ; if ( who.isIdentifiedUser ( ) ) { java.lang.String username = who.asIdentifiedUser ( ) . getUserName ( ) ; if ( ( username != null ) && ( ! ( username.isEmpty ( ) ) ) ) { fullName = ( ( ( name ) + " (" ) + username ) + ")" ; return fullName ; } } return name ; }
Source:
public void set ( ) throws java.lang.Exception { com.google.gerrit.server.account.PutUsername.Input in = new com.google.gerrit.server.account.PutUsername.Input ( ) ; in.username = "myUsername" ; com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( ( "/accounts/" + ( createUser ( ) . get ( ) ) ) + "/username" ) , in ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; com.google.common.truth.Truth.assertThat ( newGson ( ) . fromJson ( r.getReader ( ) , java.lang.String.class ) ) . isEqualTo ( in.username ) ; }

Target:
public void set ( ) throws java.lang.Exception { com.google.gerrit.server.account.PutUsername.Input in = new com.google.gerrit.server.account.PutUsername.Input ( ) ; in.username = "myUsername" ; com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( ( "/accounts/" + ( createUser ( ) . get ( ) ) ) + "/username" ) , in ) ; r.assertOK ( ) ; com.google.common.truth.Truth.assertThat ( newGson ( ) . fromJson ( r.getReader ( ) , java.lang.String.class ) ) . isEqualTo ( in.username ) ; }
Source:
public void onSuccess ( final java.util.List < com.google.gerrit.common.data.GroupReference > result ) { priorResults.clear ( ) ; final java.util.ArrayList < com.google.gerrit.client.ui.AccountGroupSuggestOracle.AccountGroupSuggestion > r = new java.util.ArrayList ( result.size ( ) ) ; for ( final com.google.gerrit.common.data.GroupReference p : result ) { r.add ( new com.google.gerrit.client.ui.AccountGroupSuggestOracle.AccountGroupSuggestion ( p ) ) ; priorResults.put ( p.getName ( ) , p.getUUID ( ) ) ; } callback.onSuggestionsReady ( req , new com.google.gerrit.client.ui.Response ( r ) ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.groups.GroupMap result ) { priorResults.clear ( ) ; java.util.ArrayList < com.google.gerrit.client.ui.AccountGroupSuggestOracle.AccountGroupSuggestion > r = new java.util.ArrayList ( result.size ( ) ) ; for ( com.google.gerrit.client.groups.GroupInfo group : com.google.gerrit.client.rpc.Natives.asList ( result.values ( ) ) ) { r.add ( new com.google.gerrit.client.ui.AccountGroupSuggestOracle.AccountGroupSuggestion ( group ) ) ; priorResults.put ( group.name ( ) , group.getGroupUUID ( ) ) ; } callback.onSuggestionsReady ( req , new com.google.gerrit.client.ui.Response ( r ) ) ; }
Source:
private void assertUnchangedMessage ( com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > edit , java.lang.String message ) throws java.lang.Exception { exception.expect ( com.google.gerrit.server.edit.UnchangedCommitMessageException.class ) ; exception.expectMessage ( "New commit message cannot be same as existing commit message" ) ; modifier.modifyMessage ( edit.get ( ) , message ) ; }

Target:
public void updateMessageOnlyAddTrailingNewLines ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( modifier.createEdit ( change , getCurrentPatchSet ( changeId ) ) ) . isEqualTo ( RefUpdate.Result.NEW ) ; com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editUtil.byChange ( change ) ; exception.expect ( com.google.gerrit.server.edit.UnchangedCommitMessageException.class ) ; exception.expectMessage ( "New commit message cannot be same as existing commit message" ) ; modifier.modifyMessage ( edit.get ( ) , ( ( edit.get ( ) . getEditCommit ( ) . getFullMessage ( ) ) + "\n\n" ) ) ; }
Source:
private boolean isRefDeleted ( com.googlesource.gerrit.plugins.refprotection.Event event ) { if ( event.getNewObjectId ( ) . equals ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) . getName ( ) ) ) { com.googlesource.gerrit.plugins.refprotection.RefUpdateListener.log.info ( java.lang.String.format ( "Ref Deleted: project [%s] refname [%s] old object id [%s]" , event.getProjectName ( ) , event.getRefName ( ) , event.getOldObjectId ( ) ) ) ; return true ; } return false ; }

Target:
private boolean isNewRef ( com.google.gerrit.server.events.RefUpdatedEvent event ) { return event.refUpdate.oldRev.equals ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) . getName ( ) ) ; }
Source:
public java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > getOwners ( ) { com.google.gerrit.reviewdb.client.Project.NameKey parentName = getProject ( ) . getParent ( ) ; if ( ( ( ! ( localOwners.isEmpty ( ) ) ) || ( parentName == null ) ) || ( isAllProjects ) ) { return localOwners ; } com.google.gerrit.server.project.ProjectState parent = projectCache.get ( parentName ) ; if ( parent != null ) { return parent.getOwners ( ) ; } return java.util.Collections.emptySet ( ) ; }

Target:
public java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > getOwners ( ) { for ( com.google.gerrit.server.project.ProjectState p : tree ( ) ) { if ( ! ( p.localOwners.isEmpty ( ) ) ) { return p.localOwners ; } } return java.util.Collections.emptySet ( ) ; }
Source:
static java.util.Map < java.lang.String , java.lang.String > toSoyData ( org.eclipse.jgit.lib.PersonIdent ident , org.eclipse.jgit.util.GitDateFormatter dateFormatter ) { return com.google.common.collect.ImmutableMap.of ( "name" , ident.getName ( ) , "email" , ident.getEmailAddress ( ) , "time" , dateFormatter.formatDate ( ident ) , "relativeTime" , org.eclipse.jgit.util.RelativeDateFormatter.format ( ident.getWhen ( ) ) ) ; }

Target:
static java.util.Map < java.lang.String , java.lang.String > toSoyData ( org.eclipse.jgit.lib.PersonIdent ident , org.eclipse.jgit.util.GitDateFormatter df ) { return com.google.common.collect.ImmutableMap.of ( "name" , ident.getName ( ) , "email" , ident.getEmailAddress ( ) , "time" , df.formatDate ( ident ) , "relativeTime" , org.eclipse.jgit.util.RelativeDateFormatter.format ( ident.getWhen ( ) ) ) ; }