auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void configureServlets ( ) { install ( new com.google.gerrit.server.config.FactoryModule ( ) { @ java.lang.Override protected void configure ( ) { factory ( ChangeProjectAccess.Factory.class ) ; factory ( ReviewProjectAccess.Factory.class ) ; factory ( ProjectAccessFactory.Factory.class ) ; } } ) ; rpc ( com.google.gerrit.httpd.rpc.project.ProjectAdminServiceImpl.class ) ; }

Target:
protected void configureServlets ( ) { install ( new com.google.gerrit.extensions.config.FactoryModule ( ) { @ java.lang.Override protected void configure ( ) { factory ( ChangeProjectAccess.Factory.class ) ; factory ( ReviewProjectAccess.Factory.class ) ; factory ( ProjectAccessFactory.Factory.class ) ; } } ) ; rpc ( com.google.gerrit.httpd.rpc.project.ProjectAdminServiceImpl.class ) ; }
Source:
private java.util.List < com.google.gerrit.acceptance.server.change.ChangeAndCommit > getRelated ( com.google.gerrit.reviewdb.client.PatchSet.Id ps ) throws java.io.IOException { java.lang.String url = java.lang.String.format ( "/changes/%d/revisions/%d/related" , ps.getParentKey ( ) . get ( ) , ps.get ( ) ) ; com.google.gerrit.acceptance.server.change.RelatedInfo related = OutputFormat.JSON_COMPACT.newGson ( ) . fromJson ( session.get ( url ) . getReader ( ) , new com.google.gson.reflect.TypeToken < com.google.gerrit.acceptance.server.change.RelatedInfo > ( ) { } . getType ( ) ) ; return related.changes ; }

Target:
private java.util.List < com.google.gerrit.server.change.GetRelated.ChangeAndCommit > getRelated ( com.google.gerrit.reviewdb.client.PatchSet.Id ps ) throws java.io.IOException { java.lang.String url = java.lang.String.format ( "/changes/%d/revisions/%d/related" , ps.getParentKey ( ) . get ( ) , ps.get ( ) ) ; return newGson ( ) . fromJson ( session.get ( url ) . getReader ( ) , com.google.gerrit.server.change.GetRelated.RelatedInfo.class ) . changes ; }
Source:
protected void configure ( ) { bind ( com.google.inject.Key.get ( javax.sql.DataSource.class , com.google.inject.name.Names.named ( "ReviewDb" ) ) ) . toProvider ( com.google.gerrit.pgm.util.DataSourceProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; listener ( ) . to ( com.google.gerrit.pgm.util.DataSourceProvider.class ) ; }

Target:
protected void configure ( ) { bind ( DataSourceProvider.Context.class ) . toInstance ( context ) ; bind ( com.google.inject.Key.get ( javax.sql.DataSource.class , com.google.inject.name.Names.named ( "ReviewDb" ) ) ) . toProvider ( com.google.gerrit.pgm.util.DataSourceProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; listener ( ) . to ( com.google.gerrit.pgm.util.DataSourceProvider.class ) ; }
Source:
public void setAssigneeOnReviewableChangeByAdminCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; assign ( sc , admin , sc.assignee , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . notTo ( sc.owner , sc.reviewer , sc.ccer , sc.starrer ) . cc ( admin ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . to ( sc.assignee ) ; }

Target:
public void setAssigneeOnReviewableChangeByAdminCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; assign ( sc , admin , sc.assignee , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . cc ( admin ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . to ( sc.assignee ) . noOneElse ( ) ; }
Source:
public com.google.gerrit.reviewdb.client.AccountSshKey addKey ( java.lang.String pub ) { com.google.common.base.Preconditions.checkState ( ( ( keys ) != null ) , "SSH keys not loaded yet" ) ; int seq = ( keys.isEmpty ( ) ) ? 1 : ( keys.lastKey ( ) ) + 1 ; com.google.gerrit.reviewdb.client.AccountSshKey key = new com.google.gerrit.reviewdb.client.AccountSshKey ( new com.google.gerrit.reviewdb.client.AccountSshKey.Id ( accountId , seq ) , pub ) ; keys.put ( seq , com.google.common.base.Optional.of ( key ) ) ; return key ; }

Target:
protected boolean onSave ( org.eclipse.jgit.lib.CommitBuilder commit ) throws java.io.IOException { if ( com.google.common.base.Strings.isNullOrEmpty ( commit.getMessage ( ) ) ) { commit.setMessage ( "Updated SSH keys\n" ) ; } saveUTF8 ( AuthorizedKeys.FILE_NAME , com.google.gerrit.server.account.AuthorizedKeys.serialize ( keys ) ) ; return true ; }
Source:
protected void configure ( ) { final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < java.lang.String , java.lang.Iterable < com.google.gerrit.sshd.SshKeyCacheEntry > > > type = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < java.lang.String , java.lang.Iterable < com.google.gerrit.sshd.SshKeyCacheEntry > > > ( ) { } ; core ( type , com.google.gerrit.sshd.SshKeyCacheImpl.CACHE_NAME ) ; bind ( com.google.gerrit.sshd.SshKeyCacheImpl.class ) ; bind ( com.google.gerrit.server.ssh.SshKeyCache.class ) . to ( com.google.gerrit.sshd.SshKeyCacheImpl.class ) ; }

Target:
protected void configure ( ) { final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < java.lang.String , java.lang.Iterable < com.google.gerrit.sshd.SshKeyCacheEntry > > > type = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < java.lang.String , java.lang.Iterable < com.google.gerrit.sshd.SshKeyCacheEntry > > > ( ) { } ; core ( type , com.google.gerrit.sshd.SshKeyCacheImpl.CACHE_NAME ) . populateWith ( com.google.gerrit.sshd.SshKeyCacheImpl.Loader.class ) ; bind ( com.google.gerrit.sshd.SshKeyCacheImpl.class ) ; bind ( com.google.gerrit.server.ssh.SshKeyCache.class ) . to ( com.google.gerrit.sshd.SshKeyCacheImpl.class ) ; }
Source:
public com.googlecode.prolog_cafe.builtin.Operation exec ( com.googlecode.prolog_cafe.builtin.Prolog engine ) { engine.setB0 ( ) ; com.googlecode.prolog_cafe.builtin.Term a1 ; a1 = arg1 ; if ( ! ( a1.unify ( new com.googlecode.prolog_cafe.builtin.IntegerTerm ( engine.stack.top ( ) ) , engine.trail ) ) ) return engine.fail ( ) ; return cont ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) { engine.setB0 ( ) ; com.googlecode.prolog_cafe.lang.Term a1 ; a1 = arg1 ; if ( ! ( a1.unify ( new com.googlecode.prolog_cafe.lang.IntegerTerm ( engine.stack.top ( ) ) , engine.trail ) ) ) return engine.fail ( ) ; return cont ; }
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 ( ) ; assertNoProblems ( kr.getPublicKey ( ) ) ; }

Target:
public void revokedKeyDueToCompromise ( ) throws java.lang.Exception { com.google.gerrit.gpg.testing.TestKey k = add ( com.google.gerrit.gpg.testing.TestKeys.revokedCompromisedKey ( ) ) ; add ( com.google.gerrit.gpg.testing.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:
public void setAssigneeToSelfOnReviewableChangeInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; assign ( sc , sc.owner , sc.owner ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . notTo ( sc.owner , sc.reviewer , sc.ccer , sc.starrer , assignee ) . to ( sc.reviewerByEmail ) . cc ( sc.ccerByEmail ) ; }

Target:
public void setAssigneeToSelfOnReviewableChangeInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; assign ( sc , sc.owner , sc.owner ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . notTo ( sc.owner , sc.reviewer , sc.ccer , sc.starrer , sc.assignee ) . to ( sc.reviewerByEmail ) . cc ( sc.ccerByEmail ) ; }
Source:
private void loadConfigInfo ( final com.google.gerrit.client.info.ChangeInfo info , com.google.gerrit.client.info.ChangeInfo.RevisionInfo rev ) { if ( loaded ) { return ; } com.google.gerrit.client.changes.RevisionInfoCache.add ( changeId , rev ) ; com.google.gerrit.client.projects.ConfigInfoCache.add ( info ) ; com.google.gerrit.client.projects.ConfigInfoCache.get ( info.projectNameKey ( ) , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.projects.ConfigInfoCache.Entry > ( this ) { @ java.lang.Override protected void preDisplay ( com.google.gerrit.client.projects.ConfigInfoCache.Entry result ) { loaded = true ; commentLinkProcessor = result.getCommentLinkProcessor ( ) ; setTheme ( result.getTheme ( ) ) ; renderChangeInfo ( info ) ; loadRevisionInfo ( ) ; } } ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.projects.ConfigInfoCache.Entry entry ) { addExtensionPoints ( info , rev , entry ) ; }
Source:
public static void patch ( java.lang.String token , final com.google.gerrit.reviewdb.Patch.Key id , final int patchIndex , final com.google.gerrit.common.data.PatchSetDetail patchSetDetail , final com.google.gerrit.client.changes.PatchTable patchTable , final com.google.gerrit.client.patches.PatchScreen.TopView topView ) { com.google.gerrit.client.Dispatcher.patch ( token , id , patchIndex , patchSetDetail , patchTable , topView , null ) ; }

Target:
public static void patch ( java.lang.String token , com.google.gerrit.reviewdb.PatchSet.Id base , com.google.gerrit.reviewdb.Patch.Key id , int patchIndex , com.google.gerrit.common.data.PatchSetDetail patchSetDetail , com.google.gerrit.client.changes.PatchTable patchTable , java.lang.String panelType ) { com.google.gerrit.client.Dispatcher.patch ( token , base , id , patchIndex , patchSetDetail , patchTable , null , panelType ) ; }
Source:
private void createSequences ( final com.google.gwtorm.client.StatementExecutor e ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { final com.google.gwtorm.schema.sql.SqlDialect dialect = dbDef.getDialect ( ) ; final com.google.gwtorm.schema.SchemaModel model = dbDef.getSchemaModel ( ) ; java.util.Set < java.lang.String > have = dialect.listSequences ( getConnection ( ) ) ; for ( final com.google.gwtorm.schema.SequenceModel s : model.getSequences ( ) ) { if ( ! ( have.contains ( s.getSequenceName ( ) . toLowerCase ( ) ) ) ) { e.execute ( s.getCreateSequenceSql ( dialect ) ) ; } } }

Target:
private void createSequences ( final com.google.gwtorm.server.StatementExecutor e ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { final com.google.gwtorm.schema.sql.SqlDialect dialect = dbDef.getDialect ( ) ; final com.google.gwtorm.schema.SchemaModel model = dbDef.getSchemaModel ( ) ; java.util.Set < java.lang.String > have = dialect.listSequences ( getConnection ( ) ) ; for ( final com.google.gwtorm.schema.SequenceModel s : model.getSequences ( ) ) { if ( ! ( have.contains ( s.getSequenceName ( ) . toLowerCase ( ) ) ) ) { e.execute ( s.getCreateSequenceSql ( dialect ) ) ; } } }
Source:
public void updateRepo ( com.google.gerrit.server.git.BatchUpdate.RepoContext ctx ) throws java.io.IOException { if ( ( deleteChangeOp ) != null ) { deleteChangeOp.updateRepo ( ctx ) ; return ; } ctx.addRefUpdate ( new org.eclipse.jgit.transport.ReceiveCommand ( org.eclipse.jgit.lib.ObjectId.fromString ( patchSet.getRevision ( ) . get ( ) ) , org.eclipse.jgit.lib.ObjectId.zeroId ( ) , patchSet.getRefName ( ) ) ) ; }

Target:
public void updateRepo ( com.google.gerrit.server.update.RepoContext ctx ) throws java.io.IOException { if ( ( deleteChangeOp ) != null ) { deleteChangeOp.updateRepo ( ctx ) ; return ; } ctx.addRefUpdate ( org.eclipse.jgit.lib.ObjectId.fromString ( patchSet.getRevision ( ) . get ( ) ) , org.eclipse.jgit.lib.ObjectId.zeroId ( ) , patchSet.getRefName ( ) ) ; }
Source:
public void createChangeBypassPrivateByDefaultEnabled ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInput input = new com.google.gerrit.extensions.common.ChangeInput ( project.get ( ) , "master" , "empty change" ) ; input.isPrivate = false ; com.google.common.truth.Truth.assertThat ( gApi.changes ( ) . create ( input ) . get ( ) . isPrivate ) . isNull ( ) ; }

Target:
public void createChangeBypassPrivateByDefaultEnabled ( ) throws java.lang.Exception { setPrivateByDefault ( project2 , InheritableBoolean.TRUE ) ; com.google.gerrit.extensions.common.ChangeInput input = new com.google.gerrit.extensions.common.ChangeInput ( project2.get ( ) , "master" , "empty change" ) ; input.isPrivate = false ; com.google.common.truth.Truth.assertThat ( gApi.changes ( ) . create ( input ) . get ( ) . isPrivate ) . isNull ( ) ; }
Source:
private static java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > predicates ( com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > db , java.util.Set < com.google.gerrit.reviewdb.client.Change.Id > ids ) { java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > r = com.google.common.collect.Lists.newArrayListWithCapacity ( ids.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.Change.Id id : ids ) { r.add ( new com.google.gerrit.server.query.change.LegacyChangeIdPredicate ( db , id ) ) ; } return r ; }

Target:
private static java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > predicates ( com.google.gerrit.server.query.change.ChangeQueryBuilder.Arguments args , java.util.Set < com.google.gerrit.reviewdb.client.Change.Id > ids ) { java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > r = com.google.common.collect.Lists.newArrayListWithCapacity ( ids.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.Change.Id id : ids ) { r.add ( new com.google.gerrit.server.query.change.LegacyChangeIdPredicate ( args , id ) ) ; } return r ; }
Source:
private boolean contains ( java.util.List < org.eclipse.jgit.revwalk.FooterLine > footers , org.eclipse.jgit.revwalk.FooterKey key , java.lang.String val ) { for ( final org.eclipse.jgit.revwalk.FooterLine line : footers ) { if ( ( line.matches ( key ) ) && ( val.equals ( line.getValue ( ) ) ) ) { return true ; } } return false ; }

Target:
private boolean isSubmitForMissingCommitsStillPossible ( final com.google.gerrit.server.git.CodeReviewCommit commit ) { if ( ( ( commit.missing ) == null ) || ( commit.missing.isEmpty ( ) ) ) { return false ; } for ( com.google.gerrit.server.git.CodeReviewCommit missingCommit : commit.missing ) { loadChangeInfo ( missingCommit ) ; if ( ( missingCommit.patchsetId ) == null ) { return false ; } if ( ! ( missingCommit.change.currentPatchSetId ( ) . equals ( missingCommit.patchsetId ) ) ) { return false ; } } return true ; }
Source:
public void setAssigneeOnReviewableChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; assign ( sc , sc.owner , sc.assignee ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . notTo ( sc.owner , sc.reviewer , sc.ccer , sc.starrer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . to ( sc.assignee ) ; }

Target:
public void setAssigneeOnReviewableChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; assign ( sc , sc.owner , sc.assignee ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . to ( sc.assignee ) . noOneElse ( ) ; }
Source:
private java.util.Map < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.reviewdb.client.Project > readAllProjects ( ) { java.util.Map < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.reviewdb.client.Project > projects = new java.util.HashMap < > ( ) ; for ( com.google.gerrit.reviewdb.client.Project.NameKey name : projectCache.all ( ) ) { com.google.gerrit.server.project.ProjectState c = projectCache.get ( name ) ; if ( c != null ) { projects.put ( c.getNameKey ( ) , c.getProject ( ) ) ; } } return projects ; }

Target:
private java.util.Map < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.reviewdb.client.Project > readAllReadableProjects ( ) { java.util.Map < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.reviewdb.client.Project > projects = new java.util.HashMap < > ( ) ; for ( com.google.gerrit.reviewdb.client.Project.NameKey name : projectCache.all ( ) ) { com.google.gerrit.server.project.ProjectState c = projectCache.get ( name ) ; if ( ( c != null ) && ( c.statePermitsRead ( ) ) ) { projects.put ( c.getNameKey ( ) , c.getProject ( ) ) ; } } return projects ; }
Source:
public com.google.gerrit.extensions.api.changes.SubmittedTogetherInfo submittedTogether ( java.util.EnumSet < com.google.gerrit.extensions.api.changes.SubmittedTogetherOption > options ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return submittedTogether.apply ( change , options ) ; } catch ( java.io.IOException | com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot query submittedTogether" , e ) ; } }

Target:
public com.google.gerrit.extensions.api.changes.SubmittedTogetherInfo submittedTogether ( java.util.EnumSet < com.google.gerrit.extensions.client.ListChangesOption > listOptions , java.util.EnumSet < com.google.gerrit.extensions.api.changes.SubmittedTogetherOption > submitOptions ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return submittedTogether.get ( ) . addListChangesOption ( listOptions ) . addSubmittedTogetherOption ( submitOptions ) . applyInfo ( change ) ; } catch ( java.io.IOException | com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot query submittedTogether" , e ) ; } }
Source:
private org.eclipse.jgit.lib.ObjectId parseRevision ( org.eclipse.jgit.revwalk.RevCommit commit ) throws org.eclipse.jgit.errors.ConfigInvalidException { java.lang.String sha = parseOneFooter ( commit , com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_COMMIT ) ; if ( sha == null ) { return null ; } try { return org.eclipse.jgit.lib.ObjectId.fromString ( sha ) ; } catch ( org.eclipse.jgit.errors.InvalidObjectIdException e ) { org.eclipse.jgit.errors.ConfigInvalidException cie = invalidFooter ( com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_COMMIT , sha ) ; cie.initCause ( e ) ; throw cie ; } }

Target:
private org.eclipse.jgit.lib.ObjectId parseRevision ( com.google.gerrit.server.notedb.ChangeNotesCommit commit ) throws org.eclipse.jgit.errors.ConfigInvalidException { java.lang.String sha = parseOneFooter ( commit , com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_COMMIT ) ; if ( sha == null ) { return null ; } try { return org.eclipse.jgit.lib.ObjectId.fromString ( sha ) ; } catch ( org.eclipse.jgit.errors.InvalidObjectIdException e ) { org.eclipse.jgit.errors.ConfigInvalidException cie = invalidFooter ( com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_COMMIT , sha ) ; cie.initCause ( e ) ; throw cie ; } }
Source:
public void remove ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key1 = com.google.gerrit.gpg.testutil.TestKeys.key1 ( ) ; store.add ( key1.getPublicKeyRing ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , store.save ( newCommitBuilder ( ) ) ) ; assertKeys ( key1.getKeyId ( ) , key1 ) ; store.remove ( key1.getPublicKey ( ) . getFingerprint ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.FAST_FORWARD , store.save ( newCommitBuilder ( ) ) ) ; assertKeys ( key1.getKeyId ( ) ) ; }

Target:
public void remove ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key1 = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithoutExpiration ( ) ; store.add ( key1.getPublicKeyRing ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , store.save ( newCommitBuilder ( ) ) ) ; assertKeys ( key1.getKeyId ( ) , key1 ) ; store.remove ( key1.getPublicKey ( ) . getFingerprint ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.FAST_FORWARD , store.save ( newCommitBuilder ( ) ) ) ; assertKeys ( key1.getKeyId ( ) ) ; }
Source:
public static com.google.gerrit.common.data.IncludedInDetail resolve ( final org.eclipse.jgit.lib.Repository repo , final org.eclipse.jgit.revwalk.RevWalk rw , final org.eclipse.jgit.revwalk.RevCommit commit ) throws java.io.IOException { return new com.google.gerrit.server.change.IncludedInResolver ( repo , rw , commit ) . resolve ( ) ; }

Target:
public static com.google.gerrit.common.data.IncludedInDetail resolve ( final org.eclipse.jgit.lib.Repository repo , final org.eclipse.jgit.revwalk.RevWalk rw , final org.eclipse.jgit.revwalk.RevCommit commit ) throws java.io.IOException { org.eclipse.jgit.revwalk.RevFlag flag = com.google.gerrit.server.change.IncludedInResolver.newFlag ( rw ) ; try { return new com.google.gerrit.server.change.IncludedInResolver ( repo , rw , commit , flag ) . resolve ( ) ; } finally { rw.disposeFlag ( flag ) ; } }
Source:
private com.google.inject.Injector getPluginInjector ( final java.io.File jarFile ) throws java.io.IOException { final java.lang.String pluginName = com.google.common.base.Objects.firstNonNull ( com.google.gerrit.server.plugins.JarPluginProvider.getJarPluginName ( jarFile ) , com.google.gerrit.server.plugins.PluginLoader.nameOf ( jarFile ) ) ; return initInjector.createChildInjector ( new com.google.inject.AbstractModule ( ) { @ java.lang.Override protected void configure ( ) { bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.PluginName.class ) . toInstance ( pluginName ) ; } } ) ; }

Target:
private com.google.inject.Injector getPluginInjector ( final java.io.File jarFile ) throws java.io.IOException { final java.lang.String pluginName = com.google.common.base.MoreObjects.firstNonNull ( com.google.gerrit.server.plugins.JarPluginProvider.getJarPluginName ( jarFile ) , com.google.gerrit.server.plugins.PluginLoader.nameOf ( jarFile ) ) ; return initInjector.createChildInjector ( new com.google.inject.AbstractModule ( ) { @ java.lang.Override protected void configure ( ) { bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.PluginName.class ) . toInstance ( pluginName ) ; } } ) ; }
Source:
public void linkifyMessageChangeId ( ) throws java.lang.Exception { com.google.gitiles.Linkifier l = new com.google.gitiles.Linkifier ( TestGitilesUrls.URLS ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( com.google.common.collect.ImmutableMap.of ( "text" , "I0123456789" , "url" , "http://test-host-review/foo/#/q/I0123456789,n,z" ) ) , l.linkify ( com.google.gitiles.LinkifierTest.REQ , "I0123456789" ) ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( com.google.common.collect.ImmutableMap.of ( "text" , "Change-Id: " ) , com.google.common.collect.ImmutableMap.of ( "text" , "I0123456789" , "url" , "http://test-host-review/foo/#/q/I0123456789,n,z" ) ) , l.linkify ( com.google.gitiles.LinkifierTest.REQ , "Change-Id: I0123456789" ) ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( com.google.common.collect.ImmutableMap.of ( "text" , "Change-Id: " ) , com.google.common.collect.ImmutableMap.of ( "text" , "I0123456789" , "url" , "http://test-host-review/foo/#/q/I0123456789,n,z" ) , com.google.common.collect.ImmutableMap.of ( "text" , " exists" ) ) , l.linkify ( com.google.gitiles.LinkifierTest.REQ , "Change-Id: I0123456789 exists" ) ) ; }

Target:
public void linkifyMessageChangeId ( ) throws java.lang.Exception { org.eclipse.jgit.lib.Config config = new org.eclipse.jgit.lib.Config ( ) ; com.google.gitiles.Linkifier l = new com.google.gitiles.Linkifier ( TestGitilesUrls.URLS , config ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( com.google.common.collect.ImmutableMap.of ( "text" , "I0123456789" , "url" , "http://test-host-review/foo/#/q/I0123456789,n,z" ) ) , l.linkify ( com.google.gitiles.LinkifierTest.REQ , "I0123456789" ) ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( com.google.common.collect.ImmutableMap.of ( "text" , "Change-Id: " ) , com.google.common.collect.ImmutableMap.of ( "text" , "I0123456789" , "url" , "http://test-host-review/foo/#/q/I0123456789,n,z" ) ) , l.linkify ( com.google.gitiles.LinkifierTest.REQ , "Change-Id: I0123456789" ) ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( com.google.common.collect.ImmutableMap.of ( "text" , "Change-Id: " ) , com.google.common.collect.ImmutableMap.of ( "text" , "I0123456789" , "url" , "http://test-host-review/foo/#/q/I0123456789,n,z" ) , com.google.common.collect.ImmutableMap.of ( "text" , " exists" ) ) , l.linkify ( com.google.gitiles.LinkifierTest.REQ , "Change-Id: I0123456789 exists" ) ) ; }
Source:
private void appendLineText ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , final int lineNumberMinusOne , final com.google.gerrit.client.patches.PatchLine.Type type , final com.google.gerrit.prettify.common.SparseHtmlFile src , final int i ) { appendLineText ( m , lineNumberMinusOne , type , src.getSafeHtmlLine ( i ) , src.hasTrailingEdit ( i ) ) ; }

Target:
private void appendLineText ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , final int lineNumberMinusOne , final com.google.gerrit.client.patches.PatchLine.Type type , final com.google.gerrit.prettify.common.SparseHtmlFile src , final int i , final boolean fullBlock ) { appendLineText ( m , lineNumberMinusOne , type , src.getSafeHtmlLine ( i ) , src.hasTrailingEdit ( i ) , fullBlock ) ; }
Source:
public com.google.gerrit.common.data.PatchScript call ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change.Id changeId = patchKey.getParentKey ( ) . getParentKey ( ) ; com.google.gerrit.server.project.ChangeControl control = changeControlFactory.validateFor ( changeId ) ; return patchScriptFactoryFactory.create ( control , patchKey.getFileName ( ) , psa , psb , dp ) . call ( ) ; }

Target:
public com.google.gerrit.common.data.PatchScript call ( ) throws java.lang.Exception { com.google.gerrit.server.project.ChangeControl control = changeControlFactory.validateFor ( patchKey.getParentKey ( ) . getParentKey ( ) , getUser ( ) ) ; return patchScriptFactoryFactory.create ( control , patchKey.getFileName ( ) , psa , psb , dp ) . call ( ) ; }
Source:
private void serveGwtUi ( ) { serve ( "/gerrit_ui/*" ) . with ( com.google.inject.Key.get ( javax.servlet.http.HttpServlet.class , com.google.inject.name.Names.named ( com.google.gerrit.httpd.raw.StaticModule.GWT_UI_SERVLET ) ) ) ; if ( ( warFs ) == null ) { filter ( "/" ) . through ( new com.google.gerrit.httpd.raw.RecompileGwtUiFilter ( buckOut , unpackedWar ) ) ; } }

Target:
private void serveGwtUi ( ) { serveRegex ( "^/gerrit_ui/(?!rpc/)(.*)$" ) . with ( com.google.inject.Key.get ( javax.servlet.http.HttpServlet.class , com.google.inject.name.Names.named ( com.google.gerrit.httpd.raw.StaticModule.GWT_UI_SERVLET ) ) ) ; if ( ( warFs ) == null ) { filter ( "/" ) . through ( new com.google.gerrit.httpd.raw.RecompileGwtUiFilter ( buckOut , unpackedWar ) ) ; } }
Source:
void parseAll ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { walk.markStart ( walk.parseCommit ( tip ) ) ; try ( com.google.gerrit.metrics.Timer1.Context timer = metrics.parseLatency.start ( com.google.gerrit.server.notedb.NoteDbTable.CHANGES ) ) { com.google.gerrit.server.notedb.ChangeNotesCommit commit ; while ( ( commit = walk.next ( ) ) != null ) { parse ( commit ) ; } parseNotes ( ) ; allPastReviewers.addAll ( reviewers.rowKeySet ( ) ) ; pruneReviewers ( ) ; updatePatchSetStates ( ) ; checkMandatoryFooters ( ) ; } }

Target:
com.google.gerrit.server.notedb.ChangeNotesState parseAll ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { walk.markStart ( walk.parseCommit ( tip ) ) ; try ( com.google.gerrit.metrics.Timer1.Context timer = metrics.parseLatency.start ( com.google.gerrit.server.notedb.NoteDbTable.CHANGES ) ) { com.google.gerrit.server.notedb.ChangeNotesCommit commit ; while ( ( commit = walk.next ( ) ) != null ) { parse ( commit ) ; } parseNotes ( ) ; allPastReviewers.addAll ( reviewers.rowKeySet ( ) ) ; pruneReviewers ( ) ; updatePatchSetStates ( ) ; checkMandatoryFooters ( ) ; } return buildState ( ) ; }
Source:
private java.util.Set < com.google.gerrit.reviewdb.AccountGroup.Id > queryForGroups ( final java.lang.String username ) throws com.google.gerrit.server.account.AccountException , javax.naming.NamingException { final javax.naming.directory.DirContext ctx = open ( ) ; try { return queryForGroups ( ctx , username , null ) ; } finally { try { ctx.close ( ) ; } catch ( javax.naming.NamingException e ) { com.google.gerrit.server.auth.ldap.LdapRealm.log.warn ( "Cannot close LDAP query handle" , e ) ; } } }

Target:
public java.util.Set < com.google.gerrit.reviewdb.AccountGroup.Id > createEntry ( final java.lang.String username ) throws java.lang.Exception { final javax.naming.directory.DirContext ctx = helper.open ( ) ; try { return helper.queryForGroups ( ctx , username , null ) ; } finally { try { ctx.close ( ) ; } catch ( javax.naming.NamingException e ) { com.google.gerrit.server.auth.ldap.LdapRealm.log.warn ( "Cannot close LDAP query handle" , e ) ; } } }
Source:
private java.util.List < org.apache.lucene.document.Document > doRead ( java.util.Set < java.lang.String > fields ) throws java.io.IOException { throw new com.google.gwtorm.server.OrmException ( "interupted" ) ; return new com.google.gerrit.lucene.LuceneChangeIndex.ChangeDataResults ( executor.submit ( new java.util.concurrent.Callable < java.util.List < org.apache.lucene.document.Document > > ( ) { @ java.lang.Override public java.util.List < org.apache.lucene.document.Document > call ( ) throws com.google.gwtorm.server.OrmException { return doRead ( ) ; } } ) ) ; }

Target:
public com.google.gwtorm.server.ResultSet < com.google.gerrit.server.query.change.ChangeData > read ( ) throws com.google.gwtorm.server.OrmException { if ( java.lang.Thread.interrupted ( ) ) { java.lang.Thread.currentThread ( ) . interrupt ( ) ; throw new com.google.gwtorm.server.OrmException ( "interrupted" ) ; } final java.util.Set < java.lang.String > fields = fields ( opts ) ; return new com.google.gerrit.lucene.LuceneChangeIndex.ChangeDataResults ( executor.submit ( new java.util.concurrent.Callable < java.util.List < org.apache.lucene.document.Document > > ( ) { @ java.lang.Override public java.util.List < org.apache.lucene.document.Document > call ( ) throws java.io.IOException { return doRead ( fields ) ; } } ) , fields ) ; }
Source:
public void run ( ) { repo.close ( ) ; }

Target:
public org.eclipse.jgit.lib.Repository createValue ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.google.gerrit.rules.PrologEnvironment env = ( ( com.google.gerrit.rules.PrologEnvironment ) ( engine.control ) ) ; com.google.gerrit.server.git.GitRepositoryManager gitMgr = env.getArgs ( ) . getGitRepositoryManager ( ) ; com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.rules.StoredValues.getChange ( engine ) ; com.google.gerrit.reviewdb.client.Project.NameKey projectKey = change.getProject ( ) ; org.eclipse.jgit.lib.Repository repo ; try { repo = gitMgr.openRepository ( projectKey ) ; } catch ( java.io.IOException e ) { throw new com.googlecode.prolog_cafe.exceptions.SystemException ( e.getMessage ( ) ) ; } env.addToCleanup ( repo :: close ) ; return repo ; }
Source:
protected void configure ( ) { bind ( com.google.inject.Key.get ( javax.sql.DataSource.class , com.google.inject.name.Names.named ( "ReviewDb" ) ) ) . toProvider ( com.google.gerrit.httpd.ReviewDbDataSourceProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; listener ( ) . to ( com.google.gerrit.httpd.ReviewDbDataSourceProvider.class ) ; }

Target:
protected void configure ( ) { bind ( DataSourceProvider.Context.class ) . toInstance ( DataSourceProvider.Context.MULTI_USER ) ; bind ( com.google.inject.Key.get ( javax.sql.DataSource.class , com.google.inject.name.Names.named ( "ReviewDb" ) ) ) . toProvider ( com.google.gerrit.server.schema.DataSourceProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; listener ( ) . to ( com.google.gerrit.server.schema.DataSourceProvider.class ) ; }
Source:
public com.google.gerrit.server.IdentifiedUser materializedCopy ( ) { final com.google.gerrit.server.account.CapabilityControl capabilities = getCapabilities ( ) ; return new com.google.gerrit.server.IdentifiedUser ( new com.google.gerrit.server.account.CapabilityControl.Factory ( ) { @ java.lang.Override public com.google.gerrit.server.account.CapabilityControl create ( com.google.gerrit.server.CurrentUser user ) { return capabilities ; } } , authConfig , realm , anonymousCowardName , com.google.inject.util.Providers.of ( canonicalUrl.get ( ) ) , accountCache , groupBackend , disableReverseDnsLookup , com.google.inject.util.Providers.of ( remotePeerProvider.get ( ) ) , state , realUser ) ; }

Target:
public java.net.SocketAddress get ( ) { throw e ; }
Source:
private void insertOne ( T obj ) throws com.google.gwtorm.client.OrmException { byte [ ] idx = indexRowData ( obj ) ; for ( com.google.gwtorm.nosql.IndexFunction < T > f : com.google.gwtorm.nosql.generic.GenericAccess.getQueryIndexes ( ) ) { if ( f.includes ( obj ) ) { db.upsert ( indexRowKey ( f , obj ) , idx ) ; } } db.insert ( dataRowKey ( obj ) , com.google.gwtorm.nosql.generic.GenericAccess.getObjectCodec ( ) . encode ( obj ) . toByteArray ( ) ) ; }

Target:
private void insertOne ( T nObj ) throws com.google.gwtorm.client.OrmException { writeNewIndexes ( null , nObj ) ; final byte [ ] key = dataRowKey ( com.google.gwtorm.nosql.generic.GenericAccess.primaryKey ( nObj ) ) ; db.insert ( key , com.google.gwtorm.nosql.generic.GenericAccess.getObjectCodec ( ) . encode ( nObj ) . toByteArray ( ) ) ; }
Source:
public synchronized boolean startReindexer ( java.lang.String name ) throws com.google.gerrit.lucene.ReindexerAlreadyRunningException { com.google.gerrit.server.index.OnlineReindexer < ? , ? , ? > reindexer = reindexers.get ( name ) ; com.google.gerrit.lucene.LuceneVersionManager.validateReindexerNotRunning ( reindexer ) ; if ( ! ( isCurrentIndexVersionLatest ( name , reindexer ) ) ) { reindexer.start ( ) ; return true ; } return false ; }

Target:
public synchronized boolean startReindexer ( java.lang.String name , boolean force ) throws com.google.gerrit.lucene.ReindexerAlreadyRunningException { com.google.gerrit.server.index.OnlineReindexer < ? , ? , ? > reindexer = reindexers.get ( name ) ; com.google.gerrit.lucene.LuceneVersionManager.validateReindexerNotRunning ( reindexer ) ; if ( force || ( ! ( isCurrentIndexVersionLatest ( name , reindexer ) ) ) ) { reindexer.start ( ) ; return true ; } return false ; }
Source:
private com.google.common.collect.Multimap < java.lang.String , java.io.File > asMultimap ( java.util.List < java.io.File > plugins ) { com.google.common.collect.Multimap < java.lang.String , java.io.File > map = com.google.common.collect.LinkedHashMultimap.create ( ) ; for ( java.io.File srcFile : plugins ) { map.put ( getPluginName ( srcFile ) , srcFile ) ; } return map ; }

Target:
private com.google.common.collect.Multimap < java.lang.String , java.nio.file.Path > asMultimap ( java.util.List < java.nio.file.Path > plugins ) { com.google.common.collect.Multimap < java.lang.String , java.nio.file.Path > map = com.google.common.collect.LinkedHashMultimap.create ( ) ; for ( java.nio.file.Path srcPath : plugins ) { map.put ( getPluginName ( srcPath ) , srcPath ) ; } return map ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.common.ChangeHookRunner.class ) ; bind ( com.google.gerrit.common.ChangeHooks.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; listener ( ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.common.ChangeHookRunner.class ) ; bind ( com.google.gerrit.common.ChangeHooks.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; bind ( com.google.gerrit.common.EventDispatcher.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; bind ( com.google.gerrit.common.EventSource.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.NewProjectCreatedListener.class ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; listener ( ) . to ( com.google.gerrit.common.ChangeHookRunner.class ) ; }
Source:
public void noValue ( ) { java.util.List < java.lang.Integer > expected = new java.util.ArrayList < > ( ) ; if ( ( com.google.gerrit.testutil.IndexVersionsTest.SCHEMA_DEF.getPrevious ( ) ) != null ) { expected.add ( com.google.gerrit.testutil.IndexVersionsTest.SCHEMA_DEF.getPrevious ( ) . getVersion ( ) ) ; } expected.add ( com.google.gerrit.testutil.IndexVersionsTest.SCHEMA_DEF.getLatest ( ) . getVersion ( ) ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.testutil.IndexVersionsTest.get ( null ) ) . containsExactlyElementsIn ( expected ) . inOrder ( ) ; }

Target:
public void noValue ( ) { java.util.List < java.lang.Integer > expected = new java.util.ArrayList < > ( ) ; if ( ( com.google.gerrit.testing.IndexVersionsTest.SCHEMA_DEF.getPrevious ( ) ) != null ) { expected.add ( com.google.gerrit.testing.IndexVersionsTest.SCHEMA_DEF.getPrevious ( ) . getVersion ( ) ) ; } expected.add ( com.google.gerrit.testing.IndexVersionsTest.SCHEMA_DEF.getLatest ( ) . getVersion ( ) ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.testing.IndexVersionsTest.get ( null ) ) . containsExactlyElementsIn ( expected ) . inOrder ( ) ; }
Source:
private com.google.gerrit.server.account.AuthResult create ( ) throws java.io.IOException { try { return accountManager.authenticate ( new com.google.gerrit.server.account.AuthRequest ( ExternalId.Key.create ( com.google.gerrit.server.account.ExternalId.SCHEME_UUID , java.util.UUID.randomUUID ( ) . toString ( ) ) ) ) ; } catch ( com.google.gerrit.server.account.AccountException e ) { getServletContext ( ) . log ( "cannot create new account" , e ) ; return null ; } }

Target:
private com.google.gerrit.server.account.AuthResult create ( ) throws java.io.IOException { try { return accountManager.authenticate ( new com.google.gerrit.server.account.AuthRequest ( ExternalId.Key.create ( com.google.gerrit.server.account.externalids.ExternalId.SCHEME_UUID , java.util.UUID.randomUUID ( ) . toString ( ) ) ) ) ; } catch ( com.google.gerrit.server.account.AccountException e ) { getServletContext ( ) . log ( "cannot create new account" , e ) ; return null ; } }
Source:
public void run ( ) { com.google.gerrit.client.projects.ProjectMap.suggest ( req.getQuery ( ) , req.getLimit ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.projects.ProjectMap > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.projects.ProjectMap map ) { callback.onSuggestionsReady ( req , new com.google.gerrit.client.ui.Response ( com.google.gerrit.client.rpc.Natives.asList ( map.values ( ) ) ) ) ; } } ) ; }

Target:
public void _onRequestSuggestions ( final com.google.gerrit.client.ui.Request req , final com.google.gerrit.client.ui.Callback callback ) { com.google.gerrit.client.projects.ProjectMap.suggest ( req.getQuery ( ) , req.getLimit ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.projects.ProjectMap > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.projects.ProjectMap map ) { callback.onSuggestionsReady ( req , new com.google.gerrit.client.ui.Response ( com.google.gerrit.client.rpc.Natives.asList ( map.values ( ) ) ) ) ; } } ) ; }
Source:
public long getTail ( ) throws java.io.IOException { if ( ( getHead ( ) ) == 0 ) { return 0 ; } long tail = stores.tail.spinGet ( com.googlesource.gerrit.plugins.events.fsstore.FsStore.MAX_GET_SPINS ) ; return tail < 1 ? 1 : tail ; }

Target:
public java.lang.String get ( long num ) throws java.io.IOException { if ( ( cachedTail.isLessThanOrEqualTo ( num , com.googlesource.gerrit.plugins.events.fsstore.FsStore.MAX_GET_SPINS ) ) && ( cachedHead.isGreaterThanOrEqualTo ( num , com.googlesource.gerrit.plugins.events.fsstore.FsStore.MAX_GET_SPINS ) ) ) { try { return com.googlesource.gerrit.plugins.events.fsstore.Fs.readFile ( paths.events.path ( num ) ) ; } catch ( java.nio.file.NoSuchFileException e ) { } } return null ; }
Source:
public void visit ( org.pegdown.ast.VerbatimNode node ) { html.open ( "pre" ) ; html.open ( "code" ) ; java.lang.String text = node.getText ( ) ; while ( text.startsWith ( "\n" ) ) { html.open ( "br" ) ; text = text.substring ( 1 ) ; } html.appendAndEscape ( text ) ; html.close ( "code" ) ; html.close ( "pre" ) ; }

Target:
public void visit ( org.pegdown.ast.AutoLinkNode node ) { java.lang.String url = node.getText ( ) ; html.open ( "a" ) . attribute ( "href" , href ( url ) ) . appendAndEscape ( url ) . close ( "a" ) ; }
Source:
public void defaultMessage ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; com.google.gerrit.extensions.common.ChangeInfo c = get ( changeId ) ; com.google.common.truth.Truth.assertThat ( c.messages ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( c.messages ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( c.messages.iterator ( ) . next ( ) . message ) . isEqualTo ( "Uploaded patch set 1." ) ; }

Target:
public void defaultMessage ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; com.google.gerrit.extensions.common.ChangeInfo c = get ( changeId , com.google.gerrit.extensions.client.ListChangesOption.MESSAGES ) ; com.google.common.truth.Truth.assertThat ( c.messages ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( c.messages ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( c.messages.iterator ( ) . next ( ) . message ) . isEqualTo ( "Uploaded patch set 1." ) ; }
Source:
private java.util.List < com.google.gerrit.extensions.common.ChangeInfo > getChangesInTopic ( java.lang.String topic , java.lang.String downstreamBranch ) throws com.google.gerrit.extensions.restapi.RestApiException , com.googlesource.gerrit.plugins.automerger.InvalidQueryParameterException { com.googlesource.gerrit.plugins.automerger.QueryBuilder queryBuilder = new com.googlesource.gerrit.plugins.automerger.QueryBuilder ( ) ; queryBuilder.addParameter ( "topic" , topic ) ; queryBuilder.addParameter ( "branch" , downstreamBranch ) ; queryBuilder.addParameter ( "status" , "open" ) ; return gApi.changes ( ) . query ( queryBuilder.get ( ) ) . withOptions ( ListChangesOption.ALL_REVISIONS , ListChangesOption.CURRENT_COMMIT ) . get ( ) ; }

Target:
private java.util.List < com.google.gerrit.extensions.common.ChangeInfo > getChangesInTopicAndBranch ( java.lang.String topic , java.lang.String downstreamBranch ) throws com.google.gerrit.extensions.restapi.RestApiException , com.googlesource.gerrit.plugins.automerger.InvalidQueryParameterException { com.googlesource.gerrit.plugins.automerger.QueryBuilder queryBuilder = new com.googlesource.gerrit.plugins.automerger.QueryBuilder ( ) ; queryBuilder.addParameter ( "topic" , topic ) ; queryBuilder.addParameter ( "branch" , downstreamBranch ) ; queryBuilder.addParameter ( "status" , "open" ) ; return gApi.changes ( ) . query ( queryBuilder.get ( ) ) . withOptions ( ListChangesOption.ALL_REVISIONS , ListChangesOption.CURRENT_COMMIT ) . get ( ) ; }
Source:
private java.lang.String getRedirectUrl ( java.lang.String pathAndQuery ) throws java.io.IOException , javax.servlet.ServletException { com.google.gitiles.FakeHttpServletResponse res = new com.google.gitiles.FakeHttpServletResponse ( ) ; service ( pathAndQuery , com.google.common.util.concurrent.Atomics.< com.google.gitiles.GitilesView > newReference ( ) , res ) ; org.junit.Assert.assertEquals ( 302 , res.getStatus ( ) ) ; return res.getHeader ( com.google.common.net.HttpHeaders.LOCATION ) ; }

Target:
private java.lang.String getRedirectUrl ( java.lang.String pathAndQuery ) throws java.io.IOException , javax.servlet.ServletException { com.google.gitiles.TestViewFilter.Result result = com.google.gitiles.TestViewFilter.service ( repo , pathAndQuery ) ; org.junit.Assert.assertEquals ( 302 , result.getResponse ( ) . getStatus ( ) ) ; return result.getResponse ( ) . getHeader ( com.google.common.net.HttpHeaders.LOCATION ) ; }
Source:
public com.google.gerrit.reviewdb.client.PatchSetInfo createValue ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.rules.StoredValues.CHANGE_DATA.get ( engine ) . getChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.rules.StoredValues.PATCH_SET.get ( engine ) ; com.google.gerrit.rules.PrologEnvironment env = ( ( com.google.gerrit.rules.PrologEnvironment ) ( engine.control ) ) ; com.google.gerrit.server.patch.PatchSetInfoFactory patchInfoFactory = env.getArgs ( ) . getPatchSetInfoFactory ( ) ; try { return patchInfoFactory.get ( change , ps ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e ) { throw new com.googlecode.prolog_cafe.lang.SystemException ( e.getMessage ( ) ) ; } }

Target:
public com.google.gerrit.reviewdb.client.PatchSetInfo createValue ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.rules.StoredValues.getChange ( engine ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.rules.StoredValues.PATCH_SET.get ( engine ) ; com.google.gerrit.rules.PrologEnvironment env = ( ( com.google.gerrit.rules.PrologEnvironment ) ( engine.control ) ) ; com.google.gerrit.server.patch.PatchSetInfoFactory patchInfoFactory = env.getArgs ( ) . getPatchSetInfoFactory ( ) ; try { return patchInfoFactory.get ( change , ps ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e ) { throw new com.googlecode.prolog_cafe.lang.SystemException ( e.getMessage ( ) ) ; } }
Source:
protected void configure ( ) { listener ( ) . to ( com.google.gerrit.server.plugins.PluginLoader.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.server.plugins.ServerInformationImpl.class ) ; bind ( com.google.gerrit.extensions.systemstatus.ServerInformation.class ) . to ( com.google.gerrit.server.plugins.ServerInformationImpl.class ) ; bind ( com.google.gerrit.server.plugins.PluginCleanerTask.class ) ; bind ( com.google.gerrit.server.plugins.PluginGuiceEnvironment.class ) ; bind ( com.google.gerrit.server.plugins.PluginLoader.class ) ; bind ( com.google.gerrit.server.plugins.CopyConfigModule.class ) ; listener ( ) . to ( com.google.gerrit.server.plugins.PluginLoader.class ) ; }