auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testToString ( ) { final com.google.gerrit.server.query.OrPredicateTest.TestPredicate a = com.google.gerrit.server.query.OrPredicateTest.f ( "q" , "alice" ) ; final com.google.gerrit.server.query.OrPredicateTest.TestPredicate b = com.google.gerrit.server.query.OrPredicateTest.f ( "q" , "bob" ) ; final com.google.gerrit.server.query.OrPredicateTest.TestPredicate c = com.google.gerrit.server.query.OrPredicateTest.f ( "q" , "charlie" ) ; org.junit.Assert.assertEquals ( "(q:alice OR q:bob)" , com.google.gerrit.server.query.Predicate.or ( a , b ) . toString ( ) ) ; org.junit.Assert.assertEquals ( "(q:alice OR q:bob OR q:charlie)" , com.google.gerrit.server.query.Predicate.or ( a , b , c ) . toString ( ) ) ; }

Target:
public void testToString ( ) { final com.google.gerrit.server.query.TestPredicate a = f ( "q" , "alice" ) ; final com.google.gerrit.server.query.TestPredicate b = f ( "q" , "bob" ) ; final com.google.gerrit.server.query.TestPredicate c = f ( "q" , "charlie" ) ; org.junit.Assert.assertEquals ( "(q:alice OR q:bob)" , com.google.gerrit.server.query.Predicate.or ( a , b ) . toString ( ) ) ; org.junit.Assert.assertEquals ( "(q:alice OR q:bob OR q:charlie)" , com.google.gerrit.server.query.Predicate.or ( a , b , c ) . toString ( ) ) ; }
Source:
net.codemirror.lib.CodeMirror getCmB ( ) { return cmB ; }

Target:
public void handle ( net.codemirror.lib.CodeMirror instance , int line , java.lang.String gutter , com.google.gwt.event.dom.client.MouseDownEvent clickEvent ) { instance.setCursor ( net.codemirror.lib.LineCharacter.create ( line ) ) ; instance.setActiveLine ( instance.getLineHandle ( line ) ) ; insertNewDraft ( instance ) . run ( ) ; }
Source:
public void registerKeys ( ) { super . registerKeys ( ) ; handlers.add ( com.google.gwtexpui.globalkey.client.GlobalKey.add ( this , keysNavigation ) ) ; handlers.add ( com.google.gwtexpui.globalkey.client.GlobalKey.add ( this , keysAction ) ) ; files.registerKeys ( ) ; related.registerKeys ( ) ; }

Target:
public void onShowView ( ) { super . onShowView ( ) ; commit.onShowView ( ) ; related.setMaxHeight ( commit.getElement ( ) . getParentElement ( ) . getOffsetHeight ( ) ) ; if ( openReplyBox ) { onReply ( ) ; } else { java.lang.String prior = com.google.gerrit.client.Gerrit.getPriorView ( ) ; if ( ( prior != null ) && ( prior.startsWith ( "/c/" ) ) ) { scrollToPath ( prior.substring ( 3 ) ) ; } } startPoller ( ) ; }
Source:
protected void run ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { try { if ( luceneVersionManager.activateLatestIndex ( name ) ) { stdout.println ( "Activated latest index version" ) ; } else { stdout.println ( "Not activating index, already using latest version" ) ; } } catch ( com.google.gerrit.lucene.ReindexerAlreadyRunningException e ) { throw new com.google.gerrit.sshd.commands.UnloggedFailure ( ( "Failed to activate latest index: " + ( e.getMessage ( ) ) ) ) ; } }

Target:
protected void run ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { try { if ( luceneVersionManager.activateLatestIndex ( name ) ) { stdout.println ( "Activated latest index version" ) ; } else { stdout.println ( "Not activating index, already using latest version" ) ; } } catch ( com.google.gerrit.lucene.ReindexerAlreadyRunningException e ) { throw die ( ( "Failed to activate latest index: " + ( e.getMessage ( ) ) ) ) ; } }
Source:
private boolean isVisible ( com.google.gerrit.reviewdb.server.ReviewDb db , @ com.google.gerrit.common.Nullable com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { if ( ( getChange ( ) . isPrivate ( ) ) && ( ! ( isPrivateVisible ( db , cd ) ) ) ) { return false ; } return refControl.isVisible ( ) ; }

Target:
private boolean isVisible ( com.google.gerrit.reviewdb.server.ReviewDb db , @ com.google.gerrit.common.Nullable com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { if ( ( getChange ( ) . isPrivate ( ) ) && ( ! ( isPrivateVisible ( db , cd ) ) ) ) { return false ; } return ( refControl.isVisible ( ) ) && ( getProjectControl ( ) . getProject ( ) . getState ( ) . permitsRead ( ) ) ; }
Source:
private java.util.Map < java.lang.String , com.google.gerrit.server.dashboard.ListDashboards.DashboardInfo > addProjectDashboards ( final com.google.gerrit.server.project.ProjectState projectState , java.util.Map < java.lang.String , com.google.gerrit.server.dashboard.ListDashboards.DashboardInfo > all ) { final java.util.Map < java.lang.String , com.google.gerrit.server.dashboard.ListDashboards.DashboardInfo > dashboards = projectDashboards ( projectState ) ; dashboards.putAll ( all ) ; return dashboards ; }

Target:
private java.util.Map < java.lang.String , com.google.gerrit.server.dashboard.ListDashboards.DashboardInfo > addProjectDashboards ( final com.google.gerrit.server.project.ProjectState projectState , java.util.Map < java.lang.String , com.google.gerrit.server.dashboard.ListDashboards.DashboardInfo > all , final java.lang.String defaultId ) { final java.util.Map < java.lang.String , com.google.gerrit.server.dashboard.ListDashboards.DashboardInfo > dashboards = projectDashboards ( projectState , defaultId ) ; dashboards.putAll ( all ) ; return dashboards ; }
Source:
public static void grant ( com.google.gerrit.server.git.ProjectConfig config , com.google.gerrit.common.data.AccessSection section , java.lang.String permission , boolean force , com.google.gerrit.common.data.GroupReference ... groupList ) { com.google.gerrit.common.data.Permission p = section.getPermission ( permission , true ) ; for ( com.google.gerrit.common.data.GroupReference group : groupList ) { if ( group != null ) { com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.schema.AclUtil.rule ( config , group ) ; r.setForce ( force ) ; p.add ( r ) ; } } }

Target:
public static void grant ( com.google.gerrit.server.git.ProjectConfig config , com.google.gerrit.common.data.AccessSection section , java.lang.String permission , boolean force , java.lang.Boolean exclusive , com.google.gerrit.common.data.GroupReference ... groupList ) { com.google.gerrit.common.data.Permission p = section.getPermission ( permission , true ) ; if ( exclusive != null ) { p.setExclusiveGroup ( exclusive ) ; } for ( com.google.gerrit.common.data.GroupReference group : groupList ) { if ( group != null ) { com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.schema.AclUtil.rule ( config , group ) ; r.setForce ( force ) ; p.add ( r ) ; } } }
Source:
public UiAction.Description getDescription ( com.google.gerrit.server.change.ChangeResource resource ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Revert" ) . setVisible ( ( ( ( resource.getChange ( ) . getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.MERGED ) ) && ( resource.getControl ( ) . getRefControl ( ) . canUpload ( ) ) ) ) ; }

Target:
public UiAction.Description getDescription ( com.google.gerrit.server.change.ChangeResource resource ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Revert" ) . setTitle ( "Revert the change" ) . setVisible ( ( ( ( resource.getChange ( ) . getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.MERGED ) ) && ( resource.getControl ( ) . getRefControl ( ) . canUpload ( ) ) ) ) ; }
Source:
static com.google.gerrit.acceptance.GerritServer.Description forTestClass ( com.google.gerrit.acceptance.Description testDesc , java.lang.String configName ) { }

Target:
static com.google.gerrit.acceptance.GerritServer.Description forTestClass ( com.google.gerrit.acceptance.Description testDesc , java.lang.String configName ) { return new com.google.gerrit.acceptance.AutoValue_GerritServer_Description ( configName , true , ( ! ( com.google.gerrit.acceptance.GerritServer.Description.has ( com.google.gerrit.acceptance.NoHttpd.class , testDesc.getTestClass ( ) ) ) ) , com.google.gerrit.acceptance.GerritServer.Description.has ( com.google.gerrit.acceptance.Sandboxed.class , testDesc.getTestClass ( ) ) , null , null ) ; }
Source:
public static com.google.gerrit.server.query.change.QueryOptions create ( com.google.gerrit.server.index.IndexConfig config , int start , int limit ) { com.google.common.base.Preconditions.checkArgument ( ( start >= 0 ) , "start must be nonnegative: %s" , start ) ; com.google.common.base.Preconditions.checkArgument ( ( limit > 0 ) , "limit must be positive: %s" , limit ) ; return new com.google.gerrit.server.query.change.AutoValue_QueryOptions ( config , start , limit ) ; }

Target:
public static com.google.gerrit.server.query.change.QueryOptions create ( com.google.gerrit.server.index.IndexConfig config , int start , int limit , java.util.Set < java.lang.String > fields ) { com.google.common.base.Preconditions.checkArgument ( ( start >= 0 ) , "start must be nonnegative: %s" , start ) ; com.google.common.base.Preconditions.checkArgument ( ( limit > 0 ) , "limit must be positive: %s" , limit ) ; return new com.google.gerrit.server.query.change.AutoValue_QueryOptions ( config , start , limit , com.google.common.collect.ImmutableSet.copyOf ( fields ) ) ; }
Source:
private void populateTableHeader ( final com.google.gerrit.common.data.PatchScript script , final com.google.gerrit.common.data.PatchSetDetail detail ) { prepareHeaderWidgets ( script , detail ) ; table.setWidget ( com.google.gerrit.client.patches.R_HEAD , com.google.gerrit.client.patches.UnifiedDiffTable.PC , psListOfHeaderA ) ; table.setWidget ( rowOfTableHeaderB , com.google.gerrit.client.patches.UnifiedDiffTable.PC , psListOfHeaderB ) ; table.getFlexCellFormatter ( ) . addStyleName ( com.google.gerrit.client.patches.R_HEAD , com.google.gerrit.client.patches.UnifiedDiffTable.PC , Gerrit.RESOURCES.css ( ) . unifiedTableHeader ( ) ) ; table.getFlexCellFormatter ( ) . addStyleName ( rowOfTableHeaderB , com.google.gerrit.client.patches.UnifiedDiffTable.PC , Gerrit.RESOURCES.css ( ) . unifiedTableHeader ( ) ) ; }

Target:
protected void createFileCommentEditorOnSideA ( ) { createCommentEditor ( ( ( R_HEAD ) + 1 ) , com.google.gerrit.client.patches.UnifiedDiffTable.PC , com.google.gerrit.client.patches.R_HEAD , com.google.gerrit.client.patches.FILE_SIDE_A ) ; return ; }
Source:
public com.google.gerrit.extensions.restapi.BinaryResult apply ( com.google.gerrit.server.change.FileResource rsrc ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { java.lang.String path = rsrc.getPatchKey ( ) . get ( ) ; com.google.gerrit.server.project.ProjectState projectState = rsrc.getRevision ( ) . getControl ( ) . getProjectControl ( ) . getProjectState ( ) ; org.eclipse.jgit.lib.ObjectId revstr = org.eclipse.jgit.lib.ObjectId.fromString ( rsrc.getRevision ( ) . getPatchSet ( ) . getRevision ( ) . get ( ) ) ; return fileContentUtil.downloadContent ( projectState , revstr , path , parent ) ; }

Target:
public com.google.gerrit.extensions.restapi.BinaryResult apply ( com.google.gerrit.server.change.FileResource rsrc ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { java.lang.String path = rsrc.getPatchKey ( ) . get ( ) ; com.google.gerrit.server.change.RevisionResource rev = rsrc.getRevision ( ) ; org.eclipse.jgit.lib.ObjectId revstr = org.eclipse.jgit.lib.ObjectId.fromString ( rev.getPatchSet ( ) . getRevision ( ) . get ( ) ) ; return fileContentUtil.downloadContent ( projectCache.checkedGet ( rev.getProject ( ) ) , revstr , path , parent ) ; }
Source:
protected void onStarClick ( final int row ) { final com.google.gerrit.client.data.ChangeInfo c = getChangeInfo ( row ) ; if ( ( c != null ) && ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { c.setStarred ( ( ! ( c.isStarred ( ) ) ) ) ; setStar ( row , c ) ; final com.google.gerrit.client.changes.ToggleStarRequest req = new com.google.gerrit.client.changes.ToggleStarRequest ( ) ; req.toggle ( c.getId ( ) , c.isStarred ( ) ) ; Util.LIST_SVC.toggleStars ( req , VoidCallback.INSTANCE ) ; } }

Target:
public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { }
Source:
private com.google.gerrit.server.project.SubmitRuleEvaluator makeEvaluator ( ) { com.google.gerrit.server.query.change.ChangeData cd = com.google.gerrit.server.query.change.ChangeData.createForTest ( project , new com.google.gerrit.reviewdb.client.Change.Id ( 1 ) , 1 ) ; cd.setChange ( com.google.gerrit.testing.TestChanges.newChange ( project , admin.id ) ) ; return evaluatorFactory.create ( cd ) ; }

Target:
private com.google.gerrit.server.query.change.ChangeData makeChangeData ( ) { com.google.gerrit.server.query.change.ChangeData cd = com.google.gerrit.server.query.change.ChangeData.createForTest ( project , new com.google.gerrit.reviewdb.client.Change.Id ( 1 ) , 1 ) ; cd.setChange ( com.google.gerrit.testing.TestChanges.newChange ( project , admin.id ) ) ; return cd ; }
Source:
public static com.google.gerrit.reviewdb.client.Change newChange ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.server.IdentifiedUser user , int id ) { com.google.gerrit.reviewdb.client.Change.Id changeId = new com.google.gerrit.reviewdb.client.Change.Id ( id ) ; com.google.gerrit.reviewdb.client.Change c = new com.google.gerrit.reviewdb.client.Change ( new com.google.gerrit.reviewdb.client.Change.Key ( "Iabcd1234abcd1234abcd1234abcd1234abcd1234" ) , changeId , user.getAccount ( ) . getId ( ) , new com.google.gerrit.reviewdb.client.Branch.NameKey ( project , "master" ) , com.google.gerrit.server.util.TimeUtil.nowTs ( ) ) ; com.google.gerrit.testutil.TestChanges.incrementPatchSet ( c ) ; return c ; }

Target:
public static com.google.gerrit.reviewdb.client.Change newChange ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.server.IdentifiedUser user , int id ) { com.google.gerrit.reviewdb.client.Change.Id changeId = new com.google.gerrit.reviewdb.client.Change.Id ( id ) ; com.google.gerrit.reviewdb.client.Change c = new com.google.gerrit.reviewdb.client.Change ( new com.google.gerrit.reviewdb.client.Change.Key ( "Iabcd1234abcd1234abcd1234abcd1234abcd1234" ) , changeId , user.getAccount ( ) . getId ( ) , new com.google.gerrit.reviewdb.client.Branch.NameKey ( project , "master" ) , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; com.google.gerrit.testutil.TestChanges.incrementPatchSet ( c ) ; return c ; }
Source:
public void run ( ) throws java.lang.Exception { processor.setOutput ( out , QueryProcessor.OutputFormat.TEXT ) ; parseCommandLine ( ) ; verifyCommandLine ( ) ; processor.query ( com.google.gerrit.sshd.commands.Query.join ( query , " " ) ) ; }

Target:
protected void parseCommandLine ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { processor.setOutput ( out , QueryProcessor.OutputFormat.TEXT ) ; super . parseCommandLine ( ) ; if ( ( processor.getIncludeFiles ( ) ) && ( ! ( ( processor.getIncludePatchSets ( ) ) || ( processor.getIncludeCurrentPatchSet ( ) ) ) ) ) { throw new com.google.gerrit.sshd.commands.UnloggedFailure ( 1 , "--files option needs --patch-sets or --current-patch-set" ) ; } }
Source:
public boolean hasRepositoryPermission ( java.lang.String name ) { boolean result = false ; try { name = getRepositoryName ( name ) ; com.google.gerrit.server.project.ProjectControl control = projectControlFactory.controlFor ( new com.google.gerrit.reviewdb.client.Project.NameKey ( name ) ) ; result = ( control != null ) && ( ! ( control.isHidden ( ) ) ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { result = false ; } return result ; }

Target:
public boolean hasRepositoryPermission ( java.lang.String name ) { boolean result = false ; try { name = getRepositoryName ( name ) ; com.google.gerrit.server.project.ProjectControl control = projectControlFactory.controlFor ( new com.google.gerrit.reviewdb.client.Project.NameKey ( name ) ) ; result = ( control != null ) && ( ! ( control.getProject ( ) . getState ( ) . equals ( ProjectState.HIDDEN ) ) ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { result = false ; } return result ; }
Source:
public static GroupDescription.Internal forAccountGroup ( com.google.gerrit.reviewdb.client.AccountGroup group ) { return new com.google.gerrit.common.data.GroupDescription.Internal ( ) { @ java.lang.Override public AccountGroup.UUID getGroupUUID ( ) { return group.getGroupUUID ( ) ; } @ java.lang.Override public java.lang.String getName ( ) { return group.getName ( ) ; } @ java.lang.Override public com.google.gerrit.reviewdb.client.AccountGroup getAccountGroup ( ) { return group ; } @ java.lang.Override @ com.google.gerrit.common.Nullable public java.lang.String getEmailAddress ( ) { return null ; } @ java.lang.Override @ com.google.gerrit.common.Nullable public java.lang.String getUrl ( ) { return "#" + ( com.google.gerrit.common.PageLinks.toGroup ( getGroupUUID ( ) ) ) ; } } ; }

Target:
public java.sql.Timestamp getCreatedOn ( ) { return group.getCreatedOn ( ) ; }
Source:
public java.util.Collection < com.google.gerrit.reviewdb.client.PatchLineComment > comments ( com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > db ) throws com.google.gwtorm.server.OrmException { if ( ( comments ) == null ) { comments = db.get ( ) . patchComments ( ) . byChange ( legacyId ) . toList ( ) ; } return comments ; }

Target:
public com.google.common.collect.ListMultimap < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchSetApproval > allApprovalsMap ( ) throws com.google.gwtorm.server.OrmException { if ( ( allApprovals ) == null ) { allApprovals = com.google.common.collect.ArrayListMultimap.create ( ) ; for ( com.google.gerrit.reviewdb.client.PatchSetApproval psa : com.google.gerrit.server.ApprovalsUtil.sortApprovals ( db.patchSetApprovals ( ) . byChange ( legacyId ) ) ) { allApprovals.put ( psa.getPatchSetId ( ) , psa ) ; } } return allApprovals ; }
Source:
public void testIsSuccessful ( ) throws java.lang.Exception { org.apache.http.HttpResponse response = setupMocks ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandlerTest.OK , com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandlerTest.EMPTY_ENTITY ) ; com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult result = handler.handleResponse ( response ) ; com.google.common.truth.Truth.assertThat ( result.isSuccessful ( ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( result.getMessage ( ) ) . isEmpty ( ) ; }

Target:
public void testIsSuccessful ( ) throws java.lang.Exception { org.apache.http.HttpResponse response = setupMocks ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandlerTest.NO_CONTENT , com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandlerTest.EMPTY_ENTITY ) ; com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult result = handler.handleResponse ( response ) ; com.google.common.truth.Truth.assertThat ( result.isSuccessful ( ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( result.getMessage ( ) ) . isEmpty ( ) ; }
Source:
private void afterTest ( ) throws java.lang.Exception { server.stop ( ) ; }

Target:
protected com.google.gerrit.extensions.common.ChangeInfo get ( java.lang.String id , com.google.gerrit.extensions.common.ListChangesOption ... options ) throws com.google.gerrit.extensions.restapi.RestApiException { java.util.EnumSet < com.google.gerrit.extensions.common.ListChangesOption > s = java.util.EnumSet.noneOf ( com.google.gerrit.extensions.common.ListChangesOption.class ) ; s.addAll ( java.util.Arrays.asList ( options ) ) ; return gApi.changes ( ) . id ( id ) . get ( s ) ; }
Source:
public void onPreMerge ( 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 { if ( ( ! ( allUsersName.equals ( destProject.getNameKey ( ) ) ) ) || ( ! ( destBranch.get ( ) . startsWith ( RefNames.REFS_GROUPS ) ) ) ) { return ; } throw new com.google.gerrit.server.git.validators.MergeValidationException ( "group update not allowed" ) ; }

Target:
public void onPreMerge ( 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 { if ( ( ! ( allUsersName.equals ( destProject.getNameKey ( ) ) ) ) || ( ( ! ( destBranch.get ( ) . startsWith ( RefNames.REFS_GROUPS ) ) ) && ( ! ( destBranch.get ( ) . equals ( RefNames.REFS_GROUPNAMES ) ) ) ) ) { return ; } throw new com.google.gerrit.server.git.validators.MergeValidationException ( "group update not allowed" ) ; }
Source:
public T get ( ) { final com.google.gerrit.server.ssh.SshScopes.Context ctx = com.google.gerrit.server.ssh.SshScopes.getContext ( ) ; final java.util.Map < com.google.inject.Key < ? > , java.lang.Object > map = ctx.session.sessionContext.map ; synchronized ( map ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) T t = ( ( T ) ( map.get ( key ) ) ) ; if ( t == null ) { t = creator.get ( ) ; map.put ( key , t ) ; } return t ; } }

Target:
public T get ( ) { final com.google.gerrit.server.ssh.SshScopes.Context ctx = com.google.gerrit.server.ssh.SshScopes.getContext ( ) ; final java.util.Map < com.google.inject.Key < ? > , java.lang.Object > map = ctx.session.getAttribute ( com.google.gerrit.server.ssh.SshScopes.sessionMap ) ; synchronized ( map ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) T t = ( ( T ) ( map.get ( key ) ) ) ; if ( t == null ) { t = creator.get ( ) ; map.put ( key , t ) ; } return t ; } }
Source:
private void postMessage ( java.lang.String changeId , java.lang.String msg ) throws java.lang.Exception { com.google.gerrit.extensions.api.changes.ReviewInput in = new com.google.gerrit.extensions.api.changes.ReviewInput ( ) ; in.message = msg ; gApi.changes ( ) . id ( changeId ) . current ( ) . review ( in ) ; }

Target:
private void postMessage ( java.lang.String changeId , java.lang.String msg , java.lang.String tag ) throws java.lang.Exception { com.google.gerrit.extensions.api.changes.ReviewInput in = new com.google.gerrit.extensions.api.changes.ReviewInput ( ) ; in.message = msg ; in.tag = tag ; gApi.changes ( ) . id ( changeId ) . current ( ) . review ( in ) ; }
Source:
public void testSyncUrlProvider ( ) { com.ericsson.gerrit.plugins.syncindex.Configuration configMock = createNiceMock ( com.ericsson.gerrit.plugins.syncindex.Configuration.class ) ; java.lang.String expected = "someUrl" ; org.easymock.EasyMock.expect ( configMock.getUrl ( ) ) . andReturn ( expected ) ; replayAll ( ) ; com.ericsson.gerrit.plugins.syncindex.Module module = new com.ericsson.gerrit.plugins.syncindex.Module ( ) ; com.google.common.truth.Truth.assertThat ( module.syncUrl ( configMock ) ) . isEqualTo ( expected ) ; }

Target:
public void testSyncUrlProvider ( ) { com.ericsson.gerrit.plugins.syncindex.Configuration configMock = org.mockito.Mockito.mock ( com.ericsson.gerrit.plugins.syncindex.Configuration.class ) ; java.lang.String expected = "someUrl" ; org.mockito.Mockito.when ( configMock.getUrl ( ) ) . thenReturn ( expected ) ; com.ericsson.gerrit.plugins.syncindex.Module module = new com.ericsson.gerrit.plugins.syncindex.Module ( ) ; com.google.common.truth.Truth.assertThat ( module.syncUrl ( configMock ) ) . isEqualTo ( expected ) ; }
Source:
private void saveLabelConfig ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; cfg.getLabelSections ( ) . put ( label.getName ( ) , label ) ; cfg.getLabelSections ( ) . put ( P.getName ( ) , P ) ; saveProjectConfig ( project , cfg ) ; }

Target:
private void saveLabelConfig ( ) throws java.lang.Exception { com.google.gerrit.server.project.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; cfg.getLabelSections ( ) . put ( label.getName ( ) , label ) ; cfg.getLabelSections ( ) . put ( P.getName ( ) , P ) ; saveProjectConfig ( project , cfg ) ; }
Source:
private void parseDelete ( final org.eclipse.jgit.transport.ReceiveCommand cmd ) { com.google.gerrit.server.project.RefControl ctl = projectControl.controlForRef ( cmd.getRefName ( ) ) ; if ( ctl.canDelete ( ) ) { cmd.execute ( rp ) ; } else { reject ( cmd , "can not delete references" ) ; } }

Target:
private void parseDelete ( final org.eclipse.jgit.transport.ReceiveCommand cmd ) { com.google.gerrit.server.project.RefControl ctl = projectControl.controlForRef ( cmd.getRefName ( ) ) ; if ( ctl.canDelete ( ) ) { if ( ( cmd.getResult ( ) ) == ( org.eclipse.jgit.transport.ReceiveCommand.Result.NOT_ATTEMPTED ) ) { cmd.execute ( rp ) ; } } else { reject ( cmd , "can not delete references" ) ; } }
Source:
public void empty1 ( ) { final java.lang.String name = "empty-file" ; final com.google.gerrit.server.patch.PatchListEntry e = com.google.gerrit.server.patch.PatchListEntry.empty ( name ) ; org.junit.Assert.assertNull ( e.getOldName ( ) ) ; org.junit.Assert.assertEquals ( name , e.getNewName ( ) ) ; org.junit.Assert.assertSame ( Patch.PatchType.UNIFIED , e.getPatchType ( ) ) ; org.junit.Assert.assertSame ( Patch.ChangeType.MODIFIED , e.getChangeType ( ) ) ; org.junit.Assert.assertTrue ( e.getEdits ( ) . isEmpty ( ) ) ; }

Target:
public void empty1 ( ) { final java.lang.String name = "empty-file" ; final com.google.gerrit.server.diff.PatchListEntry e = com.google.gerrit.server.diff.PatchListEntry.empty ( name ) ; org.junit.Assert.assertNull ( e.getOldName ( ) ) ; org.junit.Assert.assertEquals ( name , e.getNewName ( ) ) ; org.junit.Assert.assertSame ( Patch.PatchType.UNIFIED , e.getPatchType ( ) ) ; org.junit.Assert.assertSame ( Patch.ChangeType.MODIFIED , e.getChangeType ( ) ) ; org.junit.Assert.assertTrue ( e.getEdits ( ) . isEmpty ( ) ) ; }
Source:
public com.google.gerrit.extensions.common.ChangeInfo addChangeActions ( com.google.gerrit.extensions.common.ChangeInfo to , com.google.gerrit.server.project.ChangeControl ctl ) { to.actions = toActionMap ( ctl ) ; return to ; }

Target:
public java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > format ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.extensions.common.ChangeInfo changeInfo = null ; com.google.gerrit.extensions.common.RevisionInfo revisionInfo = null ; java.util.List < com.google.gerrit.extensions.api.changes.ActionVisitor > visitors = visitors ( ) ; if ( ! ( visitors.isEmpty ( ) ) ) { changeInfo = changeJson ( ) . format ( rsrc ) ; revisionInfo = com.google.common.base.Preconditions.checkNotNull ( com.google.common.collect.Iterables.getOnlyElement ( changeInfo.revisions.values ( ) ) ) ; changeInfo.revisions = null ; } return toActionMap ( rsrc , visitors , changeInfo , revisionInfo ) ; }
Source:
private static java.lang.String stripPrefix ( @ javax.annotation.Nullable java.lang.String prefix , java.lang.String name ) { return prefix != null ? name.substring ( ( ( prefix.length ( ) ) + 1 ) ) : name ; }

Target:
private static java.lang.String stripPrefix ( @ javax.annotation.Nullable java.lang.String prefix , java.lang.String name ) { if ( ( prefix != null ) && ( name.startsWith ( prefix ) ) ) { return name.substring ( ( ( prefix.length ( ) ) + 1 ) ) ; } return name ; }
Source:
private com.google.gwtorm.jdbc.JdbcSchema setupSchema ( final com.google.gwtorm.schema.sql.SqlDialect dialect ) { @ java.lang.SuppressWarnings ( value = "rawtypes" ) com.google.gwtorm.jdbc.Database db = org.mockito.Mockito.mock ( com.google.gwtorm.jdbc.Database.class ) ; try { org.mockito.Mockito.stub ( db.getDialect ( ) ) . toReturn ( dialect ) ; com.google.gwtorm.jdbc.JdbcSchema schema = new com.google.gwtorm.jdbc.TestJdbcAccess.Schema ( db , conn ) ; return schema ; } catch ( com.google.gwtorm.client.OrmException e ) { throw new java.lang.RuntimeException ( e ) ; } }

Target:
private com.google.gwtorm.jdbc.JdbcSchema setupSchema ( final com.google.gwtorm.schema.sql.SqlDialect dialect ) { @ java.lang.SuppressWarnings ( value = "rawtypes" ) com.google.gwtorm.jdbc.Database db = org.mockito.Mockito.mock ( com.google.gwtorm.jdbc.Database.class ) ; try { org.mockito.Mockito.when ( db.getDialect ( ) ) . thenReturn ( dialect ) ; org.mockito.Mockito.when ( db.newConnection ( ) ) . thenReturn ( conn ) ; com.google.gwtorm.jdbc.JdbcSchema schema = new com.google.gwtorm.jdbc.TestJdbcAccess.Schema ( db ) ; return schema ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.lang.RuntimeException ( e ) ; } }
Source:
static void link ( com.google.gerrit.client.diff.PaddingManager a , com.google.gerrit.client.diff.PaddingManager b ) { a.other = b ; b.other = a ; }

Target:
static void link ( com.google.gerrit.client.diff.PaddingManager a , com.google.gerrit.client.diff.PaddingManager b ) { if ( ! ( a.others.contains ( b ) ) ) { a.others.add ( b ) ; } if ( ! ( b.others.contains ( a ) ) ) { b.others.add ( a ) ; } }
Source:
public void onSuccess ( com.googlesource.gerrit.plugins.xdocs.client.CommitInfo commit ) { if ( ( commit.parents ( ) ) != null ) { java.util.List < com.googlesource.gerrit.plugins.xdocs.client.CommitInfo > parents = com.google.gerrit.client.rpc.Natives.asList ( commit.parents ( ) ) ; if ( ! ( parents.isEmpty ( ) ) ) { revisionA = parents.get ( 0 ) . commit ( ) ; } } show ( change ) ; }

Target:
public void onSuccess ( com.googlesource.gerrit.plugins.xdocs.client.ChangeInfo.EditInfo edit ) { if ( edit != null ) { change.revisions ( ) . put ( edit.name ( ) , com.googlesource.gerrit.plugins.xdocs.client.ChangeInfo.RevisionInfo.fromEdit ( edit ) ) ; } initRevisionsAndShow ( change ) ; }
Source:
private boolean finite ( java.lang.String pattern ) { if ( pattern.startsWith ( RefRight.REGEX_PREFIX ) ) { return com.google.gerrit.server.project.RefControl.toRegExp ( pattern ) . toAutomaton ( ) . isFinite ( ) ; } else if ( pattern.endsWith ( "/*" ) ) { return false ; } else { return true ; } }

Target:
private boolean finite ( java.lang.String pattern ) { if ( com.google.gerrit.server.project.RefControl.isRE ( pattern ) ) { return com.google.gerrit.server.project.RefControl.toRegExp ( pattern ) . toAutomaton ( ) . isFinite ( ) ; } else if ( pattern.endsWith ( "/*" ) ) { return false ; } else { return true ; } }
Source:
private void bccWatchesNotifySubmittedChanges ( ) { try { for ( final com.google.gerrit.reviewdb.AccountProjectWatch w : getWatches ( ) ) { if ( w.isNotifySubmittedChanges ( ) ) { add ( RecipientType.BCC , w.getAccountId ( ) ) ; } } } catch ( com.google.gwtorm.client.OrmException err ) { } }

Target:
private void bccWatchesNotifySubmittedChanges ( ) { try { for ( final com.google.gerrit.reviewdb.AccountProjectWatch w : getWatches ( ) ) { if ( w.isNotify ( NotifyType.SUBMITTED_CHANGES ) ) { add ( RecipientType.BCC , w.getAccountId ( ) ) ; } } } catch ( com.google.gwtorm.client.OrmException err ) { } }
Source:
public void missingKey ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key2 = com.google.gerrit.gpg.testutil.TestKeys.key2 ( ) ; org.eclipse.jgit.transport.PushCertificate cert = newSignedCert ( validNonce ( ) , key2 ) ; assertProblems ( cert , ( "No public keys found for key ID " + ( com.google.gerrit.gpg.PublicKeyStore.keyIdToString ( key2.getKeyId ( ) ) ) ) ) ; }

Target:
public void missingKey ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key2 = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithExpiration ( ) ; org.eclipse.jgit.transport.PushCertificate cert = newSignedCert ( validNonce ( ) , key2 ) ; assertProblems ( cert , ( "No public keys found for key ID " + ( com.google.gerrit.gpg.PublicKeyStore.keyIdToString ( key2.getKeyId ( ) ) ) ) ) ; }
Source:
public void index ( com.google.gerrit.reviewdb.client.Account.Id id ) throws java.io.IOException { for ( com.google.gerrit.server.index.Index < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.server.account.AccountState > i : getWriteIndexes ( ) ) { com.google.gerrit.server.account.AccountState accountState = byIdCache.getOrNull ( id ) ; if ( accountState != null ) { i.replace ( accountState ) ; } else { i.delete ( id ) ; } } fireAccountIndexedEvent ( id.get ( ) ) ; }

Target:
public void index ( com.google.gerrit.reviewdb.client.Account.Id id ) throws java.io.IOException { for ( com.google.gerrit.index.Index < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.server.account.AccountState > i : getWriteIndexes ( ) ) { com.google.gerrit.server.account.AccountState accountState = byIdCache.getOrNull ( id ) ; if ( accountState != null ) { i.replace ( accountState ) ; } else { i.delete ( id ) ; } } fireAccountIndexedEvent ( id.get ( ) ) ; }
Source:
private void index ( com.google.gerrit.server.project.ProjectControl projectControl ) { try { index.apply ( new com.google.gerrit.server.project.ProjectResource ( projectControl ) , null ) ; } catch ( java.lang.Exception e ) { writeError ( "error" , java.lang.String.format ( "Unable to index %s: %s" , projectControl.getProject ( ) . getName ( ) , e.getMessage ( ) ) ) ; } }

Target:
private void index ( com.google.gerrit.server.project.ProjectControl projectControl ) { try { index.apply ( new com.google.gerrit.server.project.ProjectResource ( projectControl.getProjectState ( ) , projectControl.getUser ( ) ) , null ) ; } catch ( java.lang.Exception e ) { writeError ( "error" , java.lang.String.format ( "Unable to index %s: %s" , projectControl.getProject ( ) . getName ( ) , e.getMessage ( ) ) ) ; } }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { save.setEnabled ( false ) ; com.google.gerrit.client.projects.ProjectApi.setHead ( getProjectKey ( ) , input.getValue ( ) . trim ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.rpc.NativeString > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.rpc.NativeString result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toProjectTags ( getProjectKey ( ) ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { super . onFailure ( caught ) ; save.setEnabled ( true ) ; } } ) ; }

Target:
private void deleteTags ( final java.util.Set < java.lang.String > tags ) { com.google.gerrit.client.projects.ProjectApi.deleteTags ( getProjectKey ( ) , tags , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { query = new com.google.gerrit.client.admin.ProjectTagsScreen.Query ( match ) . start ( start ) . run ( ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { query = new com.google.gerrit.client.admin.ProjectTagsScreen.Query ( match ) . start ( start ) . run ( ) ; super . onFailure ( caught ) ; } } ) ; }
Source:
void setRoot ( org.pegdown.ast.RootNode doc ) { outline = new java.util.ArrayList < > ( ) ; com.google.common.collect.Multimap < java.lang.String , com.google.gitiles.doc.TocFormatter.TocEntry > entries = com.google.common.collect.ArrayListMultimap.create ( 16 , 4 ) ; scan ( doc , entries , new java.util.ArrayDeque < org.pegdown.ast.HeaderNode > ( ) ) ; ids = generateIds ( entries ) ; }

Target:
void setRoot ( org.commonmark.node.Node doc ) { outline = new java.util.ArrayList < > ( ) ; com.google.common.collect.Multimap < java.lang.String , com.google.gitiles.doc.TocFormatter.TocEntry > entries = com.google.common.collect.ArrayListMultimap.create ( 16 , 4 ) ; scan ( doc , entries , new java.util.ArrayDeque < org.commonmark.node.Heading > ( ) ) ; ids = generateIds ( entries ) ; }
Source:
private com.google.gerrit.server.project.ProjectData toProjectData ( com.google.gson.JsonElement json ) { com.google.gson.JsonElement source = json.getAsJsonObject ( ) . get ( "_source" ) ; if ( source == null ) { source = json.getAsJsonObject ( ) . get ( "fields" ) ; } com.google.gerrit.reviewdb.client.Project.NameKey nameKey = new com.google.gerrit.reviewdb.client.Project.NameKey ( source.getAsJsonObject ( ) . get ( ProjectField.NAME.getName ( ) ) . getAsString ( ) ) ; return projectCache.get ( ) . get ( nameKey ) . toProjectData ( ) ; }

Target:
protected com.google.gerrit.server.project.ProjectData fromDocument ( com.google.gson.JsonObject json , java.util.Set < java.lang.String > fields ) { com.google.gson.JsonElement source = json.get ( "_source" ) ; if ( source == null ) { source = json.getAsJsonObject ( ) . get ( "fields" ) ; } com.google.gerrit.reviewdb.client.Project.NameKey nameKey = new com.google.gerrit.reviewdb.client.Project.NameKey ( source.getAsJsonObject ( ) . get ( ProjectField.NAME.getName ( ) ) . getAsString ( ) ) ; return projectCache.get ( ) . get ( nameKey ) . toProjectData ( ) ; }
Source:
private java.util.Map < com.google.gerrit.reviewdb.Change.Key , com.google.gerrit.reviewdb.Change.Id > openChangesByKey ( com.google.gerrit.reviewdb.Branch.NameKey branch ) throws com.google.gwtorm.client.OrmException { final java.util.Map < com.google.gerrit.reviewdb.Change.Key , com.google.gerrit.reviewdb.Change.Id > r = new java.util.HashMap < com.google.gerrit.reviewdb.Change.Key , com.google.gerrit.reviewdb.Change.Id > ( ) ; for ( com.google.gerrit.reviewdb.Change c : db.changes ( ) . byBranchOpenAll ( branch ) ) { r.put ( c.getKey ( ) , c.getId ( ) ) ; } return r ; }

Target:
private java.util.Map < com.google.gerrit.reviewdb.client.Change.Key , com.google.gerrit.reviewdb.client.Change.Id > openChangesByKey ( com.google.gerrit.reviewdb.client.Branch.NameKey branch ) throws com.google.gwtorm.server.OrmException { final java.util.Map < com.google.gerrit.reviewdb.client.Change.Key , com.google.gerrit.reviewdb.client.Change.Id > r = new java.util.HashMap < com.google.gerrit.reviewdb.client.Change.Key , com.google.gerrit.reviewdb.client.Change.Id > ( ) ; for ( com.google.gerrit.reviewdb.client.Change c : db.changes ( ) . byBranchOpenAll ( branch ) ) { r.put ( c.getKey ( ) , c.getId ( ) ) ; } return r ; }
Source:
public void updateRepo ( com.google.gerrit.server.update.BatchUpdate.RepoContext ctx ) throws java.lang.Exception { com.google.gerrit.server.git.CodeReviewCommit c = composeGitlinksCommit ( branch ) ; if ( c != null ) { ctx.addRefUpdate ( new org.eclipse.jgit.transport.ReceiveCommand ( c.getParent ( 0 ) , c , branch.get ( ) ) ) ; addBranchTip ( branch , c ) ; } }

Target:
public void updateRepo ( com.google.gerrit.server.update.RepoContext ctx ) throws java.lang.Exception { com.google.gerrit.server.git.CodeReviewCommit c = composeGitlinksCommit ( branch ) ; if ( c != null ) { ctx.addRefUpdate ( new org.eclipse.jgit.transport.ReceiveCommand ( c.getParent ( 0 ) , c , branch.get ( ) ) ) ; addBranchTip ( branch , c ) ; } }
Source:
public int run ( ) throws java.lang.Exception { final com.google.inject.Injector injector = com.google.inject.Guice.createInjector ( new com.google.gerrit.server.GerritServerModule ( ) , new com.google.gerrit.server.ssh.SshDaemonModule ( ) ) ; com.google.gerrit.client.rpc.Common.setGerritConfig ( injector.getInstance ( com.google.gerrit.client.data.GerritConfig.class ) ) ; injector.getInstance ( com.google.gerrit.server.ssh.GerritSshDaemon.class ) . start ( ) ; return never ( ) ; }

Target:
public int run ( ) throws java.lang.Exception { final com.google.inject.Injector injector = com.google.inject.Guice.createInjector ( new com.google.gerrit.server.config.GerritServerModule ( ) , new com.google.gerrit.server.ssh.SshDaemonModule ( ) ) ; com.google.gerrit.client.rpc.Common.setGerritConfig ( injector.getInstance ( com.google.gerrit.client.data.GerritConfig.class ) ) ; injector.getInstance ( com.google.gerrit.server.ssh.GerritSshDaemon.class ) . start ( ) ; return never ( ) ; }
Source:
private com.google.gerrit.reviewdb.client.Change.Id getOrRegisterAccount ( com.google.gerrit.reviewdb.server.ReviewDb db , org.kohsuke.github.GHUser user ) throws com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.extensions.restapi.UnprocessableEntityException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.AccountExternalId.Key userExtKey = new com.google.gerrit.reviewdb.client.AccountExternalId.Key ( com.google.gerrit.reviewdb.client.AccountExternalId.SCHEME_USERNAME , user.getLogin ( ) ) ; com.google.gerrit.reviewdb.server.AccountExternalIdAccess gerritExtIds = db.accountExternalIds ( ) ; com.google.gerrit.reviewdb.client.AccountExternalId userExtId = gerritExtIds.get ( userExtKey ) ; if ( userExtId == null ) { return accountImporter.importAccount ( user ) ; } else { return userExtId.getAccountId ( ) ; } }

Target:
private com.google.gerrit.reviewdb.client.Change.Id getOrRegisterAccount ( com.google.gerrit.reviewdb.server.ReviewDb db , java.lang.String login , java.lang.String name , java.lang.String email ) throws com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.extensions.restapi.UnprocessableEntityException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.AccountExternalId.Key userExtKey = new com.google.gerrit.reviewdb.client.AccountExternalId.Key ( com.google.gerrit.reviewdb.client.AccountExternalId.SCHEME_USERNAME , login ) ; com.google.gerrit.reviewdb.server.AccountExternalIdAccess gerritExtIds = db.accountExternalIds ( ) ; com.google.gerrit.reviewdb.client.AccountExternalId userExtId = gerritExtIds.get ( userExtKey ) ; if ( userExtId == null ) { return accountImporter.importAccount ( login , name , email ) ; } else { return userExtId.getAccountId ( ) ; } }
Source:
public void listNonEmptyGroupIncludes ( ) throws java.lang.Exception { group ( "gx" , "Administrators" ) ; group ( "gy" , "Administrators" ) ; PUT ( "/groups/Administrators/groups/gx" ) ; PUT ( "/groups/Administrators/groups/gy" ) ; assertIncludes ( GET ( "/groups/Administrators/groups/" ) , "gx" , "gy" ) ; }

Target:
public void listNonEmptyGroupIncludes ( ) throws java.lang.Exception { java.lang.String gx = group ( "gx" , "Administrators" ) ; java.lang.String gy = group ( "gy" , "Administrators" ) ; java.lang.String gz = group ( "gz" , "Administrators" ) ; PUT ( ( ( ( "/groups/" + gx ) + "/groups/" ) + gy ) ) ; PUT ( ( ( ( "/groups/" + gx ) + "/groups/" ) + gz ) ) ; assertIncludes ( GET ( ( ( "/groups/" + gx ) + "/groups/" ) ) , gy , gz ) ; }
Source:
public boolean hasNext ( ) { while ( ( ( next ) == null ) && ( itr.hasNext ( ) ) ) { com.google.inject.Provider < T > p = itr.next ( ) . get ( ) ; if ( p != null ) { try { next = p.get ( ) ; } catch ( java.lang.RuntimeException e ) { } } } return ( next ) != null ; }

Target:
public boolean hasNext ( ) { while ( ( ( next ) == null ) && ( itr.hasNext ( ) ) ) { com.google.inject.Provider < T > p = itr.next ( ) . get ( ) ; if ( p != null ) { try { next = p.get ( ) ; } catch ( java.lang.RuntimeException e ) { com.google.gerrit.extensions.registration.DynamicSet.log.error ( ( ( "Cannot get iterated object from provider " + p ) + ": object discared" ) , e ) ; } } } return ( next ) != null ; }
Source:
private void call ( com.googlecode.prolog_cafe.lang.BufferingPrologControl env , java.lang.String name ) { com.googlecode.prolog_cafe.lang.StructureTerm head = com.googlecode.prolog_cafe.lang.SymbolTerm.create ( pkg , name , 0 ) ; com.google.common.truth.Truth.assert_ ( ) . withMessage ( ( ( ( "Cannot invoke " + ( pkg ) ) + ":" ) + name ) ) . that ( env.execute ( Prolog.BUILTIN , "call" , head ) ) . isTrue ( ) ; }

Target:
private void call ( com.googlecode.prolog_cafe.lang.BufferingPrologControl env , java.lang.String name ) { com.googlecode.prolog_cafe.lang.StructureTerm head = com.googlecode.prolog_cafe.lang.SymbolTerm.create ( pkg , name , 0 ) ; com.google.common.truth.Truth.assertWithMessage ( ( ( ( "Cannot invoke " + ( pkg ) ) + ":" ) + name ) ) . that ( env.execute ( Prolog.BUILTIN , "call" , head ) ) . isTrue ( ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.groups.GroupMap result ) { priorResults.clear ( ) ; java.util.ArrayList < com.google.gerrit.client.ui.AccountGroupSuggestOracle.AccountGroupSuggestion > r = new java.util.ArrayList ( result.size ( ) ) ; for ( com.google.gerrit.client.groups.GroupInfo group : com.google.gerrit.client.rpc.Natives.asList ( result.values ( ) ) ) { r.add ( new com.google.gerrit.client.ui.AccountGroupSuggestOracle.AccountGroupSuggestion ( group ) ) ; priorResults.put ( group.name ( ) , group.getGroupUUID ( ) ) ; } callback.onSuggestionsReady ( req , new com.google.gerrit.client.ui.Response ( r ) ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.groups.GroupMap result ) { priorResults.clear ( ) ; java.util.ArrayList < com.google.gerrit.client.ui.AccountGroupSuggestOracle.AccountGroupSuggestion > r = new java.util.ArrayList ( result.size ( ) ) ; for ( com.google.gerrit.client.info.GroupInfo group : com.google.gerrit.client.rpc.Natives.asList ( result.values ( ) ) ) { r.add ( new com.google.gerrit.client.ui.AccountGroupSuggestOracle.AccountGroupSuggestion ( group ) ) ; priorResults.put ( group.name ( ) , group.getGroupUUID ( ) ) ; } callback.onSuggestionsReady ( req , new com.google.gerrit.client.ui.Response ( r ) ) ; }
Source:
protected void configure ( ) { try { bind ( com.google.gerrit.server.GerritServer.class ) . toInstance ( com.google.gerrit.server.GerritServer.getInstance ( true ) ) ; } catch ( com.google.gwtorm.client.OrmException e ) { addError ( e ) ; } catch ( com.google.gwtjsonrpc.server.XsrfException e ) { addError ( e ) ; } }

Target:
protected void configure ( ) { try { final com.google.gerrit.server.GerritServer gs = com.google.gerrit.server.GerritServer.getInstance ( true ) ; bind ( com.google.gerrit.server.GerritServer.class ) . toInstance ( gs ) ; bind ( com.google.gerrit.server.ContactStore.class ) . toInstance ( com.google.gerrit.server.EncryptedContactStore.create ( gs ) ) ; } catch ( com.google.gwtorm.client.OrmException e ) { addError ( e ) ; } catch ( com.google.gwtjsonrpc.server.XsrfException e ) { addError ( e ) ; } }
Source:
public void onSuccess ( com.google.gerrit.client.info.ChangeInfo info ) { info.init ( ) ; addExtensionPoints ( info ) ; loadConfigInfo ( info , base ) ; }

Target:
public void onSuccess ( java.lang.Void result ) { if ( ( ( base ) == null ) && ( ( rev.commit ( ) . parents ( ) . length ( ) ) > 1 ) ) { base = com.google.gerrit.client.Gerrit.getUserPreferences ( ) . defaultBaseForMerges ( ) . getBase ( ) ; } loadConfigInfo ( info , base ) ; }
Source:
public void deleteGpgKey ( ) throws java.lang.Exception { com.google.gerrit.server.git.gpg.TestKey key = com.google.gerrit.server.git.gpg.TestKey.key1 ( ) ; java.lang.String id = key.getKeyIdString ( ) ; addExternalIdEmail ( admin , "test1@example.com" ) ; addGpgKey ( key.getPublicKeyArmored ( ) ) ; assertKeys ( key ) ; gApi.accounts ( ) . self ( ) . gpgKey ( id ) . delete ( ) ; assertKeys ( ) ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; exception.expectMessage ( id ) ; gApi.accounts ( ) . self ( ) . gpgKey ( id ) . get ( ) ; }

Target:
public void listGpgKeys ( ) throws java.lang.Exception { java.util.List < com.google.gerrit.gpg.testutil.TestKey > keys = com.google.gerrit.gpg.testutil.TestKey.allValidKeys ( ) ; java.util.List < java.lang.String > toAdd = new java.util.ArrayList ( keys.size ( ) ) ; for ( com.google.gerrit.gpg.testutil.TestKey key : keys ) { addExternalIdEmail ( admin , org.eclipse.jgit.transport.PushCertificateIdent.parse ( key.getFirstUserId ( ) ) . getEmailAddress ( ) ) ; toAdd.add ( key.getPublicKeyArmored ( ) ) ; } gApi.accounts ( ) . self ( ) . putGpgKeys ( toAdd , com.google.common.collect.ImmutableList.< java.lang.String > of ( ) ) ; assertKeys ( keys ) ; }