auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public java.lang.String toString ( ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( getClass ( ) . getSimpleName ( ) ) . append ( '[' ) ; for ( int i = 0 ; i < ( problems.size ( ) ) ; i ++ ) { if ( i > 0 ) { sb.append ( ", " ) ; } sb.append ( problems.get ( i ) ) ; } return sb.append ( ']' ) . toString ( ) ; }

Target:
public java.lang.String toString ( ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( getClass ( ) . getSimpleName ( ) ) . append ( '[' ) . append ( status ) ; for ( int i = 0 ; i < ( problems.size ( ) ) ; i ++ ) { sb.append ( ( i == 0 ? ": " : ", " ) ) . append ( problems.get ( i ) ) ; } return sb.append ( ']' ) . toString ( ) ; }
Source:
public void addClickHandler ( final com.google.gwt.event.dom.client.ClickHandler clickHandler ) { myTable.addClickHandler ( clickHandler ) ; }

Target:
public void addClickHandler ( final com.google.gwt.event.dom.client.ClickHandler clickHandler ) { if ( ( myTable ) != null ) { myTable.addClickHandler ( clickHandler ) ; } else { if ( ( clickHandlers ) == null ) { clickHandlers = new java.util.ArrayList < com.google.gwt.event.dom.client.ClickHandler > ( 2 ) ; } clickHandlers.add ( clickHandler ) ; } }
Source:
public void descriptionOfFixSuggestionIsAcceptedAsIs ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.enabled ( ) ) . isTrue ( ) ; addRobotComment ( changeId , withFixRobotCommentInput ) ; java.util.List < com.google.gerrit.extensions.common.RobotCommentInfo > robotCommentInfos = getRobotComments ( ) ; com.google.gerrit.acceptance.api.revision.RobotCommentInfoSubject.assertThatList ( robotCommentInfos ) . onlyElement ( ) . onlyFixSuggestion ( ) . description ( ) . isEqualTo ( fixSuggestionInfo.description ) ; }

Target:
public void descriptionOfFixSuggestionIsAcceptedAsIs ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.enabled ( ) ) . isTrue ( ) ; addRobotComment ( changeId , withFixRobotCommentInput ) ; java.util.List < com.google.gerrit.extensions.common.RobotCommentInfo > robotCommentInfos = getRobotComments ( ) ; com.google.gerrit.extensions.common.RobotCommentInfoSubject.assertThatList ( robotCommentInfos ) . onlyElement ( ) . onlyFixSuggestion ( ) . description ( ) . isEqualTo ( fixSuggestionInfo.description ) ; }
Source:
protected void bccWatches ( com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType type ) { try { com.google.gerrit.server.mail.ChangeEmail.Watchers matching = getWatches ( type ) ; for ( com.google.gerrit.reviewdb.client.Account.Id user : matching.accounts ) { add ( RecipientType.BCC , user ) ; } for ( com.google.gerrit.server.mail.Address addr : matching.emails ) { add ( RecipientType.BCC , addr ) ; } } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.ChangeEmail.log.warn ( ( "Cannot BCC watchers for " + type ) , err ) ; } }

Target:
protected void includeWatchers ( com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType type ) { try { com.google.gerrit.server.mail.ChangeEmail.Watchers matching = getWatches ( type ) ; add ( RecipientType.TO , matching.to ) ; add ( RecipientType.CC , matching.cc ) ; add ( RecipientType.BCC , matching.bcc ) ; } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.ChangeEmail.log.warn ( ( "Cannot BCC watchers for " + type ) , err ) ; } }
Source:
public java.util.List < com.google.gerrit.reviewdb.client.ChangeMessage > byPatchSet ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { if ( ! ( migration.readChangeMessages ( ) ) ) { return com.google.gerrit.server.ChangeMessagesUtil.sortChangeMessages ( db.changeMessages ( ) . byPatchSet ( psId ) ) ; } return notes.load ( ) . getChangeMessages ( ) . get ( psId ) ; }

Target:
public java.util.List < com.google.gerrit.reviewdb.client.ChangeMessage > byPatchSet ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { if ( ! ( migration.readChanges ( ) ) ) { return com.google.gerrit.server.ChangeMessagesUtil.sortChangeMessages ( db.changeMessages ( ) . byPatchSet ( psId ) ) ; } return notes.load ( ) . getChangeMessages ( ) . get ( psId ) ; }
Source:
public java.nio.file.FileVisitResult visitFile ( java.nio.file.Path path , java.nio.file.attribute.BasicFileAttributes attrs ) throws java.io.IOException { com.google.common.base.Optional < com.google.gerrit.server.plugins.PluginEntry > resource = resourceOf ( relativePathOf ( path ) ) ; if ( resource.isPresent ( ) ) { resourcesList.add ( resource.get ( ) ) ; } return java.nio.file.FileVisitResult.CONTINUE ; }

Target:
public java.util.Enumeration < com.google.gerrit.server.plugins.PluginEntry > entries ( ) { return webScanner.entries ( ) ; }
Source:
public void inheritSubmit_AllowInChildDoesntAffectUnblockInParent ( ) { com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertNotBlocked ( com.google.gerrit.common.data.Permission.SUBMIT , "refs/heads/master" , u ) ; }

Target:
public void unblockNoForce ( ) { com.google.gerrit.server.project.testing.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.testing.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.testing.Util.DEVS ) ; assertCanUpdate ( "refs/heads/master" , u ) ; }
Source:
private com.google.gerrit.server.change.ReviewerJson.PostResult putAccount ( com.google.gerrit.server.change.ReviewerResource rsrc ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Account member = rsrc.getReviewerUser ( ) . getAccount ( ) ; com.google.gerrit.server.project.ChangeControl control = rsrc.getReviewerControl ( ) ; com.google.gerrit.server.change.ReviewerJson.PostResult result = new com.google.gerrit.server.change.ReviewerJson.PostResult ( ) ; if ( isValidReviewer ( member , control ) ) { addReviewers ( rsrc.getChangeResource ( ) , result , com.google.common.collect.ImmutableMap.of ( member.getId ( ) , control ) ) ; } return result ; }

Target:
private com.google.gerrit.extensions.api.changes.AddReviewerResult putAccount ( java.lang.String reviewer , com.google.gerrit.server.change.ReviewerResource rsrc ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Account member = rsrc.getReviewerUser ( ) . getAccount ( ) ; com.google.gerrit.server.project.ChangeControl control = rsrc.getReviewerControl ( ) ; com.google.gerrit.extensions.api.changes.AddReviewerResult result = new com.google.gerrit.extensions.api.changes.AddReviewerResult ( reviewer ) ; if ( isValidReviewer ( member , control ) ) { addReviewers ( rsrc.getChangeResource ( ) , result , com.google.common.collect.ImmutableMap.of ( member.getId ( ) , control ) ) ; } return result ; }
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 ( "Mark private" ) . setTitle ( "Mark change as private" ) . setVisible ( rsrc.getControl ( ) . isOwner ( ) ) ; }

Target:
public com.google.gerrit.server.change.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { com.google.gerrit.reviewdb.client.Change change = rsrc.getChange ( ) ; return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Mark private" ) . setTitle ( "Mark change as private" ) . setVisible ( ( ( ( ! ( change.isPrivate ( ) ) ) && ( ( change.getStatus ( ) ) != ( Change.Status.MERGED ) ) ) && ( rsrc.isUserOwner ( ) ) ) ) ; }
Source:
public java.util.Set < com.google.gerrit.reviewdb.client.Change.Id > getStarredChanges ( ) { if ( ( starredChanges ) == null ) { checkRequestScope ( ) ; try { starredChanges = com.google.gerrit.server.IdentifiedUser.starredChangeIds ( ( ( starredQuery ) != null ? starredQuery : starredQuery ( ) ) ) ; } catch ( com.google.gwtorm.server.OrmException | com.google.gwtorm.server.OrmRuntimeException e ) { com.google.gerrit.server.IdentifiedUser.log.warn ( "Cannot query starred changes" , e ) ; } } return starredChanges ; }

Target:
public java.util.Set < com.google.gerrit.reviewdb.client.Change.Id > getStarredChanges ( ) { if ( ( starredChanges ) == null ) { checkRequestScope ( ) ; try { starredChanges = com.google.gerrit.server.IdentifiedUser.starredChangeIds ( ( ( starredQuery ) != null ? starredQuery : starredQuery ( ) ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.lang.RuntimeException e ) { com.google.gerrit.server.IdentifiedUser.log.warn ( "Cannot query starred changes" , e ) ; starredChanges = java.util.Collections.emptySet ( ) ; } finally { starredQuery = null ; } } return starredChanges ; }
Source:
public java.lang.String getBranchUrl ( java.lang.String projectName , java.lang.String branchName ) { com.google.gerrit.server.project.ProjectState state = projectCache.get ( new com.google.gerrit.reviewdb.client.Project.NameKey ( projectName ) ) ; if ( state == null ) { return null ; } return getPatchUrl ( projectName , branchName , cfgFactory.create ( state ) . getIndexFile ( ) ) ; }

Target:
private java.lang.String getBranchUrl ( java.lang.String projectName , java.lang.String branchName ) { com.google.gerrit.server.project.ProjectState state = projectCache.get ( new com.google.gerrit.reviewdb.client.Project.NameKey ( projectName ) ) ; if ( state == null ) { return null ; } return getFileUrl ( projectName , branchName , cfgFactory.create ( state ) . getIndexFile ( ) , true ) ; }
Source:
private static java.lang.String describe ( com.google.gerrit.server.CurrentUser user ) { if ( user instanceof com.google.gerrit.server.IdentifiedUser ) { return ( ( com.google.gerrit.server.IdentifiedUser ) ( user ) ) . getAccountId ( ) . toString ( ) ; } if ( user instanceof com.google.gerrit.server.query.change.SingleGroupUser ) { return "group:" + ( ( ( com.google.gerrit.server.query.change.SingleGroupUser ) ( user ) ) . getEffectiveGroups ( ) . iterator ( ) . next ( ) . toString ( ) ) ; } return user.toString ( ) ; }

Target:
private static java.lang.String describe ( com.google.gerrit.server.CurrentUser user ) { if ( user instanceof com.google.gerrit.server.IdentifiedUser ) { return ( ( com.google.gerrit.server.IdentifiedUser ) ( user ) ) . getAccountId ( ) . toString ( ) ; } if ( user instanceof com.google.gerrit.server.query.change.SingleGroupUser ) { return "group:" + ( ( ( com.google.gerrit.server.query.change.SingleGroupUser ) ( user ) ) . getEffectiveGroups ( ) . getKnownGroups ( ) . iterator ( ) . next ( ) . toString ( ) ) ; } return user.toString ( ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.server.project.Util.allow ( cfg , Permission.OWNER , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.allow ( cfg , Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/for/refs/meta/config" ) ; com.google.gerrit.server.project.Util.allow ( cfg , Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/meta/config" ) ; saveProjectConfig ( project , cfg ) ; setApiUser ( user ) ; fetchRefsMetaConfig ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.server.project.Util.allow ( cfg , Permission.OWNER , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.allow ( cfg , Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/for/refs/meta/config" ) ; com.google.gerrit.server.project.Util.allow ( cfg , Permission.SUBMIT , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , RefNames.REFS_CONFIG ) ; saveProjectConfig ( project , cfg ) ; setApiUser ( user ) ; fetchRefsMetaConfig ( ) ; }
Source:
public static com.google.inject.Injector createInjector ( final com.google.inject.Injector db ) { final com.google.inject.Injector cfg = db.createChildInjector ( new com.google.gerrit.server.config.GerritConfigModule ( ) ) ; final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( cfg.getInstance ( com.google.gerrit.server.config.GerritGlobalModule.class ) ) ; return cfg.createChildInjector ( modules ) ; }

Target:
public static com.google.inject.Injector createInjector ( final com.google.inject.Injector db , final com.google.gerrit.server.config.CanonicalWebUrlModule canonicalWebUrl ) { final com.google.inject.Injector cfg = db.createChildInjector ( new com.google.gerrit.server.config.GerritConfigModule ( ) ) ; final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( cfg.getInstance ( com.google.gerrit.server.config.GerritGlobalModule.class ) ) ; modules.add ( canonicalWebUrl ) ; return cfg.createChildInjector ( modules ) ; }
Source:
private void showInitialScreen ( ) { com.google.gwt.user.client.History.addHistoryListener ( new com.google.gerrit.client.Link ( ) ) ; if ( "" . equals ( com.google.gwt.user.client.History.getToken ( ) ) ) { if ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) { com.google.gwt.user.client.History.newItem ( Link.MINE ) ; } else { com.google.gwt.user.client.History.newItem ( Link.ALL ) ; } } else { com.google.gwt.user.client.History.fireCurrentHistoryState ( ) ; } }

Target:
private void showInitialScreen ( ) { com.google.gwt.user.client.History.addHistoryListener ( new com.google.gerrit.client.Link ( ) ) ; if ( "" . equals ( com.google.gwt.user.client.History.getToken ( ) ) ) { if ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) { com.google.gwt.user.client.History.newItem ( Link.MINE ) ; } else { com.google.gwt.user.client.History.newItem ( Link.ALL_OPEN ) ; } } else { com.google.gwt.user.client.History.fireCurrentHistoryState ( ) ; } }
Source:
private void writeObject ( java.io.ObjectOutputStream out ) throws java.io.IOException { org.eclipse.jgit.lib.ObjectIdSerialization.writeCanBeNull ( out , oldId ) ; out.writeInt ( ( ( parentNum ) == null ? 0 : parentNum ) ) ; org.eclipse.jgit.lib.ObjectIdSerialization.writeNotNull ( out , newId ) ; java.lang.Character c = com.google.gerrit.server.patch.PatchListKey.WHITESPACE_TYPES.get ( whitespace ) ; if ( c == null ) { throw new java.io.IOException ( ( "Invalid whitespace type: " + ( whitespace ) ) ) ; } out.writeChar ( c ) ; out.writeChar ( com.google.gerrit.server.patch.PatchListKey.ALGORITHM_TYPES.get ( algorithm ) ) ; }

Target:
private void writeObject ( java.io.ObjectOutputStream out ) throws java.io.IOException { org.eclipse.jgit.lib.ObjectIdSerialization.writeCanBeNull ( out , oldId ) ; out.writeInt ( ( ( parentNum ) == null ? 0 : parentNum ) ) ; org.eclipse.jgit.lib.ObjectIdSerialization.writeNotNull ( out , newId ) ; java.lang.Character c = com.google.gerrit.server.diff.PatchListKey.WHITESPACE_TYPES.get ( whitespace ) ; if ( c == null ) { throw new java.io.IOException ( ( "Invalid whitespace type: " + ( whitespace ) ) ) ; } out.writeChar ( c ) ; out.writeChar ( com.google.gerrit.server.diff.PatchListKey.ALGORITHM_TYPES.get ( algorithm ) ) ; }
Source:
public com.google.gerrit.server.git.MetaDataUpdate create ( com.google.gerrit.reviewdb.client.Project.NameKey name , com.google.gerrit.server.IdentifiedUser user , org.eclipse.jgit.lib.BatchRefUpdate batch ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { return create ( name , mgr.openRepository ( name ) , user , batch ) ; }

Target:
public com.google.gerrit.server.git.MetaDataUpdate create ( com.google.gerrit.reviewdb.client.Project.NameKey name , com.google.gerrit.server.IdentifiedUser user , org.eclipse.jgit.lib.BatchRefUpdate batch ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { org.eclipse.jgit.lib.Repository repo = mgr.openRepository ( name ) ; com.google.gerrit.server.git.MetaDataUpdate md = create ( name , repo , user , batch ) ; md.setCloseRepository ( true ) ; return md ; }
Source:
public AccountResource.SshKey parse ( com.google.gerrit.server.account.AccountResource rsrc , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) { try { permissionBackend.user ( self ) . check ( GlobalPermission.MODIFY_ACCOUNT ) ; } catch ( com.google.gerrit.extensions.restapi.AuthException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } } return parse ( rsrc.getUser ( ) , id ) ; }

Target:
public AccountResource.SshKey parse ( com.google.gerrit.server.account.AccountResource rsrc , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) { try { permissionBackend.currentUser ( ) . check ( GlobalPermission.MODIFY_ACCOUNT ) ; } catch ( com.google.gerrit.extensions.restapi.AuthException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } } return parse ( rsrc.getUser ( ) , id ) ; }
Source:
public com.google.gerrit.server.notedb.ChangeUpdate getUpdate ( com.google.gerrit.reviewdb.client.PatchSet.Id psId ) { com.google.gerrit.server.notedb.ChangeUpdate u = updates.get ( psId ) ; if ( u == null ) { u = changeUpdateFactory.create ( ctl , when ) ; u.setPatchSetId ( psId ) ; updates.put ( psId , u ) ; } return u ; }

Target:
public com.google.gerrit.server.notedb.ChangeUpdate getUpdate ( com.google.gerrit.reviewdb.client.PatchSet.Id psId ) { com.google.gerrit.server.notedb.ChangeUpdate u = updates.get ( psId ) ; if ( u == null ) { u = changeUpdateFactory.create ( ctl , when ) ; if ( newChanges.containsKey ( ctl.getId ( ) ) ) { u.setAllowWriteToNewRef ( true ) ; } u.setPatchSetId ( psId ) ; updates.put ( psId , u ) ; } return u ; }
Source:
com.googlesource.gerrit.plugins.gitiles.FilteredRepository create ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws com.google.gerrit.server.project.NoSuchProjectException , java.io.IOException { com.google.gerrit.server.project.ProjectControl ctl = projectControlFactory.controlFor ( name , userProvider.get ( ) ) ; if ( ctl.getProject ( ) . getState ( ) . equals ( ProjectState.HIDDEN ) ) { throw new com.google.gerrit.server.project.NoSuchProjectException ( name ) ; } return new com.googlesource.gerrit.plugins.gitiles.FilteredRepository ( ctl , repoManager.openRepository ( name ) , visibleRefFilterFactory ) ; }

Target:
com.googlesource.gerrit.plugins.gitiles.FilteredRepository create ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws com.google.gerrit.server.permissions.PermissionBackendException , com.google.gerrit.server.project.NoSuchProjectException , java.io.IOException { com.google.gerrit.server.project.ProjectControl ctl = projectControlFactory.controlFor ( name , userProvider.get ( ) ) ; if ( ctl.getProject ( ) . getState ( ) . equals ( ProjectState.HIDDEN ) ) { throw new com.google.gerrit.server.project.NoSuchProjectException ( name ) ; } return new com.googlesource.gerrit.plugins.gitiles.FilteredRepository ( ctl , repoManager.openRepository ( name ) , visibleRefFilterFactory , permissionBackend ) ; }
Source:
private void setState ( final com.google.gerrit.reviewdb.client.Project.State newState ) { if ( ( state ) != null ) { for ( int i = 0 ; i < ( state.getItemCount ( ) ) ; i ++ ) { if ( newState.name ( ) . equals ( state.getValue ( i ) ) ) { state.setSelectedIndex ( i ) ; break ; } } } }

Target:
private void setState ( final com.google.gerrit.extensions.api.projects.ProjectState newState ) { if ( ( state ) != null ) { for ( int i = 0 ; i < ( state.getItemCount ( ) ) ; i ++ ) { if ( newState.name ( ) . equals ( state.getValue ( i ) ) ) { state.setSelectedIndex ( i ) ; break ; } } } }
Source:
public java.util.Collection < com.google.gwtorm.schema.ColumnModel > getColumns ( ) { final java.util.ArrayList < com.google.gwtorm.schema.ColumnModel > r = new java.util.ArrayList < com.google.gwtorm.schema.ColumnModel > ( ) ; r.addAll ( getDependentColumns ( ) ) ; r.addAll ( getPrimaryKeyColumns ( ) ) ; return r ; }

Target:
public java.util.Collection < com.google.gwtorm.schema.ColumnModel > getColumns ( ) { final java.util.ArrayList < com.google.gwtorm.schema.ColumnModel > r = new java.util.ArrayList < com.google.gwtorm.schema.ColumnModel > ( ) ; r.addAll ( getDependentColumns ( ) ) ; r.addAll ( getRowVersionColumns ( ) ) ; r.addAll ( getPrimaryKeyColumns ( ) ) ; return r ; }
Source:
static com.google.gerrit.server.group.PutMembers.Input init ( com.google.gerrit.server.group.PutMembers.Input in ) { if ( in == null ) { in = new com.google.gerrit.server.group.PutMembers.Input ( ) ; } if ( ( in.members ) == null ) { in.members = com.google.common.collect.Lists.newArrayListWithCapacity ( 1 ) ; } if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( in._oneMember ) ) ) { in.members.add ( in._oneMember ) ; } return in ; }

Target:
static com.google.gerrit.server.group.AddMembers.Input init ( com.google.gerrit.server.group.AddMembers.Input in ) { if ( in == null ) { in = new com.google.gerrit.server.group.AddMembers.Input ( ) ; } if ( ( in.members ) == null ) { in.members = com.google.common.collect.Lists.newArrayListWithCapacity ( 1 ) ; } if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( in._oneMember ) ) ) { in.members.add ( in._oneMember ) ; } return in ; }
Source:
public void onEvent ( com.google.gerrit.server.events.Event event ) { try { if ( ! ( publisherThread.isAlive ( ) ) ) { publisherThread.start ( ) ; } queue.put ( event ) ; } catch ( java.lang.InterruptedException e ) { com.googlesource.gerrit.plugins.rabbitmq.message.MessagePublisher.LOGGER.warn ( "Failed to queue event" , e ) ; } }

Target:
public void onEvent ( com.google.gerrit.server.events.Event event ) { if ( ! ( publisherThread.isAlive ( ) ) ) { publisherThread.start ( ) ; } if ( queue.offer ( event ) ) { if ( ( lostEventCount ) > 0 ) { com.googlesource.gerrit.plugins.rabbitmq.message.MessagePublisher.LOGGER.warn ( "Event queue is no longer full, events were lost" , lostEventCount ) ; lostEventCount = 0 ; } } else { if ( ( ( ( lostEventCount ) ++ ) % 10 ) == 0 ) { com.googlesource.gerrit.plugins.rabbitmq.message.MessagePublisher.LOGGER.error ( "Event queue is full, lost event(s)" , lostEventCount ) ; } } }
Source:
public void onLoad ( com.google.gerrit.plugin.client.screen.Screen screen ) { java.lang.String change = com.google.gwt.http.client.URL.decode ( screen.getToken ( 1 ) ) ; java.lang.String patchSet = com.google.gwt.http.client.URL.decode ( screen.getToken ( 2 ) ) ; java.lang.String path = screen.getToken ( 4 ) ; screen.show ( new com.googlesource.gerrit.plugins.xdocs.client.XDocSideBySideDiffScreen ( change , patchSet , path ) ) ; screen.setWindowTitle ( com.googlesource.gerrit.plugins.xdocs.client.FileInfo.getFileName ( path ) ) ; }

Target:
public void onLoad ( com.google.gerrit.plugin.client.screen.Screen screen ) { java.lang.String change = com.google.gwt.http.client.URL.decodeQueryString ( screen.getToken ( 1 ) ) ; java.lang.String patchSet = com.google.gwt.http.client.URL.decodeQueryString ( screen.getToken ( 2 ) ) ; java.lang.String path = screen.getToken ( 4 ) ; screen.show ( new com.googlesource.gerrit.plugins.xdocs.client.XDocSideBySideDiffScreen ( change , patchSet , path ) ) ; screen.setWindowTitle ( com.googlesource.gerrit.plugins.xdocs.client.FileInfo.getFileName ( path ) ) ; }
Source:
public void run ( ) { skipManager.removeAll ( ) ; chunkManager.reset ( ) ; diffTable.overview.clearDiffMarkers ( ) ; setShowIntraline ( prefs.intralineDifference ( ) ) ; render ( diff ) ; skipManager.render ( prefs.context ( ) , diff ) ; }

Target:
public void run ( ) { int height = ( com.google.gwt.user.client.Window.getClientHeight ( ) ) - ( ( com.google.gerrit.client.Gerrit.getHeaderFooterHeight ( ) ) + 18 ) ; cmA.setHeight ( height ) ; cmB.setHeight ( height ) ; render ( diff ) ; commentManager.render ( comments , prefs.expandAllComments ( ) ) ; skipManager.render ( prefs.context ( ) , diff ) ; }
Source:
protected java.nio.file.Path getResourcePath ( java.lang.String pathInfo ) throws java.io.IOException { return bowerComponents.resolve ( pathInfo ) ; }

Target:
protected java.nio.file.Path getResourcePath ( java.lang.String pathInfo ) throws java.io.IOException { if ( ( bowerComponents ) == null ) { throw new java.io.IOException ( ( ( ( ( "No polymer components found: " + ( zip ) ) + ". Run `" ) + ( buildCommand ) ) + "`?" ) ) ; } return bowerComponents.resolve ( pathInfo ) ; }
Source:
public void testAddMultipleHashtags ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; java.util.List < java.lang.String > expected = java.util.Arrays.asList ( "tag1" , "tag3" ) ; assertResult ( POST ( changeId , "tag3, tag1" , null ) , expected ) ; assertResult ( GET ( changeId ) , expected ) ; expected = java.util.Arrays.asList ( "tag1" , "tag2" , "tag3" , "tag4" ) ; assertResult ( POST ( changeId , "tag2, tag4" , null ) , expected ) ; assertResult ( GET ( changeId ) , expected ) ; }

Target:
public void testAddMultipleHashtags ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; addHashtags ( r , "tag3" , "tag1" ) ; assertThatGet ( r ) . containsExactly ( "tag1" , "tag3" ) . inOrder ( ) ; addHashtags ( r , "tag2" , "tag4" ) ; assertThatGet ( r ) . containsExactly ( "tag1" , "tag2" , "tag3" , "tag4" ) . inOrder ( ) ; }
Source:
private < T > T execute ( com.google.gerrit.server.update.RetryHelper.ActionType actionType , com.google.gerrit.server.update.RetryHelper.Action < T > action , com.github.rholder.retry.Retryer < T > retryer ) throws java.lang.Throwable { try { return retryer.call ( ( ) -> action.call ( ) ) ; } catch ( java.util.concurrent.ExecutionException | com.github.rholder.retry.RetryException e ) { if ( e instanceof com.github.rholder.retry.RetryException ) { metrics.timeoutCount.increment ( actionType ) ; } if ( ( e.getCause ( ) ) != null ) { throw e.getCause ( ) ; } throw e ; } }

Target:
private < T > T executeWithTimeoutCount ( com.google.gerrit.server.update.RetryHelper.ActionType actionType , com.google.gerrit.server.update.RetryHelper.Action < T > action , com.github.rholder.retry.Retryer < T > retryer ) throws java.lang.Throwable { try { return retryer.call ( ( ) -> action.call ( ) ) ; } catch ( java.util.concurrent.ExecutionException | com.github.rholder.retry.RetryException e ) { if ( e instanceof com.github.rholder.retry.RetryException ) { metrics.timeoutCount.increment ( actionType ) ; } if ( ( e.getCause ( ) ) != null ) { throw e.getCause ( ) ; } throw e ; } }
Source:
public java.util.List < com.google.gerrit.extensions.api.projects.BranchInfo > get ( ) throws com.google.gerrit.extensions.restapi.RestApiException { return listBranches ( this ) ; }

Target:
public java.util.List < com.google.gerrit.extensions.api.projects.BranchInfo > get ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return listBranches.get ( ) . request ( this ) . apply ( checkExists ( ) ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot list branches" , e ) ; } }
Source:
public void publishDraftPatchSet ( ) throws java.lang.Exception { 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 ) ; }

Target:
public void publishDraftPatchSet ( ) throws java.lang.Exception { java.lang.String changeId = createDraftChange ( ) ; java.lang.String triplet = "p~master~" + changeId ; com.google.gerrit.extensions.common.ChangeInfo c = get ( triplet ) ; com.google.common.truth.Truth.assertThat ( c.id ) . isEqualTo ( triplet ) ; com.google.common.truth.Truth.assertThat ( c.status ) . isEqualTo ( ChangeStatus.DRAFT ) ; com.google.gerrit.acceptance.RestResponse r = publishPatchSet ( changeId ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_NO_CONTENT ) ; com.google.common.truth.Truth.assertThat ( get ( triplet ) . status ) . isEqualTo ( ChangeStatus.NEW ) ; }
Source:
public void onRemoval ( java.lang.String pluginName , java.lang.String cacheName , com.google.common.cache.RemovalNotification < K , V > notification ) { if ( ( ( ! ( com.ericsson.gerrit.plugins.highavailability.forwarder.Context.isForwardedEvent ( ) ) ) && ( ! ( notification.wasEvicted ( ) ) ) ) && ( isSynchronized ( cacheName ) ) ) { executor.execute ( new CacheEvictionTask ( cacheName , notification.getKey ( ) ) ) ; } }

Target:
public void onRemoval ( java.lang.String pluginName , java.lang.String cacheName , com.google.common.cache.RemovalNotification < K , V > notification ) { if ( ( ( ! ( com.ericsson.gerrit.plugins.highavailability.forwarder.Context.isForwardedEvent ( ) ) ) && ( ! ( notification.wasEvicted ( ) ) ) ) && ( matcher.matches ( cacheName ) ) ) { executor.execute ( new CacheEvictionTask ( cacheName , notification.getKey ( ) ) ) ; } }
Source:
public void delete ( ) throws java.lang.Exception { for ( com.google.gerrit.acceptance.rest.project.PushTagIT.TagType tagType : com.google.gerrit.acceptance.rest.project.PushTagIT.TagType.values ( ) ) { allowTagCreation ( tagType ) ; java.lang.String tagRef = pushTagForExistingCommit ( tagType , Status.OK ) ; pushTagDeletion ( tagType , tagRef , Status.REJECTED_OTHER_REASON ) ; allowFastForwardTagUpdate ( ) ; pushTagDeletion ( tagType , tagRef , Status.REJECTED_OTHER_REASON ) ; } allowTagDeletion ( ) ; for ( com.google.gerrit.acceptance.rest.project.PushTagIT.TagType tagType : com.google.gerrit.acceptance.rest.project.PushTagIT.TagType.values ( ) ) { java.lang.String tagRef = pushTagForExistingCommit ( tagType , Status.OK ) ; pushTagDeletion ( tagType , tagRef , Status.OK ) ; } }

Target:
public void createTagForNewCommit ( ) throws java.lang.Exception { for ( com.google.gerrit.acceptance.rest.project.PushTagIT.TagType tagType : com.google.gerrit.acceptance.rest.project.PushTagIT.TagType.values ( ) ) { pushTagForNewCommit ( tagType , Status.REJECTED_OTHER_REASON ) ; allowTagCreation ( tagType ) ; pushTagForNewCommit ( tagType , Status.REJECTED_OTHER_REASON ) ; allowPushOnRefsTags ( ) ; pushTagForNewCommit ( tagType , Status.OK ) ; removePushFromRefsTags ( ) ; } }
Source:
public com.google.gerrit.server.account.AccountResource parse ( com.google.gerrit.extensions.restapi.TopLevelResource root , java.lang.String id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException { if ( "self" . equals ( id ) ) { com.google.gerrit.server.CurrentUser user = self.get ( ) ; if ( user instanceof com.google.gerrit.server.IdentifiedUser ) { return new com.google.gerrit.server.account.AccountResource ( ( ( com.google.gerrit.server.IdentifiedUser ) ( user ) ) ) ; } throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; }

Target:
public com.google.gerrit.server.account.AccountResource parse ( com.google.gerrit.extensions.restapi.TopLevelResource root , java.lang.String id ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceNotFoundException { if ( "self" . equals ( id ) ) { com.google.gerrit.server.CurrentUser user = self.get ( ) ; if ( user instanceof com.google.gerrit.server.IdentifiedUser ) { return new com.google.gerrit.server.account.AccountResource ( ( ( com.google.gerrit.server.IdentifiedUser ) ( user ) ) ) ; } else if ( user instanceof com.google.gerrit.server.AnonymousUser ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Authentication required" ) ; } else { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } } else { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } }
Source:
private void createLuceneIndex ( ) throws java.io.IOException { com.google.inject.Injector injector = com.google.inject.Guice.createInjector ( new com.google.gerrit.lucene.LuceneIndexModule ( com.google.gerrit.server.index.ChangeSchemas.getLatest ( ) . getVersion ( ) , 0 , null ) , new com.google.gerrit.pgm.init.InitIndex.MockIndexSupportModule ( ) ) ; com.google.gerrit.server.index.ChangeIndex index = injector.getInstance ( com.google.gerrit.lucene.LuceneChangeIndex.class ) ; index.markReady ( true ) ; index.close ( ) ; }

Target:
public void run ( ) throws java.io.IOException { ui.header ( "Index" ) ; com.google.gerrit.server.index.IndexModule.IndexType type = index.select ( "Type" , "type" , IndexType.LUCENE ) ; if ( ( site.isNew ) && ( type == ( com.google.gerrit.server.index.IndexModule.IndexType.LUCENE ) ) ) { com.google.gerrit.lucene.LuceneChangeIndex.setReady ( site , com.google.gerrit.server.index.ChangeSchemas.getLatest ( ) . getVersion ( ) , true ) ; } else { final java.lang.String message = java.lang.String.format ( ( "\nThe index must be %sbuilt before starting Gerrit:\n" + " java -jar gerrit.war reindex -d site_path\n" ) , ( site.isNew ? "" : "re" ) ) ; ui.message ( message ) ; initFlags.autoStart = false ; } }
Source:
private java.lang.String healthCheckSysinfo ( ) throws java.io.IOException { com.googlesource.gerrit.plugins.its.jira.restapi.JiraServerInfo info = client ( ) . sysInfo ( ) ; java.lang.String result = ( ( ( ( ( "{\"status\"=\"ok\",\"system\"=\"Jira\",\"version\"=\"" + ( info.getVersion ( ) ) ) + "\",\"url\"=\"" ) + ( getUrl ( ) ) ) + "\",\"build\"=\"" ) + ( info.getBuildNumber ( ) ) ) + "\"}" ; log.debug ( "Health check on sysinfo result: {}" , result ) ; return result ; }

Target:
private java.lang.String healthCheckSysinfo ( ) throws java.io.IOException { com.googlesource.gerrit.plugins.its.jira.restapi.JiraServerInfo info = client ( ) . sysInfo ( ) ; java.lang.String result = ( ( ( ( ( "{\"status\"=\"ok\",\"system\"=\"Jira\",\"version\"=\"" + ( info.getVersion ( ) ) ) + "\",\"url\"=\"" ) + ( info.getBaseUri ( ) ) ) + "\",\"build\"=\"" ) + ( info.getBuildNumber ( ) ) ) + "\"}" ; log.debug ( "Health check on sysinfo result: {}" , result ) ; return result ; }
Source:
public void testUnblockInLocalForceEditTopicName_Fails ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.REGISTERED ) ; org.junit.Assert.assertFalse ( "u can't edit topic name" , u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) ; }

Target:
public void testUnblockInLocalForceEditTopicName_Fails ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; org.junit.Assert.assertFalse ( "u can't edit topic name" , u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) ; }
Source:
public java.lang.Boolean call ( ) { try ( com.google.gerrit.reviewdb.server.ReviewDb db = com.google.gerrit.pgm.RebuildNoteDb.unwrap ( schemaFactory.open ( ) ) ) { return rebuilder.rebuildProject ( db , changesByProject , project , allUsersRepo ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.pgm.RebuildNoteDb.log.error ( ( "Error rebuilding project " + project ) , e ) ; return false ; } }

Target:
public java.lang.Boolean call ( ) { try ( com.google.gerrit.reviewdb.server.ReviewDb db = com.google.gerrit.reviewdb.server.ReviewDbUtil.unwrapDb ( schemaFactory.open ( ) ) ) { return rebuilder.rebuildProject ( db , changesByProject , project , allUsersRepo ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.pgm.RebuildNoteDb.log.error ( ( "Error rebuilding project " + project ) , e ) ; return false ; } }
Source:
void addComments ( java.util.List < com.google.gerrit.client.changes.CommentInfo > list ) { { renderComments ( list ) ; comments.setVisible ( ( ( comments.getWidgetCount ( ) ) > 0 ) ) ; commentList = java.util.Collections.emptyList ( ) ; } commentList = list ; BRANCH ( a310bb ) ; SideBySide2 : Draw = $missing$ ; com.google.gerrit.client.change.a line ; com.google.gerrit.client.change.the file ; com.google.gerrit.client.change.header when ; }

Target:
void addComments ( java.util.List < com.google.gerrit.client.changes.CommentInfo > list ) { if ( isOpen ( ) ) { renderComments ( list ) ; comments.setVisible ( ( ( comments.getWidgetCount ( ) ) > 0 ) ) ; commentList = java.util.Collections.emptyList ( ) ; } else { commentList = list ; if ( ( autoOpen ) && ( ! ( commentList.isEmpty ( ) ) ) ) { setOpen ( true ) ; } } }
Source:
public void testWithSymlink ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit c = makeCommitWithSymlink ( ) ; java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m = com.googlesource.gerrit.plugins.uploadvalidator.SymlinkValidator.performValidation ( repo , c ) ; com.google.common.truth.Truth.assertThat ( m ) . hasSize ( 2 ) ; java.util.List < com.googlesource.gerrit.plugins.uploadvalidator.ComparableCommitValidationMessage > expected = new java.util.ArrayList < > ( ) ; expected.add ( new com.googlesource.gerrit.plugins.uploadvalidator.ComparableCommitValidationMessage ( "Symbolic links are not allowed: foo.txt" , true ) ) ; expected.add ( new com.googlesource.gerrit.plugins.uploadvalidator.ComparableCommitValidationMessage ( "Symbolic links are not allowed: symbolicFolder" , true ) ) ; com.google.common.truth.Truth.assertThat ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessages ( m ) ) . containsAllIn ( expected ) ; }

Target:
public void testWithSymlink ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit c = makeCommitWithSymlink ( ) ; java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m = com.googlesource.gerrit.plugins.uploadvalidator.SymlinkValidator.performValidation ( repo , c ) ; java.util.Set < java.lang.String > expected = com.google.common.collect.ImmutableSet.of ( "ERROR: Symbolic links are not allowed: foo.txt" , "ERROR: Symbolic links are not allowed: symbolicFolder" ) ; com.google.common.truth.Truth.assertThat ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessages ( m ) ) . containsExactlyElementsIn ( expected ) ; }
Source:
public void onLoad ( ) { if ( ( sbsTable ) == null ) { initUI ( ) ; } super . onLoad ( ) ; PatchUtil.DETAIL_SVC.sideBySidePatchDetail ( patchId , null , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.data.SideBySidePatchDetail > ( ) { public void onSuccess ( final com.google.gerrit.client.data.SideBySidePatchDetail r ) { if ( isAttached ( ) ) { display ( r ) ; } } } ) ; }

Target:
public void onLoad ( ) { if ( ( sbsTable ) == null ) { initUI ( ) ; } super . onLoad ( ) ; PatchUtil.DETAIL_SVC.sideBySidePatchDetail ( patchId , null , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.data.SideBySidePatchDetail > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gerrit.client.data.SideBySidePatchDetail r ) { display ( r ) ; } } ) ; }
Source:
private void loadGroups ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { final com.google.gwtorm.client.ResultSet < com.google.gerrit.client.reviewdb.AccountGroup > r = db.accountGroups ( ) . get ( groups.keySet ( ) ) ; groups.clear ( ) ; for ( final com.google.gerrit.client.reviewdb.AccountGroup g : r ) { groups.put ( g.getId ( ) , g ) ; } }

Target:
public void setRights ( final java.util.List < com.google.gerrit.client.reviewdb.ProjectRight > r ) { rights = r ; }
Source:
public void testCommitTime ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit root = repo.commit ( ) . create ( ) ; org.eclipse.jgit.revwalk.RevCommit master = repo.commit ( ) . parent ( root ) . create ( ) ; assertEquals ( ( ( start ) + 1 ) , getTime ( root ) ) ; assertEquals ( ( ( start ) + 2 ) , getTime ( master ) ) ; }

Target:
public void commitTime ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit root = repo.commit ( ) . create ( ) ; org.eclipse.jgit.revwalk.RevCommit master = repo.commit ( ) . parent ( root ) . create ( ) ; org.junit.Assert.assertEquals ( ( ( start ) + 1 ) , getTime ( root ) ) ; org.junit.Assert.assertEquals ( ( ( start ) + 2 ) , getTime ( master ) ) ; }
Source:
private static java.lang.StringBuilder buildRefsPrefix ( java.lang.String prefix , com.google.gerrit.reviewdb.client.Account.Id accountId ) { java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( prefix ) ; int n = ( accountId.get ( ) ) % 100 ; if ( n < 10 ) { r.append ( '0' ) ; } r.append ( n ) ; r.append ( '/' ) ; r.append ( accountId.get ( ) ) ; r.append ( '/' ) ; return r ; }

Target:
public static java.lang.String refsStarredChanges ( com.google.gerrit.reviewdb.client.Change.Id changeId , com.google.gerrit.reviewdb.client.Account.Id accountId ) { java.lang.StringBuilder r = com.google.gerrit.reviewdb.client.RefNames.buildRefsPrefix ( com.google.gerrit.reviewdb.client.RefNames.REFS_STARRED_CHANGES , changeId.get ( ) ) ; r.append ( accountId.get ( ) ) ; return r.toString ( ) ; }
Source:
public void listProjects ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey someProject = new com.google.gerrit.reviewdb.client.Project.NameKey ( "some-project" ) ; com.google.gerrit.acceptance.GitUtil.createProject ( sshSession , someProject.get ( ) ) ; com.google.gerrit.acceptance.RestResponse r = GET ( "/projects/" ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ProjectInfo > result = com.google.gerrit.acceptance.rest.project.ListProjectsIT.toProjectInfoMap ( r ) ; com.google.gerrit.acceptance.rest.project.ProjectAssert.assertProjects ( java.util.Arrays.asList ( allUsers , someProject , project ) , result.values ( ) ) ; }

Target:
public void listProjectsFiltersInvisibleProjects ( ) throws java.lang.Exception { setApiUser ( user ) ; com.google.gerrit.acceptance.rest.project.ProjectAssert.assertThatNameList ( gApi.projects ( ) . list ( ) . get ( ) ) . contains ( project ) ; com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.server.project.Util.block ( cfg , Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; saveProjectConfig ( project , cfg ) ; com.google.gerrit.acceptance.rest.project.ProjectAssert.assertThatNameList ( gApi.projects ( ) . list ( ) . get ( ) ) . doesNotContain ( project ) ; }
Source:
static com.google.gerrit.server.project.ProjectControl getProjectControl ( javax.servlet.http.HttpServletRequest req ) throws org.eclipse.jgit.transport.resolver.ServiceNotEnabledException { com.google.gerrit.server.project.ProjectControl pc = ( ( com.google.gerrit.server.project.ProjectControl ) ( req.getAttribute ( com.google.gerrit.httpd.ProjectServlet.ATT_CONTROL ) ) ) ; if ( pc == null ) { com.google.gerrit.httpd.ProjectServlet.log.error ( ( ( "No " + ( com.google.gerrit.httpd.ProjectServlet.ATT_CONTROL ) ) + " in request" ) , new java.lang.Exception ( "here" ) ) ; throw new org.eclipse.jgit.transport.resolver.ServiceNotEnabledException ( ) ; } return pc ; }

Target:
static com.google.gerrit.server.project.ProjectControl getProjectControl ( javax.servlet.ServletRequest req ) throws org.eclipse.jgit.transport.resolver.ServiceNotEnabledException { com.google.gerrit.server.project.ProjectControl pc = ( ( com.google.gerrit.server.project.ProjectControl ) ( req.getAttribute ( com.google.gerrit.httpd.ProjectServlet.ATT_CONTROL ) ) ) ; if ( pc == null ) { com.google.gerrit.httpd.ProjectServlet.log.error ( ( ( "No " + ( com.google.gerrit.httpd.ProjectServlet.ATT_CONTROL ) ) + " in request" ) , new java.lang.Exception ( "here" ) ) ; throw new org.eclipse.jgit.transport.resolver.ServiceNotEnabledException ( ) ; } return pc ; }
Source:
public boolean canForceEditTopicName ( ) { boolean result = false ; for ( com.google.gerrit.common.data.PermissionRule rule : access ( Permission.EDIT_TOPIC_NAME ) ) { if ( rule.isBlock ( ) ) { return false ; } if ( rule.getForce ( ) ) { result = true ; } } return result ; }

Target:
int getBlockMin ( ) { return java.lang.Math.min ( blockMin , ( ( allowMin ) - 1 ) ) ; }
Source:
private boolean isWhiteListed ( javax.servlet.ServletRequest request ) { java.lang.String requestUri = ( ( javax.servlet.http.HttpServletRequest ) ( request ) ) . getRequestURI ( ) ; for ( java.lang.String suffix : com.googlesource.gerrit.plugins.github.filters.GitHubOAuthFilter.whiteList ) { if ( requestUri.endsWith ( suffix ) ) { return true ; } } return config.scopeSelectionUrl.endsWith ( requestUri ) ; }

Target:
public boolean apply ( com.google.gerrit.reviewdb.client.AccountExternalId externalId ) { return ( externalId.isScheme ( AccountExternalId.SCHEME_EXTERNAL ) ) && ( externalId.getSchemeRest ( ) . startsWith ( OAuthWebFilter.GITHUB_EXT_ID ) ) ; }