auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private com.google.gerrit.server.project.ProjectControl user ( com.google.gerrit.reviewdb.AccountGroup ... memberOf ) { com.google.gerrit.server.project.RefControl.Factory refControlFactory = new com.google.gerrit.server.project.RefControl.Factory ( ) { @ java.lang.Override public com.google.gerrit.server.project.RefControl create ( final com.google.gerrit.server.project.ProjectControl projectControl , final java.lang.String ref ) { return new com.google.gerrit.server.project.RefControl ( projectControl , ref ) ; } } ; return new com.google.gerrit.server.project.ProjectControl ( java.util.Collections.< com.google.gerrit.reviewdb.AccountGroup.UUID > emptySet ( ) , java.util.Collections.< com.google.gerrit.reviewdb.AccountGroup.UUID > emptySet ( ) , refControlFactory , new com.google.gerrit.server.project.RefControlTest.MockUser ( memberOf ) , newProjectState ( ) ) ; }

Target:
private com.google.gerrit.server.project.ProjectControl user ( com.google.gerrit.reviewdb.AccountGroup ... memberOf ) { com.google.gerrit.reviewdb.ReviewDb db = null ; com.google.gerrit.server.account.GroupCache groupCache = null ; java.lang.String canonicalWebUrl = "http://localhost" ; com.google.gerrit.server.project.RefControl.Factory refControlFactory = new com.google.gerrit.server.project.RefControl.Factory ( ) { @ java.lang.Override public com.google.gerrit.server.project.RefControl create ( final com.google.gerrit.server.project.ProjectControl projectControl , final java.lang.String ref ) { return new com.google.gerrit.server.project.RefControl ( projectControl , ref ) ; } } ; return new com.google.gerrit.server.project.ProjectControl ( java.util.Collections.< com.google.gerrit.reviewdb.AccountGroup.UUID > emptySet ( ) , java.util.Collections.< com.google.gerrit.reviewdb.AccountGroup.UUID > emptySet ( ) , db , groupCache , canonicalWebUrl , refControlFactory , new com.google.gerrit.server.project.RefControlTest.MockUser ( memberOf ) , newProjectState ( ) ) ; }
Source:
private void initBranchLink ( com.google.gerrit.client.changes.ChangeInfo info ) { branchLink.setText ( info.branch ( ) ) ; branchLink.setTargetHistoryToken ( com.google.gerrit.common.PageLinks.toChangeQuery ( com.google.gerrit.client.ui.BranchLink.query ( info.project_name_key ( ) , info.status ( ) , info.branch ( ) , null ) ) ) ; }

Target:
private void initBranchLink ( com.google.gerrit.client.info.ChangeInfo info ) { branchLink.setText ( info.branch ( ) ) ; branchLink.setTargetHistoryToken ( com.google.gerrit.common.PageLinks.toChangeQuery ( com.google.gerrit.client.ui.BranchLink.query ( info.projectNameKey ( ) , info.status ( ) , info.branch ( ) , null ) ) ) ; }
Source:
public void shouldReturnConfiguredSharedDirectory ( ) throws java.io.IOException { java.io.File configuredDirectory = tempFolder.newFolder ( ) ; org.mockito.Mockito.when ( pluginConfigMock.getString ( "sharedDirectory" ) ) . thenReturn ( configuredDirectory.getAbsolutePath ( ) ) ; java.nio.file.Path sharedDirectory = module.getSharedDirectory ( pluginConfigFactoryMock , com.ericsson.gerrit.plugins.highavailability.ModuleTest.PLUGIN_NAME ) ; com.google.common.truth.Truth.assertThat ( sharedDirectory.toString ( ) ) . isEqualTo ( configuredDirectory.toString ( ) ) ; }

Target:
public void shouldReturnConfiguredSharedDirectory ( ) throws java.io.IOException { java.io.File configuredDirectory = tempFolder.newFolder ( ) ; org.mockito.Mockito.when ( pluginConfigMock.getString ( com.ericsson.gerrit.plugins.highavailability.Configuration.SHARED_DIRECTORY ) ) . thenReturn ( configuredDirectory.getAbsolutePath ( ) ) ; java.nio.file.Path sharedDirectory = module.getSharedDirectory ( pluginConfigFactoryMock , com.ericsson.gerrit.plugins.highavailability.ModuleTest.PLUGIN_NAME ) ; com.google.common.truth.Truth.assertThat ( sharedDirectory.toString ( ) ) . isEqualTo ( configuredDirectory.toString ( ) ) ; }
Source:
private java.util.List < com.google.gerrit.server.git.BatchUpdate > batchUpdates ( java.util.Collection < com.google.gerrit.reviewdb.client.Project.NameKey > projects ) { java.util.List < com.google.gerrit.server.git.BatchUpdate > updates = new java.util.ArrayList ( projects.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.Project.NameKey project : projects ) { updates.add ( getRepo ( project ) . getUpdate ( ) ) ; } return updates ; }

Target:
private com.google.gerrit.server.git.strategy.SubmitStrategy createStrategy ( com.google.gerrit.server.git.MergeOpRepoManager.OpenRepo or , com.google.gerrit.server.git.MergeTip mergeTip , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.extensions.client.SubmitType submitType , com.google.gerrit.server.git.CodeReviewCommit branchTip ) throws com.google.gerrit.server.git.IntegrationException { return submitStrategyFactory.create ( submitType , db , or.repo , or.rw , or.ins , or.canMergeFlag , getAlreadyAccepted ( or , branchTip ) , destBranch , caller , mergeTip , commits , submissionId , submitInput.notify ) ; }
Source:
private void display ( final com.google.gerrit.client.data.UnifiedPatchDetail detail ) { diffTable.setPatchKey ( detail.getPatch ( ) . getKey ( ) ) ; diffTable.setAccountInfoCache ( detail.getAccounts ( ) ) ; diffTable.display ( detail.getLines ( ) ) ; }

Target:
private void display ( final com.google.gerrit.client.data.UnifiedPatchDetail detail ) { diffTable.setPatchKey ( detail.getPatch ( ) . getKey ( ) ) ; diffTable.setAccountInfoCache ( detail.getAccounts ( ) ) ; diffTable.display ( detail.getLines ( ) ) ; diffTable.finishDisplay ( true ) ; }
Source:
private java.util.jar.JarEntry getRealFileEntry ( java.util.jar.JarFile jar , java.lang.String file ) { return jar.getJarEntry ( file.replaceAll ( "\\.html$" , ".md" ) ) ; }

Target:
private static java.util.jar.JarEntry findSource ( java.util.jar.JarFile jar , java.lang.String file ) { if ( file.endsWith ( ".html" ) ) { int d = file.lastIndexOf ( '.' ) ; return jar.getJarEntry ( ( ( file.substring ( 0 , d ) ) + ".md" ) ) ; } return null ; }
Source:
protected com.google.gerrit.acceptance.PushOneCommit.Result pushTo ( java.lang.String ref ) throws com.google.gerrit.acceptance.GitAPIException , java.io.IOException { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) ) ; return push.to ( git , ref ) ; BRANCH ( 4 ) ; com.google.gerrit.acceptance.bc067 Show ; com.google.gerrit.acceptance.change status ; draft ( sets ) ; }

Target:
public org.junit.runners.model.Statement apply ( final org.junit.runners.model.Statement base , final org.junit.runner.Description description ) { return new org.junit.runners.model.Statement ( ) { @ java.lang.Override public void evaluate ( ) throws java.lang.Throwable { beforeTest ( description ) ; try { base.evaluate ( ) ; } finally { afterTest ( ) ; } } } ; }
Source:
public void filterOutAllResults ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Account.Id user2 = accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "anotheruser" ) ) . getAccountId ( ) ; for ( int i = 0 ; i < 5 ; i ++ ) { insert ( newChangeForUser ( repo , user2 ) ) ; } assertQuery ( "status:new ownerin:Administrators" ) ; assertQuery ( "status:new ownerin:Administrators limit:2" ) ; }

Target:
public void filterOutMoreThanOnePageOfResults ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change = insert ( repo , newChange ( repo ) , userId ) ; com.google.gerrit.reviewdb.client.Account.Id user2 = accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "anotheruser" ) ) . getAccountId ( ) ; for ( int i = 0 ; i < 5 ; i ++ ) { insert ( repo , newChange ( repo ) , user2 ) ; } assertQuery ( "status:new ownerin:Administrators" , change ) ; assertQuery ( "status:new ownerin:Administrators limit:2" , change ) ; }
Source:
public void noCopyNonMaxScoreOnRework ( ) throws java.lang.Exception { codeReview.setCopyMinScore ( true ) ; codeReview.setCopyMaxScore ( true ) ; saveLabelConfig ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; revision ( r ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.recommend ( ) ) ; assertApproval ( r , 1 ) ; r = ammendChange ( r.getChangeId ( ) ) ; assertApproval ( r , 0 ) ; }

Target:
public void noCopyNonMaxScoreOnRework ( ) throws java.lang.Exception { codeReview.setCopyMinScore ( true ) ; codeReview.setCopyMaxScore ( true ) ; saveLabelConfig ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; revision ( r ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.recommend ( ) ) ; assertApproval ( r , 1 ) ; r = amendChange ( r.getChangeId ( ) ) ; assertApproval ( r , 0 ) ; }
Source:
public void display ( com.google.gerrit.reviewdb.client.Change chg , java.lang.Boolean starred , com.google.gerrit.reviewdb.client.PatchSetInfo info , final com.google.gerrit.common.data.AccountInfoCache acc , com.google.gerrit.common.data.SubmitTypeRecord submitTypeRecord ) { infoBlock.display ( chg , acc , submitTypeRecord ) ; messageBlock.display ( chg.getId ( ) , starred , info.getMessage ( ) ) ; }

Target:
public void display ( com.google.gerrit.reviewdb.client.Change chg , java.lang.Boolean starred , java.lang.Boolean canEditCommitMessage , com.google.gerrit.reviewdb.client.PatchSetInfo info , final com.google.gerrit.common.data.AccountInfoCache acc , com.google.gerrit.common.data.SubmitTypeRecord submitTypeRecord ) { infoBlock.display ( chg , acc , submitTypeRecord ) ; messageBlock.display ( chg.currentPatchSetId ( ) , starred , canEditCommitMessage , info.getMessage ( ) ) ; }
Source:
protected void initName ( final java.lang.String method , final com.google.gwtorm.client.Relation rel ) throws com.google.gwtorm.client.OrmException { if ( rel == null ) { throw new com.google.gwtorm.client.OrmException ( ( ( ( ( "Method " + method ) + " is missing " ) + ( com.google.gwtorm.client.Relation.class . getName ( ) ) ) + " annotation" ) ) ; } relation = rel ; methodName = method ; relationName = com.google.gwtorm.schema.Util.any ( relation.name ( ) , methodName ) ; }

Target:
protected void initName ( final java.lang.String method , final com.google.gwtorm.client.Relation rel ) throws com.google.gwtorm.client.OrmException { if ( rel == null ) { throw new com.google.gwtorm.client.OrmException ( ( ( ( ( "Method " + method ) + " is missing " ) + ( com.google.gwtorm.client.Relation.class . getName ( ) ) ) + " annotation" ) ) ; } relation = rel ; methodName = method ; relationName = com.google.gwtorm.schema.Util.any ( relation.name ( ) , com.google.gwtorm.schema.Util.makeSqlFriendly ( methodName ) ) ; }
Source:
private java.util.Set < com.google.gerrit.reviewdb.Project.NameKey > getAllParents ( final com.google.gerrit.reviewdb.Project.NameKey projectName ) { final java.util.Set < com.google.gerrit.reviewdb.Project.NameKey > parents = new java.util.HashSet < com.google.gerrit.reviewdb.Project.NameKey > ( ) ; com.google.gerrit.reviewdb.Project.NameKey p = projectName ; while ( ( p != null ) && ( parents.add ( p ) ) ) { final com.google.gerrit.server.project.ProjectState e = projectCache.get ( p ) ; if ( e == null ) { break ; } p = getParentName ( e.getProject ( ) ) ; } return parents ; }

Target:
private java.util.Set < com.google.gerrit.reviewdb.client.Project.NameKey > getAllParents ( final com.google.gerrit.reviewdb.client.Project.NameKey projectName ) { final java.util.Set < com.google.gerrit.reviewdb.client.Project.NameKey > parents = new java.util.HashSet < com.google.gerrit.reviewdb.client.Project.NameKey > ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey p = projectName ; while ( ( p != null ) && ( parents.add ( p ) ) ) { final com.google.gerrit.server.project.ProjectState e = projectCache.get ( p ) ; if ( e == null ) { break ; } p = e.getProject ( ) . getParent ( allProjectsName ) ; } return parents ; }
Source:
private java.util.List < com.google.gerrit.extensions.common.AccountInfo > suggestAccounts ( com.google.gerrit.server.api.accounts.SuggestAccountsRequest r ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.account.QueryAccounts myQueryAccounts = queryAccountsProvider.get ( ) ; myQueryAccounts.setSuggest ( true ) ; myQueryAccounts.setQuery ( r.getQuery ( ) ) ; myQueryAccounts.setLimit ( r.getLimit ( ) ) ; return myQueryAccounts.apply ( TopLevelResource.INSTANCE ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve suggested accounts" , e ) ; } }

Target:
private java.util.List < com.google.gerrit.extensions.common.AccountInfo > suggestAccounts ( com.google.gerrit.server.api.accounts.SuggestAccountsRequest r ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.account.QueryAccounts myQueryAccounts = queryAccountsProvider.get ( ) ; myQueryAccounts.setSuggest ( true ) ; myQueryAccounts.setQuery ( r.getQuery ( ) ) ; myQueryAccounts.setLimit ( r.getLimit ( ) ) ; return myQueryAccounts.apply ( TopLevelResource.INSTANCE ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot retrieve suggested accounts" , e ) ; } }
Source:
public void refsHeadsSoy ( ) throws java.lang.Exception { repo.branch ( "refs/heads/foo" ) . commit ( ) . create ( ) ; repo.branch ( "refs/heads/refs/heads/foo" ) . commit ( ) . create ( ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( ref ( "/b/test/+/foo" , "foo" ) , ref ( "/b/test/+/refs/heads/refs/heads/foo" , "refs/heads/foo" ) ) , buildBranchesSoyData ( ) ) ; }

Target:
public void refsHeadsSoy ( ) throws java.lang.Exception { repo.branch ( "refs/heads/foo" ) . commit ( ) . create ( ) ; repo.branch ( "refs/heads/refs/heads/foo" ) . commit ( ) . create ( ) ; com.google.common.truth.Truth.assertThat ( buildBranchesSoyData ( ) ) . containsExactly ( ref ( "/b/test/+/foo" , "foo" ) , ref ( "/b/test/+/refs/heads/refs/heads/foo" , "refs/heads/foo" ) ) . inOrder ( ) ; }
Source:
public void testCannotUploadToAnyRef ( ) { grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.REGISTERED , "refs/*" ) ; grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/for/refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local ) ; assertFalse ( "cannot upload" , ( ( u.canPushToAtLeastOneRef ( ) ) == ( com.google.gerrit.common.data.Capable.OK ) ) ) ; assertFalse ( "cannot upload refs/heads/master" , u.controlForRef ( "refs/heads/master" ) . canUpload ( ) ) ; }

Target:
public void testCannotUploadToAnyRef ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.REGISTERED , "refs/*" ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/for/refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local ) ; assertFalse ( "cannot upload" , ( ( u.canPushToAtLeastOneRef ( ) ) == ( com.google.gerrit.common.data.Capable.OK ) ) ) ; assertFalse ( "cannot upload refs/heads/master" , u.controlForRef ( "refs/heads/master" ) . canUpload ( ) ) ; }
Source:
public void filterOutAllResults ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; int user2 = accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "anotheruser" ) ) . getAccountId ( ) . get ( ) ; for ( int i = 0 ; i < 5 ; i ++ ) { newChange ( repo , null , null , user2 , null ) . insert ( ) ; } assertQuery ( "status:new ownerin:Administrators" ) ; assertQuery ( "status:new ownerin:Administrators limit:2" ) ; }

Target:
protected com.google.gerrit.reviewdb.client.Change insert ( com.google.gerrit.server.change.ChangeInserter ins ) throws java.lang.Exception { try ( com.google.gerrit.server.git.BatchUpdate bu = updateFactory.create ( db , ins.getChange ( ) . getProject ( ) , ins.getUser ( ) , ins.getChange ( ) . getCreatedOn ( ) ) ) { bu.insertChange ( ins ) ; bu.execute ( ) ; return ins.getChange ( ) ; } }
Source:
private void setInvalidNoteDbState ( com.google.gerrit.reviewdb.client.Change.Id id ) throws java.lang.Exception { com.google.gerrit.reviewdb.server.ReviewDb db = unwrapDb ( ) ; com.google.gerrit.reviewdb.client.Change c = db.changes ( ) . get ( id ) ; c.setNoteDbState ( "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) ; db.changes ( ) . update ( java.util.Collections.singleton ( c ) ) ; }

Target:
private void setInvalidNoteDbState ( com.google.gerrit.reviewdb.client.Change.Id id ) throws java.lang.Exception { com.google.gerrit.reviewdb.server.ReviewDb db = getUnwrappedDb ( ) ; com.google.gerrit.reviewdb.client.Change c = db.changes ( ) . get ( id ) ; c.setNoteDbState ( "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) ; db.changes ( ) . update ( java.util.Collections.singleton ( c ) ) ; }
Source:
private void write ( final java.lang.Object message ) { final java.lang.String msg = ( gson.toJson ( message ) ) + "\n" ; synchronized ( stdout ) { stdout.print ( msg ) ; } }

Target:
private void write ( final java.lang.Object message ) { java.lang.String msg = null ; try { msg = ( gson.toJson ( message ) ) + "\n" ; } catch ( java.lang.Exception e ) { com.google.gerrit.sshd.commands.StreamEvents.log.warn ( "Could not deserialize the msg: " , e ) ; } if ( msg != null ) { synchronized ( stdout ) { stdout.print ( msg ) ; } } }
Source:
public static void prev ( java.lang.String query , int limit , java.lang.String sortkey , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeList > callback ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeList.newQuery ( query ) ; if ( limit > 0 ) { call.addParameter ( "n" , limit ) ; } if ( ! ( PagedSingleListScreen.MIN_SORTKEY.equals ( sortkey ) ) ) { call.addParameter ( "P" , sortkey ) ; } call.send ( callback ) ; }

Target:
public static void prev ( java.lang.String query , int limit , java.lang.String sortkey , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.changes.ChangeList > callback ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeList.newQuery ( query ) ; if ( limit > 0 ) { call.addParameter ( "n" , limit ) ; } if ( ! ( PagedSingleListScreen.MIN_SORTKEY.equals ( sortkey ) ) ) { call.addParameter ( "P" , sortkey ) ; } call.send ( callback ) ; }
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 ) ; }

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 ) ; }
Source:
public void onKeyPress ( com.google.gwt.event.dom.client.KeyPressEvent event ) { char c = event.getCharCode ( ) ; if ( ( c < '0' ) || ( '9' < c ) ) { switch ( c ) { case com.google.gwt.event.dom.client.KeyCodes.KEY_BACKSPACE : case com.google.gwt.event.dom.client.KeyCodes.KEY_LEFT : case com.google.gwt.event.dom.client.KeyCodes.KEY_RIGHT : case com.google.gwt.event.dom.client.KeyCodes.KEY_HOME : case com.google.gwt.event.dom.client.KeyCodes.KEY_END : case com.google.gwt.event.dom.client.KeyCodes.KEY_TAB : break ; default : if ( ! ( event.isAnyModifierKeyDown ( ) ) ) { event.preventDefault ( ) ; } break ; } } }

Target:
public void onKeyPress ( com.google.gwt.event.dom.client.KeyPressEvent event ) { char c = event.getCharCode ( ) ; if ( ( c < '0' ) || ( '9' < c ) ) { final int nativeCode = event.getNativeEvent ( ) . getKeyCode ( ) ; switch ( nativeCode ) { case com.google.gwt.event.dom.client.KeyCodes.KEY_BACKSPACE : case com.google.gwt.event.dom.client.KeyCodes.KEY_LEFT : case com.google.gwt.event.dom.client.KeyCodes.KEY_RIGHT : case com.google.gwt.event.dom.client.KeyCodes.KEY_HOME : case com.google.gwt.event.dom.client.KeyCodes.KEY_END : case com.google.gwt.event.dom.client.KeyCodes.KEY_TAB : break ; default : if ( ! ( event.isAnyModifierKeyDown ( ) ) ) { event.preventDefault ( ) ; } break ; } } }
Source:
protected void configure ( ) { bind ( java.lang.String.class ) . annotatedWith ( com.googlesource.gerrit.plugins.hooks.its.ItsName.class ) . toInstance ( "ItsTestName" ) ; serverConfig = createMock ( org.eclipse.jgit.lib.Config.class ) ; bind ( org.eclipse.jgit.lib.Config.class ) . annotatedWith ( com.google.gerrit.server.config.GerritServerConfig.class ) . toInstance ( serverConfig ) ; }

Target:
protected void configure ( ) { bind ( java.lang.String.class ) . annotatedWith ( com.googlesource.gerrit.plugins.hooks.its.ItsName.class ) . toInstance ( "ItsTestName" ) ; serverConfig = createMock ( org.eclipse.jgit.lib.Config.class ) ; bind ( org.eclipse.jgit.lib.Config.class ) . annotatedWith ( com.google.gerrit.server.config.GerritServerConfig.class ) . toInstance ( serverConfig ) ; commitMessageFetcher = createMock ( com.googlesource.gerrit.plugins.hooks.util.CommitMessageFetcher.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.util.CommitMessageFetcher.class ) . toInstance ( commitMessageFetcher ) ; }
Source:
public void getNonChildProject_NotFound ( ) throws java.lang.Exception { com.google.gerrit.acceptance.SshSession sshSession = new com.google.gerrit.acceptance.SshSession ( server , admin ) ; com.google.gerrit.reviewdb.client.Project.NameKey p1 = new com.google.gerrit.reviewdb.client.Project.NameKey ( "p1" ) ; createProject ( p1.get ( ) ) ; com.google.gerrit.reviewdb.client.Project.NameKey p2 = new com.google.gerrit.reviewdb.client.Project.NameKey ( "p2" ) ; createProject ( p2.get ( ) ) ; sshSession.close ( ) ; assertChildNotFound ( p1 , p2.get ( ) ) ; }

Target:
public void getChildProject ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey child = createProject ( "p1" ) ; com.google.gerrit.extensions.common.ProjectInfo childInfo = gApi.projects ( ) . name ( allProjects.get ( ) ) . child ( child.get ( ) ) . get ( ) ; com.google.gerrit.acceptance.rest.project.ProjectAssert.assertProjectInfo ( projectCache.get ( child ) . getProject ( ) , childInfo ) ; }
Source:
public void onCellClicked ( com.google.gwt.user.client.ui.SourcesTableEvents sender , int row , int cell ) { if ( ( getRowItem ( row ) ) != null ) { movePointerTo ( row ) ; } }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { final com.google.gwt.user.client.ui.HTMLTable.Cell cell = table.getCellForEvent ( event ) ; if ( ( cell != null ) && ( ( getRowItem ( cell.getRowIndex ( ) ) ) != null ) ) { movePointerTo ( cell.getRowIndex ( ) ) ; } }
Source:
public com.google.gerrit.server.CurrentUser runAs ( java.net.SocketAddress remotePeer , com.google.gerrit.reviewdb.client.Account.Id id , @ com.google.gerrit.common.Nullable com.google.gerrit.server.CurrentUser caller ) { return new com.google.gerrit.server.IdentifiedUser ( capabilityControlFactory , authConfig , realm , anonymousCowardName , canonicalUrl , accountCache , groupBackend , disableReverseDnsLookup , com.google.inject.util.Providers.of ( remotePeer ) , null , id , caller ) ; }

Target:
public com.google.gerrit.server.CurrentUser runAs ( java.net.SocketAddress remotePeer , com.google.gerrit.reviewdb.client.Account.Id id , @ com.google.gerrit.common.Nullable com.google.gerrit.server.CurrentUser caller ) { return new com.google.gerrit.server.IdentifiedUser ( capabilityControlFactory , starredChangesUtil , authConfig , realm , anonymousCowardName , canonicalUrl , accountCache , groupBackend , disableReverseDnsLookup , com.google.inject.util.Providers.of ( remotePeer ) , null , id , caller ) ; }
Source:
public void publishDraftPatchSet ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createDraftChange ( ) ; com.google.gerrit.server.change.ChangeJson.ChangeInfo c = getChange ( changeId ) ; org.junit.Assert.assertEquals ( ( "p~master~" + changeId ) , c.id ) ; org.junit.Assert.assertEquals ( Change.Status.DRAFT , c.status ) ; com.google.gerrit.acceptance.RestResponse r = publishPatchSet ( changeId ) ; org.junit.Assert.assertEquals ( 204 , r.getStatusCode ( ) ) ; c = getChange ( changeId ) ; org.junit.Assert.assertEquals ( Change.Status.NEW , c.status ) ; }

Target:
public void publishDraftPatchSet ( ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createDraftChange ( ) ; java.lang.String triplet = "p~master~" + changeId ; com.google.gerrit.extensions.common.ChangeInfo c = get ( triplet ) ; org.junit.Assert.assertEquals ( triplet , c.id ) ; org.junit.Assert.assertEquals ( ChangeStatus.DRAFT , c.status ) ; com.google.gerrit.acceptance.RestResponse r = publishPatchSet ( changeId ) ; org.junit.Assert.assertEquals ( 204 , r.getStatusCode ( ) ) ; org.junit.Assert.assertEquals ( ChangeStatus.NEW , get ( triplet ) . status ) ; }
Source:
public com.google.template.soy.data.SanitizedContent toSoyHtml ( org.commonmark.node.Node node ) { if ( node == null ) { return null ; } toc.setRoot ( node ) ; node.accept ( this ) ; return html.toSoy ( ) ; }

Target:
public void renderToHtml ( com.google.gitiles.doc.html.HtmlBuilder out , org.commonmark.node.Node node ) { if ( node != null ) { html = out ; toc = new com.google.gitiles.doc.TocFormatter ( html , 3 ) ; toc.setRoot ( node ) ; node.accept ( this ) ; html.finish ( ) ; html = null ; toc = null ; } }
Source:
public void onDialogVisible ( com.google.gwtexpui.user.client.DialogVisibleEvent event ) { diffTable.getElement ( ) . getStyle ( ) . setVisibility ( ( event.isVisible ( ) ? Style.Visibility.HIDDEN : Style.Visibility.VISIBLE ) ) ; }

Target:
public void onShowView ( ) { super . onShowView ( ) ; resizeCodeMirror ( ) ; com.google.gwt.user.client.Window.enableScrolling ( false ) ; cmA.setOption ( "viewportMargin" , 10 ) ; cmB.setOption ( "viewportMargin" , 10 ) ; cmB.setCursor ( net.codemirror.lib.LineCharacter.create ( 0 ) ) ; cmB.focus ( ) ; prefetchNextFile ( ) ; }
Source:
public void onSuccess ( com.googlesource.gerrit.plugins.imagare.client.ConfigInfo info ) { com.googlesource.gerrit.plugins.imagare.client.ImageUploader.setStage ( info.stage ( ) ) ; java.lang.String project = com.googlesource.gerrit.plugins.imagare.client.ImageUploadScreen.getParameter ( "project" ) ; if ( project != null ) { com.googlesource.gerrit.plugins.imagare.client.ImageUploadScreen.projectBox.setValue ( project ) ; } else { com.googlesource.gerrit.plugins.imagare.client.ImageUploadScreen.projectBox.setValue ( info.getDefaultProject ( ) ) ; } }

Target:
public void onSuccess ( com.googlesource.gerrit.plugins.imagare.client.ConfigInfo info ) { com.googlesource.gerrit.plugins.imagare.client.ImageUploader.setStage ( info.stage ( ) ) ; java.lang.String project = com.googlesource.gerrit.plugins.imagare.client.ImageUploadScreen.getParameter ( "project" ) ; if ( project != null ) { com.googlesource.gerrit.plugins.imagare.client.ImageUploadScreen.projectBox.setValue ( project ) ; } else { com.googlesource.gerrit.plugins.imagare.client.ImageUploadScreen.projectBox.setValue ( info.getDefaultProject ( ) ) ; } uploadPanel.focus ( ) ; }
Source:
private void initForwardingFilter ( ) { setForwardingFilter ( new org.apache.sshd.server.ForwardingFilter ( ) { @ java.lang.Override public boolean canForwardAgent ( org.apache.sshd.server.session.ServerSession session ) { return false ; } @ java.lang.Override public boolean canForwardX11 ( org.apache.sshd.server.session.ServerSession session ) { return false ; } @ java.lang.Override public boolean canConnect ( java.net.InetSocketAddress address , org.apache.sshd.server.session.ServerSession session ) { return false ; } @ java.lang.Override public boolean canListen ( java.net.InetSocketAddress address , org.apache.sshd.server.session.ServerSession session ) { return false ; } } ) ; }

Target:
private void initChannels ( ) { setChannelFactories ( java.util.Arrays.< org.apache.sshd.common.NamedFactory < org.apache.sshd.common.Channel > > asList ( new org.apache.sshd.server.channel.ChannelSession.Factory ( ) , new org.apache.sshd.common.forward.TcpipServerChannel.DirectTcpipFactory ( ) ) ) ; }
Source:
private com.google.gerrit.client.reviewdb.ChangeMessage message ( final com.google.gerrit.client.reviewdb.Change c , final java.lang.String body ) { final byte [ ] raw = new byte [ 4 ] ; org.spearce.jgit.util.NB.encodeInt32 ( raw , 0 , schema.nextChangeMessageId ( ) ) ; final java.lang.String uuid = org.spearce.jgit.util.Base64.encodeBytes ( raw ) ; final com.google.gerrit.client.reviewdb.ChangeMessage m = new com.google.gerrit.client.reviewdb.ChangeMessage ( new com.google.gerrit.client.reviewdb.ChangeMessage.Key ( c.getId ( ) , uuid ) , null ) ; m.setMessage ( body ) ; return m ; }

Target:
private com.google.gerrit.client.reviewdb.ChangeMessage message ( final com.google.gerrit.client.reviewdb.Change c , final java.lang.String body ) { final java.lang.String uuid ; try { uuid = com.google.gerrit.server.ChangeUtil.messageUUID ( schema ) ; } catch ( com.google.gwtorm.client.OrmException e ) { return null ; } final com.google.gerrit.client.reviewdb.ChangeMessage m = new com.google.gerrit.client.reviewdb.ChangeMessage ( new com.google.gerrit.client.reviewdb.ChangeMessage.Key ( c.getId ( ) , uuid ) , null ) ; m.setMessage ( body ) ; return m ; }
Source:
private boolean canAddPatchSet ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { if ( ( ( ! ( getRefControl ( ) . canUpload ( ) ) ) || ( isPatchSetLocked ( db ) ) ) || ( ! ( isPatchVisible ( patchSetUtil.current ( db , notes ) , db ) ) ) ) { return false ; } if ( isOwner ( ) ) { return true ; } return getRefControl ( ) . canAddPatchSet ( ) ; }

Target:
private boolean canAddPatchSet ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { if ( ( ( ! ( refControl.asForRef ( ) . testOrFalse ( RefPermission.CREATE_CHANGE ) ) ) || ( isPatchSetLocked ( db ) ) ) || ( ! ( isPatchVisible ( patchSetUtil.current ( db , notes ) , db ) ) ) ) { return false ; } if ( isOwner ( ) ) { return true ; } return getRefControl ( ) . canAddPatchSet ( ) ; }
Source:
public static void assertGroups ( java.lang.Iterable < java.lang.String > expected , java.util.Set < java.lang.String > actual ) { for ( java.lang.String g : expected ) { com.google.common.truth.Truth.assert_ ( ) . withMessage ( ( "missing group " + g ) ) . that ( actual.remove ( g ) ) . isTrue ( ) ; } com.google.common.truth.Truth.assert_ ( ) . withMessage ( ( "unexpected groups: " + actual ) ) . that ( actual ) . isEmpty ( ) ; }

Target:
public static void assertGroups ( java.lang.Iterable < java.lang.String > expected , java.util.Set < java.lang.String > actual ) { for ( java.lang.String g : expected ) { com.google.common.truth.Truth.assertWithMessage ( ( "missing group " + g ) ) . that ( actual.remove ( g ) ) . isTrue ( ) ; } com.google.common.truth.Truth.assertWithMessage ( ( "unexpected groups: " + actual ) ) . that ( actual ) . isEmpty ( ) ; }
Source:
public void asyncStarredChanges ( ) { if ( ( ( starredChanges ) == null ) && ( ( dbProvider ) != null ) ) { try { starredQuery = starredQuery ( ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.IdentifiedUser.log.warn ( "Cannot query starred by user changes" , e ) ; starredQuery = null ; starredChanges = java.util.Collections.emptySet ( ) ; } } }

Target:
public void asyncStarredChanges ( ) { if ( ( ( starredChanges ) == null ) && ( ( starredChangesUtil ) != null ) ) { starredQuery = starredChangesUtil.query ( accountId ) ; } }
Source:
void addRef ( java.lang.String ref ) { if ( com.googlesource.gerrit.plugins.replication.PushOne.ALL_REFS.equals ( ref ) ) { delta.clear ( ) ; pushAllRefs = true ; com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.trace ( ( "Added all refs for replication to " + ( uri ) ) ) ; } else if ( ! ( pushAllRefs ) ) { delta.add ( ref ) ; com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.trace ( ( ( ( "Added ref " + ref ) + " for replication to " ) + ( uri ) ) ) ; } }

Target:
void addRef ( java.lang.String ref ) { if ( com.googlesource.gerrit.plugins.replication.PushOne.ALL_REFS.equals ( ref ) ) { delta.clear ( ) ; pushAllRefs = true ; com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.trace ( "Added all refs for replication to {}" , uri ) ; } else if ( ! ( pushAllRefs ) ) { delta.add ( ref ) ; com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.trace ( "Added ref for replication to {}" , ref , uri ) ; } }
Source:
public void run ( ) { ( hasPrev ? prev : up ) . go ( ) ; }

Target:
java.lang.Runnable navigate ( com.google.gerrit.client.diff.Direction dir ) { switch ( dir ) { case PREV : return ( ) -> { ( hasPrev ? prev : up ) . go ( ) ; } ; case NEXT : return ( ) -> { ( hasNext ? next : up ) . go ( ) ; } ; default : return ( ) -> { } ; } }
Source:
public void testUpdateOneModified ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { stubExecuteBatchOK ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 0 ) ; com.google.gwtorm.jdbc.JdbcAccess < com.google.gwtorm.jdbc.TestJdbcAccess.Data , com.google.gwtorm.jdbc.TestJdbcAccess.Data.DataKey > classUnderTest = createClassUnderTest ( ) ; try { classUnderTest.update ( com.google.gwtorm.jdbc.TestJdbcAccess.ONE_ROW ) ; org.junit.Assert.fail ( "missing OrmConcurrencyException" ) ; } catch ( com.google.gwtorm.client.OrmConcurrencyException e ) { } }

Target:
public void testUpsertOneException ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.SQLException exception = new java.sql.BatchUpdateException ( ) ; java.sql.PreparedStatement update = stubStatementThrowExceptionOnExecute ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , exception ) ; com.google.gwtorm.jdbc.JdbcAccess < com.google.gwtorm.jdbc.TestJdbcAccess.Data , com.google.gwtorm.jdbc.TestJdbcAccess.Data.DataKey > classUnderTest = createClassUnderTest ( ) ; try { classUnderTest.upsert ( oneRow ) ; org.junit.Assert.fail ( "missingException" ) ; } catch ( com.google.gwtorm.server.OrmException e ) { org.junit.Assert.assertSame ( e.getCause ( ) , exception ) ; } com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( update ) ; }
Source:
public void index ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { for ( com.google.gerrit.server.index.Index < ? , com.google.gerrit.server.query.change.ChangeData > i : getWriteIndexes ( ) ) { i.replace ( cd ) ; } fireChangeIndexedEvent ( cd.getId ( ) . get ( ) ) ; }

Target:
public void index ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { for ( com.google.gerrit.server.index.Index < ? , com.google.gerrit.server.query.change.ChangeData > i : getWriteIndexes ( ) ) { i.replace ( cd ) ; } fireChangeIndexedEvent ( cd.getId ( ) . get ( ) ) ; com.google.gerrit.server.index.change.ChangeIndexer.reindexAfterIndexUpdate ( cd ) ; }
Source:
public java.util.Set < java.lang.String > reviewed ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return com.google.common.collect.ImmutableSet.copyOf ( ( ( java.lang.Iterable < java.lang.String > ) ( listFiles.setReviewed ( true ) . apply ( revision ) . value ( ) ) ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException | com.google.gerrit.server.patch.PatchListNotAvailableException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot list reviewed files" , e ) ; } }

Target:
public java.util.Set < java.lang.String > reviewed ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return com.google.common.collect.ImmutableSet.copyOf ( ( ( java.lang.Iterable < java.lang.String > ) ( listFiles.setReviewed ( true ) . apply ( revision ) . value ( ) ) ) ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot list reviewed files" , e ) ; } }
Source:
static void postSignIn ( final com.google.gerrit.client.reviewdb.Account acct , final com.google.gwt.user.client.rpc.AsyncCallback < ? > ac ) { com.google.gerrit.client.Gerrit.myAccount = acct ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; for ( final com.google.gerrit.client.SignedInListener l : com.google.gerrit.client.Gerrit.signedInListeners ) { l.onSignIn ( ) ; } final com.google.gerrit.client.ui.Screen cs = com.google.gerrit.client.Gerrit.body.getView ( ) ; if ( cs != null ) { cs.onSignIn ( ) ; } if ( ac != null ) { ac.onSuccess ( null ) ; } }

Target:
public static void removeSignOutHandler ( final com.google.gerrit.client.SignOutHandler l ) { com.google.gerrit.client.Gerrit.signOutHandlers.remove ( l ) ; }
Source:
private static void callback ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { final java.lang.StringBuilder rdr = new java.lang.StringBuilder ( ) ; rdr.append ( com.google.gerrit.server.GerritServer.serverUrl ( req ) ) ; final java.lang.String token = req.getParameter ( com.google.gerrit.server.rpc.OpenIdServiceImpl.P_TOKEN ) ; if ( ( token != null ) && ( ! ( token.startsWith ( "SignInFailure," ) ) ) ) { rdr.append ( '#' ) ; rdr.append ( token ) ; } rsp.sendRedirect ( rdr.toString ( ) ) ; }

Target:
private void callback ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { final java.lang.StringBuilder rdr = new java.lang.StringBuilder ( ) ; rdr.append ( urlProvider.get ( ) ) ; final java.lang.String token = req.getParameter ( com.google.gerrit.server.rpc.OpenIdServiceImpl.P_TOKEN ) ; if ( ( token != null ) && ( ! ( token.startsWith ( "SignInFailure," ) ) ) ) { rdr.append ( '#' ) ; rdr.append ( token ) ; } rsp.sendRedirect ( rdr.toString ( ) ) ; }
Source:
void setWidget ( net.codemirror.lib.LineWidget widget ) { this . widget = widget ; addStyleName ( style.isLineWidget ( ) ) ; }

Target:
void setWidget ( net.codemirror.lib.LineWidget lineWidget ) { widget = lineWidget ; com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { getElement ( ) . getStyle ( ) . setPaddingLeft ( cm.getGutterElement ( ) . getOffsetWidth ( ) , Unit.PX ) ; } } ) ; }
Source:
public void done ( ) { finalAdded = true ; applyAllSuccess ( ) ; }

Target:
public < T > com.google.gerrit.client.rpc.HttpCallback < T > add ( com.google.gerrit.client.rpc.HttpCallback < T > cb ) { checkFinalAdded ( ) ; if ( failed ) { cb.onFailure ( failedThrowable ) ; return new com.google.gerrit.client.rpc.HttpCallback < T > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.rpc.HttpResponse < T > result ) { } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ; } com.google.gerrit.client.rpc.CallbackGroup.HttpCallbackImpl < T > w = new com.google.gerrit.client.rpc.CallbackGroup.HttpCallbackImpl ( cb ) ; callbacks.add ( w ) ; remaining.add ( w ) ; return w ; }
Source:
private com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.AccessToken newAccessTokenFromUser ( java.lang.String username ) { com.google.gerrit.server.account.AccountState account = accountCache.getByUsername ( username ) ; java.util.Collection < com.google.gerrit.server.account.ExternalId > externalIds = account.getExternalIds ( ) ; for ( com.google.gerrit.server.account.ExternalId accountExternalId : externalIds ) { java.lang.String key = accountExternalId.asAccountExternalId ( ) . getKey ( ) . get ( ) ; if ( key.startsWith ( com.googlesource.gerrit.plugins.github.oauth.IdentifiedUserGitHubLoginProvider.EXTERNAL_ID_PREFIX ) ) { return new com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.AccessToken ( key.substring ( com.googlesource.gerrit.plugins.github.oauth.IdentifiedUserGitHubLoginProvider.EXTERNAL_ID_PREFIX.length ( ) ) ) ; } } return null ; }

Target:
private com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.AccessToken newAccessTokenFromUser ( java.lang.String username ) { com.google.gerrit.server.account.AccountState account = accountCache.getByUsername ( username ) ; java.util.Collection < com.google.gerrit.server.account.externalids.ExternalId > externalIds = account.getExternalIds ( ) ; for ( com.google.gerrit.server.account.externalids.ExternalId accountExternalId : externalIds ) { java.lang.String key = accountExternalId.asAccountExternalId ( ) . getKey ( ) . get ( ) ; if ( key.startsWith ( com.googlesource.gerrit.plugins.github.oauth.IdentifiedUserGitHubLoginProvider.EXTERNAL_ID_PREFIX ) ) { return new com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.AccessToken ( key.substring ( com.googlesource.gerrit.plugins.github.oauth.IdentifiedUserGitHubLoginProvider.EXTERNAL_ID_PREFIX.length ( ) ) ) ; } } return null ; }
Source:
private java.util.Map < com.google.gerrit.reviewdb.client.PatchSetApproval.Key , com.google.gerrit.reviewdb.client.PatchSetApproval > filterPatchSetApprovals ( ) { return limitToExistingPatchSets ( patchSetApprovals , new com.google.common.base.Function < com.google.gerrit.reviewdb.client.PatchSetApproval.Key , com.google.gerrit.reviewdb.client.PatchSet.Id > ( ) { @ java.lang.Override public PatchSet.Id apply ( com.google.gerrit.reviewdb.client.PatchSetApproval.Key in ) { return in.getParentKey ( ) ; } } ) ; }

Target:
private java.util.Map < com.google.gerrit.reviewdb.client.PatchSetApproval.Key , com.google.gerrit.reviewdb.client.PatchSetApproval > filterPatchSetApprovals ( ) { return limitToValidPatchSets ( patchSetApprovals , new com.google.common.base.Function < com.google.gerrit.reviewdb.client.PatchSetApproval.Key , com.google.gerrit.reviewdb.client.PatchSet.Id > ( ) { @ java.lang.Override public PatchSet.Id apply ( com.google.gerrit.reviewdb.client.PatchSetApproval.Key in ) { return in.getParentKey ( ) ; } } ) ; }
Source:
public void newPatchSetOnWipChangeSettingReadyInReviewDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%ready" , sc.owner ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . notTo ( sc.owner ) . to ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; assertThat ( sender ) . notSent ( ) ; }

Target:
public void newPatchSetOnWipChangeSettingReadyInReviewDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; pushTo ( sc , "refs/for/master%ready" , sc.owner ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . to ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) . noOneElse ( ) ; assertThat ( sender ) . notSent ( ) ; }
Source:
private void decodeStarredBy ( com.google.common.collect.Multimap < java.lang.String , org.apache.lucene.index.IndexableField > doc , com.google.gerrit.server.query.change.ChangeData cd ) { java.util.Collection < org.apache.lucene.index.IndexableField > starredBy = doc.get ( com.google.gerrit.lucene.LuceneChangeIndex.STARREDBY_FIELD ) ; java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > accounts = com.google.common.collect.Sets.newHashSetWithExpectedSize ( starredBy.size ( ) ) ; for ( org.apache.lucene.index.IndexableField r : starredBy ) { accounts.add ( new com.google.gerrit.reviewdb.client.Account.Id ( r.numericValue ( ) . intValue ( ) ) ) ; } cd.setStarredBy ( accounts ) ; }

Target:
public void close ( ) { java.util.List < com.google.common.util.concurrent.ListenableFuture < ? > > closeFutures = com.google.common.collect.Lists.newArrayListWithCapacity ( 2 ) ; closeFutures.add ( executor.submit ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { openIndex.close ( ) ; } } ) ) ; closeFutures.add ( executor.submit ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { closedIndex.close ( ) ; } } ) ) ; com.google.common.util.concurrent.Futures.getUnchecked ( com.google.common.util.concurrent.Futures.allAsList ( closeFutures ) ) ; }
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.elasticsearch.ElasticAccountIndex.QuerySource ( p , opts ) ; }

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 { io.searchbox.core.search.sort.Sort sort = new io.searchbox.core.search.sort.Sort ( AccountField.ID.getName ( ) , io.searchbox.core.search.sort.Sort.Sorting.ASC ) ; sort.setIgnoreUnmapped ( ) ; return new com.google.gerrit.elasticsearch.ElasticQuerySource ( p , opts.filterFields ( IndexUtils :: accountFields ) , com.google.gerrit.elasticsearch.ElasticAccountIndex.ACCOUNTS , sort ) ; }
Source:
private void evictCache ( com.google.common.cache.Cache < ? , ? > cache , java.lang.String cacheName , java.lang.Object key ) { if ( Constants.PROJECT_LIST.equals ( cacheName ) ) { cache.invalidateAll ( ) ; } else { cache.invalidate ( key ) ; } com.ericsson.gerrit.plugins.highavailability.forwarder.rest.CacheRestApiServlet.logger.debug ( ( "Invalidated " + cacheName ) ) ; }

Target:
private void evictCache ( com.google.common.cache.Cache < ? , ? > cache , java.lang.String cacheName , java.lang.Object key ) { if ( Constants.PROJECT_LIST.equals ( cacheName ) ) { cache.invalidateAll ( ) ; } else { cache.invalidate ( key ) ; } com.ericsson.gerrit.plugins.highavailability.forwarder.rest.CacheRestApiServlet.logger.debug ( "Invalidated {}" , cacheName ) ; }