auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testGetCachePatterns ( ) throws java.lang.Exception { globalPluginConfig.setStringList ( com.ericsson.gerrit.plugins.highavailability.Configuration.CACHE_SECTION , null , com.ericsson.gerrit.plugins.highavailability.Configuration.PATTERN_KEY , com.google.common.collect.ImmutableList.of ( "^my_cache.*" , "other" ) ) ; com.google.common.truth.Truth.assertThat ( getConfiguration ( ) . cache ( ) . patterns ( ) ) . containsExactly ( "^my_cache.*" , "other" ) ; }

Target:
public void testGetCachePatterns ( ) throws java.lang.Exception { globalPluginConfig.setStringList ( com.ericsson.gerrit.plugins.highavailability.Configuration.CACHE_SECTION , null , com.ericsson.gerrit.plugins.highavailability.Configuration.PATTERN_KEY , com.google.common.collect.ImmutableList.of ( "^my_cache.*" , "other" ) ) ; com.google.common.truth.Truth.assertThat ( getConfiguration ( ) . cache ( ) . patterns ( ) ) . containsExactly ( "^my_cache.*" , "other" ) . inOrder ( ) ; }
Source:
public void abandonReviewableWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; abandon ( sc.changeId , sc.owner ) ; assertThat ( sender ) . sent ( "abandon" , sc ) . notTo ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; }

Target:
public void abandonWipChangeNotifyAll ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; abandon ( sc.changeId , sc.owner , com.google.gerrit.extensions.api.changes.NotifyHandling.ALL ) ; assertThat ( sender ) . sent ( "abandon" , sc ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) . noOneElse ( ) ; }
Source:
private int search ( final java.lang.String fileName ) { int high = patches.length ; int low = 0 ; while ( low < high ) { final int mid = ( low + high ) > > > 1 ; final int cmp = patches [ mid ] . getNewName ( ) . compareTo ( fileName ) ; if ( cmp < 0 ) low = mid + 1 ; else if ( cmp == 0 ) return mid ; else high = mid ; } return - ( low + 1 ) ; }

Target:
public com.google.gerrit.server.patch.PatchListEntry get ( final java.lang.String fileName ) { final int index = search ( fileName ) ; return 0 <= index ? patches.get ( index ) : com.google.gerrit.server.patch.PatchListEntry.empty ( fileName ) ; }
Source:
private static com.google.gerrit.server.query.change.ListChanges.GitPerson toGitPerson ( com.google.gerrit.reviewdb.client.UserIdentity committer ) { com.google.gerrit.server.query.change.ListChanges.GitPerson p = new com.google.gerrit.server.query.change.ListChanges.GitPerson ( ) ; p.name = committer.getName ( ) ; p.email = committer.getEmail ( ) ; p.date = committer.getDate ( ) ; p.tz = committer.getTimeZone ( ) ; return p ; }

Target:
private static com.google.gerrit.server.change.ChangeJson.GitPerson toGitPerson ( com.google.gerrit.reviewdb.client.UserIdentity committer ) { com.google.gerrit.server.change.ChangeJson.GitPerson p = new com.google.gerrit.server.change.ChangeJson.GitPerson ( ) ; p.name = committer.getName ( ) ; p.email = committer.getEmail ( ) ; p.date = committer.getDate ( ) ; p.tz = committer.getTimeZone ( ) ; return p ; }
Source:
com.googlesource.gerrit.plugins.gitiles.FilteredRepository create ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws com.google.gerrit.server.project.NoSuchProjectException , java.io.IOException { com.google.gerrit.server.project.ProjectControl ctl = projectControlFactory.controlFor ( name , userProvider.get ( ) ) ; if ( ! ( ctl.isVisible ( ) ) ) { throw new com.google.gerrit.server.project.NoSuchProjectException ( name ) ; } org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( name ) ; return new com.googlesource.gerrit.plugins.gitiles.FilteredRepository ( ctl , repo , new com.google.gerrit.server.git.VisibleRefFilter ( tagCache , changeCache , repo , ctl , db.get ( ) , true ) ) ; }

Target:
com.googlesource.gerrit.plugins.gitiles.FilteredRepository create ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws com.google.gerrit.server.project.NoSuchProjectException , java.io.IOException { com.google.gerrit.server.project.ProjectControl ctl = projectControlFactory.controlFor ( name , userProvider.get ( ) ) ; if ( ! ( ctl.isVisible ( ) ) ) { throw new com.google.gerrit.server.project.NoSuchProjectException ( name ) ; } org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( name ) ; return new com.googlesource.gerrit.plugins.gitiles.FilteredRepository ( ctl , repo , new com.google.gerrit.server.git.VisibleRefFilter ( tagCache , changeNotesFactory , changeCache , repo , ctl , db.get ( ) , true ) ) ; }
Source:
private com.google.gerrit.server.git.strategy.SubmitStrategy createStrategy ( com.google.gerrit.server.git.MergeOpRepoManager.OpenRepo or , com.google.gerrit.server.git.MergeTip mergeTip , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.extensions.client.SubmitType submitType , com.google.gerrit.server.git.CodeReviewCommit branchTip , com.google.gerrit.server.git.SubmoduleOp submoduleOp ) throws com.google.gerrit.server.git.IntegrationException { return submitStrategyFactory.create ( submitType , db , or.repo , or.rw , or.ins , or.canMergeFlag , getAlreadyAccepted ( or , branchTip ) , destBranch , caller , mergeTip , commits , submissionId , submitInput.notify , submoduleOp ) ; }

Target:
private com.google.gerrit.server.git.strategy.SubmitStrategy createStrategy ( com.google.gerrit.server.git.MergeOpRepoManager.OpenRepo or , com.google.gerrit.server.git.MergeTip mergeTip , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.extensions.client.SubmitType submitType , com.google.gerrit.server.git.CodeReviewCommit branchTip , com.google.gerrit.server.git.SubmoduleOp submoduleOp , boolean dryrun ) throws com.google.gerrit.server.git.IntegrationException { return submitStrategyFactory.create ( submitType , db , or.repo , or.rw , or.ins , or.canMergeFlag , getAlreadyAccepted ( or , branchTip ) , destBranch , caller , mergeTip , commits , submissionId , submitInput.notify , submoduleOp , dryrun ) ; }
Source:
private void display ( com.google.gerrit.reviewdb.client.AccountExternalId id ) { java.lang.String user ; java.lang.String pass ; if ( id != null ) { user = id.getSchemeRest ( ) ; pass = id.getPassword ( ) ; } else { user = null ; pass = null ; } this . id = id ; com.google.gerrit.client.Gerrit.getUserAccount ( ) . setUserName ( user ) ; password.setText ( ( pass != null ? pass : "" ) ) ; password.setVisible ( ( pass != null ) ) ; enableUI ( true ) ; }

Target:
private void refreshHttpPassword ( ) { com.google.gerrit.client.account.AccountApi.getHttpPassword ( "self" , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.rpc.NativeString > ( this ) { @ java.lang.Override protected void preDisplay ( com.google.gerrit.client.rpc.NativeString httpPassword ) { display ( httpPassword.asString ( ) ) ; } @ java.lang.Override public void onFailure ( final java.lang.Throwable caught ) { if ( com.google.gerrit.client.rpc.RestApi.isNotFound ( caught ) ) { display ( null ) ; display ( ) ; } else { super . onFailure ( caught ) ; } } } ) ; }
Source:
public java.lang.String get ( final int idx ) { for ( int i = lastGetRange ; i < ( ranges.size ( ) ) ; i ++ ) { final com.google.gerrit.client.data.SparseFileContent.Range r = ranges.get ( i ) ; if ( r.contains ( idx ) ) { lastGetRange = i ; return r.get ( idx ) ; } } if ( ( lastGetRange ) != 0 ) { lastGetRange = 0 ; return get ( idx ) ; } throw new java.lang.ArrayIndexOutOfBoundsException ( idx ) ; }

Target:
private java.lang.String getLine ( final int idx ) { for ( int i = lastGetRange ; i < ( ranges.size ( ) ) ; i ++ ) { final com.google.gerrit.client.data.SparseFileContent.Range r = ranges.get ( i ) ; if ( r.contains ( idx ) ) { lastGetRange = i ; return r.get ( idx ) ; } } if ( ( lastGetRange ) != 0 ) { lastGetRange = 0 ; return getLine ( idx ) ; } return null ; }
Source:
private void alterTable ( com.google.gerrit.reviewdb.server.ReviewDb db , java.lang.String sqlFormat ) throws java.sql.SQLException { java.sql.Statement stmt = ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) . getConnection ( ) . createStatement ( ) ; try { stmt.executeUpdate ( java.lang.String.format ( sqlFormat , "patch_set_approvals" , "category_id" ) ) ; } finally { stmt.close ( ) ; } }

Target:
private void alterTable ( com.google.gerrit.reviewdb.server.ReviewDb db , java.lang.String sqlFormat ) throws java.sql.SQLException { try ( java.sql.Statement stmt = newStatement ( db ) ) { stmt.executeUpdate ( java.lang.String.format ( sqlFormat , "patch_set_approvals" , "category_id" ) ) ; } }
Source:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < > ( ) ; modules.add ( sysInjector.getInstance ( com.google.gerrit.sshd.SshModule.class ) ) ; if ( ! ( test ) ) { modules.add ( new com.google.gerrit.sshd.SshHostKeyModule ( ) ) ; } modules.add ( new com.google.gerrit.sshd.commands.DefaultCommandModule ( slave ) ) ; return sysInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < > ( ) ; modules.add ( sysInjector.getInstance ( com.google.gerrit.sshd.SshModule.class ) ) ; if ( ! ( test ) ) { modules.add ( new com.google.gerrit.sshd.SshHostKeyModule ( ) ) ; } modules.add ( new com.google.gerrit.sshd.commands.DefaultCommandModule ( slave , sysInjector.getInstance ( com.google.gerrit.server.config.DownloadConfig.class ) ) ) ; return sysInjector.createChildInjector ( modules ) ; }
Source:
public static com.google.gerrit.server.project.RefPatternMatcher getMatcher ( java.lang.String pattern ) { if ( pattern.contains ( "${" ) ) { return new com.google.gerrit.server.project.RefPatternMatcher.ExpandParameters ( pattern ) ; } else if ( com.google.gerrit.server.project.RefControl.isRE ( pattern ) ) { return new com.google.gerrit.server.project.RefPatternMatcher.Regexp ( pattern ) ; } else if ( pattern.endsWith ( "/*" ) ) { return new com.google.gerrit.server.project.RefPatternMatcher.Prefix ( pattern.substring ( 0 , ( ( pattern.length ( ) ) - 1 ) ) ) ; } else { return new com.google.gerrit.server.project.RefPatternMatcher.Exact ( pattern ) ; } }

Target:
public static com.google.gerrit.server.project.RefPatternMatcher getMatcher ( java.lang.String pattern ) { if ( pattern.contains ( "${" ) ) { return new com.google.gerrit.server.project.RefPatternMatcher.ExpandParameters ( pattern ) ; } else if ( com.google.gerrit.server.project.RefPattern.isRE ( pattern ) ) { return new com.google.gerrit.server.project.RefPatternMatcher.Regexp ( pattern ) ; } else if ( pattern.endsWith ( "/*" ) ) { return new com.google.gerrit.server.project.RefPatternMatcher.Prefix ( pattern.substring ( 0 , ( ( pattern.length ( ) ) - 1 ) ) ) ; } else { return new com.google.gerrit.server.project.RefPatternMatcher.Exact ( pattern ) ; } }
Source:
public void starUnstarChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; java.lang.String triplet = "p~master~" + ( r.getChangeId ( ) ) ; gApi.accounts ( ) . self ( ) . starChange ( triplet ) ; org.junit.Assert.assertTrue ( getChange ( triplet ) . starred ) ; gApi.accounts ( ) . self ( ) . unstarChange ( triplet ) ; org.junit.Assert.assertNull ( getChange ( triplet ) . starred ) ; }

Target:
public void starUnstarChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; java.lang.String triplet = "p~master~" + ( r.getChangeId ( ) ) ; gApi.accounts ( ) . self ( ) . starChange ( triplet ) ; com.google.common.truth.Truth.assertThat ( getChange ( triplet ) . starred ) . isTrue ( ) ; gApi.accounts ( ) . self ( ) . unstarChange ( triplet ) ; com.google.common.truth.Truth.assertThat ( getChange ( triplet ) . starred ) . isNull ( ) ; }
Source:
public void createEmptyEditRest ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( org.apache.http.HttpStatus.SC_NO_CONTENT , adminSession.post ( urlEdit ( ) ) . getStatusCode ( ) ) ; com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editUtil.byChange ( change ) ; org.junit.Assert.assertArrayEquals ( com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_OLD , com.google.gerrit.acceptance.edit.ChangeEditIT.toBytes ( fileUtil.getContent ( edit.get ( ) . getChange ( ) . getProject ( ) , edit.get ( ) . getRevision ( ) . get ( ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME ) ) ) ; }

Target:
public void createEmptyEditRest ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( adminSession.post ( urlEdit ( ) ) . getStatusCode ( ) ) . isEqualTo ( org.apache.http.HttpStatus.SC_NO_CONTENT ) ; com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editUtil.byChange ( change ) ; com.google.gerrit.acceptance.edit.ChangeEditIT.assertByteArray ( fileUtil.getContent ( edit.get ( ) . getChange ( ) . getProject ( ) , edit.get ( ) . getRevision ( ) . get ( ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME ) , com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_OLD ) ; }
Source:
public void publishDraftPatchSet ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createDraftChange ( ) ; com.google.gerrit.server.change.ChangeJson.ChangeInfo c = getChange ( changeId ) ; org.junit.Assert.assertEquals ( ( "p~master~" + changeId ) , c.id ) ; org.junit.Assert.assertEquals ( Change.Status.DRAFT , c.status ) ; com.google.gerrit.acceptance.RestResponse r = publishPatchSet ( changeId ) ; org.junit.Assert.assertEquals ( 204 , r.getStatusCode ( ) ) ; c = getChange ( changeId ) ; org.junit.Assert.assertEquals ( Change.Status.NEW , c.status ) ; }

Target:
public void deleteChange ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; java.lang.String triplet = "p~master~" + changeId ; com.google.gerrit.extensions.common.ChangeInfo c = get ( triplet ) ; org.junit.Assert.assertEquals ( triplet , c.id ) ; org.junit.Assert.assertEquals ( ChangeStatus.NEW , c.status ) ; com.google.gerrit.acceptance.RestResponse r = com.google.gerrit.acceptance.rest.change.DeleteDraftChangeIT.deleteChange ( changeId , adminSession ) ; org.junit.Assert.assertEquals ( "Change is not a draft" , r.getEntityContent ( ) ) ; org.junit.Assert.assertEquals ( 409 , r.getStatusCode ( ) ) ; }
Source:
public void onPluginLoad ( ) { com.google.gerrit.plugin.client.Plugin.get ( ) . screenRegex ( "project/(.*)/rev/(.*)/(.*)" , new com.googlesource.gerrit.plugins.xdocs.client.XDocScreen.Factory ( ) ) ; com.google.gerrit.plugin.client.Plugin.get ( ) . screenRegex ( "project/(.*)/(.*)" , new com.googlesource.gerrit.plugins.xdocs.client.XDocScreen.HeadFactory ( ) ) ; }

Target:
public void onPluginLoad ( ) { com.google.gerrit.plugin.client.Plugin.get ( ) . screenRegex ( "project/(.*)/rev/(.*)/(.*)" , new com.googlesource.gerrit.plugins.xdocs.client.XDocScreen.Factory ( ) ) ; com.google.gerrit.plugin.client.Plugin.get ( ) . screenRegex ( "project/(.*)/(.*)" , new com.googlesource.gerrit.plugins.xdocs.client.XDocScreen.HeadFactory ( ) ) ; com.google.gerrit.plugin.client.Plugin.get ( ) . screenRegex ( "c/(.*)/([0-9]+(\\.{2}[0-9]+)?)/(.*),unified" , new com.googlesource.gerrit.plugins.xdocs.client.XDocUnifiedDiffScreen.Factory ( ) ) ; com.google.gerrit.plugin.client.Plugin.get ( ) . screenRegex ( "c/(.*)/([0-9]+(\\.{2}[0-9]+)?)/(.*)" , new com.googlesource.gerrit.plugins.xdocs.client.XDocSideBySideDiffScreen.Factory ( ) ) ; }
Source:
public void nameValue ( ) { final java.lang.String name = "author" ; final java.lang.String value = "alice" ; final com.google.gerrit.server.query.OperatorPredicate < java.lang.String > f = f ( name , value ) ; org.junit.Assert.assertSame ( name , f.getOperator ( ) ) ; org.junit.Assert.assertSame ( value , f.getValue ( ) ) ; org.junit.Assert.assertEquals ( 0 , f.getChildren ( ) . size ( ) ) ; }

Target:
public void nameValue ( ) { final java.lang.String name = "author" ; final java.lang.String value = "alice" ; final com.google.gerrit.index.query.OperatorPredicate < java.lang.String > f = f ( name , value ) ; org.junit.Assert.assertSame ( name , f.getOperator ( ) ) ; org.junit.Assert.assertSame ( value , f.getValue ( ) ) ; org.junit.Assert.assertEquals ( 0 , f.getChildren ( ) . size ( ) ) ; }
Source:
public void testGcWithoutCapability_Error ( ) throws java.lang.Exception { com.google.gerrit.acceptance.SshSession s = new com.google.gerrit.acceptance.SshSession ( server , user ) ; s.exec ( "gerrit gc --all" ) ; assertError ( ( "One of the following capabilities is required to access this" + " resource: [runGC, maintainServer]" ) , s.getError ( ) ) ; s.close ( ) ; }

Target:
public void testGcWithoutCapability_Error ( ) throws java.lang.Exception { userSshSession.exec ( "gerrit gc --all" ) ; com.google.common.truth.Truth.assertThat ( userSshSession.hasError ( ) ) . isTrue ( ) ; java.lang.String error = userSshSession.getError ( ) ; com.google.common.truth.Truth.assertThat ( error ) . isNotNull ( ) ; assertError ( ( "One of the following capabilities is required to access this" + " resource: [runGC, maintainServer]" ) , error ) ; }
Source:
public void getProject ( ) throws java.lang.Exception { java.lang.String name = project.get ( ) ; com.google.gerrit.acceptance.RestResponse r = adminSession.get ( ( "/projects/" + name ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; com.google.gerrit.extensions.common.ProjectInfo p = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.ProjectInfo.class ) ; com.google.common.truth.Truth.assertThat ( p.name ) . isEqualTo ( name ) ; }

Target:
public void getProject ( ) throws java.lang.Exception { java.lang.String name = project.get ( ) ; com.google.gerrit.extensions.common.ProjectInfo p = gApi.projects ( ) . name ( name ) . get ( ) ; com.google.common.truth.Truth.assertThat ( p.name ) . isEqualTo ( name ) ; }
Source:
public com.google.gerrit.extensions.common.AccountInfo accountInfo ( com.google.gerrit.server.account.AccountState accountState ) { if ( ( accountState == null ) || ( ( accountState.getAccount ( ) . getId ( ) ) == null ) ) { return null ; } com.google.gerrit.reviewdb.client.Account account = accountState.getAccount ( ) ; com.google.gerrit.extensions.common.AccountInfo accountInfo = new com.google.gerrit.extensions.common.AccountInfo ( account.getId ( ) . get ( ) ) ; accountInfo.email = account.getPreferredEmail ( ) ; accountInfo.name = account.getFullName ( ) ; accountInfo.username = accountState.getUserName ( ) ; return accountInfo ; }

Target:
public com.google.gerrit.extensions.common.AccountInfo accountInfo ( com.google.gerrit.server.account.AccountState accountState ) { if ( ( accountState == null ) || ( ( accountState.getAccount ( ) . getId ( ) ) == null ) ) { return null ; } com.google.gerrit.reviewdb.client.Account account = accountState.getAccount ( ) ; com.google.gerrit.extensions.common.AccountInfo accountInfo = new com.google.gerrit.extensions.common.AccountInfo ( account.getId ( ) . get ( ) ) ; accountInfo.email = account.getPreferredEmail ( ) ; accountInfo.name = account.getFullName ( ) ; accountInfo.username = accountState.getUserName ( ) . orElse ( null ) ; return accountInfo ; }
Source:
private static void mergeImpl ( final com.google.gerrit.client.reviewdb.Branch.NameKey branch ) { try { new com.google.gerrit.git.MergeOp ( com.google.gerrit.server.GerritServer.getInstance ( ) , branch ) . merge ( ) ; } catch ( java.lang.Throwable e ) { e.printStackTrace ( ) ; } }

Target:
private static void mergeImpl ( final com.google.gerrit.client.reviewdb.Branch.NameKey branch ) { try { new com.google.gerrit.git.MergeOp ( com.google.gerrit.server.GerritServer.getInstance ( ) , branch ) . merge ( ) ; } catch ( java.lang.Throwable e ) { com.google.gerrit.git.MergeQueue.log.error ( ( ( "Merge attempt for " + branch ) + " failed" ) , e ) ; } }
Source:
public com.google.gitiles.GitilesView.Builder setPathPart ( java.lang.String path ) { switch ( type ) { case PATH : case DIFF : this . path = com.google.gitiles.GitilesView.maybeTrimLeadingAndTrailingSlash ( com.google.common.base.Preconditions.checkNotNull ( path ) ) ; return this ; case DESCRIBE : case REFS : case LOG : this . path = ( path != null ) ? com.google.gitiles.GitilesView.maybeTrimLeadingAndTrailingSlash ( path ) : null ; return this ; default : throw new java.lang.IllegalStateException ( java.lang.String.format ( "cannot set path on %s view" , type ) ) ; } }

Target:
public com.google.gitiles.GitilesView.Builder setPathPart ( java.lang.String path ) { switch ( type ) { case PATH : case DIFF : this . path = com.google.gitiles.GitilesView.maybeTrimLeadingAndTrailingSlash ( com.google.common.base.Preconditions.checkNotNull ( path ) ) ; break ; case DESCRIBE : case REFS : case LOG : this . path = ( path != null ) ? com.google.gitiles.GitilesView.maybeTrimLeadingAndTrailingSlash ( path ) : null ; break ; default : com.google.common.base.Preconditions.checkState ( ( path == null ) , "cannot set path on %s view" , type ) ; this . path = path ; break ; } return this ; }
Source:
private org.eclipse.jgit.transport.PushResult pushVia ( org.eclipse.jgit.transport.Transport tn ) throws java.io.IOException , org.eclipse.jgit.errors.NotSupportedException , org.eclipse.jgit.errors.TransportException { tn.applyConfig ( config ) ; tn.setCredentialsProvider ( credentialsProvider ) ; java.util.List < org.eclipse.jgit.transport.RemoteRefUpdate > todo = generateUpdates ( tn ) ; if ( todo.isEmpty ( ) ) { return new org.eclipse.jgit.transport.PushResult ( ) ; } com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.info ( ( ( ( "Push to " + ( uri ) ) + " references: " ) + todo ) ) ; return tn.push ( NullProgressMonitor.INSTANCE , todo ) ; }

Target:
private org.eclipse.jgit.transport.PushResult pushVia ( org.eclipse.jgit.transport.Transport tn ) throws java.io.IOException , org.eclipse.jgit.errors.NotSupportedException , org.eclipse.jgit.errors.TransportException { tn.applyConfig ( config ) ; tn.setCredentialsProvider ( credentialsProvider ) ; java.util.List < org.eclipse.jgit.transport.RemoteRefUpdate > todo = generateUpdates ( tn ) ; if ( todo.isEmpty ( ) ) { return new org.eclipse.jgit.transport.PushResult ( ) ; } com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.info ( "Push to references: {}" , uri , todo ) ; return tn.push ( NullProgressMonitor.INSTANCE , todo ) ; }
Source:
public void setUp ( ) { fs = com.google.common.jimfs.Jimfs.newFileSystem ( com.google.common.jimfs.Configuration.unix ( ) ) ; ts = new java.util.concurrent.atomic.AtomicLong ( org.joda.time.format.ISODateTimeFormat.dateTime ( ) . parseMillis ( "2010-01-30T12:00:00.000-08:00" ) ) ; }

Target:
public void setUp ( ) { fs = com.google.common.jimfs.Jimfs.newFileSystem ( com.google.common.jimfs.Configuration.unix ( ) ) ; ts = new java.util.concurrent.atomic.AtomicLong ( java.time.LocalDateTime.of ( 2010 , java.time.Month.JANUARY , 30 , 12 , 0 , 0 ) . atOffset ( java.time.ZoneOffset.ofHours ( ( - 8 ) ) ) . toInstant ( ) . toEpochMilli ( ) ) ; }
Source:
private static void createIndexes ( ) { com.google.gerrit.elasticsearch.ElasticChangeIndex.ChangeMapping openChangesMapping = new com.google.gerrit.elasticsearch.ElasticChangeIndex.ChangeMapping ( ChangeSchemaDefinitions.INSTANCE.getLatest ( ) ) ; com.google.gerrit.elasticsearch.ElasticChangeIndex.ChangeMapping closedChangesMapping = new com.google.gerrit.elasticsearch.ElasticChangeIndex.ChangeMapping ( ChangeSchemaDefinitions.INSTANCE.getLatest ( ) ) ; openChangesMapping.closedChanges = null ; closedChangesMapping.openChanges = null ; com.google.gerrit.elasticsearch.ElasticQueryChangesTest.nodeInfo.node.client ( ) . admin ( ) . indices ( ) . prepareCreate ( com.google.gerrit.elasticsearch.ElasticQueryChangesTest.INDEX_NAME ) . addMapping ( com.google.gerrit.elasticsearch.ElasticChangeIndex.OPEN_CHANGES , ElasticTestUtils.gson.toJson ( openChangesMapping ) ) . addMapping ( com.google.gerrit.elasticsearch.ElasticChangeIndex.CLOSED_CHANGES , ElasticTestUtils.gson.toJson ( closedChangesMapping ) ) . execute ( ) . actionGet ( ) ; }

Target:
public void cleanupIndex ( ) { if ( ( com.google.gerrit.elasticsearch.ElasticQueryChangesTest.nodeInfo ) != null ) { com.google.gerrit.elasticsearch.ElasticTestUtils.deleteAllIndexes ( com.google.gerrit.elasticsearch.ElasticQueryChangesTest.nodeInfo ) ; com.google.gerrit.elasticsearch.ElasticTestUtils.createAllIndexes ( com.google.gerrit.elasticsearch.ElasticQueryChangesTest.nodeInfo ) ; } }
Source:
private java.lang.Runnable doScroll ( final net.codemirror.lib.CodeMirror cm ) { final net.codemirror.lib.CodeMirror other = ( cm == ( cmA ) ) ? cmB : cmA ; return new java.lang.Runnable ( ) { public void run ( ) { cm.scrollToY ( other.getScrollInfo ( ) . getTop ( ) ) ; } } ; }

Target:
private java.lang.Runnable doScroll ( final net.codemirror.lib.CodeMirror cm ) { final net.codemirror.lib.CodeMirror other = otherCM ( cm ) ; return new java.lang.Runnable ( ) { public void run ( ) { cm.scrollToY ( other.getScrollInfo ( ) . getTop ( ) ) ; } } ; }
Source:
public static org.eclipse.jgit.api.Git cloneProject ( java.lang.String url ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { final java.io.File gitDir = com.google.gerrit.acceptance.TempFileUtil.createTempDirectory ( ) ; final org.eclipse.jgit.api.CloneCommand cloneCmd = org.eclipse.jgit.api.Git.cloneRepository ( ) ; cloneCmd.setURI ( url ) ; cloneCmd.setDirectory ( gitDir ) ; return cloneCmd.call ( ) ; }

Target:
public static org.eclipse.jgit.api.Git cloneProject ( java.lang.String url , boolean checkout ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { final java.io.File gitDir = com.google.gerrit.acceptance.TempFileUtil.createTempDirectory ( ) ; final org.eclipse.jgit.api.CloneCommand cloneCmd = org.eclipse.jgit.api.Git.cloneRepository ( ) ; cloneCmd.setURI ( url ) ; cloneCmd.setDirectory ( gitDir ) ; cloneCmd.setNoCheckout ( ( ! checkout ) ) ; return cloneCmd.call ( ) ; }
Source:
private org.apache.lucene.search.Query notTimestamp ( com.google.gerrit.server.index.TimestampRangePredicate < V > r ) throws com.google.gerrit.index.query.QueryParseException { if ( ( r.getMinTimestamp ( ) . getTime ( ) ) == 0 ) { return org.apache.lucene.search.NumericRangeQuery.newLongRange ( r.getField ( ) . getName ( ) , r.getMaxTimestamp ( ) . getTime ( ) , null , true , true ) ; } throw new com.google.gerrit.index.query.QueryParseException ( ( "cannot negate: " + r ) ) ; }

Target:
private org.apache.lucene.search.Query notTimestamp ( com.google.gerrit.index.query.TimestampRangePredicate < V > r ) throws com.google.gerrit.index.query.QueryParseException { if ( ( r.getMinTimestamp ( ) . getTime ( ) ) == 0 ) { return org.apache.lucene.search.NumericRangeQuery.newLongRange ( r.getField ( ) . getName ( ) , r.getMaxTimestamp ( ) . getTime ( ) , null , true , true ) ; } throw new com.google.gerrit.index.query.QueryParseException ( ( "cannot negate: " + r ) ) ; }
Source:
public void preferInsertAtLineBreak2 ( ) throws java.lang.Exception { java.lang.String a = " abc\n def\n" ; java.lang.String b = " abc\n def\n" ; java.util.List < org.eclipse.jgit.diff.Edit > expected = new org.eclipse.jgit.diff.EditList ( ) ; expected.add ( new org.eclipse.jgit.diff.Edit ( 0 , 0 , 0 , 2 ) ) ; expected.add ( new org.eclipse.jgit.diff.Edit ( 6 , 6 , 8 , 10 ) ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.patch.IntraLineLoaderTest.intraline ( a , b ) ) . isEqualTo ( expected ) ; }

Target:
public void preferDeleteAtLineBreak ( ) throws java.lang.Exception { java.lang.String a = " abc\n def\n" ; java.lang.String b = " abc\n def\n" ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.patch.IntraLineLoaderTest.intraline ( a , b ) ) . isEqualTo ( com.google.gerrit.server.patch.IntraLineLoaderTest.ref ( ) . remove ( " " ) . common ( " abc\n" ) . remove ( " " ) . common ( " def\n" ) . edits ) ; }
Source:
public void onSuccess ( final com.google.gerrit.common.data.HostPageData result ) { com.google.gwt.dom.client.Document.get ( ) . getElementById ( "gerrit_hostpagedata" ) . removeFromParent ( ) ; com.google.gerrit.client.Gerrit.myConfig = result.config ; com.google.gerrit.client.Gerrit.myTheme = result.theme ; if ( ( result.account ) != null ) { com.google.gerrit.client.Gerrit.myAccount = result.account ; com.google.gerrit.client.Gerrit.xGerritAuth = result.xGerritAuth ; } if ( ( result.accountDiffPref ) != null ) { com.google.gerrit.client.Gerrit.myAccountDiffPref = result.accountDiffPref ; com.google.gerrit.client.Gerrit.applyUserPreferences ( ) ; } onModuleLoad2 ( result ) ; }

Target:
private void setXsrfToken ( ) { com.google.gerrit.client.Gerrit.xGerritAuth = com.google.gwt.user.client.Cookies.getCookie ( com.google.gerrit.common.data.HostPageData.XSRF_COOKIE_NAME ) ; com.google.gwtjsonrpc.client.JsonUtil.setDefaultXsrfManager ( new com.google.gwtjsonrpc.client.XsrfManager ( ) { @ java.lang.Override public java.lang.String getToken ( com.google.gwtjsonrpc.client.JsonDefTarget proxy ) { return com.google.gerrit.client.Gerrit.xGerritAuth ; } @ java.lang.Override public void setToken ( com.google.gwtjsonrpc.client.JsonDefTarget proxy , java.lang.String token ) { } } ) ; }
Source:
public void readCommentLinkMatchButNoHtmlOrLink ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit rev = tr.commit ( ) . add ( "project.config" , ( "[commentlink \"bugzilla\"]\n" + "\tmatch = \"(bugs#?)(d+)\"\n" ) ) . create ( ) ; com.google.gerrit.server.git.ProjectConfig cfg = read ( rev ) ; com.google.common.truth.Truth.assertThat ( cfg.getCommentLinkSections ( ) ) . isEmpty ( ) ; com.google.common.truth.Truth.assertThat ( cfg.getValidationErrors ( ) . stream ( ) . map ( ValidationError :: getMessage ) ) . containsExactly ( ( "project.config: Error in pattern \"(bugs#?)(d+)\" in commentlink.bugzilla.match: " + "commentlink.bugzilla must have either link or html" ) ) ; }

Target:
public void readCommentLinkMatchButNoHtmlOrLink ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit rev = tr.commit ( ) . add ( "project.config" , ( "[commentlink \"bugzilla\"]\n" + "\tmatch = \"(bugs#?)(d+)\"\n" ) ) . create ( ) ; com.google.gerrit.server.git.ProjectConfig cfg = read ( rev ) ; com.google.common.truth.Truth.assertThat ( cfg.getCommentLinkSections ( ) ) . isEmpty ( ) ; com.google.common.truth.Truth.assertThat ( cfg.getValidationErrors ( ) ) . containsExactly ( new com.google.gerrit.server.git.ValidationError ( ( "project.config: Error in pattern \"(bugs#?)(d+)\" in commentlink.bugzilla.match: " + "commentlink.bugzilla must have either link or html" ) ) ) ; }
Source:
public boolean cleanUp ( ) { java.io.File gitDirectory = destinationDirectory ; if ( ! ( gitDirectory.exists ( ) ) ) { return false ; } try { org.apache.commons.io.FileUtils.deleteDirectory ( gitDirectory ) ; return true ; } catch ( java.io.IOException e ) { com.googlesrouce.gerrit.plugins.github.git.GitClone.log.error ( ( "Cannot clean-up output Git directory " + gitDirectory ) ) ; return false ; } }

Target:
public boolean rollback ( ) { return false ; }
Source:
private PatchSet.Id parsePatchSetId ( org.eclipse.jgit.revwalk.RevCommit commit ) throws org.eclipse.jgit.errors.ConfigInvalidException { java.util.List < java.lang.String > psIdLines = commit.getFooterLines ( com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_PATCH_SET ) ; if ( ( psIdLines.size ( ) ) != 1 ) { throw parseException ( "missing or multiple %s: %s" , com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_PATCH_SET , psIdLines ) ; } java.lang.Integer psId = com.google.common.primitives.Ints.tryParse ( psIdLines.get ( 0 ) ) ; if ( psId == null ) { throw parseException ( "invalid %s: %s" , com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_PATCH_SET , psIdLines.get ( 0 ) ) ; } return new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , psId ) ; }

Target:
private PatchSet.Id parsePatchSetId ( org.eclipse.jgit.revwalk.RevCommit commit ) throws org.eclipse.jgit.errors.ConfigInvalidException { java.util.List < java.lang.String > psIdLines = commit.getFooterLines ( com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_PATCH_SET ) ; if ( ( psIdLines.size ( ) ) != 1 ) { throw expectedOneFooter ( com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_PATCH_SET , psIdLines ) ; } java.lang.Integer psId = com.google.common.primitives.Ints.tryParse ( psIdLines.get ( 0 ) ) ; if ( psId == null ) { throw invalidFooter ( com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_PATCH_SET , psIdLines.get ( 0 ) ) ; } return new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , psId ) ; }
Source:
private void fireEvent ( com.google.gerrit.reviewdb.client.Branch.NameKey branchName , com.google.gerrit.server.events.RefEvent event ) { for ( com.google.gerrit.common.ChangeHookRunner.EventListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( branchName , holder.user ) ) { holder.listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }

Target:
private void fireEvent ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.server.events.ProjectEvent event ) { for ( com.google.gerrit.common.UserScopedEventListener listener : listeners ) { if ( isVisibleTo ( project , listener.getUser ( ) ) ) { listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }
Source:
private com.google.inject.Injector createWebInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebModule.class ) ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebSshGlueModule.class ) ) ; if ( sshd ) { modules.add ( sshInjector.getInstance ( com.google.inject.Module.class ) ) ; } return sysInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createWebInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebModule.class ) ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebSshGlueModule.class ) ) ; modules.add ( com.google.gerrit.httpd.CacheBasedWebSession.module ( ) ) ; if ( sshd ) { modules.add ( sshInjector.getInstance ( com.google.inject.Module.class ) ) ; } return sysInjector.createChildInjector ( modules ) ; }
Source:
public void changeProjectAccess ( com.google.gerrit.reviewdb.Project.NameKey projectName , java.lang.String baseRevision , java.lang.String msg , java.util.List < com.google.gerrit.common.data.AccessSection > sections , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.common.data.ProjectAccess > cb ) { org.eclipse.jgit.lib.ObjectId base = org.eclipse.jgit.lib.ObjectId.fromString ( baseRevision ) ; changeProjectAccessFactory.create ( projectName , base , sections , msg ) . to ( cb ) ; }

Target:
public void reviewProjectAccess ( com.google.gerrit.reviewdb.client.Project.NameKey projectName , java.lang.String baseRevision , java.lang.String msg , java.util.List < com.google.gerrit.common.data.AccessSection > sections , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.reviewdb.client.Change.Id > cb ) { org.eclipse.jgit.lib.ObjectId base = org.eclipse.jgit.lib.ObjectId.fromString ( baseRevision ) ; reviewProjectAccessFactory.create ( projectName , base , sections , msg ) . to ( cb ) ; }
Source:
protected com.google.gerrit.server.notedb.AbstractChangeNotes.LoadHandle openHandle ( org.eclipse.jgit.lib.Repository repo ) throws java.io.IOException { org.eclipse.jgit.lib.Ref ref = repo.getRefDatabase ( ) . exactRef ( getRefName ( ) ) ; return com.google.gerrit.server.notedb.AbstractChangeNotes.LoadHandle.create ( new org.eclipse.jgit.revwalk.RevWalk ( repo ) , ( ref != null ? ref.getObjectId ( ) : null ) ) ; }

Target:
protected com.google.gerrit.server.notedb.AbstractChangeNotes.LoadHandle openHandle ( org.eclipse.jgit.lib.Repository repo ) throws java.io.IOException { return com.google.gerrit.server.notedb.AbstractChangeNotes.LoadHandle.create ( new org.eclipse.jgit.revwalk.RevWalk ( repo ) , readRef ( repo ) ) ; }
Source:
private com.google.inject.Injector createWebInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebModule.class ) ) ; modules.add ( sysInjector.getInstance ( com.google.gerrit.httpd.GitOverHttpModule.class ) ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebSshGlueModule.class ) ) ; modules.add ( com.google.gerrit.httpd.CacheBasedWebSession.module ( ) ) ; if ( sshd ) { modules.add ( sshInjector.getInstance ( com.google.inject.Module.class ) ) ; } return sysInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createWebInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebModule.class ) ) ; modules.add ( sysInjector.getInstance ( com.google.gerrit.httpd.GitOverHttpModule.class ) ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebSshGlueModule.class ) ) ; modules.add ( com.google.gerrit.httpd.CacheBasedWebSession.module ( ) ) ; modules.add ( com.google.gerrit.server.contact.HttpContactStoreConnection.module ( ) ) ; if ( sshd ) { modules.add ( sshInjector.getInstance ( com.google.inject.Module.class ) ) ; } return sysInjector.createChildInjector ( modules ) ; }
Source:
public com.google.gerrit.server.project.ProjectResource parse ( java.lang.String id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException { com.google.gerrit.server.project.ProjectControl ctl ; try { ctl = controlFactory.controlFor ( new com.google.gerrit.reviewdb.client.Project.NameKey ( id ) , user.get ( ) ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } if ( ( ! ( ctl.isVisible ( ) ) ) && ( ! ( ctl.isOwner ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } return new com.google.gerrit.server.project.ProjectResource ( ctl ) ; }

Target:
private com.google.gerrit.server.project.ProjectResource _parse ( java.lang.String id ) { com.google.gerrit.server.project.ProjectControl ctl ; try { ctl = controlFactory.controlFor ( new com.google.gerrit.reviewdb.client.Project.NameKey ( id ) , user.get ( ) ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { return null ; } if ( ( ! ( ctl.isVisible ( ) ) ) && ( ! ( ctl.isOwner ( ) ) ) ) { return null ; } return new com.google.gerrit.server.project.ProjectResource ( ctl ) ; }
Source:
private void postEvent ( com.googlesource.gerrit.plugins.replication.PushOne pushOp ) { postEvent ( pushOp , null ) ; }

Target:
private void postReplicationFailedEvent ( com.googlesource.gerrit.plugins.replication.PushOne pushOp , org.eclipse.jgit.transport.RemoteRefUpdate.Status status ) { com.google.gerrit.reviewdb.client.Project.NameKey project = pushOp.getProjectNameKey ( ) ; java.lang.String targetNode = com.googlesource.gerrit.plugins.replication.PushResultProcessing.resolveNodeName ( pushOp.getURI ( ) ) ; for ( java.lang.String ref : pushOp.getRefs ( ) ) { com.googlesource.gerrit.plugins.replication.RefReplicatedEvent event = new com.googlesource.gerrit.plugins.replication.RefReplicatedEvent ( project.get ( ) , ref , targetNode , com.googlesource.gerrit.plugins.replication.ReplicationState.RefPushResult.FAILED , status ) ; eventDispatcher.get ( ) . postEvent ( new com.google.gerrit.reviewdb.client.Branch.NameKey ( project , ref ) , event ) ; } }
Source:
public static com.google.gerrit.server.index.IndexConfig fromConfig ( org.eclipse.jgit.lib.Config cfg ) { com.google.gerrit.server.index.IndexConfig.Builder b = com.google.gerrit.server.index.IndexConfig.builder ( ) ; return b.maxLimit ( cfg.getInt ( "index" , null , "maxLimit" , b.maxLimit ( ) ) ) . maxPages ( cfg.getInt ( "index" , null , "maxPages" , b.maxPages ( ) ) ) . maxTerms ( cfg.getInt ( "index" , null , "maxTerms" , b.maxTerms ( ) ) ) . build ( ) ; }

Target:
public static com.google.gerrit.server.index.IndexConfig.Builder fromConfig ( org.eclipse.jgit.lib.Config cfg ) { com.google.gerrit.server.index.IndexConfig.Builder b = com.google.gerrit.server.index.IndexConfig.builder ( ) ; com.google.gerrit.server.index.IndexConfig.setIfPresent ( cfg , "maxLimit" , b :: maxLimit ) ; com.google.gerrit.server.index.IndexConfig.setIfPresent ( cfg , "maxPages" , b :: maxPages ) ; com.google.gerrit.server.index.IndexConfig.setIfPresent ( cfg , "maxTerms" , b :: maxTerms ) ; return b ; }
Source:
public void onExit ( int rc , java.lang.String exitMessage ) { exit.onExit ( translateExit ( rc ) , exitMessage ) ; log ( rc ) ; }

Target:
public void run ( ) { try { onStart ( ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.sshd.CommandFactoryProvider.logger.warn ( ( ( ( "Cannot start command \"" + ( ctx.getCommandLine ( ) ) ) + "\" for user " ) + ( ctx.getSession ( ) . getUsername ( ) ) ) , e ) ; } }
Source:
public void onFailure ( final java.lang.Throwable caught ) { userNameTxt.setEnabled ( true ) ; changeUserName.setEnabled ( true ) ; if ( InvalidSshUserNameException.MESSAGE.equals ( caught.getMessage ( ) ) ) { invalidUserName ( ) ; } else { super . onFailure ( caught ) ; } }

Target:
public void onFailure ( final java.lang.Throwable caught ) { userNameTxt.setEnabled ( true ) ; changeUserName.setEnabled ( true ) ; if ( InvalidUserNameException.MESSAGE.equals ( caught.getMessage ( ) ) ) { invalidUserName ( ) ; } else { super . onFailure ( caught ) ; } }
Source:
public java.lang.String getHtmlMessage ( ) { if ( com.google.common.base.Strings.isNullOrEmpty ( id ) ) { return null ; } if ( com.google.common.base.Strings.isNullOrEmpty ( expiresAt ) ) { com.googlesource.gerrit.plugins.messageoftheday.MessageOfTheDayImpl.log.warn ( "expiresAt not defined, no message will be shown" ) ; return null ; } if ( ( com.googlesource.gerrit.plugins.messageoftheday.MessageOfTheDayImpl.today ( ) . compareTo ( expiresAt ) ) > 0 ) { return null ; } return msg ; }

Target:
public java.lang.String getHtmlMessage ( ) { if ( com.google.common.base.Strings.isNullOrEmpty ( id ) ) { return null ; } if ( com.google.common.base.Strings.isNullOrEmpty ( expiresAt ) ) { com.googlesource.gerrit.plugins.messageoftheday.MessageOfTheDayImpl.log.warn ( "expiresAt not defined, no message will be shown" ) ; return null ; } if ( ( com.googlesource.gerrit.plugins.messageoftheday.MessageOfTheDayImpl.now ( ) . compareTo ( expiresAt ) ) > 0 ) { return null ; } return msg ; }
Source:
public com.google.common.base.Optional < com.google.gerrit.reviewdb.client.PatchSetApproval > getSubmitApproval ( ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.reviewdb.client.PatchSetApproval psa : currentApprovals ( ) ) { if ( psa.isLegacySubmit ( ) ) { return com.google.common.base.Optional.fromNullable ( psa ) ; } } return com.google.common.base.Optional.absent ( ) ; }

Target:
public java.util.Optional < com.google.gerrit.reviewdb.client.PatchSetApproval > getSubmitApproval ( ) throws com.google.gwtorm.server.OrmException { return currentApprovals ( ) . stream ( ) . filter ( PatchSetApproval :: isLegacySubmit ) . findFirst ( ) ; }
Source:
public java.util.Collection < com.google.gerrit.pgm.init.api.InitStep > getInitSteps ( ) { java.util.List < java.io.File > jars = scanJarsInPluginsDirectory ( ) ; java.util.ArrayList < com.google.gerrit.pgm.init.api.InitStep > pluginsInitSteps = new java.util.ArrayList < > ( ) ; for ( java.io.File jar : jars ) { com.google.gerrit.pgm.init.api.InitStep init = loadInitStep ( jar ) ; if ( init != null ) { pluginsInitSteps.add ( init ) ; } } return pluginsInitSteps ; }

Target:
public java.util.Collection < com.google.gerrit.pgm.init.api.InitStep > getInitSteps ( ) { java.util.List < java.nio.file.Path > jars = scanJarsInPluginsDirectory ( ) ; java.util.ArrayList < com.google.gerrit.pgm.init.api.InitStep > pluginsInitSteps = new java.util.ArrayList < > ( ) ; for ( java.nio.file.Path jar : jars ) { com.google.gerrit.pgm.init.api.InitStep init = loadInitStep ( jar ) ; if ( init != null ) { pluginsInitSteps.add ( init ) ; } } return pluginsInitSteps ; }
Source:
public void patchComments ( final com.google.gerrit.client.reviewdb.Patch.Key patchKey , final com.google.gerrit.client.reviewdb.PatchSet.Id psa , final com.google.gerrit.client.reviewdb.PatchSet.Id psb , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.patches.CommentDetail > callback ) { if ( psb == null ) { callback.onFailure ( new com.google.gerrit.client.rpc.NoSuchEntityException ( ) ) ; return ; } run ( callback , new com.google.gerrit.server.patch.PatchCommentAction ( patchKey , psa , psb ) ) ; }

Target:
public void patchComments ( final com.google.gerrit.client.reviewdb.Patch.Key patchKey , final com.google.gerrit.client.reviewdb.PatchSet.Id psa , final com.google.gerrit.client.reviewdb.PatchSet.Id psb , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.patches.CommentDetail > callback ) { if ( psb == null ) { callback.onFailure ( new com.google.gerrit.client.rpc.NoSuchEntityException ( ) ) ; return ; } commentDetailFactory.create ( patchKey , psa , psb ) . to ( callback ) ; }
Source:
public static synchronized void setClockStep ( long clockStep , java.util.concurrent.TimeUnit clockStepUnit ) { com.google.common.base.Preconditions.checkState ( ( ( com.google.gerrit.testutil.TestTimeUtil.clockMs ) != null ) , "call resetWithClockStep first" ) ; com.google.gerrit.testutil.TestTimeUtil.clockStepMs = java.util.concurrent.TimeUnit.MILLISECONDS.convert ( clockStep , clockStepUnit ) ; HEAD ( ( 6899000.0 - 2.14 ) ) ; org.joda.time.DateTimeUtils.setCurrentMillisProvider ( new org.joda.time.DateTimeUtils.MillisProvider ( ) { @ java.lang.Override public long getMillis ( ) { return com.google.gerrit.testutil.TestTimeUtil.clockMs.getAndAdd ( com.google.gerrit.testutil.TestTimeUtil.clockStepMs ) ; } } ) ; }

Target:
public int getTimezone ( long when ) { return defaultReader.getTimezone ( when ) ; }
Source:
private void executePostOps ( ) throws java.lang.Exception { com.google.gerrit.server.update.BatchUpdate.ContextImpl ctx = new com.google.gerrit.server.update.BatchUpdate.ContextImpl ( ) ; for ( com.google.gerrit.server.update.BatchUpdate.Op op : ops.values ( ) ) { op.postUpdate ( ctx ) ; } for ( com.google.gerrit.server.update.BatchUpdate.RepoOnlyOp op : repoOnlyOps ) { op.postUpdate ( ctx ) ; } }

Target:
private void executePostOps ( ) throws java.lang.Exception { com.google.gerrit.server.update.BatchUpdate.ContextImpl ctx = new com.google.gerrit.server.update.BatchUpdate.ContextImpl ( ) ; for ( com.google.gerrit.server.update.BatchUpdateOp op : ops.values ( ) ) { op.postUpdate ( ctx ) ; } for ( com.google.gerrit.server.update.RepoOnlyOp op : repoOnlyOps ) { op.postUpdate ( ctx ) ; } }