auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.server.events.ProjectCreatedEvent event , com.google.gerrit.server.CurrentUser user ) { com.google.gerrit.server.project.ProjectState pe = projectCache.get ( project ) ; if ( pe == null ) { return false ; } com.google.gerrit.server.project.ProjectControl pc = pe.controlFor ( user ) ; return pc.controlForRef ( event.getHeadName ( ) ) . isVisible ( ) ; }

Target:
private boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.server.CurrentUser user ) { com.google.gerrit.server.project.ProjectState pe = projectCache.get ( project ) ; if ( pe == null ) { return false ; } return pe.controlFor ( user ) . isVisible ( ) ; }
Source:
void testRelative ( java.lang.String a , java.lang.String b , java.lang.String want ) throws java.lang.Exception { java.lang.String got = com.googlesource.gerrit.plugins.supermanifest.JiriUpdater.relativize ( java.net.URI.create ( a ) , java.net.URI.create ( b ) ) . toString ( ) ; if ( ! ( got.equals ( want ) ) ) { org.junit.Assert.fail ( java.lang.String.format ( "relative('%s', '%s') = '%s', want '%s'" , a , b , got , want ) ) ; } }

Target:
void testRelative ( java.lang.String a , java.lang.String b , java.lang.String want ) throws java.lang.Exception { java.lang.String got = com.googlesource.gerrit.plugins.supermanifest.JiriUpdater.relativize ( java.net.URI.create ( a ) , java.net.URI.create ( b ) ) . toString ( ) ; if ( ! ( got.equals ( want ) ) ) { fail ( java.lang.String.format ( "relative('%s', '%s') = '%s', want '%s'" , a , b , got , want ) ) ; } }
Source:
private void assertProblems ( com.google.gerrit.gpg.testutil.TestKey tk , java.lang.String ... expected ) throws java.lang.Exception { com.google.gerrit.gpg.CheckResult result = checker.check ( tk.getPublicKey ( ) , tk.getKeyId ( ) ) ; org.junit.Assert.assertEquals ( java.util.Arrays.asList ( expected ) , result.getProblems ( ) ) ; }

Target:
private void assertProblems ( com.google.gerrit.gpg.testutil.TestKey tk , java.lang.String ... expected ) throws java.lang.Exception { com.google.gerrit.gpg.CheckResult result = checker.check ( tk.getPublicKey ( ) ) ; org.junit.Assert.assertEquals ( java.util.Arrays.asList ( expected ) , result.getProblems ( ) ) ; }
Source:
public com.google.gerrit.server.git.WorkQueue.Task.State getState ( ) { if ( isCancelled ( ) ) { return com.google.gerrit.server.git.WorkQueue.Task.State.CANCELLED ; } else if ( ( isDone ( ) ) && ( ! ( isPeriodic ( ) ) ) ) { return com.google.gerrit.server.git.WorkQueue.Task.State.DONE ; } else if ( running.get ( ) ) { return com.google.gerrit.server.git.WorkQueue.Task.State.RUNNING ; } final long delay = getDelay ( java.util.concurrent.TimeUnit.MILLISECONDS ) ; if ( delay <= 0 ) { return com.google.gerrit.server.git.WorkQueue.Task.State.READY ; } else { return com.google.gerrit.server.git.WorkQueue.Task.State.SLEEPING ; } }

Target:
public com.google.gerrit.server.git.WorkQueue.Task.State getState ( ) { if ( isCancelled ( ) ) { return com.google.gerrit.server.git.WorkQueue.Task.State.CANCELLED ; } else if ( ( isDone ( ) ) && ( ! ( isPeriodic ( ) ) ) ) { return com.google.gerrit.server.git.WorkQueue.Task.State.DONE ; } else if ( running.get ( ) ) { return com.google.gerrit.server.git.WorkQueue.Task.State.RUNNING ; } final long delay = getDelay ( java.util.concurrent.TimeUnit.MILLISECONDS ) ; if ( delay <= 0 ) { return com.google.gerrit.server.git.WorkQueue.Task.State.READY ; } return com.google.gerrit.server.git.WorkQueue.Task.State.SLEEPING ; }
Source:
protected java.lang.ProcessBuilder newBuildProcess ( com.google.gerrit.httpd.raw.Label label ) throws java.io.IOException { java.util.Properties properties = loadBuildProperties ( sourceRoot.resolve ( ".primary_build_tool" ) ) ; java.lang.String bazel = com.google.common.base.MoreObjects.firstNonNull ( properties.getProperty ( "bazel" ) , "bazel" ) ; java.lang.ProcessBuilder proc = new java.lang.ProcessBuilder ( bazel , "build" , label.fullName ( ) ) ; if ( properties.containsKey ( "PATH" ) ) { proc.environment ( ) . put ( "PATH" , properties.getProperty ( "PATH" ) ) ; } return proc ; }

Target:
protected java.lang.ProcessBuilder newBuildProcess ( com.google.gerrit.httpd.raw.Label label ) throws java.io.IOException { return new java.lang.ProcessBuilder ( "bazel" , "build" , label.fullName ( ) ) ; }
Source:
public com.google.gerrit.server.events.PatchSetAttribute asPatchSetAttribute ( final com.google.gerrit.reviewdb.PatchSet patchSet ) { com.google.gerrit.server.events.PatchSetAttribute p = new com.google.gerrit.server.events.PatchSetAttribute ( ) ; p.revision = patchSet.getRevision ( ) . get ( ) ; p.number = java.lang.Integer.toString ( patchSet.getPatchSetId ( ) ) ; p.ref = patchSet.getRefName ( ) ; p.uploader = asAccountAttribute ( patchSet.getUploader ( ) ) ; p.createdOn = ( patchSet.getCreatedOn ( ) . getTime ( ) ) / 1000L ; return p ; }

Target:
public com.google.gerrit.server.events.PatchSetAttribute asPatchSetAttribute ( final com.google.gerrit.reviewdb.client.PatchSet patchSet ) { com.google.gerrit.server.events.PatchSetAttribute p = new com.google.gerrit.server.events.PatchSetAttribute ( ) ; p.revision = patchSet.getRevision ( ) . get ( ) ; p.number = java.lang.Integer.toString ( patchSet.getPatchSetId ( ) ) ; p.ref = patchSet.getRefName ( ) ; p.uploader = asAccountAttribute ( patchSet.getUploader ( ) ) ; p.createdOn = ( patchSet.getCreatedOn ( ) . getTime ( ) ) / 1000L ; return p ; }
Source:
public void onLoad ( ) { super . onLoad ( ) ; final int idx = tabTokens.indexOf ( initialTabToken ) ; tabs.selectTab ( ( 0 <= idx ? idx : 0 ) ) ; display ( com.google.gerrit.client.Gerrit.getUserAccount ( ) ) ; display ( ) ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; final int idx = tabTokens.indexOf ( initialTabToken ) ; tabs.selectTab ( ( 0 <= idx ? idx : 0 ) ) ; display ( com.google.gerrit.client.Gerrit.getUserAccount ( ) ) ; display ( ) ; }
Source:
private com.google.gerrit.extensions.client.SubmitType getSubmitType ( com.google.gerrit.server.query.change.ChangeData cd , com.google.gerrit.reviewdb.client.PatchSet patchSet ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.common.data.SubmitTypeRecord rec = submitRuleEvaluatorFactory.create ( cd ) . setPatchSet ( patchSet ) . getSubmitType ( ) ; if ( ( rec.status ) != ( SubmitTypeRecord.Status.OK ) ) { throw new com.google.gwtorm.server.OrmException ( ( "Submit type rule failed: " + rec ) ) ; } return rec.type ; }

Target:
private com.google.gerrit.extensions.client.SubmitType getSubmitType ( com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.common.data.SubmitTypeRecord rec = submitRuleEvaluatorFactory.create ( cd ) . getSubmitType ( ) ; if ( ( rec.status ) != ( SubmitTypeRecord.Status.OK ) ) { throw new com.google.gwtorm.server.OrmException ( ( "Submit type rule failed: " + rec ) ) ; } return rec.type ; }
Source:
public void testIsIPv6 ( ) throws java.net.UnknownHostException { final java.net.InetAddress ipv6 = java.net.InetAddress.getByName ( "1:2:3:4:5:6:7:8" ) ; assertTrue ( ( ipv6 instanceof java.net.Inet6Address ) ) ; assertTrue ( com.google.gerrit.server.util.SocketUtil.isIPv6 ( ipv6 ) ) ; final java.net.InetAddress ipv4 = java.net.InetAddress.getByName ( "127.0.0.1" ) ; assertTrue ( ( ipv4 instanceof java.net.Inet4Address ) ) ; assertFalse ( com.google.gerrit.server.util.SocketUtil.isIPv6 ( ipv4 ) ) ; }

Target:
public void testIsIPv6 ( ) throws java.net.UnknownHostException { final java.net.InetAddress ipv6 = java.net.InetAddress.getByName ( "1:2:3:4:5:6:7:8" ) ; org.junit.Assert.assertTrue ( ( ipv6 instanceof java.net.Inet6Address ) ) ; org.junit.Assert.assertTrue ( com.google.gerrit.server.util.SocketUtil.isIPv6 ( ipv6 ) ) ; final java.net.InetAddress ipv4 = java.net.InetAddress.getByName ( "127.0.0.1" ) ; org.junit.Assert.assertTrue ( ( ipv4 instanceof java.net.Inet4Address ) ) ; org.junit.Assert.assertFalse ( com.google.gerrit.server.util.SocketUtil.isIPv6 ( ipv4 ) ) ; }
Source:
public java.util.List < com.google.gerrit.extensions.common.AccountInfo > members ( boolean recursive ) throws com.google.gerrit.extensions.restapi.RestApiException { com.google.gerrit.server.group.ListMembers list = listMembers.get ( ) ; list.setRecursive ( recursive ) ; try { return list.apply ( rsrc ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot list group members" , e ) ; } }

Target:
public java.util.List < com.google.gerrit.extensions.common.AccountInfo > members ( boolean recursive ) throws com.google.gerrit.extensions.restapi.RestApiException { listMembers.setRecursive ( recursive ) ; try { return listMembers.apply ( rsrc ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot list group members" , e ) ; } }
Source:
public void setUp ( ) throws java.lang.Exception { index = new com.google.gerrit.server.index.FakeIndex ( FakeIndex.V2 ) ; indexes = new com.google.gerrit.server.index.IndexCollection ( ) ; indexes.setSearchIndex ( index ) ; queryBuilder = new com.google.gerrit.server.index.FakeQueryBuilder ( indexes ) ; rewrite = new com.google.gerrit.server.index.IndexRewriteImpl ( indexes , null , new com.google.gerrit.server.query.change.BasicChangeRewrites ( null , indexes ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { index = new com.google.gerrit.server.index.FakeIndex ( FakeIndex.V2 ) ; indexes = new com.google.gerrit.server.index.IndexCollection ( ) ; indexes.setSearchIndex ( index ) ; queryBuilder = new com.google.gerrit.server.index.FakeQueryBuilder ( indexes ) ; rewrite = new com.google.gerrit.server.index.IndexRewriteImpl ( indexes , new com.google.gerrit.server.query.change.BasicChangeRewrites ( null , indexes ) ) ; }
Source:
private void migrateStartReplicationCapability ( com.google.gerrit.reviewdb.server.ReviewDb db , java.io.File [ ] matches ) throws java.io.IOException , java.sql.SQLException , org.eclipse.jgit.errors.ConfigInvalidException , org.eclipse.jgit.errors.RepositoryNotFoundException { com.google.gerrit.server.schema.Schema_81.Description d = new com.google.gerrit.server.schema.Schema_81.Description ( ) ; if ( ( matches == null ) || ( ( matches.length ) == 0 ) ) { d.what = com.google.gerrit.server.schema.Schema_81.Description.Action.REMOVE ; } else { d.what = com.google.gerrit.server.schema.Schema_81.Description.Action.RENAME ; d.prefix = com.google.gerrit.server.schema.Schema_81.nameOf ( matches [ 0 ] ) ; } migrateStartReplicationCapability ( db , d ) ; }

Target:
private void migrateStartReplicationCapability ( java.io.File [ ] matches ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException , org.eclipse.jgit.errors.RepositoryNotFoundException { com.google.gerrit.server.schema.Schema_81.Description d = new com.google.gerrit.server.schema.Schema_81.Description ( ) ; if ( ( matches == null ) || ( ( matches.length ) == 0 ) ) { d.what = com.google.gerrit.server.schema.Schema_81.Description.Action.REMOVE ; } else { d.what = com.google.gerrit.server.schema.Schema_81.Description.Action.RENAME ; d.prefix = com.google.gerrit.server.schema.Schema_81.nameOf ( matches [ 0 ] ) ; } migrateStartReplicationCapability ( d ) ; }
Source:
public void testCreate_NotExisting ( ) throws java.io.IOException { final java.io.File root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( root ) ; assertTrue ( site.isNew ) ; assertEquals ( root , site.site_path ) ; assertEquals ( new java.io.File ( root , "etc" ) , site.etc_dir ) ; }

Target:
public void testCreate_NotExisting ( ) throws java.io.IOException { final java.io.File root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( root ) ; org.junit.Assert.assertTrue ( site.isNew ) ; org.junit.Assert.assertEquals ( root , site.site_path ) ; org.junit.Assert.assertEquals ( new java.io.File ( root , "etc" ) , site.etc_dir ) ; }
Source:
public com.google.gerrit.extensions.api.changes.RevisionApi revision ( java.lang.String id ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return revisionApi.create ( revisions.parse ( change , com.google.gerrit.extensions.restapi.IdString.fromDecoded ( id ) ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot parse revision" , e ) ; } }

Target:
public com.google.gerrit.extensions.api.changes.RevisionApi revision ( java.lang.String id ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return revisionApi.create ( revisions.parse ( change , com.google.gerrit.extensions.restapi.IdString.fromDecoded ( id ) ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot parse revision" , e ) ; } }
Source:
public void onSuccess ( java.lang.Void result ) { java.lang.String b = ( ( base ) != null ) ? java.lang.String.valueOf ( base.get ( ) ) : null ; java.lang.String rev = java.lang.String.valueOf ( revision.get ( ) ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId , rev ) , new com.google.gerrit.client.change.ChangeScreen2 ( changeId , b , rev , openReplyBox ) ) ; }

Target:
public void onSuccess ( java.lang.Void result ) { java.lang.String b = ( ( base ) != null ) ? java.lang.String.valueOf ( base.get ( ) ) : null ; java.lang.String rev = java.lang.String.valueOf ( revision.get ( ) ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId , b , rev ) , new com.google.gerrit.client.change.ChangeScreen2 ( changeId , b , rev , openReplyBox ) ) ; }
Source:
protected java.util.List < org.eclipse.jgit.revwalk.RevCommit > getRemoteLog ( ) throws java.io.IOException { org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ; try { org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ; try { rw.markStart ( rw.parseCommit ( repo.getRef ( "refs/heads/master" ) . getObjectId ( ) ) ) ; return com.google.common.collect.Lists.newArrayList ( rw ) ; } finally { rw.release ( ) ; } } finally { repo.close ( ) ; } }

Target:
protected java.util.List < org.eclipse.jgit.revwalk.RevCommit > getRemoteLog ( ) throws java.io.IOException { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ; org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { rw.markStart ( rw.parseCommit ( repo.getRef ( "refs/heads/master" ) . getObjectId ( ) ) ) ; return com.google.common.collect.Lists.newArrayList ( rw ) ; } }
Source:
public void replace ( com.google.gerrit.server.account.AccountState as ) throws java.io.IOException { try { replace ( com.google.gerrit.lucene.LuceneAccountIndex.idTerm ( as ) , toDocument ( as , null ) ) . get ( ) ; } catch ( java.util.concurrent.ExecutionException | java.lang.InterruptedException e ) { throw new java.io.IOException ( e ) ; } }

Target:
public void replace ( com.google.gerrit.server.account.AccountState as ) throws java.io.IOException { try { replace ( com.google.gerrit.lucene.LuceneAccountIndex.idTerm ( as ) , toDocument ( as ) ) . get ( ) ; } catch ( java.util.concurrent.ExecutionException | java.lang.InterruptedException e ) { throw new java.io.IOException ( e ) ; } }
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 = arg1 ; int idx ; a1 = a1.dereference ( ) ; if ( ! ( a1.isInteger ( ) ) ) throw new com.googlecode.prolog_cafe.exceptions.IllegalTypeException ( this , 1 , "integer" , a1 ) ; idx = ( ( com.googlecode.prolog_cafe.builtin.IntegerTerm ) ( a1 ) ) . intValue ( ) ; engine.internalDB.erase ( idx ) ; return cont ; }

Target:
public com.googlecode.prolog_cafe.builtin.Operation exec ( com.googlecode.prolog_cafe.builtin.Prolog engine ) { engine.setB0 ( ) ; com.googlecode.prolog_cafe.builtin.Term a1 = arg1 ; int idx ; a1 = a1.dereference ( ) ; if ( ! ( a1 instanceof com.googlecode.prolog_cafe.builtin.IntegerTerm ) ) throw new com.googlecode.prolog_cafe.exceptions.IllegalTypeException ( this , 1 , "integer" , a1 ) ; idx = ( ( com.googlecode.prolog_cafe.builtin.IntegerTerm ) ( a1 ) ) . intValue ( ) ; engine.internalDB.erase ( idx ) ; return cont ; }
Source:
public void treeTextEscaped ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevBlob blob = repo.blob ( "contents" ) ; repo.branch ( "master" ) . commit ( ) . add ( "foo\nbar\rbaz" , blob ) . create ( ) ; org.junit.Assert.assertEquals ( ( ( "100644 blob " + ( blob.name ( ) ) ) + "\t\"foo\\nbar\\rbaz\"\n" ) , buildBlob ( "/repo/+/master/" , "040000" ) ) ; }

Target:
public void treeTextEscaped ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevBlob blob = repo.blob ( "contents" ) ; repo.branch ( "master" ) . commit ( ) . add ( "foo\nbar\rbaz" , blob ) . create ( ) ; com.google.common.truth.Truth.assertThat ( buildBlob ( "/repo/+/master/" , "040000" ) ) . isEqualTo ( ( ( "100644 blob " + ( blob.name ( ) ) ) + "\t\"foo\\nbar\\rbaz\"\n" ) ) ; }
Source:
private com.google.gerrit.common.data.PermissionRule newRule ( com.google.gerrit.server.git.ProjectConfig project , com.google.gerrit.reviewdb.client.AccountGroup.UUID groupUUID ) { com.google.gerrit.common.data.GroupReference group = new com.google.gerrit.common.data.GroupReference ( groupUUID , groupUUID.get ( ) ) ; group = project.resolve ( group ) ; return new com.google.gerrit.common.data.PermissionRule ( project.getProject ( ) . getNameKey ( ) , group ) ; }

Target:
private com.google.gerrit.common.data.PermissionRule newRule ( com.google.gerrit.server.git.ProjectConfig project , com.google.gerrit.reviewdb.client.AccountGroup.UUID groupUUID ) { com.google.gerrit.common.data.GroupReference group = new com.google.gerrit.common.data.GroupReference ( groupUUID , groupUUID.get ( ) ) ; group = project.resolve ( group ) ; return new com.google.gerrit.common.data.PermissionRule ( group ) ; }
Source:
protected com.google.gerrit.sshd.SshScope.Context continuingContext ( com.google.gerrit.sshd.SshScope.Context ctx ) { HEAD ( 3379 ) ; com.google.gerrit.sshd.bc Export ; com.google.gerrit.sshd.universal version ; GroupBackend ( plugins ) ; return sshScope.newContinuingContext ( ctx ) ; return new com.google.gerrit.sshd.SshScope.Context ( ctx , ctx.getSession ( ) , ctx.getCommandLine ( ) ) ; BRANCH ( d2fa1f ) ; com.google.gerrit.sshd.Do not ; com.google.gerrit.sshd.rejected commands ; }

Target:
protected com.google.gerrit.sshd.SshScope.Context continuingContext ( com.google.gerrit.sshd.SshScope.Context ctx ) { return sshScope.newContinuingContext ( ctx ) ; }
Source:
private org.eclipse.jgit.treewalk.AbstractTreeIterator getTreeIterator ( org.eclipse.jgit.lib.Repository repo , java.lang.String name ) throws java.io.IOException { org.eclipse.jgit.treewalk.CanonicalTreeParser p = new org.eclipse.jgit.treewalk.CanonicalTreeParser ( ) ; org.eclipse.jgit.lib.ObjectReader or = repo.newObjectReader ( ) ; try { p.reset ( or , new org.eclipse.jgit.revwalk.RevWalk ( repo ) . parseTree ( repo.resolve ( name ) ) ) ; return p ; } finally { or.release ( ) ; } }

Target:
private org.eclipse.jgit.treewalk.AbstractTreeIterator getTreeIterator ( org.eclipse.jgit.lib.Repository repo , java.lang.String name ) throws java.io.IOException { org.eclipse.jgit.treewalk.CanonicalTreeParser p = new org.eclipse.jgit.treewalk.CanonicalTreeParser ( ) ; try ( org.eclipse.jgit.lib.ObjectReader or = repo.newObjectReader ( ) ) { p.reset ( or , new org.eclipse.jgit.revwalk.RevWalk ( repo ) . parseTree ( repo.resolve ( name ) ) ) ; return p ; } }
Source:
public void removeProjectEvents ( java.lang.String project ) throws java.sql.SQLException { java.sql.Connection conn = ds.getConnection ( ) ; java.sql.Statement stat = conn.createStatement ( ) ; try { stat.execute ( java.lang.String.format ( "DELETE FROM %s WHERE project = '%s'" , com.ericsson.gerrit.plugins.eventslog.sql.SQLTable.TABLE_NAME , project ) ) ; } finally { closeStatement ( stat ) ; closeConnection ( conn ) ; } }

Target:
public void removeProjectEvents ( java.lang.String project ) throws java.sql.SQLException { try ( java.sql.Connection conn = ds.getConnection ( ) ; java.sql.Statement stat = conn.createStatement ( ) ) { stat.execute ( java.lang.String.format ( "DELETE FROM %s WHERE project = '%s'" , com.ericsson.gerrit.plugins.eventslog.sql.SQLTable.TABLE_NAME , project ) ) ; } }
Source:
public void queryChangesMultipleTerms ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r1 = createChange ( ) ; createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = query ( ( "status:open " + ( r1.getChangeId ( ) ) ) ) ; org.junit.Assert.assertEquals ( r1.getChangeId ( ) , com.google.common.collect.Iterables.getOnlyElement ( results ) . changeId ) ; }

Target:
public void queryChangesMultipleTerms ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r1 = createChange ( ) ; createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = query ( ( "status:open " + ( r1.getChangeId ( ) ) ) ) ; com.google.common.truth.Truth.assertThat ( com.google.common.collect.Iterables.getOnlyElement ( results ) . changeId ) . isEqualTo ( r1.getChangeId ( ) ) ; }
Source:
void runUpgrades ( ) throws java.lang.Exception { readyToStart.countDown ( ) ; int timeoutSec = 60 ; if ( ! ( started.await ( timeoutSec , java.util.concurrent.TimeUnit.SECONDS ) ) ) { com.google.common.truth.Truth.assert_ ( ) . fail ( "%s/%s online upgrades started after %ss" , ( ( numExpected ) - ( started.getCount ( ) ) ) , numExpected , timeoutSec ) ; } finished.await ( ) ; }

Target:
void runUpgrades ( ) throws java.lang.Exception { readyToStart.countDown ( ) ; started.await ( ) ; finished.await ( ) ; }
Source:
public void testCannotUploadToAnyRef ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.REGISTERED , "refs/*" ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/for/refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local ) ; assertFalse ( "cannot upload" , ( ( u.canPushToAtLeastOneRef ( ) ) == ( com.google.gerrit.common.data.Capable.OK ) ) ) ; assertFalse ( "cannot upload refs/heads/master" , u.controlForRef ( "refs/heads/master" ) . canUpload ( ) ) ; }

Target:
public void testCannotUploadToAnyRef ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.REGISTERED , "refs/*" ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/for/refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local ) ; org.junit.Assert.assertFalse ( "cannot upload" , ( ( u.canPushToAtLeastOneRef ( ) ) == ( com.google.gerrit.common.data.Capable.OK ) ) ) ; org.junit.Assert.assertFalse ( "cannot upload refs/heads/master" , u.controlForRef ( "refs/heads/master" ) . canUpload ( ) ) ; }
Source:
private static < T > void replace ( com.google.gerrit.server.plugins.Plugin newPlugin , com.google.gerrit.extensions.registration.ReloadableRegistrationHandle < T > h , com.google.inject.Binding < T > b ) { com.google.gerrit.extensions.registration.RegistrationHandle n = h.replace ( b.getKey ( ) , b.getProvider ( ) . get ( ) ) ; if ( n != null ) { newPlugin.add ( n ) ; } }

Target:
private static < T > void replace ( com.google.gerrit.server.plugins.Plugin newPlugin , com.google.gerrit.extensions.registration.ReloadableRegistrationHandle < T > h , com.google.inject.Binding < T > b ) { com.google.gerrit.extensions.registration.RegistrationHandle n = h.replace ( b.getKey ( ) , b.getProvider ( ) ) ; if ( n != null ) { newPlugin.add ( n ) ; } }
Source:
private boolean isRecoverable ( java.lang.Exception ex ) { if ( ex instanceof com.atlassian.jira.rpc.soap.client.RemoteAuthenticationException ) return true ; java.lang.String className = ex.getClass ( ) . getName ( ) ; if ( ex instanceof org.apache.axis.AxisFault ) { org.apache.axis.AxisFault af = ( ( org.apache.axis.AxisFault ) ( ex ) ) ; className = ( ( af.detail ) == null ) ? "unknown" : af.detail.getClass ( ) . getName ( ) ; } return className.startsWith ( "java.net" ) ; }

Target:
private boolean isRecoverable ( java.lang.Exception ex ) { java.lang.String className = ex.getClass ( ) . getName ( ) ; return className.startsWith ( "java.net" ) ; }
Source:
void loadRevisionInfo ( ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeApi.actions ( changeId.get ( ) , revision ) ; call.background ( ) ; call.get ( new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.info.ActionInfo > > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.info.ActionInfo > actionMap ) { actionMap.copyKeysIntoChildren ( "id" ) ; renderRevisionInfo ( changeInfo , actionMap ) ; } } ) ; }

Target:
void loadRevisionInfo ( ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeApi.actions ( getProject ( ) . get ( ) , changeId.get ( ) , revision ) ; call.background ( ) ; call.get ( new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.info.ActionInfo > > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.info.ActionInfo > actionMap ) { actionMap.copyKeysIntoChildren ( "id" ) ; renderRevisionInfo ( changeInfo , actionMap ) ; } } ) ; }
Source:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicMap.mapOf ( binder ( ) , com.googlesource.gerrit.plugins.imagare.ImageResource.IMAGE_KIND ) ; bind ( com.googlesource.gerrit.plugins.imagare.ImagesCollection.class ) ; child ( com.google.gerrit.server.project.ProjectResource.PROJECT_KIND , "images" ) . to ( com.googlesource.gerrit.plugins.imagare.ImagesCollection.class ) ; delete ( com.googlesource.gerrit.plugins.imagare.ImageResource.IMAGE_KIND ) . to ( com.googlesource.gerrit.plugins.imagare.DeleteImage.class ) ; get ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "config" ) . to ( com.googlesource.gerrit.plugins.imagare.GetConfig.class ) ; put ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "config" ) . to ( com.googlesource.gerrit.plugins.imagare.PutConfig.class ) ; get ( com.google.gerrit.server.account.AccountResource.ACCOUNT_KIND , "preference" ) . to ( com.googlesource.gerrit.plugins.imagare.GetPreference.class ) ; put ( com.google.gerrit.server.account.AccountResource.ACCOUNT_KIND , "preference" ) . to ( com.googlesource.gerrit.plugins.imagare.PutPreference.class ) ; }

Target:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicMap.mapOf ( binder ( ) , com.googlesource.gerrit.plugins.imagare.ImageResource.IMAGE_KIND ) ; bind ( com.googlesource.gerrit.plugins.imagare.ImagesCollection.class ) ; child ( com.google.gerrit.server.project.ProjectResource.PROJECT_KIND , "images" ) . to ( com.googlesource.gerrit.plugins.imagare.ImagesCollection.class ) ; delete ( com.googlesource.gerrit.plugins.imagare.ImageResource.IMAGE_KIND ) . to ( com.googlesource.gerrit.plugins.imagare.DeleteImage.class ) ; }
Source:
private com.google.gerrit.reviewdb.client.PatchSetInfo previousPatchSetInfo ( com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException { try { return patchSetInfoFactory.get ( dbProvider.get ( ) , new com.google.gerrit.reviewdb.client.PatchSet.Id ( patchSetId.getParentKey ( ) , ( ( patchSetId.get ( ) ) - 1 ) ) ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( e.getMessage ( ) ) ; } }

Target:
private com.google.gerrit.reviewdb.client.PatchSetInfo previousPatchSetInfo ( com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId ) throws com.google.gwtorm.server.OrmException { try { return patchSetInfoFactory.get ( dbProvider.get ( ) , new com.google.gerrit.reviewdb.client.PatchSet.Id ( patchSetId.getParentKey ( ) , ( ( patchSetId.get ( ) ) - 1 ) ) ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } }
Source:
protected boolean isVisibleTo ( final com.google.gerrit.reviewdb.client.Account.Id to ) throws com.google.gwtorm.server.OrmException { return ( ( projectState ) == null ) || ( projectState.controlFor ( args.identifiedUserFactory.create ( to ) ) . controlFor ( change ) . isVisible ( args.db.get ( ) ) ) ; }

Target:
protected boolean isVisibleTo ( final com.google.gerrit.reviewdb.client.Account.Id to ) throws com.google.gwtorm.server.OrmException { return ( ( projectState ) == null ) || ( projectState.controlFor ( args.identifiedUserFactory.create ( to ) ) . controlFor ( args.db.get ( ) , change ) . isVisible ( args.db.get ( ) ) ) ; }
Source:
public void testInheritRead_OverrideWithDeny ( ) { grant ( parent , com.google.gerrit.common.data.Permission.READ , registered , "refs/*" ) ; grant ( local , com.google.gerrit.common.data.Permission.READ , registered , "refs/*" ) . setDeny ( true ) ; com.google.gerrit.server.project.ProjectControl u = user ( ) ; assertFalse ( "can't read" , u.isVisible ( ) ) ; }

Target:
public void testInheritRead_OverrideWithDeny ( ) { grant ( parent , com.google.gerrit.common.data.Permission.READ , registered , "refs/*" ) ; grant ( local , com.google.gerrit.common.data.Permission.READ , registered , "refs/*" ) . setDeny ( ) ; com.google.gerrit.server.project.ProjectControl u = user ( ) ; assertFalse ( "can't read" , u.isVisible ( ) ) ; }
Source:
protected void onInitUI ( ) { super . onInitUI ( ) ; dashes = new com.google.gerrit.client.dashboards.DashboardsTable ( ) ; com.google.gwt.user.client.ui.FlowPanel fp = new com.google.gwt.user.client.ui.FlowPanel ( ) ; fp.add ( dashes ) ; add ( fp ) ; dashes.setSavePointerId ( ( "dashboards/project/" + ( getProjectKey ( ) . get ( ) ) ) ) ; display ( ) ; }

Target:
protected void onInitUI ( ) { super . onInitUI ( ) ; dashes = new com.google.gerrit.client.dashboards.DashboardsTable ( project ) ; com.google.gwt.user.client.ui.FlowPanel fp = new com.google.gwt.user.client.ui.FlowPanel ( ) ; fp.add ( dashes ) ; add ( fp ) ; dashes.setSavePointerId ( ( "dashboards/project/" + ( getProjectKey ( ) . get ( ) ) ) ) ; display ( ) ; }
Source:
public com.google.common.collect.ImmutableListMultimap < com.google.gerrit.reviewdb.client.Account.Id , java.lang.String > byChangeFromIndex ( com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { java.util.Set < java.lang.String > fields = com.google.common.collect.ImmutableSet.of ( ChangeField.ID.getName ( ) , ChangeField.STAR.getName ( ) ) ; java.util.List < com.google.gerrit.server.query.change.ChangeData > changeData = queryProvider.get ( ) . setRequestedFields ( fields ) . byLegacyChangeId ( changeId ) ; if ( ( changeData.size ( ) ) != 1 ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( changeId ) ; } return changeData.get ( 0 ) . stars ( ) ; }

Target:
public com.google.common.collect.ImmutableListMultimap < com.google.gerrit.reviewdb.client.Account.Id , java.lang.String > byChangeFromIndex ( com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.server.query.change.ChangeData > changeData = queryProvider.get ( ) . setRequestedFields ( ChangeField.ID , ChangeField.STAR ) . byLegacyChangeId ( changeId ) ; if ( ( changeData.size ( ) ) != 1 ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( changeId ) ; } return changeData.get ( 0 ) . stars ( ) ; }
Source:
public void run ( ) { com.google.gerrit.pgm.Daemon.log.info ( "caught shutdown, cleaning up" ) ; if ( ( runId ) != null ) { try { java.nio.file.Files.delete ( runFile ) ; } catch ( java.io.IOException err ) { com.google.gerrit.pgm.Daemon.log.warn ( ( "failed to delete " + ( runFile ) ) , err ) ; } } manager.stop ( ) ; }

Target:
public void stop ( ) { if ( ( runId ) != null ) { try { java.nio.file.Files.delete ( runFile ) ; } catch ( java.io.IOException err ) { com.google.gerrit.pgm.Daemon.log.warn ( ( "failed to delete " + ( runFile ) ) , err ) ; } } manager.stop ( ) ; }
Source:
private org.eclipse.jgit.lib.ObjectId createNoteContent ( org.eclipse.jgit.revwalk.RevCommit c ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.googlesource.gerrit.plugins.reviewnotes.HeaderFormatter fmt = new com.googlesource.gerrit.plugins.reviewnotes.HeaderFormatter ( gerritServerIdent.getTimeZone ( ) , anonymousCowardName ) ; com.google.gerrit.reviewdb.client.PatchSet ps = loadPatchSet ( c ) ; if ( ps != null ) { try { createCodeReviewNote ( ps , fmt ) ; return getInserter ( ) . insert ( Constants.OBJ_BLOB , fmt.toString ( ) . getBytes ( "UTF-8" ) ) ; } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { throw new java.io.IOException ( e ) ; } } return null ; }

Target:
private org.eclipse.jgit.lib.ObjectId createNoteContent ( org.eclipse.jgit.revwalk.RevCommit c ) throws com.google.gwtorm.server.OrmException , java.io.IOException { return createNoteContent ( loadPatchSet ( c ) ) ; }
Source:
private void setReviewed ( com.google.gerrit.client.info.FileInfo info , boolean r ) { com.google.gerrit.client.rpc.RestApi api = com.google.gerrit.client.changes.ChangeApi.revision ( curr ) . view ( "files" ) . id ( info.path ( ) ) . view ( "reviewed" ) ; if ( r ) { api.put ( com.google.gerrit.client.rpc.CallbackGroup.< com.google.gerrit.client.changes.ReviewInfo > emptyCallback ( ) ) ; } else { api.delete ( com.google.gerrit.client.rpc.CallbackGroup.< com.google.gerrit.client.changes.ReviewInfo > emptyCallback ( ) ) ; } }

Target:
private void setReviewed ( com.google.gerrit.client.info.FileInfo info , boolean r ) { com.google.gerrit.client.rpc.RestApi api = com.google.gerrit.client.changes.ChangeApi.revision ( project.get ( ) , curr ) . view ( "files" ) . id ( info.path ( ) ) . view ( "reviewed" ) ; if ( r ) { api.put ( com.google.gerrit.client.rpc.CallbackGroup.< com.google.gerrit.client.changes.ReviewInfo > emptyCallback ( ) ) ; } else { api.delete ( com.google.gerrit.client.rpc.CallbackGroup.< com.google.gerrit.client.changes.ReviewInfo > emptyCallback ( ) ) ; } }
Source:
public void close ( ) throws com.google.gwtorm.client.OrmException { lock.lock ( ) ; try { if ( ( log ) != null ) { try { log.close ( ) ; } catch ( java.io.IOException err ) { throw new com.google.gwtorm.client.OrmException ( "Cannot close log file" , err ) ; } finally { log = null ; } } } finally { lock.unlock ( ) ; } }

Target:
public void close ( ) throws com.google.gwtorm.server.OrmException { lock.lock ( ) ; try { if ( ( log ) != null ) { try { log.close ( ) ; } catch ( java.io.IOException err ) { throw new com.google.gwtorm.server.OrmException ( "Cannot close log file" , err ) ; } finally { log = null ; } } } finally { lock.unlock ( ) ; } }
Source:
private java.lang.String getLatestRemoteDiff ( ) throws java.io.IOException { org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ; try { org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ; try { org.eclipse.jgit.lib.ObjectId oldTreeId = repo.resolve ( "refs/heads/master~1^{tree}" ) ; org.eclipse.jgit.lib.ObjectId newTreeId = repo.resolve ( "refs/heads/master^{tree}" ) ; return getLatestDiff ( repo , oldTreeId , newTreeId ) ; } finally { rw.release ( ) ; } } finally { repo.close ( ) ; } }

Target:
private java.lang.String getLatestRemoteDiff ( ) throws java.io.IOException { org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ; try { org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ; try { org.eclipse.jgit.lib.ObjectId oldTreeId = repo.resolve ( "refs/heads/master~1^{tree}" ) ; org.eclipse.jgit.lib.ObjectId newTreeId = repo.resolve ( "refs/heads/master^{tree}" ) ; return getLatestDiff ( repo , oldTreeId , newTreeId ) ; } finally { rw.close ( ) ; } } finally { repo.close ( ) ; } }
Source:
public java.lang.Void call ( ) throws java.lang.Exception { for ( int i = 1 ; i < 100 ; i ++ ) { java.lang.String p = "p" + i ; com.google.gerrit.acceptance.GitUtil.createProject ( sshSession , p ) ; com.google.gerrit.acceptance.GitUtil.cloneProject ( ( ( ( sshSession.getUrl ( ) ) + "/" ) + p ) ) ; } return null ; }

Target:
public java.lang.Void call ( ) throws java.lang.Exception { for ( int i = 1 ; i < 100 ; i ++ ) { java.lang.String p = "p" + i ; createProject ( p ) ; com.google.gerrit.acceptance.GitUtil.cloneProject ( ( ( ( sshSession.getUrl ( ) ) + "/" ) + p ) ) ; } return null ; }
Source:
public final boolean isCurrentView ( ) { final com.google.gwt.user.client.ui.Widget p = getParent ( ) ; return ( p instanceof com.google.gwtexpui.user.client.ViewSite ) && ( ( ( ( com.google.gwtexpui.user.client.ViewSite < ? > ) ( p ) ) . getView ( ) ) == ( this ) ) ; }

Target:
public final boolean isCurrentView ( ) { com.google.gwt.user.client.ui.Widget p = getParent ( ) ; while ( p != null ) { if ( p instanceof com.google.gwtexpui.user.client.ViewSite ) { return ( ( ( com.google.gwtexpui.user.client.ViewSite < ? > ) ( p ) ) . getView ( ) ) == ( this ) ; } p = p.getParent ( ) ; } return false ; }
Source:
public com.google.gerrit.server.account.GroupControl controlFor ( final com.google.gerrit.reviewdb.client.AccountGroup.UUID groupId ) throws com.google.gerrit.common.errors.NoSuchGroupException { final com.google.gerrit.common.data.GroupDescription.Basic group = groupBackend.get ( groupId ) ; if ( group == null ) { throw new com.google.gerrit.common.errors.NoSuchGroupException ( groupId ) ; } return new com.google.gerrit.server.account.GroupControl ( user.get ( ) , group ) ; }

Target:
public com.google.gerrit.server.account.GroupControl controlFor ( final com.google.gerrit.reviewdb.client.AccountGroup.UUID groupId ) throws com.google.gerrit.common.errors.NoSuchGroupException { final com.google.gerrit.common.data.GroupDescription.Basic group = groupBackend.get ( groupId ) ; if ( group == null ) { throw new com.google.gerrit.common.errors.NoSuchGroupException ( groupId ) ; } return controlFor ( group ) ; }
Source:
public void hashtagChangeNotes ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; java.util.LinkedHashSet < java.lang.String > hashtags = new java.util.LinkedHashSet < > ( ) ; hashtags.add ( "tag1" ) ; hashtags.add ( "tag2" ) ; update.setHashtags ( hashtags ) ; update.commit ( ) ; com.google.gerrit.server.notedb.ChangeNotes notes = newNotes ( c ) ; org.junit.Assert.assertEquals ( hashtags , notes.getHashtags ( ) ) ; }

Target:
public void hashtagChangeNotes ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; java.util.LinkedHashSet < java.lang.String > hashtags = new java.util.LinkedHashSet < > ( ) ; hashtags.add ( "tag1" ) ; hashtags.add ( "tag2" ) ; update.setHashtags ( hashtags ) ; update.commit ( ) ; com.google.gerrit.server.notedb.ChangeNotes notes = newNotes ( c ) ; com.google.common.truth.Truth.assertThat ( notes.getHashtags ( ) ) . isEqualTo ( hashtags ) ; }
Source:
public com.google.gerrit.server.notedb.ChangeNotes create ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.server.notedb.ChangeNotes.Factory.unwrap ( db ) . changes ( ) . get ( changeId ) ; com.google.common.base.Preconditions.checkNotNull ( change , "change %s not found in ReviewDb" , changeId ) ; com.google.common.base.Preconditions.checkArgument ( change.getProject ( ) . equals ( project ) , ( "passed project %s when creating ChangeNotes for %s, but actual" + " project is %s" ) , project , changeId , change.getProject ( ) ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( args , project , change ) . load ( ) ; }

Target:
public com.google.gerrit.server.notedb.ChangeNotes create ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.server.notedb.ChangeNotes.unwrap ( db ) . changes ( ) . get ( changeId ) ; com.google.common.base.Preconditions.checkNotNull ( change , "change %s not found in ReviewDb" , changeId ) ; com.google.common.base.Preconditions.checkArgument ( change.getProject ( ) . equals ( project ) , ( "passed project %s when creating ChangeNotes for %s, but actual" + " project is %s" ) , project , changeId , change.getProject ( ) ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( args , project , change ) . load ( ) ; }
Source:
public void currentRevision ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo c = get ( changeId , com.google.gerrit.extensions.client.ListChangesOption.CURRENT_REVISION ) ; com.google.common.truth.Truth.assertThat ( c.currentRevision ) . isEqualTo ( commitId ( 2 ) ) ; com.google.common.truth.Truth.assertThat ( ( ( java.lang.Iterable < ? > ) ( c.revisions.keySet ( ) ) ) ) . containsAllIn ( com.google.common.collect.ImmutableSet.of ( commitId ( 2 ) ) ) ; com.google.common.truth.Truth.assertThat ( c.revisions.get ( commitId ( 2 ) ) . _number ) . isEqualTo ( 3 ) ; }

Target:
public void currentRevision ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo c = get ( changeId , com.google.gerrit.extensions.client.ListChangesOption.CURRENT_REVISION ) ; com.google.common.truth.Truth.assertThat ( c.currentRevision ) . isEqualTo ( commitId ( 2 ) ) ; com.google.common.truth.Truth.assertThat ( c.revisions.keySet ( ) ) . containsAllIn ( com.google.common.collect.ImmutableSet.of ( commitId ( 2 ) ) ) ; com.google.common.truth.Truth.assertThat ( c.revisions.get ( commitId ( 2 ) ) . _number ) . isEqualTo ( 3 ) ; }
Source:
public static com.google.gerrit.client.rpc.RestApi blame ( com.google.gerrit.reviewdb.client.PatchSet.Id id , java.lang.String path , boolean base ) { return com.google.gerrit.client.changes.ChangeApi.revision ( id ) . view ( "files" ) . id ( path ) . view ( "blame" ) . addParameter ( "base" , base ) ; }

Target:
public static com.google.gerrit.client.rpc.RestApi blame ( @ com.google.gerrit.common.Nullable java.lang.String project , com.google.gerrit.reviewdb.client.PatchSet.Id id , java.lang.String path , boolean base ) { return com.google.gerrit.client.changes.ChangeApi.revision ( project , id ) . view ( "files" ) . id ( path ) . view ( "blame" ) . addParameter ( "base" , base ) ; }
Source:
private org.bouncycastle.openpgp.PGPPublicKeyRingCollection readPubRing ( final com.google.gerrit.server.GerritServer gs ) throws com.google.gerrit.client.rpc.ContactInformationStoreException { final java.io.File pub = new java.io.File ( gs.getSitePath ( ) , "contact_information.pub" ) ; try { java.io.InputStream in = new java.io.FileInputStream ( pub ) ; try { in = org.bouncycastle.openpgp.PGPUtil.getDecoderStream ( in ) ; return new org.bouncycastle.openpgp.PGPPublicKeyRingCollection ( in ) ; } finally { in.close ( ) ; } } catch ( java.io.IOException e ) { throw new com.google.gerrit.client.rpc.ContactInformationStoreException ( e ) ; } catch ( org.bouncycastle.openpgp.PGPException e ) { throw new com.google.gerrit.client.rpc.ContactInformationStoreException ( e ) ; } }

Target:
private org.bouncycastle.openpgp.PGPPublicKeyRingCollection readPubRing ( ) throws com.google.gerrit.client.rpc.ContactInformationStoreException { final java.io.File pub = new java.io.File ( server.getSitePath ( ) , "contact_information.pub" ) ; try { java.io.InputStream in = new java.io.FileInputStream ( pub ) ; try { in = org.bouncycastle.openpgp.PGPUtil.getDecoderStream ( in ) ; return new org.bouncycastle.openpgp.PGPPublicKeyRingCollection ( in ) ; } finally { in.close ( ) ; } } catch ( java.io.IOException e ) { throw new com.google.gerrit.client.rpc.ContactInformationStoreException ( e ) ; } catch ( org.bouncycastle.openpgp.PGPException e ) { throw new com.google.gerrit.client.rpc.ContactInformationStoreException ( e ) ; } }
Source:
protected void configure ( ) { bind ( java.util.concurrent.ScheduledExecutorService.class ) . annotatedWith ( com.googlesource.gerrit.plugins.webhooks.WebHooksExecutor.class ) . toProvider ( com.googlesource.gerrit.plugins.webhooks.ExecutorProvider.class ) ; bind ( org.apache.http.impl.client.CloseableHttpClient.class ) . toProvider ( com.googlesource.gerrit.plugins.webhooks.HttpClientProvider.class ) . in ( Scopes.SINGLETON ) ; factory ( PostTask.Factory.class ) ; factory ( RemoteConfig.Factory.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.common.EventListener.class ) . to ( com.googlesource.gerrit.plugins.webhooks.EventHandler.class ) ; install ( processors ) ; }

Target:
protected void configure ( ) { bind ( java.util.concurrent.ScheduledExecutorService.class ) . annotatedWith ( com.googlesource.gerrit.plugins.webhooks.WebHooksExecutor.class ) . toProvider ( com.googlesource.gerrit.plugins.webhooks.ExecutorProvider.class ) . in ( Scopes.SINGLETON ) ; bind ( org.apache.http.impl.client.CloseableHttpClient.class ) . toProvider ( com.googlesource.gerrit.plugins.webhooks.HttpClientProvider.class ) . in ( Scopes.SINGLETON ) ; factory ( PostTask.Factory.class ) ; factory ( RemoteConfig.Factory.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.common.EventListener.class ) . to ( com.googlesource.gerrit.plugins.webhooks.EventHandler.class ) ; install ( processors ) ; }
Source:
private void appendImageDifferences ( final com.google.gerrit.common.data.PatchScript script , final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder nc ) { final boolean syntaxHighlighting = script.getDiffPrefs ( ) . isSyntaxHighlighting ( ) ; if ( ( script.getDisplayMethodA ( ) ) == ( com.google.gerrit.common.data.PatchScript.DisplayMethod.IMG ) ) { final java.lang.String url = getUrlA ( ) ; appendImageLine ( nc , url , syntaxHighlighting , false ) ; } if ( ( script.getDisplayMethodB ( ) ) == ( com.google.gerrit.common.data.PatchScript.DisplayMethod.IMG ) ) { final java.lang.String url = getUrlB ( ) ; appendImageLine ( nc , url , syntaxHighlighting , true ) ; } }

Target:
private void appendImageDifferences ( final com.google.gerrit.common.data.PatchScript script , final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder nc ) { final boolean syntaxHighlighting = script.getDiffPrefs ( ) . syntaxHighlighting ; if ( ( script.getDisplayMethodA ( ) ) == ( com.google.gerrit.common.data.PatchScript.DisplayMethod.IMG ) ) { final java.lang.String url = getUrlA ( ) ; appendImageLine ( nc , url , syntaxHighlighting , false ) ; } if ( ( script.getDisplayMethodB ( ) ) == ( com.google.gerrit.common.data.PatchScript.DisplayMethod.IMG ) ) { final java.lang.String url = getUrlB ( ) ; appendImageLine ( nc , url , syntaxHighlighting , true ) ; } }