auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void computeSortKey ( final com.google.gerrit.reviewdb.client.Change c ) { long lastUpdated = c.getLastUpdatedOn ( ) . getTime ( ) ; int id = c.getId ( ) . get ( ) ; c.setSortKey ( com.google.gerrit.server.ChangeUtil.sortKey ( lastUpdated , id ) ) ; }

Target:
public static void computeSortKey ( com.google.gerrit.reviewdb.client.Change c ) { long lastUpdatedMs = c.getLastUpdatedOn ( ) . getTime ( ) ; int id = c.getId ( ) . get ( ) ; c.setSortKey ( com.google.gerrit.server.ChangeUtil.sortKey ( lastUpdatedMs , id ) ) ; }
Source:
public void missingDestRef ( ) throws java.lang.Exception { com.google.gerrit.server.project.ChangeControl ctl = insertChange ( ) ; java.lang.String ref = "refs/heads/master" ; testRepo.reset ( testRepo.getRepository ( ) . exactRef ( ref ) . getObjectId ( ) ) ; org.eclipse.jgit.lib.RefUpdate ru = testRepo.getRepository ( ) . updateRef ( ref ) ; ru.setForceUpdate ( true ) ; com.google.common.truth.Truth.assertThat ( ru.delete ( ) ) . isEqualTo ( RefUpdate.Result.FORCED ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Destination ref not found (may be new branch): " + ref ) ) ) ; }

Target:
public void missingDestRef ( ) throws java.lang.Exception { com.google.gerrit.server.notedb.ChangeNotes notes = insertChange ( ) ; java.lang.String ref = "refs/heads/master" ; testRepo.reset ( testRepo.getRepository ( ) . exactRef ( ref ) . getObjectId ( ) ) ; org.eclipse.jgit.lib.RefUpdate ru = testRepo.getRepository ( ) . updateRef ( ref ) ; ru.setForceUpdate ( true ) ; com.google.common.truth.Truth.assertThat ( ru.delete ( ) ) . isEqualTo ( RefUpdate.Result.FORCED ) ; assertProblems ( notes , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Destination ref not found (may be new branch): " + ref ) ) ) ; }
Source:
void doReply ( ) { if ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { com.google.gerrit.client.Gerrit.doSignIn ( parent.getToken ( ) ) ; } else if ( ( replyBox ) == null ) { com.google.gerrit.client.diff.DraftBox box = addReplyBox ( ) ; if ( ! ( getCommentInfo ( ) . has_line ( ) ) ) { parent.addFileCommentBox ( box , comment.side ( ) ) ; } } else { openReplyBox ( ) ; } }

Target:
com.google.gerrit.client.diff.DraftBox addReplyBox ( ) { com.google.gerrit.client.diff.DraftBox box = parent.addDraftBox ( parent.createReply ( comment ) , getSide ( ) ) ; registerReplyBox ( box ) ; return box ; }
Source:
public void testNoRequestWhenPeerInfoUnknown ( ) throws java.io.IOException { httpSession = new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSession ( new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpClientProvider ( configMock ) . get ( ) , com.google.inject.util.Providers.of ( com.google.common.base.Optional.< com.ericsson.gerrit.plugins.highavailability.peers.PeerInfo > absent ( ) ) ) ; try { httpSession.post ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ENDPOINT ) ; org.junit.Assert.fail ( "Expected PeerInfoNotAvailableException" ) ; } catch ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.PeerInfoNotAvailableException e ) { } com.github.tomakehurst.wiremock.client.WireMock.verify ( com.github.tomakehurst.wiremock.client.WireMock.exactly ( 0 ) , com.github.tomakehurst.wiremock.client.WireMock.anyRequestedFor ( com.github.tomakehurst.wiremock.client.WireMock.anyUrl ( ) ) ) ; }

Target:
public void testNoRequestWhenPeerInfoUnknown ( ) throws java.io.IOException { httpSession = new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSession ( new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpClientProvider ( configMock ) . get ( ) , com.google.inject.util.Providers.of ( java.util.Optional.< com.ericsson.gerrit.plugins.highavailability.peers.PeerInfo > empty ( ) ) ) ; try { httpSession.post ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ENDPOINT ) ; org.junit.Assert.fail ( "Expected PeerInfoNotAvailableException" ) ; } catch ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.PeerInfoNotAvailableException e ) { } com.github.tomakehurst.wiremock.client.WireMock.verify ( com.github.tomakehurst.wiremock.client.WireMock.exactly ( 0 ) , com.github.tomakehurst.wiremock.client.WireMock.anyRequestedFor ( com.github.tomakehurst.wiremock.client.WireMock.anyUrl ( ) ) ) ; }
Source:
public void clearReviewed ( com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { try ( java.sql.Connection con = ds.getConnection ( ) ; java.sql.PreparedStatement stmt = con.prepareStatement ( ( "DELETE FROM ACCOUNT_PATCH_REVIEWS " + "WHERE CHANGE_ID + ? AND PATCH_SET_ID = ?" ) ) ) { stmt.setInt ( 1 , psId.getParentKey ( ) . get ( ) ) ; stmt.setInt ( 2 , psId.get ( ) ) ; stmt.executeUpdate ( ) ; } catch ( java.sql.SQLException e ) { throw com.google.gerrit.server.schema.H2AccountPatchReviewStore.convertError ( "delete" , e ) ; } }

Target:
public void clearReviewed ( com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { try ( java.sql.Connection con = ds.getConnection ( ) ; java.sql.PreparedStatement stmt = con.prepareStatement ( ( "DELETE FROM account_patch_reviews " + "WHERE change_id = ? AND patch_set_id = ?" ) ) ) { stmt.setInt ( 1 , psId.getParentKey ( ) . get ( ) ) ; stmt.setInt ( 2 , psId.get ( ) ) ; stmt.executeUpdate ( ) ; } catch ( java.sql.SQLException e ) { throw com.google.gerrit.server.schema.H2AccountPatchReviewStore.convertError ( "delete" , e ) ; } }
Source:
public boolean updateChange ( com.google.gerrit.server.update.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet ps = psUtil.get ( ctx.getDb ( ) , ctx.getNotes ( ) , psId ) ; psUtil.setGroups ( ctx.getDb ( ) , ctx.getUpdate ( psId ) , ps , com.google.common.collect.ImmutableList.< java.lang.String > of ( ) ) ; ctx.bumpLastUpdatedOn ( false ) ; return true ; }

Target:
public boolean updateChange ( com.google.gerrit.server.update.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet ps = psUtil.get ( ctx.getDb ( ) , ctx.getNotes ( ) , psId ) ; psUtil.setGroups ( ctx.getDb ( ) , ctx.getUpdate ( psId ) , ps , com.google.common.collect.ImmutableList.< java.lang.String > of ( ) ) ; ctx.dontBumpLastUpdatedOn ( ) ; return true ; }
Source:
public byte [ ] getHtmlFromMarkdown ( byte [ ] data , java.lang.String charEnc ) throws java.io.UnsupportedEncodingException { return new org.pegdown.PegDownProcessor ( ( ( org.pegdown.Extensions.ALL ) & ( ~ ( org.pegdown.Extensions.HARDWRAPS ) ) ) ) . markdownToHtml ( org.eclipse.jgit.util.RawParseUtils.decode ( java.nio.charset.Charset.forName ( charEnc ) , data ) ) . getBytes ( charEnc ) ; }

Target:
public java.lang.String extractTitleFromMarkdown ( byte [ ] data , java.lang.String charEnc ) { java.lang.String md = org.eclipse.jgit.util.RawParseUtils.decode ( java.nio.charset.Charset.forName ( charEnc ) , data ) ; return findTitle ( parseMarkdown ( md ) ) ; }
Source:
public void testUnblockVisibilityByREGISTEREDUsers ( ) { com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; org.junit.Assert.assertTrue ( "u can read" , u.controlForRef ( "refs/heads/master" ) . isVisibleByRegisteredUsers ( ) ) ; }

Target:
public void testUnblockVisibilityByRegisteredUsers ( ) { com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; org.junit.Assert.assertTrue ( "u can read" , u.controlForRef ( "refs/heads/master" ) . isVisibleByRegisteredUsers ( ) ) ; }
Source:
public java.lang.Iterable < com.google.gerrit.extensions.common.WebLinkInfo > getBranchLinks ( java.lang.String project , java.lang.String branch ) { java.util.List < com.google.gerrit.extensions.common.WebLinkInfo > links = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.extensions.webui.BranchWebLink webLink : branchLinks ) { links.add ( new com.google.gerrit.extensions.common.WebLinkInfo ( webLink.getLinkName ( ) , webLink.getImageUrl ( ) , webLink.getBranchUrl ( project , branch ) , webLink.getTarget ( ) ) ) ; } return links ; }

Target:
public com.google.gerrit.extensions.common.WebLinkInfo apply ( com.google.gerrit.extensions.webui.WebLink webLink ) { return ( ( com.google.gerrit.extensions.webui.BranchWebLink ) ( webLink ) ) . getBranchWebLink ( project , branch ) ; }
Source:
public void testUsernamePatternWithRegex ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "^refs/sb/${username}/heads/.*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , "d.v" , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = util.user ( local , "dev" , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't read" , u.controlForRef ( "refs/sb/dev/heads/foobar" ) . isVisible ( ) ) ; org.junit.Assert.assertTrue ( "d can read" , d.controlForRef ( "refs/sb/dev/heads/foobar" ) . isVisible ( ) ) ; }

Target:
public void testUsernamePatternWithRegex ( ) { com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "^refs/sb/${username}/heads/.*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , "d.v" , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = util.user ( local , "dev" , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't read" , u.controlForRef ( "refs/sb/dev/heads/foobar" ) . isVisible ( ) ) ; org.junit.Assert.assertTrue ( "d can read" , d.controlForRef ( "refs/sb/dev/heads/foobar" ) . isVisible ( ) ) ; }
Source:
private java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > fetchAccountIds ( com.google.gerrit.server.change.ChangeResource changeResource ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.server.ReviewDb db = dbProvider.get ( ) ; com.google.gerrit.reviewdb.client.Change.Id changeId = changeResource.getChange ( ) . getId ( ) ; java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > accountIds = new java.util.HashSet < com.google.gerrit.reviewdb.client.Account.Id > ( ) ; for ( com.google.gerrit.reviewdb.client.PatchSetApproval patchSetApproval : db.patchSetApprovals ( ) . byChange ( changeId ) ) { accountIds.add ( patchSetApproval.getAccountId ( ) ) ; } return accountIds ; }

Target:
private java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > fetchAccountIds ( com.google.gerrit.server.change.ChangeResource rsrc ) throws com.google.gwtorm.server.OrmException { java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > accountIds = com.google.common.collect.Sets.newHashSet ( ) ; for ( com.google.gerrit.reviewdb.client.PatchSetApproval a : dbProvider.get ( ) . patchSetApprovals ( ) . byChange ( rsrc.getChange ( ) . getId ( ) ) ) { accountIds.add ( a.getAccountId ( ) ) ; } return accountIds ; }
Source:
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" ) ; } patchSet.setDraft ( false ) ; if ( ! ( wasDraftChange ) ) { com.google.gerrit.server.ChangeUtil.updated ( change ) ; ctx.getDb ( ) . changes ( ) . update ( java.util.Collections.singleton ( change ) ) ; } ctx.getDb ( ) . patchSets ( ) . update ( java.util.Collections.singleton ( patchSet ) ) ; }

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" ) ; } patchSet.setDraft ( false ) ; if ( ! ( wasDraftChange ) ) { com.google.gerrit.server.ChangeUtil.updated ( change ) ; ctx.saveChange ( ) ; } ctx.getDb ( ) . patchSets ( ) . update ( java.util.Collections.singleton ( patchSet ) ) ; }
Source:
public com.google.gerrit.index.query.DataSource < com.google.gerrit.server.account.AccountState > getSource ( com.google.gerrit.index.query.Predicate < com.google.gerrit.server.account.AccountState > p , com.google.gerrit.index.QueryOptions opts ) throws com.google.gerrit.index.query.QueryParseException { return new com.google.gerrit.lucene.LuceneAccountIndex.QuerySource ( opts , queryBuilder.toQuery ( p ) , new org.apache.lucene.search.Sort ( new org.apache.lucene.search.SortField ( com.google.gerrit.lucene.LuceneAccountIndex.ID_SORT_FIELD , SortField.Type.LONG , true ) ) ) ; }

Target:
public com.google.gerrit.index.query.DataSource < com.google.gerrit.server.account.AccountState > getSource ( com.google.gerrit.index.query.Predicate < com.google.gerrit.server.account.AccountState > p , com.google.gerrit.index.QueryOptions opts ) throws com.google.gerrit.index.query.QueryParseException { return new com.google.gerrit.lucene.LuceneQuerySource ( opts.filterFields ( IndexUtils :: accountFields ) , queryBuilder.toQuery ( p ) , new org.apache.lucene.search.Sort ( new org.apache.lucene.search.SortField ( com.google.gerrit.lucene.LuceneAccountIndex.ID_SORT_FIELD , SortField.Type.LONG , true ) ) ) ; }
Source:
protected void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; idA = org.eclipse.jgit.lib.ObjectId.fromString ( "df84c2f4f7ce7e0b25cdeac84b8870bcff319885" ) ; name = new com.google.gerrit.reviewdb.Project.NameKey ( "test" ) ; realDb = createBareRepository ( ) ; mockDb = org.easymock.classextension.EasyMock.createStrictMock ( org.eclipse.jgit.lib.Repository.class ) ; pc = org.easymock.classextension.EasyMock.createStrictMock ( com.google.gerrit.server.project.ProjectControl.class ) ; pcf = org.easymock.classextension.EasyMock.createStrictMock ( ProjectControl.Factory.class ) ; grm = org.easymock.classextension.EasyMock.createStrictMock ( com.google.gerrit.server.git.GitRepositoryManager.class ) ; }

Target:
protected void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; idA = org.eclipse.jgit.lib.ObjectId.fromString ( "df84c2f4f7ce7e0b25cdeac84b8870bcff319885" ) ; name = new com.google.gerrit.reviewdb.Project.NameKey ( "test" ) ; realDb = createBareRepository ( ) ; mockDb = org.easymock.classextension.EasyMock.createStrictMock ( org.eclipse.jgit.lib.Repository.class ) ; pc = org.easymock.classextension.EasyMock.createStrictMock ( com.google.gerrit.server.project.ProjectControl.class ) ; pcf = org.easymock.classextension.EasyMock.createStrictMock ( ProjectControl.Factory.class ) ; grm = org.easymock.classextension.EasyMock.createStrictMock ( com.google.gerrit.server.git.GitRepositoryManager.class ) ; refMocks = new java.util.ArrayList < com.google.gerrit.server.project.RefControl > ( ) ; }
Source:
void onDelete ( int idx ) { java.lang.String path = list.get ( idx ) . path ( ) ; com.google.gerrit.client.changes.ChangeEditApi.delete ( curr.getParentKey ( ) . get ( ) , path , new com.google.gwt.user.client.rpc.AsyncCallback < 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 ( curr.getParentKey ( ) ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ; }

Target:
void onRestore ( int idx ) { java.lang.String path = list.get ( idx ) . path ( ) ; com.google.gerrit.client.changes.ChangeEditApi.restore ( project.get ( ) , curr.getParentKey ( ) . get ( ) , path , new com.google.gwt.user.client.rpc.AsyncCallback < 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 ( project , curr.getParentKey ( ) ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ; }
Source:
public void onSignOut ( ) { final int max = table.getRowCount ( ) ; for ( int row = 0 ; row < max ; row ++ ) { if ( ( getRowItem ( row ) ) != null ) { table.clearCell ( row , com.google.gerrit.client.changes.ChangeTable.C_STAR ) ; } } }

Target:
public void onSignOut ( final com.google.gerrit.client.SignOutEvent event ) { final int max = table.getRowCount ( ) ; for ( int row = 0 ; row < max ; row ++ ) { if ( ( getRowItem ( row ) ) != null ) { table.clearCell ( row , com.google.gerrit.client.changes.ChangeTable.C_STAR ) ; } } regSignOut.removeHandler ( ) ; regSignOut = null ; }
Source:
public com.google.gerrit.server.config.PluginConfig getFromGerritConfig ( java.lang.String pluginName ) { return new com.google.gerrit.server.config.PluginConfig ( pluginName , cfg ) ; }

Target:
public com.google.gerrit.server.config.PluginConfig getFromGerritConfig ( java.lang.String pluginName , boolean refresh ) { if ( refresh && ( cfgSnapshot.isModified ( site.gerrit_config ) ) ) { cfgSnapshot = org.eclipse.jgit.internal.storage.file.FileSnapshot.save ( site.gerrit_config ) ; cfg = cfgProvider.get ( ) ; } return new com.google.gerrit.server.config.PluginConfig ( pluginName , cfg ) ; }
Source:
public void execute ( ) { try { onResult ( lastScript , false ) ; } finally { RpcStatus.INSTANCE.onRpcComplete ( null ) ; } }

Target:
public void onSuccess ( com.google.gerrit.common.data.PatchSetDetail result ) { patchSetDetail = result ; if ( ( fileList ) == null ) { fileList = new com.google.gerrit.client.changes.PatchTable ( prefs ) ; fileList.display ( idSideA , result ) ; patchIndex = fileList.indexOf ( patchKey ) ; } refresh ( true ) ; }
Source:
public java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > getOwners ( ) { com.google.gerrit.reviewdb.client.Project.NameKey parentName = getProject ( ) . getParent ( ) ; if ( ( ( ! ( localOwners.isEmpty ( ) ) ) || ( parentName == null ) ) || ( isAllProjects ) ) { return localOwners ; } com.google.gerrit.server.project.ProjectState parent = projectCache.get ( parentName ) ; if ( parent != null ) { return parent.getOwners ( ) ; } return java.util.Collections.emptySet ( ) ; }

Target:
public java.util.Iterator < com.google.gerrit.server.project.ProjectState > iterator ( ) { return new com.google.gerrit.server.project.ProjectHierarchyIterator ( projectCache , allProjectsName , this ) ; }
Source:
public com.google.gerrit.client.reviewdb.Account run ( com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { return db.accounts ( ) . get ( com.google.gerrit.client.rpc.Common.getAccountId ( ) ) ; }

Target:
public com.google.gerrit.client.reviewdb.Account run ( com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gerrit.client.account.Failure { final com.google.gerrit.client.reviewdb.Account a = com.google.gerrit.client.rpc.Common.getAccountCache ( ) . get ( com.google.gerrit.client.rpc.Common.getAccountId ( ) , db ) ; if ( a == null ) { throw new com.google.gerrit.client.account.Failure ( new com.google.gerrit.client.rpc.NoSuchEntityException ( ) ) ; } return a ; }
Source:
com.google.gerrit.httpd.WebSessionManager.Val createVal ( final com.google.gerrit.httpd.WebSessionManager.Key key , final com.google.gerrit.httpd.WebSessionManager.Val val ) { final com.google.gerrit.reviewdb.client.Account.Id who = val.getAccountId ( ) ; final boolean remember = val.isPersistentCookie ( ) ; final com.google.gerrit.reviewdb.client.AccountExternalId.Key lastLogin = val.getExternalId ( ) ; return createVal ( key , who , remember , lastLogin , val.sessionId , val.auth ) ; }

Target:
com.google.gerrit.httpd.WebSessionManager.Val createVal ( com.google.gerrit.httpd.WebSessionManager.Key key , com.google.gerrit.httpd.WebSessionManager.Val val ) { com.google.gerrit.reviewdb.client.Account.Id who = val.getAccountId ( ) ; boolean remember = val.isPersistentCookie ( ) ; com.google.gerrit.server.account.ExternalId.Key lastLogin = val.getExternalId ( ) ; return createVal ( key , who , remember , lastLogin , val.sessionId , val.auth ) ; }
Source:
public static void doSignOut ( ) { com.google.gerrit.client.Gerrit.myAccount = null ; com.google.gwt.user.client.Cookies.removeCookie ( com.google.gerrit.client.Gerrit.ACCOUNT_COOKIE ) ; for ( final com.google.gerrit.client.SignedInListener l : com.google.gerrit.client.Gerrit.signedInListeners ) { l.onSignOut ( ) ; } com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; final com.google.gerrit.client.ui.Screen cs = com.google.gerrit.client.Gerrit.body.getView ( ) ; if ( cs != null ) { cs.onSignOut ( ) ; } }

Target:
public static void doSignOut ( ) { com.google.gerrit.client.Gerrit.myAccount = null ; com.google.gwt.user.client.Cookies.removeCookie ( com.google.gerrit.client.Gerrit.ACCOUNT_COOKIE ) ; for ( final com.google.gerrit.client.SignOutHandler l : com.google.gerrit.client.Gerrit.signOutHandlers ) { l.onSignOut ( ) ; } com.google.gwtexpui.globalkey.client.GlobalKey.filter ( new com.google.gwtexpui.globalkey.client.KeyCommandFilter ( ) { public boolean include ( final com.google.gwtexpui.globalkey.client.KeyCommand key ) { return ! ( key instanceof com.google.gerrit.client.ui.NeedsSignInKeyCommand ) ; } } ) ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; final com.google.gerrit.client.ui.Screen cs = com.google.gerrit.client.Gerrit.body.getView ( ) ; if ( cs != null ) { cs.onSignOut ( ) ; } }
Source:
public void testUnblockLargerScope_Fails ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/master" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't push" , u.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }

Target:
public void testUnblockLargerScope_Fails ( ) { com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/master" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't push" , u.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }
Source:
public void testUnblockForceEditTopicName ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertTrue ( "u can edit topic name" , u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) ; }

Target:
public void testUnblockForceEditTopicName ( ) { com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertTrue ( "u can edit topic name" , u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) ; }
Source:
public com.google.gerrit.testutil.TestNotesMigration setFrom ( com.google.gerrit.server.notedb.NotesMigration other ) { setWriteChanges ( other.rawWriteChangesSetting ( ) ) ; setReadChanges ( other.readChanges ( ) ) ; setChangePrimaryStorage ( other.changePrimaryStorage ( ) ) ; setDisableChangeReviewDb ( other.disableChangeReviewDb ( ) ) ; setFuseUpdates ( other.fuseUpdates ( ) ) ; return this ; }

Target:
public com.google.gerrit.testutil.TestNotesMigration setFrom ( com.google.gerrit.server.notedb.NotesMigration other ) { setWriteChanges ( other.rawWriteChangesSetting ( ) ) ; setReadChanges ( other.readChanges ( ) ) ; setReadChangeSequence ( other.readChangeSequence ( ) ) ; setChangePrimaryStorage ( other.changePrimaryStorage ( ) ) ; setDisableChangeReviewDb ( other.disableChangeReviewDb ( ) ) ; setFuseUpdates ( other.fuseUpdates ( ) ) ; return this ; }
Source:
protected void preDisplay ( final java.util.List < com.google.gerrit.reviewdb.Project > result ) { projectsTab.display ( result ) ; if ( firstPopupLoad ) { firstPopupLoad = false ; displayPopup ( ) ; } }

Target:
protected void displayPopup ( ) { popingUp = true ; if ( firstPopupLoad ) { populateProjects ( ) ; } else { popup.setPopupPositionAndShow ( popupPosition ) ; com.google.gwtexpui.globalkey.client.GlobalKey.dialog ( popup ) ; com.google.gwtexpui.globalkey.client.GlobalKey.addApplication ( popup , new com.google.gwtexpui.globalkey.client.HidePopupPanelCommand ( 0 , com.google.gwt.event.dom.client.KeyCodes.KEY_ESCAPE , popup ) ) ; projectsTab.setRegisterKeys ( true ) ; projectsTab.finishDisplay ( ) ; if ( ( regWindowResize ) == null ) { regWindowResize = com.google.gwt.user.client.Window.addResizeHandler ( this ) ; } popingUp = false ; } }
Source:
private java.lang.String readNote ( com.google.gerrit.server.notedb.ChangeNotes notes , org.eclipse.jgit.lib.ObjectId noteId ) throws java.lang.Exception { org.eclipse.jgit.lib.ObjectId dataId = notes.getNoteMap ( ) . getNote ( noteId ) . getData ( ) ; return new java.lang.String ( rw.getObjectReader ( ) . open ( dataId , org.eclipse.jgit.lib.Constants.OBJ_BLOB ) . getCachedBytes ( ) , java.nio.charset.StandardCharsets.UTF_8 ) ; }

Target:
private java.lang.String readNote ( com.google.gerrit.server.notedb.ChangeNotes notes , org.eclipse.jgit.lib.ObjectId noteId ) throws java.lang.Exception { org.eclipse.jgit.lib.ObjectId dataId = notes.revisionNoteMap.noteMap.getNote ( noteId ) . getData ( ) ; return new java.lang.String ( rw.getObjectReader ( ) . open ( dataId , org.eclipse.jgit.lib.Constants.OBJ_BLOB ) . getCachedBytes ( ) , java.nio.charset.StandardCharsets.UTF_8 ) ; }
Source:
private static org.eclipse.jgit.lib.ObjectId emptyTree ( final org.eclipse.jgit.lib.Repository repo ) throws java.io.IOException { try ( org.eclipse.jgit.lib.ObjectInserter oi = repo.newObjectInserter ( ) ) { org.eclipse.jgit.lib.ObjectId id = oi.insert ( Constants.OBJ_TREE , new byte [ ] { } ) ; oi.flush ( ) ; return id ; } }

Target:
private static org.eclipse.jgit.lib.ObjectId emptyTree ( org.eclipse.jgit.lib.ObjectInserter ins ) throws java.io.IOException { org.eclipse.jgit.lib.ObjectId id = ins.insert ( Constants.OBJ_TREE , new byte [ ] { } ) ; ins.flush ( ) ; return id ; }
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 com.google.gerrit.server.git.BatchUpdate setRepository ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevWalk revWalk , org.eclipse.jgit.lib.ObjectInserter inserter ) { com.google.common.base.Preconditions.checkState ( ( ( this . repo ) == null ) , "repo already set" ) ; closeRepo = false ; this . repo = com.google.common.base.Preconditions.checkNotNull ( repo , "repo" ) ; this . revWalk = com.google.common.base.Preconditions.checkNotNull ( revWalk , "revWalk" ) ; this . inserter = com.google.common.base.Preconditions.checkNotNull ( inserter , "inserter" ) ; commands = new com.google.gerrit.server.git.ChainedReceiveCommands ( repo ) ; return this ; }
Source:
static java.lang.String authorName ( com.google.gerrit.client.changes.ChangeInfo.MessageInfo info ) { if ( ( info.author ( ) ) != null ) { if ( ( info.author ( ) . name ( ) ) != null ) { return info.author ( ) . name ( ) ; } return com.google.gerrit.client.Gerrit.getConfig ( ) . getAnonymousCowardName ( ) ; } return Util.C.messageNoAuthor ( ) ; }

Target:
static java.lang.String authorName ( com.google.gerrit.client.changes.ChangeInfo.MessageInfo info ) { if ( ( info.author ( ) ) != null ) { if ( ( info.author ( ) . name ( ) ) != null ) { return info.author ( ) . name ( ) ; } return com.google.gerrit.client.Gerrit.info ( ) . user ( ) . anonymousCowardName ( ) ; } return Util.C.messageNoAuthor ( ) ; }
Source:
private boolean isValidFile ( javax.servlet.http.HttpServletRequest req ) throws java.io.IOException { java.io.File f = configFile ( req ) ; if ( ! ( f.isFile ( ) ) ) { return false ; } return ( isParent ( etc_dir , f ) ) || ( isParent ( static_dir , f ) ) ; }

Target:
private boolean isValidFile ( javax.servlet.http.HttpServletRequest req ) throws java.io.IOException { java.io.File f = resolveFile ( req ) ; if ( ! ( f.isFile ( ) ) ) { return false ; } return ( isParent ( etc_dir , f ) ) || ( isParent ( static_dir , f ) ) ; }
Source:
public void testDeleteResponseOK ( ) throws java.lang.Exception { com.ericsson.gerrit.plugins.syncindex.HttpSessionTest.wireMockRule.givenThat ( com.github.tomakehurst.wiremock.client.WireMock.delete ( com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo ( com.ericsson.gerrit.plugins.syncindex.HttpSessionTest.ENDPOINT ) ) . willReturn ( com.github.tomakehurst.wiremock.client.WireMock.aResponse ( ) . withStatus ( com.ericsson.gerrit.plugins.syncindex.HttpSessionTest.OK ) ) ) ; com.google.common.truth.Truth.assertThat ( httpSession.delete ( com.ericsson.gerrit.plugins.syncindex.HttpSessionTest.ENDPOINT ) . isSuccessful ( ) ) . isTrue ( ) ; }

Target:
public void testDeleteResponseOK ( ) throws java.lang.Exception { com.ericsson.gerrit.plugins.multimaster.HttpSessionTest.wireMockRule.givenThat ( com.github.tomakehurst.wiremock.client.WireMock.delete ( com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo ( com.ericsson.gerrit.plugins.multimaster.HttpSessionTest.ENDPOINT ) ) . willReturn ( com.github.tomakehurst.wiremock.client.WireMock.aResponse ( ) . withStatus ( com.ericsson.gerrit.plugins.multimaster.HttpSessionTest.OK ) ) ) ; com.google.common.truth.Truth.assertThat ( httpSession.delete ( com.ericsson.gerrit.plugins.multimaster.HttpSessionTest.ENDPOINT ) . isSuccessful ( ) ) . isTrue ( ) ; }
Source:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { b.setEnabled ( false ) ; new com.google.gerrit.client.changes.RestoreChangeDialog ( patchSet.getId ( ) , new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.common.data.ChangeDetail > ( ) { public void onSuccess ( com.google.gerrit.common.data.ChangeDetail result ) { changeScreen.update ( result ) ; } public void onFailure ( java.lang.Throwable caught ) { b.setEnabled ( true ) ; } } ) . center ( ) ; }

Target:
private com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.common.data.ChangeDetail > createCommentedCallback ( final com.google.gwt.user.client.ui.Button b ) { return new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.common.data.ChangeDetail > ( ) { public void onSuccess ( com.google.gerrit.common.data.ChangeDetail result ) { changeScreen.update ( result ) ; } public void onFailure ( java.lang.Throwable caught ) { b.setEnabled ( true ) ; } } ; }
Source:
protected void selectProtocol ( com.google.gerrit.acceptance.git.AbstractPushForReview.Protocol p ) throws java.lang.Exception { java.lang.String url ; switch ( p ) { case SSH : url = sshUrl ; break ; case HTTP : url = admin.getHttpUrl ( server ) ; break ; default : throw new java.lang.IllegalArgumentException ( ( "unexpected protocol: " + p ) ) ; } setRepo ( com.google.gerrit.acceptance.GitUtil.cloneProject ( project , ( ( url + "/" ) + ( project.get ( ) ) ) ) ) ; }

Target:
protected void selectProtocol ( com.google.gerrit.acceptance.git.AbstractPushForReview.Protocol p ) throws java.lang.Exception { java.lang.String url ; switch ( p ) { case SSH : url = sshUrl ; break ; case HTTP : url = admin.getHttpUrl ( server ) ; break ; default : throw new java.lang.IllegalArgumentException ( ( "unexpected protocol: " + p ) ) ; } testRepo = com.google.gerrit.acceptance.GitUtil.cloneProject ( project , ( ( url + "/" ) + ( project.get ( ) ) ) ) ; }
Source:
public void testNoComments ( ) { com.google.gerrit.server.mail.receive.MailMessage.Builder b = newMailMessageBuilder ( ) ; b.textContent ( ( ( com.google.gerrit.server.mail.receive.TextParserTest.newPlaintextBody ( null , null , null , null , null , null , null ) ) + ( com.google.gerrit.server.mail.receive.TextParserTest.quotedFooter ) ) ) ; java.util.List < com.google.gerrit.reviewdb.client.Comment > comments = defaultComments ( ) ; java.util.List < com.google.gerrit.server.mail.receive.MailComment > parsedComments = com.google.gerrit.server.mail.receive.TextParser.parse ( b.build ( ) , comments , com.google.gerrit.server.mail.receive.TextParserTest.changeURL ) ; com.google.common.truth.Truth.assertThat ( parsedComments ) . isEmpty ( ) ; }

Target:
public void noComments ( ) { com.google.gerrit.server.mail.receive.MailMessage.Builder b = newMailMessageBuilder ( ) ; b.textContent ( ( ( com.google.gerrit.server.mail.receive.TextParserTest.newPlaintextBody ( null , null , null , null , null , null , null ) ) + ( com.google.gerrit.server.mail.receive.TextParserTest.quotedFooter ) ) ) ; java.util.List < com.google.gerrit.reviewdb.client.Comment > comments = defaultComments ( ) ; java.util.List < com.google.gerrit.server.mail.receive.MailComment > parsedComments = com.google.gerrit.server.mail.receive.TextParser.parse ( b.build ( ) , comments , changeURL ) ; com.google.common.truth.Truth.assertThat ( parsedComments ) . isEmpty ( ) ; }
Source:
public static void doSignOut ( ) { com.google.gerrit.client.Gerrit.myAccount = null ; com.google.gwt.user.client.Cookies.removeCookie ( com.google.gerrit.client.Gerrit.ACCOUNT_COOKIE ) ; for ( final com.google.gerrit.client.SignOutHandler l : com.google.gerrit.client.Gerrit.signOutHandlers ) { l.onSignOut ( ) ; } com.google.gwtexpui.globalkey.client.GlobalKey.filter ( new com.google.gwtexpui.globalkey.client.KeyCommandFilter ( ) { public boolean include ( final com.google.gwtexpui.globalkey.client.KeyCommand key ) { return ! ( key instanceof com.google.gerrit.client.ui.NeedsSignInKeyCommand ) ; } } ) ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; final com.google.gerrit.client.ui.Screen cs = com.google.gerrit.client.Gerrit.body.getView ( ) ; if ( cs != null ) { cs.onSignOut ( ) ; } }

Target:
public static void doSignOut ( ) { com.google.gerrit.client.Gerrit.myAccount = null ; com.google.gwt.user.client.Cookies.removeCookie ( com.google.gerrit.client.Gerrit.ACCOUNT_COOKIE ) ; com.google.gerrit.client.Gerrit.globalHandlers.fireEvent ( new com.google.gerrit.client.SignOutEvent ( ) ) ; com.google.gwtexpui.globalkey.client.GlobalKey.filter ( new com.google.gwtexpui.globalkey.client.KeyCommandFilter ( ) { public boolean include ( final com.google.gwtexpui.globalkey.client.KeyCommand key ) { return ! ( key instanceof com.google.gerrit.client.ui.NeedsSignInKeyCommand ) ; } } ) ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; final com.google.gerrit.client.ui.Screen cs = com.google.gerrit.client.Gerrit.body.getView ( ) ; if ( cs != null ) { cs.onSignOut ( ) ; } }
Source:
public static void revert ( int id , java.lang.String msg , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.ChangeInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.MessageInput input = com.google.gerrit.client.changes.ChangeApi.MessageInput.create ( ) ; input.message ( com.google.gerrit.client.changes.ChangeApi.emptyToNull ( msg ) ) ; com.google.gerrit.client.changes.ChangeApi.call ( id , "revert" ) . post ( input , cb ) ; }

Target:
public static void detail ( @ com.google.gerrit.common.Nullable java.lang.String project , int id , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.ChangeInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.detail ( project , id ) . get ( cb ) ; }
Source:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.RevisionInfo revision , com.google.gerrit.extensions.common.AccountInfo restorer , java.lang.String reason ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.ChangeRestored.Event event = new com.google.gerrit.server.extensions.events.ChangeRestored.Event ( change , revision , restorer , reason ) ; for ( com.google.gerrit.extensions.events.ChangeRestoredListener l : listeners ) { try { l.onChangeRestored ( event ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.extensions.events.ChangeRestored.log.warn ( "Error in event listener" , e ) ; } } }

Target:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.RevisionInfo revision , com.google.gerrit.extensions.common.AccountInfo restorer , java.lang.String reason , java.sql.Timestamp when ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.ChangeRestored.Event event = new com.google.gerrit.server.extensions.events.ChangeRestored.Event ( change , revision , restorer , reason , when ) ; for ( com.google.gerrit.extensions.events.ChangeRestoredListener l : listeners ) { try { l.onChangeRestored ( event ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.extensions.events.ChangeRestored.log.warn ( "Error in event listener" , e ) ; } } }
Source:
public boolean send ( final com.google.gerrit.server.events.Event event ) { return new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarder.Request ( ( "send event " + ( event.type ) ) ) { @ java.lang.Override com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult send ( ) throws java.io.IOException { java.lang.String serializedEvent = new com.google.gson.GsonBuilder ( ) . registerTypeAdapter ( com.google.common.base.Supplier.class , new com.google.gerrit.server.events.SupplierSerializer ( ) ) . create ( ) . toJson ( event ) ; return httpSession.post ( com.google.common.base.Joiner.on ( "/" ) . join ( pluginRelativePath , "event" ) , serializedEvent ) ; } } . execute ( ) ; }

Target:
public boolean send ( final com.google.gerrit.server.events.Event event ) { return new com.ericsson.gerrit.plugins.highavailability.forwarder.rest.RestForwarder.Request ( "send event" , event.type ) { @ java.lang.Override com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult send ( ) throws java.io.IOException { java.lang.String serializedEvent = new com.google.gson.GsonBuilder ( ) . registerTypeAdapter ( com.google.common.base.Supplier.class , new com.google.gerrit.server.events.SupplierSerializer ( ) ) . create ( ) . toJson ( event ) ; return httpSession.post ( com.google.common.base.Joiner.on ( "/" ) . join ( pluginRelativePath , "event" ) , serializedEvent ) ; } } . execute ( ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent clickEvent ) { if ( ( cm.extras ( ) . getBlameInfo ( ) ) != null ) { cm.extras ( ) . toggleAnnotation ( ) ; } else { com.google.gerrit.client.changes.ChangeApi.blame ( rev , path , isBase ) . get ( new com.google.gerrit.client.rpc.GerritCallback < com.google.gwt.core.client.JsArray < com.google.gerrit.client.blame.BlameInfo > > ( ) { @ java.lang.Override public void onSuccess ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.blame.BlameInfo > lines ) { cm.extras ( ) . toggleAnnotation ( lines ) ; } } ) ; } }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent clickEvent ) { if ( ( cm.extras ( ) . getBlameInfo ( ) ) != null ) { cm.extras ( ) . toggleAnnotation ( ) ; } else { com.google.gerrit.client.changes.ChangeApi.blame ( Project.NameKey.asStringOrNull ( project ) , rev , path , isBase ) . get ( new com.google.gerrit.client.rpc.GerritCallback < com.google.gwt.core.client.JsArray < com.google.gerrit.client.blame.BlameInfo > > ( ) { @ java.lang.Override public void onSuccess ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.blame.BlameInfo > lines ) { cm.extras ( ) . toggleAnnotation ( lines ) ; } } ) ; } }
Source:
protected void configure ( ) { bind ( DataSourceProvider.Context.class ) . toInstance ( context ) ; bind ( com.google.inject.Key.get ( javax.sql.DataSource.class , com.google.inject.name.Names.named ( "ReviewDb" ) ) ) . toProvider ( com.google.gerrit.server.schema.DataSourceProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; listener ( ) . to ( com.google.gerrit.server.schema.DataSourceProvider.class ) ; }

Target:
protected void configure ( ) { bind ( DataSourceProvider.Context.class ) . toInstance ( context ) ; bind ( new com.google.inject.TypeLiteral < com.google.gwtorm.client.SchemaFactory < com.google.gerrit.reviewdb.ReviewDb > > ( ) { } ) . toProvider ( com.google.gerrit.server.schema.DataSourceProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; listener ( ) . to ( com.google.gerrit.server.schema.DataSourceProvider.class ) ; }
Source:
public com.google.gerrit.server.change.ChangeJson.ChangeInfo format ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.query.change.ChangeData cd = changeDataFactory.create ( db.get ( ) , rsrc.getControl ( ) ) ; return format ( cd , rsrc.getPatchSet ( ) . getId ( ) ) ; }

Target:
public com.google.gerrit.server.change.ChangeJson.ChangeInfo format ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.query.change.ChangeData cd = changeDataFactory.create ( db.get ( ) , rsrc.getControl ( ) ) ; return format ( cd , com.google.common.base.Optional.of ( rsrc.getPatchSet ( ) . getId ( ) ) ) ; }
Source:
public void handle ( net.codemirror.lib.CodeMirror instance , int line , java.lang.String gutter , com.google.gwt.dom.client.NativeEvent clickEvent ) { if ( ! ( ( cm.hasActiveLine ( ) ) && ( ( instance.getLineNumber ( cm.getActiveLine ( ) ) ) == line ) ) ) { instance.setCursor ( net.codemirror.lib.LineCharacter.create ( line ) ) ; instance.setActiveLine ( cm.getLineHandle ( line ) ) ; } insertNewDraft ( cm ) . run ( ) ; }

Target:
public void execute ( ) { insertNewDraft ( cm ) . run ( ) ; }
Source:
private static < T extends com.google.gwt.core.client.JavaScriptObject > T parseJson ( com.google.gwt.http.client.Response res ) throws com.google.gwt.json.client.JSONException { java.lang.String json = res.getText ( ) ; if ( json.startsWith ( com.google.gerrit.client.rpc.RestApi.JSON_MAGIC ) ) { json = json.substring ( com.google.gerrit.client.rpc.RestApi.JSON_MAGIC.length ( ) ) ; } if ( json.isEmpty ( ) ) { throw new com.google.gwt.json.client.JSONException ( "response was empty" ) ; } return com.google.gerrit.client.rpc.RestApi.cast ( com.google.gwt.json.client.JSONParser.parseStrict ( json ) ) ; }

Target:
public < T extends com.google.gwt.core.client.JavaScriptObject > void post ( com.google.gwt.user.client.rpc.AsyncCallback < T > cb ) { send ( com.google.gwt.http.client.RequestBuilder.POST , cb ) ; }
Source:
void setSyntaxHighlighting ( final boolean b ) { operation ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { cmA.setOption ( "mode" , ( b ? getContentType ( diff.meta_a ( ) ) : null ) ) ; cmB.setOption ( "mode" , ( b ? getContentType ( diff.meta_b ( ) ) : null ) ) ; } } ) ; }

Target:
public void onFailure ( java.lang.Throwable caught ) { prefs.syntaxHighlighting ( false ) ; }
Source:
public void writeCommit ( com.google.gerrit.server.notedb.BatchMetaDataUpdate batch ) throws com.google.gwtorm.server.OrmException , java.io.IOException { org.eclipse.jgit.lib.CommitBuilder builder = new org.eclipse.jgit.lib.CommitBuilder ( ) ; if ( migration.writeChanges ( ) ) { org.eclipse.jgit.lib.ObjectId treeId = storeRevisionNotes ( ) ; if ( treeId != null ) { builder.setTreeId ( treeId ) ; } } batch.write ( this , builder ) ; if ( ( draftUpdate ) != null ) { draftUpdate.commit ( ) ; } }

Target:
com.google.gerrit.server.notedb.ChangeDraftUpdate getDraftUpdate ( ) { return draftUpdate ; }
Source:
private synchronized void unloadPlugin ( com.google.gerrit.server.plugins.Plugin plugin ) { persistentCacheFactory.onStop ( plugin ) ; java.lang.String name = plugin.getName ( ) ; com.google.gerrit.server.plugins.PluginLoader.log.info ( java.lang.String.format ( "Unloading plugin %s" , name ) ) ; plugin.stop ( env ) ; running.remove ( name ) ; disabled.remove ( name ) ; toCleanup.add ( plugin ) ; }

Target:
private synchronized void unloadPlugin ( com.google.gerrit.server.plugins.Plugin plugin ) { persistentCacheFactory.onStop ( plugin ) ; java.lang.String name = plugin.getName ( ) ; com.google.gerrit.server.plugins.PluginLoader.log.info ( java.lang.String.format ( "Unloading plugin %s" , name ) ) ; plugin.stop ( env ) ; env.onStopPlugin ( plugin ) ; running.remove ( name ) ; disabled.remove ( name ) ; toCleanup.add ( plugin ) ; }
Source:
public void deleteEdit ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , modifier.createEdit ( change , ps ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.FORCED , modifier.modifyFile ( editUtil.byChange ( change ) . get ( ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME , com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_NEW ) ) ; editUtil.delete ( editUtil.byChange ( change ) . get ( ) ) ; org.junit.Assert.assertFalse ( editUtil.byChange ( change ) . isPresent ( ) ) ; }

Target:
public void deleteEdit ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( modifier.createEdit ( change , ps ) ) . isEqualTo ( RefUpdate.Result.NEW ) ; com.google.common.truth.Truth.assertThat ( modifier.modifyFile ( editUtil.byChange ( change ) . get ( ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME , com.google.gerrit.acceptance.RestSession.newRawInput ( com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_NEW ) ) ) . isEqualTo ( RefUpdate.Result.FORCED ) ; editUtil.delete ( editUtil.byChange ( change ) . get ( ) ) ; com.google.common.truth.Truth.assertThat ( editUtil.byChange ( change ) . isPresent ( ) ) . isFalse ( ) ; }