auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void configureServlets ( ) { com.googlesource.gerrit.plugins.gitblit.GitBlitModule.log.info ( "Configuring servlet and filters" ) ; bind ( com.gitblit.IUserService.class ) . to ( com.googlesource.gerrit.plugins.gitblit.auth.GerritToGitBlitUserService.class ) ; bind ( com.googlesource.gerrit.plugins.gitblit.app.GerritGitBlit.class ) ; serve ( "/pages/*" ) . with ( com.googlesource.gerrit.plugins.gitblit.WrappedPagesServlet.class ) ; serve ( "/feed/*" ) . with ( com.googlesource.gerrit.plugins.gitblit.WrappedSyndicationServlet.class ) ; filter ( "/*" ) . through ( com.googlesource.gerrit.plugins.gitblit.GerritWicketFilter.class ) ; filter ( "/pages/*" ) . through ( com.googlesource.gerrit.plugins.gitblit.WrappedPagesFilter.class ) ; filter ( "/feed/*" ) . through ( com.googlesource.gerrit.plugins.gitblit.WrappedSyndicationFilter.class ) ; }

Target:
protected void configureServlets ( ) { com.googlesource.gerrit.plugins.gitblit.GitBlitModule.log.info ( "Configuring servlet and filters" ) ; bind ( com.gitblit.IUserService.class ) . to ( com.googlesource.gerrit.plugins.gitblit.auth.GerritToGitBlitUserService.class ) ; bind ( com.googlesource.gerrit.plugins.gitblit.app.GerritGitBlit.class ) ; serve ( "/pages/*" ) . with ( com.googlesource.gerrit.plugins.gitblit.WrappedPagesServlet.class ) ; serve ( "/feed/*" ) . with ( com.googlesource.gerrit.plugins.gitblit.WrappedSyndicationServlet.class ) ; serve ( "/zip/*" ) . with ( com.googlesource.gerrit.plugins.gitblit.WrappedDownloadZipServlet.class ) ; filter ( "/*" ) . through ( com.googlesource.gerrit.plugins.gitblit.GerritWicketFilter.class ) ; filter ( "/pages/*" ) . through ( com.googlesource.gerrit.plugins.gitblit.WrappedPagesFilter.class ) ; filter ( "/feed/*" ) . through ( com.googlesource.gerrit.plugins.gitblit.WrappedSyndicationFilter.class ) ; }
Source:
public java.util.List < com.google.reviewit.app.Change > next ( ) throws com.google.gerrit.extensions.restapi.RestApiException { query ( ) ; java.util.List < com.google.reviewit.app.Change > nextChanges = result.subList ( ( ( page ) * ( com.google.reviewit.app.QueryHandler.LIMIT_QUERY ) ) , ( ( ( page ) + 1 ) * ( com.google.reviewit.app.QueryHandler.LIMIT_QUERY ) ) ) ; ( page ) ++ ; return nextChanges ; }

Target:
public java.util.List < com.google.reviewit.app.Change > next ( ) throws com.google.gerrit.extensions.restapi.RestApiException { query ( ) ; java.util.List < com.google.reviewit.app.Change > nextChanges = result.subList ( ( ( page ) * ( com.google.reviewit.app.QueryHandler.LIMIT_QUERY ) ) , java.lang.Math.min ( ( ( ( page ) + 1 ) * ( com.google.reviewit.app.QueryHandler.LIMIT_QUERY ) ) , result.size ( ) ) ) ; ( page ) ++ ; return nextChanges ; }
Source:
private com.googlesource.gerrit.plugins.quota.Publisher.RepoSizeEvent createEvent ( ) throws java.util.concurrent.ExecutionException { com.googlesource.gerrit.plugins.quota.Publisher.RepoSizeEvent event = new com.googlesource.gerrit.plugins.quota.Publisher.RepoSizeEvent ( ) ; for ( com.google.gerrit.reviewdb.client.Project.NameKey p : projectCache.all ( ) ) { long size = repoSizeCache.get ( p ) . get ( ) ; event.addData ( size , p.get ( ) ) ; } return event ; }

Target:
private com.googlesource.gerrit.plugins.quota.Publisher.UsageDataEvent createRepoSizeEvent ( ) throws java.util.concurrent.ExecutionException { com.googlesource.gerrit.plugins.quota.Publisher.UsageDataEvent event = new com.googlesource.gerrit.plugins.quota.Publisher.UsageDataEvent ( com.googlesource.gerrit.plugins.quota.Publisher.REPO_SIZE ) ; for ( com.google.gerrit.reviewdb.client.Project.NameKey p : projectCache.all ( ) ) { long size = repoSizeCache.get ( p ) . get ( ) ; event.addData ( size , p.get ( ) ) ; } return event ; }
Source:
public static com.google.gerrit.common.data.PermissionRule block ( com.google.gerrit.server.git.ProjectConfig project , java.lang.String capabilityName , com.google.gerrit.reviewdb.client.AccountGroup.UUID group ) { com.google.gerrit.common.data.PermissionRule rule = com.google.gerrit.server.project.testing.Util.newRule ( project , group ) ; project.getAccessSection ( AccessSection.GLOBAL_CAPABILITIES , true ) . getPermission ( capabilityName , true ) . add ( rule ) ; return rule ; }

Target:
public static com.google.gerrit.common.data.PermissionRule block ( com.google.gerrit.server.project.ProjectConfig project , java.lang.String capabilityName , com.google.gerrit.reviewdb.client.AccountGroup.UUID group ) { com.google.gerrit.common.data.PermissionRule rule = com.google.gerrit.server.project.testing.Util.newRule ( project , group ) ; project.getAccessSection ( AccessSection.GLOBAL_CAPABILITIES , true ) . getPermission ( capabilityName , true ) . add ( rule ) ; return rule ; }
Source:
public void onSuccess ( com.google.gerrit.client.rpc.NativeString result ) { renderSubmitType ( result.asString ( ) ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.rpc.NativeString result ) { if ( canSubmit ) { if ( status == ( com.google.gerrit.reviewdb.client.Change.Status.NEW ) ) { statusText.setInnerText ( ( changeInfo.mergeable ( ) ? Util.C.readyToSubmit ( ) : Util.C.mergeConflict ( ) ) ) ; } } setVisible ( notMergeable , ( ! ( changeInfo.mergeable ( ) ) ) ) ; renderSubmitType ( result.asString ( ) ) ; }
Source:
public void onSuccess ( final java.util.Set < com.google.gerrit.reviewdb.Branch.NameKey > deleted ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { final com.google.gerrit.reviewdb.Branch k = getRowItem ( row ) ; if ( ( k != null ) && ( deleted.contains ( k.getNameKey ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } }

Target:
public void onOk ( ) { deleteBranches ( ids ) ; }
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 onKeyPress ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { if ( ( event.isControlKeyDown ( ) ) || ( event.isMetaKeyDown ( ) ) ) { switch ( event.getCharCode ( ) ) { case 'c' : case 'x' : com.google.gwt.user.client.DeferredCommand.addCommand ( new com.google.gwt.user.client.Command ( ) { public void execute ( ) { hideTextBox ( ) ; } } ) ; break ; } } }
Source:
private void fireEvent ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.events.ChangeEvent 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.UserScopedEventListener listener : listeners ) { if ( isVisibleTo ( branchName , listener.getUser ( ) ) ) { listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }
Source:
public void setDownloadUrl ( com.google.gerrit.reviewdb.client.AccountGeneralPreferences.DownloadScheme url ) { if ( url != null ) { downloadUrl = url.name ( ) ; } else { downloadUrl = null ; } }

Target:
public void setDownloadUrl ( java.lang.String url ) { if ( ( downloadUrl ) != null ) { switch ( url ) { case CoreDownloadSchemes.ANON_GIT : url = "ANON_GIT" ; break ; case CoreDownloadSchemes.ANON_HTTP : url = "ANON_HTTP" ; break ; case CoreDownloadSchemes.HTTP : url = "HTTP" ; break ; case CoreDownloadSchemes.SSH : url = "SSH" ; break ; case CoreDownloadSchemes.REPO_DOWNLOAD : url = "REPO_DOWNLOAD" ; break ; } } downloadUrl = url ; }
Source:
private void displayDefaultContext ( final short lines ) { for ( int i = 0 ; i < ( AccountGeneralPreferences.CONTEXT_CHOICES.length ) ; i ++ ) { if ( ( com.google.gerrit.client.reviewdb.AccountGeneralPreferences.CONTEXT_CHOICES [ i ] ) == lines ) { defaultContext.setSelectedIndex ( i ) ; return ; } } displayDefaultContext ( AccountGeneralPreferences.DEFAULT_CONTEXT ) ; }

Target:
private void setListBox ( final com.google.gwt.user.client.ui.ListBox f , final short defaultValue , final short currentValue ) { final int n = f.getItemCount ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( ( java.lang.Short.parseShort ( f.getValue ( i ) ) ) == currentValue ) { f.setSelectedIndex ( i ) ; return ; } } if ( currentValue != defaultValue ) { setListBox ( f , defaultValue , defaultValue ) ; } }
Source:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.server.account.GetSshKeys.SshKeyInfo > apply ( com.google.gerrit.server.account.AccountResource rsrc , com.google.gerrit.server.account.AddSshKey.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gwtorm.server.OrmException , java.io.IOException { if ( ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) && ( ! ( self.get ( ) . getCapabilities ( ) . canModifyAccount ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "not allowed to add SSH keys" ) ; } return apply ( rsrc.getUser ( ) , input ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.server.account.GetSshKeys.SshKeyInfo > apply ( com.google.gerrit.server.account.AccountResource rsrc , com.google.gerrit.server.account.AddSshKey.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gwtorm.server.OrmException , java.io.IOException { if ( ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) && ( ! ( self.get ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "not allowed to add SSH keys" ) ; } return apply ( rsrc.getUser ( ) , input ) ; }
Source:
private void disableLuceneAutomaticCommit ( ) { 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 ) ) ; if ( ( com.google.gerrit.server.index.IndexModule.getIndexType ( dbInjector ) ) == ( IndexType.LUCENE ) ) { cfg.setLong ( "index" , "changes_open" , "commitWithin" , ( - 1 ) ) ; cfg.setLong ( "index" , "changes_closed" , "commitWithin" , ( - 1 ) ) ; } }

Target:
private void disableLuceneAutomaticCommit ( ) { 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 ) ) ; if ( ( com.google.gerrit.server.index.IndexModule.getIndexType ( dbInjector ) ) == ( com.google.gerrit.server.index.IndexModule.IndexType.LUCENE ) ) { cfg.setLong ( "index" , "changes_open" , "commitWithin" , ( - 1 ) ) ; cfg.setLong ( "index" , "changes_closed" , "commitWithin" , ( - 1 ) ) ; } }
Source:
public java.lang.Iterable < com.google.gerrit.server.query.change.ChangeData > byCommitsOnBranchNotMerged ( com.google.gerrit.reviewdb.client.Branch.NameKey branch , java.util.List < java.lang.String > hashes ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema = com.google.gerrit.server.query.change.InternalChangeQuery.schema ( indexes ) ; int batchSize ; if ( ( schema != null ) && ( schema.hasField ( ChangeField.EXACT_COMMIT ) ) ) { batchSize = ( indexConfig.maxTerms ( ) ) - 3 ; } else { batchSize = indexConfig.maxPrefixTerms ( ) ; } return byCommitsOnBranchNotMerged ( schema , branch , hashes , batchSize ) ; }

Target:
java.lang.Iterable < com.google.gerrit.server.query.change.ChangeData > byCommitsOnBranchNotMerged ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Branch.NameKey branch , java.util.List < java.lang.String > hashes , int indexLimit ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( ( hashes.size ( ) ) > indexLimit ) { return byCommitsOnBranchNotMergedFromDatabase ( repo , db , branch , hashes ) ; } else { return byCommitsOnBranchNotMergedFromIndex ( branch , hashes ) ; } }
Source:
private void cancel ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { callback ( false , req , rsp ) ; }

Target:
private void cancel ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { if ( isSignIn ( com.google.gerrit.server.openid.OpenIdServiceImpl.signInMode ( req ) ) ) { callFactory.get ( ) . logout ( ) ; } callback ( false , req , rsp ) ; }
Source:
private java.util.Set < java.lang.String > getAllowedUserIds ( com.google.gerrit.server.IdentifiedUser user ) { java.util.Set < java.lang.String > result = new java.util.HashSet < > ( ) ; result.addAll ( user.getEmailAddresses ( ) ) ; for ( com.google.gerrit.reviewdb.client.AccountExternalId extId : user.state ( ) . getExternalIds ( ) ) { if ( extId.isScheme ( com.google.gerrit.reviewdb.client.AccountExternalId.SCHEME_GPGKEY ) ) { continue ; } result.add ( extId.getExternalId ( ) ) ; } return result ; }

Target:
private java.util.Set < java.lang.String > getAllowedUserIds ( com.google.gerrit.server.IdentifiedUser user ) { java.util.Set < java.lang.String > result = new java.util.HashSet < > ( ) ; result.addAll ( user.getEmailAddresses ( ) ) ; for ( com.google.gerrit.server.account.ExternalId extId : user.state ( ) . getExternalIds ( ) ) { if ( extId.isScheme ( com.google.gerrit.server.account.ExternalId.SCHEME_GPGKEY ) ) { continue ; } result.add ( extId.key ( ) . get ( ) ) ; } return result ; }
Source:
public static void createBranch ( com.google.gerrit.reviewdb.client.Project.NameKey projectName , java.lang.String ref , java.lang.String revision , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.projects.BranchInfo > asyncCallback ) { com.google.gerrit.client.projects.ProjectApi.BranchInput input = com.google.gerrit.client.projects.ProjectApi.BranchInput.create ( ) ; input.setRevision ( revision ) ; new com.google.gerrit.client.rpc.RestApi ( "/projects/" ) . id ( projectName.get ( ) ) . view ( "branches" ) . id ( ref ) . ifNoneMatch ( ) . put ( input , asyncCallback ) ; }

Target:
public static void createBranch ( com.google.gerrit.reviewdb.client.Project.NameKey projectName , java.lang.String ref , java.lang.String revision , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.projects.BranchInfo > cb ) { com.google.gerrit.client.projects.ProjectApi.BranchInput input = com.google.gerrit.client.projects.ProjectApi.BranchInput.create ( ) ; input.setRevision ( revision ) ; new com.google.gerrit.client.rpc.RestApi ( "/projects/" ) . id ( projectName.get ( ) ) . view ( "branches" ) . id ( ref ) . ifNoneMatch ( ) . put ( input , cb ) ; }
Source:
com.googlesource.gerrit.plugins.reviewers.ReviewersConfig create ( com.google.gerrit.reviewdb.client.Project.NameKey projectName ) ;

Target:
public com.googlesource.gerrit.plugins.reviewers.ReviewersConfig.ForProject forProject ( com.google.gerrit.reviewdb.client.Project.NameKey projectName ) { org.eclipse.jgit.lib.Config cfg ; try { cfg = cfgFactory.getProjectPluginConfigWithInheritance ( projectName , pluginName ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { com.googlesource.gerrit.plugins.reviewers.ReviewersConfig.log.error ( "Unable to get config for project {}" , projectName.get ( ) ) ; cfg = new org.eclipse.jgit.lib.Config ( ) ; } return new com.googlesource.gerrit.plugins.reviewers.ReviewersConfig.ForProject ( cfg ) ; }
Source:
private void finishActiveTag ( ) { if ( ( tag ) != null ) { if ( com.google.gitiles.doc.html.HtmlBuilder.SELF_CLOSING_TAGS.contains ( tag ) ) { htmlBuf.append ( " />" ) ; } else { htmlBuf.append ( '>' ) ; } tag = null ; } }

Target:
private void finishActiveTag ( ) { if ( ( tag ) != null ) { try { if ( com.google.gitiles.doc.html.HtmlBuilder.SELF_CLOSING_TAGS.contains ( tag ) ) { htmlBuf.append ( " />" ) ; } else { htmlBuf.append ( '>' ) ; } } catch ( java.io.IOException e ) { throw new com.google.gitiles.doc.RuntimeIOException ( e ) ; } tag = null ; } }
Source:
private void renderLinks ( com.google.gerrit.client.editor.EditFileInfo editInfo , com.google.gwt.core.client.JsArray < com.google.gerrit.client.DiffWebLinkInfo > diffLinks ) { renderLinksToDiff ( ) ; if ( editInfo != null ) { renderLinks ( com.google.gerrit.client.rpc.Natives.asList ( editInfo.web_links ( ) ) ) ; } else if ( diffLinks != null ) { renderLinks ( com.google.gerrit.client.rpc.Natives.asList ( diffLinks ) ) ; } }

Target:
private void renderLinks ( com.google.gerrit.client.editor.EditFileInfo editInfo , com.google.gwt.core.client.JsArray < com.google.gerrit.client.DiffWebLinkInfo > diffLinks ) { renderLinksToDiff ( ) ; if ( editInfo != null ) { renderLinks ( com.google.gerrit.client.rpc.Natives.asList ( editInfo.webLinks ( ) ) ) ; } else if ( diffLinks != null ) { renderLinks ( com.google.gerrit.client.rpc.Natives.asList ( diffLinks ) ) ; } }
Source:
public boolean isFile ( ) { boolean isCommitMessage = Patch.COMMIT_MSG.equals ( script.getNewName ( ) ) ; return ! ( ( isCommitMessage || ( ( ( side ) == ( com.google.gerrit.client.patches.PatchSetSelectBox.Side.A ) ) && ( 0 >= ( script.getA ( ) . size ( ) ) ) ) ) || ( ( ( side ) == ( com.google.gerrit.client.patches.PatchSetSelectBox.Side.B ) ) && ( 0 >= ( script.getB ( ) . size ( ) ) ) ) ) ; }

Target:
public boolean isFileOrCommitMessage ( ) { return ! ( ( ( ( side ) == ( com.google.gerrit.client.patches.PatchSetSelectBox.Side.A ) ) && ( 0 >= ( script.getA ( ) . size ( ) ) ) ) || ( ( ( side ) == ( com.google.gerrit.client.patches.PatchSetSelectBox.Side.B ) ) && ( 0 >= ( script.getB ( ) . size ( ) ) ) ) ) ; }
Source:
public com.google.gerrit.server.project.ProjectResource parse ( com.google.gerrit.extensions.restapi.TopLevelResource parent , java.lang.String id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException { com.google.gerrit.server.project.ProjectControl ctl ; try { ctl = controlFactory.controlFor ( new com.google.gerrit.reviewdb.client.Project.NameKey ( com.google.gerrit.extensions.restapi.Url.decode ( id ) ) , user.get ( ) ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } if ( ( ! ( ctl.isVisible ( ) ) ) && ( ! ( ctl.isOwner ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } return new com.google.gerrit.server.project.ProjectResource ( ctl ) ; }

Target:
public com.google.gerrit.server.project.ProjectResource parse ( com.google.gerrit.extensions.restapi.TopLevelResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException { com.google.gerrit.server.project.ProjectControl ctl ; try { ctl = controlFactory.controlFor ( new com.google.gerrit.reviewdb.client.Project.NameKey ( id.get ( ) ) , user.get ( ) ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } if ( ( ! ( ctl.isVisible ( ) ) ) && ( ! ( ctl.isOwner ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } return new com.google.gerrit.server.project.ProjectResource ( ctl ) ; }
Source:
public boolean equals ( java.lang.Object other ) { if ( other instanceof com.google.gerrit.extensions.registration.DynamicMap.NamePair ) { com.google.gerrit.extensions.registration.DynamicMap.NamePair np = ( ( com.google.gerrit.extensions.registration.DynamicMap.NamePair ) ( other ) ) ; return ( pluginName.equals ( np ) ) && ( exportName.equals ( np ) ) ; } return false ; }

Target:
public boolean equals ( java.lang.Object other ) { if ( other instanceof com.google.gerrit.extensions.registration.DynamicMap.NamePair ) { com.google.gerrit.extensions.registration.DynamicMap.NamePair np = ( ( com.google.gerrit.extensions.registration.DynamicMap.NamePair ) ( other ) ) ; return ( pluginName.equals ( np.pluginName ) ) && ( exportName.equals ( np.exportName ) ) ; } return false ; }
Source:
public void onSuccess ( com.google.gerrit.client.diff.DiffInfo diffInfo ) { if ( ( id == ( reloadVersionId ) ) && ( isAttached ( ) ) ) { diff = diffInfo ; operation ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { skipManager.removeAll ( ) ; chunkManager.reset ( ) ; diffTable.scrollbar.removeDiffAnnotations ( ) ; setShowIntraline ( prefs.intralineDifference ( ) ) ; render ( diff ) ; chunkManager.adjustPadding ( ) ; skipManager.render ( prefs.context ( ) , diff ) ; } } ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.diff.DiffInfo info ) { new net.codemirror.mode.ModeInjector ( ) . add ( getContentType ( info.meta_a ( ) ) ) . add ( getContentType ( info.meta_b ( ) ) ) . inject ( com.google.gerrit.client.rpc.CallbackGroup.< java.lang.Void > emptyCallback ( ) ) ; }
Source:
private Account.Id queryForUsername ( final java.lang.String username ) { try { final com.google.gerrit.reviewdb.ReviewDb db = schema.open ( ) ; try { final com.google.gerrit.reviewdb.AccountExternalId.AccountExternalId extId = db.accountExternalIds ( ) . get ( new com.google.gerrit.reviewdb.AccountExternalId.AccountExternalId.Key ( SCHEME_GERRIT , username ) ) ; return extId != null ? extId.getAccountId ( ) : null ; } finally { db.close ( ) ; } } catch ( com.google.gwtorm.client.OrmException e ) { com.google.gerrit.server.auth.ldap.LdapRealm.log.warn ( "Cannot query for username in database" , e ) ; return null ; } }

Target:
private Account.Id queryForUsername ( final java.lang.String username ) { try { final com.google.gerrit.reviewdb.ReviewDb db = schema.open ( ) ; try { final com.google.gerrit.reviewdb.AccountExternalId extId = db.accountExternalIds ( ) . get ( new com.google.gerrit.reviewdb.AccountExternalId.Key ( com.google.gerrit.reviewdb.AccountExternalId.SCHEME_GERRIT , username ) ) ; return extId != null ? extId.getAccountId ( ) : null ; } finally { db.close ( ) ; } } catch ( com.google.gwtorm.client.OrmException e ) { com.google.gerrit.server.auth.ldap.LdapRealm.log.warn ( "Cannot query for username in database" , e ) ; return null ; } }
Source:
public com.google.gerrit.extensions.api.projects.ChildProjectApi child ( java.lang.String name ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return childApi.create ( children.parse ( checkExists ( ) , com.google.gerrit.extensions.restapi.IdString.fromDecoded ( name ) ) ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot parse child project" , e ) ; } }

Target:
public com.google.gerrit.extensions.api.projects.CommitApi commit ( java.lang.String commit ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return commitApi.create ( commitsCollection.parse ( checkExists ( ) , com.google.gerrit.extensions.restapi.IdString.fromDecoded ( commit ) ) ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot parse commit" , e ) ; } }
Source:
public void missingRepo ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( new com.google.gerrit.reviewdb.client.Project.NameKey ( "otherproject" ) , adminId ) ; db.changes ( ) . insert ( java.util.Collections.singleton ( c ) ) ; insertMissingPatchSet ( c , "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) ; assertProblems ( c , "Destination repository not found: otherproject" ) ; }

Target:
public void patchSetObjectAndRefMissing ( ) throws java.lang.Exception { java.lang.String rev = "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = insertMissingPatchSet ( ctl , rev ) ; ctl = reload ( ctl ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Ref missing: " + ( ps.getId ( ) . toRefName ( ) ) ) ) , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Object missing: patch set 2:" + " deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) ) ) ; }
Source:
protected void onLoad ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ( revision ) != null ) { rw.markStart ( revision ) ; rw.sort ( RevSort.REVERSE ) ; registeredOn = new java.sql.Timestamp ( ( ( rw.next ( ) . getCommitTime ( ) ) * 1000L ) ) ; org.eclipse.jgit.lib.Config cfg = readConfig ( com.google.gerrit.server.account.AccountConfig.ACCOUNT_CONFIG ) ; account = parse ( cfg ) ; account.setMetaId ( revision.name ( ) ) ; } isLoaded = true ; }

Target:
protected void onLoad ( ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ( revision ) != null ) { rw.reset ( ) ; rw.markStart ( revision ) ; rw.sort ( RevSort.REVERSE ) ; registeredOn = new java.sql.Timestamp ( ( ( rw.next ( ) . getCommitTime ( ) ) * 1000L ) ) ; org.eclipse.jgit.lib.Config cfg = readConfig ( com.google.gerrit.server.account.AccountConfig.ACCOUNT_CONFIG ) ; account = parse ( cfg ) ; account.setMetaId ( revision.name ( ) ) ; } isLoaded = true ; }
Source:
public void visit ( org.pegdown.ast.VerbatimNode node ) { html.open ( "pre" ) ; html.open ( "code" ) ; java.lang.String text = node.getText ( ) ; while ( text.startsWith ( "\n" ) ) { html.open ( "br" ) ; text = text.substring ( 1 ) ; } html.appendAndEscape ( text ) ; html.close ( "code" ) ; html.close ( "pre" ) ; }

Target:
public void visit ( org.pegdown.ast.WikiLinkNode node ) { java.lang.String text = node.getText ( ) ; java.lang.String path = ( text.replace ( ' ' , '-' ) ) + ".md" ; html.open ( "a" ) . attribute ( "href" , href ( path ) ) . appendAndEscape ( text ) . close ( "a" ) ; }
Source:
private static java.util.Set < java.security.PublicKey > myHostKeys ( org.apache.sshd.common.KeyPairProvider p ) { final java.util.Set < java.security.PublicKey > keys = new java.util.HashSet < > ( 2 ) ; com.google.gerrit.sshd.DatabasePubKeyAuth.addPublicKey ( keys , p , KeyPairProvider.SSH_RSA ) ; com.google.gerrit.sshd.DatabasePubKeyAuth.addPublicKey ( keys , p , KeyPairProvider.SSH_DSS ) ; return keys ; }

Target:
private static java.util.Set < java.security.PublicKey > myHostKeys ( org.apache.sshd.common.keyprovider.KeyPairProvider p ) { final java.util.Set < java.security.PublicKey > keys = new java.util.HashSet < > ( 2 ) ; com.google.gerrit.sshd.DatabasePubKeyAuth.addPublicKey ( keys , p , KeyPairProvider.SSH_RSA ) ; com.google.gerrit.sshd.DatabasePubKeyAuth.addPublicKey ( keys , p , KeyPairProvider.SSH_DSS ) ; return keys ; }
Source:
private static java.lang.String quotedPhrase ( final java.lang.String name ) { if ( com.google.gerrit.server.mail.EmailHeader.needsQuotedPrintable ( name ) ) { return com.google.gerrit.server.mail.EmailHeader.quotedPrintable ( name ) ; } for ( int i = 0 ; i < ( name.length ( ) ) ; i ++ ) { final char c = name.charAt ( i ) ; if ( ( com.google.gerrit.server.mail.Address.MUST_QUOTE_NAME.indexOf ( c ) ) != ( - 1 ) ) { return com.google.gerrit.server.mail.Address.wrapInQuotes ( name ) ; } } return name ; }

Target:
private static java.lang.String quotedPhrase ( final java.lang.String name ) { if ( com.google.gerrit.server.mail.send.EmailHeader.needsQuotedPrintable ( name ) ) { return com.google.gerrit.server.mail.send.EmailHeader.quotedPrintable ( name ) ; } for ( int i = 0 ; i < ( name.length ( ) ) ; i ++ ) { final char c = name.charAt ( i ) ; if ( ( com.google.gerrit.server.mail.Address.MUST_QUOTE_NAME.indexOf ( c ) ) != ( - 1 ) ) { return com.google.gerrit.server.mail.Address.wrapInQuotes ( name ) ; } } return name ; }
Source:
public void flushWebSessionsCache_Forbidden ( ) throws java.lang.Exception { allowGlobalCapabilities ( com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , GlobalCapability.VIEW_CACHES , GlobalCapability.FLUSH_CACHES ) ; try { com.google.gerrit.acceptance.RestResponse r = userSession.post ( "/config/server/caches/accounts/flush" ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; r.consume ( ) ; r = userSession.post ( "/config/server/caches/web_sessions/flush" ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_FORBIDDEN ) ; } finally { removeGlobalCapabilities ( com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , GlobalCapability.VIEW_CACHES , GlobalCapability.FLUSH_CACHES ) ; } }

Target:
public void flushWebSessionsCache_Forbidden ( ) throws java.lang.Exception { allowGlobalCapabilities ( com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , GlobalCapability.VIEW_CACHES , GlobalCapability.FLUSH_CACHES ) ; try { com.google.gerrit.acceptance.RestResponse r = userSession.post ( "/config/server/caches/accounts/flush" ) ; r.assertOK ( ) ; r.consume ( ) ; userSession.post ( "/config/server/caches/web_sessions/flush" ) . assertForbidden ( ) ; } finally { removeGlobalCapabilities ( com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , GlobalCapability.VIEW_CACHES , GlobalCapability.FLUSH_CACHES ) ; } }
Source:
protected com.google.gerrit.client.reviewdb.ReviewDb openReviewDb ( ) throws com.google.gerrit.server.ssh.AbstractCommand.Failure { if ( ( db ) == null ) { try { db = com.google.gerrit.client.rpc.Common.getSchemaFactory ( ) . open ( ) ; } catch ( com.google.gwtorm.client.OrmException e ) { throw new com.google.gerrit.server.ssh.AbstractCommand.Failure ( 1 , "fatal: Gerrit database is offline" , e ) ; } } return db ; }

Target:
protected com.google.gerrit.client.reviewdb.ReviewDb openReviewDb ( ) throws com.google.gerrit.server.ssh.AbstractCommand.Failure { if ( ( db ) == null ) { try { db = getGerritServer ( ) . getSchemaFactory ( ) . open ( ) ; } catch ( com.google.gwtorm.client.OrmException e ) { throw new com.google.gerrit.server.ssh.AbstractCommand.Failure ( 1 , "fatal: Gerrit database is offline" , e ) ; } } return db ; }
Source:
private void fireEvent ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.events.ChangeEvent 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.Change change , com.google.gerrit.server.events.ChangeEvent event , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.common.UserScopedEventListener listener : listeners ) { if ( isVisibleTo ( change , listener.getUser ( ) , db ) ) { listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }
Source:
public void currentRevisionAndMessages ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo c = get ( changeId , com.google.gerrit.extensions.common.ListChangesOption.CURRENT_REVISION , com.google.gerrit.extensions.common.ListChangesOption.MESSAGES ) ; org.junit.Assert.assertEquals ( 1 , c.revisions.size ( ) ) ; org.junit.Assert.assertEquals ( commitId ( 2 ) , c.currentRevision ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableSet.of ( commitId ( 2 ) ) , c.revisions.keySet ( ) ) ; org.junit.Assert.assertEquals ( 3 , c.revisions.get ( commitId ( 2 ) ) . _number ) ; }

Target:
public void currentRevisionAndMessages ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo c = get ( changeId , com.google.gerrit.extensions.common.ListChangesOption.CURRENT_REVISION , com.google.gerrit.extensions.common.ListChangesOption.MESSAGES ) ; com.google.common.truth.Truth.assertThat ( c.revisions ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( c.currentRevision ) . isEqualTo ( commitId ( 2 ) ) ; com.google.common.truth.Truth.assertThat ( ( ( java.lang.Iterable < ? > ) ( c.revisions.keySet ( ) ) ) ) . containsAllIn ( com.google.common.collect.ImmutableSet.of ( commitId ( 2 ) ) ) ; com.google.common.truth.Truth.assertThat ( c.revisions.get ( commitId ( 2 ) ) . _number ) . isEqualTo ( 3 ) ; }
Source:
public java.util.List < com.google.gerrit.reviewdb.client.PatchSetApproval > currentApprovals ( ) throws com.google.gwtorm.server.OrmException { if ( ( currentApprovals ) == null ) { com.google.gerrit.reviewdb.client.Change c = change ( ) ; if ( c == null ) { currentApprovals = java.util.Collections.emptyList ( ) ; } else if ( ( allApprovals ) != null ) { return allApprovals.get ( c.currentPatchSetId ( ) ) ; } else { currentApprovals = approvalsUtil.byPatchSet ( db , notes ( ) , c.currentPatchSetId ( ) ) ; } } return currentApprovals ; }

Target:
public java.util.List < com.google.gerrit.reviewdb.client.PatchSetApproval > currentApprovals ( ) throws com.google.gwtorm.server.OrmException { if ( ( currentApprovals ) == null ) { com.google.gerrit.reviewdb.client.Change c = change ( ) ; if ( c == null ) { currentApprovals = java.util.Collections.emptyList ( ) ; } else if ( ( allApprovals ) != null ) { return allApprovals.get ( c.currentPatchSetId ( ) ) ; } else { currentApprovals = com.google.common.collect.ImmutableList.copyOf ( approvalsUtil.byPatchSet ( db , changeControl ( ) , c.currentPatchSetId ( ) ) ) ; } } return currentApprovals ; }
Source:
private com.google.gwtexpui.linker.server.Permutation select ( final javax.servlet.http.HttpServletRequest req ) { if ( "0" . equals ( req.getParameter ( "s" ) ) ) { return null ; } return selector.select ( req ) ; }

Target:
private com.google.gerrit.httpd.raw.HostPageServlet.Page.Content select ( javax.servlet.http.HttpServletRequest req ) { com.google.gerrit.httpd.raw.HostPageServlet.Page pg = get ( ) ; if ( "1" . equals ( req.getParameter ( "dbg" ) ) ) { return pg.debug ; } else if ( "0" . equals ( req.getParameter ( "s" ) ) ) { return pg.get ( null ) ; } return pg.get ( selector.select ( req ) ) ; }
Source:
java.lang.Runnable maybeNextVimSearch ( final net.codemirror.lib.CodeMirror cm ) { return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { if ( cm.vim ( ) . hasSearchHighlight ( ) ) { cm.vim ( ) . handleKey ( "n" ) ; } else { getChunkManager ( ) . diffChunkNav ( cm , Direction.NEXT ) . run ( ) ; } } } ; }

Target:
private java.lang.Runnable maybePrevVimSearch ( final net.codemirror.lib.CodeMirror cm ) { return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { if ( cm.vim ( ) . hasSearchHighlight ( ) ) { cm.vim ( ) . handleKey ( "N" ) ; } else { getCommentManager ( ) . commentNav ( cm , Direction.NEXT ) . run ( ) ; } } } ; }
Source:
boolean isSingleProjectMatch ( ) { java.lang.String [ ] projects = config.getProjects ( ) ; boolean ret = ( projects.length ) == 1 ; if ( ret ) { java.lang.String projectMatch = projects [ 0 ] ; if ( ( com.googlesource.gerrit.plugins.replication.ReplicationFilter.getPatternType ( projectMatch ) ) != ( ReplicationFilter.PatternType.EXACT_MATCH ) ) { ret = false ; } } return ret ; }

Target:
boolean wouldPushProject ( com.google.gerrit.reviewdb.client.Project.NameKey project ) { if ( ! ( shouldReplicate ( project ) ) ) { return false ; } java.util.List < java.lang.String > projects = config.getProjects ( ) ; if ( projects.isEmpty ( ) ) { return true ; } return new com.googlesource.gerrit.plugins.replication.ReplicationFilter ( projects ) . matches ( project ) ; }
Source:
private java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.Id > parseGroups ( java.util.List < java.lang.String > groups ) throws com.google.gerrit.extensions.restapi.UnprocessableEntityException { java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.Id > groupIds = com.google.common.collect.Sets.newHashSet ( ) ; if ( groups != null ) { for ( java.lang.String g : groups ) { groupIds.add ( com.google.gerrit.common.data.GroupDescriptions.toAccountGroup ( groupsCollection.parseInternal ( g ) ) . getId ( ) ) ; } } return groupIds ; }

Target:
private java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.Id > parseGroups ( java.util.List < java.lang.String > groups ) throws com.google.gerrit.extensions.restapi.UnprocessableEntityException { java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.Id > groupIds = new java.util.HashSet < > ( ) ; if ( groups != null ) { for ( java.lang.String g : groups ) { groupIds.add ( com.google.gerrit.common.data.GroupDescriptions.toAccountGroup ( groupsCollection.parseInternal ( g ) ) . getId ( ) ) ; } } return groupIds ; }
Source:
public void testAddSingleHashtag ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; java.util.List < java.lang.String > expected = java.util.Arrays.asList ( "tag2" ) ; assertResult ( POST ( changeId , "tag2" , null ) , expected ) ; assertResult ( GET ( changeId ) , expected ) ; expected = java.util.Arrays.asList ( "tag1" , "tag2" ) ; assertResult ( POST ( changeId , "tag1" , null ) , expected ) ; assertResult ( GET ( changeId ) , expected ) ; }

Target:
public void testAddSingleHashtag ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; addHashtags ( r , "tag2" ) ; assertThatGet ( r ) . containsExactly ( "tag2" ) ; addHashtags ( r , "tag1" ) ; assertThatGet ( r ) . containsExactly ( "tag1" , "tag2" ) . inOrder ( ) ; }
Source:
public void blobText ( ) throws java.lang.Exception { repo.branch ( "master" ) . commit ( ) . add ( "foo" , "contents" ) . create ( ) ; java.lang.String text = buildText ( "/repo/+/master/foo?format=TEXT" , "100644" ) ; org.junit.Assert.assertEquals ( "contents" , new java.lang.String ( com.google.common.io.BaseEncoding.base64 ( ) . decode ( text ) , java.nio.charset.StandardCharsets.UTF_8 ) ) ; }

Target:
public void blobText ( ) throws java.lang.Exception { repo.branch ( "master" ) . commit ( ) . add ( "foo" , "contents" ) . create ( ) ; java.lang.String text = buildText ( "/repo/+/master/foo?format=TEXT" , "100644" ) ; org.junit.Assert.assertEquals ( "contents" , com.google.gitiles.PathServletTest.decodeBase64 ( text ) ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { for ( com.google.gerrit.reviewdb.client.Patch p : detail.getPatches ( ) ) { openWindow ( com.google.gerrit.client.Dispatcher.toPatchUnified ( diffBaseId , p.getKey ( ) ) ) ; } }

Target:
private void displayDownload ( ) { com.google.gerrit.client.changes.PatchSetComplexDisclosurePanel.ChangeDownloadPanel dp = new com.google.gerrit.client.changes.PatchSetComplexDisclosurePanel.ChangeDownloadPanel ( changeDetail.getChange ( ) . getProject ( ) . get ( ) , patchSet.getRefName ( ) , changeDetail.isAllowsAnonymous ( ) ) ; infoTable.setWidget ( com.google.gerrit.client.changes.PatchSetComplexDisclosurePanel.R_DOWNLOAD , 1 , dp ) ; }
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 { com.google.gerrit.server.git.MetaDataUpdate md = factory.create ( name , mgr.openRepository ( name ) , batch ) ; md.getCommitBuilder ( ) . setAuthor ( createPersonIdent ( user ) ) ; md.getCommitBuilder ( ) . setCommitter ( serverIdent ) ; return md ; }

Target:
public com.google.gerrit.server.git.MetaDataUpdate create ( com.google.gerrit.reviewdb.client.Project.NameKey name , org.eclipse.jgit.lib.Repository repository , com.google.gerrit.server.IdentifiedUser user , org.eclipse.jgit.lib.BatchRefUpdate batch ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { com.google.gerrit.server.git.MetaDataUpdate md = factory.create ( name , repository , batch ) ; md.getCommitBuilder ( ) . setAuthor ( createPersonIdent ( user ) ) ; md.getCommitBuilder ( ) . setCommitter ( serverIdent ) ; return md ; }
Source:
public void onKeyPress ( com.google.gwt.event.dom.client.KeyPressEvent event ) { toggleShowIntraline ( ) ; }

Target:
public void run ( ) { if ( ! ( prefs.renderEntireFile ( ) ) ) { int height = ( com.google.gwt.user.client.Window.getClientHeight ( ) ) - ( ( com.google.gerrit.client.Gerrit.getHeaderFooterHeight ( ) ) + 18 ) ; cmA.setHeight ( height ) ; cmB.setHeight ( height ) ; } render ( diff ) ; commentManager.render ( comments , prefs.expandAllComments ( ) ) ; skipManager.render ( prefs.context ( ) , diff ) ; }
Source:
public void dontSkipForOtherOps ( ) throws java.lang.Exception { java.lang.String config = "[plugin \"uploadvalidator\"]\n" + ( ( "skipValidation=testOp\n" + "skipGroup=testGroup\n" ) + "skipGroup=anotherGroup" ) ; com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig validatorConfig = new com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig ( new com.googlesource.gerrit.plugins.uploadvalidator.FakeConfigFactory ( projectName , config ) , new com.googlesource.gerrit.plugins.uploadvalidator.FakeUserProvider ( "testGroup" , "yetAnotherGroup" ) , new com.googlesource.gerrit.plugins.uploadvalidator.FakeGroupCacheUUIDByName ( ) ) ; com.google.common.truth.Truth.assertThat ( validatorConfig.isEnabledForRef ( projectName , "anyRef" , "anotherOp" ) ) . isTrue ( ) ; }

Target:
public void dontSkipForOtherOps ( ) throws java.lang.Exception { java.lang.String config = "[plugin \"uploadvalidator\"]\n" + ( ( "skipValidation=testOp\n" + "skipGroup=testGroup\n" ) + "skipGroup=anotherGroup" ) ; com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig validatorConfig = new com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig ( new com.googlesource.gerrit.plugins.uploadvalidator.FakeConfigFactory ( projectName , config ) , new com.googlesource.gerrit.plugins.uploadvalidator.FakeGroupCacheUUIDByName ( ) ) ; com.google.common.truth.Truth.assertThat ( validatorConfig.isEnabledForRef ( anyUser , projectName , "anyRef" , "anotherOp" ) ) . isTrue ( ) ; }
Source:
protected boolean shouldSendMessage ( ) { return ( ( ( sshKey ) != null ) || ( ( gpgKeys.size ( ) ) > 0 ) ) && ( ( user.equals ( callingUser ) ) || ( ! ( callingUser.getCapabilities ( ) . canAdministrateServer ( ) ) ) ) ; }

Target:
protected boolean shouldSendMessage ( ) { if ( ( ( sshKey ) == null ) && ( ( ( gpgKeys ) == null ) || ( gpgKeys.isEmpty ( ) ) ) ) { return false ; } if ( user.equals ( callingUser ) ) { return true ; } try { permissionBackend.user ( callingUser ) . check ( GlobalPermission.ADMINISTRATE_SERVER ) ; return false ; } catch ( com.google.gerrit.extensions.restapi.AuthException | com.google.gerrit.server.permissions.PermissionBackendException e ) { return true ; } }
Source:
public void onSuccess ( com.google.gerrit.common.data.PatchSetDetail result ) { patchSetDetail = result ; if ( ( fileList ) == null ) { fileList = new com.google.gerrit.client.changes.PatchTable ( ) ; fileList.display ( result ) ; patchIndex = fileList.indexOf ( patchKey ) ; topNav.display ( patchIndex , getPatchScreenType ( ) , fileList ) ; bottomNav.display ( patchIndex , getPatchScreenType ( ) , fileList ) ; } refresh ( true ) ; }

Target:
public void onSuccess ( com.google.gerrit.common.data.PatchSetDetail result ) { patchSetDetail = result ; if ( ( fileList ) == null ) { fileList = new com.google.gerrit.client.changes.PatchTable ( prefs ) ; fileList.display ( result ) ; patchIndex = fileList.indexOf ( patchKey ) ; } refresh ( true ) ; }
Source:
com.google.gerrit.httpd.raw.ResourceServlet.Resource getResource ( java.lang.String name ) { try { java.nio.file.Path p = getResourcePath ( name ) ; return cache.get ( p , newLoader ( p ) ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.httpd.raw.ResourceServlet.log.warn ( java.lang.String.format ( "Cannot load static resource %s" , name ) , e ) ; return null ; } }

Target:
com.google.gerrit.httpd.raw.ResourceServlet.Resource getResource ( java.lang.String name ) { try { java.nio.file.Path p = getResourcePath ( name ) ; if ( p == null ) { com.google.gerrit.httpd.raw.ResourceServlet.log.warn ( java.lang.String.format ( "Path doesn't exist %s" , name ) ) ; return null ; } return cache.get ( p , newLoader ( p ) ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.httpd.raw.ResourceServlet.log.warn ( java.lang.String.format ( "Cannot load static resource %s" , name ) , e ) ; return null ; } }
Source:
private void parseTag ( org.eclipse.jgit.revwalk.RevCommit commit ) throws org.eclipse.jgit.errors.ConfigInvalidException { tag = null ; java.util.List < java.lang.String > tagLines = commit.getFooterLines ( com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_TAG ) ; if ( tagLines.isEmpty ( ) ) { return ; } else if ( ( tagLines.size ( ) ) == 1 ) { tag = tagLines.get ( 0 ) ; } else { throw expectedOneFooter ( com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_TAG , tagLines ) ; } }

Target:
private void parseTag ( com.google.gerrit.server.notedb.ChangeNotesCommit commit ) throws org.eclipse.jgit.errors.ConfigInvalidException { tag = null ; java.util.List < java.lang.String > tagLines = commit.getFooterLineValues ( com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_TAG ) ; if ( tagLines.isEmpty ( ) ) { return ; } else if ( ( tagLines.size ( ) ) == 1 ) { tag = tagLines.get ( 0 ) ; } else { throw expectedOneFooter ( com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_TAG , tagLines ) ; } }
Source:
public static com.google.gerrit.server.StarredChangesUtil.StarField parse ( java.lang.String s ) { int p = s.indexOf ( com.google.gerrit.server.StarredChangesUtil.StarField.SEPARATOR ) ; if ( p >= 0 ) { try { com.google.gerrit.reviewdb.client.Account.Id accountId = Account.Id.parse ( s.substring ( 0 , p ) ) ; java.lang.String label = s.substring ( ( p + 1 ) ) ; return com.google.gerrit.server.StarredChangesUtil.StarField.create ( accountId , label ) ; } catch ( java.lang.NumberFormatException e ) { return null ; } } return null ; }

Target:
public static com.google.gerrit.server.StarredChangesUtil.StarField parse ( java.lang.String s ) { int p = s.indexOf ( com.google.gerrit.server.StarredChangesUtil.StarField.SEPARATOR ) ; if ( p >= 0 ) { java.lang.Integer id = com.google.common.primitives.Ints.tryParse ( s.substring ( 0 , p ) ) ; if ( id == null ) { return null ; } com.google.gerrit.reviewdb.client.Account.Id accountId = new com.google.gerrit.reviewdb.client.Account.Id ( id ) ; java.lang.String label = s.substring ( ( p + 1 ) ) ; return com.google.gerrit.server.StarredChangesUtil.StarField.create ( accountId , label ) ; } return null ; }
Source:
void onReplyDone ( com.google.gwt.event.dom.client.ClickEvent e ) { if ( ( replyBox ) == null ) { com.google.gerrit.client.diff.DraftBox box = getDiffView ( ) . addReply ( getOriginal ( ) , "Done" , true ) ; registerReplyBox ( box ) ; } else { openReplyBox ( ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.changes.CommentInfo result ) { done.setEnabled ( true ) ; setOpen ( false ) ; com.google.gerrit.client.diff.DraftBox box = parent.addDraftBox ( result ) ; registerReplyBox ( box ) ; if ( ! ( getCommentInfo ( ) . has_line ( ) ) ) { parent.addFileCommentBox ( box , comment.side ( ) ) ; } }
Source:
public void onSuccess ( com.google.gerrit.common.data.PatchSetDetail result ) { patchSetDetail = result ; if ( ( fileList ) == null ) { fileList = new com.google.gerrit.client.changes.PatchTable ( prefs ) ; fileList.display ( result ) ; patchIndex = fileList.indexOf ( patchKey ) ; } refresh ( true ) ; }

Target:
public void onSuccess ( com.google.gerrit.common.data.PatchSetDetail result ) { patchSetDetail = result ; if ( ( fileList ) == null ) { fileList = new com.google.gerrit.client.changes.PatchTable ( prefs ) ; fileList.display ( idSideA , result ) ; patchIndex = fileList.indexOf ( patchKey ) ; } refresh ( true ) ; }