auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
void display ( final java.util.Map < com.google.gerrit.reviewdb.AccountGroup.Id , com.google.gerrit.reviewdb.AccountGroup > groups , final java.util.List < com.google.gerrit.reviewdb.RefRight > refRights ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.reviewdb.RefRight r : refRights ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , groups , r ) ; } }

Target:
void display ( final java.util.Map < com.google.gerrit.reviewdb.AccountGroup.Id , com.google.gerrit.reviewdb.AccountGroup > groups , final java.util.List < com.google.gerrit.common.data.InheritedRefRight > refRights ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.common.data.InheritedRefRight r : refRights ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , groups , r ) ; } }
Source:
void cleanup ( ) { try { jarFile.close ( ) ; } catch ( java.io.IOException err ) { } if ( ( ! ( tmpFile.delete ( ) ) ) && ( tmpFile.exists ( ) ) ) { PluginLoader.log.warn ( ( "Cannot delete " + ( tmpFile.getAbsolutePath ( ) ) ) ) ; } }

Target:
void cleanup ( ) { try { jarFile.close ( ) ; } catch ( java.io.IOException err ) { } if ( ( ! ( tmpFile.delete ( ) ) ) && ( tmpFile.exists ( ) ) ) { PluginLoader.log.warn ( ( "Cannot delete " + ( tmpFile.getAbsolutePath ( ) ) ) ) ; } else { PluginLoader.log.info ( ( "Cleaned plugin " + ( tmpFile.getName ( ) ) ) ) ; } }
Source:
public void updateSchema ( final com.google.gwtorm.client.StatementExecutor e ) throws com.google.gwtorm.client.OrmException { try { createSequences ( e ) ; createRelations ( e ) ; for ( final com.google.gwtorm.schema.RelationModel rel : dbDef.getSchemaModel ( ) . getRelations ( ) ) { addColumns ( e , rel ) ; } } catch ( java.sql.SQLException err ) { throw new com.google.gwtorm.client.OrmException ( "Cannot update schema" , err ) ; } }

Target:
public void updateSchema ( final com.google.gwtorm.server.StatementExecutor e ) throws com.google.gwtorm.server.OrmException { try { createSequences ( e ) ; createRelations ( e ) ; for ( final com.google.gwtorm.schema.RelationModel rel : dbDef.getSchemaModel ( ) . getRelations ( ) ) { addColumns ( e , rel ) ; } } catch ( java.sql.SQLException err ) { throw new com.google.gwtorm.server.OrmException ( "Cannot update schema" , err ) ; } }
Source:
public void execute ( ) { if ( ( cmA ) != null ) { cmA.setOption ( "viewportMargin" , 10 ) ; } if ( ( cmB ) != null ) { cmB.setOption ( "viewportMargin" , 10 ) ; } }

Target:
public void execute ( ) { int h = ( com.google.gerrit.client.Gerrit.getHeaderFooterHeight ( ) ) + ( reviewed.getOffsetHeight ( ) ) ; if ( ( cmA ) != null ) { cmA.setHeight ( ( ( com.google.gwt.user.client.Window.getClientHeight ( ) ) - h ) ) ; cmA.setOption ( "viewportMargin" , 10 ) ; } if ( ( cmB ) != null ) { cmB.setHeight ( ( ( com.google.gwt.user.client.Window.getClientHeight ( ) ) - h ) ) ; cmB.setOption ( "viewportMargin" , 10 ) ; } }
Source:
private void populateCommentAction ( ) { final com.google.gwt.user.client.ui.Button b = new com.google.gwt.user.client.ui.Button ( Util.C.buttonPublishCommentsBegin ( ) ) ; b.addClickHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { com.google.gerrit.client.Gerrit.display ( ( "change,publish," + ( patchSet.getId ( ) . toString ( ) ) ) , new com.google.gerrit.client.changes.PublishCommentScreen ( patchSet.getId ( ) ) ) ; } } ) ; actionsPanel.add ( b ) ; }

Target:
private void populateReviewAction ( ) { final com.google.gwt.user.client.ui.Button b = new com.google.gwt.user.client.ui.Button ( Util.C.buttonReview ( ) ) ; b.addClickHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { com.google.gerrit.client.Gerrit.display ( ( "change,publish," + ( patchSet.getId ( ) . toString ( ) ) ) , new com.google.gerrit.client.changes.PublishCommentScreen ( patchSet.getId ( ) ) ) ; } } ) ; actionsPanel.add ( b ) ; }
Source:
public com.google.gerrit.server.account.AccountInfo get ( com.google.gerrit.reviewdb.client.Account.Id id ) { if ( id == null ) { return null ; } com.google.gerrit.server.account.AccountInfo info = created.get ( id ) ; if ( info == null ) { info = new com.google.gerrit.server.account.AccountInfo ( id ) ; if ( detailed ) { info._account_id = id.get ( ) ; } created.put ( id , info ) ; } return info ; }

Target:
public com.google.gerrit.server.account.AccountInfo get ( com.google.gerrit.reviewdb.client.Account.Id id ) { if ( id == null ) { return null ; } com.google.gerrit.server.account.AccountInfo info = created.get ( id ) ; if ( info == null ) { info = new com.google.gerrit.server.account.AccountInfo ( id ) ; if ( detailed ) { info._accountId = id.get ( ) ; } created.put ( id , info ) ; } return info ; }
Source:
public com.google.gwtorm.server.ResultSet < com.google.gerrit.server.query.change.ChangeData > read ( ) throws com.google.gwtorm.server.OrmException { if ( java.lang.Thread.interrupted ( ) ) { java.lang.Thread.currentThread ( ) . interrupt ( ) ; throw new com.google.gwtorm.server.OrmException ( "interupted" ) ; } return new com.google.gerrit.lucene.LuceneChangeIndex.ChangeDataResults ( executor.submit ( new java.util.concurrent.Callable < java.util.List < org.apache.lucene.document.Document > > ( ) { @ java.lang.Override public java.util.List < org.apache.lucene.document.Document > call ( ) throws com.google.gwtorm.server.OrmException { return doRead ( ) ; } } ) ) ; }

Target:
public java.lang.String toString ( ) { return predicate.toString ( ) ; }
Source:
protected void deny ( java.lang.String permission , com.google.gerrit.reviewdb.client.AccountGroup.UUID id , java.lang.String ref ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.server.project.Util.deny ( cfg , permission , id , ref ) ; saveProjectConfig ( project , cfg ) ; }

Target:
protected PushOneCommit.Result amendChange ( java.lang.String changeId , java.lang.String ref ) throws java.lang.Exception { return amendChange ( changeId , ref , admin , testRepo ) ; }
Source:
public void rescan ( boolean forceCleanup ) { if ( ( rescanImp ( ) ) || forceCleanup ) { java.lang.System.gc ( ) ; processPendingCleanups ( ) ; } }

Target:
private void cleanInBackground ( ) { int cnt = java.lang.Math.max ( 0 , ( ( cleanupHandles.size ( ) ) - ( running.size ( ) ) ) ) ; if ( 0 < cnt ) { cleaner.get ( ) . clean ( cnt ) ; } }
Source:
private void assertParseFails ( org.eclipse.jgit.revwalk.RevCommit commit ) throws java.lang.Exception { try ( com.google.gerrit.server.notedb.ChangeNotesParser parser = newParser ( commit ) ) { exception.expect ( org.eclipse.jgit.errors.ConfigInvalidException.class ) ; parser.parseAll ( ) ; } }

Target:
private void assertParseFails ( org.eclipse.jgit.revwalk.RevCommit commit ) throws java.lang.Exception { try ( com.google.gerrit.server.notedb.ChangeNotesParser parser = newParser ( commit ) ) { parser.parseAll ( ) ; org.junit.Assert.fail ( ( "Expected parse to fail:\n" + ( commit.getFullMessage ( ) ) ) ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException e ) { } }
Source:
void set ( com.google.gerrit.client.info.ChangeInfo info ) { this . changeId = info.legacyId ( ) ; display ( info ) ; reviewerSuggestOracle.setChange ( changeId ) ; addReviewerIcon.setVisible ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ; }

Target:
void set ( com.google.gerrit.client.info.ChangeInfo info ) { this . changeId = info.legacyId ( ) ; this . project = info.projectNameKey ( ) ; display ( info ) ; reviewerSuggestOracle.setChange ( project , changeId ) ; addReviewerIcon.setVisible ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; final com.google.gerrit.common.data.ApprovalTypes types = new com.google.gerrit.common.data.ApprovalTypes ( java.util.Arrays.asList ( com.google.gerrit.rules.GerritCommonTest.codeReviewCategory ( ) , com.google.gerrit.rules.GerritCommonTest.verifiedCategory ( ) ) ) ; load ( "gerrit_common_test.pl" , new com.google.inject.AbstractModule ( ) { @ java.lang.Override protected void configure ( ) { bind ( com.google.gerrit.common.data.ApprovalTypes.class ) . toInstance ( types ) ; } } ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; final com.google.gerrit.common.data.ApprovalTypes types = new com.google.gerrit.common.data.ApprovalTypes ( java.util.Arrays.asList ( com.google.gerrit.rules.GerritCommonTest.codeReviewCategory ( ) , com.google.gerrit.rules.GerritCommonTest.verifiedCategory ( ) ) ) ; load ( "gerrit" , "gerrit_common_test.pl" , new com.google.inject.AbstractModule ( ) { @ java.lang.Override protected void configure ( ) { bind ( com.google.gerrit.common.data.ApprovalTypes.class ) . toInstance ( types ) ; } } ) ; }
Source:
public java.util.Collection < com.google.gerrit.reviewdb.PatchSetApproval > currentApprovals ( com.google.inject.Provider < com.google.gerrit.reviewdb.ReviewDb > db ) throws com.google.gwtorm.client.OrmException { com.google.gerrit.reviewdb.Change c = change ( db ) ; if ( c == null ) { return java.util.Collections.emptyList ( ) ; } return approvalsFor ( db , c.currentPatchSetId ( ) ) ; }

Target:
public java.util.Collection < com.google.gerrit.reviewdb.PatchSetApproval > currentApprovals ( com.google.inject.Provider < com.google.gerrit.reviewdb.ReviewDb > db ) throws com.google.gwtorm.client.OrmException { if ( ( currentApprovals ) == null ) { com.google.gerrit.reviewdb.Change c = change ( db ) ; if ( c == null ) { currentApprovals = java.util.Collections.emptyList ( ) ; } else { currentApprovals = approvalsFor ( db , c.currentPatchSetId ( ) ) ; } } return currentApprovals ; }
Source:
protected void onRequestSuggestions ( com.google.gerrit.client.ui.Request req , com.google.gerrit.client.ui.Callback cb ) { if ( ( req.getQuery ( ) . length ( ) ) >= ( com.google.gerrit.client.Gerrit.getConfig ( ) . getSuggestFrom ( ) ) ) { _onRequestSuggestions ( req , cb ) ; } else { java.util.List < com.google.gerrit.client.ui.Suggestion > none = java.util.Collections.emptyList ( ) ; cb.onSuggestionsReady ( req , new com.google.gerrit.client.ui.Response ( none ) ) ; } }

Target:
protected void onRequestSuggestions ( com.google.gerrit.client.ui.Request req , com.google.gerrit.client.ui.Callback cb ) { if ( ( req.getQuery ( ) . length ( ) ) >= ( com.google.gerrit.client.Gerrit.info ( ) . suggest ( ) . from ( ) ) ) { _onRequestSuggestions ( req , cb ) ; } else { java.util.List < com.google.gerrit.client.ui.Suggestion > none = java.util.Collections.emptyList ( ) ; cb.onSuggestionsReady ( req , new com.google.gerrit.client.ui.Response ( none ) ) ; } }
Source:
private void addPermission ( final java.lang.String permissionName , final java.util.List < java.lang.String > permissionList ) { if ( ( value.getPermission ( permissionName ) ) != null ) { return ; } if ( ( com.google.gerrit.client.Gerrit.getConfig ( ) . getWildProject ( ) . equals ( projectAccess.getProjectName ( ) ) ) && ( ! ( com.google.gerrit.common.data.Permission.canBeOnAllProjects ( value.getName ( ) , permissionName ) ) ) ) { return ; } permissionList.add ( permissionName ) ; }

Target:
private void addPermission ( final java.lang.String permissionName , final java.util.List < java.lang.String > permissionList ) { if ( ( value.getPermission ( permissionName ) ) != null ) { return ; } if ( ( com.google.gerrit.client.Gerrit.info ( ) . gerrit ( ) . isAllProjects ( projectAccess.getProjectName ( ) ) ) && ( ! ( com.google.gerrit.common.data.Permission.canBeOnAllProjects ( value.getName ( ) , permissionName ) ) ) ) { return ; } permissionList.add ( permissionName ) ; }
Source:
public void setParent_Forbidden ( ) throws com.jcraft.jsch.JSchException , java.io.IOException { java.lang.String parent = "parent" ; com.google.gerrit.acceptance.git.GitUtil.createProject ( sshSession , parent , null , true ) ; com.google.gerrit.acceptance.RestResponse r = userSession.put ( ( ( "/projects/" + ( project ) ) + "/parent" ) , new com.google.gerrit.acceptance.rest.project.SetParentIT.ParentInput ( parent ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_FORBIDDEN , r.getStatusCode ( ) ) ; r.consume ( ) ; }

Target:
public void setParent_Forbidden ( ) throws com.jcraft.jsch.JSchException , java.io.IOException { java.lang.String parent = "parent" ; com.google.gerrit.acceptance.GitUtil.createProject ( sshSession , parent , null , true ) ; com.google.gerrit.acceptance.RestResponse r = userSession.put ( ( ( "/projects/" + ( project ) ) + "/parent" ) , new com.google.gerrit.acceptance.rest.project.SetParentIT.ParentInput ( parent ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_FORBIDDEN , r.getStatusCode ( ) ) ; r.consume ( ) ; }
Source:
void setCmdLineParser ( com.google.gerrit.util.cli.CmdLineParser clp ) { this . clp = clp ; }

Target:
void addHashtag ( java.lang.String token ) throws org.kohsuke.args4j.CmdLineException { if ( ! ( notesMigration.readChanges ( ) ) ) { throw clp.reject ( "cannot add hashtags; noteDb is disabled" ) ; } java.lang.String hashtag = com.google.gerrit.server.change.HashtagsUtil.cleanupHashtag ( token ) ; if ( ! ( hashtag.isEmpty ( ) ) ) { hashtags.add ( hashtag ) ; } }
Source:
private void initIgnoreWhitespace ( com.google.gwt.user.client.ui.ListBox ws ) { ws.addItem ( PatchUtil.C.whitespaceIGNORE_NONE ( ) , Whitespace.IGNORE_NONE.name ( ) ) ; ws.addItem ( PatchUtil.C.whitespaceIGNORE_SPACE_AT_EOL ( ) , Whitespace.IGNORE_SPACE_AT_EOL.name ( ) ) ; ws.addItem ( PatchUtil.C.whitespaceIGNORE_SPACE_CHANGE ( ) , Whitespace.IGNORE_SPACE_CHANGE.name ( ) ) ; ws.addItem ( PatchUtil.C.whitespaceIGNORE_ALL_SPACE ( ) , Whitespace.IGNORE_ALL_SPACE.name ( ) ) ; }

Target:
private void initIgnoreWhitespace ( com.google.gwt.user.client.ui.ListBox ws ) { ws.addItem ( PatchUtil.C.whitespaceIGNORE_NONE ( ) , Whitespace.IGNORE_NONE.name ( ) ) ; ws.addItem ( PatchUtil.C.whitespaceIGNORE_TRAILING ( ) , Whitespace.IGNORE_TRAILING.name ( ) ) ; ws.addItem ( PatchUtil.C.whitespaceIGNORE_LEADING_AND_TRAILING ( ) , Whitespace.IGNORE_LEADING_AND_TRAILING.name ( ) ) ; ws.addItem ( PatchUtil.C.whitespaceIGNORE_ALL ( ) , Whitespace.IGNORE_ALL.name ( ) ) ; }
Source:
private com.google.gerrit.extensions.api.changes.AddReviewerResult putAccount ( java.lang.String reviewer , com.google.gerrit.server.change.ReviewerResource rsrc ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Account member = rsrc.getReviewerUser ( ) . getAccount ( ) ; com.google.gerrit.server.project.ChangeControl control = rsrc.getReviewerControl ( ) ; com.google.gerrit.extensions.api.changes.AddReviewerResult result = new com.google.gerrit.extensions.api.changes.AddReviewerResult ( reviewer ) ; if ( isValidReviewer ( member , control ) ) { addReviewers ( rsrc.getChangeResource ( ) , result , com.google.common.collect.ImmutableMap.of ( member.getId ( ) , control ) ) ; } return result ; }

Target:
private com.google.gerrit.extensions.api.changes.AddReviewerResult putAccount ( java.lang.String reviewer , com.google.gerrit.server.change.ReviewerResource rsrc , com.google.gerrit.extensions.client.ReviewerState state ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Account member = rsrc.getReviewerUser ( ) . getAccount ( ) ; com.google.gerrit.server.project.ChangeControl control = rsrc.getReviewerControl ( ) ; com.google.gerrit.extensions.api.changes.AddReviewerResult result = new com.google.gerrit.extensions.api.changes.AddReviewerResult ( reviewer ) ; if ( isValidReviewer ( member , control ) ) { addReviewers ( rsrc.getChangeResource ( ) , result , com.google.common.collect.ImmutableMap.of ( member.getId ( ) , control ) , state ) ; } return result ; }
Source:
static com.google.gerrit.reviewdb.server.ReviewDb unwrap ( com.google.gerrit.reviewdb.server.ReviewDb db ) { if ( db instanceof com.google.gerrit.server.git.BatchUpdateReviewDb ) { db = ( ( com.google.gerrit.server.git.BatchUpdateReviewDb ) ( db ) ) . unsafeGetDelegate ( ) ; } if ( db instanceof com.google.gerrit.server.schema.DisabledChangesReviewDbWrapper ) { db = ( ( com.google.gerrit.server.schema.DisabledChangesReviewDbWrapper ) ( db ) ) . unsafeGetDelegate ( ) ; } return db ; }

Target:
static com.google.gerrit.reviewdb.server.ReviewDb unwrap ( com.google.gerrit.reviewdb.server.ReviewDb db ) { if ( db instanceof com.google.gerrit.server.git.BatchUpdateReviewDb ) { db = ( ( com.google.gerrit.server.git.BatchUpdateReviewDb ) ( db ) ) . unsafeGetDelegate ( ) ; } return com.google.gerrit.reviewdb.server.ReviewDbUtil.unwrapDb ( db ) ; }
Source:
public java.lang.Boolean call ( ) throws com.google.gerrit.server.permissions.PermissionBackendException , com.google.gerrit.server.project.NoSuchProjectException { com.google.gerrit.server.project.ProjectControl projectControl = controlFor ( project ) ; return ( shouldReplicate ( projectControl ) ) && ( ( PushOne.ALL_REFS.equals ( ref ) ) || ( projectControl.controlForRef ( ref ) . isVisible ( ) ) ) ; }

Target:
public java.lang.Boolean call ( ) throws com.google.gerrit.server.permissions.PermissionBackendException , com.google.gerrit.server.project.NoSuchProjectException { com.google.gerrit.server.project.ProjectControl projectControl = controlFor ( project ) ; if ( ! ( shouldReplicate ( projectControl ) ) ) { return false ; } if ( PushOne.ALL_REFS.equals ( ref ) ) { return true ; } try { permissionBackend.user ( projectControl.getUser ( ) ) . project ( project ) . ref ( ref ) . check ( RefPermission.READ ) ; } catch ( com.google.gerrit.extensions.restapi.AuthException e ) { return false ; } return true ; }
Source:
private synchronized void runHook ( com.google.gerrit.reviewdb.client.Project.NameKey project , java.nio.file.Path hook , java.util.List < java.lang.String > args ) { if ( ( project != null ) && ( java.nio.file.Files.exists ( hook ) ) ) { hookQueue.execute ( new com.google.gerrit.common.ChangeHookRunner.AsyncHookTask ( project , hook , args ) ) ; } }

Target:
private synchronized void runHook ( com.google.common.base.Optional < java.nio.file.Path > hook , java.util.List < java.lang.String > args ) { if ( hook.isPresent ( ) ) { hookQueue.execute ( new com.google.gerrit.common.ChangeHookRunner.AsyncHookTask ( null , hook.get ( ) , args ) ) ; } }
Source:
void select ( ) { com.google.gerrit.client.download.DownloadCommandPanel parent = ( ( com.google.gerrit.client.download.DownloadCommandPanel ) ( getParent ( ) ) ) ; for ( com.google.gwt.user.client.ui.Widget w : parent ) { if ( ( w != ( this ) ) && ( w instanceof com.google.gerrit.client.download.DownloadCommandLink ) ) { w.removeStyleName ( Gerrit.RESOURCES.css ( ) . downloadLink_Active ( ) ) ; } } parent.setCurrentCommand ( this ) ; addStyleName ( Gerrit.RESOURCES.css ( ) . downloadLink_Active ( ) ) ; }

Target:
void select ( ) { copyLabel.setText ( command ) ; com.google.gerrit.client.download.DownloadCommandPanel parent = ( ( com.google.gerrit.client.download.DownloadCommandPanel ) ( getParent ( ) ) ) ; for ( com.google.gwt.user.client.ui.Widget w : parent ) { if ( ( w != ( this ) ) && ( w instanceof com.google.gerrit.client.download.DownloadCommandLink ) ) { w.removeStyleName ( Gerrit.RESOURCES.css ( ) . downloadLink_Active ( ) ) ; } } parent.setCurrentCommand ( this ) ; addStyleName ( Gerrit.RESOURCES.css ( ) . downloadLink_Active ( ) ) ; }
Source:
public void missingGroupNameRef ( ) throws java.lang.Exception { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allUsers ) ) { org.eclipse.jgit.lib.RefUpdate ru = repo.updateRef ( RefNames.REFS_GROUPNAMES ) ; ru.setForceUpdate ( true ) ; org.eclipse.jgit.lib.RefUpdate.Result result = ru.delete ( ) ; com.google.common.truth.Truth.assertThat ( result ) . isEqualTo ( Result.FORCED ) ; } assertConsistency ( "refs/meta/group-names does not exist" , ( groupsMigration.readFromNoteDb ( ) ? ConsistencyProblemInfo.Status.ERROR : ConsistencyProblemInfo.Status.WARNING ) ) ; }

Target:
public void missingGroupNameRef ( ) throws java.lang.Exception { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allUsers ) ) { org.eclipse.jgit.lib.RefUpdate ru = repo.updateRef ( RefNames.REFS_GROUPNAMES ) ; ru.setForceUpdate ( true ) ; org.eclipse.jgit.lib.RefUpdate.Result result = ru.delete ( ) ; com.google.common.truth.Truth.assertThat ( result ) . isEqualTo ( Result.FORCED ) ; } assertError ( "refs/meta/group-names does not exist" ) ; }
Source:
private void addSuggestion ( java.util.Map map , com.google.gerrit.reviewdb.Account account , com.google.gerrit.common.data.AccountInfo info , java.lang.Boolean active ) { if ( ( active == null ) || ( active == ( account.isActive ( ) ) ) ) { map.put ( account.getId ( ) , info ) ; } }

Target:
private void addSuggestion ( java.util.Map < com.google.gerrit.reviewdb.Account.Id , com.google.gerrit.common.data.AccountInfo > map , com.google.gerrit.reviewdb.Account account , com.google.gerrit.common.data.AccountInfo info , java.lang.Boolean active ) { if ( ( active == null ) || ( active == ( account.isActive ( ) ) ) ) { map.put ( account.getId ( ) , info ) ; } }
Source:
public java.util.Collection < com.google.gwtorm.schema.ColumnModel > getDependentFields ( ) { final java.util.ArrayList < com.google.gwtorm.schema.ColumnModel > r = new java.util.ArrayList < com.google.gwtorm.schema.ColumnModel > ( ) ; for ( final com.google.gwtorm.schema.ColumnModel c : fieldsByFieldName.values ( ) ) { if ( ( ( primaryKey ) == null ) || ( ( primaryKey.getField ( ) ) != c ) ) { r.add ( c ) ; } } return r ; }

Target:
public java.util.Collection < com.google.gwtorm.schema.ColumnModel > getDependentFields ( ) { final java.util.ArrayList < com.google.gwtorm.schema.ColumnModel > r = new java.util.ArrayList < com.google.gwtorm.schema.ColumnModel > ( ) ; for ( final com.google.gwtorm.schema.ColumnModel c : fieldsByFieldName.values ( ) ) { if ( ( ! ( c.rowVersion ) ) && ( ( ( primaryKey ) == null ) || ( ( primaryKey.getField ( ) ) != c ) ) ) { r.add ( c ) ; } } return r ; }
Source:
public void testParseWComments ( ) throws java.lang.Exception { com.google.gerrit.server.git.DestinationList dl = new com.google.gerrit.server.git.DestinationList ( ) ; dl.parseLabel ( com.google.gerrit.server.git.DestinationListTest.LABEL , ( ( ( com.google.gerrit.server.git.DestinationListTest.C1 ) + ( com.google.gerrit.server.git.DestinationListTest.F_SIMPLE ) ) + ( com.google.gerrit.server.git.DestinationListTest.C2 ) ) , null ) ; java.util.Set < com.google.gerrit.reviewdb.client.Branch.NameKey > branches = dl.getDestinations ( com.google.gerrit.server.git.DestinationListTest.LABEL ) ; com.google.common.truth.Truth.assertThat ( branches ) . containsExactlyElementsIn ( com.google.gerrit.server.git.DestinationListTest.D_SIMPLE ) ; }

Target:
public void testParseWComments ( ) throws java.lang.Exception { com.google.gerrit.server.account.DestinationList dl = new com.google.gerrit.server.account.DestinationList ( ) ; dl.parseLabel ( com.google.gerrit.server.account.DestinationListTest.LABEL , ( ( ( com.google.gerrit.server.account.DestinationListTest.C1 ) + ( com.google.gerrit.server.account.DestinationListTest.F_SIMPLE ) ) + ( com.google.gerrit.server.account.DestinationListTest.C2 ) ) , null ) ; java.util.Set < com.google.gerrit.reviewdb.client.Branch.NameKey > branches = dl.getDestinations ( com.google.gerrit.server.account.DestinationListTest.LABEL ) ; com.google.common.truth.Truth.assertThat ( branches ) . containsExactlyElementsIn ( com.google.gerrit.server.account.DestinationListTest.D_SIMPLE ) ; }
Source:
public void putComment ( com.google.gerrit.reviewdb.client.PatchLineComment comment ) { com.google.common.base.Preconditions.checkArgument ( ( ( psId ) != null ) , "setPatchSetId must be called before putComment" ) ; com.google.common.base.Preconditions.checkArgument ( com.google.gerrit.server.notedb.CommentsInNotesUtil.getCommentPsId ( comment ) . equals ( psId ) , "Comment on %s doesn't match previous patch set %s" , com.google.gerrit.server.notedb.CommentsInNotesUtil.getCommentPsId ( comment ) , psId ) ; com.google.common.base.Preconditions.checkArgument ( ( ( comment.getRevId ( ) ) != null ) ) ; if ( ( comment.getSide ( ) ) == 0 ) { commentsForBase.add ( comment ) ; } else { commentsForPs.add ( comment ) ; } }

Target:
public void insertComment ( com.google.gerrit.reviewdb.client.PatchLineComment comment ) throws com.google.gwtorm.server.OrmException { if ( ( comment.getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.PatchLineComment.Status.DRAFT ) ) { insertDraftComment ( comment ) ; } else { insertPublishedComment ( comment ) ; } }
Source:
protected void run ( java.lang.String [ ] args ) throws com.google.gerrit.server.ssh.Failure { final com.google.gerrit.client.data.GroupCache gc = com.google.gerrit.client.rpc.Common.getGroupCache ( ) ; if ( gc.isAdministrator ( getAccountId ( ) ) ) { gc.flush ( ) ; } else { throw new com.google.gerrit.server.ssh.Failure ( 1 , "fatal: Not a Gerrit administrator" ) ; } }

Target:
protected void run ( java.lang.String [ ] args ) throws com.google.gerrit.server.ssh.Failure { final com.google.gerrit.client.data.GroupCache gc = com.google.gerrit.client.rpc.Common.getGroupCache ( ) ; if ( gc.isAdministrator ( getAccountId ( ) ) ) { gc.flush ( ) ; com.google.gerrit.client.rpc.Common.getProjectCache ( ) . flush ( ) ; } else { throw new com.google.gerrit.server.ssh.Failure ( 1 , "fatal: Not a Gerrit administrator" ) ; } }
Source:
public void run ( ) { net.codemirror.lib.CodeMirror.LineHandle handle = cm.extras ( ) . activeLine ( ) ; int line = ( cm.getLineNumber ( handle ) ) + 1 ; java.lang.String token = com.google.gerrit.client.Dispatcher.toEditScreen ( revision , path , line ) ; if ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { com.google.gerrit.client.Gerrit.doSignIn ( token ) ; } else { com.google.gerrit.client.Gerrit.display ( token ) ; } }

Target:
public void run ( ) { net.codemirror.lib.CodeMirror.LineHandle handle = cm.extras ( ) . activeLine ( ) ; int line = ( cm.getLineNumber ( handle ) ) + 1 ; if ( Patch.COMMIT_MSG.equals ( path ) ) { line = adjustCommitMessageLine ( line ) ; } java.lang.String token = com.google.gerrit.client.Dispatcher.toEditScreen ( revision , path , line ) ; if ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { com.google.gerrit.client.Gerrit.doSignIn ( token ) ; } else { com.google.gerrit.client.Gerrit.display ( token ) ; } }
Source:
void onReplyDone ( com.google.gwt.event.dom.client.ClickEvent e ) { if ( ( replyBox ) == null ) { com.google.gerrit.client.diff.DraftBox box = getDiffView ( ) . addReply ( getOriginal ( ) , "Done" , true ) ; registerReplyBox ( box ) ; } else { openReplyBox ( ) ; } }

Target:
void onReply ( com.google.gwt.event.dom.client.ClickEvent e ) { e.stopPropagation ( ) ; if ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { com.google.gerrit.client.Gerrit.doSignIn ( parent.getToken ( ) ) ; } else if ( ( replyBox ) == null ) { registerReplyBox ( parent.addDraftBox ( parent.createReply ( comment ) ) ) ; } else { openReplyBox ( ) ; } }
Source:
public static synchronized java.nio.file.FileSystem getZipFileSystem ( java.nio.file.Path zip ) throws java.io.IOException { zip = zip.toRealPath ( ) ; java.nio.file.FileSystem zipFs = com.google.gerrit.launcher.GerritLauncher.zipFileSystems.get ( zip ) ; if ( zipFs == null ) { zipFs = java.nio.file.FileSystems.newFileSystem ( java.net.URI.create ( ( "jar:" + ( zip.toUri ( ) ) ) ) , java.util.Collections.< java.lang.String , java.lang.String > emptyMap ( ) ) ; com.google.gerrit.launcher.GerritLauncher.zipFileSystems.put ( zip , zipFs ) ; } return zipFs ; }

Target:
public static synchronized java.nio.file.FileSystem getZipFileSystem ( java.nio.file.Path zip ) throws java.io.IOException { zip = zip.toRealPath ( ) ; java.nio.file.FileSystem zipFs = com.google.gerrit.launcher.GerritLauncher.zipFileSystems.get ( zip ) ; if ( zipFs == null ) { zipFs = com.google.gerrit.launcher.GerritLauncher.newZipFileSystem ( zip ) ; com.google.gerrit.launcher.GerritLauncher.zipFileSystems.put ( zip , zipFs ) ; } return zipFs ; }
Source:
public void createNewChangeSignedOffByFooter ( ) throws java.lang.Exception { setSignedOffByFooter ( ) ; com.google.gerrit.extensions.common.ChangeInfo info = assertCreateSucceeds ( newChangeInput ( ChangeStatus.NEW ) ) ; java.lang.String message = info.revisions.get ( info.currentRevision ) . commit.message ; com.google.common.truth.Truth.assertThat ( message ) . contains ( java.lang.String.format ( "%sAdministrator <%s>" , org.eclipse.jgit.lib.Constants.SIGNED_OFF_BY_TAG , admin.getIdent ( ) . getEmailAddress ( ) ) ) ; }

Target:
public void createNewChangeWithChangeId ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInput ci = newChangeInput ( ChangeStatus.NEW ) ; java.lang.String changeId = "I1234000000000000000000000000000000000000" ; java.lang.String changeIdLine = "Change-Id: " + changeId ; ci.subject = "Subject\n\n" + changeIdLine ; com.google.gerrit.extensions.common.ChangeInfo info = assertCreateSucceeds ( ci ) ; com.google.common.truth.Truth.assertThat ( info.changeId ) . isEqualTo ( changeId ) ; com.google.common.truth.Truth.assertThat ( info.revisions.get ( info.currentRevision ) . commit.message ) . contains ( changeIdLine ) ; }
Source:
public UiAction.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { try { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setTitle ( java.lang.String.format ( "Delete Draft Change %d" , rsrc.getChange ( ) . getChangeId ( ) ) ) . setVisible ( ( ( ( rsrc.getChange ( ) . getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.DRAFT ) ) && ( rsrc.getControl ( ) . canDeleteDraft ( dbProvider.get ( ) ) ) ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.lang.IllegalStateException ( e ) ; } }

Target:
public UiAction.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { try { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setTitle ( java.lang.String.format ( "Delete draft change %d" , rsrc.getChange ( ) . getChangeId ( ) ) ) . setVisible ( ( ( ( rsrc.getChange ( ) . getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.DRAFT ) ) && ( rsrc.getControl ( ) . canDeleteDraft ( dbProvider.get ( ) ) ) ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.lang.IllegalStateException ( e ) ; } }
Source:
void updateMeter ( ) { if ( ( meter ) != null ) { meter.setValue ( ( ( 100 * ( row ) ) / ( list.size ( ) ) ) ) ; } }

Target:
void updateMeter ( ) { if ( ( meter ) != null ) { final int n = list.size ( ) ; meter.setValue ( ( ( 100 * ( ( ( stage ) * n ) + ( row ) ) ) / ( 2 * n ) ) ) ; } }
Source:
private java.lang.String buildJsonRaw ( java.lang.String path ) throws java.lang.Exception { com.google.gitiles.FakeHttpServletResponse res = buildResponse ( path , "format=json" , javax.servlet.http.HttpServletResponse.SC_OK ) ; org.junit.Assert.assertEquals ( "application/json" , res.getHeader ( com.google.common.net.HttpHeaders.CONTENT_TYPE ) ) ; java.lang.String body = res.getActualBodyString ( ) ; java.lang.String magic = ")]}\'\n" ; org.junit.Assert.assertEquals ( magic , body.substring ( 0 , magic.length ( ) ) ) ; return body.substring ( magic.length ( ) ) ; }

Target:
private java.lang.String buildJsonRaw ( java.lang.String path ) throws java.lang.Exception { com.google.gitiles.FakeHttpServletResponse res = buildResponse ( path , "format=json" , javax.servlet.http.HttpServletResponse.SC_OK ) ; com.google.common.truth.Truth.assertThat ( res.getHeader ( com.google.common.net.HttpHeaders.CONTENT_TYPE ) ) . isEqualTo ( "application/json" ) ; java.lang.String body = res.getActualBodyString ( ) ; java.lang.String magic = ")]}\'\n" ; com.google.common.truth.Truth.assertThat ( body ) . startsWith ( magic ) ; return body.substring ( magic.length ( ) ) ; }
Source:
private boolean match ( org.eclipse.jgit.lib.Repository repo , java.util.Set < com.google.gerrit.server.index.change.StalenessChecker.RefState > expected ) throws java.io.IOException { for ( org.eclipse.jgit.lib.Ref r : repo.getRefDatabase ( ) . getRefs ( prefix ( ) ) . values ( ) ) { if ( ! ( match ( r.getName ( ) ) ) ) { continue ; } if ( ! ( expected.contains ( com.google.gerrit.server.index.change.StalenessChecker.RefState.of ( r ) ) ) ) { return false ; } } return true ; }

Target:
private boolean match ( org.eclipse.jgit.lib.Repository repo , java.util.Set < com.google.gerrit.server.index.RefState > expected ) throws java.io.IOException { for ( org.eclipse.jgit.lib.Ref r : repo.getRefDatabase ( ) . getRefs ( prefix ( ) ) . values ( ) ) { if ( ! ( match ( r.getName ( ) ) ) ) { continue ; } if ( ! ( expected.contains ( com.google.gerrit.server.index.RefState.of ( r ) ) ) ) { return false ; } } return true ; }
Source:
public void commentOnReviewableChangeByOwner ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; review ( sc.owner , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED ) ; assertThat ( sender ) . sent ( "comment" , sc ) . notTo ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void commentOnReviewableChangeByOwner ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; review ( sc.owner , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED ) ; assertThat ( sender ) . sent ( "comment" , sc ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) . noOneElse ( ) ; }
Source:
protected void configure ( ) { itsConfig = createMock ( com.googlesource.gerrit.plugins.its.base.its.ItsConfig.class ) ; bind ( com.googlesource.gerrit.plugins.its.base.its.ItsConfig.class ) . toInstance ( itsConfig ) ; commitMessageFetcher = createMock ( com.googlesource.gerrit.plugins.its.base.util.CommitMessageFetcher.class ) ; bind ( com.googlesource.gerrit.plugins.its.base.util.CommitMessageFetcher.class ) . toInstance ( commitMessageFetcher ) ; db = createMock ( com.google.gerrit.reviewdb.server.ReviewDb.class ) ; bind ( com.google.gerrit.reviewdb.server.ReviewDb.class ) . toInstance ( db ) ; }

Target:
protected void configure ( ) { itsConfig = createMock ( com.googlesource.gerrit.plugins.its.base.its.ItsConfig.class ) ; bind ( com.googlesource.gerrit.plugins.its.base.its.ItsConfig.class ) . toInstance ( itsConfig ) ; commitMessageFetcher = createMock ( com.googlesource.gerrit.plugins.its.base.util.CommitMessageFetcher.class ) ; bind ( com.googlesource.gerrit.plugins.its.base.util.CommitMessageFetcher.class ) . toInstance ( commitMessageFetcher ) ; db = createMock ( com.googlesource.gerrit.plugins.its.base.util.IssueExtractor.PatchSetDb.class ) ; bind ( com.googlesource.gerrit.plugins.its.base.util.IssueExtractor.PatchSetDb.class ) . toInstance ( db ) ; }
Source:
public java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > guessRelevantGroupUUIDs ( ) { java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > groups = com.google.common.collect.Sets.newHashSet ( ) ; for ( com.google.gerrit.reviewdb.client.Project.NameKey n : all ( ) ) { com.google.gerrit.server.project.ProjectState p = byName.getIfPresent ( n.get ( ) ) ; if ( p != null ) { groups.addAll ( p.getConfig ( ) . getAllGroupUUIDs ( ) ) ; } } return groups ; }

Target:
public java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > guessRelevantGroupUUIDs ( ) { java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > groups = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.reviewdb.client.Project.NameKey n : all ( ) ) { com.google.gerrit.server.project.ProjectState p = byName.getIfPresent ( n.get ( ) ) ; if ( p != null ) { groups.addAll ( p.getConfig ( ) . getAllGroupUUIDs ( ) ) ; } } return groups ; }
Source:
private boolean isChangeReviewed ( com.google.gerrit.reviewdb.client.Account.Id self , com.google.gerrit.server.query.change.ChangeData cd , java.util.List < com.google.gerrit.reviewdb.client.ChangeMessage > msgs ) throws com.google.gwtorm.server.OrmException { msgs = ChangeNotes.MESSAGE_BY_TIME.sortedCopy ( msgs ) ; java.util.Collections.reverse ( msgs ) ; com.google.gerrit.reviewdb.client.Account.Id changeOwnerId = cd.change ( ) . getOwner ( ) ; for ( com.google.gerrit.reviewdb.client.ChangeMessage cm : msgs ) { if ( self.equals ( cm.getAuthor ( ) ) ) { return true ; } else if ( changeOwnerId.equals ( cm.getAuthor ( ) ) ) { return false ; } } return false ; }

Target:
private boolean isChangeReviewed ( com.google.gerrit.reviewdb.client.Account.Id self , com.google.gerrit.server.query.change.ChangeData cd , java.lang.Iterable < com.google.gerrit.reviewdb.client.ChangeMessage > msgs ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.reviewdb.client.ChangeMessage > reversed = ChangeNotes.MESSAGE_BY_TIME.reverse ( ) . sortedCopy ( msgs ) ; com.google.gerrit.reviewdb.client.Account.Id changeOwnerId = cd.change ( ) . getOwner ( ) ; for ( com.google.gerrit.reviewdb.client.ChangeMessage cm : reversed ) { if ( self.equals ( cm.getAuthor ( ) ) ) { return true ; } else if ( changeOwnerId.equals ( cm.getAuthor ( ) ) ) { return false ; } } return false ; }
Source:
private static boolean sameUpdate ( com.google.gerrit.server.notedb.ChangeRebuilder.Event event , com.google.gerrit.server.notedb.ChangeUpdate update ) { return ( ( ( ( update != null ) && ( ( com.google.gerrit.server.notedb.ChangeRebuilder.round ( event.when ) ) == ( com.google.gerrit.server.notedb.ChangeRebuilder.round ( update.getWhen ( ) ) ) ) ) && ( event.who.equals ( update.getUser ( ) . getAccountId ( ) ) ) ) && ( event.psId.equals ( update.getPatchSetId ( ) ) ) ) && ( ! ( event instanceof com.google.gerrit.server.notedb.ChangeRebuilder.FinalUpdatesEvent ) ) ; }

Target:
private static boolean sameUpdate ( com.google.gerrit.server.notedb.ChangeRebuilder.Event event , com.google.gerrit.server.notedb.AbstractChangeUpdate update ) { return ( ( ( ( update != null ) && ( ( com.google.gerrit.server.notedb.ChangeRebuilder.round ( event.when ) ) == ( com.google.gerrit.server.notedb.ChangeRebuilder.round ( update.getWhen ( ) ) ) ) ) && ( event.who.equals ( update.getUser ( ) . getAccountId ( ) ) ) ) && ( event.psId.equals ( update.getPatchSetId ( ) ) ) ) && ( ! ( event instanceof com.google.gerrit.server.notedb.ChangeRebuilder.FinalUpdatesEvent ) ) ; }
Source:
public void addMultipleIncludes ( ) throws java.lang.Exception { java.lang.String p = group ( "parent" ) ; java.lang.String g1 = group ( "newGroup1" ) ; java.lang.String g2 = group ( "newGroup2" ) ; java.util.List < java.lang.String > groups = com.google.common.collect.Lists.newLinkedList ( ) ; groups.add ( g1 ) ; groups.add ( g2 ) ; gApi.groups ( ) . id ( p ) . addGroups ( g1 , g2 ) ; assertIncludes ( p , g1 , g2 ) ; }

Target:
public void addMultipleIncludes ( ) throws java.lang.Exception { java.lang.String p = createGroup ( "parent" ) ; java.lang.String g1 = createGroup ( "newGroup1" ) ; java.lang.String g2 = createGroup ( "newGroup2" ) ; java.util.List < java.lang.String > groups = com.google.common.collect.Lists.newLinkedList ( ) ; groups.add ( g1 ) ; groups.add ( g2 ) ; gApi.groups ( ) . id ( p ) . addGroups ( g1 , g2 ) ; assertIncludes ( p , g1 , g2 ) ; }
Source:
void onRefReplicatedToOneNode ( java.lang.String project , java.lang.String ref , org.eclipse.jgit.transport.URIish uri , com.googlesource.gerrit.plugins.replication.ReplicationState.RefPushResult status ) { com.googlesource.gerrit.plugins.replication.RefReplicatedEvent event = new com.googlesource.gerrit.plugins.replication.RefReplicatedEvent ( project , ref , com.googlesource.gerrit.plugins.replication.PushResultProcessing.resolveNodeName ( uri ) , status ) ; postEvent ( project , ref , event ) ; }

Target:
void onRefReplicatedToOneNode ( java.lang.String project , java.lang.String ref , org.eclipse.jgit.transport.URIish uri , com.googlesource.gerrit.plugins.replication.ReplicationState.RefPushResult status , org.eclipse.jgit.transport.RemoteRefUpdate.Status refStatus ) { com.googlesource.gerrit.plugins.replication.RefReplicatedEvent event = new com.googlesource.gerrit.plugins.replication.RefReplicatedEvent ( project , ref , com.googlesource.gerrit.plugins.replication.PushResultProcessing.resolveNodeName ( uri ) , status , refStatus ) ; postEvent ( project , ref , event ) ; }
Source:
public void mergeByOtherCcingSelfNotifyNone ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS , com.google.gerrit.server.account.WatchConfig.NotifyType.SUBMITTED_CHANGES ) ; setEmailStrategy ( other , EmailStrategy.CC_ON_OWN_COMMENTS ) ; merge ( sc.changeId , other , com.google.gerrit.extensions.api.changes.NotifyHandling.NONE ) ; assertThat ( sender ) . notSent ( ) ; }

Target:
public void mergeByOtherCcingSelfNotifyOwner ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageChange ( ) ; setEmailStrategy ( other , EmailStrategy.CC_ON_OWN_COMMENTS ) ; merge ( sc.changeId , other , com.google.gerrit.extensions.api.changes.NotifyHandling.OWNER ) ; assertThat ( sender ) . sent ( "merged" , sc ) . to ( sc.owner ) . noOneElse ( ) ; }
Source:
public java.lang.String getTargetOAuthFinal ( javax.servlet.http.HttpServletRequest httpRequest ) { java.lang.String targetUrl = getTargetUrl ( httpRequest ) ; java.lang.String code = getURLEncoded ( httpRequest.getParameter ( "code" ) ) ; java.lang.String state = getURLEncoded ( httpRequest.getParameter ( "state" ) ) ; return ( ( ( ( targetUrl + ( ( targetUrl.indexOf ( '?' ) ) < 0 ? '?' : '&' ) ) + "code=" ) + code ) + "&state=" ) + state ; }

Target:
public static java.lang.String getTargetOAuthFinal ( javax.servlet.http.HttpServletRequest httpRequest ) { java.lang.String targetUrl = com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getTargetUrl ( httpRequest ) ; java.lang.String code = com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getURLEncoded ( httpRequest.getParameter ( "code" ) ) ; java.lang.String state = com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getURLEncoded ( httpRequest.getParameter ( "state" ) ) ; return ( ( ( ( targetUrl + ( ( targetUrl.indexOf ( '?' ) ) < 0 ? '?' : '&' ) ) + "code=" ) + code ) + "&state=" ) + state ; }
Source:
public boolean canUpload ( ) { for ( com.google.gerrit.server.project.SectionMatcher matcher : access ( ) ) { com.google.gerrit.common.data.AccessSection section = matcher.section ; if ( section.getName ( ) . startsWith ( "refs/for/" ) ) { com.google.gerrit.common.data.Permission permission = section.getPermission ( Permission.PUSH ) ; if ( ( permission != null ) && ( controlForRef ( section.getName ( ) ) . canPerform ( Permission.PUSH ) ) ) { return true ; } } } return false ; }

Target:
private boolean canCreateChanges ( ) { for ( com.google.gerrit.server.project.SectionMatcher matcher : access ( ) ) { com.google.gerrit.common.data.AccessSection section = matcher.section ; if ( section.getName ( ) . startsWith ( "refs/for/" ) ) { com.google.gerrit.common.data.Permission permission = section.getPermission ( Permission.PUSH ) ; if ( ( permission != null ) && ( controlForRef ( section.getName ( ) ) . canPerform ( Permission.PUSH ) ) ) { return true ; } } } return false ; }
Source:
private java.util.List < com.google.gerrit.reviewdb.RefRight > filter ( java.util.Collection < com.google.gerrit.reviewdb.RefRight > all ) { java.util.List < com.google.gerrit.reviewdb.RefRight > mine = new java.util.ArrayList < com.google.gerrit.reviewdb.RefRight > ( all.size ( ) ) ; for ( com.google.gerrit.reviewdb.RefRight right : all ) { if ( matches ( right.getRefPattern ( ) ) ) { mine.add ( right ) ; } } return mine ; }

Target:
private boolean eq ( com.google.gerrit.reviewdb.AccountGroup.UUID a , com.google.gerrit.reviewdb.AccountGroup.UUID b ) { return ( ( a != null ) && ( b != null ) ) && ( a.equals ( b ) ) ; }
Source:
public void queryChangesOwnerWithDifferentUsers ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; org.junit.Assert.assertEquals ( r.getChangeId ( ) , com.google.common.collect.Iterables.getOnlyElement ( query ( "owner:self" ) ) . changeId ) ; setApiUser ( user ) ; org.junit.Assert.assertTrue ( query ( "owner:self" ) . isEmpty ( ) ) ; }

Target:
public void queryChangesOwnerWithDifferentUsers ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.common.truth.Truth.assertThat ( com.google.common.collect.Iterables.getOnlyElement ( query ( "owner:self" ) ) . changeId ) . isEqualTo ( r.getChangeId ( ) ) ; setApiUser ( user ) ; com.google.common.truth.Truth.assertThat ( query ( "owner:self" ) . isEmpty ( ) ) . isTrue ( ) ; }
Source:
public T decode ( java.nio.ByteBuffer buf ) { if ( buf.hasArray ( ) ) { return decode ( com.google.protobuf.CodedInputStream.newInstance ( buf.array ( ) , buf.position ( ) , buf.remaining ( ) ) ) ; } else { return decode ( com.google.protobuf.ByteString.copyFrom ( buf ) ) ; } }

Target:
public byte [ ] encodeToByteArray ( T obj ) { byte [ ] data = new byte [ sizeof ( obj ) ] ; encode ( obj , data ) ; return data ; }
Source:
protected void init ( ) throws com.google.gerrit.common.errors.EmailException { super . init ( ) ; if ( ( fromId ) != null ) { reviewers.remove ( fromId ) ; } add ( RecipientType.TO , reviewers ) ; add ( RecipientType.CC , extraCC ) ; rcptToAuthors ( RecipientType.CC ) ; bccStarredBy ( ) ; includeWatchers ( NotifyType.NEW_PATCHSETS , ( ! ( patchSet.isDraft ( ) ) ) ) ; }

Target:
protected void init ( ) throws com.google.gerrit.common.errors.EmailException { super . init ( ) ; if ( ( fromId ) != null ) { reviewers.remove ( fromId ) ; } add ( RecipientType.TO , reviewers ) ; add ( RecipientType.CC , extraCC ) ; rcptToAuthors ( RecipientType.CC ) ; bccStarredBy ( ) ; removeUsersThatIgnoredTheChange ( ) ; includeWatchers ( NotifyType.NEW_PATCHSETS , ( ( ! ( patchSet.isDraft ( ) ) ) && ( ! ( change.isPrivate ( ) ) ) ) ) ; removeUsersThatIgnoredTheChange ( ) ; }
Source:
private void setLineNumber ( com.google.gerrit.client.diff.DisplaySide side , int cmLine , java.lang.String html , java.lang.String styleName ) { com.google.gwt.user.client.ui.InlineHTML gutter = new com.google.gwt.user.client.ui.InlineHTML ( html ) ; diffTable.add ( gutter ) ; gutter.setStyleName ( styleName ) ; cm.setGutterMarker ( cmLine , ( side == ( DisplaySide.A ) ? UnifiedTable.style.lineNumbersLeft ( ) : UnifiedTable.style.lineNumbersRight ( ) ) , gutter.getElement ( ) ) ; }

Target:
private void setLineNumber ( com.google.gerrit.client.diff.DisplaySide side , int cmLine , java.lang.Integer line , java.lang.String styleName ) { com.google.gwtexpui.safehtml.client.SafeHtml html = com.google.gwtexpui.safehtml.client.SafeHtml.asis ( ( line != null ? line.toString ( ) : "&nbsp;" ) ) ; com.google.gwt.user.client.ui.InlineHTML gutter = new com.google.gwt.user.client.ui.InlineHTML ( html ) ; diffTable.add ( gutter ) ; gutter.setStyleName ( styleName ) ; cm.setGutterMarker ( cmLine , ( side == ( DisplaySide.A ) ? UnifiedTable.style.lineNumbersLeft ( ) : UnifiedTable.style.lineNumbersRight ( ) ) , gutter.getElement ( ) ) ; }