auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void setUp ( ) throws java.lang.Exception { repo = new org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.DfsRepository > ( new org.eclipse.jgit.internal.storage.dfs.InMemoryRepository ( new org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription ( "test" ) ) ) ; walk = new org.eclipse.jgit.revwalk.RevWalk ( repo.getRepository ( ) ) ; cache = new com.google.gitiles.TimeCache ( ) ; start = ( repo.getDate ( ) . getTime ( ) ) / 1000 ; }

Target:
public void setUp ( ) throws java.lang.Exception { repo = new org.eclipse.jgit.junit.TestRepository ( new org.eclipse.jgit.internal.storage.dfs.InMemoryRepository ( new org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription ( "test" ) ) ) ; walk = new org.eclipse.jgit.revwalk.RevWalk ( repo.getRepository ( ) ) ; cache = new com.google.gitiles.TimeCache ( ) ; start = ( repo.getDate ( ) . getTime ( ) ) / 1000 ; }
Source:
public void onSuccess ( final com.google.gerrit.client.HostPageData result ) { com.google.gerrit.client.Gerrit.myConfig = result.config ; if ( ( result.xsrfToken ) != null ) { com.google.gwtjsonrpc.client.JsonUtil.getDefaultXsrfManager ( ) . setToken ( null , result.xsrfToken ) ; } if ( ( result.userAccount ) != null ) { com.google.gerrit.client.Gerrit.myAccount = result.userAccount ; com.google.gerrit.client.Gerrit.applyUserPreferences ( ) ; } onModuleLoad2 ( ) ; }

Target:
public void onSuccess ( final com.google.gerrit.client.HostPageData result ) { com.google.gerrit.client.Gerrit.myConfig = result.config ; if ( ( result.userAccount ) != null ) { com.google.gerrit.client.Gerrit.myAccount = result.userAccount ; com.google.gerrit.client.Gerrit.applyUserPreferences ( ) ; } onModuleLoad2 ( ) ; }
Source:
public void replace ( com.google.gerrit.server.account.AccountState as ) throws java.io.IOException { io.searchbox.core.Bulk bulk = new io.searchbox.core.Bulk.Builder ( ) . defaultIndex ( indexName ) . defaultType ( com.google.gerrit.elasticsearch.ElasticAccountIndex.ACCOUNTS ) . addAction ( insert ( com.google.gerrit.elasticsearch.ElasticAccountIndex.ACCOUNTS , as ) ) . refresh ( refresh ) . build ( ) ; io.searchbox.client.JestResult result = client.execute ( bulk ) ; if ( ! ( result.isSucceeded ( ) ) ) { throw new java.io.IOException ( java.lang.String.format ( "Failed to replace account %s in index %s: %s" , as.getAccount ( ) . getId ( ) , indexName , result.getErrorMessage ( ) ) ) ; } }

Target:
public void replace ( com.google.gerrit.server.account.AccountState as ) throws java.io.IOException { io.searchbox.core.Bulk bulk = new io.searchbox.core.Bulk.Builder ( ) . defaultIndex ( indexName ) . defaultType ( com.google.gerrit.elasticsearch.ElasticAccountIndex.ACCOUNTS ) . addAction ( insert ( com.google.gerrit.elasticsearch.ElasticAccountIndex.ACCOUNTS , as ) ) . refresh ( true ) . build ( ) ; io.searchbox.client.JestResult result = client.execute ( bulk ) ; if ( ! ( result.isSucceeded ( ) ) ) { throw new java.io.IOException ( java.lang.String.format ( "Failed to replace account %s in index %s: %s" , as.getAccount ( ) . getId ( ) , indexName , result.getErrorMessage ( ) ) ) ; } }
Source:
public int compare ( com.googlesource.gerrit.plugins.verifystatus.server.PatchSetVerification a , com.googlesource.gerrit.plugins.verifystatus.server.PatchSetVerification b ) { return new org.apache.commons.lang.builder.CompareToBuilder ( ) . append ( a.getReporter ( ) , b.getReporter ( ) ) . append ( b.getGranted ( ) , a.getGranted ( ) ) . toComparison ( ) ; }

Target:
public int compare ( com.googlesource.gerrit.plugins.verifystatus.server.PatchSetVerification a , com.googlesource.gerrit.plugins.verifystatus.server.PatchSetVerification b ) { return new org.apache.commons.lang.builder.CompareToBuilder ( ) . append ( a.getReporter ( ) , b.getReporter ( ) ) . append ( a.getName ( ) , b.getName ( ) ) . append ( b.getGranted ( ) , a.getGranted ( ) ) . toComparison ( ) ; }
Source:
public com.google.gerrit.server.data.PatchSetAttribute get ( ) { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( notes.getProjectName ( ) ) ; org.eclipse.jgit.revwalk.RevWalk revWalk = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { return eventFactory.asPatchSetAttribute ( revWalk , notes , patchSet ) ; } catch ( java.io.IOException e ) { throw com.google.common.base.Throwables.propagate ( e ) ; } }

Target:
public com.google.gerrit.server.data.PatchSetAttribute get ( ) { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( change.getProject ( ) ) ; org.eclipse.jgit.revwalk.RevWalk revWalk = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { return eventFactory.asPatchSetAttribute ( revWalk , change , patchSet ) ; } catch ( java.io.IOException e ) { throw com.google.common.base.Throwables.propagate ( e ) ; } }
Source:
private java.util.List < com.google.gerrit.client.ui.InlineHyperlink > getLinks ( ) { if ( ( revision.get ( ) ) > 0 ) { com.google.gerrit.client.ui.InlineHyperlink toUnifiedDiffLink = new com.google.gerrit.client.ui.InlineHyperlink ( ) ; toUnifiedDiffLink.setHTML ( new com.google.gwt.user.client.ui.ImageResourceRenderer ( ) . render ( Gerrit.RESOURCES.unifiedDiff ( ) ) ) ; toUnifiedDiffLink.setTargetHistoryToken ( getUnifiedDiffUrl ( ) ) ; toUnifiedDiffLink.setTitle ( PatchUtil.C.unifiedDiff ( ) ) ; return java.util.Collections.singletonList ( toUnifiedDiffLink ) ; } else { return java.util.Collections.emptyList ( ) ; } }

Target:
private java.util.List < com.google.gerrit.client.ui.InlineHyperlink > getLinks ( ) { com.google.gerrit.client.ui.InlineHyperlink toUnifiedDiffLink = new com.google.gerrit.client.ui.InlineHyperlink ( ) ; toUnifiedDiffLink.setHTML ( new com.google.gwt.user.client.ui.ImageResourceRenderer ( ) . render ( Gerrit.RESOURCES.unifiedDiff ( ) ) ) ; toUnifiedDiffLink.setTargetHistoryToken ( getUnifiedDiffUrl ( ) ) ; toUnifiedDiffLink.setTitle ( PatchUtil.C.unifiedDiff ( ) ) ; return java.util.Collections.singletonList ( toUnifiedDiffLink ) ; }
Source:
private org.eclipse.jgit.lib.Ref getBranchRef ( com.google.gerrit.reviewdb.Project.NameKey projectName ) { try { final org.eclipse.jgit.lib.Repository r = repoManager.openRepository ( projectName.get ( ) ) ; try { return r.getRef ( showBranch ) ; } finally { r.close ( ) ; } } catch ( java.io.IOException ioe ) { return null ; } }

Target:
private org.eclipse.jgit.lib.Ref getBranchRef ( com.google.gerrit.reviewdb.Project.NameKey projectName ) { try { final org.eclipse.jgit.lib.Repository r = repoManager.openRepository ( projectName ) ; try { return r.getRef ( showBranch ) ; } finally { r.close ( ) ; } } catch ( java.io.IOException ioe ) { return null ; } }
Source:
static boolean parentsEqual ( org.eclipse.jgit.revwalk.RevCommit a , org.eclipse.jgit.revwalk.RevCommit b ) { if ( ( a.getParentCount ( ) ) != ( b.getParentCount ( ) ) ) { return false ; } for ( int i = 0 ; i < ( a.getParentCount ( ) ) ; i ++ ) { if ( ( a.getParent ( i ) ) != ( b.getParent ( i ) ) ) { return false ; } } return true ; }

Target:
static boolean parentsEqual ( org.eclipse.jgit.revwalk.RevCommit a , org.eclipse.jgit.revwalk.RevCommit b ) { if ( ( a.getParentCount ( ) ) != ( b.getParentCount ( ) ) ) { return false ; } for ( int i = 0 ; i < ( a.getParentCount ( ) ) ; i ++ ) { if ( ! ( a.getParent ( i ) . equals ( b.getParent ( i ) ) ) ) { return false ; } } return true ; }
Source:
void addChange ( java.lang.String token ) { try { changeArgumentParser.addChange ( token , changes ) ; } catch ( com.google.gerrit.sshd.commands.UnloggedFailure e ) { throw new java.lang.IllegalArgumentException ( e.getMessage ( ) , e ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.lang.IllegalArgumentException ( "database is down" , e ) ; } }

Target:
void addChange ( java.lang.String token ) { try { changeArgumentParser.addChange ( token , changes , null , false ) ; } catch ( com.google.gerrit.sshd.commands.UnloggedFailure e ) { throw new java.lang.IllegalArgumentException ( e.getMessage ( ) , e ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new java.lang.IllegalArgumentException ( "database is down" , e ) ; } }
Source:
public com.google.gwtexpui.safehtml.client.SafeHtmlBuilder appendAttribute ( final java.lang.String name , java.lang.String value ) { if ( ( value != null ) && ( ( value.length ( ) ) > 0 ) ) { final java.lang.String e = getAttribute ( name ) ; return setAttribute ( name , ( ( e.length ( ) ) > 0 ? ( e + " " ) + value : e ) ) ; } return this ; }

Target:
public com.google.gwtexpui.safehtml.client.SafeHtmlBuilder appendAttribute ( final java.lang.String name , java.lang.String value ) { if ( ( value != null ) && ( ( value.length ( ) ) > 0 ) ) { final java.lang.String e = getAttribute ( name ) ; return setAttribute ( name , ( ( e.length ( ) ) > 0 ? ( e + " " ) + value : value ) ) ; } return this ; }
Source:
protected void renderTextError ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , int statusCode , java.lang.String message ) throws java.io.IOException { res.setStatus ( statusCode ) ; setApiHeaders ( res , com.google.gitiles.FormatType.TEXT ) ; setCacheHeaders ( res ) ; try ( java.io.Writer out = com.google.gitiles.BaseServlet.newWriter ( req , res ) ) { out.write ( message ) ; } }

Target:
protected void renderTextError ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , int statusCode , java.lang.String message ) throws java.io.IOException { res.setStatus ( statusCode ) ; setApiHeaders ( req , res , com.google.gitiles.FormatType.TEXT ) ; setCacheHeaders ( res ) ; try ( java.io.Writer out = com.google.gitiles.BaseServlet.newWriter ( req , res ) ) { out.write ( message ) ; } }
Source:
public void updateRepo ( com.google.gerrit.server.update.RepoContext ctx ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gwtorm.server.OrmException , java.io.IOException { validate ( ctx ) ; ctx.addRefUpdate ( new org.eclipse.jgit.transport.ReceiveCommand ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) , commitId , getPatchSetId ( ) . toRefName ( ) , ReceiveCommand.Type.CREATE ) ) ; }

Target:
public void updateRepo ( com.google.gerrit.server.update.RepoContext ctx ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gwtorm.server.OrmException , java.io.IOException { validate ( ctx ) ; ctx.addRefUpdate ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) , commitId , getPatchSetId ( ) . toRefName ( ) ) ; }
Source:
private void sendCreateChange ( com.google.gerrit.server.git.BatchUpdate.Context ctx ) throws com.google.gerrit.common.errors.EmailException { com.google.gerrit.server.mail.CreateChangeSender cm = createChangeSenderFactory.create ( change.getId ( ) ) ; cm.setFrom ( ctx.getUser ( ) . getAccountId ( ) ) ; cm.setPatchSet ( patchSet , patchSetInfo ) ; cm.addReviewers ( recipients.getReviewers ( ) ) ; cm.addExtraCC ( recipients.getCcOnly ( ) ) ; cm.send ( ) ; }

Target:
private void sendCreateChange ( com.google.gerrit.server.git.BatchUpdate.Context ctx ) throws com.google.gerrit.common.errors.EmailException { com.google.gerrit.server.mail.CreateChangeSender cm = createChangeSenderFactory.create ( ctx.getProject ( ) , change.getId ( ) ) ; cm.setFrom ( ctx.getUser ( ) . getAccountId ( ) ) ; cm.setPatchSet ( patchSet , patchSetInfo ) ; cm.addReviewers ( recipients.getReviewers ( ) ) ; cm.addExtraCC ( recipients.getCcOnly ( ) ) ; cm.send ( ) ; }
Source:
public void afterRefUpdates ( ) throws com.google.gerrit.extensions.restapi.ResourceConflictException { if ( failAfterRefUpdates ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "Failing after ref updates" ) ; } for ( com.google.gerrit.server.git.strategy.SubmitStrategy strategy : strategies ) { com.google.gerrit.server.git.strategy.SubmitStrategy.Arguments args = strategy.args ; com.google.gerrit.reviewdb.client.Account account = args.accountCache.get ( args.caller.getAccountId ( ) ) . getAccount ( ) ; args.hooks.doRefUpdatedHook ( args.destBranch , args.mergeTip.getInitialTip ( ) , args.mergeTip.getCurrentTip ( ) , account ) ; } }

Target:
public void afterRefUpdates ( ) throws com.google.gerrit.extensions.restapi.ResourceConflictException { if ( failAfterRefUpdates ) { throw new com.google.gerrit.extensions.restapi.ResourceConflictException ( "Failing after ref updates" ) ; } for ( com.google.gerrit.server.git.strategy.SubmitStrategy strategy : strategies ) { com.google.gerrit.server.git.strategy.SubmitStrategy.Arguments args = strategy.args ; if ( args.mergeTip.getCurrentTip ( ) . equals ( args.mergeTip.getInitialTip ( ) ) ) { continue ; } com.google.gerrit.reviewdb.client.Account account = args.accountCache.get ( args.caller.getAccountId ( ) ) . getAccount ( ) ; args.hooks.doRefUpdatedHook ( args.destBranch , args.mergeTip.getInitialTip ( ) , args.mergeTip.getCurrentTip ( ) , account ) ; } }
Source:
public void testChildHashCode ( ) { final int pId = 2 ; final int cId = 8 ; final com.google.gwtorm.client.IntKeyTestCase.Parent p = new com.google.gwtorm.client.IntKeyTestCase.Parent ( pId ) ; final com.google.gwtorm.client.IntKeyTestCase.Child c = new com.google.gwtorm.client.IntKeyTestCase.Child ( p , cId ) ; assertSame ( p , c.getParentKey ( ) ) ; assertTrue ( ( cId != ( c.hashCode ( ) ) ) ) ; }

Target:
public void testChildHashCode ( ) { final int pId = 2 ; final int cId = 8 ; final com.google.gwtorm.client.IntKeyTestCase.Parent p = new com.google.gwtorm.client.IntKeyTestCase.Parent ( pId ) ; final com.google.gwtorm.client.IntKeyTestCase.Child c = new com.google.gwtorm.client.IntKeyTestCase.Child ( p , cId ) ; org.junit.Assert.assertSame ( p , c.getParentKey ( ) ) ; org.junit.Assert.assertTrue ( ( cId != ( c.hashCode ( ) ) ) ) ; }
Source:
public AccountGroup.Id call ( ) throws com.google.gerrit.common.errors.NameAlreadyUsedException , com.google.gerrit.common.errors.PermissionDeniedException , com.google.gwtorm.client.OrmException { if ( ! ( user.getCapabilities ( ) . canCreateGroup ( ) ) ) { throw new com.google.gerrit.common.errors.PermissionDeniedException ( java.lang.String.format ( "%s does not have \"Create Group\" capability." , user.getUserName ( ) ) ) ; } final com.google.gerrit.server.account.PerformCreateGroup performCreateGroup = performCreateGroupFactory.create ( ) ; final com.google.gerrit.reviewdb.Account.Id me = user.getAccountId ( ) ; return performCreateGroup.createGroup ( groupName , null , false , null , java.util.Collections.singleton ( me ) , null ) ; }

Target:
public AccountGroup.Id call ( ) throws com.google.gerrit.common.errors.NameAlreadyUsedException , com.google.gerrit.common.errors.PermissionDeniedException , com.google.gwtorm.client.OrmException { final com.google.gerrit.server.account.PerformCreateGroup performCreateGroup = performCreateGroupFactory.create ( ) ; final com.google.gerrit.reviewdb.Account.Id me = user.getAccountId ( ) ; return performCreateGroup.createGroup ( groupName , null , false , null , java.util.Collections.singleton ( me ) , null ) ; }
Source:
private static void p ( final java.lang.StringBuffer r , final com.google.gerrit.client.reviewdb.Project.NameKey project ) { java.lang.String n = project.get ( ) ; if ( ! ( n.endsWith ( ".git" ) ) ) { n += ".git" ; } com.google.gerrit.client.data.GitwebLink.var ( r , "p" , n ) ; }

Target:
private static void p ( final java.lang.StringBuilder r , final com.google.gerrit.client.reviewdb.Project.NameKey project ) { java.lang.String n = project.get ( ) ; if ( ! ( n.endsWith ( ".git" ) ) ) { n += ".git" ; } com.google.gerrit.client.data.GitwebLink.var ( r , "p" , n ) ; }
Source:
private static byte [ ] read ( java.util.jar.JarFile jarFile , java.util.jar.JarEntry entry ) throws java.io.IOException { byte [ ] data = new byte [ ( ( int ) ( entry.getSize ( ) ) ) ] ; java.io.InputStream in = jarFile.getInputStream ( entry ) ; try { org.eclipse.jgit.util.IO.readFully ( in , data , 0 , data.length ) ; } finally { in.close ( ) ; } return data ; }

Target:
private static byte [ ] read ( java.util.jar.JarFile jarFile , java.util.jar.JarEntry entry ) throws java.io.IOException { byte [ ] data = new byte [ ( ( int ) ( entry.getSize ( ) ) ) ] ; try ( java.io.InputStream in = jarFile.getInputStream ( entry ) ) { org.eclipse.jgit.util.IO.readFully ( in , data , 0 , data.length ) ; } return data ; }
Source:
private org.eclipse.jgit.revwalk.RevCommit commit ( com.google.gerrit.server.git.ProjectConfig cfg ) throws java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { com.google.gerrit.server.git.MetaDataUpdate md = new com.google.gerrit.server.git.MetaDataUpdate ( com.google.gerrit.server.extensions.events.GitReferenceUpdated.DISABLED , cfg.getProject ( ) . getNameKey ( ) , db ) ; util.tick ( 5 ) ; util.setAuthorAndCommitter ( md.getCommitBuilder ( ) ) ; md.setMessage ( "Edit\n" ) ; cfg.commit ( md ) ; org.eclipse.jgit.lib.Ref ref = db.getRef ( RefNames.REFS_CONFIG ) ; return util.getRevWalk ( ) . parseCommit ( ref.getObjectId ( ) ) ; }

Target:
private org.eclipse.jgit.revwalk.RevCommit commit ( com.google.gerrit.server.git.ProjectConfig cfg ) throws java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { try ( com.google.gerrit.server.git.MetaDataUpdate md = new com.google.gerrit.server.git.MetaDataUpdate ( com.google.gerrit.server.extensions.events.GitReferenceUpdated.DISABLED , cfg.getProject ( ) . getNameKey ( ) , db ) ) { util.tick ( 5 ) ; util.setAuthorAndCommitter ( md.getCommitBuilder ( ) ) ; md.setMessage ( "Edit\n" ) ; cfg.commit ( md ) ; org.eclipse.jgit.lib.Ref ref = db.getRef ( RefNames.REFS_CONFIG ) ; return util.getRevWalk ( ) . parseCommit ( ref.getObjectId ( ) ) ; } }
Source:
public org.eclipse.jgit.lib.ObjectId loadRevision ( ) throws com.google.gwtorm.server.OrmException { if ( loaded ) { return com.google.gerrit.server.notedb.AbstractChangeNotes.getRevision ( ) ; } else if ( ! ( migration.enabled ( ) ) ) { return null ; } try ( org.eclipse.jgit.lib.Repository repo = repoManager.openMetadataRepository ( getProjectName ( ) ) ) { org.eclipse.jgit.lib.Ref ref = repo.getRefDatabase ( ) . exactRef ( com.google.gerrit.server.notedb.AbstractChangeNotes.getRefName ( ) ) ; return ref != null ? ref.getObjectId ( ) : null ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } }

Target:
public org.eclipse.jgit.lib.ObjectId loadRevision ( ) throws com.google.gwtorm.server.OrmException { if ( loaded ) { return getRevision ( ) ; } else if ( ! ( migration.enabled ( ) ) ) { return null ; } try ( org.eclipse.jgit.lib.Repository repo = repoManager.openMetadataRepository ( getProjectName ( ) ) ) { org.eclipse.jgit.lib.Ref ref = repo.getRefDatabase ( ) . exactRef ( getRefName ( ) ) ; return ref != null ? ref.getObjectId ( ) : null ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } }
Source:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change change = object.change ( ) ; if ( change == null ) { return false ; } java.lang.String t = change.getTopic ( ) ; if ( ( t == null ) && ( ( getField ( ) ) == ( com.google.gerrit.server.index.ChangeField.LEGACY_TOPIC2 ) ) ) { t = "" ; } return getValue ( ) . equals ( t ) ; }

Target:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change change = object.change ( ) ; if ( change == null ) { return false ; } return getValue ( ) . equals ( change.getTopic ( ) ) ; }
Source:
protected com.google.gerrit.client.reviewdb.ReviewDb openReviewDb ( ) throws com.google.gerrit.server.ssh.AbstractCommand.Failure { if ( ( db ) == null ) { try { db = getGerritServer ( ) . getSchemaFactory ( ) . open ( ) ; } catch ( com.google.gwtorm.client.OrmException e ) { throw new com.google.gerrit.server.ssh.AbstractCommand.Failure ( 1 , "fatal: Gerrit database is offline" , e ) ; } } return db ; }

Target:
protected com.google.gerrit.client.reviewdb.ReviewDb openReviewDb ( ) throws com.google.gerrit.server.ssh.AbstractCommand.Failure { if ( ( db ) == null ) { try { db = schema.open ( ) ; } catch ( com.google.gwtorm.client.OrmException e ) { throw new com.google.gerrit.server.ssh.AbstractCommand.Failure ( 1 , "fatal: Gerrit database is offline" , e ) ; } } return db ; }
Source:
public void rootText ( ) throws java.lang.Exception { java.lang.String name = repo.getRepository ( ) . getDescription ( ) . getRepositoryName ( ) ; com.google.gitiles.FakeHttpServletResponse res = buildText ( "/" ) ; org.junit.Assert.assertEquals ( ( name + "\n" ) , new java.lang.String ( res.getActualBody ( ) , java.nio.charset.StandardCharsets.UTF_8 ) ) ; }

Target:
public void rootText ( ) throws java.lang.Exception { java.lang.String name = repo.getRepository ( ) . getDescription ( ) . getRepositoryName ( ) ; com.google.gitiles.FakeHttpServletResponse res = buildText ( "/" ) ; com.google.common.truth.Truth.assertThat ( new java.lang.String ( res.getActualBody ( ) , java.nio.charset.StandardCharsets.UTF_8 ) ) . isEqualTo ( ( name + "\n" ) ) ; }
Source:
private void saveChange ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) { change = ctx.getChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = ctx.getUpdate ( psId ) ; wasDraftChange = ( change.getStatus ( ) ) == ( Change.Status.DRAFT ) ; if ( wasDraftChange ) { change.setStatus ( Change.Status.NEW ) ; update.setStatus ( change.getStatus ( ) ) ; ctx.saveChange ( ) ; } }

Target:
private void saveChange ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) { change = ctx.getChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = ctx.getUpdate ( psId ) ; wasDraftChange = ( change.getStatus ( ) ) == ( Change.Status.DRAFT ) ; if ( wasDraftChange ) { change.setStatus ( Change.Status.NEW ) ; update.setStatus ( change.getStatus ( ) ) ; } }
Source:
public void delete ( com.google.gerrit.reviewdb.client.Change.Id id ) throws java.io.IOException { org.apache.lucene.index.Term idTerm = com.google.gerrit.lucene.QueryBuilder.idTerm ( schema , id ) ; try { com.google.common.util.concurrent.Futures.allAsList ( openIndex.delete ( idTerm ) , closedIndex.delete ( idTerm ) ) . get ( ) ; } catch ( java.util.concurrent.ExecutionException | java.lang.InterruptedException e ) { throw new java.io.IOException ( e ) ; } }

Target:
public void delete ( com.google.gerrit.reviewdb.client.Change.Id id ) throws java.io.IOException { org.apache.lucene.index.Term idTerm = com.google.gerrit.lucene.QueryBuilder.idTerm ( id ) ; try { com.google.common.util.concurrent.Futures.allAsList ( openIndex.delete ( idTerm ) , closedIndex.delete ( idTerm ) ) . get ( ) ; } catch ( java.util.concurrent.ExecutionException | java.lang.InterruptedException e ) { throw new java.io.IOException ( e ) ; } }
Source:
private void ensureRowMeasurements ( ) { if ( ( rowHeight ) == 0 ) { surrogate.setInnerSafeHtml ( rows.get ( 0 ) ) ; getContainerElement ( ) . appendChild ( surrogate ) ; rowHeight = surrogate.getOffsetHeight ( ) ; rowWidth = surrogate.getOffsetWidth ( ) ; getContainerElement ( ) . removeChild ( surrogate ) ; getContainerElement ( ) . getStyle ( ) . setHeight ( ( ( rowHeight ) * ( rows.size ( ) ) ) , Style.Unit.PX ) ; } }

Target:
private void ensureRowMeasurements ( ) { if ( ( ( rowHeight ) == 0 ) && ( ( rows ) != null ) ) { surrogate.setInnerSafeHtml ( rows.get ( 0 ) ) ; getContainerElement ( ) . appendChild ( surrogate ) ; rowHeight = surrogate.getOffsetHeight ( ) ; rowWidth = surrogate.getOffsetWidth ( ) ; getContainerElement ( ) . removeChild ( surrogate ) ; getContainerElement ( ) . getStyle ( ) . setHeight ( ( ( rowHeight ) * ( rows.size ( ) ) ) , Style.Unit.PX ) ; } }
Source:
public com.google.gerrit.server.project.ChangeControl changeControl ( com.google.gerrit.server.CurrentUser user ) throws com.google.gwtorm.server.OrmException { if ( ( changeControl ) != null ) { throw new java.lang.IllegalStateException ( ( "user already specified: " + ( changeControl.getUser ( ) ) ) ) ; } try { if ( ( change ) != null ) { changeControl = changeControlFactory.controlFor ( change , user ) ; } else { changeControl = changeControlFactory.controlFor ( project , legacyId , user ) ; } } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } return changeControl ; }

Target:
public com.google.gerrit.server.project.ChangeControl changeControl ( com.google.gerrit.server.CurrentUser user ) throws com.google.gwtorm.server.OrmException { if ( ( changeControl ) != null ) { throw new java.lang.IllegalStateException ( ( "user already specified: " + ( changeControl.getUser ( ) ) ) ) ; } try { if ( ( change ) != null ) { changeControl = changeControlFactory.controlFor ( db , change , user ) ; } else { changeControl = changeControlFactory.controlFor ( db , project , legacyId , user ) ; } } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } return changeControl ; }
Source:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { final com.google.gwt.user.client.ui.Widget sender = ( ( com.google.gwt.user.client.ui.Widget ) ( event.getSource ( ) ) ) ; if ( ( send ) == sender ) { onSend ( ) ; } else if ( ( cancel ) == sender ) { saveStateOnUnload = false ; goChange ( ) ; } }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { final com.google.gwt.user.client.ui.Widget sender = ( ( com.google.gwt.user.client.ui.Widget ) ( event.getSource ( ) ) ) ; if ( ( send ) == sender ) { onSend ( false ) ; } else if ( ( submit ) == sender ) { onSend ( true ) ; } else if ( ( cancel ) == sender ) { saveStateOnUnload = false ; goChange ( ) ; } }
Source:
public static void syncChangeStatus ( final com.google.gerrit.reviewdb.ReviewDb db , final com.google.gerrit.reviewdb.Change change ) throws com.google.gwtorm.client.OrmException { final java.util.List < com.google.gerrit.reviewdb.PatchSetApproval > approvals = db.patchSetApprovals ( ) . byChange ( change.getId ( ) ) . toList ( ) ; for ( com.google.gerrit.reviewdb.PatchSetApproval a : approvals ) { a.cache ( change ) ; } db.patchSetApprovals ( ) . update ( approvals ) ; }

Target:
public static void syncChangeStatus ( final com.google.gerrit.reviewdb.server.ReviewDb db , final com.google.gerrit.reviewdb.client.Change change ) throws com.google.gwtorm.server.OrmException { final java.util.List < com.google.gerrit.reviewdb.client.PatchSetApproval > approvals = db.patchSetApprovals ( ) . byChange ( change.getId ( ) ) . toList ( ) ; for ( com.google.gerrit.reviewdb.client.PatchSetApproval a : approvals ) { a.cache ( change ) ; } db.patchSetApprovals ( ) . update ( approvals ) ; }
Source:
public void updateMessageNoChange ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( modifier.createEdit ( change , getCurrentPatchSet ( changeId ) ) ) . isEqualTo ( RefUpdate.Result.NEW ) ; com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editUtil.byChange ( change ) ; HEAD ( 39.0 ) ; com.google.gerrit.acceptance.edit.b6c Allow ; com.google.gerrit.acceptance.edit.note DB ; all ( tests ) ; exception.expect ( com.google.gerrit.server.edit.UnchangedCommitMessageException.class ) ; exception.expectMessage ( "New commit message cannot be same as existing commit message" ) ; modifier.modifyMessage ( edit.get ( ) , edit.get ( ) . getEditCommit ( ) . getFullMessage ( ) ) ; }

Target:
public void updateMessageNoChange ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( modifier.createEdit ( change , getCurrentPatchSet ( changeId ) ) ) . isEqualTo ( RefUpdate.Result.NEW ) ; com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editUtil.byChange ( change ) ; exception.expect ( com.google.gerrit.server.edit.UnchangedCommitMessageException.class ) ; exception.expectMessage ( "New commit message cannot be same as existing commit message" ) ; modifier.modifyMessage ( edit.get ( ) , edit.get ( ) . getEditCommit ( ) . getFullMessage ( ) ) ; }
Source:
private java.lang.String getTaskName ( ) { java.lang.StringBuilder m = new java.lang.StringBuilder ( ) ; m.append ( getTaskDescription ( ) ) ; if ( user.isIdentifiedUser ( ) ) { com.google.gerrit.server.IdentifiedUser u = user.asIdentifiedUser ( ) ; if ( u.state ( ) . getUserName ( ) . isPresent ( ) ) { m.append ( " (" ) . append ( u.state ( ) . getUserName ( ) . get ( ) ) . append ( ")" ) ; } } return m.toString ( ) ; }

Target:
private java.lang.String getTaskName ( ) { java.lang.StringBuilder m = new java.lang.StringBuilder ( ) ; m.append ( getTaskDescription ( ) ) ; if ( user.isIdentifiedUser ( ) ) { com.google.gerrit.server.IdentifiedUser u = user.asIdentifiedUser ( ) ; if ( u.getUserName ( ) . isPresent ( ) ) { m.append ( " (" ) . append ( u.getUserName ( ) . get ( ) ) . append ( ")" ) ; } } return m.toString ( ) ; }
Source:
public com.google.gerrit.extensions.common.RevisionInfo revisionInfo ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.PatchSet ps ) throws com.google.gerrit.server.GpgException , com.google.gerrit.server.patch.PatchListNotAvailableException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.query.change.ChangeData cd = changeDataFactory.create ( db.get ( ) , project , ps.getId ( ) . getParentKey ( ) ) ; com.google.gerrit.server.project.ChangeControl ctl = cd.changeControl ( ) ; return changeJson.getRevisionInfo ( ctl , ps ) ; }

Target:
public com.google.gerrit.extensions.common.RevisionInfo revisionInfo ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.PatchSet ps ) throws com.google.gerrit.server.GpgException , com.google.gerrit.server.patch.PatchListNotAvailableException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.query.change.ChangeData cd = changeDataFactory.create ( db.get ( ) , project , ps.getId ( ) . getParentKey ( ) ) ; return changeJson.getRevisionInfo ( cd , ps ) ; }
Source:
protected void blurHint ( ) { if ( ( ( ! ( hintOn ) ) && ( ( getHintText ( ) ) != null ) ) && ( "" . equals ( super . getText ( ) ) ) ) { super . setText ( getHintText ( ) ) ; hintOn = true ; if ( ( getHintStyleName ( ) ) != null ) { addStyleName ( getHintStyleName ( ) ) ; } } }

Target:
protected void blurHint ( ) { if ( ( ( ! ( hintOn ) ) && ( ( getHintText ( ) ) != null ) ) && ( "" . equals ( super . getText ( ) ) ) ) { hintOn = true ; super . setText ( getHintText ( ) ) ; if ( ( getHintStyleName ( ) ) != null ) { addStyleName ( getHintStyleName ( ) ) ; } } }
Source:
private java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > getOwnersFromEmails ( java.util.Set < java.lang.String > emails ) throws com.google.gwtorm.server.OrmException { java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > result = new java.util.HashSet < com.google.gerrit.reviewdb.client.Account.Id > ( ) ; for ( java.lang.String email : emails ) { java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > ids = resolver.findAll ( email ) ; result.addAll ( ids ) ; } return result ; }

Target:
private java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > getOwnersFromEmails ( java.util.Set < java.lang.String > emails ) throws com.google.gwtorm.server.OrmException { java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > result = new java.util.HashSet < com.google.gerrit.reviewdb.client.Account.Id > ( ) ; for ( java.lang.String email : emails ) { java.util.Set < com.google.gerrit.reviewdb.client.Account.Id > ids = resolver.findAll ( db , email ) ; result.addAll ( ids ) ; } return result ; }
Source:
public java.util.List < com.googlesource.gerrit.plugins.its.jira.restapi.JiraTransition.Item > getTransitions ( java.lang.String issueKey ) throws java.io.IOException { com.googlesource.gerrit.plugins.its.jira.restapi.JiraRestApi < com.googlesource.gerrit.plugins.its.jira.restapi.JiraTransition > api = apiBuilder.get ( com.googlesource.gerrit.plugins.its.jira.restapi.JiraTransition.class , "/issue" ) ; return java.util.Arrays.asList ( api.doGet ( ( ( "/" + issueKey ) + "/transitions" ) , java.net.HttpURLConnection.HTTP_OK ) . transitions ) ; }

Target:
public java.util.List < com.googlesource.gerrit.plugins.its.jira.restapi.JiraTransition.Item > getTransitions ( java.lang.String issueKey ) throws java.io.IOException { com.googlesource.gerrit.plugins.its.jira.restapi.JiraRestApi < com.googlesource.gerrit.plugins.its.jira.restapi.JiraTransition > api = apiBuilder.get ( com.googlesource.gerrit.plugins.its.jira.restapi.JiraTransition.class , "/issue" ) ; return java.util.Arrays.asList ( api.doGet ( ( ( "/" + issueKey ) + "/transitions" ) , java.net.HttpURLConnection.HTTP_OK ) . getTransitions ( ) ) ; }
Source:
private com.google.common.collect.ListMultimap < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchSetApproval > allApprovalsMap ( com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > db ) throws com.google.gwtorm.server.OrmException { if ( ( allApprovals ) == null ) { allApprovals = com.google.common.collect.ArrayListMultimap.create ( ) ; for ( com.google.gerrit.reviewdb.client.PatchSetApproval psa : com.google.gerrit.server.query.change.ChangeData.sortApprovals ( db.get ( ) . patchSetApprovals ( ) . byChange ( legacyId ) ) ) { allApprovals.put ( psa.getPatchSetId ( ) , psa ) ; } } return allApprovals ; }

Target:
public com.google.common.collect.ListMultimap < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchSetApproval > allApprovalsMap ( com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > db ) throws com.google.gwtorm.server.OrmException { if ( ( allApprovals ) == null ) { allApprovals = com.google.common.collect.ArrayListMultimap.create ( ) ; for ( com.google.gerrit.reviewdb.client.PatchSetApproval psa : com.google.gerrit.server.query.change.ChangeData.sortApprovals ( db.get ( ) . patchSetApprovals ( ) . byChange ( legacyId ) ) ) { allApprovals.put ( psa.getPatchSetId ( ) , psa ) ; } } return allApprovals ; }
Source:
protected java.util.List < com.google.gerrit.extensions.common.ChangeInfo > assertQuery ( com.google.gerrit.extensions.api.changes.Changes.QueryRequest query , com.google.gerrit.reviewdb.client.Change ... changes ) throws java.lang.Exception { java.util.List < com.google.gerrit.extensions.common.ChangeInfo > result = query.get ( ) ; java.lang.Iterable < java.lang.Integer > ids = com.google.gerrit.server.query.change.AbstractQueryChangesTest.ids ( result ) ; com.google.common.truth.Truth.assertThat ( ids ) . named ( query.getQuery ( ) ) . containsExactlyElementsIn ( com.google.gerrit.server.query.change.AbstractQueryChangesTest.ids ( changes ) ) . inOrder ( ) ; return result ; }

Target:
protected java.util.List < com.google.gerrit.extensions.common.ChangeInfo > assertQuery ( com.google.gerrit.extensions.api.changes.Changes.QueryRequest query , com.google.gerrit.reviewdb.client.Change ... changes ) throws java.lang.Exception { java.util.List < com.google.gerrit.extensions.common.ChangeInfo > result = query.get ( ) ; java.lang.Iterable < java.lang.Integer > ids = com.google.gerrit.server.query.change.AbstractQueryChangesTest.ids ( result ) ; com.google.common.truth.Truth.assertThat ( ids ) . named ( format ( query , ids , changes ) ) . containsExactlyElementsIn ( com.google.gerrit.server.query.change.AbstractQueryChangesTest.ids ( changes ) ) . inOrder ( ) ; return result ; }
Source:
public void execute ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( isEmpty ( ) ) { return ; } try { initChangeRepo ( ) ; if ( ! ( draftUpdates.isEmpty ( ) ) ) { initAllUsersRepo ( ) ; } addCommands ( ) ; com.google.gerrit.server.notedb.NoteDbUpdateManager.execute ( allUsersRepo ) ; com.google.gerrit.server.notedb.NoteDbUpdateManager.execute ( changeRepo ) ; } finally { if ( ( allUsersRepo ) != null ) { allUsersRepo.close ( ) ; } if ( ( changeRepo ) != null ) { changeRepo.close ( ) ; } } }

Target:
public void execute ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( isEmpty ( ) ) { return ; } try { initChangeRepo ( ) ; if ( ! ( draftUpdates.isEmpty ( ) ) ) { initAllUsersRepo ( ) ; } addCommands ( ) ; com.google.gerrit.server.notedb.NoteDbUpdateManager.execute ( changeRepo ) ; com.google.gerrit.server.notedb.NoteDbUpdateManager.execute ( allUsersRepo ) ; } finally { if ( ( allUsersRepo ) != null ) { allUsersRepo.close ( ) ; } if ( ( changeRepo ) != null ) { changeRepo.close ( ) ; } } }
Source:
public void byFileRegex ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; org.eclipse.jgit.revwalk.RevCommit commit = repo.parseBody ( repo.commit ( ) . message ( "one" ) . add ( "dir/file1" , "contents1" ) . add ( "dir/file2" , "contents2" ) . create ( ) ) ; com.google.gerrit.reviewdb.client.Change change = newChange ( repo , commit , null , null , null ) . insert ( ) ; assertQuery ( "file:.*file.*" ) ; assertQuery ( "file:^file.*" ) ; assertQuery ( "file:^dir.file.*" , change ) ; }

Target:
public void byFileRegex ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; org.eclipse.jgit.revwalk.RevCommit commit = repo.parseBody ( repo.commit ( ) . message ( "one" ) . add ( "dir/file1" , "contents1" ) . add ( "dir/file2" , "contents2" ) . create ( ) ) ; com.google.gerrit.reviewdb.client.Change change = insert ( newChange ( repo , commit , null , null , null ) ) ; assertQuery ( "file:.*file.*" ) ; assertQuery ( "file:^file.*" ) ; assertQuery ( "file:^dir.file.*" , change ) ; }
Source:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.account.AccountResource.StarredChange rsrc , com.google.gerrit.server.account.StarredChanges.EmptyInput in ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gwtorm.server.OrmException { if ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "not allowed remove starred change" ) ; } starredChangesUtil.unstar ( self.get ( ) . getAccountId ( ) , rsrc.getChange ( ) . getId ( ) ) ; return com.google.gerrit.extensions.restapi.Response.none ( ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.account.AccountResource.StarredChange rsrc , com.google.gerrit.server.account.StarredChanges.EmptyInput in ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gwtorm.server.OrmException , java.io.IOException { if ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "not allowed remove starred change" ) ; } starredChangesUtil.unstar ( self.get ( ) . getAccountId ( ) , rsrc.getChange ( ) . getProject ( ) , rsrc.getChange ( ) . getId ( ) ) ; return com.google.gerrit.extensions.restapi.Response.none ( ) ; }
Source:
protected void configure ( ) { install ( new com.google.gerrit.server.schema.SchemaVersion.Module ( ) ) ; bind ( org.eclipse.jgit.lib.PersonIdent.class ) . annotatedWith ( com.google.gerrit.server.GerritPersonIdent.class ) . toProvider ( com.google.gerrit.server.GerritPersonIdentProvider.class ) ; bind ( com.google.gerrit.server.config.AllProjectsName.class ) . toProvider ( com.google.gerrit.server.config.AllProjectsNameProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( com.google.gerrit.server.config.AllUsersName.class ) . toProvider ( com.google.gerrit.server.config.AllUsersNameProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.server.config.AnonymousCowardName.class ) . toProvider ( com.google.gerrit.server.config.AnonymousCowardNameProvider.class ) ; }

Target:
protected void configure ( ) { bind ( org.eclipse.jgit.lib.PersonIdent.class ) . annotatedWith ( com.google.gerrit.server.GerritPersonIdent.class ) . toProvider ( com.google.gerrit.server.GerritPersonIdentProvider.class ) ; bind ( com.google.gerrit.server.config.AllProjectsName.class ) . toProvider ( com.google.gerrit.server.config.AllProjectsNameProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( com.google.gerrit.server.config.AllUsersName.class ) . toProvider ( com.google.gerrit.server.config.AllUsersNameProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.server.config.AnonymousCowardName.class ) . toProvider ( com.google.gerrit.server.config.AnonymousCowardNameProvider.class ) ; }
Source:
private static java.lang.String metricNameOf ( com.google.gerrit.extensions.registration.DynamicMap.Entry < com.google.common.cache.Cache < ? , ? > > e ) { if ( "gerrit" . equals ( e.getPluginName ( ) ) ) { return e.getExportName ( ) ; } else { return java.lang.String.format ( "plugin/%s/%s" , e.getPluginName ( ) , e.getExportName ( ) ) ; } }

Target:
private static java.lang.String metricNameOf ( com.google.gerrit.extensions.registration.DynamicMap.Entry < com.google.common.cache.Cache < ? , ? > > e ) { if ( "gerrit" . equals ( e.getPluginName ( ) ) ) { return e.getExportName ( ) ; } return java.lang.String.format ( "plugin/%s/%s" , e.getPluginName ( ) , e.getExportName ( ) ) ; }
Source:
public void addPatchSetComments ( com.google.gerrit.server.data.PatchSetAttribute patchSetAttribute , java.util.Collection < com.google.gerrit.reviewdb.client.Comment > comments ) { for ( com.google.gerrit.reviewdb.client.Comment comment : comments ) { if ( ( comment.key.patchSetId ) == ( java.lang.Integer.parseInt ( patchSetAttribute.number ) ) ) { if ( ( patchSetAttribute.comments ) == null ) { patchSetAttribute.comments = new java.util.ArrayList < > ( ) ; } patchSetAttribute.comments.add ( asPatchSetLineAttribute ( comment ) ) ; } } }

Target:
public void addPatchSetComments ( com.google.gerrit.server.data.PatchSetAttribute patchSetAttribute , java.util.Collection < com.google.gerrit.reviewdb.client.Comment > comments ) { for ( com.google.gerrit.reviewdb.client.Comment comment : comments ) { if ( ( comment.key.patchSetId ) == ( patchSetAttribute.number ) ) { if ( ( patchSetAttribute.comments ) == null ) { patchSetAttribute.comments = new java.util.ArrayList < > ( ) ; } patchSetAttribute.comments.add ( asPatchSetLineAttribute ( comment ) ) ; } } }
Source:
private void assertHead ( java.lang.String projectName , java.lang.String expectedRef ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( new com.google.gerrit.reviewdb.client.Project.NameKey ( projectName ) ) ; try { com.google.common.truth.Truth.assertThat ( repo.getRef ( Constants.HEAD ) . getTarget ( ) . getName ( ) ) . isEqualTo ( expectedRef ) ; } finally { repo.close ( ) ; } }

Target:
private void assertHead ( java.lang.String projectName , java.lang.String expectedRef ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( new com.google.gerrit.reviewdb.client.Project.NameKey ( projectName ) ) ) { com.google.common.truth.Truth.assertThat ( repo.getRef ( Constants.HEAD ) . getTarget ( ) . getName ( ) ) . isEqualTo ( expectedRef ) ; } }
Source:
public void testUnblockForce ( ) { 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/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertTrue ( "u can force push" , u.controlForRef ( "refs/heads/master" ) . canForceUpdate ( ) ) ; }

Target:
public void testUnblockForce ( ) { 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/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertTrue ( "u can force push" , u.controlForRef ( "refs/heads/master" ) . canForceUpdate ( ) ) ; }
Source:
public void deleteReviewerFromReviewableChangeByAdmin ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; setApiUser ( admin ) ; removeReviewer ( sc , extraReviewer ) ; assertThat ( sender ) . sent ( "deleteReviewer" , sc ) . to ( sc.owner , extraReviewer ) . to ( sc.reviewerByEmail ) . cc ( extraCcer , sc.reviewer , sc.ccer ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void deleteReviewerFromReviewableChangeByAdmin ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; setApiUser ( admin ) ; removeReviewer ( sc , extraReviewer ) ; assertThat ( sender ) . sent ( "deleteReviewer" , sc ) . to ( sc.owner , extraReviewer ) . cc ( extraCcer , sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }
Source:
private void header ( com.google.gwtexpui.safehtml.client.SafeHtmlBuilder sb ) { sb.openTr ( ) . openTh ( ) . setStyleName ( style.legacy_id ( ) ) . append ( Resources.C.ps ( ) ) . closeTh ( ) . openTh ( ) . append ( Resources.C.commit ( ) ) . closeTh ( ) . openTh ( ) . append ( Resources.C.date ( ) ) . closeTh ( ) . openTh ( ) . append ( Resources.C.author ( ) ) . closeTh ( ) . closeTr ( ) ; }

Target:
private void header ( com.google.gwtexpui.safehtml.client.SafeHtmlBuilder sb ) { sb.openTr ( ) . openTh ( ) . setStyleName ( style.legacy_id ( ) ) . append ( Resources.C.patchSet ( ) ) . closeTh ( ) . openTh ( ) . append ( Resources.C.commit ( ) ) . closeTh ( ) . openTh ( ) . append ( Resources.C.date ( ) ) . closeTh ( ) . openTh ( ) . append ( Resources.C.author ( ) ) . closeTh ( ) . closeTr ( ) ; }
Source:
public void setParent_Forbidden ( ) throws java.lang.Exception { java.lang.String parent = "parent" ; com.google.gerrit.acceptance.GitUtil.createProject ( sshSession , parent , null , true ) ; com.google.gerrit.acceptance.RestResponse r = userSession.put ( ( ( "/projects/" + ( project.get ( ) ) ) + "/parent" ) , newParentInput ( parent ) ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_FORBIDDEN , r.getStatusCode ( ) ) ; r.consume ( ) ; }

Target:
public void setParent_Forbidden ( ) throws java.lang.Exception { java.lang.String parent = "parent" ; com.google.gerrit.acceptance.GitUtil.createProject ( sshSession , parent , null , true ) ; com.google.gerrit.acceptance.RestResponse r = userSession.put ( ( ( "/projects/" + ( project.get ( ) ) ) + "/parent" ) , newParentInput ( parent ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_FORBIDDEN ) ; r.consume ( ) ; }