auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void flush ( ) { }

Target:
public static java.lang.String messageUUID ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { int p ; int s ; synchronized ( com.google.gerrit.server.ChangeUtil.uuidLock ) { if ( ( com.google.gerrit.server.ChangeUtil.uuidSeq ) == 0 ) { com.google.gerrit.server.ChangeUtil.uuidPrefix = db.nextChangeMessageId ( ) ; com.google.gerrit.server.ChangeUtil.uuidSeq = java.lang.Integer.MAX_VALUE ; } p = com.google.gerrit.server.ChangeUtil.uuidPrefix ; s = ( com.google.gerrit.server.ChangeUtil.uuidSeq ) -- ; } java.lang.String u = com.google.gerrit.server.util.IdGenerator.format ( com.google.gerrit.server.util.IdGenerator.mix ( com.google.gerrit.server.ChangeUtil.SEED , p ) ) ; java.lang.String l = com.google.gerrit.server.util.IdGenerator.format ( com.google.gerrit.server.util.IdGenerator.mix ( p , s ) ) ; return ( u + '_' ) + l ; }
Source:
private Account.Id parseIdent ( org.eclipse.jgit.revwalk.RevCommit commit ) throws org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.lib.PersonIdent a = commit.getAuthorIdent ( ) ; org.eclipse.jgit.lib.PersonIdent c = commit.getCommitterIdent ( ) ; if ( ( a.getName ( ) . equals ( c.getName ( ) ) ) && ( a.getEmailAddress ( ) . equals ( c.getEmailAddress ( ) ) ) ) { return null ; } return parseIdent ( commit.getAuthorIdent ( ) ) ; }

Target:
private Account.Id parseIdent ( org.eclipse.jgit.revwalk.RevCommit commit ) throws org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.lib.PersonIdent a = commit.getAuthorIdent ( ) ; org.eclipse.jgit.lib.PersonIdent c = commit.getCommitterIdent ( ) ; if ( ( a.getName ( ) . equals ( c.getName ( ) ) ) && ( a.getEmailAddress ( ) . equals ( c.getEmailAddress ( ) ) ) ) { return null ; } return changeNoteUtil.parseIdent ( commit.getAuthorIdent ( ) , id ) ; }
Source:
private static void assertVerification ( com.googlesource.gerrit.plugins.verifystatus.common.VerificationInfo r , com.googlesource.gerrit.plugins.verifystatus.common.VerificationInfo e ) { com.google.common.truth.Truth.assertThat ( r.value ) . isEqualTo ( e.value ) ; com.google.common.truth.Truth.assertThat ( r.reporter ) . isEqualTo ( e.reporter ) ; com.google.common.truth.Truth.assertThat ( r.comment ) . isEqualTo ( e.comment ) ; com.google.common.truth.Truth.assertThat ( r.url ) . isEqualTo ( e.url ) ; com.google.common.truth.Truth.assertThat ( r.category ) . isEqualTo ( e.category ) ; com.google.common.truth.Truth.assertThat ( r.duration ) . isEqualTo ( e.duration ) ; }

Target:
private static void assertVerification ( com.googlesource.gerrit.plugins.verifystatus.common.VerificationInfo r , com.googlesource.gerrit.plugins.verifystatus.common.VerificationInfo e ) { com.google.common.truth.Truth.assertThat ( r.value ) . isEqualTo ( e.value ) ; com.google.common.truth.Truth.assertThat ( r.reporter ) . isEqualTo ( e.reporter ) ; com.google.common.truth.Truth.assertThat ( r.comment ) . isEqualTo ( e.comment ) ; com.google.common.truth.Truth.assertThat ( r.url ) . isEqualTo ( e.url ) ; com.google.common.truth.Truth.assertThat ( r.category ) . isEqualTo ( e.category ) ; com.google.common.truth.Truth.assertThat ( r.duration ) . isEqualTo ( e.duration ) ; com.google.common.truth.Truth.assertThat ( r.rerun ) . isEqualTo ( e.rerun ) ; }
Source:
private < T extends com.google.gwt.core.client.JavaScriptObject > void send ( com.google.gwt.http.client.RequestBuilder.Method method , com.google.gwt.user.client.rpc.AsyncCallback < T > cb ) { com.google.gerrit.client.rpc.RestApi.HttpCallback < T > httpCallback = new com.google.gerrit.client.rpc.RestApi.HttpCallback < T > ( cb ) ; try { RpcStatus.INSTANCE.onRpcStart ( ) ; request ( method ) . sendRequest ( null , httpCallback ) ; } catch ( com.google.gwt.http.client.RequestException e ) { httpCallback.onError ( null , e ) ; } }

Target:
private < T extends com.google.gwt.core.client.JavaScriptObject > void send ( com.google.gwt.http.client.RequestBuilder.Method method , com.google.gwt.user.client.rpc.AsyncCallback < T > cb ) { com.google.gerrit.client.rpc.RestApi.HttpCallback < T > httpCallback = new com.google.gerrit.client.rpc.RestApi.HttpCallback < T > ( background , cb ) ; try { if ( ! ( background ) ) { RpcStatus.INSTANCE.onRpcStart ( ) ; } request ( method ) . sendRequest ( null , httpCallback ) ; } catch ( com.google.gwt.http.client.RequestException e ) { httpCallback.onError ( null , e ) ; } }
Source:
private void assertParseNotifyValue ( java.lang.String notifyValue , java.lang.String expectedFilter , java.util.Set < com.google.gerrit.server.account.WatchConfig.NotifyType > expectedNotifyTypes ) { com.google.gerrit.server.account.WatchConfig.NotifyValue nv = parseNotifyValue ( notifyValue ) ; com.google.common.truth.Truth.assertThat ( nv.filter ( ) ) . isEqualTo ( expectedFilter ) ; com.google.common.truth.Truth.assertThat ( nv.notifyTypes ( ) ) . containsExactlyElementsIn ( expectedNotifyTypes ) ; }

Target:
private void assertParseNotifyValue ( java.lang.String notifyValue , java.lang.String expectedFilter , java.util.Set < com.google.gerrit.server.account.ProjectWatches.NotifyType > expectedNotifyTypes ) { com.google.gerrit.server.account.ProjectWatches.NotifyValue nv = parseNotifyValue ( notifyValue ) ; com.google.common.truth.Truth.assertThat ( nv.filter ( ) ) . isEqualTo ( expectedFilter ) ; com.google.common.truth.Truth.assertThat ( nv.notifyTypes ( ) ) . containsExactlyElementsIn ( expectedNotifyTypes ) ; }
Source:
public void testFindInDeleteGap ( ) { com.google.gerrit.client.diff.LineMapper mapper = new com.google.gerrit.client.diff.LineMapper ( ) ; mapper.appendDelete ( 10 ) ; org.junit.Assert.assertEquals ( ( - 1 ) , mapper.lineOnOther ( Side.PARENT , 9 ) ) ; }

Target:
public void testFindAfterDeleteGap ( ) { com.google.gerrit.client.diff.LineMapper mapper = new com.google.gerrit.client.diff.LineMapper ( ) ; mapper.appendDelete ( 10 ) ; org.junit.Assert.assertEquals ( new com.google.gerrit.client.diff.LineMapper.LineOnOtherInfo ( 0 , true ) , mapper.lineOnOther ( Side.PARENT , 10 ) ) ; org.junit.Assert.assertEquals ( new com.google.gerrit.client.diff.LineMapper.LineOnOtherInfo ( 10 , true ) , mapper.lineOnOther ( Side.REVISION , 0 ) ) ; }
Source:
public void testUnblockInLocalVisibilityByRegisteredUsers_Fails ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; org.junit.Assert.assertFalse ( "u can't read" , u.controlForRef ( "refs/heads/master" ) . isVisibleByRegisteredUsers ( ) ) ; }

Target:
public void testUnblockForceEditTopicName ( ) { com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertTrue ( "u can edit topic name" , u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) ; }
Source:
public com.google.gerrit.extensions.api.projects.ProjectApi name ( java.lang.String name ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return api.create ( projects.parse ( name ) ) ; } catch ( com.google.gerrit.extensions.restapi.UnprocessableEntityException e ) { return api.create ( name ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve project" ) ; } }

Target:
public com.google.gerrit.extensions.api.projects.ProjectApi name ( java.lang.String name ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return api.create ( projects.parse ( name ) ) ; } catch ( com.google.gerrit.extensions.restapi.UnprocessableEntityException e ) { return api.create ( name ) ; } catch ( java.io.IOException | com.google.gerrit.server.permissions.PermissionBackendException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve project" , e ) ; } }
Source:
public com.google.gerrit.server.change.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { com.google.gerrit.reviewdb.client.Change change = rsrc.getChange ( ) ; return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Mark private" ) . setTitle ( "Mark change as private" ) . setVisible ( ( ( ! ( change.isPrivate ( ) ) ) && ( canSetPrivate ( rsrc ) ) ) ) ; }

Target:
public com.google.gerrit.server.change.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { com.google.gerrit.reviewdb.client.Change change = rsrc.getChange ( ) ; return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Mark private" ) . setTitle ( "Mark change as private" ) . setVisible ( com.google.gerrit.extensions.conditions.BooleanCondition.and ( ( ! ( change.isPrivate ( ) ) ) , canSetPrivate ( rsrc ) ) ) ; }
Source:
public void onSuccess ( final com.google.gerrit.common.data.GroupDetail result ) { addMemberBox.setEnabled ( true ) ; addMemberBox.setText ( "" ) ; if ( ( ( result.accounts ) != null ) && ( ( result.members ) != null ) ) { accounts.merge ( result.accounts ) ; members.display ( result.members ) ; } }

Target:
public void onSuccess ( final com.google.gerrit.client.groups.MemberInfo memberInfo ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.client.Dispatcher.toGroup ( getGroupUUID ( ) , AccountGroupScreen.MEMBERS ) ) ; }
Source:
protected org.eclipse.jgit.lib.ObjectInserter delegate ( ) { return inserter ; }

Target:
public static java.lang.String messageUUID ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { int p ; int s ; synchronized ( com.google.gerrit.server.ChangeUtil.uuidLock ) { if ( ( com.google.gerrit.server.ChangeUtil.uuidSeq ) == 0 ) { com.google.gerrit.server.ChangeUtil.uuidPrefix = db.nextChangeMessageId ( ) ; com.google.gerrit.server.ChangeUtil.uuidSeq = java.lang.Integer.MAX_VALUE ; } p = com.google.gerrit.server.ChangeUtil.uuidPrefix ; s = ( com.google.gerrit.server.ChangeUtil.uuidSeq ) -- ; } java.lang.String u = com.google.gerrit.server.util.IdGenerator.format ( com.google.gerrit.server.util.IdGenerator.mix ( com.google.gerrit.server.ChangeUtil.SEED , p ) ) ; java.lang.String l = com.google.gerrit.server.util.IdGenerator.format ( com.google.gerrit.server.util.IdGenerator.mix ( p , s ) ) ; return ( u + '_' ) + l ; }
Source:
public void testTokenExpired ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestToken token = new com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestToken ( ( - 1 ) ) ; com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestTokenVerifier verifier = new com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestTokenVerifier ( token ) ; com.google.common.truth.Truth.assertThat ( verifier.verify ( ) ) . isFalse ( ) ; }

Target:
public void testTokenOnTime ( ) throws java.lang.Exception { java.time.Instant when = java.time.Instant.now ( ) ; com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestToken token = new com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestToken ( when , 1L ) ; com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestTokenVerifier verifier = new com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestTokenVerifier ( token ) ; com.google.common.truth.Truth.assertThat ( verifier.onTime ( when.plusMillis ( 999 ) ) ) . isTrue ( ) ; }
Source:
private com.google.gerrit.extensions.common.ChangeInput newMergeChangeInput ( java.lang.String targetBranch , java.lang.String sourceRef , com.google.gerrit.extensions.client.ChangeStatus status ) { com.google.gerrit.extensions.common.ChangeInput in = new com.google.gerrit.extensions.common.ChangeInput ( ) ; in.project = project.get ( ) ; in.branch = targetBranch ; in.subject = ( ( "merge " + sourceRef ) + " to " ) + targetBranch ; in.status = status ; com.google.gerrit.extensions.common.MergeInput mergeInput = new com.google.gerrit.extensions.common.MergeInput ( ) ; mergeInput.source = sourceRef ; in.merge = mergeInput ; return in ; }

Target:
private com.google.gerrit.extensions.common.ChangeInput newMergeChangeInput ( java.lang.String targetBranch , java.lang.String sourceRef , java.lang.String strategy ) { com.google.gerrit.extensions.common.ChangeInput in = new com.google.gerrit.extensions.common.ChangeInput ( ) ; in.project = project.get ( ) ; in.branch = targetBranch ; in.subject = ( ( "merge " + sourceRef ) + " to " ) + targetBranch ; in.status = com.google.gerrit.extensions.client.ChangeStatus.NEW ; com.google.gerrit.extensions.common.MergeInput mergeInput = new com.google.gerrit.extensions.common.MergeInput ( ) ; mergeInput.source = sourceRef ; in.merge = mergeInput ; if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( strategy ) ) ) { in.merge.strategy = strategy ; } return in ; }
Source:
public void onSuccess ( com.googlesource.gerrit.plugins.verifystatus.client.ConfigInfo info ) { if ( info.showJobsSummaryPanel ( ) ) { com.google.gerrit.plugin.client.Plugin.get ( ) . panel ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_CHANGE_INFO_BLOCK , new com.googlesource.gerrit.plugins.verifystatus.client.JobsSummaryPanel.Factory ( ) ) ; } if ( info.showJobsPanel ( ) ) { com.google.gerrit.plugin.client.Plugin.get ( ) . panel ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_CHANGE_INFO_BLOCK , new com.googlesource.gerrit.plugins.verifystatus.client.JobsPanel.Factory ( ) ) ; } if ( info.showJobsDropDownPanel ( ) ) { com.google.gerrit.plugin.client.Plugin.get ( ) . panel ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER_RIGHT_OF_POP_DOWNS , new com.googlesource.gerrit.plugins.verifystatus.client.JobsDropDownPanel.Factory ( ) ) ; } }

Target:
public void onSuccess ( com.googlesource.gerrit.plugins.verifystatus.client.ConfigInfo info ) { if ( info.showJobsSummaryPanel ( ) ) { com.google.gerrit.plugin.client.Plugin.get ( ) . panel ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_CHANGE_INFO_BLOCK , new com.googlesource.gerrit.plugins.verifystatus.client.JobsSummaryPanel.Factory ( ) , "VerifyStatusJobsSummaryPanel" ) ; } if ( info.showJobsPanel ( ) ) { com.google.gerrit.plugin.client.Plugin.get ( ) . panel ( GerritUiExtensionPoint.CHANGE_SCREEN_BELOW_CHANGE_INFO_BLOCK , new com.googlesource.gerrit.plugins.verifystatus.client.JobsPanel.Factory ( ) , "VerifyStatusJobsPanel" ) ; } if ( info.showJobsDropDownPanel ( ) ) { com.google.gerrit.plugin.client.Plugin.get ( ) . panel ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER_RIGHT_OF_POP_DOWNS , new com.googlesource.gerrit.plugins.verifystatus.client.JobsDropDownPanel.Factory ( ) , "VerifyStatusJobsDropDownPanel" ) ; } }
Source:
public org.eclipse.jgit.lib.Repository openMetadataRepository ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { com.google.common.base.Preconditions.checkState ( notesMigration.readChanges ( ) , "notedb disabled" ) ; try { return openRepository ( noteDbPath , name ) ; } catch ( org.eclipse.jgit.errors.RepositoryNotFoundException e ) { return createRepository ( noteDbPath , name ) ; } }

Target:
public org.eclipse.jgit.lib.Repository openMetadataRepository ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { com.google.common.base.Preconditions.checkState ( notesMigration.readChanges ( ) , "NoteDb disabled" ) ; try { return openRepository ( noteDbPath , name ) ; } catch ( org.eclipse.jgit.errors.RepositoryNotFoundException e ) { return createRepository ( noteDbPath , name ) ; } }
Source:
public void onSuccess ( ) { com.google.gerrit.client.Gerrit.display ( token , select ( ) ) ; }

Target:
private static void extension ( final java.lang.String token ) { com.google.gerrit.client.api.ExtensionScreen view = new com.google.gerrit.client.api.ExtensionScreen ( com.google.gerrit.client.Dispatcher.skip ( token ) ) ; if ( view.isFound ( ) ) { com.google.gerrit.client.Gerrit.display ( token , view ) ; } else { com.google.gerrit.client.Gerrit.display ( token , new com.google.gerrit.client.NotFoundScreen ( ) ) ; } }
Source:
public boolean updateChange ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { ctx.getChange ( ) . setStatus ( Change.Status.MERGED ) ; ctx.getUpdate ( ctx.getChange ( ) . currentPatchSetId ( ) ) . fixStatus ( Change.Status.MERGED ) ; return true ; }

Target:
public boolean updateChange ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { ctx.getChange ( ) . setStatus ( Change.Status.MERGED ) ; ctx.getUpdate ( ctx.getChange ( ) . currentPatchSetId ( ) ) . fixStatus ( Change.Status.MERGED ) ; p.status = com.google.gerrit.extensions.common.ProblemInfo.Status.FIXED ; p.outcome = "Marked change as merged" ; return true ; }
Source:
protected void doGet ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { final java.lang.String sid = webSession.get ( ) . getAccessToken ( ) ; final com.google.gerrit.server.CurrentUser currentUser = webSession.get ( ) . getCurrentUser ( ) ; final java.lang.String what = "sign out" ; final long when = java.lang.System.currentTimeMillis ( ) ; try { doLogout ( req , rsp ) ; } finally { audit.dispatch ( new com.google.gerrit.audit.AuditEvent ( sid , currentUser , what , when , null , null ) ) ; } }

Target:
protected void doGet ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { final java.lang.String sid = webSession.get ( ) . getAuthorization ( ) ; final com.google.gerrit.server.CurrentUser currentUser = webSession.get ( ) . getCurrentUser ( ) ; final java.lang.String what = "sign out" ; final long when = java.lang.System.currentTimeMillis ( ) ; try { doLogout ( req , rsp ) ; } finally { audit.dispatch ( new com.google.gerrit.audit.AuditEvent ( sid , currentUser , what , when , null , null ) ) ; } }
Source:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.server.change.ChangeJson.CommitInfo > apply ( com.google.gerrit.server.change.RevisionResource resource ) throws com.google.gerrit.server.patch.PatchSetInfoNotAvailableException , com.google.gwtorm.server.OrmException { return com.google.gerrit.extensions.restapi.Response.ok ( json.toCommit ( resource.getPatchSet ( ) ) ) . caching ( com.google.gerrit.extensions.restapi.CacheControl.PRIVATE ( 7 , java.util.concurrent.TimeUnit.DAYS ) ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.server.change.ChangeJson.CommitInfo > apply ( com.google.gerrit.server.change.RevisionResource resource ) throws com.google.gerrit.server.patch.PatchSetInfoNotAvailableException , com.google.gwtorm.server.OrmException { com.google.gerrit.extensions.restapi.Response < com.google.gerrit.server.change.ChangeJson.CommitInfo > r = com.google.gerrit.extensions.restapi.Response.ok ( json.toCommit ( resource.getPatchSet ( ) ) ) ; if ( resource.isCacheable ( ) ) { r.caching ( com.google.gerrit.extensions.restapi.CacheControl.PRIVATE ( 7 , java.util.concurrent.TimeUnit.DAYS ) ) ; } return r ; }
Source:
public boolean equals ( java.lang.Object o ) { if ( o instanceof com.google.gitiles.VisibilityCache.Key ) { com.google.gitiles.VisibilityCache.Key k = ( ( com.google.gitiles.VisibilityCache.Key ) ( o ) ) ; return ( ( com.google.common.base.Objects.equal ( user , k.user ) ) && ( com.google.common.base.Objects.equal ( repositoryName , k.repositoryName ) ) ) && ( com.google.common.base.Objects.equal ( objectId , k.objectId ) ) ; } return false ; }

Target:
public boolean equals ( java.lang.Object o ) { if ( o instanceof com.google.gitiles.VisibilityCache.Key ) { com.google.gitiles.VisibilityCache.Key k = ( ( com.google.gitiles.VisibilityCache.Key ) ( o ) ) ; return ( ( java.util.Objects.equals ( user , k.user ) ) && ( java.util.Objects.equals ( repositoryName , k.repositoryName ) ) ) && ( java.util.Objects.equals ( objectId , k.objectId ) ) ; } return false ; }
Source:
public void parseCommit ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( ( "\n" + "Patch-set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Subject: Some subject of a change\n" ) + "Commit: abcd1234abcd1234abcd1234abcd1234abcd1234" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( ( ( "\n" + "Patch-set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Subject: Some subject of a change\n" ) + "Commit: abcd1234abcd1234abcd1234abcd1234abcd1234\n" ) + "Commit: deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) ) ) ; assertParseFails ( ( "Update patch set 1\n" + ( ( ( ( "Uploaded patch set 1.\n" + "Patch-set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Subject: Some subject of a change\n" ) + "Commit: beef" ) ) ) ; }

Target:
public void parseCommit ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( ( "\n" + "Patch-set: 2\n" ) + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Subject: Some subject of a change\n" ) + "Commit: abcd1234abcd1234abcd1234abcd1234abcd1234" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( ( ( "\n" + "Patch-set: 2\n" ) + "Branch: refs/heads/master\n" ) + "Subject: Some subject of a change\n" ) + "Commit: abcd1234abcd1234abcd1234abcd1234abcd1234\n" ) + "Commit: deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) ) ) ; assertParseFails ( ( "Update patch set 1\n" + ( ( ( ( "Uploaded patch set 1.\n" + "Patch-set: 2\n" ) + "Branch: refs/heads/master\n" ) + "Subject: Some subject of a change\n" ) + "Commit: beef" ) ) ) ; }
Source:
protected void configureServlets ( ) { java.lang.Class < ? extends javax.servlet.Filter > authFilter ; if ( authConfig.isTrustContainerAuth ( ) ) { authFilter = com.google.gerrit.httpd.ContainerAuthFilter.class ; } else { authFilter = com.google.gerrit.httpd.ProjectDigestFilter.class ; } java.lang.String git = GitOverHttpFilter.URL_REGEX ; filterRegex ( git ) . through ( authFilter ) ; filterRegex ( git ) . through ( com.google.gerrit.httpd.GitOverHttpFilter.class ) ; }

Target:
protected void configureServlets ( ) { java.lang.Class < ? extends javax.servlet.Filter > authFilter ; if ( authConfig.isTrustContainerAuth ( ) ) { authFilter = com.google.gerrit.httpd.ContainerAuthFilter.class ; } else { authFilter = com.google.gerrit.httpd.ProjectDigestFilter.class ; } java.lang.String git = GitOverHttpServlet.URL_REGEX ; filterRegex ( git ) . through ( authFilter ) ; serveRegex ( git ) . with ( com.google.gerrit.httpd.GitOverHttpServlet.class ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.server.ssh.Sshd.class ) . to ( com.google.gerrit.server.ssh.GerritSshDaemon.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( org.apache.sshd.server.CommandFactory.class ) . toProvider ( com.google.gerrit.server.ssh.CommandFactoryProvider.class ) ; bind ( org.apache.sshd.server.PublickeyAuthenticator.class ) . to ( com.google.gerrit.server.ssh.DatabasePubKeyAuth.class ) ; install ( new com.google.gerrit.server.ssh.commands.DefaultCommandModule ( ) ) ; }

Target:
protected void configure ( ) { bindScope ( com.google.inject.servlet.SessionScoped.class , SshScopes.SESSION ) ; bindScope ( com.google.inject.servlet.RequestScoped.class , SshScopes.REQUEST ) ; configureSessionScope ( ) ; configureRequestScope ( ) ; bind ( com.google.gerrit.server.ssh.Sshd.class ) . to ( com.google.gerrit.server.ssh.GerritSshDaemon.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( org.apache.sshd.server.CommandFactory.class ) . toProvider ( com.google.gerrit.server.ssh.CommandFactoryProvider.class ) ; bind ( org.apache.sshd.server.PublickeyAuthenticator.class ) . to ( com.google.gerrit.server.ssh.DatabasePubKeyAuth.class ) ; install ( new com.google.gerrit.server.ssh.commands.DefaultCommandModule ( ) ) ; }
Source:
public void parseTag ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( ( "\n" + "Patch-Set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Subject: Change subject\n" ) + "Tag:\n" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( ( ( ( ( "\n" + "Patch-Set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Subject: Change subject\n" ) + "Tag: jenkins\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( ( ( ( "\n" + "Patch-Set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Subject: Change subject\n" ) + "Tag: ci\n" ) + "Tag: jenkins\n" ) ) ) ; }

Target:
public void parseTag ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( ( "\n" + "Patch-set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Subject: Change subject\n" ) + "Tag:\n" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( ( ( ( ( "\n" + "Patch-set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Subject: Change subject\n" ) + "Tag: jenkins\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( ( ( ( "\n" + "Patch-set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Subject: Change subject\n" ) + "Tag: ci\n" ) + "Tag: jenkins\n" ) ) ) ; }
Source:
private java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > approvals ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.change.ReviewerResource rsrc ) throws com.google.gwtorm.server.OrmException { final com.google.gerrit.reviewdb.client.Account.Id user = rsrc.getUser ( ) . getAccountId ( ) ; return com.google.common.collect.Iterables.filter ( approvalsUtil.byChange ( db , rsrc.getNotes ( ) ) . values ( ) , new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSetApproval > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.PatchSetApproval input ) { return user.equals ( input.getAccountId ( ) ) ; } } ) ; }

Target:
private java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > approvals ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx , final com.google.gerrit.reviewdb.client.Account.Id accountId ) throws com.google.gwtorm.server.OrmException { return com.google.common.collect.Iterables.filter ( approvalsUtil.byChange ( ctx.getDb ( ) , ctx.getNotes ( ) ) . values ( ) , new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSetApproval > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.PatchSetApproval input ) { return accountId.equals ( input.getAccountId ( ) ) ; } } ) ; }
Source:
public com.google.common.base.Optional < java.io.InputStream > getResourceInputStream ( java.lang.String resourcePath ) throws java.io.IOException { return com.google.common.base.Optional.absent ( ) ; }

Target:
public com.google.common.base.Optional < com.google.gerrit.server.plugins.PluginEntry > getEntry ( java.lang.String resourcePath ) { java.io.File resourceFile = getResourceFile ( resourcePath ) ; if ( ( resourceFile.exists ( ) ) && ( ( resourceFile.length ( ) ) > 0 ) ) { return resourceOf ( resourcePath ) ; } else { return com.google.common.base.Optional.absent ( ) ; } }
Source:
private java.lang.String printConfiguration ( ) { java.lang.StringBuilder b = new java.lang.StringBuilder ( ) ; b.append ( ( ( "# configuration entries: " + ( config.size ( ) ) ) + "\n" ) ) ; for ( com.googlesource.gerrit.plugins.supermanifest.SuperManifestRefUpdatedListener.ConfigEntry c : config ) { b.append ( ( ( c.toString ( ) ) + "\n" ) ) ; } return b.toString ( ) ; }

Target:
private java.lang.String configurationToString ( ) { java.lang.StringBuilder b = new java.lang.StringBuilder ( ) ; b.append ( ( ( "number of configuration entries: " + ( config.size ( ) ) ) + "\n" ) ) ; for ( com.googlesource.gerrit.plugins.supermanifest.SuperManifestRefUpdatedListener.ConfigEntry c : config ) { b.append ( ( ( c.toString ( ) ) + "\n" ) ) ; } return b.toString ( ) ; }
Source:
private static void onRestore ( com.google.gwt.dom.client.NativeEvent e , int idx ) { com.google.gerrit.client.change.FileTable.MyTable t = com.google.gerrit.client.change.FileTable.getMyTable ( e ) ; if ( t != null ) { t.onRestore ( idx ) ; } }

Target:
private static boolean onRestore ( com.google.gwt.dom.client.NativeEvent e , int idx ) { com.google.gerrit.client.change.FileTable.MyTable t = com.google.gerrit.client.change.FileTable.getMyTable ( e ) ; if ( t != null ) { t.onRestore ( idx ) ; e.preventDefault ( ) ; e.stopPropagation ( ) ; return false ; } return true ; }
Source:
public boolean canEdit ( final com.google.gerrit.reviewdb.client.Account.FieldName f ) { return editableAccountFields.contains ( f ) ; }

Target:
public boolean siteHasUsernames ( ) { if ( ( ( ( authType ) == ( com.google.gerrit.reviewdb.client.AuthType.CUSTOM_EXTENSION ) ) && ( ( getHttpPasswordUrl ( ) ) != null ) ) && ( ! ( editableAccountFields.contains ( FieldName.USER_NAME ) ) ) ) { return false ; } return true ; }
Source:
public java.lang.Void call ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( caller == ( java.lang.Thread.currentThread ( ) ) ) { updateGroups ( db ) ; } else { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schemaFactory.open ( ) ) { updateGroups ( db ) ; } } return null ; }

Target:
public java.lang.Void call ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException { try ( com.google.gerrit.server.git.ReceiveCommits.RequestState state = requestState ( caller ) ) { updateGroups ( state ) ; } return null ; }
Source:
public void testThreeLevelTreeWithSomeIndexPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "-foo:a (file:b OR file:c)" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; org.junit.Assert.assertEquals ( com.google.gerrit.server.query.change.AndSource.class , out.getClass ( ) ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( query ( in.getChild ( 1 ) ) , in.getChild ( 0 ) ) , out.getChildren ( ) ) ; }

Target:
public void testThreeLevelTreeWithSomeIndexPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "-foo:a (file:b OR file:c)" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; com.google.common.truth.Truth.assertThat ( out.getClass ( ) ) . isSameAs ( com.google.gerrit.server.query.change.AndSource.class ) ; com.google.common.truth.Truth.assertThat ( out.getChildren ( ) ) . containsExactly ( query ( in.getChild ( 1 ) ) , in.getChild ( 0 ) ) . inOrder ( ) ; }
Source:
public void blockOwner ( ) { com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.OWNER , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.OWNER , com.google.gerrit.server.project.Util.DEVS , "refs/*" ) ; com.google.common.truth.Truth.assertThat ( user ( local , com.google.gerrit.server.project.Util.DEVS ) . isOwner ( ) ) . isFalse ( ) ; }

Target:
public void blockOwner ( ) { com.google.gerrit.server.project.testing.Util.block ( parent , com.google.gerrit.common.data.Permission.OWNER , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.OWNER , com.google.gerrit.server.project.testing.Util.DEVS , "refs/*" ) ; com.google.common.truth.Truth.assertThat ( user ( local , com.google.gerrit.server.project.testing.Util.DEVS ) . isOwner ( ) ) . isFalse ( ) ; }
Source:
public int compare ( final com.google.gerrit.reviewdb.client.AccountGroupIncludeByUuid o1 , final com.google.gerrit.reviewdb.client.AccountGroupIncludeByUuid o2 ) { final com.google.gerrit.reviewdb.client.AccountGroup a = gic.get ( o1.getIncludeUUID ( ) ) ; final com.google.gerrit.reviewdb.client.AccountGroup b = gic.get ( o2.getIncludeUUID ( ) ) ; return n ( a ) . compareTo ( n ( b ) ) ; }

Target:
public int compare ( final com.google.gerrit.reviewdb.client.AccountGroupIncludeByUuid o1 , final com.google.gerrit.reviewdb.client.AccountGroupIncludeByUuid o2 ) { com.google.gerrit.common.data.GroupDescription.Basic a = gic.get ( o1.getIncludeUUID ( ) ) ; com.google.gerrit.common.data.GroupDescription.Basic b = gic.get ( o2.getIncludeUUID ( ) ) ; return n ( a ) . compareTo ( n ( b ) ) ; }
Source:
public com.google.gerrit.server.account.GroupMembership membershipsOf ( com.google.gerrit.server.IdentifiedUser user ) { java.lang.String id = com.google.gerrit.server.auth.ldap.LdapGroupBackend.findId ( user.state ( ) . getExternalIds ( ) ) ; if ( id == null ) { return com.google.gerrit.server.account.GroupMembership.EMPTY ; } try { return new com.google.gerrit.server.account.ListGroupMembership ( membershipCache.get ( id ) ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.server.auth.ldap.LdapGroupBackend.log.warn ( java.lang.String.format ( "Cannot lookup membershipsOf %s in LDAP" , id ) , e ) ; return com.google.gerrit.server.account.GroupMembership.EMPTY ; } }

Target:
public java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > getKnownGroups ( ) { java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > g = com.google.common.collect.Sets.newHashSet ( groups ) ; g.retainAll ( projectCache.guessRelevantGroupUUIDs ( ) ) ; return g ; }
Source:
private void approve ( com.google.gerrit.acceptance.RestSession s , java.lang.String changeId , int expected ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = s.post ( ( ( "/changes/" + changeId ) + "/revisions/current/review" ) , new com.google.gerrit.extensions.api.changes.ReviewInput ( ) . label ( "Code-Review" , 2 ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( expected ) ; r.consume ( ) ; }

Target:
private void approve ( com.google.gerrit.acceptance.TestAccount a , java.lang.String changeId ) throws java.lang.Exception { com.google.gerrit.acceptance.AcceptanceTestRequestScope.Context old = setApiUser ( a ) ; try { gApi.changes ( ) . id ( changeId ) . current ( ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.approve ( ) ) ; } finally { atrScope.set ( old ) ; } }
Source:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicMap.mapOf ( binder ( ) , com.google.gerrit.server.config.ConfigResource.CONFIG_KIND ) ; com.google.gerrit.extensions.registration.DynamicMap.mapOf ( binder ( ) , com.google.gerrit.server.config.CapabilityResource.CAPABILITY_KIND ) ; child ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "capabilities" ) . to ( com.google.gerrit.server.config.CapabilitiesCollection.class ) ; }

Target:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicMap.mapOf ( binder ( ) , com.google.gerrit.server.config.ConfigResource.CONFIG_KIND ) ; com.google.gerrit.extensions.registration.DynamicMap.mapOf ( binder ( ) , com.google.gerrit.server.config.CapabilityResource.CAPABILITY_KIND ) ; child ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "capabilities" ) . to ( com.google.gerrit.server.config.CapabilitiesCollection.class ) ; get ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "version" ) . to ( com.google.gerrit.server.config.GetVersion.class ) ; }
Source:
private void assertAdminsAreOwnersAndDevsAreNot ( ) { com.google.gerrit.server.project.ProjectControl uBlah = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl uAdmin = util.user ( local , com.google.gerrit.server.project.Util.DEVS , com.google.gerrit.server.project.Util.ADMIN ) ; org.junit.Assert.assertFalse ( "not owner" , uBlah.isOwner ( ) ) ; org.junit.Assert.assertTrue ( "is owner" , uAdmin.isOwner ( ) ) ; }

Target:
private void assertAdminsAreOwnersAndDevsAreNot ( ) { com.google.gerrit.server.project.ProjectControl uBlah = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl uAdmin = util.user ( local , com.google.gerrit.server.project.Util.DEVS , com.google.gerrit.server.project.Util.ADMIN ) ; com.google.common.truth.Truth.assertThat ( uBlah.isOwner ( ) ) . named ( "not owner" ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( uAdmin.isOwner ( ) ) . named ( "is owner" ) . isTrue ( ) ; }
Source:
public void missingRepo ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey name = ctl.getProject ( ) . getNameKey ( ) ; ( ( com.google.gerrit.testutil.InMemoryRepositoryManager ) ( repoManager ) ) . deleteRepository ( name ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Destination repository not found: " + name ) ) ) ; }

Target:
private void assumeNoteDbDisabled ( ) { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.common.truth.TruthJUnit.assume ( ) . that ( com.google.gerrit.testutil.NoteDbMode.get ( ) ) . isNotEqualTo ( NoteDbMode.CHECK ) ; }
Source:
public com.google.gerrit.server.patch.FileList getFileList ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet patchSet ) throws com.google.gerrit.server.patch.PatchListNotAvailableException { com.google.gerrit.reviewdb.client.Project.NameKey project = change.getProject ( ) ; org.eclipse.jgit.lib.ObjectId b = org.eclipse.jgit.lib.ObjectId.fromString ( patchSet.getRevision ( ) . get ( ) ) ; com.google.gerrit.extensions.client.DiffPreferencesInfo.Whitespace ws = com.google.gerrit.extensions.client.DiffPreferencesInfo.Whitespace.IGNORE_NONE ; return getFileList ( com.google.gerrit.server.patch.PatchListKey.againstDefaultBase ( b , ws ) , project ) ; }

Target:
public com.google.gerrit.server.patch.DiffSummary getDiffSummary ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet patchSet ) throws com.google.gerrit.server.patch.PatchListNotAvailableException { com.google.gerrit.reviewdb.client.Project.NameKey project = change.getProject ( ) ; org.eclipse.jgit.lib.ObjectId b = org.eclipse.jgit.lib.ObjectId.fromString ( patchSet.getRevision ( ) . get ( ) ) ; com.google.gerrit.extensions.client.DiffPreferencesInfo.Whitespace ws = com.google.gerrit.extensions.client.DiffPreferencesInfo.Whitespace.IGNORE_NONE ; return getDiffSummary ( com.google.gerrit.server.patch.PatchListKey.againstDefaultBase ( b , ws ) , project ) ; }
Source:
public void customConflictMessageWithRevisionSubstitutionTest ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.automerger.FailedMergeException fme = new com.googlesource.gerrit.plugins.automerger.FailedMergeException ( failedMergeBranches , currentRevision , hostName , "${branch} ${revision}" , topic ) ; java.lang.String branch1String = "branch1 " + ( currentRevision ) ; java.lang.String branch2String = "branch2 " + ( currentRevision ) ; java.lang.String branch3String = "branch3 " + ( currentRevision ) ; com.google.common.truth.Truth.assertThat ( fme.getDisplayString ( ) . split ( "\\n" ) ) . asList ( ) . containsExactly ( branch1String , branch2String , branch3String ) ; }

Target:
public void customConflictMessageTest ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.automerger.FailedMergeException fme = new com.googlesource.gerrit.plugins.automerger.FailedMergeException ( failedMergeBranches , currentRevision , hostName , projectName , changeNumber , patchsetNumber , "asdf" , topic ) ; com.google.common.truth.Truth.assertThat ( fme.getDisplayString ( ) . split ( "\\n" ) ) . asList ( ) . containsExactly ( "asdf" , "asdf" , "asdf" ) ; }
Source:
private java.util.List < com.google.gerrit.extensions.common.ProjectInfo > list ( com.google.gerrit.server.api.projects.ListRequest request ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.project.ListProjects lp = listProvider.get ( ) ; lp.setShowDescription ( request.getDescription ( ) ) ; lp.setLimit ( request.getLimit ( ) ) ; lp.setStart ( request.getStart ( ) ) ; lp.setMatchPrefix ( request.getPrefix ( ) ) ; return com.google.common.collect.ImmutableList.copyOf ( lp.apply ( ) . values ( ) ) ; }

Target:
private java.util.SortedMap < java.lang.String , com.google.gerrit.extensions.common.ProjectInfo > list ( com.google.gerrit.server.api.projects.ListRequest request ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.project.ListProjects lp = listProvider.get ( ) ; lp.setShowDescription ( request.getDescription ( ) ) ; lp.setLimit ( request.getLimit ( ) ) ; lp.setStart ( request.getStart ( ) ) ; lp.setMatchPrefix ( request.getPrefix ( ) ) ; return lp.apply ( ) ; }
Source:
private java.lang.Iterable < java.lang.String > getDraftRefs ( final com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { java.util.Set < java.lang.String > refNames = getRefNamesAllUsers ( RefNames.REFS_USER ) ; final java.lang.String suffix = ( com.google.gerrit.reviewdb.client.RefNames.DRAFTS ) + ( changeId.get ( ) ) ; return com.google.common.collect.Iterables.filter ( refNames , new com.google.common.base.Predicate < java.lang.String > ( ) { @ java.lang.Override public boolean apply ( java.lang.String input ) { return input.endsWith ( suffix ) ; } } ) ; }

Target:
private java.lang.Iterable < java.lang.String > getDraftRefs ( final com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { java.util.Set < java.lang.String > refNames = getRefNamesAllUsers ( RefNames.REFS_DRAFT_COMMENTS ) ; final java.lang.String suffix = "-" + ( changeId.get ( ) ) ; return com.google.common.collect.Iterables.filter ( refNames , new com.google.common.base.Predicate < java.lang.String > ( ) { @ java.lang.Override public boolean apply ( java.lang.String input ) { return input.endsWith ( suffix ) ; } } ) ; }
Source:
public com.google.gerrit.extensions.common.DiffWebLinkInfo getDiffLink ( java.lang.String projectName , int changeId , java.lang.Integer patchSetIdA , java.lang.String revisionA , java.lang.String fileNameA , int patchSetIdB , java.lang.String revisionB , java.lang.String fileNameB ) { com.googlesource.gerrit.plugins.xdocs.formatter.Formatters.FormatterProvider formatter = formatters.get ( projectName , fileNameB ) ; if ( formatter == null ) { return null ; } return com.google.gerrit.extensions.common.DiffWebLinkInfo.forUnifiedDiffView ( com.googlesource.gerrit.plugins.xdocs.UnifiedDiffPreviewWebLink.UNIFIED_PREVIEW_DIFF , ( ( "plugins/" + ( pluginName ) ) + "/static/unifiedDiffPreview.png" ) , com.googlesource.gerrit.plugins.xdocs.UnifiedDiffPreviewWebLink.getUrl ( pluginName , changeId , patchSetIdA , patchSetIdB , fileNameB ) , Target.SELF ) ; }

Target:
public com.google.gerrit.extensions.common.DiffWebLinkInfo getDiffLink ( java.lang.String projectName , int changeId , java.lang.Integer patchSetIdA , java.lang.String revisionA , java.lang.String pathA , int patchSetIdB , java.lang.String revisionB , java.lang.String pathB ) { com.googlesource.gerrit.plugins.xdocs.formatter.Formatters.FormatterProvider formatter = formatters.get ( projectName , pathB ) ; if ( formatter == null ) { return null ; } return com.google.gerrit.extensions.common.DiffWebLinkInfo.forUnifiedDiffView ( com.googlesource.gerrit.plugins.xdocs.UnifiedDiffPreviewWebLink.UNIFIED_PREVIEW_DIFF , ( ( "plugins/" + ( pluginName ) ) + "/static/unifiedDiffPreview.png" ) , com.googlesource.gerrit.plugins.xdocs.UnifiedDiffPreviewWebLink.getUrl ( pluginName , changeId , patchSetIdA , patchSetIdB , pathB ) , Target.SELF ) ; }
Source:
boolean isEdit ( ) { return edit ; }

Target:
public int compareTo ( com.google.gerrit.client.diff.DiffChunkInfo o ) { if ( ( side ) == ( o.side ) ) { return ( start ) - ( o.start ) ; } else if ( ( side ) == ( DisplaySide.A ) ) { int comp = ( startOnOther ) - ( o.start ) ; return comp == 0 ? - 1 : comp ; } else { int comp = ( start ) - ( o.startOnOther ) ; return comp == 0 ? 1 : comp ; } }
Source:
public void testGetAddressAccess ( ) throws java.lang.Exception { final com.google.gwtorm.data.PhoneBookDb schema = open ( ) ; assertNotNull ( schema.addresses ( ) ) ; assertEquals ( "addresses" , schema.addresses ( ) . getRelationName ( ) ) ; }

Target:
public void testGetAddressAccess ( ) throws java.lang.Exception { final com.google.gwtorm.data.PhoneBookDb schema = open ( ) ; assertNotNull ( schema.addresses ( ) ) ; assertEquals ( "addresses" , schema.addresses ( ) . getRelationName ( ) ) ; assertEquals ( 2 , schema.addresses ( ) . getRelationID ( ) ) ; }
Source:
public static boolean isExpected ( int statusCode ) { switch ( statusCode ) { case com.google.gerrit.client.rpc.RestApi.SC_UNAVAILABLE : case 400 : case 401 : case 403 : case 404 : case 405 : case 409 : case 429 : return true ; default : return false ; } }

Target:
public static boolean isExpected ( int statusCode ) { switch ( statusCode ) { case com.google.gerrit.client.rpc.RestApi.SC_UNAVAILABLE : case 400 : case 401 : case 403 : case 404 : case 405 : case 409 : case 412 : case 429 : return true ; default : return false ; } }
Source:
public void includeExistingGroup_OK ( ) throws java.lang.Exception { java.lang.String p = group ( "parent" ) ; java.lang.String g = group ( "newGroup" ) ; PUT ( ( ( ( "/groups/" + p ) + "/groups/" ) + g ) ) . consume ( ) ; com.google.common.truth.Truth.assertThat ( PUT ( ( ( ( "/groups/" + p ) + "/groups/" ) + g ) ) . getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; }

Target:
public void includeExistingGroup_OK ( ) throws java.lang.Exception { java.lang.String p = group ( "parent" ) ; java.lang.String g = group ( "newGroup" ) ; gApi.groups ( ) . id ( p ) . addGroups ( g ) ; assertIncludes ( p , g ) ; gApi.groups ( ) . id ( p ) . addGroups ( g ) ; assertIncludes ( p , g ) ; }
Source:
public static void applyUserPreferences ( ) { if ( ( com.google.gerrit.client.Gerrit.myAccount ) != null ) { final com.google.gerrit.reviewdb.client.AccountGeneralPreferences p = com.google.gerrit.client.Gerrit.myAccount.getGeneralPreferences ( ) ; com.google.gwtexpui.clippy.client.CopyableLabel.setFlashEnabled ( p.isUseFlashClipboard ( ) ) ; if ( ( com.google.gerrit.client.Gerrit.siteHeader ) != null ) { com.google.gerrit.client.Gerrit.siteHeader.setVisible ( p.isShowSiteHeader ( ) ) ; } if ( ( com.google.gerrit.client.Gerrit.siteFooter ) != null ) { com.google.gerrit.client.Gerrit.siteFooter.setVisible ( p.isShowSiteHeader ( ) ) ; } com.google.gerrit.client.FormatUtil.setPreferences ( com.google.gerrit.client.Gerrit.myAccount.getGeneralPreferences ( ) ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.info.AccountInfo result ) { com.google.gerrit.client.Gerrit.myAccount = result ; }