auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
void waitForShutdown ( ) { synchronized ( this ) { while ( ! ( shutdownComplete ) ) { try { wait ( ) ; } catch ( java.lang.InterruptedException e ) { com.google.gerrit.pgm.util.RuntimeShutdown.ShutdownCallback.log.warn ( ( ( ( "Thread " + ( java.lang.Thread.currentThread ( ) . getName ( ) ) ) + " interrupted while waiting for graceful shutdown;" ) + " ignoring interrupt request" ) ) ; } } } }

Target:
void waitForShutdown ( ) { synchronized ( this ) { while ( ! ( shutdownComplete ) ) { try { wait ( ) ; } catch ( java.lang.InterruptedException e ) { return ; } } } }
Source:
public void testCreate_NonEmpty ( ) throws java.io.IOException { final java.io.File root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; final java.io.File txt = new java.io.File ( root , "test.txt" ) ; try { assertTrue ( root.mkdir ( ) ) ; assertTrue ( txt.createNewFile ( ) ) ; final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( root ) ; assertFalse ( site.isNew ) ; assertEquals ( root , site.site_path ) ; } finally { txt.delete ( ) ; root.delete ( ) ; } }

Target:
public void testCreate_NonEmpty ( ) throws java.io.IOException { final java.io.File root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; final java.io.File txt = new java.io.File ( root , "test.txt" ) ; try { org.junit.Assert.assertTrue ( root.mkdir ( ) ) ; org.junit.Assert.assertTrue ( txt.createNewFile ( ) ) ; final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( root ) ; org.junit.Assert.assertFalse ( site.isNew ) ; org.junit.Assert.assertEquals ( root , site.site_path ) ; } finally { txt.delete ( ) ; root.delete ( ) ; } }
Source:
public com.google.gerrit.server.notedb.ChangeNotes load ( com.google.gerrit.reviewdb.client.Change change ) throws com.google.gerrit.server.project.NoSuchProjectException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.lib.Repository repo ; try { repo = repoManager.openRepository ( change.getProject ( ) ) ; } catch ( org.eclipse.jgit.errors.RepositoryNotFoundException e ) { throw new com.google.gerrit.server.project.NoSuchProjectException ( change.getProject ( ) , e ) ; } try { return new com.google.gerrit.server.notedb.ChangeNotes ( repo , change ) ; } finally { repo.close ( ) ; } }

Target:
public com.google.gerrit.server.notedb.ChangeNotes load ( com.google.gerrit.reviewdb.client.Change change ) throws com.google.gwtorm.server.OrmException { org.eclipse.jgit.lib.Repository repo ; try { repo = repoManager.openRepository ( change.getProject ( ) ) ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } try { return new com.google.gerrit.server.notedb.ChangeNotes ( repo , change ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException | java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } finally { repo.close ( ) ; } }
Source:
public com.google.gerrit.extensions.auth.oauth.OAuthToken get ( java.lang.String userName ) { com.google.gerrit.extensions.auth.oauth.OAuthToken accessToken = cache.getIfPresent ( userName ) ; if ( accessToken == null ) { return null ; } accessToken = decrypt ( accessToken ) ; if ( accessToken.isExpired ( ) ) { cache.invalidate ( userName ) ; return null ; } return accessToken ; }

Target:
public com.google.gerrit.extensions.auth.oauth.OAuthToken get ( com.google.gerrit.reviewdb.client.Account.Id id ) { com.google.gerrit.extensions.auth.oauth.OAuthToken accessToken = cache.getIfPresent ( id ) ; if ( accessToken == null ) { return null ; } accessToken = decrypt ( accessToken ) ; if ( accessToken.isExpired ( ) ) { cache.invalidate ( id ) ; return null ; } return accessToken ; }
Source:
public void testCreateSchema_Label_CodeReview ( ) throws java.lang.Exception { com.google.gerrit.common.data.LabelType codeReview = getLabelTypes ( ) . byLabel ( "Code-Review" ) ; assertNotNull ( codeReview ) ; assertEquals ( "Code-Review" , codeReview.getName ( ) ) ; assertEquals ( "CR" , codeReview.getAbbreviation ( ) ) ; assertEquals ( "MaxWithBlock" , codeReview.getFunctionName ( ) ) ; assertTrue ( codeReview.isCopyMinScore ( ) ) ; assertValueRange ( codeReview , 2 , 1 , 0 , ( - 1 ) , ( - 2 ) ) ; }

Target:
public void testCreateSchema_Label_CodeReview ( ) throws java.lang.Exception { com.google.gerrit.common.data.LabelType codeReview = getLabelTypes ( ) . byLabel ( "Code-Review" ) ; org.junit.Assert.assertNotNull ( codeReview ) ; org.junit.Assert.assertEquals ( "Code-Review" , codeReview.getName ( ) ) ; org.junit.Assert.assertEquals ( "CR" , codeReview.getAbbreviation ( ) ) ; org.junit.Assert.assertEquals ( "MaxWithBlock" , codeReview.getFunctionName ( ) ) ; org.junit.Assert.assertTrue ( codeReview.isCopyMinScore ( ) ) ; assertValueRange ( codeReview , 2 , 1 , 0 , ( - 1 ) , ( - 2 ) ) ; }
Source:
public boolean unify ( com.googlecode.prolog_cafe.lang.Term t , com.googlecode.prolog_cafe.lang.Trail trail ) { if ( t.isVariable ( ) ) return ( ( com.googlecode.prolog_cafe.lang.VariableTerm ) ( t ) ) . unify ( this , trail ) ; if ( ! ( t.isInteger ( ) ) ) return false ; else return ( this . val ) == ( ( ( com.googlecode.prolog_cafe.lang.IntegerTerm ) ( t ) ) . value ( ) ) ; }

Target:
public boolean unify ( com.googlecode.prolog_cafe.lang.Term t , com.googlecode.prolog_cafe.lang.Trail trail ) { if ( t instanceof com.googlecode.prolog_cafe.lang.VariableTerm ) return ( ( com.googlecode.prolog_cafe.lang.VariableTerm ) ( t ) ) . unify ( this , trail ) ; if ( ! ( t instanceof com.googlecode.prolog_cafe.lang.IntegerTerm ) ) return false ; else return ( this . val ) == ( ( ( com.googlecode.prolog_cafe.lang.IntegerTerm ) ( t ) ) . value ( ) ) ; }
Source:
void scanTree ( org.eclipse.jgit.revwalk.RevTree tree ) throws java.io.IOException , org.eclipse.jgit.errors.CorruptObjectException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { if ( config.render ) { org.eclipse.jgit.treewalk.TreeWalk tw = new org.eclipse.jgit.treewalk.TreeWalk ( reader ) ; tw.setRecursive ( false ) ; tw.addTree ( tree ) ; while ( ( tw.next ( ) ) && ( ! ( isPresent ( ) ) ) ) { considerEntry ( tw ) ; } } }

Target:
void scanTree ( org.eclipse.jgit.revwalk.RevTree tree ) throws java.io.IOException , org.eclipse.jgit.errors.CorruptObjectException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { if ( config.render ) { try ( org.eclipse.jgit.treewalk.TreeWalk tw = new org.eclipse.jgit.treewalk.TreeWalk ( reader ) ) { tw.setRecursive ( false ) ; tw.addTree ( tree ) ; while ( ( tw.next ( ) ) && ( ! ( isPresent ( ) ) ) ) { considerEntry ( tw ) ; } } } }
Source:
private static com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > equalsLabelPredicate ( com.google.gerrit.server.query.change.LabelPredicate.Args args , java.lang.String label , int expVal ) { if ( ( ( args.accounts ) == null ) || ( args.accounts.isEmpty ( ) ) ) { return new com.google.gerrit.server.query.change.EqualsLabelPredicate ( args , label , expVal , null ) ; } java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > r = new java.util.ArrayList < > ( ) ; for ( com.google.gerrit.reviewdb.client.Account.Id a : args.accounts ) { r.add ( new com.google.gerrit.server.query.change.EqualsLabelPredicate ( args , label , expVal , a ) ) ; } return or ( r ) ; }

Target:
protected static com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > equalsLabelPredicate ( com.google.gerrit.server.query.change.LabelPredicate.Args args , java.lang.String label , int expVal ) { if ( ( ( args.accounts ) == null ) || ( args.accounts.isEmpty ( ) ) ) { return new com.google.gerrit.server.query.change.EqualsLabelPredicate ( args , label , expVal , null ) ; } java.util.List < com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > > r = new java.util.ArrayList < > ( ) ; for ( com.google.gerrit.reviewdb.client.Account.Id a : args.accounts ) { r.add ( new com.google.gerrit.server.query.change.EqualsLabelPredicate ( args , label , expVal , a ) ) ; } return or ( r ) ; }
Source:
protected void configure ( ) { bind ( GitilesAccess.Factory.class ) . to ( GerritGitilesAccess.Factory.class ) ; bind ( new com.google.inject.TypeLiteral < org.eclipse.jgit.transport.resolver.RepositoryResolver < javax.servlet.http.HttpServletRequest > > ( ) { } ) . to ( com.googlesource.gerrit.plugins.gitiles.Resolver.class ) ; bind ( com.google.gerrit.server.config.AllProjectsName.class ) . toProvider ( com.google.gerrit.server.config.AllProjectsNameProvider.class ) ; listener ( ) . to ( com.googlesource.gerrit.plugins.gitiles.Module.Lifecycle.class ) ; }

Target:
protected void configure ( ) { bind ( GitilesAccess.Factory.class ) . to ( GerritGitilesAccess.Factory.class ) ; bind ( new com.google.inject.TypeLiteral < org.eclipse.jgit.transport.resolver.RepositoryResolver < javax.servlet.http.HttpServletRequest > > ( ) { } ) . to ( com.googlesource.gerrit.plugins.gitiles.Resolver.class ) ; listener ( ) . to ( com.googlesource.gerrit.plugins.gitiles.Module.Lifecycle.class ) ; }
Source:
public com.google.gerrit.server.project.ChildProjectResource parse ( com.google.gerrit.server.project.ProjectResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException { com.google.gerrit.server.project.ProjectResource p = projectsCollection.parse ( TopLevelResource.INSTANCE , id ) ; for ( com.google.gerrit.server.project.ProjectState pp : p.getControl ( ) . getProjectState ( ) . parents ( ) ) { if ( parent.getNameKey ( ) . equals ( pp.getProject ( ) . getNameKey ( ) ) ) { return new com.google.gerrit.server.project.ChildProjectResource ( parent , p.getControl ( ) ) ; } } throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; }

Target:
public com.google.gerrit.server.project.ChildProjectResource parse ( com.google.gerrit.server.project.ProjectResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException { com.google.gerrit.server.project.ProjectResource p = projectsCollection.parse ( TopLevelResource.INSTANCE , id ) ; for ( com.google.gerrit.server.project.ProjectState pp : p.getControl ( ) . getProjectState ( ) . parents ( ) ) { if ( parent.getNameKey ( ) . equals ( pp.getProject ( ) . getNameKey ( ) ) ) { return new com.google.gerrit.server.project.ChildProjectResource ( parent , p.getProjectState ( ) ) ; } } throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; }
Source:
protected void runImpl ( ) throws java.io.IOException { final org.eclipse.jgit.transport.UploadPack up = new org.eclipse.jgit.transport.UploadPack ( repo ) ; if ( ! ( projectControl.allRefsAreVisible ( ) ) ) { up.setRefFilter ( new com.google.gerrit.server.git.VisibleRefFilter ( repo , projectControl , db ) ) ; } up.upload ( in , out , err ) ; }

Target:
protected void runImpl ( ) throws java.io.IOException { final org.eclipse.jgit.transport.UploadPack up = new org.eclipse.jgit.transport.UploadPack ( repo ) ; if ( ! ( projectControl.allRefsAreVisible ( ) ) ) { up.setRefFilter ( new com.google.gerrit.server.git.VisibleRefFilter ( repo , projectControl , db.get ( ) ) ) ; } up.upload ( in , out , err ) ; }
Source:
private java.util.HashMap < java.lang.String , java.lang.String > getGitblitInitParams ( ) { java.util.HashMap < java.lang.String , java.lang.String > props = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; props.put ( "applicationClassName" , com.googlesource.gerrit.plugins.gitblit.app.GerritToGitBlitWebApp.class . getName ( ) ) ; props.put ( "filterMappingUrlPattern" , "/*" ) ; props.put ( "ignorePaths" , "pages/,feed/" ) ; return props ; }

Target:
private java.util.HashMap < java.lang.String , java.lang.String > getGitblitInitParams ( ) { java.util.HashMap < java.lang.String , java.lang.String > props = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; props.put ( "filterMappingUrlPattern" , "/*" ) ; props.put ( "ignorePaths" , "pages/,feed/" ) ; return props ; }
Source:
public void onLoad ( ) { enableForm ( false ) ; super . onLoad ( ) ; Util.PROJECT_SVC.projectDetail ( projectId , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.admin.ProjectDetail > ( ) { public void onSuccess ( final com.google.gerrit.client.admin.ProjectDetail result ) { enableForm ( true ) ; display ( result ) ; } } ) ; }

Target:
protected void onLoad ( ) { enableForm ( false ) ; super . onLoad ( ) ; Util.PROJECT_SVC.projectDetail ( projectId , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.admin.ProjectDetail > ( ) { public void onSuccess ( final com.google.gerrit.client.admin.ProjectDetail result ) { enableForm ( true ) ; display ( result ) ; } } ) ; }
Source:
protected void renameTable ( com.google.gerrit.reviewdb.server.ReviewDb db , java.lang.String from , java.lang.String to ) throws com.google.gwtorm.server.OrmException { final com.google.gwtorm.jdbc.JdbcSchema s = ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) ; final com.google.gwtorm.jdbc.JdbcExecutor e = new com.google.gwtorm.jdbc.JdbcExecutor ( s ) ; try { s.renameTable ( e , from , to ) ; } finally { e.close ( ) ; } }

Target:
protected static void renameTable ( com.google.gerrit.reviewdb.server.ReviewDb db , java.lang.String from , java.lang.String to ) throws com.google.gwtorm.server.OrmException { com.google.gwtorm.jdbc.JdbcSchema s = ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) ; try ( com.google.gwtorm.jdbc.JdbcExecutor e = new com.google.gwtorm.jdbc.JdbcExecutor ( s ) ) { s.renameTable ( e , from , to ) ; } }
Source:
protected void preDisplay ( com.google.gerrit.client.projects.ConfigInfoCache.Entry result ) { commentManager = new com.google.gerrit.client.diff.SideBySideCommentManager ( this , base , revision , path , result.getCommentLinkProcessor ( ) , getChangeStatus ( ) . isOpen ( ) ) ; setTheme ( result.getTheme ( ) ) ; display ( comments ) ; header.setupPrevNextFiles ( comments ) ; }

Target:
protected void preDisplay ( com.google.gerrit.client.projects.ConfigInfoCache.Entry result ) { commentManager = new com.google.gerrit.client.diff.SideBySideCommentManager ( this , getProject ( ) , base , revision , path , result.getCommentLinkProcessor ( ) , getChangeStatus ( ) . isOpen ( ) ) ; setTheme ( result.getTheme ( ) ) ; display ( comments ) ; header.setupPrevNextFiles ( comments ) ; }
Source:
private void writeToBatch ( com.google.gerrit.server.git.VersionedMetaData.BatchMetaDataUpdate batch , com.google.gerrit.server.notedb.AbstractChangeUpdate update , org.eclipse.jgit.lib.Repository repo ) throws com.google.gwtorm.server.OrmException , java.io.IOException { try ( org.eclipse.jgit.lib.ObjectInserter inserter = repo.newObjectInserter ( ) ) { update.setInserter ( inserter ) ; update.writeCommit ( batch ) ; } }

Target:
private void writeToBatch ( com.google.gerrit.server.git.VersionedMetaData.BatchMetaDataUpdate batch , com.google.gerrit.server.notedb.AbstractChangeUpdate update , org.eclipse.jgit.lib.Repository repo ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( ( update == null ) || ( update.isEmpty ( ) ) ) { return ; } try ( org.eclipse.jgit.lib.ObjectInserter inserter = repo.newObjectInserter ( ) ) { update.setInserter ( inserter ) ; update.writeCommit ( batch ) ; } }
Source:
private java.lang.String getScopesKeyFromCookie ( javax.servlet.http.HttpServletRequest request ) { javax.servlet.http.Cookie [ ] cookies = request.getCookies ( ) ; if ( cookies == null ) { return null ; } for ( javax.servlet.http.Cookie cookie : cookies ) { if ( cookie.getName ( ) . equalsIgnoreCase ( "scope" ) ) { return cookie.getValue ( ) ; } } return null ; }

Target:
public java.lang.String getScopesKeyFromCookie ( javax.servlet.http.HttpServletRequest request ) { javax.servlet.http.Cookie [ ] cookies = request.getCookies ( ) ; if ( cookies == null ) { return null ; } for ( javax.servlet.http.Cookie cookie : cookies ) { if ( cookie.getName ( ) . equalsIgnoreCase ( "scope" ) ) { return cookie.getValue ( ) ; } } return null ; }
Source:
public void update ( final int completed ) { count += completed ; if ( ( total ) != ( com.google.gerrit.server.git.MultiProgressMonitor.UNKNOWN ) ) { int percent = ( ( count ) * 100 ) / ( total ) ; if ( percent > ( lastPercent ) ) { lastPercent = percent ; wakeUp ( ) ; } } }

Target:
public void update ( final int completed ) { boolean w = false ; synchronized ( this ) { count += completed ; if ( ( total ) != ( com.google.gerrit.server.git.MultiProgressMonitor.UNKNOWN ) ) { int percent = ( ( count ) * 100 ) / ( total ) ; if ( percent > ( lastPercent ) ) { lastPercent = percent ; w = true ; } } } if ( w ) { wakeUp ( ) ; } }
Source:
private void banner ( ) { java.lang.System.err.format ( "Gerrit Code Review %s - Interactive Prolog Shell" , com.google.gerrit.common.Version.getVersion ( ) ) ; java.lang.System.err.println ( ) ; java.lang.System.err.println ( ( "based on " + ( com.googlecode.prolog_cafe.repl.PrologMain.VERSION ) ) ) ; java.lang.System.err.println ( ( " " + ( com.googlecode.prolog_cafe.repl.PrologMain.COPYRIGHT ) ) ) ; java.lang.System.err.println ( ( "(type Ctrl-D or \"halt.\" to exit," + " \"[\'path/to/file.pl\'].\" to load a file)" ) ) ; java.lang.System.err.println ( ) ; java.lang.System.err.flush ( ) ; }

Target:
private void banner ( ) { java.lang.System.err.format ( "Gerrit Code Review %s - Interactive Prolog Shell" , com.google.gerrit.common.Version.getVersion ( ) ) ; java.lang.System.err.println ( ) ; java.lang.System.err.println ( ( "(type Ctrl-D or \"halt.\" to exit," + " \"[\'path/to/file.pl\'].\" to load a file)" ) ) ; java.lang.System.err.println ( ) ; java.lang.System.err.flush ( ) ; }
Source:
protected void setUpEnvironment ( com.google.gerrit.rules.PrologEnvironment env ) { com.google.gerrit.reviewdb.client.Change change = new com.google.gerrit.reviewdb.client.Change ( new com.google.gerrit.reviewdb.client.Change.Key ( "Ibeef" ) , new com.google.gerrit.reviewdb.client.Change.Id ( 1 ) , new com.google.gerrit.reviewdb.client.Account.Id ( 2 ) , new com.google.gerrit.reviewdb.client.Branch.NameKey ( localKey , "refs/heads/master" ) , com.google.gerrit.server.util.TimeUtil.nowTs ( ) ) ; env.set ( StoredValues.CHANGE , change ) ; env.set ( StoredValues.CHANGE_CONTROL , util.user ( local ) . controlFor ( change ) ) ; }

Target:
protected void setUpEnvironment ( com.google.gerrit.rules.PrologEnvironment env ) { com.google.gerrit.reviewdb.client.Change change = new com.google.gerrit.reviewdb.client.Change ( new com.google.gerrit.reviewdb.client.Change.Key ( "Ibeef" ) , new com.google.gerrit.reviewdb.client.Change.Id ( 1 ) , new com.google.gerrit.reviewdb.client.Account.Id ( 2 ) , new com.google.gerrit.reviewdb.client.Branch.NameKey ( localKey , "refs/heads/master" ) , com.google.gerrit.server.util.TimeUtil.nowTs ( ) ) ; env.set ( StoredValues.CHANGE_CONTROL , util.user ( local ) . controlFor ( change ) ) ; }
Source:
public boolean equals ( final java.lang.Object other ) { if ( ( getClass ( ) ) == ( other.getClass ( ) ) ) { final com.google.gerrit.server.query.OperatorPredicate < ? > p = ( ( com.google.gerrit.server.query.OperatorPredicate < ? > ) ( other ) ) ; return ( getOperator ( ) . equals ( p.getOperator ( ) ) ) && ( getValue ( ) . equals ( p.getValue ( ) ) ) ; } return false ; }

Target:
public boolean equals ( final java.lang.Object other ) { if ( other == null ) return false ; if ( ( getClass ( ) ) == ( other.getClass ( ) ) ) { final com.google.gerrit.server.query.OperatorPredicate < ? > p = ( ( com.google.gerrit.server.query.OperatorPredicate < ? > ) ( other ) ) ; return ( getOperator ( ) . equals ( p.getOperator ( ) ) ) && ( getValue ( ) . equals ( p.getValue ( ) ) ) ; } return false ; }
Source:
protected void onSave ( org.eclipse.jgit.lib.CommitBuilder commit ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ( ( commit.getMessage ( ) ) == null ) || ( "" . equals ( commit.getMessage ( ) ) ) ) { commit.setMessage ( "Updated configuration\n" ) ; } saveConfig ( fileName , cfg ) ; }

Target:
protected boolean onSave ( org.eclipse.jgit.lib.CommitBuilder commit ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( ( ( commit.getMessage ( ) ) == null ) || ( "" . equals ( commit.getMessage ( ) ) ) ) { commit.setMessage ( "Updated configuration\n" ) ; } saveConfig ( fileName , cfg ) ; return true ; }
Source:
public void extend ( com.google.gerrit.server.events.ChangeAttribute a , com.google.gerrit.reviewdb.Change change ) { a.createdOn = ( change.getCreatedOn ( ) . getTime ( ) ) / 1000L ; a.lastUpdated = ( change.getLastUpdatedOn ( ) . getTime ( ) ) / 1000L ; a.sortKey = change.getSortKey ( ) ; a.open = change.getStatus ( ) . isOpen ( ) ; a.status = change.getStatus ( ) ; }

Target:
public void extend ( com.google.gerrit.server.events.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 ( ) ; a.status = change.getStatus ( ) ; }
Source:
public boolean apply ( com.google.gerrit.reviewdb.client.Project project , java.lang.String hash , java.lang.String name , com.google.gerrit.server.git.GitRepositoryManager gitRepoManager ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.reviewdb.client.Project.NameKey p = new com.google.gerrit.reviewdb.client.Project.NameKey ( project.getName ( ) ) ; org.eclipse.jgit.lib.Repository db = gitRepoManager.openRepository ( p ) ; org.eclipse.jgit.api.Git git = new org.eclipse.jgit.api.Git ( db ) ; git.branchCreate ( ) . setName ( branch ) . setStartPoint ( hash ) . call ( ) ; git.close ( ) ; return true ; }

Target:
public boolean apply ( com.google.gerrit.reviewdb.client.Project project , java.lang.String hash , java.lang.String name , com.google.gerrit.server.git.GitRepositoryManager gitRepoManager ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.reviewdb.client.Project.NameKey p = new com.google.gerrit.reviewdb.client.Project.NameKey ( project.getName ( ) ) ; try ( org.eclipse.jgit.lib.Repository db = gitRepoManager.openRepository ( p ) ; org.eclipse.jgit.api.Git git = new org.eclipse.jgit.api.Git ( db ) ) { git.branchCreate ( ) . setName ( branch ) . setStartPoint ( hash ) . call ( ) ; } return true ; }
Source:
private void uncacheSshKeys ( final com.google.gerrit.client.reviewdb.Account.Id me , final com.google.gerrit.client.reviewdb.ReviewDb db ) { final net.sf.ehcache.constructs.blocking.SelfPopulatingCache c = server.getSshKeysCache ( ) ; final com.google.gerrit.client.reviewdb.Account a = com.google.gerrit.client.rpc.Common.getAccountCache ( ) . get ( me , db ) ; if ( ( a != null ) && ( ( a.getSshUserName ( ) ) != null ) ) { c.remove ( a.getSshUserName ( ) ) ; } }

Target:
private void uncacheSshKeys ( final com.google.gerrit.client.reviewdb.Account.Id me , final com.google.gerrit.client.reviewdb.ReviewDb db ) { final com.google.gerrit.client.reviewdb.Account a = com.google.gerrit.client.rpc.Common.getAccountCache ( ) . get ( me , db ) ; if ( a != null ) { uncacheSshKeys ( a.getSshUserName ( ) ) ; } }
Source:
private void setStatus ( com.google.gerrit.server.notedb.ChangeUpdate update ) { java.lang.String msg = message.getMessage ( ) ; if ( com.google.gerrit.server.notedb.ChangeRebuilderImpl.ChangeMessageEvent.STATUS_ABANDONED_REGEXP.matcher ( msg ) . matches ( ) ) { update.setStatus ( Change.Status.ABANDONED ) ; noteDbChange.setStatus ( Change.Status.ABANDONED ) ; return ; } if ( com.google.gerrit.server.notedb.ChangeRebuilderImpl.ChangeMessageEvent.STATUS_RESTORED_REGEXP.matcher ( msg ) . matches ( ) ) { update.setStatus ( Change.Status.NEW ) ; noteDbChange.setStatus ( Change.Status.NEW ) ; } }

Target:
private void setStatus ( com.google.gerrit.server.notedb.ChangeUpdate update ) { java.lang.String msg = message.getMessage ( ) ; if ( msg == null ) { return ; } if ( com.google.gerrit.server.notedb.ChangeRebuilderImpl.ChangeMessageEvent.STATUS_ABANDONED_REGEXP.matcher ( msg ) . matches ( ) ) { update.setStatus ( Change.Status.ABANDONED ) ; noteDbChange.setStatus ( Change.Status.ABANDONED ) ; return ; } if ( com.google.gerrit.server.notedb.ChangeRebuilderImpl.ChangeMessageEvent.STATUS_RESTORED_REGEXP.matcher ( msg ) . matches ( ) ) { update.setStatus ( Change.Status.NEW ) ; noteDbChange.setStatus ( Change.Status.NEW ) ; } }
Source:
protected void configure ( ) { factory ( AddBranch.Factory.class ) ; factory ( AddRefRight.Factory.class ) ; factory ( ChangeProjectSettings.Factory.class ) ; factory ( DeleteBranches.Factory.class ) ; factory ( DeleteRefRights.Factory.class ) ; factory ( ListBranches.Factory.class ) ; factory ( VisibleProjects.Factory.class ) ; factory ( ProjectDetailFactory.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( AddBranch.Factory.class ) ; factory ( ChangeProjectSettings.Factory.class ) ; factory ( DeleteBranches.Factory.class ) ; factory ( ListBranches.Factory.class ) ; factory ( VisibleProjects.Factory.class ) ; factory ( ProjectDetailFactory.Factory.class ) ; }
Source:
public void run ( ) { try { executePredicate ( ) ; } catch ( com.googlecode.prolog_cafe.lang.JavaInterruptedException e ) { java.lang.System.exit ( 1 ) ; } catch ( com.googlecode.prolog_cafe.lang.PrologException e ) { if ( engine.getPrintStackTrace ( ) . equals ( "on" ) ) printStackTrace ( e ) ; else java.lang.System.out.println ( e.toString ( ) ) ; } catch ( java.lang.Exception e ) { printStackTrace ( e ) ; } stop ( ) ; }

Target:
public void run ( ) { try { executePredicate ( ) ; } catch ( com.googlecode.prolog_cafe.lang.JavaInterruptedException e ) { java.lang.System.exit ( 1 ) ; } catch ( com.googlecode.prolog_cafe.lang.PrologException e ) { java.lang.System.out.println ( e.toString ( ) ) ; } catch ( java.lang.Exception e ) { printStackTrace ( e ) ; } stop ( ) ; }
Source:
public com.google.gerrit.server.git.WorkQueue.Task < ? > getTask ( final int id ) { com.google.gerrit.server.git.WorkQueue.Task < ? > result = null ; for ( final com.google.gerrit.server.git.WorkQueue.Executor e : queues ) { final com.google.gerrit.server.git.WorkQueue.Task < ? > t = e.getTask ( id ) ; if ( t != null ) { if ( result != null ) { return null ; } else { result = t ; } } } return result ; }

Target:
public com.google.gerrit.server.git.WorkQueue.Task < ? > getTask ( final int id ) { com.google.gerrit.server.git.WorkQueue.Task < ? > result = null ; for ( final com.google.gerrit.server.git.WorkQueue.Executor e : queues ) { final com.google.gerrit.server.git.WorkQueue.Task < ? > t = e.getTask ( id ) ; if ( t != null ) { if ( result != null ) { return null ; } result = t ; } } return result ; }
Source:
public void stop ( ) { I read = searchIndex.get ( ) ; if ( read != null ) { read.close ( ) ; } for ( I write : writeIndexes ) { if ( write != read ) { write.stop ( ) ; write.close ( ) ; } } }

Target:
public void stop ( ) { I read = searchIndex.get ( ) ; if ( read != null ) { read.close ( ) ; } for ( I write : writeIndexes ) { if ( write != read ) { write.close ( ) ; } } }
Source:
private java.util.List < com.google.gerrit.extensions.common.ProjectInfo > getDirectChildProjects ( com.google.gerrit.reviewdb.client.Project.NameKey parent ) { java.util.List < com.google.gerrit.extensions.common.ProjectInfo > childProjects = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.reviewdb.client.Project.NameKey projectName : projectCache.all ( ) ) { com.google.gerrit.server.project.ProjectState e = projectCache.get ( projectName ) ; if ( e == null ) { continue ; } if ( parent.equals ( e.getProject ( ) . getParent ( allProjects ) ) ) { childProjects.add ( json.format ( e.getProject ( ) ) ) ; } } return childProjects ; }

Target:
private java.util.List < com.google.gerrit.extensions.common.ProjectInfo > getDirectChildProjects ( com.google.gerrit.reviewdb.client.Project.NameKey parent ) { java.util.List < com.google.gerrit.extensions.common.ProjectInfo > childProjects = new java.util.ArrayList < > ( ) ; for ( com.google.gerrit.reviewdb.client.Project.NameKey projectName : projectCache.all ( ) ) { com.google.gerrit.server.project.ProjectState e = projectCache.get ( projectName ) ; if ( e == null ) { continue ; } if ( parent.equals ( e.getProject ( ) . getParent ( allProjects ) ) ) { childProjects.add ( json.format ( e.getProject ( ) ) ) ; } } return childProjects ; }
Source:
com.google.gerrit.server.git.strategy.SubmitStrategy.Arguments create ( com.google.gerrit.extensions.client.SubmitType submitType , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.server.git.MergeOp.CommitStatus commitStatus , com.google.gerrit.server.git.CodeReviewCommit.CodeReviewRevWalk rw , com.google.gerrit.server.IdentifiedUser caller , com.google.gerrit.server.git.MergeTip mergeTip , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevFlag canMergeFlag , com.google.gerrit.reviewdb.server.ReviewDb db , java.util.Set < org.eclipse.jgit.revwalk.RevCommit > alreadyAccepted , java.util.Set < com.google.gerrit.server.git.CodeReviewCommit > incoming , com.google.gerrit.server.util.RequestId submissionId , com.google.gerrit.extensions.api.changes.NotifyHandling notifyHandling , com.google.common.collect.ListMultimap < com.google.gerrit.extensions.api.changes.RecipientType , com.google.gerrit.reviewdb.client.Account.Id > accountsToNotify , com.google.gerrit.server.git.SubmoduleOp submoduleOp , boolean dryrun ) ;

Target:
com.google.gerrit.server.git.strategy.SubmitStrategy.Arguments create ( com.google.gerrit.extensions.client.SubmitType submitType , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.server.git.MergeOp.CommitStatus commitStatus , com.google.gerrit.server.git.CodeReviewCommit.CodeReviewRevWalk rw , com.google.gerrit.server.IdentifiedUser caller , com.google.gerrit.server.git.MergeTip mergeTip , org.eclipse.jgit.revwalk.RevFlag canMergeFlag , com.google.gerrit.reviewdb.server.ReviewDb db , java.util.Set < org.eclipse.jgit.revwalk.RevCommit > alreadyAccepted , java.util.Set < com.google.gerrit.server.git.CodeReviewCommit > incoming , com.google.gerrit.server.util.RequestId submissionId , com.google.gerrit.extensions.api.changes.NotifyHandling notifyHandling , com.google.common.collect.ListMultimap < com.google.gerrit.extensions.api.changes.RecipientType , com.google.gerrit.reviewdb.client.Account.Id > accountsToNotify , com.google.gerrit.server.git.SubmoduleOp submoduleOp , boolean dryrun ) ;
Source:
public java.lang.String [ ] getStringList ( java.lang.String section , java.lang.String subsection , java.lang.String name ) { java.lang.String [ ] secure = secureStore.getList ( section , subsection , name ) ; if ( secure != null ) { return secure ; } return super . getStringList ( section , subsection , name ) ; }

Target:
public java.lang.String [ ] getStringList ( java.lang.String section , java.lang.String subsection , java.lang.String name ) { java.lang.String [ ] secure = secureStore.getList ( section , subsection , name ) ; if ( ( secure != null ) && ( ( secure.length ) > 0 ) ) { return secure ; } return super . getStringList ( section , subsection , name ) ; }
Source:
public static com.google.gerrit.client.diff.CommentRange create ( int sl , int sc , int el , int ec ) { com.google.gerrit.client.diff.CommentRange r = createObject ( ) . cast ( ) ; r.setStartLine ( sl ) ; r.setStartCh ( sc ) ; r.setEndLine ( el ) ; r.setEndCh ( ec ) ; return r ; }

Target:
public static com.google.gerrit.client.diff.CommentRange create ( int sl , int sc , int el , int ec ) { com.google.gerrit.client.diff.CommentRange r = createObject ( ) . cast ( ) ; r.set ( sl , sc , el , ec ) ; return r ; }
Source:
protected void configure ( ) { bind ( com.google.inject.Key.get ( javax.sql.DataSource.class , com.google.inject.name.Names.named ( "ReviewDb" ) ) ) . toProvider ( com.google.gerrit.httpd.ReviewDbDataSourceProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; listener ( ) . to ( com.google.gerrit.httpd.ReviewDbDataSourceProvider.class ) ; modules.add ( new com.google.gerrit.server.schema.DatabaseModule ( ) ) ; modules.add ( new com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.ApiModule ( ) ) ; return com.google.inject.Guice.createInjector ( com.google.inject.Stage.PRODUCTION , modules ) ; }

Target:
protected void configure ( ) { bind ( com.google.inject.Key.get ( javax.sql.DataSource.class , com.google.inject.name.Names.named ( "ReviewDb" ) ) ) . toProvider ( com.google.gerrit.httpd.ReviewDbDataSourceProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; listener ( ) . to ( com.google.gerrit.httpd.ReviewDbDataSourceProvider.class ) ; }
Source:
private com.google.gerrit.reviewdb.client.PatchSet updateDraftPatchSet ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { final com.google.gerrit.reviewdb.client.PatchSet updatedPatchSet = dbProvider.get ( ) . patchSets ( ) . atomicUpdate ( rsrc.getPatchSet ( ) . getId ( ) , new com.google.gwtorm.server.AtomicUpdate < com.google.gerrit.reviewdb.client.PatchSet > ( ) { @ java.lang.Override public com.google.gerrit.reviewdb.client.PatchSet update ( com.google.gerrit.reviewdb.client.PatchSet patchset ) { patchset.setDraft ( false ) ; return patchset ; } } ) ; return updatedPatchSet ; }

Target:
private com.google.gerrit.reviewdb.client.PatchSet updateDraftPatchSet ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { return dbProvider.get ( ) . patchSets ( ) . atomicUpdate ( rsrc.getPatchSet ( ) . getId ( ) , new com.google.gwtorm.server.AtomicUpdate < com.google.gerrit.reviewdb.client.PatchSet > ( ) { @ java.lang.Override public com.google.gerrit.reviewdb.client.PatchSet update ( com.google.gerrit.reviewdb.client.PatchSet patchset ) { patchset.setDraft ( false ) ; return patchset ; } } ) ; }
Source:
public void testPatternNullMatch ( ) { com.googlesource.gerrit.plugins.hooks.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "commentlink" , "ItsTestName" , "match" ) ) . andReturn ( null ) . atLeastOnce ( ) ; replayMocks ( ) ; assertNull ( "Pattern for null match is not null" , itsConfig.getIssuePattern ( ) ) ; }

Target:
public void testPatternNullMatch ( ) { com.googlesource.gerrit.plugins.hooks.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "ItsTestName" , null , "commentlink" ) ) . andReturn ( null ) . atLeastOnce ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "commentlink" , "ItsTestName" , "match" ) ) . andReturn ( null ) . atLeastOnce ( ) ; replayMocks ( ) ; assertNull ( "Pattern for null match is not null" , itsConfig.getIssuePattern ( ) ) ; }
Source:
public void setInfo ( java.lang.String msg ) { if ( ( info ) == null ) { info = new com.google.gwt.user.client.ui.Image ( Gerrit.RESOURCES.info ( ) ) ; titlePanel.add ( info ) ; } info.setTitle ( msg ) ; }

Target:
public void setInfo ( java.lang.String msg ) { if ( ( ( info ) == null ) && ( ( titlePanel ) != null ) ) { info = new com.google.gwt.user.client.ui.Image ( Gerrit.RESOURCES.info ( ) ) ; titlePanel.add ( info ) ; } info.setTitle ( msg ) ; }
Source:
public void submitWithFastForward ( ) throws java.lang.Exception { org.eclipse.jgit.api.Git git = createProject ( ) ; org.eclipse.jgit.revwalk.RevCommit oldHead = getRemoteHead ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result change = createChange ( git ) ; submit ( change.getChangeId ( ) ) ; org.eclipse.jgit.revwalk.RevCommit head = getRemoteHead ( ) ; com.google.common.truth.Truth.assertThat ( head.getId ( ) ) . isEqualTo ( change.getCommitId ( ) ) ; com.google.common.truth.Truth.assertThat ( head.getParent ( 0 ) ) . isEqualTo ( oldHead ) ; assertSubmitter ( change.getChangeId ( ) , 1 ) ; }

Target:
public void submitWithFastForward ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit oldHead = getRemoteHead ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result change = createChange ( ) ; submit ( change.getChangeId ( ) ) ; org.eclipse.jgit.revwalk.RevCommit head = getRemoteHead ( ) ; com.google.common.truth.Truth.assertThat ( head.getId ( ) ) . isEqualTo ( change.getCommitId ( ) ) ; com.google.common.truth.Truth.assertThat ( head.getParent ( 0 ) ) . isEqualTo ( oldHead ) ; assertSubmitter ( change.getChangeId ( ) , 1 ) ; }
Source:
public java.util.Map < java.lang.Object , com.codahale.metrics.Metric > getCells ( ) { return com.google.common.collect.Maps.transformValues ( cells , new com.google.common.base.Function < com.google.gerrit.metrics.dropwizard.BucketedCallback < V > . ValueGauge , com.codahale.metrics.Metric > ( ) { @ java.lang.Override public com.codahale.metrics.Metric apply ( com.google.gerrit.metrics.dropwizard.BucketedCallback < V > . ValueGauge in ) { return in ; } } ) ; }

Target:
public java.util.Map < java.lang.Object , com.codahale.metrics.Metric > getCells ( ) { return com.google.common.collect.Maps.transformValues ( cells , ( in ) -> ( ( com.codahale.metrics.Metric ) ( in ) ) ) ; }
Source:
public void commentOnWipChangeByOwnerNotifyAll ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; review ( sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED , com.google.gerrit.extensions.api.changes.NotifyHandling.ALL ) ; assertThat ( sender ) . sent ( "comment" , sc ) . notTo ( 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 commentOnWipChangeByOwnerNotifyAll ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; review ( sc.owner , sc.changeId , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED , com.google.gerrit.extensions.api.changes.NotifyHandling.ALL ) ; assertThat ( sender ) . sent ( "comment" , sc ) . notTo ( 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 ) ; }
Source:
public static java.lang.String mediumFormat ( final java.util.Date dt ) { if ( dt == null ) { return "" ; } final long tzOffset = ( ( - ( com.google.gerrit.client.FormatUtil.guessTimeZone ( ) ) ) * 60 ) * 1000L ; return com.google.gerrit.client.FormatUtil.dtfmt.format ( new java.util.Date ( ( ( dt.getTime ( ) ) + tzOffset ) ) ) ; }

Target:
public static java.lang.String mediumFormat ( final java.util.Date dt ) { if ( dt == null ) { return "" ; } return com.google.gerrit.client.FormatUtil.dtfmt.format ( new java.util.Date ( dt.getTime ( ) ) ) ; }
Source:
private static org.eclipse.jgit.lib.ObjectId resolveRevision ( org.eclipse.jgit.lib.Repository repo , java.lang.String revision ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { org.eclipse.jgit.lib.ObjectId revId = repo.resolve ( com.google.common.base.MoreObjects.firstNonNull ( revision , Constants.HEAD ) ) ; if ( revId == null ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } return revId ; }

Target:
private static org.eclipse.jgit.lib.ObjectId resolveRevision ( org.eclipse.jgit.lib.Repository repo , java.lang.String revision ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { if ( revision == null ) { return null ; } org.eclipse.jgit.lib.ObjectId revId = repo.resolve ( revision ) ; if ( revId == null ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } return revId ; }
Source:
public java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > onCommitReceived ( com.google.gerrit.server.events.CommitReceivedEvent receiveEvent ) throws com.google.gerrit.server.git.validators.CommitValidationException { if ( itsConfig.isEnabled ( receiveEvent.project.getName ( ) , receiveEvent.refName ) ) { return validCommit ( receiveEvent.command , receiveEvent.commit ) ; } else { return java.util.Collections.emptyList ( ) ; } }

Target:
public java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > onCommitReceived ( com.google.gerrit.server.events.CommitReceivedEvent receiveEvent ) throws com.google.gerrit.server.git.validators.CommitValidationException { if ( itsConfig.isEnabled ( receiveEvent.project.getName ( ) , receiveEvent.refName ) ) { return validCommit ( receiveEvent.commit ) ; } else { return java.util.Collections.emptyList ( ) ; } }
Source:
public static void rebase ( int id , java.lang.String commit , java.lang.String base , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.ChangeInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.RebaseInput rebaseInput = com.google.gerrit.client.changes.ChangeApi.RebaseInput.create ( ) ; rebaseInput.setBase ( base ) ; com.google.gerrit.client.changes.ChangeApi.call ( id , commit , "rebase" ) . post ( rebaseInput , cb ) ; }

Target:
public static void rebase ( @ com.google.gerrit.common.Nullable java.lang.String project , int id , java.lang.String commit , java.lang.String base , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.ChangeInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.RebaseInput rebaseInput = com.google.gerrit.client.changes.ChangeApi.RebaseInput.create ( ) ; rebaseInput.setBase ( base ) ; com.google.gerrit.client.changes.ChangeApi.call ( project , id , commit , "rebase" ) . post ( rebaseInput , cb ) ; }
Source:
public void testUnblockForceWithAllowNoForce_NotPossible ( ) { com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) ; r.setBlock ( ) ; r.setForce ( true ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertFalse ( "u can't force push" , u.controlForRef ( "refs/heads/master" ) . canForceUpdate ( ) ) ; }

Target:
public void testUnblockForceWithAllowNoForce_NotPossible ( ) { com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) ; r.setBlock ( ) ; r.setForce ( true ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't force push" , u.controlForRef ( "refs/heads/master" ) . canForceUpdate ( ) ) ; }
Source:
private com.google.inject.AbstractModule createIndexModule ( ) { if ( slave ) { return new com.google.gerrit.server.index.DummyIndexModule ( ) ; } com.google.gerrit.server.index.IndexModule.IndexType indexType = com.google.gerrit.server.index.IndexModule.getIndexType ( cfgInjector ) ; switch ( indexType ) { case LUCENE : return ( luceneModule ) != null ? luceneModule : new com.google.gerrit.lucene.LuceneIndexModule ( ) ; case SOLR : return new com.google.gerrit.solr.SolrIndexModule ( ) ; default : throw new java.lang.IllegalStateException ( ( "unsupported index.type = " + indexType ) ) ; } }

Target:
private com.google.inject.AbstractModule createIndexModule ( ) { if ( slave ) { return new com.google.gerrit.server.index.DummyIndexModule ( ) ; } switch ( indexType ) { case LUCENE : return ( luceneModule ) != null ? luceneModule : new com.google.gerrit.lucene.LuceneIndexModule ( ) ; default : throw new java.lang.IllegalStateException ( ( "unsupported index.type = " + ( indexType ) ) ) ; } }
Source:
public com.google.gwtjsonrpc.client.VoidResult run ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gerrit.server.Failure , com.google.gwtorm.client.OrmException { assertAmGroupOwner ( db , groupId ) ; final com.google.gerrit.client.reviewdb.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; if ( group == null ) { throw new com.google.gerrit.server.Failure ( new com.google.gerrit.client.rpc.NoSuchEntityException ( ) ) ; } group.setDescription ( description ) ; db.accountGroups ( ) . update ( java.util.Collections.singleton ( group ) ) ; return com.google.gwtjsonrpc.client.VoidResult.INSTANCE ; }

Target:
public com.google.gwtjsonrpc.client.VoidResult run ( final com.google.gerrit.client.reviewdb.ReviewDb db ) throws com.google.gerrit.server.Failure , com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; assertAmGroupOwner ( db , group ) ; group.setDescription ( description ) ; db.accountGroups ( ) . update ( java.util.Collections.singleton ( group ) ) ; return com.google.gwtjsonrpc.client.VoidResult.INSTANCE ; }
Source:
private boolean can ( com.google.gerrit.server.permissions.LabelPermission.WithValue perm ) { com.google.gerrit.common.data.PermissionRange r = label ( perm.permissionName ( ) . get ( ) ) ; if ( ( ( perm.forUser ( ) ) == ( ForUser.ON_BEHALF_OF ) ) && ( r.isEmpty ( ) ) ) { return false ; } return r.contains ( perm.value ( ) ) ; }

Target:
private boolean can ( com.google.gerrit.server.permissions.LabelPermission.WithValue perm ) { com.google.gerrit.common.data.PermissionRange r = label ( perm.permissionName ( ) ) ; if ( ( ( perm.forUser ( ) ) == ( ForUser.ON_BEHALF_OF ) ) && ( r.isEmpty ( ) ) ) { return false ; } return r.contains ( perm.value ( ) ) ; }
Source:
public void byId ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change1 = newChange ( repo , null , null , null , null ) . insert ( ) ; com.google.gerrit.reviewdb.client.Change change2 = newChange ( repo , null , null , null , null ) . insert ( ) ; assertQuery ( "12345" ) ; assertQuery ( change1.getId ( ) . get ( ) , change1 ) ; assertQuery ( change2.getId ( ) . get ( ) , change2 ) ; }

Target:
public void byId ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change1 = insert ( newChange ( repo , null , null , null , null ) ) ; com.google.gerrit.reviewdb.client.Change change2 = insert ( newChange ( repo , null , null , null , null ) ) ; assertQuery ( "12345" ) ; assertQuery ( change1.getId ( ) . get ( ) , change1 ) ; assertQuery ( change2.getId ( ) . get ( ) , change2 ) ; }
Source:
private java.lang.String getChangeUrl ( final com.google.gerrit.reviewdb.Change change ) { if ( ( change != null ) && ( ( urlProvider.get ( ) ) != null ) ) { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( urlProvider.get ( ) ) ; r.append ( change.getChangeId ( ) ) ; return r.toString ( ) ; } return null ; }

Target:
private java.lang.String getChangeUrl ( final com.google.gerrit.reviewdb.client.Change change ) { if ( ( change != null ) && ( ( urlProvider.get ( ) ) != null ) ) { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( urlProvider.get ( ) ) ; r.append ( change.getChangeId ( ) ) ; return r.toString ( ) ; } return null ; }