auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean isOwner ( ) { if ( ( getCurrentUser ( ) ) instanceof com.google.gerrit.server.IdentifiedUser ) { final com.google.gerrit.server.IdentifiedUser i = ( ( com.google.gerrit.server.IdentifiedUser ) ( getCurrentUser ( ) ) ) ; return i.getAccountId ( ) . equals ( change.getOwner ( ) ) ; } return false ; }

Target:
public boolean isOwner ( ) { if ( getCurrentUser ( ) . isIdentifiedUser ( ) ) { final com.google.gerrit.server.IdentifiedUser i = ( ( com.google.gerrit.server.IdentifiedUser ) ( getCurrentUser ( ) ) ) ; return i.getAccountId ( ) . equals ( change.getOwner ( ) ) ; } return false ; }
Source:
private com.google.gerrit.client.diff.DraftBox newRangeDraft ( net.codemirror.lib.CodeMirror cm , int line , net.codemirror.lib.TextMarker.FromTo fromTo ) { com.google.gerrit.client.diff.DisplaySide side = host.getSideFromCm ( cm ) ; return addDraftBox ( com.google.gerrit.client.changes.CommentInfo.createRange ( path , getStoredSideFromDisplaySide ( side ) , ( line + 1 ) , null , null , com.google.gerrit.client.diff.CommentRange.create ( fromTo ) ) , side ) ; }

Target:
private com.google.gerrit.client.diff.DraftBox newRangeDraft ( net.codemirror.lib.CodeMirror cm , int line , net.codemirror.lib.TextMarker.FromTo fromTo ) { com.google.gerrit.client.diff.DisplaySide side = cm.side ( ) ; return addDraftBox ( com.google.gerrit.client.changes.CommentInfo.createRange ( path , getStoredSideFromDisplaySide ( side ) , ( line + 1 ) , null , null , com.google.gerrit.client.diff.CommentRange.create ( fromTo ) ) , side ) ; }
Source:
public com.googlesource.gerrit.plugins.github.oauth.OAuthCookie getFromUser ( java.lang.String username , java.lang.String email , java.lang.String fullName , java.util.SortedSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > scopes ) { try { return new com.googlesource.gerrit.plugins.github.oauth.OAuthCookie ( cipher , username , email , fullName , scopes ) ; } catch ( com.googlesource.gerrit.plugins.github.oauth.OAuthTokenException e ) { return null ; } }

Target:
public com.googlesource.gerrit.plugins.github.oauth.OAuthCookie getFromUser ( java.lang.String username , java.lang.String email , java.lang.String fullName , java.util.SortedSet < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > scopes ) { try { return new com.googlesource.gerrit.plugins.github.oauth.OAuthCookie ( cipher , username , email , fullName , scopes , getGerritSessionMaxAgeMillis ( ) ) ; } catch ( com.googlesource.gerrit.plugins.github.oauth.OAuthTokenException e ) { return null ; } }
Source:
private boolean add ( java.util.Set < java.lang.Integer > watchers , com.google.gerrit.reviewdb.client.AccountProjectWatch w , com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType type , com.google.gerrit.server.query.change.ChangeData change ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.IdentifiedUser user = identifiedUserFactory.create ( w.getAccountId ( ) ) ; try { if ( filterMatch ( user , w.getFilter ( ) , change ) ) { if ( w.isNotify ( type ) ) { watchers.add ( w.getAccountId ( ) . get ( ) ) ; } return true ; } } catch ( com.google.gerrit.server.query.QueryParseException e ) { } return false ; }

Target:
private boolean add ( java.util.Set < java.lang.Integer > watchers , com.google.gerrit.reviewdb.client.Account.Id accountId , com.google.gerrit.server.account.WatchConfig.ProjectWatchKey key , java.util.Set < com.google.gerrit.server.account.WatchConfig.NotifyType > watchedTypes , com.google.gerrit.server.account.WatchConfig.NotifyType type , com.google.gerrit.server.query.change.ChangeData change ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.IdentifiedUser user = identifiedUserFactory.create ( accountId ) ; try { if ( filterMatch ( user , key.filter ( ) , change ) ) { if ( watchedTypes.contains ( type ) ) { watchers.add ( accountId.get ( ) ) ; } return true ; } } catch ( com.google.gerrit.server.query.QueryParseException e ) { } return false ; }
Source:
protected void setApiHeaders ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , com.google.gitiles.FormatType type ) { res.setContentType ( type.getMimeType ( ) ) ; res.setCharacterEncoding ( com.google.common.base.Charsets.UTF_8.name ( ) ) ; res.setHeader ( com.google.common.net.HttpHeaders.CONTENT_DISPOSITION , "attachment" ) ; setCacheHeaders ( req , res ) ; }

Target:
protected void setApiHeaders ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , com.google.gitiles.FormatType type ) { res.setContentType ( type.getMimeType ( ) ) ; res.setCharacterEncoding ( com.google.common.base.Charsets.UTF_8.name ( ) ) ; res.setHeader ( com.google.common.net.HttpHeaders.CONTENT_DISPOSITION , "attachment" ) ; res.setHeader ( com.google.common.net.HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN , "*" ) ; setCacheHeaders ( req , res ) ; }
Source:
public void commentOnReviewableWipChangeByOwner ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; review ( sc.owner , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED ) ; assertThat ( sender ) . notSent ( ) ; }

Target:
public void commentOnWipChangeByBot ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; com.google.gerrit.acceptance.TestAccount bot = sc.testAccount ( "bot" ) ; review ( bot , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED , null , "tag" ) ; assertThat ( sender ) . sent ( "comment" , sc ) . to ( sc.owner ) . notTo ( sc.reviewer , sc.ccer ) . notTo ( sc.reviewerByEmail , sc.ccerByEmail ) . notTo ( sc.starrer ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }
Source:
public void deleteComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) { verifyComment ( c ) ; if ( migration.readComments ( ) ) { com.google.common.base.Preconditions.checkArgument ( draftNotes.containsComment ( c ) , ( "Cannot delete this comment" + " because it didn't previously exist as a draft" ) ) ; } if ( migration.write ( ) ) { if ( draftNotes.containsComment ( c ) ) { deleteComments.add ( c ) ; } } }

Target:
public void deleteComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) throws com.google.gwtorm.server.OrmException { verifyComment ( c ) ; if ( migration.readComments ( ) ) { com.google.common.base.Preconditions.checkArgument ( draftNotes.load ( ) . containsComment ( c ) , ( "Cannot delete this comment because it didn't previously exist as a" + " draft" ) ) ; } if ( migration.write ( ) ) { if ( draftNotes.load ( ) . containsComment ( c ) ) { deleteComments.add ( c ) ; } } }
Source:
public void unstarChange ( java.lang.String changeId ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.change.ChangeResource rsrc = changes.parse ( TopLevelResource.INSTANCE , com.google.gerrit.extensions.restapi.IdString.fromUrl ( changeId ) ) ; com.google.gerrit.server.account.AccountResource.StarredChange starredChange = new com.google.gerrit.server.account.AccountResource.StarredChange ( account.getUser ( ) , rsrc ) ; starredChangesDelete.apply ( starredChange , new com.google.gerrit.server.account.StarredChanges.EmptyInput ( ) ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot unstar change" , e ) ; } }

Target:
public void unstarChange ( java.lang.String changeId ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.change.ChangeResource rsrc = changes.parse ( TopLevelResource.INSTANCE , com.google.gerrit.extensions.restapi.IdString.fromUrl ( changeId ) ) ; com.google.gerrit.server.account.AccountResource.StarredChange starredChange = new com.google.gerrit.server.account.AccountResource.StarredChange ( account.getUser ( ) , rsrc ) ; starredChangesDelete.apply ( starredChange , new com.google.gerrit.server.restapi.account.StarredChanges.EmptyInput ( ) ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot unstar change" , e ) ; } }
Source:
static com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > create ( com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema ) { if ( ( schema == null ) || ( schema.hasField ( ChangeField.LEGACY_REVIEWED ) ) ) { return new com.google.gerrit.server.query.change.LegacyIsReviewedPredicate ( ) ; } com.google.gerrit.server.query.change.IsReviewedPredicate.checkSchema ( schema ) ; return com.google.gerrit.server.query.Predicate.not ( new com.google.gerrit.server.query.change.IsReviewedPredicate ( com.google.gerrit.server.query.change.IsReviewedPredicate.NOT_REVIEWED ) ) ; }

Target:
static com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > create ( com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema ) { if ( ( com.google.gerrit.server.query.change.IsReviewedPredicate.getField ( schema ) ) == ( com.google.gerrit.server.index.ChangeField.LEGACY_REVIEWED ) ) { return new com.google.gerrit.server.query.change.LegacyIsReviewedPredicate ( ) ; } return com.google.gerrit.server.query.Predicate.not ( new com.google.gerrit.server.query.change.IsReviewedPredicate ( com.google.gerrit.server.query.change.IsReviewedPredicate.NOT_REVIEWED ) ) ; }
Source:
private short getDefaultContext ( ) { final int idx = defaultContext.getSelectedIndex ( ) ; if ( 0 <= idx ) { return java.lang.Short.parseShort ( defaultContext.getValue ( idx ) ) ; } return com.google.gerrit.client.reviewdb.AccountGeneralPreferences.DEFAULT_CONTEXT ; }

Target:
private void display ( final com.google.gerrit.client.reviewdb.AccountGeneralPreferences p ) { showSiteHeader.setValue ( p.isShowSiteHeader ( ) ) ; useFlashClipboard.setValue ( p.isUseFlashClipboard ( ) ) ; setListBox ( maximumPageSize , com.google.gerrit.client.reviewdb.AccountGeneralPreferences.DEFAULT_PAGESIZE , p.getMaximumPageSize ( ) ) ; setListBox ( defaultContext , com.google.gerrit.client.reviewdb.AccountGeneralPreferences.DEFAULT_CONTEXT , p.getDefaultContext ( ) ) ; }
Source:
private static java.lang.reflect.Method getDefaultConfig ( java.lang.Class < ? > clazz ) { java.lang.reflect.Method result = null ; for ( java.lang.reflect.Method m : clazz.getMethods ( ) ) { com.google.gerrit.testutil.ConfigSuite.Default ann = m.getAnnotation ( com.google.gerrit.testutil.ConfigSuite.Default.class ) ; if ( ann != null ) { com.google.common.base.Preconditions.checkArgument ( ( result == null ) , "Multiple methods annotated with @ConfigSuite.Method: %s, %s" , result , m ) ; result = m ; } } return result ; }

Target:
private static < T extends java.lang.annotation.Annotation > java.lang.reflect.Method getAnnotatedMethod ( java.lang.Class < ? > clazz , java.lang.Class < T > annotationClass ) { java.lang.reflect.Method result = null ; for ( java.lang.reflect.Method m : clazz.getMethods ( ) ) { T ann = m.getAnnotation ( annotationClass ) ; if ( ann != null ) { com.google.common.base.Preconditions.checkArgument ( ( result == null ) , "Multiple methods annotated with %s: %s, %s" , ann , result , m ) ; result = m ; } } return result ; }
Source:
public void reviewTriplet ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; gApi.changes ( ) . id ( ( "p~master~" + ( r.getChangeId ( ) ) ) ) . revision ( r.getCommit ( ) . name ( ) ) . review ( com.google.gerrit.acceptance.api.revision.RevisionIT.approve ( ) ) ; }

Target:
public void reviewTriplet ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; gApi.changes ( ) . id ( ( "p~master~" + ( r.getChangeId ( ) ) ) ) . revision ( r.getCommit ( ) . name ( ) ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.approve ( ) ) ; }
Source:
private java.util.List < com.google.gerrit.server.change.GetRelated.ChangeAndCommit > getRelated ( com.google.gerrit.reviewdb.client.Change.Id changeId , int ps ) throws java.lang.Exception { java.lang.String url = java.lang.String.format ( "/changes/%d/revisions/%d/related" , changeId.get ( ) , ps ) ; return newGson ( ) . fromJson ( adminRestSession.get ( url ) . getReader ( ) , com.google.gerrit.server.change.GetRelated.RelatedInfo.class ) . changes ; }

Target:
private java.util.List < com.google.gerrit.server.change.GetRelated.ChangeAndCommit > getRelated ( com.google.gerrit.reviewdb.client.Change.Id changeId , int ps ) throws java.lang.Exception { java.lang.String url = java.lang.String.format ( "/changes/%d/revisions/%d/related" , changeId.get ( ) , ps ) ; com.google.gerrit.acceptance.RestResponse r = adminRestSession.get ( url ) ; r.assertOK ( ) ; return newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.server.change.GetRelated.RelatedInfo.class ) . changes ; }
Source:
protected void loadDefaults ( ) { approvals = com.google.common.collect.ImmutableListMultimap.of ( ) ; reviewers = com.google.common.collect.ImmutableSetMultimap.of ( ) ; submitRecords = com.google.common.collect.ImmutableList.of ( ) ; allChangeMessages = com.google.common.collect.ImmutableList.of ( ) ; changeMessagesByPatchSet = com.google.common.collect.ImmutableListMultimap.of ( ) ; comments = com.google.common.collect.ImmutableListMultimap.of ( ) ; hashtags = com.google.common.collect.ImmutableSet.of ( ) ; patchSets = com.google.common.collect.ImmutableSortedMap.of ( ) ; allPastReviewers = com.google.common.collect.ImmutableList.of ( ) ; }

Target:
protected void loadDefaults ( ) { approvals = com.google.common.collect.ImmutableListMultimap.of ( ) ; reviewers = com.google.gerrit.server.ReviewerSet.empty ( ) ; submitRecords = com.google.common.collect.ImmutableList.of ( ) ; allChangeMessages = com.google.common.collect.ImmutableList.of ( ) ; changeMessagesByPatchSet = com.google.common.collect.ImmutableListMultimap.of ( ) ; comments = com.google.common.collect.ImmutableListMultimap.of ( ) ; hashtags = com.google.common.collect.ImmutableSet.of ( ) ; patchSets = com.google.common.collect.ImmutableSortedMap.of ( ) ; allPastReviewers = com.google.common.collect.ImmutableList.of ( ) ; }
Source:
public com.google.gerrit.server.change.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Mute" ) . setTitle ( "Mute the change to unhighlight it in the dashboard" ) . setVisible ( ( ( ! ( rsrc.isUserOwner ( ) ) ) && ( isMuteable ( rsrc.getChange ( ) ) ) ) ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < java.lang.String > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.Mute.Input input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.StarredChangesUtil.IllegalLabelException , com.google.gwtorm.server.OrmException { if ( ( rsrc.isUserOwner ( ) ) || ( isMuted ( rsrc ) ) ) { return com.google.gerrit.extensions.restapi.Response.ok ( "" ) ; } stars.mute ( rsrc ) ; return com.google.gerrit.extensions.restapi.Response.ok ( "" ) ; }
Source:
public void getPersonPartsExtractsParts ( ) { com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.index.SchemaUtil.getPersonParts ( new org.eclipse.jgit.lib.PersonIdent ( "" , "" ) ) ) . containsExactly ( "" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.index.SchemaUtil.getPersonParts ( new org.eclipse.jgit.lib.PersonIdent ( "foo bar" , "" ) ) ) . containsExactly ( "foo" , "bar" , "" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.index.SchemaUtil.getPersonParts ( new org.eclipse.jgit.lib.PersonIdent ( "" , "foo@example.com" ) ) ) . containsExactly ( "foo@example.com" , "foo" , "example.com" , "example" , "com" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.index.SchemaUtil.getPersonParts ( new org.eclipse.jgit.lib.PersonIdent ( "foO J. bAr" , "bA-z@exAmple.cOm" ) ) ) . containsExactly ( "foo" , "j" , "bar" , "ba-z@example.com" , "ba-z" , "ba" , "z" , "example.com" , "example" , "com" ) ; }

Target:
public void getPersonPartsExtractsParts ( ) { com.google.common.truth.Truth.assertThat ( com.google.gerrit.index.SchemaUtil.getPersonParts ( new org.eclipse.jgit.lib.PersonIdent ( "" , "" ) ) ) . containsExactly ( "" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.index.SchemaUtil.getPersonParts ( new org.eclipse.jgit.lib.PersonIdent ( "foo bar" , "" ) ) ) . containsExactly ( "foo" , "bar" , "" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.index.SchemaUtil.getPersonParts ( new org.eclipse.jgit.lib.PersonIdent ( "" , "foo@example.com" ) ) ) . containsExactly ( "foo@example.com" , "foo" , "example.com" , "example" , "com" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.index.SchemaUtil.getPersonParts ( new org.eclipse.jgit.lib.PersonIdent ( "foO J. bAr" , "bA-z@exAmple.cOm" ) ) ) . containsExactly ( "foo" , "j" , "bar" , "ba-z@example.com" , "ba-z" , "ba" , "z" , "example.com" , "example" , "com" ) ; }
Source:
private void checkImpl ( ) { checkOwner ( ) ; checkCurrentPatchSetEntity ( ) ; if ( ! ( openRepo ( ) ) ) { return ; } if ( ! ( checkPatchSets ( ) ) ) { return ; } checkMerged ( ) ; }

Target:
private void checkImpl ( ) { com.google.common.base.Preconditions.checkState ( ( ! ( notesMigration.readChanges ( ) ) ) , "ConsistencyChecker for notedb not yet implemented" ) ; checkOwner ( ) ; checkCurrentPatchSetEntity ( ) ; if ( ! ( openRepo ( ) ) ) { return ; } if ( ! ( checkPatchSets ( ) ) ) { return ; } checkMerged ( ) ; }
Source:
public java.lang.Object apply ( com.google.gerrit.server.change.ChangeResource resource ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.extensions.api.changes.SubmittedTogetherInfo info = apply ( resource , options ) ; if ( options.isEmpty ( ) ) { return info.changes ; } return info ; }

Target:
void addOption ( java.lang.String option ) { for ( com.google.gerrit.extensions.client.ListChangesOption o : com.google.gerrit.extensions.client.ListChangesOption.values ( ) ) { if ( o.name ( ) . equalsIgnoreCase ( option ) ) { jsonOpt.add ( o ) ; return ; } } for ( com.google.gerrit.extensions.api.changes.SubmittedTogetherOption o : com.google.gerrit.extensions.api.changes.SubmittedTogetherOption.values ( ) ) { if ( o.name ( ) . equalsIgnoreCase ( option ) ) { options.add ( o ) ; return ; } } throw new java.lang.IllegalArgumentException ( ( "option not recognized: " + option ) ) ; }
Source:
private void refresh ( ) { setToken ( ( ( ( subname ) == null ) || ( "" . equals ( subname ) ) ? com.google.gerrit.common.PageLinks.ADMIN_GROUPS : ( ( com.google.gerrit.common.PageLinks.ADMIN_GROUPS ) + "?filter=" ) + ( com.google.gwt.http.client.URL.encodeQueryString ( subname ) ) ) ) ; com.google.gerrit.client.groups.GroupMap.match ( subname , new com.google.gerrit.client.ui.IgnoreOutdatedFilterResultsCallbackWrapper < com.google.gerrit.client.groups.GroupMap > ( this , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.groups.GroupMap > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gerrit.client.groups.GroupMap result ) { groups.display ( result , subname ) ; groups.finishDisplay ( ) ; } } ) ) ; }

Target:
private void refresh ( ) { setToken ( ( ( ( subname ) == null ) || ( "" . equals ( subname ) ) ? com.google.gerrit.common.PageLinks.ADMIN_GROUPS : ( ( com.google.gerrit.common.PageLinks.ADMIN_GROUPS ) + "?filter=" ) + ( com.google.gwt.http.client.URL.encodeQueryString ( subname ) ) ) ) ; com.google.gerrit.client.groups.GroupMap.match ( subname , new com.google.gerrit.client.ui.IgnoreOutdatedFilterResultsCallbackWrapper < com.google.gerrit.client.groups.GroupMap > ( this , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.groups.GroupMap > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.groups.GroupMap result ) { groups.display ( result , subname ) ; groups.finishDisplay ( ) ; } } ) ) ; }
Source:
public PatchSet.Id call ( ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { try { if ( caller == ( java.lang.Thread.currentThread ( ) ) ) { return insertPatchSet ( db ) ; } else { com.google.gerrit.reviewdb.server.ReviewDb db = schemaFactory.open ( ) ; try { return insertPatchSet ( db ) ; } finally { db.close ( ) ; } } } finally { synchronized ( replaceProgress ) { replaceProgress.update ( 1 ) ; } } }

Target:
public PatchSet.Id call ( ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { try { if ( magicBranch.edit ) { return upsertEdit ( ) ; } else if ( caller == ( java.lang.Thread.currentThread ( ) ) ) { return insertPatchSet ( db ) ; } else { com.google.gerrit.reviewdb.server.ReviewDb db = schemaFactory.open ( ) ; try { return insertPatchSet ( db ) ; } finally { db.close ( ) ; } } } finally { synchronized ( replaceProgress ) { replaceProgress.update ( 1 ) ; } } }
Source:
public void newPatchSetByOtherOnReviewableChangeOwnerSelfCcNotifyOwnerInReviewDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; 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 , EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . to ( sc.owner ) . to ( sc.reviewer , sc.ccer ) . notTo ( sc.starrer , other ) . notTo ( sc.reviewerByEmail , sc.ccerByEmail ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }

Target:
public void newPatchSetOnWipChangeAddingReviewer ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; com.google.gerrit.acceptance.TestAccount newReviewer = sc.testAccount ( "newReviewer" ) ; pushTo ( sc , ( "refs/for/master%r=" + ( newReviewer.username ) ) , sc.owner ) ; assertThat ( sender ) . notSent ( ) ; }
Source:
public com.google.gerrit.extensions.common.AccountInfo deleteAssignee ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.common.AccountInfo > r = deleteAssignee.apply ( change , null ) ; return r.isNone ( ) ? null : r.value ( ) ; } catch ( com.google.gerrit.server.update.UpdateException | com.google.gwtorm.server.OrmException | com.google.gerrit.server.permissions.PermissionBackendException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot delete assignee" , e ) ; } }

Target:
public com.google.gerrit.extensions.common.AccountInfo deleteAssignee ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.common.AccountInfo > r = deleteAssignee.apply ( change , null ) ; return r.isNone ( ) ? null : r.value ( ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot delete assignee" , e ) ; } }
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 ) . to ( sc.reviewerByEmail ) . cc ( sc.owner , sc.reviewer , other ) . cc ( sc.ccerByEmail ) . notTo ( sc.starrer ) ; } ) ; }

Target:
public void addReviewerToReviewableChangeByOtherCcingSelfInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.TestAccount other = accountCreator.create ( "other" , "other@example.com" , "other" ) ; forAll ( ( adder ) -> { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; com.google.gerrit.acceptance.TestAccount reviewer = accountCreator.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 ) . notTo ( sc.starrer ) ; } ) ; }
Source:
public boolean muted ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return stars.isMutedBy ( change.getChange ( ) , change.getUser ( ) . getAccountId ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot check if muted" , e ) ; } }

Target:
public boolean muted ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return stars.isMuted ( change ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot check if muted" , e ) ; } }
Source:
private java.util.Set < java.lang.String > getRefNames ( java.lang.String prefix ) throws com.google.gwtorm.server.OrmException { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allUsers ) ) { org.eclipse.jgit.lib.RefDatabase refDb = repo.getRefDatabase ( ) ; return refDb.getRefs ( prefix ) . keySet ( ) ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } }

Target:
public org.eclipse.jgit.lib.ObjectId getObjectId ( com.google.gerrit.reviewdb.client.Account.Id accountId , com.google.gerrit.reviewdb.client.Change.Id changeId ) { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allUsers ) ) { return getObjectId ( repo , com.google.gerrit.reviewdb.client.RefNames.refsStarredChanges ( changeId , accountId ) ) ; } catch ( java.io.IOException e ) { com.google.gerrit.server.StarredChangesUtil.log.error ( java.lang.String.format ( "Getting star object ID for account %d on change %d failed" , accountId.get ( ) , changeId.get ( ) ) , e ) ; return org.eclipse.jgit.lib.ObjectId.zeroId ( ) ; } }
Source:
public void customLabelMaxNoBlock_NegativeVoteNotBlock ( ) throws java.lang.Exception { Q.setFunctionName ( "MaxNoBlock" ) ; saveLabelConfig ( ) ; com.google.gerrit.acceptance.rest.change.ChangeInfo c = get ( disliked ( change ( ) ) ) ; com.google.gerrit.server.change.ChangeJson.LabelInfo q = c.labels.get ( Q.getName ( ) ) ; org.junit.Assert.assertEquals ( 1 , q.all.size ( ) ) ; org.junit.Assert.assertNull ( q.rejected ) ; org.junit.Assert.assertNotNull ( q.disliked ) ; }

Target:
public void customLabelMaxNoBlock_NegativeVoteNotBlock ( ) throws java.lang.Exception { Q.setFunctionName ( "MaxNoBlock" ) ; saveLabelConfig ( ) ; com.google.gerrit.acceptance.rest.change.ChangeInfo c = get ( disliked ( change ( ) ) ) ; com.google.gerrit.server.change.ChangeJson.LabelInfo q = c.labels.get ( Q.getName ( ) ) ; org.junit.Assert.assertEquals ( 1 , q.all.size ( ) ) ; org.junit.Assert.assertNotNull ( q.rejected ) ; org.junit.Assert.assertNull ( q.blocking ) ; }
Source:
public com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > rewrite ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in , com.google.gerrit.server.query.change.QueryOptions opts ) throws com.google.gerrit.server.query.QueryParseException { com.google.gerrit.server.index.change.ChangeIndex index = indexes.getSearchIndex ( ) ; org.eclipse.jgit.util.MutableInteger leafTerms = new org.eclipse.jgit.util.MutableInteger ( ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewriteImpl ( in , index , opts , leafTerms ) ; if ( ( in == out ) || ( out instanceof com.google.gerrit.server.index.IndexPredicate ) ) { return new com.google.gerrit.server.index.change.IndexedChangeQuery ( index , out , opts ) ; } else if ( out == null ) { return in ; } else { return out ; } }

Target:
public com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > rewrite ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in , com.google.gerrit.server.index.QueryOptions opts ) throws com.google.gerrit.server.query.QueryParseException { com.google.gerrit.server.index.change.ChangeIndex index = indexes.getSearchIndex ( ) ; org.eclipse.jgit.util.MutableInteger leafTerms = new org.eclipse.jgit.util.MutableInteger ( ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewriteImpl ( in , index , opts , leafTerms ) ; if ( ( in == out ) || ( out instanceof com.google.gerrit.server.index.IndexPredicate ) ) { return new com.google.gerrit.server.index.change.IndexedChangeQuery ( index , out , opts ) ; } else if ( out == null ) { return in ; } else { return out ; } }
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.legacyId ( ) , style , headerLine , includedIn ) ; includedIn.setVisible ( true ) ; } }

Target:
private void initIncludedInAction ( com.google.gerrit.client.info.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:
public void onSend ( ) { com.google.gerrit.client.changes.ChangeApi.cherrypick ( info.legacyId ( ) . get ( ) , revision , getDestinationBranch ( ) , getMessageText ( ) , 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.cherrypick ( info.legacyId ( ) . get ( ) , revision , getDestinationBranch ( ) , getMessageText ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.info.ChangeInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.info.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:
void expectWrapper ( java.lang.String path , @ javax.annotation.Nonnull java.util.Optional < byte [ ] > value ) throws java.io.IOException { org.easymock.EasyMock.expect ( com.vmware.gerrit.owners.common.JgitWrapper.getBlobAsBytes ( org.easymock.EasyMock.anyObject ( org.eclipse.jgit.lib.Repository.class ) , org.easymock.EasyMock.anyObject ( java.lang.String.class ) , org.easymock.EasyMock.eq ( path ) ) ) . andReturn ( value ) . anyTimes ( ) ; }

Target:
void expectNoConfig ( java.lang.String path ) throws java.io.IOException { org.easymock.EasyMock.expect ( com.vmware.gerrit.owners.common.JgitWrapper.getBlobAsBytes ( org.easymock.EasyMock.anyObject ( org.eclipse.jgit.lib.Repository.class ) , org.easymock.EasyMock.anyObject ( java.lang.String.class ) , org.easymock.EasyMock.eq ( path ) ) ) . andReturn ( java.util.Optional.empty ( ) ) . anyTimes ( ) ; }
Source:
public void testUpdateOneDBException ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.SQLException exception = new java.sql.BatchUpdateException ( ) ; java.sql.PreparedStatement update = stubStatementThrowExceptionOnExecute ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , exception ) ; com.google.gwtorm.jdbc.JdbcAccess < com.google.gwtorm.jdbc.TestJdbcAccess.Data , com.google.gwtorm.jdbc.TestJdbcAccess.Data.DataKey > classUnderTest = createClassUnderTest ( ) ; try { classUnderTest.update ( oneRow ) ; org.junit.Assert.fail ( "missingException" ) ; } catch ( com.google.gwtorm.server.OrmException e ) { org.junit.Assert.assertSame ( e.getCause ( ) , exception ) ; } com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( update ) ; }

Target:
public void testUpdateOneException ( ) throws java.sql.SQLException { sqlException = new java.sql.BatchUpdateException ( ) ; java.sql.PreparedStatement update = stubStatementThrowExceptionOnExecute ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.UPDATE , sqlException ) ; try { classUnderTest.update ( oneRow ) ; org.junit.Assert.fail ( "missingException" ) ; } catch ( com.google.gwtorm.server.OrmException e ) { org.junit.Assert.assertSame ( e.getCause ( ) , sqlException ) ; } assertCorrectUpdating ( update , 1 ) ; }
Source:
private static com.google.gerrit.testutil.FakeEmailSender.Message create ( com.google.gerrit.server.mail.Address from , java.util.Collection < com.google.gerrit.server.mail.Address > rcpt , java.util.Map < java.lang.String , com.google.gerrit.server.mail.send.EmailHeader > headers , java.lang.String body ) { return new com.google.gerrit.testutil.AutoValue_FakeEmailSender_Message ( from , com.google.common.collect.ImmutableList.copyOf ( rcpt ) , com.google.common.collect.ImmutableMap.copyOf ( headers ) , body ) ; }

Target:
private static com.google.gerrit.testutil.FakeEmailSender.Message create ( com.google.gerrit.server.mail.Address from , java.util.Collection < com.google.gerrit.server.mail.Address > rcpt , java.util.Map < java.lang.String , com.google.gerrit.server.mail.send.EmailHeader > headers , java.lang.String body , java.lang.String htmlBody ) { return new com.google.gerrit.testutil.AutoValue_FakeEmailSender_Message ( from , com.google.common.collect.ImmutableList.copyOf ( rcpt ) , com.google.common.collect.ImmutableMap.copyOf ( headers ) , body , htmlBody ) ; }
Source:
void onReplyDone ( com.google.gwt.event.dom.client.ClickEvent e ) { if ( ( replyBox ) == null ) { com.google.gerrit.client.diff.DraftBox box = getDiffView ( ) . addReply ( getOriginal ( ) , "Done" , true ) ; registerReplyBox ( box ) ; } else { openReplyBox ( ) ; } }

Target:
void onReplyDone ( com.google.gwt.event.dom.client.ClickEvent e ) { if ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { com.google.gerrit.client.Gerrit.doSignIn ( getDiffView ( ) . getToken ( ) ) ; } else if ( ( replyBox ) == null ) { com.google.gerrit.client.diff.DraftBox box = getDiffView ( ) . addReply ( getOriginal ( ) , "Done" , true ) ; registerReplyBox ( box ) ; } else { openReplyBox ( ) ; } }
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 ( final com.google.gerrit.reviewdb.client.Change change , final com.google.gerrit.server.events.Event event , final com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.common.ChangeHookRunner.EventListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( change , holder.user , db ) ) { holder.listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }
Source:
public static void recursivelyDelete ( java.io.File dir ) throws java.io.IOException { if ( ! ( dir.getPath ( ) . equals ( dir.getCanonicalPath ( ) ) ) ) { return ; } java.io.File [ ] contents = dir.listFiles ( ) ; if ( contents != null ) { for ( java.io.File d : contents ) { if ( d.isDirectory ( ) ) { com.google.gerrit.testutil.TempFileUtil.recursivelyDelete ( d ) ; } else { com.google.gerrit.testutil.TempFileUtil.deleteNowOrOnExit ( d ) ; } } } com.google.gerrit.testutil.TempFileUtil.deleteNowOrOnExit ( dir ) ; }

Target:
public static void recursivelyDelete ( java.io.File dir ) throws java.io.IOException { if ( ! ( dir.getPath ( ) . equals ( dir.getCanonicalPath ( ) ) ) ) { return ; } java.io.File [ ] contents = dir.listFiles ( ) ; if ( contents != null ) { for ( java.io.File d : contents ) { if ( d.isDirectory ( ) ) { com.google.gerrit.testing.TempFileUtil.recursivelyDelete ( d ) ; } else { com.google.gerrit.testing.TempFileUtil.deleteNowOrOnExit ( d ) ; } } } com.google.gerrit.testing.TempFileUtil.deleteNowOrOnExit ( dir ) ; }
Source:
public void inheritRead_SingleBranchDoesNotOverrideInherited ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/for/refs/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/foobar" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCanUpload ( u ) ; assertCanUpload ( "refs/heads/master" , u ) ; assertCanUpload ( "refs/heads/foobar" , u ) ; }

Target:
public void inheritRead_SingleBranchDoesNotOverrideInherited ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/for/refs/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/foobar" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCanUpload ( u ) ; assertCreateChange ( "refs/heads/master" , u ) ; assertCreateChange ( "refs/heads/foobar" , u ) ; }
Source:
public void configure ( ) { factory ( OnlineReindexer.Factory.class ) ; listener ( ) . to ( com.google.gerrit.lucene.LuceneVersionManager.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.server.index.IndexConfig.class ) . toInstance ( com.google.gerrit.server.index.IndexConfig.createDefault ( ) ) ; factory ( LuceneChangeIndex.Factory.class ) ; factory ( OnlineReindexer.Factory.class ) ; install ( new com.google.gerrit.server.index.IndexModule ( threads ) ) ; if ( ( ( singleVersion ) == null ) && ( ( base ) == null ) ) { install ( new com.google.gerrit.lucene.LuceneIndexModule.MultiVersionModule ( ) ) ; } else { install ( new com.google.gerrit.lucene.LuceneIndexModule.SingleVersionModule ( ) ) ; } }
Source:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicMap.mapOf ( binder ( ) , com.google.gerrit.server.config.CacheResource.CACHE_KIND ) ; child ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "caches" ) . to ( com.google.gerrit.server.config.CachesCollection.class ) ; get ( com.google.gerrit.server.config.CacheResource.CACHE_KIND ) . to ( com.google.gerrit.server.config.GetCache.class ) ; }

Target:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicMap.mapOf ( binder ( ) , com.google.gerrit.server.config.CacheResource.CACHE_KIND ) ; child ( com.google.gerrit.server.config.ConfigResource.CONFIG_KIND , "caches" ) . to ( com.google.gerrit.server.config.CachesCollection.class ) ; get ( com.google.gerrit.server.config.CacheResource.CACHE_KIND ) . to ( com.google.gerrit.server.config.GetCache.class ) ; post ( com.google.gerrit.server.config.CacheResource.CACHE_KIND , "flush" ) . to ( com.google.gerrit.server.config.FlushCache.class ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { final com.google.gwt.user.client.ui.HTMLTable.Cell cell = table.getCellForEvent ( event ) ; if ( ( ( cell != null ) && ( ( cell.getCellIndex ( ) ) != 1 ) ) && ( ( getRowItem ( cell.getRowIndex ( ) ) ) != null ) ) { movePointerTo ( cell.getRowIndex ( ) ) ; } }

Target:
public void onSuccess ( final java.util.Set < com.google.gerrit.client.reviewdb.AccountExternalId.Key > removed ) { deleteIdentity.setEnabled ( true ) ; for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { final com.google.gerrit.client.reviewdb.AccountExternalId k = getRowItem ( row ) ; if ( ( k != null ) && ( removed.contains ( k.getKey ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } }
Source:
public void addPatchSetComments ( com.google.gerrit.server.events.PatchSetAttribute patchSetAttribute , java.util.Collection < com.google.gerrit.reviewdb.PatchLineComment > patchLineComments ) { for ( com.google.gerrit.reviewdb.PatchLineComment comment : patchLineComments ) { if ( ( comment.getKey ( ) . getParentKey ( ) . getParentKey ( ) . get ( ) ) == ( java.lang.Integer.parseInt ( patchSetAttribute.number ) ) ) { if ( ( patchSetAttribute.comments ) == null ) { patchSetAttribute.comments = new java.util.ArrayList < com.google.gerrit.server.events.PatchSetCommentAttribute > ( ) ; } patchSetAttribute.comments.add ( asPatchSetLineAttribute ( comment ) ) ; } } }

Target:
private com.google.gerrit.server.events.DependencyAttribute newNeededBy ( com.google.gerrit.reviewdb.client.Change c , com.google.gerrit.reviewdb.client.PatchSet ps ) { return newDependencyAttribute ( c , ps ) ; }
Source:
public static java.lang.String toProjectAdmin ( com.google.gerrit.reviewdb.client.Project.NameKey n , java.lang.String panel ) { if ( ( panel == null ) || ( ProjectScreen.INFO.equals ( panel ) ) ) { return "/admin/projects/" + ( n.toString ( ) ) ; } return ( ( "/admin/projects/" + ( n.toString ( ) ) ) + "," ) + panel ; }

Target:
public static java.lang.String toProjectAdmin ( com.google.gerrit.reviewdb.client.Project.NameKey n , java.lang.String panel ) { if ( ( panel == null ) || ( ProjectScreen.INFO.equals ( panel ) ) ) { return ( com.google.gerrit.common.PageLinks.ADMIN_PROJECTS ) + ( n.toString ( ) ) ; } return ( ( ( com.google.gerrit.common.PageLinks.ADMIN_PROJECTS ) + ( n.toString ( ) ) ) + "," ) + panel ; }
Source:
public void postUpdate ( com.google.gerrit.server.git.BatchUpdate.Context ctx ) throws com.google.gwtorm.server.OrmException { if ( ( updated ( ) ) && ( runHooks ) ) { com.google.gerrit.server.IdentifiedUser currentUser = ( ( com.google.gerrit.server.IdentifiedUser ) ( ctx.getUser ( ) ) ) ; hooks.doHashtagsChangedHook ( change , currentUser.getAccount ( ) , toAdd , toRemove , updatedHashtags , ctx.getDb ( ) ) ; } }

Target:
public void postUpdate ( com.google.gerrit.server.git.BatchUpdate.Context ctx ) throws com.google.gwtorm.server.OrmException { if ( ( updated ( ) ) && ( runHooks ) ) { hooks.doHashtagsChangedHook ( change , ctx.getUser ( ) . asIdentifiedUser ( ) . getAccount ( ) , toAdd , toRemove , updatedHashtags , ctx.getDb ( ) ) ; } }
Source:
void setShowLineNumbers ( boolean b ) { cmA.setOption ( "lineNumbers" , b ) ; cmB.setOption ( "lineNumbers" , b ) ; if ( b ) { diffTable.addStyleName ( DiffTable.style.showLineNumbers ( ) ) ; } else { diffTable.removeStyleName ( DiffTable.style.showLineNumbers ( ) ) ; } }

Target:
private com.google.gerrit.client.diff.DisplaySide getSideFromCm ( net.codemirror.lib.CodeMirror cm ) { return cm == ( cmA ) ? DisplaySide.A : DisplaySide.B ; }
Source:
public com.google.gerrit.index.query.DataSource < com.google.gerrit.server.project.ProjectData > getSource ( com.google.gerrit.index.query.Predicate < com.google.gerrit.server.project.ProjectData > p , com.google.gerrit.index.QueryOptions opts ) throws com.google.gerrit.index.query.QueryParseException { return new com.google.gerrit.lucene.LuceneProjectIndex.QuerySource ( opts , queryBuilder.toQuery ( p ) , new org.apache.lucene.search.Sort ( new org.apache.lucene.search.SortField ( com.google.gerrit.lucene.LuceneProjectIndex.NAME_SORT_FIELD , SortField.Type.STRING , false ) ) ) ; }

Target:
public com.google.gerrit.index.query.DataSource < com.google.gerrit.server.project.ProjectData > getSource ( com.google.gerrit.index.query.Predicate < com.google.gerrit.server.project.ProjectData > p , com.google.gerrit.index.QueryOptions opts ) throws com.google.gerrit.index.query.QueryParseException { return new com.google.gerrit.lucene.LuceneQuerySource ( opts.filterFields ( IndexUtils :: projectFields ) , queryBuilder.toQuery ( p ) , new org.apache.lucene.search.Sort ( new org.apache.lucene.search.SortField ( com.google.gerrit.lucene.LuceneProjectIndex.NAME_SORT_FIELD , SortField.Type.STRING , false ) ) ) ; }
Source:
java.lang.Runnable toggleOpenBox ( final net.codemirror.lib.CodeMirror cm ) { return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { if ( cm.extras ( ) . hasActiveLine ( ) ) { com.google.gerrit.client.diff.SideBySideCommentGroup w = map ( cm.side ( ) ) . get ( ( ( cm.getLineNumber ( cm.extras ( ) . activeLine ( ) ) ) + 1 ) ) ; if ( w != null ) { w.openCloseLast ( ) ; } } } } ; }

Target:
java.lang.String getTokenSuffixForActiveLine ( net.codemirror.lib.CodeMirror cm ) { return ( ( cm.side ( ) ) == ( DisplaySide.A ) ? "a" : "" ) + ( ( cm.getLineNumber ( cm.extras ( ) . activeLine ( ) ) ) + 1 ) ; }
Source:
public java.util.Set < com.google.gerrit.reviewdb.Account > call ( ) throws com.google.gerrit.common.errors.NoSuchGroupException , com.google.gerrit.server.project.NoSuchProjectException , com.google.gwtorm.client.OrmException { if ( AccountGroup.PROJECT_OWNERS.equals ( groupUUID ) ) { return getProjectOwners ( ) ; } return getAllGroupMembers ( groupCache.get ( groupUUID ) , new java.util.HashSet < com.google.gerrit.reviewdb.AccountGroup.Id > ( ) ) ; }

Target:
private java.util.Set < com.google.gerrit.reviewdb.Account > listAccounts ( final com.google.gerrit.reviewdb.AccountGroup.UUID groupUUID , final java.util.Set < com.google.gerrit.reviewdb.AccountGroup.UUID > seen ) throws com.google.gerrit.common.errors.NoSuchGroupException , com.google.gerrit.server.project.NoSuchProjectException , com.google.gwtorm.client.OrmException { if ( AccountGroup.PROJECT_OWNERS.equals ( groupUUID ) ) { return getProjectOwners ( seen ) ; } else { return getGroupMembers ( groupCache.get ( groupUUID ) , seen ) ; } }