auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.lang.PrologException { com.googlecode.prolog_cafe.lang.Term a3 = engine.areg3 ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.Iterator < java.util.Map.Entry < java.lang.String , com.google.gerrit.reviewdb.client.Account.Id > > iter = ( ( java.util.Iterator < java.util.Map.Entry < java.lang.String , com.google.gerrit.reviewdb.client.Account.Id > > ) ( ( ( com.googlecode.prolog_cafe.lang.JavaObjectTerm ) ( a3 ) ) . object ( ) ) ) ; if ( ! ( iter.hasNext ( ) ) ) { return engine.fail ( ) ; } return engine.jtry3 ( gerrit_owners.PRED_owner_2.OWNER_CHECK , gerrit_owners.PRED_owner_2.OWNER_NEXT ) ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.exceptions.PrologException { com.googlecode.prolog_cafe.lang.Term a3 = engine.r3 ; @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.Iterator < java.util.Map.Entry < java.lang.String , com.google.gerrit.reviewdb.client.Account.Id > > iter = ( ( java.util.Iterator < java.util.Map.Entry < java.lang.String , com.google.gerrit.reviewdb.client.Account.Id > > ) ( ( ( com.googlecode.prolog_cafe.lang.JavaObjectTerm ) ( a3 ) ) . object ( ) ) ) ; if ( ! ( iter.hasNext ( ) ) ) { return engine.fail ( ) ; } return engine.jtry3 ( gerrit_owners.PRED_owner_2.OWNER_CHECK , gerrit_owners.PRED_owner_2.OWNER_NEXT ) ; }
Source:
public void removeNonexisting ( ) throws java.lang.Exception { com.google.gerrit.server.git.gpg.TestKey key1 = com.google.gerrit.server.git.gpg.TestKey.key1 ( ) ; store.add ( key1.getPublicKeyRing ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , store.save ( newCommitBuilder ( ) ) ) ; com.google.gerrit.server.git.gpg.TestKey key2 = com.google.gerrit.server.git.gpg.TestKey.key2 ( ) ; store.remove ( key2.getPublicKey ( ) . getFingerprint ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NO_CHANGE , store.save ( newCommitBuilder ( ) ) ) ; assertKeys ( key1.getKeyId ( ) , key1 ) ; }

Target:
public void removeNonexisting ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key1 = com.google.gerrit.gpg.testutil.TestKey.key1 ( ) ; store.add ( key1.getPublicKeyRing ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , store.save ( newCommitBuilder ( ) ) ) ; com.google.gerrit.gpg.testutil.TestKey key2 = com.google.gerrit.gpg.testutil.TestKey.key2 ( ) ; store.remove ( key2.getPublicKey ( ) . getFingerprint ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NO_CHANGE , store.save ( newCommitBuilder ( ) ) ) ; assertKeys ( key1.getKeyId ( ) , key1 ) ; }
Source:
public boolean rebuildProject ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.common.collect.ImmutableMultimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.reviewdb.client.Change.Id > allChanges , com.google.gerrit.reviewdb.client.Project.NameKey project , org.eclipse.jgit.lib.Repository allUsersRepo ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( failNextUpdate.getAndSet ( false ) ) { throw new java.io.IOException ( "Update failed" ) ; } boolean result = delegate.rebuildProject ( db , allChanges , project , allUsersRepo ) ; if ( stealNextUpdate.getAndSet ( false ) ) { throw new java.io.IOException ( "Update stolen" ) ; } return result ; }

Target:
public void buildUpdates ( com.google.gerrit.server.notedb.NoteDbUpdateManager manager , com.google.gerrit.server.notedb.ChangeBundle bundle ) throws com.google.gwtorm.server.OrmException , java.io.IOException { delegate.buildUpdates ( manager , bundle ) ; }
Source:
public void testCreateProjectApiWithGitSuffix ( ) throws java.lang.Exception { final java.lang.String newProjectName = "newProject" ; com.google.gerrit.extensions.common.ProjectInfo p = gApi.projects ( ) . create ( ( newProjectName + ".git" ) ) . get ( ) ; com.google.common.truth.Truth.assertThat ( p.name ) . isEqualTo ( newProjectName ) ; com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( new com.google.gerrit.reviewdb.client.Project.NameKey ( newProjectName ) ) ; com.google.common.truth.Truth.assertThat ( projectState ) . isNotNull ( ) ; com.google.gerrit.acceptance.rest.project.ProjectAssert.assertProjectInfo ( projectState.getProject ( ) , p ) ; assertHead ( newProjectName , "refs/heads/master" ) ; }

Target:
public void testCreateProjectWithGitSuffix ( ) throws java.lang.Exception { final java.lang.String newProjectName = "newProject" ; com.google.gerrit.extensions.common.ProjectInfo p = gApi.projects ( ) . create ( ( newProjectName + ".git" ) ) . get ( ) ; com.google.common.truth.Truth.assertThat ( p.name ) . isEqualTo ( newProjectName ) ; com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( new com.google.gerrit.reviewdb.client.Project.NameKey ( newProjectName ) ) ; com.google.common.truth.Truth.assertThat ( projectState ) . isNotNull ( ) ; com.google.gerrit.acceptance.rest.project.ProjectAssert.assertProjectInfo ( projectState.getProject ( ) , p ) ; assertHead ( newProjectName , "refs/heads/master" ) ; }
Source:
public void testUpsertOneException ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { stubExecuteBatchException ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , new java.sql.BatchUpdateException ( ) ) ; try { createClassUnderTest ( ) . upsert ( com.google.gwtorm.jdbc.TestJdbcAccess.ONE_ROW ) ; org.junit.Assert.fail ( "missingException" ) ; } catch ( com.google.gwtorm.client.OrmException e ) { } }

Target:
public void testUpsertOneNotExisting ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT , 1 ) ; createClassUnderTest ( ) . upsert ( oneRow ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( update ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( insert ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertExpectedIdsUsed ( insert , 1 ) ; }
Source:
public void onFailure ( final java.lang.Throwable caught ) { super . onFailure ( caught ) ; c.setStarred ( prior ) ; setStar ( row , c ) ; }

Target:
public void onSignOut ( final com.google.gerrit.client.SignOutEvent event ) { final int max = table.getRowCount ( ) ; for ( int row = 0 ; row < max ; row ++ ) { if ( ( getRowItem ( row ) ) != null ) { table.clearCell ( row , com.google.gerrit.client.changes.ChangeTable.C_STAR ) ; } } regSignOut.removeHandler ( ) ; regSignOut = null ; }
Source:
protected void bccStarredBy ( ) { try { for ( com.google.gerrit.reviewdb.client.StarredChange w : args.db.get ( ) . starredChanges ( ) . byChange ( change.getId ( ) ) ) { super . add ( RecipientType.BCC , w.getAccountId ( ) ) ; } } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.ChangeEmail.log.warn ( "Cannot BCC users that starred updated change" , err ) ; } }

Target:
protected void bccStarredBy ( ) { try { for ( com.google.gerrit.reviewdb.client.Account.Id accountId : args.starredChangesUtil.byChange ( change.getId ( ) ) ) { super . add ( RecipientType.BCC , accountId ) ; } } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.ChangeEmail.log.warn ( "Cannot BCC users that starred updated change" , err ) ; } }
Source:
public void getProjectWithGitSuffix ( ) throws java.lang.Exception { java.lang.String name = project.get ( ) ; com.google.gerrit.acceptance.RestResponse r = adminSession.get ( ( ( "/projects/" + name ) + ".git" ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; com.google.gerrit.extensions.common.ProjectInfo p = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.ProjectInfo.class ) ; com.google.common.truth.Truth.assertThat ( p.name ) . isEqualTo ( name ) ; }

Target:
public void getProject ( ) throws java.lang.Exception { java.lang.String name = project.get ( ) ; com.google.gerrit.extensions.common.ProjectInfo p = gApi.projects ( ) . name ( name ) . get ( ) ; com.google.common.truth.Truth.assertThat ( p.name ) . isEqualTo ( name ) ; }
Source:
public void testCUSTOM_NullUser ( ) { setFrom ( "A ${user} B <my.server@email.address>" ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( null ) ; assertNotNull ( r ) ; assertEquals ( ident.getName ( ) , r.name ) ; assertEquals ( "my.server@email.address" , r.email ) ; org.easymock.EasyMock.verify ( accountCache ) ; }

Target:
public void testCUSTOM_NoFullNameUser ( ) { setFrom ( "A ${user} B <my.server@email.address>" ) ; final java.lang.String email = "a.u.thor@test.example.com" ; final com.google.gerrit.reviewdb.client.Account.Id user = user ( null , email ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( user ) ; org.junit.Assert.assertNotNull ( r ) ; org.junit.Assert.assertEquals ( "A Anonymous Coward B" , r.name ) ; org.junit.Assert.assertEquals ( "my.server@email.address" , r.email ) ; org.easymock.EasyMock.verify ( accountCache ) ; }
Source:
public void rangeOfFixReplacementIsMandatory ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.enabled ( ) ) . isTrue ( ) ; fixReplacementInfo.range = null ; exception.expect ( com.google.gerrit.extensions.restapi.BadRequestException.class ) ; exception.expectMessage ( java.lang.String.format ( ( "A range must be given for the " + "replacement of the robot comment on %s" ) , withFixRobotCommentInput.path ) ) ; addRobotComment ( changeId , withFixRobotCommentInput ) ; }

Target:
public void rangeOfFixReplacementIsMandatory ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.enabled ( ) ) . isTrue ( ) ; fixReplacementInfo.range = null ; exception.expect ( com.google.gerrit.extensions.restapi.BadRequestException.class ) ; exception.expectMessage ( java.lang.String.format ( "A range must be given for the replacement of the robot comment on %s" , withFixRobotCommentInput.path ) ) ; addRobotComment ( changeId , withFixRobotCommentInput ) ; }
Source:
void init ( com.google.gerrit.client.diff.PreferencesAction pa ) { prefsAction = pa ; prefsAction.setPartner ( preferences ) ; }

Target:
void init ( com.google.gerrit.client.diff.PreferencesAction pa , java.util.List < com.google.gerrit.client.ui.InlineHyperlink > links , java.util.List < com.google.gerrit.client.WebLinkInfo > webLinks ) { prefsAction = pa ; prefsAction.setPartner ( preferences ) ; for ( com.google.gerrit.client.ui.InlineHyperlink link : links ) { linkPanel.add ( link ) ; } for ( com.google.gerrit.client.WebLinkInfo webLink : webLinks ) { linkPanel.add ( webLink.toAnchor ( ) ) ; } }
Source:
public java.lang.Iterable < com.google.gerrit.extensions.common.WebLinkInfo > getPatchLinks ( java.lang.String project , java.lang.String revision , java.lang.String file ) { java.util.List < com.google.gerrit.extensions.common.WebLinkInfo > links = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.extensions.webui.FileWebLink webLink : fileLinks ) { links.add ( new com.google.gerrit.extensions.common.WebLinkInfo ( webLink.getLinkName ( ) , webLink.getImageUrl ( ) , webLink.getFileUrl ( project , revision , file ) ) ) ; } return links ; }

Target:
public java.lang.Iterable < com.google.gerrit.extensions.common.WebLinkInfo > getPatchLinks ( java.lang.String project , java.lang.String revision , java.lang.String file ) { java.util.List < com.google.gerrit.extensions.common.WebLinkInfo > links = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.extensions.webui.FileWebLink webLink : fileLinks ) { links.add ( new com.google.gerrit.extensions.common.WebLinkInfo ( webLink.getLinkName ( ) , webLink.getImageUrl ( ) , webLink.getFileUrl ( project , revision , file ) , webLink.getTarget ( ) ) ) ; } return links ; }
Source:
private boolean addSuggestion ( java.util.Map < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.extensions.common.AccountInfo > map , com.google.gerrit.reviewdb.client.Account.Id id ) { if ( ( ! ( map.containsKey ( id ) ) ) && ( accountControl.canSee ( id ) ) ) { map.put ( id , accountLoader.get ( id ) ) ; return true ; } return false ; }

Target:
private boolean addSuggestion ( java.util.Map < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.extensions.common.AccountInfo > map , com.google.gerrit.reviewdb.client.Account.Id id ) { com.google.gerrit.reviewdb.client.Account a = accountCache.get ( id ) . getAccount ( ) ; return addSuggestion ( map , a ) ; }
Source:
public boolean canDelete ( ) { if ( ( ! ( canWrite ( ) ) ) || ( GitRepositoryManager.REF_CONFIG.equals ( refName ) ) ) { return false ; } switch ( getCurrentUser ( ) . getAccessPath ( ) ) { case REST_API : return ( isOwner ( ) ) || ( canPushWithForce ( ) ) ; case GIT : return canPushWithForce ( ) ; default : return false ; } }

Target:
public boolean canDelete ( ) { if ( ( ! ( canWrite ( ) ) ) || ( GitRepositoryManager.REF_CONFIG.equals ( refName ) ) ) { return false ; } switch ( getCurrentUser ( ) . getAccessPath ( ) ) { case REST_API : case JSON_RPC : return ( isOwner ( ) ) || ( canPushWithForce ( ) ) ; case GIT : return canPushWithForce ( ) ; default : return false ; } }
Source:
public void missingKey ( ) throws java.lang.Exception { com.google.gerrit.server.git.gpg.TestKey key2 = com.google.gerrit.server.git.gpg.TestKey.key2 ( ) ; org.eclipse.jgit.transport.PushCertificate cert = newSignedCert ( validNonce ( ) , key2 ) ; assertProblems ( cert , ( "No public keys found for Key ID " + ( com.google.gerrit.server.git.gpg.PublicKeyStore.keyIdToString ( key2.getKeyId ( ) ) ) ) ) ; }

Target:
public void missingKey ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key2 = com.google.gerrit.gpg.testutil.TestKey.key2 ( ) ; org.eclipse.jgit.transport.PushCertificate cert = newSignedCert ( validNonce ( ) , key2 ) ; assertProblems ( cert , ( "No public keys found for Key ID " + ( com.google.gerrit.gpg.PublicKeyStore.keyIdToString ( key2.getKeyId ( ) ) ) ) ) ; }
Source:
public com.google.gitiles.GitilesView.Builder putAllParams ( java.util.Map < java.lang.String , java.lang.String [ ] > params ) { for ( java.util.Map.Entry < java.lang.String , java.lang.String [ ] > e : params.entrySet ( ) ) { for ( java.lang.String v : e.getValue ( ) ) { this . params.put ( e.getKey ( ) , v ) ; } } return this ; }

Target:
public com.google.gitiles.GitilesView.Builder putAllParams ( java.util.Map < java.lang.String , java.lang.String [ ] > params ) { for ( java.util.Map.Entry < java.lang.String , java.lang.String [ ] > e : params.entrySet ( ) ) { this . params.putAll ( e.getKey ( ) , java.util.Arrays.asList ( e.getValue ( ) ) ) ; } return this ; }
Source:
public void noHeadText ( ) throws java.lang.Exception { com.google.gitiles.FakeHttpServletRequest req = com.google.gitiles.FakeHttpServletRequest.newRequest ( ) ; req.setPathInfo ( "/test/+refs/HEAD" ) ; req.setQueryString ( "format=TEXT" ) ; com.google.gitiles.FakeHttpServletResponse res = new com.google.gitiles.FakeHttpServletResponse ( ) ; servlet.service ( req , res ) ; org.junit.Assert.assertEquals ( 200 , res.getStatus ( ) ) ; org.junit.Assert.assertEquals ( "" , res.getActualBodyString ( ) ) ; }

Target:
public void noHeadText ( ) throws java.lang.Exception { setUpSimpleRefs ( ) ; com.google.gitiles.FakeHttpServletRequest req = com.google.gitiles.FakeHttpServletRequest.newRequest ( ) ; req.setPathInfo ( "/test/+refs/HEAD" ) ; req.setQueryString ( "format=TEXT" ) ; com.google.gitiles.FakeHttpServletResponse res = new com.google.gitiles.FakeHttpServletResponse ( ) ; servlet.service ( req , res ) ; org.junit.Assert.assertEquals ( 200 , res.getStatus ( ) ) ; org.junit.Assert.assertEquals ( "" , res.getActualBodyString ( ) ) ; }
Source:
public boolean canDelete ( ) { if ( GitRepositoryManager.REF_CONFIG.equals ( refName ) ) { return false ; } switch ( getCurrentUser ( ) . getAccessPath ( ) ) { case WEB_UI : return ( isOwner ( ) ) || ( canPushWithForce ( ) ) ; case GIT : return canPushWithForce ( ) ; default : return false ; } }

Target:
public boolean canDelete ( ) { if ( ( ! ( canWrite ( ) ) ) || ( GitRepositoryManager.REF_CONFIG.equals ( refName ) ) ) { return false ; } switch ( getCurrentUser ( ) . getAccessPath ( ) ) { case WEB_UI : return ( isOwner ( ) ) || ( canPushWithForce ( ) ) ; case GIT : return canPushWithForce ( ) ; default : return false ; } }
Source:
public int compare ( com.google.gerrit.client.changes.ChangeInfo.RevisionInfo a , com.google.gerrit.client.changes.ChangeInfo.RevisionInfo b ) { int a_number = a._number ( ) ; int b_number = b._number ( ) ; if ( a_number == 0 ) { a_number = parent_edit_number ; } if ( b_number == 0 ) { b_number = parent_edit_number ; } return a_number - b_number ; }

Target:
public int compare ( com.google.gerrit.client.changes.ChangeInfo.RevisionInfo a , com.google.gerrit.client.changes.ChangeInfo.RevisionInfo b ) { return ( num ( a ) ) - ( num ( b ) ) ; }
Source:
public static java.lang.String changeRefName ( com.google.gerrit.reviewdb.client.Change.Id id ) { java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( RefNames.REFS_CHANGES ) ; int n = id.get ( ) ; int m = n % 100 ; if ( m < 10 ) { r.append ( '0' ) ; } r.append ( m ) ; r.append ( '/' ) ; r.append ( n ) ; r.append ( "/meta" ) ; return r.toString ( ) ; }

Target:
public static java.lang.String changeRefName ( com.google.gerrit.reviewdb.client.Change.Id id ) { java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( RefNames.REFS_CHANGES ) ; int n = id.get ( ) ; int m = n % 100 ; if ( m < 10 ) { r.append ( '0' ) ; } r.append ( m ) ; r.append ( '/' ) ; r.append ( n ) ; r.append ( RefNames.META_SUFFIX ) ; return r.toString ( ) ; }
Source:
public void revokedKeyDueToCompromise ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey k = add ( com.google.gerrit.gpg.testutil.TestKeys.revokedCompromisedKey ( ) ) ; add ( com.google.gerrit.gpg.testutil.TestKeys.validKeyWithoutExpiration ( ) ) ; save ( ) ; assertProblems ( k , ( "Key is revoked (key material has been compromised):" + " test6 compromised" ) ) ; org.bouncycastle.openpgp.PGPPublicKeyRing kr = removeRevokers ( k.getPublicKeyRing ( ) ) ; store.add ( kr ) ; save ( ) ; assertProblems ( kr.getPublicKey ( ) ) ; }

Target:
public void revokedKeyDueToCompromise ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey k = add ( com.google.gerrit.gpg.testutil.TestKeys.revokedCompromisedKey ( ) ) ; add ( com.google.gerrit.gpg.testutil.TestKeys.validKeyWithoutExpiration ( ) ) ; save ( ) ; assertProblems ( k , ( "Key is revoked (key material has been compromised):" + " test6 compromised" ) ) ; org.bouncycastle.openpgp.PGPPublicKeyRing kr = removeRevokers ( k.getPublicKeyRing ( ) ) ; store.add ( kr ) ; save ( ) ; assertNoProblems ( kr.getPublicKey ( ) ) ; }
Source:
private void parseDelete ( final org.eclipse.jgit.transport.ReceiveCommand cmd ) { com.google.gerrit.server.project.RefControl ctl = projectControl.controlForRef ( cmd.getRefName ( ) ) ; if ( ctl.canDelete ( ) ) { } else { com.google.gerrit.server.git.ReceiveCommits.reject ( cmd , "can not delete references" ) ; } }

Target:
private void parseDelete ( final org.eclipse.jgit.transport.ReceiveCommand cmd ) { com.google.gerrit.server.project.RefControl ctl = projectControl.controlForRef ( cmd.getRefName ( ) ) ; if ( ctl.canDelete ( ) ) { cmd.execute ( rp ) ; } else { com.google.gerrit.server.git.ReceiveCommits.reject ( cmd , "can not delete references" ) ; } }
Source:
protected void configure ( ) { final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.reviewdb.Project.NameKey , com.google.gerrit.server.project.ProjectState > > type = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.reviewdb.Project.NameKey , com.google.gerrit.server.project.ProjectState > > ( ) { } ; core ( type , com.google.gerrit.server.project.ProjectCacheImpl.CACHE_NAME ) ; bind ( com.google.gerrit.server.project.ProjectCacheImpl.class ) ; bind ( com.google.gerrit.server.project.ProjectCache.class ) . to ( com.google.gerrit.server.project.ProjectCacheImpl.class ) ; }

Target:
protected void configure ( ) { final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.reviewdb.Project.NameKey , com.google.gerrit.server.project.ProjectState > > type = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.reviewdb.Project.NameKey , com.google.gerrit.server.project.ProjectState > > ( ) { } ; core ( type , com.google.gerrit.server.project.ProjectCacheImpl.CACHE_NAME ) . populateWith ( com.google.gerrit.server.project.ProjectCacheImpl.Loader.class ) ; bind ( com.google.gerrit.server.project.ProjectCacheImpl.class ) ; bind ( com.google.gerrit.server.project.ProjectCache.class ) . to ( com.google.gerrit.server.project.ProjectCacheImpl.class ) ; }
Source:
void apply ( com.google.gerrit.server.notedb.ChangeUpdate update ) { checkUpdate ( update ) ; if ( ( ps.getPatchSetId ( ) ) == 1 ) { update.setSubject ( "Create change" ) ; } else { update.setSubject ( ( "Create patch set " + ( ps.getPatchSetId ( ) ) ) ) ; } }

Target:
void apply ( com.google.gerrit.server.notedb.ChangeUpdate update ) { checkUpdate ( update ) ; if ( ( ps.getPatchSetId ( ) ) == 1 ) { update.setSubject ( "Create change" ) ; update.setBranch ( change.getDest ( ) . get ( ) ) ; } else { update.setSubject ( ( "Create patch set " + ( ps.getPatchSetId ( ) ) ) ) ; } }
Source:
public void updateRepo ( com.google.gerrit.server.git.BatchUpdate.RepoContext ctx ) throws com.google.gerrit.server.project.InvalidChangeOperationException , java.io.IOException { validate ( ctx ) ; if ( ! ( updateRef ) ) { return ; } ctx.addRefUpdate ( new org.eclipse.jgit.transport.ReceiveCommand ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) , commit , patchSet.getRefName ( ) ) ) ; }

Target:
public void updateRepo ( com.google.gerrit.server.git.BatchUpdate.RepoContext ctx ) throws com.google.gerrit.server.project.InvalidChangeOperationException , java.io.IOException { validate ( ctx ) ; patchSetInfo = patchSetInfoFactory.get ( ctx.getRevWalk ( ) , commit , patchSet.getId ( ) ) ; change.setCurrentPatchSet ( patchSetInfo ) ; if ( ! ( updateRef ) ) { return ; } ctx.addRefUpdate ( new org.eclipse.jgit.transport.ReceiveCommand ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) , commit , patchSet.getRefName ( ) ) ) ; }
Source:
private Account.Id parseIdent ( org.eclipse.jgit.lib.PersonIdent ident ) throws org.eclipse.jgit.errors.ConfigInvalidException { java.lang.String email = ident.getEmailAddress ( ) ; int at = email.indexOf ( '@' ) ; if ( at >= 0 ) { java.lang.String host = email.substring ( ( at + 1 ) , email.length ( ) ) ; java.lang.Integer id = com.google.common.primitives.Ints.tryParse ( email.substring ( 0 , at ) ) ; if ( ( id != null ) && ( host.equals ( com.google.gerrit.server.notedb.ChangeNoteUtil.GERRIT_PLACEHOLDER_HOST ) ) ) { return new com.google.gerrit.reviewdb.client.Account.Id ( id ) ; } } throw parseException ( "invalid identity, expected <id>@%s: %s" , com.google.gerrit.server.notedb.ChangeNoteUtil.GERRIT_PLACEHOLDER_HOST , email ) ; }

Target:
private Account.Id parseIdent ( org.eclipse.jgit.lib.PersonIdent ident ) throws org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.reviewdb.client.Account.Id id = com.google.gerrit.server.notedb.ChangeNoteUtil.parseIdent ( ident ) ; if ( id == null ) { throw parseException ( "invalid identity, expected <id>@%s: %s" , com.google.gerrit.server.notedb.ChangeNoteUtil.GERRIT_PLACEHOLDER_HOST , ident.getEmailAddress ( ) ) ; } return id ; }
Source:
public void testMultiple ( ) { com.google.common.truth.Truth.assertThat ( cfg.getString ( "x" , null , "y" ) ) . isEqualTo ( "z" ) ; com.google.common.truth.Truth.assertThat ( cfg.getString ( "a" , null , "b" ) ) . isEqualTo ( "c" ) ; }

Target:
public void testMultiple ( ) { com.google.common.truth.Truth.assertThat ( cfg.getString ( "section" , null , "name" ) ) . isEqualTo ( "value" ) ; com.google.common.truth.Truth.assertThat ( cfg.getString ( "section1" , null , "name" ) ) . isEqualTo ( "value1" ) ; com.google.common.truth.Truth.assertThat ( cfg.getString ( "section" , "subsection" , "name" ) ) . isEqualTo ( "value" ) ; com.google.common.truth.Truth.assertThat ( cfg.getString ( "section" , "subsection1" , "name" ) ) . isEqualTo ( "value1" ) ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; com.google.gerrit.client.changes.ChangeApi.detail ( changeId.get ( ) , java.util.EnumSet.of ( ListChangesOption.ALL_REVISIONS , ListChangesOption.CURRENT_ACTIONS ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.changes.ChangeInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo info ) { info.init ( ) ; loadConfigInfo ( info ) ; } } ) ; }

Target:
void loadChangeInfo ( boolean fg , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > cb ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeApi.detail ( changeId.get ( ) ) ; com.google.gerrit.client.changes.ChangeList.addOptions ( call , java.util.EnumSet.of ( ListChangesOption.ALL_REVISIONS , ListChangesOption.CURRENT_ACTIONS ) ) ; if ( ! fg ) { call.background ( ) ; } call.get ( cb ) ; }
Source:
private com.google.gerrit.httpd.rpc.patch.PatchScriptBuilder newBuilder ( final com.google.gerrit.server.patch.PatchList list , org.eclipse.jgit.lib.Repository git ) { final com.google.gerrit.reviewdb.AccountDiffPreference dp = new com.google.gerrit.reviewdb.AccountDiffPreference ( diffPrefs ) ; final com.google.gerrit.httpd.rpc.patch.PatchScriptBuilder b = builderFactory.get ( ) ; b.setRepository ( git ) ; b.setChange ( change ) ; b.setDiffPrefs ( dp ) ; b.setTrees ( list.isAgainstParent ( ) , list.getOldId ( ) , list.getNewId ( ) ) ; return b ; }

Target:
private com.google.gerrit.httpd.rpc.patch.PatchScriptBuilder newBuilder ( final com.google.gerrit.server.patch.PatchList list , org.eclipse.jgit.lib.Repository git ) { final com.google.gerrit.reviewdb.AccountDiffPreference dp = new com.google.gerrit.reviewdb.AccountDiffPreference ( diffPrefs ) ; final com.google.gerrit.httpd.rpc.patch.PatchScriptBuilder b = builderFactory.get ( ) ; b.setRepository ( git , projectKey ) ; b.setChange ( change ) ; b.setDiffPrefs ( dp ) ; b.setTrees ( list.isAgainstParent ( ) , list.getOldId ( ) , list.getNewId ( ) ) ; return b ; }
Source:
public com.google.common.base.Optional < org.eclipse.jgit.lib.ObjectId > get ( java.lang.String refName ) throws java.io.IOException { org.eclipse.jgit.transport.ReceiveCommand cmd = commands.get ( refName ) ; if ( cmd != null ) { return ! ( cmd.getNewId ( ) . equals ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) ) ) ? com.google.common.base.Optional.of ( cmd.getNewId ( ) ) : com.google.common.base.Optional.< org.eclipse.jgit.lib.ObjectId > absent ( ) ; } return refCache.get ( refName ) ; }

Target:
public java.util.Optional < org.eclipse.jgit.lib.ObjectId > get ( java.lang.String refName ) throws java.io.IOException { org.eclipse.jgit.transport.ReceiveCommand cmd = commands.get ( refName ) ; if ( cmd != null ) { return ! ( cmd.getNewId ( ) . equals ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) ) ) ? java.util.Optional.of ( cmd.getNewId ( ) ) : java.util.Optional.empty ( ) ; } return refCache.get ( refName ) ; }
Source:
public void testInheritRead_AppendWithDenyOfRef ( ) { grant ( parent , com.google.gerrit.reviewdb.ApprovalCategory.READ , registered , "refs/*" , 1 ) ; grant ( local , com.google.gerrit.reviewdb.ApprovalCategory.READ , registered , "refs/heads/*" , 0 ) ; com.google.gerrit.server.project.ProjectControl u = user ( ) ; assertTrue ( "can read" , u.isVisible ( ) ) ; assertTrue ( "can read" , u.controlForRef ( "refs/master" ) . isVisible ( ) ) ; assertTrue ( "can read" , u.controlForRef ( "refs/tags/foobar" ) . isVisible ( ) ) ; assertTrue ( "no master" , u.controlForRef ( "refs/heads/master" ) . isVisible ( ) ) ; }

Target:
public void testInheritRead_OverrideWithDeny ( ) { grant ( parent , com.google.gerrit.common.data.Permission.READ , registered , "refs/*" ) ; grant ( local , com.google.gerrit.common.data.Permission.READ , registered , "refs/*" ) . setDeny ( true ) ; com.google.gerrit.server.project.ProjectControl u = user ( ) ; assertFalse ( "can't read" , u.isVisible ( ) ) ; }
Source:
protected void initColumnHeaders ( ) { table.setText ( 0 , 1 , Util.C.dashboardName ( ) ) ; table.setText ( 0 , 2 , Util.C.dashboardDescription ( ) ) ; final com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter fmt = table.getFlexCellFormatter ( ) ; fmt.addStyleName ( 0 , 1 , Gerrit.RESOURCES.css ( ) . dataHeader ( ) ) ; fmt.addStyleName ( 0 , 2 , Gerrit.RESOURCES.css ( ) . dataHeader ( ) ) ; }

Target:
protected void initColumnHeaders ( ) { final com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter fmt = table.getFlexCellFormatter ( ) ; fmt.setColSpan ( 0 , 0 , 2 ) ; fmt.addStyleName ( 0 , 1 , Gerrit.RESOURCES.css ( ) . dataHeader ( ) ) ; fmt.addStyleName ( 0 , 2 , Gerrit.RESOURCES.css ( ) . dataHeader ( ) ) ; table.setText ( 0 , 1 , Util.C.dashboardName ( ) ) ; table.setText ( 0 , 2 , Util.C.dashboardDescription ( ) ) ; }
Source:
protected java.util.Optional < com.googlesource.gerrit.plugins.lfs.fs.LfsFsRequestAuthorizer.LfsFsAuthToken > createToken ( java.util.List < java.lang.String > values ) { if ( ( values.size ( ) ) != 3 ) { return java.util.Optional.empty ( ) ; } return java.util.Optional.of ( new com.googlesource.gerrit.plugins.lfs.fs.LfsFsRequestAuthorizer.LfsFsAuthToken ( values.get ( 0 ) , org.eclipse.jgit.lfs.lib.LongObjectId.fromString ( values.get ( 1 ) ) , values.get ( 2 ) ) ) ; }

Target:
protected java.util.Optional < com.googlesource.gerrit.plugins.lfs.fs.LfsFsRequestAuthorizer.LfsFsAuthToken > createToken ( java.util.List < java.lang.String > values ) { if ( ( values.size ( ) ) != 4 ) { return java.util.Optional.empty ( ) ; } return java.util.Optional.of ( new com.googlesource.gerrit.plugins.lfs.fs.LfsFsRequestAuthorizer.LfsFsAuthToken ( values.get ( 0 ) , org.eclipse.jgit.lfs.lib.LongObjectId.fromString ( values.get ( 1 ) ) , values.get ( 2 ) , java.lang.Long.valueOf ( values.get ( 3 ) ) ) ) ; }
Source:
public com.google.gerrit.extensions.api.changes.ReviewerApi reviewer ( java.lang.String id ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return reviewerApi.create ( reviewers.parse ( change , com.google.gerrit.extensions.restapi.IdString.fromDecoded ( id ) ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot parse reviewer" , e ) ; } }

Target:
public com.google.gerrit.extensions.api.changes.ReviewerApi reviewer ( java.lang.String id ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return reviewerApi.create ( reviewers.parse ( change , com.google.gerrit.extensions.restapi.IdString.fromDecoded ( id ) ) ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot parse reviewer" , e ) ; } }
Source:
private void onCallback ( final com.google.gerrit.client.reviewdb.Account result ) { if ( result != null ) { com.google.gerrit.client.Gerrit.postSignIn ( result ) ; hide ( ) ; final com.google.gwt.user.client.rpc.AsyncCallback < ? > ac = appCallback ; if ( ac != null ) { com.google.gwt.user.client.DeferredCommand.addCommand ( new com.google.gwt.user.client.Command ( ) { public void execute ( ) { ac.onSuccess ( null ) ; } } ) ; } } else { hide ( ) ; } }

Target:
private void onSuccess ( final com.google.gerrit.client.account.SignInResult result ) { com.google.gerrit.client.Gerrit.postSignIn ( result.getAccount ( ) ) ; hide ( ) ; final com.google.gwt.user.client.rpc.AsyncCallback < ? > ac = appCallback ; if ( ac != null ) { com.google.gwt.user.client.DeferredCommand.addCommand ( new com.google.gwt.user.client.Command ( ) { public void execute ( ) { ac.onSuccess ( null ) ; } } ) ; } }
Source:
public com.google.gerrit.common.data.GroupReference resolve ( com.google.gerrit.common.data.GroupReference group ) { return groupList.resolve ( group ) ; }

Target:
public com.google.gerrit.common.data.GroupReference resolve ( com.google.gerrit.common.data.GroupReference group ) { com.google.gerrit.common.data.GroupReference groupRef = groupList.resolve ( group ) ; if ( ( ( groupRef != null ) && ( ( groupRef.getUUID ( ) ) != null ) ) && ( ! ( groupsByName.containsKey ( groupRef.getName ( ) ) ) ) ) { groupsByName.put ( groupRef.getName ( ) , groupRef ) ; } return groupRef ; }
Source:
private PushOneCommit.Result push ( java.lang.String ref , java.lang.String subject , java.lang.String fileName , java.lang.String content ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , git , subject , fileName , content ) ; return push.to ( ref ) ; }

Target:
private PushOneCommit.Result push ( java.lang.String ref , java.lang.String subject , java.lang.String fileName , java.lang.String content ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , testRepo , subject , fileName , content ) ; return push.to ( ref ) ; }
Source:
public void testCreate ( ) throws java.io.FileNotFoundException { final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( new java.io.File ( "." ) ) ; final com.google.gerrit.pgm.util.ConsoleUI ui = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.pgm.util.ConsoleUI.class ) ; org.easymock.EasyMock.replay ( ui ) ; com.google.gerrit.pgm.init.Libraries lib = new com.google.gerrit.pgm.init.Libraries ( new com.google.inject.Provider < com.google.gerrit.pgm.init.LibraryDownloader > ( ) { @ java.lang.Override public com.google.gerrit.pgm.init.LibraryDownloader get ( ) { return new com.google.gerrit.pgm.init.LibraryDownloader ( ui , site ) ; } } ) ; assertNotNull ( lib.bouncyCastle ) ; assertNotNull ( lib.mysqlDriver ) ; org.easymock.EasyMock.verify ( ui ) ; }

Target:
public void testCreate ( ) throws java.io.FileNotFoundException { final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( new java.io.File ( "." ) ) ; final com.google.gerrit.pgm.util.ConsoleUI ui = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.pgm.util.ConsoleUI.class ) ; org.easymock.EasyMock.replay ( ui ) ; com.google.gerrit.pgm.init.Libraries lib = new com.google.gerrit.pgm.init.Libraries ( new com.google.inject.Provider < com.google.gerrit.pgm.init.LibraryDownloader > ( ) { @ java.lang.Override public com.google.gerrit.pgm.init.LibraryDownloader get ( ) { return new com.google.gerrit.pgm.init.LibraryDownloader ( ui , site ) ; } } ) ; assertNotNull ( lib.bouncyCastleProvider ) ; assertNotNull ( lib.mysqlDriver ) ; org.easymock.EasyMock.verify ( ui ) ; }
Source:
public java.lang.String [ ] getPluginStringList ( java.lang.String name , java.lang.String [ ] defaultValue ) { java.util.List < java.lang.String > values = getAll ( ) . get ( name ) ; if ( ( values == null ) || ( values.isEmpty ( ) ) ) { return defaultValue ; } else { return values.toArray ( new java.lang.String [ values.size ( ) ] ) ; } }

Target:
public java.lang.String getString ( java.lang.String name ) { return cfg.getString ( com.google.gerrit.server.config.PluginConfig.PLUGIN , pluginName , name ) ; }
Source:
private static java.lang.String parseStringField ( byte [ ] note , org.eclipse.jgit.util.MutableInteger curr , com.google.gerrit.reviewdb.client.Change.Id changeId , java.nio.charset.Charset enc , java.lang.String fieldName ) throws org.eclipse.jgit.errors.ConfigInvalidException { int endOfLine = org.eclipse.jgit.util.RawParseUtils.nextLF ( note , curr.value ) ; com.google.gerrit.server.notedb.CommentsInNotesUtil.checkHeaderLineFormat ( note , curr , fieldName , enc , changeId ) ; int startOfField = ( org.eclipse.jgit.util.RawParseUtils.endOfFooterLineKey ( note , curr.value ) ) + 2 ; curr.value = endOfLine ; return org.eclipse.jgit.util.RawParseUtils.decode ( enc , note , startOfField , ( endOfLine - 1 ) ) ; }

Target:
private static java.lang.String parseStringField ( byte [ ] note , org.eclipse.jgit.util.MutableInteger curr , com.google.gerrit.reviewdb.client.Change.Id changeId , java.lang.String fieldName ) throws org.eclipse.jgit.errors.ConfigInvalidException { int endOfLine = org.eclipse.jgit.util.RawParseUtils.nextLF ( note , curr.value ) ; com.google.gerrit.server.notedb.CommentsInNotesUtil.checkHeaderLineFormat ( note , curr , fieldName , changeId ) ; int startOfField = ( org.eclipse.jgit.util.RawParseUtils.endOfFooterLineKey ( note , curr.value ) ) + 2 ; curr.value = endOfLine ; return org.eclipse.jgit.util.RawParseUtils.decode ( java.nio.charset.StandardCharsets.UTF_8 , note , startOfField , ( endOfLine - 1 ) ) ; }
Source:
void set ( com.google.gerrit.client.changes.ChangeInfo info , java.lang.String revision ) { canEdit = ( info.hasActions ( ) ) && ( info.actions ( ) . containsKey ( "topic" ) ) ; psId = new com.google.gerrit.reviewdb.client.PatchSet.Id ( info.legacyId ( ) , info.revisions ( ) . get ( revision ) . _number ( ) ) ; initTopicLink ( info ) ; editIcon.setVisible ( canEdit ) ; if ( ! ( canEdit ) ) { show.setTitle ( null ) ; } }

Target:
void set ( com.google.gerrit.client.info.ChangeInfo info , java.lang.String revision ) { canEdit = ( info.hasActions ( ) ) && ( info.actions ( ) . containsKey ( "topic" ) ) ; psId = new com.google.gerrit.reviewdb.client.PatchSet.Id ( info.legacyId ( ) , info.revisions ( ) . get ( revision ) . _number ( ) ) ; initTopicLink ( info ) ; editIcon.setVisible ( canEdit ) ; if ( ! ( canEdit ) ) { show.setTitle ( null ) ; } }
Source:
private org.apache.lucene.search.Query fullTextQuery ( com.google.gerrit.server.index.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > p ) { return queryBuilder.createPhraseQuery ( p.getField ( ) . getName ( ) , p.getValue ( ) ) ; }

Target:
private org.apache.lucene.search.Query fullTextQuery ( com.google.gerrit.server.index.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > p ) throws com.google.gerrit.server.query.QueryParseException { java.lang.String value = p.getValue ( ) ; if ( value == null ) { throw new com.google.gerrit.server.query.QueryParseException ( "Full-text search over empty string not supported" ) ; } return queryBuilder.createPhraseQuery ( p.getField ( ) . getName ( ) , value ) ; }
Source:
public com.google.gerrit.reviewdb.client.Change abandon ( com.google.gerrit.server.project.ChangeControl control , final java.lang.String msgTxt , final com.google.gerrit.reviewdb.client.Account account ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException { com.google.gerrit.server.change.Abandon.Op op = new com.google.gerrit.server.change.Abandon.Op ( msgTxt , account ) ; com.google.gerrit.reviewdb.client.Change c = control.getChange ( ) ; try ( com.google.gerrit.server.git.BatchUpdate u = batchUpdateFactory.create ( dbProvider.get ( ) , c.getProject ( ) , control.getCurrentUser ( ) , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ) { u.addOp ( c.getId ( ) , op ) . execute ( ) ; } return op.change ; }

Target:
public com.google.gerrit.reviewdb.client.Change abandon ( com.google.gerrit.server.project.ChangeControl control , final java.lang.String msgTxt , final com.google.gerrit.reviewdb.client.Account account ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException { com.google.gerrit.server.change.Abandon.Op op = new com.google.gerrit.server.change.Abandon.Op ( msgTxt , account ) ; com.google.gerrit.reviewdb.client.Change c = control.getChange ( ) ; try ( com.google.gerrit.server.git.BatchUpdate u = batchUpdateFactory.create ( dbProvider.get ( ) , c.getProject ( ) , control.getUser ( ) , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ) { u.addOp ( c.getId ( ) , op ) . execute ( ) ; } return op.change ; }
Source:
public void onKeyPress ( com.google.gwt.event.dom.client.KeyPressEvent event ) { link.go ( ) ; }

Target:
public void onSuccess ( com.google.gerrit.common.data.PatchSetDetail result ) { patchSetDetail = result ; if ( ( fileList ) == null ) { fileList = new com.google.gerrit.client.changes.PatchTable ( ) ; fileList.display ( result ) ; patchIndex = fileList.indexOf ( patchKey ) ; topNav.display ( patchIndex , getPatchScreenType ( ) , fileList ) ; bottomNav.display ( patchIndex , getPatchScreenType ( ) , fileList ) ; } refresh ( true ) ; }
Source:
private int distance ( java.lang.String pattern ) { java.lang.String example ; if ( com.google.gerrit.server.project.RefControl.isRE ( pattern ) ) { example = com.google.gerrit.server.project.RefControl.shortestExample ( pattern ) ; } else if ( pattern.endsWith ( "/*" ) ) { example = pattern ; } else if ( pattern.equals ( refName ) ) { return 0 ; } else { return java.lang.Math.max ( pattern.length ( ) , refName.length ( ) ) ; } return org.apache.commons.lang.StringUtils.getLevenshteinDistance ( example , refName ) ; }

Target:
private int distance ( java.lang.String pattern ) { java.lang.String example ; if ( com.google.gerrit.server.project.RefPattern.isRE ( pattern ) ) { example = com.google.gerrit.server.project.RefPattern.shortestExample ( pattern ) ; } else if ( pattern.endsWith ( "/*" ) ) { example = pattern ; } else if ( pattern.equals ( refName ) ) { return 0 ; } else { return java.lang.Math.max ( pattern.length ( ) , refName.length ( ) ) ; } return org.apache.commons.lang.StringUtils.getLevenshteinDistance ( example , refName ) ; }
Source:
private boolean isLive ( final java.io.File entry ) { final java.lang.String name = entry.getName ( ) ; return ( ( ( ( ErrorLogFile.LOG_NAME.equals ( name ) ) || ( "sshd_log" . equals ( name ) ) ) || ( "httpd_log" . equals ( name ) ) ) || ( "gerrit.run" . equals ( name ) ) ) || ( name.endsWith ( ".pid" ) ) ; }

Target:
private boolean isLive ( final java.io.File entry ) { final java.lang.String name = entry.getName ( ) ; return ( ( ( ( ( ErrorLogFile.LOG_NAME.equals ( name ) ) || ( GarbageCollection.LOG_NAME.equals ( name ) ) ) || ( "sshd_log" . equals ( name ) ) ) || ( "httpd_log" . equals ( name ) ) ) || ( "gerrit.run" . equals ( name ) ) ) || ( name.endsWith ( ".pid" ) ) ; }
Source:
private void getAllFiles ( java.io.File dir , java.lang.String extension , java.util.List < java.io.File > fileList ) { for ( java.io.File f : dir.listFiles ( ) ) { if ( f.getName ( ) . endsWith ( extension ) ) { fileList.add ( f ) ; } if ( f.isDirectory ( ) ) { getAllFiles ( f , extension , fileList ) ; } } }

Target:
private void getAllFiles ( java.io.File dir , java.lang.String extension , java.util.List < java.io.File > fileList ) throws java.io.IOException { for ( java.io.File f : com.google.gerrit.pgm.rules.PrologCompiler.listFiles ( dir ) ) { if ( f.getName ( ) . endsWith ( extension ) ) { fileList.add ( f ) ; } if ( f.isDirectory ( ) ) { getAllFiles ( f , extension , fileList ) ; } } }
Source:
com.ericsson.gerrit.plugins.eventslog.sql.SQLClient provideSqlClient ( com.ericsson.gerrit.plugins.eventslog.EventsLogConfig cfg ) { com.ericsson.gerrit.plugins.eventslog.sql.SQLClient sqlClient = new com.ericsson.gerrit.plugins.eventslog.sql.SQLClient ( cfg.getStoreDriver ( ) , cfg.getStoreUrl ( ) , cfg.getUrlOptions ( ) ) ; sqlClient.setUsername ( cfg.getStoreUsername ( ) ) ; sqlClient.setPassword ( cfg.getStorePassword ( ) ) ; return sqlClient ; }

Target:
com.ericsson.gerrit.plugins.eventslog.sql.SQLClient provideSqlClient ( com.ericsson.gerrit.plugins.eventslog.EventsLogConfig cfg ) { com.ericsson.gerrit.plugins.eventslog.sql.SQLClient sqlClient = new com.ericsson.gerrit.plugins.eventslog.sql.SQLClient ( cfg.getStoreDriver ( ) , cfg.getStoreUrl ( ) , cfg.getUrlOptions ( ) ) ; sqlClient.setUsername ( cfg.getStoreUsername ( ) ) ; sqlClient.setPassword ( cfg.getStorePassword ( ) ) ; sqlClient.setEvictIdleTime ( cfg.getEvictIdleTime ( ) ) ; return sqlClient ; }
Source:
private boolean deleteKey ( int seq ) { checkLoaded ( ) ; if ( ( seq <= ( keys.size ( ) ) ) && ( keys.get ( ( seq - 1 ) ) . isPresent ( ) ) ) { keys.set ( ( seq - 1 ) , com.google.common.base.Optional.< com.google.gerrit.reviewdb.client.AccountSshKey > absent ( ) ) ; return true ; } return false ; }

Target:
private boolean deleteKey ( int seq ) { checkLoaded ( ) ; if ( ( seq <= ( keys.size ( ) ) ) && ( keys.get ( ( seq - 1 ) ) . isPresent ( ) ) ) { keys.set ( ( seq - 1 ) , java.util.Optional.empty ( ) ) ; return true ; } return false ; }
Source:
protected void configure ( ) { factory ( RegisterNewEmailSender.Factory.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.server.ssh.Sshd.class ) . toProvider ( sshInjector.getProvider ( com.google.gerrit.server.ssh.Sshd.class ) ) ; bind ( com.google.gerrit.client.data.GerritConfig.class ) . toProvider ( com.google.gerrit.server.config.GerritConfigProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; install ( com.google.gerrit.server.GerritServletConfig.createServletModule ( ) ) ; install ( new com.google.gerrit.server.rpc.UiRpcModule ( ) ) ; factory ( RegisterNewEmailSender.Factory.class ) ; }
Source:
java.lang.Iterable < com.google.gerrit.server.query.change.ChangeData > byCommitsOnBranchNotMerged ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Branch.NameKey branch , java.util.List < java.lang.String > hashes , int indexLimit ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( ( hashes.size ( ) ) > indexLimit ) { return byCommitsOnBranchNotMergedFromDatabase ( repo , db , branch , hashes ) ; } return byCommitsOnBranchNotMergedFromIndex ( branch , hashes ) ; }

Target:
java.lang.Iterable < com.google.gerrit.server.query.change.ChangeData > byCommitsOnBranchNotMerged ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Branch.NameKey branch , java.util.Collection < java.lang.String > hashes , int indexLimit ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( ( hashes.size ( ) ) > indexLimit ) { return byCommitsOnBranchNotMergedFromDatabase ( repo , db , branch , hashes ) ; } return byCommitsOnBranchNotMergedFromIndex ( branch , hashes ) ; }
Source:
private void enable ( boolean enabled ) { commitMessage.setEnabled ( enabled ) ; commit.setEnabled ( enabled ) ; cancel1.setEnabled ( enabled ) ; cancel2.setEnabled ( enabled ) ; }

Target:
private void enable ( boolean enabled ) { commitMessage.setEnabled ( enabled ) ; commit.setEnabled ( ( enabled ? ! ( access.getOwnerOf ( ) . isEmpty ( ) ) : false ) ) ; review.setEnabled ( ( enabled ? access.canUpload ( ) : false ) ) ; cancel1.setEnabled ( enabled ) ; cancel2.setEnabled ( enabled ) ; }
Source:
public boolean isOwner ( ) { com.google.gerrit.reviewdb.client.AccountGroup accountGroup = com.google.gerrit.common.data.GroupDescriptions.toAccountGroup ( group ) ; if ( accountGroup == null ) { isOwner = false ; } else if ( ( isOwner ) == null ) { com.google.gerrit.reviewdb.client.AccountGroup.UUID ownerUUID = accountGroup.getOwnerGroupUUID ( ) ; isOwner = ( getCurrentUser ( ) . getEffectiveGroups ( ) . contains ( ownerUUID ) ) || ( getCurrentUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ; } return isOwner ; }

Target:
public boolean isOwner ( ) { com.google.gerrit.reviewdb.client.AccountGroup accountGroup = com.google.gerrit.common.data.GroupDescriptions.toAccountGroup ( group ) ; if ( accountGroup == null ) { isOwner = false ; } else if ( ( isOwner ) == null ) { com.google.gerrit.reviewdb.client.AccountGroup.UUID ownerUUID = accountGroup.getOwnerGroupUUID ( ) ; isOwner = ( getUser ( ) . getEffectiveGroups ( ) . contains ( ownerUUID ) ) || ( getUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ; } return isOwner ; }