auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public GroupDescription.Basic get ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) { final com.google.gerrit.common.data.GroupReference ref = com.google.gerrit.server.group.SystemGroupBackend.getGroup ( uuid ) ; if ( ref != null ) { return new com.google.gerrit.common.data.GroupDescription.Basic ( ) { @ java.lang.Override public java.lang.String getName ( ) { return ref.getName ( ) ; } @ java.lang.Override public AccountGroup.UUID getGroupUUID ( ) { return ref.getUUID ( ) ; } @ java.lang.Override public java.lang.String getUrl ( ) { return null ; } @ java.lang.Override public java.lang.String getEmailAddress ( ) { return null ; } } ; } return null ; }

Target:
public GroupDescription.Basic get ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) { final com.google.gerrit.common.data.GroupReference ref = com.google.gerrit.server.group.SystemGroupBackend.getGroup ( uuid ) ; return new com.google.gerrit.common.data.GroupDescription.Basic ( ) { @ java.lang.Override public java.lang.String getName ( ) { return ref.getName ( ) ; } @ java.lang.Override public AccountGroup.UUID getGroupUUID ( ) { return ref.getUUID ( ) ; } @ java.lang.Override public java.lang.String getUrl ( ) { return null ; } @ java.lang.Override public java.lang.String getEmailAddress ( ) { return null ; } } ; }
Source:
public void testUnblockNoForce ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertTrue ( "u can push" , u.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }

Target:
public void testUnblockNoForce ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertTrue ( "u can push" , u.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }
Source:
public void configure ( ) { install ( dbInjector.getInstance ( com.google.gerrit.pgm.util.BatchProgramModule.class ) ) ; install ( com.google.gerrit.server.git.SearchingChangeCacheImpl.module ( ) ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.GitReferenceUpdatedListener.class ) . to ( com.google.gerrit.server.index.change.ReindexAfterUpdate.class ) ; install ( new com.google.gerrit.server.index.DummyIndexModule ( ) ) ; factory ( ChangeResource.Factory.class ) ; }

Target:
public void configure ( ) { install ( dbInjector.getInstance ( com.google.gerrit.pgm.util.BatchProgramModule.class ) ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.GitReferenceUpdatedListener.class ) . to ( com.google.gerrit.server.index.change.ReindexAfterUpdate.class ) ; install ( new com.google.gerrit.server.index.DummyIndexModule ( ) ) ; factory ( ChangeResource.Factory.class ) ; }
Source:
public void testPrefixOnlyOptimization ( ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.query.change.RegexFilePredicate p = com.google.gerrit.server.query.change.RegexFilePredicateTest.predicate ( "^a/b/.*" ) ; assertTrue ( p.match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "a/b/source.c" ) ) ) ; assertFalse ( p.match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "source.c" ) ) ) ; assertTrue ( p.match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "a/b/source.c" , "a/c/test" ) ) ) ; assertFalse ( p.match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "a/bb/source.c" ) ) ) ; }

Target:
public void testPrefixOnlyOptimization ( ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.query.change.RegexFilePredicate p = com.google.gerrit.server.query.change.RegexFilePredicateTest.predicate ( "^a/b/.*" ) ; org.junit.Assert.assertTrue ( p.match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "a/b/source.c" ) ) ) ; org.junit.Assert.assertFalse ( p.match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "source.c" ) ) ) ; org.junit.Assert.assertTrue ( p.match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "a/b/source.c" , "a/c/test" ) ) ) ; org.junit.Assert.assertFalse ( p.match ( com.google.gerrit.server.query.change.RegexFilePredicateTest.change ( "a/bb/source.c" ) ) ) ; }
Source:
public com.google.gerrit.server.notedb.ChangeNotes load ( com.google.gerrit.reviewdb.client.Change change ) throws com.google.gwtorm.server.OrmException { org.eclipse.jgit.lib.Repository repo ; try { repo = repoManager.openRepository ( change.getProject ( ) ) ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } try { return new com.google.gerrit.server.notedb.ChangeNotes ( repo , change ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException | java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } finally { repo.close ( ) ; } }

Target:
public com.google.gerrit.server.notedb.ChangeNotes create ( com.google.gerrit.reviewdb.client.Change change ) { return new com.google.gerrit.server.notedb.ChangeNotes ( repoManager , change ) ; }
Source:
private static < T > T readContentFromJson ( com.google.gerrit.acceptance.RestResponse r , int expectedStatus , java.lang.Class < T > clazz ) throws java.lang.Exception { r.assertStatus ( expectedStatus ) ; com.google.gson.stream.JsonReader jsonReader = new com.google.gson.stream.JsonReader ( r.getReader ( ) ) ; jsonReader.setLenient ( true ) ; return newGson ( ) . fromJson ( jsonReader , clazz ) ; }

Target:
private static < T > T readContentFromJson ( com.google.gerrit.acceptance.RestResponse r , int expectedStatus , java.lang.Class < T > clazz ) throws java.lang.Exception { r.assertStatus ( expectedStatus ) ; try ( com.google.gson.stream.JsonReader jsonReader = new com.google.gson.stream.JsonReader ( r.getReader ( ) ) ) { jsonReader.setLenient ( true ) ; return newGson ( ) . fromJson ( jsonReader , clazz ) ; } }
Source:
private boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Branch.NameKey branchName , com.google.gerrit.server.CurrentUser user ) { final com.google.gerrit.server.project.ProjectState pe = projectCache.get ( branchName.getParentKey ( ) ) ; if ( pe == null ) { return false ; } final com.google.gerrit.server.project.ProjectControl pc = pe.controlFor ( user ) ; return pc.controlForRef ( branchName ) . isVisible ( ) ; }

Target:
private boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.CurrentUser user , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.project.ProjectState pe = projectCache.get ( change.getProject ( ) ) ; if ( pe == null ) { return false ; } com.google.gerrit.server.project.ProjectControl pc = pe.controlFor ( user ) ; return pc.controlFor ( change ) . isVisible ( db ) ; }
Source:
public boolean isPatchVisible ( com.google.gerrit.reviewdb.PatchSet ps , com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { if ( ( ps.isDraft ( ) ) && ( ! ( isDraftVisible ( db ) ) ) ) { return false ; } return isVisible ( db ) ; }

Target:
public boolean isPatchVisible ( com.google.gerrit.reviewdb.client.PatchSet ps , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { if ( ( ps.isDraft ( ) ) && ( ! ( isDraftVisible ( db ) ) ) ) { return false ; } return isVisible ( db ) ; }
Source:
private static void publish ( final com.google.gerrit.reviewdb.client.PatchSet.Id ps ) { java.lang.String token = com.google.gerrit.client.Dispatcher.toPublish ( ps ) ; new com.google.gerrit.client.Dispatcher.AsyncSplit ( token ) { public void onSuccess ( ) { com.google.gerrit.client.Gerrit.display ( this . token , select ( ) ) ; } private com.google.gerrit.client.ui.Screen select ( ) { return new com.google.gerrit.client.changes.PublishCommentScreen ( ps ) ; } } . onSuccess ( ) ; }

Target:
private static void publish ( final com.google.gerrit.reviewdb.client.PatchSet.Id ps ) { java.lang.String token = com.google.gerrit.client.Dispatcher.toPublish ( ps ) ; new com.google.gerrit.client.Dispatcher.AsyncSplit ( token ) { public void onSuccess ( ) { com.google.gerrit.client.Gerrit.display ( token , select ( ) ) ; } private com.google.gerrit.client.ui.Screen select ( ) { return new com.google.gerrit.client.changes.PublishCommentScreen ( ps ) ; } } . onSuccess ( ) ; }
Source:
private java.util.List < com.google.gerrit.reviewdb.client.PatchLineComment > byCommentStatus ( com.google.gwtorm.server.ResultSet < com.google.gerrit.reviewdb.client.PatchLineComment > comments , final com.google.gerrit.reviewdb.client.PatchLineComment.Status status ) throws com.google.gwtorm.server.OrmException { return com.google.common.collect.Lists.newArrayList ( com.google.common.collect.Iterables.filter ( comments , new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchLineComment > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.PatchLineComment input ) { return ( input.getStatus ( ) ) == status ; } } ) ) ; }

Target:
private static java.util.List < com.google.gerrit.reviewdb.client.PatchLineComment > byCommentStatus ( com.google.gwtorm.server.ResultSet < com.google.gerrit.reviewdb.client.PatchLineComment > comments , final com.google.gerrit.reviewdb.client.PatchLineComment.Status status ) { return com.google.common.collect.Lists.newArrayList ( com.google.common.collect.Iterables.filter ( comments , new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchLineComment > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.PatchLineComment input ) { return ( input.getStatus ( ) ) == status ; } } ) ) ; }
Source:
public static com.google.gerrit.extensions.common.GroupOptionsInfo createOptions ( com.google.gerrit.common.data.GroupDescription.Basic group ) { com.google.gerrit.extensions.common.GroupOptionsInfo options = new com.google.gerrit.extensions.common.GroupOptionsInfo ( ) ; if ( ( com.google.gerrit.server.group.GroupJson.isInternalGroup ( group ) ) && ( ( ( com.google.gerrit.common.data.GroupDescription.Internal ) ( group ) ) . isVisibleToAll ( ) ) ) { options.visibleToAll = true ; } return options ; }

Target:
public static com.google.gerrit.extensions.common.GroupOptionsInfo createOptions ( com.google.gerrit.common.data.GroupDescription.Basic group ) { com.google.gerrit.extensions.common.GroupOptionsInfo options = new com.google.gerrit.extensions.common.GroupOptionsInfo ( ) ; if ( ( group instanceof com.google.gerrit.common.data.GroupDescription.Internal ) && ( ( ( com.google.gerrit.common.data.GroupDescription.Internal ) ( group ) ) . isVisibleToAll ( ) ) ) { options.visibleToAll = true ; } return options ; }
Source:
void display ( final java.util.List < com.google.gerrit.reviewdb.Branch > result ) { canDelete = false ; while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.reviewdb.Branch k : result ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , k ) ; } }

Target:
void display ( final java.util.List < com.google.gerrit.reviewdb.client.Branch > result ) { canDelete = false ; while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.reviewdb.client.Branch k : result ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , k ) ; } }
Source:
private static void updateHeadLocally ( org.eclipse.jgit.transport.URIish uri , java.lang.String newHead ) { try { org.eclipse.jgit.lib.Repository repo = new org.eclipse.jgit.internal.storage.file.FileRepository ( uri.getPath ( ) ) ; try { if ( newHead != null ) { org.eclipse.jgit.lib.RefUpdate u = repo.updateRef ( Constants.HEAD ) ; u.link ( newHead ) ; } } finally { repo.close ( ) ; } } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.error ( java.lang.String.format ( "Failed to update HEAD of repository %s to %s" , uri.getPath ( ) , newHead ) , e ) ; } }

Target:
private static void updateHeadLocally ( org.eclipse.jgit.transport.URIish uri , java.lang.String newHead ) { try ( org.eclipse.jgit.lib.Repository repo = new org.eclipse.jgit.internal.storage.file.FileRepository ( uri.getPath ( ) ) ) { if ( newHead != null ) { org.eclipse.jgit.lib.RefUpdate u = repo.updateRef ( Constants.HEAD ) ; u.link ( newHead ) ; } } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.error ( java.lang.String.format ( "Failed to update HEAD of repository %s to %s" , uri.getPath ( ) , newHead ) , e ) ; } }
Source:
public com.google.gerrit.common.data.Capable canPushToAtLeastOneRef ( ) { if ( ( ( ! ( canPerformOnAnyRef ( Permission.PUSH ) ) ) && ( ! ( canPerformOnAnyRef ( Permission.CREATE_TAG ) ) ) ) && ( ! ( isOwner ( ) ) ) ) { java.lang.String pName = state.getProject ( ) . getName ( ) ; return new com.google.gerrit.common.data.Capable ( ( ( "Upload denied for project '" + pName ) + "'" ) ) ; } if ( state.isUseContributorAgreements ( ) ) { return verifyActiveContributorAgreement ( ) ; } return com.google.gerrit.common.data.Capable.OK ; }

Target:
public com.google.gerrit.common.data.Capable canPushToAtLeastOneRef ( ) { if ( ( ( ! ( canPerformOnAnyRef ( Permission.PUSH ) ) ) && ( ! ( canPerformOnAnyRef ( Permission.CREATE_TAG ) ) ) ) && ( ! ( isOwner ( ) ) ) ) { return new com.google.gerrit.common.data.Capable ( ( ( "Upload denied for project '" + ( state.getName ( ) ) ) + "'" ) ) ; } return com.google.gerrit.common.data.Capable.OK ; }
Source:
private void initSignedPush ( ) { boolean def = flags.cfg.getBoolean ( com.google.gerrit.pgm.init.InitAuth.RECEIVE , com.google.gerrit.pgm.init.InitAuth.ENABLE_SIGNED_PUSH , false ) ; boolean enable = ui.yesno ( def , "Enable signed push support" ) ; receive.set ( "enableSignedPush" , java.lang.Boolean.toString ( enable ) ) ; if ( enable ) { libraries.bouncyCastleProvider.downloadRequired ( ) ; libraries.bouncyCastlePGP.downloadRequired ( ) ; } }

Target:
private void initSignedPush ( ) { boolean def = flags.cfg.getBoolean ( com.google.gerrit.pgm.init.InitAuth.RECEIVE , com.google.gerrit.pgm.init.InitAuth.ENABLE_SIGNED_PUSH , false ) ; boolean enable = ui.yesno ( def , "Enable signed push support" ) ; receive.set ( "enableSignedPush" , java.lang.Boolean.toString ( enable ) ) ; }
Source:
public com.google.gerrit.reviewdb.AccountSshKey create ( com.google.gerrit.reviewdb.AccountSshKey.Id id , java.lang.String encoded ) throws com.google.gerrit.common.errors.InvalidSshKeyException { try { final com.google.gerrit.reviewdb.AccountSshKey key = new com.google.gerrit.reviewdb.AccountSshKey ( id , com.google.gerrit.sshd.SshUtil.toOpenSshPublicKey ( encoded ) ) ; com.google.gerrit.sshd.SshUtil.parse ( key ) ; return key ; } catch ( java.security.NoSuchAlgorithmException e ) { throw new com.google.gerrit.common.errors.InvalidSshKeyException ( ) ; } catch ( java.security.spec.InvalidKeySpecException e ) { throw new com.google.gerrit.common.errors.InvalidSshKeyException ( ) ; } catch ( java.security.NoSuchProviderException e ) { com.google.gerrit.sshd.SshKeyCacheImpl.log.error ( "Cannot parse SSH key" , e ) ; throw new com.google.gerrit.common.errors.InvalidSshKeyException ( ) ; } }

Target:
public com.google.gerrit.reviewdb.AccountSshKey create ( com.google.gerrit.reviewdb.AccountSshKey.Id id , java.lang.String encoded ) throws com.google.gerrit.common.errors.InvalidSshKeyException { try { encoded = com.google.gerrit.sshd.SshUtil.toOpenSshPublicKey ( encoded ) ; com.google.gerrit.reviewdb.AccountSshKey key = new com.google.gerrit.reviewdb.AccountSshKey ( id , encoded ) ; com.google.gerrit.sshd.SshUtil.parse ( key ) ; return key ; } catch ( java.security.NoSuchAlgorithmException e ) { throw new com.google.gerrit.common.errors.InvalidSshKeyException ( ) ; } catch ( java.security.spec.InvalidKeySpecException e ) { throw new com.google.gerrit.common.errors.InvalidSshKeyException ( ) ; } catch ( java.security.NoSuchProviderException e ) { com.google.gerrit.sshd.SshKeyCacheImpl.log.error ( "Cannot parse SSH key" , e ) ; throw new com.google.gerrit.common.errors.InvalidSshKeyException ( ) ; } }
Source:
private void deleteProject ( org.eclipse.jgit.transport.URIish replicateURI ) { if ( ! ( replicateURI.isRemote ( ) ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.deleteLocally ( replicateURI ) ; com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.info ( ( "Deleted local repository: " + replicateURI ) ) ; } else if ( com.googlesource.gerrit.plugins.replication.ReplicationQueue.isSSH ( replicateURI ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.deleteRemoteSsh ( replicateURI ) ; com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.info ( ( "Deleted remote repository: " + replicateURI ) ) ; } else { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.warn ( java.lang.String.format ( ( "Cannot delete project on remote site %s." + ( " Only local paths and SSH URLs are supported" + " for remote repository deletion" ) ) , replicateURI ) ) ; } }

Target:
private void deleteProject ( org.eclipse.jgit.transport.URIish replicateURI ) { if ( ! ( replicateURI.isRemote ( ) ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.deleteLocally ( replicateURI ) ; com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.info ( ( "Deleted local repository: " + replicateURI ) ) ; } else if ( com.googlesource.gerrit.plugins.replication.ReplicationQueue.isSSH ( replicateURI ) ) { deleteRemoteSsh ( replicateURI ) ; com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.info ( ( "Deleted remote repository: " + replicateURI ) ) ; } else { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.warn ( java.lang.String.format ( ( "Cannot delete project on remote site %s." + ( " Only local paths and SSH URLs are supported" + " for remote repository deletion" ) ) , replicateURI ) ) ; } }
Source:
protected org.apache.lucene.search.IndexSearcher refreshIfNeeded ( org.apache.lucene.search.IndexSearcher referenceToRefresh ) throws java.io.IOException { final org.apache.lucene.index.IndexReader r = referenceToRefresh.getIndexReader ( ) ; assert r instanceof org.apache.lucene.index.DirectoryReader : "searcher's IndexReader should be a DirectoryReader, but got " + r ; final org.apache.lucene.index.IndexReader newReader = org.apache.lucene.index.DirectoryReader.openIfChanged ( ( ( org.apache.lucene.index.DirectoryReader ) ( r ) ) ) ; if ( newReader == null ) { return null ; } else { return com.google.gerrit.lucene.WrappableSearcherManager.getSearcher ( searcherFactory , newReader ) ; } }

Target:
protected org.apache.lucene.search.IndexSearcher refreshIfNeeded ( org.apache.lucene.search.IndexSearcher referenceToRefresh ) throws java.io.IOException { final org.apache.lucene.index.IndexReader r = referenceToRefresh.getIndexReader ( ) ; assert r instanceof org.apache.lucene.index.DirectoryReader : "searcher's IndexReader should be a DirectoryReader, but got " + r ; final org.apache.lucene.index.IndexReader newReader = org.apache.lucene.index.DirectoryReader.openIfChanged ( ( ( org.apache.lucene.index.DirectoryReader ) ( r ) ) ) ; if ( newReader == null ) { return null ; } return com.google.gerrit.lucene.WrappableSearcherManager.getSearcher ( searcherFactory , newReader ) ; }
Source:
public void testFindReplace ( ) { final java.lang.String find = "find" ; final java.lang.String replace = "replace" ; final com.google.gwtexpui.safehtml.client.RawFindReplace a = new com.google.gwtexpui.safehtml.client.RawFindReplace ( find , replace ) ; assertEquals ( find , a.pattern ( ) . getSource ( ) ) ; assertEquals ( replace , a.replace ( find ) ) ; assertEquals ( ( ( ( "find = " + find ) + ", replace = " ) + replace ) , a.toString ( ) ) ; }

Target:
public void testFindReplace ( ) { final java.lang.String find = "find" ; final java.lang.String replace = "replace" ; final com.google.gwtexpui.safehtml.client.RawFindReplace a = new com.google.gwtexpui.safehtml.client.RawFindReplace ( find , replace ) ; org.junit.Assert.assertEquals ( find , a.pattern ( ) . getSource ( ) ) ; org.junit.Assert.assertEquals ( replace , a.replace ( find ) ) ; org.junit.Assert.assertEquals ( ( ( ( "find = " + find ) + ", replace = " ) + replace ) , a.toString ( ) ) ; }
Source:
public void mergeByOwnerCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS , com.google.gerrit.server.account.WatchConfig.NotifyType.SUBMITTED_CHANGES ) ; merge ( sc.changeId , sc.owner , EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "merged" , sc ) . to ( sc.owner ) . to ( sc.reviewerByEmail ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS , com.google.gerrit.server.account.WatchConfig.NotifyType.SUBMITTED_CHANGES ) ; }

Target:
public void mergeByOwnerCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS , com.google.gerrit.server.account.WatchConfig.NotifyType.SUBMITTED_CHANGES ) ; merge ( sc.changeId , sc.owner , EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "merged" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS , com.google.gerrit.server.account.WatchConfig.NotifyType.SUBMITTED_CHANGES ) ; }
Source:
public com.google.gerrit.common.data.AccountInfoCache create ( ) { final java.util.List < com.google.gerrit.common.data.AccountInfo > r = new java.util.ArrayList < com.google.gerrit.common.data.AccountInfo > ( out.size ( ) ) ; for ( final com.google.gerrit.reviewdb.client.Account a : out.values ( ) ) { r.add ( new com.google.gerrit.common.data.AccountInfo ( a ) ) ; } return new com.google.gerrit.common.data.AccountInfoCache ( r ) ; }

Target:
public com.google.gerrit.common.data.AccountInfoCache create ( ) { final java.util.List < com.google.gerrit.common.data.AccountInfo > r = new java.util.ArrayList ( out.size ( ) ) ; for ( final com.google.gerrit.reviewdb.client.Account a : out.values ( ) ) { r.add ( new com.google.gerrit.common.data.AccountInfo ( a ) ) ; } return new com.google.gerrit.common.data.AccountInfoCache ( r ) ; }
Source:
public com.google.gerrit.extensions.common.RevisionInfo getRevisionInfo ( com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet in ) throws com.google.gerrit.server.GpgException , com.google.gerrit.server.patch.PatchListNotAvailableException , com.google.gwtorm.server.OrmException , java.io.IOException { accountLoader = accountLoaderFactory.create ( has ( com.google.gerrit.extensions.client.ListChangesOption.DETAILED_ACCOUNTS ) ) ; try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( ctl.getProject ( ) . getNameKey ( ) ) ) { com.google.gerrit.extensions.common.RevisionInfo rev = toRevisionInfo ( ctl , changeDataFactory.create ( db.get ( ) , ctl ) , in , repo ) ; accountLoader.fill ( ) ; return rev ; } }

Target:
public com.google.gerrit.extensions.common.RevisionInfo getRevisionInfo ( com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet in ) throws com.google.gerrit.server.GpgException , com.google.gerrit.server.patch.PatchListNotAvailableException , com.google.gwtorm.server.OrmException , java.io.IOException { accountLoader = accountLoaderFactory.create ( has ( com.google.gerrit.extensions.client.ListChangesOption.DETAILED_ACCOUNTS ) ) ; try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( ctl.getProject ( ) . getNameKey ( ) ) ) { com.google.gerrit.extensions.common.RevisionInfo rev = toRevisionInfo ( ctl , changeDataFactory.create ( db.get ( ) , ctl ) , in , repo , true ) ; accountLoader.fill ( ) ; return rev ; } }
Source:
public java.lang.Iterable < com.google.gerrit.server.plugins.Plugin > getPlugins ( boolean all ) { if ( ! all ) { return running.values ( ) ; } else { java.util.ArrayList < com.google.gerrit.server.plugins.Plugin > plugins = new java.util.ArrayList < com.google.gerrit.server.plugins.Plugin > ( running.values ( ) ) ; plugins.addAll ( disabled.values ( ) ) ; return plugins ; } }

Target:
public java.lang.Iterable < com.google.gerrit.server.plugins.Plugin > getPlugins ( boolean all ) { if ( ! all ) { return running.values ( ) ; } else { java.util.List < com.google.gerrit.server.plugins.Plugin > plugins = new java.util.ArrayList ( running.values ( ) ) ; plugins.addAll ( disabled.values ( ) ) ; return plugins ; } }
Source:
protected void onOpenRow ( final int row ) { final com.google.gerrit.client.changes.ChangeInfo c = getRowItem ( row ) ; final com.google.gerrit.reviewdb.client.Change.Id id = c.legacy_id ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( id ) , new com.google.gerrit.client.changes.ChangeScreen ( id ) ) ; }

Target:
protected void onOpenRow ( final int row ) { final com.google.gerrit.client.changes.ChangeInfo c = getRowItem ( row ) ; final com.google.gerrit.reviewdb.client.Change.Id id = c.legacy_id ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( id ) ) ; }
Source:
private void loadBase ( java.lang.String notesBranch ) throws java.io.IOException { org.eclipse.jgit.lib.Ref branch = db.getRef ( notesBranch ) ; if ( branch != null ) { baseCommit = revWalk.parseCommit ( branch.getObjectId ( ) ) ; base = org.eclipse.jgit.notes.NoteMap.read ( revWalk.getObjectReader ( ) , baseCommit ) ; } if ( ( baseCommit ) != null ) { ours = org.eclipse.jgit.notes.NoteMap.read ( db.newObjectReader ( ) , baseCommit ) ; } else { ours = org.eclipse.jgit.notes.NoteMap.newEmptyMap ( ) ; } }

Target:
private void loadBase ( java.lang.String notesBranch ) throws java.io.IOException { org.eclipse.jgit.lib.Ref branch = db.getRef ( notesBranch ) ; if ( branch != null ) { baseCommit = revWalk.parseCommit ( branch.getObjectId ( ) ) ; base = org.eclipse.jgit.notes.NoteMap.read ( revWalk.getObjectReader ( ) , baseCommit ) ; } if ( ( baseCommit ) != null ) { ours = org.eclipse.jgit.notes.NoteMap.read ( revWalk.getObjectReader ( ) , baseCommit ) ; } else { ours = org.eclipse.jgit.notes.NoteMap.newEmptyMap ( ) ; } }
Source:
boolean add ( final java.lang.Runnable newTask ) { synchronized ( this ) { if ( ( ! ( shutdownStarted ) ) && ( ! ( shutdownComplete ) ) ) { if ( tasks.isEmpty ( ) ) { java.lang.Runtime.getRuntime ( ) . addShutdownHook ( this ) ; } tasks.add ( newTask ) ; return true ; } else { return false ; } } }

Target:
boolean add ( final java.lang.Runnable newTask ) { synchronized ( this ) { if ( ( ! ( shutdownStarted ) ) && ( ! ( shutdownComplete ) ) ) { if ( tasks.isEmpty ( ) ) { java.lang.Runtime.getRuntime ( ) . addShutdownHook ( this ) ; } tasks.add ( newTask ) ; return true ; } return false ; } }
Source:
public void stop ( ) { com.ericsson.gerrit.plugins.highavailability.peers.jgroups.JGroupsPeerInfoProvider.log.info ( "closing jgroups channel (cluster {})" , channel.getName ( ) , jgroupsConfig.clusterName ( ) ) ; channel.close ( ) ; peerInfo = java.util.Optional.empty ( ) ; peerAddress = null ; }

Target:
public void stop ( ) { if ( ( channel ) != null ) { com.ericsson.gerrit.plugins.highavailability.peers.jgroups.JGroupsPeerInfoProvider.log.info ( "closing jgroups channel (cluster {})" , channel.getName ( ) , jgroupsConfig.clusterName ( ) ) ; channel.close ( ) ; } peerInfo = java.util.Optional.empty ( ) ; peerAddress = null ; }
Source:
private com.google.gerrit.server.project.ProjectControl user ( com.google.gerrit.reviewdb.AccountGroup ... memberOf ) { com.google.gerrit.server.project.RefControl.Factory refControlFactory = new com.google.gerrit.server.project.RefControl.Factory ( ) { @ java.lang.Override public com.google.gerrit.server.project.RefControl create ( final com.google.gerrit.server.project.ProjectControl projectControl , final java.lang.String ref ) { return new com.google.gerrit.server.project.RefControl ( systemConfig , projectControl , ref ) ; } } ; return new com.google.gerrit.server.project.ProjectControl ( java.util.Collections.< com.google.gerrit.reviewdb.AccountGroup.Id > emptySet ( ) , java.util.Collections.< com.google.gerrit.reviewdb.AccountGroup.Id > emptySet ( ) , refControlFactory , new com.google.gerrit.server.project.RefControlTest.MockUser ( memberOf ) , newProjectState ( ) ) ; }

Target:
private com.google.gerrit.server.project.ProjectControl user ( com.google.gerrit.reviewdb.AccountGroup ... memberOf ) { com.google.gerrit.server.project.RefControl.Factory refControlFactory = new com.google.gerrit.server.project.RefControl.Factory ( ) { @ java.lang.Override public com.google.gerrit.server.project.RefControl create ( final com.google.gerrit.server.project.ProjectControl projectControl , final java.lang.String ref ) { return new com.google.gerrit.server.project.RefControl ( systemConfig , projectControl , ref ) ; } } ; return new com.google.gerrit.server.project.ProjectControl ( systemConfig , java.util.Collections.< com.google.gerrit.reviewdb.AccountGroup.Id > emptySet ( ) , java.util.Collections.< com.google.gerrit.reviewdb.AccountGroup.Id > emptySet ( ) , refControlFactory , new com.google.gerrit.server.project.RefControlTest.MockUser ( memberOf ) , newProjectState ( ) ) ; }
Source:
protected void configure ( ) { factory ( AddBranch.Factory.class ) ; factory ( ChangeProjectAccess.Factory.class ) ; factory ( ReviewProjectAccess.Factory.class ) ; factory ( ChangeProjectSettings.Factory.class ) ; factory ( DeleteBranches.Factory.class ) ; factory ( ListBranches.Factory.class ) ; factory ( VisibleProjectDetails.Factory.class ) ; factory ( ProjectAccessFactory.Factory.class ) ; factory ( ProjectDetailFactory.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( ChangeProjectAccess.Factory.class ) ; factory ( ReviewProjectAccess.Factory.class ) ; factory ( ChangeProjectSettings.Factory.class ) ; factory ( DeleteBranches.Factory.class ) ; factory ( ListBranches.Factory.class ) ; factory ( VisibleProjectDetails.Factory.class ) ; factory ( ProjectAccessFactory.Factory.class ) ; factory ( ProjectDetailFactory.Factory.class ) ; }
Source:
private java.util.List < com.google.gerrit.common.data.SubmitRecord > ruleError ( java.lang.String err ) { if ( logErrors ) { com.google.gerrit.server.project.SubmitRuleEvaluator.log.error ( err ) ; return com.google.gerrit.server.project.SubmitRuleEvaluator.defaultRuleError ( ) ; } else { return com.google.gerrit.server.project.SubmitRuleEvaluator.createRuleError ( err ) ; } }

Target:
private java.util.List < com.google.gerrit.common.data.SubmitRecord > ruleError ( java.lang.String err , java.lang.Exception e ) { if ( logErrors ) { if ( e == null ) { com.google.gerrit.server.project.SubmitRuleEvaluator.log.error ( err ) ; } else { com.google.gerrit.server.project.SubmitRuleEvaluator.log.error ( err , e ) ; } return com.google.gerrit.server.project.SubmitRuleEvaluator.defaultRuleError ( ) ; } else { return com.google.gerrit.server.project.SubmitRuleEvaluator.createRuleError ( err ) ; } }
Source:
protected void setUp ( ) throws java.lang.Exception { repo = new org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.DfsRepository > ( new org.eclipse.jgit.internal.storage.dfs.InMemoryRepository ( new org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription ( "test" ) ) ) ; servlet = new com.google.gitiles.RepositoryIndexServlet ( new com.google.gitiles.TestGitilesAccess ( repo.getRepository ( ) ) , new com.google.gitiles.DefaultRenderer ( ) , new com.google.gitiles.DateFormatterBuilder ( com.google.common.base.Optional.< java.util.TimeZone > absent ( ) ) , new com.google.gitiles.TimeCache ( ) ) ; }

Target:
protected void setUp ( ) throws java.lang.Exception { repo = new org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.DfsRepository > ( new org.eclipse.jgit.internal.storage.dfs.InMemoryRepository ( new org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription ( "test" ) ) ) ; servlet = new com.google.gitiles.RepositoryIndexServlet ( new com.google.gitiles.TestGitilesAccess ( repo.getRepository ( ) ) , new com.google.gitiles.DefaultRenderer ( ) , new com.google.gitiles.TimeCache ( ) ) ; }
Source:
private com.google.gerrit.httpd.raw.StaticModule.Paths getPaths ( ) { if ( ( paths ) == null ) { try { paths = new com.google.gerrit.httpd.raw.StaticModule.Paths ( ) ; } catch ( java.io.IOException e ) { com.google.inject.ProvisionException pe = new com.google.inject.ProvisionException ( "Error initializing static content paths" ) ; pe.initCause ( e ) ; throw pe ; } } return paths ; }

Target:
private com.google.gerrit.httpd.raw.StaticModule.Paths getPaths ( ) { if ( ( paths ) == null ) { paths = new com.google.gerrit.httpd.raw.StaticModule.Paths ( ) ; } return paths ; }
Source:
private void assertCreateSucceeds ( com.google.gerrit.reviewdb.client.Branch.NameKey branch ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.BranchInfo created = branch ( branch ) . create ( new com.google.gerrit.extensions.api.projects.BranchInput ( ) ) . get ( ) ; com.google.common.truth.Truth.assertThat ( created.ref ) . isEqualTo ( ( ( org.eclipse.jgit.lib.Constants.R_HEADS ) + ( branch.getShortName ( ) ) ) ) ; }

Target:
private void assertCreateSucceeds ( com.google.gerrit.reviewdb.client.Branch.NameKey branch ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.BranchInfo created = branch ( branch ) . create ( new com.google.gerrit.extensions.api.projects.BranchInput ( ) ) . get ( ) ; com.google.common.truth.Truth.assertThat ( created.ref ) . isEqualTo ( branch.get ( ) ) ; }
Source:
public static com.google.gerrit.reviewdb.client.PatchSet.Id parseIdent ( org.eclipse.jgit.lib.PersonIdent ident , com.google.gerrit.reviewdb.client.Change.Id changeId ) 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 com.google.gerrit.server.notedb.ChangeNotes.parseException ( changeId , "invalid identity, expected <id>@%s: %s" , com.google.gerrit.server.notedb.ChangeNoteUtil.GERRIT_PLACEHOLDER_HOST , email ) ; }

Target:
public static Account.Id parseIdent ( org.eclipse.jgit.lib.PersonIdent ident , com.google.gerrit.reviewdb.client.Change.Id changeId ) 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 com.google.gerrit.server.notedb.ChangeNotes.parseException ( changeId , "invalid identity, expected <id>@%s: %s" , com.google.gerrit.server.notedb.ChangeNoteUtil.GERRIT_PLACEHOLDER_HOST , email ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; codeReview = com.google.common.base.Preconditions.checkNotNull ( cfg.getLabelSections ( ) . get ( "Code-Review" ) ) ; codeReview.setCopyMinScore ( false ) ; codeReview.setCopyMaxScore ( false ) ; codeReview.setCopyAllScoresOnTrivialRebase ( false ) ; codeReview.setCopyAllScoresIfNoCodeChange ( false ) ; codeReview.setCopyAllScoresIfNoChange ( false ) ; codeReview.setDefaultValue ( ( ( short ) ( - 1 ) ) ) ; saveProjectConfig ( cfg ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; codeReview = com.google.common.base.Preconditions.checkNotNull ( cfg.getLabelSections ( ) . get ( "Code-Review" ) ) ; codeReview.setDefaultValue ( ( ( short ) ( - 1 ) ) ) ; saveProjectConfig ( cfg ) ; }
Source:
public PatchSet.Id call ( ) throws com.google.gwtorm.server.OrmException { try { if ( caller == ( java.lang.Thread.currentThread ( ) ) ) { return insertPatchSet ( db ) ; } else { com.google.gerrit.reviewdb.server.ReviewDb db = schemaFactory.open ( ) ; try { return insertPatchSet ( db ) ; } finally { db.close ( ) ; } } } finally { synchronized ( newProgress ) { replaceProgress.update ( 1 ) ; } } }

Target:
public PatchSet.Id call ( ) throws com.google.gwtorm.server.OrmException { try { if ( caller == ( java.lang.Thread.currentThread ( ) ) ) { return insertPatchSet ( db ) ; } else { com.google.gerrit.reviewdb.server.ReviewDb db = schemaFactory.open ( ) ; try { return insertPatchSet ( db ) ; } finally { db.close ( ) ; } } } finally { synchronized ( replaceProgress ) { replaceProgress.update ( 1 ) ; } } }
Source:
public T call ( ) throws java.lang.Exception { final com.google.gerrit.server.CurrentUser user = context.getCurrentUser ( ) ; com.google.gerrit.server.util.RequestContext old = local.setContext ( new com.google.gerrit.server.util.RequestContext ( ) { @ java.lang.Override public com.google.gerrit.server.CurrentUser getCurrentUser ( ) { return user ; } @ java.lang.Override public com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > getReviewDbProvider ( ) { return dbProviderProvider.get ( ) ; } } ) ; try { return callable.call ( ) ; } finally { local.setContext ( old ) ; } }

Target:
public T call ( ) throws java.lang.Exception { com.google.gerrit.server.util.RequestContext old = local.setContext ( new com.google.gerrit.server.util.RequestContext ( ) { @ java.lang.Override public com.google.gerrit.server.CurrentUser getCurrentUser ( ) { return context.getCurrentUser ( ) ; } @ java.lang.Override public com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > getReviewDbProvider ( ) { return dbProviderProvider.get ( ) ; } } ) ; try { return callable.call ( ) ; } finally { local.setContext ( old ) ; } }
Source:
public void basicTextFormattingWorks ( ) throws java.io.IOException { java.lang.String raw = "*italic* **bold** `monospace`" ; java.lang.String formatted = ( ( com.googlesource.gerrit.plugins.xdocs.formatter.MarkdownFormatterTest.PROLOG ) + "<em>italic</em> <strong>bold</strong> <code>monospace</code>" ) + ( com.googlesource.gerrit.plugins.xdocs.formatter.MarkdownFormatterTest.EPILOG ) ; org.junit.Assert.assertEquals ( formatter.format ( null , null , null , null , cfg , raw ) , formatted ) ; }

Target:
public void basicTextFormattingWorks ( ) throws java.io.IOException { java.lang.String raw = "*italic* **bold** `monospace`" ; java.lang.String formatted = ( ( com.googlesource.gerrit.plugins.xdocs.formatter.MarkdownFormatterTest.PROLOG ) + "<em>italic</em> <strong>bold</strong> <code>monospace</code>" ) + ( com.googlesource.gerrit.plugins.xdocs.formatter.MarkdownFormatterTest.EPILOG ) ; org.junit.Assert.assertEquals ( formatted , formatter.format ( null , null , null , null , cfg , raw ) ) ; }
Source:
private java.lang.String url ( com.google.gerrit.client.info.FileInfo info ) { return info.binary ( ) ? com.google.gerrit.client.Dispatcher.toUnified ( base , curr , info.path ( ) ) : ( mode ) == ( com.google.gerrit.client.change.FileTable.Mode.REVIEW ) ? com.google.gerrit.client.Dispatcher.toPatch ( base , curr , info.path ( ) ) : com.google.gerrit.client.Dispatcher.toEditScreen ( curr , info.path ( ) ) ; }

Target:
private java.lang.String url ( com.google.gerrit.client.info.FileInfo info ) { return info.binary ( ) ? com.google.gerrit.client.Dispatcher.toUnified ( project , base , curr , info.path ( ) ) : ( mode ) == ( com.google.gerrit.client.change.FileTable.Mode.REVIEW ) ? com.google.gerrit.client.Dispatcher.toPatch ( project , base , curr , info.path ( ) ) : com.google.gerrit.client.Dispatcher.toEditScreen ( project , curr , info.path ( ) ) ; }
Source:
protected void assertSubmittable ( java.lang.String changeId ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( gApi.changes ( ) . id ( changeId ) . info ( ) . submittable ) . named ( "submit bit on ChangeInfo" ) . isEqualTo ( true ) ; com.google.gerrit.server.change.RevisionResource rsrc = parseCurrentRevisionResource ( changeId ) ; com.google.gerrit.extensions.webui.UiAction.Description desc = submitHandler.getDescription ( rsrc ) ; com.google.common.truth.Truth.assertThat ( desc.isVisible ( ) ) . named ( "visible bit on submit action" ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( desc.isEnabled ( ) ) . named ( "enabled bit on submit action" ) . isTrue ( ) ; }

Target:
protected void assertSubmittable ( java.lang.String changeId ) throws java.lang.Exception { com.google.gerrit.server.change.RevisionResource rsrc = parseCurrentRevisionResource ( changeId ) ; com.google.gerrit.extensions.webui.UiAction.Description desc = submitHandler.getDescription ( rsrc ) ; com.google.common.truth.Truth.assertThat ( desc.isVisible ( ) ) . named ( "visible bit on submit action" ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( desc.isEnabled ( ) ) . named ( "enabled bit on submit action" ) . isTrue ( ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.account.EmailInfo result ) { box.hide ( ) ; if ( com.google.gerrit.client.Gerrit.getServerInfo ( ) . auth ( ) . isDev ( ) ) { currentEmail = addr ; if ( ( emailPick.getItemCount ( ) ) == 0 ) { final com.google.gerrit.reviewdb.client.Account me = com.google.gerrit.client.Gerrit.getUserAccount ( ) ; me.setPreferredEmail ( addr ) ; onSaveSuccess ( me ) ; } else { save.setEnabled ( true ) ; } updateEmailList ( ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.account.EmailInfo result ) { box.hide ( ) ; if ( com.google.gerrit.client.Gerrit.info ( ) . auth ( ) . isDev ( ) ) { currentEmail = addr ; if ( ( emailPick.getItemCount ( ) ) == 0 ) { final com.google.gerrit.reviewdb.client.Account me = com.google.gerrit.client.Gerrit.getUserAccount ( ) ; me.setPreferredEmail ( addr ) ; onSaveSuccess ( me ) ; } else { save.setEnabled ( true ) ; } updateEmailList ( ) ; } }
Source:
public void onSuccess ( com.googlesource.gerrit.plugins.serviceuser.client.CreateServiceUserForm.MessagesInfo info ) { onSuccessMessage = info.getOnSuccessMessage ( ) ; java.lang.String infoMessage = info.getInfoMessage ( ) ; if ( ( infoMessage != null ) && ( ! ( "" . equals ( infoMessage ) ) ) ) { p.insert ( new com.google.gwt.user.client.ui.HTML ( onSuccessMessage ) , 0 ) ; } }

Target:
public void onSuccess ( com.googlesource.gerrit.plugins.serviceuser.client.CreateServiceUserForm.MessagesInfo info ) { onSuccessMessage = info.getOnSuccessMessage ( ) ; java.lang.String infoMessage = info.getInfoMessage ( ) ; if ( ( infoMessage != null ) && ( ! ( "" . equals ( infoMessage ) ) ) ) { p.insert ( new com.google.gwt.user.client.ui.HTML ( infoMessage ) , 0 ) ; } }
Source:
public com.google.gerrit.reviewdb.client.Account findByNameOrEmail ( final java.lang.String nameOrEmail ) throws com.google.gwtorm.server.OrmException { java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > r = findAllByNameOrEmail ( nameOrEmail ) ; return ( r.size ( ) ) == 1 ? byId.get ( r.iterator ( ) . next ( ) ) . getAccount ( ) : null ; }

Target:
public com.google.gerrit.reviewdb.client.Account findByNameOrEmail ( com.google.gerrit.reviewdb.server.ReviewDb db , java.lang.String nameOrEmail ) throws com.google.gwtorm.server.OrmException { java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > r = findAllByNameOrEmail ( db , nameOrEmail ) ; return ( r.size ( ) ) == 1 ? byId.get ( r.iterator ( ) . next ( ) ) . getAccount ( ) : null ; }
Source:
public void setUp ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; com.google.gerrit.server.project.Util.block ( cfg , Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/drafts/*" ) ; saveProjectConfig ( cfg ) ; projectCache.evict ( cfg.getProject ( ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.server.project.Util.block ( cfg , Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/drafts/*" ) ; saveProjectConfig ( project , cfg ) ; }
Source:
public com.google.gerrit.server.change.ConsistencyChecker.Result check ( com.google.gerrit.server.query.change.ChangeData cd , @ com.google.gerrit.common.Nullable com.google.gerrit.extensions.api.changes.FixInput f ) { reset ( ) ; try { return check ( cd.change ( ) , f ) ; } catch ( com.google.gwtorm.server.OrmException e ) { error ( "Error looking up change" , e ) ; return com.google.gerrit.server.change.ConsistencyChecker.Result.create ( cd.getId ( ) , problems ) ; } }

Target:
private com.google.gerrit.reviewdb.client.Change change ( ) { return ctl.getChange ( ) ; }
Source:
private java.util.Set < java.lang.String > getRefNamesAllUsers ( java.lang.String prefix ) throws com.google.gwtorm.server.OrmException { org.eclipse.jgit.lib.Repository repo ; try { repo = repoManager.openRepository ( allUsers ) ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } try { org.eclipse.jgit.lib.RefDatabase refDb = repo.getRefDatabase ( ) ; return refDb.getRefs ( prefix ) . keySet ( ) ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } finally { repo.close ( ) ; } }

Target:
private java.util.Set < java.lang.String > getRefNamesAllUsers ( java.lang.String prefix ) throws com.google.gwtorm.server.OrmException { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allUsers ) ) { org.eclipse.jgit.lib.RefDatabase refDb = repo.getRefDatabase ( ) ; return refDb.getRefs ( prefix ) . keySet ( ) ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } }
Source:
public void onLoad ( com.google.gerrit.plugin.client.screen.Screen screen ) { java.lang.String projectName = com.google.gwt.http.client.URL.decode ( screen.getToken ( 1 ) ) ; java.lang.String revision = com.google.gwt.http.client.URL.decode ( screen.getToken ( 2 ) ) ; java.lang.String path = com.google.gwt.http.client.URL.decode ( screen.getToken ( 3 ) ) ; screen.show ( new com.googlesource.gerrit.plugins.xdocs.client.XDocScreen ( projectName , revision , path ) ) ; screen.setWindowTitle ( com.googlesource.gerrit.plugins.xdocs.client.FileInfo.getFileName ( path ) ) ; }

Target:
public void onLoad ( com.google.gerrit.plugin.client.screen.Screen screen ) { java.lang.String projectName = com.google.gwt.http.client.URL.decode ( screen.getToken ( 1 ) ) ; java.lang.String revision = com.google.gwt.http.client.URL.decode ( screen.getToken ( 2 ) ) ; java.lang.String path = screen.getToken ( 3 ) ; screen.show ( new com.googlesource.gerrit.plugins.xdocs.client.XDocScreen ( projectName , revision , path ) ) ; screen.setWindowTitle ( com.googlesource.gerrit.plugins.xdocs.client.FileInfo.getFileName ( path ) ) ; }