auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onSuccess ( com.google.gwt.core.client.JsArrayString result ) { for ( int i = 0 ; i < ( result.length ( ) ) ; i ++ ) { if ( path.equals ( result.get ( i ) ) ) { reviewed.setValue ( true , false ) ; break ; } } }

Target:
public void onSuccess ( com.google.gerrit.client.changes.ReviewInfo result ) { reviewed.setValue ( true , false ) ; }
Source:
private com.google.gerrit.client.diff.DraftBox addNewDraft ( net.codemirror.lib.CodeMirror cm , int line , net.codemirror.lib.TextMarker.FromTo fromTo ) { com.google.gerrit.client.diff.DisplaySide side = getSideFromCm ( cm ) ; return addDraftBox ( com.google.gerrit.client.changes.CommentInfo.createRange ( path , getStoredSideFromDisplaySide ( side ) , ( line + 1 ) , null , null , com.google.gerrit.client.diff.CommentRange.create ( fromTo ) ) , side ) ; }

Target:
java.lang.String getContentType ( ) { return getContentType ( diff.meta_b ( ) ) ; }
Source:
void close ( ) { reopenThread.close ( ) ; try { searcherManager.maybeRefreshBlocking ( ) ; } catch ( java.io.IOException e ) { com.google.gerrit.lucene.SubIndex.log.warn ( "error finishing pending Lucene writes" , e ) ; } try { writer.getIndexWriter ( ) . close ( ) ; } catch ( org.apache.lucene.store.AlreadyClosedException e ) { } catch ( java.io.IOException e ) { com.google.gerrit.lucene.SubIndex.log.warn ( "error closing Lucene writer" , e ) ; } try { dir.close ( ) ; } catch ( java.io.IOException e ) { com.google.gerrit.lucene.SubIndex.log.warn ( "error closing Lucene directory" , e ) ; } }

Target:
public void close ( ) { reopenThread.close ( ) ; try { searcherManager.maybeRefreshBlocking ( ) ; } catch ( java.io.IOException e ) { com.google.gerrit.lucene.AbstractLuceneIndex.log.warn ( "error finishing pending Lucene writes" , e ) ; } try { writer.getIndexWriter ( ) . close ( ) ; } catch ( org.apache.lucene.store.AlreadyClosedException e ) { } catch ( java.io.IOException e ) { com.google.gerrit.lucene.AbstractLuceneIndex.log.warn ( "error closing Lucene writer" , e ) ; } try { dir.close ( ) ; } catch ( java.io.IOException e ) { com.google.gerrit.lucene.AbstractLuceneIndex.log.warn ( "error closing Lucene directory" , e ) ; } }
Source:
private void assertProblems ( com.google.gerrit.gpg.PublicKeyChecker checker , com.google.gerrit.gpg.testutil.TestKey k , java.lang.String ... expected ) { if ( ( expected.length ) == 0 ) { throw new java.lang.IllegalArgumentException ( "Use assertNoProblems" ) ; } com.google.gerrit.gpg.CheckResult result = checker.setStore ( store ) . check ( k.getPublicKey ( ) ) ; org.junit.Assert.assertEquals ( java.util.Arrays.asList ( expected ) , result.getProblems ( ) ) ; }

Target:
private void assertProblems ( com.google.gerrit.gpg.PublicKeyChecker checker , com.google.gerrit.gpg.testutil.TestKey k , java.lang.String first , java.lang.String ... rest ) { com.google.gerrit.gpg.CheckResult result = checker.setStore ( store ) . check ( k.getPublicKey ( ) ) ; org.junit.Assert.assertEquals ( com.google.gerrit.gpg.PublicKeyCheckerTest.list ( first , rest ) , result.getProblems ( ) ) ; }
Source:
public java.lang.String getLine ( final int i ) { final int s = lines.get ( ( i + 1 ) ) ; int e = lines.get ( ( i + 2 ) ) ; if ( ( content [ ( e - 1 ) ] ) == '\n' ) { e -- ; } return org.eclipse.jgit.util.RawParseUtils.decode ( Constants.CHARSET , content , s , e ) ; }

Target:
public java.lang.String getLines ( final int begin , final int end ) { if ( begin == end ) { return "" ; } final int s = getLineStart ( begin ) ; int e = getLineEnd ( ( end - 1 ) ) ; if ( ( content [ ( e - 1 ) ] ) == '\n' ) { e -- ; } return decode ( s , e ) ; }
Source:
public com.google.gitiles.GitilesView.Builder setOldRevision ( com.google.gitiles.Revision revision ) { switch ( type ) { case DIFF : case LOG : break ; default : revision = com.google.common.base.MoreObjects.firstNonNull ( revision , Revision.NULL ) ; com.google.common.base.Preconditions.checkState ( ( revision == ( Revision.NULL ) ) , "cannot set old revision on %s view" , type ) ; break ; } this . oldRevision = revision ; return this ; }

Target:
public com.google.gitiles.GitilesView.Builder setOldRevision ( com.google.gitiles.Revision revision ) { if ( ( ( type ) != ( com.google.gitiles.GitilesView.Type.DIFF ) ) && ( ( type ) != ( com.google.gitiles.GitilesView.Type.LOG ) ) ) { revision = com.google.common.base.MoreObjects.firstNonNull ( revision , Revision.NULL ) ; com.google.common.base.Preconditions.checkState ( ( revision == ( Revision.NULL ) ) , "cannot set old revision on %s view" , type ) ; } this . oldRevision = revision ; return this ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.server.config.SitePaths.class ) . toInstance ( site ) ; factory ( ChangeData.Factory.class ) ; }

Target:
public void run ( ) throws java.io.IOException { ui.header ( "Index" ) ; com.google.gerrit.server.index.IndexModule.IndexType type = index.select ( "Type" , "type" , IndexType.LUCENE ) ; if ( ( site.isNew ) && ( type == ( com.google.gerrit.server.index.IndexModule.IndexType.LUCENE ) ) ) { com.google.gerrit.lucene.LuceneChangeIndex.setReady ( site , com.google.gerrit.server.index.ChangeSchemas.getLatest ( ) . getVersion ( ) , true ) ; } else { ui.message ( ( "The index must be built before starting Gerrit:\n" + " java -jar gerrit.war reindex -d site_path\n" ) ) ; initFlags.autoStart = false ; } }
Source:
private boolean isSessionValid ( javax.servlet.http.HttpServletRequest req ) { com.google.gerrit.httpd.WebSession session = sessionProvider.get ( ) ; if ( session.isSignedIn ( ) ) { java.lang.String user = getRemoteUser ( req ) ; com.google.gerrit.reviewdb.client.AccountExternalId.Key id = session.getLastLoginExternalId ( ) ; return ( ( user != null ) && ( id != null ) ) && ( id.equals ( new com.google.gerrit.reviewdb.client.AccountExternalId.Key ( com.google.gerrit.reviewdb.client.AccountExternalId.SCHEME_GERRIT , user ) ) ) ; } return false ; }

Target:
private static boolean correctUser ( java.lang.String user , com.google.gerrit.httpd.WebSession session ) { com.google.gerrit.reviewdb.client.AccountExternalId.Key id = session.getLastLoginExternalId ( ) ; return ( id != null ) && ( id.equals ( new com.google.gerrit.reviewdb.client.AccountExternalId.Key ( com.google.gerrit.reviewdb.client.AccountExternalId.SCHEME_GERRIT , user ) ) ) ; }
Source:
private static int split ( java.lang.String line ) { int sp = line.indexOf ( ' ' ) ; int tab = line.indexOf ( '\t' ) ; if ( ( sp < 0 ) && ( tab < 0 ) ) { return - 1 ; } if ( ( sp < 0 ) && ( 0 <= tab ) ) { return tab ; } if ( ( 0 <= sp ) && ( tab < 0 ) ) { return sp ; } return java.lang.Math.min ( sp , tab ) ; }

Target:
public com.google.gerrit.common.data.GroupReference getGroup ( com.google.gerrit.reviewdb.AccountGroup.UUID uuid ) { return groupsByUUID.get ( uuid ) ; }
Source:
public void deleteEdit ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , modifier.createEdit ( change , ps ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.FORCED , modifier.modifyFile ( editUtil.byChange ( change ) . get ( ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME , com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_NEW ) ) ; editUtil.delete ( editUtil.byChange ( change ) . get ( ) ) ; org.junit.Assert.assertFalse ( editUtil.byChange ( change ) . isPresent ( ) ) ; }

Target:
public void deleteEdit ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( modifier.createEdit ( change , ps ) ) . isEqualTo ( RefUpdate.Result.NEW ) ; com.google.common.truth.Truth.assertThat ( modifier.modifyFile ( editUtil.byChange ( change ) . get ( ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME , com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_NEW ) ) . isEqualTo ( RefUpdate.Result.FORCED ) ; editUtil.delete ( editUtil.byChange ( change ) . get ( ) ) ; com.google.common.truth.Truth.assertThat ( editUtil.byChange ( change ) . isPresent ( ) ) . isFalse ( ) ; }
Source:
public void onHistoryChanged ( final java.lang.String token ) { final com.google.gerrit.client.ui.Screen s = select ( token ) ; if ( s != null ) { com.google.gerrit.client.Gerrit.display ( s ) ; } else { com.google.gerrit.client.Gerrit.display ( new com.google.gerrit.client.NotFoundScreen ( ) ) ; } }

Target:
public void onHistoryChanged ( final java.lang.String token ) { com.google.gerrit.client.ui.Screen s ; try { s = select ( token ) ; } catch ( java.lang.RuntimeException err ) { com.google.gwt.core.client.GWT.log ( ( "Error parsing history token: " + token ) , err ) ; s = null ; } if ( s != null ) { com.google.gerrit.client.Gerrit.display ( s ) ; } else { com.google.gerrit.client.Gerrit.display ( new com.google.gerrit.client.NotFoundScreen ( ) ) ; } }
Source:
public void emptyChangeUpdate ( ) throws java.lang.Exception { com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( newChange ( ) , changeOwner ) ; update.commit ( ) ; com.google.common.truth.Truth.assertThat ( update.getRevision ( ) ) . isNull ( ) ; }

Target:
public void emptyChangeUpdate ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; org.eclipse.jgit.lib.ObjectId revision = update.getRevision ( ) ; com.google.common.truth.Truth.assertThat ( revision ) . isNotNull ( ) ; update = newUpdate ( c , changeOwner ) ; update.commit ( ) ; com.google.common.truth.Truth.assertThat ( update.getRevision ( ) ) . isEqualTo ( revision ) ; }
Source:
public java.lang.String getETag ( ) { com.google.gerrit.server.CurrentUser user = control.getCurrentUser ( ) ; com.google.common.hash.Hasher h = com.google.common.hash.Hashing.md5 ( ) . newHasher ( ) . putBoolean ( user.getStarredChanges ( ) . contains ( getChange ( ) . getId ( ) ) ) ; prepareETag ( h , user ) ; return h.hash ( ) . toString ( ) ; }

Target:
public java.lang.String getETag ( ) { com.google.gerrit.server.CurrentUser user = control.getUser ( ) ; com.google.common.hash.Hasher h = com.google.common.hash.Hashing.md5 ( ) . newHasher ( ) . putBoolean ( user.getStarredChanges ( ) . contains ( getChange ( ) . getId ( ) ) ) ; prepareETag ( h , user ) ; return h.hash ( ) . toString ( ) ; }
Source:
public void format ( java.util.List < ? extends org.eclipse.jgit.diff.DiffEntry > entries ) throws java.io.IOException { for ( fileIndex = 0 ; ( fileIndex ) < ( entries.size ( ) ) ; ( fileIndex ) ++ ) { format ( entries.get ( fileIndex ) ) ; } }

Target:
public void format ( java.util.List < ? extends org.eclipse.jgit.diff.DiffEntry > entries ) throws java.io.IOException { for ( fileIndex = 0 ; ( fileIndex ) < ( entries.size ( ) ) ; ( fileIndex ) ++ ) { entry = entries.get ( fileIndex ) ; format ( entry ) ; } }
Source:
void display ( final java.util.List < com.google.gerrit.reviewdb.client.AccountSshKey > result ) { if ( result.isEmpty ( ) ) { setKeyTableVisible ( false ) ; showAddKeyBlock ( true ) ; } else { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.reviewdb.client.AccountSshKey k : result ) { addOneKey ( k ) ; } setKeyTableVisible ( true ) ; deleteKey.setEnabled ( false ) ; } }

Target:
void display ( final java.util.List < com.google.gerrit.client.account.SshKeyInfo > result ) { if ( result.isEmpty ( ) ) { setKeyTableVisible ( false ) ; showAddKeyBlock ( true ) ; } else { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.client.account.SshKeyInfo k : result ) { addOneKey ( k ) ; } setKeyTableVisible ( true ) ; deleteKey.setEnabled ( false ) ; } }
Source:
private void wrapText ( java.lang.String tag , org.pegdown.ast.TextNode node ) { html.open ( tag ) . appendAndEscape ( node.getText ( ) ) . close ( tag ) ; }

Target:
private void visit ( org.commonmark.ext.gfm.tables.TableCell cell ) { java.lang.String tag = ( cell.isHeader ( ) ) ? "th" : "td" ; html.open ( tag ) ; org.commonmark.ext.gfm.tables.TableCell.Alignment alignment = cell.getAlignment ( ) ; if ( alignment != null ) { html.attribute ( "align" , com.google.gitiles.doc.MarkdownToHtml.toHtml ( alignment ) ) ; } visitChildren ( cell ) ; html.close ( tag ) ; }
Source:
public void execute ( ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException { try { executeRefUpdates ( ) ; executeChangeOps ( ) ; reindexChanges ( ) ; if ( ( batchRefUpdate ) != null ) { gitRefUpdated.fire ( project , batchRefUpdate ) ; } executePostOps ( ) ; } catch ( com.google.gerrit.server.git.UpdateException | com.google.gerrit.extensions.restapi.RestApiException e ) { throw e ; } catch ( java.lang.Exception e ) { com.google.common.base.Throwables.propagateIfPossible ( e ) ; throw new com.google.gerrit.server.git.UpdateException ( e ) ; } }

Target:
public com.google.gerrit.server.notedb.ChangeUpdate getUpdate ( com.google.gerrit.reviewdb.client.PatchSet.Id psId ) { com.google.gerrit.server.notedb.ChangeUpdate u = updates.get ( psId ) ; if ( u == null ) { u = changeUpdateFactory.create ( ctl , when ) ; if ( newChanges.containsKey ( ctl.getId ( ) ) ) { u.setAllowWriteToNewRef ( true ) ; } u.setPatchSetId ( psId ) ; updates.put ( psId , u ) ; } return u ; }
Source:
private java.util.Set < com.google.gerrit.reviewdb.client.Project.NameKey > getAllParents ( final com.google.gerrit.reviewdb.client.Project.NameKey projectName ) { final java.util.Set < com.google.gerrit.reviewdb.client.Project.NameKey > parents = new java.util.HashSet < com.google.gerrit.reviewdb.client.Project.NameKey > ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey p = projectName ; while ( ( p != null ) && ( parents.add ( p ) ) ) { final com.google.gerrit.server.project.ProjectState e = projectCache.get ( p ) ; if ( e == null ) { break ; } p = e.getProject ( ) . getParent ( allProjectsName ) ; } return parents ; }

Target:
public Project.NameKey apply ( com.google.gerrit.server.project.ProjectState in ) { return in.getProject ( ) . getNameKey ( ) ; }
Source:
public void onShowView ( ) { super . onShowView ( ) ; com.google.gwt.user.client.Window.enableScrolling ( false ) ; final int height = getCodeMirrorHeight ( ) ; onShowView ( cmA , height ) ; onShowView ( cmB , height ) ; diffTable.sidePanel.adjustGutters ( cmB ) ; cmB.setCursor ( net.codemirror.lib.LineCharacter.create ( 0 ) ) ; cmB.focus ( ) ; prefetchNextFile ( ) ; }

Target:
public void onShowView ( ) { super . onShowView ( ) ; com.google.gwt.user.client.Window.enableScrolling ( false ) ; final int height = getCodeMirrorHeight ( ) ; cmA.setHeight ( height ) ; cmB.setHeight ( height ) ; diffTable.sidePanel.adjustGutters ( cmB ) ; cmB.setCursor ( net.codemirror.lib.LineCharacter.create ( 0 ) ) ; cmB.focus ( ) ; prefetchNextFile ( ) ; }
Source:
public void testUnblockInLocalVisibilityByRegisteredUsers_Fails ( ) { com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; org.junit.Assert.assertFalse ( "u can't read" , u.controlForRef ( "refs/heads/master" ) . isVisibleByRegisteredUsers ( ) ) ; }

Target:
public void testUnblockVisibilityByRegisteredUsers ( ) { com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; com.google.common.truth.Truth.assertThat ( u.controlForRef ( "refs/heads/master" ) . isVisibleByRegisteredUsers ( ) ) . named ( "u can read" ) . isTrue ( ) ; }
Source:
public void onGitReferenceUpdated ( com.google.gerrit.server.change.Event event ) { java.lang.String ref = event.getRefName ( ) ; if ( ( ref.startsWith ( Constants.R_HEADS ) ) || ( ref.equals ( GitRepositoryManager.REF_CONFIG ) ) ) { executor.submit ( new com.google.gerrit.server.change.MergeabilityChecker.RefUpdateTask ( schemaFactory , new com.google.gerrit.reviewdb.client.Project.NameKey ( event.getProjectName ( ) ) , ref ) ) ; } }

Target:
private com.google.common.util.concurrent.CheckedFuture < java.lang.Boolean , java.io.IOException > updateAsync ( com.google.gerrit.reviewdb.client.Change change , boolean force ) { return com.google.common.util.concurrent.Futures.makeChecked ( executor.submit ( new com.google.gerrit.server.change.MergeabilityChecker.ChangeUpdateTask ( schemaFactory , change , force ) ) , com.google.gerrit.server.change.MergeabilityChecker.MAPPER ) ; }
Source:
public java.util.Map < java.lang.String , java.util.List < com.google.gerrit.extensions.common.CommentInfo > > apply ( com.google.gerrit.server.change.ChangeResource rsrc ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.query.change.ChangeData cd = changeDataFactory.create ( db.get ( ) , rsrc.getControl ( ) ) ; return commentJson.get ( ) . setFillAccounts ( true ) . setFillPatchSet ( true ) . newCommentFormatter ( ) . format ( commentsUtil.publishedByChange ( db.get ( ) , cd.notes ( ) ) ) ; }

Target:
public java.util.Map < java.lang.String , java.util.List < com.google.gerrit.extensions.common.CommentInfo > > apply ( com.google.gerrit.server.change.ChangeResource rsrc ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.query.change.ChangeData cd = changeDataFactory.create ( db.get ( ) , rsrc.getNotes ( ) ) ; return commentJson.get ( ) . setFillAccounts ( true ) . setFillPatchSet ( true ) . newCommentFormatter ( ) . format ( commentsUtil.publishedByChange ( db.get ( ) , cd.notes ( ) ) ) ; }
Source:
protected java.util.List < java.lang.Integer > query ( java.lang.Object query ) throws java.lang.Exception { return com.google.gerrit.server.query.change.AbstractQueryChangesTest.query ( newQuery ( query ) ) ; }

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 ( ids.toString ( ) ) . containsExactlyElementsIn ( com.google.gerrit.server.query.change.AbstractQueryChangesTest.ids ( changes ) ) . inOrder ( ) ; return result ; }
Source:
public com.google.gerrit.reviewdb.client.AccountGroup get ( final com.google.gerrit.reviewdb.client.AccountGroup.Id groupId ) { try { com.google.common.base.Optional < com.google.gerrit.reviewdb.client.AccountGroup > g = byId.get ( groupId ) ; return g.isPresent ( ) ? g.get ( ) : com.google.gerrit.server.account.GroupCacheImpl.missing ( groupId ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.server.account.GroupCacheImpl.log.warn ( ( "Cannot load group " + groupId ) , e ) ; return com.google.gerrit.server.account.GroupCacheImpl.missing ( groupId ) ; } }

Target:
public com.google.gerrit.reviewdb.client.AccountGroup get ( final com.google.gerrit.reviewdb.client.AccountGroup.Id groupId ) { try { java.util.Optional < com.google.gerrit.reviewdb.client.AccountGroup > g = byId.get ( groupId ) ; return g.isPresent ( ) ? g.get ( ) : com.google.gerrit.server.account.GroupCacheImpl.missing ( groupId ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.server.account.GroupCacheImpl.log.warn ( ( "Cannot load group " + groupId ) , e ) ; return com.google.gerrit.server.account.GroupCacheImpl.missing ( groupId ) ; } }
Source:
private void addMessage ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx , com.google.gerrit.server.notedb.ChangeUpdate update ) throws com.google.gwtorm.server.OrmException { java.lang.StringBuilder msg = new java.lang.StringBuilder ( ) ; appendHashtagMessage ( msg , "added" , toAdd ) ; appendHashtagMessage ( msg , "removed" , toRemove ) ; com.google.gerrit.reviewdb.client.ChangeMessage cmsg = com.google.gerrit.server.ChangeMessagesUtil.newMessage ( ctx , msg.toString ( ) , ChangeMessagesUtil.TAG_SET_HASHTAGS ) ; cmUtil.addChangeMessage ( ctx.getDb ( ) , update , cmsg ) ; }

Target:
private void addMessage ( com.google.gerrit.server.update.BatchUpdate.ChangeContext ctx , com.google.gerrit.server.notedb.ChangeUpdate update ) throws com.google.gwtorm.server.OrmException { java.lang.StringBuilder msg = new java.lang.StringBuilder ( ) ; appendHashtagMessage ( msg , "added" , toAdd ) ; appendHashtagMessage ( msg , "removed" , toRemove ) ; com.google.gerrit.reviewdb.client.ChangeMessage cmsg = com.google.gerrit.server.ChangeMessagesUtil.newMessage ( ctx , msg.toString ( ) , ChangeMessagesUtil.TAG_SET_HASHTAGS ) ; cmUtil.addChangeMessage ( ctx.getDb ( ) , update , cmsg ) ; }
Source:
protected void configure ( ) { propertyExtractor = createMock ( com.googlesource.gerrit.plugins.hooks.util.PropertyExtractor.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.util.PropertyExtractor.class ) . toInstance ( propertyExtractor ) ; ruleBase = createMock ( com.googlesource.gerrit.plugins.hooks.workflow.RuleBase.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.workflow.RuleBase.class ) . toInstance ( ruleBase ) ; actionExecutor = createMock ( com.googlesource.gerrit.plugins.hooks.workflow.ActionExecutor.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.workflow.ActionExecutor.class ) . toInstance ( actionExecutor ) ; }

Target:
public boolean isEnabled ( com.google.gerrit.server.events.ChangeEvent event ) { return true ; }
Source:
public void mergeByOwner ( ) 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.owner ) ; assertThat ( sender ) . sent ( "merged" , sc ) . notTo ( 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 ) ; }

Target:
public void mergeByOwner ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageChange ( ) ; merge ( sc.changeId , sc.owner ) ; assertThat ( sender ) . sent ( "merged" , sc ) . 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 ) . noOneElse ( ) ; }
Source:
private void grantTagPermissions ( ) throws java.lang.Exception { grant ( Permission.SUBMIT , project , "refs/for/refs/heads/master" ) ; grant ( Permission.CREATE , project , ( ( org.eclipse.jgit.lib.Constants.R_TAGS ) + "*" ) ) ; grant ( Permission.PUSH , project , ( ( org.eclipse.jgit.lib.Constants.R_TAGS ) + "*" ) ) ; }

Target:
private void grantTagPermissions ( ) throws java.lang.Exception { grant ( Permission.CREATE , project , ( ( org.eclipse.jgit.lib.Constants.R_TAGS ) + "*" ) ) ; grant ( Permission.PUSH_TAG , project , ( ( org.eclipse.jgit.lib.Constants.R_TAGS ) + "*" ) ) ; grant ( Permission.PUSH_SIGNED_TAG , project , ( ( org.eclipse.jgit.lib.Constants.R_TAGS ) + "*" ) ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.httpd.GerritUiOptions.class ) . toInstance ( new com.google.gerrit.httpd.GerritUiOptions ( headless ) ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.server.config.GerritOptions.class ) . toInstance ( new com.google.gerrit.server.config.GerritOptions ( config , headless , slave , polyGerritDev ) ) ; if ( test ) { bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.server.securestore.SecureStoreClassName.class ) . toInstance ( com.google.gerrit.server.securestore.DefaultSecureStore.class . getName ( ) ) ; bind ( com.google.gerrit.server.securestore.SecureStore.class ) . toProvider ( com.google.gerrit.server.securestore.SecureStoreProvider.class ) ; } }
Source:
public void testTimeAltersId ( ) throws java.lang.Exception { assertEquals ( ( "a\n" + ( "\n" + "Change-Id: I7fc3876fee63c766a2063df97fbe04a2dddd8d7c\n" ) ) , call ( "a\n" ) ) ; tick ( ) ; assertEquals ( ( "a\n" + ( "\n" + "Change-Id: I3251906b99dda598a58a6346d8126237ee1ea800\n" ) ) , call ( "a\n" ) ) ; tick ( ) ; assertEquals ( ( "a\n" + ( "\n" + "Change-Id: I69adf9208d828f41a3d7e41afbca63aff37c0c5c\n" ) ) , call ( "a\n" ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { skipIfWin32Platform ( ) ; super . setUp ( ) ; final java.util.Date when = author.getWhen ( ) ; final java.util.TimeZone tz = author.getTimeZone ( ) ; author = new org.eclipse.jgit.lib.PersonIdent ( "J. Author" , "ja@example.com" ) ; author = new org.eclipse.jgit.lib.PersonIdent ( author , when , tz ) ; committer = new org.eclipse.jgit.lib.PersonIdent ( "J. Committer" , "jc@example.com" ) ; committer = new org.eclipse.jgit.lib.PersonIdent ( committer , when , tz ) ; }
Source:
public com.google.gerrit.server.project.ProjectControl controlFor ( com.google.gerrit.reviewdb.Project.NameKey nameKey , com.google.gerrit.server.CurrentUser user ) throws com.google.gerrit.server.project.NoSuchProjectException { final com.google.gerrit.server.project.ProjectState p = projectCache.get ( nameKey ) ; if ( p == null ) { throw new com.google.gerrit.server.project.NoSuchProjectException ( nameKey ) ; } return p.controlFor ( user ) ; }

Target:
public com.google.gerrit.server.project.ProjectControl controlFor ( com.google.gerrit.reviewdb.Project.NameKey nameKey , com.google.gerrit.server.CurrentUser user ) throws com.google.gerrit.server.project.NoSuchProjectException { final com.google.gerrit.server.project.ProjectState p = com.google.gerrit.server.util.FutureUtil.getOrNull ( projectCache.get ( nameKey ) ) ; if ( p == null ) { throw new com.google.gerrit.server.project.NoSuchProjectException ( nameKey ) ; } return p.controlFor ( user ) ; }
Source:
public java.lang.String get ( final int idx ) { for ( int i = lastGetRange ; i < ( ranges.size ( ) ) ; i ++ ) { final com.google.gerrit.client.data.SparseFileContent.Range r = ranges.get ( i ) ; if ( r.contains ( idx ) ) { lastGetRange = i ; return r.get ( idx ) ; } } if ( ( lastGetRange ) != 0 ) { lastGetRange = 0 ; return get ( idx ) ; } throw new java.lang.ArrayIndexOutOfBoundsException ( idx ) ; }

Target:
public java.lang.String get ( final int idx ) { final java.lang.String line = getLine ( idx ) ; if ( line == null ) { throw new java.lang.ArrayIndexOutOfBoundsException ( idx ) ; } return line ; }
Source:
private void initDisplayControls ( ) { final com.google.gwt.user.client.ui.Grid displayControls = new com.google.gwt.user.client.ui.Grid ( 0 , 5 ) ; displayControls.setStyleName ( Gerrit.RESOURCES.css ( ) . patchScreenDisplayControls ( ) ) ; add ( displayControls ) ; createIgnoreWhitespace ( displayControls , 0 , 0 ) ; createContext ( displayControls , 0 , 2 ) ; }

Target:
private void update ( com.google.gerrit.common.data.PatchScriptSettings s ) { if ( ( ( lastScript ) != null ) && ( canReuse ( s , lastScript ) ) ) { lastScript.setSettings ( s ) ; RpcStatus.INSTANCE.onRpcStart ( null ) ; settingsPanel.setEnabled ( false ) ; com.google.gwt.user.client.DeferredCommand.addCommand ( new com.google.gwt.user.client.Command ( ) { @ java.lang.Override public void execute ( ) { try { onResult ( lastScript , false ) ; } finally { RpcStatus.INSTANCE.onRpcComplete ( null ) ; } } } ) ; } else { refresh ( false ) ; } }
Source:
private java.util.Set < com.google.gerrit.server.change.PostReview.CommentSetEntry > readExistingComments ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.util.Set < com.google.gerrit.server.change.PostReview.CommentSetEntry > r = new java.util.HashSet < > ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.publishedByChange ( ctx.getDb ( ) , ctx.getChangeNotes ( ) ) ) { r.add ( com.google.gerrit.server.change.PostReview.CommentSetEntry.create ( c ) ) ; } return r ; }

Target:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > changeDrafts ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = new java.util.HashMap < > ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByChangeAuthor ( ctx.getDb ( ) , ctx.getNotes ( ) , user.getAccountId ( ) ) ) { c.setTag ( in.tag ) ; drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }
Source:
protected void populate ( final int row , final com.google.gerrit.reviewdb.client.Project k ) { table.setWidget ( row , 1 , new com.google.gerrit.client.ui.Hyperlink ( k.getName ( ) , link ( k ) ) ) ; table.setText ( row , 2 , k.getDescription ( ) ) ; setRowItem ( row , k ) ; }

Target:
protected void populate ( final int row , final com.google.gerrit.client.projects.ProjectInfo k ) { table.setWidget ( row , 1 , new com.google.gerrit.client.ui.Hyperlink ( k.name ( ) , link ( k ) ) ) ; table.setText ( row , 2 , k.description ( ) ) ; setRowItem ( row , k ) ; }
Source:
private com.google.inject.Injector newRootInjector ( com.google.gerrit.server.plugins.PluginGuiceEnvironment env ) { return com.google.inject.Guice.createInjector ( env.getSysModule ( ) , new com.google.inject.AbstractModule ( ) { @ java.lang.Override protected void configure ( ) { bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.PluginName.class ) . toInstance ( name ) ; } } ) ; }

Target:
static com.google.gerrit.server.plugins.Plugin.ApiType getApiType ( java.util.jar.Manifest manifest ) throws com.google.gerrit.server.plugins.InvalidPluginException { java.util.jar.Attributes main = manifest.getMainAttributes ( ) ; java.lang.String v = main.getValue ( "Gerrit-ApiType" ) ; if ( ( com.google.common.base.Strings.isNullOrEmpty ( v ) ) || ( com.google.gerrit.server.plugins.Plugin.ApiType.EXTENSION.name ( ) . equalsIgnoreCase ( v ) ) ) { return com.google.gerrit.server.plugins.Plugin.ApiType.EXTENSION ; } else if ( com.google.gerrit.server.plugins.Plugin.ApiType.PLUGIN.name ( ) . equalsIgnoreCase ( v ) ) { return com.google.gerrit.server.plugins.Plugin.ApiType.PLUGIN ; } else { throw new com.google.gerrit.server.plugins.InvalidPluginException ( ( "Invalid Gerrit-ApiType: " + v ) ) ; } }
Source:
private static com.google.gerrit.client.rpc.RestApi api ( int id , java.lang.String commit , java.lang.String action ) { return new com.google.gerrit.client.rpc.RestApi ( ( ( ( ( ( "/changes/" + id ) + "/revisions/" ) + commit ) + "/" ) + action ) ) ; }

Target:
public static void cherrypick ( int id , java.lang.String commit , java.lang.String destination , java.lang.String message , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.CherryPickInput cherryPickInput = com.google.gerrit.client.changes.ChangeApi.CherryPickInput.create ( ) ; cherryPickInput.setMessage ( message ) ; cherryPickInput.setDestination ( destination ) ; com.google.gerrit.client.changes.ChangeApi.call ( id , commit , "cherrypick" ) . post ( cherryPickInput , cb ) ; }
Source:
public Project.NameKey project ( ) throws com.google.gwtorm.server.OrmException { if ( ( project ) == null ) { com.google.common.base.Preconditions.checkState ( ( ! ( notesMigration.readChanges ( ) ) ) , ( "should not have created " + " ChangeData without a project when notedb is enabled" ) ) ; project = change ( ) . getProject ( ) ; } return project ; }

Target:
public Project.NameKey project ( ) throws com.google.gwtorm.server.OrmException { if ( ( project ) == null ) { com.google.common.base.Preconditions.checkState ( ( ! ( notesMigration.readChanges ( ) ) ) , ( "should not have created " + " ChangeData without a project when NoteDb is enabled" ) ) ; project = change ( ) . getProject ( ) ; } return project ; }
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 , 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.gerrit.server.ReviewerByEmailSet.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 , null ) ; }
Source:
void onLogin ( ) { async.append ( log ( ( "LOGIN FROM " + ( session.get ( ) . getRemoteAddressAsString ( ) ) ) ) ) ; audit ( context.get ( ) , "0" , "LOGIN" ) ; }

Target:
void onLogin ( ) { org.apache.log4j.spi.LoggingEvent entry = log ( ( "LOGIN FROM " + ( session.get ( ) . getRemoteAddressAsString ( ) ) ) ) ; if ( ( async ) != null ) { async.append ( entry ) ; } audit ( context.get ( ) , "0" , "LOGIN" ) ; }
Source:
public int weigh ( com.google.gerrit.server.patch.PatchListKey key , com.google.gerrit.server.patch.FileList value ) { int size = ( 16 + ( 4 * 8 ) ) + ( 2 * 36 ) ; for ( java.lang.String p : value.getPaths ( ) ) { size += p.length ( ) ; } size += ( value.getPaths ( ) . size ( ) ) - 1 ; return size ; }

Target:
public int weigh ( com.google.gerrit.server.patch.PatchListKey key , com.google.gerrit.server.patch.DiffSummary value ) { int size = ( 16 + ( 4 * 8 ) ) + ( 2 * 36 ) ; for ( java.lang.String p : value.getPaths ( ) ) { size += p.length ( ) ; } size += ( value.getPaths ( ) . size ( ) ) - 1 ; return size ; }
Source:
private com.google.gerrit.server.project.ChangeControl incrementPatchSet ( com.google.gerrit.server.project.ChangeControl ctl , org.eclipse.jgit.revwalk.RevCommit commit ) throws java.lang.Exception { com.google.gerrit.server.change.PatchSetInserter ins ; try ( com.google.gerrit.server.update.BatchUpdate bu = newUpdate ( ctl.getChange ( ) . getOwner ( ) ) ) { ins = patchSetInserterFactory.create ( ctl , nextPatchSetId ( ctl ) , commit ) . setValidate ( false ) . setFireRevisionCreated ( false ) . setNotify ( NotifyHandling.NONE ) ; bu.addOp ( ctl.getId ( ) , ins ) . execute ( ) ; } return reload ( ctl ) ; }

Target:
private com.google.gerrit.server.notedb.ChangeNotes incrementPatchSet ( com.google.gerrit.server.notedb.ChangeNotes notes , org.eclipse.jgit.revwalk.RevCommit commit ) throws java.lang.Exception { com.google.gerrit.server.change.PatchSetInserter ins ; try ( com.google.gerrit.server.update.BatchUpdate bu = newUpdate ( notes.getChange ( ) . getOwner ( ) ) ) { ins = patchSetInserterFactory.create ( notes , nextPatchSetId ( notes ) , commit ) . setValidate ( false ) . setFireRevisionCreated ( false ) . setNotify ( NotifyHandling.NONE ) ; bu.addOp ( notes.getChangeId ( ) , ins ) . execute ( ) ; } return reload ( notes ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { final com.google.gwt.user.client.ui.HTMLTable.Cell cell = table.getCellForEvent ( event ) ; if ( ( ( cell != null ) && ( ( cell.getCellIndex ( ) ) != 1 ) ) && ( ( getRowItem ( cell.getRowIndex ( ) ) ) != null ) ) { movePointerTo ( cell.getRowIndex ( ) ) ; } }

Target:
public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { final com.google.gerrit.client.reviewdb.AccountSshKey k = getRowItem ( row ) ; if ( ( k != null ) && ( ids.contains ( k.getKey ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } if ( ( table.getRowCount ( ) ) == 1 ) { showAddKeyBlock ( true ) ; } }
Source:
private static org.eclipse.jgit.diff.ReplaceEdit copy ( org.eclipse.jgit.diff.ReplaceEdit edit ) { java.util.List < org.eclipse.jgit.diff.Edit > internalEdits = edit.getInternalEdits ( ) . stream ( ) . map ( com.google.gerrit.server.patch.IntraLineDiff :: copy ) . collect ( java.util.stream.Collectors.toList ( ) ) ; return new org.eclipse.jgit.diff.ReplaceEdit ( edit.getBeginA ( ) , edit.getEndA ( ) , edit.getBeginB ( ) , edit.getEndB ( ) , internalEdits ) ; }

Target:
private static org.eclipse.jgit.diff.ReplaceEdit copy ( org.eclipse.jgit.diff.ReplaceEdit edit ) { java.util.List < org.eclipse.jgit.diff.Edit > internalEdits = edit.getInternalEdits ( ) . stream ( ) . map ( com.google.gerrit.server.diff.IntraLineDiff :: copy ) . collect ( java.util.stream.Collectors.toList ( ) ) ; return new org.eclipse.jgit.diff.ReplaceEdit ( edit.getBeginA ( ) , edit.getEndA ( ) , edit.getBeginB ( ) , edit.getEndB ( ) , internalEdits ) ; }
Source:
public void testWithSubmodule ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit c = makeCommitWithSubmodule ( ) ; java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m = com.googlesource.gerrit.plugins.uploadvalidator.SubmoduleValidator.performValidation ( repo , c ) ; com.google.common.truth.Truth.assertThat ( m ) . hasSize ( 1 ) ; java.util.List < com.googlesource.gerrit.plugins.uploadvalidator.ComparableCommitValidationMessage > expected = new java.util.ArrayList < > ( ) ; expected.add ( new com.googlesource.gerrit.plugins.uploadvalidator.ComparableCommitValidationMessage ( "submodules are not allowed: modules/library" , true ) ) ; com.google.common.truth.Truth.assertThat ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessages ( m ) ) . containsAllIn ( expected ) ; }

Target:
public void testWithSubmodule ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit c = makeCommitWithSubmodule ( ) ; java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m = com.googlesource.gerrit.plugins.uploadvalidator.SubmoduleValidator.performValidation ( repo , c ) ; com.google.common.truth.Truth.assertThat ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessages ( m ) ) . containsExactlyElementsIn ( com.google.common.collect.ImmutableSet.of ( "ERROR: submodules are not allowed: modules/library" ) ) ; }
Source:
private org.eclipse.jgit.revwalk.RevTree aFor ( org.eclipse.jgit.revwalk.RevCommit b , org.eclipse.jgit.revwalk.RevWalk walk ) throws java.io.IOException { switch ( b.getParentCount ( ) ) { case 0 : return walk.parseTree ( emptyTree ( ) ) ; case 1 : org.eclipse.jgit.revwalk.RevCommit a = b.getParent ( 0 ) ; walk.parseBody ( a ) ; return walk.parseTree ( a.getTree ( ) ) ; case 2 : return com.google.gerrit.server.patch.PatchListLoader.automerge ( repo , walk , b ) ; default : return null ; } }

Target:
private org.eclipse.jgit.revwalk.RevTree aFor ( org.eclipse.jgit.revwalk.RevCommit b , org.eclipse.jgit.revwalk.RevWalk walk ) throws java.io.IOException { switch ( b.getParentCount ( ) ) { case 0 : return walk.parseTree ( emptyTree ( ) ) ; case 1 : org.eclipse.jgit.revwalk.RevCommit a = b.getParent ( 0 ) ; walk.parseBody ( a ) ; return walk.parseTree ( a.getTree ( ) ) ; case 2 : return com.google.gerrit.server.patch.PatchListLoader.automerge ( repo , walk , b , mergeStrategy ) ; default : return null ; } }
Source:
void restore ( com.googlecode.prolog_cafe.lang.Prolog engine ) { engine.cont = this . cont ; engine.areg1 = this . areg1 ; engine.areg2 = this . areg2 ; }

Target:
void restore ( com.googlecode.prolog_cafe.lang.Prolog engine ) { engine.cont = this . cont ; engine.r1 = this . r1 ; engine.r2 = this . r2 ; engine.r3 = this . r3 ; engine.r4 = this . r4 ; engine.r5 = this . r5 ; engine.r6 = this . r6 ; engine.r7 = this . r7 ; engine.r8 = this . r8 ; engine.r9 = this . r9 ; }
Source:
public void filterOutAllResults ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; int user2 = accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "anotheruser" ) ) . getAccountId ( ) . get ( ) ; for ( int i = 0 ; i < 5 ; i ++ ) { insert ( newChange ( repo , null , null , user2 , null ) ) ; } assertQuery ( "status:new ownerin:Administrators" ) ; assertQuery ( "status:new ownerin:Administrators limit:2" ) ; }

Target:
public void filterOutMoreThanOnePageOfResults ( ) 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 ( newChangeForUser ( repo , userId ) ) ; com.google.gerrit.reviewdb.client.Account.Id user2 = accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "anotheruser" ) ) . getAccountId ( ) ; for ( int i = 0 ; i < 5 ; i ++ ) { insert ( newChangeForUser ( repo , user2 ) ) ; } assertQuery ( "status:new ownerin:Administrators" , change ) ; assertQuery ( "status:new ownerin:Administrators limit:2" , change ) ; }
Source:
protected void renderJson ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , java.lang.Object src , java.lang.reflect.Type typeOfSrc ) throws java.io.IOException { setApiHeaders ( res , com.google.gitiles.FormatType.JSON ) ; res.setStatus ( javax.servlet.http.HttpServletResponse.SC_OK ) ; java.io.PrintWriter writer = res.getWriter ( ) ; new com.google.gson.GsonBuilder ( ) . setFieldNamingPolicy ( com.google.gson.FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES ) . setPrettyPrinting ( ) . generateNonExecutableJson ( ) . create ( ) . toJson ( src , typeOfSrc , writer ) ; writer.print ( '\n' ) ; writer.close ( ) ; }

Target:
protected void renderJson ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , java.lang.Object src , java.lang.reflect.Type typeOfSrc ) throws java.io.IOException { setApiHeaders ( res , com.google.gitiles.FormatType.JSON ) ; res.setStatus ( javax.servlet.http.HttpServletResponse.SC_OK ) ; java.io.Writer writer = getWriter ( res ) ; new com.google.gson.GsonBuilder ( ) . setFieldNamingPolicy ( com.google.gson.FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES ) . setPrettyPrinting ( ) . generateNonExecutableJson ( ) . create ( ) . toJson ( src , typeOfSrc , writer ) ; writer.write ( '\n' ) ; writer.close ( ) ; }
Source:
public static org.eclipse.jgit.merge.ThreeWayMerger newThreeWayMerger ( org.eclipse.jgit.lib.Repository repo , final org.eclipse.jgit.lib.ObjectInserter inserter , java.lang.String strategyName ) { org.eclipse.jgit.merge.MergeStrategy strategy = org.eclipse.jgit.merge.MergeStrategy.get ( strategyName ) ; com.google.common.base.Preconditions.checkArgument ( ( strategy != null ) , "invalid merge strategy: %s" , strategyName ) ; org.eclipse.jgit.merge.Merger m = strategy.newMerger ( repo , true ) ; com.google.common.base.Preconditions.checkArgument ( ( m instanceof org.eclipse.jgit.merge.ThreeWayMerger ) , "merge strategy %s does not support three-way merging" , strategyName ) ; m.setObjectInserter ( inserter ) ; return ( ( org.eclipse.jgit.merge.ThreeWayMerger ) ( m ) ) ; }

Target:
protected org.eclipse.jgit.lib.ObjectInserter delegate ( ) { return inserter ; }
Source:
public void onCellClicked ( com.google.gwt.user.client.ui.SourcesTableEvents sender , int row , int cell ) { switch ( cell ) { case 1 : case 3 : break ; default : if ( ( getRowItem ( row ) ) != null ) { movePointerTo ( row ) ; } break ; } }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { final com.google.gwt.user.client.ui.HTMLTable.Cell cell = table.getCellForEvent ( event ) ; if ( cell != null ) { switch ( cell.getCellIndex ( ) ) { case 1 : case 3 : break ; default : if ( ( getRowItem ( cell.getRowIndex ( ) ) ) != null ) { movePointerTo ( cell.getRowIndex ( ) ) ; } break ; } } }
Source:
private static java.io.File popdir ( java.net.URL u , java.io.File dir , java.lang.String name ) throws java.io.FileNotFoundException { if ( dir.getName ( ) . equals ( name ) ) { return dir.getParentFile ( ) ; } throw new java.io.FileNotFoundException ( ( "Cannot find buck-out from " + u ) ) ; }

Target:
private static java.nio.file.Path popdir ( java.net.URL u , java.nio.file.Path dir , java.lang.String name ) throws java.io.FileNotFoundException { if ( com.google.gerrit.launcher.GerritLauncher.last ( dir ) . equals ( name ) ) { return dir.getParent ( ) ; } throw new java.io.FileNotFoundException ( ( "Cannot find buck-out from " + u ) ) ; }
Source:
private Project.NameKey getProjectName ( java.nio.file.Path p ) { java.lang.String projectName = basePath.relativize ( p ) . toString ( ) ; if ( ( java.io.File.separatorChar ) != '/' ) { projectName = projectName.replace ( java.io.File.separatorChar , '/' ) ; } if ( projectName.endsWith ( Constants.DOT_GIT_EXT ) ) { int newLen = ( projectName.length ( ) ) - ( Constants.DOT_GIT_EXT.length ( ) ) ; projectName = projectName.substring ( 0 , newLen ) ; } return new com.google.gerrit.reviewdb.client.Project.NameKey ( projectName ) ; }

Target:
private Project.NameKey getProjectName ( java.nio.file.Path p ) { java.lang.String projectName = startFolder.relativize ( p ) . toString ( ) ; if ( ( java.io.File.separatorChar ) != '/' ) { projectName = projectName.replace ( java.io.File.separatorChar , '/' ) ; } if ( projectName.endsWith ( Constants.DOT_GIT_EXT ) ) { int newLen = ( projectName.length ( ) ) - ( Constants.DOT_GIT_EXT.length ( ) ) ; projectName = projectName.substring ( 0 , newLen ) ; } return new com.google.gerrit.reviewdb.client.Project.NameKey ( projectName ) ; }
Source:
public void customConflictMessageWithConflictSubstitutionTest ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.automerger.FailedMergeException fme = new com.googlesource.gerrit.plugins.automerger.FailedMergeException ( failedMergeBranches , currentRevision , hostName , "${branch}: ${conflict}" , topic ) ; java.lang.String branch1String = "branch1: branch1 merge conflict" ; java.lang.String branch2String = "branch2: branch2 merge conflict" ; java.lang.String branch3String = "branch3: branch3 merge conflict" ; com.google.common.truth.Truth.assertThat ( fme.getDisplayString ( ) . split ( "\\n" ) ) . asList ( ) . containsExactly ( branch1String , branch2String , branch3String ) ; }

Target:
public void customConflictMessageWithPatchsetNumberTest ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.automerger.FailedMergeException fme = new com.googlesource.gerrit.plugins.automerger.FailedMergeException ( failedMergeBranches , currentRevision , hostName , projectName , changeNumber , patchsetNumber , "${patchsetNumber}: hooray" , topic ) ; java.lang.String patchsetNumberString = "2: hooray" ; com.google.common.truth.Truth.assertThat ( fme.getDisplayString ( ) . split ( "\\n" ) ) . asList ( ) . containsExactly ( patchsetNumberString , patchsetNumberString , patchsetNumberString ) ; }