auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private java.util.List < com.google.gerrit.acceptance.rest.group.AccountInfo > GET ( java.lang.String endpoint ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = session.get ( endpoint ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; return new com.google.gson.Gson ( ) . fromJson ( r.getReader ( ) , new com.google.common.reflect.TypeToken < java.util.List < com.google.gerrit.acceptance.rest.group.AccountInfo > > ( ) { } . getType ( ) ) ; }

Target:
private java.util.List < com.google.gerrit.acceptance.rest.group.AccountInfo > GET ( java.lang.String endpoint ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = session.get ( endpoint ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_OK , r.getStatusCode ( ) ) ; return new com.google.gson.Gson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.acceptance.rest.group.AccountInfo > > ( ) { } . getType ( ) ) ; }
Source:
public void create_NotExisting ( ) throws java.io.IOException { final java.nio.file.Path root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( root ) ; com.google.common.truth.Truth.assertThat ( site.isNew ) . isTrue ( ) ; com.google.gerrit.extensions.common.PathSubject.assertThat ( site.site_path ) . isEqualTo ( root ) ; com.google.gerrit.extensions.common.PathSubject.assertThat ( site.etc_dir ) . isEqualTo ( root.resolve ( "etc" ) ) ; }

Target:
public void create_NotExisting ( ) throws java.io.IOException { final java.nio.file.Path root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( root ) ; com.google.common.truth.Truth.assertThat ( site.isNew ) . isTrue ( ) ; com.google.gerrit.extensions.common.testing.PathSubject.assertThat ( site.site_path ) . isEqualTo ( root ) ; com.google.gerrit.extensions.common.testing.PathSubject.assertThat ( site.etc_dir ) . isEqualTo ( root.resolve ( "etc" ) ) ; }
Source:
public void onLoad ( ) { if ( ( descriptionPanel ) == null ) { initUI ( ) ; } displayTitle ( ( ( changeInfo ) != null ? changeInfo.getSubject ( ) : null ) ) ; super . onLoad ( ) ; Util.DETAIL_SVC.changeDetail ( changeId , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.data.ChangeDetail > ( ) { public void onSuccess ( final com.google.gerrit.client.data.ChangeDetail r ) { if ( isAttached ( ) ) { display ( r ) ; } } } ) ; }

Target:
public void onLoad ( ) { if ( ( descriptionPanel ) == null ) { initUI ( ) ; } displayTitle ( ( ( changeInfo ) != null ? changeInfo.getSubject ( ) : null ) ) ; super . onLoad ( ) ; refresh ( ) ; }
Source:
public void upsertOneException ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { java.sql.SQLException exception = new java.sql.BatchUpdateException ( ) ; java.sql.PreparedStatement update = stubStatementThrowExceptionOnExecute ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.UPDATE , exception ) ; try { classUnderTest.upsert ( oneRow ) ; org.junit.Assert.fail ( "missingException" ) ; } catch ( com.google.gwtorm.client.OrmException e ) { org.junit.Assert.assertSame ( e.getCause ( ) , exception ) ; } assertCorrectUpdating ( update , 1 ) ; }

Target:
public void upsertOneException ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.SQLException exception = new java.sql.BatchUpdateException ( ) ; java.sql.PreparedStatement update = stubStatementThrowExceptionOnExecute ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.UPDATE , exception ) ; try { classUnderTest.upsert ( oneRow ) ; org.junit.Assert.fail ( "missingException" ) ; } catch ( com.google.gwtorm.server.OrmException e ) { org.junit.Assert.assertSame ( e.getCause ( ) , exception ) ; } assertCorrectAttempting ( update , 1 ) ; }
Source:
public com.google.gerrit.server.change.Description getDescription ( com.google.gerrit.server.change.ChangeResource rsrc ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Unmark private" ) . setTitle ( "Unmark change as private" ) . setVisible ( ( ( rsrc.getChange ( ) . isPrivate ( ) ) && ( rsrc.isUserOwner ( ) ) ) ) ; }

Target:
protected boolean canDeletePrivate ( com.google.gerrit.server.change.ChangeResource rsrc ) { com.google.gerrit.server.permissions.PermissionBackend.WithUser user = permissionBackend.user ( rsrc.getUser ( ) ) ; return ( user.testOrFalse ( GlobalPermission.ADMINISTRATE_SERVER ) ) || ( ( rsrc.isUserOwner ( ) ) && ( ( rsrc.getChange ( ) . getStatus ( ) ) != ( Change.Status.MERGED ) ) ) ; }
Source:
public void onSuccess ( final com.google.gerrit.client.VoidResult result ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { final com.google.gerrit.reviewdb.client.AccountGroupMember k = getRowItem ( row ) ; if ( ( k != null ) && ( ids.contains ( k.getAccountId ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } }

Target:
public void onSuccess ( final com.google.gerrit.client.VoidResult result ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { final com.google.gerrit.client.groups.MemberInfo i = getRowItem ( row ) ; if ( ( i != null ) && ( ids.contains ( i.getAccountId ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } }
Source:
private void applyEdgeStyles ( final int row ) { final com.google.gwt.user.client.ui.HTMLTable.CellFormatter fmt = table.getCellFormatter ( ) ; fmt.addStyleName ( row , 0 , "leftmost" ) ; fmt.addStyleName ( row , 1 , "approvalrole" ) ; fmt.addStyleName ( row , ( 1 + ( types.size ( ) ) ) , "rightmost" ) ; fmt.addStyleName ( row , ( 2 + ( types.size ( ) ) ) , "approvalhint" ) ; }

Target:
private void applyEdgeStyles ( final int row ) { final com.google.gwt.user.client.ui.HTMLTable.CellFormatter fmt = table.getCellFormatter ( ) ; fmt.addStyleName ( row , 0 , "leftmost" ) ; fmt.addStyleName ( row , 0 , "reviewer" ) ; fmt.addStyleName ( row , 1 , "approvalrole" ) ; fmt.addStyleName ( row , ( 1 + ( types.size ( ) ) ) , "rightmost" ) ; fmt.addStyleName ( row , ( 2 + ( types.size ( ) ) ) , "approvalhint" ) ; }
Source:
public void getRefsHeadsText ( ) throws java.lang.Exception { com.google.gitiles.FakeHttpServletRequest req = com.google.gitiles.FakeHttpServletRequest.newRequest ( ) ; req.setPathInfo ( "/test/+refs/heads" ) ; req.setQueryString ( "format=TEXT" ) ; com.google.gitiles.FakeHttpServletResponse res = new com.google.gitiles.FakeHttpServletResponse ( ) ; servlet.service ( req , res ) ; org.junit.Assert.assertEquals ( 200 , res.getStatus ( ) ) ; org.junit.Assert.assertEquals ( ( ( ( ( id ( "refs/heads/branch" ) ) + " refs/heads/branch\n" ) + ( id ( "refs/heads/master" ) ) ) + " refs/heads/master\n" ) , res.getActualBodyString ( ) ) ; }

Target:
public void getRefsHeadsText ( ) throws java.lang.Exception { setUpSimpleRefs ( ) ; com.google.gitiles.FakeHttpServletRequest req = com.google.gitiles.FakeHttpServletRequest.newRequest ( ) ; req.setPathInfo ( "/test/+refs/heads" ) ; req.setQueryString ( "format=TEXT" ) ; com.google.gitiles.FakeHttpServletResponse res = new com.google.gitiles.FakeHttpServletResponse ( ) ; servlet.service ( req , res ) ; org.junit.Assert.assertEquals ( 200 , res.getStatus ( ) ) ; org.junit.Assert.assertEquals ( ( ( ( ( id ( "refs/heads/branch" ) ) + " refs/heads/branch\n" ) + ( id ( "refs/heads/master" ) ) ) + " refs/heads/master\n" ) , res.getActualBodyString ( ) ) ; }
Source:
public boolean isChangeUpToDate ( org.eclipse.jgit.lib.Repository changeRepo ) throws java.io.IOException { org.eclipse.jgit.lib.Ref ref = changeRepo.exactRef ( com.google.gerrit.server.notedb.ChangeNoteUtil.changeRefName ( changeId ) ) ; if ( ref == null ) { return changeMetaId.equals ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) ) ; } return ref.getObjectId ( ) . equals ( changeMetaId ) ; }

Target:
public boolean isChangeUpToDate ( org.eclipse.jgit.lib.Repository changeRepo ) throws java.io.IOException { org.eclipse.jgit.lib.Ref ref = changeRepo.exactRef ( com.google.gerrit.reviewdb.client.RefNames.changeMetaRef ( changeId ) ) ; if ( ref == null ) { return changeMetaId.equals ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) ) ; } return ref.getObjectId ( ) . equals ( changeMetaId ) ; }
Source:
public java.lang.String getCommand ( com.google.gerrit.extensions.config.DownloadScheme scheme , java.lang.String project , java.lang.String ref ) { if ( ( commandAllowed ) && ( scheme instanceof com.googlesource.gerrit.plugins.download.scheme.RepoScheme ) ) { return ( ( scheme.getUrl ( project ) ) + " " ) + ref ; } return null ; }

Target:
public java.lang.String getCommand ( com.google.gerrit.extensions.config.DownloadScheme scheme , java.lang.String project , java.lang.String ref ) { if ( ( commandAllowed ) && ( scheme instanceof com.googlesource.gerrit.plugins.download.scheme.RepoScheme ) ) { java.lang.String id = com.googlesource.gerrit.plugins.download.command.RepoCommand.trim ( ref ) ; if ( id != null ) { return ( ( "repo download " + ( scheme.getUrl ( project ) ) ) + " " ) + id ; } } return null ; }
Source:
private boolean canPerformOnAnyRef ( com.google.gerrit.reviewdb.ApprovalCategory.Id actionId , short requireValue ) { final java.util.Set < com.google.gerrit.reviewdb.AccountGroup.Id > groups = user.getEffectiveGroups ( ) ; for ( final com.google.gerrit.reviewdb.RefRight pr : state.getAllRights ( actionId , true ) ) { if ( ( groups.contains ( pr.getAccountGroupId ( ) ) ) && ( ( pr.getMaxValue ( ) ) >= requireValue ) ) { return true ; } } return false ; }

Target:
private boolean canPerformOnAnyRef ( com.google.gerrit.reviewdb.ApprovalCategory.Id actionId , short requireValue ) { final java.util.Set < com.google.gerrit.reviewdb.AccountGroup.UUID > groups = user.getEffectiveGroups ( ) ; for ( final com.google.gerrit.reviewdb.RefRight pr : state.getAllRights ( actionId , true ) ) { if ( ( groups.contains ( pr.getAccountGroupUUID ( ) ) ) && ( ( pr.getMaxValue ( ) ) >= requireValue ) ) { return true ; } } return false ; }
Source:
private long getLong ( java.lang.String name , java.lang.String setting , long def ) { return config.getLong ( "cache" , name , setting , def ) ; }

Target:
private long getSeconds ( java.lang.String n , java.lang.String setting , long def ) { final long d = java.util.concurrent.TimeUnit.MINUTES.convert ( def , java.util.concurrent.TimeUnit.SECONDS ) ; final long m ; m = com.google.gerrit.server.config.ConfigUtil.getTimeUnit ( config , "cache" , n , setting , d , java.util.concurrent.TimeUnit.MINUTES ) ; return java.util.concurrent.TimeUnit.SECONDS.convert ( m , java.util.concurrent.TimeUnit.MINUTES ) ; }
Source:
public static void assertGroups ( java.lang.Iterable < java.lang.String > expected , java.util.Set < java.lang.String > actual ) { for ( java.lang.String g : expected ) { com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( ( "missing group " + g ) ) . that ( actual.remove ( g ) ) . isTrue ( ) ; } com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( ( "unexpected groups: " + actual ) ) . that ( actual ) . isEmpty ( ) ; }

Target:
public static void assertGroups ( java.lang.Iterable < java.lang.String > expected , java.util.Set < java.lang.String > actual ) { for ( java.lang.String g : expected ) { com.google.common.truth.Truth.assert_ ( ) . withMessage ( ( "missing group " + g ) ) . that ( actual.remove ( g ) ) . isTrue ( ) ; } com.google.common.truth.Truth.assert_ ( ) . withMessage ( ( "unexpected groups: " + actual ) ) . that ( actual ) . isEmpty ( ) ; }
Source:
public void duplicateChangeEventOfAQueuedEventShouldGetDiscarded ( ) { com.google.gerrit.server.git.WorkQueue.Executor poolMock = org.mockito.Mockito.mock ( com.google.gerrit.server.git.WorkQueue.Executor.class ) ; indexEventHandler = new com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandler ( poolMock , com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandlerTest.PLUGIN_NAME , forwarder ) ; indexEventHandler.onChangeIndexed ( changeId.get ( ) ) ; indexEventHandler.onChangeIndexed ( changeId.get ( ) ) ; org.mockito.Mockito.verify ( poolMock , org.mockito.Mockito.times ( 1 ) ) . execute ( indexEventHandler.new com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandler.IndexChangeTask ( com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandlerTest.CHANGE_ID , false ) ) ; }

Target:
public void duplicateChangeEventOfAQueuedEventShouldGetDiscarded ( ) { java.util.concurrent.ScheduledThreadPoolExecutor poolMock = org.mockito.Mockito.mock ( java.util.concurrent.ScheduledThreadPoolExecutor.class ) ; indexEventHandler = new com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandler ( poolMock , com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandlerTest.PLUGIN_NAME , forwarder ) ; indexEventHandler.onChangeIndexed ( changeId.get ( ) ) ; indexEventHandler.onChangeIndexed ( changeId.get ( ) ) ; org.mockito.Mockito.verify ( poolMock , org.mockito.Mockito.times ( 1 ) ) . execute ( indexEventHandler.new com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandler.IndexChangeTask ( com.ericsson.gerrit.plugins.highavailability.index.IndexEventHandlerTest.CHANGE_ID , false ) ) ; }
Source:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.server.git.validators.CommitValidationListener.class ) . to ( com.googlesource.gerrit.plugins.uploadvalidator.BlockedKeywordValidator.class ) ; bind ( com.google.gerrit.server.config.ProjectConfigEntry.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.Exports.named ( com.googlesource.gerrit.plugins.uploadvalidator.BlockedKeywordValidator.KEY_CHECK_BLOCKED_KEYWORD_PATTERN ) ) . toInstance ( new com.google.gerrit.server.config.ProjectConfigEntry ( "Blocked Keyword Pattern" , null , com.google.gerrit.extensions.api.projects.ProjectConfigEntryType.ARRAY , null , false , ( "Pushes of commits that contain files with blocked keywords " + "will be rejected." ) ) ) ; }

Target:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.server.git.validators.CommitValidationListener.class ) . to ( com.googlesource.gerrit.plugins.uploadvalidator.BlockedKeywordValidator.class ) ; bind ( com.google.gerrit.server.config.ProjectConfigEntry.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.Exports.named ( com.googlesource.gerrit.plugins.uploadvalidator.BlockedKeywordValidator.KEY_CHECK_BLOCKED_KEYWORD_PATTERN ) ) . toInstance ( new com.google.gerrit.server.config.ProjectConfigEntry ( "Blocked Keyword Pattern" , null , com.google.gerrit.extensions.api.projects.ProjectConfigEntryType.ARRAY , null , false , ( "Pushes of commits that contain files or commit messages with " + "blocked keywords will be rejected." ) ) ) ; }
Source:
private void upsertOne ( T newObj ) throws com.google.gwtorm.client.OrmException { final byte [ ] key = dataRowKey ( newObj ) ; final byte [ ] oldBin = db.get ( key ) ; final T oldObj = ( oldBin != null ) ? com.google.gwtorm.nosql.generic.GenericAccess.getObjectCodec ( ) . decode ( oldBin ) : null ; writeNewIndexes ( oldObj , newObj ) ; db.upsert ( key , com.google.gwtorm.nosql.generic.GenericAccess.getObjectCodec ( ) . encode ( newObj ) . toByteArray ( ) ) ; pruneOldIndexes ( oldObj , newObj ) ; }

Target:
protected byte [ ] dataRowKey ( K key ) { com.google.gwtorm.nosql.IndexKeyBuilder b = new com.google.gwtorm.nosql.IndexKeyBuilder ( ) ; b.add ( com.google.gwtorm.nosql.generic.GenericAccess.getRelationName ( ) ) ; b.delimiter ( ) ; encodePrimaryKey ( b , key ) ; return b.toByteArray ( ) ; }
Source:
protected void configure ( ) { if ( ( gerritConfig.getString ( pluginName , null , "url" ) ) != null ) { com.googlesource.gerrit.plugins.hooks.jira.JiraModule.LOG.info ( "JIRA is configured as ITS" ) ; bind ( com.googlesource.gerrit.plugins.hooks.its.ItsFacade.class ) . toInstance ( new com.googlesource.gerrit.plugins.hooks.jira.JiraItsFacade ( pluginName , gerritConfig ) ) ; install ( new com.googlesource.gerrit.plugins.hooks.ItsHookModule ( ) ) ; } }

Target:
protected void configure ( ) { if ( ( gerritConfig.getString ( pluginName , null , "url" ) ) != null ) { com.googlesource.gerrit.plugins.hooks.jira.JiraModule.LOG.info ( "JIRA is configured as ITS" ) ; bind ( com.googlesource.gerrit.plugins.hooks.its.ItsFacade.class ) . toInstance ( new com.googlesource.gerrit.plugins.hooks.jira.JiraItsFacade ( pluginName , gerritConfig ) ) ; install ( new com.googlesource.gerrit.plugins.hooks.ItsHookModule ( pluginName , pluginCfgFactory ) ) ; } }
Source:
private static java.lang.String getRevision ( com.googlesource.gerrit.plugins.xdocs.client.ChangeInfo change , int patchSet ) { for ( com.googlesource.gerrit.plugins.xdocs.client.ChangeInfo.RevisionInfo rev : com.google.gerrit.client.rpc.Natives.asList ( change.revisions ( ) . values ( ) ) ) { if ( ( rev._number ( ) ) == patchSet ) { return rev.ref ( ) ; } } throw new java.lang.IllegalArgumentException ( ( ( "Patch set " + patchSet ) + " not found." ) ) ; }

Target:
private static java.lang.String getRevision ( com.googlesource.gerrit.plugins.xdocs.client.ChangeInfo change , int patchSet ) { for ( com.googlesource.gerrit.plugins.xdocs.client.ChangeInfo.RevisionInfo rev : com.google.gerrit.client.rpc.Natives.asList ( change.revisions ( ) . values ( ) ) ) { if ( rev.is_edit ( ) ) { return rev.commit ( ) . commit ( ) ; } if ( ( rev._number ( ) ) == patchSet ) { return rev.ref ( ) ; } } throw new java.lang.IllegalArgumentException ( ( ( "Patch set " + patchSet ) + " not found." ) ) ; }
Source:
private java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > approvals ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.change.ReviewerResource rsrc ) throws com.google.gwtorm.server.OrmException { final com.google.gerrit.reviewdb.client.Account.Id user = rsrc.getReviewerUser ( ) . getAccountId ( ) ; return com.google.common.collect.Iterables.filter ( approvalsUtil.byChange ( db , rsrc.getChangeResource ( ) . getNotes ( ) ) . values ( ) , new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSetApproval > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.PatchSetApproval input ) { return user.equals ( input.getAccountId ( ) ) ; } } ) ; }

Target:
private java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > approvals ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx , final com.google.gerrit.reviewdb.client.Account.Id accountId ) throws com.google.gwtorm.server.OrmException { return com.google.common.collect.Iterables.filter ( approvalsUtil.byChange ( ctx.getDb ( ) , ctx.getNotes ( ) ) . values ( ) , new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSetApproval > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.PatchSetApproval input ) { return accountId.equals ( input.getAccountId ( ) ) ; } } ) ; }
Source:
public RefUpdate.Result call ( ) throws java.lang.Exception { org.eclipse.jgit.lib.Ref ref = repo.exactRef ( refName ) ; afterReadRef.run ( ) ; org.eclipse.jgit.lib.ObjectId oldId ; if ( ref == null ) { oldId = org.eclipse.jgit.lib.ObjectId.zeroId ( ) ; next = seed.get ( ) ; } else { oldId = ref.getObjectId ( ) ; next = parse ( oldId ) ; } return store ( repo , rw , oldId , ( ( next ) + ( batchSize ) ) ) ; }

Target:
public RefUpdate.Result call ( ) throws java.lang.Exception { org.eclipse.jgit.lib.Ref ref = repo.exactRef ( refName ) ; afterReadRef.run ( ) ; org.eclipse.jgit.lib.ObjectId oldId ; if ( ref == null ) { oldId = org.eclipse.jgit.lib.ObjectId.zeroId ( ) ; next = seed.get ( ) ; } else { oldId = ref.getObjectId ( ) ; next = parse ( oldId ) ; } return store ( repo , rw , oldId , ( ( next ) + ( count ) ) ) ; }
Source:
private static void h ( final java.lang.StringBuilder r , final com.google.gerrit.reviewdb.Branch.NameKey branch ) { com.google.gerrit.common.data.GitwebLink.var ( r , "h" , branch.get ( ) ) ; }

Target:
public java.lang.String toBranch ( final com.google.gerrit.reviewdb.Branch.NameKey branch ) { com.google.gerrit.common.data.ParamertizedString pattern = new com.google.gerrit.common.data.ParamertizedString ( type.getBranch ( ) ) ; final java.util.Map < java.lang.String , java.lang.String > p = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; p.put ( "project" , com.google.gwt.http.client.URL.encodeComponent ( branch.getParentKey ( ) . get ( ) ) ) ; p.put ( "branch" , com.google.gwt.http.client.URL.encodeComponent ( branch.get ( ) ) ) ; return ( baseUrl ) + ( pattern.replace ( p ) ) ; }
Source:
public void visit ( org.pegdown.ast.ExpImageNode node ) { html.open ( "img" ) . attribute ( "src" , resolveImageUrl ( node.url ) ) . attribute ( "title" , node.title ) . attribute ( "alt" , com.google.gitiles.doc.MarkdownUtil.getInnerText ( node ) ) ; }

Target:
public void visit ( org.commonmark.node.Image node ) { html.open ( "img" ) . attribute ( "src" , resolveImageUrl ( node.getDestination ( ) ) ) . attribute ( "title" , node.getTitle ( ) ) . attribute ( "alt" , com.google.gitiles.doc.MarkdownUtil.getInnerText ( node ) ) ; }
Source:
protected void configure ( ) { factory ( AgreementInfoFactory.Factory.class ) ; factory ( CreateGroup.Factory.class ) ; factory ( DeleteExternalIds.Factory.class ) ; factory ( ExternalIdDetailFactory.Factory.class ) ; factory ( GroupDetailHandler.Factory.class ) ; factory ( MyGroupsFactory.Factory.class ) ; factory ( RenameGroup.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( AgreementInfoFactory.Factory.class ) ; factory ( CreateGroup.Factory.class ) ; factory ( DeleteExternalIds.Factory.class ) ; factory ( ExternalIdDetailFactory.Factory.class ) ; factory ( GroupDetailHandler.Factory.class ) ; factory ( MyGroupsFactory.Factory.class ) ; factory ( RenameGroup.Factory.class ) ; factory ( VisibleGroups.Factory.class ) ; }
Source:
static java.lang.String authorName ( com.google.gerrit.client.changes.ChangeInfo.MessageInfo info ) { if ( ( info.author ( ) ) != null ) { if ( ( info.author ( ) . name ( ) ) != null ) { return info.author ( ) . name ( ) ; } return com.google.gerrit.client.Gerrit.info ( ) . user ( ) . anonymousCowardName ( ) ; } return Util.C.messageNoAuthor ( ) ; }

Target:
static java.lang.String authorName ( com.google.gerrit.client.info.ChangeInfo.MessageInfo info ) { if ( ( info.author ( ) ) != null ) { if ( ( info.author ( ) . name ( ) ) != null ) { return info.author ( ) . name ( ) ; } return com.google.gerrit.client.Gerrit.info ( ) . user ( ) . anonymousCowardName ( ) ; } return Util.C.messageNoAuthor ( ) ; }
Source:
protected java.util.List < com.google.gerrit.extensions.common.ChangeInfo > assertQuery ( com.google.gerrit.extensions.api.changes.Changes.QueryRequest query , com.google.gerrit.reviewdb.client.Change ... changes ) throws java.lang.Exception { java.util.List < com.google.gerrit.extensions.common.ChangeInfo > result = query.get ( ) ; java.lang.Iterable < java.lang.Integer > ids = com.google.gerrit.server.query.change.AbstractQueryChangesTest.ids ( result ) ; com.google.common.truth.Truth.assertThat ( ids ) . named ( ids.toString ( ) ) . containsExactlyElementsIn ( com.google.gerrit.server.query.change.AbstractQueryChangesTest.ids ( changes ) ) . inOrder ( ) ; return result ; }

Target:
protected java.util.List < com.google.gerrit.extensions.common.ChangeInfo > assertQuery ( com.google.gerrit.extensions.api.changes.Changes.QueryRequest query , com.google.gerrit.reviewdb.client.Change ... changes ) throws java.lang.Exception { java.util.List < com.google.gerrit.extensions.common.ChangeInfo > result = query.get ( ) ; java.lang.Iterable < java.lang.Integer > ids = com.google.gerrit.server.query.change.AbstractQueryChangesTest.ids ( result ) ; com.google.common.truth.Truth.assertThat ( ids ) . named ( query.getQuery ( ) ) . containsExactlyElementsIn ( com.google.gerrit.server.query.change.AbstractQueryChangesTest.ids ( changes ) ) . inOrder ( ) ; return result ; }
Source:
public java.util.Optional < com.googlesource.gerrit.plugins.manager.gson.SmartJson > getOptional ( java.lang.String fieldName ) { HEAD ( 57 ) ; com.googlesource.gerrit.plugins.manager.gson.c082 Adapt ; latest = $missing$ ; AcceptCreate = $missing$ ; }

Target:
public java.util.Optional < com.googlesource.gerrit.plugins.manager.gson.SmartJson > getOptional ( java.lang.String fieldName ) { if ( ( ( ( jsonElem ) != null ) && ( ! ( jsonElem.isJsonNull ( ) ) ) ) && ( ( jsonElem.getAsJsonObject ( ) . get ( fieldName ) ) != null ) ) { return java.util.Optional.of ( com.googlesource.gerrit.plugins.manager.gson.SmartJson.of ( jsonElem.getAsJsonObject ( ) . get ( fieldName ) ) ) ; } return java.util.Optional.empty ( ) ; }
Source:
public void run ( ) throws java.lang.Exception { org.eclipse.jgit.lib.Config cfg = allProjectsConfig.load ( ) ; if ( ( cfg == null ) || ( ! ( cfg.getSubsections ( com.google.gerrit.pgm.init.InitLabels.KEY_LABEL ) . contains ( com.google.gerrit.pgm.init.InitLabels.LABEL_VERIFIED ) ) ) ) { ui.header ( "Review Labels" ) ; installVerified = ui.yesno ( false , "Install Verified label" ) ; } }

Target:
public void run ( ) throws java.lang.Exception { org.eclipse.jgit.lib.Config cfg = allProjectsConfig.load ( ) . getConfig ( ) ; if ( ( cfg == null ) || ( ! ( cfg.getSubsections ( com.google.gerrit.pgm.init.InitLabels.KEY_LABEL ) . contains ( com.google.gerrit.pgm.init.InitLabels.LABEL_VERIFIED ) ) ) ) { ui.header ( "Review Labels" ) ; installVerified = ui.yesno ( false , "Install Verified label" ) ; } }
Source:
public void testUnblockRangeForNotChangeOwner ( ) { com.google.gerrit.server.project.Util.grant ( local , ( ( com.google.gerrit.common.data.Permission.LABEL ) + "Code-Review" ) , ( - 2 ) , ( + 2 ) , com.google.gerrit.server.group.SystemGroupBackend.CHANGE_OWNER , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.common.data.PermissionRange range = u.controlForRef ( "refs/heads/master" ) . getRange ( ( ( com.google.gerrit.common.data.Permission.LABEL ) + "Code-Review" ) ) ; org.junit.Assert.assertFalse ( "u can vote -2" , range.contains ( ( - 2 ) ) ) ; org.junit.Assert.assertFalse ( "u can vote +2" , range.contains ( 2 ) ) ; }

Target:
public void testUnblockRangeForNotChangeOwner ( ) { com.google.gerrit.server.project.Util.allow ( local , ( ( com.google.gerrit.common.data.Permission.LABEL ) + "Code-Review" ) , ( - 2 ) , ( + 2 ) , com.google.gerrit.server.group.SystemGroupBackend.CHANGE_OWNER , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.common.data.PermissionRange range = u.controlForRef ( "refs/heads/master" ) . getRange ( ( ( com.google.gerrit.common.data.Permission.LABEL ) + "Code-Review" ) ) ; org.junit.Assert.assertFalse ( "u can vote -2" , range.contains ( ( - 2 ) ) ) ; org.junit.Assert.assertFalse ( "u can vote +2" , range.contains ( 2 ) ) ; }
Source:
private java.lang.Class < T > generate ( final com.google.gwtorm.schema.sql.SqlDialect dialect , final com.google.gwtorm.server.GeneratedClassLoader loader ) throws com.google.gwtorm.client.OrmException { return new com.google.gwtorm.server.SchemaGen ( loader , schemaModel , com.google.gwtorm.jdbc.JdbcSchema.class , new com.google.gwtorm.server.SchemaGen.AccessGenerator ( ) { @ java.lang.Override public java.lang.Class < ? > create ( com.google.gwtorm.server.GeneratedClassLoader loader , com.google.gwtorm.schema.RelationModel rm ) throws com.google.gwtorm.client.OrmException { return new com.google.gwtorm.jdbc.AccessGen ( loader , rm , dialect ) . create ( ) ; } } ) . create ( ) ; }

Target:
private java.lang.Class < T > generate ( final com.google.gwtorm.schema.sql.SqlDialect dialect , final com.google.gwtorm.server.GeneratedClassLoader loader ) throws com.google.gwtorm.client.OrmException { return new com.google.gwtorm.server.SchemaGen ( loader , schemaModel , getClass ( ) , com.google.gwtorm.jdbc.JdbcSchema.class , new com.google.gwtorm.server.SchemaGen.AccessGenerator ( ) { @ java.lang.Override public java.lang.Class < ? > create ( com.google.gwtorm.server.GeneratedClassLoader loader , com.google.gwtorm.schema.RelationModel rm ) throws com.google.gwtorm.client.OrmException { return new com.google.gwtorm.jdbc.AccessGen ( loader , rm , dialect ) . create ( ) ; } } ) . create ( ) ; }
Source:
public void run ( ) { try { for ( com.google.gerrit.reviewdb.client.Project.NameKey nameKey : projectCache.all ( ) ) { if ( filter.matches ( nameKey ) ) { replication.scheduleFullSync ( nameKey , urlMatch , state ) ; } } } catch ( java.lang.Exception e ) { stateLog.error ( "Cannot enumerate known projects" , e , state ) ; } state.markAllPushTasksScheduled ( ) ; }

Target:
public void run ( ) { try { for ( com.google.gerrit.reviewdb.client.Project.NameKey nameKey : projectCache.all ( ) ) { if ( filter.matches ( nameKey ) ) { replication.scheduleFullSync ( nameKey , urlMatch , state , now ) ; } } } catch ( java.lang.Exception e ) { stateLog.error ( "Cannot enumerate known projects" , e , state ) ; } state.markAllPushTasksScheduled ( ) ; }
Source:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < > ( ) ; modules.add ( sysInjector.getInstance ( com.google.gerrit.sshd.SshModule.class ) ) ; if ( ! ( test ) ) { modules.add ( new com.google.gerrit.sshd.SshHostKeyModule ( ) ) ; } modules.add ( new com.google.gerrit.sshd.commands.DefaultCommandModule ( slave ) ) ; return sysInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.AbstractModule createIndexModule ( ) { if ( slave ) { return new com.google.gerrit.server.index.DummyIndexModule ( ) ; } com.google.gerrit.server.index.IndexModule.IndexType indexType = com.google.gerrit.server.index.IndexModule.getIndexType ( cfgInjector ) ; switch ( indexType ) { case LUCENE : return ( luceneModule ) != null ? luceneModule : new com.google.gerrit.lucene.LuceneIndexModule ( ) ; default : throw new java.lang.IllegalStateException ( ( "unsupported index.type = " + indexType ) ) ; } }
Source:
public void run ( ) { view.getCmFromSide ( DisplaySide.A ) . setOption ( "mode" , mode ) ; view.getCmFromSide ( DisplaySide.B ) . setOption ( "mode" , mode ) ; }

Target:
public void onSuccess ( java.lang.Void result ) { if ( ( ( prefs.syntaxHighlighting ( ) ) && ( java.util.Objects.equals ( mode , getSelectedMode ( ) ) ) ) && ( view.isAttached ( ) ) ) { view.operation ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { view.getCmFromSide ( DisplaySide.A ) . setOption ( "mode" , mode ) ; view.getCmFromSide ( DisplaySide.B ) . setOption ( "mode" , mode ) ; } } ) ; } }
Source:
public T decode ( java.nio.ByteBuffer buf ) { if ( buf.hasArray ( ) ) { return decode ( com.google.protobuf.CodedInputStream.newInstance ( buf.array ( ) , buf.position ( ) , buf.remaining ( ) ) ) ; } else { return decode ( com.google.protobuf.ByteString.copyFrom ( buf ) ) ; } }

Target:
public T decode ( java.nio.ByteBuffer buf ) { if ( buf.hasArray ( ) ) { com.google.protobuf.CodedInputStream in = com.google.protobuf.CodedInputStream.newInstance ( buf.array ( ) , buf.position ( ) , buf.remaining ( ) ) ; T obj = decode ( in ) ; buf.position ( ( ( buf.position ( ) ) + ( in.getTotalBytesRead ( ) ) ) ) ; return obj ; } else { return decode ( com.google.protobuf.ByteString.copyFrom ( buf ) ) ; } }
Source:
private org.apache.lucene.index.Term idTerm ( com.google.gerrit.server.query.change.ChangeData cd ) { return intTerm ( com.google.gerrit.server.query.change.ChangeQueryBuilder.FIELD_CHANGE , cd.getId ( ) . get ( ) ) ; }

Target:
private static org.apache.lucene.index.IndexWriterConfig getIndexWriterConfig ( org.eclipse.jgit.lib.Config cfg , java.lang.String name ) { org.apache.lucene.index.IndexWriterConfig writerConfig = new org.apache.lucene.index.IndexWriterConfig ( com.google.gerrit.lucene.LuceneChangeIndex.LUCENE_VERSION , new org.apache.lucene.analysis.standard.StandardAnalyzer ( com.google.gerrit.lucene.LuceneChangeIndex.LUCENE_VERSION ) ) ; writerConfig.setOpenMode ( OpenMode.CREATE_OR_APPEND ) ; double m = 1 << 20 ; writerConfig.setRAMBufferSizeMB ( ( ( cfg.getLong ( "index" , name , "ramBufferSize" , ( ( long ) ( ( org.apache.lucene.index.IndexWriterConfig.DEFAULT_RAM_BUFFER_SIZE_MB ) * m ) ) ) ) / m ) ) ; writerConfig.setMaxBufferedDocs ( cfg.getInt ( "index" , name , "maxBufferedDocs" , IndexWriterConfig.DEFAULT_MAX_BUFFERED_DOCS ) ) ; return writerConfig ; }
Source:
public void postRun ( ) throws java.lang.Exception { org.eclipse.jgit.lib.Config cfg = allProjectsConfig.load ( ) ; if ( installVerified ) { cfg.setString ( com.google.gerrit.pgm.init.InitLabels.KEY_LABEL , com.google.gerrit.pgm.init.InitLabels.LABEL_VERIFIED , com.google.gerrit.pgm.init.InitLabels.KEY_FUNCTION , "MaxWithBlock" ) ; cfg.setStringList ( com.google.gerrit.pgm.init.InitLabels.KEY_LABEL , com.google.gerrit.pgm.init.InitLabels.LABEL_VERIFIED , com.google.gerrit.pgm.init.InitLabels.KEY_VALUE , java.util.Arrays.asList ( new java.lang.String [ ] { "-1 Fails" , " 0 No score" , "+1 Verified" } ) ) ; allProjectsConfig.save ( "Configure 'Verified' label" ) ; } }

Target:
public void postRun ( ) throws java.lang.Exception { org.eclipse.jgit.lib.Config cfg = allProjectsConfig.load ( ) . getConfig ( ) ; if ( installVerified ) { cfg.setString ( com.google.gerrit.pgm.init.InitLabels.KEY_LABEL , com.google.gerrit.pgm.init.InitLabels.LABEL_VERIFIED , com.google.gerrit.pgm.init.InitLabels.KEY_FUNCTION , "MaxWithBlock" ) ; cfg.setStringList ( com.google.gerrit.pgm.init.InitLabels.KEY_LABEL , com.google.gerrit.pgm.init.InitLabels.LABEL_VERIFIED , com.google.gerrit.pgm.init.InitLabels.KEY_VALUE , java.util.Arrays.asList ( new java.lang.String [ ] { "-1 Fails" , " 0 No score" , "+1 Verified" } ) ) ; allProjectsConfig.save ( "Configure 'Verified' label" ) ; } }
Source:
public void writeNoChanges ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , modifier.createEdit ( change , ps ) ) ; com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editUtil.byChange ( change ) ; org.junit.Assert.assertTrue ( edit.isPresent ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NEW , modifier.modifyFile ( edit.get ( ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME , org.eclipse.jgit.lib.Constants.encode ( com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_OLD ) ) ) ; }

Target:
private java.lang.String amendChange ( org.eclipse.jgit.api.Git git , org.eclipse.jgit.lib.PersonIdent ident , java.lang.String changeId ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , ident , PushOneCommit.SUBJECT , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME2 , new java.lang.String ( com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_NEW2 ) , changeId ) ; return push.to ( git , "refs/for/master" ) . getChangeId ( ) ; }
Source:
public java.lang.String getUrl ( ) { java.lang.String database = cfg.getString ( "database" , null , "database" ) ; if ( ( database == null ) || ( database.isEmpty ( ) ) ) { database = "db/ReviewDB" ; } return "jdbc:h2:" + ( site.resolve ( database ) . toUri ( ) . toString ( ) ) ; }

Target:
public java.lang.String getUrl ( ) { java.lang.String database = cfg.getString ( "database" , null , "database" ) ; if ( ( database == null ) || ( database.isEmpty ( ) ) ) { database = "db/ReviewDB" ; } return com.google.gerrit.server.schema.H2.appendUrlOptions ( cfg , com.google.gerrit.server.schema.H2.createUrl ( site.resolve ( database ) ) ) ; }
Source:
public com.google.common.base.Optional < com.google.gerrit.server.plugins.PluginEntry > getEntry ( java.lang.String resourcePath ) { java.io.File resourceFile = getResourceFile ( resourcePath ) ; if ( ( resourceFile.exists ( ) ) && ( ( resourceFile.length ( ) ) > 0 ) ) { return resourceOf ( resourcePath ) ; } else { return com.google.common.base.Optional.absent ( ) ; } }

Target:
public java.io.InputStream getInputStream ( com.google.gerrit.server.plugins.PluginEntry entry ) throws java.io.IOException { return webScanner.getInputStream ( entry ) ; }
Source:
static int toMask ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { int mask = event.getUnicodeCharCode ( ) ; if ( mask == 0 ) { mask = event.getNativeEvent ( ) . getKeyCode ( ) ; } return mask ; }

Target:
static int toMask ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { int mask = event.getUnicodeCharCode ( ) ; if ( mask == 0 ) { mask = event.getNativeEvent ( ) . getKeyCode ( ) ; } if ( event.isControlKeyDown ( ) ) { mask |= KeyCommand.M_CTRL ; } if ( event.isMetaKeyDown ( ) ) { mask |= KeyCommand.M_META ; } return mask ; }
Source:
public int hashCode ( ) { int h = projectKey.hashCode ( ) ; if ( ( oldId ) != null ) { h *= 31 ; h += oldId.hashCode ( ) ; } h *= 31 ; h += newId.hashCode ( ) ; h *= 31 ; h += fileName.hashCode ( ) ; if ( ( sourceFileName ) != null ) { h *= 31 ; h += sourceFileName.hashCode ( ) ; } return h ; }

Target:
public int hashCode ( ) { int h = projectKey.hashCode ( ) ; if ( ( oldId ) != null ) { h *= 31 ; h += oldId.hashCode ( ) ; } h *= 31 ; h += newId.hashCode ( ) ; h *= 31 ; h += fileName.hashCode ( ) ; if ( ( sourceFileName ) != null ) { h *= 31 ; h += sourceFileName.hashCode ( ) ; } h *= 31 ; h += whitespace.ordinal ( ) ; return h ; }
Source:
protected void init ( ) throws com.google.gerrit.common.errors.EmailException { super . init ( ) ; if ( ( fromId ) != null ) { reviewers.remove ( fromId ) ; } add ( RecipientType.TO , reviewers ) ; add ( RecipientType.CC , extraCC ) ; rcptToAuthors ( RecipientType.CC ) ; bccStarredBy ( ) ; }

Target:
protected void init ( ) throws com.google.gerrit.common.errors.EmailException { super . init ( ) ; if ( ( fromId ) != null ) { reviewers.remove ( fromId ) ; } add ( RecipientType.TO , reviewers ) ; add ( RecipientType.CC , extraCC ) ; rcptToAuthors ( RecipientType.CC ) ; bccStarredBy ( ) ; includeWatchers ( NotifyType.NEW_PATCHSETS ) ; }
Source:
private void populateTableHeader ( final com.google.gerrit.common.data.PatchScript script , final com.google.gerrit.common.data.PatchSetDetail detail ) { prepareHeaderWidgets ( script , detail ) ; table.setWidget ( com.google.gerrit.client.patches.R_HEAD , com.google.gerrit.client.patches.UnifiedDiffTable.PC , psListOfHeaderA ) ; table.setWidget ( rowOfTableHeaderB , com.google.gerrit.client.patches.UnifiedDiffTable.PC , psListOfHeaderB ) ; table.getFlexCellFormatter ( ) . addStyleName ( com.google.gerrit.client.patches.R_HEAD , com.google.gerrit.client.patches.UnifiedDiffTable.PC , Gerrit.RESOURCES.css ( ) . unifiedTableHeader ( ) ) ; table.getFlexCellFormatter ( ) . addStyleName ( rowOfTableHeaderB , com.google.gerrit.client.patches.UnifiedDiffTable.PC , Gerrit.RESOURCES.css ( ) . unifiedTableHeader ( ) ) ; }

Target:
private void populateTableHeader ( final com.google.gerrit.common.data.PatchScript script , final com.google.gerrit.common.data.PatchSetDetail detail ) { initHeaders ( script , detail ) ; table.setWidget ( com.google.gerrit.client.patches.R_HEAD , com.google.gerrit.client.patches.UnifiedDiffTable.PC , headerSideA ) ; table.setWidget ( rowOfTableHeaderB , com.google.gerrit.client.patches.UnifiedDiffTable.PC , headerSideB ) ; table.getFlexCellFormatter ( ) . addStyleName ( com.google.gerrit.client.patches.R_HEAD , com.google.gerrit.client.patches.UnifiedDiffTable.PC , Gerrit.RESOURCES.css ( ) . unifiedTableHeader ( ) ) ; table.getFlexCellFormatter ( ) . addStyleName ( rowOfTableHeaderB , com.google.gerrit.client.patches.UnifiedDiffTable.PC , Gerrit.RESOURCES.css ( ) . unifiedTableHeader ( ) ) ; }
Source:
abstract void setExpandAllComments ( boolean b ) ;

Target:
void setExpandAllComments ( boolean b ) { setExpandAll ( b ) ; for ( com.google.gerrit.client.diff.CommentGroup g : sideA.values ( ) ) { g.setOpenAll ( b ) ; } for ( com.google.gerrit.client.diff.CommentGroup g : sideB.values ( ) ) { g.setOpenAll ( b ) ; } }
Source:
private org.eclipse.jgit.lib.ObjectId createCommit ( com.google.gerrit.server.IdentifiedUser me , org.eclipse.jgit.lib.ObjectInserter inserter , org.eclipse.jgit.revwalk.RevCommit revision , org.eclipse.jgit.lib.ObjectId tree , java.lang.String msg , java.sql.Timestamp when ) throws java.io.IOException { org.eclipse.jgit.lib.CommitBuilder builder = new org.eclipse.jgit.lib.CommitBuilder ( ) ; builder.setTreeId ( tree ) ; builder.setParentIds ( revision.getParents ( ) ) ; builder.setAuthor ( revision.getAuthorIdent ( ) ) ; builder.setCommitter ( getCommitterIdent ( me , when ) ) ; builder.setMessage ( msg ) ; return inserter.insert ( builder ) ; }

Target:
private org.eclipse.jgit.lib.PersonIdent getCommitterIdent ( java.sql.Timestamp commitTimestamp ) { com.google.gerrit.server.IdentifiedUser user = currentUser.get ( ) . asIdentifiedUser ( ) ; return user.newCommitterIdent ( commitTimestamp , tz ) ; }
Source:
public void onSuccess ( final com.google.gerrit.common.data.HostPageData result ) { com.google.gwt.dom.client.Document.get ( ) . getElementById ( "gerrit_hostpagedata" ) . removeFromParent ( ) ; com.google.gerrit.client.Gerrit.myTheme = result.theme ; com.google.gerrit.client.Gerrit.isNoteDbEnabled = result.isNoteDbEnabled ; if ( ( result.account ) != null ) { com.google.gerrit.client.Gerrit.myAccount = result.account ; com.google.gerrit.client.Gerrit.xGerritAuth = result.xGerritAuth ; } if ( ( result.accountDiffPref ) != null ) { com.google.gerrit.client.Gerrit.myAccountDiffPref = result.accountDiffPref ; com.google.gerrit.client.Gerrit.applyUserPreferences ( ) ; } onModuleLoad2 ( result ) ; }

Target:
public static void setUserPreferences ( com.google.gerrit.client.info.AccountPreferencesInfo prefs ) { com.google.gerrit.client.Gerrit.myPrefs = prefs ; com.google.gerrit.client.Gerrit.applyUserPreferences ( ) ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; }
Source:
public void starUnstarChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; java.lang.String triplet = "p~master~" + ( r.getChangeId ( ) ) ; gApi.accounts ( ) . self ( ) . starChange ( triplet ) ; com.google.common.truth.Truth.assertThat ( info ( triplet ) . starred ) . isTrue ( ) ; gApi.accounts ( ) . self ( ) . unstarChange ( triplet ) ; com.google.common.truth.Truth.assertThat ( info ( triplet ) . starred ) . isNull ( ) ; }

Target:
public void starUnstarChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; java.lang.String triplet = ( ( project.get ( ) ) + "~master~" ) + ( r.getChangeId ( ) ) ; gApi.accounts ( ) . self ( ) . starChange ( triplet ) ; com.google.common.truth.Truth.assertThat ( info ( triplet ) . starred ) . isTrue ( ) ; gApi.accounts ( ) . self ( ) . unstarChange ( triplet ) ; com.google.common.truth.Truth.assertThat ( info ( triplet ) . starred ) . isNull ( ) ; }
Source:
public void addReviewerToReviewableChangeByOtherCcingSelfInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.TestAccount other = accounts.create ( "other" , "other@example.com" , "other" ) ; forAll ( ( adder ) -> { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; com.google.gerrit.acceptance.TestAccount reviewer = accounts.create ( "added" , "added@example.com" , "added" ) ; addReviewer ( adder , sc.changeId , other , reviewer.email , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS , null ) ; assertThat ( sender ) . sent ( "newchange" , sc ) . to ( reviewer ) . cc ( sc.owner , sc.reviewer , other ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . noOneElse ( ) ; } ) ; }

Target:
private void addReviewerToReviewableChangeByOtherCcingSelfInNoteDb ( com.google.gerrit.acceptance.server.mail.AddReviewerSenderIT.Adder adder ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.TestAccount other = accountCreator.create ( "other" , "other@example.com" , "other" ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; com.google.gerrit.acceptance.TestAccount reviewer = accountCreator.create ( "added" , "added@example.com" , "added" ) ; addReviewer ( adder , sc.changeId , other , reviewer.email , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS , null ) ; assertThat ( sender ) . sent ( "newchange" , sc ) . to ( reviewer ) . cc ( sc.owner , sc.reviewer , other ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . noOneElse ( ) ; }
Source:
protected void configureServlets ( ) { serveRegex ( ( ( "^" + ( ImageServlet.PATH_PREFIX ) ) + "(.+)?$" ) ) . with ( com.googlesource.gerrit.plugins.imagare.ImageServlet.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.webui.WebUiPlugin.class ) . toInstance ( new com.google.gerrit.extensions.webui.GwtPlugin ( "imagare" ) ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.webui.WebUiPlugin.class ) . toInstance ( new com.google.gerrit.extensions.webui.JavaScriptPlugin ( "imagare.js" ) ) ; }

Target:
protected void configureServlets ( ) { if ( cfgFactory.getFromGerritConfig ( pluginName , true ) . getBoolean ( "enableImageServer" , true ) ) { serveRegex ( ( ( "^" + ( ImageServlet.PATH_PREFIX ) ) + "(.+)?$" ) ) . with ( com.googlesource.gerrit.plugins.imagare.ImageServlet.class ) ; } com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.webui.WebUiPlugin.class ) . toInstance ( new com.google.gerrit.extensions.webui.GwtPlugin ( "imagare" ) ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.webui.WebUiPlugin.class ) . toInstance ( new com.google.gerrit.extensions.webui.JavaScriptPlugin ( "imagare.js" ) ) ; }
Source:
protected void configure ( ) { if ( ( gerritConfig.getString ( pluginName , null , "url" ) ) != null ) { com.googlesource.gerrit.plugins.its.jira.JiraModule.LOG.info ( "JIRA is configured as ITS" ) ; bind ( com.googlesource.gerrit.plugins.its.base.its.ItsFacade.class ) . toInstance ( new com.googlesource.gerrit.plugins.its.jira.JiraItsFacade ( pluginName , gerritConfig ) ) ; install ( new com.googlesource.gerrit.plugins.its.base.ItsHookModule ( pluginName , pluginCfgFactory ) ) ; } }

Target:
protected void configure ( ) { if ( ( gerritConfig.getString ( pluginName , null , "url" ) ) != null ) { com.googlesource.gerrit.plugins.its.jira.JiraModule.LOG.info ( "JIRA is configured as ITS" ) ; bind ( com.googlesource.gerrit.plugins.its.base.its.ItsFacade.class ) . to ( com.googlesource.gerrit.plugins.its.jira.JiraItsFacade.class ) . asEagerSingleton ( ) ; install ( new com.googlesource.gerrit.plugins.its.base.ItsHookModule ( pluginName , pluginCfgFactory ) ) ; } }
Source:
public int compare ( com.google.gerrit.client.account.AccountInfo a , com.google.gerrit.client.account.AccountInfo b ) { java.lang.String as = name ( a ) ; java.lang.String bs = name ( b ) ; if ( as.isEmpty ( ) ) { return 1 ; } else if ( bs.isEmpty ( ) ) { return - 1 ; } return as.compareTo ( bs ) ; }

Target:
public int compare ( com.google.gerrit.client.info.AccountInfo a , com.google.gerrit.client.info.AccountInfo b ) { java.lang.String as = name ( a ) ; java.lang.String bs = name ( b ) ; if ( as.isEmpty ( ) ) { return 1 ; } else if ( bs.isEmpty ( ) ) { return - 1 ; } return as.compareTo ( bs ) ; }
Source:
void onPost ( com.google.gwt.event.dom.client.ClickEvent e ) { in.message ( getMessage ( ) ) ; in.prePost ( ) ; com.google.gerrit.client.changes.ChangeApi.revision ( psId.getParentKey ( ) . get ( ) , revision ) . view ( "review" ) . post ( in , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.changes.ReviewInput > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ReviewInput result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( psId.getParentKey ( ) , java.lang.String.valueOf ( psId.get ( ) ) ) ) ; } } ) ; hide ( ) ; }

Target:
void quickApprove ( com.google.gerrit.client.changes.ReviewInput quickApproveInput ) { in.mergeLabels ( quickApproveInput ) ; postReview ( ) ; }