auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testEvictGroupsOK ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.AccountGroup.Id key = AccountGroup.Id.parse ( "123" ) ; java.lang.String keyJson = new com.google.gson.GsonBuilder ( ) . create ( ) . toJson ( key ) ; org.mockito.Mockito.when ( httpSessionMock.post ( buildCacheEndpoint ( Constants.GROUPS ) , keyJson ) ) . thenReturn ( new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarderTest.SUCCESSFUL , com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarderTest.EMPTY_MSG ) ) ; com.google.common.truth.Truth.assertThat ( forwarder.evict ( Constants.GROUPS , key ) ) . isTrue ( ) ; }

Target:
public void testEvictGroupsOK ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.AccountGroup.Id key = new com.google.gerrit.reviewdb.client.AccountGroup.Id ( 123 ) ; java.lang.String keyJson = new com.google.gson.GsonBuilder ( ) . create ( ) . toJson ( key ) ; org.mockito.Mockito.when ( httpSessionMock.post ( buildCacheEndpoint ( Constants.GROUPS ) , keyJson ) ) . thenReturn ( new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarderTest.SUCCESSFUL , com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarderTest.EMPTY_MSG ) ) ; com.google.common.truth.Truth.assertThat ( forwarder.evict ( Constants.GROUPS , key ) ) . isTrue ( ) ; }
Source:
public void blockPushDrafts ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/for/refs/*" ) ; com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/drafts/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCanUpload ( "refs/heads/master" , u ) ; assertBlocked ( com.google.gerrit.common.data.Permission.PUSH , "refs/drafts/refs/heads/master" , u ) ; }

Target:
public void blockPushDrafts ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/for/refs/*" ) ; com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/drafts/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCreateChange ( "refs/heads/master" , u ) ; assertBlocked ( com.google.gerrit.common.data.Permission.PUSH , "refs/drafts/refs/heads/master" , u ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.diff.DiffInfo diffInfo ) { diff = diffInfo ; fileSize = com.google.gerrit.client.diff.SideBySide2.bucketFileSize ( diffInfo ) ; net.codemirror.theme.ThemeLoader.loadTheme ( prefs.theme ( ) , themeCallback ) ; if ( prefs.syntaxHighlighting ( ) ) { if ( ( fileSize.compareTo ( com.google.gerrit.client.diff.SideBySide2.FileSize.SMALL ) ) > 0 ) { modeInjectorCb.onSuccess ( null ) ; } else { injectMode ( diffInfo , modeInjectorCb ) ; } } else { modeInjectorCb.onSuccess ( null ) ; } }

Target:
public void onSuccess ( java.lang.Void result ) { net.codemirror.theme.ThemeLoader.loadTheme ( prefs.theme ( ) , themeCallback ) ; }
Source:
static void extract ( final java.io.File dst , final java.lang.Class < ? > sibling , final java.lang.String name ) throws java.io.IOException { final java.io.InputStream in = com.google.gerrit.pgm.init.InitUtil.open ( sibling , name ) ; if ( in != null ) { com.google.gerrit.pgm.init.InitUtil.copy ( dst , in ) ; } }

Target:
static void extract ( final java.io.File dst , final java.lang.Class < ? > sibling , final java.lang.String name ) throws java.io.IOException { final java.io.InputStream in = com.google.gerrit.pgm.init.InitUtil.open ( sibling , name ) ; if ( in != null ) { java.nio.ByteBuffer buf = org.eclipse.jgit.util.IO.readWholeStream ( in , 8192 ) ; com.google.gerrit.pgm.init.InitUtil.copy ( dst , buf ) ; } }
Source:
public void getEventsShallBeConsistent ( ) throws java.lang.Exception { java.lang.String events = "/plugins/events-log/events/?t1=1970-01-01;t2=2999-01-01" ; java.lang.String change1 = "refs/changes/01/1/1" ; createChange ( ) ; java.lang.String response = adminSession.get ( events ) . getEntityContent ( ) ; com.google.common.truth.Truth.assertThat ( response ) . contains ( change1 ) ; createChange ( ) ; response = adminSession.get ( events ) . getEntityContent ( ) ; com.google.common.truth.Truth.assertThat ( response ) . contains ( change1 ) ; com.google.common.truth.Truth.assertThat ( response ) . contains ( "refs/changes/02/2/1" ) ; }

Target:
public void getEventsShallBeConsistent ( ) throws java.lang.Exception { java.lang.String events = "/plugins/events-log/events/?t1=1970-01-01;t2=2999-01-01" ; java.lang.String change1 = "refs/changes/01/1/1" ; createChange ( ) ; java.lang.String response = adminRestSession.get ( events ) . getEntityContent ( ) ; com.google.common.truth.Truth.assertThat ( response ) . contains ( change1 ) ; createChange ( ) ; response = adminRestSession.get ( events ) . getEntityContent ( ) ; com.google.common.truth.Truth.assertThat ( response ) . contains ( change1 ) ; com.google.common.truth.Truth.assertThat ( response ) . contains ( "refs/changes/02/2/1" ) ; }
Source:
public void testGetMultiple ( ) throws java.lang.Exception { com.google.gerrit.server.git.gpg.TestKey key1 = com.google.gerrit.server.git.gpg.TestKey.key1 ( ) ; com.google.gerrit.server.git.gpg.TestKey key2 = com.google.gerrit.server.git.gpg.TestKey.key2 ( ) ; tr.branch ( RefNames.REFS_GPG_KEYS ) . commit ( ) . add ( com.google.gerrit.server.git.gpg.PublicKeyStore.keyObjectId ( key1.getKeyId ( ) ) . name ( ) , ( ( key1.getPublicKeyArmored ( ) ) + ( key2.getPublicKeyArmored ( ) ) ) ) . create ( ) ; assertKeys ( key1.getKeyId ( ) , key1 , key2 ) ; }

Target:
public void testGetMultiple ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key1 = com.google.gerrit.gpg.testutil.TestKey.key1 ( ) ; com.google.gerrit.gpg.testutil.TestKey key2 = com.google.gerrit.gpg.testutil.TestKey.key2 ( ) ; tr.branch ( RefNames.REFS_GPG_KEYS ) . commit ( ) . add ( com.google.gerrit.gpg.PublicKeyStore.keyObjectId ( key1.getKeyId ( ) ) . name ( ) , ( ( key1.getPublicKeyArmored ( ) ) + ( key2.getPublicKeyArmored ( ) ) ) ) . create ( ) ; assertKeys ( key1.getKeyId ( ) , key1 , key2 ) ; }
Source:
public void patchSetObjectAndRefMissing ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.testutil.TestChanges.newPatchSet ( c.currentPatchSetId ( ) , org.eclipse.jgit.lib.ObjectId.fromString ( "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) , adminId ) ; db.patchSets ( ) . insert ( java.util.Collections.singleton ( ps ) ) ; assertProblems ( c , ( "Ref missing: " + ( ps.getId ( ) . toRefName ( ) ) ) , "Object missing: patch set 1: deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) ; }

Target:
public void patchSetObjectAndRefMissingWithFix ( ) throws java.lang.Exception { java.lang.String rev = "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = insertMissingPatchSet ( ctl , rev ) ; ctl = reload ( ctl ) ; java.lang.String refName = ps.getId ( ) . toRefName ( ) ; assertProblems ( ctl , new com.google.gerrit.extensions.api.changes.FixInput ( ) , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Ref missing: " + refName ) ) , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Object missing: patch set 2: " + rev ) ) ) ; }
Source:
protected void onStarClick ( final int row ) { final com.google.gerrit.common.data.ChangeInfo c = getRowItem ( row ) ; if ( ( c != null ) && ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { com.google.gerrit.client.changes.ChangeCache.get ( c.getId ( ) ) . getStarCache ( ) . toggleStar ( ) ; } }

Target:
protected void onStarClick ( final int row ) { final com.google.gerrit.common.data.ChangeInfo c = getRowItem ( row ) ; if ( ( c != null ) && ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { ( ( com.google.gerrit.client.changes.StarredChanges.Icon ) ( table.getWidget ( row , com.google.gerrit.client.changes.ChangeTable.C_STAR ) ) ) . toggleStar ( ) ; } }
Source:
public com.google.gerrit.reviewdb.Change update ( com.google.gerrit.reviewdb.Change c ) { c.setStatus ( Change.Status.MERGED ) ; if ( ! ( merged.equals ( c.currentPatchSetId ( ) ) ) ) { try { c.setCurrentPatchSet ( patchSetInfoFactory.get ( merged ) ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e1 ) { com.google.gerrit.server.git.MergeOp.log.error ( ( "Cannot read merged patch set " + merged ) , e1 ) ; } } com.google.gerrit.server.ChangeUtil.updated ( c ) ; return c ; }

Target:
public com.google.gerrit.reviewdb.Change update ( com.google.gerrit.reviewdb.Change change ) { change.setCurrentPatchSet ( patchSetInfoFactory.get ( newCommit , ps.getId ( ) ) ) ; return change ; }
Source:
public com.google.common.collect.SetMultimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.reviewdb.client.Branch.NameKey > branchesByProject ( ) { com.google.common.collect.SetMultimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.reviewdb.client.Branch.NameKey > ret = com.google.common.collect.HashMultimap.create ( ) ; for ( com.google.gerrit.reviewdb.client.Branch.NameKey branch : targets.keySet ( ) ) { ret.put ( branch.getParentKey ( ) , branch ) ; } return ret ; }

Target:
public com.google.common.collect.ImmutableSet < com.google.gerrit.reviewdb.client.Project.NameKey > getProjectsInOrder ( ) throws com.google.gerrit.server.git.SubmoduleException { java.util.LinkedHashSet < com.google.gerrit.reviewdb.client.Project.NameKey > projects = new java.util.LinkedHashSet < > ( ) ; for ( com.google.gerrit.reviewdb.client.Project.NameKey project : branchesByProject.keySet ( ) ) { addAllSubmoduleProjects ( project , new java.util.LinkedHashSet < > ( ) , projects ) ; } for ( com.google.gerrit.reviewdb.client.Branch.NameKey branch : updatedBranches ) { projects.add ( branch.getParentKey ( ) ) ; } return com.google.common.collect.ImmutableSet.copyOf ( projects ) ; }
Source:
private void deleteActionCategories ( com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { java.util.List < com.google.gerrit.reviewdb.ApprovalCategory > delete = new java.util.ArrayList < com.google.gerrit.reviewdb.ApprovalCategory > ( ) ; for ( com.google.gerrit.reviewdb.ApprovalCategory category : categoryMap.values ( ) ) { if ( ( category.getPosition ( ) ) < 0 ) { delete.add ( category ) ; } } db.approvalCategories ( ) . delete ( delete ) ; }

Target:
private void deleteActionCategories ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.reviewdb.client.ApprovalCategory > delete = new java.util.ArrayList < com.google.gerrit.reviewdb.client.ApprovalCategory > ( ) ; for ( com.google.gerrit.reviewdb.client.ApprovalCategory category : categoryMap.values ( ) ) { if ( ( category.getPosition ( ) ) < 0 ) { delete.add ( category ) ; } } db.approvalCategories ( ) . delete ( delete ) ; }
Source:
public void singleHeadText ( ) throws java.lang.Exception { com.google.gitiles.FakeHttpServletRequest req = com.google.gitiles.FakeHttpServletRequest.newRequest ( ) ; req.setPathInfo ( "/test/+refs/heads/master" ) ; req.setQueryString ( "format=TEXT" ) ; com.google.gitiles.FakeHttpServletResponse res = new com.google.gitiles.FakeHttpServletResponse ( ) ; servlet.service ( req , res ) ; org.junit.Assert.assertEquals ( 200 , res.getStatus ( ) ) ; org.junit.Assert.assertEquals ( ( ( id ( "refs/heads/master" ) ) + " refs/heads/master\n" ) , res.getActualBodyString ( ) ) ; }

Target:
public void singleHeadText ( ) throws java.lang.Exception { setUpSimpleRefs ( ) ; com.google.gitiles.FakeHttpServletRequest req = com.google.gitiles.FakeHttpServletRequest.newRequest ( ) ; req.setPathInfo ( "/test/+refs/heads/master" ) ; req.setQueryString ( "format=TEXT" ) ; com.google.gitiles.FakeHttpServletResponse res = new com.google.gitiles.FakeHttpServletResponse ( ) ; servlet.service ( req , res ) ; org.junit.Assert.assertEquals ( 200 , res.getStatus ( ) ) ; org.junit.Assert.assertEquals ( ( ( id ( "refs/heads/master" ) ) + " refs/heads/master\n" ) , res.getActualBodyString ( ) ) ; }
Source:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.common.ChangeListener.class ) . to ( com.googlesource.gerrit.plugins.reviewersbyblame.ChangeUpdatedListener.class ) ; factory ( ReviewersByBlame.Factory.class ) ; }

Target:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.common.ChangeListener.class ) . to ( com.googlesource.gerrit.plugins.reviewersbyblame.ChangeUpdatedListener.class ) ; factory ( ReviewersByBlame.Factory.class ) ; bind ( com.google.gerrit.server.config.ProjectConfigEntry.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.Exports.named ( "maxReviewers" ) ) . toInstance ( new com.google.gerrit.server.config.ProjectConfigEntry ( "Max Reviewers" , 3 , true , ( "The maximum number of reviewers that should be automatically added" + " to a change based on the git blame computation on the changed files." ) ) ) ; }
Source:
public void testNegativeAdvance ( ) { com.google.gerrit.client.diff.EditIterator i = new com.google.gerrit.client.diff.EditIterator ( lines , 0 ) ; assertLineChsEqual ( net.codemirror.lib.LineCharacter.create ( 1 , 1 ) , i.advance ( 5 ) ) ; assertLineChsEqual ( net.codemirror.lib.LineCharacter.create ( 0 , 3 ) , i.advance ( ( - 2 ) ) ) ; }

Target:
public void testNegativeAdvance ( ) { com.google.gerrit.client.diff.EditIterator i = new com.google.gerrit.client.diff.EditIterator ( lines , 0 ) ; assertLineChsEqual ( net.codemirror.lib.Pos.create ( 1 , 1 ) , i.advance ( 5 ) ) ; assertLineChsEqual ( net.codemirror.lib.Pos.create ( 0 , 3 ) , i.advance ( ( - 2 ) ) ) ; }
Source:
void display ( final java.util.List < com.google.gerrit.client.groups.MemberInfo > result ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.client.groups.MemberInfo i : result ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , i ) ; } }

Target:
void display ( final java.util.List < com.google.gerrit.client.account.AccountInfo > result ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.client.account.AccountInfo i : result ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , i ) ; } }
Source:
public void reset ( ) { if ( ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) && ( ( com.google.gerrit.client.Gerrit.getAccountDiffPreference ( ) ) != null ) ) { set ( com.google.gerrit.client.Gerrit.getAccountDiffPreference ( ) ) ; } else { set ( com.google.gerrit.reviewdb.client.AccountDiffPreference.createDefault ( null ) ) ; } }

Target:
public void reset ( ) { if ( ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) && ( ( com.google.gerrit.client.Gerrit.getDiffPreferences ( ) ) != null ) ) { set ( com.google.gerrit.client.Gerrit.getDiffPreferences ( ) ) ; } else { set ( com.google.gerrit.extensions.client.DiffPreferencesInfo.defaults ( ) ) ; } }
Source:
public com.google.gerrit.extensions.client.DiffPreferencesInfo apply ( com.google.gerrit.server.config.ConfigResource configResource , com.google.gerrit.extensions.client.DiffPreferencesInfo input ) throws com.google.gerrit.extensions.restapi.BadRequestException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( input == null ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "input must be provided" ) ; } if ( ! ( com.google.gerrit.server.restapi.config.SetDiffPreferences.hasSetFields ( input ) ) ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "unsupported option" ) ; } try ( com.google.gerrit.server.git.MetaDataUpdate md = metaDataUpdateFactory.get ( ) . create ( allUsersName ) ) { com.google.gerrit.extensions.client.DiffPreferencesInfo updatedPrefs = com.google.gerrit.server.account.PreferencesConfig.updateDefaultDiffPreferences ( md , input ) ; accountCache.evictAllNoReindex ( ) ; return updatedPrefs ; } }

Target:
public com.google.gerrit.extensions.client.DiffPreferencesInfo apply ( com.google.gerrit.server.config.ConfigResource configResource , com.google.gerrit.extensions.client.DiffPreferencesInfo input ) throws com.google.gerrit.extensions.restapi.BadRequestException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( input == null ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "input must be provided" ) ; } if ( ! ( com.google.gerrit.server.restapi.config.SetDiffPreferences.hasSetFields ( input ) ) ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "unsupported option" ) ; } try ( com.google.gerrit.server.git.MetaDataUpdate md = metaDataUpdateFactory.get ( ) . create ( allUsersName ) ) { com.google.gerrit.extensions.client.DiffPreferencesInfo updatedPrefs = com.google.gerrit.server.account.Preferences.updateDefaultDiffPreferences ( md , input ) ; accountCache.evictAllNoReindex ( ) ; return updatedPrefs ; } }
Source:
public void isEnabledForMultipleRefs ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig config = getConfig ( ( "[plugin \"uploadvalidator\"]\n" + ( ( " ref = refs/heads/branch1\n" + " ref = refs/heads/branch2\n" ) + " blockedFileExtension = jar" ) ) ) ; assertThat ( config.isEnabledForRef ( projectName , "refs/heads/branch1" ) ) . isTrue ( ) ; assertThat ( config.isEnabledForRef ( projectName , "refs/heads/branch2" ) ) . isTrue ( ) ; assertThat ( config.isEnabledForRef ( projectName , "refs/heads/branch3" ) ) . isFalse ( ) ; }

Target:
public void isEnabledForMultipleRefs ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig config = getConfig ( ( "[plugin \"uploadvalidator\"]\n" + ( ( " ref = refs/heads/branch1\n" + " ref = refs/heads/branch2\n" ) + " blockedFileExtension = jar" ) ) ) ; com.google.common.truth.Truth.assertThat ( config.isEnabledForRef ( projectName , "refs/heads/branch1" , "blockedFileExtension" ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( config.isEnabledForRef ( projectName , "refs/heads/branch2" , "blockedFileExtension" ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( config.isEnabledForRef ( projectName , "refs/heads/branch3" , "blockedFileExtension" ) ) . isFalse ( ) ; }
Source:
private void uncacheSshKeys ( final com.google.gerrit.client.reviewdb.Account.Id me , final com.google.gerrit.client.reviewdb.ReviewDb db ) { final com.google.gerrit.client.reviewdb.Account a = com.google.gerrit.client.rpc.Common.getAccountCache ( ) . get ( me , db ) ; if ( a != null ) { uncacheSshKeys ( a.getSshUserName ( ) ) ; } }

Target:
private void uncacheSshKeys ( final com.google.gerrit.client.reviewdb.Account.Id me ) { uncacheSshKeys ( accountCache.get ( me ) . getAccount ( ) . getSshUserName ( ) ) ; }
Source:
public void testGcAll ( ) throws java.lang.Exception { java.lang.String response = adminSshSession.exec ( "gerrit gc --all" ) ; com.google.common.truth.Truth.assert_ ( ) . withMessage ( adminSshSession.getError ( ) ) . that ( adminSshSession.hasError ( ) ) . isFalse ( ) ; assertNoError ( response ) ; gcAssert.assertHasPackFile ( allProjects , project , project2 , project3 ) ; }

Target:
public void testGcAll ( ) throws java.lang.Exception { java.lang.String response = adminSshSession.exec ( "gerrit gc --all" ) ; com.google.common.truth.Truth.assertWithMessage ( adminSshSession.getError ( ) ) . that ( adminSshSession.hasError ( ) ) . isFalse ( ) ; assertNoError ( response ) ; gcAssert.assertHasPackFile ( allProjects , project , project2 , project3 ) ; }
Source:
private static void dashboard ( final java.lang.String token ) { com.google.gerrit.client.Gerrit.display ( token , new com.google.gerrit.client.changes.AccountDashboardScreen ( Account.Id.parse ( com.google.gerrit.client.Dispatcher.skip ( token ) ) ) ) ; }

Target:
private static void dashboard ( final java.lang.String token ) { java.lang.String rest = com.google.gerrit.client.Dispatcher.skip ( token ) ; if ( rest.matches ( "[0-9]+" ) ) { com.google.gerrit.client.Gerrit.display ( token , new com.google.gerrit.client.changes.AccountDashboardScreen ( Account.Id.parse ( rest ) ) ) ; return ; } if ( rest.startsWith ( "?" ) ) { com.google.gerrit.client.Gerrit.display ( token , new com.google.gerrit.client.changes.CustomDashboardScreen ( rest.substring ( 1 ) ) ) ; return ; } com.google.gerrit.client.Gerrit.display ( token , new com.google.gerrit.client.NotFoundScreen ( ) ) ; }
Source:
protected void configure ( ) { install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . implement ( com.google.gerrit.server.index.change.ChangeIndex.class , com.google.gerrit.elasticsearch.ElasticChangeIndex.class ) . build ( ChangeIndex.Factory.class ) ) ; install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . implement ( com.google.gerrit.server.index.account.AccountIndex.class , com.google.gerrit.elasticsearch.ElasticAccountIndex.class ) . build ( AccountIndex.Factory.class ) ) ; install ( new com.google.gerrit.server.index.IndexModule ( threads ) ) ; install ( new com.google.gerrit.server.index.SingleVersionModule ( singleVersions ) ) ; }

Target:
protected void configure ( ) { install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . implement ( com.google.gerrit.server.index.account.AccountIndex.class , com.google.gerrit.elasticsearch.ElasticAccountIndex.class ) . build ( AccountIndex.Factory.class ) ) ; install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . implement ( com.google.gerrit.server.index.change.ChangeIndex.class , com.google.gerrit.elasticsearch.ElasticChangeIndex.class ) . build ( ChangeIndex.Factory.class ) ) ; install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . implement ( com.google.gerrit.server.index.group.GroupIndex.class , com.google.gerrit.elasticsearch.ElasticGroupIndex.class ) . build ( GroupIndex.Factory.class ) ) ; install ( new com.google.gerrit.server.index.IndexModule ( threads ) ) ; install ( new com.google.gerrit.server.index.SingleVersionModule ( singleVersions ) ) ; }
Source:
public UiAction.Description getDescription ( com.google.gerrit.server.change.RevisionResource rsrc ) { try { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setTitle ( java.lang.String.format ( "Publish revision %d" , rsrc.getPatchSet ( ) . getPatchSetId ( ) ) ) . setVisible ( ( ( rsrc.getPatchSet ( ) . isDraft ( ) ) && ( rsrc.getControl ( ) . canPublish ( dbProvider.get ( ) ) ) ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.lang.IllegalStateException ( e ) ; } }

Target:
public UiAction.Description getDescription ( com.google.gerrit.server.change.RevisionResource rsrc ) { try { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Publish" ) . setTitle ( java.lang.String.format ( "Publish revision %d" , rsrc.getPatchSet ( ) . getPatchSetId ( ) ) ) . setVisible ( ( ( rsrc.getPatchSet ( ) . isDraft ( ) ) && ( rsrc.getControl ( ) . canPublish ( dbProvider.get ( ) ) ) ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.lang.IllegalStateException ( e ) ; } }
Source:
void appendApproval ( com.google.gerrit.reviewdb.client.ApprovalCategory category , short value , com.google.gerrit.reviewdb.client.Account user ) { sb.append ( category.getLabelName ( ) ) ; sb.append ( ( value < 0 ? "-" : "+" ) ) . append ( java.lang.Math.abs ( value ) ) . append ( ": " ) ; appendUserData ( user ) ; sb.append ( "\n" ) ; }

Target:
void appendApproval ( com.google.gerrit.common.data.LabelType label , short value , com.google.gerrit.reviewdb.client.Account user ) { sb.append ( label.getName ( ) ) ; sb.append ( com.google.gerrit.common.data.LabelValue.formatValue ( value ) ) ; sb.append ( ": " ) ; appendUserData ( user ) ; sb.append ( "\n" ) ; }
Source:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicMap.mapOf ( binder ( ) , com.googlesource.gerrit.plugins.imagare.ImageResource.IMAGE_KIND ) ; bind ( com.googlesource.gerrit.plugins.imagare.ImagesCollection.class ) ; child ( com.google.gerrit.server.project.ProjectResource.PROJECT_KIND , "images" ) . to ( com.googlesource.gerrit.plugins.imagare.ImagesCollection.class ) ; get ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "config" ) . to ( com.googlesource.gerrit.plugins.imagare.GetConfig.class ) ; put ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "config" ) . to ( com.googlesource.gerrit.plugins.imagare.PutConfig.class ) ; }

Target:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicMap.mapOf ( binder ( ) , com.googlesource.gerrit.plugins.imagare.ImageResource.IMAGE_KIND ) ; bind ( com.googlesource.gerrit.plugins.imagare.ImagesCollection.class ) ; child ( com.google.gerrit.server.project.ProjectResource.PROJECT_KIND , "images" ) . to ( com.googlesource.gerrit.plugins.imagare.ImagesCollection.class ) ; get ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "config" ) . to ( com.googlesource.gerrit.plugins.imagare.GetConfig.class ) ; put ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "config" ) . to ( com.googlesource.gerrit.plugins.imagare.PutConfig.class ) ; get ( com.google.gerrit.server.account.AccountResource.ACCOUNT_KIND , "preference" ) . to ( com.googlesource.gerrit.plugins.imagare.GetPreference.class ) ; put ( com.google.gerrit.server.account.AccountResource.ACCOUNT_KIND , "preference" ) . to ( com.googlesource.gerrit.plugins.imagare.PutPreference.class ) ; }
Source:
public static < T > void invoke ( final com.google.gwtjsonrpc.client.ResultDeserializer < T > resultDeserializer , final com.google.gwt.user.client.rpc.AsyncCallback < T > callback , final com.google.gwt.core.client.JavaScriptObject rpcResult ) { final T result ; try { result = resultDeserializer.fromResult ( rpcResult ) ; } catch ( java.lang.RuntimeException e ) { callback.onFailure ( new com.google.gwt.user.client.rpc.InvocationException ( "Invalid JSON Response" , e ) ) ; return ; } callback.onSuccess ( result ) ; }

Target:
public static < T > void invoke ( final com.google.gwtjsonrpc.client.impl.ResultDeserializer < T > resultDeserializer , final com.google.gwt.user.client.rpc.AsyncCallback < T > callback , final com.google.gwt.core.client.JavaScriptObject rpcResult ) { final T result ; try { result = resultDeserializer.fromResult ( rpcResult ) ; } catch ( java.lang.RuntimeException e ) { callback.onFailure ( new com.google.gwt.user.client.rpc.InvocationException ( "Invalid JSON Response" , e ) ) ; return ; } callback.onSuccess ( result ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { for ( com.google.gerrit.reviewdb.Patch p : detail.getPatches ( ) ) { com.google.gwt.user.client.Window.open ( ( ( ( Window.Location.getPath ( ) ) + "#" ) + ( com.google.gerrit.client.Dispatcher.toPatchUnified ( p.getKey ( ) ) ) ) , "_blank" , null ) ; } }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { for ( com.google.gerrit.reviewdb.Patch p : detail.getPatches ( ) ) { openWindow ( com.google.gerrit.client.Dispatcher.toPatchUnified ( diffBaseId , p.getKey ( ) ) ) ; } }
Source:
public void suggestReviewersChange ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > reviewers = suggestReviewers ( changeId , "u" , 6 ) ; com.google.common.truth.Truth.assertThat ( reviewers ) . hasSize ( 6 ) ; reviewers = suggestReviewers ( changeId , "u" , 5 ) ; com.google.common.truth.Truth.assertThat ( reviewers ) . hasSize ( 5 ) ; reviewers = suggestReviewers ( changeId , "users3" , 10 ) ; com.google.common.truth.Truth.assertThat ( reviewers ) . hasSize ( 1 ) ; }

Target:
public void suggestReviewersNoResult3 ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > reviewers = suggestReviewers ( changeId , name ( "" ) . substring ( 0 , 1 ) , 6 ) ; com.google.common.truth.Truth.assertThat ( reviewers ) . isEmpty ( ) ; }
Source:
private static void addDiffLink ( final com.google.gerrit.client.ui.LinkMenuBar m , final java.lang.String text , final com.google.gerrit.client.patches.PatchScreen.TopView tv ) { m.addItem ( new com.google.gerrit.client.ui.LinkMenuItem ( text , "" ) { @ java.lang.Override 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 ( ) ; } } ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.info.AccountPreferencesInfo prefs ) { com.google.gerrit.client.Gerrit.setUserPreferences ( prefs ) ; }
Source:
private void send ( ) throws javax.mail.MessagingException { if ( rcptTo.isEmpty ( ) ) { return ; } if ( ( ( rcptTo.size ( ) ) == 1 ) && ( rcptTo.contains ( fromId ) ) ) { return ; } msg.setText ( body.toString ( ) , "UTF-8" ) ; javax.mail.Transport.send ( msg ) ; }

Target:
private void send ( ) throws javax.mail.MessagingException { if ( haveRcptTo ( ) ) { ccSender ( ) ; openFooter ( ) ; body.append ( "To unsubscribe, visit " ) ; body.append ( settingsUrl ( ) ) ; body.append ( "\n" ) ; msg.setText ( body.toString ( ) , "UTF-8" ) ; javax.mail.Transport.send ( msg ) ; } }
Source:
public void run ( ) { net.codemirror.lib.CodeMirror.Viewport fromTo = cm.getViewport ( ) ; int size = ( ( fromTo.getTo ( ) ) - ( fromTo.getFrom ( ) ) ) + 1 ; if ( ( cm.getOldViewportSize ( ) ) == size ) { return ; } cm.setOldViewportSize ( size ) ; diffTable.overview.adjustGutters ( cmB ) ; }

Target:
public void run ( ) { skipManager.removeAll ( ) ; skipManager.render ( context , diff ) ; diffTable.overview.refresh ( ) ; }
Source:
public void testGcAll ( ) throws java.lang.Exception { java.lang.String response = sshSession.exec ( "gerrit gc --all" ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( sshSession.getError ( ) ) . that ( sshSession.hasError ( ) ) . isFalse ( ) ; assertNoError ( response ) ; gcAssert.assertHasPackFile ( allProjects , project , project2 , project3 ) ; }

Target:
public void testGcAll ( ) throws java.lang.Exception { java.lang.String response = adminSshSession.exec ( "gerrit gc --all" ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( adminSshSession.getError ( ) ) . that ( adminSshSession.hasError ( ) ) . isFalse ( ) ; assertNoError ( response ) ; gcAssert.assertHasPackFile ( allProjects , project , project2 , project3 ) ; }
Source:
public void myAgreements ( final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.account.AgreementInfo > callback ) { run ( callback , new com.google.gerrit.server.rpc.account.Action < com.google.gerrit.client.account.AgreementInfo > ( ) { public com.google.gerrit.client.account.AgreementInfo run ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.client.account.AgreementInfo i = new com.google.gerrit.client.account.AgreementInfo ( ) ; i.load ( com.google.gerrit.client.rpc.Common.getAccountId ( ) , db ) ; return i ; } } ) ; }

Target:
public void myAgreements ( final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.account.AgreementInfo > callback ) { agreementInfoFactory.create ( ) . to ( callback ) ; }
Source:
private void update ( org.eclipse.jgit.revwalk.RevCommit rev ) throws java.lang.Exception { org.eclipse.jgit.lib.RefUpdate u = db.updateRef ( RefNames.REFS_CONFIG ) ; u.disableRefLog ( ) ; u.setNewObjectId ( rev ) ; org.eclipse.jgit.lib.RefUpdate.Result result = u.forceUpdate ( ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( ( "Cannot update ref for test: " + result ) ) . that ( result ) . isAnyOf ( Result.FAST_FORWARD , Result.FORCED , Result.NEW , Result.NO_CHANGE ) ; }

Target:
private void update ( org.eclipse.jgit.revwalk.RevCommit rev ) throws java.lang.Exception { org.eclipse.jgit.lib.RefUpdate u = db.updateRef ( RefNames.REFS_CONFIG ) ; u.disableRefLog ( ) ; u.setNewObjectId ( rev ) ; org.eclipse.jgit.lib.RefUpdate.Result result = u.forceUpdate ( ) ; com.google.common.truth.Truth.assert_ ( ) . withMessage ( ( "Cannot update ref for test: " + result ) ) . that ( result ) . isAnyOf ( Result.FAST_FORWARD , Result.FORCED , Result.NEW , Result.NO_CHANGE ) ; }
Source:
public static java.lang.String toLongString ( final com.google.gerrit.client.reviewdb.Change.Status status ) { if ( status == null ) { return "" ; } else if ( status == ( Change.Status.NEW ) ) { return com.google.gerrit.client.changes.Util.C.statusLongNew ( ) ; } else if ( status == ( Change.Status.MERGED ) ) { return com.google.gerrit.client.changes.Util.C.statusLongMerged ( ) ; } else if ( status == ( Change.Status.ABANDONED ) ) { return com.google.gerrit.client.changes.Util.C.statusLongAbandoned ( ) ; } else { return status.name ( ) ; } }

Target:
public static java.lang.String toLongString ( final com.google.gerrit.client.reviewdb.Change.Status status ) { if ( status == null ) { return "" ; } switch ( status ) { case NEW : return com.google.gerrit.client.changes.Util.C.statusLongNew ( ) ; case SUBMITTED : return com.google.gerrit.client.changes.Util.C.statusLongSubmitted ( ) ; case MERGED : return com.google.gerrit.client.changes.Util.C.statusLongMerged ( ) ; case ABANDONED : return com.google.gerrit.client.changes.Util.C.statusLongAbandoned ( ) ; default : return status.name ( ) ; } }
Source:
private java.lang.String categoryOf ( final com.google.gerrit.reviewdb.ProjectRight r ) { final com.google.gerrit.common.data.ApprovalType type = approvalTypes.getApprovalType ( r.getApprovalCategoryId ( ) ) ; if ( type == null ) { return r.getApprovalCategoryId ( ) . get ( ) ; } return type.getCategory ( ) . getName ( ) ; }

Target:
private java.lang.String categoryOf ( final com.google.gerrit.reviewdb.RefRight r ) { final com.google.gerrit.common.data.ApprovalType type = approvalTypes.getApprovalType ( r.getApprovalCategoryId ( ) ) ; if ( type == null ) { return r.getApprovalCategoryId ( ) . get ( ) ; } return type.getCategory ( ) . getName ( ) ; }
Source:
public void init ( final javax.servlet.ServletConfig config ) throws javax.servlet.ServletException { super . init ( config ) ; com.google.gerrit.server.ssh.SshServlet.startSshd ( ) ; }

Target:
public void init ( final javax.servlet.ServletConfig config ) throws javax.servlet.ServletException { super . init ( config ) ; try { com.google.gerrit.server.ssh.GerritSshDaemon.startSshd ( ) ; } catch ( java.net.SocketException e ) { throw new javax.servlet.ServletException ( e ) ; } catch ( com.google.gwtorm.client.OrmException e ) { throw new javax.servlet.ServletException ( e ) ; } catch ( com.google.gwtjsonrpc.server.XsrfException e ) { throw new javax.servlet.ServletException ( e ) ; } }
Source:
private void addMembers ( com.google.gerrit.server.group.GroupResource rsrc ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.group.AddMembers.Input input = AddMembers.Input.fromMembers ( com.google.common.collect.FluentIterable.from ( initialMembers ) . transform ( new com.google.common.base.Function < com.google.gerrit.reviewdb.client.Account.Id , java.lang.String > ( ) { @ java.lang.Override public java.lang.String apply ( com.google.gerrit.reviewdb.client.Account.Id id ) { return java.lang.String.valueOf ( id.get ( ) ) ; } } ) . toList ( ) ) ; addMembers.apply ( rsrc , input ) ; }

Target:
private void addMembers ( com.google.gerrit.server.group.GroupResource rsrc ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.group.AddMembers.Input input = AddMembers.Input.fromMembers ( initialMembers.stream ( ) . map ( java.lang.Object :: toString ) . collect ( java.util.stream.Collectors.toList ( ) ) ) ; addMembers.apply ( rsrc , input ) ; }
Source:
private char [ ] readPassword ( ) throws java.io.IOException { java.nio.file.Path passwordDevice = java.nio.file.Paths.get ( gerritConfig.getString ( com.googlesource.gerrit.plugins.secureconfig.SecureConfigSettings.SECURE_CONFIG , null , com.googlesource.gerrit.plugins.secureconfig.SecureConfigSettings.PASSWORD_DEVICE ) ) ; try ( java.io.FileInputStream in = new java.io.FileInputStream ( passwordDevice.toFile ( ) ) ) { byte [ ] passphrase = new byte [ gerritConfig.getInt ( com.googlesource.gerrit.plugins.secureconfig.SecureConfigSettings.SECURE_CONFIG , com.googlesource.gerrit.plugins.secureconfig.SecureConfigSettings.PASSWORD_LENGTH , com.googlesource.gerrit.plugins.secureconfig.SecureConfigSettings.DEF_PASSWORD_LENGTH ) ] ; in.read ( passphrase ) ; return new java.lang.String ( java.util.Base64.getEncoder ( ) . encode ( passphrase ) ) . toCharArray ( ) ; } }

Target:
private char [ ] readPassword ( ) throws java.io.IOException { java.nio.file.Path passwordDevice = java.nio.file.Paths.get ( gerritConfig.getString ( com.googlesource.gerrit.plugins.secureconfig.SecureConfigSettings.SECURE_CONFIG , null , com.googlesource.gerrit.plugins.secureconfig.SecureConfigSettings.PASSWORD_DEVICE ) ) ; try ( java.io.FileInputStream in = new java.io.FileInputStream ( passwordDevice.toFile ( ) ) ) { byte [ ] passphrase = new byte [ gerritConfig.getInt ( com.googlesource.gerrit.plugins.secureconfig.SecureConfigSettings.SECURE_CONFIG , com.googlesource.gerrit.plugins.secureconfig.SecureConfigSettings.PASSWORD_LENGTH , com.googlesource.gerrit.plugins.secureconfig.SecureConfigSettings.DEF_PASSWORD_LENGTH ) ] ; in.read ( passphrase ) ; return new java.lang.String ( org.apache.commons.codec.binary.Base64.encodeBase64 ( passphrase ) ) . toCharArray ( ) ; } }
Source:
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 ) ) ; bind ( com.google.gerrit.server.FileTypeRegistry.class ) . toInstance ( new com.google.gerrit.server.FileTypeRegistry ( gs ) ) ; } 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 ) ) ; bind ( com.google.gerrit.server.FileTypeRegistry.class ) . to ( com.google.gerrit.server.MimeUtilFileTypeRegistry.class ) ; } catch ( com.google.gwtorm.client.OrmException e ) { addError ( e ) ; } catch ( com.google.gwtjsonrpc.server.XsrfException e ) { addError ( e ) ; } }
Source:
public void submitWithRebaseWithoutAddPatchSetPermission ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.server.project.Util.block ( cfg , Permission.ADD_PATCH_SET , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.allow ( cfg , Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( cfg , com.google.gerrit.common.data.Permission.forLabel ( com.google.gerrit.server.project.Util.codeReview ( ) . getName ( ) ) , ( - 2 ) , 2 , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; saveProjectConfig ( project , cfg ) ; submitWithRebase ( user ) ; }

Target:
public void submitWithRebaseWithoutAddPatchSetPermission ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.server.project.testing.Util.block ( cfg , Permission.ADD_PATCH_SET , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( cfg , Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( cfg , com.google.gerrit.common.data.Permission.forLabel ( com.google.gerrit.server.project.testing.Util.codeReview ( ) . getName ( ) ) , ( - 2 ) , 2 , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; saveProjectConfig ( project , cfg ) ; submitWithRebase ( user ) ; }
Source:
public void addReviewer ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.api.changes.AddReviewerInput in = new com.google.gerrit.extensions.api.changes.AddReviewerInput ( ) ; in.reviewer = user.email ; gApi.changes ( ) . id ( r.getChangeId ( ) ) . addReviewer ( in ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableSet.of ( user.id ) , getReviewers ( r.getChangeId ( ) ) ) ; }

Target:
public void addReviewer ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.api.changes.AddReviewerInput in = new com.google.gerrit.extensions.api.changes.AddReviewerInput ( ) ; in.reviewer = user.email ; gApi.changes ( ) . id ( r.getChangeId ( ) ) . addReviewer ( in ) ; com.google.common.truth.Truth.assertThat ( getReviewers ( r.getChangeId ( ) ) ) . containsExactlyElementsIn ( com.google.common.collect.ImmutableSet.of ( user.id ) ) ; }
Source:
public void onKeyPress ( com.google.gwt.user.client.ui.Widget sender , char keyCode , int modifiers ) { if ( this . onKeyPress ( keyCode , modifiers ) ) { final com.google.gwt.user.client.Event event = com.google.gwt.user.client.DOM.eventGetCurrentEvent ( ) ; com.google.gwt.user.client.DOM.eventCancelBubble ( event , true ) ; com.google.gwt.user.client.DOM.eventPreventDefault ( event ) ; } }

Target:
public void onKeyPress ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { if ( this . onKeyPress ( event ) ) { event.stopPropagation ( ) ; event.preventDefault ( ) ; } }
Source:
private void saveChange ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { change = ctx.getChange ( ) ; wasDraftChange = ( change.getStatus ( ) ) == ( Change.Status.DRAFT ) ; if ( wasDraftChange ) { change.setStatus ( Change.Status.NEW ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; ctx.getDb ( ) . changes ( ) . update ( java.util.Collections.singleton ( change ) ) ; } }

Target:
private void savePatchSet ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException { if ( ! ( patchSet.isDraft ( ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "Patch set is not a draft" ) ; } psUtil.publish ( ctx.getDb ( ) , ctx.getUpdate ( psId ) , patchSet ) ; }
Source:
public void replace ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { org.apache.lucene.index.Term id = idTerm ( cd ) ; org.apache.lucene.document.Document doc = toDocument ( cd ) ; if ( cd.getChange ( ) . getStatus ( ) . isOpen ( ) ) { closedIndex.delete ( id ) ; openIndex.replace ( id , doc ) ; } else { openIndex.delete ( id ) ; closedIndex.replace ( id , doc ) ; } }

Target:
public void replace ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { org.apache.lucene.index.Term id = idTerm ( cd ) ; org.apache.lucene.document.Document doc = toDocument ( cd ) ; if ( readOnly ) { return ; } if ( cd.getChange ( ) . getStatus ( ) . isOpen ( ) ) { closedIndex.delete ( id ) ; openIndex.replace ( id , doc ) ; } else { openIndex.delete ( id ) ; closedIndex.replace ( id , doc ) ; } }
Source:
public void extend ( com.google.gerrit.server.events.ChangeAttribute a , com.google.gerrit.reviewdb.Change change ) { a.lastUpdated = ( change.getLastUpdatedOn ( ) . getTime ( ) ) / 1000L ; a.sortKey = change.getSortKey ( ) ; a.open = change.getStatus ( ) . isOpen ( ) ; a.status = change.getStatus ( ) ; }

Target:
public void extend ( com.google.gerrit.server.events.ChangeAttribute a , com.google.gerrit.reviewdb.Change change ) { a.createdOn = ( change.getCreatedOn ( ) . getTime ( ) ) / 1000L ; a.lastUpdated = ( change.getLastUpdatedOn ( ) . getTime ( ) ) / 1000L ; a.sortKey = change.getSortKey ( ) ; a.open = change.getStatus ( ) . isOpen ( ) ; a.status = change.getStatus ( ) ; }
Source:
public void noRescheduleOnNonRecoverableException ( ) throws java.io.IOException { org.mockito.Mockito.when ( session.post ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.WEBHOOK_URL , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.HEADERS , remote , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.BODY ) ) . thenThrow ( javax.net.ssl.SSLException.class ) ; task.run ( ) ; org.mockito.Mockito.verifyZeroInteractions ( executor ) ; }

Target:
public void noRescheduleOnNonRecoverableException ( ) throws java.io.IOException { org.mockito.Mockito.when ( session.post ( org.mockito.ArgumentMatchers.eq ( remote ) , org.mockito.ArgumentMatchers.eq ( content ) ) ) . thenThrow ( javax.net.ssl.SSLException.class ) ; task.run ( ) ; org.mockito.Mockito.verifyZeroInteractions ( executor ) ; }
Source:
private void sortEvents ( com.google.gerrit.reviewdb.client.Change.Id changeId , java.util.List < com.google.gerrit.server.notedb.ChangeRebuilderImpl.Event > events ) { java.util.Collections.sort ( events , com.google.gerrit.server.notedb.ChangeRebuilderImpl.EVENT_ORDER ) ; int ps = 1 ; for ( com.google.gerrit.server.notedb.ChangeRebuilderImpl.Event e : events ) { if ( ( e.psId ) == null ) { e.psId = new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , ps ) ; } else { ps = java.lang.Math.max ( ps , e.psId.get ( ) ) ; } } }

Target:
private void sortEvents ( com.google.gerrit.reviewdb.client.Change.Id changeId , java.util.List < com.google.gerrit.server.notedb.ChangeRebuilderImpl.Event > events , java.lang.Integer minPsNum ) { java.util.Collections.sort ( events , com.google.gerrit.server.notedb.ChangeRebuilderImpl.EVENT_ORDER ) ; int ps = com.google.common.base.MoreObjects.firstNonNull ( minPsNum , 1 ) ; for ( com.google.gerrit.server.notedb.ChangeRebuilderImpl.Event e : events ) { if ( ( e.psId ) == null ) { e.psId = new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , ps ) ; } else { ps = java.lang.Math.max ( ps , e.psId.get ( ) ) ; } } }