auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private GitilesView.Builder parseNoCommand ( javax.servlet.http.HttpServletRequest req , java.lang.String repoName ) { if ( ( req.getAttribute ( org.eclipse.jgit.http.server.ServletUtils.ATTRIBUTE_REPOSITORY ) ) == null ) { return com.google.gitiles.GitilesView.hostIndex ( ) . setRepositoryPrefix ( repoName ) ; } return com.google.gitiles.GitilesView.repositoryIndex ( ) . setRepositoryName ( repoName ) ; }

Target:
private static boolean hasRepository ( javax.servlet.http.HttpServletRequest req ) { return ( req.getAttribute ( org.eclipse.jgit.http.server.ServletUtils.ATTRIBUTE_REPOSITORY ) ) != null ; }
Source:
public java.lang.String toString ( ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( ) ; if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( output ) ) ) { sb.append ( output ) ; if ( ( executionError ) != null ) { sb.append ( " - " ) ; } } if ( ( executionError ) != null ) { sb.append ( executionError ) ; } return sb.toString ( ) ; }

Target:
public java.lang.String toString ( ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( ) ; if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( output ) ) ) { sb.append ( output ) ; if ( ( executionError ) != null ) { sb.append ( " - " ) ; } } if ( ( executionError ) != null ) { sb.append ( executionError ) ; } return sb.toString ( ) . trim ( ) ; }
Source:
public java.util.Map < java.lang.String , com.google.gitiles.RepositoryDescription > listRepositories ( java.util.Set < java.lang.String > branches ) { throw new java.lang.UnsupportedOperationException ( ) ; }

Target:
public java.util.Map < java.lang.String , com.google.gitiles.RepositoryDescription > listRepositories ( java.util.Set < java.lang.String > branches ) { if ( ( branches != null ) && ( ! ( branches.isEmpty ( ) ) ) ) { throw new java.lang.UnsupportedOperationException ( "branches set not yet supported" ) ; } com.google.gitiles.RepositoryDescription desc = new com.google.gitiles.RepositoryDescription ( ) ; desc.name = repo.getDescription ( ) . getRepositoryName ( ) ; desc.cloneUrl = ( ( TestGitilesUrls.URLS.getBaseGitUrl ( req ) ) + "/" ) + ( desc.name ) ; return com.google.common.collect.ImmutableMap.of ( desc.name , desc ) ; }
Source:
public void testRejectJavaScript_AnchorHref ( ) { final java.lang.String href = "javascript:window.close();" ; try { new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) . openAnchor ( ) . setAttribute ( "href" , href ) ; fail ( "accepted javascript in a href" ) ; } catch ( java.lang.RuntimeException e ) { assertEquals ( ( "javascript unsafe in href: " + href ) , e.getMessage ( ) ) ; } }

Target:
public void testRejectJavaScript_FormAction ( ) { final java.lang.String href = "javascript:window.close();" ; try { new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) . openElement ( "form" ) . setAttribute ( "action" , href ) ; org.junit.Assert.fail ( "accepted javascript in form action" ) ; } catch ( java.lang.RuntimeException e ) { org.junit.Assert.assertEquals ( ( "javascript unsafe in href: " + href ) , e.getMessage ( ) ) ; } }
Source:
public void run ( ) { java.lang.String mode = ( ( m != null ) && ( ! ( m.isEmpty ( ) ) ) ) ? m : null ; view.getCmFromSide ( DisplaySide.A ) . setOption ( "mode" , mode ) ; view.getCmFromSide ( DisplaySide.B ) . setOption ( "mode" , mode ) ; }

Target:
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 ( ) ; } }
Source:
private static com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy toEmailStrategy ( java.lang.String v ) { if ( v == null ) { return com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED ; } return com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.valueOf ( v ) ; }

Target:
private static com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy toEmailStrategy ( java.lang.String v , boolean emailStrategyColumnExists ) throws com.google.gwtorm.server.OrmException { if ( v == null ) { return com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED ; } if ( emailStrategyColumnExists ) { return com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.valueOf ( v ) ; } else { if ( v.equals ( "N" ) ) { return com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.ENABLED ; } else if ( v.equals ( "Y" ) ) { return com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS ; } else { throw new com.google.gwtorm.server.OrmException ( ( "invalid value in accounts.copy_self_on_email: " + v ) ) ; } } }
Source:
public void onSuccess ( com.googlesource.gerrit.plugins.labelui.client.PreferencesInfo result ) { com.googlesource.gerrit.plugins.labelui.client.LabelUIPlugin.refreshDefaultLabelUi ( result.ui ( ) ) ; com.google.gerrit.client.info.ChangeInfo change = panel.getObject ( GerritUiExtensionPoint.Key.CHANGE_INFO ) . cast ( ) ; switch ( result.ui ( ) ) { case USER_LABEL_TABLE : displayUserLabelTable ( change ) ; break ; case DEFAULT : default : return ; } }

Target:
public void onSuccess ( com.googlesource.gerrit.plugins.labelui.client.PreferencesInfo result ) { com.googlesource.gerrit.plugins.labelui.client.LabelUIPlugin.refreshDefaultLabelUi ( result.ui ( ) ) ; com.google.gerrit.client.info.ChangeInfo change = panel.getObject ( GerritUiExtensionPoint.Key.CHANGE_INFO ) . cast ( ) ; switch ( result.ui ( ) ) { case LABEL_USER_TABLE : displayLabelUserTable ( change ) ; break ; case USER_LABEL_TABLE : displayUserLabelTable ( change ) ; break ; case DEFAULT : default : return ; } }
Source:
private com.google.gerrit.reviewdb.client.Change insertChange ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( project , adminId ) ; db.changes ( ) . insert ( java.util.Collections.singleton ( c ) ) ; return c ; }

Target:
private com.google.gerrit.reviewdb.client.Change insertChange ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( project , adminId ) ; db.changes ( ) . insert ( java.util.Collections.singleton ( c ) ) ; com.google.gerrit.server.notedb.ChangeUpdate u = changeUpdateFactory.create ( changeControlFactory.controlFor ( c , userFactory.create ( adminId ) ) ) ; u.setBranch ( c.getDest ( ) . get ( ) ) ; u.commit ( ) ; return c ; }
Source:
public void getDraft ( ) throws java.lang.Exception { for ( java.lang.Integer line : lines ) { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; java.lang.String changeId = r.getChangeId ( ) ; java.lang.String revId = r.getCommit ( ) . getName ( ) ; com.google.gerrit.extensions.api.changes.ReviewInput.CommentInput comment = newCommentInfo ( "file1" , Side.REVISION , line , "comment 1" ) ; com.google.gerrit.extensions.common.CommentInfo returned = addDraft ( changeId , revId , comment ) ; com.google.gerrit.extensions.common.CommentInfo actual = getDraftComment ( changeId , revId , returned.id ) ; com.google.gerrit.acceptance.server.change.CommentsIT.assertCommentInfo ( comment , actual ) ; } }

Target:
public void getDraft ( ) throws java.lang.Exception { for ( java.lang.Integer line : lines ) { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; java.lang.String changeId = r.getChangeId ( ) ; java.lang.String revId = r.getCommit ( ) . getName ( ) ; com.google.gerrit.extensions.api.changes.DraftInput comment = newDraft ( "file1" , Side.REVISION , line , "comment 1" ) ; com.google.gerrit.extensions.common.CommentInfo returned = addDraft ( changeId , revId , comment ) ; com.google.gerrit.extensions.common.CommentInfo actual = getDraftComment ( changeId , revId , returned.id ) ; com.google.gerrit.acceptance.server.change.CommentsIT.assertCommentInfo ( comment , actual ) ; } }
Source:
public void abandonWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; abandon ( sc.changeId , sc.owner ) ; assertThat ( sender ) . sent ( "abandon" , sc ) . notTo ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . to ( sc.reviewerByEmail ) . cc ( sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; }

Target:
public void abandonWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; abandon ( sc.changeId , sc.owner ) ; assertThat ( sender ) . notSent ( ) ; }
Source:
private org.apache.lucene.search.Query fullTextQuery ( com.google.gerrit.server.index.IndexPredicate < V > p ) throws com.google.gerrit.server.query.QueryParseException { java.lang.String value = p.getValue ( ) ; if ( value == null ) { throw new com.google.gerrit.server.query.QueryParseException ( "Full-text search over empty string not supported" ) ; } org.apache.lucene.search.Query query = queryBuilder.createPhraseQuery ( p.getField ( ) . getName ( ) , value ) ; if ( query == null ) { throw new com.google.gerrit.server.query.QueryParseException ( ( "Cannot create full-text query with value: " + value ) ) ; } return query ; }

Target:
private org.apache.lucene.search.Query fullTextQuery ( com.google.gerrit.server.index.IndexPredicate < V > p ) throws com.google.gerrit.index.query.QueryParseException { java.lang.String value = p.getValue ( ) ; if ( value == null ) { throw new com.google.gerrit.index.query.QueryParseException ( "Full-text search over empty string not supported" ) ; } org.apache.lucene.search.Query query = queryBuilder.createPhraseQuery ( p.getField ( ) . getName ( ) , value ) ; if ( query == null ) { throw new com.google.gerrit.index.query.QueryParseException ( ( "Cannot create full-text query with value: " + value ) ) ; } return query ; }
Source:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicMap.mapOf ( binder ( ) , com.google.gerrit.extensions.config.CapabilityDefinition.class ) ; bind ( com.google.gerrit.extensions.config.CapabilityDefinition.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.Exports.named ( "printHello" ) ) . toInstance ( new com.google.gerrit.extensions.config.CapabilityDefinition ( ) { @ java.lang.Override public java.lang.String getDescription ( ) { return "Print Hello" ; } } ) ; }

Target:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicMap.mapOf ( binder ( ) , com.google.gerrit.extensions.config.CapabilityDefinition.class ) ; bind ( com.google.gerrit.extensions.config.CapabilityDefinition.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.Exports.named ( "printHello" ) ) . toInstance ( new com.google.gerrit.extensions.config.CapabilityDefinition ( ) { @ java.lang.Override public java.lang.String getDescription ( ) { return "Print Hello" ; } } ) ; bind ( com.google.gerrit.server.permissions.PermissionBackend.class ) . to ( com.google.gerrit.server.config.ListCapabilitiesTest.FakePermissionBackend.class ) ; }
Source:
public void unifiedPatchDetail ( final com.google.gerrit.client.reviewdb.Patch.Key key , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.data.UnifiedPatchDetail > callback ) { run ( callback , new com.google.gerrit.server.patch.UnifiedPatchDetailAction ( key ) ) ; }

Target:
public void unifiedPatchDetail ( final com.google.gerrit.client.reviewdb.Patch.Key key , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.data.UnifiedPatchDetail > callback ) { final com.google.gerrit.git.RepositoryCache rc = server.getRepositoryCache ( ) ; if ( rc == null ) { callback.onFailure ( new java.lang.Exception ( "No Repository Cache configured" ) ) ; return ; } run ( callback , new com.google.gerrit.server.patch.UnifiedPatchDetailAction ( rc , key ) ) ; }
Source:
void loadChangeInfo ( boolean fg , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > cb ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeApi.detail ( changeId.get ( ) ) ; com.google.gerrit.client.changes.ChangeList.addOptions ( call , java.util.EnumSet.of ( ListChangesOption.CHANGE_ACTIONS , ListChangesOption.ALL_REVISIONS ) ) ; if ( ! fg ) { call.background ( ) ; } call.get ( cb ) ; }

Target:
void loadChangeInfo ( boolean fg , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.ChangeInfo > cb ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeApi.detail ( changeId.get ( ) ) ; java.util.EnumSet < com.google.gerrit.extensions.client.ListChangesOption > opts = java.util.EnumSet.of ( ListChangesOption.ALL_REVISIONS , ListChangesOption.CHANGE_ACTIONS ) ; if ( enableSignedPush ( ) ) { opts.add ( ListChangesOption.PUSH_CERTIFICATES ) ; } com.google.gerrit.client.changes.ChangeList.addOptions ( call , opts ) ; if ( ! fg ) { call.background ( ) ; } call.get ( cb ) ; }
Source:
public void allRefsVisibleWithRefsMetaConfig ( ) throws java.lang.Exception { allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/meta/config" ) ; assertRefs ( "HEAD" , ( ( r1 ) + "1" ) , ( ( r1 ) + "meta" ) , ( ( r2 ) + "1" ) , ( ( r2 ) + "meta" ) , "refs/heads/branch" , "refs/heads/master" , "refs/meta/config" , "refs/tags/branch-tag" , "refs/tags/master-tag" ) ; }

Target:
public void allRefsVisibleWithRefsMetaConfig ( ) throws java.lang.Exception { allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , RefNames.REFS_CONFIG ) ; assertRefs ( "HEAD" , ( ( r1 ) + "1" ) , ( ( r1 ) + "meta" ) , ( ( r2 ) + "1" ) , ( ( r2 ) + "meta" ) , "refs/heads/branch" , "refs/heads/master" , RefNames.REFS_CONFIG , "refs/tags/branch-tag" , "refs/tags/master-tag" ) ; }
Source:
protected void assertApproved ( java.lang.String changeId ) throws java.io.IOException { com.google.gerrit.server.change.ChangeJson.ChangeInfo c = getChange ( changeId , com.google.gerrit.extensions.common.ListChangesOption.DETAILED_LABELS ) ; com.google.gerrit.server.change.ChangeJson.LabelInfo cr = c.labels.get ( "Code-Review" ) ; org.junit.Assert.assertEquals ( 1 , cr.all.size ( ) ) ; org.junit.Assert.assertEquals ( 2 , cr.all.get ( 0 ) . value.intValue ( ) ) ; org.junit.Assert.assertEquals ( "Administrator" , cr.all.get ( 0 ) . name ) ; }

Target:
protected void assertApproved ( java.lang.String changeId ) throws java.io.IOException { com.google.gerrit.extensions.common.ChangeInfo c = getChange ( changeId , com.google.gerrit.extensions.common.ListChangesOption.DETAILED_LABELS ) ; com.google.gerrit.extensions.common.LabelInfo cr = c.labels.get ( "Code-Review" ) ; org.junit.Assert.assertEquals ( 1 , cr.all.size ( ) ) ; org.junit.Assert.assertEquals ( 2 , cr.all.get ( 0 ) . value.intValue ( ) ) ; org.junit.Assert.assertEquals ( admin.getId ( ) , new com.google.gerrit.reviewdb.client.Account.Id ( cr.all.get ( 0 ) . _accountId ) ) ; }
Source:
private com.google.inject.Injector createSshInjector ( ) { return sysInjector.createChildInjector ( new com.google.gerrit.sshd.SshModule ( ) , new com.google.gerrit.sshd.commands.MasterCommandModule ( ) ) ; }

Target:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( new com.google.gerrit.sshd.SshModule ( ) ) ; modules.add ( new com.google.gerrit.sshd.commands.MasterCommandModule ( ) ) ; modules.add ( new com.google.gerrit.server.config.MasterNodeStartup ( ) ) ; return sysInjector.createChildInjector ( modules ) ; }
Source:
public com.google.gerrit.server.git.receive.ReceiveCommits getReceiveCommits ( ) { return rc ; }

Target:
public void init ( @ com.google.gerrit.common.Nullable java.util.Collection < com.google.gerrit.reviewdb.client.Account.Id > extraReviewers , @ com.google.gerrit.common.Nullable java.util.Collection < com.google.gerrit.reviewdb.client.Account.Id > extraCcs ) { rc.init ( ) ; if ( extraReviewers != null ) { rc.addReviewers ( extraReviewers ) ; } if ( extraCcs != null ) { rc.addExtraCC ( extraCcs ) ; } }
Source:
public com.google.gerrit.server.change.PatchSetInserter setMessage ( java.lang.String message ) throws com.google.gwtorm.server.OrmException { changeMessage = new com.google.gerrit.reviewdb.client.ChangeMessage ( new com.google.gerrit.reviewdb.client.ChangeMessage.Key ( change.getId ( ) , com.google.gerrit.server.ChangeUtil.messageUUID ( db ) ) , user.getAccountId ( ) , patchSet.getId ( ) ) ; changeMessage.setMessage ( message ) ; return this ; }

Target:
public com.google.gerrit.server.change.PatchSetInserter setMessage ( java.lang.String message ) throws com.google.gwtorm.server.OrmException { changeMessage = new com.google.gerrit.reviewdb.client.ChangeMessage ( new com.google.gerrit.reviewdb.client.ChangeMessage.Key ( change.getId ( ) , com.google.gerrit.server.ChangeUtil.messageUUID ( db ) ) , user.getAccountId ( ) , com.google.gerrit.server.util.TimeUtil.nowTs ( ) , patchSet.getId ( ) ) ; changeMessage.setMessage ( message ) ; return this ; }
Source:
private void setListBox ( final com.google.gwt.user.client.ui.ListBox f , final short defaultValue , final short currentValue ) { final int n = f.getItemCount ( ) ; for ( int i = 0 ; i < n ; i ++ ) { if ( ( java.lang.Short.parseShort ( f.getValue ( i ) ) ) == currentValue ) { f.setSelectedIndex ( i ) ; return ; } } if ( currentValue != defaultValue ) { setListBox ( f , defaultValue , defaultValue ) ; } }

Target:
private void setListBox ( final com.google.gwt.user.client.ui.ListBox f , final short defaultValue , final short currentValue ) { setListBox ( f , java.lang.String.valueOf ( defaultValue ) , java.lang.String.valueOf ( currentValue ) ) ; }
Source:
private void deleteDraftPatchSet ( com.google.gerrit.reviewdb.client.PatchSet patchSet , com.google.gerrit.reviewdb.client.Change change ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException , java.io.IOException { try { changeUtil.deleteOnlyDraftPatchSet ( patchSet , change ) ; } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( e.getMessage ( ) ) ; } }

Target:
private void deleteDraftPatchSet ( com.google.gerrit.reviewdb.client.PatchSet patchSet , com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException , java.io.IOException { try { changeUtil.deleteOnlyDraftPatchSet ( patchSet , ctx.getChange ( ) ) ; } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( e.getMessage ( ) ) ; } }
Source:
private boolean visible ( com.google.gerrit.reviewdb.client.Change.Id changeId ) { if ( ( visibleChanges ) == null ) { if ( ( changeCache ) == null ) { visibleChanges = visibleChangesByScan ( ) ; } else { visibleChanges = visibleChangesBySearch ( ) ; } } return visibleChanges.contains ( changeId ) ; }

Target:
private boolean visible ( com.google.gerrit.reviewdb.client.Change.Id changeId ) { if ( ( visibleChanges ) == null ) { if ( ( changeCache ) == null ) { visibleChanges = visibleChangesByScan ( ) ; } else { visibleChanges = visibleChangesBySearch ( ) ; } } return visibleChanges.containsKey ( changeId ) ; }
Source:
public java.lang.String getETag ( ) { com.google.gerrit.server.CurrentUser user = control.getUser ( ) ; com.google.common.hash.Hasher h = com.google.common.hash.Hashing.md5 ( ) . newHasher ( ) ; h.putString ( starredChangesUtil.getObjectId ( user.getAccountId ( ) , getId ( ) ) . name ( ) , java.nio.charset.StandardCharsets.UTF_8 ) ; prepareETag ( h , user ) ; return h.hash ( ) . toString ( ) ; }

Target:
public java.lang.String getETag ( ) { com.google.gerrit.server.CurrentUser user = control.getUser ( ) ; com.google.common.hash.Hasher h = com.google.common.hash.Hashing.md5 ( ) . newHasher ( ) ; if ( user.isIdentifiedUser ( ) ) { h.putString ( starredChangesUtil.getObjectId ( user.getAccountId ( ) , getId ( ) ) . name ( ) , java.nio.charset.StandardCharsets.UTF_8 ) ; } prepareETag ( h , user ) ; return h.hash ( ) . toString ( ) ; }
Source:
public void setUp ( ) throws java.sql.SQLException { java.sql.Connection conn = java.sql.DriverManager.getConnection ( ( ( ( com.ericsson.gerrit.plugins.eventslog.sql.SQLStoreTest.TEST_URL ) + ";" ) + ( com.ericsson.gerrit.plugins.eventslog.sql.SQLStoreTest.TEST_OPTIONS ) ) ) ; }

Target:
public void setUp ( ) throws java.sql.SQLException { java.sql.Connection conn = java.sql.DriverManager.getConnection ( ( ( ( com.ericsson.gerrit.plugins.eventslog.sql.SQLStoreTest.TEST_URL ) + ";" ) + ( com.ericsson.gerrit.plugins.eventslog.sql.SQLStoreTest.TEST_OPTIONS ) ) ) ; mockEvent = new com.ericsson.gerrit.plugins.eventslog.sql.SQLStoreTest.MockEvent ( ) ; stat = conn.createStatement ( ) ; poolMock = new com.ericsson.gerrit.plugins.eventslog.sql.SQLStoreTest.PoolMock ( ) ; org.mockito.Mockito.when ( cfgMock.getMaxAge ( ) ) . thenReturn ( 5 ) ; org.mockito.Mockito.when ( cfgMock.getLocalStorePath ( ) ) . thenReturn ( testFolder.getRoot ( ) . toPath ( ) ) ; }
Source:
void appendApproval ( com.google.gerrit.common.data.LabelType label , short value , com.google.gerrit.reviewdb.client.Account user ) { sb.append ( label.getName ( ) ) ; sb.append ( com.google.gerrit.common.data.LabelValue.formatValue ( value ) ) ; sb.append ( ": " ) ; appendUserData ( user ) ; sb.append ( "\n" ) ; }

Target:
void appendApproval ( com.google.gerrit.common.data.LabelType label , short value , com.google.gerrit.reviewdb.client.Account.Id accountId , java.util.Optional < com.google.gerrit.reviewdb.client.Account > account ) { sb.append ( label.getName ( ) ) ; sb.append ( com.google.gerrit.common.data.LabelValue.formatValue ( value ) ) ; sb.append ( ": " ) ; appendUserData ( accountId , account ) ; sb.append ( "\n" ) ; }
Source:
public com.google.gerrit.server.ssh.Command createCommand ( final java.lang.String requestCommand ) { final com.google.gerrit.server.ssh.DispatchCommand c = dispatcher.get ( ) ; c.setCommandLine ( requestCommand ) ; return c ; }

Target:
public void start ( ) throws java.io.IOException { final com.google.gerrit.server.ssh.SshScopes.Context old = SshScopes.current.get ( ) ; try { SshScopes.current.set ( new com.google.gerrit.server.ssh.SshScopes.Context ( session ) ) ; final com.google.gerrit.server.ssh.DispatchCommand c = dispatcher.get ( ) ; c.setCommandLine ( commandLine ) ; c.setInputStream ( in ) ; c.setOutputStream ( out ) ; c.setErrorStream ( err ) ; c.setExitCallback ( exit ) ; c.start ( ) ; } finally { SshScopes.current.set ( old ) ; } }
Source:
private com.google.gerrit.server.query.change.ChangeData changeData ( com.google.gerrit.reviewdb.server.ReviewDb db , @ com.google.gerrit.common.Nullable com.google.gerrit.server.query.change.ChangeData cd ) { return cd != null ? cd : changeDataFactory.create ( db , getNotes ( ) ) ; }

Target:
private boolean isReviewer ( com.google.gerrit.reviewdb.server.ReviewDb db , @ com.google.gerrit.common.Nullable com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { if ( getUser ( ) . isIdentifiedUser ( ) ) { cd = ( cd != null ) ? cd : changeDataFactory.create ( db , notes ) ; java.util.Collection < com.google.gerrit.reviewdb.client.Account.Id > results = cd.reviewers ( ) . all ( ) ; return results.contains ( getUser ( ) . getAccountId ( ) ) ; } return false ; }
Source:
public java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > byPatchSetUser ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet.Id psId , com.google.gerrit.reviewdb.client.Account.Id accountId ) throws com.google.gwtorm.server.OrmException { if ( ! ( migration.readPatchSetApprovals ( ) ) ) { return com.google.gerrit.server.ApprovalsUtil.sortApprovals ( db.patchSetApprovals ( ) . byPatchSetUser ( psId , accountId ) ) ; } return com.google.gerrit.server.ApprovalsUtil.filterApprovals ( byPatchSet ( db , ctl , psId ) , accountId ) ; }

Target:
public java.lang.Iterable < com.google.gerrit.reviewdb.client.PatchSetApproval > byPatchSetUser ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet.Id psId , com.google.gerrit.reviewdb.client.Account.Id accountId ) throws com.google.gwtorm.server.OrmException { if ( ! ( migration.readChanges ( ) ) ) { return com.google.gerrit.server.ApprovalsUtil.sortApprovals ( db.patchSetApprovals ( ) . byPatchSetUser ( psId , accountId ) ) ; } return com.google.gerrit.server.ApprovalsUtil.filterApprovals ( byPatchSet ( db , ctl , psId ) , accountId ) ; }
Source:
private boolean isPrivateVisible ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { return ( ( ( isOwner ( ) ) || ( isReviewer ( db , cd ) ) ) || ( getRefControl ( ) . canViewPrivateChanges ( ) ) ) || ( getUser ( ) . isInternalUser ( ) ) ; }

Target:
private boolean isPrivateVisible ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { return ( ( ( isOwner ( ) ) || ( isReviewer ( db , cd ) ) ) || ( refControl.canViewPrivateChanges ( ) ) ) || ( getUser ( ) . isInternalUser ( ) ) ; }
Source:
private void assertReviewers ( com.google.gerrit.reviewdb.client.Change c , com.google.gerrit.acceptance.TestAccount ... expectedReviewers ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { java.lang.Iterable < com.google.gerrit.reviewdb.client.Account.Id > actualIds = approvalsUtil.getReviewers ( db , notesFactory.createChecked ( db , c ) ) . values ( ) ; com.google.common.truth.Truth.assertThat ( actualIds ) . containsExactlyElementsIn ( com.google.common.collect.Sets.newHashSet ( com.google.gerrit.acceptance.TestAccount.ids ( expectedReviewers ) ) ) ; }

Target:
private void assertReviewers ( com.google.gerrit.reviewdb.client.Change c , com.google.gerrit.acceptance.TestAccount ... expectedReviewers ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { java.lang.Iterable < com.google.gerrit.reviewdb.client.Account.Id > actualIds = approvalsUtil.getReviewers ( db , notesFactory.createChecked ( db , c ) ) . all ( ) ; com.google.common.truth.Truth.assertThat ( actualIds ) . containsExactlyElementsIn ( com.google.common.collect.Sets.newHashSet ( com.google.gerrit.acceptance.TestAccount.ids ( expectedReviewers ) ) ) ; }
Source:
private void assertBranches ( java.util.List < java.lang.String > branches ) throws java.lang.Exception { java.util.List < java.lang.String > expected = com.google.common.collect.Lists.newArrayList ( "HEAD" , RefNames.REFS_CONFIG , "refs/heads/master" ) ; expected.addAll ( branches.stream ( ) . map ( ( b ) -> prefixRef ( b ) ) . collect ( java.util.stream.Collectors.toList ( ) ) ) ; com.google.gerrit.acceptance.rest.project.RefAssert.assertRefNames ( expected , project ( ) . branches ( ) . get ( ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { allow ( "refs/*" , Permission.CREATE , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; allow ( "refs/*" , Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; for ( java.lang.String name : com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) { project ( ) . branch ( name ) . create ( new com.google.gerrit.extensions.api.projects.BranchInput ( ) ) ; } assertBranches ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ; }
Source:
public static void replyError ( javax.servlet.http.HttpServletResponse res , int statusCode , java.lang.String msg ) throws java.io.IOException { res.setStatus ( statusCode ) ; com.google.gwtexpui.server.CacheHeaders.setNotCacheable ( res ) ; com.google.gerrit.httpd.restapi.RestApiServlet.replyText ( null , res , msg ) ; }

Target:
public static void replyError ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res , int statusCode , java.lang.String msg , com.google.gerrit.extensions.restapi.CacheControl c ) throws java.io.IOException { res.setStatus ( statusCode ) ; com.google.gerrit.httpd.restapi.RestApiServlet.configureCaching ( req , res , c ) ; com.google.gerrit.httpd.restapi.RestApiServlet.replyText ( null , res , msg ) ; }
Source:
public void onSend ( ) { com.google.gerrit.client.changes.ChangeApi.cherrypick ( info.legacy_id ( ) . get ( ) , revision , getDestinationBranch ( ) , getMessageText ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.changes.ChangeInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { sent = true ; hide ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( result.legacy_id ( ) ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { enableButtons ( true ) ; super . onFailure ( caught ) ; } } ) ; }

Target:
public void onSend ( ) { com.google.gerrit.client.changes.ChangeApi.cherrypick ( info.legacyId ( ) . get ( ) , revision , getDestinationBranch ( ) , getMessageText ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.changes.ChangeInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { sent = true ; hide ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( result.legacyId ( ) ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { enableButtons ( true ) ; super . onFailure ( caught ) ; } } ) ; }
Source:
public int run ( ) throws java.lang.Exception { final com.google.inject.Injector injector = com.google.inject.Guice.createInjector ( com.google.inject.Stage.PRODUCTION , new com.google.gerrit.server.config.DatabaseModule ( ) , new com.google.gerrit.server.config.GerritGlobalModule ( ) , new com.google.gerrit.server.ssh.SshModule ( ) ) ; injector.getInstance ( com.google.gerrit.server.ssh.SshDaemon.class ) . start ( ) ; return never ( ) ; }

Target:
public int run ( ) throws java.lang.Exception { com.google.inject.Injector sysInjector = com.google.gerrit.server.config.GerritGlobalModule.createInjector ( ) ; com.google.inject.Injector sshInjector = sysInjector.createChildInjector ( new com.google.gerrit.server.ssh.SshModule ( ) ) ; sshInjector.getInstance ( com.google.gerrit.server.ssh.SshDaemon.class ) . start ( ) ; return never ( ) ; }
Source:
public void onReloadPlugin ( com.google.gerrit.server.plugins.Plugin oldPlugin , com.google.gerrit.server.plugins.Plugin newPlugin ) { com.google.inject.Provider < org.apache.sshd.server.Command > cmd = load ( newPlugin ) ; if ( cmd != null ) { newPlugin.add ( root.replace ( com.google.gerrit.sshd.Commands.named ( newPlugin.getName ( ) ) , cmd ) ) ; } }

Target:
public void onReloadPlugin ( com.google.gerrit.server.plugins.Plugin oldPlugin , com.google.gerrit.server.plugins.Plugin newPlugin ) { com.google.inject.Provider < org.apache.sshd.server.Command > cmd = load ( newPlugin ) ; if ( cmd != null ) { newPlugin.add ( root.replace ( com.google.gerrit.sshd.Commands.named ( newPlugin.getName ( ) ) , cmd ) ) ; } cache.evictAll ( ) ; }
Source:
private void assertChangeUpToDate ( boolean expected , com.google.gerrit.reviewdb.client.Change.Id id ) throws java.lang.Exception { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ) { com.google.gerrit.reviewdb.client.Change c = unwrapDb ( ) . changes ( ) . get ( id ) ; com.google.common.truth.Truth.assertThat ( c ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( c.getNoteDbState ( ) ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.notedb.NoteDbChangeState.parse ( c ) . isChangeUpToDate ( new com.google.gerrit.server.git.RepoRefCache ( repo ) ) ) . isEqualTo ( expected ) ; } }

Target:
private void assertChangeUpToDate ( boolean expected , com.google.gerrit.reviewdb.client.Change.Id id ) throws java.lang.Exception { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ) { com.google.gerrit.reviewdb.client.Change c = getUnwrappedDb ( ) . changes ( ) . get ( id ) ; com.google.common.truth.Truth.assertThat ( c ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( c.getNoteDbState ( ) ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.notedb.NoteDbChangeState.parse ( c ) . isChangeUpToDate ( new com.google.gerrit.server.git.RepoRefCache ( repo ) ) ) . isEqualTo ( expected ) ; } }
Source:
public void noCommand ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( Type.HOST_INDEX , getView ( "/" ) . getType ( ) ) ; org.junit.Assert.assertEquals ( Type.REPOSITORY_INDEX , getView ( "/repo" ) . getType ( ) ) ; org.junit.Assert.assertNull ( getView ( "/repo/+" ) ) ; org.junit.Assert.assertNull ( getView ( "/repo/+/" ) ) ; }

Target:
public void noCommand ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( getView ( "/" ) . getType ( ) ) . isEqualTo ( Type.HOST_INDEX ) ; com.google.common.truth.Truth.assertThat ( getView ( "/repo" ) . getType ( ) ) . isEqualTo ( Type.REPOSITORY_INDEX ) ; com.google.common.truth.Truth.assertThat ( getView ( "/repo/+" ) ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( getView ( "/repo/+/" ) ) . isNull ( ) ; }
Source:
private void addSshKeys ( java.util.List < java.lang.String > sshKeys ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException , java.io.IOException { for ( final java.lang.String sshKey : sshKeys ) { com.google.gerrit.server.account.AddSshKey.Input in = new com.google.gerrit.server.account.AddSshKey.Input ( ) ; in.raw = new com.google.gerrit.extensions.restapi.RawInput ( ) { @ java.lang.Override public java.io.InputStream getInputStream ( ) throws java.io.IOException { return new java.io.ByteArrayInputStream ( sshKey.getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ; } @ java.lang.Override public java.lang.String getContentType ( ) { return "plain/text" ; } @ java.lang.Override public long getContentLength ( ) { return sshKey.length ( ) ; } } ; addSshKey.apply ( rsrc , in ) ; } }

Target:
private void addSshKeys ( java.util.List < java.lang.String > sshKeys ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException , java.io.IOException { for ( final java.lang.String sshKey : sshKeys ) { com.google.gerrit.server.account.AddSshKey.Input in = new com.google.gerrit.server.account.AddSshKey.Input ( ) ; in.raw = com.google.gerrit.common.RawInputUtil.create ( sshKey.getBytes ( ) , "plain/text" ) ; addSshKey.apply ( rsrc , in ) ; } }
Source:
public void allRefsVisibleWithRefsMetaConfig ( ) throws java.lang.Exception { allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , RefNames.REFS_CONFIG ) ; assertRefs ( "HEAD" , ( ( r1 ) + "1" ) , ( ( r1 ) + "meta" ) , ( ( r2 ) + "1" ) , ( ( r2 ) + "meta" ) , "refs/heads/branch" , "refs/heads/master" , RefNames.REFS_CONFIG , "refs/tags/branch-tag" , "refs/tags/master-tag" ) ; }

Target:
public void uploadPackAllRefsVisibleWithRefsMetaConfig ( ) throws java.lang.Exception { allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , RefNames.REFS_CONFIG ) ; assertUploadPackRefs ( "HEAD" , ( ( r1 ) + "1" ) , ( ( r1 ) + "meta" ) , ( ( r2 ) + "1" ) , ( ( r2 ) + "meta" ) , "refs/heads/branch" , "refs/heads/master" , RefNames.REFS_CONFIG , "refs/tags/branch-tag" , "refs/tags/master-tag" ) ; }
Source:
public static synchronized com.google.gerrit.server.GerritServer getInstance ( ) throws com.google.gwtjsonrpc.server.XsrfException , com.google.gwtorm.client.OrmException { if ( ( com.google.gerrit.server.GerritServer.impl ) == null ) { try { com.google.gerrit.server.GerritServer.impl = new com.google.gerrit.server.GerritServer ( ) ; } catch ( com.google.gwtorm.client.OrmException e ) { com.google.gerrit.server.GerritServer.closeDataSource ( ) ; com.google.gerrit.server.GerritServer.log.error ( "GerritServer ORM is unavailable" , e ) ; throw e ; } catch ( com.google.gwtjsonrpc.server.XsrfException e ) { com.google.gerrit.server.GerritServer.closeDataSource ( ) ; com.google.gerrit.server.GerritServer.log.error ( "GerritServer XSRF support failed to initailize" , e ) ; throw e ; } } return com.google.gerrit.server.GerritServer.impl ; }

Target:
public static synchronized com.google.gerrit.server.GerritServer getInstance ( ) throws com.google.gwtjsonrpc.server.XsrfException , com.google.gwtorm.client.OrmException { if ( ( com.google.gerrit.server.GerritServer.impl ) == null ) { try { com.google.gerrit.server.GerritServer.impl = new com.google.gerrit.server.GerritServer ( ) ; com.google.gerrit.server.GerritServer.impl.reloadMergeQueue ( ) ; } catch ( com.google.gwtorm.client.OrmException e ) { com.google.gerrit.server.GerritServer.closeDataSource ( ) ; com.google.gerrit.server.GerritServer.log.error ( "GerritServer ORM is unavailable" , e ) ; throw e ; } catch ( com.google.gwtjsonrpc.server.XsrfException e ) { com.google.gerrit.server.GerritServer.closeDataSource ( ) ; com.google.gerrit.server.GerritServer.log.error ( "GerritServer XSRF support failed to initailize" , e ) ; throw e ; } } return com.google.gerrit.server.GerritServer.impl ; }
Source:
public void onClick ( com.google.gwt.user.client.ui.Widget sender ) { sendButton.setEnabled ( false ) ; PatchUtil.DETAIL_SVC.abandonChange ( psid , message.getText ( ) . trim ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { public void onSuccess ( com.google.gwtjsonrpc.client.VoidResult result ) { if ( ( appCallback ) != null ) { appCallback.onSuccess ( null ) ; } hide ( ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { sendButton.setEnabled ( true ) ; super . onFailure ( caught ) ; } } ) ; }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { sendButton.setEnabled ( false ) ; PatchUtil.DETAIL_SVC.abandonChange ( psid , message.getText ( ) . trim ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { public void onSuccess ( com.google.gwtjsonrpc.client.VoidResult result ) { if ( ( appCallback ) != null ) { appCallback.onSuccess ( null ) ; } hide ( ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { sendButton.setEnabled ( true ) ; super . onFailure ( caught ) ; } } ) ; }
Source:
public java.util.List < com.google.gerrit.reviewdb.client.PatchSetApproval > addReviewers ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.server.notedb.ChangeUpdate update , com.google.gerrit.common.data.LabelTypes labelTypes , com.google.gerrit.reviewdb.client.Change change , java.lang.Iterable < com.google.gerrit.reviewdb.client.Account.Id > wantReviewers ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet.Id psId = change.currentPatchSetId ( ) ; return addReviewers ( db , update , labelTypes , change , psId , false , null , null , wantReviewers , getReviewers ( db , notes ) . values ( ) ) ; }

Target:
public java.util.List < com.google.gerrit.reviewdb.client.PatchSetApproval > addReviewers ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.server.notedb.ChangeUpdate update , com.google.gerrit.common.data.LabelTypes labelTypes , com.google.gerrit.reviewdb.client.Change change , java.lang.Iterable < com.google.gerrit.reviewdb.client.Account.Id > wantReviewers ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet.Id psId = change.currentPatchSetId ( ) ; return addReviewers ( db , update , labelTypes , change , psId , false , null , null , wantReviewers , getReviewers ( db , notes ) . all ( ) ) ; }
Source:
public static java.lang.String changeMetaRef ( com.google.gerrit.reviewdb.client.Change.Id id ) { java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( com.google.gerrit.reviewdb.client.RefNames.REFS_CHANGES ) ; int n = id.get ( ) ; int m = n % 100 ; if ( m < 10 ) { r.append ( '0' ) ; } r.append ( m ) ; r.append ( '/' ) ; r.append ( n ) ; r.append ( com.google.gerrit.reviewdb.client.RefNames.META_SUFFIX ) ; return r.toString ( ) ; }

Target:
public static java.lang.String changeMetaRef ( com.google.gerrit.reviewdb.client.Change.Id id ) { java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( com.google.gerrit.reviewdb.client.RefNames.REFS_CHANGES ) ; r.append ( com.google.gerrit.reviewdb.client.RefNames.shard ( id.get ( ) ) ) ; r.append ( com.google.gerrit.reviewdb.client.RefNames.META_SUFFIX ) ; return r.toString ( ) ; }
Source:
public void delete ( java.lang.Iterable < T > instances ) throws com.google.gwtorm.client.OrmException { for ( T obj : instances ) { db.delete ( dataRowKey ( obj ) ) ; for ( com.google.gwtorm.nosql.IndexFunction < T > f : com.google.gwtorm.nosql.generic.GenericAccess.getQueryIndexes ( ) ) { if ( f.includes ( obj ) ) { db.delete ( indexRowKey ( f , obj ) ) ; } } } }

Target:
public void update ( java.lang.Iterable < T > instances ) throws com.google.gwtorm.client.OrmException { for ( T obj : instances ) { upsertOne ( obj , true ) ; } }
Source:
public com.google.gerrit.server.project.ChangeControl validateFor ( com.google.gerrit.reviewdb.client.Change.Id changeId , com.google.gerrit.server.CurrentUser user ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change change = db.get ( ) . changes ( ) . get ( changeId ) ; if ( change == null ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( changeId ) ; } return validateFor ( change , user ) ; }

Target:
public com.google.gerrit.server.project.ChangeControl validateFor ( com.google.gerrit.reviewdb.client.Change.Id changeId , com.google.gerrit.server.CurrentUser user ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.server.project.ChangeControl > ctls = changeFinder.find ( changeId , user ) ; if ( ( ctls.size ( ) ) != 1 ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( changeId ) ; } return validateFor ( ctls.get ( 0 ) . getChange ( ) , user ) ; }
Source:
public com.google.common.util.concurrent.ListenableFuture < ? > rebuildAsync ( final com.google.gerrit.reviewdb.client.Change change , com.google.common.util.concurrent.ListeningExecutorService executor ) { return executor.submit ( new java.util.concurrent.Callable < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void call ( ) throws java.lang.Exception { rebuild ( change , null ) ; return null ; } } ) ; }

Target:
public com.google.common.util.concurrent.ListenableFuture < ? > rebuildAsync ( final com.google.gerrit.reviewdb.client.Change change , com.google.common.util.concurrent.ListeningExecutorService executor , final org.eclipse.jgit.lib.BatchRefUpdate bru , final org.eclipse.jgit.lib.BatchRefUpdate bruForDrafts , final org.eclipse.jgit.lib.Repository changeRepo , final org.eclipse.jgit.lib.Repository allUsersRepo ) { return executor.submit ( new java.util.concurrent.Callable < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void call ( ) throws java.lang.Exception { rebuild ( change , bru , bruForDrafts , changeRepo , allUsersRepo ) ; return null ; } } ) ; }
Source:
public void testUnblockForceEditTopicName ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertTrue ( "u can edit topic name" , u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) ; }

Target:
public void testUnblockInLocalForceEditTopicName_Fails ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.REGISTERED ) ; org.junit.Assert.assertFalse ( "u can't edit topic name" , u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) ; }
Source:
protected void configureServlets ( ) { serve ( "/static/*" ) . with ( com.google.gerrit.httpd.raw.SiteStaticDirectoryServlet.class ) ; install ( new com.google.gerrit.server.cache.CacheModule ( ) { @ java.lang.Override protected void configure ( ) { cache ( com.google.gerrit.httpd.raw.StaticModule.CACHE , java.nio.file.Path.class , com.google.gerrit.httpd.raw.ResourceServlet.Resource.class ) . maximumWeight ( ( 1 << 20 ) ) . weigher ( ResourceServlet.Weigher.class ) ; } } ) ; if ( options.enablePolyGerrit ( ) ) { servePolyGerritUi ( ) ; } else if ( options.enableDefaultUi ( ) ) { serveGwtUi ( ) ; } }

Target:
protected void configureServlets ( ) { serve ( "/static/*" ) . with ( com.google.gerrit.httpd.raw.SiteStaticDirectoryServlet.class ) ; install ( new com.google.gerrit.server.cache.CacheModule ( ) { @ java.lang.Override protected void configure ( ) { cache ( com.google.gerrit.httpd.raw.StaticModule.CACHE , java.nio.file.Path.class , com.google.gerrit.httpd.raw.ResourceServlet.Resource.class ) . maximumWeight ( ( 1 << 20 ) ) . weigher ( ResourceServlet.Weigher.class ) ; } } ) ; if ( options.enablePolyGerrit ( ) ) { install ( new com.google.gerrit.httpd.raw.StaticModule.PolyGerritUiModule ( ) ) ; } else if ( options.enableDefaultUi ( ) ) { install ( new com.google.gerrit.httpd.raw.StaticModule.GwtUiModule ( ) ) ; } }
Source:
public com.google.gerrit.extensions.api.changes.ChangeApi rebase ( com.google.gerrit.extensions.api.changes.RebaseInput in ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return changes.id ( rebase.apply ( revision , in ) . _number ) ; } catch ( com.google.gwtorm.server.OrmException | com.google.gerrit.common.errors.EmailException | com.google.gerrit.server.update.UpdateException | java.io.IOException | com.google.gerrit.server.permissions.PermissionBackendException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot rebase ps" , e ) ; } }

Target:
public com.google.gerrit.extensions.api.changes.ChangeApi rebase ( com.google.gerrit.extensions.api.changes.RebaseInput in ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return changes.id ( rebase.apply ( revision , in ) . _number ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot rebase ps" , e ) ; } }