auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static java.util.List < java.lang.String > transformCommits ( java.util.List < org.eclipse.jgit.lib.ObjectId > commits ) { if ( ( commits == null ) || ( commits.isEmpty ( ) ) ) { return null ; } return com.google.common.collect.Lists.transform ( commits , new com.google.common.base.Function < org.eclipse.jgit.lib.ObjectId , java.lang.String > ( ) { @ java.lang.Override public java.lang.String apply ( org.eclipse.jgit.lib.ObjectId id ) { return id.getName ( ) ; } } ) ; }

Target:
private static java.util.List < java.lang.String > transformCommits ( java.util.List < org.eclipse.jgit.lib.ObjectId > commits ) { if ( ( commits == null ) || ( commits.isEmpty ( ) ) ) { return null ; } return com.google.common.collect.Lists.transform ( commits , ObjectId :: getName ) ; }
Source:
public java.lang.Void call ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( caller == ( java.lang.Thread.currentThread ( ) ) ) { insertChange ( db ) ; } else { com.google.gerrit.reviewdb.server.ReviewDb db = schemaFactory.open ( ) ; try { insertChange ( db ) ; } finally { db.close ( ) ; } } synchronized ( newProgress ) { newProgress.update ( 1 ) ; } return null ; }

Target:
public java.lang.Void call ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException { if ( caller == ( java.lang.Thread.currentThread ( ) ) ) { insertChange ( db ) ; } else { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schemaFactory.open ( ) ) { insertChange ( db ) ; } } synchronized ( newProgress ) { newProgress.update ( 1 ) ; } return null ; }
Source:
protected void configure ( ) { factory ( ReviewerResource.Factory.class ) ; factory ( AccountInfo.Loader.Factory.class ) ; factory ( EmailReviewComments.Factory.class ) ; factory ( ChangeInserter.Factory.class ) ; factory ( PatchSetInserter.Factory.class ) ; factory ( CreateChange.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( ReviewerResource.Factory.class ) ; factory ( AccountInfo.Loader.Factory.class ) ; factory ( EmailReviewComments.Factory.class ) ; factory ( ChangeInserter.Factory.class ) ; factory ( PatchSetInserter.Factory.class ) ; }
Source:
private static java.util.TreeMap < java.lang.Integer , com.google.gerrit.reviewdb.client.PatchSet > getPatchSets ( com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { java.util.Collection < com.google.gerrit.reviewdb.client.PatchSet > patchSets = cd.patches ( ) ; java.util.TreeMap < java.lang.Integer , com.google.gerrit.reviewdb.client.PatchSet > result = com.google.common.collect.Maps.newTreeMap ( ) ; for ( com.google.gerrit.reviewdb.client.PatchSet ps : patchSets ) { result.put ( ps.getId ( ) . get ( ) , ps ) ; } return result ; }

Target:
private static java.util.TreeMap < java.lang.Integer , com.google.gerrit.reviewdb.client.PatchSet > getPatchSets ( com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { java.util.Collection < com.google.gerrit.reviewdb.client.PatchSet > patchSets = cd.patchSets ( ) ; java.util.TreeMap < java.lang.Integer , com.google.gerrit.reviewdb.client.PatchSet > result = com.google.common.collect.Maps.newTreeMap ( ) ; for ( com.google.gerrit.reviewdb.client.PatchSet ps : patchSets ) { result.put ( ps.getId ( ) . get ( ) , ps ) ; } return result ; }
Source:
private java.lang.String call ( final java.lang.String body ) throws java.lang.Exception { final java.io.File tmp = write ( body ) ; try { final java.io.File hook = getHook ( "commit-msg" ) ; assertEquals ( 0 , runHook ( repository , hook , tmp.getAbsolutePath ( ) ) ) ; return read ( tmp ) ; } finally { tmp.delete ( ) ; } }

Target:
private java.lang.String call ( final java.lang.String body ) throws java.lang.Exception { final java.io.File tmp = write ( body ) ; try { final java.io.File hook = getHook ( "commit-msg" ) ; org.junit.Assert.assertEquals ( 0 , runHook ( repository , hook , tmp.getAbsolutePath ( ) ) ) ; return read ( tmp ) ; } finally { tmp.delete ( ) ; } }
Source:
public void testUnblockMoreSpecificRef_Fails ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/master" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertFalse ( "u can't push" , u.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }

Target:
public void testUnblockMoreSpecificRef_Fails ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/master" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't push" , u.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }
Source:
public com.google.gerrit.server.git.ChangeSet completeChangeSet ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.CurrentUser user ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { com.google.gerrit.server.query.change.ChangeData cd = changeDataFactory.create ( db , change.getProject ( ) , change.getId ( ) ) ; cd.changeControl ( user ) ; if ( com.google.gerrit.server.change.Submit.wholeTopicEnabled ( cfg ) ) { return completeChangeSetIncludingTopics ( db , new com.google.gerrit.server.git.ChangeSet ( cd ) , user ) ; } else { return completeChangeSetWithoutTopic ( db , new com.google.gerrit.server.git.ChangeSet ( cd ) , user ) ; } }

Target:
public com.google.gerrit.server.git.ChangeSet completeChangeSet ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.CurrentUser user ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { com.google.gerrit.server.query.change.ChangeData cd = changeDataFactory.create ( db , change.getProject ( ) , change.getId ( ) ) ; cd.changeControl ( user ) ; if ( com.google.gerrit.server.change.Submit.wholeTopicEnabled ( cfg ) ) { return completeChangeSetIncludingTopics ( db , new com.google.gerrit.server.git.ChangeSet ( cd ) , user ) ; } return completeChangeSetWithoutTopic ( db , new com.google.gerrit.server.git.ChangeSet ( cd ) , user ) ; }
Source:
protected void deny ( java.lang.String permission , com.google.gerrit.reviewdb.client.AccountGroup.UUID id , java.lang.String ref ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.server.project.Util.deny ( cfg , permission , id , ref ) ; saveProjectConfig ( project , cfg ) ; }

Target:
protected void deny ( com.google.gerrit.reviewdb.client.Project.NameKey p , java.lang.String permission , com.google.gerrit.reviewdb.client.AccountGroup.UUID id , java.lang.String ref ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( p ) . getConfig ( ) ; com.google.gerrit.server.project.Util.deny ( cfg , permission , id , ref ) ; saveProjectConfig ( p , cfg ) ; }
Source:
public void push ( com.googlecode.prolog_cafe.lang.Undoable t ) { try { buffer [ ( ++ ( top ) ) ] = t ; } catch ( java.lang.ArrayIndexOutOfBoundsException e ) { int len = buffer.length ; com.googlecode.prolog_cafe.lang.Undoable [ ] new_buffer = new com.googlecode.prolog_cafe.lang.Undoable [ len + 20000 ] ; java.lang.System.arraycopy ( buffer , 0 , new_buffer , 0 , len ) ; buffer = new_buffer ; buffer [ top ] = t ; } }

Target:
public void push ( com.googlecode.prolog_cafe.lang.Undoable t ) { if ( ( ++ ( top ) ) >= ( buffer.length ) ) { int len = buffer.length ; com.googlecode.prolog_cafe.lang.Undoable [ ] new_buffer = new com.googlecode.prolog_cafe.lang.Undoable [ 2 * len ] ; java.lang.System.arraycopy ( buffer , 0 , new_buffer , 0 , len ) ; buffer = new_buffer ; } buffer [ top ] = t ; }
Source:
private void fireEvent ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.common.Event event , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.common.ChangeHookRunner.EventListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( change , holder.user , db ) ) { holder.listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }

Target:
private void fireEvent ( com.google.gerrit.common.Event event , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.common.ChangeHookRunner.EventListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( event , holder.user , db ) ) { holder.listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }
Source:
private static com.googlecode.prolog_cafe.lang.Term toListTerm ( java.util.List < com.googlecode.prolog_cafe.lang.Term > terms ) { com.googlecode.prolog_cafe.lang.Term list = com.googlecode.prolog_cafe.lang.Prolog.Nil ; for ( int i = ( terms.size ( ) ) - 1 ; i >= 0 ; i -- ) { list = new com.googlecode.prolog_cafe.lang.ListTerm ( terms.get ( i ) , list ) ; } return list ; }

Target:
public static com.googlecode.prolog_cafe.lang.Term toListTerm ( java.util.List < com.googlecode.prolog_cafe.lang.Term > terms ) { com.googlecode.prolog_cafe.lang.Term list = com.googlecode.prolog_cafe.lang.Prolog.Nil ; for ( int i = ( terms.size ( ) ) - 1 ; i >= 0 ; i -- ) { list = new com.googlecode.prolog_cafe.lang.ListTerm ( terms.get ( i ) , list ) ; } return list ; }
Source:
com.google.common.util.concurrent.ListeningExecutorService getBatchIndexExecutor ( @ com.google.gerrit.server.config.GerritServerConfig org.eclipse.jgit.lib.Config config , com.google.gerrit.server.git.WorkQueue workQueue ) { if ( ( batchExecutor ) != null ) { return batchExecutor ; } int threads = config.getInt ( "index" , null , "batchThreads" , 0 ) ; if ( threads <= 0 ) { threads = config.getInt ( "changeMerge" , null , "threadPoolSize" , 0 ) ; } if ( threads <= 0 ) { threads = java.lang.Runtime.getRuntime ( ) . availableProcessors ( ) ; } return com.google.common.util.concurrent.MoreExecutors.listeningDecorator ( workQueue.createQueue ( threads , "Index-Batch" ) ) ; }

Target:
com.google.common.util.concurrent.ListeningExecutorService getBatchIndexExecutor ( @ com.google.gerrit.server.config.GerritServerConfig org.eclipse.jgit.lib.Config config , com.google.gerrit.server.git.WorkQueue workQueue ) { if ( ( batchExecutor ) != null ) { return batchExecutor ; } int threads = config.getInt ( "index" , null , "batchThreads" , 0 ) ; if ( threads <= 0 ) { threads = java.lang.Runtime.getRuntime ( ) . availableProcessors ( ) ; } return com.google.common.util.concurrent.MoreExecutors.listeningDecorator ( workQueue.createQueue ( threads , "Index-Batch" ) ) ; }
Source:
public static java.util.Map < java.lang.String , java.lang.String > menuEntry ( java.lang.String text , java.lang.String url ) { if ( url != null ) { return com.google.common.collect.ImmutableMap.of ( "text" , text , "url" , url ) ; } else { return com.google.common.collect.ImmutableMap.of ( "text" , text ) ; } }

Target:
public static java.util.Map < java.lang.String , java.lang.String > menuEntry ( java.lang.String text , java.lang.String url ) { if ( url != null ) { return com.google.common.collect.ImmutableMap.of ( "text" , text , "url" , url ) ; } return com.google.common.collect.ImmutableMap.of ( "text" , text ) ; }
Source:
public void mergeByReviewerCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS , com.google.gerrit.server.account.WatchConfig.NotifyType.SUBMITTED_CHANGES ) ; merge ( sc.changeId , sc.reviewer , EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "merged" , sc ) . to ( sc.owner ) . to ( sc.reviewerByEmail ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS , com.google.gerrit.server.account.WatchConfig.NotifyType.SUBMITTED_CHANGES ) ; }

Target:
public void mergeByReviewerCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS , com.google.gerrit.server.account.WatchConfig.NotifyType.SUBMITTED_CHANGES ) ; merge ( sc.changeId , sc.reviewer , EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "merged" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS , com.google.gerrit.server.account.WatchConfig.NotifyType.SUBMITTED_CHANGES ) ; }
Source:
private static org.eclipse.jgit.patch.Patch parsePatch ( byte [ ] enc ) { byte [ ] buf = com.google.common.io.BaseEncoding.base64 ( ) . decode ( new java.lang.String ( enc , java.nio.charset.StandardCharsets.UTF_8 ) ) ; org.eclipse.jgit.patch.Patch p = new org.eclipse.jgit.patch.Patch ( ) ; p.parse ( buf , 0 , buf.length ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( ) , p.getErrors ( ) ) ; return p ; }

Target:
private static org.eclipse.jgit.patch.Patch parsePatch ( byte [ ] enc ) { byte [ ] buf = com.google.common.io.BaseEncoding.base64 ( ) . decode ( new java.lang.String ( enc , java.nio.charset.StandardCharsets.UTF_8 ) ) ; org.eclipse.jgit.patch.Patch p = new org.eclipse.jgit.patch.Patch ( ) ; p.parse ( buf , 0 , buf.length ) ; com.google.common.truth.Truth.assertThat ( p.getErrors ( ) ) . isEqualTo ( com.google.common.collect.ImmutableList.of ( ) ) ; return p ; }
Source:
private void createDraftUpdateIfNull ( com.google.gerrit.reviewdb.client.PatchLineComment c ) { if ( ( draftUpdate ) == null ) { draftUpdate = draftUpdateFactory.create ( ctl , when ) ; if ( ( psId ) != null ) { draftUpdate.setPatchSetId ( psId ) ; } else { draftUpdate.setPatchSetId ( com.google.gerrit.server.notedb.CommentsInNotesUtil.getCommentPsId ( c ) ) ; } } }

Target:
private void createDraftUpdateIfNull ( ) { if ( ( draftUpdate ) == null ) { draftUpdate = draftUpdateFactory.create ( ctl , when ) ; } }
Source:
public java.lang.String getChangeUrl ( ) { if ( ( ( change ) != null ) && ( ( getGerritUrl ( ) ) != null ) ) { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( getGerritUrl ( ) ) ; r.append ( change.getChangeId ( ) ) ; return r.toString ( ) ; } return null ; }

Target:
public java.lang.String getChangeUrl ( ) { if ( ( getGerritUrl ( ) ) != null ) { final java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( getGerritUrl ( ) ) ; r.append ( change.getChangeId ( ) ) ; return r.toString ( ) ; } return null ; }
Source:
public com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope [ ] getDefaultScopes ( ) { if ( ( ( scopes ) == null ) || ( ( scopes.get ( "scopes" ) ) == null ) ) { return new com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope [ 0 ] ; } return scopes.get ( "scopes" ) . toArray ( new com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope [ 0 ] ) ; }

Target:
public com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope [ ] getDefaultScopes ( ) { if ( ( ( scopes ) == null ) || ( ( scopes.get ( "scopes" ) ) == null ) ) { return new com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope [ 0 ] ; } else { return scopes.get ( "scopes" ) . toArray ( new com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.Scope [ 0 ] ) ; } }
Source:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; if ( sshd ) { modules.add ( new com.google.gerrit.sshd.SshModule ( ) ) ; if ( slave ) { modules.add ( new com.google.gerrit.sshd.commands.SlaveCommandModule ( ) ) ; } else { modules.add ( new com.google.gerrit.sshd.commands.MasterCommandModule ( ) ) ; modules.add ( cfgInjector.getInstance ( com.google.gerrit.sshd.commands.MasterPluginsModule.class ) ) ; } } else { modules.add ( new com.google.gerrit.server.ssh.NoSshModule ( ) ) ; } return sysInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; if ( sshd ) { modules.add ( new com.google.gerrit.sshd.SshModule ( ) ) ; if ( slave ) { modules.add ( new com.google.gerrit.sshd.commands.SlaveCommandModule ( ) ) ; } else { modules.add ( new com.google.gerrit.sshd.commands.MasterCommandModule ( ) ) ; } } else { modules.add ( new com.google.gerrit.server.ssh.NoSshModule ( ) ) ; } return sysInjector.createChildInjector ( modules ) ; }
Source:
private void initColumns ( ) throws com.google.gwtorm.server.OrmException { final java.util.List < com.google.gwtorm.schema.java.JavaColumnModel > col = new java.util.ArrayList < com.google.gwtorm.schema.java.JavaColumnModel > ( ) ; java.lang.Class < ? > in = entityType ; while ( in != null ) { for ( final java.lang.reflect.Field f : in.getDeclaredFields ( ) ) { if ( ( f.getAnnotation ( com.google.gwtorm.client.Column.class ) ) != null ) { col.add ( new com.google.gwtorm.schema.java.JavaColumnModel ( f ) ) ; } } in = in.getSuperclass ( ) ; } initColumns ( col ) ; }

Target:
private void initColumns ( ) throws com.google.gwtorm.server.OrmException { final java.util.List < com.google.gwtorm.schema.java.JavaColumnModel > col = new java.util.ArrayList < com.google.gwtorm.schema.java.JavaColumnModel > ( ) ; java.lang.Class < ? > in = entityType ; while ( in != null ) { for ( final java.lang.reflect.Field f : com.google.gwtorm.schema.java.JavaColumnModel.getDeclaredFields ( in ) ) { if ( ( f.getAnnotation ( com.google.gwtorm.client.Column.class ) ) != null ) { col.add ( new com.google.gwtorm.schema.java.JavaColumnModel ( f ) ) ; } } in = in.getSuperclass ( ) ; } initColumns ( col ) ; }
Source:
public void updateRepo ( com.google.gerrit.server.git.BatchUpdate.RepoContext ctx ) throws java.lang.Exception { com.google.gerrit.server.git.CodeReviewCommit c = composeGitlinksCommit ( branch , null ) ; ctx.addRefUpdate ( new org.eclipse.jgit.transport.ReceiveCommand ( c.getParent ( 0 ) , c , branch.get ( ) ) ) ; addBranchTip ( branch , c ) ; }

Target:
public void updateRepo ( com.google.gerrit.server.git.BatchUpdate.RepoContext ctx ) throws java.lang.Exception { com.google.gerrit.server.git.CodeReviewCommit c = composeGitlinksCommit ( branch ) ; if ( c != null ) { ctx.addRefUpdate ( new org.eclipse.jgit.transport.ReceiveCommand ( c.getParent ( 0 ) , c , branch.get ( ) ) ) ; addBranchTip ( branch , c ) ; } }
Source:
private static java.lang.String defaultOf ( com.google.gerrit.reviewdb.client.Project proj ) { final java.lang.String defaultId = com.google.common.base.MoreObjects.firstNonNull ( proj.getLocalDefaultDashboard ( ) , com.google.common.base.Strings.nullToEmpty ( proj.getDefaultDashboard ( ) ) ) ; if ( defaultId.startsWith ( com.google.gerrit.reviewdb.client.RefNames.REFS_DASHBOARDS ) ) { return defaultId.substring ( com.google.gerrit.reviewdb.client.RefNames.REFS_DASHBOARDS.length ( ) ) ; } else { return defaultId ; } }

Target:
private static java.lang.String defaultOf ( com.google.gerrit.reviewdb.client.Project proj ) { final java.lang.String defaultId = com.google.common.base.MoreObjects.firstNonNull ( proj.getLocalDefaultDashboard ( ) , com.google.common.base.Strings.nullToEmpty ( proj.getDefaultDashboard ( ) ) ) ; if ( defaultId.startsWith ( com.google.gerrit.reviewdb.client.RefNames.REFS_DASHBOARDS ) ) { return defaultId.substring ( com.google.gerrit.reviewdb.client.RefNames.REFS_DASHBOARDS.length ( ) ) ; } return defaultId ; }
Source:
com.google.gerrit.client.diff.DisplaySide displaySide ( com.google.gerrit.client.changes.CommentInfo info , com.google.gerrit.client.diff.DisplaySide forSide ) { if ( ( info.side ( ) ) == ( com.google.gerrit.extensions.client.Side.PARENT ) ) { return ( base ) == null ? DisplaySide.A : null ; } return forSide ; }

Target:
com.google.gerrit.client.diff.DisplaySide displaySide ( com.google.gerrit.client.changes.CommentInfo info , com.google.gerrit.client.diff.DisplaySide forSide ) { if ( ( info.side ( ) ) == ( com.google.gerrit.extensions.client.Side.PARENT ) ) { return ( ( base ) == null ) || ( ( base.get ( ) ) < 0 ) ? DisplaySide.A : null ; } return forSide ; }
Source:
protected void configure ( ) { factory ( EditCommitMessageHandler.Factory.class ) ; factory ( RebaseChangeHandler.Factory.class ) ; factory ( ChangeDetailFactory.Factory.class ) ; factory ( IncludedInDetailFactory.Factory.class ) ; factory ( PatchSetDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; factory ( PublishAction.Factory.class ) ; factory ( DeleteDraftChange.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( RebaseChangeHandler.Factory.class ) ; factory ( ChangeDetailFactory.Factory.class ) ; factory ( IncludedInDetailFactory.Factory.class ) ; factory ( PatchSetDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; factory ( PublishAction.Factory.class ) ; factory ( DeleteDraftChange.Factory.class ) ; }
Source:
public java.util.List < com.google.gerrit.reviewdb.client.PatchLineComment > getForA ( final int lineNbr ) { if ( lineNbr == 0 ) { return java.util.Collections.emptyList ( ) ; } if ( ( forA ) == null ) { forA = index ( a ) ; } return com.google.gerrit.common.data.CommentDetail.get ( forA , lineNbr ) ; }

Target:
public java.util.List < com.google.gerrit.reviewdb.client.PatchLineComment > getForA ( final int lineNbr ) { if ( ( forA ) == null ) { forA = index ( a ) ; } return com.google.gerrit.common.data.CommentDetail.get ( forA , lineNbr ) ; }
Source:
public com.google.gerrit.server.git.ChangeSet completeChangeSet ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.CurrentUser user ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { com.google.gerrit.server.query.change.ChangeData cd = changeDataFactory.create ( db , change.getProject ( ) , change.getId ( ) ) ; cd.changeControl ( user ) ; if ( com.google.gerrit.server.change.Submit.wholeTopicEnabled ( cfg ) ) { return completeChangeSetIncludingTopics ( db , new com.google.gerrit.server.git.ChangeSet ( cd , db , null ) , user ) ; } return completeChangeSetWithoutTopic ( db , new com.google.gerrit.server.git.ChangeSet ( cd , db , null ) , user ) ; }

Target:
public com.google.gerrit.server.git.ChangeSet completeChangeSet ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.CurrentUser user ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { com.google.gerrit.server.query.change.ChangeData cd = changeDataFactory.create ( db , change.getProject ( ) , change.getId ( ) ) ; cd.changeControl ( user ) ; if ( com.google.gerrit.server.change.Submit.wholeTopicEnabled ( cfg ) ) { return completeChangeSetIncludingTopics ( db , new com.google.gerrit.server.git.ChangeSet ( cd ) , user ) ; } return completeChangeSetWithoutTopic ( db , new com.google.gerrit.server.git.ChangeSet ( cd ) , user ) ; }
Source:
public org.eclipse.jgit.lib.ObjectId commit ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.notedb.NoteDbUpdateManager updateManager = updateManagerFactory.create ( getProjectName ( ) ) ; updateManager.add ( this ) ; com.google.gerrit.server.notedb.NoteDbChangeState.applyDelta ( getChange ( ) , updateManager.stage ( ) . get ( getId ( ) ) ) ; updateManager.execute ( ) ; return getResult ( ) ; }

Target:
public org.eclipse.jgit.lib.ObjectId commit ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.notedb.NoteDbUpdateManager updateManager = updateManagerFactory.create ( getProjectName ( ) ) ; updateManager.add ( this ) ; com.google.gerrit.server.notedb.NoteDbChangeState.applyDelta ( getChange ( ) , updateManager.stage ( ) ) ; updateManager.execute ( ) ; return getResult ( ) ; }
Source:
public java.lang.String getStatusDescription ( ) { if ( ( exception ) != null ) { return getErrorDescription ( exception ) ; } else { switch ( status.getStatus ( ) ) { case COMPLETE : return "Cloned (100%)" ; case CANCELLED : return "Cancelled" ; default : return ( ( ( ( ( "Phase-" + ( currTask ) ) + " / " ) + ( task ) ) + " (" ) + ( lastPercentage ) ) + "%)" ; } } }

Target:
public java.lang.String getStatusDescription ( ) { if ( ( exception ) != null ) { return getErrorDescription ( exception ) ; } switch ( status.getStatus ( ) ) { case COMPLETE : return "Cloned (100%)" ; case CANCELLED : return "Cancelled" ; default : return ( ( ( ( ( "Phase-" + ( currTask ) ) + " / " ) + ( task ) ) + " (" ) + ( lastPercentage ) ) + "%)" ; } }
Source:
private static java.util.List < com.googlesource.gerrit.plugins.analytics.CommitInfo > getCommits ( org.eclipse.jgit.lib.ObjectId [ ] ids , long [ ] times , boolean [ ] merges ) { java.util.List < com.googlesource.gerrit.plugins.analytics.CommitInfo > commits = new java.util.ArrayList ( ids.length ) ; for ( int i = 0 ; i < ( ids.length ) ; i ++ ) { commits.add ( new com.googlesource.gerrit.plugins.analytics.CommitInfo ( ids [ i ] . name ( ) , new java.util.Date ( times [ i ] ) , merges [ i ] ) ) ; } return commits ; }

Target:
private static java.util.List < com.googlesource.gerrit.plugins.analytics.CommitInfo > getCommits ( org.eclipse.jgit.lib.ObjectId [ ] ids , long [ ] times , boolean [ ] merges ) { java.util.List < com.googlesource.gerrit.plugins.analytics.CommitInfo > commits = new java.util.ArrayList ( ids.length ) ; for ( int i = 0 ; i < ( ids.length ) ; i ++ ) { commits.add ( new com.googlesource.gerrit.plugins.analytics.CommitInfo ( ids [ i ] . name ( ) , times [ i ] , merges [ i ] ) ) ; } return commits ; }
Source:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.RevisionInfo revision , com.google.gerrit.extensions.common.AccountInfo uploader , java.sql.Timestamp when , com.google.gerrit.extensions.api.changes.NotifyHandling notify ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.RevisionCreated.Event event = new com.google.gerrit.server.extensions.events.RevisionCreated.Event ( change , revision , uploader , when , notify ) ; for ( com.google.gerrit.extensions.events.RevisionCreatedListener l : listeners ) { try { l.onRevisionCreated ( event ) ; } catch ( java.lang.Exception e ) { util.logEventListenerError ( com.google.gerrit.server.extensions.events.RevisionCreated.log , e ) ; } } }

Target:
private void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.RevisionInfo revision , com.google.gerrit.extensions.common.AccountInfo uploader , java.sql.Timestamp when , com.google.gerrit.extensions.api.changes.NotifyHandling notify ) { com.google.gerrit.server.extensions.events.RevisionCreated.Event event = new com.google.gerrit.server.extensions.events.RevisionCreated.Event ( change , revision , uploader , when , notify ) ; for ( com.google.gerrit.extensions.events.RevisionCreatedListener l : listeners ) { try { l.onRevisionCreated ( event ) ; } catch ( java.lang.Exception e ) { util.logEventListenerError ( com.google.gerrit.server.extensions.events.RevisionCreated.log , e ) ; } } }
Source:
public void load ( org.eclipse.jgit.revwalk.RevWalk walk , org.eclipse.jgit.lib.ObjectId id ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { this . rw = walk ; this . reader = walk.getObjectReader ( ) ; try { revision = ( id != null ) ? walk.parseCommit ( id ) : null ; onLoad ( ) ; } finally { walk = null ; reader = null ; } }

Target:
public void load ( org.eclipse.jgit.revwalk.RevWalk walk , org.eclipse.jgit.lib.ObjectId id ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { this . rw = walk ; this . reader = walk.getObjectReader ( ) ; try { revision = ( id != null ) ? walk.parseCommit ( id ) : null ; onLoad ( ) ; } finally { this . rw = null ; this . reader = null ; } }
Source:
public static boolean siteReliesOnHttp ( ) { return ( ( ( com.google.gerrit.client.Gerrit.getConfig ( ) . getGitHttpUrl ( ) ) != null ) && ( com.google.gerrit.client.Gerrit.getInfo ( ) . auth ( ) . isCustomExtension ( ) ) ) && ( ! ( com.google.gerrit.client.Gerrit.getConfig ( ) . siteHasUsernames ( ) ) ) ; }

Target:
public static boolean siteReliesOnHttp ( ) { return ( ( ( com.google.gerrit.client.Gerrit.getConfig ( ) . getGitHttpUrl ( ) ) != null ) && ( com.google.gerrit.client.Gerrit.info ( ) . auth ( ) . isCustomExtension ( ) ) ) && ( ! ( com.google.gerrit.client.Gerrit.getConfig ( ) . siteHasUsernames ( ) ) ) ; }
Source:
private com.google.codereview.internal.SyncProject.BranchSync toBranch ( final org.spearce.jgit.lib.Ref r , final org.spearce.jgit.revwalk.RevCommit c ) { final com.google.codereview.internal.SyncProject.BranchSync.Builder bs = com.google.codereview.internal.SyncProject.BranchSync.newBuilder ( ) ; bs.setBranchName ( r.getName ( ) ) ; bs.setCommit ( com.google.codereview.util.GitMetaUtil.toGitCommit ( c ) ) ; return bs.build ( ) ; }

Target:
private com.google.codereview.internal.SyncProject.BranchSync toBranch ( final org.spearce.jgit.lib.Ref r , final org.spearce.jgit.revwalk.RevCommit c ) { final com.google.codereview.internal.SyncProject.BranchSync.Builder bs = com.google.codereview.internal.SyncProject.BranchSync.newBuilder ( ) ; bs.setBranchName ( r.getName ( ) ) ; return bs.build ( ) ; }
Source:
public void byKey ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change = insert ( newChange ( repo , null , null , null , null ) ) ; java.lang.String key = change.getKey ( ) . get ( ) ; assertQuery ( "I0000000000000000000000000000000000000000" ) ; for ( int i = 0 ; i <= 36 ; i ++ ) { java.lang.String q = key.substring ( 0 , ( 41 - i ) ) ; assertQuery ( q , change ) ; } }

Target:
public void byKey ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change = insert ( newChange ( repo ) ) ; java.lang.String key = change.getKey ( ) . get ( ) ; assertQuery ( "I0000000000000000000000000000000000000000" ) ; for ( int i = 0 ; i <= 36 ; i ++ ) { java.lang.String q = key.substring ( 0 , ( 41 - i ) ) ; assertQuery ( q , change ) ; } }
Source:
private void onCommentAdded ( final com.google.gerrit.server.events.CommentAddedEvent newComment ) { if ( ! ( shouldProcessCommentEvent ( newComment ) ) ) { return ; } com.google.gerrit.server.data.ChangeAttribute change = newComment.change.get ( ) ; try { checkReviewExists ( change.number ) ; autoSubmitIfMergeable ( change ) ; } catch ( com.google.gerrit.extensions.restapi.RestApiException | com.google.gwtorm.server.OrmException | com.google.gerrit.server.update.UpdateException | java.io.IOException e ) { com.criteo.gerrit.plugins.automerge.AutomaticMerger.log.error ( "An exception occured while trying to atomic merge a change." , e ) ; throw new java.lang.RuntimeException ( e ) ; } }

Target:
private void onCommentAdded ( final com.google.gerrit.server.events.CommentAddedEvent newComment ) { if ( ! ( shouldProcessCommentEvent ( newComment ) ) ) { return ; } com.google.gerrit.server.data.ChangeAttribute change = newComment.change.get ( ) ; try { checkReviewExists ( change.number ) ; autoSubmitIfMergeable ( change ) ; } catch ( java.lang.Exception e ) { com.criteo.gerrit.plugins.automerge.AutomaticMerger.log.error ( "An exception occured while trying to atomic merge a change." , e ) ; throw new java.lang.RuntimeException ( e ) ; } }
Source:
public com.google.gerrit.extensions.api.changes.ReviewerInfo format ( com.google.gerrit.server.CurrentUser user , com.google.gerrit.extensions.api.changes.ReviewerInfo out , com.google.gerrit.server.permissions.PermissionBackend.ForChange perm , com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet.Id psId = cd.change ( ) . currentPatchSetId ( ) ; return format ( user , out , perm , cd , approvalsUtil.byPatchSetUser ( db.get ( ) , cd.notes ( ) , perm.user ( ) , psId , new com.google.gerrit.reviewdb.client.Account.Id ( out._accountId ) , null , null ) ) ; }

Target:
public com.google.gerrit.extensions.api.changes.ReviewerInfo format ( com.google.gerrit.extensions.api.changes.ReviewerInfo out , com.google.gerrit.server.permissions.PermissionBackend.ForChange perm , com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet.Id psId = cd.change ( ) . currentPatchSetId ( ) ; return format ( out , perm , cd , approvalsUtil.byPatchSetUser ( db.get ( ) , cd.notes ( ) , perm.user ( ) , psId , new com.google.gerrit.reviewdb.client.Account.Id ( out._accountId ) , null , null ) ) ; }
Source:
public void deleteCcerFromReviewableChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; removeReviewer ( sc , extraCcer ) ; assertThat ( sender ) . sent ( "deleteReviewer" , sc ) . notTo ( sc.owner ) . to ( extraCcer ) . to ( sc.reviewerByEmail ) . cc ( extraReviewer , sc.reviewer , sc.ccer ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void deleteCcerFromReviewableChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; removeReviewer ( sc , extraCcer ) ; assertThat ( sender ) . sent ( "deleteReviewer" , sc ) . notTo ( sc.owner ) . to ( extraCcer ) . cc ( extraReviewer , sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }
Source:
protected com.google.gerrit.server.notedb.LoadHandle openHandle ( org.eclipse.jgit.lib.Repository repo ) throws java.io.IOException { if ( autoRebuild ) { com.google.gerrit.server.notedb.NoteDbChangeState state = com.google.gerrit.server.notedb.NoteDbChangeState.parse ( change ) ; com.google.gerrit.server.git.RefCache refs = ( ( this . refs ) != null ) ? this . refs : new com.google.gerrit.server.git.RepoRefCache ( repo ) ; if ( ( state == null ) || ( ! ( state.isChangeUpToDate ( refs ) ) ) ) { return rebuildAndOpen ( repo ) ; } } return super . openHandle ( repo ) ; }

Target:
protected com.google.gerrit.server.notedb.LoadHandle openHandle ( org.eclipse.jgit.lib.Repository repo ) throws java.io.IOException { if ( autoRebuild ) { com.google.gerrit.server.notedb.NoteDbChangeState state = com.google.gerrit.server.notedb.NoteDbChangeState.parse ( change ) ; com.google.gerrit.server.git.RefCache refs = ( ( this . refs ) != null ) ? this . refs : new com.google.gerrit.server.git.RepoRefCache ( repo ) ; if ( ! ( com.google.gerrit.server.notedb.NoteDbChangeState.isChangeUpToDate ( state , refs , getChangeId ( ) ) ) ) { return rebuildAndOpen ( repo ) ; } } return super . openHandle ( repo ) ; }
Source:
private void deleteRef ( com.google.gerrit.reviewdb.client.Change change , org.eclipse.jgit.lib.Repository repo , com.google.gerrit.server.git.ChainedReceiveCommands cmds ) throws java.io.IOException { java.lang.String refName = com.google.gerrit.server.notedb.ChangeNoteUtil.changeRefName ( change.getId ( ) ) ; org.eclipse.jgit.lib.ObjectId old = cmds.getObjectId ( repo , refName ) ; cmds.add ( new org.eclipse.jgit.transport.ReceiveCommand ( old , org.eclipse.jgit.lib.ObjectId.zeroId ( ) , refName ) ) ; }

Target:
private void deleteRef ( com.google.gerrit.reviewdb.client.Change change , org.eclipse.jgit.lib.Repository repo , com.google.gerrit.server.git.ChainedReceiveCommands cmds ) throws java.io.IOException { java.lang.String refName = com.google.gerrit.server.notedb.ChangeNoteUtil.changeRefName ( change.getId ( ) ) ; org.eclipse.jgit.lib.ObjectId old = cmds.getObjectId ( repo , refName ) ; if ( old != null ) { cmds.add ( new org.eclipse.jgit.transport.ReceiveCommand ( old , org.eclipse.jgit.lib.ObjectId.zeroId ( ) , refName ) ) ; } }
Source:
public void queryChangesNoOptions ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.common.ChangeInfo result = com.google.common.collect.Iterables.getOnlyElement ( query ( r.getChangeId ( ) ) ) ; com.google.common.truth.Truth.assertThat ( result.labels ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( ( ( java.lang.Iterable < ? > ) ( result.messages ) ) ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( result.revisions ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( result.actions ) . isNull ( ) ; }

Target:
public void queryChangesNoOptions ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.common.ChangeInfo result = com.google.common.collect.Iterables.getOnlyElement ( query ( r.getChangeId ( ) ) ) ; com.google.common.truth.Truth.assertThat ( result.labels ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( result.messages ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( result.revisions ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( result.actions ) . isNull ( ) ; }
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 ( req , res , com.google.gitiles.FormatType.TEXT ) ; setCacheHeaders ( req , res ) ; java.io.PrintWriter out = res.getWriter ( ) ; out.write ( message ) ; out.close ( ) ; }

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 ( res , com.google.gitiles.FormatType.TEXT ) ; setCacheHeaders ( res ) ; java.io.PrintWriter out = res.getWriter ( ) ; out.write ( message ) ; out.close ( ) ; }
Source:
private boolean isAlreadyMerged ( com.google.gerrit.server.git.CodeReviewCommit commit ) throws java.io.IOException { try ( com.google.gerrit.server.git.CodeReviewCommit.CodeReviewRevWalk mirw = com.google.gerrit.server.git.CodeReviewCommit.newRevWalk ( rw.getObjectReader ( ) ) ) { mirw.reset ( ) ; mirw.markStart ( commit ) ; for ( org.eclipse.jgit.revwalk.RevCommit accepted : alreadyAccepted ) { if ( mirw.isMergedInto ( mirw.parseCommit ( accepted ) , mirw.parseCommit ( commit ) ) ) { return true ; } } } return false ; }

Target:
private boolean isAlreadyMerged ( com.google.gerrit.server.git.CodeReviewCommit commit ) throws java.io.IOException { try ( com.google.gerrit.server.git.CodeReviewCommit.CodeReviewRevWalk mirw = com.google.gerrit.server.git.CodeReviewCommit.newRevWalk ( rw.getObjectReader ( ) ) ) { mirw.reset ( ) ; mirw.markStart ( commit ) ; for ( org.eclipse.jgit.revwalk.RevCommit accepted : alreadyAccepted ) { if ( mirw.isMergedInto ( mirw.parseCommit ( commit ) , mirw.parseCommit ( accepted ) ) ) { return true ; } } } return false ; }
Source:
static com.google.gerrit.server.notedb.ChangeNotesState empty ( com.google.gerrit.reviewdb.client.Change change ) { return new com.google.gerrit.server.notedb.AutoValue_ChangeNotesState ( null , change.getId ( ) , null , com.google.common.collect.ImmutableSet.of ( ) , com.google.common.collect.ImmutableSet.of ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.gerrit.server.ReviewerSet.empty ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.common.collect.ImmutableListMultimap.of ( ) , com.google.common.collect.ImmutableListMultimap.of ( ) , null ) ; }

Target:
static com.google.gerrit.server.notedb.ChangeNotesState empty ( com.google.gerrit.reviewdb.client.Change change ) { return new com.google.gerrit.server.notedb.AutoValue_ChangeNotesState ( null , change.getId ( ) , null , com.google.common.collect.ImmutableSet.of ( ) , com.google.common.collect.ImmutableSet.of ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.gerrit.server.ReviewerSet.empty ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.common.collect.ImmutableList.of ( ) , com.google.common.collect.ImmutableListMultimap.of ( ) , com.google.common.collect.ImmutableListMultimap.of ( ) , null , null ) ; }
Source:
public static com.google.gerrit.reviewdb.client.PatchSet newPatchSet ( com.google.gerrit.reviewdb.client.PatchSet.Id id , org.eclipse.jgit.lib.ObjectId revision , com.google.gerrit.reviewdb.client.Account.Id userId ) { com.google.gerrit.reviewdb.client.PatchSet ps = new com.google.gerrit.reviewdb.client.PatchSet ( id ) ; ps.setRevision ( new com.google.gerrit.reviewdb.client.RevId ( revision.name ( ) ) ) ; ps.setUploader ( userId ) ; ps.setCreatedOn ( com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; return ps ; }

Target:
public static com.google.gerrit.reviewdb.client.PatchSet newPatchSet ( com.google.gerrit.reviewdb.client.PatchSet.Id id , java.lang.String revision , com.google.gerrit.reviewdb.client.Account.Id userId ) { com.google.gerrit.reviewdb.client.PatchSet ps = new com.google.gerrit.reviewdb.client.PatchSet ( id ) ; ps.setRevision ( new com.google.gerrit.reviewdb.client.RevId ( revision ) ) ; ps.setUploader ( userId ) ; ps.setCreatedOn ( com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; return ps ; }
Source:
public void testWithoutSubmodule ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit c = makeCommitWithoutSubmodule ( ) ; java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m = com.googlesource.gerrit.plugins.uploadvalidator.SubmoduleValidator.performValidation ( repo , c ) ; com.google.common.truth.Truth.assertThat ( m ) . isEmpty ( ) ; }

Target:
public void testWithoutSubmodule ( ) throws java.lang.Exception { try ( org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ) { org.eclipse.jgit.revwalk.RevCommit c = makeCommitWithoutSubmodule ( rw ) ; java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m = com.googlesource.gerrit.plugins.uploadvalidator.SubmoduleValidator.performValidation ( repo , c , rw ) ; com.google.common.truth.Truth.assertThat ( m ) . isEmpty ( ) ; } }
Source:
public void testWhereNameEq ( ) throws com.google.gwtorm.schema.QueryParseException { final org.antlr.runtime.tree.Tree t = parse ( "WHERE name = ?" ) ; assertNotNull ( t ) ; assertEquals ( QueryParser.WHERE , t.getType ( ) ) ; assertEquals ( 1 , t.getChildCount ( ) ) ; com.google.gwtorm.schema.QueryParserTest.assertGoodEQ ( t.getChild ( 0 ) , "name" ) ; }

Target:
public void testWhereNameEq ( ) throws com.google.gwtorm.schema.QueryParseException { final org.antlr.runtime.tree.Tree t = parse ( "WHERE name = ?" ) ; org.junit.Assert.assertNotNull ( t ) ; org.junit.Assert.assertEquals ( QueryParser.WHERE , t.getType ( ) ) ; org.junit.Assert.assertEquals ( 1 , t.getChildCount ( ) ) ; com.google.gwtorm.schema.QueryParserTest.assertGoodEQ ( t.getChild ( 0 ) , "name" ) ; }
Source:
public void writeCommit ( com.google.gerrit.server.notedb.BatchMetaDataUpdate batch ) throws com.google.gwtorm.server.OrmException , java.io.IOException { org.eclipse.jgit.lib.CommitBuilder builder = new org.eclipse.jgit.lib.CommitBuilder ( ) ; if ( migration.writeChanges ( ) ) { java.util.concurrent.atomic.AtomicBoolean removedAllComments = new java.util.concurrent.atomic.AtomicBoolean ( ) ; org.eclipse.jgit.lib.ObjectId treeId = storeCommentsInNotes ( removedAllComments ) ; if ( treeId != null ) { if ( removedAllComments.get ( ) ) { batch.removeRef ( getRefName ( ) ) ; } else { builder.setTreeId ( treeId ) ; batch.write ( builder ) ; } } } }

Target:
public void writeCommit ( com.google.gerrit.server.notedb.BatchMetaDataUpdate batch ) throws com.google.gwtorm.server.OrmException , java.io.IOException { org.eclipse.jgit.lib.CommitBuilder builder = new org.eclipse.jgit.lib.CommitBuilder ( ) ; if ( migration.writeChanges ( ) ) { java.util.concurrent.atomic.AtomicBoolean removedAllComments = new java.util.concurrent.atomic.AtomicBoolean ( ) ; org.eclipse.jgit.lib.ObjectId treeId = storeCommentsInNotes ( removedAllComments ) ; if ( removedAllComments.get ( ) ) { batch.removeRef ( getRefName ( ) ) ; } else if ( treeId != null ) { builder.setTreeId ( treeId ) ; batch.write ( builder ) ; } } }
Source:
public void fooBarSubdirJson ( ) throws java.lang.Exception { java.util.Map < java.lang.String , com.google.gitiles.RepositoryDescription > res = buildJson ( "/foo/bar/" , new com.google.gson.reflect.TypeToken < java.util.Map < java.lang.String , com.google.gitiles.RepositoryDescription > > ( ) { } . getType ( ) ) ; org.junit.Assert.assertEquals ( 1 , res.size ( ) ) ; com.google.gitiles.RepositoryDescription d = res.get ( "repo" ) ; assertNotNull ( "repo exists" , d ) ; org.junit.Assert.assertEquals ( repo.getRepository ( ) . getDescription ( ) . getRepositoryName ( ) , d.name ) ; }

Target:
public void fooBarSubdirJson ( ) throws java.lang.Exception { java.util.Map < java.lang.String , com.google.gitiles.RepositoryDescription > res = buildJson ( "/foo/bar/" , new com.google.gson.reflect.TypeToken < java.util.Map < java.lang.String , com.google.gitiles.RepositoryDescription > > ( ) { } . getType ( ) ) ; org.junit.Assert.assertEquals ( 1 , res.size ( ) ) ; com.google.gitiles.RepositoryDescription d = res.get ( "repo" ) ; org.junit.Assert.assertNotNull ( "repo exists" , d ) ; org.junit.Assert.assertEquals ( repo.getRepository ( ) . getDescription ( ) . getRepositoryName ( ) , d.name ) ; }
Source:
private int colorLines ( net.codemirror.lib.CodeMirror cm , int line , int cnt ) { for ( int i = 0 ; i < cnt ; i ++ ) { cm.addLineClass ( line , LineClassWhere.WRAP , diffTable.style.diff ( ) ) ; } return line + cnt ; }

Target:
private int colorLines ( net.codemirror.lib.CodeMirror cm , int line , int cnt ) { for ( int i = 0 ; i < cnt ; i ++ ) { cm.addLineClass ( ( line + i ) , LineClassWhere.WRAP , diffTable.style.diff ( ) ) ; } return line + cnt ; }