auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void update ( com.google.gerrit.reviewdb.client.Project.NameKey project ) throws java.io.IOException { try { for ( com.google.common.util.concurrent.CheckedFuture < ? , java.io.IOException > f : new com.google.gerrit.server.change.MergeabilityChecker.ProjectUpdateTask ( schemaFactory , project , false ) . call ( ) ) { f.checkedGet ( ) ; } } catch ( java.lang.Exception e ) { com.google.common.base.Throwables.propagateIfPossible ( e ) ; throw com.google.gerrit.server.change.MergeabilityChecker.MAPPER.apply ( e ) ; } }

Target:
public com.google.gerrit.reviewdb.server.ReviewDb get ( ) { if ( ( reviewDb ) == null ) { try { reviewDb = schemaFactory.open ( ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.inject.ProvisionException ( "Cannot open ReviewDb" , e ) ; } } return reviewDb ; }
Source:
public static com.google.gerrit.extensions.client.GeneralPreferencesInfo defaults ( ) { com.google.gerrit.extensions.client.GeneralPreferencesInfo p = new com.google.gerrit.extensions.client.GeneralPreferencesInfo ( ) ; p.changesPerPage = com.google.gerrit.extensions.client.GeneralPreferencesInfo.DEFAULT_PAGESIZE ; p.showSiteHeader = true ; p.useFlashClipboard = true ; p.emailStrategy = com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED ; p.reviewCategoryStrategy = com.google.gerrit.extensions.client.GeneralPreferencesInfo.ReviewCategoryStrategy.NONE ; p.downloadScheme = null ; p.downloadCommand = com.google.gerrit.extensions.client.GeneralPreferencesInfo.DownloadCommand.CHECKOUT ; p.dateFormat = com.google.gerrit.extensions.client.GeneralPreferencesInfo.DateFormat.STD ; p.timeFormat = com.google.gerrit.extensions.client.GeneralPreferencesInfo.TimeFormat.HHMM_12 ; p.relativeDateInChangeTable = false ; p.diffView = com.google.gerrit.extensions.client.GeneralPreferencesInfo.DiffView.SIDE_BY_SIDE ; p.sizeBarInChangeTable = true ; p.legacycidInChangeTable = false ; p.muteCommonPathPrefixes = true ; p.signedOffBy = false ; return p ; }

Target:
public static com.google.gerrit.extensions.client.GeneralPreferencesInfo defaults ( ) { com.google.gerrit.extensions.client.GeneralPreferencesInfo p = new com.google.gerrit.extensions.client.GeneralPreferencesInfo ( ) ; p.changesPerPage = com.google.gerrit.extensions.client.GeneralPreferencesInfo.DEFAULT_PAGESIZE ; p.showSiteHeader = true ; p.useFlashClipboard = true ; p.emailStrategy = com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED ; p.reviewCategoryStrategy = com.google.gerrit.extensions.client.GeneralPreferencesInfo.ReviewCategoryStrategy.NONE ; p.downloadScheme = null ; p.downloadCommand = com.google.gerrit.extensions.client.GeneralPreferencesInfo.DownloadCommand.CHECKOUT ; p.dateFormat = com.google.gerrit.extensions.client.GeneralPreferencesInfo.DateFormat.STD ; p.timeFormat = com.google.gerrit.extensions.client.GeneralPreferencesInfo.TimeFormat.HHMM_12 ; p.relativeDateInChangeTable = false ; p.diffView = com.google.gerrit.extensions.client.GeneralPreferencesInfo.DiffView.SIDE_BY_SIDE ; p.sizeBarInChangeTable = true ; p.legacycidInChangeTable = false ; p.muteCommonPathPrefixes = true ; p.signedOffBy = false ; p.defaultBaseForMerges = com.google.gerrit.extensions.client.GeneralPreferencesInfo.DefaultBase.FIRST_PARENT ; return p ; }
Source:
boolean filterMatch ( java.lang.String filter , com.google.gerrit.server.query.change.ChangeData changeData ) throws com.google.gerrit.server.query.QueryParseException , com.google.gwtorm.server.OrmException { com.google.common.base.Preconditions.checkNotNull ( filter ) ; com.google.gerrit.server.query.change.ChangeQueryBuilder qb = queryBuilder.create ( user.get ( ) ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > filterPredicate = qb.parse ( filter ) ; return filterPredicate.match ( changeData ) ; }

Target:
boolean filterMatch ( java.lang.String filter , com.google.gerrit.server.query.change.ChangeData changeData ) throws com.google.gerrit.server.query.QueryParseException , com.google.gwtorm.server.OrmException { com.google.common.base.Preconditions.checkNotNull ( filter ) ; com.google.gerrit.server.query.change.ChangeQueryBuilder qb = queryBuilder.asUser ( user.get ( ) ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > filterPredicate = qb.parse ( filter ) ; return filterPredicate.match ( changeData ) ; }
Source:
public void onClick ( com.google.gwt.user.client.ui.Widget sender ) { final java.lang.String newName = groupNameTxt.getText ( ) . trim ( ) ; Util.GROUP_SVC.renameGroup ( groupId , newName , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { saveName.setEnabled ( false ) ; setPageTitle ( Util.M.group ( newName ) ) ; } } ) ; }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { final java.lang.String newName = groupNameTxt.getText ( ) . trim ( ) ; Util.GROUP_SVC.renameGroup ( groupId , newName , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { saveName.setEnabled ( false ) ; setPageTitle ( Util.M.group ( newName ) ) ; } } ) ; }
Source:
public < T extends com.google.gerrit.server.permissions.ChangePermissionOrLabel > java.util.Set < T > test ( java.util.Collection < T > permSet ) throws com.google.gerrit.server.permissions.PermissionBackendException { java.util.Set < T > ok = com.google.gerrit.server.project.ChangeControl.newSet ( permSet ) ; for ( T perm : permSet ) { if ( can ( perm ) ) { ok.add ( perm ) ; } } return ok ; }

Target:
public < T extends com.google.gerrit.server.permissions.ChangePermissionOrLabel > java.util.Set < T > test ( java.util.Collection < T > permSet ) throws com.google.gerrit.server.permissions.PermissionBackendException { java.util.Set < T > ok = com.google.gerrit.server.permissions.ChangeControl.newSet ( permSet ) ; for ( T perm : permSet ) { if ( can ( perm ) ) { ok.add ( perm ) ; } } return ok ; }
Source:
private java.util.List < com.google.gerrit.client.reviewdb.Project > myOwnedProjects ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.Account.Id me = com.google.gerrit.client.rpc.RpcUtil.getAccountId ( ) ; final java.util.List < com.google.gerrit.client.reviewdb.Project > own = new java.util.ArrayList < com.google.gerrit.client.reviewdb.Project > ( ) ; for ( final com.google.gerrit.client.reviewdb.AccountGroup.Id groupId : groupCache.getGroups ( me ) ) { for ( final com.google.gerrit.client.reviewdb.Project g : db.projects ( ) . ownedByGroup ( groupId ) ) { own.add ( g ) ; } } return own ; }

Target:
private java.util.List < com.google.gerrit.client.reviewdb.Project > myOwnedProjects ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.Account.Id me = com.google.gerrit.client.rpc.Common.getAccountId ( ) ; final java.util.List < com.google.gerrit.client.reviewdb.Project > own = new java.util.ArrayList < com.google.gerrit.client.reviewdb.Project > ( ) ; for ( final com.google.gerrit.client.reviewdb.AccountGroup.Id groupId : groupCache.getGroups ( me ) ) { for ( final com.google.gerrit.client.reviewdb.Project g : db.projects ( ) . ownedByGroup ( groupId ) ) { own.add ( g ) ; } } return own ; }
Source:
public void deleteReviewerFromReviewableChangeNotifyOwnerReviewers ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; removeReviewer ( sc , extraReviewer , NotifyHandling.OWNER_REVIEWERS ) ; assertThat ( sender ) . sent ( "deleteReviewer" , sc ) . notTo ( sc.owner ) . to ( extraReviewer ) . cc ( extraCcer , sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . notTo ( sc.starrer ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void deleteReviewerFromReviewableChangeNotifyOwnerReviewers ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChangeWithExtraReviewer ( ) ; removeReviewer ( sc , extraReviewer , NotifyHandling.OWNER_REVIEWERS ) ; assertThat ( sender ) . sent ( "deleteReviewer" , sc ) . to ( extraReviewer ) . cc ( extraCcer , sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . noOneElse ( ) ; }
Source:
public void preDisplay ( final com.google.gerrit.common.data.ProjectDetail result ) { enableForm ( result.canModifyAgreements , result.canModifyDescription , result.canModifyMergeType ) ; saveProject.setVisible ( ( ( ( result.canModifyAgreements ) || ( result.canModifyDescription ) ) || ( result.canModifyMergeType ) ) ) ; display ( result ) ; }

Target:
public void preDisplay ( final com.google.gerrit.common.data.ProjectDetail result ) { enableForm ( result.canModifyAgreements , result.canModifyDescription , result.canModifyMergeType , result.canModifyState ) ; saveProject.setVisible ( ( ( ( ( result.canModifyAgreements ) || ( result.canModifyDescription ) ) || ( result.canModifyMergeType ) ) || ( result.canModifyState ) ) ) ; display ( result ) ; }
Source:
public void run ( ) { int line = ( cm.extras ( ) . hasActiveLine ( ) ) ? cm.getLineNumber ( cm.extras ( ) . activeLine ( ) ) : 0 ; int res = java.util.Collections.binarySearch ( chunks , new com.google.gerrit.client.diff.DiffChunkInfo ( cm.side ( ) , line , 0 , false ) , getDiffChunkComparator ( ) ) ; diffChunkNavHelper ( chunks , host , res , dir ) ; }

Target:
java.lang.Runnable diffChunkNav ( final net.codemirror.lib.CodeMirror cm , final com.google.gerrit.client.diff.Direction dir ) { return ( ) -> { int line = ( cm.extras ( ) . hasActiveLine ( ) ) ? cm.getLineNumber ( cm.extras ( ) . activeLine ( ) ) : 0 ; int res = java.util.Collections.binarySearch ( chunks , new com.google.gerrit.client.diff.DiffChunkInfo ( cm.side ( ) , line , 0 , false ) , getDiffChunkComparator ( ) ) ; diffChunkNavHelper ( chunks , host , res , dir ) ; } ; }
Source:
private void updateSelection ( ) { if ( cm.somethingSelected ( ) ) { net.codemirror.lib.TextMarker.FromTo r = cm.getSelectedRange ( ) ; if ( ( r.getTo ( ) . getLine ( ) ) >= ( line ) ) { cm.setSelection ( r.getFrom ( ) , r.getTo ( ) ) ; } } }

Target:
private void updateSelection ( ) { if ( cm.somethingSelected ( ) ) { net.codemirror.lib.TextMarker.FromTo r = cm.getSelectedRange ( ) ; if ( ( r.to ( ) . line ( ) ) >= ( line ) ) { cm.setSelection ( r.from ( ) , r.to ( ) ) ; } } }
Source:
public com.google.gerrit.extensions.common.GpgKeyInfo apply ( com.google.gerrit.gpg.server.GpgKey rsrc ) throws java.io.IOException { try ( com.google.gerrit.gpg.PublicKeyStore store = storeProvider.get ( ) ) { return com.google.gerrit.gpg.server.GpgKeys.toJson ( rsrc.getKeyRing ( ) . getPublicKey ( ) , checkerFactory.create ( rsrc.getUser ( ) ) , store ) ; } }

Target:
public com.google.gerrit.extensions.common.GpgKeyInfo apply ( com.google.gerrit.gpg.server.GpgKey rsrc ) throws java.io.IOException { try ( com.google.gerrit.gpg.PublicKeyStore store = storeProvider.get ( ) ) { return com.google.gerrit.gpg.server.GpgKeys.toJson ( rsrc.getKeyRing ( ) . getPublicKey ( ) , checkerFactory.create ( ) . setExpectedUser ( rsrc.getUser ( ) ) , store ) ; } }
Source:
public com.googlesource.gerrit.plugins.quota.Module.Holder load ( java.lang.String key ) throws java.lang.Exception { com.google.common.base.Optional < com.googlesource.gerrit.plugins.quota.AccountLimitsConfig.RateLimit > limit = finder.getRateLimit ( AccountLimitsConfig.Type.UPLOADPACK , anonymous ) ; if ( limit.isPresent ( ) ) { return new com.googlesource.gerrit.plugins.quota.Module.Holder ( com.googlesource.gerrit.plugins.quota.RateLimitUploadListener.createSmoothBurstyRateLimiter ( limit.get ( ) . getRatePerSecond ( ) , limit.get ( ) . getMaxBurstSeconds ( ) ) ) ; } return com.googlesource.gerrit.plugins.quota.Module.Holder.EMPTY ; }

Target:
public com.googlesource.gerrit.plugins.quota.Module.Holder load ( java.lang.String key ) throws java.lang.Exception { java.util.Optional < com.googlesource.gerrit.plugins.quota.AccountLimitsConfig.RateLimit > limit = finder.getRateLimit ( AccountLimitsConfig.Type.UPLOADPACK , anonymous ) ; if ( limit.isPresent ( ) ) { return new com.googlesource.gerrit.plugins.quota.Module.Holder ( com.googlesource.gerrit.plugins.quota.RateLimitUploadListener.createSmoothBurstyRateLimiter ( limit.get ( ) . getRatePerSecond ( ) , limit.get ( ) . getMaxBurstSeconds ( ) ) ) ; } return com.googlesource.gerrit.plugins.quota.Module.Holder.EMPTY ; }
Source:
private void fireEvent ( com.google.gerrit.reviewdb.client.Branch.NameKey branchName , final com.google.gerrit.server.events.Event event ) { for ( com.google.gerrit.common.ChangeHookRunner.ChangeListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( branchName , holder.user ) ) { holder.listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }

Target:
private void fireEvent ( com.google.gerrit.reviewdb.client.Branch.NameKey branchName , final com.google.gerrit.server.events.Event event ) { for ( com.google.gerrit.common.ChangeHookRunner.EventListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( branchName , holder.user ) ) { holder.listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }
Source:
private static boolean isNoteDbTestEnabled ( ) { final java.lang.String [ ] RUN_FLAGS = new java.lang.String [ ] { "yes" , "y" , "true" } ; java.lang.String value = java.lang.System.getenv ( "GERRIT_ENABLE_NOTEDB" ) ; return ( value != null ) && ( java.util.Arrays.asList ( RUN_FLAGS ) . contains ( value.toLowerCase ( ) ) ) ; }

Target:
protected com.google.gerrit.extensions.api.projects.BranchApi createBranch ( com.google.gerrit.reviewdb.client.Branch.NameKey branch ) throws java.lang.Exception { return gApi.projects ( ) . name ( branch.getParentKey ( ) . get ( ) ) . branch ( branch.get ( ) ) . create ( new com.google.gerrit.extensions.api.projects.BranchInput ( ) ) ; }
Source:
protected com.google.template.soy.tofu.SoyTofu getTofu ( ) { com.google.template.soy.SoyFileSet.Builder builder = new com.google.template.soy.SoyFileSet.Builder ( ) . setCompileTimeGlobals ( globals ) ; for ( java.net.URL template : templates ) { try { com.google.common.base.Preconditions.checkState ( new java.io.File ( template.toURI ( ) ) . exists ( ) , "Missing Soy template %s" , template ) ; } catch ( java.net.URISyntaxException e ) { throw new java.lang.IllegalStateException ( e ) ; } builder.add ( template ) ; } return builder.build ( ) . compileToTofu ( ) ; }

Target:
protected com.google.template.soy.tofu.SoyTofu getTofu ( ) { com.google.template.soy.SoyFileSet.Builder builder = com.google.template.soy.SoyFileSet.builder ( ) . setCompileTimeGlobals ( globals ) ; for ( java.net.URL template : templates ) { try { com.google.common.base.Preconditions.checkState ( new java.io.File ( template.toURI ( ) ) . exists ( ) , "Missing Soy template %s" , template ) ; } catch ( java.net.URISyntaxException e ) { throw new java.lang.IllegalStateException ( e ) ; } builder.add ( template ) ; } return builder.build ( ) . compileToTofu ( ) ; }
Source:
private static java.lang.String oldFileName ( final com.google.gerrit.server.patch.DiffCacheKey key , final org.spearce.jgit.patch.FileHeader fh ) { if ( fh != null ) { if ( ( org.spearce.jgit.lib.FileMode.MISSING ) == ( fh.getOldMode ( ) ) ) { return null ; } if ( FileHeader.DEV_NULL.equals ( fh.getOldName ( ) ) ) { return null ; } return fh.getOldName ( ) ; } if ( ( key.getSourceFileName ( ) ) != null ) { return key.getSourceFileName ( ) ; } return key.getFileName ( ) ; }

Target:
private static java.lang.String newName ( final com.google.gerrit.server.patch.PatchListEntry entry ) { switch ( entry.getChangeType ( ) ) { case DELETED : return null ; case ADDED : case MODIFIED : case COPIED : case RENAMED : default : return entry.getNewName ( ) ; } }
Source:
public static boolean isRefsEditOf ( java.lang.String ref , com.google.gerrit.reviewdb.client.Account.Id accountId ) { if ( accountId == null ) { return false ; } java.lang.String prefix = new java.lang.StringBuilder ( com.google.gerrit.reviewdb.client.RefNames.refsUsers ( accountId ) ) . append ( '/' ) . append ( com.google.gerrit.reviewdb.client.RefNames.EDIT_PREFIX ) . toString ( ) ; return ref.startsWith ( prefix ) ; }

Target:
public static java.lang.String refsEditPrefix ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { return ( ( com.google.gerrit.reviewdb.client.RefNames.refsUsers ( accountId ) ) + '/' ) + ( com.google.gerrit.reviewdb.client.RefNames.EDIT_PREFIX ) ; }
Source:
static com.googlesource.gerrit.plugins.findowners.OwnersDb get ( com.googlesource.gerrit.plugins.findowners.Server server , java.lang.String key , org.eclipse.jgit.lib.Repository repository , java.lang.String branch , java.util.Collection < java.lang.String > files ) { return com.googlesource.gerrit.plugins.findowners.Cache.get ( server , key , repository , null , null , branch , files ) ; }

Target:
com.googlesource.gerrit.plugins.findowners.OwnersDb get ( org.eclipse.jgit.lib.Repository repository , com.google.gerrit.server.query.change.ChangeData changeData , int patchset ) throws com.google.gwtorm.server.OrmException { java.lang.String branch = changeData.change ( ) . getDest ( ) . get ( ) ; java.lang.String dbKey = com.googlesource.gerrit.plugins.findowners.Cache.makeKey ( changeData.getId ( ) . get ( ) , patchset , branch ) ; return get ( dbKey , repository , branch , changeData.currentFilePaths ( ) ) ; }
Source:
public boolean isEnabled ( com.google.gerrit.server.change.ChangeResource resource ) { return ( ( resource.getChange ( ) . getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.ABANDONED ) ) && ( resource.getControl ( ) . canRestore ( ) ) ; }

Target:
public UiAction.Description getDescription ( com.google.gerrit.server.change.ChangeResource resource ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Restore" ) . setVisible ( ( ( ( resource.getChange ( ) . getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.ABANDONED ) ) && ( resource.getControl ( ) . canRestore ( ) ) ) ) ; }
Source:
public void setFrom ( final com.google.gerrit.reviewdb.client.Account.Id id ) { super . setFrom ( id ) ; final com.google.gerrit.server.IdentifiedUser user = args.identifiedUserFactory.create ( id ) ; emailOnlyAuthors = ! ( user.getCapabilities ( ) . canEmailReviewers ( ) ) ; }

Target:
public void setFrom ( com.google.gerrit.reviewdb.client.Account.Id id ) { super . setFrom ( id ) ; try { com.google.gerrit.server.IdentifiedUser user = args.identifiedUserFactory.create ( id ) ; args.permissionBackend.user ( user ) . check ( GlobalPermission.EMAIL_REVIEWERS ) ; } catch ( com.google.gerrit.extensions.restapi.AuthException | com.google.gerrit.server.permissions.PermissionBackendException e ) { emailOnlyAuthors = true ; } }
Source:
private com.google.gerrit.server.change.ChangeJson.ChangeInfo format ( com.google.gerrit.server.query.change.ChangeData cd , com.google.common.base.Optional < com.google.gerrit.reviewdb.client.PatchSet.Id > limitToPsId ) throws com.google.gwtorm.server.OrmException { accountLoader = accountLoaderFactory.create ( has ( com.google.gerrit.common.changes.ListChangesOption.DETAILED_ACCOUNTS ) ) ; com.google.gerrit.server.change.ChangeJson.ChangeInfo res = toChangeInfo ( cd , limitToPsId ) ; accountLoader.fill ( ) ; return res ; }

Target:
private com.google.gerrit.server.change.ChangeJson.ChangeInfo format ( com.google.gerrit.server.query.change.ChangeData cd , com.google.common.base.Optional < com.google.gerrit.reviewdb.client.PatchSet.Id > limitToPsId ) throws com.google.gwtorm.server.OrmException { accountLoader = accountLoaderFactory.create ( has ( com.google.gerrit.extensions.common.ListChangesOption.DETAILED_ACCOUNTS ) ) ; com.google.gerrit.server.change.ChangeJson.ChangeInfo res = toChangeInfo ( cd , limitToPsId ) ; accountLoader.fill ( ) ; return res ; }
Source:
public com.google.gerrit.extensions.api.changes.SubmittedTogetherInfo submittedTogether ( java.util.EnumSet < com.google.gerrit.extensions.client.ListChangesOption > listOptions , java.util.EnumSet < com.google.gerrit.extensions.api.changes.SubmittedTogetherOption > submitOptions ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return submittedTogether.get ( ) . addListChangesOption ( listOptions ) . addSubmittedTogetherOption ( submitOptions ) . applyInfo ( change ) ; } catch ( java.io.IOException | com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot query submittedTogether" , e ) ; } }

Target:
public com.google.gerrit.extensions.api.changes.SubmittedTogetherInfo submittedTogether ( java.util.EnumSet < com.google.gerrit.extensions.client.ListChangesOption > listOptions , java.util.EnumSet < com.google.gerrit.extensions.api.changes.SubmittedTogetherOption > submitOptions ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return submittedTogether.get ( ) . addListChangesOption ( listOptions ) . addSubmittedTogetherOption ( submitOptions ) . applyInfo ( change ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot query submittedTogether" , e ) ; } }
Source:
public void publishDraftChange ( ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createDraftChange ( ) ; com.google.gerrit.server.change.ChangeJson.ChangeInfo c = getChange ( changeId ) ; org.junit.Assert.assertEquals ( ( "p~master~" + changeId ) , c.id ) ; org.junit.Assert.assertEquals ( Change.Status.DRAFT , c.status ) ; com.google.gerrit.acceptance.RestResponse r = publishChange ( changeId ) ; org.junit.Assert.assertEquals ( 204 , r.getStatusCode ( ) ) ; c = getChange ( changeId ) ; org.junit.Assert.assertEquals ( Change.Status.NEW , c.status ) ; }

Target:
public void publishDraftPatchSet ( ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createDraftChange ( ) ; java.lang.String triplet = "p~master~" + changeId ; com.google.gerrit.extensions.common.ChangeInfo c = get ( triplet ) ; org.junit.Assert.assertEquals ( triplet , c.id ) ; org.junit.Assert.assertEquals ( ChangeStatus.DRAFT , c.status ) ; com.google.gerrit.acceptance.RestResponse r = publishPatchSet ( changeId ) ; org.junit.Assert.assertEquals ( 204 , r.getStatusCode ( ) ) ; org.junit.Assert.assertEquals ( ChangeStatus.NEW , get ( triplet ) . status ) ; }
Source:
public void pushBypassPrivateByDefaultEnabled ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( createChange ( "refs/for/master%remove-private" ) . getChange ( ) . change ( ) . isPrivate ( ) ) . isEqualTo ( false ) ; }

Target:
public void createChangeBypassPrivateByDefaultEnabled ( ) throws java.lang.Exception { setPrivateByDefault ( project2 , InheritableBoolean.TRUE ) ; com.google.gerrit.extensions.common.ChangeInput input = new com.google.gerrit.extensions.common.ChangeInput ( project2.get ( ) , "master" , "empty change" ) ; input.isPrivate = false ; com.google.common.truth.Truth.assertThat ( gApi.changes ( ) . create ( input ) . get ( ) . isPrivate ) . isNull ( ) ; }
Source:
public void newPatchSetByOtherOnReviewableChangeNotifyOwnerInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%notify=OWNER" , other ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . notTo ( sc.owner , sc.starrer , other ) . to ( sc.reviewer ) . cc ( sc.ccer ) . notTo ( sc.reviewerByEmail , sc.ccerByEmail ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }

Target:
public void newPatchSetByOtherOnReviewableChangeNotifyOwner ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%notify=OWNER" , other ) ; assertThat ( sender ) . notSent ( ) ; }
Source:
public static boolean isPermission ( java.lang.String varName ) { java.lang.String lc = varName.toLowerCase ( ) ; if ( lc.startsWith ( com.google.gerrit.common.data.Permission.LABEL ) ) { return ( com.google.gerrit.common.data.Permission.LABEL.length ( ) ) < ( lc.length ( ) ) ; } return com.google.gerrit.common.data.Permission.NAMES_LC.contains ( lc ) ; }

Target:
public static java.lang.String forLabelAs ( java.lang.String labelName ) { return ( com.google.gerrit.common.data.Permission.LABEL_AS ) + labelName ; }
Source:
public com.google.common.util.concurrent.CheckedFuture < ? , java.io.IOException > indexAsync ( com.google.gerrit.reviewdb.client.Change.Id id ) { return ( executor ) != null ? submit ( new com.google.gerrit.server.index.ChangeIndexer.IndexTask ( id ) ) : com.google.common.util.concurrent.Futures.< java.lang.Object , java.io.IOException > immediateCheckedFuture ( null ) ; }

Target:
public com.google.common.util.concurrent.CheckedFuture < ? , java.io.IOException > indexAsync ( com.google.gerrit.reviewdb.client.Project.NameKey project , java.util.Collection < com.google.gerrit.reviewdb.client.Change.Id > ids ) { java.util.List < com.google.common.util.concurrent.ListenableFuture < ? > > futures = new java.util.ArrayList ( ids.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.Change.Id id : ids ) { futures.add ( indexAsync ( project , id ) ) ; } return com.google.gerrit.server.index.ChangeIndexer.allAsList ( futures ) ; }
Source:
void display ( final java.util.List < com.google.gerrit.reviewdb.client.AccountGroupInclude > result ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.reviewdb.client.AccountGroupInclude k : result ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , k ) ; } }

Target:
void display ( final java.util.List < com.google.gerrit.reviewdb.client.AccountGroupIncludeByUuid > result ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.reviewdb.client.AccountGroupIncludeByUuid k : result ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , k ) ; } }
Source:
public void doAction ( com.google.gerrit.server.IdentifiedUser user , com.googlesource.gerrit.plugins.github.oauth.GitHubLogin hubLogin , javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse resp , com.googlesource.gerrit.plugins.github.wizard.ControllerErrors errors ) throws java.io.IOException , javax.servlet.ServletException { com.googlesrouce.gerrit.plugins.github.git.GitImporter cloner = clonerProvider.get ( ) ; com.google.gson.JsonArray reposStatus = new com.google.gson.JsonArray ( ) ; for ( com.googlesrouce.gerrit.plugins.github.git.GitJob job : cloner.getCloneJobs ( ) ) { reposStatus.add ( getJsonStatus ( job ) ) ; } resp.getWriter ( ) . println ( reposStatus.toString ( ) ) ; }

Target:
public void doAction ( com.google.gerrit.server.IdentifiedUser user , com.googlesource.gerrit.plugins.github.oauth.GitHubLogin hubLogin , javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse resp , com.googlesource.gerrit.plugins.github.wizard.ControllerErrors errors ) throws java.io.IOException , javax.servlet.ServletException { respondWithJobStatusJson ( resp , clonerProvider.get ( ) ) ; }
Source:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { final com.google.gerrit.reviewdb.client.Change change = object.change ( ) ; if ( change == null ) { return false ; } final com.google.gerrit.server.IdentifiedUser owner = userFactory.create ( dbProvider , change.getOwner ( ) ) ; return owner.memberOf ( uuid ) ; }

Target:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { final com.google.gerrit.reviewdb.client.Change change = object.change ( ) ; if ( change == null ) { return false ; } final com.google.gerrit.server.IdentifiedUser owner = userFactory.create ( dbProvider , change.getOwner ( ) ) ; return owner.getEffectiveGroups ( ) . contains ( uuid ) ; }
Source:
private com.google.gerrit.server.data.ApprovalAttribute getApprovalAttribute ( com.google.gerrit.common.data.LabelType label ) { com.google.gerrit.server.data.ApprovalAttribute [ ] aa = lastCommentAddedEvent.approvals.get ( ) ; com.google.gerrit.server.data.ApprovalAttribute res = null ; for ( int i = 0 ; i < ( aa.length ) ; i ++ ) { if ( aa [ i ] . description.equals ( label.getName ( ) ) ) { res = aa [ i ] ; } } return res ; }

Target:
private com.google.gerrit.acceptance.server.event.CommentAddedEventIT.ApprovalValues getApprovalValues ( com.google.gerrit.common.data.LabelType label ) { com.google.gerrit.acceptance.server.event.CommentAddedEventIT.ApprovalValues res = new com.google.gerrit.acceptance.server.event.CommentAddedEventIT.ApprovalValues ( ) ; com.google.gerrit.extensions.common.ApprovalInfo info = lastCommentAddedEvent.getApprovals ( ) . get ( label.getName ( ) ) ; if ( info != null ) { res.value = info.value ; } info = lastCommentAddedEvent.getOldApprovals ( ) . get ( label.getName ( ) ) ; if ( info != null ) { res.oldValue = info.value ; } return res ; }
Source:
public java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > apply ( com.google.gerrit.server.change.ChangeResource rsrc ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ! ( self.get ( ) . isIdentifiedUser ( ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Authentication required" ) ; } return reviewersUtil.suggestReviewers ( rsrc.getNotes ( ) , this , rsrc.getControl ( ) . getProjectControl ( ) , getVisibility ( rsrc ) , excludeGroups ) ; }

Target:
public java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > apply ( com.google.gerrit.server.change.ChangeResource rsrc ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ! ( self.get ( ) . isIdentifiedUser ( ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Authentication required" ) ; } return reviewersUtil.suggestReviewers ( rsrc.getNotes ( ) , this , rsrc.getControl ( ) . getProjectControl ( ) . getProjectState ( ) , getVisibility ( rsrc ) , excludeGroups ) ; }
Source:
public void execute ( ) { try { onResult ( lastScript , false ) ; } finally { RpcStatus.INSTANCE.onRpcComplete ( null ) ; } }

Target:
public void onSuccess ( com.google.gerrit.common.data.PatchSetDetail result ) { patchSetDetail = result ; if ( ( fileList ) == null ) { fileList = new com.google.gerrit.client.changes.PatchTable ( prefs ) ; fileList.display ( result ) ; patchIndex = fileList.indexOf ( patchKey ) ; } refresh ( true ) ; }
Source:
private boolean isMember ( com.google.gerrit.reviewdb.client.AccountGroup group , com.google.gerrit.server.IdentifiedUser user ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.AccountGroup.UUID groupUuid = group.getGroupUUID ( ) ; try { return groups.isMember ( db.get ( ) , groupUuid , user.getAccountId ( ) ) ; } catch ( com.google.gerrit.common.errors.NoSuchGroupException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( java.lang.String.format ( "Group %s not found" , groupUuid ) ) ; } }

Target:
private boolean isMember ( com.google.gerrit.common.data.GroupDescription.Internal group , com.google.gerrit.server.IdentifiedUser user ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.AccountGroup.UUID groupUuid = group.getGroupUUID ( ) ; try { return groups.isMember ( db.get ( ) , groupUuid , user.getAccountId ( ) ) ; } catch ( com.google.gerrit.common.errors.NoSuchGroupException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( java.lang.String.format ( "Group %s not found" , groupUuid ) ) ; } }
Source:
public void testBlockRule_ParentBlocksChild ( ) { grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/tags/*" ) ; grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/tags/*" ) . setBlock ( ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertFalse ( "u can't force update tag" , u.controlForRef ( "refs/tags/V10" ) . canForceUpdate ( ) ) ; }

Target:
public void testSortWithRegex ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "^refs/heads/.*" ) ; com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.ANONYMOUS , "^refs/heads/.*-QA-.*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertTrue ( "u can read" , u.controlForRef ( "refs/heads/foo-QA-bar" ) . isVisible ( ) ) ; assertTrue ( "d can read" , d.controlForRef ( "refs/heads/foo-QA-bar" ) . isVisible ( ) ) ; }
Source:
public void onFailure ( final java.lang.Throwable caught ) { if ( ( rpcSequence ) == rpcseq ) { if ( ( isNoDifferences ( caught ) ) && ( ! isFirst ) ) { historyTable.enableAll ( true ) ; showPatch ( false ) ; } else { super . onFailure ( caught ) ; } } }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent arg0 ) { if ( showFullFileBox.getValue ( ) ) { contextLines = com.google.gerrit.client.reviewdb.AccountGeneralPreferences.WHOLE_FILE_CONTEXT ; } else { initContextLines ( ) ; } refresh ( false ) ; }
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 ( ) . isAdmin_DoNotUse ( ) ) ; } return isOwner ; }

Target:
public boolean isVisible ( ) { return ( ( ( ( user.isInternalUser ( ) ) || ( groupBackend.isVisibleToAll ( group.getGroupUUID ( ) ) ) ) || ( user.getEffectiveGroups ( ) . contains ( group.getGroupUUID ( ) ) ) ) || ( isOwner ( ) ) ) || ( canAdministrateServer ( ) ) ; }
Source:
private boolean noNeedToAbandon ( com.google.gerrit.server.query.change.ChangeData cd , java.lang.String query ) throws com.google.gerrit.server.query.QueryParseException , com.google.gwtorm.server.OrmException { java.lang.String newQuery = ( query + " change:" ) + ( cd.getId ( ) ) ; java.util.List < com.google.gerrit.server.query.change.ChangeData > changesToAbandon = queryProcessor.enforceVisibility ( false ) . queryChanges ( queryBuilder.parse ( newQuery ) ) . changes ( ) ; return changesToAbandon.isEmpty ( ) ; }

Target:
private boolean noNeedToAbandon ( com.google.gerrit.server.query.change.ChangeData cd , java.lang.String query ) throws com.google.gerrit.server.query.QueryParseException , com.google.gwtorm.server.OrmException { java.lang.String newQuery = ( query + " change:" ) + ( cd.getId ( ) ) ; java.util.List < com.google.gerrit.server.query.change.ChangeData > changesToAbandon = queryProcessor.enforceVisibility ( false ) . query ( queryBuilder.parse ( newQuery ) ) . entities ( ) ; return changesToAbandon.isEmpty ( ) ; }
Source:
public void onKeyPress ( com.google.gwt.event.dom.client.KeyPressEvent event ) { submitOnSelection = false ; if ( ( event.getCharCode ( ) ) == ( com.google.gwt.event.dom.client.KeyCodes.KEY_ENTER ) ) { if ( suggestions.isSuggestionListShowing ( ) ) { submitOnSelection = true ; } else { com.google.gwt.event.logical.shared.SelectionEvent.fire ( this , getValue ( ) ) ; } } }

Target:
public void onKeyPress ( com.google.gwt.event.dom.client.KeyPressEvent event ) { submitOnSelection = false ; if ( ( event.getNativeEvent ( ) . getKeyCode ( ) ) == ( com.google.gwt.event.dom.client.KeyCodes.KEY_ENTER ) ) { if ( suggestions.isSuggestionListShowing ( ) ) { submitOnSelection = true ; } else { com.google.gwt.event.logical.shared.SelectionEvent.fire ( this , getValue ( ) ) ; } } }
Source:
private static boolean havePGP ( ) { try { java.lang.Class.forName ( org.bouncycastle.openpgp.PGPPublicKey.class . getName ( ) ) ; com.google.gerrit.server.contact.ContactStoreProvider.addBouncyCastleProvider ( ) ; return true ; } catch ( java.lang.NoClassDefFoundError | java.lang.ClassNotFoundException | java.lang.SecurityException | java.lang.NoSuchMethodException | java.lang.InstantiationException | java.lang.IllegalAccessException | java.lang.reflect.InvocationTargetException | java.lang.ClassCastException noBouncyCastle ) { return false ; } }

Target:
private static boolean havePGP ( ) { try { java.lang.Class.forName ( org.bouncycastle.openpgp.PGPPublicKey.class . getName ( ) ) ; com.google.gerrit.server.contact.ContactStoreModule.addBouncyCastleProvider ( ) ; return true ; } catch ( java.lang.NoClassDefFoundError | java.lang.ClassNotFoundException | java.lang.SecurityException | java.lang.NoSuchMethodException | java.lang.InstantiationException | java.lang.IllegalAccessException | java.lang.reflect.InvocationTargetException | java.lang.ClassCastException noBouncyCastle ) { return false ; } }
Source:
private com.google.gerrit.server.git.MergeOp.OpenRepo openRepo ( com.google.gerrit.reviewdb.client.Project.NameKey project ) throws com.google.gerrit.server.project.NoSuchProjectException , java.io.IOException { com.google.gerrit.server.git.MergeOp.OpenRepo repo = openRepos.get ( project ) ; if ( repo == null ) { com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( project ) ; if ( projectState == null ) { throw new com.google.gerrit.server.project.NoSuchProjectException ( project ) ; } try { repo = new com.google.gerrit.server.git.MergeOp.OpenRepo ( repoManager.openRepository ( project ) , projectState ) ; } catch ( org.eclipse.jgit.errors.RepositoryNotFoundException e ) { throw new com.google.gerrit.server.project.NoSuchProjectException ( project ) ; } openRepos.put ( project , repo ) ; } return repo ; }

Target:
private com.google.gerrit.server.git.MergeOp.OpenRepo getRepo ( com.google.gerrit.reviewdb.client.Project.NameKey project ) { com.google.gerrit.server.git.MergeOp.OpenRepo or = openRepos.get ( project ) ; com.google.common.base.Preconditions.checkState ( ( or != null ) , "repo not yet opened: %s" , project ) ; return or ; }
Source:
private boolean canCreateCommit ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevCommit commit ) { if ( canUpdate ( ) ) { return true ; } else if ( isMergedIntoBranchOrTag ( repo , commit ) ) { return true ; } return false ; }

Target:
private java.lang.String canCreateCommit ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevCommit commit , java.lang.String userId ) { if ( canUpdate ( ) ) { return null ; } else if ( projectControl.isReachableFromHeadsOrTags ( repo , commit ) ) { return null ; } return ( ( userId + " lacks permission " ) + ( com.google.gerrit.common.data.Permission.PUSH ) ) + " for creating new commit object" ; }
Source:
protected void ccExistingReviewers ( ) { try { for ( com.google.gerrit.reviewdb.client.Account.Id id : changeData.reviewers ( ) . get ( com.google.gerrit.server.notedb.ReviewerStateInternal.REVIEWER ) ) { add ( RecipientType.CC , id ) ; } } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.ChangeEmail.log.warn ( "Cannot CC users that commented on updated change" , err ) ; } }

Target:
protected void ccExistingReviewers ( ) { if ( ( ! ( NotifyHandling.ALL.equals ( notify ) ) ) && ( ! ( NotifyHandling.OWNER_REVIEWERS.equals ( notify ) ) ) ) { return ; } try { for ( com.google.gerrit.reviewdb.client.Account.Id id : changeData.reviewers ( ) . get ( com.google.gerrit.server.notedb.ReviewerStateInternal.REVIEWER ) ) { add ( RecipientType.CC , id ) ; } } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.ChangeEmail.log.warn ( "Cannot CC users that commented on updated change" , err ) ; } }
Source:
public void run ( ) { try ( java.io.BufferedReader br = new java.io.BufferedReader ( new java.io.InputStreamReader ( in , java.nio.charset.StandardCharsets.ISO_8859_1.name ( ) ) ) ) { java.lang.String line ; while ( ( line = br.readLine ( ) ) != null ) { com.google.gerrit.httpd.gitweb.GitwebServlet.log.error ( ( "CGI: " + line ) ) ; } } catch ( java.io.IOException e ) { com.google.gerrit.httpd.gitweb.GitwebServlet.log.debug ( "Unexpected error copying stderr from CGI" , e ) ; } }

Target:
private void copyStderrToLog ( final java.io.InputStream in ) { new java.lang.Thread ( ( ) -> { try ( java.io.BufferedReader br = new java.io.BufferedReader ( new java.io.InputStreamReader ( in , java.nio.charset.StandardCharsets.ISO_8859_1.name ( ) ) ) ) { java.lang.String line ; while ( ( line = br.readLine ( ) ) != null ) { com.google.gerrit.httpd.gitweb.GitwebServlet.log.error ( ( "CGI: " + line ) ) ; } } catch ( java.io.IOException e ) { com.google.gerrit.httpd.gitweb.GitwebServlet.log.debug ( "Unexpected error copying stderr from CGI" , e ) ; } } , "Gitweb-ErrorLogger" ) . start ( ) ; }
Source:
public void addReviewerToReviewableChangeByOtherCcingSelfInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.TestAccount other = accounts.create ( "other" , "other@example.com" , "other" ) ; forAll ( ( adder ) -> { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; com.google.gerrit.acceptance.TestAccount reviewer = accounts.create ( "added" , "added@example.com" , "added" ) ; addReviewer ( adder , sc.changeId , other , reviewer.email , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS , null ) ; assertThat ( sender ) . sent ( "newchange" , sc ) . to ( reviewer ) . cc ( sc.owner , sc.reviewer , other ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . noOneElse ( ) ; } ) ; }

Target:
public void addReviewerToReviewableChangeByOtherCcingSelfInNoteDbBatch ( ) throws java.lang.Exception { addReviewerToReviewableChangeByOtherCcingSelfInNoteDb ( batch ( ) ) ; }
Source:
public void onSend ( ) { com.google.gerrit.client.changes.ChangeApi.createChange ( project , getDestinationBranch ( ) , message.getText ( ) , null , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.changes.ChangeInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { sent = true ; hide ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( result.legacyId ( ) ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { enableButtons ( true ) ; super . onFailure ( caught ) ; } } ) ; }

Target:
public void onSend ( ) { com.google.gerrit.client.changes.ChangeApi.createChange ( project , getDestinationBranch ( ) , getDestinationTopic ( ) , message.getText ( ) , null , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.changes.ChangeInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { sent = true ; hide ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( result.legacyId ( ) ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { enableButtons ( true ) ; super . onFailure ( caught ) ; } } ) ; }
Source:
public com.google.gerrit.reviewdb.client.PatchSet patch ( com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { if ( ( ( currentPatchSet ) != null ) && ( currentPatchSet.getId ( ) . equals ( psId ) ) ) { return currentPatchSet ; } for ( com.google.gerrit.reviewdb.client.PatchSet ps : patches ( ) ) { if ( ps.getId ( ) . equals ( psId ) ) { return ps ; } } return null ; }

Target:
public java.util.Collection < com.google.gerrit.reviewdb.client.PatchSet > patchSets ( ) throws com.google.gwtorm.server.OrmException { if ( ( patchSets ) == null ) { patchSets = db.patchSets ( ) . byChange ( legacyId ) . toList ( ) ; } return patchSets ; }
Source:
public void addReviewer ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.api.changes.AddReviewerInput in = new com.google.gerrit.extensions.api.changes.AddReviewerInput ( ) ; in.reviewer = user.email ; gApi.changes ( ) . id ( r.getChangeId ( ) ) . addReviewer ( in ) ; com.google.common.truth.Truth.assertThat ( getReviewers ( r.getChangeId ( ) ) ) . containsExactlyElementsIn ( com.google.common.collect.ImmutableSet.of ( user.id ) ) ; }

Target:
public void addReviewer ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.api.changes.AddReviewerInput in = new com.google.gerrit.extensions.api.changes.AddReviewerInput ( ) ; in.reviewer = user.email ; gApi.changes ( ) . id ( r.getChangeId ( ) ) . addReviewer ( in ) ; com.google.common.truth.Truth.assertThat ( ( ( java.lang.Iterable < ? > ) ( getReviewers ( r.getChangeId ( ) ) ) ) ) . containsExactlyElementsIn ( com.google.common.collect.ImmutableSet.of ( user.id ) ) ; }
Source:
private com.google.inject.Injector createSysInjector ( ) { java.util.List < com.google.inject.Module > modules = com.google.common.collect.Lists.newArrayList ( ) ; com.google.inject.Module changeIndexModule ; switch ( com.google.gerrit.server.index.IndexModule.getIndexType ( dbInjector ) ) { case LUCENE : changeIndexModule = new com.google.gerrit.lucene.LuceneIndexModule ( version , threads , outputBase ) ; break ; case SOLR : changeIndexModule = new com.google.gerrit.solr.SolrIndexModule ( false , threads , outputBase ) ; break ; default : throw new java.lang.IllegalStateException ( "unsupported index.type" ) ; } modules.add ( changeIndexModule ) ; HEAD ( 4512.0F ) ; com.google.gerrit.pgm.e Enable ; }

Target:
private com.google.inject.Injector createSysInjector ( ) { java.util.List < com.google.inject.Module > modules = com.google.common.collect.Lists.newArrayList ( ) ; com.google.inject.Module changeIndexModule ; switch ( com.google.gerrit.server.index.IndexModule.getIndexType ( dbInjector ) ) { case LUCENE : changeIndexModule = new com.google.gerrit.lucene.LuceneIndexModule ( version , threads , outputBase ) ; break ; case SOLR : changeIndexModule = new com.google.gerrit.solr.SolrIndexModule ( false , threads , outputBase ) ; break ; default : throw new java.lang.IllegalStateException ( "unsupported index.type" ) ; } modules.add ( changeIndexModule ) ; modules.add ( dbInjector.getInstance ( com.google.gerrit.pgm.util.BatchProgramModule.class ) ) ; return dbInjector.createChildInjector ( modules ) ; }