auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private java.util.List < com.google.gerrit.server.data.ChangeAttribute > getChanges ( java.lang.String rawResponse ) { java.lang.String [ ] lines = rawResponse.split ( "\\n" ) ; java.util.List < com.google.gerrit.server.data.ChangeAttribute > changes = new java.util.ArrayList < > ( ( ( lines.length ) - 1 ) ) ; for ( int i = 0 ; i < ( ( lines.length ) - 1 ) ; i ++ ) { changes.add ( new com.google.gson.Gson ( ) . fromJson ( lines [ i ] , com.google.gerrit.server.data.ChangeAttribute.class ) ) ; } return changes ; }

Target:
private static java.util.List < com.google.gerrit.server.data.ChangeAttribute > getChanges ( java.lang.String rawResponse ) { java.lang.String [ ] lines = rawResponse.split ( "\\n" ) ; java.util.List < com.google.gerrit.server.data.ChangeAttribute > changes = new java.util.ArrayList < > ( ( ( lines.length ) - 1 ) ) ; for ( int i = 0 ; i < ( ( lines.length ) - 1 ) ; i ++ ) { changes.add ( com.google.gerrit.acceptance.ssh.QueryIT.gson.fromJson ( lines [ i ] , com.google.gerrit.server.data.ChangeAttribute.class ) ) ; } return changes ; }
Source:
public static void restore ( int id , java.lang.String msg , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.Input input = com.google.gerrit.client.changes.ChangeApi.Input.create ( ) ; input.message ( com.google.gerrit.client.changes.ChangeApi.emptyToNull ( msg ) ) ; com.google.gerrit.client.changes.ChangeApi.api ( id , "restore" ) . data ( input ) . post ( cb ) ; }

Target:
public static void restore ( int id , java.lang.String msg , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.Input input = com.google.gerrit.client.changes.ChangeApi.Input.create ( ) ; input.message ( com.google.gerrit.client.changes.ChangeApi.emptyToNull ( msg ) ) ; com.google.gerrit.client.changes.ChangeApi.call ( id , "restore" ) . post ( input , cb ) ; }
Source:
public void duplicateEventOfAQueuedEventShouldGetDiscarded ( ) { com.google.gerrit.server.git.WorkQueue.Executor poolMock = org.mockito.Mockito.mock ( com.google.gerrit.server.git.WorkQueue.Executor.class ) ; indexEventHandler = new com.ericsson.gerrit.plugins.syncindex.IndexEventHandler ( poolMock , com.ericsson.gerrit.plugins.syncindex.IndexEventHandlerTest.PLUGIN_NAME , restSessionMock ) ; indexEventHandler.onChangeIndexed ( id.get ( ) ) ; indexEventHandler.onChangeIndexed ( id.get ( ) ) ; org.mockito.Mockito.verify ( poolMock , org.mockito.Mockito.times ( 1 ) ) . execute ( indexEventHandler.new com.ericsson.gerrit.plugins.syncindex.IndexEventHandler.SyncIndexTask ( com.ericsson.gerrit.plugins.syncindex.IndexEventHandlerTest.CHANGE_ID , false ) ) ; }

Target:
public void duplicateEventOfAQueuedEventShouldGetDiscarded ( ) { com.google.gerrit.server.git.WorkQueue.Executor poolMock = org.mockito.Mockito.mock ( com.google.gerrit.server.git.WorkQueue.Executor.class ) ; indexEventHandler = new com.ericsson.gerrit.plugins.multimaster.IndexEventHandler ( poolMock , com.ericsson.gerrit.plugins.multimaster.IndexEventHandlerTest.PLUGIN_NAME , restSessionMock ) ; indexEventHandler.onChangeIndexed ( id.get ( ) ) ; indexEventHandler.onChangeIndexed ( id.get ( ) ) ; org.mockito.Mockito.verify ( poolMock , org.mockito.Mockito.times ( 1 ) ) . execute ( indexEventHandler.new com.ericsson.gerrit.plugins.multimaster.IndexEventHandler.SyncIndexTask ( com.ericsson.gerrit.plugins.multimaster.IndexEventHandlerTest.CHANGE_ID , false ) ) ; }
Source:
public com.google.gitiles.GitilesView build ( ) { switch ( type ) { case HOST_INDEX : checkHostIndex ( ) ; break ; case REPOSITORY_INDEX : checkRepositoryIndex ( ) ; break ; case REVISION : checkRevision ( ) ; break ; case PATH : checkPath ( ) ; break ; case DIFF : checkDiff ( ) ; break ; case LOG : checkLog ( ) ; break ; } return new com.google.gitiles.GitilesView ( type , hostName , servletPath , repositoryName , revision , oldRevision , path , params , anchor ) ; }

Target:
public com.google.gitiles.GitilesView build ( ) { switch ( type ) { case HOST_INDEX : checkHostIndex ( ) ; break ; case REPOSITORY_INDEX : checkRepositoryIndex ( ) ; break ; case REFS : checkRefs ( ) ; break ; case REVISION : checkRevision ( ) ; break ; case PATH : checkPath ( ) ; break ; case DIFF : checkDiff ( ) ; break ; case LOG : checkLog ( ) ; break ; } return new com.google.gitiles.GitilesView ( type , hostName , servletPath , repositoryName , revision , oldRevision , path , params , anchor ) ; }
Source:
public void run ( ) { for ( java.nio.file.Path folder : repoFolders ) { if ( java.nio.file.Files.notExists ( folder ) ) { com.googlesource.gerrit.plugins.deleteproject.fs.DeleteTrashFolders.log.debug ( "Base path does not exist" , folder ) ; continue ; } try { java.nio.file.Files.walkFileTree ( folder , new com.googlesource.gerrit.plugins.deleteproject.fs.DeleteTrashFolders.TrashFolderRemover ( ) ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.deleteproject.fs.DeleteTrashFolders.log.warn ( "Exception while trying to delete trash folders" , e ) ; } } }

Target:
public void start ( ) { new java.lang.Thread ( ( ) -> { for ( java.nio.file.Path folder : repoFolders ) { if ( java.nio.file.Files.notExists ( folder ) ) { com.googlesource.gerrit.plugins.deleteproject.fs.DeleteTrashFolders.log.debug ( "Base path does not exist" , folder ) ; continue ; } try { java.nio.file.Files.walkFileTree ( folder , new com.googlesource.gerrit.plugins.deleteproject.fs.DeleteTrashFolders.TrashFolderRemover ( ) ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.deleteproject.fs.DeleteTrashFolders.log.warn ( "Exception while trying to delete trash folders" , e ) ; } } } , "DeleteTrashFolders" ) . start ( ) ; }
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.reviewdb.client.Project.SubmitType submitType ) { infoBlock.display ( chg , acc , submitType ) ; messageBlock.display ( chg.getId ( ) , starred , info.getMessage ( ) ) ; }

Target:
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 ( ) ) ; }
Source:
public void testDuplicateCompoundNonIndexOnlyPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "(status:new OR status:draft) bar:p file:a" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; com.google.common.truth.Truth.assertThat ( out.getClass ( ) ) . isEqualTo ( com.google.gerrit.server.query.change.AndSource.class ) ; com.google.common.truth.Truth.assertThat ( out.getChildren ( ) ) . containsExactly ( query ( com.google.gerrit.server.query.Predicate.and ( in.getChild ( 0 ) , in.getChild ( 2 ) ) ) , in.getChild ( 1 ) ) . inOrder ( ) ; }

Target:
public void testDuplicateCompoundNonIndexOnlyPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "(status:new OR status:draft) bar:p file:a" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; com.google.common.truth.Truth.assertThat ( out.getClass ( ) ) . isEqualTo ( com.google.gerrit.server.query.change.AndChangeSource.class ) ; com.google.common.truth.Truth.assertThat ( out.getChildren ( ) ) . containsExactly ( query ( com.google.gerrit.server.query.Predicate.and ( in.getChild ( 0 ) , in.getChild ( 2 ) ) ) , in.getChild ( 1 ) ) . inOrder ( ) ; }
Source:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > changeDrafts ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByChangeAuthor ( ctx.getDb ( ) , ctx.getChangeNotes ( ) , user.getAccountId ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }

Target:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > changeDrafts ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByChangeAuthor ( ctx.getDb ( ) , ctx.getNotes ( ) , user.getAccountId ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }
Source:
private void display ( final com.google.gerrit.client.admin.ProjectDetail result ) { setTitleText ( Util.M.project ( result.project.getName ( ) ) ) ; ownerTxt.setText ( result.ownerGroup.getName ( ) ) ; descTxt.setText ( result.project.getDescription ( ) ) ; }

Target:
private void initRights ( ) { final com.google.gwt.user.client.ui.Label rightsHdr = new com.google.gwt.user.client.ui.Label ( Util.C.headingAccessRights ( ) ) ; rightsHdr.setStyleName ( "gerrit-SmallHeading" ) ; rights = new com.google.gerrit.client.admin.ProjectAdminScreen.RightsTable ( ) ; delRight = new com.google.gwt.user.client.ui.Button ( Util.C.buttonDeleteGroupMembers ( ) ) ; delRight.addClickListener ( new com.google.gwt.user.client.ui.ClickListener ( ) { public void onClick ( final com.google.gwt.user.client.ui.Widget sender ) { rights.deleteChecked ( ) ; } } ) ; add ( rightsHdr ) ; add ( rights ) ; add ( delRight ) ; }
Source:
public boolean equals ( final java.lang.Object o ) { if ( o instanceof com.google.gerrit.server.patch.PatchListKey ) { final com.google.gerrit.server.patch.PatchListKey k = ( ( com.google.gerrit.server.patch.PatchListKey ) ( o ) ) ; return ( ( com.google.gerrit.server.patch.PatchListKey.eq ( oldId , k.oldId ) ) && ( com.google.gerrit.server.patch.PatchListKey.eq ( newId , k.newId ) ) ) && ( ( whitespace ) == ( k.whitespace ) ) ; } return false ; }

Target:
public com.google.gerrit.reviewdb.AccountDiffPreference.Whitespace getWhitespace ( ) { if ( ( whitespace ) == null ) { whitespace = com.google.gerrit.reviewdb.AccountDiffPreference.Whitespace.forCode ( whitespaceCode ) ; } return whitespace ; }
Source:
public void testCreateSchema_Label_CodeReview ( ) throws java.lang.Exception { com.google.gerrit.common.data.LabelType codeReview = getLabelTypes ( ) . byLabel ( "Code-Review" ) ; assertNotNull ( codeReview ) ; assertEquals ( "Code-Review" , codeReview.getName ( ) ) ; assertEquals ( "CR" , codeReview.getAbbreviatedName ( ) ) ; assertEquals ( "MaxWithBlock" , codeReview.getFunctionName ( ) ) ; assertTrue ( codeReview.isCopyMinScore ( ) ) ; assertValueRange ( codeReview , 2 , 1 , 0 , ( - 1 ) , ( - 2 ) ) ; }

Target:
public void testCreateSchema_Label_CodeReview ( ) throws java.lang.Exception { com.google.gerrit.common.data.LabelType codeReview = getLabelTypes ( ) . byLabel ( "Code-Review" ) ; assertNotNull ( codeReview ) ; assertEquals ( "Code-Review" , codeReview.getName ( ) ) ; assertEquals ( "CR" , codeReview.getAbbreviation ( ) ) ; assertEquals ( "MaxWithBlock" , codeReview.getFunctionName ( ) ) ; assertTrue ( codeReview.isCopyMinScore ( ) ) ; assertValueRange ( codeReview , 2 , 1 , 0 , ( - 1 ) , ( - 2 ) ) ; }
Source:
public void unblockRangeForNotChangeOwner ( ) { com.google.gerrit.server.project.testing.Util.allow ( local , ( ( com.google.gerrit.common.data.Permission.LABEL ) + "Code-Review" ) , ( - 2 ) , ( + 2 ) , com.google.gerrit.server.group.SystemGroupBackend.CHANGE_OWNER , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.testing.Util.DEVS ) ; com.google.gerrit.common.data.PermissionRange range = u.controlForRef ( "refs/heads/master" ) . getRange ( ( ( com.google.gerrit.common.data.Permission.LABEL ) + "Code-Review" ) ) ; assertCannotVote ( ( - 2 ) , range ) ; assertCannotVote ( 2 , range ) ; }

Target:
public void unblockRangeForNotChangeOwner ( ) { com.google.gerrit.server.project.testing.Util.allow ( local , ( ( com.google.gerrit.common.data.Permission.LABEL ) + "Code-Review" ) , ( - 2 ) , ( + 2 ) , com.google.gerrit.server.group.SystemGroupBackend.CHANGE_OWNER , "refs/heads/*" ) ; com.google.gerrit.server.permissions.ProjectControl u = user ( local , com.google.gerrit.server.project.testing.Util.DEVS ) ; com.google.gerrit.common.data.PermissionRange range = u.controlForRef ( "refs/heads/master" ) . getRange ( ( ( com.google.gerrit.common.data.Permission.LABEL ) + "Code-Review" ) ) ; assertCannotVote ( ( - 2 ) , range ) ; assertCannotVote ( 2 , range ) ; }
Source:
private com.google.gerrit.reviewdb.client.PatchLineComment newComment ( ) { com.google.gerrit.reviewdb.client.PatchLineComment newComment = new com.google.gerrit.reviewdb.client.PatchLineComment ( new com.google.gerrit.reviewdb.client.PatchLineComment.Key ( comment.getKey ( ) . getParentKey ( ) , null ) , comment.getLine ( ) , com.google.gerrit.client.Gerrit.getUserAccount ( ) . getId ( ) , comment.getKey ( ) . get ( ) ) ; newComment.setSide ( comment.getSide ( ) ) ; return newComment ; }

Target:
private com.google.gerrit.reviewdb.client.PatchLineComment newComment ( ) { com.google.gerrit.reviewdb.client.PatchLineComment newComment = new com.google.gerrit.reviewdb.client.PatchLineComment ( new com.google.gerrit.reviewdb.client.PatchLineComment.Key ( comment.getKey ( ) . getParentKey ( ) , null ) , comment.getLine ( ) , com.google.gerrit.client.Gerrit.getUserAccount ( ) . getId ( ) , comment.getKey ( ) . get ( ) , new java.sql.Timestamp ( java.lang.System.currentTimeMillis ( ) ) ) ; newComment.setSide ( comment.getSide ( ) ) ; return newComment ; }
Source:
private org.apache.lucene.search.Query exactQuery ( com.google.gerrit.server.index.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > p ) { return new org.apache.lucene.search.TermQuery ( new org.apache.lucene.index.Term ( p.getOperator ( ) , p.getValue ( ) ) ) ; }

Target:
public void markReady ( ) throws java.io.IOException { try { org.eclipse.jgit.storage.file.FileBasedConfig cfg = com.google.gerrit.lucene.LuceneVersionManager.loadGerritIndexConfig ( sitePaths ) ; cfg.setBoolean ( "index" , java.lang.Integer.toString ( schema.getVersion ( ) ) , "ready" , true ) ; cfg.save ( ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException e ) { throw new java.io.IOException ( e ) ; } }
Source:
public void onLoad ( ) { super . onLoad ( ) ; Util.ACCOUNT_SVC.myAccount ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.reviewdb.Account > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gerrit.client.reviewdb.Account result ) { display ( result ) ; tabs.selectTab ( tabTokens.indexOf ( initialTabToken ) ) ; } } ) ; }

Target:
public void onLoad ( ) { super . onLoad ( ) ; final int idx = tabTokens.indexOf ( initialTabToken ) ; tabs.selectTab ( ( 0 <= idx ? idx : 0 ) ) ; display ( com.google.gerrit.client.Gerrit.getUserAccount ( ) ) ; display ( ) ; }
Source:
private static final java.net.InetSocketAddress newPort ( ) throws java.io.IOException { java.net.ServerSocket s = new java.net.ServerSocket ( 0 , 0 , java.net.InetAddress.getLocalHost ( ) ) ; try { return ( ( java.net.InetSocketAddress ) ( s.getLocalSocketAddress ( ) ) ) ; } finally { s.close ( ) ; } }

Target:
private static java.net.InetAddress getLocalHost ( ) throws java.net.UnknownHostException { try { return java.net.InetAddress.getLocalHost ( ) ; } catch ( java.net.UnknownHostException e1 ) { try { return java.net.InetAddress.getByName ( "localhost" ) ; } catch ( java.net.UnknownHostException e2 ) { return java.net.InetAddress.getByName ( "127.0.0.1" ) ; } } }
Source:
public void testCreateProjectWithNonExistingOwner_UnprocessableEntity ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.ProjectInput in = new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ; in.owners = java.util.Collections.singletonList ( "non-existing-group" ) ; com.google.gerrit.acceptance.RestResponse r = adminSession.put ( "/projects/newProject" , in ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_UNPROCESSABLE_ENTITY ) ; }

Target:
public void testCreateProjectWithNonExistingOwner_UnprocessableEntity ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.ProjectInput in = new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ; in.name = "newProjectName" ; in.owners = java.util.Collections.singletonList ( "non-existing-group" ) ; assertCreateFails ( in , com.google.gerrit.extensions.restapi.UnprocessableEntityException.class ) ; }
Source:
public final java.util.List < com.google.gerrit.client.info.AgreementInfo > contributorAgreements ( ) { java.util.List < com.google.gerrit.client.info.AgreementInfo > agreements = new java.util.ArrayList < > ( ) ; for ( com.google.gerrit.client.info.AgreementInfo a : com.google.gerrit.client.rpc.Natives.asList ( _contributorAgreements ( ) ) ) { agreements.add ( a ) ; } return agreements ; }

Target:
public final java.util.List < com.google.gerrit.client.info.AgreementInfo > contributorAgreements ( ) { java.util.List < com.google.gerrit.client.info.AgreementInfo > agreements = new java.util.ArrayList < > ( ) ; com.google.gwt.core.client.JsArray < com.google.gerrit.client.info.AgreementInfo > contributorAgreements = _contributorAgreements ( ) ; if ( contributorAgreements != null ) { for ( com.google.gerrit.client.info.AgreementInfo a : com.google.gerrit.client.rpc.Natives.asList ( contributorAgreements ) ) { agreements.add ( a ) ; } } return agreements ; }
Source:
private boolean isLive ( final java.io.File entry ) { final java.lang.String name = entry.getName ( ) ; return ( ( ErrorLogFile.LOG_NAME.equals ( name ) ) || ( "sshd_log" . equals ( name ) ) ) || ( name.endsWith ( ".pid" ) ) ; }

Target:
private boolean isLive ( final java.io.File entry ) { final java.lang.String name = entry.getName ( ) ; return ( ( ( ErrorLogFile.LOG_NAME.equals ( name ) ) || ( "sshd_log" . equals ( name ) ) ) || ( "httpd_log" . equals ( name ) ) ) || ( name.endsWith ( ".pid" ) ) ; }
Source:
private java.util.Set < java.lang.String > fields ( com.google.gerrit.server.query.change.QueryOptions opts ) { if ( ( ( schemaHasRequestedField ( ChangeField.LEGACY_ID2 , opts.fields ( ) ) ) || ( schemaHasRequestedField ( ChangeField.CHANGE , opts.fields ( ) ) ) ) || ( schemaHasRequestedField ( ChangeField.LEGACY_ID , opts.fields ( ) ) ) ) { return opts.fields ( ) ; } return com.google.common.collect.Sets.union ( opts.fields ( ) , com.google.common.collect.ImmutableSet.of ( idFieldName ( ) ) ) ; }

Target:
private java.util.Set < java.lang.String > fields ( com.google.gerrit.server.query.change.QueryOptions opts ) { if ( ( schemaHasRequestedField ( ChangeField.LEGACY_ID2 , opts.fields ( ) ) ) || ( schemaHasRequestedField ( ChangeField.CHANGE , opts.fields ( ) ) ) ) { return opts.fields ( ) ; } return com.google.common.collect.Sets.union ( opts.fields ( ) , com.google.common.collect.ImmutableSet.of ( com.google.gerrit.server.index.ChangeField.LEGACY_ID2.getName ( ) ) ) ; }
Source:
public static void createProject ( java.lang.String projectName , java.lang.String parent , java.lang.Boolean createEmptyCcommit , java.lang.Boolean permissionsOnly , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > cb ) { com.google.gerrit.client.projects.ProjectApi.ProjectInput input = com.google.gerrit.client.projects.ProjectApi.ProjectInput.create ( ) ; input.setName ( projectName ) ; input.setParent ( parent ) ; input.setPermissionsOnly ( permissionsOnly ) ; input.setCreateEmptyCommit ( createEmptyCcommit ) ; new com.google.gerrit.client.rpc.RestApi ( "projects" ) . id ( projectName ) . ifNoneMatch ( ) . put ( input , cb ) ; }

Target:
public static void createProject ( java.lang.String projectName , java.lang.String parent , java.lang.Boolean createEmptyCcommit , java.lang.Boolean permissionsOnly , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > cb ) { com.google.gerrit.client.projects.ProjectApi.ProjectInput input = com.google.gerrit.client.projects.ProjectApi.ProjectInput.create ( ) ; input.setName ( projectName ) ; input.setParent ( parent ) ; input.setPermissionsOnly ( permissionsOnly ) ; input.setCreateEmptyCommit ( createEmptyCcommit ) ; new com.google.gerrit.client.rpc.RestApi ( "/projects/" ) . id ( projectName ) . ifNoneMatch ( ) . put ( input , cb ) ; }
Source:
private java.util.List < com.google.gerrit.acceptance.rest.account.AccountInfo > GET ( java.lang.String endpoint ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = session.get ( endpoint ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; return new com.google.gson.Gson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.acceptance.rest.account.AccountInfo > > ( ) { } . getType ( ) ) ; }

Target:
private java.util.List < com.google.gerrit.server.account.AccountInfo > GET ( java.lang.String endpoint ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = session.get ( endpoint ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; return newGson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.server.account.AccountInfo > > ( ) { } . getType ( ) ) ; }
Source:
private java.util.List < com.google.gerrit.reviewdb.RefRight > getAllRights ( com.google.gerrit.reviewdb.ApprovalCategory.Id actionId ) { final java.util.List < com.google.gerrit.reviewdb.RefRight > allRefRights = filter ( getProjectState ( ) . getAllRights ( actionId , true ) ) ; return resolveOwnerGroups ( allRefRights ) ; }

Target:
private boolean matchGroup ( com.google.gerrit.reviewdb.AccountGroup.UUID uuid ) { java.util.Set < com.google.gerrit.reviewdb.AccountGroup.UUID > userGroups = getCurrentUser ( ) . getEffectiveGroups ( ) ; if ( AccountGroup.PROJECT_OWNERS.equals ( uuid ) ) { com.google.gerrit.server.project.ProjectState state = projectControl.getProjectState ( ) ; return com.google.gerrit.common.CollectionsUtil.isAnyIncludedIn ( state.getAllOwners ( ) , userGroups ) ; } else { return userGroups.contains ( uuid ) ; } }
Source:
private org.apache.lucene.search.Query fieldQuery ( com.google.gerrit.server.index.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > p ) throws com.google.gerrit.server.query.QueryParseException { if ( ( p.getType ( ) ) == ( com.google.gerrit.server.index.FieldType.INTEGER ) ) { return intQuery ( p ) ; } else if ( ( p.getType ( ) ) == ( com.google.gerrit.server.index.FieldType.EXACT ) ) { return exactQuery ( p ) ; } else { throw com.google.gerrit.lucene.LuceneChangeIndex.badFieldType ( p.getType ( ) ) ; } }

Target:
private org.apache.lucene.search.Query fieldQuery ( com.google.gerrit.server.index.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > p ) throws com.google.gerrit.server.query.QueryParseException { if ( ( p.getType ( ) ) == ( com.google.gerrit.server.index.FieldType.INTEGER ) ) { return intQuery ( p ) ; } else if ( ( p.getType ( ) ) == ( com.google.gerrit.server.index.FieldType.TIMESTAMP ) ) { return com.google.gerrit.lucene.LuceneChangeIndex.timestampQuery ( p ) ; } else if ( ( p.getType ( ) ) == ( com.google.gerrit.server.index.FieldType.EXACT ) ) { return exactQuery ( p ) ; } else { throw com.google.gerrit.lucene.LuceneChangeIndex.badFieldType ( p.getType ( ) ) ; } }
Source:
void insertPatchSetWithoutBatchUpdate ( ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException , java.io.IOException { try ( com.google.gerrit.server.git.BatchUpdate bu = batchUpdateFactory.create ( db , projectControl.getProject ( ) . getNameKey ( ) , user , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; org.eclipse.jgit.lib.ObjectInserter ins = repo.newObjectInserter ( ) ) { bu.setRepository ( repo , rp.getRevWalk ( ) , ins ) ; addOps ( bu ) ; bu.execute ( ) ; } }

Target:
void insertPatchSetWithoutBatchUpdate ( ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException , java.io.IOException { try ( com.google.gerrit.server.git.BatchUpdate bu = batchUpdateFactory.create ( db , projectControl.getProject ( ) . getNameKey ( ) , user , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; org.eclipse.jgit.lib.ObjectInserter ins = repo.newObjectInserter ( ) ) { bu.setRepository ( repo , rp.getRevWalk ( ) , ins ) ; addOps ( bu , replaceProgress ) ; bu.execute ( ) ; } }
Source:
public boolean isIdentityTrustable ( final java.util.Collection < com.google.gerrit.reviewdb.AccountExternalId > ids ) { switch ( getAuthType ( ) ) { case DEVELOPMENT_BECOME_ANY_ACCOUNT : case HTTP : case HTTP_LDAP : case LDAP : case LDAP_BIND : case CLIENT_SSL_CERT_LDAP : return true ; case OPENID : for ( final com.google.gerrit.reviewdb.AccountExternalId e : ids ) { if ( ! ( isTrusted ( e ) ) ) { return false ; } } return true ; default : return false ; } }

Target:
public boolean isIdentityTrustable ( final java.util.Collection < com.google.gerrit.reviewdb.AccountExternalId > ids ) { switch ( getAuthType ( ) ) { case DEVELOPMENT_BECOME_ANY_ACCOUNT : case HTTP : case HTTP_LDAP : case LDAP : case LDAP_BIND : case CLIENT_SSL_CERT_LDAP : case CUSTOM_EXTENSION : return true ; case OPENID : for ( final com.google.gerrit.reviewdb.AccountExternalId e : ids ) { if ( ! ( isTrusted ( e ) ) ) { return false ; } } return true ; default : return false ; } }
Source:
public void onFailure ( java.lang.Throwable reason ) { new com.google.gerrit.client.ErrorDialog ( reason ) . center ( ) ; }

Target:
public final void onFailure ( java.lang.Throwable reason ) { if ( ( ! ( isReloadUi ) ) && ( "HTTP download failed with status 404" . equals ( reason.getMessage ( ) ) ) ) { com.google.gerrit.client.Gerrit.upgradeUI ( token ) ; } else { new com.google.gerrit.client.ErrorDialog ( reason ) . center ( ) ; } }
Source:
private java.lang.String getSettingsUrl ( ) { if ( ( getGerritUrl ( ) ) != null ) { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( getGerritUrl ( ) ) ; r.append ( "settings" ) ; return r.toString ( ) ; } return null ; }

Target:
protected void setupVelocityContext ( ) { super . setupVelocityContext ( ) ; velocityContext.put ( "change" , change ) ; velocityContext.put ( "branch" , change.getDest ( ) ) ; velocityContext.put ( "projectName" , projectName ) ; velocityContext.put ( "patchSet" , patchSet ) ; velocityContext.put ( "patchSetInfo" , patchSetInfo ) ; }
Source:
com.google.common.util.concurrent.ListeningExecutorService getBatchIndexExecutor ( @ com.google.gerrit.server.index.IndexExecutor ( value = com.google.gerrit.server.git.QueueProvider.QueueType.INTERACTIVE ) com.google.common.util.concurrent.ListeningExecutorService interactive , @ com.google.gerrit.server.config.GerritServerConfig org.eclipse.jgit.lib.Config config , com.google.gerrit.server.git.WorkQueue workQueue ) { if ( ( batchExecutor ) != null ) { return batchExecutor ; } int threads = config.getInt ( "index" , null , "batchThreads" , 0 ) ; if ( threads <= 0 ) { threads = config.getInt ( "changeMerge" , null , "threadPoolSize" , 0 ) ; } if ( threads <= 0 ) { return interactive ; } return com.google.common.util.concurrent.MoreExecutors.listeningDecorator ( workQueue.createQueue ( threads , "Index-Batch" ) ) ; }

Target:
com.google.common.util.concurrent.ListeningExecutorService getBatchIndexExecutor ( @ com.google.gerrit.server.config.GerritServerConfig org.eclipse.jgit.lib.Config config , com.google.gerrit.server.git.WorkQueue workQueue ) { if ( ( batchExecutor ) != null ) { return batchExecutor ; } int threads = config.getInt ( "index" , null , "batchThreads" , 0 ) ; if ( threads <= 0 ) { threads = config.getInt ( "changeMerge" , null , "threadPoolSize" , 0 ) ; } if ( threads <= 0 ) { threads = java.lang.Runtime.getRuntime ( ) . availableProcessors ( ) ; } return com.google.common.util.concurrent.MoreExecutors.listeningDecorator ( workQueue.createQueue ( threads , "Index-Batch" ) ) ; }
Source:
protected com.google.gerrit.extensions.common.RobotCommentInfo toInfo ( com.google.gerrit.reviewdb.client.RobotComment c , com.google.gerrit.server.account.AccountLoader loader ) { com.google.gerrit.extensions.common.RobotCommentInfo rci = new com.google.gerrit.extensions.common.RobotCommentInfo ( ) ; rci.robotId = c.robotId ; rci.robotRunId = c.robotRunId ; rci.url = c.url ; fillCommentInfo ( c , rci , loader ) ; return rci ; }

Target:
protected com.google.gerrit.extensions.common.RobotCommentInfo toInfo ( com.google.gerrit.reviewdb.client.RobotComment c , com.google.gerrit.server.account.AccountLoader loader ) { com.google.gerrit.extensions.common.RobotCommentInfo rci = new com.google.gerrit.extensions.common.RobotCommentInfo ( ) ; rci.robotId = c.robotId ; rci.robotRunId = c.robotRunId ; rci.url = c.url ; rci.properties = c.properties ; fillCommentInfo ( c , rci , loader ) ; return rci ; }
Source:
protected void configure ( ) { final java.lang.String cacheName = WebSessionManager.CACHE_NAME ; final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.httpd.WebSessionManager.Key , com.google.gerrit.httpd.WebSessionManager.Val > > type = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.httpd.WebSessionManager.Key , com.google.gerrit.httpd.WebSessionManager.Val > > ( ) { } ; disk ( type , cacheName ) . memoryLimit ( 1024 ) . maxAge ( 12 , java.util.concurrent.TimeUnit.HOURS ) . evictionPolicy ( EvictionPolicy.LRU ) ; bind ( com.google.gerrit.httpd.WebSessionManager.class ) ; bind ( com.google.gerrit.httpd.WebSession.class ) . in ( com.google.inject.servlet.RequestScoped.class ) ; }

Target:
protected void configure ( ) { final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.reviewdb.ActiveSession.Key , com.google.gerrit.reviewdb.ActiveSession > > type = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < com.google.gerrit.reviewdb.ActiveSession.Key , com.google.gerrit.reviewdb.ActiveSession > > ( ) { } ; core ( type , com.google.gerrit.httpd.WebSession.CACHE_NAME ) . memoryLimit ( 1024 ) . maxAge ( 12 , java.util.concurrent.TimeUnit.HOURS ) . evictionPolicy ( EvictionPolicy.LRU ) ; bind ( com.google.gerrit.httpd.WebSession.class ) . in ( com.google.inject.servlet.RequestScoped.class ) ; bind ( com.google.gerrit.httpd.WebSession.KeyGenerator.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; }
Source:
private static boolean isStateChange ( javax.servlet.http.HttpServletRequest req ) { return ! ( com.google.gerrit.httpd.restapi.RestApiServlet.isGetOrHead ( req ) ) ; }

Target:
private static boolean isCorsPreflight ( javax.servlet.http.HttpServletRequest req ) { return ( ( "OPTIONS" . equals ( req.getMethod ( ) ) ) && ( ! ( com.google.common.base.Strings.isNullOrEmpty ( req.getHeader ( com.google.common.net.HttpHeaders.ORIGIN ) ) ) ) ) && ( ! ( com.google.common.base.Strings.isNullOrEmpty ( req.getHeader ( com.google.common.net.HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD ) ) ) ) ; }
Source:
public void testGetIssuePatternNullMatchWCommentLink ( ) { com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "ItsTestName" , null , "commentlink" ) ) . andReturn ( "foo" ) . atLeastOnce ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "commentlink" , "foo" , "match" ) ) . andReturn ( null ) . atLeastOnce ( ) ; replayMocks ( ) ; assertNull ( "Pattern for null match is not null" , itsConfig.getIssuePattern ( ) ) ; }

Target:
public void testGetIssuePatternNullMatchWCommentLink ( ) { com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "plugin" , "ItsTestName" , "commentlink" ) ) . andReturn ( "foo" ) . atLeastOnce ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "commentlink" , "foo" , "match" ) ) . andReturn ( null ) . atLeastOnce ( ) ; replayMocks ( ) ; assertNull ( "Pattern for null match is not null" , itsConfig.getIssuePattern ( ) ) ; }
Source:
protected com.google.gerrit.common.data.ProjectAccess updateProjectConfig ( com.google.gerrit.server.git.ProjectConfig config , com.google.gerrit.server.git.MetaDataUpdate md , boolean parentProjectUpdate ) throws com.google.gerrit.server.project.NoSuchProjectException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.revwalk.RevCommit commit = config.commit ( md ) ; hooks.doRefUpdatedHook ( new com.google.gerrit.reviewdb.client.Branch.NameKey ( config.getProject ( ) . getNameKey ( ) , com.google.gerrit.reviewdb.client.RefNames.REFS_CONFIG ) , base , commit.getId ( ) , user.getAccount ( ) ) ; projectCache.evict ( config.getProject ( ) ) ; return projectAccessFactory.create ( projectName ) . call ( ) ; }

Target:
protected com.google.gerrit.common.data.ProjectAccess updateProjectConfig ( com.google.gerrit.server.project.ProjectControl ctl , com.google.gerrit.server.git.ProjectConfig config , com.google.gerrit.server.git.MetaDataUpdate md , boolean parentProjectUpdate ) throws com.google.gerrit.server.project.NoSuchProjectException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.revwalk.RevCommit commit = config.commit ( md ) ; hooks.doRefUpdatedHook ( new com.google.gerrit.reviewdb.client.Branch.NameKey ( config.getProject ( ) . getNameKey ( ) , com.google.gerrit.reviewdb.client.RefNames.REFS_CONFIG ) , base , commit.getId ( ) , user.getAccount ( ) ) ; projectCache.evict ( config.getProject ( ) ) ; return projectAccessFactory.create ( projectName ) . call ( ) ; }
Source:
public void testRemoveSingleHashtag ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; addHashtags ( r , "tag1" ) ; assertThatGet ( r ) . containsExactly ( "tag1" ) ; removeHashtags ( r , "tag1" ) ; assertThatGet ( r ) . isEmpty ( ) ; addHashtags ( r , "tag1" , "tag2" , "tag3" ) ; removeHashtags ( r , "tag2" ) ; assertThatGet ( r ) . containsExactly ( "tag1" , "tag3" ) . inOrder ( ) ; }

Target:
public void testRemoveSingleHashtag ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; addHashtags ( r , "tag1" ) ; assertThatGet ( r ) . containsExactly ( "tag1" ) ; removeHashtags ( r , "tag1" ) ; assertThatGet ( r ) . isEmpty ( ) ; assertMessage ( r , "Hashtag removed: tag1" ) ; addHashtags ( r , "tag1" , "tag2" , "tag3" ) ; removeHashtags ( r , "tag2" ) ; assertThatGet ( r ) . containsExactly ( "tag1" , "tag3" ) . inOrder ( ) ; assertMessage ( r , "Hashtag removed: tag2" ) ; }
Source:
public java.lang.Iterable < com.google.gerrit.server.WebLinks.Link > getProjectLinks ( java.lang.String project ) { java.util.List < com.google.gerrit.server.WebLinks.Link > links = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.extensions.webui.ProjectWebLink webLink : projectLinks ) { links.add ( new com.google.gerrit.server.WebLinks.Link ( webLink.getLinkName ( ) , webLink.getProjectUrl ( project ) ) ) ; } return links ; }

Target:
public java.lang.Iterable < com.google.gerrit.extensions.common.WebLinkInfo > getProjectLinks ( java.lang.String project ) { java.util.List < com.google.gerrit.extensions.common.WebLinkInfo > links = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.extensions.webui.ProjectWebLink webLink : projectLinks ) { links.add ( new com.google.gerrit.extensions.common.WebLinkInfo ( webLink.getLinkName ( ) , webLink.getImageUrl ( ) , webLink.getProjectUrl ( project ) ) ) ; } return links ; }
Source:
private org.eclipse.jgit.lib.PersonIdent newAuthorIdent ( ) { com.google.gerrit.server.CurrentUser u = getUser ( ) ; if ( u instanceof com.google.gerrit.server.IdentifiedUser ) { return noteUtil.newIdent ( u.asIdentifiedUser ( ) . getAccount ( ) , when , serverIdent , anonymousCowardName ) ; } else if ( u instanceof com.google.gerrit.server.InternalUser ) { return serverIdent ; } throw new java.lang.IllegalStateException ( ) ; }

Target:
public com.google.gerrit.server.notedb.ChangeNotes getNotes ( ) { return notes ; }
Source:
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 ( ) ; }

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 , com.google.gerrit.server.mail.receive.CHANGE_URL ) ; com.google.common.truth.Truth.assertThat ( parsedComments ) . isEmpty ( ) ; }
Source:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { final java.lang.String txt = descTxt.getText ( ) . trim ( ) ; Util.GROUP_SVC.changeGroupDescription ( getGroupId ( ) , txt , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.common.VoidResult > ( ) { public void onSuccess ( final com.google.gwtjsonrpc.common.VoidResult result ) { saveDesc.setEnabled ( false ) ; } } ) ; }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { final java.lang.String txt = descTxt.getText ( ) . trim ( ) ; com.google.gerrit.client.groups.GroupApi.setGroupDescription ( getGroupUUID ( ) , txt , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.common.com.google.gerrit.client.VoidResult > ( ) { public void onSuccess ( final com.google.gwtjsonrpc.common.com.google.gerrit.client.VoidResult result ) { saveDesc.setEnabled ( false ) ; } } ) ; }
Source:
public void cleanupIndex ( ) { com.google.gerrit.elasticsearch.ElasticQueryChangesTest.node.client ( ) . admin ( ) . indices ( ) . prepareDelete ( com.google.gerrit.elasticsearch.ElasticQueryChangesTest.INDEX_NAME ) . execute ( ) ; com.google.gerrit.elasticsearch.ElasticQueryChangesTest.createIndexes ( ) ; }

Target:
private static void createIndexes ( ) { com.google.gerrit.elasticsearch.ElasticChangeIndex.ChangeMapping openChangesMapping = new com.google.gerrit.elasticsearch.ElasticChangeIndex.ChangeMapping ( ChangeSchemaDefinitions.INSTANCE.getLatest ( ) ) ; com.google.gerrit.elasticsearch.ElasticChangeIndex.ChangeMapping closedChangesMapping = new com.google.gerrit.elasticsearch.ElasticChangeIndex.ChangeMapping ( ChangeSchemaDefinitions.INSTANCE.getLatest ( ) ) ; openChangesMapping.closedChanges = null ; closedChangesMapping.openChanges = null ; com.google.gerrit.elasticsearch.ElasticQueryChangesTest.nodeInfo.node.client ( ) . admin ( ) . indices ( ) . prepareCreate ( com.google.gerrit.elasticsearch.ElasticQueryChangesTest.INDEX_NAME ) . addMapping ( com.google.gerrit.elasticsearch.ElasticChangeIndex.OPEN_CHANGES , ElasticTestUtils.gson.toJson ( openChangesMapping ) ) . addMapping ( com.google.gerrit.elasticsearch.ElasticChangeIndex.CLOSED_CHANGES , ElasticTestUtils.gson.toJson ( closedChangesMapping ) ) . execute ( ) . actionGet ( ) ; }
Source:
protected void renderTextError ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , int statusCode , java.lang.String message ) throws java.io.IOException { res.setStatus ( statusCode ) ; setApiHeaders ( res , com.google.gitiles.FormatType.TEXT ) ; setCacheHeaders ( res ) ; java.io.PrintWriter out = res.getWriter ( ) ; out.write ( message ) ; out.close ( ) ; }

Target:
protected void renderTextError ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , int statusCode , java.lang.String message ) throws java.io.IOException { res.setStatus ( statusCode ) ; setApiHeaders ( res , com.google.gitiles.FormatType.TEXT ) ; setCacheHeaders ( res ) ; java.io.Writer out = getWriter ( res ) ; out.write ( message ) ; out.close ( ) ; }
Source:
public void fire ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet ps , com.google.gerrit.reviewdb.client.Account restorer , java.lang.String reason ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } try { fire ( util.changeInfo ( change ) , util.revisionInfo ( change.getProject ( ) , ps ) , util.accountInfo ( restorer ) , reason ) ; } catch ( com.google.gerrit.server.patch.PatchListNotAvailableException | com.google.gerrit.server.GpgException | java.io.IOException | com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.extensions.events.ChangeRestored.log.error ( "Couldn't fire event" , e ) ; } }

Target:
public void fire ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet ps , com.google.gerrit.reviewdb.client.Account restorer , java.lang.String reason , java.sql.Timestamp when ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } try { fire ( util.changeInfo ( change ) , util.revisionInfo ( change.getProject ( ) , ps ) , util.accountInfo ( restorer ) , reason , when ) ; } catch ( com.google.gerrit.server.patch.PatchListNotAvailableException | com.google.gerrit.server.GpgException | java.io.IOException | com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.extensions.events.ChangeRestored.log.error ( "Couldn't fire event" , e ) ; } }
Source:
public void testAsText ( ) throws java.lang.Exception { java.lang.String expectedText = ( ( com.google.gerrit.server.git.QueryListTest.HEADER ) + "#\n" ) + ( com.google.gerrit.server.git.QueryListTest.F_PROPER ) ; com.google.gerrit.server.git.QueryList ql = com.google.gerrit.server.git.QueryList.parse ( com.google.gerrit.server.git.QueryListTest.F_SIMPLE , null ) ; java.lang.String asText = ql.asText ( ) ; com.google.common.truth.Truth.assertThat ( asText ) . isEqualTo ( expectedText ) ; ql = com.google.gerrit.server.git.QueryList.parse ( asText , null ) ; asText = ql.asText ( ) ; com.google.common.truth.Truth.assertThat ( asText ) . isEqualTo ( expectedText ) ; }

Target:
public void testAsText ( ) throws java.lang.Exception { java.lang.String expectedText = ( ( com.google.gerrit.server.account.QueryListTest.HEADER ) + "#\n" ) + ( com.google.gerrit.server.account.QueryListTest.F_PROPER ) ; com.google.gerrit.server.account.QueryList ql = com.google.gerrit.server.account.QueryList.parse ( com.google.gerrit.server.account.QueryListTest.F_SIMPLE , null ) ; java.lang.String asText = ql.asText ( ) ; com.google.common.truth.Truth.assertThat ( asText ) . isEqualTo ( expectedText ) ; ql = com.google.gerrit.server.account.QueryList.parse ( asText , null ) ; asText = ql.asText ( ) ; com.google.common.truth.Truth.assertThat ( asText ) . isEqualTo ( expectedText ) ; }
Source:
public void testNoStripDotGit ( ) throws java.lang.Exception { assertRedirectsTo ( com.google.gitiles.GitilesView.repositoryIndex ( ) . setHostName ( com.google.gitiles.TestGitilesUrls.HOST_NAME ) . setServletPath ( com.google.gitiles.FakeHttpServletRequest.SERVLET_PATH ) . setRepositoryName ( "test.git" ) . toUrl ( ) , com.google.gitiles.GitwebRedirectFilterTest.newRequest ( "a=summary;p=test.git" ) ) ; assertRedirectsTo ( com.google.gitiles.GitilesView.repositoryIndex ( ) . setHostName ( com.google.gitiles.TestGitilesUrls.HOST_NAME ) . setServletPath ( com.google.gitiles.FakeHttpServletRequest.SERVLET_PATH ) . setRepositoryName ( "test" ) . toUrl ( ) , com.google.gitiles.GitwebRedirectFilterTest.newRequest ( "a=summary;p=test" ) ) ; }

Target:
public void noStripDotGit ( ) throws java.lang.Exception { assertRedirectsTo ( com.google.gitiles.GitilesView.repositoryIndex ( ) . setHostName ( com.google.gitiles.TestGitilesUrls.HOST_NAME ) . setServletPath ( com.google.gitiles.FakeHttpServletRequest.SERVLET_PATH ) . setRepositoryName ( "test.git" ) . toUrl ( ) , com.google.gitiles.GitwebRedirectFilterTest.newRequest ( "a=summary;p=test.git" ) ) ; assertRedirectsTo ( com.google.gitiles.GitilesView.repositoryIndex ( ) . setHostName ( com.google.gitiles.TestGitilesUrls.HOST_NAME ) . setServletPath ( com.google.gitiles.FakeHttpServletRequest.SERVLET_PATH ) . setRepositoryName ( "test" ) . toUrl ( ) , com.google.gitiles.GitwebRedirectFilterTest.newRequest ( "a=summary;p=test" ) ) ; }
Source:
com.google.gerrit.client.diff.DiffChunkInfo getFirst ( ) { if ( ! ( chunks.isEmpty ( ) ) ) { for ( com.google.gerrit.client.diff.DiffChunkInfo d : chunks ) { if ( ( d.getSide ( ) ) == ( DisplaySide.B ) ) { return d ; } } return chunks.get ( 0 ) ; } return null ; }

Target:
private static void focus ( com.google.gwt.dom.client.NativeEvent event , com.google.gerrit.client.diff.DisplaySide side ) { com.google.gwt.dom.client.Element e = com.google.gwt.dom.client.Element.as ( event.getEventTarget ( ) ) ; for ( e = com.google.gwt.user.client.DOM.getParent ( e ) ; e != null ; e = com.google.gwt.user.client.DOM.getParent ( e ) ) { com.google.gwt.user.client.EventListener l = com.google.gwt.user.client.DOM.getEventListener ( e ) ; if ( l instanceof com.google.gerrit.client.diff.SideBySide2 ) { ( ( com.google.gerrit.client.diff.SideBySide2 ) ( l ) ) . getCmFromSide ( side ) . focus ( ) ; event.stopPropagation ( ) ; } } }
Source:
protected java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > getActions ( java.lang.String changeId ) throws java.lang.Exception { return com.google.gerrit.acceptance.AbstractDaemonTest.newGson ( ) . fromJson ( adminSession.get ( ( ( "/changes/" + changeId ) + "/revisions/1/actions" ) ) . getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > > ( ) { } . getType ( ) ) ; }

Target:
protected java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > getActions ( java.lang.String id ) throws java.lang.Exception { return gApi.changes ( ) . id ( id ) . revision ( 1 ) . actions ( ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.info.ChangeInfo info ) { info.init ( ) ; addExtensionPoints ( info , initCurrentRevision ( info ) ) ; loadConfigInfo ( info , base ) ; }

Target:
public void onSuccess ( final com.google.gerrit.client.info.ChangeInfo info ) { info.init ( ) ; addExtensionPoints ( info , initCurrentRevision ( info ) ) ; com.google.gerrit.client.info.ChangeInfo.RevisionInfo rev = info.revision ( revision ) ; com.google.gerrit.client.rpc.CallbackGroup group = new com.google.gerrit.client.rpc.CallbackGroup ( ) ; loadCommit ( rev , group ) ; group.addListener ( new com.google.gerrit.client.rpc.GerritCallback < java.lang.Void > ( ) { @ java.lang.Override public void onSuccess ( java.lang.Void result ) { loadConfigInfo ( info , base ) ; } } ) ; group.done ( ) ; }