auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
boolean index ( int changeId ) { try { com.ericsson.gerrit.plugins.syncindex.IndexResponseHandler.IndexResult result = httpSession.post ( buildEndpoint ( changeId ) ) ; if ( result.isSuccessful ( ) ) { return true ; } com.ericsson.gerrit.plugins.syncindex.RestSession.log.error ( "Unable to index change {}. Cause: {}" , changeId , result.getMessage ( ) ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.syncindex.RestSession.log.error ( ( "Error trying to index change " + changeId ) , e ) ; } return false ; }

Target:
boolean index ( int changeId ) { try { com.ericsson.gerrit.plugins.highavailability.IndexResponseHandler.IndexResult result = httpSession.post ( buildEndpoint ( changeId ) ) ; if ( result.isSuccessful ( ) ) { return true ; } com.ericsson.gerrit.plugins.highavailability.RestSession.log.error ( "Unable to index change {}. Cause: {}" , changeId , result.getMessage ( ) ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.highavailability.RestSession.log.error ( ( "Error trying to index change " + changeId ) , e ) ; } return false ; }
Source:
public void fire ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet patchSet , com.google.gerrit.reviewdb.client.Account.Id uploader , java.sql.Timestamp when ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } try { fire ( util.changeInfo ( change ) , util.revisionInfo ( change.getProject ( ) , patchSet ) , util.accountInfo ( uploader ) , when ) ; } catch ( com.google.gerrit.server.patch.PatchListNotAvailableException | com.google.gerrit.server.GpgException | java.io.IOException | com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.extensions.events.RevisionCreated.log.error ( "Couldn't fire event" , e ) ; } }

Target:
public void fire ( com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet patchSet , com.google.gerrit.reviewdb.client.Account.Id uploader , java.sql.Timestamp when , com.google.gerrit.extensions.api.changes.NotifyHandling notify ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } try { fire ( util.changeInfo ( change ) , util.revisionInfo ( change.getProject ( ) , patchSet ) , util.accountInfo ( uploader ) , when , notify ) ; } catch ( com.google.gerrit.server.patch.PatchListNotAvailableException | com.google.gerrit.server.GpgException | java.io.IOException | com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.extensions.events.RevisionCreated.log.error ( "Couldn't fire event" , e ) ; } }
Source:
public void newPatchSetByOtherOnReviewableChangeOwnerSelfCcNotifyOwnerInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%notify=OWNER" , other , EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . to ( sc.owner ) . to ( sc.reviewer ) . cc ( sc.ccer ) . notTo ( sc.starrer , other ) . notTo ( sc.reviewerByEmail , sc.ccerByEmail ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }

Target:
public void newPatchSetByOwnerOnReviewableChangeToWip ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%wip" , sc.owner ) ; assertThat ( sender ) . notSent ( ) ; }
Source:
private boolean isMember ( com.google.gerrit.reviewdb.client.AccountGroup parent , com.google.gerrit.common.data.GroupDescription.Basic member ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { try { return groups.isIncluded ( dbProvider.get ( ) , parent.getGroupUUID ( ) , member.getGroupUUID ( ) ) ; } catch ( com.google.gerrit.common.errors.NoSuchGroupException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( java.lang.String.format ( "Group %s not found" , parent.getGroupUUID ( ) ) ) ; } }

Target:
private boolean isMember ( com.google.gerrit.common.data.GroupDescription.Internal parent , com.google.gerrit.common.data.GroupDescription.Basic member ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { try { return groups.isIncluded ( dbProvider.get ( ) , parent.getGroupUUID ( ) , member.getGroupUUID ( ) ) ; } catch ( com.google.gerrit.common.errors.NoSuchGroupException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( java.lang.String.format ( "Group %s not found" , parent.getGroupUUID ( ) ) ) ; } }
Source:
private void initProjectLink ( com.google.gerrit.client.changes.ChangeInfo info ) { projectLink.setText ( info.project ( ) ) ; projectLink.setTargetHistoryToken ( com.google.gerrit.common.PageLinks.toChangeQuery ( com.google.gerrit.common.PageLinks.projectQuery ( info.project_name_key ( ) , info.status ( ) ) ) ) ; }

Target:
private void initProjectLinks ( final com.google.gerrit.client.changes.ChangeInfo info ) { projectQuery.addDomHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toProjectDefaultDashboard ( info.project_name_key ( ) ) ) ; } } , com.google.gwt.event.dom.client.ClickEvent.getType ( ) ) ; projectLink.setText ( info.project ( ) ) ; projectLink.setTargetHistoryToken ( com.google.gerrit.common.PageLinks.toProject ( info.project_name_key ( ) ) ) ; }
Source:
private void fireEvent ( com.google.gerrit.reviewdb.client.Branch.NameKey branchName , com.google.gerrit.common.Event event ) { for ( com.google.gerrit.common.ChangeHookRunner.EventListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( branchName , holder.user ) ) { holder.listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }

Target:
private void fireEvent ( com.google.gerrit.reviewdb.client.Branch.NameKey branchName , com.google.gerrit.server.events.RefEvent event ) { for ( com.google.gerrit.common.ChangeHookRunner.EventListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( branchName , holder.user ) ) { holder.listener.onEvent ( event ) ; } } fireEventForUnrestrictedListeners ( event ) ; }
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 appendNoLF ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m ) { openLine ( m ) ; padLineNumberForSideA ( m ) ; padLineNumberForSideB ( m ) ; 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 ) ; }
Source:
public void onDoubleClick ( com.google.gwt.event.dom.client.DoubleClickEvent event ) { com.google.gwt.user.client.Element row = getRow ( event.getNativeEvent ( ) . getEventTarget ( ) . < com.google.gwt.user.client.Element > cast ( ) ) ; if ( row != null ) { movePointerTo ( ( ( startRow ) + ( com.google.gwt.user.client.DOM.getChildIndex ( body , row ) ) ) , false ) ; onOpenRow ( row ) ; event.stopPropagation ( ) ; } }

Target:
public void onDoubleClick ( com.google.gwt.event.dom.client.DoubleClickEvent event ) { com.google.gwt.dom.client.Element row = getRow ( event.getNativeEvent ( ) . getEventTarget ( ) . < com.google.gwt.dom.client.Element > cast ( ) ) ; if ( row != null ) { movePointerTo ( ( ( startRow ) + ( com.google.gwt.user.client.DOM.getChildIndex ( body , row ) ) ) , false ) ; onOpenRow ( row ) ; event.stopPropagation ( ) ; } }
Source:
public static synchronized void schedule ( final java.lang.Runnable task , final long delay , final java.util.concurrent.TimeUnit unit ) { if ( ( com.google.gerrit.git.WorkQueue.pool ) == null ) { com.google.gerrit.git.WorkQueue.pool = new java.util.concurrent.ScheduledThreadPoolExecutor ( 1 ) ; com.google.gerrit.git.WorkQueue.pool.setKeepAliveTime ( 60 , java.util.concurrent.TimeUnit.SECONDS ) ; com.google.gerrit.git.WorkQueue.pool.setMaximumPoolSize ( 5 ) ; } com.google.gerrit.git.WorkQueue.pool.schedule ( task , delay , unit ) ; }

Target:
public static void schedule ( final java.lang.Runnable task , final long delay , final java.util.concurrent.TimeUnit unit ) { com.google.gerrit.git.WorkQueue.getPool ( true ) . schedule ( task , delay , unit ) ; }
Source:
public void customConflictMessageWitTopicTest ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.automerger.FailedMergeException fme = new com.googlesource.gerrit.plugins.automerger.FailedMergeException ( failedMergeBranches , currentRevision , hostName , "i am ${topic}" , topic ) ; java.lang.String conflictMessage = "i am testtopic" ; com.google.common.truth.Truth.assertThat ( fme.getDisplayString ( ) . split ( "\\n" ) ) . asList ( ) . containsExactly ( "i am testtopic" , "i am testtopic" , "i am testtopic" ) ; }

Target:
public void customConflictMessageWithChangeNumberTest ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.automerger.FailedMergeException fme = new com.googlesource.gerrit.plugins.automerger.FailedMergeException ( failedMergeBranches , currentRevision , hostName , projectName , changeNumber , patchsetNumber , "${changeNumber}: hooray" , topic ) ; java.lang.String changeNumberString = "15: hooray" ; com.google.common.truth.Truth.assertThat ( fme.getDisplayString ( ) . split ( "\\n" ) ) . asList ( ) . containsExactly ( changeNumberString , changeNumberString , changeNumberString ) ; }
Source:
public void testCUSTOM_NoFullNameUser ( ) { setFrom ( "A ${user} B <my.server@email.address>" ) ; final java.lang.String email = "a.u.thor@test.example.com" ; final com.google.gerrit.reviewdb.client.Account.Id user = user ( null , email ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( user ) ; org.junit.Assert.assertNotNull ( r ) ; org.junit.Assert.assertEquals ( "A Anonymous Coward B" , r.name ) ; org.junit.Assert.assertEquals ( "my.server@email.address" , r.email ) ; org.easymock.EasyMock.verify ( accountCache ) ; }

Target:
public void testCUSTOM_FullyConfiguredUser ( ) { setFrom ( "A ${user} B <my.server@email.address>" ) ; final java.lang.String name = "A U. Thor" ; final java.lang.String email = "a.u.thor@test.example.com" ; final com.google.gerrit.reviewdb.client.Account.Id user = user ( name , email ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( user ) ; com.google.common.truth.Truth.assertThat ( r ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( r.name ) . isEqualTo ( ( ( "A " + name ) + " B" ) ) ; com.google.common.truth.Truth.assertThat ( r.email ) . isEqualTo ( "my.server@email.address" ) ; org.easymock.EasyMock.verify ( accountCache ) ; }
Source:
private com.google.gerrit.server.project.ChangeControl controlFor ( com.google.gerrit.server.change.RevisionResource rsrc , com.google.gerrit.reviewdb.client.Change.Id id ) throws com.google.gwtorm.server.OrmException { if ( rsrc.getChange ( ) . getId ( ) . equals ( id ) ) { return rsrc.getControl ( ) ; } com.google.gerrit.server.notedb.ChangeNotes notes = notesFactory.create ( dbProvider.get ( ) , rsrc.getProject ( ) , id ) ; return rsrc.getControl ( ) . getProjectControl ( ) . controlFor ( notes ) ; }

Target:
private com.google.gerrit.server.project.ChangeControl controlFor ( com.google.gerrit.server.change.RevisionResource rsrc , com.google.gerrit.reviewdb.client.Change.Id id ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { if ( rsrc.getChange ( ) . getId ( ) . equals ( id ) ) { return rsrc.getControl ( ) ; } com.google.gerrit.server.notedb.ChangeNotes notes = notesFactory.createChecked ( dbProvider.get ( ) , rsrc.getProject ( ) , id ) ; return rsrc.getControl ( ) . getProjectControl ( ) . controlFor ( notes ) ; }
Source:
public com.google.gerrit.reviewdb.client.PatchSetInfo createValue ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.rules.StoredValues.CHANGE.get ( engine ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.rules.StoredValues.PATCH_SET.get ( engine ) ; com.google.gerrit.rules.PrologEnvironment env = ( ( com.google.gerrit.rules.PrologEnvironment ) ( engine.control ) ) ; com.google.gerrit.server.patch.PatchSetInfoFactory patchInfoFactory = env.getArgs ( ) . getPatchSetInfoFactory ( ) ; try { return patchInfoFactory.get ( change , ps ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e ) { throw new com.googlecode.prolog_cafe.lang.SystemException ( e.getMessage ( ) ) ; } }

Target:
public com.google.gerrit.reviewdb.client.PatchSetInfo createValue ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.rules.StoredValues.CHANGE_DATA.get ( engine ) . getChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.rules.StoredValues.PATCH_SET.get ( engine ) ; com.google.gerrit.rules.PrologEnvironment env = ( ( com.google.gerrit.rules.PrologEnvironment ) ( engine.control ) ) ; com.google.gerrit.server.patch.PatchSetInfoFactory patchInfoFactory = env.getArgs ( ) . getPatchSetInfoFactory ( ) ; try { return patchInfoFactory.get ( change , ps ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e ) { throw new com.googlecode.prolog_cafe.lang.SystemException ( e.getMessage ( ) ) ; } }
Source:
private com.google.gerrit.reviewdb.client.Account findAccount ( final java.lang.String nameOrEmail ) throws com.google.gerrit.httpd.rpc.account.Failure , com.google.gwtorm.server.OrmException { final com.google.gerrit.reviewdb.client.Account r = accountResolver.find ( nameOrEmail ) ; if ( r == null ) { throw new com.google.gerrit.httpd.rpc.account.Failure ( new com.google.gerrit.common.errors.NoSuchAccountException ( nameOrEmail ) ) ; } return r ; }

Target:
private com.google.gerrit.reviewdb.client.Account findAccount ( final java.lang.String nameOrEmail ) throws com.google.gerrit.httpd.rpc.account.Failure , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Account r = accountResolver.find ( nameOrEmail ) ; if ( r == null ) { switch ( authType ) { case HTTP_LDAP : case CLIENT_SSL_CERT_LDAP : case LDAP : r = createAccountByLdap ( nameOrEmail ) ; break ; default : } if ( r == null ) { throw new com.google.gerrit.httpd.rpc.account.Failure ( new com.google.gerrit.common.errors.NoSuchAccountException ( nameOrEmail ) ) ; } } return r ; }
Source:
public com.google.common.base.Optional < com.google.gerrit.reviewdb.client.Account.Id > load ( java.lang.String username ) throws java.lang.Exception { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { final com.google.gerrit.reviewdb.client.AccountExternalId extId = db.accountExternalIds ( ) . get ( new com.google.gerrit.reviewdb.client.AccountExternalId.Key ( com.google.gerrit.reviewdb.client.AccountExternalId.SCHEME_GERRIT , username ) ) ; if ( extId != null ) { return com.google.common.base.Optional.of ( extId.getAccountId ( ) ) ; } return com.google.common.base.Optional.absent ( ) ; } }

Target:
public java.util.Optional < com.google.gerrit.reviewdb.client.Account.Id > load ( java.lang.String username ) throws java.lang.Exception { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { return java.util.Optional.ofNullable ( db.accountExternalIds ( ) . get ( new com.google.gerrit.reviewdb.client.AccountExternalId.Key ( com.google.gerrit.reviewdb.client.AccountExternalId.SCHEME_GERRIT , username ) ) ) . map ( AccountExternalId :: getAccountId ) ; } }
Source:
public void onShowView ( ) { super . onShowView ( ) ; java.lang.String prior = com.google.gerrit.client.Gerrit.getPriorView ( ) ; if ( ( prior != null ) && ( prior.startsWith ( "/c/" ) ) ) { scrollToPath ( prior.substring ( 3 ) ) ; } }

Target:
public void onShowView ( ) { super . onShowView ( ) ; related.setMaxHeight ( commit.getElement ( ) . getParentElement ( ) . getOffsetHeight ( ) ) ; java.lang.String prior = com.google.gerrit.client.Gerrit.getPriorView ( ) ; if ( ( prior != null ) && ( prior.startsWith ( "/c/" ) ) ) { scrollToPath ( prior.substring ( 3 ) ) ; } }
Source:
public com.google.gerrit.reviewdb.Change update ( com.google.gerrit.reviewdb.Change change ) { if ( change.getStatus ( ) . isOpen ( ) ) { change.setStatus ( Change.Status.NEW ) ; change.setCurrentPatchSet ( result.info ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; return change ; } else { return null ; } }

Target:
public com.google.gerrit.reviewdb.Change update ( com.google.gerrit.reviewdb.Change change ) { if ( change.getStatus ( ) . isOpen ( ) ) { if ( ( destTopicName ) != null ) { change.setTopic ( ( destTopicName.isEmpty ( ) ? null : destTopicName ) ) ; } change.setStatus ( Change.Status.NEW ) ; change.setCurrentPatchSet ( result.info ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; return change ; } else { return null ; } }
Source:
private void doReplay ( ) { org.easymock.EasyMock.replay ( schemaFactory , schema , subscriptions , urlProvider , repoManager , gitRefUpdated ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; mockMaker = org.easymock.EasyMock.createStrictControl ( ) ; schemaFactory = mockMaker.createMock ( com.google.gwtorm.server.SchemaFactory.class ) ; schema = mockMaker.createMock ( com.google.gerrit.reviewdb.server.ReviewDb.class ) ; subscriptions = mockMaker.createMock ( com.google.gerrit.reviewdb.server.SubmoduleSubscriptionAccess.class ) ; urlProvider = mockMaker.createMock ( com.google.inject.Provider.class ) ; repoManager = mockMaker.createMock ( com.google.gerrit.server.git.GitRepositoryManager.class ) ; gitRefUpdated = mockMaker.createMock ( com.google.gerrit.server.extensions.events.GitReferenceUpdated.class ) ; changeHooks = mockMaker.createMock ( com.google.gerrit.common.ChangeHooks.class ) ; }
Source:
public void emptyGroupName ( ) throws java.lang.Exception { com.google.gerrit.common.data.GroupReference g = newGroup ( "" ) ; updateGroupNames ( com.google.gerrit.server.group.db.GroupNameNotesTest.newPersonIdent ( ) , g ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.group.db.testing.GroupTestUtil.readNameToUuidMap ( repo ) ) . containsExactly ( "" , "-1" ) ; com.google.common.truth.Truth.assertThat ( readNameNote ( g ) ) . isEqualTo ( "[group]\n\tuuid = -1\n\tname = \n" ) ; }

Target:
public void emptyGroupName ( ) throws java.lang.Exception { com.google.gerrit.common.data.GroupReference g = newGroup ( "" ) ; updateGroupNames ( com.google.gerrit.server.group.db.GroupNameNotesTest.newPersonIdent ( ) , g ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.group.db.GroupNameNotes.loadAllGroups ( repo ) ) . containsExactly ( g ) ; com.google.common.truth.Truth.assertThat ( readNameNote ( g ) ) . isEqualTo ( "[group]\n\tuuid = -1\n\tname = \n" ) ; }
Source:
public void httpLink ( ) { com.google.gitiles.doc.MarkdownToHtml md = com.google.gitiles.doc.MarkdownToHtml.builder ( ) . setGitilesView ( view ) . setConfig ( new com.google.gitiles.doc.MarkdownConfig ( config ) ) . setFilePath ( "index.md" ) . build ( ) ; java.lang.String url ; url = "http://example.com/foo.html" ; com.google.common.truth.Truth.assertThat ( md.href ( url ) ) . isEqualTo ( url ) ; url = "https://example.com/foo.html" ; com.google.common.truth.Truth.assertThat ( md.href ( url ) ) . isEqualTo ( url ) ; url = "//example.com/foo.html" ; com.google.common.truth.Truth.assertThat ( md.href ( url ) ) . isEqualTo ( url ) ; }

Target:
public void httpLink ( ) { com.google.gitiles.doc.MarkdownToHtml md = com.google.gitiles.doc.MarkdownToHtml.builder ( ) . setGitilesView ( view ) . setConfig ( new com.google.gitiles.doc.MarkdownConfig ( config ) ) . setFilePath ( "index.md" ) . build ( ) ; java.lang.String url ; url = "http://example.com/foo.html" ; com.google.common.truth.Truth.assertThat ( md.href ( url ) ) . isEqualTo ( url ) ; url = "https://example.com/foo.html" ; com.google.common.truth.Truth.assertThat ( md.href ( url ) ) . isEqualTo ( url ) ; url = "//example.com/foo.html" ; com.google.common.truth.Truth.assertThat ( md.href ( url ) ) . isEqualTo ( url ) ; url = "mailto://nobody@nowhere.org" ; com.google.common.truth.Truth.assertThat ( md.href ( url ) ) . isEqualTo ( url ) ; }
Source:
public com.google.gerrit.server.project.TagResource parse ( com.google.gerrit.server.project.ProjectResource rsrc , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { return new com.google.gerrit.server.project.TagResource ( rsrc.getProjectState ( ) , rsrc.getUser ( ) , list.get ( ) . get ( rsrc , id ) ) ; }

Target:
public com.google.gerrit.server.project.TagResource parse ( com.google.gerrit.server.project.ProjectResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException { parent.getProjectState ( ) . checkStatePermitsRead ( ) ; return new com.google.gerrit.server.project.TagResource ( parent.getProjectState ( ) , parent.getUser ( ) , list.get ( ) . get ( parent , id ) ) ; }
Source:
private static void export ( org.spearce.jgit.lib.RepositoryConfig config , java.sql.ResultSet rs ) throws java.sql.SQLException { com.google.gerrit.pgm.ConvertSystemConfig.sshd ( config , rs ) ; com.google.gerrit.pgm.ConvertSystemConfig.contactstore ( config , rs ) ; com.google.gerrit.pgm.ConvertSystemConfig.user ( config , rs ) ; com.google.gerrit.pgm.ConvertSystemConfig.auth ( config , rs ) ; }

Target:
private static void export ( org.spearce.jgit.lib.RepositoryConfig config , java.sql.ResultSet rs ) throws java.sql.SQLException { com.google.gerrit.pgm.ConvertSystemConfig.sshd ( config , rs ) ; com.google.gerrit.pgm.ConvertSystemConfig.contactstore ( config , rs ) ; com.google.gerrit.pgm.ConvertSystemConfig.user ( config , rs ) ; com.google.gerrit.pgm.ConvertSystemConfig.auth ( config , rs ) ; com.google.gerrit.pgm.ConvertSystemConfig.gitweb ( config , rs ) ; }
Source:
private void touch ( com.google.gerrit.server.cache.h2.H2CacheImpl.SqlHandle c , K key ) throws java.sql.SQLException { if ( ( c.touch ) == null ) { c.touch = c.conn.prepareStatement ( "UPDATE data SET accessed=? WHERE k=?" ) ; } try { c.touch.setTimestamp ( 1 , new java.sql.Timestamp ( com.google.gerrit.server.util.TimeUtil.nowMs ( ) ) ) ; keyType.set ( c.touch , 2 , key ) ; c.touch.executeUpdate ( ) ; } finally { c.touch.clearParameters ( ) ; } }

Target:
private void touch ( com.google.gerrit.server.cache.h2.H2CacheImpl.SqlHandle c , K key ) throws java.sql.SQLException { if ( ( c.touch ) == null ) { c.touch = c.conn.prepareStatement ( "UPDATE data SET accessed=? WHERE k=?" ) ; } try { c.touch.setTimestamp ( 1 , com.google.gerrit.server.util.TimeUtil.nowTs ( ) ) ; keyType.set ( c.touch , 2 , key ) ; c.touch.executeUpdate ( ) ; } finally { c.touch.clearParameters ( ) ; } }
Source:
private boolean canSetPrivate ( com.google.gerrit.server.change.ChangeResource rsrc ) { com.google.gerrit.server.permissions.PermissionBackend.WithUser user = permissionBackend.user ( rsrc.getUser ( ) ) ; return ( rsrc.isUserOwner ( ) ) || ( user.testOrFalse ( GlobalPermission.ADMINISTRATE_SERVER ) ) ; }

Target:
private boolean canSetPrivate ( 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:
private static org.eclipse.jgit.lib.Config defaultConfig ( ) throws java.net.UnknownHostException { org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; java.lang.String cwd = java.lang.System.getProperty ( "user.dir" ) ; cfg.setString ( "gitiles" , null , "basePath" , cwd ) ; cfg.setBoolean ( "gitiles" , null , "exportAll" , true ) ; cfg.setString ( "gitiles" , null , "baseGitUrl" , ( ( "file://" + cwd ) + "/" ) ) ; java.lang.String networkHostName = java.net.InetAddress.getLocalHost ( ) . getCanonicalHostName ( ) ; cfg.setString ( "gitiles" , null , "siteTitle" , java.lang.String.format ( "Gitiles - %s:%s" , networkHostName , cwd ) ) ; cfg.setString ( "gitiles" , null , "canonicalHostName" , new java.io.File ( cwd ) . getName ( ) ) ; return cfg ; }

Target:
private static org.eclipse.jgit.lib.Config defaultConfig ( ) { org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; java.lang.String cwd = java.lang.System.getProperty ( "user.dir" ) ; cfg.setString ( "gitiles" , null , "basePath" , cwd ) ; cfg.setBoolean ( "gitiles" , null , "exportAll" , true ) ; cfg.setString ( "gitiles" , null , "baseGitUrl" , ( ( "file://" + cwd ) + "/" ) ) ; java.lang.String networkHostName ; try { networkHostName = java.net.InetAddress.getLocalHost ( ) . getCanonicalHostName ( ) ; } catch ( java.net.UnknownHostException e ) { networkHostName = "127.0.0.1" ; } cfg.setString ( "gitiles" , null , "siteTitle" , java.lang.String.format ( "Gitiles - %s:%s" , networkHostName , cwd ) ) ; cfg.setString ( "gitiles" , null , "canonicalHostName" , new java.io.File ( cwd ) . getName ( ) ) ; return cfg ; }
Source:
public void updateComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) throws com.google.gwtorm.server.OrmException { verifyComment ( c ) ; com.google.common.base.Preconditions.checkArgument ( ( ( c.getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.PatchLineComment.Status.DRAFT ) ) , "Cannot update a published comment into a ChangeDraftUpdate" ) ; if ( migration.readComments ( ) ) { com.google.common.base.Preconditions.checkArgument ( draftNotes.containsComment ( c ) , "Cannot update this comment because it didn't exist previously" ) ; } upsertComments.add ( c ) ; }

Target:
public void updateComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) throws com.google.gwtorm.server.OrmException { verifyComment ( c ) ; com.google.common.base.Preconditions.checkArgument ( ( ( c.getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.PatchLineComment.Status.DRAFT ) ) , "Cannot update a published comment into a ChangeDraftUpdate" ) ; if ( migration.readComments ( ) ) { com.google.common.base.Preconditions.checkArgument ( draftNotes.load ( ) . containsComment ( c ) , "Cannot update this comment because it didn't exist previously" ) ; } upsertComments.add ( c ) ; }
Source:
public com.googlesource.gerrit.plugins.oauth.Token extract ( java.lang.String response ) { org.scribe.utils.Preconditions.checkEmptyString ( response , "Cannot extract a token from a null or empty String" ) ; java.util.regex.Matcher matcher = accessTokenPattern.matcher ( response ) ; if ( matcher.find ( ) ) { return new com.googlesource.gerrit.plugins.oauth.Token ( matcher.group ( 1 ) , "" , response ) ; } else { throw new org.scribe.exceptions.OAuthException ( ( "Cannot extract an acces token. Response was: " + response ) ) ; } }

Target:
public org.scribe.model.Token extract ( java.lang.String response ) { org.scribe.utils.Preconditions.checkEmptyString ( response , "Cannot extract a token from a null or empty String" ) ; java.util.regex.Matcher matcher = accessTokenPattern.matcher ( response ) ; if ( matcher.find ( ) ) { return new org.scribe.model.Token ( matcher.group ( 1 ) , "" , response ) ; } throw new org.scribe.exceptions.OAuthException ( ( "Cannot extract an acces token. Response was: " + response ) ) ; }
Source:
public static void abandon ( int changeId , java.lang.String message , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > callback ) { com.google.gerrit.client.changes.ChangeApi.Message msg = new com.google.gerrit.client.changes.ChangeApi.Message ( ) ; msg.setMessage ( message ) ; new com.google.gerrit.client.rpc.RestApi ( ( ( ( com.google.gerrit.client.changes.ChangeApi.URI ) + changeId ) + "/abandon" ) ) . data ( msg ) . post ( callback ) ; }

Target:
public static void abandon ( int changeId , java.lang.String message , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > callback ) { com.google.gerrit.client.changes.ChangeApi.Input input = com.google.gerrit.client.changes.ChangeApi.Input.create ( ) ; input.setMessage ( com.google.gerrit.client.changes.ChangeApi.emptyToNull ( message ) ) ; new com.google.gerrit.client.rpc.RestApi ( ( ( ( com.google.gerrit.client.changes.ChangeApi.URI ) + changeId ) + "/abandon" ) ) . data ( input ) . post ( callback ) ; }
Source:
private com.google.inject.Injector createWebInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebModule.class ) ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebSshGlueModule.class ) ) ; return sysInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createWebInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebModule.class ) ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebSshGlueModule.class ) ) ; modules.add ( new com.google.gerrit.httpd.SessionCacheCleaner.Module ( ) ) ; return sysInjector.createChildInjector ( modules ) ; }
Source:
private static synchronized void fill ( byte [ ] raw , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { if ( ( com.google.gerrit.server.ChangeUtil.uuidSeq ) == 0 ) { com.google.gerrit.server.ChangeUtil.uuidPrefix = db.nextChangeMessageId ( ) ; com.google.gerrit.server.ChangeUtil.uuidSeq = java.lang.Integer.MAX_VALUE ; } org.eclipse.jgit.util.NB.encodeInt32 ( raw , 0 , com.google.gerrit.server.ChangeUtil.uuidPrefix ) ; org.eclipse.jgit.util.NB.encodeInt32 ( raw , 4 , ( ( com.google.gerrit.server.ChangeUtil.uuidSeq ) -- ) ) ; }

Target:
public static java.lang.String messageUUID ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { int p ; int s ; synchronized ( com.google.gerrit.server.ChangeUtil.uuidLock ) { if ( ( com.google.gerrit.server.ChangeUtil.uuidSeq ) == 0 ) { com.google.gerrit.server.ChangeUtil.uuidPrefix = db.nextChangeMessageId ( ) ; com.google.gerrit.server.ChangeUtil.uuidSeq = java.lang.Integer.MAX_VALUE ; } p = com.google.gerrit.server.ChangeUtil.uuidPrefix ; s = ( com.google.gerrit.server.ChangeUtil.uuidSeq ) -- ; } java.lang.String u = com.google.gerrit.server.util.IdGenerator.format ( com.google.gerrit.server.util.IdGenerator.mix ( com.google.gerrit.server.ChangeUtil.SEED , p ) ) ; java.lang.String l = com.google.gerrit.server.util.IdGenerator.format ( com.google.gerrit.server.util.IdGenerator.mix ( p , s ) ) ; return ( u + '_' ) + l ; }
Source:
void setReviewed ( boolean r ) { reviewed.setValue ( r , true ) ; }

Target:
public void onSuccess ( com.google.gwt.core.client.JsArrayString result ) { boolean b = com.google.gerrit.client.rpc.Natives.asList ( result ) . contains ( path ) ; reviewed.setValue ( b , false ) ; if ( ( ! b ) && ( ( reviewedState ) == ( com.google.gerrit.client.diff.Header.ReviewedState.AUTO_REVIEW ) ) ) { postAutoReviewed ( ) ; } reviewedState = com.google.gerrit.client.diff.Header.ReviewedState.LOADED ; }
Source:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > changeDrafts ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByChangeAuthor ( ctx.getDb ( ) , ctx.getChangeNotes ( ) , user.getAccountId ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }

Target:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > changeDrafts ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = new java.util.HashMap < > ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByChangeAuthor ( ctx.getDb ( ) , ctx.getNotes ( ) , user.getAccountId ( ) ) ) { c.setTag ( in.tag ) ; drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }
Source:
private static void assertAmGroupOwner ( final com.google.gerrit.client.reviewdb.ReviewDb db , final com.google.gerrit.client.reviewdb.AccountGroup.Id groupId ) throws com.google.gerrit.client.admin.Failure , com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.AccountGroupMember m = db.accountGroupMembers ( ) . get ( new com.google.gerrit.client.reviewdb.AccountGroupMember.Key ( com.google.gerrit.client.rpc.RpcUtil.getAccountId ( ) , groupId ) ) ; if ( ( ( m == null ) || ( ! ( m.isGroupOwner ( ) ) ) ) && ( ! ( com.google.gerrit.client.admin.GroupAdminServiceImpl.amAdmin ( db ) ) ) ) { throw new com.google.gerrit.client.admin.Failure ( new com.google.gerrit.client.rpc.NoSuchEntityException ( ) ) ; } }

Target:
private static boolean amInGroup ( final com.google.gerrit.client.reviewdb.ReviewDb db , final com.google.gerrit.client.reviewdb.AccountGroup.Id groupId ) throws com.google.gwtorm.client.OrmException { return ( db.accountGroupMembers ( ) . get ( new com.google.gerrit.client.reviewdb.AccountGroupMember.Key ( com.google.gerrit.client.rpc.RpcUtil.getAccountId ( ) , groupId ) ) ) != null ; }
Source:
private com.google.gerrit.gpg.PublicKeyChecker newChecker ( int maxTrustDepth , com.google.gerrit.gpg.testutil.TestKey ... trusted ) { java.util.Map < java.lang.Long , com.google.gerrit.gpg.Fingerprint > fps = new java.util.HashMap < > ( ) ; for ( com.google.gerrit.gpg.testutil.TestKey k : trusted ) { com.google.gerrit.gpg.Fingerprint fp = new com.google.gerrit.gpg.Fingerprint ( k.getPublicKey ( ) . getFingerprint ( ) ) ; fps.put ( fp.getId ( ) , fp ) ; } return new com.google.gerrit.gpg.PublicKeyChecker ( ) . enableTrust ( maxTrustDepth , fps ) . setStore ( store ) ; }

Target:
private com.google.gerrit.gpg.PublicKeyChecker newChecker ( int maxTrustDepth , com.google.gerrit.gpg.testing.TestKey ... trusted ) { java.util.Map < java.lang.Long , com.google.gerrit.gpg.Fingerprint > fps = new java.util.HashMap < > ( ) ; for ( com.google.gerrit.gpg.testing.TestKey k : trusted ) { com.google.gerrit.gpg.Fingerprint fp = new com.google.gerrit.gpg.Fingerprint ( k.getPublicKey ( ) . getFingerprint ( ) ) ; fps.put ( fp.getId ( ) , fp ) ; } return new com.google.gerrit.gpg.PublicKeyChecker ( ) . enableTrust ( maxTrustDepth , fps ) . setStore ( store ) ; }
Source:
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 ) ) ; initMembersAndSubgroups ( 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 { return createGroupInfo ( group , com.google.common.base.Suppliers.memoize ( ( ) -> groupControlFactory.controlFor ( group ) ) ) ; }
Source:
protected boolean shouldSendMessage ( ) { if ( ( body.length ( ) ) == 0 ) { return false ; } if ( smtpRcptTo.isEmpty ( ) ) { return false ; } if ( ( ( ( smtpRcptTo.size ( ) ) == 1 ) && ( ( rcptTo.size ( ) ) == 1 ) ) && ( rcptTo.contains ( fromId ) ) ) { return false ; } return true ; }

Target:
protected boolean shouldSendMessage ( ) { if ( ( body.length ( ) ) == 0 ) { com.google.gerrit.server.mail.OutgoingEmail.log.warn ( "Skipping delivery of email with no body" ) ; return false ; } if ( smtpRcptTo.isEmpty ( ) ) { com.google.gerrit.server.mail.OutgoingEmail.log.info ( "Skipping delivery of email with no recipients" ) ; return false ; } if ( ( ( ( smtpRcptTo.size ( ) ) == 1 ) && ( ( rcptTo.size ( ) ) == 1 ) ) && ( rcptTo.contains ( fromId ) ) ) { return false ; } return true ; }
Source:
private static com.google.common.collect.Multimap < java.lang.String , java.io.File > asMultimap ( java.util.List < java.io.File > plugins ) throws java.io.IOException { com.google.common.collect.Multimap < java.lang.String , java.io.File > map = com.google.common.collect.LinkedHashMultimap.create ( ) ; for ( java.io.File srcFile : plugins ) { map.put ( com.google.common.base.Objects.firstNonNull ( com.google.gerrit.server.plugins.PluginLoader.getGerritPluginName ( srcFile ) , com.google.gerrit.server.plugins.PluginLoader.nameOf ( srcFile ) ) , srcFile ) ; } return map ; }

Target:
private static com.google.common.collect.Multimap < java.lang.String , java.io.File > asMultimap ( java.util.List < java.io.File > plugins ) throws java.io.IOException { com.google.common.collect.Multimap < java.lang.String , java.io.File > map = com.google.common.collect.LinkedHashMultimap.create ( ) ; for ( java.io.File srcFile : plugins ) { map.put ( com.google.gerrit.server.plugins.PluginLoader.getPluginName ( srcFile ) , srcFile ) ; } return map ; }
Source:
private void decodeReviewers ( com.google.common.collect.Multimap < java.lang.String , org.apache.lucene.index.IndexableField > doc , com.google.gerrit.server.query.change.ChangeData cd ) { cd.setReviewers ( com.google.gerrit.server.index.change.ChangeField.parseReviewerFieldValues ( com.google.common.collect.FluentIterable.from ( doc.get ( com.google.gerrit.lucene.LuceneChangeIndex.REVIEWER_FIELD ) ) . transform ( new com.google.common.base.Function < org.apache.lucene.index.IndexableField , java.lang.String > ( ) { @ java.lang.Override public java.lang.String apply ( org.apache.lucene.index.IndexableField in ) { return in.stringValue ( ) ; } } ) ) ) ; }

Target:
private void decodeReviewers ( com.google.common.collect.Multimap < java.lang.String , org.apache.lucene.index.IndexableField > doc , com.google.gerrit.server.query.change.ChangeData cd ) { cd.setReviewers ( com.google.gerrit.server.index.change.ChangeField.parseReviewerFieldValues ( com.google.common.collect.FluentIterable.from ( doc.get ( com.google.gerrit.lucene.LuceneChangeIndex.REVIEWER_FIELD ) ) . transform ( IndexableField :: stringValue ) ) ) ; }
Source:
public com.google.gerrit.server.CurrentUser getCurrentUser ( ) { final com.google.gerrit.server.CurrentUser user = session.getCurrentUser ( ) ; if ( user instanceof com.google.gerrit.server.IdentifiedUser ) { return userFactory.create ( ( ( com.google.gerrit.server.IdentifiedUser ) ( user ) ) . getAccountId ( ) ) ; } return user ; }

Target:
public com.google.gerrit.server.CurrentUser getCurrentUser ( ) { final com.google.gerrit.server.CurrentUser user = session.getCurrentUser ( ) ; if ( user instanceof com.google.gerrit.server.IdentifiedUser ) { com.google.gerrit.server.IdentifiedUser identifiedUser = userFactory.create ( ( ( com.google.gerrit.server.IdentifiedUser ) ( user ) ) . getAccountId ( ) ) ; identifiedUser.setAccessPath ( user.getAccessPath ( ) ) ; return identifiedUser ; } return user ; }
Source:
private com.google.gerrit.server.notedb.RevisionNoteData parseJson ( com.google.gerrit.server.notedb.ChangeNoteUtil noteUtil , int offset ) throws java.io.IOException { com.google.gerrit.server.notedb.RevisionNoteData data ; try ( java.io.InputStream is = new java.io.ByteArrayInputStream ( raw , offset , ( ( raw.length ) - offset ) ) ; java.io.Reader r = new java.io.InputStreamReader ( is ) ) { data = noteUtil.getGson ( ) . fromJson ( r , com.google.gerrit.server.notedb.RevisionNoteData.class ) ; } return data ; }

Target:
public byte [ ] getRaw ( ) { checkParsed ( ) ; return raw ; }
Source:
public void display ( final com.google.gerrit.client.reviewdb.Change chg , final com.google.gerrit.client.reviewdb.PatchSetInfo info , final com.google.gerrit.client.data.AccountInfoCache acc ) { infoBlock.display ( chg , acc ) ; com.google.gwtexpui.safehtml.client.SafeHtml.set ( description , new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) . append ( info.getMessage ( ) ) . linkify ( ) ) ; descriptionPanel.setOpen ( true ) ; }

Target:
public void display ( final com.google.gerrit.client.reviewdb.Change chg , final com.google.gerrit.client.reviewdb.PatchSetInfo info , final com.google.gerrit.client.data.AccountInfoCache acc ) { infoBlock.display ( chg , acc ) ; com.google.gwtexpui.safehtml.client.SafeHtml msg = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) . append ( info.getMessage ( ) ) ; msg = msg.linkify ( ) ; msg = msg.replaceAll ( "\n\n" , "<p />" ) ; msg = msg.replaceAll ( "\n" , "<br />" ) ; com.google.gwtexpui.safehtml.client.SafeHtml.set ( description , msg ) ; descriptionPanel.setOpen ( true ) ; }
Source:
private java.lang.Iterable < java.lang.String > getDraftRefs ( final com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { java.util.Set < java.lang.String > refNames = getRefNamesAllUsers ( RefNames.REFS_DRAFT_COMMENTS ) ; final java.lang.String suffix = "/" + ( changeId.get ( ) ) ; return com.google.common.collect.Iterables.filter ( refNames , new com.google.common.base.Predicate < java.lang.String > ( ) { @ java.lang.Override public boolean apply ( java.lang.String input ) { return input.endsWith ( suffix ) ; } } ) ; }

Target:
public java.util.Collection < org.eclipse.jgit.lib.Ref > getDraftRefs ( com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allUsers ) ) { return getDraftRefs ( repo , changeId ) ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } }
Source:
void onTopMenu ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > e ) { prefs.hideTopMenu ( ( ! ( e.getValue ( ) ) ) ) ; if ( ( view ) != null ) { com.google.gerrit.client.Gerrit.setHeaderVisible ( ( ! ( prefs.hideTopMenu ( ) ) ) ) ; view.resizeCodeMirror ( ) ; } }

Target:
void onCursoBlinkRate ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.String > e ) { java.lang.String v = e.getValue ( ) ; if ( ( v != null ) && ( ( v.length ( ) ) > 0 ) ) { prefs.cursorBlinkRate ( java.lang.Math.max ( 0 , java.lang.Integer.parseInt ( v ) ) ) ; if ( ( view ) != null ) { view.setOption ( "cursorBlinkRate" , prefs.cursorBlinkRate ( ) ) ; } } }
Source:
public void setUp ( ) { project = new com.google.gerrit.reviewdb.client.Project.NameKey ( "test-project" ) ; repo = com.google.gerrit.testutil.InMemoryRepositoryManager.newRepository ( project ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { project = new com.google.gerrit.reviewdb.client.Project.NameKey ( "test-project" ) ; repoManager = new com.google.gerrit.testutil.InMemoryRepositoryManager ( ) ; repo = repoManager.createRepository ( project ) ; accountCache = new com.google.gerrit.testutil.FakeAccountCache ( ) ; accountCache.put ( com.google.gerrit.server.notedb.ChangeNotesTest.CHANGE_OWNER ) ; accountCache.put ( com.google.gerrit.server.notedb.ChangeNotesTest.OTHER_ACCOUNT ) ; }
Source:
private java.util.List < java.nio.file.Path > scanJarsInPluginsDirectory ( ) { try { return com.google.gerrit.server.plugins.PluginLoader.listPlugins ( pluginsDir , ".jar" ) ; } catch ( java.io.IOException e ) { ui.message ( "WARN: Cannot list %s: %s" , pluginsDir.toAbsolutePath ( ) , e.getMessage ( ) ) ; return com.google.common.collect.ImmutableList.of ( ) ; } }

Target:
private java.util.List < java.nio.file.Path > scanJarsInPluginsDirectory ( ) { try { return com.google.gerrit.server.plugins.PluginUtil.listPlugins ( pluginsDir , ".jar" ) ; } catch ( java.io.IOException e ) { ui.message ( "WARN: Cannot list %s: %s" , pluginsDir.toAbsolutePath ( ) , e.getMessage ( ) ) ; return com.google.common.collect.ImmutableList.of ( ) ; } }
Source:
com.google.common.collect.ImmutableListMultimap < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.ChangeMessage > buildMessagesByPatchSet ( ) { for ( java.util.Collection < com.google.gerrit.reviewdb.client.ChangeMessage > v : changeMessagesByPatchSet.asMap ( ) . values ( ) ) { java.util.Collections.reverse ( ( ( java.util.List < com.google.gerrit.reviewdb.client.ChangeMessage > ) ( v ) ) ) ; } return com.google.common.collect.ImmutableListMultimap.copyOf ( changeMessagesByPatchSet ) ; }

Target:
private com.google.common.collect.Multimap < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.ChangeMessage > buildMessagesByPatchSet ( ) { for ( java.util.Collection < com.google.gerrit.reviewdb.client.ChangeMessage > v : changeMessagesByPatchSet.asMap ( ) . values ( ) ) { java.util.Collections.reverse ( ( ( java.util.List < com.google.gerrit.reviewdb.client.ChangeMessage > ) ( v ) ) ) ; } return changeMessagesByPatchSet ; }
Source:
public void addComments ( com.google.gerrit.server.events.ChangeAttribute ca , java.util.Collection < com.google.gerrit.reviewdb.ChangeMessage > messages ) { if ( ! ( messages.isEmpty ( ) ) ) { ca.comments = new java.util.ArrayList < com.google.gerrit.server.events.MessageAttribute > ( ) ; for ( com.google.gerrit.reviewdb.ChangeMessage message : messages ) { ca.comments.add ( asMessageAttribute ( message ) ) ; } } }

Target:
public void addPatchSets ( com.google.gerrit.server.events.ChangeAttribute a , java.util.Collection < com.google.gerrit.reviewdb.client.PatchSet > ps ) { addPatchSets ( a , ps , null , false , null ) ; }
Source:
private static int checkLimit ( int limit , java.lang.String name ) { if ( limit == 0 ) { return java.lang.Integer.MAX_VALUE ; } com.google.common.base.Preconditions.checkArgument ( ( limit > 0 ) , "%s must be positive: %s" , name , limit ) ; return limit ; }

Target:
public static com.google.gerrit.server.index.IndexConfig create ( int maxLimit , int maxPages , int maxPrefixTerms ) { return new com.google.gerrit.server.index.AutoValue_IndexConfig ( com.google.gerrit.server.index.IndexConfig.checkLimit ( maxLimit , "maxLimit" , java.lang.Integer.MAX_VALUE ) , com.google.gerrit.server.index.IndexConfig.checkLimit ( maxPages , "maxPages" , java.lang.Integer.MAX_VALUE ) , com.google.gerrit.server.index.IndexConfig.checkLimit ( maxPrefixTerms , "maxPrefixTerms" , com.google.gerrit.server.index.IndexConfig.DEFAULT_MAX_PREFIX_TERMS ) ) ; }
Source:
protected org.eclipse.jgit.junit.TestRepository < ? > createProjectWithPush ( java.lang.String name , @ com.google.gerrit.common.Nullable com.google.gerrit.reviewdb.client.Project.NameKey parent ) throws java.lang.Exception { return createProjectWithPush ( name , parent , getSubmitType ( ) ) ; }

Target:
protected org.eclipse.jgit.junit.TestRepository < ? > createProjectWithPush ( java.lang.String name , @ com.google.gerrit.common.Nullable com.google.gerrit.reviewdb.client.Project.NameKey parent , boolean createEmptyCommit , com.google.gerrit.extensions.client.SubmitType submitType ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Project.NameKey project = createProject ( name , parent , createEmptyCommit , submitType ) ; grant ( "push" , project , "refs/heads/*" ) ; grant ( "submit" , project , "refs/for/refs/heads/*" ) ; return cloneProject ( project ) ; }