auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean get ( ) { com.google.gerrit.common.data.ChangeDetail detail = cache.getChangeDetailCache ( ) . get ( ) ; if ( detail != null ) { return detail.isStarred ( ) ; } return false ; }

Target:
public boolean get ( ) { com.google.gerrit.common.data.ChangeDetail detail = cache.getChangeDetailCache ( ) . get ( ) ; if ( detail != null ) { return detail.isStarred ( ) ; } com.google.gerrit.common.data.ChangeInfo info = cache.getChangeInfoCache ( ) . get ( ) ; if ( info != null ) { return info.isStarred ( ) ; } return false ; }
Source:
public void add ( com.google.gerrit.lifecycle.LifecycleListener listener ) { manager.add ( listener ) ; }

Target:
public void add ( com.google.gerrit.extensions.registration.RegistrationHandle handle ) { if ( handle instanceof com.google.gerrit.extensions.registration.ReloadableRegistrationHandle ) { if ( ( reloadableHandles ) == null ) { reloadableHandles = com.google.common.collect.Lists.newArrayList ( ) ; } reloadableHandles.add ( ( ( com.google.gerrit.extensions.registration.ReloadableRegistrationHandle < ? > ) ( handle ) ) ) ; } manager.add ( handle ) ; }
Source:
private java.util.Set < com.google.gerrit.reviewdb.client.Account > listAccounts ( final com.google.gerrit.reviewdb.client.AccountGroup.UUID groupUUID , final com.google.gerrit.reviewdb.client.Project.NameKey project , final java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > seen ) throws com.google.gerrit.common.errors.NoSuchGroupException , com.google.gerrit.server.project.NoSuchProjectException , com.google.gwtorm.server.OrmException , java.io.IOException { if ( AccountGroup.PROJECT_OWNERS.equals ( groupUUID ) ) { return getProjectOwners ( project , seen ) ; } else { com.google.gerrit.reviewdb.client.AccountGroup group = groupCache.get ( groupUUID ) ; if ( group != null ) { return getGroupMembers ( group , project , seen ) ; } else { return java.util.Collections.emptySet ( ) ; } } }

Target:
private java.util.Set < com.google.gerrit.reviewdb.client.Account > listAccounts ( final com.google.gerrit.reviewdb.client.AccountGroup.UUID groupUUID , final com.google.gerrit.reviewdb.client.Project.NameKey project , final java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > seen ) throws com.google.gerrit.common.errors.NoSuchGroupException , com.google.gerrit.server.project.NoSuchProjectException , com.google.gwtorm.server.OrmException , java.io.IOException { if ( SystemGroupBackend.PROJECT_OWNERS.equals ( groupUUID ) ) { return getProjectOwners ( project , seen ) ; } else { com.google.gerrit.reviewdb.client.AccountGroup group = groupCache.get ( groupUUID ) ; if ( group != null ) { return getGroupMembers ( group , project , seen ) ; } else { return java.util.Collections.emptySet ( ) ; } } }
Source:
public java.util.List < com.google.gerrit.extensions.common.ProjectInfo > list ( com.google.gerrit.reviewdb.client.Project.NameKey parent ) throws com.google.gerrit.server.permissions.PermissionBackendException { java.util.Map < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.reviewdb.client.Project > projects = readAllProjects ( ) ; com.google.common.collect.Multimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.reviewdb.client.Project.NameKey > children = parentToChildren ( projects ) ; com.google.gerrit.server.permissions.PermissionBackend.WithUser perm = permissionBackend.currentUser ( ) ; java.util.List < com.google.gerrit.extensions.common.ProjectInfo > results = new java.util.ArrayList < > ( ) ; depthFirstFormat ( results , perm , projects , children , parent ) ; return results ; }

Target:
public java.util.List < com.google.gerrit.extensions.common.ProjectInfo > list ( com.google.gerrit.reviewdb.client.Project.NameKey parent ) throws com.google.gerrit.server.permissions.PermissionBackendException { java.util.Map < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.reviewdb.client.Project > projects = readAllReadableProjects ( ) ; com.google.common.collect.Multimap < com.google.gerrit.reviewdb.client.Project.NameKey , com.google.gerrit.reviewdb.client.Project.NameKey > children = parentToChildren ( projects ) ; com.google.gerrit.server.permissions.PermissionBackend.WithUser perm = permissionBackend.currentUser ( ) ; java.util.List < com.google.gerrit.extensions.common.ProjectInfo > results = new java.util.ArrayList < > ( ) ; depthFirstFormat ( results , perm , projects , children , parent ) ; return results ; }
Source:
public static java.util.Set < com.google.gerrit.client.reviewdb.Change.Id > starredBy ( final com.google.gerrit.client.reviewdb.ReviewDb db , final com.google.gerrit.client.reviewdb.Account.Id me ) throws com.google.gwtorm.client.OrmException { final java.util.Set < com.google.gerrit.client.reviewdb.Change.Id > existing = new java.util.HashSet < com.google.gerrit.client.reviewdb.Change.Id > ( ) ; if ( me != null ) { for ( final com.google.gerrit.client.reviewdb.StarredChange sc : db.starredChanges ( ) . byAccount ( me ) ) { existing.add ( sc.getChangeId ( ) ) ; } } return existing ; }

Target:
public void myStarredChangeIds ( final com.google.gwt.user.client.rpc.AsyncCallback < java.util.Set < com.google.gerrit.client.reviewdb.Change.Id > > callback ) { callback.onSuccess ( currentUser.get ( ) . getStarredChanges ( ) ) ; }
Source:
private com.google.gerrit.client.diff.DraftBox newRangeDraft ( net.codemirror.lib.CodeMirror cm , int line , net.codemirror.lib.TextMarker.FromTo fromTo ) { com.google.gerrit.client.diff.DisplaySide side = cm.side ( ) ; 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:
void clearLine ( com.google.gerrit.client.diff.DisplaySide side , int line ) { map ( side ) . remove ( line ) ; }
Source:
public void setExisting_Conflict ( ) throws java.lang.Exception { com.google.gerrit.server.account.PutUsername.Input in = new com.google.gerrit.server.account.PutUsername.Input ( ) ; in.username = admin.username ; adminRestSession.put ( ( ( "/accounts/" + ( accountCreator.create ( ) . id.get ( ) ) ) + "/username" ) , in ) . assertConflict ( ) ; }

Target:
public void setExisting_Conflict ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.UsernameInput in = new com.google.gerrit.extensions.common.UsernameInput ( ) ; in.username = admin.username ; adminRestSession.put ( ( ( "/accounts/" + ( accountCreator.create ( ) . id.get ( ) ) ) + "/username" ) , in ) . assertConflict ( ) ; }
Source:
boolean match ( final java.security.PublicKey inkey ) { return publicKey.equals ( inkey ) ; }

Target:
boolean match ( final java.security.PublicKey inkey ) { if ( ( publicKey ) == null ) { try { publicKey = com.google.gerrit.sshd.SshUtil.parse ( key ) ; } catch ( java.lang.OutOfMemoryError e ) { throw e ; } catch ( java.lang.Throwable e ) { publicKey = com.google.gerrit.sshd.SshKeyCacheEntry.INVALID_KEY ; } } return publicKey.equals ( inkey ) ; }
Source:
void schedule ( final com.google.gerrit.client.reviewdb.Project.NameKey project , final java.lang.String ref , final org.spearce.jgit.transport.URIish uri ) { synchronized ( pending ) { com.google.gerrit.git.PushOp e = pending.get ( uri ) ; if ( e == null ) { e = new com.google.gerrit.git.PushOp ( this , project.get ( ) , remote , uri ) ; injector.injectMembers ( e ) ; pool.schedule ( e , delay , java.util.concurrent.TimeUnit.SECONDS ) ; pending.put ( uri , e ) ; } e.addRef ( ref ) ; } }

Target:
protected void configure ( ) { bind ( com.google.gerrit.git.PushReplication.ReplicationConfig.class ) . toInstance ( this ) ; bind ( org.spearce.jgit.transport.RemoteConfig.class ) . toInstance ( remote ) ; bind ( PushOp.Factory.class ) . toProvider ( com.google.inject.assistedinject.FactoryProvider.newFactory ( PushOp.Factory.class , com.google.gerrit.git.PushOp.class ) ) ; }
Source:
public void defaultMessage ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; com.google.gerrit.extensions.common.ChangeInfo c = get ( changeId ) ; org.junit.Assert.assertNotNull ( c.messages ) ; org.junit.Assert.assertEquals ( 1 , c.messages.size ( ) ) ; org.junit.Assert.assertEquals ( "Uploaded patch set 1." , c.messages.iterator ( ) . next ( ) . message ) ; }

Target:
public void defaultMessage ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; com.google.gerrit.extensions.common.ChangeInfo c = get ( changeId ) ; com.google.common.truth.Truth.assertThat ( ( ( java.lang.Iterable < ? > ) ( c.messages ) ) ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( ( ( java.lang.Iterable < ? > ) ( c.messages ) ) ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( c.messages.iterator ( ) . next ( ) . message ) . isEqualTo ( "Uploaded patch set 1." ) ; }
Source:
public com.google.gerrit.server.group.GroupJson.GroupInfo format ( com.google.gerrit.common.data.GroupDescription.Basic group ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.group.GroupJson.GroupInfo info = init ( group ) ; if ( ( options.contains ( com.google.gerrit.common.groups.ListGroupsOption.MEMBERS ) ) || ( options.contains ( com.google.gerrit.common.groups.ListGroupsOption.INCLUDES ) ) ) { com.google.gerrit.server.group.GroupResource rsrc = new com.google.gerrit.server.group.GroupResource ( groupControlFactory.controlFor ( group ) ) ; initMembersAndIncludes ( rsrc , info ) ; } return info ; }

Target:
public com.google.gerrit.extensions.common.GroupInfo format ( com.google.gerrit.common.data.GroupDescription.Basic group ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.extensions.common.GroupInfo info = init ( group ) ; if ( ( options.contains ( com.google.gerrit.extensions.client.ListGroupsOption.MEMBERS ) ) || ( options.contains ( com.google.gerrit.extensions.client.ListGroupsOption.INCLUDES ) ) ) { com.google.gerrit.server.group.GroupResource rsrc = new com.google.gerrit.server.group.GroupResource ( groupControlFactory.controlFor ( group ) ) ; initMembersAndIncludes ( rsrc , info ) ; } return info ; }
Source:
public void withValidGroupName ( ) throws java.lang.Exception { java.lang.String newGroupName = "newGroup" ; adminRestSession.put ( ( "/groups/" + newGroupName ) ) ; java.lang.String newProjectName = "newProject" ; adminSshSession.exec ( ( ( ( "gerrit create-project --branch master --owner " + newGroupName ) + " " ) + newProjectName ) ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( adminSshSession.getError ( ) ) . that ( adminSshSession.hasError ( ) ) . isFalse ( ) ; com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( new com.google.gerrit.reviewdb.client.Project.NameKey ( newProjectName ) ) ; com.google.common.truth.Truth.assertThat ( projectState ) . isNotNull ( ) ; }

Target:
public void withValidGroupName ( ) throws java.lang.Exception { java.lang.String newGroupName = "newGroup" ; adminRestSession.put ( ( "/groups/" + newGroupName ) ) ; java.lang.String newProjectName = "newProject" ; adminSshSession.exec ( ( ( ( "gerrit create-project --branch master --owner " + newGroupName ) + " " ) + newProjectName ) ) ; com.google.common.truth.Truth.assert_ ( ) . withMessage ( adminSshSession.getError ( ) ) . that ( adminSshSession.hasError ( ) ) . isFalse ( ) ; com.google.gerrit.server.project.ProjectState projectState = projectCache.get ( new com.google.gerrit.reviewdb.client.Project.NameKey ( newProjectName ) ) ; com.google.common.truth.Truth.assertThat ( projectState ) . isNotNull ( ) ; }
Source:
com.ericsson.gerrit.plugins.eventslog.sql.SQLClient provideLocalSqlClient ( com.ericsson.gerrit.plugins.eventslog.EventsLogConfig cfg ) { com.ericsson.gerrit.plugins.eventslog.sql.SQLClient sqlClient ; }

Target:
com.ericsson.gerrit.plugins.eventslog.sql.SQLClient provideLocalSqlClient ( com.ericsson.gerrit.plugins.eventslog.EventsLogConfig cfg ) { java.lang.String path = cfg.getLocalStorePath ( ) . toString ( ) ; path = ( path.endsWith ( "/" ) ) ? path : path + "/" ; com.ericsson.gerrit.plugins.eventslog.sql.SQLClient sqlClient = new com.ericsson.gerrit.plugins.eventslog.sql.SQLClient ( cfg.getLocalStoreDriver ( ) , ( ( ( com.ericsson.gerrit.plugins.eventslog.sql.SQLModule.H2_DB_PREFIX ) + path ) + ( SQLTable.TABLE_NAME ) ) , cfg.getUrlOptions ( ) ) ; sqlClient.setEvictIdleTime ( cfg.getEvictIdleTime ( ) ) ; return sqlClient ; }
Source:
public void parseAuthor ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Patch-Set: 1\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( writeCommit ( ( "Update change\n" + ( "\n" + "Patch-Set: 1\n" ) ) , new org.eclipse.jgit.lib.PersonIdent ( "Change Owner" , "owner@example.com" , serverIdent.getWhen ( ) , serverIdent.getTimeZone ( ) ) ) ) ; assertParseFails ( writeCommit ( ( "Update change\n" + ( "\n" + "Patch-Set: 1\n" ) ) , new org.eclipse.jgit.lib.PersonIdent ( "Change Owner" , "x@gerrit" , serverIdent.getWhen ( ) , serverIdent.getTimeZone ( ) ) ) ) ; }

Target:
public void parseAuthor ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Patch-set: 1\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( writeCommit ( ( "Update change\n" + ( "\n" + "Patch-set: 1\n" ) ) , new org.eclipse.jgit.lib.PersonIdent ( "Change Owner" , "owner@example.com" , serverIdent.getWhen ( ) , serverIdent.getTimeZone ( ) ) ) ) ; assertParseFails ( writeCommit ( ( "Update change\n" + ( "\n" + "Patch-set: 1\n" ) ) , new org.eclipse.jgit.lib.PersonIdent ( "Change Owner" , "x@gerrit" , serverIdent.getWhen ( ) , serverIdent.getTimeZone ( ) ) ) ) ; }
Source:
protected void configure ( ) { install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . implement ( com.google.gerrit.server.index.group.GroupIndex.class , com.google.gerrit.lucene.LuceneGroupIndex.class ) . build ( GroupIndex.Factory.class ) ) ; install ( new com.google.gerrit.pgm.init.index.IndexModuleOnInit ( ) ) ; }

Target:
protected void configure ( ) { install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . implement ( com.google.gerrit.server.index.account.AccountIndex.class , com.google.gerrit.lucene.LuceneAccountIndex.class ) . build ( AccountIndex.Factory.class ) ) ; install ( new com.google.inject.assistedinject.FactoryModuleBuilder ( ) . implement ( com.google.gerrit.server.index.group.GroupIndex.class , com.google.gerrit.lucene.LuceneGroupIndex.class ) . build ( GroupIndex.Factory.class ) ) ; install ( new com.google.gerrit.pgm.init.index.IndexModuleOnInit ( ) ) ; }
Source:
public void testUnblockForce ( ) { com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; r.setBlock ( ) ; r.setForce ( true ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertTrue ( "u can force push" , u.controlForRef ( "refs/heads/master" ) . canForceUpdate ( ) ) ; }

Target:
public void testUnblockForce ( ) { com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; r.setForce ( true ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertTrue ( "u can force push" , u.controlForRef ( "refs/heads/master" ) . canForceUpdate ( ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; schemaFactory = org.easymock.EasyMock.createStrictMock ( com.google.gwtorm.server.SchemaFactory.class ) ; schema = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.reviewdb.server.ReviewDb.class ) ; subscriptions = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.reviewdb.server.SubmoduleSubscriptionAccess.class ) ; urlProvider = org.easymock.EasyMock.createStrictMock ( com.google.inject.Provider.class ) ; repoManager = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.server.git.GitRepositoryManager.class ) ; replication = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.server.git.ReplicationQueue.class ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; schemaFactory = org.easymock.EasyMock.createStrictMock ( com.google.gwtorm.server.SchemaFactory.class ) ; schema = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.reviewdb.server.ReviewDb.class ) ; subscriptions = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.reviewdb.server.SubmoduleSubscriptionAccess.class ) ; urlProvider = org.easymock.EasyMock.createStrictMock ( com.google.inject.Provider.class ) ; repoManager = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.server.git.GitRepositoryManager.class ) ; replication = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.server.extensions.events.GitReferenceUpdated.class ) ; }
Source:
public void testPostResponseOK ( ) throws java.lang.Exception { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.wireMockRule.givenThat ( com.github.tomakehurst.wiremock.client.WireMock.post ( com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ENDPOINT ) ) . willReturn ( com.github.tomakehurst.wiremock.client.WireMock.aResponse ( ) . withStatus ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.OK ) ) ) ; com.google.common.truth.Truth.assertThat ( httpSession.post ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ENDPOINT ) . isSuccessful ( ) ) . isTrue ( ) ; }

Target:
public void testPostResponseOK ( ) throws java.lang.Exception { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.wireMockRule.givenThat ( com.github.tomakehurst.wiremock.client.WireMock.post ( com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ENDPOINT ) ) . willReturn ( com.github.tomakehurst.wiremock.client.WireMock.aResponse ( ) . withStatus ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.NO_CONTENT ) ) ) ; com.google.common.truth.Truth.assertThat ( httpSession.post ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ENDPOINT ) . isSuccessful ( ) ) . isTrue ( ) ; }
Source:
private java.lang.String createServiceUserNote ( java.lang.String branch , com.googlesource.gerrit.plugins.serviceuser.GetServiceUser.ServiceUserInfo serviceUser ) throws com.google.gwtorm.server.OrmException { com.googlesource.gerrit.plugins.serviceuser.HeaderFormatter fmt = new com.googlesource.gerrit.plugins.serviceuser.HeaderFormatter ( gerritServerIdent.getTimeZone ( ) , anonymousCowardName ) ; fmt.appendDate ( ) ; fmt.append ( "Project" , project.get ( ) ) ; fmt.append ( "Branch" , branch ) ; fmt.appendUser ( com.googlesource.gerrit.plugins.serviceuser.CreateServiceUser.KEY_CREATED_BY , serviceUser.createdBy ) ; for ( com.google.gerrit.server.account.AccountInfo owner : listOwners ( serviceUser ) ) { fmt.appendUser ( com.googlesource.gerrit.plugins.serviceuser.CreateServiceUser.KEY_OWNER , owner ) ; } return fmt.toString ( ) ; }

Target:
private java.lang.String createServiceUserNote ( java.lang.String branch , com.googlesource.gerrit.plugins.serviceuser.GetServiceUser.ServiceUserInfo serviceUser ) throws com.google.gwtorm.server.OrmException { com.googlesource.gerrit.plugins.serviceuser.HeaderFormatter fmt = new com.googlesource.gerrit.plugins.serviceuser.HeaderFormatter ( gerritServerIdent.getTimeZone ( ) , anonymousCowardName ) ; fmt.appendDate ( ) ; fmt.append ( "Project" , project.get ( ) ) ; fmt.append ( "Branch" , branch ) ; fmt.appendUser ( com.googlesource.gerrit.plugins.serviceuser.CreateServiceUser.KEY_CREATED_BY , serviceUser.createdBy ) ; for ( com.google.gerrit.server.account.AccountInfo owner : serviceUserResolver.listOwners ( serviceUser ) ) { fmt.appendUser ( com.googlesource.gerrit.plugins.serviceuser.CreateServiceUser.KEY_OWNER , owner ) ; } return fmt.toString ( ) ; }
Source:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.common.ChangeListener.class ) . to ( com.googlesource.gerrit.plugins.reviewers.ChangeEventListener.class ) ; factory ( DefaultReviewers.Factory.class ) ; bind ( com.google.gerrit.server.config.ProjectConfigEntry.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.Exports.named ( "reviewer" ) ) . toInstance ( new com.google.gerrit.server.config.ProjectConfigEntry ( "Reviewers" , null , ProjectConfigEntry.Type.ARRAY , null , false , "Users or groups can be provided as reviewers" ) ) ; }

Target:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.common.ChangeListener.class ) . to ( com.googlesource.gerrit.plugins.reviewers.ChangeEventListener.class ) ; factory ( DefaultReviewers.Factory.class ) ; factory ( ReviewersConfig.Factory.class ) ; }
Source:
private static void sendError ( javax.servlet.http.HttpServletResponse rsp , int statusCode , java.lang.String message ) { try { rsp.sendError ( statusCode , message ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.syncevents.SyncEventsRestApiServlet.logger.error ( ( "Failed to send error messsage: " + ( e.getMessage ( ) ) ) , e ) ; } }

Target:
private static void sendError ( javax.servlet.http.HttpServletResponse rsp , int statusCode , java.lang.String message ) { try { rsp.sendError ( statusCode , message ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.EventRestApiServlet.logger.error ( ( "Failed to send error messsage: " + ( e.getMessage ( ) ) ) , e ) ; } }
Source:
protected void rcptToAuthors ( final com.google.gerrit.server.mail.RecipientType rt ) { add ( rt , change.getOwner ( ) ) ; if ( ( patchSet ) != null ) { add ( rt , patchSet.getUploader ( ) ) ; } if ( ( patchSetInfo ) != null ) { add ( rt , patchSetInfo.getAuthor ( ) ) ; add ( rt , patchSetInfo.getCommitter ( ) ) ; } }

Target:
protected void add ( final com.google.gerrit.server.mail.RecipientType rt , final com.google.gerrit.reviewdb.Account.Id to ) { if ( ( ! ( emailOnlyAuthors ) ) || ( authors.contains ( to ) ) ) { super . add ( rt , to ) ; } }
Source:
public void testUnblockForceWithAllowNoForce_NotPossible ( ) { com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) ; r.setBlock ( ) ; r.setForce ( true ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't force push" , u.controlForRef ( "refs/heads/master" ) . canForceUpdate ( ) ) ; }

Target:
public void testUnblockForceWithAllowNoForce_NotPossible ( ) { com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; r.setBlock ( ) ; r.setForce ( true ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't force push" , u.controlForRef ( "refs/heads/master" ) . canForceUpdate ( ) ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo info ) { info.revisions ( ) . copyKeysIntoChildren ( "name" ) ; com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.ChangeInfo.RevisionInfo > list = info.revisions ( ) . values ( ) ; com.google.gerrit.client.changes.ChangeInfo.RevisionInfo.sortRevisionInfoByNumber ( list ) ; diffTable.setUpPatchSetNav ( list , diff ) ; header.set ( info ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo info ) { info.revisions ( ) . copyKeysIntoChildren ( "name" ) ; com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.ChangeInfo.RevisionInfo > list = info.revisions ( ) . values ( ) ; com.google.gerrit.client.changes.ChangeInfo.RevisionInfo.sortRevisionInfoByNumber ( list ) ; diffTable.setUpPatchSetNav ( list , diff ) ; header.setChangeInfo ( info ) ; }
Source:
public void keyRevokedByExpiredKeyAfterExpirationIsNotRevoked ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey k = add ( com.google.gerrit.gpg.testutil.TestKeys.keyRevokedByExpiredKeyAfterExpiration ( ) ) ; add ( com.google.gerrit.gpg.testutil.TestKeys.expiredKey ( ) ) ; save ( ) ; com.google.gerrit.gpg.PublicKeyChecker checker = new com.google.gerrit.gpg.PublicKeyChecker ( ) . setStore ( store ) ; assertNoProblems ( checker , k ) ; }

Target:
public void keyRevokedByExpiredKeyAfterExpirationIsNotRevoked ( ) throws java.lang.Exception { com.google.gerrit.gpg.testing.TestKey k = add ( com.google.gerrit.gpg.testing.TestKeys.keyRevokedByExpiredKeyAfterExpiration ( ) ) ; add ( com.google.gerrit.gpg.testing.TestKeys.expiredKey ( ) ) ; save ( ) ; com.google.gerrit.gpg.PublicKeyChecker checker = new com.google.gerrit.gpg.PublicKeyChecker ( ) . setStore ( store ) ; assertNoProblems ( checker , k ) ; }
Source:
public void inheritRead_AppendWithDenyOfRef ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.deny ( 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 = user ( local ) ; assertCanRead ( u ) ; assertCanRead ( "refs/master" , u ) ; assertCanRead ( "refs/tags/foobar" , u ) ; assertCanRead ( "refs/heads/master" , u ) ; }

Target:
public void inheritRead_AppendWithDenyOfRef ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.deny ( 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 = user ( local ) ; assertCanAccess ( u ) ; assertCanRead ( "refs/master" , u ) ; assertCanRead ( "refs/tags/foobar" , u ) ; assertCanRead ( "refs/heads/master" , u ) ; }
Source:
private com.google.gerrit.server.mail.Address toAddress ( final com.google.gerrit.client.reviewdb.Account.Id id ) { final com.google.gerrit.client.reviewdb.Account a = com.google.gerrit.client.rpc.Common.getAccountCache ( ) . get ( id ) ; if ( a == null ) { return null ; } final java.lang.String e = a.getPreferredEmail ( ) ; if ( e == null ) { return null ; } return new com.google.gerrit.server.mail.Address ( a.getFullName ( ) , e ) ; }

Target:
private com.google.gerrit.server.mail.Address toAddress ( final com.google.gerrit.client.reviewdb.Account.Id id ) { final com.google.gerrit.client.reviewdb.Account a = accountCache.get ( id ) . getAccount ( ) ; final java.lang.String e = a.getPreferredEmail ( ) ; if ( e == null ) { return null ; } return new com.google.gerrit.server.mail.Address ( a.getFullName ( ) , e ) ; }
Source:
public int weigh ( com.google.gerrit.server.patch.PatchListKey key , com.google.gerrit.server.patch.PatchList value ) { int size = ( ( ( ( ( ( 16 + ( 4 * 8 ) ) + ( 2 * 36 ) ) + 8 ) + 16 ) + ( 3 * 8 ) ) + ( 3 * 4 ) ) + 20 ; for ( com.google.gerrit.server.patch.PatchListEntry e : value.getPatches ( ) ) { size += e.weigh ( ) ; } return size ; }

Target:
public int weigh ( com.google.gerrit.server.diff.PatchListKey key , com.google.gerrit.server.diff.PatchList value ) { int size = ( ( ( ( ( ( 16 + ( 4 * 8 ) ) + ( 2 * 36 ) ) + 8 ) + 16 ) + ( 3 * 8 ) ) + ( 3 * 4 ) ) + 20 ; for ( com.google.gerrit.server.diff.PatchListEntry e : value.getPatches ( ) ) { size += e.weigh ( ) ; } return size ; }
Source:
private com.google.gerrit.reviewdb.client.Change newChange ( ) { com.google.gerrit.reviewdb.client.Change.Id changeId = new com.google.gerrit.reviewdb.client.Change.Id ( 1 ) ; com.google.gerrit.reviewdb.client.Change c = new com.google.gerrit.reviewdb.client.Change ( new com.google.gerrit.reviewdb.client.Change.Key ( "Iabcd1234abcd1234abcd1234abcd1234abcd1234" ) , changeId , changeOwner.getAccount ( ) . getId ( ) , new com.google.gerrit.reviewdb.client.Branch.NameKey ( project , "master" ) , com.google.gerrit.server.util.TimeUtil.nowTs ( ) ) ; com.google.gerrit.server.notedb.ChangeNotesTest.incrementPatchSet ( c ) ; return c ; }

Target:
private com.google.gerrit.reviewdb.client.Change newChange ( ) { return com.google.gerrit.testutil.TestChanges.newChange ( project , changeOwner ) ; }
Source:
private void appendHunkHeader ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , final com.google.gerrit.common.data.EditList.Hunk hunk ) { openLine ( m ) ; padLineNumber ( m ) ; padLineNumber ( m ) ; m.openTd ( ) ; m.addStyleName ( "DiffText" ) ; m.addStyleName ( "DiffText-HUNK_HEADER" ) ; m.append ( "@@ -" ) ; appendRange ( m , ( ( hunk.getCurA ( ) ) + 1 ) , ( ( hunk.getEndA ( ) ) - ( hunk.getCurA ( ) ) ) ) ; m.append ( " +" ) ; appendRange ( m , ( ( hunk.getCurB ( ) ) + 1 ) , ( ( hunk.getEndB ( ) ) - ( hunk.getCurB ( ) ) ) ) ; m.append ( " @@" ) ; m.closeTd ( ) ; closeLine ( m ) ; }

Target:
private void appendHunkHeader ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , final com.google.gerrit.common.data.EditList.Hunk hunk ) { openLine ( m ) ; padLineNumber ( m ) ; padLineNumber ( m ) ; m.openTd ( ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffText ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffTextHunkHeader ( ) ) ; m.append ( "@@ -" ) ; appendRange ( m , ( ( hunk.getCurA ( ) ) + 1 ) , ( ( hunk.getEndA ( ) ) - ( hunk.getCurA ( ) ) ) ) ; m.append ( " +" ) ; appendRange ( m , ( ( hunk.getCurB ( ) ) + 1 ) , ( ( hunk.getEndB ( ) ) - ( hunk.getCurB ( ) ) ) ) ; m.append ( " @@" ) ; m.closeTd ( ) ; closeLine ( m ) ; }
Source:
public com.googlesource.gerrit.plugins.hooks.its.ItsIssue getIssue ( final java.lang.String bugId ) throws java.io.IOException { return execute ( new java.util.concurrent.Callable < com.googlesource.gerrit.plugins.hooks.its.ItsIssue > ( ) { @ java.lang.Override public com.googlesource.gerrit.plugins.hooks.its.ItsIssue call ( ) throws java.lang.Exception { com.j2bugzilla.base.Bug bug = client ( ) . getBug ( bugId ) ; com.googlesource.gerrit.plugins.hooks.its.ItsIssue result = ( bug == null ) ? null : new com.googlesource.gerrit.plugins.hooks.its.ItsIssue ( bugId , bug ) ; log.debug ( ( ( ( "Got issue " + bugId ) + ", " ) + result ) ) ; return result ; } } ) ; }

Target:
public boolean exists ( final java.lang.String bugId ) throws java.io.IOException { return execute ( new java.util.concurrent.Callable < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean call ( ) throws java.lang.Exception { return ( client ( ) . getBug ( bugId ) ) != null ; } } ) ; }
Source:
private static void initLogSystem ( java.io.File logdir ) { org.apache.log4j.Logger gcLogger = org.apache.log4j.LogManager.getLogger ( GarbageCollection.LOG_NAME ) ; gcLogger.removeAllAppenders ( ) ; gcLogger.addAppender ( com.google.gerrit.server.util.SystemLog.createAppender ( logdir , GarbageCollection.LOG_NAME , new org.apache.log4j.PatternLayout ( "[%d] %-5p %x: %m%n" ) ) ) ; gcLogger.setAdditivity ( false ) ; }

Target:
private static void initLogSystem ( java.nio.file.Path logdir ) { org.apache.log4j.Logger gcLogger = org.apache.log4j.LogManager.getLogger ( GarbageCollection.LOG_NAME ) ; gcLogger.removeAllAppenders ( ) ; gcLogger.addAppender ( com.google.gerrit.server.util.SystemLog.createAppender ( logdir , GarbageCollection.LOG_NAME , new org.apache.log4j.PatternLayout ( "[%d] %-5p %x: %m%n" ) ) ) ; gcLogger.setAdditivity ( false ) ; }
Source:
private void login ( javax.servlet.ServletRequest request , javax.servlet.http.HttpServletRequest httpRequest , javax.servlet.http.HttpServletResponse httpResponse , com.googlesource.gerrit.plugins.github.oauth.GitHubLogin ghLogin ) throws java.io.IOException { if ( ghLogin.login ( httpRequest , httpResponse ) ) { org.kohsuke.github.GHMyself myself = ghLogin.getMyself ( ) ; java.lang.String user = myself.getLogin ( ) ; updateSecureConfigWithRetry ( ghLogin.hub.getMyOrganizations ( ) . keySet ( ) , user , ghLogin.token.accessToken ) ; } }

Target:
private void login ( javax.servlet.ServletRequest request , javax.servlet.http.HttpServletRequest httpRequest , javax.servlet.http.HttpServletResponse httpResponse , com.googlesource.gerrit.plugins.github.oauth.GitHubLogin ghLogin ) throws java.io.IOException { if ( ghLogin.login ( httpRequest , httpResponse , oauth ) ) { org.kohsuke.github.GHMyself myself = ghLogin.getMyself ( ) ; java.lang.String user = myself.getLogin ( ) ; updateSecureConfigWithRetry ( ghLogin.getHub ( ) . getMyOrganizations ( ) . keySet ( ) , user , ghLogin.getToken ( ) . accessToken ) ; } }
Source:
public static synchronized int getSshdPort ( ) { return ( com.google.gerrit.server.ssh.GerritSshDaemon.sshd ) != null ? com.google.gerrit.server.ssh.GerritSshDaemon.sshd.getPort ( ) : 0 ; }

Target:
private static java.util.Collection < java.security.PublicKey > computeHostKeys ( ) { final org.apache.sshd.common.KeyPairProvider p = com.google.gerrit.server.ssh.GerritSshDaemon.sshd.getKeyPairProvider ( ) ; final java.util.List < java.security.PublicKey > keys = new java.util.ArrayList < java.security.PublicKey > ( 2 ) ; com.google.gerrit.server.ssh.GerritSshDaemon.addPublicKey ( keys , p , KeyPairProvider.SSH_DSS ) ; com.google.gerrit.server.ssh.GerritSshDaemon.addPublicKey ( keys , p , KeyPairProvider.SSH_RSA ) ; return java.util.Collections.unmodifiableList ( keys ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { index = new com.google.gerrit.server.index.change.FakeChangeIndex ( FakeChangeIndex.V2 ) ; indexes = new com.google.gerrit.server.index.change.ChangeIndexCollection ( ) ; indexes.setSearchIndex ( index ) ; queryBuilder = new com.google.gerrit.server.index.change.FakeQueryBuilder ( indexes ) ; rewrite = new com.google.gerrit.server.index.change.ChangeIndexRewriter ( indexes , com.google.gerrit.server.index.IndexConfig.builder ( ) . maxTerms ( 3 ) . build ( ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { index = new com.google.gerrit.server.index.change.FakeChangeIndex ( FakeChangeIndex.V2 ) ; indexes = new com.google.gerrit.server.index.change.ChangeIndexCollection ( ) ; indexes.setSearchIndex ( index ) ; queryBuilder = new com.google.gerrit.server.index.change.FakeQueryBuilder ( indexes ) ; rewrite = new com.google.gerrit.server.index.change.ChangeIndexRewriter ( indexes , com.google.gerrit.index.IndexConfig.builder ( ) . maxTerms ( 3 ) . build ( ) ) ; }
Source:
public com.google.gerrit.server.group.GroupJson.GroupInfo format ( com.google.gerrit.common.data.GroupDescription.Basic group ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.group.GroupJson.GroupInfo info = init ( group ) ; if ( ( options.contains ( com.google.gerrit.common.groups.ListGroupsOption.MEMBERS ) ) || ( options.contains ( com.google.gerrit.common.groups.ListGroupsOption.INCLUDES ) ) ) { com.google.gerrit.server.group.GroupResource rsrc = new com.google.gerrit.server.group.GroupResource ( groupControlFactory.controlFor ( group ) ) ; initMembersAndIncludes ( rsrc , info ) ; } return info ; }

Target:
public com.google.gerrit.extensions.common.GroupInfo format ( com.google.gerrit.server.group.GroupResource rsrc ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.extensions.common.GroupInfo info = init ( rsrc.getGroup ( ) ) ; initMembersAndIncludes ( rsrc , info ) ; return info ; }
Source:
private org.eclipse.jgit.revwalk.RevCommit commit ( com.google.gerrit.server.notedb.ChangeUpdate update ) throws java.io.IOException { com.google.gerrit.server.git.MetaDataUpdate md = new com.google.gerrit.server.git.MetaDataUpdate ( com.google.gerrit.server.extensions.events.GitReferenceUpdated.DISABLED , project , repo ) ; md.getCommitBuilder ( ) . setAuthor ( update.getUser ( ) . newCommitterIdent ( update.getWhen ( ) , com.google.gerrit.server.notedb.ChangeNotesTest.TZ ) ) ; return update.commit ( md ) ; }

Target:
public void configure ( ) { factory ( ChangeUpdate.Factory.class ) ; bind ( com.google.gerrit.server.IdentifiedUser.class ) . toInstance ( user ) ; }
Source:
public void createdOnIsPopulatedForGroupsCreatedAfterAudit ( ) throws java.lang.Exception { java.sql.Timestamp testStartTime = com.google.gerrit.common.TimeUtil.nowTs ( ) ; com.google.gerrit.reviewdb.client.AccountGroup.Id groupId = createGroup ( "Group for schema migration" ) ; setCreatedOnToVeryOldTimestamp ( groupId ) ; schema151.migrateData ( db , new com.google.gerrit.testutil.TestUpdateUI ( ) ) ; com.google.gerrit.reviewdb.client.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; com.google.common.truth.Truth.assertThat ( group.getCreatedOn ( ) ) . isAtLeast ( testStartTime ) ; }

Target:
public void createdOnIsPopulatedForGroupsCreatedAfterAudit ( ) throws java.lang.Exception { java.sql.Timestamp testStartTime = com.google.gerrit.common.TimeUtil.nowTs ( ) ; com.google.gerrit.reviewdb.client.AccountGroup.Id groupId = createGroup ( "Group for schema migration" ) ; setCreatedOnToVeryOldTimestamp ( groupId ) ; schema151.migrateData ( db , new com.google.gerrit.testutil.TestUpdateUI ( ) ) ; java.sql.Timestamp createdOn = getCreatedOn ( groupId ) ; com.google.common.truth.Truth.assertThat ( createdOn ) . isAtLeast ( testStartTime ) ; }
Source:
public com.google.gerrit.server.account.GroupControl controlFor ( final com.google.gerrit.reviewdb.client.AccountGroup.Id groupId ) throws com.google.gerrit.common.errors.NoSuchGroupException { final com.google.gerrit.reviewdb.client.AccountGroup group = groupCache.get ( groupId ) ; if ( group == null ) { throw new com.google.gerrit.common.errors.NoSuchGroupException ( groupId ) ; } return new com.google.gerrit.server.account.GroupControl ( user.get ( ) , group ) ; }

Target:
public com.google.gerrit.server.account.GroupControl controlFor ( final com.google.gerrit.reviewdb.client.AccountGroup.Id groupId ) throws com.google.gerrit.common.errors.NoSuchGroupException { final com.google.gerrit.reviewdb.client.AccountGroup group = groupCache.get ( groupId ) ; if ( group == null ) { throw new com.google.gerrit.common.errors.NoSuchGroupException ( groupId ) ; } return controlFor ( com.google.gerrit.common.data.GroupDescriptions.forAccountGroup ( group ) ) ; }
Source:
java.util.List < com.google.gerrit.server.account.AccountInfo > listActiveOwners ( com.googlesource.gerrit.plugins.serviceuser.GetServiceUser.ServiceUserInfo serviceUser ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.server.account.AccountInfo > activeOwners = new java.util.ArrayList < > ( ) ; for ( com.google.gerrit.server.account.AccountInfo owner : listOwners ( serviceUser ) ) { com.google.gerrit.server.account.AccountState accountState = accountCache.get ( owner._id ) ; if ( ( accountState != null ) && ( accountState.getAccount ( ) . isActive ( ) ) ) { activeOwners.add ( owner ) ; } } return activeOwners ; }

Target:
java.util.List < com.google.gerrit.extensions.common.AccountInfo > listActiveOwners ( com.googlesource.gerrit.plugins.serviceuser.GetServiceUser.ServiceUserInfo serviceUser ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.extensions.common.AccountInfo > activeOwners = new java.util.ArrayList < > ( ) ; for ( com.google.gerrit.extensions.common.AccountInfo owner : listOwners ( serviceUser ) ) { com.google.gerrit.server.account.AccountState accountState = accountCache.get ( new com.google.gerrit.reviewdb.client.Account.Id ( owner._accountId ) ) ; if ( ( accountState != null ) && ( accountState.getAccount ( ) . isActive ( ) ) ) { activeOwners.add ( owner ) ; } } return activeOwners ; }
Source:
protected void insertTitleWidget ( final com.google.gwt.user.client.ui.Widget w ) { header.insert ( w , 0 ) ; }

Target:
protected void setPageTitle ( final java.lang.String text ) { final java.lang.String old = headerText.getText ( ) ; if ( text.isEmpty ( ) ) { header.setVisible ( false ) ; } else { headerText.setText ( text ) ; header.setVisible ( true ) ; } if ( ( ( windowTitle ) == null ) || ( ( windowTitle ) == old ) ) { setWindowTitle ( text ) ; } }
Source:
public void testInheritRead_OverrideWithDeny ( ) { grant ( parent , com.google.gerrit.reviewdb.ApprovalCategory.READ , registered , "refs/*" , 1 ) ; grant ( local , com.google.gerrit.reviewdb.ApprovalCategory.READ , registered , "refs/*" , 0 ) ; com.google.gerrit.server.project.ProjectControl u = user ( ) ; assertFalse ( "can't read" , u.isVisible ( ) ) ; }

Target:
public void testInheritRead_OverrideWithDeny ( ) { grant ( parent , com.google.gerrit.common.data.Permission.READ , registered , "refs/*" ) ; grant ( local , com.google.gerrit.common.data.Permission.READ , registered , "refs/*" ) . setDeny ( true ) ; com.google.gerrit.server.project.ProjectControl u = user ( ) ; assertFalse ( "can't read" , u.isVisible ( ) ) ; }
Source:
private void fireEvent ( com.google.gerrit.common.Event event , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.common.ChangeHookRunner.EventListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( event , holder.user , db ) ) { holder.listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }

Target:
private void fireEvent ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.events.ChangeEvent event , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.common.UserScopedEventListener listener : listeners ) { if ( isVisibleTo ( change , listener.getUser ( ) , db ) ) { listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }
Source:
public com.googlesource.gerrit.plugins.verifystatus.server.GetConfig.ConfigInfo apply ( com.google.gerrit.server.config.ConfigResource resource ) { com.googlesource.gerrit.plugins.verifystatus.server.GetConfig.ConfigInfo info = new com.googlesource.gerrit.plugins.verifystatus.server.GetConfig.ConfigInfo ( ) ; info.showJobsPanel = cfg.getBoolean ( "showJobsPanel" , true ) ; info.showJobsDropDownPanel = cfg.getBoolean ( "showJobsDropDownPanel" , true ) ; info.showJobsSummaryPanel = cfg.getBoolean ( "showJobsSummaryPanel" , true ) ; return info ; }

Target:
public com.googlesource.gerrit.plugins.verifystatus.server.GetConfig.ConfigInfo apply ( com.google.gerrit.server.config.ConfigResource resource ) { com.googlesource.gerrit.plugins.verifystatus.server.GetConfig.ConfigInfo info = new com.googlesource.gerrit.plugins.verifystatus.server.GetConfig.ConfigInfo ( ) ; info.showJobsPanel = cfg.getBoolean ( "showJobsPanel" , true ) ; info.showJobsDropDownPanel = cfg.getBoolean ( "showJobsDropDownPanel" , true ) ; info.showJobsSummaryPanel = cfg.getBoolean ( "showJobsSummaryPanel" , true ) ; info.sortJobsPanel = cfg.getEnum ( com.googlesource.gerrit.plugins.verifystatus.server.JobsSorting.values ( ) , "sortJobsPanel" , JobsSorting.REPORTER ) ; info.sortJobsDropDownPanel = cfg.getEnum ( com.googlesource.gerrit.plugins.verifystatus.server.JobsSorting.values ( ) , "sortJobsDropDownPanel" , JobsSorting.REPORTER ) ; return info ; }
Source:
void onCancel ( com.google.gwt.event.dom.client.ClickEvent e ) { e.stopPropagation ( ) ; if ( ( isNew ( ) ) && ( ! ( isDirty ( ) ) ) ) { removeUI ( ) ; } else { setEdit ( false ) ; if ( autoClosed ) { setOpen ( false ) ; } getCm ( ) . focus ( ) ; } }

Target:
void onDiscard ( com.google.gwt.event.dom.client.ClickEvent e ) { e.stopPropagation ( ) ; if ( isNew ( ) ) { removeUI ( ) ; restoreSelection ( ) ; } else { setEdit ( false ) ; com.google.gerrit.client.changes.CommentApi.deleteDraft ( psId , comment.id ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwt.core.client.JavaScriptObject > ( ) { @ java.lang.Override public void onSuccess ( com.google.gwt.core.client.JavaScriptObject result ) { removeUI ( ) ; } } ) ; } }
Source:
private void appendNoLF ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m ) { openLine ( m , false ) ; padLineNumber ( m , false , true ) ; padLineNumber ( m , false , false ) ; m.openTd ( ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffText ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . diffTextNoLF ( ) ) ; m.append ( "\\ No newline at end of file" ) ; m.closeTd ( ) ; closeLine ( m ) ; }

Target:
private void createFileCommentBorderRow ( ) { if ( ! ( isFileCommentBorderRowExist ) ) { isFileCommentBorderRowExist = true ; table.insertRow ( borderRowOfFileComment ) ; final com.google.gwt.user.client.ui.HTMLTable.CellFormatter fmt = table.getCellFormatter ( ) ; fmt.addStyleName ( borderRowOfFileComment , com.google.gerrit.client.patches.C_ARROW , Gerrit.RESOURCES.css ( ) . iconCellOfFileCommentRow ( ) ) ; defaultStyle ( borderRowOfFileComment , fmt ) ; final com.google.gwt.user.client.Element iconCell = fmt.getElement ( borderRowOfFileComment , com.google.gerrit.client.patches.C_ARROW ) ; com.google.gwt.user.client.ui.UIObject.setStyleName ( com.google.gwt.user.client.DOM.getParent ( iconCell ) , Gerrit.RESOURCES.css ( ) . fileCommentBorder ( ) , true ) ; } }
Source:
protected void insertRow ( final int row ) { super . insertRow ( row ) ; final com.google.gwt.user.client.ui.HTMLTable.CellFormatter fmt = table.getCellFormatter ( ) ; fmt.addStyleName ( row , ( ( com.google.gerrit.client.patches.UnifiedDiffTable.PC ) - 2 ) , "LineNumber" ) ; fmt.addStyleName ( row , ( ( com.google.gerrit.client.patches.UnifiedDiffTable.PC ) - 1 ) , "LineNumber" ) ; fmt.addStyleName ( row , com.google.gerrit.client.patches.UnifiedDiffTable.PC , "DiffText" ) ; }

Target:
protected void insertRow ( final int row ) { super . insertRow ( row ) ; final com.google.gwt.user.client.ui.HTMLTable.CellFormatter fmt = table.getCellFormatter ( ) ; fmt.addStyleName ( row , ( ( com.google.gerrit.client.patches.UnifiedDiffTable.PC ) - 2 ) , Gerrit.RESOURCES.css ( ) . lineNumber ( ) ) ; fmt.addStyleName ( row , ( ( com.google.gerrit.client.patches.UnifiedDiffTable.PC ) - 1 ) , Gerrit.RESOURCES.css ( ) . lineNumber ( ) ) ; fmt.addStyleName ( row , com.google.gerrit.client.patches.UnifiedDiffTable.PC , Gerrit.RESOURCES.css ( ) . diffText ( ) ) ; }