auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean exists ( final java.lang.String issudeId ) { java.lang.String info = null ; try { info = client.getStory ( issudeId ) ; } catch ( java.io.IOException e ) { log.error ( "Error: Storyboard is not accessible" ) ; } if ( info != null ) { log.debug ( ( "Story exists, info: " + info ) ) ; return true ; } return false ; }

Target:
public boolean exists ( final java.lang.String issudeId ) { java.lang.String info = null ; try { info = client.getStory ( issudeId ) ; } catch ( java.io.IOException e ) { log.error ( ( "Error: Storyboard is not accessible at: " + ( com.googlesource.gerrit.plugins.its.storyboard.StoryboardItsFacade.GERRIT_CONFIG_URL ) ) ) ; } if ( info != null ) { log.debug ( ( "Story exists, info: " + info ) ) ; return true ; } return false ; }
Source:
public void run ( ) { try { final java.io.BufferedReader br = new java.io.BufferedReader ( new java.io.InputStreamReader ( in , "ISO-8859-1" ) ) ; try { java.lang.String line ; while ( ( line = br.readLine ( ) ) != null ) { com.google.gerrit.httpd.gitweb.GitwebServlet.log.error ( ( "CGI: " + line ) ) ; } } finally { br.close ( ) ; } } catch ( java.io.IOException e ) { com.google.gerrit.httpd.gitweb.GitwebServlet.log.debug ( "Unexpected error copying stderr from CGI" , e ) ; } }

Target:
public void run ( ) { try ( java.io.BufferedReader br = new java.io.BufferedReader ( new java.io.InputStreamReader ( in , java.nio.charset.StandardCharsets.ISO_8859_1.name ( ) ) ) ) { java.lang.String line ; while ( ( line = br.readLine ( ) ) != null ) { com.google.gerrit.httpd.gitweb.GitwebServlet.log.error ( ( "CGI: " + line ) ) ; } } catch ( java.io.IOException e ) { com.google.gerrit.httpd.gitweb.GitwebServlet.log.debug ( "Unexpected error copying stderr from CGI" , e ) ; } }
Source:
static void noCache ( javax.servlet.http.HttpServletResponse res ) { res.setHeader ( "Expires" , "Fri, 01 Jan 1980 00:00:00 GMT" ) ; res.setHeader ( "Pragma" , "no-cache" ) ; res.setHeader ( "Cache-Control" , "no-cache, must-revalidate" ) ; res.setHeader ( "Content-Disposition" , "attachment" ) ; }

Target:
private void writeToResponse ( javax.servlet.http.HttpServletResponse res , java.io.InputStream in ) throws java.io.IOException { try { java.io.OutputStream out = res.getOutputStream ( ) ; try { byte [ ] tmp = new byte [ 1024 ] ; int n ; while ( ( n = in.read ( tmp ) ) > 0 ) { out.write ( tmp , 0 , n ) ; } } finally { out.close ( ) ; } } finally { in.close ( ) ; } }
Source:
public com.google.gitiles.GitilesView.Builder setPathPart ( java.lang.String path ) { switch ( type ) { case PATH : case DIFF : this . path = com.google.gitiles.GitilesView.maybeTrimLeadingAndTrailingSlash ( com.google.common.base.Preconditions.checkNotNull ( path ) ) ; return this ; case REFS : case LOG : this . path = ( path != null ) ? com.google.gitiles.GitilesView.maybeTrimLeadingAndTrailingSlash ( path ) : null ; return this ; default : throw new java.lang.IllegalStateException ( java.lang.String.format ( "cannot set path on %s view" , type ) ) ; } }

Target:
public com.google.gitiles.GitilesView.Builder setPathPart ( java.lang.String path ) { switch ( type ) { case PATH : case DIFF : this . path = com.google.gitiles.GitilesView.maybeTrimLeadingAndTrailingSlash ( com.google.common.base.Preconditions.checkNotNull ( path ) ) ; return this ; case DESCRIBE : case REFS : case LOG : this . path = ( path != null ) ? com.google.gitiles.GitilesView.maybeTrimLeadingAndTrailingSlash ( path ) : null ; return this ; default : throw new java.lang.IllegalStateException ( java.lang.String.format ( "cannot set path on %s view" , type ) ) ; } }
Source:
public void createdOnIsPopulatedForGroupsCreatedBeforeAudit ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.AccountGroup.Id groupId = createGroup ( "Ancient group for schema migration" ) ; setCreatedOnToVeryOldTimestamp ( groupId ) ; removeAuditEntriesFor ( groupId ) ; schema151.migrateData ( db , new com.google.gerrit.testing.TestUpdateUI ( ) ) ; java.sql.Timestamp createdOn = getCreatedOn ( groupId ) ; com.google.common.truth.Truth.assertThat ( createdOn ) . isEqualTo ( com.google.gerrit.reviewdb.client.AccountGroup.auditCreationInstantTs ( ) ) ; }

Target:
public void createdOnIsPopulatedForGroupsCreatedAfterAudit ( ) throws java.lang.Exception { java.sql.Timestamp testStartTime = com.google.gerrit.common.TimeUtil.nowTs ( ) ; com.google.gerrit.reviewdb.client.AccountGroup.Id groupId = createGroupInReviewDb ( "Group for schema migration" ) ; setCreatedOnToVeryOldTimestamp ( groupId ) ; schema151.migrateData ( db , new com.google.gerrit.testing.TestUpdateUI ( ) ) ; java.sql.Timestamp createdOn = getCreatedOn ( groupId ) ; com.google.common.truth.Truth.assertThat ( createdOn ) . isAtLeast ( testStartTime ) ; }
Source:
private int limit ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > s ) { int n = ( queryBuilder.hasLimit ( s ) ) ? queryBuilder.getLimit ( s ) : maxLimit ; return ( limit ) > 0 ? ( java.lang.Math.min ( n , limit ) ) + 1 : n + 1 ; }

Target:
private int limit ( com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > s ) { int n = ( com.google.gerrit.server.query.change.ChangeQueryBuilder.hasLimit ( s ) ) ? com.google.gerrit.server.query.change.ChangeQueryBuilder.getLimit ( s ) : maxLimit ; return ( limit ) > 0 ? ( java.lang.Math.min ( n , limit ) ) + 1 : n + 1 ; }
Source:
public java.lang.Iterable < com.google.gerrit.extensions.common.WebLinkInfo > getBranchLinks ( java.lang.String project , java.lang.String branch ) { java.util.List < com.google.gerrit.extensions.common.WebLinkInfo > links = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.extensions.webui.BranchWebLink webLink : branchLinks ) { links.add ( new com.google.gerrit.extensions.common.WebLinkInfo ( webLink.getLinkName ( ) , webLink.getImageUrl ( ) , webLink.getBranchUrl ( project , branch ) ) ) ; } return links ; }

Target:
public java.lang.Iterable < com.google.gerrit.extensions.common.WebLinkInfo > getBranchLinks ( java.lang.String project , java.lang.String branch ) { java.util.List < com.google.gerrit.extensions.common.WebLinkInfo > links = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.extensions.webui.BranchWebLink webLink : branchLinks ) { links.add ( new com.google.gerrit.extensions.common.WebLinkInfo ( webLink.getLinkName ( ) , webLink.getImageUrl ( ) , webLink.getBranchUrl ( project , branch ) , webLink.getTarget ( ) ) ) ; } return links ; }
Source:
protected void onLoad ( ) { if ( ! ( loaded ) ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeApi.detail ( changeId.get ( ) ) ; com.google.gerrit.client.changes.ChangeList.addOptions ( call , java.util.EnumSet.of ( ListChangesOption.ALL_REVISIONS , ListChangesOption.ALL_COMMITS ) ) ; call.get ( new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { render ( result.revisions ( ) ) ; loaded = true ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ; } }

Target:
protected void onLoad ( ) { if ( ! ( loaded ) ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeApi.detail ( changeId.get ( ) ) ; com.google.gerrit.client.changes.ChangeList.addOptions ( call , java.util.EnumSet.of ( ListChangesOption.ALL_COMMITS , ListChangesOption.ALL_REVISIONS , ListChangesOption.DRAFT_COMMENTS ) ) ; call.get ( new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { render ( result.revisions ( ) ) ; loaded = true ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ; } }
Source:
private static java.util.Collection < java.security.PublicKey > computeHostKeys ( ) { final org.apache.sshd.common.KeyPairProvider p = com.google.gerrit.server.ssh.GerritSshDaemon.sshd.getKeyPairProvider ( ) ; final java.util.List < java.security.PublicKey > keys = new java.util.ArrayList < java.security.PublicKey > ( 2 ) ; com.google.gerrit.server.ssh.GerritSshDaemon.addPublicKey ( keys , p , KeyPairProvider.SSH_DSS ) ; com.google.gerrit.server.ssh.GerritSshDaemon.addPublicKey ( keys , p , KeyPairProvider.SSH_RSA ) ; return java.util.Collections.unmodifiableList ( keys ) ; }

Target:
public static synchronized int getSshdPort ( ) { return ( com.google.gerrit.server.ssh.GerritSshDaemon.sshd ) != null ? com.google.gerrit.server.ssh.GerritSshDaemon.sshd.getPort ( ) : 0 ; }
Source:
private com.google.gerrit.reviewdb.client.AccountGroup newGroup ( com.google.gerrit.reviewdb.server.ReviewDb c , java.lang.String name ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid = com.google.gerrit.server.account.GroupUUID.make ( name , serverUser ) ; return new com.google.gerrit.reviewdb.client.AccountGroup ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( name ) , new com.google.gerrit.reviewdb.client.AccountGroup.Id ( c.nextAccountGroupId ( ) ) , uuid , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; }

Target:
private static com.google.gerrit.server.group.db.InternalGroupCreation getGroupCreation ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.common.data.GroupReference groupReference ) throws com.google.gwtorm.server.OrmException { return com.google.gerrit.server.group.db.InternalGroupCreation.builder ( ) . setNameKey ( new com.google.gerrit.reviewdb.client.AccountGroup.NameKey ( groupReference.getName ( ) ) ) . setId ( new com.google.gerrit.reviewdb.client.AccountGroup.Id ( db.nextAccountGroupId ( ) ) ) . setGroupUUID ( groupReference.getUUID ( ) ) . setCreatedOn ( com.google.gerrit.common.TimeUtil.nowTs ( ) ) . build ( ) ; }
Source:
private static < T > java.util.Set < T > one ( final java.util.Set < T > c ) { return java.util.Collections.singleton ( c.iterator ( ) . next ( ) ) ; }

Target:
private static com.google.gerrit.server.account.AccountIdSet pack ( final java.util.Set < com.google.gerrit.reviewdb.Account.Id > c ) { switch ( c.size ( ) ) { case 0 : return AccountIdSet.EMPTY_SET ; case 1 : return new com.google.gerrit.server.account.AccountIdSet ( c.iterator ( ) . next ( ) ) ; default : return new com.google.gerrit.server.account.AccountIdSet ( new java.util.HashSet < com.google.gerrit.reviewdb.Account.Id > ( c ) ) ; } }
Source:
protected void setupVelocityContext ( ) { super . setupVelocityContext ( ) ; velocityContext.put ( "change" , change ) ; velocityContext.put ( "branch" , change.getDest ( ) ) ; velocityContext.put ( "projectName" , projectName ) ; velocityContext.put ( "patchSet" , patchSet ) ; velocityContext.put ( "patchSetInfo" , patchSetInfo ) ; }

Target:
protected void setupVelocityContext ( ) { super . setupVelocityContext ( ) ; velocityContext.put ( "change" , change ) ; velocityContext.put ( "changeId" , change.getKey ( ) ) ; velocityContext.put ( "coverLetter" , getCoverLetter ( ) ) ; velocityContext.put ( "branch" , change.getDest ( ) ) ; velocityContext.put ( "fromName" , getNameFor ( fromId ) ) ; velocityContext.put ( "projectName" , projectName ) ; velocityContext.put ( "patchSet" , patchSet ) ; velocityContext.put ( "patchSetInfo" , patchSetInfo ) ; }
Source:
protected void configure ( ) { cache ( com.google.gerrit.server.git.SearchingChangeCacheImpl.ID_CACHE , Project.NameKey.class , new com.google.inject.TypeLiteral < java.util.List < com.google.gerrit.server.git.SearchingChangeCacheImpl.CachedChange > > ( ) { } ) . maximumWeight ( 0 ) . loader ( com.google.gerrit.server.git.SearchingChangeCacheImpl.Loader.class ) ; bind ( com.google.gerrit.server.git.SearchingChangeCacheImpl.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.GitReferenceUpdatedListener.class ) . to ( com.google.gerrit.server.git.SearchingChangeCacheImpl.class ) ; }

Target:
protected void configure ( ) { if ( slave ) { bind ( com.google.gerrit.server.git.SearchingChangeCacheImpl.class ) . toProvider ( com.google.inject.util.Providers.< com.google.gerrit.server.git.SearchingChangeCacheImpl > of ( null ) ) ; } else { cache ( com.google.gerrit.server.git.SearchingChangeCacheImpl.ID_CACHE , Project.NameKey.class , new com.google.inject.TypeLiteral < java.util.List < com.google.gerrit.server.git.SearchingChangeCacheImpl.CachedChange > > ( ) { } ) . maximumWeight ( 0 ) . loader ( com.google.gerrit.server.git.SearchingChangeCacheImpl.Loader.class ) ; bind ( com.google.gerrit.server.git.SearchingChangeCacheImpl.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.GitReferenceUpdatedListener.class ) . to ( com.google.gerrit.server.git.SearchingChangeCacheImpl.class ) ; } }
Source:
public void setUp ( ) throws java.lang.Exception { testEnv.getInjector ( ) . injectMembers ( this ) ; db = testEnv.getDb ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { testEnv.getInjector ( ) . injectMembers ( this ) ; db = testEnv.getDb ( ) ; com.google.common.truth.TruthJUnit.assume ( ) . that ( ( ( db ) instanceof com.google.gwtorm.jdbc.JdbcSchema ) ) . isTrue ( ) ; connection = ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) . getConnection ( ) ; createdOnRetrieval = connection.prepareStatement ( "SELECT created_on FROM account_groups WHERE group_id = ?" ) ; createdOnUpdate = connection.prepareStatement ( "UPDATE account_groups SET created_on = ? WHERE group_id = ?" ) ; auditEntryDeletion = connection.prepareStatement ( "DELETE FROM account_group_members_audit WHERE group_id = ?" ) ; }
Source:
public void beginTask ( java.lang.String task , int totalUnits ) { ( this . currTask ) ++ ; this . task = task ; this . totUnits = totalUnits ; this . currUnit = 0 ; this . lastPercentage = 0 ; }

Target:
public void beginTask ( java.lang.String task , int totalUnits ) { ( this . currTask ) ++ ; this . task = task ; this . totUnits = totalUnits ; this . currUnit = 0 ; this . lastPercentage = 0 ; status.update ( Code.SYNC , status.getShortDescription ( ) , getStatusDescription ( ) ) ; }
Source:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { b.setEnabled ( false ) ; Util.MANAGE_SVC.deleteDraftChange ( patchSet.getId ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { public void onSuccess ( com.google.gwtjsonrpc.client.VoidResult result ) { com.google.gerrit.client.Gerrit.display ( PageLinks.MINE ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { b.setEnabled ( true ) ; super . onFailure ( caught ) ; } } ) ; }

Target:
public void onSend ( ) { Util.MANAGE_SVC.revertChange ( patchSet.getId ( ) , getMessageText ( ) , createCallback ( ) ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.changes.CommentInfo result ) { enableEdit ( true ) ; set ( result ) ; if ( ( result.message ( ) . length ( ) ) < 70 ) { com.google.gwt.user.client.ui.UIObject.setVisible ( p_edit , false ) ; setOpen ( false ) ; } else { setEdit ( false ) ; } }

Target:
public void execute ( ) { resizePaddingWidget ( ) ; }
Source:
public void execute ( ) { commentManager.newDraftCallback ( cm ) . run ( ) ; }

Target:
private void setLineNumber ( com.google.gerrit.client.diff.DisplaySide side , int cmLine , java.lang.String html , java.lang.String styleName ) { com.google.gwt.user.client.ui.InlineHTML gutter = new com.google.gwt.user.client.ui.InlineHTML ( html ) ; diffTable.add ( gutter ) ; gutter.setStyleName ( styleName ) ; cm.setGutterMarker ( cmLine , ( side == ( DisplaySide.A ) ? UnifiedTable.style.lineNumbersLeft ( ) : UnifiedTable.style.lineNumbersRight ( ) ) , gutter.getElement ( ) ) ; }
Source:
private java.util.Set < java.lang.String > findReviewers ( java.util.List < com.googlesource.gerrit.plugins.reviewers.ReviewerFilterSection > sections , final com.google.gerrit.reviewdb.server.ReviewDb reviewDb , final com.google.gerrit.reviewdb.client.Change change ) throws com.google.gerrit.server.query.QueryParseException , com.google.gwtorm.server.OrmException { com.google.common.collect.ImmutableSet.Builder < java.lang.String > reviewers = com.google.common.collect.ImmutableSet.builder ( ) ; java.util.List < com.googlesource.gerrit.plugins.reviewers.ReviewerFilterSection > found = findReviewerSections ( sections , reviewDb , change ) ; for ( com.googlesource.gerrit.plugins.reviewers.ReviewerFilterSection s : found ) { reviewers.addAll ( s.getReviewers ( ) ) ; } return reviewers.build ( ) ; }

Target:
private java.util.Set < java.lang.String > findReviewers ( java.util.List < com.googlesource.gerrit.plugins.reviewers.ReviewerFilterSection > sections , com.google.gerrit.server.query.change.ChangeData changeData ) throws com.google.gerrit.server.query.QueryParseException , com.google.gwtorm.server.OrmException { com.google.common.collect.ImmutableSet.Builder < java.lang.String > reviewers = com.google.common.collect.ImmutableSet.builder ( ) ; java.util.List < com.googlesource.gerrit.plugins.reviewers.ReviewerFilterSection > found = findReviewerSections ( sections , changeData ) ; for ( com.googlesource.gerrit.plugins.reviewers.ReviewerFilterSection s : found ) { reviewers.addAll ( s.getReviewers ( ) ) ; } return reviewers.build ( ) ; }
Source:
public void onSend ( ) { com.google.gerrit.client.changes.ChangeApi.createDraftChange ( project , getDestinationBranch ( ) , message.getText ( ) , null , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.changes.ChangeInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { sent = true ; hide ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( result.legacy_id ( ) ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { enableButtons ( true ) ; super . onFailure ( caught ) ; } } ) ; }

Target:
public void onSend ( ) { com.google.gerrit.client.changes.ChangeApi.createChange ( project , getDestinationBranch ( ) , message.getText ( ) , null , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.changes.ChangeInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { sent = true ; hide ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( result.legacy_id ( ) ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { enableButtons ( true ) ; super . onFailure ( caught ) ; } } ) ; }
Source:
private void createHeaderText ( ) { final com.google.gwt.user.client.ui.FlowPanel headerText = new com.google.gwt.user.client.ui.FlowPanel ( ) ; final java.lang.String me = Window.Location.getHostName ( ) ; final com.google.gwt.user.client.ui.Label headerLabel = new com.google.gwt.user.client.ui.Label ( ) ; switch ( mode ) { case LINK_IDENTIY : headerLabel.setText ( OpenIdUtil.M.linkAt ( me ) ) ; break ; case SIGN_IN : default : headerLabel.setText ( OpenIdUtil.M.signInAt ( me ) ) ; break ; } headerLabel.setStyleName ( "gerrit-SmallHeading" ) ; headerText.add ( headerLabel ) ; formBody.add ( headerText ) ; }

Target:
private void createHeaderText ( ) { final com.google.gwt.user.client.ui.FlowPanel headerText = new com.google.gwt.user.client.ui.FlowPanel ( ) ; final java.lang.String me = Window.Location.getHostName ( ) ; final com.google.gerrit.client.ui.SmallHeading headerLabel = new com.google.gerrit.client.ui.SmallHeading ( ) ; switch ( mode ) { case LINK_IDENTIY : headerLabel.setText ( OpenIdUtil.M.linkAt ( me ) ) ; break ; case SIGN_IN : default : headerLabel.setText ( OpenIdUtil.M.signInAt ( me ) ) ; break ; } headerText.add ( headerLabel ) ; formBody.add ( headerText ) ; }
Source:
static java.lang.String resolveTargetUrl ( com.google.gitiles.GitilesView view , java.lang.String target ) { java.lang.String resolved = com.google.gitiles.Paths.simplifyPathUpToRoot ( target , view.getTreePath ( ) ) ; if ( resolved == null ) { return null ; } return com.google.gitiles.GitilesView.path ( ) . copyFrom ( view ) . setTreePath ( resolved ) . toUrl ( ) ; }

Target:
static java.lang.String resolveTargetUrl ( com.google.gitiles.GitilesView view , java.lang.String target ) { java.lang.String resolved = com.google.gitiles.Paths.simplifyPathUpToRoot ( target , view.getPathPart ( ) ) ; if ( resolved == null ) { return null ; } return com.google.gitiles.GitilesView.path ( ) . copyFrom ( view ) . setPathPart ( resolved ) . toUrl ( ) ; }
Source:
public void add ( final com.google.inject.Injector ... injectors ) { for ( final com.google.inject.Injector i : injectors ) { add ( i ) ; } }

Target:
public void add ( final com.google.inject.Injector injector ) { if ( started ) { throw new java.lang.IllegalStateException ( "Already started" ) ; } for ( final com.google.inject.Binding < com.google.gerrit.lifecycle.LifecycleListener > binding : com.google.gerrit.lifecycle.LifecycleManager.get ( injector ) ) { add ( binding.getProvider ( ) . get ( ) ) ; } }
Source:
public java.lang.Boolean call ( ) throws com.google.gerrit.server.project.NoSuchProjectException { return controlFor ( project ) . isVisible ( ) ; }

Target:
public java.lang.Boolean call ( ) throws com.google.gerrit.server.permissions.PermissionBackendException , com.google.gerrit.server.project.NoSuchProjectException { com.google.gerrit.server.project.ProjectControl projectControl = controlFor ( project ) ; return ( shouldReplicate ( projectControl ) ) && ( ( PushOne.ALL_REFS.equals ( ref ) ) || ( projectControl.controlForRef ( ref ) . isVisible ( ) ) ) ; }
Source:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < > ( ) ; modules.add ( sysInjector.getInstance ( com.google.gerrit.sshd.SshModule.class ) ) ; modules.add ( new com.google.gerrit.sshd.SshHostKeyModule ( ) ) ; modules.add ( new com.google.gerrit.sshd.commands.DefaultCommandModule ( false , sysInjector.getInstance ( com.google.gerrit.server.config.DownloadConfig.class ) ) ) ; return sysInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < > ( ) ; modules.add ( sysInjector.getInstance ( com.google.gerrit.sshd.SshModule.class ) ) ; modules.add ( new com.google.gerrit.sshd.SshHostKeyModule ( ) ) ; modules.add ( new com.google.gerrit.sshd.commands.DefaultCommandModule ( false , sysInjector.getInstance ( com.google.gerrit.server.config.DownloadConfig.class ) ) ) ; if ( ( indexType ) == ( com.google.gerrit.server.index.IndexModule.IndexType.LUCENE ) ) { modules.add ( new com.google.gerrit.sshd.commands.IndexCommandsModule ( ) ) ; } return sysInjector.createChildInjector ( modules ) ; }
Source:
public void loginPhase1 ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response , java.util.Set < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > scopes ) throws java.io.IOException { java.lang.String scopesString = getScope ( scopes ) ; com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.LOG.debug ( ( ( ( "Initiating GitHub Login for ClientId=" + ( config.gitHubClientId ) ) + " Scopes=" ) + scopesString ) ) ; response.sendRedirect ( java.lang.String.format ( "%s?client_id=%s%s&redirect_uri=%s&state=%s%s" , config.gitHubOAuthUrl , config.gitHubClientId , scopesString , com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getURLEncoded ( config.oAuthFinalRedirectUrl ) , me ( ) , com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getURLEncoded ( request.getRequestURI ( ) . toString ( ) ) ) ) ; }

Target:
public java.lang.String loginPhase1 ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response , java.util.Set < com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope > scopes ) throws java.io.IOException { java.lang.String scopesString = getScope ( scopes ) ; com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.log.debug ( ( ( ( "Initiating GitHub Login for ClientId=" + ( config.gitHubClientId ) ) + " Scopes=" ) + scopesString ) ) ; java.lang.String state = newRandomState ( request.getRequestURI ( ) . toString ( ) ) ; response.sendRedirect ( java.lang.String.format ( "%s?client_id=%s%s&redirect_uri=%s&state=%s" , config.gitHubOAuthUrl , config.gitHubClientId , scopesString , com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getURLEncoded ( config.oAuthFinalRedirectUrl ) , com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getURLEncoded ( state ) ) ) ; return state ; }
Source:
public void content ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; org.junit.Assert.assertEquals ( com.google.gerrit.acceptance.PushOneCommit.FILE_CONTENT , gApi.changes ( ) . id ( r.getChangeId ( ) ) . revision ( r.getCommit ( ) . name ( ) ) . file ( com.google.gerrit.acceptance.PushOneCommit.FILE_NAME ) . content ( ) ) ; }

Target:
public void content ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.restapi.BinaryResult bin = gApi.changes ( ) . id ( r.getChangeId ( ) ) . revision ( r.getCommit ( ) . name ( ) ) . file ( com.google.gerrit.acceptance.PushOneCommit.FILE_NAME ) . content ( ) ; java.io.ByteArrayOutputStream os = new java.io.ByteArrayOutputStream ( ) ; bin.writeTo ( os ) ; java.lang.String res = new java.lang.String ( os.toByteArray ( ) , java.nio.charset.StandardCharsets.UTF_8 ) ; com.google.common.truth.Truth.assertThat ( res ) . isEqualTo ( com.google.gerrit.acceptance.PushOneCommit.FILE_CONTENT ) ; }
Source:
public void onKeyPress ( final com.google.gwt.user.client.ui.Widget sender , final char kc , final int mod ) { if ( ( ( mod & ( MODIFIER_CTRL ) ) == ( MODIFIER_CTRL ) ) || ( ( mod & ( MODIFIER_META ) ) == ( MODIFIER_META ) ) ) { switch ( kc ) { case 'c' : case 'x' : com.google.gwt.user.client.DeferredCommand.addCommand ( new com.google.gwt.user.client.Command ( ) { public void execute ( ) { hideTextBox ( ) ; } } ) ; break ; } } }

Target:
public void onBlur ( final com.google.gwt.event.dom.client.BlurEvent event ) { hideTextBox ( ) ; }
Source:
public void index ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) throws java.io.IOException { for ( com.google.gerrit.index.Index < ? , com.google.gerrit.reviewdb.client.AccountGroup > i : getWriteIndexes ( ) ) { i.replace ( groupCache.get ( uuid ) ) ; } fireGroupIndexedEvent ( uuid.get ( ) ) ; }

Target:
public void index ( com.google.gerrit.reviewdb.client.AccountGroup.UUID uuid ) throws java.io.IOException { for ( com.google.gerrit.index.Index < com.google.gerrit.reviewdb.client.AccountGroup.UUID , com.google.gerrit.server.group.InternalGroup > i : getWriteIndexes ( ) ) { java.util.Optional < com.google.gerrit.server.group.InternalGroup > internalGroup = groupCache.getInternalGroup ( uuid ) ; if ( internalGroup.isPresent ( ) ) { i.replace ( internalGroup.get ( ) ) ; } else { i.delete ( uuid ) ; } } fireGroupIndexedEvent ( uuid.get ( ) ) ; }
Source:
private com.googlecode.prolog_cafe.lang.Term removePackage ( com.googlecode.prolog_cafe.lang.Term test ) { com.googlecode.prolog_cafe.lang.Term name = test ; if ( ( name.isStructure ( ) ) && ( ":" . equals ( ( ( com.googlecode.prolog_cafe.lang.StructureTerm ) ( name ) ) . name ( ) ) ) ) { name = ( ( com.googlecode.prolog_cafe.lang.StructureTerm ) ( name ) ) . args ( ) [ 1 ] ; } return name ; }

Target:
private com.googlecode.prolog_cafe.lang.Term removePackage ( com.googlecode.prolog_cafe.lang.Term test ) { com.googlecode.prolog_cafe.lang.Term name = test ; if ( ( name instanceof com.googlecode.prolog_cafe.lang.StructureTerm ) && ( ":" . equals ( name.name ( ) ) ) ) { name = name.arg ( 1 ) ; } return name ; }
Source:
public java.util.List < com.google.gerrit.reviewdb.client.PatchLineComment > draftByChangeAuthor ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.reviewdb.client.Account.Id author ) throws com.google.gwtorm.server.OrmException { if ( ! ( migration.readChanges ( ) ) ) { return com.google.gerrit.server.PatchLineCommentsUtil.sort ( db.patchComments ( ) . byChange ( notes.getChangeId ( ) ) . toList ( ) ) ; } java.util.List < com.google.gerrit.reviewdb.client.PatchLineComment > comments = com.google.common.collect.Lists.newArrayList ( ) ; comments.addAll ( notes.getDraftComments ( author ) . values ( ) ) ; return com.google.gerrit.server.PatchLineCommentsUtil.sort ( comments ) ; }

Target:
public boolean apply ( com.google.gerrit.reviewdb.client.PatchLineComment in ) { com.google.gerrit.reviewdb.client.Change.Id changeId = in.getKey ( ) . getParentKey ( ) . getParentKey ( ) . getParentKey ( ) ; return changeId.equals ( matchId ) ; }
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.ObjectIdSerializer.write ( out , oldId ) ; out.writeInt ( ( ( parentNum ) == null ? 0 : parentNum ) ) ; org.eclipse.jgit.lib.ObjectIdSerializer.writeWithoutMarker ( 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 ) ) ; }
Source:
private java.util.List < com.google.gerrit.server.plugins.ServerPluginProvider > providersForHandlingPlugin ( final java.io.File srcFile ) { java.util.List < com.google.gerrit.server.plugins.ServerPluginProvider > providers = new java.util.ArrayList < > ( ) ; for ( com.google.gerrit.server.plugins.ServerPluginProvider serverPluginProvider : serverPluginProviders ) { boolean handles = serverPluginProvider.handles ( srcFile ) ; com.google.gerrit.server.plugins.UniversalServerPluginProvider.log.debug ( "File handled by ? => {}" , srcFile , serverPluginProvider.getProviderPluginName ( ) , handles ) ; if ( handles ) { providers.add ( serverPluginProvider ) ; } } return providers ; }

Target:
private java.util.List < com.google.gerrit.server.plugins.ServerPluginProvider > providersForHandlingPlugin ( final java.nio.file.Path srcPath ) { java.util.List < com.google.gerrit.server.plugins.ServerPluginProvider > providers = new java.util.ArrayList < > ( ) ; for ( com.google.gerrit.server.plugins.ServerPluginProvider serverPluginProvider : serverPluginProviders ) { boolean handles = serverPluginProvider.handles ( srcPath ) ; com.google.gerrit.server.plugins.UniversalServerPluginProvider.log.debug ( "File handled by ? => {}" , srcPath , serverPluginProvider.getProviderPluginName ( ) , handles ) ; if ( handles ) { providers.add ( serverPluginProvider ) ; } } return providers ; }
Source:
private void write ( final java.io.OutputStream out , final org.eclipse.jgit.diff.Edit e ) throws java.io.IOException { com.google.gerrit.server.ioutil.BasicSerialization.writeVarInt32 ( out , e.getBeginA ( ) ) ; com.google.gerrit.server.ioutil.BasicSerialization.writeVarInt32 ( out , e.getEndA ( ) ) ; com.google.gerrit.server.ioutil.BasicSerialization.writeVarInt32 ( out , e.getBeginB ( ) ) ; com.google.gerrit.server.ioutil.BasicSerialization.writeVarInt32 ( out , e.getEndB ( ) ) ; }

Target:
private void write ( final java.io.OutputStream out , final com.google.gerrit.prettify.common.BaseEdit e ) throws java.io.IOException { com.google.gerrit.server.ioutil.BasicSerialization.writeVarInt32 ( out , e.getBeginA ( ) ) ; com.google.gerrit.server.ioutil.BasicSerialization.writeVarInt32 ( out , e.getEndA ( ) ) ; com.google.gerrit.server.ioutil.BasicSerialization.writeVarInt32 ( out , e.getBeginB ( ) ) ; com.google.gerrit.server.ioutil.BasicSerialization.writeVarInt32 ( out , e.getEndB ( ) ) ; }
Source:
public void onFailure ( java.lang.Throwable err ) { progress.setVisible ( false ) ; scroll.setVisible ( false ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( error , true ) ; error.setInnerText ( err.getMessage ( ) ) ; }

Target:
public void onFailure ( java.lang.Throwable err ) { tabPanel.getTabBar ( ) . setTabText ( 0 , Resources.M.relatedChanges ( Resources.C.notAvailable ( ) ) ) ; progress.setVisible ( false ) ; scroll.setVisible ( false ) ; com.google.gwt.user.client.ui.UIObject.setVisible ( error , true ) ; error.setInnerText ( err.getMessage ( ) ) ; }
Source:
public com.google.gerrit.server.events.PatchSetCommentAttribute asPatchSetLineAttribute ( com.google.gerrit.reviewdb.client.PatchLineComment c ) { com.google.gerrit.server.events.PatchSetCommentAttribute a = new com.google.gerrit.server.events.PatchSetCommentAttribute ( ) ; a.reviewer = asAccountAttribute ( c.getAuthor ( ) ) ; a.file = c.getKey ( ) . getParentKey ( ) . get ( ) ; a.line = c.getLine ( ) ; a.message = c.getMessage ( ) ; return a ; }

Target:
public com.google.gerrit.server.data.PatchSetCommentAttribute asPatchSetLineAttribute ( com.google.gerrit.reviewdb.client.PatchLineComment c ) { com.google.gerrit.server.data.PatchSetCommentAttribute a = new com.google.gerrit.server.data.PatchSetCommentAttribute ( ) ; a.reviewer = asAccountAttribute ( c.getAuthor ( ) ) ; a.file = c.getKey ( ) . getParentKey ( ) . get ( ) ; a.line = c.getLine ( ) ; a.message = c.getMessage ( ) ; return a ; }
Source:
public void changeToIndexDoNotExist ( ) throws java.lang.Exception { setupPostMocks ( com.ericsson.gerrit.plugins.syncindex.SyncIndexRestApiServletTest.CHANGE_DOES_NOT_EXIST ) ; syncIndexRestApiServlet.doPost ( req , rsp ) ; org.mockito.Mockito.verify ( indexer , org.mockito.Mockito.times ( 1 ) ) . delete ( id ) ; org.mockito.Mockito.verify ( rsp ) . setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; }

Target:
public void changeToIndexDoNotExist ( ) throws java.lang.Exception { setupPostMocks ( com.ericsson.gerrit.plugins.multimaster.SyncIndexRestApiServletTest.CHANGE_DOES_NOT_EXIST ) ; syncIndexRestApiServlet.doPost ( req , rsp ) ; org.mockito.Mockito.verify ( indexer , org.mockito.Mockito.times ( 1 ) ) . delete ( id ) ; org.mockito.Mockito.verify ( rsp ) . setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; }
Source:
public static com.google.gerrit.git.WorkQueue.Executor createQueue ( final int poolsize , final java.lang.String prefix ) { final com.google.gerrit.git.WorkQueue.Executor r = new com.google.gerrit.git.WorkQueue.Executor ( poolsize , prefix ) ; r.setContinueExistingPeriodicTasksAfterShutdownPolicy ( false ) ; r.setExecuteExistingDelayedTasksAfterShutdownPolicy ( false ) ; com.google.gerrit.git.WorkQueue.queues.add ( r ) ; return r ; }

Target:
public com.google.gerrit.git.WorkQueue.Executor createQueue ( final int poolsize , final java.lang.String prefix ) { final com.google.gerrit.git.WorkQueue.Executor r = new com.google.gerrit.git.WorkQueue.Executor ( poolsize , prefix ) ; r.setContinueExistingPeriodicTasksAfterShutdownPolicy ( false ) ; r.setExecuteExistingDelayedTasksAfterShutdownPolicy ( false ) ; queues.add ( r ) ; return r ; }
Source:
private com.google.gerrit.server.change.PostReviewers.Addition putAccount ( java.lang.String reviewer , com.google.gerrit.server.change.ReviewerResource rsrc , com.google.gerrit.extensions.client.ReviewerState state ) throws com.google.gerrit.extensions.restapi.UnprocessableEntityException { com.google.gerrit.reviewdb.client.Account member = rsrc.getReviewerUser ( ) . getAccount ( ) ; com.google.gerrit.server.project.ChangeControl control = rsrc.getReviewerControl ( ) ; if ( isValidReviewer ( member , control ) ) { return new com.google.gerrit.server.change.PostReviewers.Addition ( reviewer , rsrc.getChangeResource ( ) , com.google.common.collect.ImmutableMap.of ( member.getId ( ) , control ) , state ) ; } throw new com.google.gerrit.extensions.restapi.UnprocessableEntityException ( ( "Change not visible to " + reviewer ) ) ; }

Target:
private com.google.gerrit.server.change.PostReviewers.Addition putAccount ( java.lang.String reviewer , com.google.gerrit.server.change.ReviewerResource rsrc , com.google.gerrit.extensions.client.ReviewerState state , com.google.gerrit.extensions.api.changes.NotifyHandling notify ) throws com.google.gerrit.extensions.restapi.UnprocessableEntityException { com.google.gerrit.reviewdb.client.Account member = rsrc.getReviewerUser ( ) . getAccount ( ) ; com.google.gerrit.server.project.ChangeControl control = rsrc.getReviewerControl ( ) ; if ( isValidReviewer ( member , control ) ) { return new com.google.gerrit.server.change.PostReviewers.Addition ( reviewer , rsrc.getChangeResource ( ) , com.google.common.collect.ImmutableMap.of ( member.getId ( ) , control ) , state , notify ) ; } throw new com.google.gerrit.extensions.restapi.UnprocessableEntityException ( ( "Change not visible to " + reviewer ) ) ; }
Source:
protected com.google.gerrit.extensions.common.ChangeInfo queryOne ( java.lang.Object query ) throws java.lang.Exception { java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = query ( query ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( java.lang.String.format ( "expected singleton List<ChangeInfo>, found %s for [%s]" , results , query ) ) . that ( results ) . hasSize ( 1 ) ; return results.get ( 0 ) ; }

Target:
protected void assertQuery ( java.lang.Object query , com.google.gerrit.reviewdb.client.Change ... changes ) throws java.lang.Exception { assertQuery ( newQuery ( query ) , changes ) ; }
Source:
public java.lang.Boolean call ( ) { try ( com.google.gerrit.reviewdb.server.ReviewDb db = com.google.gerrit.reviewdb.server.ReviewDbUtil.unwrapDb ( schemaFactory.open ( ) ) ) { return 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 void configure ( ) { install ( dbInjector.getInstance ( com.google.gerrit.pgm.util.BatchProgramModule.class ) ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.GitReferenceUpdatedListener.class ) . to ( com.google.gerrit.server.index.change.ReindexAfterUpdate.class ) ; install ( new com.google.gerrit.server.index.DummyIndexModule ( ) ) ; factory ( ChangeResource.Factory.class ) ; }
Source:
private void limitThreads ( ) { org.eclipse.jgit.lib.Config cfg = dbInjector.getInstance ( com.google.inject.Key.get ( org.eclipse.jgit.lib.Config.class , com.google.gerrit.server.config.GerritServerConfig.class ) ) ; boolean usePool = cfg.getBoolean ( "database" , "connectionpool" , dbInjector.getInstance ( com.google.gerrit.server.schema.DataSourceType.class ) . usePool ( ) ) ; int poolLimit = cfg.getInt ( "database" , "poollimit" , DataSourceProvider.DEFAULT_POOL_LIMIT ) ; if ( usePool && ( ( threads ) > poolLimit ) ) { com.google.gerrit.pgm.Reindex.log.warn ( ( ( "Limiting reindexing to " + poolLimit ) + " threads due to database.poolLimit" ) ) ; threads = poolLimit ; } }

Target:
private void checkNotSlaveMode ( ) throws com.google.gerrit.common.Die { if ( globalConfig.getBoolean ( "container" , "slave" , false ) ) { throw die ( "Cannot run reindex in slave mode" ) ; } }
Source:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > patchSetDrafts ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByPatchSetAuthor ( db.get ( ) , rsrc.getPatchSet ( ) . getId ( ) , rsrc.getAccountId ( ) , rsrc.getNotes ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }

Target:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > changeDrafts ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByChangeAuthor ( ctx.getDb ( ) , ctx.getNotes ( ) , user.getAccountId ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }
Source:
private void fireEvent ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.common.Event event , 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 ) ; }

Target:
private void fireEvent ( com.google.gerrit.reviewdb.client.Branch.NameKey branchName , com.google.gerrit.server.events.RefEvent event ) { for ( com.google.gerrit.common.ChangeHookRunner.EventListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( branchName , holder.user ) ) { holder.listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }
Source:
public com.google.gerrit.server.patch.PatchList get ( com.google.gerrit.server.patch.PatchListKey key ) throws com.google.gerrit.server.patch.PatchListNotAvailableException { try { return fileCache.get ( key ) ; } catch ( java.util.concurrent.ExecutionException e ) { PatchListLoader.log.warn ( ( "Error computing " + key ) , e ) ; throw new com.google.gerrit.server.patch.PatchListNotAvailableException ( e.getCause ( ) ) ; } }

Target:
public com.google.gerrit.server.patch.PatchList get ( com.google.gerrit.server.patch.PatchListKey key , com.google.gerrit.reviewdb.client.Project.NameKey project ) throws com.google.gerrit.server.patch.PatchListNotAvailableException { try { return fileCache.get ( key , fileLoaderFactory.create ( key , project ) ) ; } catch ( java.util.concurrent.ExecutionException | org.eclipse.jgit.errors.LargeObjectException e ) { PatchListLoader.log.warn ( ( "Error computing " + key ) , e ) ; throw new com.google.gerrit.server.patch.PatchListNotAvailableException ( e.getCause ( ) ) ; } }
Source:
private java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > getDraftRefs ( org.eclipse.jgit.lib.Repository repo , final com.google.gerrit.reviewdb.client.Change.Id changeId ) throws java.io.IOException { final java.lang.String suffix = "/" + ( changeId.get ( ) ) ; return com.google.common.collect.Maps.filterKeys ( repo.getRefDatabase ( ) . getRefs ( RefNames.REFS_DRAFT_COMMENTS ) , new com.google.common.base.Predicate < java.lang.String > ( ) { @ java.lang.Override public boolean apply ( java.lang.String input ) { return input.endsWith ( suffix ) ; } } ) ; }

Target:
private java.util.Collection < org.eclipse.jgit.lib.Ref > getDraftRefs ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws java.io.IOException { return repo.getRefDatabase ( ) . getRefs ( com.google.gerrit.reviewdb.client.RefNames.refsDraftCommentsPrefix ( changeId ) ) . values ( ) ; }
Source:
void initMeter ( ) { if ( ( meter ) == null ) { resetHtml ( "<tr><td></td></tr>" ) ; meter = new com.google.gwtexpui.progress.client.ProgressBar ( Util.M.loadingPatchSet ( psid.get ( ) ) ) ; table.setWidget ( 0 , 0 , meter ) ; } updateMeter ( ) ; }

Target:
void initMeter ( ) { if ( ( meter ) == null ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; b.openTr ( ) ; b.openTd ( ) ; b.closeTd ( ) ; b.closeTr ( ) ; resetHtml ( b ) ; meter = new com.google.gwtexpui.progress.client.ProgressBar ( Util.M.loadingPatchSet ( psid.get ( ) ) ) ; table.setWidget ( 0 , 0 , meter ) ; } updateMeter ( ) ; }
Source:
protected org.eclipse.jgit.revwalk.RevCommit getHead ( org.eclipse.jgit.lib.Repository repo , java.lang.String name ) throws java.lang.Exception { try ( org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { return rw.parseCommit ( repo.exactRef ( name ) . getObjectId ( ) ) ; } }

Target:
protected org.eclipse.jgit.revwalk.RevCommit getHead ( org.eclipse.jgit.lib.Repository repo , java.lang.String name ) throws java.lang.Exception { try ( org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { org.eclipse.jgit.lib.Ref r = repo.exactRef ( name ) ; return r != null ? rw.parseCommit ( r.getObjectId ( ) ) : null ; } }
Source:
protected void configureServlets ( ) { serveRegex ( "/index/account/\\d+$" ) . with ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexAccountRestApiServlet.class ) ; serveRegex ( "/index/change/\\d+$" ) . with ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexChangeRestApiServlet.class ) ; serve ( "/event" ) . with ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.EventRestApiServlet.class ) ; serve ( "/cache/*" ) . with ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.CacheRestApiServlet.class ) ; }

Target:
protected void configureServlets ( ) { serveRegex ( "/index/account/\\d+$" ) . with ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexAccountRestApiServlet.class ) ; serveRegex ( "/index/change/\\d+$" ) . with ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexChangeRestApiServlet.class ) ; serveRegex ( "/index/group/\\w+$" ) . with ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.IndexGroupRestApiServlet.class ) ; serve ( "/event" ) . with ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.EventRestApiServlet.class ) ; serve ( "/cache/*" ) . with ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.CacheRestApiServlet.class ) ; }
Source:
public void testUrlTrailingSlashIsDropped ( ) throws java.lang.Exception { org.mockito.Mockito.when ( configMock.getString ( "url" ) ) . thenReturn ( ( ( com.ericsson.gerrit.plugins.syncindex.ConfigurationTest.URL ) + "/" ) ) ; configuration = new com.ericsson.gerrit.plugins.syncindex.Configuration ( cfgFactoryMock , pluginName ) ; com.google.common.truth.Truth.assertThat ( configuration ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( configuration.getUrl ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.syncindex.ConfigurationTest.URL ) ; }

Target:
public void testUrlTrailingSlashIsDropped ( ) throws java.lang.Exception { org.mockito.Mockito.when ( configMock.getString ( "url" ) ) . thenReturn ( ( ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.URL ) + "/" ) ) ; configuration = new com.ericsson.gerrit.plugins.highavailability.Configuration ( cfgFactoryMock , pluginName ) ; com.google.common.truth.Truth.assertThat ( configuration ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( configuration.getUrl ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.highavailability.ConfigurationTest.URL ) ; }