auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private org.kohsuke.github.PagedIterable < org.kohsuke.github.GHRepository > getRepositories ( com.googlesource.gerrit.plugins.github.oauth.GitHubLogin hubLogin , java.lang.String organisation ) throws java.io.IOException { if ( organisation.equals ( hubLogin.getMyself ( ) . getLogin ( ) ) ) { return hubLogin.getMyself ( ) . listRepositories ( config.repositoryListPageSize , RepositoryListFilter.OWNER ) ; } else { org.kohsuke.github.GHOrganization ghOrganisation = hubLogin.getMyself ( ) . getAllOrganizations ( ) . byLogin ( organisation ) ; return ghOrganisation.listRepositories ( config.repositoryListPageSize ) ; } }

Target:
private org.kohsuke.github.PagedIterable < org.kohsuke.github.GHRepository > getRepositories ( com.googlesource.gerrit.plugins.github.oauth.GitHubLogin hubLogin , java.lang.String organisation ) throws java.io.IOException { if ( organisation.equals ( hubLogin.getMyself ( ) . getLogin ( ) ) ) { return hubLogin.getMyself ( ) . listRepositories ( config.repositoryListPageSize , RepositoryListFilter.OWNER ) ; } org.kohsuke.github.GHOrganization ghOrganisation = hubLogin.getMyself ( ) . getAllOrganizations ( ) . byLogin ( organisation ) ; return ghOrganisation.listRepositories ( config.repositoryListPageSize ) ; }
Source:
private static boolean isChangeScreen2 ( ) { if ( com.google.gerrit.client.Dispatcher.changeScreen2 ) { return true ; } com.google.gerrit.reviewdb.client.AccountGeneralPreferences.ChangeScreen ui = null ; if ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) { ui = com.google.gerrit.client.Gerrit.getUserAccount ( ) . getGeneralPreferences ( ) . getChangeScreen ( ) ; } if ( ui == null ) { ui = com.google.gerrit.client.Gerrit.getConfig ( ) . getChangeScreen ( ) ; } return ui == ( com.google.gerrit.client.changes.ChangeScreen.CHANGE_SCREEN2 ) ; }

Target:
public static boolean isChangeScreen2 ( ) { if ( com.google.gerrit.client.Dispatcher.changeScreen2 ) { return true ; } com.google.gerrit.reviewdb.client.AccountGeneralPreferences.ChangeScreen ui = null ; if ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) { ui = com.google.gerrit.client.Gerrit.getUserAccount ( ) . getGeneralPreferences ( ) . getChangeScreen ( ) ; } if ( ui == null ) { ui = com.google.gerrit.client.Gerrit.getConfig ( ) . getChangeScreen ( ) ; } return ui == ( com.google.gerrit.client.changes.ChangeScreen.CHANGE_SCREEN2 ) ; }
Source:
private static java.lang.String getParameter ( java.lang.String name ) { java.util.List < java.lang.String > values = com.googlesource.gerrit.plugins.imagare.client.ImageUploadScreen.getParameters ( ) . get ( name ) ; if ( values == null ) { return null ; } else { return values.get ( ( ( values.size ( ) ) - 1 ) ) ; } }

Target:
private static java.lang.String getParameter ( java.lang.String name ) { java.util.List < java.lang.String > values = com.googlesource.gerrit.plugins.imagare.client.ImageUploadScreen.getParameters ( ) . get ( name ) ; if ( values == null ) { return null ; } return values.get ( ( ( values.size ( ) ) - 1 ) ) ; }
Source:
public void commentOnReviewableChangeByReviewerCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; review ( sc.reviewer , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "comment" , sc ) . to ( sc.owner ) . to ( sc.reviewerByEmail ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void commentOnReviewableChangeByReviewerCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; review ( sc.reviewer , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "comment" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }
Source:
protected void configureServlets ( ) { install ( new com.google.gerrit.server.config.FactoryModule ( ) { @ java.lang.Override protected void configure ( ) { factory ( PatchScriptFactory.Factory.class ) ; factory ( SaveDraft.Factory.class ) ; } } ) ; bind ( com.google.gerrit.httpd.rpc.patch.PatchScriptBuilder.class ) ; rpc ( com.google.gerrit.httpd.rpc.patch.PatchDetailServiceImpl.class ) ; }

Target:
protected void configureServlets ( ) { install ( new com.google.gerrit.server.config.FactoryModule ( ) { @ java.lang.Override protected void configure ( ) { factory ( SaveDraft.Factory.class ) ; } } ) ; rpc ( com.google.gerrit.httpd.rpc.patch.PatchDetailServiceImpl.class ) ; }
Source:
public void start ( ) { if ( ( delay ) > 0 ) { handle = submit.create ( ) . startWithFixedDelay ( com.google.gerrit.server.config.MasterNodeStartup.Lifecycle.INITIAL_DELAY_S , delay , java.util.concurrent.TimeUnit.SECONDS ) ; } else { handle = submit.create ( ) . start ( com.google.gerrit.server.config.MasterNodeStartup.Lifecycle.INITIAL_DELAY_S , java.util.concurrent.TimeUnit.SECONDS ) ; } }

Target:
public void start ( ) { if ( ( delay ) > 0 ) { handle = submit.startWithFixedDelay ( com.google.gerrit.server.config.MasterNodeStartup.Lifecycle.INITIAL_DELAY_S , delay , java.util.concurrent.TimeUnit.SECONDS ) ; } else { handle = submit.start ( com.google.gerrit.server.config.MasterNodeStartup.Lifecycle.INITIAL_DELAY_S , java.util.concurrent.TimeUnit.SECONDS ) ; } }
Source:
public java.lang.String toBranch ( final com.google.gerrit.client.reviewdb.Branch.NameKey branch ) { final java.lang.StringBuffer r = new java.lang.StringBuffer ( ) ; com.google.gerrit.client.data.GitwebLink.p ( r , branch.getParentKey ( ) ) ; com.google.gerrit.client.data.GitwebLink.h ( r , branch ) ; com.google.gerrit.client.data.GitwebLink.a ( r , "shortlog" ) ; return ( baseUrl ) + r ; }

Target:
public java.lang.String toBranch ( final com.google.gerrit.client.reviewdb.Branch.NameKey branch ) { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; com.google.gerrit.client.data.GitwebLink.p ( r , branch.getParentKey ( ) ) ; com.google.gerrit.client.data.GitwebLink.h ( r , branch ) ; com.google.gerrit.client.data.GitwebLink.a ( r , "shortlog" ) ; return ( baseUrl ) + r ; }
Source:
protected void run ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { boolean ok = true ; for ( com.google.gerrit.server.change.ChangeResource rsrc : changes.values ( ) ) { try { index.apply ( rsrc , new com.google.gerrit.server.change.Index.Input ( ) ) ; } catch ( java.io.IOException | com.google.gerrit.extensions.restapi.RestApiException | com.google.gwtorm.server.OrmException | com.google.gerrit.server.permissions.PermissionBackendException e ) { ok = false ; writeError ( "error" , java.lang.String.format ( "failed to index change %s: %s" , rsrc.getId ( ) , e.getMessage ( ) ) ) ; } } if ( ! ok ) { throw die ( "failed to index one or more changes" ) ; } }

Target:
protected void run ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { boolean ok = true ; for ( com.google.gerrit.server.change.ChangeResource rsrc : changes.values ( ) ) { try { index.apply ( rsrc , new com.google.gerrit.server.change.Index.Input ( ) ) ; } catch ( java.lang.Exception e ) { ok = false ; writeError ( "error" , java.lang.String.format ( "failed to index change %s: %s" , rsrc.getId ( ) , e.getMessage ( ) ) ) ; } } if ( ! ok ) { throw die ( "failed to index one or more changes" ) ; } }
Source:
public void start ( ) { org.eclipse.jgit.transport.SshSessionFactory.setInstance ( new org.eclipse.jgit.transport.JschConfigSessionFactory ( ) { @ java.lang.Override protected void configure ( org.eclipse.jgit.transport.OpenSshConfig.Host hc , com.jcraft.jsch.Session session ) { } } ) ; final org.eclipse.jgit.storage.file.WindowCacheConfig c = new org.eclipse.jgit.storage.file.WindowCacheConfig ( ) ; c.fromConfig ( cfg ) ; org.eclipse.jgit.storage.file.WindowCache.reconfigure ( c ) ; }

Target:
public void start ( ) { final org.eclipse.jgit.storage.file.WindowCacheConfig c = new org.eclipse.jgit.storage.file.WindowCacheConfig ( ) ; c.fromConfig ( cfg ) ; org.eclipse.jgit.storage.file.WindowCache.reconfigure ( c ) ; }
Source:
private boolean canRebase ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { return ( ( ( ( ( isOwner ( ) ) || ( refControl.canSubmit ( isOwner ( ) ) ) ) || ( refControl.canRebase ( ) ) ) && ( refControl.asForRef ( ) . testOrFalse ( RefPermission.CREATE_CHANGE ) ) ) && ( getProjectControl ( ) . getProjectState ( ) . statePermitsWrite ( ) ) ) && ( ! ( isPatchSetLocked ( db ) ) ) ; }

Target:
private boolean canRebase ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { return ( ( ( ( isOwner ( ) ) || ( refControl.canSubmit ( isOwner ( ) ) ) ) || ( refControl.canRebase ( ) ) ) && ( refControl.asForRef ( ) . testOrFalse ( RefPermission.CREATE_CHANGE ) ) ) && ( ! ( isPatchSetLocked ( db ) ) ) ; }
Source:
public com.google.gitiles.GitilesView.Builder setOldRevision ( com.google.gitiles.Revision revision ) { switch ( type ) { case DIFF : case LOG : this . oldRevision = revision ; break ; default : com.google.common.base.Preconditions.checkState ( ( revision == null ) , "cannot set old revision on %s view" , type ) ; this . oldRevision = revision ; break ; } return this ; }

Target:
public com.google.gitiles.GitilesView.Builder setOldRevision ( com.google.gitiles.Revision revision ) { switch ( type ) { case DIFF : case LOG : break ; default : com.google.common.base.Preconditions.checkState ( ( revision == null ) , "cannot set old revision on %s view" , type ) ; break ; } this . oldRevision = revision ; return this ; }
Source:
public com.google.gerrit.reviewdb.client.Change update ( com.google.gerrit.reviewdb.client.Change change ) { if ( ( change.getStatus ( ) . isOpen ( ) ) && ( change.currentPatchSetId ( ) . equals ( patchSetId ) ) ) { change.setStatus ( Change.Status.ABANDONED ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; return change ; } else { return null ; } }

Target:
public com.google.gerrit.reviewdb.client.Change update ( com.google.gerrit.reviewdb.client.Change change ) { if ( change.getStatus ( ) . isOpen ( ) ) { change.setStatus ( Change.Status.ABANDONED ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; return change ; } else { return null ; } }
Source:
private static java.lang.String getVersion ( java.nio.file.Path plugin ) throws java.io.IOException { java.util.jar.JarFile jarFile = new java.util.jar.JarFile ( plugin.toFile ( ) ) ; try { java.util.jar.Manifest manifest = jarFile.getManifest ( ) ; java.util.jar.Attributes main = manifest.getMainAttributes ( ) ; return main.getValue ( java.util.jar.Attributes.Name.IMPLEMENTATION_VERSION ) ; } finally { jarFile.close ( ) ; } }

Target:
private static java.lang.String getVersion ( java.nio.file.Path plugin ) throws java.io.IOException { try ( java.util.jar.JarFile jarFile = new java.util.jar.JarFile ( plugin.toFile ( ) ) ) { java.util.jar.Manifest manifest = jarFile.getManifest ( ) ; java.util.jar.Attributes main = manifest.getMainAttributes ( ) ; return main.getValue ( java.util.jar.Attributes.Name.IMPLEMENTATION_VERSION ) ; } }
Source:
public void delete ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { deleteDraft.get ( ) . apply ( revision , null ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot delete draft ps" , e ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot delete draft ps" , e ) ; } }

Target:
public void delete ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { deleteDraft.get ( ) . apply ( revision , null ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot delete draft ps" , e ) ; } }
Source:
public void testCreateProjectWithGitSuffix ( ) throws java.lang.Exception { final java.lang.String newProjectName = "newProject" ; com.google.gerrit.extensions.common.ProjectInfo p = gApi.projects ( ) . create ( ( newProjectName + ".git" ) ) . get ( ) ; com.google.common.truth.Truth.assertThat ( p.name ) . isEqualTo ( newProjectName ) ; com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( new com.google.gerrit.reviewdb.client.Project.NameKey ( newProjectName ) ) ; com.google.common.truth.Truth.assertThat ( projectState ) . isNotNull ( ) ; com.google.gerrit.acceptance.rest.project.ProjectAssert.assertProjectInfo ( projectState.getProject ( ) , p ) ; assertHead ( newProjectName , "refs/heads/master" ) ; }

Target:
public void testCreateProjectWithGitSuffix ( ) throws java.lang.Exception { java.lang.String newProjectName = name ( "newProject" ) ; com.google.gerrit.extensions.common.ProjectInfo p = gApi.projects ( ) . create ( ( newProjectName + ".git" ) ) . get ( ) ; com.google.common.truth.Truth.assertThat ( p.name ) . isEqualTo ( newProjectName ) ; com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( new com.google.gerrit.reviewdb.client.Project.NameKey ( newProjectName ) ) ; com.google.common.truth.Truth.assertThat ( projectState ) . isNotNull ( ) ; com.google.gerrit.acceptance.rest.project.ProjectAssert.assertProjectInfo ( projectState.getProject ( ) , p ) ; assertHead ( newProjectName , "refs/heads/master" ) ; }
Source:
protected void configure ( ) { install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . implement ( com.google.gerrit.server.index.change.ChangeIndex.class , com.google.gerrit.lucene.LuceneChangeIndex.class ) . build ( ChangeIndex.Factory.class ) ) ; install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . implement ( com.google.gerrit.server.index.account.AccountIndex.class , com.google.gerrit.lucene.LuceneAccountIndex.class ) . build ( AccountIndex.Factory.class ) ) ; install ( new com.google.gerrit.server.index.IndexModule ( threads ) ) ; if ( ( singleVersions ) == null ) { install ( new com.google.gerrit.lucene.LuceneIndexModule.MultiVersionModule ( ) ) ; } else { install ( new com.google.gerrit.lucene.LuceneIndexModule.SingleVersionModule ( ) ) ; } }

Target:
protected void configure ( ) { install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . implement ( com.google.gerrit.server.index.change.ChangeIndex.class , com.google.gerrit.lucene.LuceneChangeIndex.class ) . build ( ChangeIndex.Factory.class ) ) ; install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . implement ( com.google.gerrit.server.index.account.AccountIndex.class , com.google.gerrit.lucene.LuceneAccountIndex.class ) . build ( AccountIndex.Factory.class ) ) ; install ( new com.google.gerrit.server.index.IndexModule ( threads ) ) ; if ( ( singleVersions ) == null ) { install ( new com.google.gerrit.lucene.LuceneIndexModule.MultiVersionModule ( ) ) ; } else { install ( new com.google.gerrit.lucene.LuceneIndexModule.SingleVersionModule ( singleVersions ) ) ; } }
Source:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.client.OrmException { if ( cd.fastIsVisibleTo ( user ) ) { return true ; } try { com.google.gerrit.reviewdb.Change c = cd.change ( db ) ; if ( ( c != null ) && ( changeControl.controlFor ( c , user ) . isVisible ( ) ) ) { cd.cacheVisibleTo ( user ) ; return true ; } else { return false ; } } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { return false ; } }

Target:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.client.OrmException { if ( cd.fastIsVisibleTo ( user ) ) { return true ; } try { com.google.gerrit.reviewdb.Change c = cd.change ( db ) ; if ( ( c != null ) && ( changeControl.controlFor ( c , user ) . isVisible ( db.get ( ) ) ) ) { cd.cacheVisibleTo ( user ) ; return true ; } else { return false ; } } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { return false ; } }
Source:
public static void deleteDraftChange ( com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId , com.google.gerrit.server.git.GitRepositoryManager gitManager , com.google.gerrit.server.extensions.events.GitReferenceUpdated gitRefUpdated , com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.index.ChangeIndexer indexer ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { final com.google.gerrit.reviewdb.client.Change.Id changeId = patchSetId.getParentKey ( ) ; com.google.gerrit.server.ChangeUtil.deleteDraftChange ( changeId , gitManager , gitRefUpdated , db , indexer ) ; }

Target:
public void deleteDraftChange ( com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { deleteDraftChange ( patchSetId.getParentKey ( ) ) ; }
Source:
public int compareTo ( com.googlecode.prolog_cafe.lang.Term anotherTerm ) { if ( ! ( anotherTerm.isClosure ( ) ) ) return AFTER ; if ( code.equals ( ( ( com.googlecode.prolog_cafe.lang.ClosureTerm ) ( anotherTerm ) ) . code ) ) return EQUAL ; return ( code.hashCode ( ) ) - ( ( ( com.googlecode.prolog_cafe.lang.ClosureTerm ) ( anotherTerm ) ) . code.hashCode ( ) ) ; }

Target:
public int compareTo ( com.googlecode.prolog_cafe.lang.Term anotherTerm ) { if ( ! ( anotherTerm instanceof com.googlecode.prolog_cafe.lang.ClosureTerm ) ) return AFTER ; if ( code.equals ( ( ( com.googlecode.prolog_cafe.lang.ClosureTerm ) ( anotherTerm ) ) . code ) ) return EQUAL ; return ( code.hashCode ( ) ) - ( ( ( com.googlecode.prolog_cafe.lang.ClosureTerm ) ( anotherTerm ) ) . code.hashCode ( ) ) ; }
Source:
public java.lang.String toRevision ( final com.google.gerrit.client.reviewdb.Project.NameKey project , final com.google.gerrit.client.reviewdb.PatchSet ps ) { final java.lang.StringBuffer r = new java.lang.StringBuffer ( ) ; com.google.gerrit.client.data.GitwebLink.p ( r , project ) ; com.google.gerrit.client.data.GitwebLink.h ( r , ps ) ; return ( baseUrl ) + r ; }

Target:
public java.lang.String toRevision ( final com.google.gerrit.client.reviewdb.Project.NameKey project , final com.google.gerrit.client.reviewdb.PatchSet ps ) { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; com.google.gerrit.client.data.GitwebLink.p ( r , project ) ; com.google.gerrit.client.data.GitwebLink.h ( r , ps ) ; return ( baseUrl ) + r ; }
Source:
private boolean add ( com.google.gerrit.server.mail.ProjectWatch.Watchers matching , com.google.gerrit.reviewdb.client.AccountProjectWatch w , com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType type ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.IdentifiedUser user = args.identifiedUserFactory.create ( args.db , w.getAccountId ( ) ) ; try { if ( filterMatch ( user , w.getFilter ( ) ) ) { if ( w.isNotify ( type ) ) { matching.bcc.accounts.add ( w.getAccountId ( ) ) ; } return true ; } } catch ( com.google.gerrit.server.query.QueryParseException e ) { } return false ; }

Target:
private boolean add ( com.google.gerrit.server.mail.ProjectWatch.Watchers matching , com.google.gerrit.reviewdb.client.AccountProjectWatch w , com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType type ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.IdentifiedUser user = args.identifiedUserFactory.create ( w.getAccountId ( ) ) ; try { if ( filterMatch ( user , w.getFilter ( ) ) ) { if ( w.isNotify ( type ) ) { matching.bcc.accounts.add ( w.getAccountId ( ) ) ; } return true ; } } catch ( com.google.gerrit.server.query.QueryParseException e ) { } return false ; }
Source:
public synchronized void init ( javax.servlet.ServletConfig config ) throws javax.servlet.ServletException { super . init ( config ) ; java.lang.String path = config.getServletContext ( ) . getContextPath ( ) ; base = ( com.google.common.base.Strings.nullToEmpty ( path ) ) + "/plugins/" ; for ( com.google.gerrit.server.plugins.Plugin plugin : pending ) { com.google.inject.servlet.GuiceFilter filter = load ( plugin ) ; if ( filter != null ) { plugins.put ( plugin.getName ( ) , filter ) ; } } pending = null ; }

Target:
public synchronized void init ( javax.servlet.ServletConfig config ) throws javax.servlet.ServletException { super . init ( config ) ; java.lang.String path = config.getServletContext ( ) . getContextPath ( ) ; base = ( com.google.common.base.Strings.nullToEmpty ( path ) ) + "/plugins/" ; for ( com.google.gerrit.server.plugins.Plugin plugin : pending ) { install ( plugin ) ; } pending = null ; }
Source:
private org.eclipse.jgit.revwalk.RevCommit writeCommit ( java.lang.String body , boolean initWorkInProgress ) throws java.lang.Exception { com.google.gerrit.server.notedb.ChangeNoteUtil noteUtil = injector.getInstance ( com.google.gerrit.server.notedb.ChangeNoteUtil.class ) ; return writeCommit ( body , noteUtil.newIdent ( changeOwner.getAccount ( ) , com.google.gerrit.common.TimeUtil.nowTs ( ) , serverIdent , "Anonymous Coward" ) , initWorkInProgress ) ; }

Target:
private org.eclipse.jgit.revwalk.RevCommit writeCommit ( java.lang.String body , boolean initWorkInProgress ) throws java.lang.Exception { com.google.gerrit.server.notedb.ChangeNoteUtil noteUtil = injector.getInstance ( com.google.gerrit.server.notedb.ChangeNoteUtil.class ) ; return writeCommit ( body , noteUtil.newIdent ( changeOwner.getAccount ( ) , com.google.gerrit.common.TimeUtil.nowTs ( ) , serverIdent ) , initWorkInProgress ) ; }
Source:
private void insertDummyApproval ( final com.google.gerrit.reviewdb.Change change , final com.google.gerrit.reviewdb.PatchSet.Id psId , final com.google.gerrit.reviewdb.Account.Id forAccount , final com.google.gerrit.reviewdb.ApprovalCategory.Id catId , final com.google.gerrit.reviewdb.ReviewDb db , final com.google.gwtorm.client.Transaction txn ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.reviewdb.PatchSetApproval ca = new com.google.gerrit.reviewdb.PatchSetApproval ( new com.google.gerrit.reviewdb.PatchSetApproval.Key ( psId , forAccount , catId ) , ( ( short ) ( 0 ) ) ) ; ca.cache ( change ) ; db.patchSetApprovals ( ) . insert ( java.util.Collections.singleton ( ca ) , txn ) ; }

Target:
private void insertDummyApproval ( final com.google.gerrit.reviewdb.Change change , final com.google.gerrit.reviewdb.PatchSet.Id psId , final com.google.gerrit.reviewdb.Account.Id forAccount , final com.google.gerrit.reviewdb.ApprovalCategory.Id catId , final com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.reviewdb.PatchSetApproval ca = new com.google.gerrit.reviewdb.PatchSetApproval ( new com.google.gerrit.reviewdb.PatchSetApproval.Key ( psId , forAccount , catId ) , ( ( short ) ( 0 ) ) ) ; ca.cache ( change ) ; db.patchSetApprovals ( ) . insert ( java.util.Collections.singleton ( ca ) ) ; }
Source:
public void doFilter ( javax.servlet.ServletRequest request , javax.servlet.ServletResponse response , javax.servlet.FilterChain chain ) throws java.io.IOException , javax.servlet.ServletException { javax.servlet.http.HttpServletRequest req = ( ( javax.servlet.http.HttpServletRequest ) ( request ) ) ; if ( ! ( org.eclipse.jgit.http.server.GitSmartHttpTools.isGitClient ( req ) ) ) { chain.doFilter ( request , response ) ; return ; } com.google.gerrit.httpd.ProjectDigestFilter.Response rsp = new com.google.gerrit.httpd.ProjectDigestFilter.Response ( req , ( ( javax.servlet.http.HttpServletResponse ) ( response ) ) ) ; if ( verify ( req , rsp ) ) { chain.doFilter ( req , rsp ) ; } }

Target:
public void doFilter ( javax.servlet.ServletRequest request , javax.servlet.ServletResponse response , javax.servlet.FilterChain chain ) throws java.io.IOException , javax.servlet.ServletException { javax.servlet.http.HttpServletRequest req = ( ( javax.servlet.http.HttpServletRequest ) ( request ) ) ; com.google.gerrit.httpd.ProjectDigestFilter.Response rsp = new com.google.gerrit.httpd.ProjectDigestFilter.Response ( req , ( ( javax.servlet.http.HttpServletResponse ) ( response ) ) ) ; if ( verify ( req , rsp ) ) { chain.doFilter ( req , rsp ) ; } }
Source:
private java.util.List < com.google.gerrit.extensions.common.ProjectInfo > getChildProjectsRecursively ( com.google.gerrit.server.project.ProjectNode p ) { java.util.List < com.google.gerrit.extensions.common.ProjectInfo > allChildren = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.server.project.ProjectNode c : p.getChildren ( ) ) { if ( c.isVisible ( ) ) { allChildren.add ( json.format ( c.getProject ( ) ) ) ; allChildren.addAll ( getChildProjectsRecursively ( c ) ) ; } } return allChildren ; }

Target:
private java.util.List < com.google.gerrit.extensions.common.ProjectInfo > getChildProjectsRecursively ( com.google.gerrit.server.project.ProjectNode p ) { java.util.List < com.google.gerrit.extensions.common.ProjectInfo > allChildren = new java.util.ArrayList < > ( ) ; for ( com.google.gerrit.server.project.ProjectNode c : p.getChildren ( ) ) { if ( c.isVisible ( ) ) { allChildren.add ( json.format ( c.getProject ( ) ) ) ; allChildren.addAll ( getChildProjectsRecursively ( c ) ) ; } } return allChildren ; }
Source:
public static void restore ( int id , java.lang.String msg , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.ChangeInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.MessageInput input = com.google.gerrit.client.changes.ChangeApi.MessageInput.create ( ) ; input.message ( com.google.gerrit.client.changes.ChangeApi.emptyToNull ( msg ) ) ; com.google.gerrit.client.changes.ChangeApi.call ( id , "restore" ) . post ( input , cb ) ; }

Target:
public static void restore ( @ com.google.gerrit.common.Nullable java.lang.String project , int id , java.lang.String msg , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.ChangeInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.MessageInput input = com.google.gerrit.client.changes.ChangeApi.MessageInput.create ( ) ; input.message ( com.google.gerrit.client.changes.ChangeApi.emptyToNull ( msg ) ) ; com.google.gerrit.client.changes.ChangeApi.call ( project , id , "restore" ) . post ( input , cb ) ; }
Source:
private void assertCreateFails ( com.google.gerrit.extensions.api.projects.ProjectInput in , java.lang.Class < ? extends com.google.gerrit.extensions.restapi.RestApiException > errType ) throws java.lang.Exception { { gApi.projects ( ) . create ( in ) ; org.junit.Assert.fail ( ( "Expected " + ( errType.getSimpleName ( ) ) ) ) ; } com.google.common.truth.Truth.assertThat ( expected ) . isInstanceOf ( errType ) ; BRANCH ( 75 ) ; com.google.gerrit.acceptance.rest.project.b519 Merge ; }

Target:
private void assertCreateFails ( com.google.gerrit.extensions.api.projects.ProjectInput in , java.lang.Class < ? extends com.google.gerrit.extensions.restapi.RestApiException > errType ) throws java.lang.Exception { try { gApi.projects ( ) . create ( in ) ; org.junit.Assert.fail ( ( "Expected " + ( errType.getSimpleName ( ) ) ) ) ; } catch ( com.google.gerrit.extensions.restapi.RestApiException expected ) { com.google.common.truth.Truth.assertThat ( expected ) . isInstanceOf ( errType ) ; } }
Source:
private java.lang.String getSortValue ( ) { if ( ( accountInfo ) != null ) { if ( ( accountInfo.getPreferredEmail ( ) ) != null ) { return accountInfo.getPreferredEmail ( ) ; } return accountInfo.getFullName ( ) . toString ( ) ; } return groupReference.getName ( ) ; }

Target:
private java.lang.String getSortValue ( ) { if ( ( accountInfo ) != null ) { if ( ( accountInfo.getPreferredEmail ( ) ) != null ) { return accountInfo.getPreferredEmail ( ) ; } return accountInfo.getFullName ( ) ; } return groupReference.getName ( ) ; }
Source:
public java.lang.Iterable < com.google.gerrit.server.plugins.Plugin > getPlugins ( boolean all ) { if ( ! all ) { return running.values ( ) ; } else { java.util.List < com.google.gerrit.server.plugins.Plugin > plugins = new java.util.ArrayList ( running.values ( ) ) ; plugins.addAll ( disabled.values ( ) ) ; return plugins ; } }

Target:
public java.lang.Iterable < com.google.gerrit.server.plugins.Plugin > getPlugins ( boolean all ) { if ( ! all ) { return running.values ( ) ; } java.util.List < com.google.gerrit.server.plugins.Plugin > plugins = new java.util.ArrayList ( running.values ( ) ) ; plugins.addAll ( disabled.values ( ) ) ; return plugins ; }
Source:
private void appendLineNone ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m ) { m.openTd ( ) ; m.setStyleName ( "LineNumber" ) ; m.nbsp ( ) ; m.closeTd ( ) ; m.openTd ( ) ; m.addStyleName ( "FileLine" ) ; m.addStyleName ( "FileLineNone" ) ; m.nbsp ( ) ; m.closeTd ( ) ; }

Target:
private void appendLineNone ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m ) { m.openTd ( ) ; m.setStyleName ( "LineNumber" ) ; m.closeTd ( ) ; m.openTd ( ) ; m.addStyleName ( "FileLine" ) ; m.addStyleName ( "FileLineNone" ) ; m.closeTd ( ) ; }
Source:
public void set ( com.google.gerrit.client.DiffObject base , com.google.gerrit.reviewdb.client.PatchSet.Id curr , com.google.gerrit.client.change.ChangeScreen.Style style , com.google.gwt.user.client.ui.Widget replyButton , com.google.gerrit.client.change.FileTable.Mode mode , boolean editExists ) { this . base = base ; this . curr = curr ; this . style = style ; this . replyButton = replyButton ; this . mode = mode ; this . editExists = editExists ; }

Target:
public void set ( com.google.gerrit.client.DiffObject base , com.google.gerrit.reviewdb.client.PatchSet.Id curr , com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.client.change.ChangeScreen.Style style , com.google.gwt.user.client.ui.Widget replyButton , com.google.gerrit.client.change.FileTable.Mode mode , boolean editExists ) { this . base = base ; this . curr = curr ; this . project = project ; this . style = style ; this . replyButton = replyButton ; this . mode = mode ; this . editExists = editExists ; }
Source:
protected org.eclipse.jgit.lib.CommitBuilder applyImpl ( org.eclipse.jgit.lib.ObjectInserter ins ) throws com.google.gwtorm.server.OrmException , java.io.IOException { org.eclipse.jgit.lib.CommitBuilder cb = new org.eclipse.jgit.lib.CommitBuilder ( ) ; cb.setAuthor ( newAuthorIdent ( ) ) ; cb.setCommitter ( new org.eclipse.jgit.lib.PersonIdent ( serverIdent , when ) ) ; cb.setMessage ( "Update draft comments" ) ; java.util.concurrent.atomic.AtomicBoolean removedAllComments = new java.util.concurrent.atomic.AtomicBoolean ( ) ; org.eclipse.jgit.lib.ObjectId treeId = storeCommentsInNotes ( ins , removedAllComments ) ; if ( removedAllComments.get ( ) ) { return null ; } cb.setTreeId ( com.google.common.base.Preconditions.checkNotNull ( treeId ) ) ; return cb ; }

Target:
protected org.eclipse.jgit.lib.CommitBuilder applyImpl ( org.eclipse.jgit.lib.ObjectInserter ins ) throws com.google.gwtorm.server.OrmException , java.io.IOException { org.eclipse.jgit.lib.CommitBuilder cb = new org.eclipse.jgit.lib.CommitBuilder ( ) ; cb.setMessage ( "Update draft comments" ) ; java.util.concurrent.atomic.AtomicBoolean removedAllComments = new java.util.concurrent.atomic.AtomicBoolean ( ) ; org.eclipse.jgit.lib.ObjectId treeId = storeCommentsInNotes ( ins , removedAllComments ) ; if ( removedAllComments.get ( ) ) { return null ; } cb.setTreeId ( com.google.common.base.Preconditions.checkNotNull ( treeId ) ) ; return cb ; }
Source:
private java.lang.String getSettingsUrl ( ) { if ( ( getGerritUrl ( ) ) != null ) { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( getGerritUrl ( ) ) ; r.append ( "settings" ) ; return r.toString ( ) ; } return null ; }

Target:
public java.lang.String getSettingsUrl ( ) { if ( ( getGerritUrl ( ) ) != null ) { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( getGerritUrl ( ) ) ; r.append ( "settings" ) ; return r.toString ( ) ; } return null ; }
Source:
public void onLoad ( ) { super . onLoad ( ) ; Util.LIST_SVC.forAccount ( ownerId , new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.data.AccountDashboardInfo > ( ) { public void onSuccess ( final com.google.gerrit.client.data.AccountDashboardInfo r ) { byOwner.display ( r.getByOwner ( ) ) ; forReview.display ( r.getForReview ( ) ) ; closed.display ( r.getClosed ( ) ) ; } public void onFailure ( final java.lang.Throwable caught ) { com.google.gwt.core.client.GWT.log ( "Fail" , caught ) ; } } ) ; }

Target:
public void onLoad ( ) { super . onLoad ( ) ; Util.LIST_SVC.forAccount ( ownerId , new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.data.AccountDashboardInfo > ( ) { public void onSuccess ( final com.google.gerrit.client.data.AccountDashboardInfo r ) { display ( r ) ; } public void onFailure ( final java.lang.Throwable caught ) { com.google.gwt.core.client.GWT.log ( "Fail" , caught ) ; } } ) ; }
Source:
public void testSubsequentGetReads ( ) throws com.google.gwtorm.client.OrmException { db.create ( ) ; final com.google.gerrit.reviewdb.SystemConfig exp = db.getSystemConfig ( ) ; final com.google.gerrit.reviewdb.SystemConfig act = db.getSystemConfig ( ) ; assertNotSame ( exp , act ) ; assertEquals ( exp.adminGroupId , act.adminGroupId ) ; assertEquals ( exp.anonymousGroupId , act.anonymousGroupId ) ; assertEquals ( exp.registeredGroupId , act.registeredGroupId ) ; assertEquals ( exp.sitePath , act.sitePath ) ; assertEquals ( exp.registerEmailPrivateKey , act.registerEmailPrivateKey ) ; }

Target:
public void testSubsequentGetReads ( ) throws com.google.gwtorm.client.OrmException { db.create ( ) ; final com.google.gerrit.reviewdb.SystemConfig exp = db.getSystemConfig ( ) ; final com.google.gerrit.reviewdb.SystemConfig act = db.getSystemConfig ( ) ; assertNotSame ( exp , act ) ; assertEquals ( exp.sitePath , act.sitePath ) ; assertEquals ( exp.registerEmailPrivateKey , act.registerEmailPrivateKey ) ; }
Source:
private boolean can ( com.google.gerrit.server.permissions.ProjectPermission perm ) throws com.google.gerrit.server.permissions.PermissionBackendException { switch ( perm ) { case ACCESS : return ( ( ! ( isHidden ( ) ) ) && ( ( user.isInternalUser ( ) ) || ( canPerformOnAnyRef ( Permission.READ ) ) ) ) || ( isOwner ( ) ) ; case READ : return ( ( ! ( isHidden ( ) ) ) && ( allRefsAreVisible ( java.util.Collections.emptySet ( ) ) ) ) || ( isOwner ( ) ) ; } throw new com.google.gerrit.server.permissions.PermissionBackendException ( ( perm + " unsupported" ) ) ; }

Target:
private boolean can ( com.google.gerrit.server.permissions.ProjectPermission perm ) throws com.google.gerrit.server.permissions.PermissionBackendException { switch ( perm ) { case ACCESS : return ( ( ! ( isHidden ( ) ) ) && ( ( user.isInternalUser ( ) ) || ( canPerformOnAnyRef ( Permission.READ ) ) ) ) || ( isOwner ( ) ) ; case READ : return ( ! ( isHidden ( ) ) ) && ( allRefsAreVisible ( java.util.Collections.emptySet ( ) ) ) ; } throw new com.google.gerrit.server.permissions.PermissionBackendException ( ( perm + " unsupported" ) ) ; }
Source:
public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { save.setEnabled ( false ) ; final com.google.gerrit.client.reviewdb.Account me = com.google.gerrit.client.Gerrit.getUserAccount ( ) ; me.setFullName ( newName ) ; me.setPreferredEmail ( newEmail ) ; me.setContactInformation ( info ) ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; parentScreen.display ( me ) ; }

Target:
public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { save.setEnabled ( false ) ; final com.google.gerrit.client.reviewdb.Account me = com.google.gerrit.client.Gerrit.getUserAccount ( ) ; me.setFullName ( newName ) ; me.setPreferredEmail ( newEmail ) ; me.setContactInformation ( info ) ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; if ( ( parentScreen ) != null ) { parentScreen.display ( me ) ; } }
Source:
public void run ( ) { try { final com.google.gerrit.server.mail.MergedSender cm = mergedSenderFactory.create ( result.changeCtl ) ; cm.setFrom ( currentUser.getAccountId ( ) ) ; cm.setPatchSet ( result.newPatchSet , result.info ) ; cm.send ( ) ; } catch ( java.lang.Exception e ) { final com.google.gerrit.reviewdb.client.PatchSet.Id psi = result.newPatchSet.getId ( ) ; com.google.gerrit.server.git.ReceiveCommits.log.error ( ( "Cannot send email for submitted patch set " + psi ) , e ) ; } }

Target:
public void run ( ) { try { final com.google.gerrit.server.mail.MergedSender cm = mergedSenderFactory.create ( id ) ; cm.setFrom ( currentUser.getAccountId ( ) ) ; cm.setPatchSet ( result.newPatchSet , result.info ) ; cm.send ( ) ; } catch ( java.lang.Exception e ) { final com.google.gerrit.reviewdb.client.PatchSet.Id psi = result.newPatchSet.getId ( ) ; com.google.gerrit.server.git.ReceiveCommits.log.error ( ( "Cannot send email for submitted patch set " + psi ) , e ) ; } }
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.release ( ) ; reader = null ; } }

Target:
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 ; } }
Source:
protected synchronized void startThread ( final com.google.gerrit.sshd.BaseCommand.CommandRunnable thunk ) { final com.google.gerrit.sshd.BaseCommand.TaskThunk tt = new com.google.gerrit.sshd.BaseCommand.TaskThunk ( thunk ) ; if ( ( isAdminCommand ( ) ) || ( ( isAdminHighPriorityCommand ( ) ) && ( userProvider.get ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) ) { new java.lang.Thread ( tt , tt.toString ( ) ) . start ( ) ; } else { task = executor.submit ( tt ) ; } }

Target:
protected synchronized void startThread ( final com.google.gerrit.sshd.BaseCommand.CommandRunnable thunk ) { final com.google.gerrit.sshd.BaseCommand.TaskThunk tt = new com.google.gerrit.sshd.BaseCommand.TaskThunk ( thunk ) ; if ( ( isAdminHighPriorityCommand ( ) ) && ( userProvider.get ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) { new java.lang.Thread ( tt , tt.toString ( ) ) . start ( ) ; } else { task = executor.submit ( tt ) ; } }
Source:
private com.google.gerrit.extensions.common.CommitInfo getCommit ( org.eclipse.jgit.lib.ObjectId id ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = userSession.get ( ( ( ( "/projects/" + ( project.get ( ) ) ) + "/commits/" ) + ( id.name ( ) ) ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; com.google.gerrit.extensions.common.CommitInfo result = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.CommitInfo.class ) ; r.consume ( ) ; return result ; }

Target:
private com.google.gerrit.extensions.common.CommitInfo getCommit ( 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_OK ) ; com.google.gerrit.extensions.common.CommitInfo result = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.CommitInfo.class ) ; r.consume ( ) ; return result ; }
Source:
protected static java.lang.Iterable < java.lang.Integer > ids ( com.google.gerrit.extensions.common.AccountInfo ... accounts ) { return com.google.common.collect.FluentIterable.from ( java.util.Arrays.asList ( accounts ) ) . transform ( new com.google.common.base.Function < com.google.gerrit.extensions.common.AccountInfo , java.lang.Integer > ( ) { @ java.lang.Override public java.lang.Integer apply ( com.google.gerrit.extensions.common.AccountInfo in ) { return in._accountId ; } } ) ; }

Target:
protected static java.lang.Iterable < java.lang.Integer > ids ( java.lang.Iterable < com.google.gerrit.extensions.common.AccountInfo > accounts ) { return com.google.common.collect.FluentIterable.from ( accounts ) . transform ( new com.google.common.base.Function < com.google.gerrit.extensions.common.AccountInfo , java.lang.Integer > ( ) { @ java.lang.Override public java.lang.Integer apply ( com.google.gerrit.extensions.common.AccountInfo in ) { return in._accountId ; } } ) ; }
Source:
public void treeAndBlobTime ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevBlob blob = repo.blob ( "contents" ) ; org.eclipse.jgit.revwalk.RevTree tree = repo.tree ( repo.file ( "foo" , blob ) ) ; org.junit.Assert.assertEquals ( java.lang.Long.MIN_VALUE , getTime ( blob ) ) ; org.junit.Assert.assertEquals ( java.lang.Long.MIN_VALUE , getTime ( tree ) ) ; }

Target:
public void treeAndBlobTime ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevBlob blob = repo.blob ( "contents" ) ; org.eclipse.jgit.revwalk.RevTree tree = repo.tree ( repo.file ( "foo" , blob ) ) ; com.google.common.truth.Truth.assertThat ( getTime ( blob ) ) . isEqualTo ( java.lang.Long.MIN_VALUE ) ; com.google.common.truth.Truth.assertThat ( getTime ( tree ) ) . isEqualTo ( java.lang.Long.MIN_VALUE ) ; }
Source:
public void basePathForSpecificFilter ( ) { java.lang.String basePath = "/someAbsolutePath/someDirectory" ; configureBasePath ( "someProject" , basePath ) ; com.google.common.truth.Truth.assertThat ( ( ( java.lang.Object ) ( repoCfg.getBasePath ( new com.google.gerrit.reviewdb.client.Project.NameKey ( "someOtherProject" ) ) ) ) ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( repoCfg.getBasePath ( new com.google.gerrit.reviewdb.client.Project.NameKey ( "someProject" ) ) . toString ( ) ) . isEqualTo ( basePath ) ; }

Target:
public void basePathForSpecificFilter ( ) { java.lang.String basePath = "/someAbsolutePath/someDirectory" ; configureBasePath ( "someProject" , basePath ) ; com.google.common.truth.Truth.assertThat ( repoCfg.getBasePath ( new com.google.gerrit.reviewdb.client.Project.NameKey ( "someOtherProject" ) ) ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( repoCfg.getBasePath ( new com.google.gerrit.reviewdb.client.Project.NameKey ( "someProject" ) ) . toString ( ) ) . isEqualTo ( basePath ) ; }
Source:
protected void fireEvent ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.events.ChangeEvent event , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.common.UserScopedEventListener listener : listeners ) { if ( isVisibleTo ( change , listener.getUser ( ) , db ) ) { listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }

Target:
protected void fireEvent ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.events.ChangeEvent event ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.common.UserScopedEventListener listener : listeners ) { if ( isVisibleTo ( change , listener.getUser ( ) ) ) { listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }
Source:
private void setMissingHeader ( final java.util.Map < java.lang.String , com.google.gerrit.server.mail.send.EmailHeader > hdrs , java.lang.String name , java.lang.String value ) { if ( ( ! ( hdrs.containsKey ( name ) ) ) || ( hdrs.get ( name ) . isEmpty ( ) ) ) { hdrs.put ( name , new com.google.gerrit.server.mail.send.EmailHeader.String ( value ) ) ; } }

Target:
private static void setMissingHeader ( java.util.Map < java.lang.String , com.google.gerrit.server.mail.send.EmailHeader > hdrs , java.lang.String name , java.lang.String value ) { if ( ( ! ( hdrs.containsKey ( name ) ) ) || ( hdrs.get ( name ) . isEmpty ( ) ) ) { hdrs.put ( name , new com.google.gerrit.server.mail.send.EmailHeader.String ( value ) ) ; } }
Source:
public static void rename ( int id , java.lang.String path , java.lang.String newPath , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > cb ) { com.google.gerrit.client.changes.ChangeEditApi.Input in = com.google.gerrit.client.changes.ChangeEditApi.Input.create ( ) ; in.oldPath ( path ) ; in.newPath ( newPath ) ; com.google.gerrit.client.changes.ChangeApi.edit ( id ) . post ( in , cb ) ; }

Target:
public static void rename ( @ com.google.gerrit.common.Nullable java.lang.String project , int id , java.lang.String path , java.lang.String newPath , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > cb ) { com.google.gerrit.client.changes.ChangeEditApi.Input in = com.google.gerrit.client.changes.ChangeEditApi.Input.create ( ) ; in.oldPath ( path ) ; in.newPath ( newPath ) ; com.google.gerrit.client.changes.ChangeApi.edit ( project , id ) . post ( in , cb ) ; }
Source:
public static java.lang.String toProjectAdmin ( com.google.gerrit.reviewdb.client.Project.NameKey n , java.lang.String panel ) { if ( ProjectScreen.INFO.equals ( panel ) ) { return "/admin/projects/" + ( n.toString ( ) ) ; } return ( ( "/admin/projects/" + ( n.toString ( ) ) ) + "," ) + panel ; }

Target:
public static java.lang.String toProjectAdmin ( com.google.gerrit.reviewdb.client.Project.NameKey n , java.lang.String panel ) { if ( ( panel == null ) || ( ProjectScreen.INFO.equals ( panel ) ) ) { return "/admin/projects/" + ( n.toString ( ) ) ; } return ( ( "/admin/projects/" + ( n.toString ( ) ) ) + "," ) + panel ; }
Source:
public void conflictingChanges ( ) throws com.jcraft.jsch.JSchException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { org.eclipse.jgit.api.Git git = createProject ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result change = createChange ( git , true ) ; com.google.gerrit.acceptance.PushOneCommit.Result conflictingChange1 = createChange ( git , true ) ; com.google.gerrit.acceptance.PushOneCommit.Result conflictingChange2 = createChange ( git , true ) ; createChange ( git , false ) ; java.util.Set < java.lang.String > changes = queryConflictingChanges ( change ) ; assertChanges ( changes , conflictingChange1 , conflictingChange2 ) ; }

Target:
public void conflictingChanges ( ) throws com.jcraft.jsch.JSchException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit.Result change = createChange ( git , true ) ; com.google.gerrit.acceptance.PushOneCommit.Result conflictingChange1 = createChange ( git , true ) ; com.google.gerrit.acceptance.PushOneCommit.Result conflictingChange2 = createChange ( git , true ) ; createChange ( git , false ) ; java.util.Set < java.lang.String > changes = queryConflictingChanges ( change ) ; assertChanges ( changes , conflictingChange1 , conflictingChange2 ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.diff.DiffInfo diffInfo ) { diff = diffInfo ; fileSize = com.google.gerrit.client.diff.SideBySide2.bucketFileSize ( diffInfo ) ; net.codemirror.theme.ThemeLoader.loadTheme ( prefs.theme ( ) , themeCallback ) ; if ( prefs.syntaxHighlighting ( ) ) { if ( ( fileSize.compareTo ( com.google.gerrit.client.diff.SideBySide2.FileSize.SMALL ) ) > 0 ) { modeInjectorCb.onSuccess ( null ) ; } else { injectMode ( diffInfo , modeInjectorCb ) ; } } else { modeInjectorCb.onSuccess ( null ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.diff.DiffInfo diffInfo ) { diff = diffInfo ; fileSize = com.google.gerrit.client.diff.SideBySide2.bucketFileSize ( diffInfo ) ; if ( prefs.syntaxHighlighting ( ) ) { if ( ( fileSize.compareTo ( com.google.gerrit.client.diff.SideBySide2.FileSize.SMALL ) ) > 0 ) { modeInjectorCb.onSuccess ( null ) ; } else { injectMode ( diffInfo , modeInjectorCb ) ; } } else { modeInjectorCb.onSuccess ( null ) ; } }