auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
void onSave ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ClickEvent e ) { com.google.gerrit.client.changes.ChangeFileApi.putContentOrMessage ( revision , path , cm.getValue ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChangeInEditMode ( revision.getParentKey ( ) ) ) ; } } ) ; }

Target:
public void run ( ) { if ( ! ( cm.isClean ( generation ) ) ) { java.lang.String text = cm.getValue ( ) ; final int g = cm.changeGeneration ( false ) ; com.google.gerrit.client.changes.ChangeFileApi.putContentOrMessage ( revision , path , text , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { generation = g ; save.setEnabled ( ( ! ( cm.isClean ( g ) ) ) ) ; } } ) ; } }
Source:
protected boolean isVisibleTo ( final com.google.gerrit.reviewdb.Account.Id to ) { return ( ( ( projectState ) == null ) || ( ( change ) == null ) ) || ( projectState.controlFor ( args.identifiedUserFactory.create ( to ) ) . controlFor ( change ) . isVisible ( ) ) ; }

Target:
protected boolean isVisibleTo ( final com.google.gerrit.reviewdb.client.Account.Id to ) throws com.google.gwtorm.server.OrmException { return ( ( projectState ) == null ) || ( projectState.controlFor ( args.identifiedUserFactory.create ( to ) ) . controlFor ( change ) . isVisible ( args.db.get ( ) ) ) ; }
Source:
private void setUpClient ( ) { eventsDb = new com.ericsson.gerrit.plugins.eventslog.SQLClient ( com.ericsson.gerrit.plugins.eventslog.SQLStoreTest.TEST_DRIVER , com.ericsson.gerrit.plugins.eventslog.SQLStoreTest.TEST_PATH , com.ericsson.gerrit.plugins.eventslog.SQLStoreTest.TEST_OPTIONS ) ; localEventsDb = new com.ericsson.gerrit.plugins.eventslog.SQLClient ( com.ericsson.gerrit.plugins.eventslog.SQLStoreTest.TEST_DRIVER , com.ericsson.gerrit.plugins.eventslog.SQLStoreTest.TEST_LOCAL_PATH , com.ericsson.gerrit.plugins.eventslog.SQLStoreTest.TEST_OPTIONS ) ; store = new com.ericsson.gerrit.plugins.eventslog.SQLStore ( pcFactoryMock , userProviderMock , cfgMock , eventsDb , localEventsDb , poolMock ) ; store.start ( ) ; }

Target:
private void setUpClient ( ) { eventsDb = new com.ericsson.gerrit.plugins.eventslog.SQLClient ( com.ericsson.gerrit.plugins.eventslog.SQLStoreTest.TEST_DRIVER , com.ericsson.gerrit.plugins.eventslog.SQLStoreTest.TEST_URL , com.ericsson.gerrit.plugins.eventslog.SQLStoreTest.TEST_OPTIONS ) ; localEventsDb = new com.ericsson.gerrit.plugins.eventslog.SQLClient ( com.ericsson.gerrit.plugins.eventslog.SQLStoreTest.TEST_DRIVER , com.ericsson.gerrit.plugins.eventslog.SQLStoreTest.TEST_LOCAL_URL , com.ericsson.gerrit.plugins.eventslog.SQLStoreTest.TEST_OPTIONS ) ; store = new com.ericsson.gerrit.plugins.eventslog.SQLStore ( pcFactoryMock , userProviderMock , cfgMock , eventsDb , localEventsDb , poolMock ) ; store.start ( ) ; }
Source:
public com.google.template.soy.tofu.SoyTofu get ( ) throws com.google.inject.ProvisionException { com.google.template.soy.SoyFileSet.Builder builder = com.google.template.soy.SoyFileSet.builder ( ) ; for ( java.lang.String name : com.google.gerrit.server.mail.send.MailSoyTofuProvider.TEMPLATES ) { addTemplate ( builder , name ) ; } return builder.build ( ) . compileToTofu ( ) ; }

Target:
public com.google.template.soy.tofu.SoyTofu get ( ) throws com.google.inject.ProvisionException { com.google.template.soy.SoyFileSet.Builder builder = com.google.template.soy.SoyFileSet.builder ( ) ; builder.setSoyAstCache ( cache ) ; for ( java.lang.String name : com.google.gerrit.server.mail.send.MailSoyTofuProvider.TEMPLATES ) { addTemplate ( builder , name ) ; } return builder.build ( ) . compileToTofu ( ) ; }
Source:
public void listTagsOfNonVisibleBranch ( ) throws java.lang.Exception { grant ( Permission.SUBMIT , project , "refs/for/refs/heads/master" ) ; grant ( Permission.SUBMIT , project , "refs/for/refs/heads/hidden" ) ; grant ( Permission.CREATE , project , "refs/tags/*" ) ; grant ( Permission.PUSH , project , "refs/tags/*" ) ; com.google.gerrit.acceptance.PushOneCommit.Tag tag1 = new com.google.gerrit.acceptance.PushOneCommit.Tag ( "v1.0" ) ; com.google.gerrit.acceptance.PushOneCommit push1 = pushFactory.create ( db , admin.getIdent ( ) , testRepo ) ; push1.setTag ( tag1 ) ; com.google.gerrit.acceptance.PushOneCommit.Result r1 = push1.to ( "refs/for/master%submit" ) ; r1.assertOkStatus ( ) ; pushTo ( "refs/heads/hidden" ) ; com.google.gerrit.acceptance.PushOneCommit.Tag tag2 = new com.google.gerrit.acceptance.PushOneCommit.Tag ( "v2.0" ) ; com.google.gerrit.acceptance.PushOneCommit push2 = pushFactory.create ( db , admin.getIdent ( ) , testRepo ) ; push2.setTag ( tag2 ) ; com.google.gerrit.acceptance.PushOneCommit.Result r2 = push2.to ( "refs/for/hidden%submit" ) ; r2.assertOkStatus ( ) ; java.util.List < com.google.gerrit.extensions.api.projects.TagInfo > result = getTags ( ) ; com.google.common.truth.Truth.assertThat ( result ) . hasSize ( 2 ) ; com.google.common.truth.Truth.assertThat ( result.get ( 0 ) . ref ) . isEqualTo ( ( "refs/tags/" + ( tag1.name ) ) ) ; com.google.common.truth.Truth.assertThat ( result.get ( 0 ) . revision ) . isEqualTo ( r1.getCommitId ( ) . getName ( ) ) ; com.google.common.truth.Truth.assertThat ( result.get ( 1 ) . ref ) . isEqualTo ( ( "refs/tags/" + ( tag2.name ) ) ) ; com.google.common.truth.Truth.assertThat ( result.get ( 1 ) . revision ) . isEqualTo ( r2.getCommitId ( ) . getName ( ) ) ; blockRead ( project , "refs/heads/hidden" ) ; result = getTags ( ) ; com.google.common.truth.Truth.assertThat ( result ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( result.get ( 0 ) . ref ) . isEqualTo ( ( "refs/tags/" + ( tag1.name ) ) ) ; com.google.common.truth.Truth.assertThat ( result.get ( 0 ) . revision ) . isEqualTo ( r1.getCommitId ( ) . getName ( ) ) ; }

Target:
public void listTagsWithLimitOption ( ) throws java.lang.Exception { createTags ( ) ; int limit = ( com.google.gerrit.acceptance.rest.project.TagsIT.testTags.size ( ) ) - 1 ; java.util.List < com.google.gerrit.extensions.api.projects.TagInfo > result = getTags ( ) . withLimit ( limit ) . get ( ) ; assertTagList ( com.google.common.collect.FluentIterable.from ( com.google.gerrit.acceptance.rest.project.TagsIT.testTags ) . limit ( limit ) , result ) ; }
Source:
public void onScreenLoad ( com.google.gerrit.client.ui.ScreenLoadEvent event ) { com.google.gerrit.client.ui.Screen screen = event.getScreen ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey projectKey ; if ( screen instanceof com.google.gerrit.client.admin.ProjectScreen ) { projectKey = ( ( com.google.gerrit.client.admin.ProjectScreen ) ( screen ) ) . getProjectKey ( ) ; } else { projectKey = com.google.gerrit.client.admin.ProjectScreen.getSavedKey ( ) ; } if ( projectKey != null ) { setVisible ( true ) ; setTargetHistoryToken ( com.google.gerrit.client.Dispatcher.toProjectAdmin ( projectKey , panel ) ) ; } else { setVisible ( false ) ; } super . onScreenLoad ( event ) ; }

Target:
public void go ( ) { if ( ( com.google.gerrit.client.Gerrit.patchScreen ) != null ) { com.google.gerrit.client.Gerrit.patchScreen.setTopView ( PatchScreen.TopView.MAIN ) ; if ( type == ( com.google.gerrit.client.Gerrit.patchScreen.getPatchScreenType ( ) ) ) { com.google.gwt.dom.client.AnchorElement.as ( getElement ( ) ) . blur ( ) ; } else { new com.google.gerrit.client.ui.PatchLink ( "" , type , com.google.gerrit.client.Gerrit.patchScreen ) . go ( ) ; } } }
Source:
public void testUnblockVisibilityByREGISTEREDUsers ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.REGISTERED , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.REGISTERED ) ; assertTrue ( "u can read" , u.controlForRef ( "refs/heads/master" ) . isVisibleByRegisteredUsers ( ) ) ; }

Target:
public void testUnblockInLocalVisibilityByRegisteredUsers_Fails ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.REGISTERED , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.REGISTERED ) ; org.junit.Assert.assertFalse ( "u can't read" , u.controlForRef ( "refs/heads/master" ) . isVisibleByRegisteredUsers ( ) ) ; }
Source:
void onOpenForm ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ClickEvent e ) { onOpenForm ( ) ; }

Target:
void set ( com.google.gerrit.client.info.ChangeInfo info ) { canEdit = ( info.hasActions ( ) ) && ( info.actions ( ) . containsKey ( "hashtags" ) ) ; this . changeId = info.legacyId ( ) ; display ( info ) ; addHashtagIcon.setVisible ( canEdit ) ; }
Source:
private void deleteOrUpdateDraftChange ( com.google.gerrit.server.update.BatchUpdate.ChangeContext ctx ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.Change c = ctx.getChange ( ) ; if ( deletedOnlyPatchSet ( ) ) { deleteChangeOp = deleteChangeOpProvider.get ( ) ; deleteChangeOp.updateChange ( ctx ) ; return ; } if ( c.currentPatchSetId ( ) . equals ( psId ) ) { c.setCurrentPatchSet ( previousPatchSetInfo ( ctx ) ) ; } }

Target:
private void deleteOrUpdateDraftChange ( com.google.gerrit.server.update.ChangeContext ctx ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.Change c = ctx.getChange ( ) ; if ( deletedOnlyPatchSet ( ) ) { deleteChangeOp = deleteChangeOpProvider.get ( ) ; deleteChangeOp.updateChange ( ctx ) ; return ; } if ( c.currentPatchSetId ( ) . equals ( psId ) ) { c.setCurrentPatchSet ( previousPatchSetInfo ( ctx ) ) ; } }
Source:
public java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > draftsByUser ( ) throws com.google.gwtorm.server.OrmException { if ( ( draftsByUser ) == null ) { com.google.gerrit.reviewdb.client.Change c = change ( ) ; if ( c == null ) { return java.util.Collections.emptySet ( ) ; } draftsByUser = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment sc : plcUtil.draftByChange ( db , notes ) ) { draftsByUser.add ( sc.getAuthor ( ) ) ; } } return draftsByUser ; }

Target:
public java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > draftsByUser ( ) throws com.google.gwtorm.server.OrmException { if ( ( draftsByUser ) == null ) { if ( ! ( lazyLoad ) ) { return java.util.Collections.emptySet ( ) ; } com.google.gerrit.reviewdb.client.Change c = change ( ) ; if ( c == null ) { return java.util.Collections.emptySet ( ) ; } draftsByUser = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment sc : plcUtil.draftByChange ( db , notes ) ) { draftsByUser.add ( sc.getAuthor ( ) ) ; } } return draftsByUser ; }
Source:
public boolean dryRun ( com.google.gerrit.server.git.CodeReviewCommit mergeTip , com.google.gerrit.server.git.CodeReviewCommit toMerge ) throws com.google.gerrit.server.git.IntegrationException { return ( args.mergeUtil.canFastForward ( args.mergeSorter , mergeTip , args.rw , toMerge ) ) || ( args.mergeUtil.canMerge ( args.mergeSorter , args.repo , mergeTip , toMerge ) ) ; }

Target:
static boolean dryRun ( com.google.gerrit.server.git.strategy.SubmitDryRun.Arguments args , com.google.gerrit.server.git.CodeReviewCommit mergeTip , com.google.gerrit.server.git.CodeReviewCommit toMerge ) throws com.google.gerrit.server.git.IntegrationException { return ( args.mergeUtil.canFastForward ( args.mergeSorter , mergeTip , args.rw , toMerge ) ) || ( args.mergeUtil.canMerge ( args.mergeSorter , args.repo , mergeTip , toMerge ) ) ; }
Source:
public void generatesExpectedMessageForLongComment ( ) throws java.lang.Exception { mockEvent.change = mockChange ; mockEvent.author = mockAccount ; mockEvent.comment = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. " + ( ( "Integer tristique ligula nec dapibus lobortis. Nulla venenatis, lacus quis vulputate volutpat, " + "sem neque ornare eros, vel sodales magna risus et diam. Maecenas ultricies justo dictum orci " ) + "scelerisque consequat a vel purus." ) ; mockChange.project = "testproject" ; mockChange.branch = "master" ; mockChange.url = "https://change/" ; mockAccount.name = "Unit Tester" ; com.cisco.gerrit.plugins.slack.message.MessageGenerator messageGenerator ; messageGenerator = com.cisco.gerrit.plugins.slack.message.MessageGeneratorFactory.newInstance ( mockEvent , config ) ; java.lang.String expectedResult ; expectedResult = ( ( ( "{\"text\": \"Unit Tester commented\\n>>>" + "testproject (master): " ) + ( mockEvent.comment.substring ( 0 , 197 ) ) ) + "... (https://change/)\"," ) + "\"channel\": \"#testchannel\",\"username\": \"testuser\"}\n" ; java.lang.String actualResult ; actualResult = messageGenerator.generate ( ) ; org.junit.Assert.assertThat ( actualResult , org.hamcrest.core.Is.is ( org.hamcrest.CoreMatchers.equalTo ( expectedResult ) ) ) ; }

Target:
public void generatesExpectedMessageForLongComment ( ) throws java.lang.Exception { mockEvent.change = mockChange ; mockEvent.author = mockAccount ; mockEvent.comment = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. " + ( ( "Integer tristique ligula nec dapibus lobortis. Nulla venenatis, lacus quis vulputate volutpat, " + "sem neque ornare eros, vel sodales magna risus et diam. Maecenas ultricies justo dictum orci " ) + "scelerisque consequat a vel purus." ) ; mockChange.project = "testproject" ; mockChange.branch = "master" ; mockChange.url = "https://change/" ; mockChange.owner = mockOwner ; mockOwner.name = "Owner" ; mockAccount.name = "Unit Tester" ; com.cisco.gerrit.plugins.slack.message.MessageGenerator messageGenerator ; messageGenerator = com.cisco.gerrit.plugins.slack.message.MessageGeneratorFactory.newInstance ( mockEvent , config ) ; java.lang.String expectedResult ; expectedResult = ( ( ( "{\"text\": \"Unit Tester commented to Owner\\n>>>" + "testproject (master): " ) + ( mockEvent.comment.substring ( 0 , 197 ) ) ) + "... (https://change/)\"," ) + "\"channel\": \"#testchannel\",\"username\": \"testuser\"}\n" ; java.lang.String actualResult ; actualResult = messageGenerator.generate ( ) ; org.junit.Assert.assertThat ( actualResult , org.hamcrest.core.Is.is ( org.hamcrest.CoreMatchers.equalTo ( expectedResult ) ) ) ; }
Source:
private com.google.inject.Provider < org.apache.sshd.server.Command > load ( com.google.gerrit.server.plugins.Plugin plugin ) { if ( ( plugin.getSshInjector ( ) ) != null ) { com.google.inject.Key < org.apache.sshd.server.Command > key = com.google.gerrit.sshd.Commands.key ( plugin.getName ( ) ) ; try { return plugin.getSshInjector ( ) . getProvider ( key ) ; } catch ( java.lang.RuntimeException err ) { com.google.gerrit.sshd.SshPluginStarterCallback.log.warn ( java.lang.String.format ( "Plugin %s did not define its top-level command" , plugin.getName ( ) ) , err ) ; } } return null ; }

Target:
private com.google.inject.Provider < org.apache.sshd.server.Command > load ( com.google.gerrit.server.plugins.Plugin plugin ) { if ( ( plugin.getSshInjector ( ) ) != null ) { com.google.inject.Key < org.apache.sshd.server.Command > key = com.google.gerrit.sshd.Commands.key ( plugin.getName ( ) ) ; try { return plugin.getSshInjector ( ) . getProvider ( key ) ; } catch ( java.lang.RuntimeException err ) { if ( ! ( providesDynamicOptions ( plugin ) ) ) { com.google.gerrit.sshd.SshPluginStarterCallback.log.warn ( java.lang.String.format ( "Plugin %s did not define its top-level command nor any DynamicOptions" , plugin.getName ( ) ) , err ) ; } } } return null ; }
Source:
protected org.apache.sshd.common.session.AbstractSession createSession ( final org.apache.mina.core.session.IoSession io ) throws java.lang.Exception { if ( ( io.getConfig ( ) ) instanceof org.apache.mina.transport.socket.SocketSessionConfig ) { final org.apache.mina.transport.socket.SocketSessionConfig c = ( ( org.apache.mina.transport.socket.SocketSessionConfig ) ( io.getConfig ( ) ) ) ; c.setKeepAlive ( keepAlive ) ; } final org.apache.sshd.common.session.AbstractSession s = super . createSession ( io ) ; s.setAttribute ( SshUtil.REMOTE_PEER , io.getRemoteAddress ( ) ) ; s.setAttribute ( SshUtil.ACTIVE , new java.util.ArrayList < com.google.gerrit.server.ssh.AbstractCommand > ( 2 ) ) ; return s ; }

Target:
protected org.apache.sshd.server.session.ServerSession createSession ( final org.apache.mina.core.session.IoSession io ) throws java.lang.Exception { return new com.google.gerrit.server.ssh.GerritServerSession ( server , io , keepAlive ) ; }
Source:
public void missingRepo ( ) throws java.lang.Exception { assumeNoteDbDisabled ( ) ; com.google.gerrit.server.notedb.ChangeNotes notes = insertChange ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey name = notes.getProjectName ( ) ; ( ( com.google.gerrit.testutil.InMemoryRepositoryManager ) ( repoManager ) ) . deleteRepository ( name ) ; com.google.common.truth.Truth.assertThat ( checker.check ( notes , null ) . problems ( ) ) . containsExactly ( com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Destination repository not found: " + name ) ) ) ; }

Target:
public void missingRepo ( ) throws java.lang.Exception { assumeNoteDbDisabled ( ) ; com.google.gerrit.server.notedb.ChangeNotes notes = insertChange ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey name = notes.getProjectName ( ) ; ( ( com.google.gerrit.testing.InMemoryRepositoryManager ) ( repoManager ) ) . deleteRepository ( name ) ; com.google.common.truth.Truth.assertThat ( checker.check ( notes , null ) . problems ( ) ) . containsExactly ( com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Destination repository not found: " + name ) ) ) ; }
Source:
public java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > files ( java.lang.String base ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return ( ( java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > ) ( listFiles.setBase ( base ) . apply ( revision ) . value ( ) ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException | com.google.gerrit.server.patch.PatchListNotAvailableException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve files" , e ) ; } }

Target:
public java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > files ( java.lang.String base ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return ( ( java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > ) ( listFiles.setBase ( base ) . apply ( revision ) . value ( ) ) ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot retrieve files" , e ) ; } }
Source:
public static com.google.gerrit.common.data.PermissionRule block ( com.google.gerrit.server.git.ProjectConfig project , java.lang.String permissionName , com.google.gerrit.reviewdb.client.AccountGroup.UUID group , java.lang.String ref ) { com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.project.testing.Util.grant ( project , permissionName , com.google.gerrit.server.project.testing.Util.newRule ( project , group ) , ref ) ; r.setBlock ( ) ; return r ; }

Target:
public static com.google.gerrit.common.data.PermissionRule block ( com.google.gerrit.server.project.ProjectConfig project , java.lang.String permissionName , com.google.gerrit.reviewdb.client.AccountGroup.UUID group , java.lang.String ref ) { com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.project.testing.Util.grant ( project , permissionName , com.google.gerrit.server.project.testing.Util.newRule ( project , group ) , ref ) ; r.setBlock ( ) ; return r ; }
Source:
public void addPatchSets ( com.google.gerrit.server.data.ChangeAttribute a , java.util.Collection < com.google.gerrit.reviewdb.client.PatchSet > ps , com.google.gerrit.common.data.LabelTypes labelTypes ) { addPatchSets ( a , ps , null , false , null , labelTypes ) ; }

Target:
public void addPatchSets ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.data.ChangeAttribute ca , java.util.Collection < com.google.gerrit.reviewdb.client.PatchSet > ps , java.util.Map < com.google.gerrit.reviewdb.client.PatchSet.Id , java.util.Collection < com.google.gerrit.reviewdb.client.PatchSetApproval > > approvals , com.google.gerrit.common.data.LabelTypes labelTypes ) { addPatchSets ( db , ca , ps , approvals , false , null , labelTypes ) ; }
Source:
public boolean accept ( java.io.File pathname ) { java.lang.String n = pathname.getName ( ) ; return ( ( n.endsWith ( ".jar" ) ) || ( n.endsWith ( ".jar.disabled" ) ) ) && ( pathname.isFile ( ) ) ; }

Target:
public boolean accept ( java.io.File pathname ) { java.lang.String n = pathname.getName ( ) ; return ( ( ( ( n.endsWith ( ".jar" ) ) || ( n.endsWith ( ".jar.disabled" ) ) ) && ( ! ( n.startsWith ( ".last_" ) ) ) ) && ( ! ( n.startsWith ( ".next_" ) ) ) ) && ( pathname.isFile ( ) ) ; }
Source:
public void run ( ) { com.google.codereview.Main.LOG.info ( "Shutting down thread pool." ) ; pool.shutdownNow ( ) ; }

Target:
public void run ( ) { com.google.codereview.Main.LOG.info ( "Shutting down thread pool." ) ; pool.shutdown ( ) ; boolean waiting = true ; do { try { waiting = pool.awaitTermination ( 10 , java.util.concurrent.TimeUnit.SECONDS ) ; } catch ( java.lang.InterruptedException ie ) { } } while ( waiting ) ; com.google.codereview.Main.LOG.info ( "Thread pool shutdown." ) ; }
Source:
private boolean matchAny ( java.util.List < com.google.gerrit.common.data.PermissionRule > rules ) { java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > groups = user.getEffectiveGroups ( ) ; for ( com.google.gerrit.common.data.PermissionRule rule : rules ) { if ( com.google.gerrit.server.account.CapabilityControl.match ( groups , rule ) ) { return true ; } } return false ; }

Target:
private boolean matchAny ( java.util.List < com.google.gerrit.common.data.PermissionRule > rules ) { java.lang.Iterable < com.google.gerrit.reviewdb.client.AccountGroup.UUID > ids = com.google.common.collect.Iterables.transform ( rules , new com.google.common.base.Function < com.google.gerrit.common.data.PermissionRule , com.google.gerrit.reviewdb.client.AccountGroup.UUID > ( ) { @ java.lang.Override public AccountGroup.UUID apply ( com.google.gerrit.common.data.PermissionRule rule ) { return rule.getGroup ( ) . getUUID ( ) ; } } ) ; return user.getEffectiveGroups ( ) . containsAnyOf ( ids ) ; }
Source:
private void openRepos ( java.util.Collection < com.google.gerrit.reviewdb.client.Project.NameKey > projects ) throws com.google.gerrit.server.git.IntegrationException { for ( com.google.gerrit.reviewdb.client.Project.NameKey project : projects ) { try { orm.openRepo ( project , true ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException noProject ) { logWarn ( ( ( ( "Project " + ( noProject.project ( ) ) ) + " no longer exists, " ) + "abandoning open changes" ) ) ; abandonAllOpenChangeForDeletedProject ( noProject.project ( ) ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.git.IntegrationException ( ( "Error opening project " + project ) , e ) ; } } }

Target:
private com.google.gerrit.server.git.MergeOpRepoManager.OpenRepo openRepo ( com.google.gerrit.reviewdb.client.Project.NameKey project ) throws com.google.gerrit.server.git.IntegrationException { try { return orm.openRepo ( project ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException noProject ) { logWarn ( ( ( ( "Project " + ( noProject.project ( ) ) ) + " no longer exists, " ) + "abandoning open changes" ) ) ; abandonAllOpenChangeForDeletedProject ( noProject.project ( ) ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.git.IntegrationException ( ( "Error opening project " + project ) , e ) ; } return null ; }
Source:
private com.google.gerrit.client.diff.SideBySide2.DiffChunkInfo getDiffChunk ( com.google.gerrit.client.diff.SideBySide2.DisplaySide side , int line ) { for ( com.google.gerrit.client.diff.SideBySide2.DiffChunkInfo info : diffChunks ) { if ( ( ( ( info.getSide ( ) ) == side ) && ( ( info.getStart ( ) ) <= line ) ) && ( line <= ( info.getEnd ( ) ) ) ) { return info ; } } return null ; }

Target:
private com.google.gerrit.client.diff.SideBySide2.DiffChunkInfo getDiffChunk ( com.google.gerrit.client.diff.SideBySide2.DisplaySide side , int line ) { int res = java.util.Collections.binarySearch ( diffChunks , new com.google.gerrit.client.diff.SideBySide2.DiffChunkInfo ( side , line , 0 , false ) , getDiffChunkComparator ( ) ) ; return res >= 0 ? diffChunks.get ( res ) : null ; }
Source:
public boolean equals ( final java.lang.Object o ) { if ( o instanceof com.google.gerrit.server.patch.PatchListKey ) { final com.google.gerrit.server.patch.PatchListKey k = ( ( com.google.gerrit.server.patch.PatchListKey ) ( o ) ) ; return ( ( com.google.gerrit.server.patch.PatchListKey.eq ( oldId , k.oldId ) ) && ( com.google.gerrit.server.patch.PatchListKey.eq ( newId , k.newId ) ) ) && ( ( whitespace ) == ( k.whitespace ) ) ; } return false ; }

Target:
public boolean equals ( final java.lang.Object o ) { if ( o instanceof com.google.gerrit.server.patch.PatchListKey ) { com.google.gerrit.server.patch.PatchListKey k = ( ( com.google.gerrit.server.patch.PatchListKey ) ( o ) ) ; return ( ( ( java.util.Objects.equals ( oldId , k.oldId ) ) && ( java.util.Objects.equals ( parentNum , k.parentNum ) ) ) && ( java.util.Objects.equals ( newId , k.newId ) ) ) && ( ( whitespace ) == ( k.whitespace ) ) ; } return false ; }
Source:
public void testCUSTOM_FullyConfiguredUser ( ) { setFrom ( "A ${user} B <my.server@email.address>" ) ; final java.lang.String name = "A U. Thor" ; final java.lang.String email = "a.u.thor@test.example.com" ; final com.google.gerrit.reviewdb.client.Account.Id user = user ( name , email ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( user ) ; assertNotNull ( r ) ; assertEquals ( ( ( "A " + name ) + " B" ) , r.name ) ; assertEquals ( "my.server@email.address" , r.email ) ; org.easymock.EasyMock.verify ( accountCache ) ; }

Target:
public void testCUSTOM_FullyConfiguredUser ( ) { setFrom ( "A ${user} B <my.server@email.address>" ) ; final java.lang.String name = "A U. Thor" ; final java.lang.String email = "a.u.thor@test.example.com" ; final com.google.gerrit.reviewdb.client.Account.Id user = user ( name , email ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( user ) ; org.junit.Assert.assertNotNull ( r ) ; org.junit.Assert.assertEquals ( ( ( "A " + name ) + " B" ) , r.name ) ; org.junit.Assert.assertEquals ( "my.server@email.address" , r.email ) ; org.easymock.EasyMock.verify ( accountCache ) ; }
Source:
private void refreshFileTable ( ) { int idx = diffBase.getSelectedIndex ( ) ; if ( 0 <= idx ) { java.lang.String n = diffBase.getValue ( idx ) ; loadConfigInfo ( changeInfo , ( ! ( n.isEmpty ( ) ) ? n : null ) ) ; } }

Target:
void onChangeRevision ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ChangeEvent e ) { int idx = diffBase.getSelectedIndex ( ) ; if ( 0 <= idx ) { java.lang.String n = diffBase.getValue ( idx ) ; loadConfigInfo ( changeInfo , ( ! ( n.isEmpty ( ) ) ? n : null ) ) ; } }
Source:
public void cancel ( ) { if ( ( status ) != ( GitJobStatus.SYNC ) ) { return ; } cancelled = true ; status = GitJobStatus.CANCELLED ; rollback ( ) ; }

Target:
public void beginTask ( java.lang.String task , int totalUnits ) { ( this . currTask ) ++ ; this . task = task ; this . totUnits = totalUnits ; this . currUnit = 0 ; this . lastPercentage = 0 ; status.update ( Code.SYNC , status.getShortDescription ( ) , getStatusDescription ( ) ) ; }
Source:
public void getDraft ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; java.lang.String changeId = r.getChangeId ( ) ; java.lang.String revId = r.getCommit ( ) . getName ( ) ; com.google.gerrit.extensions.api.changes.ReviewInput.CommentInput comment = newCommentInfo ( "file1" , Comment.Side.REVISION , 1 , "comment 1" ) ; com.google.gerrit.extensions.common.CommentInfo returned = addDraft ( changeId , revId , comment ) ; com.google.gerrit.extensions.common.CommentInfo actual = getDraftComment ( changeId , revId , returned.id ) ; com.google.gerrit.acceptance.server.change.CommentsIT.assertCommentInfo ( comment , actual ) ; }

Target:
public void getDraft ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; java.lang.String changeId = r.getChangeId ( ) ; java.lang.String revId = r.getCommit ( ) . getName ( ) ; com.google.gerrit.extensions.api.changes.ReviewInput.CommentInput comment = newCommentInfo ( "file1" , Side.REVISION , 1 , "comment 1" ) ; com.google.gerrit.extensions.common.CommentInfo returned = addDraft ( changeId , revId , comment ) ; com.google.gerrit.extensions.common.CommentInfo actual = getDraftComment ( changeId , revId , returned.id ) ; com.google.gerrit.acceptance.server.change.CommentsIT.assertCommentInfo ( comment , actual ) ; }
Source:
protected void configureServlets ( ) { bind ( com.google.gerrit.httpd.plugins.HttpPluginServlet.class ) ; serve ( "/plugins/*" ) . with ( com.google.gerrit.httpd.plugins.HttpPluginServlet.class ) ; bind ( com.google.gerrit.server.plugins.StartPluginListener.class ) . annotatedWith ( com.google.inject.internal.UniqueAnnotations.create ( ) ) . to ( com.google.gerrit.httpd.plugins.HttpPluginServlet.class ) ; bind ( com.google.gerrit.server.plugins.ReloadPluginListener.class ) . annotatedWith ( com.google.inject.internal.UniqueAnnotations.create ( ) ) . to ( com.google.gerrit.httpd.plugins.HttpPluginServlet.class ) ; }

Target:
protected void configureServlets ( ) { bind ( com.google.gerrit.httpd.plugins.HttpPluginServlet.class ) ; serve ( "/plugins/*" ) . with ( com.google.gerrit.httpd.plugins.HttpPluginServlet.class ) ; bind ( com.google.gerrit.server.plugins.StartPluginListener.class ) . annotatedWith ( com.google.inject.internal.UniqueAnnotations.create ( ) ) . to ( com.google.gerrit.httpd.plugins.HttpPluginServlet.class ) ; bind ( com.google.gerrit.server.plugins.ReloadPluginListener.class ) . annotatedWith ( com.google.inject.internal.UniqueAnnotations.create ( ) ) . to ( com.google.gerrit.httpd.plugins.HttpPluginServlet.class ) ; bind ( com.google.gerrit.server.plugins.ModuleGenerator.class ) . to ( com.google.gerrit.httpd.plugins.HttpAutoRegisterModuleGenerator.class ) ; }
Source:
void display ( final java.util.Map < com.google.gerrit.client.reviewdb.AccountGroup.Id , com.google.gerrit.client.reviewdb.AccountGroup > groups , final java.util.List < com.google.gerrit.client.reviewdb.ProjectRight > result ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.client.reviewdb.ProjectRight k : result ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; populate ( row , groups , k ) ; } }

Target:
void display ( final java.util.Map < com.google.gerrit.client.reviewdb.AccountGroup.Id , com.google.gerrit.client.reviewdb.AccountGroup > groups , final java.util.List < com.google.gerrit.client.reviewdb.ProjectRight > result ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.client.reviewdb.ProjectRight k : result ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , groups , k ) ; } }
Source:
public void execute ( ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException { try { executeRefUpdates ( ) ; executeChangeOps ( ) ; reindexChanges ( ) ; if ( ( batchRefUpdate ) != null ) { gitRefUpdated.fire ( project , batchRefUpdate ) ; } executePostOps ( ) ; } catch ( com.google.gerrit.server.git.UpdateException | com.google.gerrit.extensions.restapi.RestApiException e ) { throw e ; } catch ( java.lang.Exception e ) { com.google.common.base.Throwables.propagateIfPossible ( e ) ; throw new com.google.gerrit.server.git.UpdateException ( e ) ; } }

Target:
public void addRefUpdate ( org.eclipse.jgit.transport.ReceiveCommand cmd ) throws java.io.IOException { initRepository ( ) ; commands.add ( cmd ) ; }
Source:
protected com.google.gerrit.reviewdb.client.Change newChange ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( project , changeOwner.getAccountId ( ) ) ; newUpdate ( c , changeOwner ) . commit ( ) ; return c ; }

Target:
protected com.google.gerrit.reviewdb.client.Change newChange ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( project , changeOwner.getAccountId ( ) ) ; com.google.gerrit.server.notedb.ChangeUpdate u = newUpdate ( c , changeOwner ) ; u.setBranch ( c.getDest ( ) . get ( ) ) ; u.commit ( ) ; return c ; }
Source:
private com.google.inject.Injector createSysInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( cfgInjector.getInstance ( com.google.gerrit.server.config.GerritGlobalModule.class ) ) ; modules.add ( new com.google.gerrit.ehcache.EhcachePoolImpl.Module ( ) ) ; modules.add ( new com.google.gerrit.server.config.CanonicalWebUrlModule ( ) { @ java.lang.Override protected java.lang.Class < ? extends com.google.inject.Provider < java.lang.String > > provider ( ) { return com.google.gerrit.httpd.HttpCanonicalWebUrlProvider.class ; } } ) ; modules.add ( new com.google.gerrit.server.config.MasterNodeStartup ( ) ) ; return cfgInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createSysInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( cfgInjector.getInstance ( com.google.gerrit.server.config.GerritGlobalModule.class ) ) ; modules.add ( new com.google.gerrit.server.mail.SmtpEmailSender.Module ( ) ) ; modules.add ( new com.google.gerrit.ehcache.EhcachePoolImpl.Module ( ) ) ; modules.add ( new com.google.gerrit.server.config.CanonicalWebUrlModule ( ) { @ java.lang.Override protected java.lang.Class < ? extends com.google.inject.Provider < java.lang.String > > provider ( ) { return com.google.gerrit.httpd.HttpCanonicalWebUrlProvider.class ; } } ) ; modules.add ( new com.google.gerrit.server.config.MasterNodeStartup ( ) ) ; return cfgInjector.createChildInjector ( modules ) ; }
Source:
public static < V > com.google.gerrit.server.index.Schema < V > schema ( com.google.gerrit.server.index.Schema < V > schema , com.google.gerrit.server.index.FieldDef < V , ? > ... moreFields ) { return new com.google.gerrit.server.index.Schema ( new com.google.common.collect.ImmutableList.Builder < com.google.gerrit.server.index.FieldDef < V , ? > > ( ) . addAll ( schema.getFields ( ) . values ( ) ) . addAll ( com.google.common.collect.ImmutableList.copyOf ( moreFields ) ) . build ( ) ) ; }

Target:
public static < V > com.google.gerrit.index.Schema < V > schema ( com.google.gerrit.index.Schema < V > schema , com.google.gerrit.index.FieldDef < V , ? > ... moreFields ) { return new com.google.gerrit.index.Schema ( new com.google.common.collect.ImmutableList.Builder < com.google.gerrit.index.FieldDef < V , ? > > ( ) . addAll ( schema.getFields ( ) . values ( ) ) . addAll ( com.google.common.collect.ImmutableList.copyOf ( moreFields ) ) . build ( ) ) ; }
Source:
public java.lang.Void call ( ) throws java.lang.Exception { int rc = daemon.main ( new java.lang.String [ ] { "-d" , site.getPath ( ) , "--headless" } ) ; if ( rc != 0 ) { java.lang.System.out.println ( ( ( "Failed to start Gerrit daemon. Check " + ( site.getPath ( ) ) ) + "/logs/error_log" ) ) ; serverStarted.reset ( ) ; } return null ; }

Target:
public java.lang.Void call ( ) throws java.lang.Exception { int rc = daemon.main ( new java.lang.String [ ] { "-d" , site.getPath ( ) , "--headless" , "--console-log" , "--show-stack-trace" } ) ; if ( rc != 0 ) { java.lang.System.err.println ( "Failed to start Gerrit daemon" ) ; serverStarted.reset ( ) ; } return null ; }
Source:
private boolean isMuteable ( com.google.gerrit.server.change.ChangeResource rsrc ) { try { return ( ! ( isMuted ( rsrc ) ) ) && ( ! ( stars.isIgnored ( rsrc ) ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.change.Mute.log.error ( "failed to check ignored star" , e ) ; } return false ; }

Target:
private boolean isMuteable ( com.google.gerrit.server.change.ChangeResource rsrc ) { try { return ( ( ! ( rsrc.isUserOwner ( ) ) ) && ( ! ( isMuted ( rsrc ) ) ) ) && ( ! ( stars.isIgnored ( rsrc ) ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.change.Mute.log.error ( "failed to check ignored star" , e ) ; } return false ; }
Source:
protected void onShowView ( com.google.gerrit.client.ui.Screen view ) { final java.lang.String token = view.getToken ( ) ; if ( ! ( token.equals ( com.google.gwt.user.client.History.getToken ( ) ) ) ) { com.google.gwt.user.client.History.newItem ( token , false ) ; if ( ( com.google.gerrit.client.Gerrit.historyHooks ) != null ) { com.google.gerrit.client.Gerrit.dispatchHistoryHooks ( token ) ; } } super . onShowView ( view ) ; view.onShowView ( ) ; }

Target:
protected void onShowView ( com.google.gerrit.client.ui.Screen view ) { final java.lang.String token = view.getToken ( ) ; if ( ! ( token.equals ( com.google.gwt.user.client.History.getToken ( ) ) ) ) { com.google.gwt.user.client.History.newItem ( token , false ) ; if ( ( com.google.gerrit.client.Gerrit.historyHooks ) != null ) { com.google.gerrit.client.Gerrit.dispatchHistoryHooks ( token ) ; } } if ( view instanceof com.google.gerrit.client.changes.ChangeListScreen ) { com.google.gerrit.client.Gerrit.lastChangeListToken = token ; } super . onShowView ( view ) ; view.onShowView ( ) ; }
Source:
private void appendFileHeader ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , final java.lang.String line ) { openLine ( m ) ; padLineNumber ( m ) ; padLineNumber ( m ) ; m.openTd ( ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffText ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffTextFileHeader ( ) ) ; m.append ( line ) ; m.closeTd ( ) ; closeLine ( m ) ; }

Target:
private void appendFileHeader ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , final java.lang.String line ) { openLine ( m ) ; padLineNumberForSideA ( m ) ; padLineNumberForSideB ( m ) ; m.openTd ( ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffText ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffTextFileHeader ( ) ) ; m.append ( line ) ; m.closeTd ( ) ; closeLine ( m ) ; }
Source:
public com.google.gerrit.extensions.api.changes.ChangeApi id ( java.lang.String id ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return api.create ( changes.parse ( TopLevelResource.INSTANCE , com.google.gerrit.extensions.restapi.IdString.fromUrl ( id ) ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot parse change" , e ) ; } }

Target:
public com.google.gerrit.extensions.api.changes.ChangeApi id ( java.lang.String id ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return api.create ( changes.parse ( TopLevelResource.INSTANCE , com.google.gerrit.extensions.restapi.IdString.fromUrl ( id ) ) ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot parse change" , e ) ; } }
Source:
public java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > files ( int parentNum ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return ( ( java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > ) ( listFiles.setParent ( parentNum ) . apply ( revision ) . value ( ) ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException | com.google.gerrit.server.patch.PatchListNotAvailableException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve files" , e ) ; } }

Target:
public java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > files ( int parentNum ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return ( ( java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > ) ( listFiles.setParent ( parentNum ) . apply ( revision ) . value ( ) ) ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot retrieve files" , e ) ; } }
Source:
private static java.util.Map < java.lang.String , com.google.gerrit.extensions.common.RevisionInfo > toRevisionInfoMap ( com.google.gerrit.acceptance.RestResponse r ) throws java.io.IOException { java.util.Map < java.lang.String , com.google.gerrit.extensions.common.RevisionInfo > result = newGson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.Map < java.lang.String , com.google.gerrit.extensions.common.RevisionInfo > > ( ) { } . getType ( ) ) ; return result ; }

Target:
private com.google.gerrit.extensions.common.EditInfo toEditInfo ( ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = session.get ( urlEdit ( ) ) ; org.junit.Assert.assertEquals ( org.apache.http.HttpStatus.SC_OK , r.getStatusCode ( ) ) ; return newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.EditInfo.class ) ; }
Source:
public java.lang.Iterable < com.google.gerrit.extensions.common.WebLinkInfo > getProjectLinks ( java.lang.String project ) { java.util.List < com.google.gerrit.extensions.common.WebLinkInfo > links = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.extensions.webui.ProjectWebLink webLink : projectLinks ) { links.add ( new com.google.gerrit.extensions.common.WebLinkInfo ( webLink.getLinkName ( ) , webLink.getImageUrl ( ) , webLink.getProjectUrl ( project ) , webLink.getTarget ( ) ) ) ; } return links ; }

Target:
public java.lang.Iterable < com.google.gerrit.extensions.common.WebLinkInfo > getProjectLinks ( java.lang.String project ) { java.util.List < com.google.gerrit.extensions.common.WebLinkInfo > links = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.extensions.webui.ProjectWebLink webLink : projectLinks ) { links.add ( webLink.getProjectWeblink ( project ) ) ; } return links ; }
Source:
public void setUp ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.server.project.testing.Util.allow ( cfg , Permission.OWNER , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( cfg , Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/for/refs/meta/config" ) ; com.google.gerrit.server.project.testing.Util.allow ( cfg , Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , RefNames.REFS_CONFIG ) ; saveProjectConfig ( project , cfg ) ; setApiUser ( user ) ; fetchRefsMetaConfig ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { com.google.gerrit.server.project.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.server.project.testing.Util.allow ( cfg , Permission.OWNER , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( cfg , Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/for/refs/meta/config" ) ; com.google.gerrit.server.project.testing.Util.allow ( cfg , Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , RefNames.REFS_CONFIG ) ; saveProjectConfig ( project , cfg ) ; setApiUser ( user ) ; fetchRefsMetaConfig ( ) ; }
Source:
private org.eclipse.jetty.util.resource.Resource getBaseResource ( ) throws java.io.IOException { if ( ( baseResource ) == null ) { try { baseResource = unpackWar ( ) ; } catch ( java.io.FileNotFoundException err ) { if ( ( err.getMessage ( ) ) == ( com.google.gerrit.main.GerritLauncher.NOT_ARCHIVED ) ) { baseResource = useDeveloperBuild ( ) ; } else { throw err ; } } } return baseResource ; }

Target:
private org.eclipse.jetty.util.resource.Resource getBaseResource ( ) throws java.io.IOException { if ( ( baseResource ) == null ) { try { baseResource = unpackWar ( ) ; } catch ( java.io.FileNotFoundException err ) { if ( ( err.getMessage ( ) ) == ( com.google.gerrit.launcher.GerritLauncher.NOT_ARCHIVED ) ) { baseResource = useDeveloperBuild ( ) ; } else { throw err ; } } } return baseResource ; }
Source:
public void go ( ) { if ( ( com.google.gerrit.client.Gerrit.patchScreen ) != null ) { com.google.gerrit.client.Gerrit.patchScreen.setTopView ( PatchScreen.TopView.MAIN ) ; if ( type == ( com.google.gerrit.client.Gerrit.patchScreen.getPatchScreenType ( ) ) ) { com.google.gwt.dom.client.AnchorElement.as ( getElement ( ) ) . blur ( ) ; } else { new com.google.gerrit.client.ui.PatchLink ( "" , type , com.google.gerrit.client.Gerrit.patchScreen ) . go ( ) ; } } }

Target:
public void go ( ) { if ( ( com.google.gerrit.client.Gerrit.patchScreen ) != null ) { com.google.gerrit.client.Gerrit.patchScreen.setTopView ( tv ) ; } com.google.gwt.dom.client.AnchorElement.as ( getElement ( ) ) . blur ( ) ; }
Source:
public void testGetUrlIsDroppingTrailingSlash ( ) throws java.lang.Exception { org.mockito.Mockito.when ( configMock.getString ( com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , null , com.ericsson.gerrit.plugins.highavailability.Configuration.URL_KEY ) ) . thenReturn ( ( ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.URL ) + "/" ) ) ; initializeConfiguration ( ) ; com.google.common.truth.Truth.assertThat ( configuration ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( configuration.peerInfo ( ) . url ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.URL ) ; }

Target:
public void testGetUrl ( ) throws java.lang.Exception { initializeConfiguration ( ) ; com.google.common.truth.Truth.assertThat ( configuration.peerInfoStatic ( ) . url ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.EMPTY ) ; org.mockito.Mockito.when ( configMock.getString ( com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , com.ericsson.gerrit.plugins.highavailability.Configuration.STATIC_SUBSECTION , com.ericsson.gerrit.plugins.highavailability.Configuration.URL_KEY ) ) . thenReturn ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.URL ) ; initializeConfiguration ( ) ; com.google.common.truth.Truth.assertThat ( configuration.peerInfoStatic ( ) . url ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.URL ) ; }