auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static void populateBottomMenu ( ) { final com.google.gwt.user.client.ui.RootPanel btmmenu = com.google.gwt.user.client.ui.RootPanel.get ( "gerrit_btmmenu" ) ; final com.google.gwt.user.client.ui.Label keyHelp = new com.google.gwt.user.client.ui.Label ( com.google.gerrit.client.Gerrit.C.keyHelp ( ) ) ; keyHelp.setStyleName ( "gerrit-keyhelp" ) ; btmmenu.add ( keyHelp ) ; final java.lang.String vs = com.google.gerrit.client.Gerrit.getVersion ( ) ; final com.google.gwt.user.client.ui.HTML version = new com.google.gwt.user.client.ui.HTML ( com.google.gerrit.client.Gerrit.M.poweredBy ( vs ) ) ; version.setStyleName ( "gerrit-version" ) ; btmmenu.add ( version ) ; }

Target:
private static void populateBottomMenu ( final com.google.gwt.user.client.ui.RootPanel btmmenu ) { final com.google.gwt.user.client.ui.Label keyHelp = new com.google.gwt.user.client.ui.Label ( com.google.gerrit.client.Gerrit.C.keyHelp ( ) ) ; keyHelp.setStyleName ( com.google.gerrit.client.Gerrit.RESOURCES.css ( ) . keyhelp ( ) ) ; btmmenu.add ( keyHelp ) ; final java.lang.String vs = com.google.gerrit.client.Gerrit.getVersion ( ) ; final com.google.gwt.user.client.ui.HTML version = new com.google.gwt.user.client.ui.HTML ( com.google.gerrit.client.Gerrit.M.poweredBy ( vs ) ) ; version.setStyleName ( com.google.gerrit.client.Gerrit.RESOURCES.css ( ) . version ( ) ) ; btmmenu.add ( version ) ; }
Source:
public static GroupDescription.Internal forAccountGroup ( com.google.gerrit.reviewdb.client.AccountGroup group ) { return new com.google.gerrit.common.data.GroupDescription.Internal ( ) { @ java.lang.Override public AccountGroup.UUID getGroupUUID ( ) { return group.getGroupUUID ( ) ; } @ java.lang.Override public java.lang.String getName ( ) { return group.getName ( ) ; } @ java.lang.Override public com.google.gerrit.reviewdb.client.AccountGroup getAccountGroup ( ) { return group ; } @ java.lang.Override @ com.google.gerrit.common.Nullable public java.lang.String getEmailAddress ( ) { return null ; } @ java.lang.Override @ com.google.gerrit.common.Nullable public java.lang.String getUrl ( ) { return "#" + ( com.google.gerrit.common.PageLinks.toGroup ( getGroupUUID ( ) ) ) ; } } ; }

Target:
public boolean isVisibleToAll ( ) { return group.isVisibleToAll ( ) ; }
Source:
private java.util.List < com.google.gerrit.extensions.common.AccountInfo > toAccountInfoList ( java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > accountIds ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.extensions.common.AccountInfo > result = com.google.common.collect.Lists.newLinkedList ( ) ; com.google.gerrit.server.account.AccountLoader loader = infoFactory.create ( true ) ; for ( com.google.gerrit.reviewdb.client.Account.Id accId : accountIds ) { result.add ( loader.get ( accId ) ) ; } loader.fill ( ) ; return result ; }

Target:
private java.util.List < com.google.gerrit.extensions.common.AccountInfo > toAccountInfoList ( java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > accountIds ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.extensions.common.AccountInfo > result = new java.util.LinkedList < > ( ) ; com.google.gerrit.server.account.AccountLoader loader = infoFactory.create ( true ) ; for ( com.google.gerrit.reviewdb.client.Account.Id accId : accountIds ) { result.add ( loader.get ( accId ) ) ; } loader.fill ( ) ; return result ; }
Source:
public void onScreenLoad ( com.google.gerrit.client.ui.ScreenLoadEvent event ) { com.google.gerrit.client.ui.Screen screen = event.getScreen ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey projectKey ; if ( screen instanceof com.google.gerrit.client.admin.ProjectScreen ) { projectKey = ( ( com.google.gerrit.client.admin.ProjectScreen ) ( screen ) ) . getProjectKey ( ) ; } else { projectKey = com.google.gerrit.client.admin.ProjectScreen.getSavedKey ( ) ; } if ( projectKey != null ) { setVisible ( true ) ; setTargetHistoryToken ( com.google.gerrit.client.Dispatcher.toProjectAdmin ( projectKey , panel ) ) ; } else { setVisible ( false ) ; } super . onScreenLoad ( event ) ; }

Target:
public static void selectMenu ( com.google.gerrit.client.ui.LinkMenuBar bar ) { com.google.gerrit.client.Gerrit.menuLeft.selectTab ( com.google.gerrit.client.Gerrit.menuLeft.getWidgetIndex ( bar ) ) ; }
Source:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < > ( ) ; modules.add ( sysInjector.getInstance ( com.google.gerrit.sshd.SshModule.class ) ) ; modules.add ( new com.google.gerrit.sshd.SshHostKeyModule ( ) ) ; modules.add ( new com.google.gerrit.sshd.commands.DefaultCommandModule ( false ) ) ; return sysInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < > ( ) ; modules.add ( sysInjector.getInstance ( com.google.gerrit.sshd.SshModule.class ) ) ; modules.add ( new com.google.gerrit.sshd.SshHostKeyModule ( ) ) ; modules.add ( new com.google.gerrit.sshd.commands.DefaultCommandModule ( false , sysInjector.getInstance ( com.google.gerrit.server.config.DownloadConfig.class ) ) ) ; if ( ( indexType ) == ( com.google.gerrit.server.index.IndexModule.IndexType.LUCENE ) ) { modules.add ( new com.google.gerrit.sshd.commands.IndexCommandsModule ( ) ) ; } return sysInjector.createChildInjector ( modules ) ; }
Source:
static boolean skip ( org.eclipse.jgit.lib.Ref ref ) { return ( ( ref.isSymbolic ( ) ) || ( ( ref.getObjectId ( ) ) == null ) ) || ( com.google.gerrit.reviewdb.client.PatchSet.isChangeRef ( ref.getName ( ) ) ) ; }

Target:
static boolean skip ( org.eclipse.jgit.lib.Ref ref ) { return ( ( ( ref.isSymbolic ( ) ) || ( ( ref.getObjectId ( ) ) == null ) ) || ( com.google.gerrit.reviewdb.client.PatchSet.isChangeRef ( ref.getName ( ) ) ) ) || ( com.google.gerrit.reviewdb.client.RefNames.isNoteDbMetaRef ( ref.getName ( ) ) ) ; }
Source:
protected void movePointerTo ( final int newRow ) { if ( newRow >= 0 ) { table.setWidget ( newRow , com.google.gerrit.client.ui.FancyFlexTable.C_ARROW , pointer ) ; table.getCellFormatter ( ) . getElement ( newRow , com.google.gerrit.client.ui.FancyFlexTable.C_ARROW ) . scrollIntoView ( ) ; } else if ( ( currentRow ) >= 0 ) { table.setWidget ( currentRow , com.google.gerrit.client.ui.FancyFlexTable.C_ARROW , null ) ; } currentRow = newRow ; }

Target:
protected void applyDataRowStyle ( final int newRow ) { table.getCellFormatter ( ) . addStyleName ( newRow , com.google.gerrit.client.ui.FancyFlexTable.C_ARROW , com.google.gerrit.client.ui.FancyFlexTable.S_ICON_CELL ) ; }
Source:
public java.util.Set < java.lang.String > hashtags ( ) throws com.google.gwtorm.server.OrmException { if ( ( hashtags ) == null ) { hashtags = notes ( ) . getHashtags ( ) ; } return hashtags ; }

Target:
public java.util.Set < java.lang.String > hashtags ( ) throws com.google.gwtorm.server.OrmException { if ( ( hashtags ) == null ) { if ( ! ( lazyLoad ) ) { return java.util.Collections.emptySet ( ) ; } hashtags = notes ( ) . getHashtags ( ) ; } return hashtags ; }
Source:
private boolean isSignedOffBy ( java.util.List < org.eclipse.jgit.revwalk.FooterLine > footers , java.lang.String email ) { for ( final org.eclipse.jgit.revwalk.FooterLine line : footers ) { if ( ( line.matches ( FooterKey.SIGNED_OFF_BY ) ) && ( email.equals ( line.getEmailAddress ( ) ) ) ) { return true ; } } return false ; }

Target:
private boolean containsMissingCommits ( final java.util.Map < com.google.gerrit.reviewdb.client.Project.SubmitType , java.util.List < com.google.gerrit.server.git.CodeReviewCommit > > map , final com.google.gerrit.server.git.CodeReviewCommit commit ) { if ( ! ( isSubmitForMissingCommitsStillPossible ( commit ) ) ) { return false ; } for ( final com.google.gerrit.server.git.CodeReviewCommit missingCommit : commit.missing ) { boolean found = false ; for ( final java.util.List < com.google.gerrit.server.git.CodeReviewCommit > list : map.values ( ) ) { if ( list.contains ( missingCommit ) ) { found = true ; break ; } } if ( ! found ) { return false ; } } return true ; }
Source:
void parseAll ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { walk.markStart ( walk.parseCommit ( tip ) ) ; for ( org.eclipse.jgit.revwalk.RevCommit commit : walk ) { parse ( commit ) ; } parseComments ( ) ; allPastReviewers.addAll ( reviewers.keySet ( ) ) ; pruneReviewers ( ) ; checkMandatoryFooters ( ) ; }

Target:
void parseAll ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { walk.markStart ( walk.parseCommit ( tip ) ) ; for ( org.eclipse.jgit.revwalk.RevCommit commit : walk ) { parse ( commit ) ; } parseComments ( ) ; allPastReviewers.addAll ( reviewers.keySet ( ) ) ; pruneReviewers ( ) ; updatePatchSetStates ( ) ; checkMandatoryFooters ( ) ; }
Source:
public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { final com.google.gerrit.reviewdb.ProjectRight k = getRowItem ( row ) ; if ( ( k != null ) && ( ids.contains ( k.getKey ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } }

Target:
public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { com.google.gerrit.reviewdb.RefRight r = getRowItem ( row ) ; if ( ( r != null ) && ( refRightIds.contains ( r.getKey ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } }
Source:
void onAutoHideDiffTableHeader ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > e ) { prefs.autoHideDiffTableHeader ( ( ! ( e.getValue ( ) ) ) ) ; if ( ( view ) != null ) { view.setAutoHideDiffHeader ( ( ! ( e.getValue ( ) ) ) ) ; } }

Target:
void onTopMenu ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > e ) { prefs.hideTopMenu ( ( ! ( e.getValue ( ) ) ) ) ; if ( ( view ) != null ) { com.google.gerrit.client.Gerrit.setHeaderVisible ( ( ! ( prefs.hideTopMenu ( ) ) ) ) ; view.resizeCodeMirror ( ) ; } }
Source:
protected void configure ( ) { factory ( AbandonChange.Factory.class ) ; factory ( RestoreChange.Factory.class ) ; factory ( RevertChange.Factory.class ) ; factory ( ChangeDetailFactory.Factory.class ) ; factory ( IncludedInDetailFactory.Factory.class ) ; factory ( PatchSetDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; factory ( SubmitAction.Factory.class ) ; factory ( PublishAction.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( AbandonChange.Factory.class ) ; factory ( RestoreChange.Factory.class ) ; factory ( RevertChange.Factory.class ) ; factory ( ChangeDetailFactory.Factory.class ) ; factory ( IncludedInDetailFactory.Factory.class ) ; factory ( PatchSetDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; factory ( SubmitAction.Factory.class ) ; factory ( PublishAction.Factory.class ) ; factory ( DeleteDraftChange.Factory.class ) ; }
Source:
public void execute ( ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException { try { executeRefUpdates ( ) ; executeChangeOps ( ) ; reindexChanges ( ) ; if ( ( batchRefUpdate ) != null ) { gitRefUpdated.fire ( project , batchRefUpdate ) ; } executePostOps ( ) ; } catch ( com.google.gerrit.server.git.UpdateException | com.google.gerrit.extensions.restapi.RestApiException e ) { throw e ; } catch ( java.lang.Exception e ) { com.google.common.base.Throwables.propagateIfPossible ( e ) ; throw new com.google.gerrit.server.git.UpdateException ( e ) ; } }

Target:
public void execute ( ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException { execute ( com.google.gerrit.server.git.BatchUpdate.Listener.NONE ) ; }
Source:
public com.google.gerrit.extensions.common.DiffWebLinkInfo getDiffLink ( java.lang.String projectName , int changeId , java.lang.Integer patchSetIdA , java.lang.String revisionA , java.lang.String fileNameA , int patchSetIdB , java.lang.String revisionB , java.lang.String fileNameB ) { com.googlesource.gerrit.plugins.xdocs.formatter.Formatters.FormatterProvider formatter = formatters.get ( projectName , fileNameB ) ; if ( formatter == null ) { return null ; } return com.google.gerrit.extensions.common.DiffWebLinkInfo.forSideBySideDiffView ( com.googlesource.gerrit.plugins.xdocs.client.SideBySideDiffPreviewWebLink.SIDE_BY_SIDE_PREVIEW_DIFF , ( ( "plugins/" + ( pluginName ) ) + "/static/sideBySideDiffPreview.png" ) , com.googlesource.gerrit.plugins.xdocs.client.SideBySideDiffPreviewWebLink.getUrl ( pluginName , changeId , patchSetIdA , patchSetIdB , fileNameB ) , Target.SELF ) ; }

Target:
public com.google.gerrit.extensions.common.DiffWebLinkInfo getDiffLink ( java.lang.String projectName , int changeId , java.lang.Integer patchSetIdA , java.lang.String revisionA , java.lang.String fileNameA , int patchSetIdB , java.lang.String revisionB , java.lang.String fileNameB ) { com.googlesource.gerrit.plugins.xdocs.formatter.Formatters.FormatterProvider formatter = formatters.get ( projectName , fileNameB ) ; if ( formatter == null ) { return null ; } return com.google.gerrit.extensions.common.DiffWebLinkInfo.forSideBySideDiffView ( com.googlesource.gerrit.plugins.xdocs.SideBySideDiffPreviewWebLink.SIDE_BY_SIDE_PREVIEW_DIFF , ( ( "plugins/" + ( pluginName ) ) + "/static/sideBySideDiffPreview.png" ) , com.googlesource.gerrit.plugins.xdocs.SideBySideDiffPreviewWebLink.getUrl ( pluginName , changeId , patchSetIdA , patchSetIdB , fileNameB ) , Target.SELF ) ; }
Source:
private PushOneCommit.Result createChangeWithTopic ( org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.InMemoryRepository > repo , java.lang.String topic , java.lang.String commitMsg , java.lang.String fileName , java.lang.String content ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( topic ) . isNotEmpty ( ) ; return createCommitAndPush ( repo , ( "refs/for/master/" + ( name ( topic ) ) ) , commitMsg , fileName , content ) ; }

Target:
public boolean visit ( java.lang.String name , com.google.gerrit.extensions.common.ActionInfo actionInfo , com.google.gerrit.extensions.common.ChangeInfo changeInfo , com.google.gerrit.extensions.common.RevisionInfo revisionInfo ) { com.google.common.truth.Truth.assertThat ( changeInfo ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( changeInfo._number ) . isEqualTo ( origChange._number ) ; com.google.common.truth.Truth.assertThat ( revisionInfo ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( revisionInfo._number ) . isEqualTo ( 1 ) ; if ( name.equals ( "description" ) ) { actionInfo.label = "Describify" ; } return true ; }
Source:
public synchronized void stop ( ) { if ( ( basicDataSource ) != null ) { try { basicDataSource.close ( ) ; } catch ( java.sql.SQLException e ) { } finally { basicDataSource = null ; } } }

Target:
public synchronized void stop ( ) { if ( ( basicDataSource ) != null ) { try { basicDataSource.close ( ) ; } catch ( java.sql.SQLException e ) { } finally { basicDataSource = null ; } } if ( ( ds ) instanceof com.google.gwtorm.nosql.heap.FileDatabase ) { try { ( ( com.google.gwtorm.nosql.heap.FileDatabase ) ( ds ) ) . close ( ) ; } catch ( com.google.gwtorm.client.OrmException err ) { com.google.gerrit.server.schema.DataSourceProvider.log.warn ( "Cannot safely close database" , err ) ; } } }
Source:
public com.google.gerrit.server.change.ReviewerJson.ReviewerInfo format ( com.google.gerrit.server.change.ReviewerJson.ReviewerInfo out , com.google.gerrit.server.project.ChangeControl ctl ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet.Id psId = ctl.getChange ( ) . currentPatchSetId ( ) ; return format ( out , ctl , approvalsUtil.byPatchSetUser ( db.get ( ) , ctl , psId , out._id ) ) ; }

Target:
public com.google.gerrit.server.change.ReviewerJson.ReviewerInfo format ( com.google.gerrit.server.change.ReviewerJson.ReviewerInfo out , com.google.gerrit.server.project.ChangeControl ctl ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet.Id psId = ctl.getChange ( ) . currentPatchSetId ( ) ; return format ( out , ctl , approvalsUtil.byPatchSetUser ( db.get ( ) , ctl , psId , new com.google.gerrit.reviewdb.client.Account.Id ( out._accountId ) ) ) ; }
Source:
private static org.apache.lucene.search.Sort getSort ( com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema , com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > p ) { if ( com.google.gerrit.server.query.change.SortKeyPredicate.hasSortKeyField ( schema ) ) { boolean reverse = com.google.gerrit.server.query.change.ChangeQueryBuilder.hasNonTrivialSortKeyAfter ( schema , p ) ; return new org.apache.lucene.search.Sort ( new org.apache.lucene.search.SortField ( ChangeField.SORTKEY.getName ( ) , SortField.Type.LONG , ( ! reverse ) ) ) ; } else { return new org.apache.lucene.search.Sort ( new org.apache.lucene.search.SortField ( ChangeField.UPDATED.getName ( ) , SortField.Type.LONG , true ) , new org.apache.lucene.search.SortField ( ChangeField.LEGACY_ID.getName ( ) , SortField.Type.INT , true ) ) ; } }

Target:
private org.apache.lucene.search.Sort getSort ( ) { return new org.apache.lucene.search.Sort ( new org.apache.lucene.search.SortField ( com.google.gerrit.lucene.LuceneChangeIndex.UPDATED_SORT_FIELD , SortField.Type.LONG , true ) , new org.apache.lucene.search.SortField ( com.google.gerrit.lucene.LuceneChangeIndex.ID_SORT_FIELD , SortField.Type.LONG , true ) ) ; }
Source:
private void enable ( final boolean on ) { showSiteHeader.setEnabled ( on ) ; useFlashClipboard.setEnabled ( on ) ; copySelfOnEmails.setEnabled ( on ) ; reversePatchSetOrder.setEnabled ( on ) ; showUsernameInReviewCategory.setEnabled ( on ) ; maximumPageSize.setEnabled ( on ) ; dateFormat.setEnabled ( on ) ; timeFormat.setEnabled ( on ) ; relativeDateInChangeTable.setEnabled ( on ) ; commentVisibilityStrategy.setEnabled ( on ) ; diffView.setEnabled ( on ) ; }

Target:
private void enable ( final boolean on ) { showSiteHeader.setEnabled ( on ) ; useFlashClipboard.setEnabled ( on ) ; copySelfOnEmails.setEnabled ( on ) ; reversePatchSetOrder.setEnabled ( on ) ; showUsernameInReviewCategory.setEnabled ( on ) ; maximumPageSize.setEnabled ( on ) ; dateFormat.setEnabled ( on ) ; timeFormat.setEnabled ( on ) ; relativeDateInChangeTable.setEnabled ( on ) ; commentVisibilityStrategy.setEnabled ( on ) ; changeScreen.setEnabled ( on ) ; diffView.setEnabled ( on ) ; }
Source:
private void waitForEmails ( ) { for ( com.google.gerrit.server.git.WorkQueue.Task < ? > task : workQueue.getTasks ( ) ) { if ( task.toString ( ) . contains ( "send-email" ) ) { try { task.get ( ) ; } catch ( java.util.concurrent.ExecutionException | java.lang.InterruptedException e ) { com.google.gerrit.testutil.FakeEmailSender.log.warn ( "error finishing email task" , e ) ; } } } }

Target:
private void waitForEmails ( ) { for ( com.google.gerrit.server.git.WorkQueue.Task < ? > task : workQueue.getTasks ( ) ) { if ( task.toString ( ) . contains ( "send-email" ) ) { try { task.get ( ) ; } catch ( java.util.concurrent.ExecutionException | java.lang.InterruptedException e ) { com.google.gerrit.testing.FakeEmailSender.log.warn ( "error finishing email task" , e ) ; } } } }
Source:
public static java.lang.String owner ( com.google.gerrit.client.account.AccountInfo ai ) { if ( ( ai.email ( ) ) != null ) { return ai.email ( ) ; } else if ( ( ai.name ( ) ) != null ) { return ai.name ( ) ; } else if ( ( ai._account_id ( ) ) != 0 ) { return "" + ( ai._account_id ( ) ) ; } else { return "" ; } }

Target:
public static java.lang.String owner ( com.google.gerrit.client.account.AccountInfo ai ) { if ( ( ai.email ( ) ) != null ) { return ai.email ( ) ; } else if ( ( ai.name ( ) ) != null ) { return ai.name ( ) ; } else if ( ( ai._accountId ( ) ) != 0 ) { return "" + ( ai._accountId ( ) ) ; } else { return "" ; } }
Source:
public static org.eclipse.jgit.lib.Config allowDraftsDisabled ( ) { return allowDraftsDisabledConfig ( ) ; }

Target:
public void createChangeOnInvisibleBranchFails ( ) throws java.lang.Exception { changeInTwoBranches ( "invisible-branch" , "a.txt" , "branchB" , "b.txt" ) ; block ( project , "refs/heads/invisible-branch" , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; com.google.gerrit.extensions.common.ChangeInput in = newChangeInput ( ChangeStatus.NEW ) ; in.branch = "invisible-branch" ; assertCreateFails ( in , com.google.gerrit.extensions.restapi.ResourceNotFoundException.class , "" ) ; }
Source:
public void testValidationError ( ) throws java.lang.Exception { com.google.gerrit.server.git.ValidationError.Sink sink = org.easymock.EasyMock.createMock ( ValidationError.Sink.class ) ; sink.error ( org.easymock.EasyMock.anyObject ( com.google.gerrit.server.git.ValidationError.class ) ) ; org.easymock.EasyMock.expectLastCall ( ) . times ( 2 ) ; org.easymock.EasyMock.replay ( sink ) ; groupList = com.google.gerrit.server.git.GroupList.parse ( com.google.gerrit.server.git.GroupListTest.TEXT.replace ( "\t" , " " ) , sink ) ; org.easymock.EasyMock.verify ( sink ) ; }

Target:
public void testValidationError ( ) throws java.lang.Exception { com.google.gerrit.server.git.ValidationError.Sink sink = org.easymock.EasyMock.createMock ( ValidationError.Sink.class ) ; sink.error ( org.easymock.EasyMock.anyObject ( com.google.gerrit.server.git.ValidationError.class ) ) ; org.easymock.EasyMock.expectLastCall ( ) . times ( 2 ) ; org.easymock.EasyMock.replay ( sink ) ; groupList = com.google.gerrit.server.git.GroupList.parse ( com.google.gerrit.server.git.GroupListTest.PROJECT , com.google.gerrit.server.git.GroupListTest.TEXT.replace ( "\t" , " " ) , sink ) ; org.easymock.EasyMock.verify ( sink ) ; }
Source:
public void testReplaceEmpty ( ) { com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.html ( "A\nissue42\nB" ) ; org.junit.Assert.assertSame ( o , o.replaceAll ( null ) ) ; org.junit.Assert.assertSame ( o , o.replaceAll ( java.util.Collections.< com.google.gwtexpui.safehtml.client.FindReplace > emptyList ( ) ) ) ; }

Target:
public void testReplaceEmpty ( ) { com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_ReplaceTest.html ( "A\nissue42\nB" ) ; com.google.common.truth.Truth.assertThat ( o.replaceAll ( null ) ) . isSameAs ( o ) ; com.google.common.truth.Truth.assertThat ( o.replaceAll ( java.util.Collections.< com.google.gwtexpui.safehtml.client.FindReplace > emptyList ( ) ) ) . isSameAs ( o ) ; }
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 : 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 : return true ; case OPENID : for ( final com.google.gerrit.reviewdb.AccountExternalId e : ids ) { if ( ! ( isTrusted ( e ) ) ) { return false ; } } return true ; default : return false ; } }
Source:
private java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > visibleTags ( com.google.gerrit.server.project.ProjectControl control , org.eclipse.jgit.lib.Repository repo , java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > tags ) { return new com.google.gerrit.server.git.VisibleRefFilter ( tagCache , changeNotesFactory , changeCache , repo , control , dbProvider.get ( ) , false ) . filter ( tags , true ) ; }

Target:
private java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > visibleTags ( com.google.gerrit.server.project.ProjectControl pctl , org.eclipse.jgit.lib.Repository repo , java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > tags ) { return new com.google.gerrit.server.git.VisibleRefFilter ( tagCache , changeNotesFactory , changeCache , repo , pctl , dbProvider.get ( ) , false ) . filter ( tags , true ) ; }
Source:
public boolean isOwner ( ) { com.google.gerrit.reviewdb.client.AccountGroup accountGroup = com.google.gerrit.common.data.GroupDescriptions.toAccountGroup ( group ) ; if ( accountGroup == null ) { isOwner = false ; } else if ( ( isOwner ) == null ) { com.google.gerrit.reviewdb.client.AccountGroup.UUID ownerUUID = accountGroup.getOwnerGroupUUID ( ) ; isOwner = ( getUser ( ) . getEffectiveGroups ( ) . contains ( ownerUUID ) ) || ( getUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ; } return isOwner ; }

Target:
public boolean isOwner ( ) { com.google.gerrit.reviewdb.client.AccountGroup accountGroup = com.google.gerrit.common.data.GroupDescriptions.toAccountGroup ( group ) ; if ( accountGroup == null ) { isOwner = false ; } else if ( ( isOwner ) == null ) { com.google.gerrit.reviewdb.client.AccountGroup.UUID ownerUUID = accountGroup.getOwnerGroupUUID ( ) ; isOwner = ( getUser ( ) . getEffectiveGroups ( ) . contains ( ownerUUID ) ) || ( getUser ( ) . getCapabilities ( ) . isAdmin_DoNotUse ( ) ) ; } return isOwner ; }
Source:
public com.google.gerrit.server.patch.PatchListEntry get ( final java.lang.String fileName ) { final int index = search ( fileName ) ; return 0 <= index ? patches [ index ] : com.google.gerrit.server.patch.PatchListEntry.empty ( fileName ) ; }

Target:
public java.util.List < com.google.gerrit.reviewdb.Patch > toPatchList ( final com.google.gerrit.reviewdb.PatchSet.Id setId ) { final java.util.ArrayList < com.google.gerrit.reviewdb.Patch > r = new java.util.ArrayList < com.google.gerrit.reviewdb.Patch > ( patches.size ( ) ) ; for ( final com.google.gerrit.server.patch.PatchListEntry e : patches ) { r.add ( e.toPatch ( setId ) ) ; } return r ; }
Source:
public void byAfter ( ) throws java.lang.Exception { Merge ( com.google.gerrit.server.query.change.I7aeb7d2e , com.google.gerrit.server.query.change.Ie93003f9 , com.google.gerrit.server.query.change.I16cdc920 ) ; resetTimeWithClockStep ( 30 , java.util.concurrent.TimeUnit.HOURS ) ; }

Target:
public void byAfter ( ) throws java.lang.Exception { resetTimeWithClockStep ( 30 , java.util.concurrent.TimeUnit.HOURS ) ; org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change1 = insert ( repo , newChange ( repo ) ) ; com.google.gerrit.reviewdb.client.Change change2 = insert ( repo , newChange ( repo ) ) ; com.google.gerrit.testutil.TestTimeUtil.setClockStep ( 0 , java.util.concurrent.TimeUnit.MILLISECONDS ) ; assertQuery ( "after:2009-10-03" ) ; assertQuery ( "after:\"2009-10-01 20:59:59 -0400\"" , change2 ) ; assertQuery ( "after:\"2009-10-01 20:59:59 -0000\"" , change2 ) ; assertQuery ( "after:2009-10-01" , change2 ) ; assertQuery ( "after:2009-09-30" , change2 , change1 ) ; }
Source:
private void initIncludedInAction ( com.google.gerrit.client.changes.ChangeInfo info ) { if ( ( info.status ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.MERGED ) ) { includedInAction = new com.google.gerrit.client.change.IncludedInAction ( info.legacy_id ( ) , style , headerLine , includedIn ) ; includedIn.setVisible ( true ) ; } }

Target:
private void initIncludedInAction ( com.google.gerrit.client.changes.ChangeInfo info ) { if ( ( info.status ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.MERGED ) ) { includedInAction = new com.google.gerrit.client.change.IncludedInAction ( info.legacyId ( ) , style , headerLine , includedIn ) ; includedIn.setVisible ( true ) ; } }
Source:
protected PushOneCommit.Result createChange ( org.eclipse.jgit.api.Git git , java.lang.String subject , java.lang.String fileName , java.lang.String content ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , git , subject , fileName , content ) ; return push.to ( "refs/for/master" ) ; }

Target:
protected PushOneCommit.Result createChange ( java.lang.String subject , java.lang.String fileName , java.lang.String content ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , testRepo , subject , fileName , content ) ; return push.to ( "refs/for/master" ) ; }
Source:
private static void scheduleJobImp ( final com.google.gerrit.git.MergeQueue.MergeEntry e ) { if ( ! ( e.jobScheduled ) ) { e.jobScheduled = true ; com.google.gerrit.git.WorkQueue.schedule ( new java.lang.Runnable ( ) { public void run ( ) { com.google.gerrit.git.MergeQueue.unschedule ( e ) ; try { com.google.gerrit.git.MergeQueue.mergeImpl ( e.dest ) ; } finally { com.google.gerrit.git.MergeQueue.finish ( e.dest ) ; } } } , 0 , java.util.concurrent.TimeUnit.SECONDS ) ; } }

Target:
public java.lang.String toString ( ) { final com.google.gerrit.client.reviewdb.Branch.NameKey branch = e.dest ; final com.google.gerrit.client.reviewdb.Project.NameKey project = branch.getParentKey ( ) ; return ( ( "submit " + ( project.get ( ) ) ) + " " ) + ( branch.getShortName ( ) ) ; }
Source:
protected void migrateData ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.schema.UpdateUI ui ) throws java.sql.SQLException { ui.message ( ( "Migrate user preference showUserInReview to " + "reviewCategoryStrategy" ) ) ; java.sql.Statement stmt = ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) . getConnection ( ) . createStatement ( ) ; try { stmt.executeUpdate ( ( "UPDATE ACCOUNTS SET " + ( "REVIEW_CATEGORY_STRATEGY='NAME' " + "WHERE (SHOW_USER_IN_REVIEW='Y')" ) ) ) ; } finally { stmt.close ( ) ; } }

Target:
protected void migrateData ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.schema.UpdateUI ui ) throws java.sql.SQLException { ui.message ( ( "Migrate user preference showUserInReview to " + "reviewCategoryStrategy" ) ) ; java.sql.Statement stmt = ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) . getConnection ( ) . createStatement ( ) ; try { stmt.executeUpdate ( ( "UPDATE accounts SET " + ( "REVIEW_CATEGORY_STRATEGY='NAME' " + "WHERE (SHOW_USER_IN_REVIEW='Y')" ) ) ) ; } finally { stmt.close ( ) ; } }
Source:
public void voteOnBehalfOfMissingUser ( ) throws java.lang.Exception { allowCodeReviewOnBehalfOf ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.api.changes.RevisionApi revision = gApi.changes ( ) . id ( r.getChangeId ( ) ) . current ( ) ; com.google.gerrit.extensions.api.changes.ReviewInput in = new com.google.gerrit.extensions.api.changes.ReviewInput ( ) ; in.onBehalfOf = "doesnotexist" ; in.label ( "Code-Review" , 1 ) ; exception.expect ( com.google.gerrit.extensions.restapi.UnprocessableEntityException.class ) ; exception.expectMessage ( "Account Not Found: doesnotexist" ) ; revision.review ( in ) ; }

Target:
public void voteOnBehalfOfMissingUser ( ) throws java.lang.Exception { allowCodeReviewOnBehalfOf ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.api.changes.RevisionApi revision = gApi.changes ( ) . id ( r.getChangeId ( ) ) . current ( ) ; com.google.gerrit.extensions.api.changes.ReviewInput in = new com.google.gerrit.extensions.api.changes.ReviewInput ( ) ; in.onBehalfOf = "doesnotexist" ; in.label ( "Code-Review" , 1 ) ; exception.expect ( com.google.gerrit.extensions.restapi.UnprocessableEntityException.class ) ; exception.expectMessage ( "not found" ) ; exception.expectMessage ( "doesnotexist" ) ; revision.review ( in ) ; }
Source:
protected org.eclipse.jgit.junit.TestRepository < ? > createProjectWithPush ( java.lang.String name ) throws java.lang.Exception { return createProjectWithPush ( name , null ) ; }

Target:
protected org.eclipse.jgit.junit.TestRepository < ? > createProjectWithPush ( java.lang.String name , @ com.google.gerrit.common.Nullable com.google.gerrit.reviewdb.client.Project.NameKey parent , boolean createEmptyCommit , com.google.gerrit.extensions.client.SubmitType submitType ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey project = createProject ( name , parent , createEmptyCommit , submitType ) ; grant ( "push" , project , "refs/heads/*" ) ; grant ( "submit" , project , "refs/for/refs/heads/*" ) ; return cloneProject ( project ) ; }
Source:
public com.google.gerrit.server.data.PatchSetAttribute asPatchSetAttribute ( org.eclipse.jgit.revwalk.RevWalk revWalk , com.google.gerrit.reviewdb.client.PatchSet patchSet ) { return asPatchSetAttribute ( revWalk , patchSet ) ; }

Target:
public com.google.gerrit.server.data.PatchSetAttribute asPatchSetAttribute ( org.eclipse.jgit.revwalk.RevWalk revWalk , com.google.gerrit.reviewdb.client.PatchSet patchSet ) { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { return asPatchSetAttribute ( db , revWalk , patchSet ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.events.EventFactory.log.error ( "Cannot open database connection" , e ) ; return new com.google.gerrit.server.data.PatchSetAttribute ( ) ; } }
Source:
public GroupDescription.Basic get ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) { if ( uuid == null ) { return null ; } com.google.gerrit.server.account.GroupBackend b = backend ( uuid ) ; if ( b == null ) { com.google.gerrit.server.account.UniversalGroupBackend.log.warn ( ( "Unknown GroupBackend for UUID: " + uuid ) ) ; return null ; } return b.get ( uuid ) ; }

Target:
public GroupDescription.Basic get ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) { if ( uuid == null ) { return null ; } com.google.gerrit.server.account.GroupBackend b = backend ( uuid ) ; if ( b == null ) { com.google.gerrit.server.account.UniversalGroupBackend.log.debug ( ( "Unknown GroupBackend for UUID: " + uuid ) ) ; return null ; } return b.get ( uuid ) ; }
Source:
public void put ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid , com.google.gerrit.common.data.GroupReference reference ) { byUUID.put ( uuid , reference ) ; }

Target:
public void put ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid , com.google.gerrit.common.data.GroupReference reference ) { if ( ( uuid == null ) || ( ( uuid.get ( ) ) == null ) ) { com.google.gerrit.server.git.GroupList.log.warn ( "attempting to put null group in {}: {}" , project , reference ) ; return ; } byUUID.put ( uuid , reference ) ; }
Source:
public void execute ( ) { assert ( selfWidget ) != null ; assert ( widgetManager ) != null ; selfWidget.changed ( ) ; widgetManager.resizePaddingWidget ( ) ; }

Target:
public void execute ( ) { if ( ( diffChunkInfo ) != null ) { parent.resizePaddingOnOtherSide ( getCommentInfo ( ) . side ( ) , diffChunkInfo.getEnd ( ) ) ; } else { assert ( selfWidget ) != null ; assert ( widgetManager ) != null ; widgetManager.resizePaddingWidget ( ) ; } }
Source:
private com.google.gerrit.server.config.GetServerInfo.GerritInfo getGerritInfo ( org.eclipse.jgit.lib.Config cfg , com.google.gerrit.server.config.AllProjectsName allProjectsName , com.google.gerrit.server.config.AllUsersName allUsersName ) { com.google.gerrit.server.config.GetServerInfo.GerritInfo info = new com.google.gerrit.server.config.GetServerInfo.GerritInfo ( ) ; info.allProjects = allProjectsName.get ( ) ; info.allUsers = allUsersName.get ( ) ; info.reportBugUrl = cfg.getString ( "gerrit" , null , "reportBugUrl" ) ; info.reportBugText = cfg.getString ( "gerrit" , null , "reportBugText" ) ; return info ; }

Target:
private com.google.gerrit.server.config.GetServerInfo.GerritInfo getGerritInfo ( org.eclipse.jgit.lib.Config cfg , com.google.gerrit.server.config.AllProjectsName allProjectsName , com.google.gerrit.server.config.AllUsersName allUsersName ) { com.google.gerrit.server.config.GetServerInfo.GerritInfo info = new com.google.gerrit.server.config.GetServerInfo.GerritInfo ( ) ; info.allProjects = allProjectsName.get ( ) ; info.allUsers = allUsersName.get ( ) ; info.reportBugUrl = cfg.getString ( "gerrit" , null , "reportBugUrl" ) ; info.reportBugText = cfg.getString ( "gerrit" , null , "reportBugText" ) ; info.docUrl = getDocUrl ( cfg ) ; return info ; }
Source:
public static com.google.gerrit.extensions.common.SshKeyInfo newSshKeyInfo ( com.google.gerrit.server.account.AccountSshKey sshKey ) { com.google.gerrit.extensions.common.SshKeyInfo info = new com.google.gerrit.extensions.common.SshKeyInfo ( ) ; info.seq = sshKey.getKey ( ) . get ( ) ; info.sshPublicKey = sshKey.getSshPublicKey ( ) ; info.encodedKey = sshKey.getEncodedKey ( ) ; info.algorithm = sshKey.getAlgorithm ( ) ; info.comment = com.google.common.base.Strings.emptyToNull ( sshKey.getComment ( ) ) ; info.valid = sshKey.isValid ( ) ; return info ; }

Target:
public static com.google.gerrit.extensions.common.SshKeyInfo newSshKeyInfo ( com.google.gerrit.server.account.AccountSshKey sshKey ) { com.google.gerrit.extensions.common.SshKeyInfo info = new com.google.gerrit.extensions.common.SshKeyInfo ( ) ; info.seq = sshKey.seq ( ) ; info.sshPublicKey = sshKey.sshPublicKey ( ) ; info.encodedKey = sshKey.encodedKey ( ) ; info.algorithm = sshKey.algorithm ( ) ; info.comment = com.google.common.base.Strings.emptyToNull ( sshKey.comment ( ) ) ; info.valid = sshKey.valid ( ) ; return info ; }
Source:
private com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.rpc.NativeMap < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > > > publishedBase ( ) { return new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.rpc.NativeMap < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > > > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.rpc.NativeMap < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > > result ) { publishedBase = sort ( result.get ( path ) ) ; } } ; }

Target:
private com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.rpc.NativeMap < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > > > publishedBase ( ) { return new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.rpc.NativeMap < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > > > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.rpc.NativeMap < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > > result ) { publishedBase = sort ( result.get ( path ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ; }
Source:
public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo info ) { info.revisions ( ) . copyKeysIntoChildren ( "name" ) ; com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.ChangeInfo.RevisionInfo > list = info.revisions ( ) . values ( ) ; com.google.gerrit.client.changes.ChangeInfo.RevisionInfo.sortRevisionInfoByNumber ( list ) ; diffTable.setUpPatchSetNav ( list , diff ) ; header.setChangeInfo ( info ) ; }

Target:
public void run ( ) { int height = ( com.google.gwt.user.client.Window.getClientHeight ( ) ) - ( ( com.google.gerrit.client.Gerrit.getHeaderFooterHeight ( ) ) + 18 ) ; cmA.setHeight ( height ) ; cmB.setHeight ( height ) ; render ( diff ) ; commentManager.render ( comments , prefs.expandAllComments ( ) ) ; skipManager.render ( prefs.context ( ) , diff ) ; }
Source:
public com.google.gerrit.common.data.GroupInfo get ( final com.google.gerrit.reviewdb.client.AccountGroup.Id id ) { if ( id == null ) { return null ; } com.google.gerrit.common.data.GroupInfo r = groups.get ( id ) ; if ( r == null ) { r = new com.google.gerrit.common.data.GroupInfo ( id ) ; groups.put ( id , r ) ; } return r ; }

Target:
public com.google.gerrit.common.data.GroupInfo get ( final com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) { if ( uuid == null ) { return null ; } com.google.gerrit.common.data.GroupInfo r = groups.get ( uuid ) ; if ( r == null ) { r = new com.google.gerrit.common.data.GroupInfo ( uuid ) ; groups.put ( uuid , r ) ; } return r ; }
Source:
public void testCUSTOM_NoFullNameUser ( ) { setFrom ( "A ${user} B <my.server@email.address>" ) ; final java.lang.String email = "a.u.thor@test.example.com" ; final com.google.gerrit.reviewdb.client.Account.Id user = user ( null , email ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( user ) ; assertNotNull ( r ) ; assertEquals ( "A Anonymous Coward B" , r.name ) ; assertEquals ( "my.server@email.address" , r.email ) ; org.easymock.EasyMock.verify ( accountCache ) ; }

Target:
public void testCUSTOM_NullUser ( ) { setFrom ( "A ${user} B <my.server@email.address>" ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( null ) ; org.junit.Assert.assertNotNull ( r ) ; org.junit.Assert.assertEquals ( ident.getName ( ) , r.name ) ; org.junit.Assert.assertEquals ( "my.server@email.address" , r.email ) ; org.easymock.EasyMock.verify ( accountCache ) ; }
Source:
protected java.lang.String getSanitizedMethodName ( ) { java.lang.String name = testName.getMethodName ( ) . toLowerCase ( ) ; name = com.google.common.base.CharMatcher.javaLetterOrDigit ( ) . negate ( ) . replaceFrom ( name , '_' ) ; name = com.google.common.base.CharMatcher.is ( '_' ) . trimTrailingFrom ( name ) ; return name ; }

Target:
protected java.lang.String getSanitizedMethodName ( ) { java.lang.String name = testName.getMethodName ( ) . toLowerCase ( ) ; name = com.google.common.base.CharMatcher.inRange ( 'a' , 'z' ) . or ( com.google.common.base.CharMatcher.inRange ( 'A' , 'Z' ) ) . or ( com.google.common.base.CharMatcher.inRange ( '0' , '9' ) ) . negate ( ) . replaceFrom ( name , '_' ) ; name = com.google.common.base.CharMatcher.is ( '_' ) . trimTrailingFrom ( name ) ; return name ; }
Source:
private com.google.gerrit.server.git.strategy.SubmitStrategy createStrategy ( com.google.gerrit.server.git.MergeOp.OpenRepo or , com.google.gerrit.server.git.MergeTip mergeTip , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.extensions.client.SubmitType submitType , com.google.gerrit.server.git.CodeReviewCommit branchTip ) throws com.google.gerrit.server.git.IntegrationException { return submitStrategyFactory.create ( submitType , db , or.repo , or.rw , or.ins , or.canMergeFlag , getAlreadyAccepted ( or , branchTip ) , destBranch , caller , mergeTip , commits , submissionId ) ; }

Target:
private com.google.gerrit.server.git.strategy.SubmitStrategy createStrategy ( com.google.gerrit.server.git.MergeOpRepoManager.OpenRepo or , com.google.gerrit.server.git.MergeTip mergeTip , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.extensions.client.SubmitType submitType , com.google.gerrit.server.git.CodeReviewCommit branchTip ) throws com.google.gerrit.server.git.IntegrationException { return submitStrategyFactory.create ( submitType , db , or.repo , or.rw , or.ins , or.canMergeFlag , getAlreadyAccepted ( or , branchTip ) , destBranch , caller , mergeTip , commits , submissionId , submitInput.notify ) ; }
Source:
private boolean matchGroup ( com.google.gerrit.reviewdb.AccountGroup.UUID uuid ) { java.util.Set < com.google.gerrit.reviewdb.AccountGroup.UUID > userGroups = getCurrentUser ( ) . getEffectiveGroups ( ) ; return userGroups.contains ( uuid ) ; }

Target:
private boolean matchAny ( java.util.List < com.google.gerrit.common.data.PermissionRule > rules ) { java.util.Set < com.google.gerrit.reviewdb.AccountGroup.UUID > groups = user.getEffectiveGroups ( ) ; for ( com.google.gerrit.common.data.PermissionRule rule : rules ) { if ( com.google.gerrit.server.account.CapabilityControl.match ( groups , rule ) ) { return true ; } } return false ; }
Source:
public void ownersFile2Test ( ) throws java.lang.Exception { addFile ( "add OWNERS" , "OWNERS" , "per-file *.c=x@x\na@a\nc@c\nb@b\n" ) ; com.google.gerrit.acceptance.PushOneCommit.Result c2 = createChange ( "add t.c" , "t.c" , "Hello!" ) ; com.google.common.truth.Truth.assertThat ( getOwnersResponse ( c2 ) ) . contains ( "owners:[ x@x[1+0+0] ], files:[ t.c ]" ) ; com.google.gerrit.acceptance.PushOneCommit.Result c3 = createChange ( "add t.txt" , "t.txt" , "Test!" ) ; com.google.common.truth.Truth.assertThat ( getOwnersResponse ( c3 ) ) . contains ( "owners:[ a@a[1+0+0], b@b[1+0+0], c@c[1+0+0] ], files:[ t.txt ]" ) ; }

Target:
public void ownersFile2Test ( ) throws java.lang.Exception { addFile ( "add OWNERS" , "OWNERS" , "per-file *.c=x@x\na@a\nc@c\nb@b\n" ) ; com.google.gerrit.acceptance.PushOneCommit.Result c2 = createChange ( "add t.c" , "t.c" , "Hello!" ) ; java.lang.String ownerA = ownerJson ( "a@a" ) ; java.lang.String ownerB = ownerJson ( "b@b" ) ; java.lang.String ownerC = ownerJson ( "c@c" ) ; java.lang.String ownerX = ownerJson ( "x@x" ) ; com.google.common.truth.Truth.assertThat ( getOwnersResponse ( c2 ) ) . contains ( ( ( "owners:[ " + ownerX ) + " ], files:[ t.c ]" ) ) ; com.google.gerrit.acceptance.PushOneCommit.Result c3 = createChange ( "add t.txt" , "t.txt" , "Test!" ) ; com.google.common.truth.Truth.assertThat ( getOwnersResponse ( c3 ) ) . contains ( ( ( ( ( ( ( "owners:[ " + ownerA ) + ", " ) + ownerB ) + ", " ) + ownerC ) + " ], files:[ t.txt ]" ) ) ; }
Source:
public java.util.concurrent.atomic.AtomicLong load ( com.google.gerrit.reviewdb.client.Project.NameKey project ) throws java.io.IOException { try ( org.eclipse.jgit.lib.Repository git = gitManager.openRepository ( project ) ) { return new java.util.concurrent.atomic.AtomicLong ( com.googlesource.gerrit.plugins.quota.MaxRepositorySizeQuota.Loader.getDiskUsage ( git.getDirectory ( ) ) ) ; } }

Target:
public java.util.concurrent.atomic.AtomicLong load ( com.google.gerrit.reviewdb.client.Project.NameKey project ) throws java.io.IOException { try ( org.eclipse.jgit.lib.Repository git = gitManager.openRepository ( project ) ) { if ( useGitObjectCount ) { return new java.util.concurrent.atomic.AtomicLong ( getDiskUsageByGitObjectCount ( git ) ) ; } return new java.util.concurrent.atomic.AtomicLong ( com.googlesource.gerrit.plugins.quota.MaxRepositorySizeQuota.Loader.getDiskUsage ( git.getDirectory ( ) ) ) ; } }
Source:
private void columnStatus ( com.google.gwtexpui.safehtml.client.SafeHtmlBuilder sb , com.google.gerrit.client.diff.FileInfo info ) { sb.openTd ( ) . setStyleName ( com.google.gerrit.client.change.FileTable.R.css ( ) . status ( ) ) ; if ( ( ( ! ( Patch.COMMIT_MSG.equals ( info.path ( ) ) ) ) && ( ( info.status ( ) ) != null ) ) && ( ! ( ChangeType.MODIFIED.matches ( info.status ( ) ) ) ) ) { sb.append ( info.status ( ) ) ; } sb.closeTd ( ) ; }

Target:
private void columnStatus ( com.google.gwtexpui.safehtml.client.SafeHtmlBuilder sb , com.google.gerrit.client.info.FileInfo info ) { sb.openTd ( ) . setStyleName ( com.google.gerrit.client.change.FileTable.R.css ( ) . status ( ) ) ; if ( ( ( ! ( Patch.COMMIT_MSG.equals ( info.path ( ) ) ) ) && ( ( info.status ( ) ) != null ) ) && ( ! ( ChangeType.MODIFIED.matches ( info.status ( ) ) ) ) ) { sb.append ( info.status ( ) ) ; } sb.closeTd ( ) ; }