auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void rescheduleOnError ( ) throws java.io.IOException { org.mockito.Mockito.when ( session.post ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.WEBHOOK_URL , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.HEADERS , remote , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.BODY ) ) . thenReturn ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.ERR_RESULT ) ; task.run ( ) ; org.mockito.Mockito.verify ( executor , org.mockito.Mockito.times ( 1 ) ) . schedule ( task , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.RETRY_INTERVAL , java.util.concurrent.TimeUnit.MILLISECONDS ) ; }

Target:
public void noRescheduleOnSuccess ( ) throws java.io.IOException { org.mockito.Mockito.when ( session.post ( org.mockito.ArgumentMatchers.eq ( remote ) , org.mockito.ArgumentMatchers.eq ( content ) ) ) . thenReturn ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.OK_RESULT ) ; task.run ( ) ; org.mockito.Mockito.verifyZeroInteractions ( executor ) ; }
Source:
private void assertExternalId ( com.google.gerrit.server.account.externalids.ExternalId.Key extIdKey , @ com.google.gerrit.common.Nullable java.lang.String expectedEmail ) throws java.lang.Exception { com.google.gerrit.server.account.externalids.ExternalId extId = externalIds.get ( extIdKey ) ; com.google.common.truth.Truth.assertThat ( extId ) . named ( extIdKey.get ( ) ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( extId.email ( ) ) . named ( ( "email of " + ( extIdKey.get ( ) ) ) ) . isEqualTo ( expectedEmail ) ; }

Target:
private void assertExternalId ( com.google.gerrit.server.account.externalids.ExternalId.Key extIdKey , @ com.google.gerrit.common.Nullable java.lang.String expectedEmail ) throws java.lang.Exception { java.util.Optional < com.google.gerrit.server.account.externalids.ExternalId > extId = externalIds.get ( extIdKey ) ; com.google.common.truth.Truth.assertThat ( extId ) . named ( extIdKey.get ( ) ) . isPresent ( ) ; com.google.common.truth.Truth.assertThat ( extId.get ( ) . email ( ) ) . named ( ( "email of " + ( extIdKey.get ( ) ) ) ) . isEqualTo ( expectedEmail ) ; }
Source:
private void setDefaultBlameCache ( ) { if ( ( blameCache ) == null ) { if ( config.getSubsections ( "cache" ) . contains ( "blame" ) ) { blameCache = new com.google.gitiles.BlameCache ( com.google.gitiles.ConfigUtil.getCacheBuilder ( config , "blame" ) ) ; } else { blameCache = new com.google.gitiles.BlameCache ( ) ; } } }

Target:
private void setDefaultBlameCache ( ) { if ( ( blameCache ) == null ) { if ( config.getSubsections ( "cache" ) . contains ( "blame" ) ) { blameCache = new com.google.gitiles.BlameCacheImpl ( com.google.gitiles.ConfigUtil.getCacheBuilder ( config , "blame" ) ) ; } else { blameCache = new com.google.gitiles.BlameCacheImpl ( ) ; } } }
Source:
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 ( ) ) ; }

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 ) ; com.google.common.truth.Truth.assertThat ( u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) . named ( "u can edit topic name" ) . isTrue ( ) ; }
Source:
private synchronized void runHook ( java.io.File hook , java.util.List < java.lang.String > args ) { if ( hook.exists ( ) ) { hookQueue.execute ( new com.google.gerrit.common.ChangeHookRunner.HookTask ( null , hook , args ) ) ; } }

Target:
private synchronized void runHook ( com.google.gerrit.reviewdb.client.Project.NameKey project , java.io.File hook , java.util.List < java.lang.String > args ) { if ( ( project != null ) && ( hook.exists ( ) ) ) { hookQueue.execute ( new com.google.gerrit.common.ChangeHookRunner.AsyncHookTask ( project , hook , args ) ) ; } }
Source:
private com.google.gerrit.extensions.api.GerritApi connect ( com.google.reviewit.app.ServerConfig serverCfg ) { return new com.urswolfer.gerrit.client.rest.GerritRestApiFactory ( ) . create ( new com.urswolfer.gerrit.client.rest.GerritAuthData.Basic ( serverCfg.url , serverCfg.user , serverCfg.password ) ) ; }

Target:
public org.apache.http.impl.client.HttpClientBuilder extend ( org.apache.http.impl.client.HttpClientBuilder httpClientBuilder , com.urswolfer.gerrit.client.rest.GerritAuthData authData ) { httpClientBuilder.addInterceptorLast ( new org.apache.http.HttpRequestInterceptor ( ) { public void process ( org.apache.http.HttpRequest request , org.apache.http.protocol.HttpContext context ) throws java.io.IOException , org.apache.http.HttpException { org.apache.http.Header existingUserAgent = request.getFirstHeader ( HttpHeaders.USER_AGENT ) ; java.lang.String userAgent = java.lang.String.format ( "%s/%s" , getApplicationName ( ) , getVersion ( ) ) ; userAgent += " using " + ( existingUserAgent.getValue ( ) ) ; request.setHeader ( HttpHeaders.USER_AGENT , userAgent ) ; } } ) ; return super . extend ( httpClientBuilder , authData ) ; }
Source:
public < F1 , V > com.google.gerrit.metrics.CallbackMetric1 < F1 , V > newCallbackMetric ( java.lang.String name , java.lang.Class < V > valueClass , com.google.gerrit.metrics.Description desc , com.google.gerrit.metrics.Field < F1 > field1 ) { com.google.gerrit.metrics.dropwizard.CallbackMetricImpl1 < F1 , V > m = new com.google.gerrit.metrics.dropwizard.CallbackMetricImpl1 ( this , registry , name , valueClass , desc , field1 ) ; define ( name , desc ) ; bucketed.put ( name , m ) ; return m.create ( ) ; }

Target:
public < F1 , V > com.google.gerrit.metrics.CallbackMetric1 < F1 , V > newCallbackMetric ( java.lang.String name , java.lang.Class < V > valueClass , com.google.gerrit.metrics.Description desc , com.google.gerrit.metrics.Field < F1 > field1 ) { com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.checkMetricName ( name ) ; com.google.gerrit.metrics.dropwizard.CallbackMetricImpl1 < F1 , V > m = new com.google.gerrit.metrics.dropwizard.CallbackMetricImpl1 ( this , registry , name , valueClass , desc , field1 ) ; define ( name , desc ) ; bucketed.put ( name , m ) ; return m.create ( ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; final java.util.Properties p = new java.util.Properties ( ) ; p.setProperty ( "driver" , org.h2.Driver.class . getName ( ) ) ; p.setProperty ( "url" , ( "jdbc:h2:mem:PhoneBookDb" + ( ( com.google.gwtorm.server.PhoneBookDbTestCase.runCount ) ++ ) ) ) ; db = new com.google.gwtorm.jdbc.Database < com.google.gwtorm.data.PhoneBookDb > ( p , com.google.gwtorm.data.PhoneBookDb.class ) ; openSchemas = new java.util.ArrayList < com.google.gwtorm.data.PhoneBookDb > ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; final java.util.Properties p = new java.util.Properties ( ) ; p.setProperty ( "driver" , org.h2.Driver.class . getName ( ) ) ; p.setProperty ( "url" , ( "jdbc:h2:mem:PhoneBookDb" + ( ( com.google.gwtorm.server.PhoneBookDbTestCase.runCount ) ++ ) ) ) ; db = new com.google.gwtorm.jdbc.Database < com.google.gwtorm.data.PhoneBookDb > ( new com.google.gwtorm.jdbc.SimpleDataSource ( p ) , com.google.gwtorm.data.PhoneBookDb.class ) ; openSchemas = new java.util.ArrayList < com.google.gwtorm.data.PhoneBookDb > ( ) ; }
Source:
public void indexChange ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; com.google.gerrit.acceptance.RestResponse r = userSession.post ( ( ( "/changes/" + changeId ) + "/index/" ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_NO_CONTENT ) ; }

Target:
public void indexChange ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; com.google.gerrit.acceptance.RestResponse r = adminSession.post ( ( ( "/changes/" + changeId ) + "/index/" ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_NO_CONTENT ) ; }
Source:
private static java.lang.String format ( java.lang.String name , short value ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( ( ( name.length ( ) ) + 2 ) ) ; sb.append ( name ) ; if ( value >= 0 ) { sb.append ( '+' ) ; } sb.append ( value ) ; return sb.toString ( ) ; }

Target:
private void addLabelDelta ( java.lang.String name , short value ) { labelDelta.add ( new com.google.gerrit.server.util.LabelVote ( name , value ) . format ( ) ) ; }
Source:
private final native void setStartLine ( int sl ) ;

Target:
public static com.google.gerrit.client.diff.CommentRange create ( net.codemirror.lib.TextMarker.FromTo fromTo ) { if ( fromTo == null ) { return null ; } net.codemirror.lib.LineCharacter from = fromTo.getFrom ( ) ; net.codemirror.lib.LineCharacter to = fromTo.getTo ( ) ; return com.google.gerrit.client.diff.CommentRange.create ( ( ( from.getLine ( ) ) + 1 ) , from.getCh ( ) , ( ( to.getLine ( ) ) + 1 ) , to.getCh ( ) ) ; }
Source:
private static boolean isUnreasonableName ( java.lang.String name ) { if ( ( name.length ( ) ) < 1 ) return true ; if ( ( name.indexOf ( '\\' ) ) >= 0 ) return true ; if ( name.startsWith ( "../" ) ) return true ; if ( name.contains ( "/../" ) ) return true ; if ( name.contains ( "/./" ) ) return true ; if ( name.contains ( "//" ) ) return true ; return false ; }

Target:
private static boolean isUnreasonableName ( java.lang.String name ) { if ( ( name.length ( ) ) < 1 ) return true ; if ( name.contains ( "\\" ) ) return true ; if ( name.startsWith ( "../" ) ) return true ; if ( name.contains ( "/../" ) ) return true ; if ( name.contains ( "/./" ) ) return true ; if ( name.contains ( "//" ) ) return true ; return false ; }
Source:
public void onFailure ( final java.lang.Throwable caught ) { com.google.gwt.core.client.GWT.log ( "Fail" , caught ) ; }

Target:
public void onLoad ( ) { super . onLoad ( ) ; table.setSavePointerId ( com.google.gwt.user.client.History.getToken ( ) ) ; Util.LIST_SVC.myStarredChanges ( new com.google.gerrit.client.rpc.GerritCallback < java.util.List < com.google.gerrit.client.data.ChangeInfo > > ( ) { public void onSuccess ( final java.util.List < com.google.gerrit.client.data.ChangeInfo > result ) { starred.display ( result ) ; table.finishDisplay ( ) ; } } ) ; }
Source:
public void testReplaceInOrder1 ( ) { final com.google.gwtexpui.safehtml.client.RawFindReplace [ ] repl = new com.google.gwtexpui.safehtml.client.RawFindReplace [ ] { new com.google.gwtexpui.safehtml.client.RawFindReplace ( "(GWTEXPUI-(\\d+))" , "<a href=\"gwtexpui-bug?$2\">$1</a>" ) , new com.google.gwtexpui.safehtml.client.RawFindReplace ( "(issue\\s+(\\d+))" , "<a href=\"generic-bug?$2\">$1</a>" ) } ; final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.html ( "A\nissue 42\nReally GWTEXPUI-9918 is better\nB" ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.replaceAll ( java.util.Arrays.asList ( repl ) ) ; assertNotSame ( o , n ) ; assertEquals ( ( "A\n" + ( ( "<a href=\"generic-bug?42\">issue 42</a>\n" + "Really <a href=\"gwtexpui-bug?9918\">GWTEXPUI-9918</a> is better\n" ) + "B" ) ) , n.asString ( ) ) ; }

Target:
private static java.util.List < com.google.gwtexpui.safehtml.client.RegexFindReplace > repls ( com.google.gwtexpui.safehtml.client.RegexFindReplace ... repls ) { return java.util.Arrays.asList ( repls ) ; }
Source:
public boolean indexChange ( int changeId ) { try { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult result = httpSession.post ( buildEndpoint ( changeId ) ) ; if ( result.isSuccessful ( ) ) { return true ; } com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarder.log.error ( "Unable to index change {}. Cause: {}" , changeId , result.getMessage ( ) ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarder.log.error ( ( "Error trying to index change " + changeId ) , e ) ; } return false ; }

Target:
public boolean indexChange ( int changeId ) { try { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult result = httpSession.post ( buildIndexEndpoint ( changeId ) ) ; if ( result.isSuccessful ( ) ) { return true ; } com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarder.log.error ( "Unable to index change {}. Cause: {}" , changeId , result.getMessage ( ) ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarder.log.error ( ( "Error trying to index change " + changeId ) , e ) ; } return false ; }
Source:
public java.util.Set < java.lang.String > getMyOrganisationsLogins ( ) throws java.io.IOException { if ( isLoggedIn ( ) ) { try { return getMyOrganisationsLoginsViaApi ( ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.github.oauth.GitHubLogin.log.error ( ( ( "Cannot retrieve " + ( getMyself ( ) . getLogin ( ) ) ) + "'s organisations via REST API => falling back to Web HTML profile" ) , e ) ; return getMyOrganisationsLoginsViaWeb ( ) ; } } return java.util.Collections.emptySet ( ) ; }

Target:
public java.util.Set < java.lang.String > getMyOrganisationsLogins ( ) throws java.io.IOException { if ( isLoggedIn ( ) ) { return getHub ( ) . getMyOrganizations ( ) . keySet ( ) ; } return java.util.Collections.emptySet ( ) ; }
Source:
protected boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Branch.NameKey branchName , com.google.gerrit.server.CurrentUser user ) { com.google.gerrit.server.project.ProjectState pe = projectCache.get ( branchName.getParentKey ( ) ) ; if ( pe == null ) { return false ; } com.google.gerrit.server.project.ProjectControl pc = pe.controlFor ( user ) ; return pc.controlForRef ( branchName ) . isVisible ( ) ; }

Target:
protected boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Branch.NameKey branchName , com.google.gerrit.server.CurrentUser user ) throws com.google.gerrit.server.permissions.PermissionBackendException { com.google.gerrit.server.project.ProjectState pe = projectCache.get ( branchName.getParentKey ( ) ) ; if ( pe == null ) { return false ; } return permissionBackend.user ( user ) . ref ( branchName ) . test ( RefPermission.READ ) ; }
Source:
public void testInsertOneDBException ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.SQLException exception = new java.sql.BatchUpdateException ( ) ; java.sql.PreparedStatement insert = stubStatementThrowExceptionOnExecute ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT , exception ) ; com.google.gwtorm.jdbc.JdbcAccess < com.google.gwtorm.jdbc.TestJdbcAccess.Data , com.google.gwtorm.jdbc.TestJdbcAccess.Data.DataKey > classUnderTest = createClassUnderTest ( ) ; try { classUnderTest.insert ( oneRow ) ; org.junit.Assert.fail ( "missingException" ) ; } catch ( com.google.gwtorm.server.OrmException e ) { org.junit.Assert.assertSame ( e.getCause ( ) , exception ) ; } com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( insert ) ; }

Target:
public void testUpdateOneException ( ) throws java.sql.SQLException { sqlException = new java.sql.BatchUpdateException ( ) ; java.sql.PreparedStatement update = stubStatementThrowExceptionOnExecute ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.UPDATE , sqlException ) ; try { classUnderTest.update ( oneRow ) ; org.junit.Assert.fail ( "missingException" ) ; } catch ( com.google.gwtorm.server.OrmException e ) { org.junit.Assert.assertSame ( e.getCause ( ) , sqlException ) ; } assertCorrectUpdating ( update , 1 ) ; }
Source:
private PushOneCommit.Result createCommitAndPush ( org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.InMemoryRepository > repo , java.lang.String ref , java.lang.String commitMsg , java.lang.String fileName , java.lang.String content ) throws java.lang.Exception { return pushFactory.create ( db , admin.getIdent ( ) , repo , commitMsg , fileName , content ) . to ( ref ) ; }

Target:
public boolean visit ( java.lang.String name , com.google.gerrit.extensions.common.ActionInfo actionInfo , com.google.gerrit.extensions.common.ChangeInfo changeInfo ) { return true ; }
Source:
public void testUnblockForce ( ) { com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) ; r.setBlock ( ) ; r.setForce ( true ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , 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 ) ; assertTrue ( "u can force push" , u.controlForRef ( "refs/heads/master" ) . canForceUpdate ( ) ) ; }

Target:
public void testUnblockForceWithAllowNoForce_NotPossible ( ) { com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) ; r.setBlock ( ) ; r.setForce ( true ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't force push" , u.controlForRef ( "refs/heads/master" ) . canForceUpdate ( ) ) ; }
Source:
public com.google.gerrit.reviewdb.client.AccountSshKey addKey ( java.lang.String pub ) { com.google.common.base.Preconditions.checkState ( ( ( keys ) != null ) , "SSH keys not loaded yet" ) ; int seq = ( keys.isEmpty ( ) ) ? 1 : ( keys.size ( ) ) + 1 ; com.google.gerrit.reviewdb.client.AccountSshKey.Id keyId = new com.google.gerrit.reviewdb.client.AccountSshKey.Id ( accountId , seq ) ; com.google.gerrit.reviewdb.client.AccountSshKey key = new com.google.gerrit.server.account.VersionedAuthorizedKeys.SimpleSshKeyCreator ( ) . create ( keyId , pub ) ; keys.add ( com.google.common.base.Optional.of ( key ) ) ; return key ; }

Target:
public com.google.gerrit.reviewdb.client.AccountSshKey addKey ( java.lang.String pub ) { com.google.common.base.Preconditions.checkState ( ( ( keys ) != null ) , "SSH keys not loaded yet" ) ; int seq = ( keys.isEmpty ( ) ) ? 1 : ( keys.size ( ) ) + 1 ; com.google.gerrit.reviewdb.client.AccountSshKey.Id keyId = new com.google.gerrit.reviewdb.client.AccountSshKey.Id ( accountId , seq ) ; com.google.gerrit.reviewdb.client.AccountSshKey key = new com.google.gerrit.server.account.VersionedAuthorizedKeys.SimpleSshKeyCreator ( ) . create ( keyId , pub ) ; keys.add ( java.util.Optional.of ( key ) ) ; return key ; }
Source:
public void suggestReviewersChange ( ) throws java.io.IOException , java.lang.Exception , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; java.util.List < com.google.gerrit.server.change.SuggestReviewers.SuggestedReviewerInfo > reviewers = suggestReviewers ( changeId , "u" , 6 ) ; org.junit.Assert.assertEquals ( reviewers.size ( ) , 6 ) ; reviewers = suggestReviewers ( changeId , "u" , 5 ) ; org.junit.Assert.assertEquals ( reviewers.size ( ) , 5 ) ; reviewers = suggestReviewers ( changeId , "users3" , 10 ) ; org.junit.Assert.assertEquals ( reviewers.size ( ) , 1 ) ; }

Target:
public void suggestReviewersChange ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > reviewers = suggestReviewers ( changeId , "u" , 6 ) ; com.google.common.truth.Truth.assertThat ( reviewers ) . hasSize ( 6 ) ; reviewers = suggestReviewers ( changeId , "u" , 5 ) ; com.google.common.truth.Truth.assertThat ( reviewers ) . hasSize ( 5 ) ; reviewers = suggestReviewers ( changeId , "users3" , 10 ) ; com.google.common.truth.Truth.assertThat ( reviewers ) . hasSize ( 1 ) ; }
Source:
com.google.gerrit.server.account.externalids.ExternalId get ( com.google.gerrit.server.account.externalids.ExternalId.Key key ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { checkReadEnabled ( ) ; try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allUsersName ) ; org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { org.eclipse.jgit.lib.ObjectId rev = com.google.gerrit.server.account.externalids.ExternalIdReader.readRevision ( repo ) ; if ( rev.equals ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) ) ) { return null ; } return com.google.gerrit.server.account.externalids.ExternalIdReader.parse ( key , rw , rev ) ; } }

Target:
com.google.gerrit.server.account.externalids.ExternalId get ( com.google.gerrit.server.account.externalids.ExternalId.Key key , org.eclipse.jgit.lib.ObjectId rev ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { checkReadEnabled ( ) ; try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allUsersName ) ) { return com.google.gerrit.server.account.externalids.ExternalIdNotes.loadReadOnly ( repo , rev ) . get ( key ) . orElse ( null ) ; } }
Source:
private synchronized void define ( java.lang.String name , com.google.gerrit.metrics.Description desc ) { if ( descriptions.containsKey ( name ) ) { throw new java.lang.IllegalStateException ( java.lang.String.format ( "metric %s already defined" , name ) ) ; } descriptions.put ( name , desc.getAnnotations ( ) ) ; }

Target:
private synchronized void define ( java.lang.String name , com.google.gerrit.metrics.Description desc ) { if ( descriptions.containsKey ( name ) ) { com.google.common.collect.ImmutableMap < java.lang.String , java.lang.String > annotations = descriptions.get ( name ) ; if ( ! ( desc.getAnnotations ( ) . get ( Description.DESCRIPTION ) . equals ( annotations.get ( Description.DESCRIPTION ) ) ) ) { throw new java.lang.IllegalStateException ( java.lang.String.format ( "metric %s already defined" , name ) ) ; } } else { descriptions.put ( name , desc.getAnnotations ( ) ) ; } }
Source:
public com.google.gerrit.client.ui.InlineHyperlink getNextPatchLink ( int index , com.google.gerrit.client.patches.PatchScreen.Type patchType ) { if ( index < ( ( patchList.size ( ) ) - 1 ) ) return createLink ( ( index + 1 ) , patchType , null , com.google.gwtexpui.safehtml.client.SafeHtml.asis ( Util.C.nextPatchLinkIcon ( ) ) ) ; return null ; }

Target:
public com.google.gerrit.client.ui.InlineHyperlink getNextPatchLink ( int index , com.google.gerrit.client.patches.PatchScreen.Type patchType ) { for ( index ++ ; index < ( patchList.size ( ) ) ; index ++ ) { com.google.gerrit.client.ui.InlineHyperlink link = createLink ( index , patchType , null , com.google.gwtexpui.safehtml.client.SafeHtml.asis ( Util.C.nextPatchLinkIcon ( ) ) ) ; if ( link != null ) { return link ; } } return null ; }
Source:
public void testNonIndexPredicate ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "foo:a" ) ; com.google.common.truth.Truth.assertThat ( in ) . isSameAs ( rewrite ( in ) ) ; }

Target:
public void testNonIndexPredicate ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "foo:a" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.query.change.AndSource.class ) . isSameAs ( out.getClass ( ) ) ; com.google.common.truth.Truth.assertThat ( out.getChildren ( ) ) . containsExactly ( query ( com.google.gerrit.server.query.change.ChangeStatusPredicate.open ( ) ) , in ) . inOrder ( ) ; }
Source:
private void display ( final com.google.gerrit.client.reviewdb.AccountGeneralPreferences p ) { showSiteHeader.setValue ( p.isShowSiteHeader ( ) ) ; useFlashClipboard.setValue ( p.isUseFlashClipboard ( ) ) ; displayDefaultContext ( p.getDefaultContext ( ) ) ; }

Target:
private void display ( final com.google.gerrit.client.reviewdb.AccountGeneralPreferences p ) { showSiteHeader.setValue ( p.isShowSiteHeader ( ) ) ; useFlashClipboard.setValue ( p.isUseFlashClipboard ( ) ) ; setListBox ( maximumPageSize , com.google.gerrit.client.reviewdb.AccountGeneralPreferences.DEFAULT_PAGESIZE , p.getMaximumPageSize ( ) ) ; setListBox ( defaultContext , com.google.gerrit.client.reviewdb.AccountGeneralPreferences.DEFAULT_CONTEXT , p.getDefaultContext ( ) ) ; }
Source:
private static com.googlecode.prolog_cafe.lang.BufferingPrologControl newEmptyMachine ( java.lang.ClassLoader cl ) { com.googlecode.prolog_cafe.lang.BufferingPrologControl ctl = new com.googlecode.prolog_cafe.lang.BufferingPrologControl ( ) ; ctl.setMaxArity ( PrologEnvironment.MAX_ARITY ) ; ctl.setMaxDatabaseSize ( com.google.gerrit.rules.RulesCache.DB_MAX ) ; ctl.setPrologClassLoader ( new com.googlecode.prolog_cafe.lang.PrologClassLoader ( cl ) ) ; ctl.setEnabled ( java.util.EnumSet.allOf ( Prolog.Feature.class ) , false ) ; return ctl ; }

Target:
private static com.googlecode.prolog_cafe.lang.BufferingPrologControl newEmptyMachine ( java.lang.ClassLoader cl ) { com.googlecode.prolog_cafe.lang.BufferingPrologControl ctl = new com.googlecode.prolog_cafe.lang.BufferingPrologControl ( ) ; ctl.setMaxArity ( PrologEnvironment.MAX_ARITY ) ; ctl.setMaxDatabaseSize ( com.google.gerrit.rules.RulesCache.DB_MAX ) ; ctl.setPrologClassLoader ( new com.googlecode.prolog_cafe.lang.PrologClassLoader ( cl ) ) ; ctl.setEnabled ( java.util.EnumSet.allOf ( Prolog.Feature.class ) , false ) ; ctl.initialize ( com.google.gerrit.rules.RulesCache.PACKAGE_LIST ) ; return ctl ; }
Source:
public void unblockForceEditTopicName ( ) { 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 = user ( local , com.google.gerrit.server.project.Util.DEVS ) ; com.google.common.truth.Truth.assertThat ( u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) . named ( "u can edit topic name" ) . isTrue ( ) ; }

Target:
public void usernamePatternNonRegex ( ) { 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 , "u" , com.google.gerrit.server.project.testing.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = user ( local , "d" , com.google.gerrit.server.project.testing.Util.DEVS ) ; assertCannotRead ( "refs/sb/d/heads/foobar" , u ) ; assertCanRead ( "refs/sb/d/heads/foobar" , d ) ; }
Source:
public com.google.gerrit.server.patch.PatchList get ( final com.google.gerrit.server.patch.PatchListKey key ) { return self.get ( key ) ; }

Target:
public com.google.gerrit.server.patch.PatchList get ( final com.google.gerrit.server.patch.PatchListKey key ) { if ( com.google.gerrit.server.patch.PatchListCacheImpl.dynamic ) { try { return compute ( key ) ; } catch ( java.lang.Exception e ) { throw new java.lang.RuntimeException ( ( "Cannot lookup " + key ) , e ) ; } } return self.get ( key ) ; }
Source:
protected void migrateData ( final com.google.gerrit.reviewdb.server.ReviewDb db , final com.google.gerrit.server.schema.UpdateUI ui ) throws java.sql.SQLException { final java.sql.Statement stmt = ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) . getConnection ( ) . createStatement ( ) ; try { stmt.executeUpdate ( "UPDATE account_diff_preferences SET show_line_endings='Y'" ) ; } finally { stmt.close ( ) ; } }

Target:
protected void migrateData ( final com.google.gerrit.reviewdb.server.ReviewDb db , final com.google.gerrit.server.schema.UpdateUI ui ) throws java.sql.SQLException { try ( java.sql.Statement stmt = newStatement ( db ) ) { stmt.executeUpdate ( "UPDATE account_diff_preferences SET show_line_endings='Y'" ) ; } }
Source:
private com.google.common.collect.SetMultimap < org.eclipse.jgit.lib.ObjectId , org.eclipse.jgit.lib.Ref > changeRefsById ( ) throws java.io.IOException { if ( ( refsById ) == null ) { refsById = com.google.common.collect.HashMultimap.create ( ) ; for ( org.eclipse.jgit.lib.Ref r : repo.getRefDatabase ( ) . getRefs ( "refs/changes/" ) . values ( ) ) { if ( com.google.gerrit.reviewdb.client.PatchSet.isRef ( r.getName ( ) ) ) { refsById.put ( r.getObjectId ( ) , r ) ; } } } return refsById ; }

Target:
private com.google.common.collect.SetMultimap < org.eclipse.jgit.lib.ObjectId , org.eclipse.jgit.lib.Ref > changeRefsById ( ) throws java.io.IOException { if ( ( refsById ) == null ) { refsById = com.google.common.collect.HashMultimap.create ( ) ; for ( org.eclipse.jgit.lib.Ref r : repo.getRefDatabase ( ) . getRefs ( com.google.gerrit.reviewdb.client.RefNames.REFS_CHANGES ) . values ( ) ) { if ( com.google.gerrit.reviewdb.client.PatchSet.isRef ( r.getName ( ) ) ) { refsById.put ( r.getObjectId ( ) , r ) ; } } } return refsById ; }
Source:
public com.google.gerrit.server.events.RefUpdatedEvent getOneRefUpdate ( java.lang.String project , java.lang.String refName ) { java.lang.String key = com.google.gerrit.acceptance.EventRecorder.key ( RefUpdatedEvent.TYPE , project , refName ) ; com.google.common.truth.Truth.assertThat ( recordedEvents ) . containsKey ( key ) ; java.util.Collection < com.google.gerrit.server.events.RefEvent > events = recordedEvents.get ( key ) ; com.google.common.truth.Truth.assertThat ( events ) . hasSize ( 1 ) ; com.google.gerrit.server.events.Event e = events.iterator ( ) . next ( ) ; com.google.common.truth.Truth.assertThat ( e ) . isInstanceOf ( com.google.gerrit.server.events.RefUpdatedEvent.class ) ; return ( ( com.google.gerrit.server.events.RefUpdatedEvent ) ( e ) ) ; }

Target:
public T apply ( com.google.gerrit.server.events.RefEvent e ) { return ( ( T ) ( e ) ) ; }
Source:
public void requestReceived ( com.github.tomakehurst.wiremock.http.Request request , com.github.tomakehurst.wiremock.http.Response response ) { if ( request.getAbsoluteUrl ( ) . contains ( expectedRequest ) ) { try { checkPoint.await ( ) ; } catch ( java.lang.InterruptedException | java.util.concurrent.BrokenBarrierException e ) { org.junit.Assert.fail ( ) ; } } }

Target:
public void doAction ( ) throws java.lang.Exception { gApi.groups ( ) . id ( someGroupId ) . addGroups ( someOtherGroupId ) ; }
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:
public void missingRepo ( ) throws java.lang.Exception { assumeNoteDbDisabled ( ) ; 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 ) ) ) ; }
Source:
public void testUnblockInLocalVisibilityByRegisteredUsers_Fails ( ) { com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( 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 testUnblockInLocalVisibilityByRegisteredUsers_Fails ( ) { com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( 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 ) ; com.google.common.truth.Truth.assertThat ( u.controlForRef ( "refs/heads/master" ) . isVisibleByRegisteredUsers ( ) ) . named ( "u can't read" ) . isFalse ( ) ; }
Source:
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 ) ; }

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.setAccountInfoCache ( lastScript.getCommentDetail ( ) . getAccounts ( ) ) ; fileList.display ( idSideA , result ) ; patchIndex = fileList.indexOf ( patchKey ) ; } refresh ( true ) ; }
Source:
public final AccountGroup.Id getAdministrators ( ) { return administrators ; }

Target:
private com.google.gerrit.client.reviewdb.AccountGroup lookup ( final com.google.gerrit.client.reviewdb.AccountGroup.NameKey groupName ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.ReviewDb db = schema.open ( ) ; try { return db.accountGroups ( ) . get ( groupName ) ; } finally { db.close ( ) ; } }
Source:
private static java.lang.String KD ( java.lang.String secret , java.lang.String data ) { try { java.security.MessageDigest md = com.google.gerrit.httpd.ProjectDigestFilter.newMD5 ( ) ; md.update ( secret.getBytes ( "UTF-8" ) ) ; md.update ( ( ( byte ) ( ':' ) ) ) ; md.update ( data.getBytes ( "UTF-8" ) ) ; return com.google.gerrit.httpd.ProjectDigestFilter.LHEX ( md.digest ( ) ) ; } catch ( java.io.UnsupportedEncodingException e ) { throw new java.lang.RuntimeException ( "UTF-8 encoding not available" , e ) ; } }

Target:
private static java.lang.String KD ( java.lang.String secret , java.lang.String data ) { java.security.MessageDigest md = com.google.gerrit.httpd.ProjectDigestFilter.newMD5 ( ) ; md.update ( secret.getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ; md.update ( ( ( byte ) ( ':' ) ) ) ; md.update ( data.getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ; return com.google.gerrit.httpd.ProjectDigestFilter.LHEX ( md.digest ( ) ) ; }
Source:
protected void setUp ( ) throws java.lang.Exception { repo = new org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.storage.dfs.DfsRepository > ( new org.eclipse.jgit.storage.dfs.InMemoryRepository ( new org.eclipse.jgit.storage.dfs.DfsRepositoryDescription ( "test" ) ) ) ; servlet = new com.google.gitiles.RepositoryIndexServlet ( new com.google.gitiles.DefaultRenderer ( ) , new com.google.gitiles.TestGitilesAccess ( repo.getRepository ( ) ) , new com.google.gitiles.TimeCache ( ) ) ; }

Target:
protected void setUp ( ) throws java.lang.Exception { repo = new org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.DfsRepository > ( new org.eclipse.jgit.internal.storage.dfs.InMemoryRepository ( new org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription ( "test" ) ) ) ; servlet = new com.google.gitiles.RepositoryIndexServlet ( new com.google.gitiles.DefaultRenderer ( ) , new com.google.gitiles.TestGitilesAccess ( repo.getRepository ( ) ) , new com.google.gitiles.TimeCache ( ) ) ; }
Source:
void addReplyBox ( ) { getCommentManager ( ) . addDraftBox ( getCm ( ) . side ( ) , com.google.gerrit.client.changes.CommentInfo.createReply ( comment ) ) . setEdit ( true ) ; }

Target:
void addReplyBox ( boolean quote ) { com.google.gerrit.client.changes.CommentInfo commentReply = com.google.gerrit.client.changes.CommentInfo.createReply ( comment ) ; if ( quote ) { commentReply.message ( com.google.gerrit.client.change.ReplyBox.quote ( comment.message ( ) ) ) ; } getCommentManager ( ) . addDraftBox ( getCm ( ) . side ( ) , commentReply ) . setEdit ( true ) ; }
Source:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.project.ChangeControl changeControl , java.lang.String filePath ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.Project.NameKey project = changeControl.getChange ( ) . getProject ( ) ; try ( org.eclipse.jgit.lib.Repository repository = repositoryManager.openRepository ( project ) ) { editModifier.deleteFile ( repository , changeControl , filePath ) ; } catch ( com.google.gerrit.server.project.InvalidChangeOperationException e ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( e.getMessage ( ) ) ; } return com.google.gerrit.extensions.restapi.Response.none ( ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.change.ChangeResource rsrc , java.lang.String filePath ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException , java.io.IOException { try ( org.eclipse.jgit.lib.Repository repository = repositoryManager.openRepository ( rsrc.getProject ( ) ) ) { editModifier.deleteFile ( repository , rsrc.getNotes ( ) , filePath ) ; } catch ( com.google.gerrit.server.project.InvalidChangeOperationException e ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( e.getMessage ( ) ) ; } return com.google.gerrit.extensions.restapi.Response.none ( ) ; }
Source:
protected com.google.gwtorm.data.PhoneBookDb openAndCreate ( ) throws com.google.gwtorm.client.OrmException { final com.google.gwtorm.data.PhoneBookDb schema = open ( ) ; schema.updateSchema ( ) ; return schema ; }

Target:
protected com.google.gwtorm.data.PhoneBookDb openAndCreate ( ) throws com.google.gwtorm.client.OrmException { final com.google.gwtorm.data.PhoneBookDb schema = open ( ) ; final com.google.gwtorm.jdbc.JdbcExecutor e = new com.google.gwtorm.jdbc.JdbcExecutor ( ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( schema ) ) ) ; try { schema.updateSchema ( e ) ; } finally { e.close ( ) ; } return schema ; }
Source:
public boolean isVisible ( ) { return ( ( ( ( ( user ) instanceof com.google.gerrit.server.InternalUser ) || ( groupBackend.isVisibleToAll ( group.getGroupUUID ( ) ) ) ) || ( user.getEffectiveGroups ( ) . contains ( group.getGroupUUID ( ) ) ) ) || ( user.getCapabilities ( ) . canAdministrateServer ( ) ) ) || ( isOwner ( ) ) ; }

Target:
public boolean isVisible ( ) { return ( ( ( ( user.isInternalUser ( ) ) || ( groupBackend.isVisibleToAll ( group.getGroupUUID ( ) ) ) ) || ( user.getEffectiveGroups ( ) . contains ( group.getGroupUUID ( ) ) ) ) || ( user.getCapabilities ( ) . canAdministrateServer ( ) ) ) || ( isOwner ( ) ) ; }
Source:
private void insertChangeRow ( final int row ) { insertRow ( row ) ; setStyleName ( row , com.google.gerrit.client.changes.ChangeTable.C_ID , "gerrit-ChangeTable-ColumnID" ) ; final com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter fmt = table.getFlexCellFormatter ( ) ; for ( int i = com.google.gerrit.client.changes.ChangeTable.C_ID ; i < ( com.google.gerrit.client.changes.ChangeTable.COLUMNS ) ; i ++ ) { fmt.addStyleName ( row , i , "gerrit-ChangeTable-Cell" ) ; } }

Target:
private void insertNoneRow ( final int row ) { insertRow ( row ) ; table.setText ( row , 0 , Util.C.changeTableNone ( ) ) ; final com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter fmt = table.getFlexCellFormatter ( ) ; fmt.setColSpan ( row , 0 , com.google.gerrit.client.changes.ChangeTable.COLUMNS ) ; fmt.setStyleName ( row , 0 , com.google.gerrit.client.changes.ChangeTable.S_EMPTY_SECTION ) ; }
Source:
private static void addFooter ( java.lang.StringBuilder sb , org.eclipse.jgit.revwalk.FooterKey footer , java.lang.Object ... values ) { com.google.gerrit.server.notedb.ChangeUpdate.addFooter ( sb , footer ) ; for ( java.lang.Object value : values ) { sb.append ( value ) ; } sb.append ( '\n' ) ; }

Target:
private static void addFooter ( java.lang.StringBuilder sb , org.eclipse.jgit.revwalk.FooterKey footer , java.lang.Object ... values ) { com.google.gerrit.server.notedb.ChangeUpdate.addFooter ( sb , footer ) ; for ( java.lang.Object value : values ) { sb.append ( com.google.gerrit.server.notedb.ChangeNoteUtil.sanitizeFooter ( java.util.Objects.toString ( value ) ) ) ; } sb.append ( '\n' ) ; }
Source:
java.lang.Runnable toggleOpenBox ( final net.codemirror.lib.CodeMirror cm ) { return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { if ( cm.extras ( ) . hasActiveLine ( ) ) { com.google.gerrit.client.diff.UnifiedCommentGroup w = map ( cm.side ( ) ) . get ( ( ( cm.getLineNumber ( cm.extras ( ) . activeLine ( ) ) ) + 1 ) ) ; if ( w != null ) { w.openCloseLast ( ) ; } } } } ; }

Target:
java.lang.String getTokenSuffixForActiveLine ( net.codemirror.lib.CodeMirror cm ) { int cmLinePlusOne = ( cm.getLineNumber ( cm.extras ( ) . activeLine ( ) ) ) + 1 ; com.google.gerrit.client.diff.UnifiedChunkManager.LineRegionInfo info = ( ( com.google.gerrit.client.diff.Unified ) ( host ) ) . getLineRegionInfoFromCmLine ( ( cmLinePlusOne - 1 ) ) ; return ( ( info.getSide ( ) ) == ( DisplaySide.A ) ? "a" : "" ) + cmLinePlusOne ; }
Source:
public void postEvent ( com.google.gerrit.reviewdb.client.Branch.NameKey branchName , com.google.gerrit.server.events.Event event ) { fireEvent ( branchName , event ) ; }

Target:
private void fireEvent ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.common.Event event , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.common.ChangeHookRunner.EventListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( change , holder.user , db ) ) { holder.listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }
Source:
protected com.google.gerrit.common.data.PermissionRule block ( java.lang.String permission , com.google.gerrit.reviewdb.client.AccountGroup.UUID id , java.lang.String ref ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.common.data.PermissionRule rule = com.google.gerrit.server.project.Util.block ( cfg , permission , id , ref ) ; saveProjectConfig ( project , cfg ) ; return rule ; }

Target:
protected org.eclipse.jgit.revwalk.RevCommit getRemoteHead ( ) throws java.lang.Exception { return getRemoteHead ( project , "master" ) ; }
Source:
public void testUpsertTwoSecondExistsing ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { stubExecuteBatchOK ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 0 , 1 ) ; java.sql.PreparedStatement insert = stubExecuteBatchOK ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT , 1 ) ; createClassUnderTest ( ) . upsert ( com.google.gwtorm.jdbc.TestJdbcAccess.TWO_ROWS ) ; verifyIds ( insert , 1 ) ; }

Target:
public void testUpsertTwoSecondExisting ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 0 , 1 ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT , 1 ) ; createClassUnderTest ( ) . upsert ( twoRows ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( update ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( insert ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertExpectedIdsUsed ( insert , 1 ) ; }
Source:
public void basicGroupProperties ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.GroupInfo createdGroup = gApi.groups ( ) . create ( name ( "group" ) ) . get ( ) ; com.google.gerrit.server.group.InternalGroup reviewDbGroup = groups.getGroup ( db , new com.google.gerrit.reviewdb.client.AccountGroup.UUID ( createdGroup.id ) ) . get ( ) ; deleteGroupRefs ( reviewDbGroup ) ; com.google.common.truth.Truth.assertThat ( rebuild ( reviewDbGroup ) ) . isEqualTo ( roundToSecond ( reviewDbGroup ) ) ; }

Target:
public void basicGroupProperties ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.GroupInfo createdGroup = gApi.groups ( ) . create ( name ( "group" ) ) . get ( ) ; com.google.gerrit.server.group.InternalGroup reviewDbGroup = groups.getGroup ( db , new com.google.gerrit.reviewdb.client.AccountGroup.UUID ( createdGroup.id ) ) . get ( ) ; deleteGroupRefs ( reviewDbGroup ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.acceptance.api.group.GroupRebuilderIT.removeRefState ( rebuild ( reviewDbGroup ) ) ) . isEqualTo ( roundToSecond ( reviewDbGroup ) ) ; }
Source:
private boolean matchGroup ( com.google.gerrit.reviewdb.AccountGroup.UUID uuid ) { java.util.Set < com.google.gerrit.reviewdb.AccountGroup.UUID > userGroups = getCurrentUser ( ) . getEffectiveGroups ( ) ; if ( AccountGroup.PROJECT_OWNERS.equals ( uuid ) ) { com.google.gerrit.server.project.ProjectState state = projectControl.getProjectState ( ) ; return com.google.gerrit.common.CollectionsUtil.isAnyIncludedIn ( state.getOwners ( ) , userGroups ) ; } else { return userGroups.contains ( uuid ) ; } }

Target:
private boolean matchGroup ( com.google.gerrit.reviewdb.AccountGroup.UUID uuid ) { java.util.Set < com.google.gerrit.reviewdb.AccountGroup.UUID > userGroups = getCurrentUser ( ) . getEffectiveGroups ( ) ; if ( AccountGroup.PROJECT_OWNERS.equals ( uuid ) ) { com.google.gerrit.server.project.ProjectState state = projectControl.getProjectState ( ) ; return com.google.gerrit.common.CollectionsUtil.isAnyIncludedIn ( state.getAllOwners ( ) , userGroups ) ; } else { return userGroups.contains ( uuid ) ; } }