auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void start ( final org.apache.sshd.server.Environment env ) { java.lang.String s = env.getEnv ( ) . get ( Environment.ENV_COLUMNS ) ; if ( ( s != null ) && ( ! ( s.isEmpty ( ) ) ) ) { try { columns = java.lang.Integer.parseInt ( s ) ; } catch ( java.lang.NumberFormatException err ) { columns = 80 ; } } startThread ( new com.google.gerrit.sshd.commands.CommandRunnable ( ) { @ java.lang.Override public void run ( ) throws java.lang.Exception { parseCommandLine ( ) ; com.google.gerrit.sshd.commands.ShowQueue.this . display ( ) ; } } ) ; }

Target:
public void start ( final org.apache.sshd.server.Environment env ) throws java.io.IOException { java.lang.String s = env.getEnv ( ) . get ( Environment.ENV_COLUMNS ) ; if ( ( s != null ) && ( ! ( s.isEmpty ( ) ) ) ) { try { columns = java.lang.Integer.parseInt ( s ) ; } catch ( java.lang.NumberFormatException err ) { columns = 80 ; } } super . start ( env ) ; }
Source:
private synchronized void runHook ( org.eclipse.jgit.lib.Repository repo , java.io.File hook , java.util.List < java.lang.String > args ) { if ( repo != null ) { if ( hook.exists ( ) ) { hookQueue.execute ( new com.google.gerrit.common.ChangeHookRunner.HookTask ( repo , hook , args ) ) ; } else { repo.close ( ) ; } } }

Target:
private synchronized void runHook ( java.io.File hook , java.util.List < java.lang.String > args ) { if ( hook.exists ( ) ) { hookQueue.execute ( new com.google.gerrit.common.ChangeHookRunner.HookTask ( null , hook , args ) ) ; } }
Source:
private void assertNotFound ( org.eclipse.jgit.lib.ObjectId id ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = userSession.get ( ( ( ( "/projects/" + ( project.get ( ) ) ) + "/commits/" ) + ( id.name ( ) ) ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_NOT_FOUND ) ; }

Target:
private void assertNotFound ( org.eclipse.jgit.lib.ObjectId id ) throws java.lang.Exception { userSession.get ( ( ( ( "/projects/" + ( project.get ( ) ) ) + "/commits/" ) + ( id.name ( ) ) ) ) . assertNotFound ( ) ; }
Source:
public com.google.gitiles.GitilesView.Builder setRevision ( com.google.gitiles.Revision revision ) { switch ( type ) { case HOST_INDEX : case REPOSITORY_INDEX : case REFS : case DESCRIBE : throw new java.lang.IllegalStateException ( java.lang.String.format ( "cannot set revision on %s view" , type ) ) ; case ARCHIVE : case BLAME : case DIFF : case DOC : case LOG : case PATH : case REVISION : case ROOTED_DOC : case SHOW : default : this . revision = com.google.common.base.Preconditions.checkNotNull ( revision ) ; return this ; } }

Target:
public com.google.gitiles.GitilesView.Builder setRevision ( com.google.gitiles.Revision revision ) { switch ( type ) { case HOST_INDEX : case REPOSITORY_INDEX : case REFS : case DESCRIBE : throw new java.lang.IllegalStateException ( java.lang.String.format ( "cannot set revision on %s view" , type ) ) ; default : this . revision = com.google.common.base.Preconditions.checkNotNull ( revision ) ; return this ; } }
Source:
public java.lang.String replace ( java.lang.String input ) { java.lang.String href = pat.replace ( input , link ) ; if ( ! ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( href ) ) ) { throw new java.lang.IllegalArgumentException ( ( ( ( "Invalid scheme (" + ( toString ( ) ) ) + "): " ) + href ) ) ; } java.lang.String result = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) . openAnchor ( ) . setAttribute ( "href" , href ) . append ( com.google.gwtexpui.safehtml.client.SafeHtml.asis ( input ) ) . closeAnchor ( ) . asString ( ) ; return result ; }

Target:
public java.lang.String replace ( java.lang.String input ) { java.lang.String href = pat.replace ( input , link ) ; if ( ! ( com.google.gwtexpui.safehtml.client.LinkFindReplace.hasValidScheme ( href ) ) ) { throw new java.lang.IllegalArgumentException ( ( ( ( "Invalid scheme (" + ( toString ( ) ) ) + "): " ) + href ) ) ; } return new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) . openAnchor ( ) . setAttribute ( "href" , href ) . append ( com.google.gwtexpui.safehtml.client.SafeHtml.asis ( input ) ) . closeAnchor ( ) . asString ( ) ; }
Source:
private com.google.gerrit.reviewdb.client.PatchSetApproval getSubmitter ( com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c = db.changes ( ) . get ( patchSetId.getParentKey ( ) ) ; com.google.gerrit.server.notedb.ChangeNotes notes = changeNotesFactory.create ( db , c ) . load ( ) ; return approvalsUtil.getSubmitter ( db , notes , patchSetId ) ; }

Target:
private com.google.gerrit.reviewdb.client.PatchSetApproval getSubmitter ( com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.notedb.ChangeNotes notes = changeNotesFactory.create ( db , project , patchSetId.getParentKey ( ) ) . load ( ) ; return approvalsUtil.getSubmitter ( db , notes , patchSetId ) ; }
Source:
private java.lang.String toHex ( final byte [ ] b ) { final java.lang.StringBuilder sec = new java.lang.StringBuilder ( ) ; for ( int i = 0 ; i < ( b.length ) ; i ++ ) { final int u = ( ( b [ i ] ) > > 4 ) & 15 ; final int l = ( b [ i ] ) & 15 ; sec.append ( org.apache.commons.net.smtp.AuthSMTPClient.hexchar [ u ] ) ; sec.append ( org.apache.commons.net.smtp.AuthSMTPClient.hexchar [ l ] ) ; } return sec.toString ( ) ; }

Target:
private java.lang.String toHex ( final byte [ ] b ) { final java.lang.StringBuilder sec = new java.lang.StringBuilder ( ) ; for ( byte c : b ) { final int u = ( c > > 4 ) & 15 ; final int l = c & 15 ; sec.append ( org.apache.commons.net.smtp.AuthSMTPClient.hexchar [ u ] ) ; sec.append ( org.apache.commons.net.smtp.AuthSMTPClient.hexchar [ l ] ) ; } return sec.toString ( ) ; }
Source:
public org.eclipse.jgit.lib.ObjectId findLastCommit ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.lib.ObjectId commitId , java.lang.String path ) throws java.io.IOException { org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ; try { rw.markStart ( rw.parseCommit ( commitId ) ) ; rw.setRewriteParents ( false ) ; rw.setTreeFilter ( org.eclipse.jgit.treewalk.filter.AndTreeFilter.create ( org.eclipse.jgit.treewalk.filter.PathFilterGroup.createFromStrings ( path ) , TreeFilter.ANY_DIFF ) ) ; return rw.next ( ) ; } finally { rw.release ( ) ; } }

Target:
public org.eclipse.jgit.lib.ObjectId findLastCommit ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.lib.ObjectId commitId , java.lang.String path ) throws java.io.IOException { try ( org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { rw.markStart ( rw.parseCommit ( commitId ) ) ; rw.setRewriteParents ( false ) ; rw.setTreeFilter ( org.eclipse.jgit.treewalk.filter.AndTreeFilter.create ( org.eclipse.jgit.treewalk.filter.PathFilterGroup.createFromStrings ( path ) , TreeFilter.ANY_DIFF ) ) ; return rw.next ( ) ; } }
Source:
private void renderActionTextDate ( com.google.gerrit.client.changes.ChangeInfo info ) { java.lang.String action ; if ( info.created ( ) . equals ( info.updated ( ) ) ) { action = Util.C.changeInfoBlockUploaded ( ) ; } else { action = Util.C.changeInfoBlockUpdated ( ) ; } actionText.setInnerText ( action ) ; actionDate.setInnerText ( com.google.gerrit.client.FormatUtil.relativeFormat ( info.updated ( ) ) ) ; HEAD ( ( ( 2.0 - ( plugin ) ) - ( gwtui ( cli ) ) ) ) ; }

Target:
private void renderActionTextDate ( com.google.gerrit.client.changes.ChangeInfo info ) { java.lang.String action ; if ( info.created ( ) . equals ( info.updated ( ) ) ) { action = Util.C.changeInfoBlockUploaded ( ) ; } else { action = Util.C.changeInfoBlockUpdated ( ) ; } actionText.setInnerText ( action ) ; actionDate.setInnerText ( com.google.gerrit.client.FormatUtil.relativeFormat ( info.updated ( ) ) ) ; }
Source:
public com.googlecode.prolog_cafe.lang.Term arg ( int nth ) { com.googlecode.prolog_cafe.lang.Term t = this ; int old_nth = nth ; while ( ( t.isList ( ) ) && ( 0 < nth ) ) { nth -- ; t = ( ( com.googlecode.prolog_cafe.lang.ListTerm ) ( t ) ) . cdr.dereference ( ) ; } if ( t.isList ( ) ) return ( ( com.googlecode.prolog_cafe.lang.ListTerm ) ( t ) ) . car ; throw new java.lang.ArrayIndexOutOfBoundsException ( old_nth ) ; }

Target:
public com.googlecode.prolog_cafe.lang.Term arg ( int nth ) { com.googlecode.prolog_cafe.lang.Term t = this ; int old_nth = nth ; while ( ( t instanceof com.googlecode.prolog_cafe.lang.ListTerm ) && ( 0 < nth ) ) { nth -- ; t = ( ( com.googlecode.prolog_cafe.lang.ListTerm ) ( t ) ) . cdr.dereference ( ) ; } if ( t instanceof com.googlecode.prolog_cafe.lang.ListTerm ) return ( ( com.googlecode.prolog_cafe.lang.ListTerm ) ( t ) ) . car ; throw new java.lang.ArrayIndexOutOfBoundsException ( old_nth ) ; }
Source:
public org.eclipse.jgit.lib.Repository createRepository ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws com.google.gerrit.server.git.RepositoryCaseMismatchException , org.eclipse.jgit.errors.RepositoryNotFoundException { org.eclipse.jgit.lib.Repository repo = createRepository ( basePath , name ) ; if ( ( noteDbPath ) != null ) { createRepository ( noteDbPath , name ) ; } return repo ; }

Target:
public org.eclipse.jgit.lib.Repository createRepository ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws com.google.gerrit.server.git.RepositoryCaseMismatchException , org.eclipse.jgit.errors.RepositoryNotFoundException { org.eclipse.jgit.lib.Repository repo = createRepository ( basePath , name ) ; if ( ( ( noteDbPath ) != null ) && ( ! ( noteDbPath.equals ( basePath ) ) ) ) { createRepository ( noteDbPath , name ) ; } return repo ; }
Source:
private boolean canCreateServiceUser ( ) { if ( userProvider.get ( ) . isIdentifiedUser ( ) ) { com.google.gerrit.server.account.CapabilityControl ctl = userProvider.get ( ) . getCapabilities ( ) ; return ( ctl.canPerform ( ( ( ( pluginName ) + "-" ) + ( CreateServiceUserCapability.ID ) ) ) ) || ( ctl.canAdministrateServer ( ) ) ; } else { return false ; } }

Target:
private boolean canCreateServiceUser ( ) { if ( userProvider.get ( ) . isIdentifiedUser ( ) ) { com.google.gerrit.server.account.CapabilityControl ctl = userProvider.get ( ) . getCapabilities ( ) ; return ( ctl.canPerform ( ( ( ( pluginName ) + "-" ) + ( CreateServiceUserCapability.ID ) ) ) ) || ( ctl.canAdministrateServer ( ) ) ; } return false ; }
Source:
public org.eclipse.jgit.lib.ObjectId commit ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.notedb.NoteDbUpdateManager updateManager = updateManagerFactory.create ( getProjectName ( ) ) ; updateManager.add ( this ) ; updateManager.stageAndApplyDelta ( getChange ( ) ) ; updateManager.execute ( ) ; return getResult ( ) ; }

Target:
public org.eclipse.jgit.lib.ObjectId commit ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException { try ( com.google.gerrit.server.notedb.NoteDbUpdateManager updateManager = updateManagerFactory.create ( getProjectName ( ) ) ) { updateManager.add ( this ) ; updateManager.stageAndApplyDelta ( getChange ( ) ) ; updateManager.execute ( ) ; } return getResult ( ) ; }
Source:
private void displayFile ( com.google.reviewit.widget.ScrollWithHeadingsView root , com.google.reviewit.app.Change change , java.lang.String path , com.google.gerrit.extensions.common.FileInfo file ) { java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > files = new java.util.HashMap < > ( ) ; files.put ( path , file ) ; displayFiles ( root , change , files ) ; }

Target:
private void displayFile ( com.google.reviewit.app.Change change , java.lang.String path , com.google.gerrit.extensions.common.FileInfo file ) { java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > files = new java.util.HashMap < > ( ) ; files.put ( path , file ) ; displayFiles ( change , files ) ; }
Source:
public void stop ( ) { try { searcherManager.close ( ) ; } catch ( java.io.IOException e ) { com.google.gerrit.lucene.LuceneChangeIndex.log.warn ( "error closing Lucene searcher" , e ) ; } try { writer.close ( true ) ; } catch ( java.io.IOException e ) { com.google.gerrit.lucene.LuceneChangeIndex.log.warn ( "error closing Lucene writer" , e ) ; } try { dir.close ( ) ; } catch ( java.io.IOException e ) { com.google.gerrit.lucene.LuceneChangeIndex.log.warn ( "error closing Lucene directory" , e ) ; } }

Target:
void close ( ) { try { searcherManager.close ( ) ; } catch ( java.io.IOException e ) { com.google.gerrit.lucene.LuceneChangeIndex.log.warn ( "error closing Lucene searcher" , e ) ; } try { writer.close ( true ) ; } catch ( java.io.IOException e ) { com.google.gerrit.lucene.LuceneChangeIndex.log.warn ( "error closing Lucene writer" , e ) ; } try { dir.close ( ) ; } catch ( java.io.IOException e ) { com.google.gerrit.lucene.LuceneChangeIndex.log.warn ( "error closing Lucene directory" , e ) ; } }
Source:
private com.google.inject.Injector createWebInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( sshInjector.getInstance ( com.google.inject.Module.class ) ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebModule.class ) ) ; return sysInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createWebInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; if ( sshd ) { modules.add ( sshInjector.getInstance ( com.google.inject.Module.class ) ) ; } modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebModule.class ) ) ; return sysInjector.createChildInjector ( modules ) ; }
Source:
public static void replyError ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , int statusCode , java.lang.String msg , com.google.gerrit.extensions.restapi.CacheControl c , @ com.google.gerrit.common.Nullable java.lang.Throwable err ) throws java.io.IOException { if ( err != null ) { com.google.gerrit.util.http.RequestUtil.setErrorTraceAttribute ( req , err ) ; } com.google.gerrit.httpd.restapi.RestApiServlet.configureCaching ( req , res , null , c ) ; res.setStatus ( statusCode ) ; com.google.gerrit.httpd.restapi.RestApiServlet.replyText ( req , res , msg ) ; }

Target:
public static void replyError ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , int statusCode , java.lang.String msg , com.google.gerrit.extensions.restapi.CacheControl c , @ com.google.gerrit.common.Nullable java.lang.Throwable err ) throws java.io.IOException { if ( err != null ) { com.google.gerrit.util.http.RequestUtil.setErrorTraceAttribute ( req , err ) ; } com.google.gerrit.httpd.restapi.RestApiServlet.configureCaching ( req , res , null , null , c ) ; res.setStatus ( statusCode ) ; com.google.gerrit.httpd.restapi.RestApiServlet.replyText ( req , res , msg ) ; }
Source:
protected org.eclipse.jgit.junit.TestRepository < ? > createProjectWithPush ( java.lang.String name , @ com.google.gerrit.common.Nullable com.google.gerrit.reviewdb.client.Project.NameKey parent , boolean createEmptyCommit , com.google.gerrit.extensions.client.SubmitType submitType ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey project = createProject ( name , parent , createEmptyCommit , submitType ) ; grant ( Permission.PUSH , project , "refs/heads/*" ) ; grant ( Permission.SUBMIT , project , "refs/for/refs/heads/*" ) ; return cloneProject ( project ) ; }

Target:
protected org.eclipse.jgit.junit.TestRepository < ? > createProjectWithPush ( java.lang.String name , @ com.google.gerrit.common.Nullable com.google.gerrit.reviewdb.client.Project.NameKey parent , boolean createEmptyCommit , com.google.gerrit.extensions.client.SubmitType submitType ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey project = createProject ( name , parent , createEmptyCommit , submitType ) ; grant ( project , "refs/heads/*" , Permission.PUSH ) ; grant ( project , "refs/for/refs/heads/*" , Permission.SUBMIT ) ; return cloneProject ( project ) ; }
Source:
public void run ( ) { java.lang.String mode = ( ( m != null ) && ( ! ( m.isEmpty ( ) ) ) ) ? m : null ; view.getCmFromSide ( DisplaySide.A ) . setOption ( "mode" , mode ) ; view.getCmFromSide ( DisplaySide.B ) . setOption ( "mode" , mode ) ; }

Target:
public void run ( ) { view.getCmFromSide ( DisplaySide.A ) . setOption ( "mode" , mode ) ; view.getCmFromSide ( DisplaySide.B ) . setOption ( "mode" , mode ) ; }
Source:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.project.ProjectResource project , com.google.gerrit.extensions.api.projects.DeleteBranchesInput input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException , java.io.IOException { if ( ( ( input == null ) || ( ( input.branches ) == null ) ) || ( input.branches.isEmpty ( ) ) ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "branches must be specified" ) ; } deleteRefFactory.create ( project ) . refs ( input.branches ) . delete ( ) ; return com.google.gerrit.extensions.restapi.Response.none ( ) ; HEAD ( 2 ) ; com.google.gerrit.server.project.a35a2 Merge ; }

Target:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.project.ProjectResource project , com.google.gerrit.extensions.api.projects.DeleteBranchesInput input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException , java.io.IOException { if ( ( ( input == null ) || ( ( input.branches ) == null ) ) || ( input.branches.isEmpty ( ) ) ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "branches must be specified" ) ; } deleteRefFactory.create ( project ) . refs ( input.branches ) . delete ( ) ; return com.google.gerrit.extensions.restapi.Response.none ( ) ; }
Source:
public void extend ( com.google.gerrit.server.data.ChangeAttribute a , com.google.gerrit.reviewdb.client.Change change ) { a.createdOn = ( change.getCreatedOn ( ) . getTime ( ) ) / 1000L ; a.lastUpdated = ( change.getLastUpdatedOn ( ) . getTime ( ) ) / 1000L ; a.sortKey = change.getSortKey ( ) ; a.open = change.getStatus ( ) . isOpen ( ) ; }

Target:
public void extend ( com.google.gerrit.server.data.ChangeAttribute a , com.google.gerrit.reviewdb.client.Change change ) { a.createdOn = ( change.getCreatedOn ( ) . getTime ( ) ) / 1000L ; a.lastUpdated = ( change.getLastUpdatedOn ( ) . getTime ( ) ) / 1000L ; a.open = change.getStatus ( ) . isOpen ( ) ; }
Source:
public static void setAssignee ( int id , java.lang.String user , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.AccountInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.AssigneeInput input = com.google.gerrit.client.changes.ChangeApi.AssigneeInput.create ( ) ; input.assignee ( user ) ; com.google.gerrit.client.changes.ChangeApi.change ( id ) . view ( "assignee" ) . put ( input , cb ) ; }

Target:
public static void setAssignee ( @ com.google.gerrit.common.Nullable java.lang.String project , int id , java.lang.String user , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.AccountInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.AssigneeInput input = com.google.gerrit.client.changes.ChangeApi.AssigneeInput.create ( ) ; input.assignee ( user ) ; com.google.gerrit.client.changes.ChangeApi.change ( project , id ) . view ( "assignee" ) . put ( input , cb ) ; }
Source:
public void testWithSubmodule ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit c = makeCommitWithSubmodule ( ) ; java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m = com.googlesource.gerrit.plugins.uploadvalidator.SubmoduleValidator.performValidation ( repo , c ) ; com.google.common.truth.Truth.assertThat ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessages ( m ) ) . containsExactly ( "ERROR: submodules are not allowed: modules/library" ) ; }

Target:
public void testWithSubmodule ( ) throws java.lang.Exception { try ( org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { org.eclipse.jgit.revwalk.RevCommit c = makeCommitWithSubmodule ( rw ) ; java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m = com.googlesource.gerrit.plugins.uploadvalidator.SubmoduleValidator.performValidation ( repo , c , rw ) ; com.google.common.truth.Truth.assertThat ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessages ( m ) ) . containsExactly ( "ERROR: submodules are not allowed: modules/library" ) ; } }
Source:
private boolean isVisibleTo ( com.google.gerrit.reviewdb.Change change , com.google.gerrit.server.IdentifiedUser user , com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.server.project.ProjectState pe = projectCache.get ( change.getProject ( ) ) ; if ( pe == null ) { return false ; } final com.google.gerrit.server.project.ProjectControl pc = pe.controlFor ( user ) ; return pc.controlFor ( change ) . isVisible ( db ) ; }

Target:
private boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.IdentifiedUser user , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { final com.google.gerrit.server.project.ProjectState pe = projectCache.get ( change.getProject ( ) ) ; if ( pe == null ) { return false ; } final com.google.gerrit.server.project.ProjectControl pc = pe.controlFor ( user ) ; return pc.controlFor ( change ) . isVisible ( db ) ; }
Source:
public com.google.gerrit.server.notedb.ChangeNotes createChecked ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.server.query.change.ChangeData > changes = getChangesCorrespondingToId ( changeId ) ; if ( changes.isEmpty ( ) ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( changeId ) ; } return create ( db , project , changeId ) ; }

Target:
public com.google.gerrit.server.notedb.ChangeNotes createChecked ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.notedb.ChangeNotes notes = create ( db , project , changeId ) ; if ( ( notes.getChange ( ) ) == null ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( changeId ) ; } return notes ; }
Source:
java.lang.Runnable newDraftCallback ( final net.codemirror.lib.CodeMirror cm ) { if ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { return signInCallback ( cm ) ; } return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { if ( cm.extras ( ) . hasActiveLine ( ) ) { newDraft ( cm ) ; } } } ; }

Target:
java.lang.Runnable newDraftCallback ( net.codemirror.lib.CodeMirror cm ) { if ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { return signInCallback ( cm ) ; } return ( ) -> { if ( cm.extras ( ) . hasActiveLine ( ) ) { newDraft ( cm ) ; } } ; }
Source:
public void queryChangesOneTerm ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r1 = createChange ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r2 = createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = query ( "status:open" ) ; org.junit.Assert.assertEquals ( 2 , results.size ( ) ) ; org.junit.Assert.assertEquals ( r2.getChangeId ( ) , results.get ( 0 ) . changeId ) ; org.junit.Assert.assertEquals ( r1.getChangeId ( ) , results.get ( 1 ) . changeId ) ; }

Target:
public void queryChangesOneTerm ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r1 = createChange ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r2 = createChange ( ) ; java.util.List < com.google.gerrit.extensions.common.ChangeInfo > results = query ( "status:open" ) ; com.google.common.truth.Truth.assertThat ( results.size ( ) ) . is ( 2 ) ; com.google.common.truth.Truth.assertThat ( results.get ( 0 ) . changeId ) . isEqualTo ( r2.getChangeId ( ) ) ; com.google.common.truth.Truth.assertThat ( results.get ( 1 ) . changeId ) . isEqualTo ( r1.getChangeId ( ) ) ; }
Source:
protected void configure ( ) { factory ( AgreementInfoFactory.Factory.class ) ; factory ( CreateGroup.Factory.class ) ; factory ( DeleteExternalIds.Factory.class ) ; factory ( ExternalIdDetailFactory.Factory.class ) ; factory ( GroupDetailHandler.Factory.class ) ; factory ( RegisterNewEmailSender.Factory.class ) ; factory ( RenameGroup.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( AgreementInfoFactory.Factory.class ) ; factory ( DeleteExternalIds.Factory.class ) ; factory ( ExternalIdDetailFactory.Factory.class ) ; factory ( GroupDetailHandler.Factory.class ) ; factory ( RegisterNewEmailSender.Factory.class ) ; factory ( RenameGroup.Factory.class ) ; }
Source:
private void updateScreenHeader ( net.codemirror.lib.ScrollInfo si ) { if ( ( ( si.getTop ( ) ) == 0 ) && ( ! ( com.google.gerrit.client.Gerrit.isHeaderVisible ( ) ) ) ) { com.google.gerrit.client.Gerrit.setHeaderVisible ( true ) ; diffTable.updateFileCommentVisibility ( false ) ; } else if ( ( ( si.getTop ( ) ) > ( 0.5 * ( si.getClientHeight ( ) ) ) ) && ( com.google.gerrit.client.Gerrit.isHeaderVisible ( ) ) ) { com.google.gerrit.client.Gerrit.setHeaderVisible ( false ) ; diffTable.updateFileCommentVisibility ( true ) ; } }

Target:
private void updateScreenHeader ( net.codemirror.lib.ScrollInfo si ) { if ( ( ( si.getTop ( ) ) == 0 ) && ( ! ( com.google.gerrit.client.Gerrit.isHeaderVisible ( ) ) ) ) { diffTable.setHeaderVisible ( true ) ; } else if ( ( ( si.getTop ( ) ) > ( 0.5 * ( si.getClientHeight ( ) ) ) ) && ( com.google.gerrit.client.Gerrit.isHeaderVisible ( ) ) ) { diffTable.setHeaderVisible ( false ) ; } }
Source:
private long getEffectiveMaxObjectSizeLimit ( com.google.gerrit.server.project.ProjectState p ) { long global = cfg.getLong ( "receive" , "maxObjectSizeLimit" , 0 ) ; long local = p.getMaxObjectSizeLimit ( ) ; if ( ( global > 0 ) && ( local > 0 ) ) { return java.lang.Math.min ( global , local ) ; } else { return java.lang.Math.max ( global , local ) ; } }

Target:
private long getEffectiveMaxObjectSizeLimit ( com.google.gerrit.server.project.ProjectState p ) { long global = cfg.getLong ( "receive" , "maxObjectSizeLimit" , 0 ) ; long local = p.getMaxObjectSizeLimit ( ) ; if ( ( global > 0 ) && ( local > 0 ) ) { return java.lang.Math.min ( global , local ) ; } return java.lang.Math.max ( global , local ) ; }
Source:
private void load ( ) throws java.io.IOException { if ( ( migration.writeChanges ( ) ) && ( ( getRevision ( ) ) == null ) ) { org.eclipse.jgit.lib.Repository repo = repoManager.openMetadataRepository ( getProjectName ( ) ) ; try { load ( repo ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException e ) { throw new java.io.IOException ( e ) ; } finally { repo.close ( ) ; } } }

Target:
private void load ( ) throws java.io.IOException { if ( ( migration.writeChanges ( ) ) && ( ( getRevision ( ) ) == null ) ) { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openMetadataRepository ( getProjectName ( ) ) ) { load ( repo ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException e ) { throw new java.io.IOException ( e ) ; } } }
Source:
public void testOneIndexPredicate ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "foo:a file:b" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; assertSame ( com.google.gerrit.server.query.change.AndSource.class , out.getClass ( ) ) ; assertEquals ( com.google.common.collect.ImmutableList.of ( query ( in.getChild ( 1 ) ) , in.getChild ( 0 ) ) , out.getChildren ( ) ) ; }

Target:
public void testOneIndexPredicate ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "foo:a file:b" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; org.junit.Assert.assertSame ( com.google.gerrit.server.query.change.AndSource.class , out.getClass ( ) ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( query ( in.getChild ( 1 ) ) , in.getChild ( 0 ) ) , out.getChildren ( ) ) ; }
Source:
public void testToSafeHtml ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; b.append ( 1 ) ; final com.google.gwtexpui.safehtml.client.SafeHtml h = b.toSafeHtml ( ) ; assertNotNull ( h ) ; assertNotSame ( h , b ) ; assertFalse ( ( h instanceof com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ) ) ; assertEquals ( "1" , h.asString ( ) ) ; }

Target:
public void testToSafeHtml ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; b.append ( 1 ) ; final com.google.gwtexpui.safehtml.client.SafeHtml h = b.toSafeHtml ( ) ; org.junit.Assert.assertNotNull ( h ) ; org.junit.Assert.assertNotSame ( h , b ) ; org.junit.Assert.assertFalse ( ( h instanceof com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ) ) ; org.junit.Assert.assertEquals ( "1" , h.asString ( ) ) ; }
Source:
public void testListDrafts ( ) throws java.lang.Exception { com.google.gerrit.server.change.CommentsTest.assertListDrafts ( injector , revRes1 , java.util.Collections.< java.lang.String , java.util.ArrayList < com.google.gerrit.reviewdb.client.PatchLineComment > > emptyMap ( ) ) ; com.google.gerrit.server.change.CommentsTest.assertListDrafts ( injector , revRes2 , com.google.common.collect.ImmutableMap.of ( "FileOne.txt" , com.google.common.collect.Lists.newArrayList ( plc4 , plc5 ) ) ) ; }

Target:
public void testListDrafts ( ) throws java.lang.Exception { assertListDrafts ( revRes1 , java.util.Collections.< java.lang.String , java.util.ArrayList < com.google.gerrit.reviewdb.client.PatchLineComment > > emptyMap ( ) ) ; assertListDrafts ( revRes2 , com.google.common.collect.ImmutableMap.of ( "FileOne.txt" , com.google.common.collect.Lists.newArrayList ( plc4 , plc5 ) ) ) ; }
Source:
public void testAppend_StringBuilder ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; assertSame ( b , b.append ( ( ( java.lang.StringBuilder ) ( null ) ) ) ) ; assertEquals ( "" , b.asString ( ) ) ; assertSame ( b , b.append ( new java.lang.StringBuilder ( "foo" ) ) ) ; assertSame ( b , b.append ( new java.lang.StringBuilder ( "bar" ) ) ) ; assertEquals ( "foobar" , b.asString ( ) ) ; }

Target:
public void testAppend_StringBuilder ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; org.junit.Assert.assertSame ( b , b.append ( ( ( java.lang.StringBuilder ) ( null ) ) ) ) ; org.junit.Assert.assertEquals ( "" , b.asString ( ) ) ; org.junit.Assert.assertSame ( b , b.append ( new java.lang.StringBuilder ( "foo" ) ) ) ; org.junit.Assert.assertSame ( b , b.append ( new java.lang.StringBuilder ( "bar" ) ) ) ; org.junit.Assert.assertEquals ( "foobar" , b.asString ( ) ) ; }
Source:
public void afterRefUpdates ( ) throws com.google.gerrit.extensions.restapi.ResourceConflictException { if ( failAfterRefUpdates ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "Failing after ref updates" ) ; } for ( com.google.gerrit.server.git.strategy.SubmitStrategy strategy : strategies ) { com.google.gerrit.server.git.strategy.SubmitStrategy.Arguments args = strategy.args ; if ( args.mergeTip.getCurrentTip ( ) . equals ( args.mergeTip.getInitialTip ( ) ) ) { continue ; } } }

Target:
public void afterRefUpdates ( ) throws com.google.gerrit.extensions.restapi.ResourceConflictException { if ( failAfterRefUpdates ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "Failing after ref updates" ) ; } }
Source:
public void banCommit_Forbidden ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = userSession.put ( ( ( "/projects/" + ( project.get ( ) ) ) + "/ban/" ) , BanCommit.Input.fromCommits ( "a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96" ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_FORBIDDEN , r.getStatusCode ( ) ) ; }

Target:
public void banCommit_Forbidden ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = userSession.put ( ( ( "/projects/" + ( project.get ( ) ) ) + "/ban/" ) , BanCommit.Input.fromCommits ( "a8a477efffbbf3b44169bb9a1d3a334cbbd9aa96" ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_FORBIDDEN ) ; }
Source:
private int getInt ( com.google.gerrit.server.config.PluginConfig cfg , java.lang.String name , int defaultValue ) { try { return cfg.getInt ( name , defaultValue ) ; } catch ( java.lang.IllegalArgumentException e ) { com.googlesource.gerrit.plugins.webhooks.Configuration.log.error ( java.lang.String.format ( "invalid value for %s; using default value %d" , name , defaultValue ) ) ; com.googlesource.gerrit.plugins.webhooks.Configuration.log.debug ( ( "Failed retrieve integer value: " + ( e.getMessage ( ) ) ) , e ) ; return defaultValue ; } }

Target:
protected int getInt ( com.google.gerrit.server.config.PluginConfig cfg , java.lang.String name , int defaultValue ) { try { return cfg.getInt ( name , defaultValue ) ; } catch ( java.lang.IllegalArgumentException e ) { com.googlesource.gerrit.plugins.webhooks.Configuration.log.error ( java.lang.String.format ( "invalid value for %s; using default value %d" , name , defaultValue ) ) ; com.googlesource.gerrit.plugins.webhooks.Configuration.log.debug ( ( "Failed retrieve integer value: " + ( e.getMessage ( ) ) ) , e ) ; return defaultValue ; } }
Source:
private java.util.Set < java.lang.String > allRefPatterns ( java.lang.String permissionName ) { java.util.Set < java.lang.String > all = new java.util.HashSet < java.lang.String > ( ) ; for ( com.google.gerrit.common.data.AccessSection section : access ( ) ) { com.google.gerrit.common.data.Permission permission = section.getPermission ( permissionName ) ; if ( permission != null ) { all.add ( section.getRefPattern ( ) ) ; } } return all ; }

Target:
private java.util.Set < java.lang.String > allRefPatterns ( java.lang.String permissionName ) { java.util.Set < java.lang.String > all = new java.util.HashSet < java.lang.String > ( ) ; for ( com.google.gerrit.common.data.AccessSection section : access ( ) ) { com.google.gerrit.common.data.Permission permission = section.getPermission ( permissionName ) ; if ( permission != null ) { all.add ( section.getName ( ) ) ; } } return all ; }
Source:
public void testGetPeopleAccess ( ) throws java.lang.Exception { final com.google.gwtorm.data.PhoneBookDb schema = open ( ) ; assertNotNull ( schema.people ( ) ) ; assertEquals ( "people" , schema.people ( ) . getRelationName ( ) ) ; assertEquals ( 1 , schema.people ( ) . getRelationID ( ) ) ; }

Target:
public void testGetPeopleAccess ( ) throws java.lang.Exception { final com.google.gwtorm.data.PhoneBookDb schema = open ( ) ; org.junit.Assert.assertNotNull ( schema.people ( ) ) ; org.junit.Assert.assertEquals ( "people" , schema.people ( ) . getRelationName ( ) ) ; org.junit.Assert.assertEquals ( 1 , schema.people ( ) . getRelationID ( ) ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.extensions.api.projects.Projects.class ) . to ( com.google.gerrit.server.api.projects.ProjectsImpl.class ) ; factory ( BranchApiImpl.Factory.class ) ; factory ( TagApiImpl.Factory.class ) ; factory ( ProjectApiImpl.Factory.class ) ; factory ( ChildProjectApiImpl.Factory.class ) ; factory ( AccessApiImpl.Factory.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.extensions.api.projects.Projects.class ) . to ( com.google.gerrit.server.api.projects.ProjectsImpl.class ) ; factory ( BranchApiImpl.Factory.class ) ; factory ( TagApiImpl.Factory.class ) ; factory ( ProjectApiImpl.Factory.class ) ; factory ( ChildProjectApiImpl.Factory.class ) ; }
Source:
private java.lang.String url ( ) { if ( ( info.hasChangeNumber ( ) ) && ( info.hasRevisionNumber ( ) ) ) { return "#" + ( com.google.gerrit.common.PageLinks.toChange ( info.patchSetId ( ) ) ) ; } return null ; }

Target:
private java.lang.String url ( ) { if ( ( info.hasChangeNumber ( ) ) && ( info.hasRevisionNumber ( ) ) ) { return "#" + ( com.google.gerrit.common.PageLinks.toChange ( new com.google.gerrit.reviewdb.client.Project.NameKey ( info.project ( ) ) , info.patchSetId ( ) ) ) ; } return null ; }
Source:
public java.lang.String getCreateSequenceSql ( final com.google.gwtorm.schema.SequenceModel seq ) { final com.google.gwtorm.client.Sequence s = seq.getSequence ( ) ; final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( "CREATE TABLE " ) ; r.append ( seq.getSequenceName ( ) ) ; r.append ( "(s SERIAL)" ) ; return r.toString ( ) ; }

Target:
public java.lang.String getCreateSequenceSql ( final com.google.gwtorm.schema.SequenceModel seq ) { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( "CREATE TABLE " ) ; r.append ( seq.getSequenceName ( ) ) ; r.append ( "(s SERIAL)" ) ; return r.toString ( ) ; }
Source:
public com.google.gerrit.extensions.api.changes.ReviewerInfo format ( com.google.gerrit.extensions.api.changes.ReviewerInfo out , com.google.gerrit.server.permissions.PermissionBackend.ForChange perm , com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet.Id psId = cd.change ( ) . currentPatchSetId ( ) ; com.google.gerrit.server.project.ChangeControl ctl = cd.changeControl ( ) . forUser ( perm.user ( ) ) ; return format ( out , perm , cd , approvalsUtil.byPatchSetUser ( db.get ( ) , cd.notes ( ) , ctl.getUser ( ) , psId , new com.google.gerrit.reviewdb.client.Account.Id ( out._accountId ) , null , null ) ) ; }

Target:
public com.google.gerrit.extensions.api.changes.ReviewerInfo format ( com.google.gerrit.extensions.api.changes.ReviewerInfo out , com.google.gerrit.server.permissions.PermissionBackend.ForChange perm , com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet.Id psId = cd.change ( ) . currentPatchSetId ( ) ; return format ( out , perm , cd , approvalsUtil.byPatchSetUser ( db.get ( ) , cd.notes ( ) , perm.user ( ) , psId , new com.google.gerrit.reviewdb.client.Account.Id ( out._accountId ) , null , null ) ) ; }
Source:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.ChangeInfo revertChange , java.sql.Timestamp when ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.ChangeReverted.Event event = new com.google.gerrit.server.extensions.events.ChangeReverted.Event ( change , revertChange , when ) ; for ( com.google.gerrit.extensions.events.ChangeRevertedListener l : listeners ) { try { l.onChangeReverted ( event ) ; } catch ( java.lang.Exception e ) { util.logEventListenerError ( com.google.gerrit.server.extensions.events.ChangeReverted.log , e ) ; } } }

Target:
private void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.ChangeInfo revertChange , java.sql.Timestamp when ) { com.google.gerrit.server.extensions.events.ChangeReverted.Event event = new com.google.gerrit.server.extensions.events.ChangeReverted.Event ( change , revertChange , when ) ; for ( com.google.gerrit.extensions.events.ChangeRevertedListener l : listeners ) { try { l.onChangeReverted ( event ) ; } catch ( java.lang.Exception e ) { util.logEventListenerError ( com.google.gerrit.server.extensions.events.ChangeReverted.log , e ) ; } } }
Source:
private void deleteSshKey ( com.google.gerrit.extensions.common.SshKeyInfo i ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException , org.eclipse.jgit.errors.RepositoryNotFoundException { com.google.gerrit.server.account.AccountSshKey sshKey = new com.google.gerrit.server.account.AccountSshKey ( new com.google.gerrit.server.account.AccountSshKey.Id ( user.getAccountId ( ) , i.seq ) , i.sshPublicKey ) ; deleteSshKey.apply ( new com.google.gerrit.server.account.AccountResource.SshKey ( user.asIdentifiedUser ( ) , sshKey ) , null ) ; }

Target:
private void deleteSshKey ( com.google.gerrit.extensions.common.SshKeyInfo i ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException , org.eclipse.jgit.errors.RepositoryNotFoundException { com.google.gerrit.server.account.AccountSshKey sshKey = com.google.gerrit.server.account.AccountSshKey.create ( user.getAccountId ( ) , i.seq , i.sshPublicKey ) ; deleteSshKey.apply ( new com.google.gerrit.server.account.AccountResource.SshKey ( user.asIdentifiedUser ( ) , sshKey ) , null ) ; }
Source:
public com.google.gerrit.server.plugins.ServerPlugin get ( java.io.File srcFile , org.eclipse.jgit.internal.storage.file.FileSnapshot snapshot , com.googlesource.gerrit.plugins.cookbook.pluginprovider.PluginDescription pluginDescriptor ) throws com.google.gerrit.server.plugins.InvalidPluginException { java.lang.String name = getPluginName ( srcFile ) ; return new com.google.gerrit.server.plugins.ServerPlugin ( name , pluginDescriptor.canonicalUrl , pluginDescriptor.user , srcFile , snapshot , new com.googlesource.gerrit.plugins.cookbook.pluginprovider.HelloSshPluginContentScanner ( name ) , pluginDescriptor.dataDir , com.google.gerrit.server.plugins.Plugin.ApiType.PLUGIN , getClass ( ) . getClassLoader ( ) , null , com.googlesource.gerrit.plugins.cookbook.pluginprovider.HelloSshModule.class , null ) ; }

Target:
public com.google.gerrit.server.plugins.ServerPlugin get ( java.io.File srcFile , org.eclipse.jgit.internal.storage.file.FileSnapshot snapshot , com.googlesource.gerrit.plugins.cookbook.pluginprovider.PluginDescription pluginDescriptor ) throws com.google.gerrit.server.plugins.InvalidPluginException { java.lang.String name = getPluginName ( srcFile ) ; return new com.google.gerrit.server.plugins.ServerPlugin ( name , pluginDescriptor.canonicalUrl , pluginDescriptor.user , srcFile , snapshot , new com.googlesource.gerrit.plugins.cookbook.pluginprovider.HelloSshPluginContentScanner ( name ) , pluginDescriptor.dataDir , getClass ( ) . getClassLoader ( ) ) ; }
Source:
private static java.util.List < com.google.gwtorm.schema.ColumnModel > leaves ( java.util.List < com.google.gwtorm.schema.ColumnModel > in ) { java.util.ArrayList < com.google.gwtorm.schema.ColumnModel > r = new java.util.ArrayList < com.google.gwtorm.schema.ColumnModel > ( in.size ( ) ) ; for ( com.google.gwtorm.schema.ColumnModel m : in ) { if ( m.isNested ( ) ) { r.addAll ( m.getAllLeafColumns ( ) ) ; } else { r.add ( m ) ; } } return r ; }

Target:
private static java.util.List < com.google.gwtorm.schema.ColumnModel > leaves ( java.util.List < com.google.gwtorm.schema.ColumnModel > in ) { java.util.ArrayList < com.google.gwtorm.schema.ColumnModel > r = new java.util.ArrayList ( in.size ( ) ) ; for ( com.google.gwtorm.schema.ColumnModel m : in ) { if ( m.isNested ( ) ) { r.addAll ( m.getAllLeafColumns ( ) ) ; } else { r.add ( m ) ; } } return r ; }
Source:
public void deleteBranchesNotFound ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.DeleteBranchesInput input = new com.google.gerrit.extensions.api.projects.DeleteBranchesInput ( ) ; java.util.List < java.lang.String > branches = com.google.common.collect.Lists.newArrayList ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ; branches.add ( "refs/heads/does-not-exist" ) ; input.branches = branches ; try { project ( ) . deleteBranches ( input ) ; org.junit.Assert.fail ( "Expected ResourceConflictException" ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceConflictException e ) { com.google.common.truth.Truth.assertThat ( e ) . hasMessageThat ( ) . isEqualTo ( errorMessageForBranches ( com.google.common.collect.ImmutableList.of ( "refs/heads/does-not-exist" ) ) ) ; } assertBranchesDeleted ( ) ; }

Target:
public void deleteBranchesNotFound ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.DeleteBranchesInput input = new com.google.gerrit.extensions.api.projects.DeleteBranchesInput ( ) ; java.util.List < java.lang.String > branches = com.google.common.collect.Lists.newArrayList ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ; branches.add ( "refs/heads/does-not-exist" ) ; input.branches = branches ; try { project ( ) . deleteBranches ( input ) ; fail ( "Expected ResourceConflictException" ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceConflictException e ) { com.google.common.truth.Truth.assertThat ( e ) . hasMessageThat ( ) . isEqualTo ( errorMessageForBranches ( com.google.common.collect.ImmutableList.of ( "refs/heads/does-not-exist" ) ) ) ; } assertBranchesDeleted ( ) ; }
Source:
private static void trimLeadingEmptyLines ( byte [ ] bytes , org.eclipse.jgit.util.MutableInteger p ) { while ( ( ( p.value ) < ( bytes.length ) ) && ( ( bytes [ p.value ] ) == '\n' ) ) { ( p.value ) ++ ; } }

Target:
protected static void trimLeadingEmptyLines ( byte [ ] bytes , org.eclipse.jgit.util.MutableInteger p ) { while ( ( ( p.value ) < ( bytes.length ) ) && ( ( bytes [ p.value ] ) == '\n' ) ) { ( p.value ) ++ ; } }
Source:
public com.google.gerrit.common.data.Permission getPermission ( java.lang.String name , boolean create ) { for ( com.google.gerrit.common.data.Permission p : getPermissions ( ) ) { if ( p.getName ( ) . equalsIgnoreCase ( name ) ) { return p ; } } if ( create ) { com.google.gerrit.common.data.Permission p = new com.google.gerrit.common.data.Permission ( name ) ; permissions.add ( p ) ; return p ; } else { return null ; } }

Target:
public com.google.gerrit.common.data.Permission getPermission ( java.lang.String name , boolean create ) { for ( com.google.gerrit.common.data.Permission p : getPermissions ( ) ) { if ( p.getName ( ) . equalsIgnoreCase ( name ) ) { return p ; } } if ( create ) { com.google.gerrit.common.data.Permission p = new com.google.gerrit.common.data.Permission ( name ) ; permissions.add ( p ) ; return p ; } return null ; }
Source:
public void updateRepo ( com.google.gerrit.server.git.BatchUpdate.RepoContext ctx ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , java.io.IOException { validate ( ctx ) ; patchSetInfo = patchSetInfoFactory.get ( ctx.getRevWalk ( ) , commit , patchSet.getId ( ) ) ; change.setCurrentPatchSet ( patchSetInfo ) ; if ( ! ( updateRef ) ) { return ; } ctx.addRefUpdate ( new org.eclipse.jgit.transport.ReceiveCommand ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) , commit , patchSet.getRefName ( ) ) ) ; }

Target:
public void updateRepo ( com.google.gerrit.server.git.BatchUpdate.RepoContext ctx ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , java.io.IOException { validate ( ctx ) ; if ( ! ( updateRef ) ) { return ; } ctx.addRefUpdate ( new org.eclipse.jgit.transport.ReceiveCommand ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) , commit , patchSet.getRefName ( ) ) ) ; }