auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testSubscriptionToEmptyRepo ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < ? > superRepo = createProjectWithPush ( "super-project" ) ; org.eclipse.jgit.junit.TestRepository < ? > subRepo = createProjectWithPush ( "subscribed-to-project" ) ; allowSubmoduleSubscription ( "subscribed-to-project" , "refs/heads/master" , "super-project" , "refs/heads/master" ) ; createSubmoduleSubscription ( superRepo , "master" , "subscribed-to-project" , "master" ) ; pushChangeTo ( subRepo , "master" ) ; org.eclipse.jgit.lib.ObjectId subHEAD = pushChangeTo ( subRepo , "master" ) ; expectToHaveSubmoduleState ( superRepo , "master" , "subscribed-to-project" , subHEAD ) ; }

Target:
public void testSubscriptionToEmptyRepo ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < ? > superRepo = createProjectWithPush ( "super-project" ) ; org.eclipse.jgit.junit.TestRepository < ? > subRepo = createProjectWithPush ( "subscribed-to-project" ) ; allowSubmoduleSubscription ( "subscribed-to-project" , "refs/heads/master" , "super-project" , "refs/heads/master" ) ; createSubmoduleSubscription ( superRepo , "master" , "subscribed-to-project" , "master" ) ; pushChangeTo ( subRepo , "master" ) ; org.eclipse.jgit.lib.ObjectId subHEAD = pushChangeTo ( subRepo , "master" ) ; com.google.common.truth.Truth.assertThat ( hasSubmodule ( superRepo , "master" , "subscribed-to-project" ) ) . isTrue ( ) ; expectToHaveSubmoduleState ( superRepo , "master" , "subscribed-to-project" , subHEAD ) ; }
Source:
private static boolean isReviewer ( final org.eclipse.jgit.revwalk.FooterLine candidateFooterLine ) { return ( ( ( candidateFooterLine.matches ( FooterKey.SIGNED_OFF_BY ) ) || ( candidateFooterLine.matches ( FooterKey.ACKED_BY ) ) ) || ( candidateFooterLine.matches ( com.google.gerrit.server.mail.MailUtil.REVIEWED_BY ) ) ) || ( candidateFooterLine.matches ( com.google.gerrit.server.mail.MailUtil.TESTED_BY ) ) ; }

Target:
private static boolean isReviewer ( final org.eclipse.jgit.revwalk.FooterLine candidateFooterLine ) { return ( ( ( candidateFooterLine.matches ( FooterKey.SIGNED_OFF_BY ) ) || ( candidateFooterLine.matches ( FooterKey.ACKED_BY ) ) ) || ( candidateFooterLine.matches ( FooterConstants.REVIEWED_BY ) ) ) || ( candidateFooterLine.matches ( FooterConstants.TESTED_BY ) ) ; }
Source:
public static boolean isChild ( final com.google.gerrit.server.ssh.CommandName parent , final com.google.gerrit.server.ssh.CommandName name ) { if ( name instanceof com.google.gerrit.server.ssh.Commands.NestedCommandNameImpl ) { return parent.equals ( ( ( com.google.gerrit.server.ssh.Commands.NestedCommandNameImpl ) ( name ) ) . parent ) ; } if ( parent == ( com.google.gerrit.server.ssh.Commands.ROOT ) ) { return true ; } return false ; }

Target:
public static boolean isChild ( final com.google.gerrit.server.ssh.CommandName parent , final com.google.gerrit.server.ssh.CommandName name ) { if ( name instanceof com.google.gerrit.server.ssh.Commands.NestedCommandNameImpl ) { return parent.equals ( ( ( com.google.gerrit.server.ssh.Commands.NestedCommandNameImpl ) ( name ) ) . parent ) ; } if ( parent == ( com.google.gerrit.server.ssh.Commands.CMD_ROOT ) ) { return true ; } return false ; }
Source:
public boolean execute ( ) { other.setScrollSetByOther ( false ) ; return false ; }

Target:
public void run ( ) { net.codemirror.lib.CodeMirror.Viewport fromTo = cm.getViewport ( ) ; int size = ( ( fromTo.getTo ( ) ) - ( fromTo.getFrom ( ) ) ) + 1 ; if ( ( cm.getOldViewportSize ( ) ) == size ) { return ; } cm.setOldViewportSize ( size ) ; diffTable.sidePanel.adjustGutters ( cmB ) ; }
Source:
private void assertProblems ( com.google.gerrit.gpg.PublicKeyChecker checker , com.google.gerrit.gpg.testutil.TestKey k , java.lang.String first , java.lang.String ... rest ) { com.google.gerrit.gpg.CheckResult result = checker.setStore ( store ) . check ( k.getPublicKey ( ) ) ; org.junit.Assert.assertEquals ( com.google.gerrit.gpg.PublicKeyCheckerTest.list ( first , rest ) , result.getProblems ( ) ) ; }

Target:
private void assertProblems ( com.google.gerrit.gpg.PublicKeyChecker checker , com.google.gerrit.gpg.testing.TestKey k , java.lang.String first , java.lang.String ... rest ) { com.google.gerrit.gpg.CheckResult result = checker.setStore ( store ) . check ( k.getPublicKey ( ) ) ; org.junit.Assert.assertEquals ( com.google.gerrit.gpg.PublicKeyCheckerTest.list ( first , rest ) , result.getProblems ( ) ) ; }
Source:
private static org.apache.lucene.store.Directory dir ( com.google.gerrit.server.index.Schema < com.google.gerrit.reviewdb.client.AccountGroup > schema , org.eclipse.jgit.lib.Config cfg , com.google.gerrit.server.config.SitePaths sitePaths ) throws java.io.IOException { if ( com.google.gerrit.lucene.LuceneIndexModule.isInMemoryTest ( cfg ) ) { return new org.apache.lucene.store.RAMDirectory ( ) ; } java.nio.file.Path indexDir = com.google.gerrit.lucene.LuceneVersionManager.getDir ( sitePaths , com.google.gerrit.lucene.LuceneGroupIndex.GROUPS , schema ) ; return org.apache.lucene.store.FSDirectory.open ( indexDir ) ; }

Target:
private static org.apache.lucene.store.Directory dir ( com.google.gerrit.index.Schema < com.google.gerrit.reviewdb.client.AccountGroup > schema , org.eclipse.jgit.lib.Config cfg , com.google.gerrit.server.config.SitePaths sitePaths ) throws java.io.IOException { if ( com.google.gerrit.lucene.LuceneIndexModule.isInMemoryTest ( cfg ) ) { return new org.apache.lucene.store.RAMDirectory ( ) ; } java.nio.file.Path indexDir = com.google.gerrit.lucene.LuceneVersionManager.getDir ( sitePaths , com.google.gerrit.lucene.LuceneGroupIndex.GROUPS , schema ) ; return org.apache.lucene.store.FSDirectory.open ( indexDir ) ; }
Source:
public void groupCannotBeRenamedWhenOldNameIsWrong ( ) throws java.lang.Exception { createGroup ( groupUuid , groupName ) ; com.google.gerrit.reviewdb.client.AccountGroup.NameKey anotherOldName = new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( "contributors" ) ; com.google.gerrit.reviewdb.client.AccountGroup.NameKey anotherName = new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( "admins" ) ; expectedException.expect ( org.eclipse.jgit.errors.ConfigInvalidException.class ) ; expectedException.expectMessage ( anotherOldName.get ( ) ) ; com.google.gerrit.server.group.db.GroupNameNotes.loadForRename ( repo , groupUuid , anotherOldName , anotherName ) ; }

Target:
public void groupCannotBeRenamedWhenOldNameIsWrong ( ) throws java.lang.Exception { createGroup ( groupUuid , groupName ) ; com.google.gerrit.reviewdb.client.AccountGroup.NameKey anotherOldName = new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( "contributors" ) ; com.google.gerrit.reviewdb.client.AccountGroup.NameKey anotherName = new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( "admins" ) ; expectedException.expect ( org.eclipse.jgit.errors.ConfigInvalidException.class ) ; expectedException.expectMessage ( anotherOldName.get ( ) ) ; com.google.gerrit.server.group.db.GroupNameNotes.forRename ( repo , groupUuid , anotherOldName , anotherName ) ; }
Source:
public void onMouseMove ( com.google.gwt.event.dom.client.MouseMoveEvent event ) { resizePaddingWidget ( ) ; }

Target:
public void onMouseMove ( com.google.gwt.event.dom.client.MouseMoveEvent event ) { int h = editArea.getOffsetHeight ( ) ; if ( ( isEdit ( ) ) && ( h != ( editAreaHeight ) ) ) { getCommentGroup ( ) . resize ( ) ; resizeTimer.scheduleRepeating ( 50 ) ; editAreaHeight = h ; } }
Source:
private com.google.gerrit.server.notedb.ChangeNotes createFromChangeOnlyWhenNotedbDisabled ( com.google.gerrit.reviewdb.client.Change change ) throws com.google.gwtorm.server.OrmException { com.google.common.base.Preconditions.checkState ( ( ! ( args.migration.readChanges ( ) ) ) , ( "do not call" + " createFromChangeWhenNotedbDisabled when notedb is enabled" ) ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( args , change.getProject ( ) , change ) . load ( ) ; }

Target:
public com.google.gerrit.server.notedb.ChangeNotes createWithAutoRebuildingDisabled ( com.google.gerrit.reviewdb.client.Change change ) throws com.google.gwtorm.server.OrmException { return new com.google.gerrit.server.notedb.ChangeNotes ( args , change.getProject ( ) , change , false ) . load ( ) ; }
Source:
private void addDiffChunkAndPadding ( net.codemirror.lib.CodeMirror cmToPad , int lineToPad , int lineOnOther , int chunkSize , boolean edit ) { net.codemirror.lib.CodeMirror otherCm = otherCm ( cmToPad ) ; linePaddingOnOtherSideMap.put ( otherCm.getLineHandle ( lineOnOther ) , new com.google.gerrit.client.diff.PaddingManager.LinePaddingWidgetWrapper ( addPaddingWidget ( cmToPad , lineToPad , 0 , Unit.EM , null ) , lineToPad , chunkSize ) ) ; diffChunks.add ( new com.google.gerrit.client.diff.DiffChunkInfo ( getSideFromCm ( otherCm ) , ( ( lineOnOther - chunkSize ) + 1 ) , lineOnOther , edit ) ) ; }

Target:
public void run ( ) { skipManager.removeAll ( ) ; clearMarkers ( ) ; diffTable.sidePanel.clearDiffGutters ( ) ; setShowIntraline ( prefs.intralineDifference ( ) ) ; render ( diff ) ; skipManager.render ( prefs.context ( ) , diff ) ; }
Source:
private com.google.gerrit.extensions.common.CommentInfo addDraft ( java.lang.String changeId , java.lang.String revId , com.google.gerrit.extensions.api.changes.ReviewInput.CommentInput c ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = userSession.put ( ( ( ( ( "/changes/" + changeId ) + "/revisions/" ) + revId ) + "/drafts" ) , c ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_CREATED ) ; return newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.CommentInfo.class ) ; }

Target:
private com.google.gerrit.extensions.common.CommentInfo addDraft ( java.lang.String changeId , java.lang.String revId , com.google.gerrit.extensions.api.changes.DraftInput in ) throws java.lang.Exception { return gApi.changes ( ) . id ( changeId ) . revision ( revId ) . createDraft ( in ) . get ( ) ; }
Source:
public void validNewChange ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = insertChange ( ) ; insertPatchSet ( c ) ; incrementPatchSet ( c ) ; insertPatchSet ( c ) ; assertProblems ( c ) ; }

Target:
public void missingOwner ( ) throws java.lang.Exception { com.google.gerrit.acceptance.TestAccount owner = accounts.create ( "missing" ) ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( owner ) ; db.accounts ( ) . deleteKeys ( java.util.Collections.singleton ( owner.getId ( ) ) ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Missing change owner: " + ( owner.getId ( ) ) ) ) ) ; }
Source:
public void markReady ( boolean ready ) throws java.io.IOException { org.eclipse.jgit.storage.file.FileBasedConfig cfg = new org.eclipse.jgit.storage.file.FileBasedConfig ( com.google.gerrit.solr.IndexVersionCheck.solrIndexConfig ( sitePaths ) , org.eclipse.jgit.util.FS.detect ( ) ) ; for ( java.util.Map.Entry < java.lang.String , java.lang.Integer > e : com.google.gerrit.solr.IndexVersionCheck.SCHEMA_VERSIONS.entrySet ( ) ) { cfg.setInt ( "index" , e.getKey ( ) , "schemaVersion" , ( ready ? e.getValue ( ) : - 1 ) ) ; } cfg.save ( ) ; }

Target:
public void markReady ( boolean ready ) throws java.io.IOException { org.eclipse.jgit.storage.file.FileBasedConfig cfg = new org.eclipse.jgit.storage.file.FileBasedConfig ( com.google.gerrit.solr.IndexVersionCheck.solrIndexConfig ( sitePaths ) . toFile ( ) , org.eclipse.jgit.util.FS.detect ( ) ) ; for ( java.util.Map.Entry < java.lang.String , java.lang.Integer > e : com.google.gerrit.solr.IndexVersionCheck.SCHEMA_VERSIONS.entrySet ( ) ) { cfg.setInt ( "index" , e.getKey ( ) , "schemaVersion" , ( ready ? e.getValue ( ) : - 1 ) ) ; } cfg.save ( ) ; }
Source:
private static java.lang.String format ( com.google.gerrit.server.git.WorkQueue.Task.State state ) { switch ( state ) { case DONE : return "....... done" ; case CANCELLED : return "..... killed" ; case RUNNING : return "" ; case READY : return "waiting ...." ; case SLEEPING : return "sleeping" ; default : return state.toString ( ) ; } }

Target:
private static java.lang.String format ( com.google.gerrit.server.git.WorkQueue.Task.State state ) { switch ( state ) { case DONE : return "....... done" ; case CANCELLED : return "..... killed" ; case RUNNING : return "" ; case READY : return "waiting ...." ; case SLEEPING : return "sleeping" ; case OTHER : default : return state.toString ( ) ; } }
Source:
protected void configureServlets ( ) { rpc ( com.google.gerrit.server.rpc.AccountServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.AccountSecurityImpl.class ) ; rpc ( com.google.gerrit.server.rpc.GroupAdminServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.ChangeListServiceImpl.class ) ; rpc ( com.google.gerrit.server.patch.PatchDetailServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.ProjectAdminServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.SuggestServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.SystemInfoServiceImpl.class ) ; install ( new com.google.gerrit.server.rpc.changedetail.ChangeDetailModule ( ) ) ; }

Target:
protected void configureServlets ( ) { rpc ( com.google.gerrit.server.rpc.AccountServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.AccountSecurityImpl.class ) ; rpc ( com.google.gerrit.server.rpc.GroupAdminServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.ChangeListServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.SuggestServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.SystemInfoServiceImpl.class ) ; install ( new com.google.gerrit.server.rpc.changedetail.ChangeDetailModule ( ) ) ; install ( new com.google.gerrit.server.patch.PatchModule ( ) ) ; install ( new com.google.gerrit.server.rpc.project.ProjectModule ( ) ) ; }
Source:
public com.google.gerrit.server.notedb.ChangeNotes createChecked ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.reviewdb.server.ReviewDbUtil.unwrapDb ( db ) . changes ( ) . get ( changeId ) ; if ( ( change == null ) || ( ! ( change.getProject ( ) . equals ( project ) ) ) ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( changeId ) ; } return new com.google.gerrit.server.notedb.ChangeNotes ( args , change ) . load ( ) ; }

Target:
public com.google.gerrit.server.notedb.ChangeNotes createChecked ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.server.notedb.ChangeNotes.readOneReviewDbChange ( db , changeId ) ; if ( ( change == null ) || ( ! ( change.getProject ( ) . equals ( project ) ) ) ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( changeId ) ; } return new com.google.gerrit.server.notedb.ChangeNotes ( args , change ) . load ( ) ; }
Source:
public void createdOnIsPopulatedForGroupsCreatedBeforeAudit ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.AccountGroup.Id groupId = createGroup ( "Ancient group for schema migration" ) ; setCreatedOnToVeryOldTimestamp ( groupId ) ; removeAuditEntriesFor ( groupId ) ; schema151.migrateData ( db , new com.google.gerrit.server.schema.Schema_150_to_151_Test.TestUpdateUI ( ) ) ; com.google.gerrit.reviewdb.client.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; com.google.common.truth.Truth.assertThat ( group.getCreatedOn ( ) ) . isEqualTo ( java.sql.Timestamp.from ( Schema_151.AUDIT_CREATION_INSTANT ) ) ; }

Target:
public void createdOnIsPopulatedForGroupsCreatedBeforeAudit ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.AccountGroup.Id groupId = createGroup ( "Ancient group for schema migration" ) ; setCreatedOnToVeryOldTimestamp ( groupId ) ; removeAuditEntriesFor ( groupId ) ; schema151.migrateData ( db , new com.google.gerrit.server.schema.Schema_150_to_151_Test.TestUpdateUI ( ) ) ; com.google.gerrit.reviewdb.client.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; com.google.common.truth.Truth.assertThat ( group.getCreatedOn ( ) ) . isEqualTo ( com.google.gerrit.reviewdb.client.AccountGroup.auditCreationInstantTs ( ) ) ; }
Source:
public void reviewId ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.git.PushOneCommit.Result r = createChange ( ) ; gApi.changes ( ) . id ( r.getChangeId ( ) ) . revision ( r.getCommit ( ) . name ( ) ) . review ( com.google.gerrit.acceptance.api.revision.ReviewIT.makeReview ( ) ) ; }

Target:
public void rebase ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.git.PushOneCommit.Result r = createChange ( ) ; gApi.changes ( ) . id ( ( "p~master~" + ( r.getChangeId ( ) ) ) ) . revision ( r.getCommit ( ) . name ( ) ) . rebase ( ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.diff.DiffInfo diffInfo ) { if ( ( id == ( reloadVersionId ) ) && ( isAttached ( ) ) ) { diff = diffInfo ; operation ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { clearSkipBars ( ) ; clearMarkers ( ) ; diffTable.sidePanel.clearDiffGutters ( ) ; setShowIntraline ( prefs.intralineDifference ( ) ) ; render ( diff ) ; renderSkips ( prefs.context ( ) ) ; } } ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.diff.DiffInfo info ) { new net.codemirror.lib.ModeInjector ( ) . add ( getContentType ( info.meta_a ( ) ) ) . add ( getContentType ( info.meta_b ( ) ) ) . inject ( com.google.gerrit.client.rpc.CallbackGroup.< java.lang.Void > emptyCallback ( ) ) ; }
Source:
public void suggestReviewersWithoutLimitOptionSpecified ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; java.lang.String query = user3.fullName ; java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > suggestedReviewerInfos = gApi.changes ( ) . id ( changeId ) . suggestReviewers ( query ) . get ( ) ; com.google.common.truth.Truth.assertThat ( suggestedReviewerInfos ) . hasSize ( 1 ) ; }

Target:
public void suggestReviewersWithoutLimitOptionSpecified ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; java.lang.String query = user3.username ; java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > suggestedReviewerInfos = gApi.changes ( ) . id ( changeId ) . suggestReviewers ( query ) . get ( ) ; com.google.common.truth.Truth.assertThat ( suggestedReviewerInfos ) . hasSize ( 1 ) ; }
Source:
private void checkRemoveReviewer ( com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.server.CurrentUser currentUser , com.google.gerrit.reviewdb.client.Account.Id reviewer , int val ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gerrit.server.project.NoSuchProjectException , java.io.IOException { if ( canRemoveReviewerWithoutPermissionCheck ( notes.getChange ( ) , currentUser , reviewer , val ) ) { return ; } permissionBackend.user ( currentUser ) . change ( notes ) . database ( dbProvider ) . check ( ChangePermission.REMOVE_REVIEWER ) ; }

Target:
private void checkRemoveReviewer ( com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.server.CurrentUser currentUser , com.google.gerrit.reviewdb.client.Account.Id reviewer , int val ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException { if ( com.google.gerrit.server.project.RemoveReviewerControl.canRemoveReviewerWithoutPermissionCheck ( permissionBackend , notes.getChange ( ) , currentUser , reviewer , val ) ) { return ; } permissionBackend.user ( currentUser ) . change ( notes ) . database ( dbProvider ) . check ( ChangePermission.REMOVE_REVIEWER ) ; }
Source:
public java.util.Collection < com.google.gerrit.client.reviewdb.ProjectRight > getProjectRights ( final com.google.gerrit.client.reviewdb.ApprovalCategory.Id id ) { if ( ( projectRights ) == null ) { projectRights = com.google.gerrit.server.workflow.FunctionState.index ( project.getRights ( ) ) ; } final java.util.Collection < com.google.gerrit.client.reviewdb.ProjectRight > l = projectRights.get ( id ) ; return l != null ? l : java.util.Collections.< com.google.gerrit.client.reviewdb.ProjectRight > emptySet ( ) ; }

Target:
public java.util.Collection < com.google.gerrit.client.reviewdb.ProjectRight > getProjectRights ( final com.google.gerrit.client.reviewdb.ApprovalCategory.Id id ) { if ( ( projectRights ) == null ) { projectRights = com.google.gerrit.server.workflow.FunctionState.index ( project.getLocalRights ( ) ) ; } final java.util.Collection < com.google.gerrit.client.reviewdb.ProjectRight > l = projectRights.get ( id ) ; return l != null ? l : java.util.Collections.< com.google.gerrit.client.reviewdb.ProjectRight > emptySet ( ) ; }
Source:
public void defaultMessage ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createChange ( ) ; com.google.gerrit.extensions.common.ChangeInfo c = getChange ( ( "p~master~" + changeId ) , java.util.EnumSet.of ( com.google.gerrit.extensions.common.ListChangesOption.MESSAGES ) ) ; org.junit.Assert.assertNotNull ( c.messages ) ; org.junit.Assert.assertEquals ( 1 , c.messages.size ( ) ) ; org.junit.Assert.assertEquals ( "Uploaded patch set 1." , c.messages.iterator ( ) . next ( ) . message ) ; }

Target:
public void defaultMessage ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createChange ( ) ; com.google.gerrit.extensions.common.ChangeInfo c = getChangeAll ( ( "p~master~" + changeId ) ) ; org.junit.Assert.assertNotNull ( c.messages ) ; org.junit.Assert.assertEquals ( 1 , c.messages.size ( ) ) ; org.junit.Assert.assertEquals ( "Uploaded patch set 1." , c.messages.iterator ( ) . next ( ) . message ) ; }
Source:
public static void createTableIfNotExists ( java.lang.String url ) throws com.google.gwtorm.server.OrmException { try ( java.sql.Connection con = java.sql.DriverManager.getConnection ( url ) ; java.sql.Statement stmt = con.createStatement ( ) ) { stmt.executeUpdate ( ( "CREATE TABLE IF NOT EXISTS ACCOUNT_PATCH_REVIEWS (" + ( ( ( ( ( ( "ACCOUNT_ID INTEGER DEFAULT 0 NOT NULL, " + "CHANGE_ID INTEGER DEFAULT 0 NOT NULL, " ) + "PATCH_SET_ID INTEGER DEFAULT 0 NOT NULL, " ) + "FILE_NAME VARCHAR(255) DEFAULT '' NOT NULL, " ) + "CONSTRAINT PRIMARY_KEY_ACCOUNT_PATCH_REVIEWS " ) + "PRIMARY KEY (ACCOUNT_ID, CHANGE_ID, PATCH_SET_ID, FILE_NAME)" ) + ")" ) ) ) ; } catch ( java.sql.SQLException e ) { throw com.google.gerrit.server.schema.H2AccountPatchReviewStore.convertError ( "create" , e ) ; } }

Target:
public static void createTableIfNotExists ( java.lang.String url ) throws com.google.gwtorm.server.OrmException { try ( java.sql.Connection con = java.sql.DriverManager.getConnection ( url ) ; java.sql.Statement stmt = con.createStatement ( ) ) { com.google.gerrit.server.schema.H2AccountPatchReviewStore.doCreateTable ( stmt ) ; } catch ( java.sql.SQLException e ) { throw com.google.gerrit.server.schema.H2AccountPatchReviewStore.convertError ( "create" , e ) ; } }
Source:
public void bothDateTime ( ) throws java.lang.Exception { java.util.Map < java.lang.String , java.lang.String > params = new java.util.HashMap < > ( ) ; params.put ( "t1" , "2013-10-10 10:00:00" ) ; params.put ( "t2" , "2014-10-10 10:00:00" ) ; java.lang.String query = com.ericsson.gerrit.plugins.eventslog.QueryMakerTest.queryMaker.formQueryFromRequestParameters ( params ) ; org.junit.Assert.assertFalse ( query.equals ( com.ericsson.gerrit.plugins.eventslog.QueryMakerTest.defaultQuery ) ) ; }

Target:
public void bothDateTime ( ) throws java.lang.Exception { java.util.Map < java.lang.String , java.lang.String > params = new java.util.HashMap < > ( ) ; params.put ( "t1" , "2013-10-10 10:00:00" ) ; params.put ( "t2" , "2014-10-10 10:00:00" ) ; java.lang.String query = com.ericsson.gerrit.plugins.eventslog.QueryMakerTest.queryMaker.formQueryFromRequestParameters ( params ) ; com.google.common.truth.Truth.assertThat ( query ) . isNotEqualTo ( com.ericsson.gerrit.plugins.eventslog.QueryMakerTest.defaultQuery ) ; }
Source:
public void parseInvalidWatchConfig ( ) throws java.lang.Exception { org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; cfg.fromText ( ( "[project \"myProject\"]\n" + ( ( ( " notify = * [ALL_COMMENTS, NEW_PATCHSETS]\n" + " notify = branch:master [INVALID, NEW_CHANGES]\n" ) + "[project \"otherProject\"]\n" ) + " notify = [NEW_PATCHSETS]\n" ) ) ) ; com.google.gerrit.server.account.WatchConfig.parse ( new com.google.gerrit.reviewdb.client.Account.Id ( 1000000 ) , cfg , this ) ; com.google.common.truth.Truth.assertThat ( validationErrors ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( validationErrors.get ( 0 ) . getMessage ( ) ) . isEqualTo ( ( "watch.config: Invalid notify type INVALID in project watch of" + ( " account 1000000 for project myProject: branch:master" + " [INVALID, NEW_CHANGES]" ) ) ) ; }

Target:
public void parseInvalidWatchConfig ( ) throws java.lang.Exception { org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; cfg.fromText ( ( "[project \"myProject\"]\n" + ( ( ( " notify = * [ALL_COMMENTS, NEW_PATCHSETS]\n" + " notify = branch:master [INVALID, NEW_CHANGES]\n" ) + "[project \"otherProject\"]\n" ) + " notify = [NEW_PATCHSETS]\n" ) ) ) ; com.google.gerrit.server.account.ProjectWatches.parse ( new com.google.gerrit.reviewdb.client.Account.Id ( 1000000 ) , cfg , this ) ; com.google.common.truth.Truth.assertThat ( validationErrors ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( validationErrors.get ( 0 ) . getMessage ( ) ) . isEqualTo ( ( "watch.config: Invalid notify type INVALID in project watch of" + ( " account 1000000 for project myProject: branch:master" + " [INVALID, NEW_CHANGES]" ) ) ) ; }
Source:
private void executePostOps ( ) throws java.lang.Exception { com.google.gerrit.server.git.BatchUpdate.Context ctx = new com.google.gerrit.server.git.BatchUpdate.Context ( ) ; for ( com.google.gerrit.server.git.BatchUpdate.Op op : ops.values ( ) ) { op.postUpdate ( ctx ) ; } }

Target:
private void executePostOps ( ) throws java.lang.Exception { com.google.gerrit.server.git.BatchUpdate.Context ctx = new com.google.gerrit.server.git.BatchUpdate.Context ( ) ; for ( com.google.gerrit.server.git.BatchUpdate.Op op : ops.values ( ) ) { op.postUpdate ( ctx ) ; } for ( com.google.gerrit.server.git.BatchUpdate.RepoOnlyOp op : repoOnlyOps ) { op.postUpdate ( ctx ) ; } }
Source:
void onSave ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ClickEvent e ) { if ( cm.isClean ( generation ) ) { upToChange ( ) ; return ; } com.google.gerrit.client.changes.ChangeEditApi.put ( revision.getParentKey ( ) . get ( ) , path , cm.getValue ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { upToChange ( ) ; } } ) ; }

Target:
void onSave ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ClickEvent e ) { save ( ) . run ( ) ; }
Source:
public java.lang.String getSqlType ( final com.google.gwtorm.schema.ColumnModel col , final com.google.gwtorm.schema.sql.SqlDialect dialect ) { final com.google.gwtorm.client.Column column = col.getColumnAnnotation ( ) ; final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( dialect.getSqlTypeName ( getSqlTypeConstant ( ) ) ) ; if ( column.notNull ( ) ) { r.append ( " DEFAULT ''" ) ; r.append ( " NOT NULL" ) ; } return r.toString ( ) ; }

Target:
public java.lang.String getSqlType ( final com.google.gwtorm.schema.ColumnModel col , final com.google.gwtorm.schema.sql.SqlDialect dialect ) { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( dialect.getSqlTypeName ( getSqlTypeConstant ( ) ) ) ; if ( col.isNotNull ( ) ) { r.append ( " DEFAULT ''" ) ; r.append ( " NOT NULL" ) ; } return r.toString ( ) ; }
Source:
public void changeMessageWithTrailingDoubleNewline ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.setChangeMessage ( ( "Testing trailing double newline\n" + "\n" ) ) ; update.commit ( ) ; assertBodyEquals ( ( "Update patch set 1\n" + ( ( ( ( ( "\n" + "Testing trailing double newline\n" ) + "\n" ) + "\n" ) + "\n" ) + "Patch-set: 1\n" ) ) , update.getRevision ( ) ) ; }

Target:
public void changeMessageWithTrailingDoubleNewline ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.setChangeMessage ( ( "Testing trailing double newline\n" + "\n" ) ) ; update.commit ( ) ; assertBodyEquals ( ( "Update patch set 1\n" + ( ( ( ( ( "\n" + "Testing trailing double newline\n" ) + "\n" ) + "\n" ) + "\n" ) + "Patch-set: 1\n" ) ) , update.getResult ( ) ) ; }
Source:
protected void add ( com.google.gerrit.server.mail.RecipientType type , com.google.gerrit.server.mail.ChangeEmail.Watchers.List list ) { for ( com.google.gerrit.reviewdb.client.Account.Id user : list.accounts ) { add ( type , user ) ; } for ( com.google.gerrit.server.mail.Address addr : list.emails ) { add ( type , addr ) ; } }

Target:
protected void includeWatchers ( com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType type ) { try { com.google.gerrit.server.mail.ProjectWatch.Watchers matching = getWatchers ( type ) ; add ( RecipientType.TO , matching.to ) ; add ( RecipientType.CC , matching.cc ) ; add ( RecipientType.BCC , matching.bcc ) ; } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.ChangeEmail.log.warn ( ( "Cannot BCC watchers for " + type ) , err ) ; } }
Source:
public static com.google.gerrit.extensions.events.LifecycleListener start ( final java.nio.file.Path sitePath ) throws java.io.IOException { java.nio.file.Path logdir = com.google.gerrit.common.FileUtil.mkdirsOrDie ( new com.google.gerrit.server.config.SitePaths ( sitePath ) . logs_dir , "Cannot create log directory" ) ; if ( com.google.gerrit.server.util.SystemLog.shouldConfigure ( ) ) { com.google.gerrit.pgm.util.ErrorLogFile.initLogSystem ( logdir ) ; } return new com.google.gerrit.extensions.events.LifecycleListener ( ) { @ java.lang.Override public void start ( ) { } @ java.lang.Override public void stop ( ) { org.apache.log4j.LogManager.shutdown ( ) ; } } ; }

Target:
public static com.google.gerrit.extensions.events.LifecycleListener start ( final java.nio.file.Path sitePath , final org.eclipse.jgit.lib.Config config ) throws java.io.IOException { java.nio.file.Path logdir = com.google.gerrit.common.FileUtil.mkdirsOrDie ( new com.google.gerrit.server.config.SitePaths ( sitePath ) . logs_dir , "Cannot create log directory" ) ; if ( com.google.gerrit.server.util.SystemLog.shouldConfigure ( ) ) { com.google.gerrit.pgm.util.ErrorLogFile.initLogSystem ( logdir , config ) ; } return new com.google.gerrit.extensions.events.LifecycleListener ( ) { @ java.lang.Override public void start ( ) { } @ java.lang.Override public void stop ( ) { org.apache.log4j.LogManager.shutdown ( ) ; } } ; }
Source:
public final SubmitRecord.Label.Status status ( ) { if ( ( approved ( ) ) != null ) { return SubmitRecord.Label.Status.OK ; } else if ( ( rejected ( ) ) != null ) { return SubmitRecord.Label.Status.REJECT ; } else { return SubmitRecord.Label.Status.NEED ; } }

Target:
public final SubmitRecord.Label.Status status ( ) { if ( ( approved ( ) ) != null ) { return SubmitRecord.Label.Status.OK ; } else if ( ( rejected ( ) ) != null ) { return SubmitRecord.Label.Status.REJECT ; } else if ( optional ( ) ) { return SubmitRecord.Label.Status.MAY ; } else { return SubmitRecord.Label.Status.NEED ; } }
Source:
public com.google.gerrit.client.account.ExternalIdDetail run ( com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.Account.Id me = com.google.gerrit.client.rpc.Common.getAccountId ( ) ; final java.util.List < com.google.gerrit.client.reviewdb.TrustedExternalId > trusted = com.google.gerrit.client.rpc.Common.getGroupCache ( ) . getTrustedExternalIds ( db ) ; final java.util.List < com.google.gerrit.client.reviewdb.AccountExternalId > myIds = db.accountExternalIds ( ) . byAccount ( me ) . toList ( ) ; return new com.google.gerrit.client.account.ExternalIdDetail ( myIds , trusted ) ; }

Target:
public void myExternalIds ( com.google.gwt.user.client.rpc.AsyncCallback < java.util.List < com.google.gerrit.client.reviewdb.AccountExternalId > > callback ) { externalIdDetailFactory.create ( ) . to ( callback ) ; }
Source:
public void addComment ( final java.lang.String issueId , final java.lang.String comment ) throws java.io.IOException { com.googlesource.gerrit.plugins.its.storyboard.StoryboardClient.log.debug ( "Posting comment with data: ({},{})" , issueId , comment ) ; final java.lang.String url = ( ( ( ( baseUrl ) + ( com.googlesource.gerrit.plugins.its.storyboard.StoryboardClient.STORIES_ENDPOINT ) ) + "/" ) + issueId ) + "/comments" ; final java.lang.String escapedComment = comment.replace ( "\n" , "\\n" ) ; final java.lang.String json = ( ( ( "{\"story_id\":\"" + issueId ) + "\",\"content\":\"" ) + escapedComment ) + "\"}" ; postData ( url , json ) ; }

Target:
public void addComment ( final java.lang.String issueId , final java.lang.String comment ) throws java.io.IOException { int story_id = getStoryId ( issueId ) ; com.googlesource.gerrit.plugins.its.storyboard.StoryboardClient.log.debug ( "Posting comment with data: ({},{})" , story_id , comment ) ; final java.lang.String url = ( ( ( ( baseUrl ) + ( com.googlesource.gerrit.plugins.its.storyboard.StoryboardClient.STORIES_ENDPOINT ) ) + "/" ) + story_id ) + "/comments" ; final java.lang.String escapedComment = comment.replace ( "\n" , "\\n" ) ; final java.lang.String json = ( ( ( "{\"story_id\":\"" + issueId ) + "\",\"content\":\"" ) + escapedComment ) + "\"}" ; postData ( url , json ) ; }
Source:
public void submitOnPush ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException , org.eclipse.jgit.errors.ConfigInvalidException { grantSubmit ( project , "refs/for/refs/heads/master" ) ; com.google.gerrit.acceptance.git.PushOneCommit.Result r = pushTo ( "refs/for/master%submit" ) ; r.assertOkStatus ( ) ; r.assertChange ( Change.Status.MERGED , null , admin ) ; assertSubmitApproval ( r.getPatchSetId ( ) ) ; assertCommit ( project , "refs/heads/master" ) ; }

Target:
public void submitOnPush ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException , org.eclipse.jgit.errors.ConfigInvalidException { grant ( Permission.SUBMIT , project , "refs/for/refs/heads/master" ) ; com.google.gerrit.acceptance.git.PushOneCommit.Result r = pushTo ( "refs/for/master%submit" ) ; r.assertOkStatus ( ) ; r.assertChange ( Change.Status.MERGED , null , admin ) ; assertSubmitApproval ( r.getPatchSetId ( ) ) ; assertCommit ( project , "refs/heads/master" ) ; }
Source:
public java.util.List < java.lang.String > getMoreStable ( java.lang.String branch ) { int i = order.indexOf ( com.google.gerrit.reviewdb.client.RefNames.fullName ( branch ) ) ; if ( 0 <= i ) { return order.subList ( ( i + 1 ) , order.size ( ) ) ; } else { return com.google.common.collect.ImmutableList.of ( ) ; } }

Target:
public java.lang.String [ ] getMoreStable ( java.lang.String branch ) { int i = order.indexOf ( com.google.gerrit.reviewdb.client.RefNames.fullName ( branch ) ) ; if ( 0 <= i ) { java.util.List < java.lang.String > r = order.subList ( ( i + 1 ) , order.size ( ) ) ; return r.toArray ( new java.lang.String [ r.size ( ) ] ) ; } return new java.lang.String [ ] { } ; }
Source:
public static com.google.gerrit.common.data.PermissionRule remove ( com.google.gerrit.server.git.ProjectConfig project , java.lang.String capabilityName , com.google.gerrit.reviewdb.client.AccountGroup.UUID group ) { com.google.gerrit.common.data.PermissionRule rule = com.google.gerrit.server.project.testing.Util.newRule ( project , group ) ; project.getAccessSection ( AccessSection.GLOBAL_CAPABILITIES , true ) . getPermission ( capabilityName , true ) . remove ( rule ) ; return rule ; }

Target:
public static com.google.gerrit.common.data.PermissionRule remove ( com.google.gerrit.server.project.ProjectConfig project , java.lang.String capabilityName , com.google.gerrit.reviewdb.client.AccountGroup.UUID group ) { com.google.gerrit.common.data.PermissionRule rule = com.google.gerrit.server.project.testing.Util.newRule ( project , group ) ; project.getAccessSection ( AccessSection.GLOBAL_CAPABILITIES , true ) . getPermission ( capabilityName , true ) . remove ( rule ) ; return rule ; }
Source:
public void insertedWhitespaceIsRecognizedInIdenticalLines ( ) throws java.lang.Exception { java.lang.String a = " int *foobar\n int *foobar\n" ; java.lang.String b = " int * foobar\n int * foobar\n" ; java.util.List < org.eclipse.jgit.diff.Edit > expected = new org.eclipse.jgit.diff.EditList ( ) ; expected.add ( new org.eclipse.jgit.diff.Edit ( 6 , 6 , 6 , 7 ) ) ; expected.add ( new org.eclipse.jgit.diff.Edit ( 19 , 19 , 20 , 21 ) ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.patch.IntraLineLoaderTest.intraline ( a , b ) ) . isEqualTo ( expected ) ; }

Target:
public void insertedWhitespaceIsRecognizedInMultipleLines ( ) throws java.lang.Exception { java.lang.String a = " int *foobar\n int *foobar\n" ; java.lang.String b = " int * foobar\n int * foobar\n" ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.patch.IntraLineLoaderTest.intraline ( a , b ) ) . isEqualTo ( com.google.gerrit.server.patch.IntraLineLoaderTest.ref ( ) . common ( " int *" ) . insert ( " " ) . common ( "foobar\n" ) . common ( " int *" ) . insert ( " " ) . common ( "foobar\n" ) . edits ) ; }
Source:
private PushOneCommit.Result push ( java.lang.String content , java.lang.String baseChangeId ) throws java.lang.Exception { java.lang.String subject = "Change subject" ; java.lang.String fileName = "a.txt" ; com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , git , subject , fileName , content , baseChangeId ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = push.to ( "refs/for/master" ) ; r.assertOkStatus ( ) ; return r ; }

Target:
private PushOneCommit.Result push ( java.lang.String content , java.lang.String baseChangeId ) throws java.lang.Exception { java.lang.String subject = "Change subject" ; java.lang.String fileName = "a.txt" ; com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , testRepo , subject , fileName , content , baseChangeId ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = push.to ( "refs/for/master" ) ; r.assertOkStatus ( ) ; return r ; }
Source:
private static void printCommits ( final java.io.PrintWriter stdout , final java.util.List < org.eclipse.jgit.lib.ObjectId > commits ) { boolean first = true ; for ( final org.eclipse.jgit.lib.ObjectId c : commits ) { if ( ! first ) { stdout.print ( ",\n" ) ; } stdout.print ( c.getName ( ) ) ; first = false ; } stdout.print ( "\n\n" ) ; }

Target:
private void printCommits ( java.util.List < java.lang.String > commits , java.lang.String message ) { if ( org.apache.commons.collections.CollectionUtils.isNotEmpty ( commits ) ) { stdout.print ( ( message + ":\n" ) ) ; stdout.print ( com.google.common.base.Joiner.on ( ",\n" ) . join ( commits ) ) ; stdout.print ( "\n\n" ) ; } }
Source:
public void testHeadRefReplicated ( ) throws java.net.URISyntaxException { org.easymock.EasyMock.reset ( dispatcherMock ) ; com.googlesource.gerrit.plugins.replication.RefReplicatedEvent expectedEvent = new com.googlesource.gerrit.plugins.replication.RefReplicatedEvent ( "someProject" , "refs/heads/master" , "someHost" , com.googlesource.gerrit.plugins.replication.ReplicationState.RefPushResult.SUCCEEDED , RemoteRefUpdate.Status.OK ) ; dispatcherMock.postEvent ( org.easymock.EasyMock.anyObject ( Branch.NameKey.class ) , com.googlesource.gerrit.plugins.replication.RefReplicatedEventEquals.eqEvent ( expectedEvent ) ) ; org.easymock.EasyMock.expectLastCall ( ) . once ( ) ; org.easymock.EasyMock.replay ( dispatcherMock ) ; gitUpdateProcessing.onRefReplicatedToOneNode ( "someProject" , "refs/heads/master" , new org.eclipse.jgit.transport.URIish ( "git://someHost/someProject.git" ) , RefPushResult.SUCCEEDED , RemoteRefUpdate.Status.OK ) ; org.easymock.EasyMock.verify ( dispatcherMock ) ; }

Target:
public void testChangeRefReplicated ( ) throws com.google.gwtorm.server.OrmException , java.net.URISyntaxException { org.easymock.EasyMock.reset ( dispatcherMock ) ; com.googlesource.gerrit.plugins.replication.RefReplicatedEvent expectedEvent = new com.googlesource.gerrit.plugins.replication.RefReplicatedEvent ( "someProject" , "refs/changes/01/1/1" , "someHost" , com.googlesource.gerrit.plugins.replication.ReplicationState.RefPushResult.FAILED , RemoteRefUpdate.Status.REJECTED_NONFASTFORWARD ) ; dispatcherMock.postEvent ( com.googlesource.gerrit.plugins.replication.RefReplicatedEventEquals.eqEvent ( expectedEvent ) , org.easymock.EasyMock.anyObject ( com.google.gerrit.reviewdb.server.ReviewDb.class ) ) ; org.easymock.EasyMock.expectLastCall ( ) . once ( ) ; org.easymock.EasyMock.replay ( dispatcherMock ) ; gitUpdateProcessing.onRefReplicatedToOneNode ( "someProject" , "refs/changes/01/1/1" , new org.eclipse.jgit.transport.URIish ( "git://someHost/someProject.git" ) , RefPushResult.FAILED , RemoteRefUpdate.Status.REJECTED_NONFASTFORWARD ) ; org.easymock.EasyMock.verify ( dispatcherMock ) ; }
Source:
private static boolean isChangeScreen2 ( ) { if ( com.google.gerrit.client.Dispatcher.changeScreen2 ) { return true ; } com.google.gerrit.reviewdb.client.AccountGeneralPreferences.ChangeScreen ui = null ; if ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) { ui = com.google.gerrit.client.Gerrit.getUserAccount ( ) . getGeneralPreferences ( ) . getChangeScreen ( ) ; } if ( ui == null ) { ui = com.google.gerrit.client.Gerrit.getConfig ( ) . getChangeScreen ( ) ; } return ui == ( com.google.gerrit.client.changes.ChangeScreen.CHANGE_SCREEN2 ) ; }

Target:
private static boolean isChangeScreen2 ( ) { if ( ! ( com.google.gerrit.client.Gerrit.getConfig ( ) . getNewFeatures ( ) ) ) { return false ; } else if ( com.google.gerrit.client.Dispatcher.changeScreen2 ) { return true ; } com.google.gerrit.reviewdb.client.AccountGeneralPreferences.ChangeScreen ui = null ; if ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) { ui = com.google.gerrit.client.Gerrit.getUserAccount ( ) . getGeneralPreferences ( ) . getChangeScreen ( ) ; } if ( ui == null ) { ui = com.google.gerrit.client.Gerrit.getConfig ( ) . getChangeScreen ( ) ; } return ui == ( com.google.gerrit.client.changes.ChangeScreen.CHANGE_SCREEN2 ) ; }
Source:
public java.util.Set < com.google.gerrit.reviewdb.client.Change.Id > getStarredChanges ( ) { if ( ( starredChanges ) == null ) { checkRequestScope ( ) ; try { starredChanges = com.google.gerrit.server.IdentifiedUser.starredChangeIds ( ( ( starredQuery ) != null ? starredQuery : starredQuery ( ) ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.lang.RuntimeException e ) { com.google.gerrit.server.IdentifiedUser.log.warn ( "Cannot query starred changes" , e ) ; starredChanges = java.util.Collections.emptySet ( ) ; } finally { starredQuery = null ; } } return starredChanges ; }

Target:
public void asyncStarredChanges ( ) { if ( ( ( starredChanges ) == null ) && ( ( starredChangesUtil ) != null ) ) { starredQuery = starredChangesUtil.query ( accountId ) ; } }
Source:
protected < T > org.elasticsearch.index.query.QueryBuilder toQueryBuilder ( com.google.gerrit.server.query.Predicate < T > p ) throws com.google.gerrit.index.query.QueryParseException { if ( p instanceof com.google.gerrit.server.query.AndPredicate ) { return and ( p ) ; } else if ( p instanceof com.google.gerrit.server.query.OrPredicate ) { return or ( p ) ; } else if ( p instanceof com.google.gerrit.server.query.NotPredicate ) { return not ( p ) ; } else if ( p instanceof com.google.gerrit.server.index.IndexPredicate ) { return fieldQuery ( ( ( com.google.gerrit.server.index.IndexPredicate < T > ) ( p ) ) ) ; } else { throw new com.google.gerrit.index.query.QueryParseException ( ( "cannot create query for index: " + p ) ) ; } }

Target:
protected < T > org.elasticsearch.index.query.QueryBuilder toQueryBuilder ( com.google.gerrit.index.query.Predicate < T > p ) throws com.google.gerrit.index.query.QueryParseException { if ( p instanceof com.google.gerrit.index.query.AndPredicate ) { return and ( p ) ; } else if ( p instanceof com.google.gerrit.index.query.OrPredicate ) { return or ( p ) ; } else if ( p instanceof com.google.gerrit.index.query.NotPredicate ) { return not ( p ) ; } else if ( p instanceof com.google.gerrit.index.query.IndexPredicate ) { return fieldQuery ( ( ( com.google.gerrit.index.query.IndexPredicate < T > ) ( p ) ) ) ; } else { throw new com.google.gerrit.index.query.QueryParseException ( ( "cannot create query for index: " + p ) ) ; } }
Source:
private static com.google.gerrit.extensions.client.EditPreferencesInfo parseEditPreferences ( org.eclipse.jgit.lib.Config cfg , @ com.google.gerrit.common.Nullable org.eclipse.jgit.lib.Config defaultCfg , @ com.google.gerrit.common.Nullable com.google.gerrit.extensions.client.EditPreferencesInfo input ) throws org.eclipse.jgit.errors.ConfigInvalidException { return com.google.gerrit.server.config.ConfigUtil.loadSection ( cfg , UserConfigSections.EDIT , null , new com.google.gerrit.extensions.client.EditPreferencesInfo ( ) , ( defaultCfg != null ? com.google.gerrit.server.account.PreferencesConfig.parseDefaultEditPreferences ( defaultCfg , input ) : com.google.gerrit.extensions.client.EditPreferencesInfo.defaults ( ) ) , input ) ; }

Target:
private static com.google.gerrit.extensions.client.EditPreferencesInfo parseEditPreferences ( org.eclipse.jgit.lib.Config cfg , @ com.google.gerrit.common.Nullable org.eclipse.jgit.lib.Config defaultCfg , @ com.google.gerrit.common.Nullable com.google.gerrit.extensions.client.EditPreferencesInfo input ) throws org.eclipse.jgit.errors.ConfigInvalidException { return com.google.gerrit.server.config.ConfigUtil.loadSection ( cfg , UserConfigSections.EDIT , null , new com.google.gerrit.extensions.client.EditPreferencesInfo ( ) , ( defaultCfg != null ? com.google.gerrit.server.account.Preferences.parseDefaultEditPreferences ( defaultCfg , input ) : com.google.gerrit.extensions.client.EditPreferencesInfo.defaults ( ) ) , input ) ; }