auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void invalidRevision ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.enabled ( ) ) . isFalse ( ) ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.testutil.TestChanges.newPatchSet ( ctl.getChange ( ) . currentPatchSetId ( ) , "fooooooooooooooooooooooooooooooooooooooo" , adminId ) ; db.patchSets ( ) . update ( java.util.Collections.singleton ( ps ) ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Invalid revision on patch set 1:" + " fooooooooooooooooooooooooooooooooooooooo" ) ) ) ; }

Target:
public void invalidRevision ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.enabled ( ) ) . isFalse ( ) ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.testutil.TestChanges.newPatchSet ( ctl.getChange ( ) . currentPatchSetId ( ) , "fooooooooooooooooooooooooooooooooooooooo" , adminId ) ; db.patchSets ( ) . update ( java.util.Collections.singleton ( ps ) ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( "Invalid revision on patch set 1: fooooooooooooooooooooooooooooooooooooooo" ) ) ; }
Source:
protected void onUnload ( ) { super . onUnload ( ) ; if ( ( resizeHandler ) != null ) { resizeHandler.removeHandler ( ) ; resizeHandler = null ; } if ( ( cmA ) != null ) { cmA.getWrapperElement ( ) . removeFromParent ( ) ; cmA = null ; } if ( ( cmB ) != null ) { cmB.getWrapperElement ( ) . removeFromParent ( ) ; cmB = null ; } com.google.gwt.user.client.Window.enableScrolling ( true ) ; }

Target:
protected void onUnload ( ) { super . onUnload ( ) ; if ( ( resizeHandler ) != null ) { resizeHandler.removeHandler ( ) ; resizeHandler = null ; } if ( ( cmA ) != null ) { cmA.getWrapperElement ( ) . removeFromParent ( ) ; cmA = null ; } if ( ( cmB ) != null ) { cmB.getWrapperElement ( ) . removeFromParent ( ) ; cmB = null ; } com.google.gwt.user.client.Window.enableScrolling ( true ) ; mapper = null ; initialBoxes = null ; publishedMap = null ; }
Source:
public static boolean compareCommitValidationMessage ( java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m1 , java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m2 ) { for ( com.google.gerrit.server.git.validators.CommitValidationMessage cvm1 : m1 ) { boolean found = false ; for ( com.google.gerrit.server.git.validators.CommitValidationMessage cvm2 : m2 ) { if ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.compareCommitValidationMessage ( cvm1 , cvm2 ) ) { found = true ; } } if ( ! found ) { return false ; } } return true ; }

Target:
public static java.util.List < java.lang.String > transformMessages ( java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > messages ) { return com.google.common.collect.Lists.transform ( messages , new com.google.common.base.Function < com.google.gerrit.server.git.validators.CommitValidationMessage , java.lang.String > ( ) { @ java.lang.Override public java.lang.String apply ( com.google.gerrit.server.git.validators.CommitValidationMessage input ) { java.lang.String pre = ( input.isError ( ) ) ? "ERROR: " : "MSG: " ; return pre + ( input.getMessage ( ) ) ; } } ) ; }
Source:
public void updateMessageOnlyAddTrailingNewLines ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( modifier.createEdit ( change , getCurrentPatchSet ( changeId ) ) ) . isEqualTo ( RefUpdate.Result.NEW ) ; com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editUtil.byChange ( change ) ; exception.expect ( com.google.gerrit.server.edit.UnchangedCommitMessageException.class ) ; exception.expectMessage ( "New commit message cannot be same as existing commit message" ) ; modifier.modifyMessage ( edit.get ( ) , ( ( edit.get ( ) . getEditCommit ( ) . getFullMessage ( ) ) + "\n\n" ) ) ; }

Target:
public void updateMessageOnlyAddTrailingNewLines ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( modifier.createEdit ( change , getCurrentPatchSet ( changeId ) ) ) . isEqualTo ( RefUpdate.Result.NEW ) ; java.util.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editUtil.byChange ( change ) ; exception.expect ( com.google.gerrit.server.edit.UnchangedCommitMessageException.class ) ; exception.expectMessage ( "New commit message cannot be same as existing commit message" ) ; modifier.modifyMessage ( edit.get ( ) , ( ( edit.get ( ) . getEditCommit ( ) . getFullMessage ( ) ) + "\n\n" ) ) ; }
Source:
public void fieldSetEnd ( ) { final org.objectweb.asm.Type c = containerClass ( col ) ; mv.visitFieldInsn ( com.google.gwtorm.jdbc.gen.PUTFIELD , c.getInternalName ( ) , col.getFieldName ( ) , com.google.gwtorm.jdbc.gen.CodeGenSupport.toType ( col ) . getDescriptor ( ) ) ; }

Target:
public void fieldSetEnd ( ) { final org.objectweb.asm.Type c = containerClass ( col ) ; if ( ( dupOnSet ) >= 0 ) { mv.visitInsn ( com.google.gwtorm.jdbc.gen.DUP ) ; mv.visitVarInsn ( com.google.gwtorm.jdbc.gen.ASTORE , dupOnSet ) ; } mv.visitFieldInsn ( com.google.gwtorm.jdbc.gen.PUTFIELD , c.getInternalName ( ) , col.getFieldName ( ) , com.google.gwtorm.jdbc.gen.CodeGenSupport.toType ( col ) . getDescriptor ( ) ) ; }
Source:
private void createAdminsGroup ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.Sequences seqs , org.eclipse.jgit.lib.Repository allUsersRepo , com.google.gerrit.common.data.GroupReference groupReference ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.group.db.InternalGroupCreation groupCreation = getGroupCreation ( seqs , groupReference ) ; com.google.gerrit.server.group.db.InternalGroupUpdate groupUpdate = com.google.gerrit.server.group.db.InternalGroupUpdate.builder ( ) . setDescription ( "Gerrit Site Administrators" ) . build ( ) ; createGroup ( db , allUsersRepo , groupCreation , groupUpdate ) ; }

Target:
private void createBatchUsersGroup ( com.google.gerrit.server.Sequences seqs , org.eclipse.jgit.lib.Repository allUsersRepo , com.google.gerrit.common.data.GroupReference groupReference , com.google.gerrit.reviewdb.client.AccountGroup.UUID adminsGroupUuid ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.group.db.InternalGroupCreation groupCreation = getGroupCreation ( seqs , groupReference ) ; com.google.gerrit.server.group.db.InternalGroupUpdate groupUpdate = com.google.gerrit.server.group.db.InternalGroupUpdate.builder ( ) . setDescription ( "Users who perform batch actions on Gerrit" ) . setOwnerGroupUUID ( adminsGroupUuid ) . build ( ) ; createGroup ( allUsersRepo , groupCreation , groupUpdate ) ; }
Source:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.exceptions.PrologException { engine.setB0 ( ) ; com.googlecode.prolog_cafe.lang.Term a1 = arg1.dereference ( ) ; com.google.gerrit.server.project.ChangeControl control = StoredValues.CHANGE_CONTROL.get ( engine ) ; com.google.gerrit.extensions.client.SubmitType submitType = control.getProject ( ) . getSubmitType ( ) ; if ( ! ( a1.unify ( gerrit.PRED_project_default_submit_type_1.term [ submitType.ordinal ( ) ] , engine.trail ) ) ) { return engine.fail ( ) ; } return cont ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.exceptions.PrologException { engine.setB0 ( ) ; com.googlecode.prolog_cafe.lang.Term a1 = arg1.dereference ( ) ; com.google.gerrit.server.project.ProjectState projectState = StoredValues.PROJECT_STATE.get ( engine ) ; com.google.gerrit.extensions.client.SubmitType submitType = projectState.getProject ( ) . getSubmitType ( ) ; if ( ! ( a1.unify ( gerrit.PRED_project_default_submit_type_1.term [ submitType.ordinal ( ) ] , engine.trail ) ) ) { return engine.fail ( ) ; } return cont ; }
Source:
public java.lang.String toString ( ) { return com.google.common.base.Objects.toStringHelper ( this ) . omitNullValues ( ) . add ( "revision" , revision.getName ( ) ) . add ( "oldRevision" , ( ( oldRevision ) != null ? oldRevision.getName ( ) : null ) ) . add ( "path" , path ) . toString ( ) ; }

Target:
public java.lang.String toString ( ) { return com.google.common.base.MoreObjects.toStringHelper ( this ) . omitNullValues ( ) . add ( "revision" , revision.getName ( ) ) . add ( "oldRevision" , ( ( oldRevision ) != null ? oldRevision.getName ( ) : null ) ) . add ( "path" , path ) . toString ( ) ; }
Source:
public void testGetJGroupsMyUrlFromListenUrlWhenReverseProxyConfigured ( ) throws java.lang.Exception { org.mockito.Mockito.when ( configMock.getEnum ( com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , null , com.ericsson.gerrit.plugins.highavailability.Configuration.STRATEGY_KEY , com.ericsson.gerrit.plugins.highavailability.Configuration.DEFAULT_PEER_INFO_STRATEGY ) ) . thenReturn ( Configuration.PeerInfoStrategy.JGROUPS ) ; initializeConfiguration ( ) ; org.mockito.Mockito.when ( serverConfigMock.getStringList ( "httpd" , null , "listenUrl" ) ) . thenReturn ( new java.lang.String [ ] { "proxy-https://foo" } ) ; exception.expect ( com.ericsson.gerrit.plugins.highavailability.ProvisionException.class ) ; exception.expectMessage ( "when configured as reverse-proxy" ) ; getMyUrlProvider ( ) ; }

Target:
public void testGetJGroupsMyUrlFromListenUrlWhenReverseProxyConfigured ( ) throws java.lang.Exception { org.mockito.Mockito.when ( configMock.getEnum ( com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , null , com.ericsson.gerrit.plugins.highavailability.Configuration.STRATEGY_KEY , com.ericsson.gerrit.plugins.highavailability.Configuration.DEFAULT_PEER_INFO_STRATEGY ) ) . thenReturn ( Configuration.PeerInfoStrategy.JGROUPS ) ; initializeConfiguration ( ) ; org.mockito.Mockito.when ( serverConfigMock.getStringList ( "httpd" , null , "listenUrl" ) ) . thenReturn ( new java.lang.String [ ] { "proxy-https://foo" } ) ; exception.expect ( com.google.inject.ProvisionException.class ) ; exception.expectMessage ( "when configured as reverse-proxy" ) ; getMyUrlProvider ( ) ; }
Source:
public com.google.gerrit.server.restapi.change.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { return new com.google.gerrit.server.restapi.change.Description ( ) . setLabel ( "Start Review" ) . setTitle ( "Set Ready For Review" ) . setVisible ( ( ( ( rsrc.isUserOwner ( ) ) && ( ( rsrc.getChange ( ) . getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.NEW ) ) ) && ( rsrc.getChange ( ) . isWorkInProgress ( ) ) ) ) ; }

Target:
public com.google.gerrit.server.restapi.change.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { return new com.google.gerrit.server.restapi.change.Description ( ) . setLabel ( "Start Review" ) . setTitle ( "Set Ready For Review" ) . setVisible ( com.google.gerrit.extensions.conditions.BooleanCondition.and ( ( ( ( rsrc.getChange ( ) . getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.NEW ) ) && ( rsrc.getChange ( ) . isWorkInProgress ( ) ) ) , com.google.gerrit.extensions.conditions.BooleanCondition.or ( rsrc.isUserOwner ( ) , permissionBackend.currentUser ( ) . testCond ( GlobalPermission.ADMINISTRATE_SERVER ) ) ) ) ; }
Source:
public static com.google.gerrit.server.index.IndexConfig create ( int maxLimit , int maxPages , int maxTerms ) { return new com.google.gerrit.server.index.AutoValue_IndexConfig ( com.google.gerrit.server.index.IndexConfig.checkLimit ( maxLimit , "maxLimit" , java.lang.Integer.MAX_VALUE ) , com.google.gerrit.server.index.IndexConfig.checkLimit ( maxPages , "maxPages" , java.lang.Integer.MAX_VALUE ) , com.google.gerrit.server.index.IndexConfig.checkLimit ( maxTerms , "maxTerms" , com.google.gerrit.server.index.IndexConfig.DEFAULT_MAX_TERMS ) ) ; }

Target:
public abstract com.google.gerrit.server.index.IndexConfig.Builder maxLimit ( int maxLimit ) ;
Source:
public void run ( ) { int line = ( cm.extras ( ) . hasActiveLine ( ) ) ? cm.getLineNumber ( cm.extras ( ) . activeLine ( ) ) : 0 ; int res = java.util.Collections.binarySearch ( chunks , new com.google.gerrit.client.diff.DiffChunkInfo ( cm.side ( ) , line , 0 , 0 , false ) ) ; diffChunkNavHelper ( chunks , host , res , dir ) ; }

Target:
public void run ( ) { int line = ( cm.extras ( ) . hasActiveLine ( ) ) ? cm.getLineNumber ( cm.extras ( ) . activeLine ( ) ) : 0 ; int res = java.util.Collections.binarySearch ( chunks , new com.google.gerrit.client.diff.DiffChunkInfo ( cm.side ( ) , line , 0 , false ) , getDiffChunkComparator ( ) ) ; diffChunkNavHelper ( chunks , host , res , dir ) ; }
Source:
protected void migrateData ( com.google.gerrit.reviewdb.ReviewDb db , com.google.gerrit.server.schema.UpdateUI ui ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { systemConfig = db.systemConfig ( ) . get ( new com.google.gerrit.reviewdb.SystemConfig.Key ( ) ) ; categoryMap = db.approvalCategories ( ) . toMap ( db.approvalCategories ( ) . all ( ) ) ; assignGroupUUIDs ( db ) ; readOldRefRights ( db ) ; readProjectParents ( db ) ; exportProjectConfig ( db ) ; deleteActionCategories ( db ) ; }

Target:
protected void migrateData ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.schema.UpdateUI ui ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { systemConfig = db.systemConfig ( ) . get ( new com.google.gerrit.reviewdb.client.SystemConfig.Key ( ) ) ; categoryMap = db.approvalCategories ( ) . toMap ( db.approvalCategories ( ) . all ( ) ) ; assignGroupUUIDs ( db ) ; readOldRefRights ( db ) ; readProjectParents ( db ) ; exportProjectConfig ( db ) ; deleteActionCategories ( db ) ; }
Source:
private void assertProblems ( com.google.gerrit.gpg.PublicKeyChecker checker , com.google.gerrit.gpg.testutil.TestKey k , java.lang.String ... expected ) { com.google.gerrit.gpg.CheckResult result = checker.check ( k.getPublicKey ( ) , store ) ; org.junit.Assert.assertEquals ( java.util.Arrays.asList ( expected ) , result.getProblems ( ) ) ; }

Target:
private com.google.gerrit.gpg.PublicKeyChecker newChecker ( int maxTrustDepth , com.google.gerrit.gpg.testutil.TestKey ... trusted ) { java.util.Map < java.lang.Long , com.google.gerrit.gpg.Fingerprint > fps = new java.util.HashMap < > ( ) ; for ( com.google.gerrit.gpg.testutil.TestKey k : trusted ) { com.google.gerrit.gpg.Fingerprint fp = new com.google.gerrit.gpg.Fingerprint ( k.getPublicKey ( ) . getFingerprint ( ) ) ; fps.put ( fp.getId ( ) , fp ) ; } return new com.google.gerrit.gpg.PublicKeyChecker ( ) . enableTrust ( maxTrustDepth , fps ) . setStore ( store ) ; }
Source:
private com.google.gerrit.client.diff.DraftBox addNewDraft ( net.codemirror.lib.CodeMirror cm , int line , net.codemirror.lib.TextMarker.FromTo fromTo ) { com.google.gerrit.client.diff.DisplaySide side = getSideFromCm ( cm ) ; return addDraftBox ( com.google.gerrit.client.changes.CommentInfo.createRange ( path , getStoredSideFromDisplaySide ( side ) , ( line + 1 ) , null , null , com.google.gerrit.client.diff.CommentRange.create ( fromTo ) ) , side ) ; }

Target:
com.google.gerrit.client.diff.LineMapper.LineOnOtherInfo lineOnOther ( com.google.gerrit.client.diff.DisplaySide side , int line ) { return chunkManager.getLineMapper ( ) . lineOnOther ( side , line ) ; }
Source:
private javax.naming.directory.DirContext open ( ) throws javax.naming.NamingException { final java.util.Properties env = new java.util.Properties ( ) ; env.put ( javax.naming.Context.INITIAL_CONTEXT_FACTORY , com.google.gerrit.server.ldap.LdapRealm.LDAP ) ; env.put ( javax.naming.Context.PROVIDER_URL , server ) ; if ( ( username ) != null ) { env.put ( javax.naming.Context.SECURITY_PRINCIPAL , username ) ; env.put ( javax.naming.Context.SECURITY_CREDENTIALS , ( ( password ) != null ? password : "" ) ) ; } return new javax.naming.directory.InitialDirContext ( env ) ; }

Target:
private javax.naming.directory.DirContext open ( ) throws javax.naming.NamingException { final java.util.Properties env = createContextProperties ( ) ; if ( ( username ) != null ) { env.put ( javax.naming.Context.SECURITY_AUTHENTICATION , "simple" ) ; env.put ( javax.naming.Context.SECURITY_PRINCIPAL , username ) ; env.put ( javax.naming.Context.SECURITY_CREDENTIALS , ( ( password ) != null ? password : "" ) ) ; } return new javax.naming.directory.InitialDirContext ( env ) ; }
Source:
public void queryChangesOneTerm ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r1 = createChange ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r2 = createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = query ( "status:open" ) ; com.google.common.truth.Truth.assertThat ( results.size ( ) ) . is ( 2 ) ; com.google.common.truth.Truth.assertThat ( results.get ( 0 ) . changeId ) . isEqualTo ( r2.getChangeId ( ) ) ; com.google.common.truth.Truth.assertThat ( results.get ( 1 ) . changeId ) . isEqualTo ( r1.getChangeId ( ) ) ; }

Target:
public void queryChangesOneTerm ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r1 = createChange ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r2 = createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = query ( "status:open" ) ; com.google.common.truth.Truth.assertThat ( results ) . hasSize ( 2 ) ; com.google.common.truth.Truth.assertThat ( results.get ( 0 ) . changeId ) . isEqualTo ( r2.getChangeId ( ) ) ; com.google.common.truth.Truth.assertThat ( results.get ( 1 ) . changeId ) . isEqualTo ( r1.getChangeId ( ) ) ; }
Source:
public void queryChangesNoOptions ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.common.ChangeInfo result = com.google.common.collect.Iterables.getOnlyElement ( gApi.changes ( ) . query ( r.getChangeId ( ) ) . get ( ) ) ; org.junit.Assert.assertNull ( result.labels ) ; org.junit.Assert.assertNull ( result.messages ) ; org.junit.Assert.assertNull ( result.revisions ) ; org.junit.Assert.assertNull ( result.actions ) ; }

Target:
public void queryChangesReviewerNotReviewed ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.api.changes.AddReviewerInput in = new com.google.gerrit.extensions.api.changes.AddReviewerInput ( ) ; in.reviewer = user.email ; gApi.changes ( ) . id ( ( "p~master~" + ( r.getChangeId ( ) ) ) ) . addReviewer ( in ) ; setApiUser ( user ) ; org.junit.Assert.assertNull ( get ( r.getChangeId ( ) ) . reviewed ) ; }
Source:
public void noRescheduleOnNonRecoverableException ( ) throws java.io.IOException { org.mockito.Mockito.when ( session.post ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.WEBHOOK_URL , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.BODY ) ) . thenThrow ( javax.net.ssl.SSLException.class ) ; task.run ( ) ; org.mockito.Mockito.verifyZeroInteractions ( executor ) ; }

Target:
public void noRescheduleOnNonRecoverableException ( ) throws java.io.IOException { org.mockito.Mockito.when ( session.post ( org.mockito.ArgumentMatchers.eq ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.WEBHOOK_URL ) , org.mockito.ArgumentMatchers.eq ( content ) ) ) . thenThrow ( javax.net.ssl.SSLException.class ) ; task.run ( ) ; org.mockito.Mockito.verifyZeroInteractions ( executor ) ; }
Source:
public void run ( ) { if ( cm.extras ( ) . hasActiveLine ( ) ) { com.google.gerrit.client.diff.SideBySideCommentGroup w = map ( cm.side ( ) ) . get ( ( ( cm.getLineNumber ( cm.extras ( ) . activeLine ( ) ) ) + 1 ) ) ; if ( w != null ) { w.openCloseAll ( ) ; } } }

Target:
void newDraftOnGutterClick ( net.codemirror.lib.CodeMirror cm , java.lang.String gutterClass , int line ) { if ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { signInCallback ( cm ) . run ( ) ; } else { insertNewDraft ( cm.side ( ) , line ) ; } }
Source:
protected void configure ( ) { bind ( java.util.concurrent.Executor.class ) . annotatedWith ( com.ericsson.gerrit.plugins.highavailability.index.IndexExecutor.class ) . toProvider ( com.ericsson.gerrit.plugins.highavailability.index.IndexExecutorProvider.class ) ; listener ( ) . to ( com.ericsson.gerrit.plugins.highavailability.index.IndexExecutorProvider.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.ChangeIndexedListener.class ) . to ( com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandler.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.AccountIndexedListener.class ) . to ( com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandler.class ) ; }

Target:
protected void configure ( ) { bind ( java.util.concurrent.Executor.class ) . annotatedWith ( com.ericsson.gerrit.plugins.highavailability.index.IndexExecutor.class ) . toProvider ( com.ericsson.gerrit.plugins.highavailability.index.IndexExecutorProvider.class ) ; listener ( ) . to ( com.ericsson.gerrit.plugins.highavailability.index.IndexExecutorProvider.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.ChangeIndexedListener.class ) . to ( com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandler.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.AccountIndexedListener.class ) . to ( com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandler.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.GroupIndexedListener.class ) . to ( com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandler.class ) ; }
Source:
void removeDraft ( com.google.gerrit.common.changes.Side side , int line ) { net.codemirror.lib.CodeMirror.LineHandle handle = getCmFromSide ( side ) . getLineHandle ( line ) ; lineActiveBoxMap.remove ( handle ) ; if ( lineLastPublishedBoxMap.containsKey ( handle ) ) { lineActiveBoxMap.put ( handle , lineLastPublishedBoxMap.get ( handle ) ) ; } }

Target:
void removeDraft ( com.google.gerrit.client.diff.DraftBox box , com.google.gerrit.common.changes.Side side , int line ) { net.codemirror.lib.CodeMirror.LineHandle handle = getCmFromSide ( side ) . getLineHandle ( line ) ; lineActiveBoxMap.remove ( handle ) ; if ( lineLastPublishedBoxMap.containsKey ( handle ) ) { lineActiveBoxMap.put ( handle , lineLastPublishedBoxMap.get ( handle ) ) ; } }
Source:
public void testInsertOneException ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { stubExecuteBatchException ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT , new java.sql.BatchUpdateException ( ) ) ; try { createClassUnderTest ( ) . insert ( com.google.gwtorm.jdbc.TestJdbcAccess.ONE_ROW ) ; org.junit.Assert.fail ( "missingException" ) ; } catch ( com.google.gwtorm.client.OrmException e ) { } }

Target:
public void testDeleteOneExisting ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement delete = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.DELETE , 1 ) ; createClassUnderTest ( ) . delete ( oneRow ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( delete ) ; }
Source:
private void initMacs ( final org.eclipse.jgit.lib.Config cfg ) { setMacFactories ( com.google.gerrit.sshd.SshDaemon.filter ( cfg , "mac" , new org.apache.sshd.common.mac.HMACMD5.Factory ( ) , new org.apache.sshd.common.mac.HMACSHA1.Factory ( ) , new org.apache.sshd.common.mac.HMACMD596.Factory ( ) , new org.apache.sshd.common.mac.HMACSHA196.Factory ( ) ) ) ; }

Target:
private void initMacs ( org.eclipse.jgit.lib.Config cfg ) { java.util.List < org.apache.sshd.common.NamedFactory < org.apache.sshd.common.mac.Mac > > m = org.apache.sshd.common.BaseBuilder.setUpDefaultMacs ( true ) ; setMacFactories ( com.google.gerrit.sshd.SshDaemon.filter ( cfg , "mac" , ( ( org.apache.sshd.common.NamedFactory < org.apache.sshd.common.mac.Mac > [ ] ) ( m.toArray ( new org.apache.sshd.common.NamedFactory [ m.size ( ) ] ) ) ) ) ) ; }
Source:
protected void migrateData ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.schema.UpdateUI ui ) throws java.sql.SQLException { java.sql.Statement stmt = ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) . getConnection ( ) . createStatement ( ) ; try { if ( ( ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) . getDialect ( ) ) instanceof com.google.gwtorm.schema.sql.DialectPostgreSQL ) { stmt.execute ( ( "CREATE INDEX changes_byBranchClosed" + ( " ON changes (status, dest_project_name, dest_branch_name, sort_key)" + " WHERE open = 'N'" ) ) ) ; } else { stmt.execute ( ( "CREATE INDEX changes_byBranchClosed" + " ON changes (status, dest_project_name, dest_branch_name, sort_key)" ) ) ; } } finally { stmt.close ( ) ; } }

Target:
protected void migrateData ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.schema.UpdateUI ui ) throws java.sql.SQLException { try ( java.sql.Statement stmt = newStatement ( db ) ) { if ( ( ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) . getDialect ( ) ) instanceof com.google.gwtorm.schema.sql.DialectPostgreSQL ) { stmt.execute ( ( "CREATE INDEX changes_byBranchClosed" + ( " ON changes (status, dest_project_name, dest_branch_name, sort_key)" + " WHERE open = 'N'" ) ) ) ; } else { stmt.execute ( ( "CREATE INDEX changes_byBranchClosed" + " ON changes (status, dest_project_name, dest_branch_name, sort_key)" ) ) ; } } }
Source:
protected void configure ( ) { factory ( RenameGroupOp.Factory.class ) ; factory ( MetaDataUpdate.InternalFactory.class ) ; bind ( MetaDataUpdate.Server.class ) ; bind ( com.google.gerrit.server.git.ReceiveConfig.class ) ; }

Target:
protected void configure ( ) { factory ( RenameGroupOp.Factory.class ) ; factory ( MetaDataUpdate.InternalFactory.class ) ; bind ( MetaDataUpdate.Server.class ) ; bind ( com.google.gerrit.server.git.ReceiveConfig.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , org.eclipse.jgit.transport.PostUploadHook.class ) . to ( com.google.gerrit.server.git.UploadPackMetricsHook.class ) ; }
Source:
public void testVerifyAgainstDifferentObjectId ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.lfs.AuthInfo info = auth.generateAuthInfo ( "o" , org.eclipse.jgit.lfs.lib.LongObjectId.zeroId ( ) , 1 ) ; com.google.common.truth.Truth.assertThat ( auth.verifyAuthInfo ( info.authToken , "o" , org.eclipse.jgit.lfs.lib.LongObjectId.fromString ( ( "123456789012345678901234567890" + ( "123456789012345678901234567890" + "1234" ) ) ) ) ) . isFalse ( ) ; }

Target:
public void testVerifyAgainstDifferentObjectId ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.lfs.AuthInfo info = auth.generateAuthInfo ( "o" , org.eclipse.jgit.lfs.lib.LongObjectId.zeroId ( ) , java.time.Instant.now ( ) , 1L ) ; com.google.common.truth.Truth.assertThat ( auth.verifyAuthInfo ( info.authToken ( ) , "o" , org.eclipse.jgit.lfs.lib.LongObjectId.fromString ( ( "123456789012345678901234567890" + ( "123456789012345678901234567890" + "1234" ) ) ) ) ) . isFalse ( ) ; }
Source:
public void customLabelAnyWithBlock_NegativeVoteBlock ( ) throws java.lang.Exception { Q.setFunctionName ( "AnyWithBlock" ) ; saveLabelConfig ( ) ; com.google.gerrit.acceptance.rest.change.ChangeInfo c = get ( disliked ( change ( ) ) ) ; com.google.gerrit.server.change.ChangeJson.LabelInfo q = c.labels.get ( Q.getName ( ) ) ; org.junit.Assert.assertEquals ( 1 , q.all.size ( ) ) ; org.junit.Assert.assertNull ( q.disliked ) ; org.junit.Assert.assertNotNull ( q.rejected ) ; }

Target:
public void customLabelAnyWithBlock_NegativeVoteBlock ( ) throws java.lang.Exception { Q.setFunctionName ( "AnyWithBlock" ) ; saveLabelConfig ( ) ; com.google.gerrit.acceptance.rest.change.ChangeInfo c = get ( disliked ( change ( ) ) ) ; com.google.gerrit.server.change.ChangeJson.LabelInfo q = c.labels.get ( Q.getName ( ) ) ; org.junit.Assert.assertEquals ( 1 , q.all.size ( ) ) ; org.junit.Assert.assertNull ( q.disliked ) ; org.junit.Assert.assertNotNull ( q.rejected ) ; org.junit.Assert.assertTrue ( q.blocking ) ; }
Source:
public com.google.gerrit.extensions.common.ChangeInfo addChangeActions ( com.google.gerrit.extensions.common.ChangeInfo to , com.google.gerrit.server.project.ChangeControl ctl ) { to.actions = toActionMap ( ctl ) ; return to ; }

Target:
public com.google.gerrit.extensions.common.RevisionInfo addRevisionActions ( @ com.google.gerrit.common.Nullable com.google.gerrit.extensions.common.ChangeInfo changeInfo , com.google.gerrit.extensions.common.RevisionInfo to , com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.extensions.api.changes.ActionVisitor > visitors = visitors ( ) ; if ( ! ( visitors.isEmpty ( ) ) ) { if ( changeInfo != null ) { changeInfo = copy ( visitors , changeInfo ) ; } else { changeInfo = changeJson ( ) . format ( rsrc ) ; } } to.actions = toActionMap ( rsrc , visitors , changeInfo , copy ( visitors , to ) ) ; return to ; }
Source:
private java.lang.String replaceInUrl ( java.lang.String url , java.lang.String replacement ) { if ( ( ( replacement == null ) || ( url == null ) ) || ( ( url.contains ( com.googlesource.gerrit.plugins.avatars.external.ExternalUrlAvatarProvider.REPLACE_MARKER ) ) == false ) ) { return url ; } return url.replace ( com.googlesource.gerrit.plugins.avatars.external.ExternalUrlAvatarProvider.REPLACE_MARKER , com.google.gerrit.extensions.restapi.Url.encode ( replacement ) ) ; }

Target:
private java.lang.String replaceInUrl ( java.lang.String url , java.lang.String replacement ) { if ( ( ( replacement == null ) || ( url == null ) ) || ( ( url.contains ( com.googlesource.gerrit.plugins.avatars.external.ExternalUrlAvatarProvider.USER_PLACEHOLDER ) ) == false ) ) { return url ; } return url.replace ( com.googlesource.gerrit.plugins.avatars.external.ExternalUrlAvatarProvider.USER_PLACEHOLDER , com.google.gerrit.extensions.restapi.Url.encode ( replacement ) ) ; }
Source:
private static java.lang.StringBuilder buildRefsPrefix ( java.lang.String prefix , com.google.gerrit.reviewdb.client.Account.Id accountId ) { java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( prefix ) ; int n = ( accountId.get ( ) ) % 100 ; if ( n < 10 ) { r.append ( '0' ) ; } r.append ( n ) ; r.append ( '/' ) ; r.append ( accountId.get ( ) ) ; r.append ( '/' ) ; return r ; }

Target:
public static java.lang.String refsDraftCommentsPrefix ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { return com.google.gerrit.reviewdb.client.RefNames.buildRefsPrefix ( com.google.gerrit.reviewdb.client.RefNames.REFS_DRAFT_COMMENTS , accountId.get ( ) ) . toString ( ) ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; com.google.gerrit.client.dashboards.DashboardList.all ( getProjectKey ( ) , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.rpc.NativeList < com.google.gerrit.client.dashboards.DashboardList > > ( this ) { @ java.lang.Override protected void preDisplay ( com.google.gerrit.client.rpc.NativeList < com.google.gerrit.client.dashboards.DashboardList > result ) { dashes.display ( result ) ; } } ) ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; com.google.gerrit.client.dashboards.DashboardList.all ( getProjectKey ( ) , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.rpc.NativeList < com.google.gerrit.client.dashboards.DashboardList > > ( this ) { @ java.lang.Override protected void preDisplay ( com.google.gerrit.client.rpc.NativeList < com.google.gerrit.client.dashboards.DashboardList > result ) { dashes.display ( result ) ; } } ) ; savedPanel = DASHBOARDS ; }
Source:
private com.google.inject.Key < javax.servlet.http.HttpServlet > legacyGerritScreen ( ) { return key ( new javax.servlet.http.HttpServlet ( ) { @ java.lang.Override protected void doGet ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { final java.lang.String token = req.getPathInfo ( ) . substring ( 1 ) ; toGerrit ( token , req , rsp ) ; } } ) ; }

Target:
private com.google.inject.Key < javax.servlet.http.HttpServlet > legacyGerritScreen ( ) { return key ( new javax.servlet.http.HttpServlet ( ) { private static final long serialVersionUID = 1L ; @ java.lang.Override protected void doGet ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { final java.lang.String token = req.getPathInfo ( ) . substring ( 1 ) ; toGerrit ( token , req , rsp ) ; } } ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { if ( ( edit ) != null ) { edit.set_name ( edit.commit ( ) . commit ( ) ) ; result.revisions ( ) . put ( edit.name ( ) , com.google.gerrit.client.changes.ChangeInfo.RevisionInfo.fromEdit ( edit ) ) ; } render ( result.revisions ( ) ) ; loaded = true ; }

Target:
public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { if ( ( edit ) != null ) { edit.setName ( edit.commit ( ) . commit ( ) ) ; result.revisions ( ) . put ( edit.name ( ) , com.google.gerrit.client.changes.ChangeInfo.RevisionInfo.fromEdit ( edit ) ) ; } render ( result.revisions ( ) ) ; loaded = true ; }
Source:
public void display ( com.google.gerrit.reviewdb.client.Change chg , java.lang.Boolean starred , com.google.gerrit.reviewdb.client.PatchSetInfo info , final com.google.gerrit.common.data.AccountInfoCache acc ) { infoBlock.display ( chg , acc ) ; messageBlock.display ( chg.getId ( ) , starred , info.getMessage ( ) ) ; }

Target:
public void display ( com.google.gerrit.reviewdb.client.Change chg , java.lang.Boolean starred , com.google.gerrit.reviewdb.client.PatchSetInfo info , final com.google.gerrit.common.data.AccountInfoCache acc , com.google.gerrit.reviewdb.client.Project.SubmitType submitType ) { infoBlock.display ( chg , acc , submitType ) ; messageBlock.display ( chg.getId ( ) , starred , info.getMessage ( ) ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.projects.BranchInfo branch ) { showAddedBranch ( branch ) ; addBranch.setEnabled ( true ) ; nameTxtBox.setText ( "" ) ; irevTxtBox.setText ( "" ) ; branchTable.insert ( branch ) ; delBranch.setVisible ( branchTable.hasBranchCanDelete ( ) ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.projects.BranchInfo branch ) { showAddedBranch ( branch ) ; nameTxtBox.setText ( "" ) ; irevTxtBox.setText ( "" ) ; query = new com.google.gerrit.client.admin.ProjectBranchesScreen.Query ( match ) . start ( start ) . run ( ) ; }
Source:
public com.google.gerrit.server.query.change.ChangeData next ( ) { return convert ( itr.next ( ) ) ; }

Target:
public boolean hasNext ( ) { if ( ( next ) != null ) { return true ; } while ( itr.hasNext ( ) ) { com.google.gerrit.server.query.change.ChangeData d = convert ( itr.next ( ) ) ; if ( seen.add ( d.getId ( ) ) ) { next = d ; return true ; } } return false ; }
Source:
public void connect ( ) { if ( isOpen ( ) ) { com.googlesource.gerrit.plugins.kafka.session.type.KafkaSession.LOGGER.debug ( "Already connected." ) ; return ; } com.googlesource.gerrit.plugins.kafka.session.type.KafkaSession.LOGGER.info ( "Connect to {}..." , properties.getProperty ( "bootstrap.servers" ) ) ; producer = new org.apache.kafka.clients.producer.KafkaProducer ( properties ) ; com.googlesource.gerrit.plugins.kafka.session.type.KafkaSession.LOGGER.info ( "Connection established." ) ; }

Target:
public void connect ( ) { if ( isOpen ( ) ) { com.googlesource.gerrit.plugins.kafka.session.type.KafkaSession.LOGGER.debug ( "Already connected." ) ; return ; } com.googlesource.gerrit.plugins.kafka.session.type.KafkaSession.LOGGER.info ( "Connect to {}..." , properties.getProperty ( "bootstrap.servers" ) ) ; setConnectionClassLoader ( ) ; producer = new org.apache.kafka.clients.producer.KafkaProducer ( properties ) ; com.googlesource.gerrit.plugins.kafka.session.type.KafkaSession.LOGGER.info ( "Connection established." ) ; }
Source:
public void inheritSubmit_AllowInChildDoesntAffectUnblockInParent ( ) { com.google.gerrit.server.project.testing.Util.block ( parent , com.google.gerrit.common.data.Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( parent , com.google.gerrit.common.data.Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.permissions.ProjectControl u = user ( local ) ; assertNotBlocked ( com.google.gerrit.common.data.Permission.SUBMIT , "refs/heads/master" , u ) ; }

Target:
public void inheritSubmit_AllowInChildDoesntAffectUnblockInParent ( ) { com.google.gerrit.server.project.testing.Util.block ( parent , com.google.gerrit.common.data.Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( parent , com.google.gerrit.common.data.Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.permissions.ProjectControl u = user ( local ) ; com.google.common.truth.Truth.assertThat ( u.controlForRef ( "refs/heads/master" ) . canPerform ( com.google.gerrit.common.data.Permission.SUBMIT ) ) . named ( "submit is allowed" ) . isTrue ( ) ; }
Source:
com.google.gerrit.server.notedb.RobotCommentUpdate createRobotCommentUpdateIfNull ( ) { if ( ( robotCommentUpdate ) == null ) { com.google.gerrit.server.notedb.ChangeNotes notes = getNotes ( ) ; if ( notes != null ) { robotCommentUpdate = robotCommentUpdateFactory.create ( notes , accountId , authorIdent , when ) ; } else { robotCommentUpdate = robotCommentUpdateFactory.create ( getChange ( ) , accountId , authorIdent , when ) ; } } return robotCommentUpdate ; }

Target:
com.google.gerrit.server.notedb.RobotCommentUpdate createRobotCommentUpdateIfNull ( ) { if ( ( robotCommentUpdate ) == null ) { com.google.gerrit.server.notedb.ChangeNotes notes = getNotes ( ) ; if ( notes != null ) { robotCommentUpdate = robotCommentUpdateFactory.create ( notes , accountId , realAccountId , authorIdent , when ) ; } else { robotCommentUpdate = robotCommentUpdateFactory.create ( getChange ( ) , accountId , realAccountId , authorIdent , when ) ; } } return robotCommentUpdate ; }
Source:
protected void execStream ( final java.io.InputStream in , final java.lang.String p ) { try { runMethod0 ( console , shell , "execfile" , new java.lang.Class [ ] { java.io.InputStream.class , java.lang.String.class } , new java.lang.Object [ ] { in , p } ) ; } catch ( java.lang.reflect.InvocationTargetException e ) { com.google.gerrit.pgm.shell.JythonShell.log.error ( ( ( "Exception occured while loading " + p ) + " : " ) , e ) ; } }

Target:
protected void execStream ( final java.io.InputStream in , final java.lang.String p ) { try { runMethod0 ( console , shell , "execfile" , new java.lang.Class [ ] { java.io.InputStream.class , java.lang.String.class } , new java.lang.Object [ ] { in , p } ) ; } catch ( java.lang.reflect.InvocationTargetException e ) { com.google.gerrit.pgm.JythonShell.log.error ( ( ( "Exception occured while loading " + p ) + " : " ) , e ) ; } }
Source:
private void submit ( ) { Util.MANAGE_SVC.submit ( patchSetId , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.common.data.ChangeDetail > ( ) { public void onSuccess ( com.google.gerrit.common.data.ChangeDetail result ) { saveStateOnUnload = false ; goChange ( ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { goChange ( ) ; super . onFailure ( caught ) ; } } ) ; }

Target:
private void submit ( ) { com.google.gerrit.client.changes.ChangeApi.submit ( patchSetId.getParentKey ( ) . get ( ) , revision , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.changes.SubmitInfo > ( ) { public void onSuccess ( com.google.gerrit.client.changes.SubmitInfo result ) { saveStateOnUnload = false ; goChange ( ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable err ) { if ( com.google.gerrit.client.changes.SubmitFailureDialog.isConflict ( err ) ) { new com.google.gerrit.client.changes.SubmitFailureDialog ( err.getMessage ( ) ) . center ( ) ; } else { super . onFailure ( err ) ; } goChange ( ) ; } } ) ; }
Source:
private void preMerge ( ) throws com.google.gerrit.server.git.MergeException , com.google.gwtorm.server.OrmException { openBranch ( ) ; validateChangeList ( ) ; mergeTip = branchTip ; switch ( destProject.getSubmitType ( ) ) { case CHERRY_PICK : cherryPickChanges ( ) ; break ; case FAST_FORWARD_ONLY : case MERGE_ALWAYS : case MERGE_IF_NECESSARY : default : reduceToMinimalMerge ( ) ; mergeTopics ( ) ; markCleanMerges ( ) ; break ; } }

Target:
private com.google.gerrit.server.git.SubmitStrategy createStrategy ( ) throws com.google.gerrit.server.git.MergeException { return submitStrategyFactory.create ( destProject.getSubmitType ( ) , db , repo , rw , inserter , CAN_MERGE , alreadyAccepted , destBranch , destProject.isUseContentMerge ( ) ) ; }
Source:
public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > event ) { saveProject.setEnabled ( true ) ; }

Target:
private void initDescription ( ) { final com.google.gwt.user.client.ui.VerticalPanel vp = new com.google.gwt.user.client.ui.VerticalPanel ( ) ; vp.add ( new com.google.gerrit.client.ui.SmallHeading ( Util.C.headingDescription ( ) ) ) ; descTxt = new com.google.gwtexpui.globalkey.client.NpTextArea ( ) ; descTxt.setVisibleLines ( 6 ) ; descTxt.setCharacterWidth ( 60 ) ; vp.add ( descTxt ) ; add ( vp ) ; saveEnabler = new com.google.gerrit.client.ui.OnEditEnabler ( saveProject ) ; saveEnabler.listenTo ( descTxt ) ; }
Source:
private PushOneCommit.Result createChangeWithTopic ( org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.InMemoryRepository > repo , java.lang.String topic , java.lang.String commitMsg , java.lang.String fileName , java.lang.String content ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , repo , commitMsg , fileName , content ) ; com.google.common.truth.Truth.assertThat ( topic ) . isNotEmpty ( ) ; return push.to ( ( "refs/for/master/" + ( name ( topic ) ) ) ) ; }

Target:
private PushOneCommit.Result createCommitAndPush ( org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.InMemoryRepository > repo , java.lang.String ref , java.lang.String commitMsg , java.lang.String fileName , java.lang.String content ) throws java.lang.Exception { return pushFactory.create ( db , admin.getIdent ( ) , repo , commitMsg , fileName , content ) . to ( ref ) ; }
Source:
private com.google.gerrit.server.group.InternalGroup toInternalGroup ( com.google.gson.JsonObject json ) { com.google.gson.JsonElement source = json.get ( "_source" ) ; if ( source == null ) { source = json.getAsJsonObject ( ) . get ( "fields" ) ; } com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid = new com.google.gerrit.reviewdb.client.AccountGroup.UUID ( source.getAsJsonObject ( ) . get ( GroupField.UUID.getName ( ) ) . getAsString ( ) ) ; return groupCache.get ( ) . get ( uuid ) . orElse ( null ) ; }

Target:
protected com.google.gerrit.server.group.InternalGroup fromDocument ( com.google.gson.JsonObject json , java.util.Set < java.lang.String > fields ) { com.google.gson.JsonElement source = json.get ( "_source" ) ; if ( source == null ) { source = json.getAsJsonObject ( ) . get ( "fields" ) ; } com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid = new com.google.gerrit.reviewdb.client.AccountGroup.UUID ( source.getAsJsonObject ( ) . get ( GroupField.UUID.getName ( ) ) . getAsString ( ) ) ; return groupCache.get ( ) . get ( uuid ) . orElse ( null ) ; }
Source:
private static com.google.common.collect.ImmutableListMultimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.server.query.change.ChangeData > byProject ( java.lang.Iterable < com.google.gerrit.server.query.change.ChangeData > changes ) throws com.google.gwtorm.server.OrmException { com.google.common.collect.ImmutableListMultimap.Builder < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.server.query.change.ChangeData > builder = new com.google.common.collect.ImmutableListMultimap.Builder < > ( ) ; for ( com.google.gerrit.server.query.change.ChangeData cd : changes ) { builder.put ( cd.change ( ) . getProject ( ) , cd ) ; } return builder.build ( ) ; }

Target:
private com.google.gerrit.server.git.MergeOpRepoManager.OpenRepo getRepo ( com.google.gerrit.reviewdb.client.Project.NameKey project ) throws java.io.IOException { if ( ( orm ) == null ) { orm = repoManagerProvider.get ( ) ; closeOrm = true ; } try { com.google.gerrit.server.git.MergeOpRepoManager.OpenRepo or = orm.openRepo ( project ) ; com.google.common.base.Preconditions.checkState ( or.rw.hasRevSort ( RevSort.TOPO ) ) ; return or ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { throw new java.io.IOException ( e ) ; } }
Source:
protected void run ( ) throws com.google.gerrit.sshd.commands.Failure { try { com.google.gerrit.server.project.BanCommit.Input input = BanCommit.Input.fromCommits ( com.google.common.collect.Lists.transform ( commitsToBan , ObjectId :: getName ) ) ; input.reason = reason ; com.google.gerrit.server.project.BanCommit.BanResultInfo r = banCommit.apply ( new com.google.gerrit.server.project.ProjectResource ( projectState , user ) , input ) ; printCommits ( r.newlyBanned , "The following commits were banned" ) ; printCommits ( r.alreadyBanned , "The following commits were already banned" ) ; printCommits ( r.ignored , "The following ids do not represent commits and were ignored" ) ; } catch ( java.lang.Exception e ) { throw die ( e ) ; } }

Target:
protected void run ( ) throws com.google.gerrit.sshd.commands.Failure { try { com.google.gerrit.extensions.common.BanCommitInput input = com.google.gerrit.extensions.common.BanCommitInput.fromCommits ( com.google.common.collect.Lists.transform ( commitsToBan , ObjectId :: getName ) ) ; input.reason = reason ; com.google.gerrit.server.project.BanCommit.BanResultInfo r = banCommit.apply ( new com.google.gerrit.server.project.ProjectResource ( projectState , user ) , input ) ; printCommits ( r.newlyBanned , "The following commits were banned" ) ; printCommits ( r.alreadyBanned , "The following commits were already banned" ) ; printCommits ( r.ignored , "The following ids do not represent commits and were ignored" ) ; } catch ( java.lang.Exception e ) { throw die ( e ) ; } }
Source:
public java.lang.String toProject ( final com.google.gerrit.reviewdb.Project.NameKey project ) { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; com.google.gerrit.common.data.GitwebLink.p ( r , project ) ; com.google.gerrit.common.data.GitwebLink.a ( r , "summary" ) ; return ( baseUrl ) + r ; }

Target:
public java.lang.String toProject ( final com.google.gerrit.reviewdb.Project.NameKey project ) { com.google.gerrit.common.data.ParamertizedString pattern = new com.google.gerrit.common.data.ParamertizedString ( type.getProject ( ) ) ; final java.util.Map < java.lang.String , java.lang.String > p = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; p.put ( "project" , com.google.gwt.http.client.URL.encodeComponent ( project.get ( ) ) ) ; return ( baseUrl ) + ( pattern.replace ( p ) ) ; }