auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void addMessage ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx , com.google.gerrit.server.notedb.ChangeUpdate update , com.google.gerrit.server.IdentifiedUser deletedAssignee ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.ChangeMessage cmsg = com.google.gerrit.server.ChangeMessagesUtil.newMessage ( ctx , ( "Assignee deleted: " + ( deletedAssignee.getNameEmail ( ) ) ) , ChangeMessagesUtil.TAG_DELETE_ASSIGNEE ) ; cmUtil.addChangeMessage ( ctx.getDb ( ) , update , cmsg ) ; }

Target:
private void addMessage ( com.google.gerrit.server.update.ChangeContext ctx , com.google.gerrit.server.notedb.ChangeUpdate update , com.google.gerrit.server.IdentifiedUser deletedAssignee ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.ChangeMessage cmsg = com.google.gerrit.server.ChangeMessagesUtil.newMessage ( ctx , ( "Assignee deleted: " + ( deletedAssignee.getNameEmail ( ) ) ) , ChangeMessagesUtil.TAG_DELETE_ASSIGNEE ) ; cmUtil.addChangeMessage ( ctx.getDb ( ) , update , cmsg ) ; }
Source:
private java.util.Map < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchSet > filterPatchSets ( ) { final int max = change.currentPatchSetId ( ) . get ( ) ; return com.google.common.collect.Maps.filterKeys ( patchSets , new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSet.Id > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.PatchSet.Id in ) { return ( in.get ( ) ) <= max ; } } ) ; }

Target:
private com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSet.Id > upToCurrentPredicate ( ) { final int max = change.currentPatchSetId ( ) . get ( ) ; return new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSet.Id > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.PatchSet.Id in ) { return ( in.get ( ) ) <= max ; } } ; }
Source:
public com.google.gerrit.server.notedb.ChangeNotes createChecked ( 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.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.notedb.ChangeNotes notes = create ( db , project , changeId ) ; if ( ( notes.getChange ( ) ) == null ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( changeId ) ; } return notes ; }

Target:
public com.google.gerrit.server.notedb.ChangeNotes call ( ) throws java.lang.Exception { 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 , change , false , null ) . load ( ) ; }
Source:
public java.lang.String toString ( ) { return com.google.common.base.MoreObjects.toStringHelper ( this ) . add ( "psId" , psId ) . add ( "effectiveUser" , user ) . add ( "realUser" , realUser ) . add ( "when" , when ) . toString ( ) ; }

Target:
public java.lang.String toString ( ) { com.google.common.base.MoreObjects.ToStringHelper helper = com.google.common.base.MoreObjects.toStringHelper ( this ) . add ( "psId" , psId ) . add ( "effectiveUser" , user ) . add ( "realUser" , realUser ) . add ( "when" , when ) . add ( "tag" , tag ) ; addToString ( helper ) ; return helper.toString ( ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.server.index.ChangeIndex.class ) . to ( com.google.gerrit.lucene.LuceneChangeIndex.class ) ; bind ( com.google.gerrit.server.index.ChangeIndexer.class ) . to ( com.google.gerrit.server.index.ChangeIndexerImpl.class ) ; listener ( ) . to ( com.google.gerrit.lucene.LuceneChangeIndex.class ) ; if ( checkVersion ) { listener ( ) . to ( com.google.gerrit.lucene.IndexVersionCheck.class ) ; } }

Target:
protected void configure ( ) { bind ( com.google.gerrit.server.index.ChangeIndex.class ) . to ( com.google.gerrit.lucene.LuceneChangeIndex.class ) ; bind ( com.google.gerrit.server.index.ChangeIndexer.class ) . to ( com.google.gerrit.server.index.ChangeIndexerImpl.class ) ; bind ( com.google.gerrit.server.query.change.IndexRewrite.class ) . to ( com.google.gerrit.server.query.change.IndexRewriteImpl.class ) ; listener ( ) . to ( com.google.gerrit.lucene.LuceneChangeIndex.class ) ; if ( checkVersion ) { listener ( ) . to ( com.google.gerrit.lucene.IndexVersionCheck.class ) ; } }
Source:
public boolean deleteKey ( int seq ) { com.google.common.base.Preconditions.checkState ( ( ( keys ) != null ) , "SSH keys not loaded yet" ) ; if ( ( keys.containsKey ( seq ) ) && ( keys.get ( seq ) . isPresent ( ) ) ) { keys.put ( seq , com.google.common.base.Optional.< com.google.gerrit.reviewdb.client.AccountSshKey > absent ( ) ) ; return true ; } return false ; }

Target:
private void checkLoaded ( ) { com.google.common.base.Preconditions.checkNotNull ( keys , "SSH keys not loaded yet" ) ; }
Source:
public void currentRevisionAndMessages ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo c = get ( changeId , com.google.gerrit.extensions.common.ListChangesOption.CURRENT_REVISION , com.google.gerrit.extensions.common.ListChangesOption.MESSAGES ) ; com.google.common.truth.Truth.assertThat ( c.revisions ) . hasSize ( 1 ) ; 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 currentRevisionAndMessages ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo c = get ( changeId , com.google.gerrit.extensions.client.ListChangesOption.CURRENT_REVISION , com.google.gerrit.extensions.client.ListChangesOption.MESSAGES ) ; com.google.common.truth.Truth.assertThat ( c.revisions ) . hasSize ( 1 ) ; 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 ) ; }
Source:
public int compare ( java.io.File a , java.io.File b ) { return a.getName ( ) . compareTo ( b.getName ( ) ) ; }

Target:
public int compare ( java.io.File a , java.io.File b ) { int cmp = com.google.common.primitives.Longs.compare ( b.lastModified ( ) , a.lastModified ( ) ) ; if ( cmp != 0 ) { return cmp ; } return a.getName ( ) . compareTo ( b.getName ( ) ) ; }
Source:
public void testNoHeadText ( ) throws java.lang.Exception { com.google.gitiles.FakeHttpServletRequest req = com.google.gitiles.FakeHttpServletRequest.newRequest ( ) ; req.setPathInfo ( "/test/+refs/HEAD" ) ; req.setQueryString ( "format=TEXT" ) ; com.google.gitiles.FakeHttpServletResponse res = new com.google.gitiles.FakeHttpServletResponse ( ) ; servlet.service ( req , res ) ; assertEquals ( 200 , res.getStatus ( ) ) ; assertEquals ( "" , res.getActualBodyString ( ) ) ; }

Target:
public void noHeadText ( ) throws java.lang.Exception { com.google.gitiles.FakeHttpServletRequest req = com.google.gitiles.FakeHttpServletRequest.newRequest ( ) ; req.setPathInfo ( "/test/+refs/HEAD" ) ; req.setQueryString ( "format=TEXT" ) ; com.google.gitiles.FakeHttpServletResponse res = new com.google.gitiles.FakeHttpServletResponse ( ) ; servlet.service ( req , res ) ; org.junit.Assert.assertEquals ( 200 , res.getStatus ( ) ) ; org.junit.Assert.assertEquals ( "" , res.getActualBodyString ( ) ) ; }
Source:
public void testPostResponseWithContentOK ( ) throws java.lang.Exception { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.wireMockRule.givenThat ( com.github.tomakehurst.wiremock.client.WireMock.post ( com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ENDPOINT ) ) . withRequestBody ( com.github.tomakehurst.wiremock.client.WireMock.equalTo ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.BODY ) ) . willReturn ( com.github.tomakehurst.wiremock.client.WireMock.aResponse ( ) . withStatus ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.NO_CONTENT ) ) ) ; com.google.common.truth.Truth.assertThat ( httpSession.post ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ENDPOINT , com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.BODY ) . isSuccessful ( ) ) . isTrue ( ) ; }

Target:
public void testPostResponseWithContentOK ( ) throws java.lang.Exception { wireMockRule.givenThat ( com.github.tomakehurst.wiremock.client.WireMock.post ( com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ENDPOINT ) ) . withRequestBody ( com.github.tomakehurst.wiremock.client.WireMock.equalTo ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.BODY ) ) . willReturn ( com.github.tomakehurst.wiremock.client.WireMock.aResponse ( ) . withStatus ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.NO_CONTENT ) ) ) ; com.google.common.truth.Truth.assertThat ( httpSession.post ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ENDPOINT , com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.BODY ) . isSuccessful ( ) ) . isTrue ( ) ; }
Source:
public static void dialog ( final com.google.gwt.user.client.ui.PopupPanel panel ) { com.google.gwtexpui.globalkey.client.GlobalKey.initEvents ( ) ; com.google.gwtexpui.globalkey.client.GlobalKey.initDialog ( ) ; assert panel.isVisible ( ) ; assert ( com.google.gwtexpui.globalkey.client.GlobalKey.active ) == ( com.google.gwtexpui.globalkey.client.GlobalKey.global ) ; com.google.gwtexpui.globalkey.client.GlobalKey.active = new com.google.gwtexpui.globalkey.client.GlobalKey.State ( panel ) ; com.google.gwtexpui.globalkey.client.GlobalKey.active.add ( new com.google.gwtexpui.globalkey.client.KeyCommand ( 0 , com.google.gwt.event.dom.client.KeyCodes.KEY_ESCAPE , Util.C.closeCurrentDialog ( ) ) { @ java.lang.Override public void onKeyPress ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { panel.hide ( ) ; } } ) ; panel.addCloseHandler ( com.google.gwtexpui.globalkey.client.GlobalKey.restoreGlobal ) ; }

Target:
public static void dialog ( final com.google.gwt.user.client.ui.PopupPanel panel ) { com.google.gwtexpui.globalkey.client.GlobalKey.initEvents ( ) ; com.google.gwtexpui.globalkey.client.GlobalKey.initDialog ( ) ; assert panel.isShowing ( ) ; assert ( com.google.gwtexpui.globalkey.client.GlobalKey.active ) == ( com.google.gwtexpui.globalkey.client.GlobalKey.global ) ; com.google.gwtexpui.globalkey.client.GlobalKey.active = new com.google.gwtexpui.globalkey.client.GlobalKey.State ( panel ) ; com.google.gwtexpui.globalkey.client.GlobalKey.active.add ( new com.google.gwtexpui.globalkey.client.KeyCommand ( 0 , com.google.gwt.event.dom.client.KeyCodes.KEY_ESCAPE , Util.C.closeCurrentDialog ( ) ) { @ java.lang.Override public void onKeyPress ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { panel.hide ( ) ; } } ) ; panel.addCloseHandler ( com.google.gwtexpui.globalkey.client.GlobalKey.restoreGlobal ) ; }
Source:
public void delete ( com.google.gerrit.reviewdb.client.Project project ) throws com.google.gerrit.sshd.BaseCommand.UnloggedFailure , java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { final org.eclipse.jgit.lib.Repository repository = repoManager.openRepository ( project.getNameKey ( ) ) ; if ( repository == null ) { throw new com.google.gerrit.sshd.BaseCommand.UnloggedFailure ( "There was an error finding the project." ) ; } cleanCache ( repository ) ; deleteGitRepository ( repository ) ; }

Target:
public void delete ( com.google.gerrit.reviewdb.client.Project project , boolean preserveGitRepository ) throws com.google.gerrit.sshd.BaseCommand.UnloggedFailure , java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { final org.eclipse.jgit.lib.Repository repository = repoManager.openRepository ( project.getNameKey ( ) ) ; if ( repository == null ) { throw new com.google.gerrit.sshd.BaseCommand.UnloggedFailure ( "There was an error finding the project." ) ; } cleanCache ( repository ) ; if ( ! preserveGitRepository ) { deleteGitRepository ( repository ) ; } }
Source:
public void newPatchSetOnWipChangeToReadyInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%ready" , sc.owner ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . notTo ( sc.owner ) . to ( sc.reviewer ) . cc ( sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }

Target:
public void newPatchSetOnReviewableWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableWipChange ( ) ; pushTo ( sc , "refs/for/master%wip" , sc.owner ) ; assertThat ( sender ) . notSent ( ) ; }
Source:
private boolean search ( java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > ids ) { if ( ids.isEmpty ( ) ) { return false ; } com.google.gerrit.server.account.GroupMembership membership = user.getEffectiveGroups ( ) ; if ( ( ids.size ( ) ) == 1 ) { return membership.contains ( com.google.common.collect.Iterables.getOnlyElement ( ids ) ) ; } return membership.containsAnyOf ( ids ) ; }

Target:
public java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > intersection ( java.lang.Iterable < com.google.gerrit.reviewdb.client.AccountGroup.UUID > groupIds ) { java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > r = com.google.common.collect.Sets.newHashSet ( ) ; for ( com.google.gerrit.reviewdb.client.AccountGroup.UUID id : groupIds ) { if ( contains ( id ) ) { r.add ( id ) ; } } return r ; }
Source:
public void setLimit ( int n ) { if ( n < 0 ) { limit = 10 ; } else if ( n == 0 ) { limit = com.google.gerrit.server.account.SuggestAccounts.MAX_RESULTS ; } else { limit = java.lang.Math.min ( n , com.google.gerrit.server.account.SuggestAccounts.MAX_RESULTS ) ; } }

Target:
public void setLimit ( int n ) { if ( n < 0 ) { limit = 10 ; } else if ( n == 0 ) { limit = com.google.gerrit.server.account.SuggestAccounts.MAX_RESULTS ; } else { limit = java.lang.Math.min ( n , com.google.gerrit.server.account.SuggestAccounts.MAX_RESULTS ) ; } queryProcessor.setLimit ( limit ) ; }
Source:
public SiteIndexer.Result indexAll ( final com.google.gerrit.server.index.project.ProjectIndex index ) { org.eclipse.jgit.lib.ProgressMonitor progress = new org.eclipse.jgit.lib.TextProgressMonitor ( new java.io.PrintWriter ( progressOut ) ) ; progress.start ( 2 ) ; com.google.common.base.Stopwatch sw = com.google.common.base.Stopwatch.createStarted ( ) ; java.util.List < com.google.gerrit.reviewdb.client.Project.NameKey > names ; try { names = collectProjects ( progress ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.index.project.AllProjectsIndexer.log.error ( "Error collecting projects" , e ) ; return new com.google.gerrit.server.index.SiteIndexer.Result ( sw , false , 0 , 0 ) ; } return reindexProjects ( index , names , progress ) ; }

Target:
public SiteIndexer.Result indexAll ( final com.google.gerrit.server.index.project.ProjectIndex index ) { org.eclipse.jgit.lib.ProgressMonitor progress = new org.eclipse.jgit.lib.TextProgressMonitor ( new java.io.PrintWriter ( progressOut ) ) ; progress.start ( 2 ) ; com.google.common.base.Stopwatch sw = com.google.common.base.Stopwatch.createStarted ( ) ; java.util.List < com.google.gerrit.reviewdb.client.Project.NameKey > names ; try { names = collectProjects ( progress ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.index.project.AllProjectsIndexer.log.error ( "Error collecting projects" , e ) ; return new com.google.gerrit.index.SiteIndexer.Result ( sw , false , 0 , 0 ) ; } return reindexProjects ( index , names , progress ) ; }
Source:
void parseAll ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { walk.markStart ( walk.parseCommit ( tip ) ) ; for ( org.eclipse.jgit.revwalk.RevCommit commit : walk ) { parse ( commit ) ; } parseComments ( ) ; allPastReviewers.addAll ( reviewers.keySet ( ) ) ; pruneReviewers ( ) ; }

Target:
void parseAll ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { walk.markStart ( walk.parseCommit ( tip ) ) ; for ( org.eclipse.jgit.revwalk.RevCommit commit : walk ) { parse ( commit ) ; } parseComments ( ) ; allPastReviewers.addAll ( reviewers.keySet ( ) ) ; pruneReviewers ( ) ; checkMandatoryFooters ( ) ; }
Source:
protected com.google.gitiles.FakeHttpServletResponse buildResponse ( java.lang.String path , java.lang.String queryString , int expectedStatus ) throws java.lang.Exception { com.google.gitiles.FakeHttpServletRequest req = com.google.gitiles.FakeHttpServletRequest.newRequest ( ) ; req.setPathInfo ( path ) ; if ( queryString != null ) { req.setQueryString ( queryString ) ; } com.google.gitiles.FakeHttpServletResponse res = new com.google.gitiles.FakeHttpServletResponse ( ) ; servlet.service ( req , res ) ; com.google.common.truth.Truth.assertThat ( res.getStatus ( ) ) . isEqualTo ( expectedStatus ) ; return res ; }

Target:
protected com.google.gitiles.FakeHttpServletResponse buildResponse ( java.lang.String path , java.lang.String queryString , int expectedStatus , java.lang.String origin ) throws java.lang.Exception { com.google.gitiles.FakeHttpServletRequest req = com.google.gitiles.FakeHttpServletRequest.newRequest ( ) ; req.setHeader ( com.google.common.net.HttpHeaders.ORIGIN , origin ) ; req.setPathInfo ( path ) ; if ( queryString != null ) { req.setQueryString ( queryString ) ; } com.google.gitiles.FakeHttpServletResponse res = new com.google.gitiles.FakeHttpServletResponse ( ) ; servlet.service ( req , res ) ; com.google.common.truth.Truth.assertThat ( res.getStatus ( ) ) . isEqualTo ( expectedStatus ) ; return res ; }
Source:
public void testItsAssociationPolicyMandatory ( ) { com.googlesource.gerrit.plugins.hooks.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getEnum ( "commentlink" , "ItsTestName" , "association" , ItsAssociationPolicy.OPTIONAL ) ) . andReturn ( ItsAssociationPolicy.MANDATORY ) . atLeastOnce ( ) ; replayMocks ( ) ; assertEquals ( "Expected and generated associated policy do not match" , ItsAssociationPolicy.MANDATORY , itsConfig.getItsAssociationPolicy ( ) ) ; }

Target:
public void testItsAssociationPolicyMandatory ( ) { com.googlesource.gerrit.plugins.hooks.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "ItsTestName" , null , "commentlink" ) ) . andReturn ( null ) . atLeastOnce ( ) ; org.easymock.EasyMock.expect ( serverConfig.getEnum ( "commentlink" , "ItsTestName" , "association" , ItsAssociationPolicy.OPTIONAL ) ) . andReturn ( ItsAssociationPolicy.MANDATORY ) . atLeastOnce ( ) ; replayMocks ( ) ; assertEquals ( "Expected and generated associated policy do not match" , ItsAssociationPolicy.MANDATORY , itsConfig.getItsAssociationPolicy ( ) ) ; }
Source:
public com.google.gerrit.server.change.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { com.google.gerrit.reviewdb.client.Change change = rsrc.getChange ( ) ; return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Mark private" ) . setTitle ( "Mark change as private" ) . setVisible ( ( ( ( ! ( change.isPrivate ( ) ) ) && ( ( change.getStatus ( ) ) != ( Change.Status.MERGED ) ) ) && ( rsrc.isUserOwner ( ) ) ) ) ; }

Target:
public com.google.gerrit.server.change.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { com.google.gerrit.reviewdb.client.Change change = rsrc.getChange ( ) ; return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Mark private" ) . setTitle ( "Mark change as private" ) . setVisible ( ( ( ( ! ( change.isPrivate ( ) ) ) && ( ( change.getStatus ( ) ) != ( Change.Status.MERGED ) ) ) && ( canSetPrivate ( rsrc ) ) ) ) ; }
Source:
public static void list ( int id , java.lang.String revision , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.diff.FileInfo > > cb ) { com.google.gerrit.client.changes.ChangeApi.revision ( id , revision ) . view ( "files" ) . get ( com.google.gerrit.client.rpc.NativeMap.copyKeysIntoChildren ( "path" , cb ) ) ; }

Target:
public static void list ( int id , java.lang.String base , java.lang.String revision , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.diff.FileInfo > > cb ) { com.google.gerrit.client.rpc.RestApi api = com.google.gerrit.client.changes.ChangeApi.revision ( id , revision ) . view ( "files" ) ; if ( base != null ) { api.addParameter ( "base" , base ) ; } api.get ( com.google.gerrit.client.rpc.NativeMap.copyKeysIntoChildren ( "path" , cb ) ) ; }
Source:
public void run ( ) { net.codemirror.lib.CodeMirror.handleVimKey ( cm , "<C-d>" ) ; }

Target:
void removeDraft ( com.google.gerrit.client.diff.DraftBox box , int line ) { net.codemirror.lib.CodeMirror.LineHandle handle = getCmFromSide ( box.getSide ( ) ) . getLineHandle ( line ) ; lineActiveBoxMap.remove ( handle ) ; if ( linePublishedBoxesMap.containsKey ( handle ) ) { java.util.List < com.google.gerrit.client.diff.PublishedBox > list = linePublishedBoxesMap.get ( handle ) ; lineActiveBoxMap.put ( handle , list.get ( ( ( list.size ( ) ) - 1 ) ) ) ; } unsaved.remove ( box ) ; }
Source:
public void testAppend_boolean ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; org.junit.Assert.assertSame ( b , b.append ( true ) ) ; org.junit.Assert.assertSame ( b , b.append ( false ) ) ; org.junit.Assert.assertEquals ( "truefalse" , b.asString ( ) ) ; }

Target:
public void testAppend_boolean ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; com.google.common.truth.Truth.assertThat ( b ) . isSameAs ( b.append ( true ) ) ; com.google.common.truth.Truth.assertThat ( b ) . isSameAs ( b.append ( false ) ) ; com.google.common.truth.Truth.assertThat ( b.asString ( ) ) . isEqualTo ( "truefalse" ) ; }
Source:
com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.CounterImpl forceCreate ( java.lang.Object key ) { com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.CounterImpl c = cells.get ( key ) ; if ( c != null ) { return c ; } synchronized ( cells ) { c = cells.get ( key ) ; if ( c == null ) { c = metrics.newCounterImpl ( submetric ( key ) , isRate ) ; cells.put ( key , c ) ; } return c ; } }

Target:
com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.CounterImpl forceCreate ( java.lang.Object key ) { com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.CounterImpl c = cells.get ( key ) ; if ( c != null ) { return c ; } synchronized ( lock ) { c = cells.get ( key ) ; if ( c == null ) { c = metrics.newCounterImpl ( submetric ( key ) , isRate ) ; cells.put ( key , c ) ; } return c ; } }
Source:
protected static java.lang.String getInstanceAndProjectName ( java.lang.String instanceName , java.lang.String projectName ) { if ( ( instanceName == null ) || ( instanceName.isEmpty ( ) ) ) { return projectName.replaceAll ( "/.*/" , "..." ) ; } return ( instanceName + "/" ) + ( projectName.substring ( ( ( projectName.lastIndexOf ( "/" ) ) + 1 ) ) ) ; }

Target:
protected static java.lang.String getInstanceAndProjectName ( java.lang.String instanceName , java.lang.String projectName ) { if ( ( instanceName == null ) || ( instanceName.isEmpty ( ) ) ) { return com.google.gerrit.server.mail.send.NotificationEmail.getShortProjectName ( projectName ) ; } return ( instanceName + "/" ) + ( projectName.substring ( ( ( projectName.lastIndexOf ( "/" ) ) + 1 ) ) ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.extensions.config.CapabilityDefinition.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.Exports.named ( com.googlesource.gerrit.plugins.wip.WorkInProgressCapability.WORK_IN_PROGRESS ) ) . to ( com.googlesource.gerrit.plugins.wip.WorkInProgressCapability.class ) ; install ( new com.google.gerrit.extensions.restapi.RestApiModule ( ) { @ java.lang.Override protected void configure ( ) { post ( com.google.gerrit.server.change.RevisionResource.REVISION_KIND , "set-wip" ) . to ( com.googlesource.gerrit.plugins.wip.WorkInProgressAction.class ) ; post ( com.google.gerrit.server.change.RevisionResource.REVISION_KIND , "set-ready" ) . to ( com.googlesource.gerrit.plugins.wip.ReadyForReviewAction.class ) ; } } ) ; }

Target:
protected void configure ( ) { install ( new com.google.gerrit.extensions.restapi.RestApiModule ( ) { @ java.lang.Override protected void configure ( ) { post ( com.google.gerrit.server.change.RevisionResource.REVISION_KIND , "set-wip" ) . to ( com.googlesource.gerrit.plugins.wip.WorkInProgress.class ) ; post ( com.google.gerrit.server.change.RevisionResource.REVISION_KIND , "set-ready" ) . to ( com.googlesource.gerrit.plugins.wip.ReadyForReview.class ) ; } } ) ; }
Source:
private boolean isIndexPredicate ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in , com.google.gerrit.server.index.change.ChangeIndex index ) { if ( ! ( in instanceof com.google.gerrit.server.index.IndexPredicate ) ) { return false ; } com.google.gerrit.server.index.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > p = ( ( com.google.gerrit.server.index.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > ) ( in ) ) ; com.google.gerrit.server.index.FieldDef < com.google.gerrit.server.query.change.ChangeData , ? > def = p.getField ( ) ; com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema = index.getSchema ( ) ; return schema.hasField ( def ) ; }

Target:
private boolean isIndexPredicate ( com.google.gerrit.index.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in , com.google.gerrit.server.index.change.ChangeIndex index ) { if ( ! ( in instanceof com.google.gerrit.index.query.IndexPredicate ) ) { return false ; } com.google.gerrit.index.query.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > p = ( ( com.google.gerrit.index.query.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > ) ( in ) ) ; com.google.gerrit.index.FieldDef < com.google.gerrit.server.query.change.ChangeData , ? > def = p.getField ( ) ; com.google.gerrit.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema = index.getSchema ( ) ; return schema.hasField ( def ) ; }
Source:
protected void configure ( ) { factory ( ListBranches.Factory.class ) ; factory ( ProjectDetailFactory.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( AddBranch.Factory.class ) ; factory ( AddProjectRight.Factory.class ) ; factory ( ChangeProjectSettings.Factory.class ) ; factory ( DeleteBranches.Factory.class ) ; factory ( DeleteProjectRights.Factory.class ) ; factory ( ListBranches.Factory.class ) ; factory ( OwnedProjects.Factory.class ) ; factory ( ProjectDetailFactory.Factory.class ) ; }
Source:
public void testUnblockLargerScope_Fails ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/master" ) . 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 ) ; assertFalse ( "u can't push" , u.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }

Target:
public void testUnblockMoreSpecificRef_Fails ( ) { 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/master" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't push" , u.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }
Source:
private void display ( final com.google.gerrit.reviewdb.AccountGeneralPreferences p ) { showSiteHeader.setValue ( p.isShowSiteHeader ( ) ) ; useFlashClipboard.setValue ( p.isUseFlashClipboard ( ) ) ; copySelfOnEmails.setValue ( p.isCopySelfOnEmails ( ) ) ; setListBox ( maximumPageSize , com.google.gerrit.reviewdb.AccountGeneralPreferences.DEFAULT_PAGESIZE , p.getMaximumPageSize ( ) ) ; }

Target:
private void display ( final com.google.gerrit.reviewdb.AccountGeneralPreferences p ) { showSiteHeader.setValue ( p.isShowSiteHeader ( ) ) ; useFlashClipboard.setValue ( p.isUseFlashClipboard ( ) ) ; copySelfOnEmails.setValue ( p.isCopySelfOnEmails ( ) ) ; setListBox ( maximumPageSize , com.google.gerrit.reviewdb.AccountGeneralPreferences.DEFAULT_PAGESIZE , p.getMaximumPageSize ( ) ) ; setListBox ( dateFormat , AccountGeneralPreferences.DateFormat.STD , p.getDateFormat ( ) ) ; setListBox ( timeFormat , AccountGeneralPreferences.TimeFormat.HHMM_12 , p.getTimeFormat ( ) ) ; }
Source:
public java.lang.String getAuthorizationUrl ( java.lang.String scopesString , java.lang.String state ) { return ( ( ( ( ( config.gitHubOAuthUrl ) + "?client_id=" ) + ( config.gitHubClientId ) ) + ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getURLEncodedParameter ( "&scope=" , scopesString ) ) ) + ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getURLEncodedParameter ( "&redirect_uri=" , config.oAuthFinalRedirectUrl ) ) ) + ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getURLEncodedParameter ( "&state=" , state ) ) ; }

Target:
public java.lang.String getAuthorizationUrl ( java.lang.String scopesString , java.lang.String state , javax.servlet.http.HttpServletRequest req ) { return ( ( ( ( ( config.gitHubOAuthUrl ) + "?client_id=" ) + ( config.gitHubClientId ) ) + ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getURLEncodedParameter ( "&scope=" , scopesString ) ) ) + ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getURLEncodedParameter ( "&redirect_uri=" , config.getOAuthFinalRedirectUrl ( req ) ) ) ) + ( com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getURLEncodedParameter ( "&state=" , state ) ) ; }
Source:
private void writeToBatch ( com.google.gerrit.server.git.VersionedMetaData.BatchMetaDataUpdate batch , com.google.gerrit.server.notedb.AbstractChangeUpdate update , org.eclipse.jgit.lib.Repository repo ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( ( update == null ) || ( update.isEmpty ( ) ) ) { return ; } try ( org.eclipse.jgit.lib.ObjectInserter inserter = repo.newObjectInserter ( ) ) { update.setInserter ( inserter ) ; update.writeCommit ( batch ) ; } }

Target:
private static boolean sameUpdate ( com.google.gerrit.server.notedb.ChangeRebuilder.Event event , com.google.gerrit.server.notedb.AbstractChangeUpdate update ) { return ( ( ( ( update != null ) && ( ( com.google.gerrit.server.notedb.ChangeRebuilder.round ( event.when ) ) == ( com.google.gerrit.server.notedb.ChangeRebuilder.round ( update.getWhen ( ) ) ) ) ) && ( event.who.equals ( update.getUser ( ) . getAccountId ( ) ) ) ) && ( event.psId.equals ( update.getPatchSetId ( ) ) ) ) && ( ! ( event instanceof com.google.gerrit.server.notedb.ChangeRebuilder.FinalUpdatesEvent ) ) ; }
Source:
protected void assertCherryPick ( org.eclipse.jgit.api.Git localGit , boolean contentMerge ) throws java.io.IOException { assertRebase ( localGit , contentMerge ) ; org.eclipse.jgit.revwalk.RevCommit remoteHead = getRemoteHead ( ) ; org.junit.Assert.assertFalse ( remoteHead.getFooterLines ( "Reviewed-On" ) . isEmpty ( ) ) ; org.junit.Assert.assertFalse ( remoteHead.getFooterLines ( "Reviewed-By" ) . isEmpty ( ) ) ; }

Target:
protected void assertCherryPick ( org.eclipse.jgit.api.Git localGit , boolean contentMerge ) throws java.io.IOException { assertRebase ( localGit , contentMerge ) ; org.eclipse.jgit.revwalk.RevCommit remoteHead = getRemoteHead ( ) ; com.google.common.truth.Truth.assertThat ( remoteHead.getFooterLines ( "Reviewed-On" ) ) . isNotEmpty ( ) ; com.google.common.truth.Truth.assertThat ( remoteHead.getFooterLines ( "Reviewed-By" ) ) . isNotEmpty ( ) ; }
Source:
private void recursiveDeleteParent ( java.io.File file , java.io.File until ) { if ( file.equals ( until ) ) { return ; } if ( ( file.listFiles ( ) . length ) == 0 ) { java.io.File parent = file.getParentFile ( ) ; file.delete ( ) ; recursiveDeleteParent ( parent , until ) ; } }

Target:
private void recursiveDeleteParent ( java.io.File file , java.io.File until ) throws java.io.IOException { if ( file.equals ( until ) ) { return ; } if ( ( file.listFiles ( ) . length ) == 0 ) { java.io.File parent = file.getParentFile ( ) ; java.nio.file.Files.delete ( file.toPath ( ) ) ; recursiveDeleteParent ( parent , until ) ; } }
Source:
private static org.apache.lucene.store.Directory dir ( com.google.gerrit.server.index.Schema < com.google.gerrit.server.account.AccountState > schema , org.eclipse.jgit.lib.Config cfg , com.google.gerrit.server.config.SitePaths sitePaths ) throws java.io.IOException { if ( com.google.gerrit.lucene.LuceneIndexModule.isInMemoryTest ( cfg ) ) { return new org.apache.lucene.store.RAMDirectory ( ) ; } java.nio.file.Path indexDir = com.google.gerrit.lucene.LuceneVersionManager.getDir ( sitePaths , com.google.gerrit.lucene.LuceneAccountIndex.ACCOUNTS , schema ) ; return org.apache.lucene.store.FSDirectory.open ( indexDir ) ; }

Target:
private static org.apache.lucene.store.Directory dir ( com.google.gerrit.index.Schema < com.google.gerrit.server.account.AccountState > schema , org.eclipse.jgit.lib.Config cfg , com.google.gerrit.server.config.SitePaths sitePaths ) throws java.io.IOException { if ( com.google.gerrit.lucene.LuceneIndexModule.isInMemoryTest ( cfg ) ) { return new org.apache.lucene.store.RAMDirectory ( ) ; } java.nio.file.Path indexDir = com.google.gerrit.lucene.LuceneVersionManager.getDir ( sitePaths , com.google.gerrit.lucene.LuceneAccountIndex.ACCOUNTS , schema ) ; return org.apache.lucene.store.FSDirectory.open ( indexDir ) ; }
Source:
public void testAddSingleHashtag ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; java.util.List < java.lang.String > expected = java.util.Arrays.asList ( "tag2" ) ; assertResult ( POST ( changeId , "tag2" , null ) , expected ) ; assertResult ( GET ( changeId ) , expected ) ; expected = java.util.Arrays.asList ( "tag1" , "tag2" ) ; assertResult ( POST ( changeId , "tag1" , null ) , expected ) ; assertResult ( GET ( changeId ) , expected ) ; }

Target:
public void testAddAlreadyExistingHashtag ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; addHashtags ( r , "tag2" ) ; assertThatGet ( r ) . containsExactly ( "tag2" ) ; addHashtags ( r , "tag2" ) ; assertThatGet ( r ) . containsExactly ( "tag2" ) ; addHashtags ( r , "tag1" , "tag2" ) ; assertThatGet ( r ) . containsExactly ( "tag1" , "tag2" ) . inOrder ( ) ; }
Source:
public void run ( ) { int v = prefs.tabSize ( ) ; view.getCmFromSide ( DisplaySide.A ) . setOption ( "tabSize" , v ) ; view.getCmFromSide ( DisplaySide.B ) . setOption ( "tabSize" , v ) ; }

Target:
public void run ( ) { if ( ( ( getSelectedTheme ( ) ) == newTheme ) && ( isAttached ( ) ) ) { java.lang.String t = newTheme.name ( ) . toLowerCase ( ) ; view.getCmFromSide ( DisplaySide.A ) . setOption ( "theme" , t ) ; view.getCmFromSide ( DisplaySide.B ) . setOption ( "theme" , t ) ; view.setThemeStyles ( newTheme.isDark ( ) ) ; } }
Source:
public void validatePreMerge ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.server.git.CodeReviewCommit commit , com.google.gerrit.server.project.ProjectState destProject , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId , com.google.gerrit.server.IdentifiedUser caller ) throws com.google.gerrit.server.git.validators.MergeValidationException { java.util.List < com.google.gerrit.server.git.validators.MergeValidationListener > validators = com.google.common.collect.ImmutableList.of ( new com.google.gerrit.server.git.validators.MergeValidators.PluginMergeValidationListener ( mergeValidationListeners ) , projectConfigValidatorFactory.create ( ) ) ; for ( com.google.gerrit.server.git.validators.MergeValidationListener validator : validators ) { validator.onPreMerge ( repo , commit , destProject , destBranch , patchSetId , caller ) ; } }

Target:
public void validatePreMerge ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.server.git.CodeReviewCommit commit , com.google.gerrit.server.project.ProjectState destProject , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId , com.google.gerrit.server.IdentifiedUser caller ) throws com.google.gerrit.server.git.validators.MergeValidationException { java.util.List < com.google.gerrit.server.git.validators.MergeValidationListener > validators = com.google.common.collect.ImmutableList.of ( new com.google.gerrit.server.git.validators.MergeValidators.PluginMergeValidationListener ( mergeValidationListeners ) , projectConfigValidatorFactory.create ( ) , accountValidatorFactory.create ( ) ) ; for ( com.google.gerrit.server.git.validators.MergeValidationListener validator : validators ) { validator.onPreMerge ( repo , commit , destProject , destBranch , patchSetId , caller ) ; } }
Source:
public void run ( ) { try { final com.google.gerrit.server.mail.MergedSender cm = mergedSenderFactory.create ( result.change ) ; cm.setFrom ( currentUser.getAccountId ( ) ) ; cm.setPatchSet ( result.patchSet , result.info ) ; cm.send ( ) ; } catch ( java.lang.Exception e ) { final com.google.gerrit.reviewdb.client.PatchSet.Id psi = result.patchSet.getId ( ) ; com.google.gerrit.server.git.ReceiveCommits.log.error ( ( "Cannot send email for submitted patch set " + psi ) , e ) ; } }

Target:
public void run ( ) { try { final com.google.gerrit.server.mail.MergedSender cm = mergedSenderFactory.create ( result.change ) ; cm.setFrom ( currentUser.getAccountId ( ) ) ; cm.setPatchSet ( result.newPatchSet , result.info ) ; cm.send ( ) ; } catch ( java.lang.Exception e ) { final com.google.gerrit.reviewdb.client.PatchSet.Id psi = result.newPatchSet.getId ( ) ; com.google.gerrit.server.git.ReceiveCommits.log.error ( ( "Cannot send email for submitted patch set " + psi ) , e ) ; } }
Source:
public static java.lang.String refsUsers ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( com.google.gerrit.reviewdb.client.RefNames.REFS_USERS ) ; int account = accountId.get ( ) ; int m = account % 100 ; if ( m < 10 ) { r.append ( '0' ) ; } r.append ( m ) ; r.append ( '/' ) ; r.append ( account ) ; return r.toString ( ) ; }

Target:
private static java.lang.StringBuilder buildRefsPrefix ( java.lang.String prefix , int id ) { java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( prefix ) ; r.append ( com.google.gerrit.reviewdb.client.RefNames.shard ( id ) ) ; r.append ( '/' ) ; return r ; }
Source:
private static void assertCommentInfo ( com.google.gerrit.extensions.api.changes.ReviewInput.CommentInput expected , com.google.gerrit.extensions.common.CommentInfo actual ) { com.google.common.truth.Truth.assertThat ( actual.line ) . isEqualTo ( expected.line ) ; com.google.common.truth.Truth.assertThat ( actual.message ) . isEqualTo ( expected.message ) ; com.google.common.truth.Truth.assertThat ( actual.inReplyTo ) . isEqualTo ( expected.inReplyTo ) ; if ( ( actual.side ) == null ) { com.google.common.truth.Truth.assertThat ( Side.REVISION ) . isEqualTo ( expected.side ) ; } }

Target:
private static void assertCommentInfo ( com.google.gerrit.extensions.api.changes.ReviewInput.CommentInput expected , com.google.gerrit.extensions.common.CommentInfo actual ) { com.google.common.truth.Truth.assertThat ( actual.line ) . isEqualTo ( expected.line ) ; com.google.common.truth.Truth.assertThat ( actual.message ) . isEqualTo ( expected.message ) ; com.google.common.truth.Truth.assertThat ( actual.inReplyTo ) . isEqualTo ( expected.inReplyTo ) ; com.google.gerrit.acceptance.server.change.CommentsIT.assertCommentRange ( expected.range , actual.range ) ; if ( ( actual.side ) == null ) { com.google.common.truth.Truth.assertThat ( Side.REVISION ) . isEqualTo ( expected.side ) ; } }
Source:
void display ( final java.util.List < com.google.gerrit.client.account.AccountInfo > result ) { while ( 1 < ( table.getRowCount ( ) ) ) { table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; } for ( final com.google.gerrit.client.account.AccountInfo i : result ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , i ) ; } }

Target:
void display ( final java.util.List < com.google.gerrit.client.info.AccountInfo > result ) { while ( 1 < ( table.getRowCount ( ) ) ) { table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; } for ( final com.google.gerrit.client.info.AccountInfo i : result ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , i ) ; } }
Source:
public void onPluginLoad ( ) { com.google.gerrit.plugin.client.Plugin.get ( ) . screen ( "create" , new com.googlesource.gerrit.plugins.serviceuser.client.CreateServiceUserScreen.Factory ( ) ) ; com.google.gerrit.plugin.client.Plugin.get ( ) . screen ( "admin" , new com.googlesource.gerrit.plugins.serviceuser.client.ServiceUserAdminScreen.Factory ( ) ) ; com.google.gerrit.plugin.client.Plugin.get ( ) . screen ( "list" , new com.googlesource.gerrit.plugins.serviceuser.client.ServiceUserListScreen.Factory ( ) ) ; }

Target:
public void onPluginLoad ( ) { com.google.gerrit.plugin.client.Plugin.get ( ) . screen ( "create" , new com.googlesource.gerrit.plugins.serviceuser.client.CreateServiceUserScreen.Factory ( ) ) ; com.google.gerrit.plugin.client.Plugin.get ( ) . screen ( "admin" , new com.googlesource.gerrit.plugins.serviceuser.client.ServiceUserAdminScreen.Factory ( ) ) ; com.google.gerrit.plugin.client.Plugin.get ( ) . screen ( "list" , new com.googlesource.gerrit.plugins.serviceuser.client.ServiceUserListScreen.Factory ( ) ) ; com.google.gerrit.plugin.client.Plugin.get ( ) . screenRegex ( "user/(.*)" , new com.googlesource.gerrit.plugins.serviceuser.client.ServiceUserScreen.Factory ( ) ) ; }
Source:
public java.lang.Object apply ( com.google.gerrit.server.group.GroupResource resource , com.google.gerrit.server.group.PutMembers.PutMember.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.group.PutMembers.Input in = new com.google.gerrit.server.group.PutMembers.Input ( ) ; in._oneMember = id ; return put.get ( ) . apply ( resource , in ) ; }

Target:
public java.lang.Object apply ( com.google.gerrit.server.group.GroupResource resource , com.google.gerrit.server.group.PutMembers.PutMember.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.group.PutMembers.Input in = new com.google.gerrit.server.group.PutMembers.Input ( ) ; in._oneMember = id ; java.util.List < com.google.gerrit.server.group.MembersCollection.MemberInfo > list = put.get ( ) . apply ( resource , in ) ; if ( list.isEmpty ( ) ) { return com.google.gerrit.extensions.restapi.Response.none ( ) ; } else if ( ( list.size ( ) ) == 1 ) { return list.get ( 0 ) ; } else { throw new java.lang.IllegalStateException ( ) ; } }
Source:
private void redirectChooseProvider ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { com.google.gerrit.server.LoginServlet.forceLogout ( rsp ) ; final java.lang.StringBuffer url = req.getRequestURL ( ) ; url.append ( "?" ) ; url.append ( RelyingParty.DEFAULT_PARAMETER ) ; url.append ( "=" ) ; url.append ( org.mortbay.util.UrlEncoded.encodeString ( GoogleAccountDiscovery.GOOGLE_ACCOUNT ) ) ; url.append ( "&" ) ; com.google.gerrit.server.LoginServlet.appendCallbackParameter ( req , url ) ; rsp.sendRedirect ( url.toString ( ) ) ; }

Target:
private void redirectChooseProvider ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { final java.lang.StringBuilder url = new java.lang.StringBuilder ( req.getRequestURL ( ) ) ; com.google.gerrit.server.LoginServlet.append ( url , com.google.gerrit.server.LoginServlet.CALLBACK_PARMETER , req.getParameter ( com.google.gerrit.server.LoginServlet.CALLBACK_PARMETER ) ) ; com.google.gerrit.server.LoginServlet.append ( url , RelyingParty.DEFAULT_PARAMETER , GoogleAccountDiscovery.GOOGLE_ACCOUNT ) ; rsp.sendRedirect ( url.toString ( ) ) ; }
Source:
public < V > com.google.gerrit.metrics.CallbackMetric < V > newCallbackMetric ( java.lang.String name , java.lang.Class < V > valueClass , com.google.gerrit.metrics.Description desc ) { com.google.gerrit.metrics.CallbackMetric < V > m = root.newCallbackMetric ( ( ( prefix ) + name ) , valueClass , desc ) ; cleanup.add ( m ) ; return m ; }

Target:
public < V > com.google.gerrit.metrics.CallbackMetric0 < V > newCallbackMetric ( java.lang.String name , java.lang.Class < V > valueClass , com.google.gerrit.metrics.Description desc ) { com.google.gerrit.metrics.CallbackMetric0 < V > m = root.newCallbackMetric ( ( ( prefix ) + name ) , valueClass , desc ) ; cleanup.add ( m ) ; return m ; }
Source:
public void onSuccess ( com.google.gerrit.reviewdb.client.Change.Id changeId ) { enable ( true ) ; commitMessage.setText ( "" ) ; error.clear ( ) ; if ( changeId != null ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId ) ) ; } else { displayReadOnly ( access ) ; } }

Target:
public void onSuccess ( com.google.gerrit.reviewdb.client.Change.Id changeId ) { enable ( true ) ; commitMessage.setText ( "" ) ; error.clear ( ) ; if ( changeId != null ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( getProjectKey ( ) , changeId ) ) ; } else { displayReadOnly ( access ) ; } }