auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public java.util.Map < java.lang.String , java.util.Set < java.lang.String > > getIssueIds ( java.lang.String projectName , java.lang.String commitId ) { java.util.Map < java.lang.String , java.util.Set < java.lang.String > > ret = com.google.common.collect.Maps.newHashMap ( ) ; java.lang.String commitMessage = commitMessageFetcher.fetchGuarded ( projectName , commitId ) ; for ( java.lang.String issue : getIssueIds ( commitMessage ) ) { addIssueOccurrence ( issue , ret , "somewhere" ) ; } return ret ; }

Target:
private void addIssuesOccurrence ( java.lang.String text , java.lang.String occurrence , java.util.Map < java.lang.String , java.util.Set < java.lang.String > > map ) { for ( java.lang.String issue : getIssueIds ( text ) ) { java.util.Set < java.lang.String > occurrences = map.get ( issue ) ; if ( occurrences == null ) { occurrences = com.google.common.collect.Sets.newLinkedHashSet ( ) ; map.put ( issue , occurrences ) ; } occurrences.add ( occurrence ) ; } }
Source:
public void onSuccess ( com.google.gerrit.client.changes.CommentInfo result ) { done.setEnabled ( true ) ; setOpen ( false ) ; com.google.gerrit.client.diff.DraftBox box = getDiffScreen ( ) . addDraftBox ( result , getSide ( ) ) ; registerReplyBox ( box ) ; if ( ! ( getCommentInfo ( ) . has_line ( ) ) ) { getDiffScreen ( ) . addFileCommentBox ( box ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.changes.CommentInfo result ) { done.setEnabled ( true ) ; setOpen ( false ) ; com.google.gerrit.client.diff.DraftBox box = getCommentManager ( ) . addDraftBox ( result , getCm ( ) . side ( ) ) ; registerReplyBox ( box ) ; if ( ! ( getCommentInfo ( ) . has_line ( ) ) ) { getCommentManager ( ) . addFileCommentBox ( box ) ; } }
Source:
public java.util.Optional < com.google.gerrit.extensions.restapi.BinaryResult > getFile ( java.lang.String filePath ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.change.ChangeEditResource changeEditResource = getChangeEditResource ( filePath ) ; com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.restapi.BinaryResult > fileResponse = changeEditsGet.apply ( changeEditResource ) ; return fileResponse.isNone ( ) ? java.util.Optional.empty ( ) : java.util.Optional.of ( fileResponse.value ( ) ) ; } catch ( java.io.IOException | com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve file of change edit" , e ) ; } }

Target:
public java.util.Optional < com.google.gerrit.extensions.restapi.BinaryResult > getFile ( java.lang.String filePath ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.change.ChangeEditResource changeEditResource = getChangeEditResource ( filePath ) ; com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.restapi.BinaryResult > fileResponse = changeEditsGet.apply ( changeEditResource ) ; return fileResponse.isNone ( ) ? java.util.Optional.empty ( ) : java.util.Optional.of ( fileResponse.value ( ) ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot retrieve file of change edit" , e ) ; } }
Source:
public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { addMemberBox.setEnabled ( true ) ; addMemberBox.setText ( "" ) ; Util.DETAIL_SVC.changeDetail ( changeId , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.data.ChangeDetail > ( ) { public void onSuccess ( final com.google.gerrit.client.data.ChangeDetail r ) { if ( isAttached ( ) ) { setAccountInfoCache ( r.getAccounts ( ) ) ; display ( r.getChange ( ) , r.getMissingApprovals ( ) , r.getApprovals ( ) ) ; } } } ) ; }

Target:
public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { addMemberBox.setEnabled ( true ) ; addMemberBox.setText ( "" ) ; Util.DETAIL_SVC.changeDetail ( changeId , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.data.ChangeDetail > ( ) { public void onSuccess ( final com.google.gerrit.client.data.ChangeDetail r ) { if ( isAttached ( ) ) { setAccountInfoCache ( r.getAccounts ( ) ) ; display ( r.getChange ( ) , r.getMissingApprovals ( ) , r.getApprovals ( ) ) ; } } } ) ; }
Source:
public java.lang.String getUnitSymbol ( ) { return "B" ; }

Target:
private com.googlesource.gerrit.plugins.quota.Publisher.UsageDataEvent createEvent ( com.google.gerrit.extensions.events.UsageDataPublishedListener.MetaData metaData , com.google.common.cache.Cache < com.google.gerrit.reviewdb.client.Project.NameKey , java.util.concurrent.atomic.AtomicLong > cache ) { com.googlesource.gerrit.plugins.quota.Publisher.UsageDataEvent event = new com.googlesource.gerrit.plugins.quota.Publisher.UsageDataEvent ( metaData ) ; for ( com.google.gerrit.reviewdb.client.Project.NameKey p : projectCache.all ( ) ) { java.util.concurrent.atomic.AtomicLong count = cache.getIfPresent ( p ) ; if ( count != null ) { long currentCount = count.getAndSet ( 0 ) ; if ( currentCount != 0 ) { event.addData ( currentCount , p.get ( ) ) ; } } } return event ; }
Source:
HEAD ( ) { }

Target:
public void throwSQLExceptionIfNotOnline ( ) throws java.lang.Exception { setUpClientMock ( ) ; org.mockito.Mockito.doThrow ( new java.sql.SQLException ( new java.net.ConnectException ( ) ) ) . when ( eventsDb ) . createDBIfNotCreated ( ) ; org.mockito.Mockito.doThrow ( new java.sql.SQLException ( ) ) . when ( eventsDb ) . queryOne ( ) ; store = new com.ericsson.gerrit.plugins.eventslog.sql.SQLStore ( userProviderMock , cfgMock , eventsDb , localEventsDb , poolMock , permissionBackendMock ) ; store.start ( ) ; store.storeEvent ( mockEvent ) ; store.queryChangeEvents ( com.ericsson.gerrit.plugins.eventslog.sql.SQLStoreTest.GENERIC_QUERY ) ; }
Source:
void onOneNodeReplicated ( java.lang.String project , java.lang.String ref , org.eclipse.jgit.transport.URIish uri , com.googlesource.gerrit.plugins.replication.ReplicationState.RefPushResult status ) { }

Target:
void onRefReplicatedToAllNodes ( java.lang.String project , java.lang.String ref , int nodesCount ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( ) ; sb.append ( "Replication of " ) ; sb.append ( project ) ; sb.append ( " ref " ) ; sb.append ( ref ) ; sb.append ( " completed to " ) ; sb.append ( nodesCount ) ; sb.append ( " nodes, " ) ; writeStdOut ( sb.toString ( ) ) ; }
Source:
public com.google.gerrit.server.git.PluginProjectConfig getPluginConfig ( java.lang.String pluginName ) { com.google.common.collect.LinkedListMultimap < java.lang.String , java.lang.String > pluginConfig = pluginConfigs.get ( pluginName ) ; if ( pluginConfig == null ) { pluginConfig = com.google.common.collect.LinkedListMultimap.create ( ) ; pluginConfigs.put ( pluginName , pluginConfig ) ; } return new com.google.gerrit.server.git.PluginProjectConfig ( pluginName , pluginConfig ) ; }

Target:
public com.google.gerrit.server.config.PluginConfig getPluginConfig ( java.lang.String pluginName ) { org.eclipse.jgit.lib.Config pluginConfig = pluginConfigs.get ( pluginName ) ; if ( pluginConfig == null ) { pluginConfig = new org.eclipse.jgit.lib.Config ( ) ; pluginConfigs.put ( pluginName , pluginConfig ) ; } return new com.google.gerrit.server.config.PluginConfig ( pluginName , pluginConfig , this ) ; }
Source:
private void goUpToChange ( boolean openReplyBox ) { java.lang.String b = ( ( base ) != null ) ? java.lang.String.valueOf ( base.get ( ) ) : null ; java.lang.String rev = java.lang.String.valueOf ( revision.get ( ) ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId , rev ) , new com.google.gerrit.client.change.ChangeScreen2 ( changeId , b , rev , openReplyBox ) ) ; }

Target:
public void onSuccess ( java.lang.Void result ) { java.lang.String b = ( ( base ) != null ) ? java.lang.String.valueOf ( base.get ( ) ) : null ; java.lang.String rev = java.lang.String.valueOf ( revision.get ( ) ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId , rev ) , new com.google.gerrit.client.change.ChangeScreen2 ( changeId , b , rev , openReplyBox ) ) ; }
Source:
public boolean canForceEditTopicName ( ) { boolean result = false ; for ( com.google.gerrit.common.data.PermissionRule rule : access ( Permission.EDIT_TOPIC_NAME ) ) { if ( rule.isBlock ( ) ) { return false ; } if ( rule.getForce ( ) ) { result = true ; } } return result ; }

Target:
public boolean canForceEditTopicName ( ) { return canForcePerform ( Permission.EDIT_TOPIC_NAME ) ; }
Source:
private static com.google.gerrit.server.change.ChangeJson.GitPerson toGitPerson ( org.eclipse.jgit.lib.PersonIdent id ) { com.google.gerrit.server.change.ChangeJson.GitPerson p = new com.google.gerrit.server.change.ChangeJson.GitPerson ( ) ; p.name = id.getName ( ) ; p.email = id.getEmailAddress ( ) ; p.date = new java.sql.Timestamp ( id.getWhen ( ) . getTime ( ) ) ; p.tz = id.getTimeZoneOffset ( ) ; return p ; }

Target:
private static com.google.gerrit.extensions.common.GitPerson toGitPerson ( org.eclipse.jgit.lib.PersonIdent id ) { com.google.gerrit.extensions.common.GitPerson p = new com.google.gerrit.extensions.common.GitPerson ( ) ; p.name = id.getName ( ) ; p.email = id.getEmailAddress ( ) ; p.date = new java.sql.Timestamp ( id.getWhen ( ) . getTime ( ) ) ; p.tz = id.getTimeZoneOffset ( ) ; return p ; }
Source:
public com.google.gerrit.extensions.restapi.Response < java.lang.String > apply ( com.google.gerrit.server.account.AccountResource rsrc , com.google.gerrit.server.account.PutName.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException , java.io.IOException { if ( ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) && ( ! ( self.get ( ) . getCapabilities ( ) . canModifyAccount ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "not allowed to change name" ) ; } return apply ( rsrc.getUser ( ) , input ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < java.lang.String > apply ( com.google.gerrit.server.account.AccountResource rsrc , com.google.gerrit.server.account.PutName.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gerrit.server.permissions.PermissionBackendException , com.google.gwtorm.server.OrmException , java.io.IOException { if ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) { permissionBackend.user ( self ) . check ( GlobalPermission.MODIFY_ACCOUNT ) ; } return apply ( rsrc.getUser ( ) , input ) ; }
Source:
public void basicLog ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit commit = repo.branch ( "HEAD" ) . commit ( ) . create ( ) ; repo.getRevWalk ( ) . parseBody ( commit ) ; com.google.gitiles.CommitJsonData.Log log = buildJson ( "/repo/+log" , com.google.gitiles.LogServletTest.LOG , "" ) ; com.google.common.truth.Truth.assertThat ( log.log ) . hasSize ( 1 ) ; verifyJsonCommit ( log.log.get ( 0 ) , commit ) ; com.google.common.truth.Truth.assertThat ( log.log.get ( 0 ) . treeDiff ) . isNull ( ) ; }

Target:
public void basicLog ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit commit = repo.branch ( "HEAD" ) . commit ( ) . create ( ) ; com.google.gitiles.CommitJsonData.Log response = buildJson ( com.google.gitiles.LogServletTest.LOG , "/repo/+log" ) ; com.google.common.truth.Truth.assertThat ( response.log ) . hasSize ( 1 ) ; verifyJsonCommit ( response.log.get ( 0 ) , commit ) ; com.google.common.truth.Truth.assertThat ( response.log.get ( 0 ) . treeDiff ) . isNull ( ) ; }
Source:
public java.lang.Void call ( ) throws java.lang.Exception { try { index.replace ( new com.google.gerrit.server.query.change.ChangeData ( change ) ) ; return null ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.index.ChangeIndexerImpl.log.error ( java.lang.String.format ( "Failed to index change %d in %s" , change.getChangeId ( ) , change.getProject ( ) . get ( ) ) , e ) ; throw e ; } }

Target:
public com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > getReviewDbProvider ( ) { return com.google.inject.util.Providers.of ( db ) ; }
Source:
public void addThenRemove ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key1 = com.google.gerrit.gpg.testutil.TestKeys.key1 ( ) ; store.add ( key1.getPublicKeyRing ( ) ) ; store.remove ( key1.getPublicKey ( ) . getFingerprint ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NO_CHANGE , store.save ( newCommitBuilder ( ) ) ) ; assertKeys ( key1.getKeyId ( ) ) ; }

Target:
public void addThenRemove ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key1 = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithoutExpiration ( ) ; store.add ( key1.getPublicKeyRing ( ) ) ; store.remove ( key1.getPublicKey ( ) . getFingerprint ( ) ) ; org.junit.Assert.assertEquals ( RefUpdate.Result.NO_CHANGE , store.save ( newCommitBuilder ( ) ) ) ; assertKeys ( key1.getKeyId ( ) ) ; }
Source:
private void setClickHandler ( ) { if ( ( headerClick ) == null ) { header.addDomHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { setOpen ( ( ! ( isOpen ( ) ) ) ) ; if ( ( clickCallback ) != null ) { clickCallback.run ( ) ; } } } , com.google.gwt.event.dom.client.ClickEvent.getType ( ) ) ; } }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; headerClick = header.addDomHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { setOpen ( ( ! ( isOpen ( ) ) ) ) ; if ( ( clickCallback ) != null ) { clickCallback.run ( ) ; } } } , com.google.gwt.event.dom.client.ClickEvent.getType ( ) ) ; res.style ( ) . ensureInjected ( ) ; }
Source:
protected void configureServlets ( ) { rpc ( com.google.gerrit.server.rpc.GroupAdminServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.ChangeListServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.SuggestServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.SystemInfoServiceImpl.class ) ; install ( new com.google.gerrit.server.rpc.account.AccountModule ( ) ) ; install ( new com.google.gerrit.server.rpc.changedetail.ChangeModule ( ) ) ; install ( new com.google.gerrit.server.patch.PatchModule ( ) ) ; install ( new com.google.gerrit.server.rpc.project.ProjectModule ( ) ) ; }

Target:
protected void configureServlets ( ) { rpc ( com.google.gerrit.server.rpc.GroupAdminServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.ChangeListServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.SuggestServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.SystemInfoServiceImpl.class ) ; install ( new com.google.gerrit.server.rpc.account.AccountModule ( ) ) ; install ( new com.google.gerrit.server.rpc.changedetail.ChangeModule ( ) ) ; install ( new com.google.gerrit.server.rpc.patch.PatchModule ( ) ) ; install ( new com.google.gerrit.server.rpc.project.ProjectModule ( ) ) ; }
Source:
public void byCommitter ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change1 = newChange ( repo , null , null , userId.get ( ) , null ) . insert ( ) ; assertQuery ( "committer:jcommitter@example.com" , change1 ) ; assertQuery ( "committer:jcommitter" , change1 ) ; assertQuery ( "committer:example" , change1 ) ; assertQuery ( "committer:example.com" , change1 ) ; assertQuery ( "committer:Committer" , change1 ) ; assertQuery ( "committer:jauthor@example.com" ) ; assertQuery ( "committer:somewhere.com" ) ; assertQuery ( "committer:jauthor" ) ; assertQuery ( "committer:Author" ) ; }

Target:
public void byAuthor ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Change change1 = insert ( newChange ( repo , null , null , userId.get ( ) , null ) ) ; assertQuery ( "author:jauthor@example.com" , change1 ) ; assertQuery ( "author:jauthor" , change1 ) ; assertQuery ( "author:example" , change1 ) ; assertQuery ( "author:example.com" , change1 ) ; assertQuery ( "author:Author" , change1 ) ; assertQuery ( "author:jcommitter@example.com" ) ; assertQuery ( "author:somewhere.com" ) ; assertQuery ( "author:jcommitter" ) ; assertQuery ( "author:Committer" ) ; }
Source:
protected org.apache.http.client.HttpClient getClient ( ) { if ( ( client ) == null ) { java.net.URI uri = java.net.URI.create ( url ) ; org.apache.http.impl.client.BasicCredentialsProvider creds = new org.apache.http.impl.client.BasicCredentialsProvider ( ) ; creds.setCredentials ( new org.apache.http.auth.AuthScope ( uri.getHost ( ) , uri.getPort ( ) ) , new org.apache.http.auth.UsernamePasswordCredentials ( account.username , account.httpPassword ) ) ; client = org.apache.http.impl.client.HttpClientBuilder.create ( ) . setDefaultCredentialsProvider ( creds ) . setMaxConnPerRoute ( 10 ) . setMaxConnTotal ( 1024 ) . build ( ) ; } return client ; }

Target:
protected org.apache.http.client.HttpClient getClient ( ) { if ( ( client ) == null ) { java.net.URI uri = java.net.URI.create ( url ) ; org.apache.http.impl.client.BasicCredentialsProvider creds = new org.apache.http.impl.client.BasicCredentialsProvider ( ) ; creds.setCredentials ( new org.apache.http.auth.AuthScope ( uri.getHost ( ) , uri.getPort ( ) ) , new org.apache.http.auth.UsernamePasswordCredentials ( account.username , account.httpPassword ) ) ; client = org.apache.http.impl.client.HttpClientBuilder.create ( ) . setDefaultCredentialsProvider ( creds ) . setMaxConnPerRoute ( 512 ) . setMaxConnTotal ( 1024 ) . build ( ) ; } return client ; }
Source:
public void inheritRead_OverridesAndDeniesOfRef ( ) { 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/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local ) ; assertCanRead ( u ) ; assertCannotRead ( "refs/foobar" , u ) ; assertCannotRead ( "refs/tags/foobar" , u ) ; assertCanRead ( "refs/heads/foobar" , 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 java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > changeDrafts ( com.google.gerrit.server.change.RevisionResource rsrc ) 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 ( db.get ( ) , rsrc.getNotes ( ) , rsrc.getAccountId ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }

Target:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > patchSetDrafts ( 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.draftByPatchSetAuthor ( ctx.getDb ( ) , psId , user.getAccountId ( ) , ctx.getChangeNotes ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { for ( com.google.gerrit.reviewdb.Patch p : detail.getPatches ( ) ) { com.google.gwt.user.client.Window.open ( ( ( ( Window.Location.getPath ( ) ) + "#" ) + ( com.google.gerrit.client.Dispatcher.toPatchSideBySide ( p.getKey ( ) ) ) ) , "_blank" , null ) ; } }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { for ( com.google.gerrit.reviewdb.client.Patch p : detail.getPatches ( ) ) { openWindow ( com.google.gerrit.client.Dispatcher.toPatchUnified ( diffBaseId , p.getKey ( ) ) ) ; } }
Source:
public void testUpsertTwoFirstExistsing ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { stubExecuteBatchOK ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 1 , 0 ) ; java.sql.PreparedStatement insert = stubExecuteBatchOK ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT , 1 ) ; createClassUnderTest ( ) . upsert ( com.google.gwtorm.jdbc.TestJdbcAccess.TWO_ROWS ) ; verifyIds ( insert , 2 ) ; }

Target:
public void testUpsertTwoFirstExisting ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE , 1 , 0 ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT , 1 ) ; createClassUnderTest ( ) . upsert ( twoRows ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( update ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( insert ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertExpectedIdsUsed ( insert , 2 ) ; }
Source:
private void insertChangeRow ( final int row ) { insertRow ( row ) ; setStyleName ( row , com.google.gerrit.client.changes.ChangeTable.C_ID , "gerrit-ChangeTable-ColumnID" ) ; final com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter fmt = table.getFlexCellFormatter ( ) ; for ( int i = com.google.gerrit.client.changes.ChangeTable.C_ID ; i < ( com.google.gerrit.client.changes.ChangeTable.COLUMNS ) ; i ++ ) { fmt.addStyleName ( row , i , "gerrit-ChangeTable-Cell" ) ; } }

Target:
private void insertChangeRow ( final int row ) { insertRow ( row ) ; final com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter fmt = table.getFlexCellFormatter ( ) ; fmt.addStyleName ( row , com.google.gerrit.client.changes.ChangeTable.C_ARROW , com.google.gerrit.client.changes.ChangeTable.S_ICON_CELL ) ; fmt.addStyleName ( row , com.google.gerrit.client.changes.ChangeTable.C_STAR , com.google.gerrit.client.changes.ChangeTable.S_ICON_CELL ) ; for ( int i = com.google.gerrit.client.changes.ChangeTable.C_ID ; i < ( com.google.gerrit.client.changes.ChangeTable.COLUMNS ) ; i ++ ) { fmt.addStyleName ( row , i , com.google.gerrit.client.changes.ChangeTable.S_DATA_CELL ) ; } fmt.addStyleName ( row , com.google.gerrit.client.changes.ChangeTable.C_ID , com.google.gerrit.client.changes.ChangeTable.S_C_ID ) ; }
Source:
public void delete ( java.lang.Iterable < T > instances ) throws com.google.gwtorm.client.OrmException { for ( T oldObj : instances ) { db.delete ( dataRowKey ( com.google.gwtorm.nosql.generic.GenericAccess.primaryKey ( oldObj ) ) ) ; pruneOldIndexes ( oldObj , null ) ; } maybeFlush ( ) ; }

Target:
public void delete ( java.lang.Iterable < T > instances ) throws com.google.gwtorm.client.OrmException { for ( T oldObj : instances ) { db.delete ( dataRowKey ( com.google.gwtorm.nosql.generic.GenericAccess.primaryKey ( oldObj ) ) ) ; pruneOldIndexes ( oldObj , null ) ; cache ( ) . remove ( com.google.gwtorm.nosql.generic.GenericAccess.primaryKey ( oldObj ) ) ; } maybeFlush ( ) ; }
Source:
public java.lang.String [ ] getList ( java.lang.String section , java.lang.String subsection , java.lang.String name ) { return java.util.Arrays.stream ( sec.getStringList ( section , subsection , name ) ) . map ( codec :: decode ) . toArray ( java.lang.String [ ] :: new ) ; }

Target:
public java.lang.String [ ] getList ( java.lang.String section , java.lang.String subsection , java.lang.String name ) { return com.google.common.collect.FluentIterable.from ( java.util.Arrays.asList ( sec.getStringList ( section , subsection , name ) ) ) . transform ( codec.decodeFun ) . toArray ( java.lang.String.class ) ; }
Source:
private com.google.gerrit.server.change.PostReviewers.Addition putAccount ( java.lang.String reviewer , com.google.gerrit.server.change.ReviewerResource rsrc , com.google.gerrit.extensions.client.ReviewerState state ) { com.google.gerrit.reviewdb.client.Account member = rsrc.getReviewerUser ( ) . getAccount ( ) ; com.google.gerrit.server.project.ChangeControl control = rsrc.getReviewerControl ( ) ; if ( isValidReviewer ( member , control ) ) { return new com.google.gerrit.server.change.PostReviewers.Addition ( reviewer , rsrc.getChangeResource ( ) , com.google.common.collect.ImmutableMap.of ( member.getId ( ) , control ) , state ) ; } return new com.google.gerrit.server.change.PostReviewers.Addition ( reviewer ) ; }

Target:
private com.google.gerrit.server.change.PostReviewers.Addition putAccount ( java.lang.String reviewer , com.google.gerrit.server.change.ReviewerResource rsrc , com.google.gerrit.extensions.client.ReviewerState state ) throws com.google.gerrit.extensions.restapi.UnprocessableEntityException { com.google.gerrit.reviewdb.client.Account member = rsrc.getReviewerUser ( ) . getAccount ( ) ; com.google.gerrit.server.project.ChangeControl control = rsrc.getReviewerControl ( ) ; if ( isValidReviewer ( member , control ) ) { return new com.google.gerrit.server.change.PostReviewers.Addition ( reviewer , rsrc.getChangeResource ( ) , com.google.common.collect.ImmutableMap.of ( member.getId ( ) , control ) , state ) ; } throw new com.google.gerrit.extensions.restapi.UnprocessableEntityException ( ( "Change not visible to " + reviewer ) ) ; }
Source:
private com.google.gerrit.server.project.ProjectState toProjectState ( com.google.gson.JsonElement json ) { com.google.gson.JsonElement source = json.getAsJsonObject ( ) . get ( "_source" ) ; if ( source == null ) { source = json.getAsJsonObject ( ) . get ( "fields" ) ; } com.google.gerrit.reviewdb.client.Project.NameKey nameKey = new com.google.gerrit.reviewdb.client.Project.NameKey ( source.getAsJsonObject ( ) . get ( ProjectField.NAME.getName ( ) ) . getAsString ( ) ) ; return projectCache.get ( ) . get ( nameKey ) ; }

Target:
private com.google.gerrit.server.project.ProjectData toProjectData ( com.google.gson.JsonElement json ) { com.google.gson.JsonElement source = json.getAsJsonObject ( ) . get ( "_source" ) ; if ( source == null ) { source = json.getAsJsonObject ( ) . get ( "fields" ) ; } com.google.gerrit.reviewdb.client.Project.NameKey nameKey = new com.google.gerrit.reviewdb.client.Project.NameKey ( source.getAsJsonObject ( ) . get ( ProjectField.NAME.getName ( ) ) . getAsString ( ) ) ; return projectCache.get ( ) . get ( nameKey ) . toProjectData ( ) ; }
Source:
private void setDefaultBlameCache ( ) { if ( ( blameCache ) == null ) { if ( config.getSubsections ( "cache" ) . contains ( "blame" ) ) { blameCache = new com.google.gitiles.BlameCacheImpl ( com.google.gitiles.ConfigUtil.getCacheBuilder ( com.google.gitiles.BlameCacheImpl.newBuilder ( ) , config , "blame" ) ) ; } else { blameCache = new com.google.gitiles.BlameCacheImpl ( ) ; } } }

Target:
private void setDefaultBlameCache ( ) { if ( ( blameCache ) == null ) { if ( config.getSubsections ( "cache" ) . contains ( "blame" ) ) { blameCache = new com.google.gitiles.blame.BlameCacheImpl ( com.google.gitiles.ConfigUtil.getCacheBuilder ( com.google.gitiles.blame.BlameCacheImpl.newBuilder ( ) , config , "blame" ) ) ; } else { blameCache = new com.google.gitiles.blame.BlameCacheImpl ( ) ; } } }
Source:
javax.naming.directory.DirContext open ( ) throws javax.naming.NamingException { final java.util.Properties env = createContextProperties ( ) ; if ( ( username ) != null ) { env.put ( javax.naming.Context.SECURITY_AUTHENTICATION , "simple" ) ; env.put ( javax.naming.Context.SECURITY_PRINCIPAL , username ) ; env.put ( javax.naming.Context.SECURITY_CREDENTIALS , ( ( password ) != null ? password : "" ) ) ; } return new javax.naming.directory.InitialDirContext ( env ) ; }

Target:
javax.naming.directory.DirContext open ( ) throws javax.naming.NamingException { final java.util.Properties env = createContextProperties ( ) ; if ( ( username ) != null ) { env.put ( javax.naming.Context.SECURITY_AUTHENTICATION , "simple" ) ; env.put ( javax.naming.Context.SECURITY_PRINCIPAL , username ) ; env.put ( javax.naming.Context.SECURITY_CREDENTIALS , ( ( password ) != null ? password : "" ) ) ; env.put ( javax.naming.Context.REFERRAL , ( ( referral ) != null ? referral : "ignore" ) ) ; } return new javax.naming.directory.InitialDirContext ( env ) ; }
Source:
public static synchronized void setClockStep ( long clockStep , java.util.concurrent.TimeUnit clockStepUnit ) { com.google.common.base.Preconditions.checkState ( ( ( com.google.gerrit.testutil.TestTimeUtil.clockMs ) != null ) , "call resetWithClockStep first" ) ; com.google.gerrit.testutil.TestTimeUtil.clockStepMs = java.util.concurrent.TimeUnit.MILLISECONDS.convert ( clockStep , clockStepUnit ) ; org.joda.time.DateTimeUtils.setCurrentMillisProvider ( new org.joda.time.DateTimeUtils.MillisProvider ( ) { @ java.lang.Override public long getMillis ( ) { return com.google.gerrit.testutil.TestTimeUtil.clockMs.getAndAdd ( com.google.gerrit.testutil.TestTimeUtil.clockStepMs ) ; } } ) ; }

Target:
public java.lang.String getProperty ( java.lang.String key ) { return defaultReader.getProperty ( key ) ; }
Source:
public boolean isValid ( final com.google.gerrit.server.CurrentUser user , final com.google.gerrit.common.data.ApprovalType at , final com.google.gerrit.server.workflow.FunctionState state ) { if ( com.google.gerrit.server.workflow.SubmitFunction.valid ( at , state ) ) { for ( final com.google.gerrit.reviewdb.ProjectRight pr : state.getAllRights ( at ) ) { if ( ( user.getEffectiveGroups ( ) . contains ( pr.getAccountGroupId ( ) ) ) && ( ( pr.getMaxValue ( ) ) > 0 ) ) { return true ; } } } return false ; }

Target:
public boolean isValid ( final com.google.gerrit.server.CurrentUser user , final com.google.gerrit.common.data.ApprovalType at , final com.google.gerrit.server.workflow.FunctionState state ) { if ( com.google.gerrit.server.workflow.SubmitFunction.valid ( at , state ) ) { for ( final com.google.gerrit.reviewdb.RefRight pr : state.getAllRights ( at ) ) { if ( ( user.getEffectiveGroups ( ) . contains ( pr.getAccountGroupId ( ) ) ) && ( ( pr.getMaxValue ( ) ) > 0 ) ) { return true ; } } } return false ; }
Source:
public void onRevisionCreated ( com.google.gerrit.extensions.events.RevisionCreatedListener.Event event ) { com.google.gerrit.extensions.common.ChangeInfo change = event.getChange ( ) ; try { automergeChanges ( change , event.getRevision ( ) ) ; } catch ( com.google.gerrit.extensions.restapi.RestApiException | java.io.IOException | org.eclipse.jgit.errors.ConfigInvalidException | com.googlesource.gerrit.plugins.automerger.InvalidQueryParameterException e ) { com.googlesource.gerrit.plugins.automerger.DownstreamCreator.log.error ( "Automerger plugin failed onRevisionCreated for {}" , change.id , e ) ; } }

Target:
public void onRevisionCreated ( com.google.gerrit.extensions.events.RevisionCreatedListener.Event event ) { try ( com.google.gerrit.server.util.ManualRequestContext ctx = oneOffRequestContext.openAs ( config.getContextUserId ( ) ) ) { com.google.gerrit.extensions.common.ChangeInfo change = event.getChange ( ) ; automergeChanges ( change , event.getRevision ( ) ) ; } catch ( com.google.gerrit.extensions.restapi.RestApiException | java.io.IOException | org.eclipse.jgit.errors.ConfigInvalidException | com.googlesource.gerrit.plugins.automerger.InvalidQueryParameterException | com.google.gwtorm.server.OrmException e ) { com.googlesource.gerrit.plugins.automerger.DownstreamCreator.log.error ( "Automerger plugin failed onRevisionCreated for {}" , event.getChange ( ) . id , e ) ; } }
Source:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.DeleteChangeEdit.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editUtil.byChange ( rsrc.getChange ( ) ) ; if ( edit.isPresent ( ) ) { editUtil.delete ( edit.get ( ) ) ; } else { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } return com.google.gerrit.extensions.restapi.Response.none ( ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.change.ChangeResource rsrc , com.google.gerrit.server.change.DeleteChangeEdit.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException , java.io.IOException { java.util.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editUtil.byChange ( rsrc.getChange ( ) ) ; if ( edit.isPresent ( ) ) { editUtil.delete ( edit.get ( ) ) ; } else { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } return com.google.gerrit.extensions.restapi.Response.none ( ) ; }
Source:
private java.lang.String getSerializerQualifiedName ( ) { final java.lang.String [ ] name ; name = com.google.gwtjsonrpc.rebind.ProxyCreator.synthesizeTopLevelClassName ( targetType , com.google.gwtjsonrpc.rebind.SerializerCreator.SER_SUFFIX ) ; return ( name [ 0 ] . length ( ) ) == 0 ? name [ 1 ] : ( ( name [ 0 ] ) + "." ) + ( name [ 1 ] ) ; }

Target:
private java.lang.String getSerializerQualifiedName ( final com.google.gwt.core.ext.typeinfo.JClassType targetType ) { final java.lang.String [ ] name ; name = com.google.gwtjsonrpc.rebind.ProxyCreator.synthesizeTopLevelClassName ( targetType , com.google.gwtjsonrpc.rebind.SerializerCreator.SER_SUFFIX ) ; return ( name [ 0 ] . length ( ) ) == 0 ? name [ 1 ] : ( ( name [ 0 ] ) + "." ) + ( name [ 1 ] ) ; }
Source:
protected void onUnload ( ) { super . onUnload ( ) ; if ( ( cm ) != null ) { cm.getWrapperElement ( ) . removeFromParent ( ) ; } if ( ( resizeHandler ) != null ) { resizeHandler.removeHandler ( ) ; } com.google.gwt.user.client.Window.enableScrolling ( true ) ; com.google.gerrit.client.Gerrit.setHeaderVisible ( true ) ; com.google.gerrit.client.JumpKeys.enable ( true ) ; }

Target:
protected void onUnload ( ) { super . onUnload ( ) ; if ( ( cm ) != null ) { cm.getWrapperElement ( ) . removeFromParent ( ) ; } if ( ( resizeHandler ) != null ) { resizeHandler.removeHandler ( ) ; } if ( ( closeHandler ) != null ) { closeHandler.removeHandler ( ) ; } com.google.gwt.user.client.Window.enableScrolling ( true ) ; com.google.gerrit.client.Gerrit.setHeaderVisible ( true ) ; com.google.gerrit.client.JumpKeys.enable ( true ) ; }
Source:
public void testNonIndexPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "foo:a OR foo:b" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.query.change.AndSource.class ) . isSameAs ( out.getClass ( ) ) ; com.google.common.truth.Truth.assertThat ( out.getChildren ( ) ) . containsExactly ( query ( com.google.gerrit.server.query.change.ChangeStatusPredicate.open ( ) ) , in ) . inOrder ( ) ; }

Target:
public void testNonIndexPredicates ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "foo:a OR foo:b" ) ; com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > out = rewrite ( in ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.query.change.AndChangeSource.class ) . isSameAs ( out.getClass ( ) ) ; com.google.common.truth.Truth.assertThat ( out.getChildren ( ) ) . containsExactly ( query ( com.google.gerrit.server.query.change.ChangeStatusPredicate.open ( ) ) , in ) . inOrder ( ) ; }
Source:
public com.google.gerrit.server.plugins.InstallPlugin create ( com.google.gerrit.extensions.restapi.TopLevelResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gerrit.extensions.restapi.ResourceNotFoundException { if ( ! ( loader.isRemoteAdminEnabled ( ) ) ) { throw new com.google.gerrit.extensions.restapi.MethodNotAllowedException ( "remote installation is disabled" ) ; } return install.get ( ) . setName ( id.get ( ) ) . setCreated ( true ) ; }

Target:
public com.google.gerrit.server.plugins.InstallPlugin create ( com.google.gerrit.extensions.restapi.TopLevelResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.RestApiException { loader.checkRemoteAdminEnabled ( ) ; return install.get ( ) . setName ( id.get ( ) ) . setCreated ( true ) ; }
Source:
public com.google.gerrit.reviewdb.client.Change reloadChange ( ) throws com.google.gwtorm.server.OrmException { if ( ( project ) == null ) { notes = notesFactory.createFromIdOnlyWhenNoteDbDisabled ( db , legacyId ) ; } else { notes = notesFactory.create ( db , project , legacyId ) ; } change = notes.getChange ( ) ; if ( ( change ) == null ) { throw new com.google.gwtorm.server.OrmException ( ( "Unable to load change " + ( legacyId ) ) ) ; } return change ; }

Target:
public com.google.gerrit.reviewdb.client.Change reloadChange ( ) throws com.google.gwtorm.server.OrmException { if ( ( project ) == null ) { notes = notesFactory.createFromIdOnlyWhenNoteDbDisabled ( db , legacyId ) ; } else { notes = notesFactory.create ( db , project , legacyId ) ; } change = notes.getChange ( ) ; if ( ( change ) == null ) { throw new com.google.gwtorm.server.OrmException ( ( "Unable to load change " + ( legacyId ) ) ) ; } setPatchSets ( null ) ; return change ; }
Source:
static byte [ ] toByteArray ( com.google.gerrit.reviewdb.client.Project.NameKey project , org.eclipse.jgit.lib.Ref ref ) { return com.google.gerrit.server.index.change.StalenessChecker.RefState.toByteArray ( project , ref.getName ( ) , ref.getObjectId ( ) ) ; }

Target:
private boolean match ( org.eclipse.jgit.lib.Repository repo ) throws java.io.IOException { org.eclipse.jgit.lib.Ref ref = repo.exactRef ( ref ( ) ) ; org.eclipse.jgit.lib.ObjectId expected = ( ref != null ) ? ref.getObjectId ( ) : org.eclipse.jgit.lib.ObjectId.zeroId ( ) ; return id ( ) . equals ( expected ) ; }
Source:
void addLabel ( final java.lang.String token ) throws org.kohsuke.args4j.CmdLineException { com.google.gerrit.server.util.LabelVote v = com.google.gerrit.server.util.LabelVote.parse ( token ) ; try { com.google.gerrit.common.data.LabelType.checkName ( v.label ( ) ) ; com.google.gerrit.server.ApprovalsUtil.checkLabel ( labelTypes , v.label ( ) , v.value ( ) ) ; } catch ( java.lang.IllegalArgumentException e ) { throw clp.reject ( e.getMessage ( ) ) ; } labels.put ( v.label ( ) , v.value ( ) ) ; }

Target:
void addMessage ( final java.lang.String token ) { message = token.replace ( "_" , " " ) ; }
Source:
public boolean isVisibleToAll ( ) { return group.isVisibleToAll ( ) ; }

Target:
public static GroupDescription.Internal forAccountGroup ( final com.google.gerrit.reviewdb.client.AccountGroup group ) { return new com.google.gerrit.common.data.GroupDescription.Internal ( ) { @ java.lang.Override public AccountGroup.UUID getGroupUUID ( ) { return group.getGroupUUID ( ) ; } @ java.lang.Override public java.lang.String getName ( ) { return group.getName ( ) ; } @ java.lang.Override public com.google.gerrit.reviewdb.client.AccountGroup getAccountGroup ( ) { return group ; } @ java.lang.Override @ javax.annotation.Nullable public java.lang.String getEmailAddress ( ) { return null ; } @ java.lang.Override @ javax.annotation.Nullable public java.lang.String getUrl ( ) { return "#" + ( com.google.gerrit.common.PageLinks.toGroup ( getGroupUUID ( ) ) ) ; } } ; }
Source:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.reviewdb.client.PatchSetApproval p : object.approvals ( ) . values ( ) ) { if ( id.equals ( p.getAccountId ( ) ) ) { return true ; } } return false ; }

Target:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.reviewdb.client.Account.Id accountId : object.reviewers ( ) . values ( ) ) { if ( id.equals ( accountId ) ) { return true ; } } return false ; }
Source:
private void deleteProject ( org.eclipse.jgit.transport.URIish replicateURI ) { if ( ! ( replicateURI.isRemote ( ) ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.deleteLocally ( replicateURI ) ; } else if ( com.googlesource.gerrit.plugins.replication.ReplicationQueue.isSSH ( replicateURI ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.deleteRemoteSsh ( replicateURI ) ; } else { com.googlesource.gerrit.plugins.replication.ReplicationQueue.log.warn ( java.lang.String.format ( ( "Cannot delete project on remote site %s." + ( " Only local paths and SSH URLs are supported" + " for remote repository deletion" ) ) , replicateURI ) ) ; } }

Target:
private void deleteProject ( org.eclipse.jgit.transport.URIish replicateURI ) { if ( ! ( replicateURI.isRemote ( ) ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.deleteLocally ( replicateURI ) ; com.googlesource.gerrit.plugins.replication.ReplicationQueue.log.info ( ( "Deleted local repository: " + replicateURI ) ) ; } else if ( com.googlesource.gerrit.plugins.replication.ReplicationQueue.isSSH ( replicateURI ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.deleteRemoteSsh ( replicateURI ) ; com.googlesource.gerrit.plugins.replication.ReplicationQueue.log.info ( ( "Deleted remote repository: " + replicateURI ) ) ; } else { com.googlesource.gerrit.plugins.replication.ReplicationQueue.log.warn ( java.lang.String.format ( ( "Cannot delete project on remote site %s." + ( " Only local paths and SSH URLs are supported" + " for remote repository deletion" ) ) , replicateURI ) ) ; } }
Source:
private void removeRunAs ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; com.google.gerrit.server.project.Util.remove ( cfg , GlobalCapability.RUN_AS , systemGroupBackend.getGroup ( com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS ) . getUUID ( ) ) ; saveProjectConfig ( allProjects , cfg ) ; }

Target:
private void allowRunAs ( ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( allProjects ) . getConfig ( ) ; com.google.gerrit.server.project.testing.Util.allow ( cfg , GlobalCapability.RUN_AS , systemGroupBackend.getGroup ( com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS ) . getUUID ( ) ) ; saveProjectConfig ( allProjects , cfg ) ; }
Source:
private org.eclipse.jgit.revwalk.RevCommit makeCommit ( ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException , org.eclipse.jgit.api.errors.NoFilepatternException { java.util.Map < java.io.File , byte [ ] > files = new java.util.HashMap < > ( ) ; java.lang.String content = "http://foo.bar.tld/?pw=myp4ssw0rdTefoobarstline2\n" ; files.put ( new java.io.File ( repo.getDirectory ( ) . getParent ( ) , "foo.txt" ) , content.getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ; content = "$Id$\n" + ( ( ( "$Header$\n" + "$Author$\n" ) + "processXFile($File::Find::name, $Config{$type});\n" ) + "$Id: foo bar$\n" ) ; files.put ( new java.io.File ( repo.getDirectory ( ) . getParent ( ) , "bar.txt" ) , content.getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ; content = "Testline1\n" + ( ( "Testline2\n" + "Testline3\n" ) + "Testline4" ) ; files.put ( new java.io.File ( repo.getDirectory ( ) . getParent ( ) , "foobar.txt" ) , content.getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ; return com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.makeCommit ( repo , "Commit with test files." , files ) ; }

Target:
private org.eclipse.jgit.revwalk.RevCommit makeCommit ( ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.util.Map < java.io.File , byte [ ] > files = new java.util.HashMap < > ( ) ; java.lang.String content = "http://foo.bar.tld/?pw=myp4ssw0rdTefoobarstline2\n" ; files.put ( new java.io.File ( repo.getDirectory ( ) . getParent ( ) , "foo.txt" ) , content.getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ; content = "$Id$\n" + ( ( ( "$Header$\n" + "$Author$\n" ) + "processXFile($File::Find::name, $Config{$type});\n" ) + "$Id: foo bar$\n" ) ; files.put ( new java.io.File ( repo.getDirectory ( ) . getParent ( ) , "bar.txt" ) , content.getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ; content = "Testline1\n" + ( ( "Testline2\n" + "Testline3\n" ) + "Testline4" ) ; files.put ( new java.io.File ( repo.getDirectory ( ) . getParent ( ) , "foobar.txt" ) , content.getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ; return com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.makeCommit ( repo , "Commit foobar with test files." , files ) ; }
Source:
public void unstarChange ( java.lang.String id ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.change.ChangeResource rsrc = changes.parse ( TopLevelResource.INSTANCE , com.google.gerrit.extensions.restapi.IdString.fromUrl ( id ) ) ; com.google.gerrit.server.account.AccountResource.StarredChange starredChange = new com.google.gerrit.server.account.AccountResource.StarredChange ( account.getUser ( ) , rsrc ) ; starredChangesDelete.apply ( starredChange , new com.google.gerrit.server.account.StarredChanges.EmptyInput ( ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot unstar change" , e ) ; } }

Target:
public void starChange ( java.lang.String changeId ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.change.ChangeResource rsrc = changes.parse ( TopLevelResource.INSTANCE , com.google.gerrit.extensions.restapi.IdString.fromUrl ( changeId ) ) ; starredChangesCreate.setChange ( rsrc ) ; starredChangesCreate.apply ( account , new com.google.gerrit.server.account.StarredChanges.EmptyInput ( ) ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot star change" , e ) ; } }