auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void populateProjects ( ) { Util.PROJECT_SVC.visibleProjects ( new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.common.data.ProjectList > ( ) { @ java.lang.Override public void onSuccess ( final com.google.gerrit.common.data.ProjectList result ) { projectsTab.display ( result.getProjects ( ) ) ; if ( firstPopupLoad ) { firstPopupLoad = false ; displayPopup ( ) ; } } } ) ; }

Target:
protected void populateProjects ( ) { com.google.gerrit.client.projects.ProjectMap.all ( new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.projects.ProjectMap > ( ) { @ java.lang.Override public void onSuccess ( final com.google.gerrit.client.projects.ProjectMap result ) { projectsTab.display ( result ) ; if ( firstPopupLoad ) { firstPopupLoad = false ; displayPopup ( ) ; } } } ) ; }
Source:
void display ( final java.util.List < com.google.gerrit.reviewdb.client.AccountGroupIncludeByUuid > result ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.reviewdb.client.AccountGroupIncludeByUuid k : result ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , k ) ; } }

Target:
void display ( java.util.List < com.google.gerrit.client.groups.GroupInfo > list ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.client.groups.GroupInfo i : list ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , i ) ; } }
Source:
public void onFailure ( java.lang.Throwable caught ) { new com.google.gerrit.client.ErrorDialog ( caught.getMessage ( ) ) { @ java.lang.Override public void setText ( final java.lang.String t ) { } } . center ( ) ; enableForm ( true ) ; }

Target:
protected void populate ( final int row , final com.google.gerrit.reviewdb.Project k ) { final com.google.gwt.user.client.ui.Anchor projectLink = new com.google.gwt.user.client.ui.Anchor ( k.getName ( ) ) ; projectLink.addClickHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { sugestParent.setText ( getRowItem ( row ) . getName ( ) ) ; } } ) ; table.setWidget ( row , 1 , projectLink ) ; table.setText ( row , 2 , k.getDescription ( ) ) ; setRowItem ( row , k ) ; }
Source:
public boolean xsrfValidate ( ) { final java.lang.String keyIn = getXsrfKeyIn ( ) ; if ( ( keyIn == null ) || ( "" . equals ( keyIn ) ) ) { return ! ( session.isSignedIn ( ) ) ; } else { return ( session.isSignedIn ( ) ) && ( keyIn.equals ( session.getAccessToken ( ) ) ) ; } }

Target:
public boolean xsrfValidate ( ) { final java.lang.String keyIn = getXsrfKeyIn ( ) ; if ( ( keyIn == null ) || ( "" . equals ( keyIn ) ) ) { return ! ( session.isSignedIn ( ) ) ; } else { return ( session.isSignedIn ( ) ) && ( keyIn.equals ( session.getAuthorization ( ) ) ) ; } }
Source:
public void rollback ( ) throws com.google.gwtorm.server.OrmException { try { conn.rollback ( ) ; } catch ( java.sql.SQLException err ) { throw new com.google.gwtorm.server.OrmException ( "Cannot rollback transaction" , err ) ; } finally { try { conn.setAutoCommit ( true ) ; } catch ( java.sql.SQLException err ) { throw new com.google.gwtorm.server.OrmException ( "Cannot set auto commit mode" , err ) ; } } }

Target:
public void rollback ( ) throws com.google.gwtorm.server.OrmException { try { if ( ! ( conn.getAutoCommit ( ) ) ) { conn.rollback ( ) ; } } catch ( java.sql.SQLException err ) { throw new com.google.gwtorm.server.OrmException ( "Cannot rollback transaction" , err ) ; } finally { try { conn.setAutoCommit ( true ) ; } catch ( java.sql.SQLException err ) { throw new com.google.gwtorm.server.OrmException ( "Cannot set auto commit mode" , err ) ; } } }
Source:
public boolean updateChange ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet ps = psUtil.get ( ctx.getDb ( ) , ctx.getNotes ( ) , psId ) ; psUtil.setGroups ( ctx.getDb ( ) , ctx.getUpdate ( psId ) , ps , com.google.common.collect.ImmutableList.< java.lang.String > of ( ) ) ; ctx.bumpLastUpdatedOn ( false ) ; return true ; }

Target:
public boolean updateChange ( com.google.gerrit.server.update.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet ps = psUtil.get ( ctx.getDb ( ) , ctx.getNotes ( ) , psId ) ; psUtil.setGroups ( ctx.getDb ( ) , ctx.getUpdate ( psId ) , ps , com.google.common.collect.ImmutableList.< java.lang.String > of ( ) ) ; ctx.bumpLastUpdatedOn ( false ) ; return true ; }
Source:
protected void updateRepoImpl ( com.google.gerrit.server.update.RepoContext ctx ) throws com.google.gerrit.server.git.IntegrationException { args.mergeTip.moveTipTo ( toMerge , toMerge ) ; }

Target:
protected void updateRepoImpl ( com.google.gerrit.server.update.RepoContext ctx ) throws com.google.gerrit.server.git.IntegrationException { if ( ( args.project.is ( BooleanProjectConfig.REJECT_EMPTY_COMMIT ) ) && ( toMerge.getTree ( ) . equals ( toMerge.getParent ( 0 ) . getTree ( ) ) ) ) { toMerge.setStatusCode ( com.google.gerrit.server.git.strategy.CommitMergeStatus.EMPTY_COMMIT ) ; return ; } args.mergeTip.moveTipTo ( toMerge , toMerge ) ; }
Source:
public void setUp ( ) { systemTimeZone = java.lang.System.setProperty ( "user.timezone" , "US/Eastern" ) ; com.google.gerrit.testutil.TestTimeUtil.resetWithClockStep ( 1 , java.util.concurrent.TimeUnit.SECONDS ) ; project = new com.google.gerrit.reviewdb.client.Project.NameKey ( "project" ) ; accountId = new com.google.gerrit.reviewdb.client.Account.Id ( 100 ) ; }

Target:
public void setUp ( ) { java.lang.String tz = "US/Eastern" ; systemTimeZoneProperty = java.lang.System.setProperty ( "user.timezone" , tz ) ; systemTimeZone = java.util.TimeZone.getDefault ( ) ; java.util.TimeZone.setDefault ( java.util.TimeZone.getTimeZone ( tz ) ) ; com.google.gerrit.testutil.TestTimeUtil.resetWithClockStep ( 1 , java.util.concurrent.TimeUnit.SECONDS ) ; project = new com.google.gerrit.reviewdb.client.Project.NameKey ( "project" ) ; accountId = new com.google.gerrit.reviewdb.client.Account.Id ( 100 ) ; }
Source:
private java.nio.file.Path getReplicationStatusPath ( java.lang.String key ) throws java.io.IOException { java.lang.String sanitizedKey = key.replace ( "." , "_" ) . replace ( " " , "_" ) ; java.nio.file.Path projectPath = pluginData.resolve ( ( sanitizedKey + ".replication-error.json" ) ) ; java.nio.file.Files.createDirectories ( projectPath.getParent ( ) ) ; return projectPath ; }

Target:
private java.nio.file.Path getReplicationStatusPath ( java.lang.String key ) throws java.io.IOException { java.nio.file.Path projectPath = pluginData.resolve ( ( ( getSanitizedKey ( key ) ) + ".replication-error.json" ) ) ; java.nio.file.Files.createDirectories ( projectPath.getParent ( ) ) ; return projectPath ; }
Source:
public void insertComment ( com.google.gerrit.reviewdb.client.PatchLineComment comment ) throws com.google.gwtorm.server.OrmException { if ( ( comment.getStatus ( ) ) == ( PatchLineComment.Status.DRAFT ) ) { insertDraftComment ( comment ) ; } else { insertPublishedComment ( comment ) ; } }

Target:
public void putComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) { verifyComment ( c ) ; createDraftUpdateIfNull ( ) ; if ( ( c.getStatus ( ) ) == ( PatchLineComment.Status.DRAFT ) ) { draftUpdate.putComment ( c ) ; } else { comments.add ( c ) ; draftUpdate.deleteComment ( c ) ; } }
Source:
private org.apache.http.impl.client.DefaultHttpClient getClient ( ) { if ( ( client ) == null ) { client = new org.apache.http.impl.client.DefaultHttpClient ( ) ; client.getCredentialsProvider ( ) . setCredentials ( new org.apache.http.auth.AuthScope ( "localhost" , 8080 ) , new org.apache.http.auth.UsernamePasswordCredentials ( account.username , account.httpPassword ) ) ; } return client ; }

Target:
private org.apache.http.impl.client.DefaultHttpClient getClient ( ) { if ( ( client ) == null ) { java.net.URI uri = java.net.URI.create ( url ) ; client = new org.apache.http.impl.client.DefaultHttpClient ( ) ; client.getCredentialsProvider ( ) . setCredentials ( new org.apache.http.auth.AuthScope ( uri.getHost ( ) , uri.getPort ( ) ) , new org.apache.http.auth.UsernamePasswordCredentials ( account.username , account.httpPassword ) ) ; } return client ; }
Source:
protected void insertTitleRow ( final int row , java.lang.String section ) { table.insertRow ( row ) ; table.setText ( row , 0 , section ) ; final com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter fmt = table.getFlexCellFormatter ( ) ; fmt.setColSpan ( row , 0 , 4 ) ; fmt.addStyleName ( row , 0 , Gerrit.RESOURCES.css ( ) . sectionHeader ( ) ) ; }

Target:
protected void insertTitleRow ( final int row , java.lang.String section ) { table.insertRow ( row ) ; table.setText ( row , 0 , section ) ; final com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter fmt = table.getFlexCellFormatter ( ) ; fmt.setColSpan ( row , 0 , 5 ) ; fmt.addStyleName ( row , 0 , Gerrit.RESOURCES.css ( ) . sectionHeader ( ) ) ; }
Source:
protected com.google.gerrit.common.data.ProjectAccess updateProjectConfig ( com.google.gerrit.server.git.ProjectConfig config , com.google.gerrit.server.git.MetaDataUpdate md , boolean parentProjectUpdate ) throws com.google.gerrit.server.permissions.PermissionBackendException , com.google.gerrit.server.project.NoSuchProjectException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.revwalk.RevCommit commit = config.commit ( md ) ; gitRefUpdated.fire ( config.getProject ( ) . getNameKey ( ) , RefNames.REFS_CONFIG , base , commit.getId ( ) , user.asIdentifiedUser ( ) . getAccount ( ) ) ; projectCache.evict ( config.getProject ( ) ) ; createGroupPermissionSyncer.syncIfNeeded ( ) ; return projectAccessFactory.create ( projectName ) . call ( ) ; }

Target:
protected com.google.gerrit.common.data.ProjectAccess updateProjectConfig ( com.google.gerrit.server.git.ProjectConfig config , com.google.gerrit.server.git.MetaDataUpdate md , boolean parentProjectUpdate ) throws com.google.gerrit.server.permissions.PermissionBackendException , com.google.gerrit.server.project.NoSuchProjectException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.revwalk.RevCommit commit = config.commit ( md ) ; gitRefUpdated.fire ( config.getProject ( ) . getNameKey ( ) , RefNames.REFS_CONFIG , base , commit.getId ( ) , user.asIdentifiedUser ( ) . state ( ) ) ; projectCache.evict ( config.getProject ( ) ) ; createGroupPermissionSyncer.syncIfNeeded ( ) ; return projectAccessFactory.create ( projectName ) . call ( ) ; }
Source:
javax.naming.directory.DirContext authenticate ( java.lang.String dn , java.lang.String password ) throws com.google.gerrit.server.account.AccountException { final java.util.Properties env = createContextProperties ( ) ; env.put ( javax.naming.Context.SECURITY_AUTHENTICATION , "simple" ) ; env.put ( javax.naming.Context.SECURITY_PRINCIPAL , dn ) ; env.put ( javax.naming.Context.SECURITY_CREDENTIALS , password ) ; env.put ( javax.naming.Context.REFERRAL , referral ) ; try { return new javax.naming.directory.InitialDirContext ( env ) ; } catch ( javax.naming.NamingException e ) { throw new com.google.gerrit.server.account.AuthenticationFailedException ( "Incorrect username or password" , e ) ; } }

Target:
javax.naming.directory.DirContext authenticate ( java.lang.String dn , java.lang.String password ) throws com.google.gerrit.server.account.AccountException { final java.util.Properties env = createContextProperties ( ) ; try { javax.naming.ldap.LdapContext ctx = createContext ( env ) ; ctx.addToEnvironment ( javax.naming.Context.SECURITY_AUTHENTICATION , "simple" ) ; ctx.addToEnvironment ( javax.naming.Context.SECURITY_PRINCIPAL , dn ) ; ctx.addToEnvironment ( javax.naming.Context.SECURITY_CREDENTIALS , password ) ; ctx.addToEnvironment ( javax.naming.Context.REFERRAL , referral ) ; ctx.reconnect ( null ) ; return ctx ; } catch ( java.io.IOException | javax.naming.NamingException e ) { throw new com.google.gerrit.server.account.AuthenticationFailedException ( "Incorrect username or password" , e ) ; } }
Source:
protected void configure ( ) { bind ( PrologEnvironment.Args.class ) . toInstance ( new com.google.gerrit.rules.PrologEnvironment.Args ( null , null , null , null , null , null ) ) ; }

Target:
protected void configure ( ) { org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; cfg.setInt ( "rules" , null , "reductionLimit" , 1300 ) ; cfg.setInt ( "rules" , null , "compileReductionLimit" , ( ( int ) ( 1000000.0 ) ) ) ; bind ( PrologEnvironment.Args.class ) . toInstance ( new com.google.gerrit.rules.PrologEnvironment.Args ( null , null , null , null , null , null , cfg ) ) ; }
Source:
void setSecure ( java.lang.String name , java.lang.String value ) { if ( value != null ) { flags.sec.setString ( section , null , name , value ) ; } else { flags.sec.unset ( section , null , name ) ; } }

Target:
public java.lang.String select ( final java.lang.String title , final java.lang.String name , final java.lang.String dv , java.util.Set < java.lang.String > allowedValues ) { final java.lang.String ov = get ( name ) ; java.lang.String nv = ui.readString ( ( ov != null ? ov : dv ) , allowedValues , "%s" , title ) ; if ( ! ( com.google.gerrit.pgm.init.Section.eq ( ov , nv ) ) ) { set ( name , nv ) ; } return nv ; }
Source:
public void deletePatchSet ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createChangeWith2PS ( "refs/for/master" ) ; com.google.gerrit.reviewdb.client.PatchSet ps = getCurrentPatchSet ( changeId ) ; com.google.gerrit.server.change.ChangeJson.ChangeInfo c = getChange ( changeId ) ; org.junit.Assert.assertEquals ( ( "p~master~" + changeId ) , c.id ) ; org.junit.Assert.assertEquals ( Change.Status.NEW , c.status ) ; com.google.gerrit.acceptance.RestResponse r = com.google.gerrit.acceptance.rest.change.DeleteDraftPatchSetIT.deletePatchSet ( changeId , ps , adminSession ) ; org.junit.Assert.assertEquals ( "Patch set is not a draft." , r.getEntityContent ( ) ) ; org.junit.Assert.assertEquals ( 409 , r.getStatusCode ( ) ) ; }

Target:
public void deletePatchSet ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = getCurrentPatchSet ( changeId ) ; java.lang.String triplet = "p~master~" + changeId ; com.google.gerrit.extensions.common.ChangeInfo c = get ( triplet ) ; org.junit.Assert.assertEquals ( triplet , c.id ) ; org.junit.Assert.assertEquals ( ChangeStatus.NEW , c.status ) ; com.google.gerrit.acceptance.RestResponse r = com.google.gerrit.acceptance.rest.change.DeleteDraftPatchSetIT.deletePatchSet ( changeId , ps , adminSession ) ; org.junit.Assert.assertEquals ( "Patch set is not a draft." , r.getEntityContent ( ) ) ; org.junit.Assert.assertEquals ( 409 , r.getStatusCode ( ) ) ; }
Source:
public void testTokenExpired ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestToken token = new com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestToken ( ( - 1 ) ) ; com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestTokenVerifier verifier = new com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestTokenVerifier ( token ) ; com.google.common.truth.Truth.assertThat ( verifier.verify ( ) ) . isFalse ( ) ; }

Target:
public void testTokenExpired ( ) throws java.lang.Exception { java.time.Instant when = java.time.Instant.now ( ) ; com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestToken token = new com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestToken ( when , 1L ) ; com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestTokenVerifier verifier = new com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestTokenVerifier ( token ) ; com.google.common.truth.Truth.assertThat ( verifier.onTime ( when.plusMillis ( 1001 ) ) ) . isFalse ( ) ; }
Source:
private java.util.List < org.apache.lucene.document.Document > doRead ( ) throws com.google.gwtorm.server.OrmException { BRANCH ( 87.0F ) ; }

Target:
public com.google.gwtorm.server.ResultSet < com.google.gerrit.server.query.change.ChangeData > read ( ) throws com.google.gwtorm.server.OrmException { if ( java.lang.Thread.interrupted ( ) ) { java.lang.Thread.currentThread ( ) . interrupt ( ) ; throw new com.google.gwtorm.server.OrmException ( "interrupted" ) ; } final java.util.Set < java.lang.String > fields = fields ( opts ) ; return new com.google.gerrit.lucene.LuceneChangeIndex.ChangeDataResults ( executor.submit ( new java.util.concurrent.Callable < java.util.List < org.apache.lucene.document.Document > > ( ) { @ java.lang.Override public java.util.List < org.apache.lucene.document.Document > call ( ) throws java.io.IOException { return doRead ( fields ) ; } } ) , fields ) ; }
Source:
protected void configure ( ) { try { final com.google.gerrit.server.GerritServer gs = com.google.gerrit.server.GerritServer.getInstance ( true ) ; bind ( com.google.gerrit.server.GerritServer.class ) . toInstance ( gs ) ; bind ( com.google.gerrit.server.ContactStore.class ) . toInstance ( com.google.gerrit.server.EncryptedContactStore.create ( gs ) ) ; bind ( com.google.gerrit.server.FileTypeRegistry.class ) . to ( com.google.gerrit.server.MimeUtilFileTypeRegistry.class ) ; } catch ( com.google.gwtorm.client.OrmException e ) { addError ( e ) ; } catch ( com.google.gwtjsonrpc.server.XsrfException e ) { addError ( e ) ; } }

Target:
protected void configure ( ) { try { bind ( com.google.gerrit.server.GerritServer.class ) . toInstance ( com.google.gerrit.server.GerritServer.getInstance ( true ) ) ; } catch ( com.google.gwtorm.client.OrmException e ) { addError ( e ) ; } catch ( com.google.gwtjsonrpc.server.XsrfException e ) { addError ( e ) ; } bind ( com.google.gerrit.server.ContactStore.class ) . toProvider ( com.google.gerrit.server.EncryptedContactStoreProvider.class ) ; bind ( com.google.gerrit.server.FileTypeRegistry.class ) . to ( com.google.gerrit.server.MimeUtilFileTypeRegistry.class ) ; }
Source:
public com.google.gerrit.server.change.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Unmute" ) . setTitle ( "Unmute the change" ) . setVisible ( ( ( ! ( rsrc.isUserOwner ( ) ) ) && ( isUnMuteable ( rsrc.getChange ( ) ) ) ) ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < java.lang.String > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.Unmute.Input input ) throws com.google.gerrit.server.StarredChangesUtil.IllegalLabelException , com.google.gwtorm.server.OrmException { if ( isMuted ( rsrc ) ) { stars.unmute ( rsrc ) ; } return com.google.gerrit.extensions.restapi.Response.ok ( "" ) ; }
Source:
public void suggestReviewersWithoutLimitOptionSpecified ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; java.lang.String query = user3.fullName ; java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > suggestedReviewerInfos = newGson ( ) . fromJson ( adminSession.get ( ( ( ( "/changes/" + changeId ) + "/suggest_reviewers?q=" ) + query ) ) . getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > > ( ) { } . getType ( ) ) ; com.google.common.truth.Truth.assertThat ( suggestedReviewerInfos ) . hasSize ( 1 ) ; }

Target:
public void suggestReviewersWithoutLimitOptionSpecified ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; java.lang.String query = user3.fullName ; java.util.List < com.google.gerrit.extensions.common.SuggestedReviewerInfo > suggestedReviewerInfos = gApi.changes ( ) . id ( changeId ) . suggestReviewers ( query ) . get ( ) ; com.google.common.truth.Truth.assertThat ( suggestedReviewerInfos ) . hasSize ( 1 ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.info.AccountInfo result ) { onCloseForm ( ) ; assigneeLink.setText ( result.name ( ) ) ; }

Target:
private void setAssignee ( com.google.gerrit.client.info.AccountInfo assignee ) { currentAssignee = assignee ; assigneeLink.setText ( ( assignee != null ? assignee.name ( ) : null ) ) ; assigneeLink.setTargetHistoryToken ( ( assignee != null ? com.google.gerrit.common.PageLinks.toAssigneeQuery ( ( ( assignee.name ( ) ) != null ? assignee.name ( ) : ( assignee.email ( ) ) != null ? assignee.email ( ) : java.lang.String.valueOf ( assignee._accountId ( ) ) ) ) : "" ) ) ; }
Source:
private java.lang.Iterable < java.lang.String > getDraftRefs ( final com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { java.util.Set < java.lang.String > refNames = getRefNamesAllUsers ( RefNames.REFS_DRAFT_COMMENTS ) ; final java.lang.String suffix = "/" + ( changeId.get ( ) ) ; return com.google.common.collect.Iterables.filter ( refNames , 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 onAddress ( com.google.gwt.event.dom.client.ClickEvent e ) { e.stopPropagation ( ) ; com.google.gerrit.client.editor.EditScreen.scrollToLine ( comment.line ( ) ) ; java.lang.String token = com.google.gerrit.client.Dispatcher.toEditScreen ( psId , comment.path ( ) ) ; if ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { com.google.gerrit.client.Gerrit.doSignIn ( token ) ; } else { com.google.gerrit.client.Gerrit.display ( token ) ; } }

Target:
void onEdit ( com.google.gwt.event.dom.client.ClickEvent e ) { e.stopPropagation ( ) ; com.google.gerrit.client.editor.EditScreen.scrollToLine ( comment.line ( ) ) ; java.lang.String token = com.google.gerrit.client.Dispatcher.toEditScreen ( psId , comment.path ( ) ) ; if ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { com.google.gerrit.client.Gerrit.doSignIn ( token ) ; } else { com.google.gerrit.client.Gerrit.display ( token ) ; } }
Source:
public void usernamePatternNonRegex ( ) { com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "refs/sb/${username}/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , "u" , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = user ( local , "d" , com.google.gerrit.server.project.Util.DEVS ) ; assertCannotRead ( "refs/sb/d/heads/foobar" , u ) ; assertCanRead ( "refs/sb/d/heads/foobar" , d ) ; }

Target:
public void usernamePatternWithRegex ( ) { com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.testing.Util.DEVS , "^refs/sb/${username}/heads/.*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , "d.v" , com.google.gerrit.server.project.testing.Util.DEVS ) ; com.google.gerrit.server.project.ProjectControl d = user ( local , "dev" , com.google.gerrit.server.project.testing.Util.DEVS ) ; assertCannotRead ( "refs/sb/dev/heads/foobar" , u ) ; assertCanRead ( "refs/sb/dev/heads/foobar" , d ) ; }
Source:
private org.apache.lucene.document.Document toDocument ( com.google.gerrit.server.query.change.ChangeData cd ) { org.apache.lucene.document.Document result = new org.apache.lucene.document.Document ( ) ; for ( com.google.gerrit.server.index.Schema.Values < com.google.gerrit.server.query.change.ChangeData > vs : schema.buildFields ( cd , fillArgs ) ) { if ( ( vs.getValues ( ) ) != null ) { add ( result , vs ) ; } } return result ; }

Target:
private org.apache.lucene.document.Document toDocument ( com.google.gerrit.server.query.change.ChangeData cd ) { org.apache.lucene.document.Document result = new org.apache.lucene.document.Document ( ) ; for ( com.google.gerrit.server.index.Schema.Values < com.google.gerrit.server.query.change.ChangeData > vs : schema.buildFields ( cd , fillArgs ) ) { if ( ( vs.getValues ( ) ) != null ) { com.google.gerrit.lucene.LuceneChangeIndex.add ( result , vs ) ; } } return result ; }
Source:
protected java.lang.Object createServiceHandle ( ) throws java.lang.Exception { final com.google.gerrit.server.GerritServer gs = com.google.gerrit.server.GerritServer.getInstance ( ) ; return new com.google.gerrit.client.changes.ChangeDetailServiceImpl ( gs.getDatabase ( ) , gs.getGroupCache ( ) ) ; }

Target:
protected java.lang.Object createServiceHandle ( ) throws java.lang.Exception { final com.google.gerrit.server.GerritServer gs = com.google.gerrit.server.GerritServer.getInstance ( ) ; final com.google.gwtorm.client.SchemaFactory < com.google.gerrit.client.reviewdb.ReviewDb > rdf = gs.getDatabase ( ) ; final com.google.gerrit.client.data.GroupCache groups = gs.getGroupCache ( ) ; final com.google.gerrit.client.data.GerritConfig config = gs.getGerritConfig ( ) ; return new com.google.gerrit.client.changes.ChangeDetailServiceImpl ( rdf , groups , config ) ; }
Source:
private boolean canPushWithForce ( ) { for ( com.google.gerrit.common.data.PermissionRule rule : access ( Permission.PUSH ) ) { if ( rule.getForce ( ) ) { return true ; } } return false ; }

Target:
private boolean canPushWithForce ( ) { if ( ( GitRepositoryManager.REF_CONFIG.equals ( refName ) ) && ( ! ( getProjectControl ( ) . isOwner ( ) ) ) ) { return false ; } for ( com.google.gerrit.common.data.PermissionRule rule : access ( Permission.PUSH ) ) { if ( rule.getForce ( ) ) { return true ; } } return false ; }
Source:
public void listProjectWithType ( ) throws java.lang.Exception { java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ProjectInfo > result = gApi.projects ( ) . list ( ) . withType ( FilterType.PERMISSIONS ) . getAsMap ( ) ; com.google.common.truth.Truth.assertThat ( result ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( result ) . containsKey ( allProjects.get ( ) ) ; com.google.gerrit.acceptance.rest.project.ProjectAssert.assertThatNameList ( gApi.projects ( ) . list ( ) . withType ( FilterType.ALL ) . get ( ) ) . containsExactly ( allProjects , allUsers , project ) . inOrder ( ) ; }

Target:
public void listProjectWithType ( ) throws java.lang.Exception { java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ProjectInfo > result = gApi.projects ( ) . list ( ) . withType ( FilterType.PERMISSIONS ) . getAsMap ( ) ; com.google.common.truth.Truth.assertThat ( result ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( result ) . containsKey ( allProjects.get ( ) ) ; com.google.gerrit.acceptance.rest.project.ProjectAssert.assertThatNameList ( filter ( gApi.projects ( ) . list ( ) . withType ( FilterType.ALL ) . get ( ) ) ) . containsExactly ( allProjects , allUsers , project ) . inOrder ( ) ; }
Source:
private static Change.Key getChangeId ( org.eclipse.jgit.lib.ObjectId id , org.eclipse.jgit.revwalk.RevCommit emptyCommit ) { java.util.List < java.lang.String > idList = emptyCommit.getFooterLines ( MergeUtil.CHANGE_ID ) ; com.google.gerrit.reviewdb.client.Change.Key changeKey = ( ! ( idList.isEmpty ( ) ) ) ? new com.google.gerrit.reviewdb.client.Change.Key ( idList.get ( ( ( idList.size ( ) ) - 1 ) ) . trim ( ) ) : new com.google.gerrit.reviewdb.client.Change.Key ( ( "I" + ( id.name ( ) ) ) ) ; return changeKey ; }

Target:
private static Change.Key getChangeId ( org.eclipse.jgit.lib.ObjectId id , org.eclipse.jgit.revwalk.RevCommit emptyCommit ) { java.util.List < java.lang.String > idList = emptyCommit.getFooterLines ( FooterConstants.CHANGE_ID ) ; com.google.gerrit.reviewdb.client.Change.Key changeKey = ( ! ( idList.isEmpty ( ) ) ) ? new com.google.gerrit.reviewdb.client.Change.Key ( idList.get ( ( ( idList.size ( ) ) - 1 ) ) . trim ( ) ) : new com.google.gerrit.reviewdb.client.Change.Key ( ( "I" + ( id.name ( ) ) ) ) ; return changeKey ; }
Source:
public com.google.gwtjsonrpc.client.VoidResult run ( final com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gerrit.httpd.rpc.account.Failure , com.google.gwtorm.server.OrmException { final com.google.gerrit.reviewdb.client.Account.Id me = user.get ( ) . getAccountId ( ) ; for ( final com.google.gerrit.reviewdb.client.AccountSshKey.Id keyId : ids ) { if ( ! ( me.equals ( keyId.getParentKey ( ) ) ) ) throw new com.google.gerrit.httpd.rpc.account.Failure ( new com.google.gerrit.common.errors.NoSuchEntityException ( ) ) ; } db.accountSshKeys ( ) . deleteKeys ( ids ) ; uncacheSshKeys ( ) ; return com.google.gwtjsonrpc.client.VoidResult.INSTANCE ; }

Target:
public com.google.gwtjsonrpc.common.VoidResult run ( final com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gerrit.httpd.rpc.account.Failure , com.google.gwtorm.server.OrmException { final com.google.gerrit.reviewdb.client.Account.Id me = user.get ( ) . getAccountId ( ) ; for ( final com.google.gerrit.reviewdb.client.AccountSshKey.Id keyId : ids ) { if ( ! ( me.equals ( keyId.getParentKey ( ) ) ) ) throw new com.google.gerrit.httpd.rpc.account.Failure ( new com.google.gerrit.common.errors.NoSuchEntityException ( ) ) ; } db.accountSshKeys ( ) . deleteKeys ( ids ) ; uncacheSshKeys ( ) ; return com.google.gwtjsonrpc.common.VoidResult.INSTANCE ; }
Source:
public java.lang.Object apply ( com.google.gerrit.server.group.MemberResource resource , com.google.gerrit.server.group.DeleteMembers.DeleteMember.Input input ) throws com.google.gerrit.common.errors.NoSuchGroupException , com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.group.PutMembers.Input in = new com.google.gerrit.server.group.PutMembers.Input ( ) ; in._oneMember = resource.getUser ( ) . getAccountId ( ) . toString ( ) ; return delete.get ( ) . apply ( resource.getGroup ( ) , in ) ; }

Target:
public java.lang.Object apply ( com.google.gerrit.server.group.MemberResource resource , com.google.gerrit.server.group.DeleteMembers.DeleteMember.Input input ) throws com.google.gerrit.common.errors.NoSuchGroupException , com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.group.AddMembers.Input in = new com.google.gerrit.server.group.AddMembers.Input ( ) ; in._oneMember = resource.getUser ( ) . getAccountId ( ) . toString ( ) ; return delete.get ( ) . apply ( resource.getGroup ( ) , in ) ; }
Source:
public void load ( org.eclipse.jgit.lib.Repository db , org.eclipse.jgit.lib.ObjectId id ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { reader = db.newObjectReader ( ) ; try { revision = ( id != null ) ? new org.eclipse.jgit.revwalk.RevWalk ( reader ) . parseCommit ( id ) : null ; onLoad ( ) ; } finally { reader.close ( ) ; reader = null ; } }

Target:
public void load ( org.eclipse.jgit.revwalk.RevWalk walk , org.eclipse.jgit.lib.ObjectId id ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { this . reader = walk.getObjectReader ( ) ; try { revision = ( id != null ) ? new org.eclipse.jgit.revwalk.RevWalk ( reader ) . parseCommit ( id ) : null ; onLoad ( ) ; } finally { reader = null ; } }
Source:
public static java.util.Set < java.lang.Class < ? > > load ( com.googlesource.gerrit.plugins.scripting.groovyprovider.GroovyPluginScriptEngine scriptEngine , java.io.File srcFile ) throws com.google.gerrit.server.plugins.InvalidPluginException { try { return com.googlesource.gerrit.plugins.scripting.groovyprovider.GroovyPluginScanner.scanGroovyScriptBindings ( scriptEngine.loadScriptByName ( srcFile.getName ( ) ) ) ; } catch ( groovy.util.ResourceException | groovy.util.ScriptException e ) { throw new com.google.gerrit.server.plugins.InvalidPluginException ( ( "Cannot compile and execute Groovy script " + srcFile ) , e ) ; } }

Target:
public static java.util.Set < java.lang.Class < ? > > load ( com.googlesource.gerrit.plugins.scripting.groovyprovider.GroovyPluginScriptEngine scriptEngine , java.nio.file.Path srcFile ) throws com.google.gerrit.server.plugins.InvalidPluginException { try { return com.googlesource.gerrit.plugins.scripting.groovyprovider.GroovyPluginScanner.scanGroovyScriptBindings ( scriptEngine.loadScriptByName ( srcFile.toString ( ) ) ) ; } catch ( groovy.util.ResourceException | groovy.util.ScriptException e ) { throw new com.google.gerrit.server.plugins.InvalidPluginException ( ( "Cannot compile and execute Groovy script " + srcFile ) , e ) ; } }
Source:
public java.lang.Void call ( ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException , com.google.gwtorm.server.OrmException { insertChangeImpl ( ) ; synchronized ( newProgress ) { newProgress.update ( 1 ) ; } return null ; }

Target:
public java.lang.Void call ( ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException , com.google.gwtorm.server.OrmException { if ( caller == ( java.lang.Thread.currentThread ( ) ) ) { insertChange ( this . db ) ; } else { try ( com.google.gerrit.reviewdb.server.ReviewDb threadLocalDb = schemaFactory.open ( ) ) { insertChange ( threadLocalDb ) ; } } synchronized ( newProgress ) { newProgress.update ( 1 ) ; } return null ; }
Source:
public void onShowView ( ) { super . onShowView ( ) ; com.google.gwt.user.client.Window.enableScrolling ( false ) ; com.google.gerrit.client.JumpKeys.enable ( false ) ; if ( getPrefs ( ) . hideTopMenu ( ) ) { com.google.gerrit.client.Gerrit.setHeaderVisible ( false ) ; } resizeHandler = com.google.gwt.user.client.Window.addResizeHandler ( new com.google.gwt.event.logical.shared.ResizeHandler ( ) { @ java.lang.Override public void onResize ( com.google.gwt.event.logical.shared.ResizeEvent event ) { resizeCodeMirror ( ) ; } } ) ; }

Target:
private void countParents ( com.google.gerrit.client.rpc.CallbackGroup cbg ) { com.google.gerrit.client.changes.ChangeApi.revision ( changeId.get ( ) , revision.getId ( ) ) . view ( "commit" ) . get ( cbg.add ( new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.ChangeInfo.CommitInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.info.ChangeInfo.CommitInfo info ) { parents = info.parents ( ) . length ( ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { parents = 0 ; } } ) ) ; }
Source:
public void doClaSignupHook ( com.google.gerrit.reviewdb.Account account , com.google.gerrit.reviewdb.ContributorAgreement cla ) { if ( account != null ) { final java.util.List < java.lang.String > args = new java.util.ArrayList < java.lang.String > ( ) ; addArg ( args , "--submitter" , getDisplayName ( account ) ) ; addArg ( args , "--user-id" , account.getId ( ) . toString ( ) ) ; addArg ( args , "--cla-id" , cla.getId ( ) . toString ( ) ) ; runHook ( claSignedHook , args ) ; } }

Target:
public void doClaSignupHook ( com.google.gerrit.reviewdb.client.Account account , com.google.gerrit.common.data.ContributorAgreement cla ) { if ( account != null ) { final java.util.List < java.lang.String > args = new java.util.ArrayList < java.lang.String > ( ) ; addArg ( args , "--submitter" , getDisplayName ( account ) ) ; addArg ( args , "--user-id" , account.getId ( ) . toString ( ) ) ; addArg ( args , "--cla-name" , cla.getName ( ) ) ; runHook ( claSignedHook , args ) ; } }
Source:
public com.googlesource.gerrit.plugins.wip.Description getDescription ( com.google.gerrit.server.change.RevisionResource rsrc ) { com.google.gerrit.reviewdb.client.PatchSet.Id current = rsrc.getChange ( ) . currentPatchSetId ( ) ; return new com.googlesource.gerrit.plugins.wip.Description ( ) . setLabel ( "Ready" ) . setTitle ( "Set Ready For Review" ) . setVisible ( ( ( ( rsrc.getChange ( ) . getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.WORKINPROGRESS ) ) && ( rsrc.getPatchSet ( ) . getId ( ) . equals ( current ) ) ) ) ; }

Target:
public com.googlesource.gerrit.plugins.wip.Description getDescription ( com.google.gerrit.server.change.RevisionResource rsrc ) { com.google.gerrit.reviewdb.client.PatchSet.Id current = rsrc.getChange ( ) . currentPatchSetId ( ) ; return new com.googlesource.gerrit.plugins.wip.Description ( ) . setLabel ( "Ready" ) . setTitle ( "Set Ready For Review" ) . setVisible ( ( ( ( rsrc.getControl ( ) . isOwner ( ) ) && ( ( rsrc.getChange ( ) . getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.DRAFT ) ) ) && ( rsrc.getPatchSet ( ) . getId ( ) . equals ( current ) ) ) ) ; }
Source:
public void testIsEnabledEventSingleBranchExact ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "refs/heads/testBranch" } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.PatchSetCreatedEvent event = new com.google.gerrit.server.events.PatchSetCreatedEvent ( ) ; event.change = new com.google.gerrit.server.data.ChangeAttribute ( ) ; event.change.project = "testProject" ; event.change.branch = "testBranch" ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( event ) ) ; }

Target:
public void testIsEnabledChangeRestoredEvent ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.ChangeRestoredEvent event = new com.google.gerrit.server.events.ChangeRestoredEvent ( ) ; com.google.gerrit.server.data.ChangeAttribute changeAttribute = new com.google.gerrit.server.data.ChangeAttribute ( ) ; changeAttribute.project = "testProject" ; changeAttribute.branch = "testBranch" ; event.change = com.google.common.base.Suppliers.ofInstance ( changeAttribute ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( event ) ) ; }
Source:
protected void execResource ( final java.lang.String p ) { try ( java.io.InputStream in = com.google.gerrit.pgm.shell.JythonShell.class . getClassLoader ( ) . getResourceAsStream ( p ) ) { if ( in != null ) { execStream ( in , ( "resource " + p ) ) ; } else { com.google.gerrit.pgm.shell.JythonShell.log.error ( ( "Cannot load resource " + p ) ) ; } } catch ( java.io.IOException e ) { com.google.gerrit.pgm.shell.JythonShell.log.error ( e.getMessage ( ) , e ) ; } }

Target:
protected void execResource ( final java.lang.String p ) { try ( java.io.InputStream in = com.google.gerrit.pgm.JythonShell.class . getClassLoader ( ) . getResourceAsStream ( p ) ) { if ( in != null ) { execStream ( in , ( "resource " + p ) ) ; } else { com.google.gerrit.pgm.JythonShell.log.error ( ( "Cannot load resource " + p ) ) ; } } catch ( java.io.IOException e ) { com.google.gerrit.pgm.JythonShell.log.error ( e.getMessage ( ) , e ) ; } }
Source:
private static boolean eq ( final org.eclipse.jgit.lib.ObjectId a , final org.eclipse.jgit.lib.ObjectId b ) { if ( ( a == null ) && ( b == null ) ) { return true ; } return ( ( a != null ) && ( b != null ) ) && ( org.eclipse.jgit.lib.AnyObjectId.equals ( a , b ) ) ; }

Target:
public java.lang.Integer getParentNum ( ) { return parentNum ; }
Source:
public java.lang.Void call ( ) throws java.lang.Exception { try { index.replace ( new com.google.gerrit.server.query.change.ChangeData ( change ) ) ; return null ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.index.ChangeIndexerImpl.log.error ( java.lang.String.format ( "Failed to index change %d in %s" , change.getChangeId ( ) , change.getProject ( ) . get ( ) ) , e ) ; throw e ; } }

Target:
public com.google.gerrit.server.CurrentUser getCurrentUser ( ) { throw new com.google.inject.OutOfScopeException ( "No user during ChangeIndexer" ) ; }
Source:
static void postSignIn ( ) { com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; com.google.gwt.user.client.DeferredCommand.addCommand ( new com.google.gwt.user.client.Command ( ) { public void execute ( ) { for ( final com.google.gerrit.client.SignedInListener l : com.google.gerrit.client.Gerrit.signedInListeners ) { l.onSignIn ( ) ; } } } ) ; }

Target:
static void postSignIn ( final com.google.gerrit.client.reviewdb.Account acct ) { com.google.gerrit.client.Gerrit.myAccount = acct ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; com.google.gwt.user.client.DeferredCommand.addCommand ( new com.google.gwt.user.client.Command ( ) { public void execute ( ) { for ( final com.google.gerrit.client.SignedInListener l : com.google.gerrit.client.Gerrit.signedInListeners ) { l.onSignIn ( ) ; } } } ) ; }
Source:
public void ignore ( boolean ignore ) throws com.google.gerrit.extensions.restapi.RestApiException { if ( ignore ) { this . ignore.apply ( change , new com.google.gerrit.server.change.Ignore.Input ( ) ) ; } else { unignore.apply ( change , new com.google.gerrit.server.change.Unignore.Input ( ) ) ; } }

Target:
public void ignore ( boolean ignore ) throws com.google.gerrit.extensions.restapi.RestApiException { try { if ( ignore ) { this . ignore.apply ( change , new com.google.gerrit.server.change.Ignore.Input ( ) ) ; } else { unignore.apply ( change , new com.google.gerrit.server.change.Unignore.Input ( ) ) ; } } catch ( com.google.gwtorm.server.OrmException e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot ignore change" , e ) ; } }
Source:
private void scan ( org.commonmark.node.Node node , com.google.common.collect.Multimap < java.lang.String , com.google.gitiles.doc.TocFormatter.TocEntry > entries , java.util.Deque < org.commonmark.node.Heading > stack ) { if ( node instanceof org.commonmark.node.Heading ) { scan ( ( ( org.commonmark.node.Heading ) ( node ) ) , entries , stack ) ; } else { for ( org.commonmark.node.Node c = node.getFirstChild ( ) ; c != null ; c = c.getNext ( ) ) { scan ( c , entries , stack ) ; } } }

Target:
private void scan ( org.commonmark.node.Node node , com.google.common.collect.ListMultimap < java.lang.String , com.google.gitiles.doc.TocFormatter.TocEntry > entries , java.util.Deque < org.commonmark.node.Heading > stack ) { if ( node instanceof org.commonmark.node.Heading ) { scan ( ( ( org.commonmark.node.Heading ) ( node ) ) , entries , stack ) ; } else { for ( org.commonmark.node.Node c = node.getFirstChild ( ) ; c != null ; c = c.getNext ( ) ) { scan ( c , entries , stack ) ; } } }
Source:
private void updateChange ( java.lang.String changeId , com.google.gerrit.extensions.client.ChangeKind changeKind ) throws java.lang.Exception { switch ( changeKind ) { case com.google.gerrit.extensions.client.ChangeKind.NO_CODE_CHANGE : noCodeChange ( changeId ) ; return ; case com.google.gerrit.extensions.client.ChangeKind.REWORK : rework ( changeId ) ; return ; case com.google.gerrit.extensions.client.ChangeKind.TRIVIAL_REBASE : trivialRebase ( changeId ) ; return ; case com.google.gerrit.extensions.client.ChangeKind.MERGE_FIRST_PARENT_UPDATE : updateFirstParent ( changeId ) ; return ; case NO_CHANGE : default : org.junit.Assert.fail ( ( "unexpected change kind: " + changeKind ) ) ; } }

Target:
private void updateChange ( java.lang.String changeId , com.google.gerrit.extensions.client.ChangeKind changeKind ) throws java.lang.Exception { switch ( changeKind ) { case com.google.gerrit.extensions.client.ChangeKind.NO_CODE_CHANGE : noCodeChange ( changeId ) ; return ; case com.google.gerrit.extensions.client.ChangeKind.REWORK : rework ( changeId ) ; return ; case com.google.gerrit.extensions.client.ChangeKind.TRIVIAL_REBASE : trivialRebase ( changeId ) ; return ; case com.google.gerrit.extensions.client.ChangeKind.MERGE_FIRST_PARENT_UPDATE : updateFirstParent ( changeId ) ; return ; case com.google.gerrit.extensions.client.ChangeKind.NO_CHANGE : noChange ( changeId ) ; return ; default : org.junit.Assert.fail ( ( "unexpected change kind: " + changeKind ) ) ; } }
Source:
public void cannotUploadToAnyRef ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/for/refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCannotUpload ( u ) ; assertCannotCreateChange ( "refs/heads/master" , u ) ; }

Target:
public void cannotUploadToAnyRef ( ) { com.google.gerrit.server.project.testing.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.project.testing.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.testing.Util.DEVS , "refs/for/refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCannotUpload ( u ) ; assertCannotCreateChange ( "refs/heads/master" , u ) ; }
Source:
public void onSuccess ( final com.google.gerrit.common.data.HostPageData result ) { com.google.gwt.dom.client.Document.get ( ) . getElementById ( "gerrit_hostpagedata" ) . removeFromParent ( ) ; com.google.gerrit.client.Gerrit.myConfig = result.config ; com.google.gerrit.client.Gerrit.myTheme = result.theme ; if ( ( result.account ) != null ) { com.google.gerrit.client.Gerrit.myAccount = result.account ; com.google.gerrit.client.Gerrit.xGerritAuth = result.xGerritAuth ; } if ( ( result.accountDiffPref ) != null ) { com.google.gerrit.client.Gerrit.myAccountDiffPref = result.accountDiffPref ; com.google.gerrit.client.Gerrit.applyUserPreferences ( ) ; } onModuleLoad2 ( result ) ; }

Target:
public static void setUserPreferences ( com.google.gerrit.client.info.GeneralPreferences prefs ) { com.google.gerrit.client.Gerrit.myPrefs = prefs ; com.google.gerrit.client.Gerrit.applyUserPreferences ( ) ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; }
Source:
private java.util.Properties loadBuckProperties ( ) throws java.io.IOException { java.util.Properties properties = new java.util.Properties ( ) ; java.nio.file.Path propertiesPath = gen.resolve ( java.nio.file.Paths.get ( "tools/buck/buck.properties" ) ) ; if ( java.nio.file.Files.exists ( propertiesPath ) ) { try ( java.io.InputStream in = java.nio.file.Files.newInputStream ( propertiesPath ) ) { properties.load ( in ) ; } } return properties ; }

Target:
private java.util.Properties loadBuildProperties ( java.nio.file.Path propertiesPath ) throws java.io.IOException { java.util.Properties properties = new java.util.Properties ( ) ; if ( java.nio.file.Files.exists ( propertiesPath ) ) { try ( java.io.InputStream in = java.nio.file.Files.newInputStream ( propertiesPath ) ) { properties.load ( in ) ; } } return properties ; }