auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static org.eclipse.jgit.lib.ObjectId zeroToNull ( org.eclipse.jgit.lib.ObjectId id ) { if ( ( id == null ) || ( id.equals ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) ) ) ) { return null ; } return id ; }

Target:
public com.google.common.base.Optional < org.eclipse.jgit.lib.ObjectId > get ( java.lang.String refName ) throws java.io.IOException { org.eclipse.jgit.transport.ReceiveCommand cmd = commands.get ( refName ) ; if ( cmd != null ) { return ! ( cmd.getNewId ( ) . equals ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) ) ) ? com.google.common.base.Optional.of ( cmd.getNewId ( ) ) : com.google.common.base.Optional.< org.eclipse.jgit.lib.ObjectId > absent ( ) ; } return refCache.get ( refName ) ; }
Source:
public void testIsEnabledRefNoParentMatchingBranchEnabled ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/test.*" } ; setupIsEnabled ( "true" , null , branches ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( "testProject" , "refs/heads/testBranch" ) ) ; }

Target:
public void testIsEnabledRefParentNoBranchEnforced ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { } ; setupIsEnabled ( "false" , "enforced" , branches ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey projectNK = new com.google.gerrit.reviewdb.client.Project.NameKey ( "testProject" ) ; assertTrue ( itsConfig.isEnabled ( projectNK , "refs/heads/testBranch" ) ) ; }
Source:
static java.util.List < java.lang.String > sortKeys ( com.googlesource.gerrit.plugins.findowners.Util.Owner2Weights weights ) { java.util.ArrayList < java.lang.String > keys = new java.util.ArrayList ( weights.keySet ( ) ) ; java.util.Collections.sort ( keys , new com.googlesource.gerrit.plugins.findowners.OwnerWeights.WeightComparator ( weights ) ) ; return keys ; }

Target:
static java.util.List < java.lang.String > sortKeys ( java.util.Map < java.lang.String , com.googlesource.gerrit.plugins.findowners.OwnerWeights > weights ) { java.util.List < java.lang.String > keys = new java.util.ArrayList < > ( weights.keySet ( ) ) ; java.util.Collections.sort ( keys , new com.googlesource.gerrit.plugins.findowners.OwnerWeights.WeightComparator ( weights ) ) ; return keys ; }
Source:
protected void onCellSingleClick ( int row , int column ) { if ( column == ( com.google.gerrit.client.change.FileTable.C_PATH ) ) { onOpenRow ( row ) ; } else { super . onCellSingleClick ( row , column ) ; } }

Target:
protected void onCellSingleClick ( com.google.gwt.user.client.Event event , int row , int column ) { if ( ( column == ( com.google.gerrit.client.change.FileTable.C_PATH ) ) && ( com.google.gerrit.client.change.FileTable.link.handleAsClick ( event ) ) ) { onOpenRow ( row ) ; } else { super . onCellSingleClick ( event , row , column ) ; } }
Source:
public void parseBranch ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Patch-Set: 1\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Branch: master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Patch-Set: 1\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Branch: refs/heads/stable" ) ) ) ; }

Target:
public void parseBranch ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Patch-set: 1\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseSucceeds ( ( "Update change\n" + ( ( ( ( "\n" + "Branch: master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Patch-set: 1\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-set: 1\n" ) + "Branch: refs/heads/master\n" ) + "Branch: refs/heads/stable" ) ) ) ; }
Source:
public com.ruesga.gerrit.plugins.fcm.rest.CloudNotificationInfo apply ( com.ruesga.gerrit.plugins.fcm.server.DeviceResource rsrc ) throws com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.ResourceNotFoundException { if ( ( ( self.get ( ) ) == null ) || ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "invalid account!" ) ; } throw new com.google.gerrit.extensions.restapi.BadRequestException ( "unsupported!" ) ; }

Target:
public com.ruesga.gerrit.plugins.fcm.rest.CloudNotificationInfo apply ( com.ruesga.gerrit.plugins.fcm.server.DeviceResource rsrc ) throws com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.ResourceNotFoundException { if ( ! ( config.isEnabled ( ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( "not configured!" ) ; } if ( ( ( self.get ( ) ) == null ) || ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "invalid account!" ) ; } throw new com.google.gerrit.extensions.restapi.BadRequestException ( "unsupported!" ) ; }
Source:
private void decodeStar ( org.apache.lucene.document.Document doc , com.google.gerrit.server.query.change.ChangeData cd ) { org.apache.lucene.index.IndexableField [ ] star = doc.getFields ( com.google.gerrit.lucene.LuceneChangeIndex.STAR_FIELD ) ; com.google.common.collect.Multimap < com.google.gerrit.reviewdb.client.Account.Id , java.lang.String > stars = com.google.common.collect.ArrayListMultimap.create ( ) ; for ( org.apache.lucene.index.IndexableField r : star ) { com.google.gerrit.server.StarredChangesUtil.StarField starField = StarredChangesUtil.StarField.parse ( r.stringValue ( ) ) ; if ( starField != null ) { stars.put ( starField.accountId ( ) , starField.label ( ) ) ; } } cd.setStars ( stars ) ; }

Target:
private void decodeStar ( com.google.common.collect.Multimap < java.lang.String , org.apache.lucene.index.IndexableField > doc , com.google.gerrit.server.query.change.ChangeData cd ) { java.util.Collection < org.apache.lucene.index.IndexableField > star = doc.get ( com.google.gerrit.lucene.LuceneChangeIndex.STAR_FIELD ) ; com.google.common.collect.Multimap < com.google.gerrit.reviewdb.client.Account.Id , java.lang.String > stars = com.google.common.collect.ArrayListMultimap.create ( ) ; for ( org.apache.lucene.index.IndexableField r : star ) { com.google.gerrit.server.StarredChangesUtil.StarField starField = StarredChangesUtil.StarField.parse ( r.stringValue ( ) ) ; if ( starField != null ) { stars.put ( starField.accountId ( ) , starField.label ( ) ) ; } } cd.setStars ( stars ) ; }
Source:
private boolean shouldReplicate ( com.google.gerrit.server.project.ProjectControl ctl ) throws com.google.gerrit.server.permissions.PermissionBackendException { if ( ( ! ( config.replicateHiddenProjects ( ) ) ) && ( ( ctl.getProject ( ) . getState ( ) ) == ( com.google.gerrit.extensions.client.ProjectState.HIDDEN ) ) ) { return false ; } try { permissionBackend.user ( ctl.getUser ( ) ) . project ( ctl.getProject ( ) . getNameKey ( ) ) . check ( ProjectPermission.ACCESS ) ; return true ; } catch ( com.google.gerrit.extensions.restapi.AuthException e ) { return false ; } }

Target:
private boolean shouldReplicate ( com.google.gerrit.server.project.ProjectState projectState , com.google.gerrit.server.CurrentUser user ) throws com.google.gerrit.server.permissions.PermissionBackendException { if ( ( ! ( config.replicateHiddenProjects ( ) ) ) && ( ( projectState.getProject ( ) . getState ( ) ) == ( com.google.gerrit.server.project.ProjectState.HIDDEN ) ) ) { return false ; } try { permissionBackend.user ( user ) . project ( projectState.getNameKey ( ) ) . check ( ProjectPermission.ACCESS ) ; return true ; } catch ( com.google.gerrit.extensions.restapi.AuthException e ) { return false ; } }
Source:
public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo.MergeableInfo result ) { if ( canSubmit ) { actions.setSubmitEnabled ( result.mergeable ( ) ) ; if ( status == ( com.google.gerrit.reviewdb.client.Change.Status.NEW ) ) { statusText.setInnerText ( ( result.mergeable ( ) ? Util.C.readyToSubmit ( ) : Util.C.mergeConflict ( ) ) ) ; } } setVisible ( notMergeable , ( ! ( result.mergeable ( ) ) ) ) ; renderSubmitType ( result.submit_type ( ) ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.rpc.NativeString result ) { if ( canSubmit ) { if ( status == ( com.google.gerrit.reviewdb.client.Change.Status.NEW ) ) { statusText.setInnerText ( ( changeInfo.mergeable ( ) ? Util.C.readyToSubmit ( ) : Util.C.mergeConflict ( ) ) ) ; } } setVisible ( notMergeable , ( ! ( changeInfo.mergeable ( ) ) ) ) ; renderSubmitType ( result.asString ( ) ) ; }
Source:
public void onLoad ( ) { if ( ( projects ) == null ) { initUI ( ) ; } Util.PROJECT_SVC.ownedProjects ( new com.google.gerrit.client.rpc.ScreenLoadCallback < java.util.List < com.google.gerrit.client.reviewdb.Project > > ( this ) { @ java.lang.Override protected void preDisplay ( final java.util.List < com.google.gerrit.client.reviewdb.Project > result ) { projects.display ( result ) ; projects.finishDisplay ( true ) ; } } ) ; }

Target:
protected void onInitUI ( ) { super . onInitUI ( ) ; setTitleText ( Util.C.projectListTitle ( ) ) ; projects = new com.google.gerrit.client.admin.ProjectListScreen.ProjectTable ( ) ; projects.setSavePointerId ( Link.ADMIN_PROJECTS ) ; add ( projects ) ; final com.google.gwt.user.client.ui.VerticalPanel fp = new com.google.gwt.user.client.ui.VerticalPanel ( ) ; fp.setStyleName ( "gerrit-AddSshKeyPanel" ) ; fp.add ( new com.google.gerrit.client.ui.SmallHeading ( Util.C.headingCreateGroup ( ) ) ) ; }
Source:
private void configureCmdLineParser ( ) { factory ( CmdLineParser.Factory.class ) ; registerOptionHandler ( Account.Id.class , com.google.gerrit.server.ssh.args4j.AccountIdHandler.class ) ; registerOptionHandler ( PatchSet.Id.class , com.google.gerrit.server.ssh.args4j.PatchSetIdHandler.class ) ; registerOptionHandler ( com.google.gerrit.server.project.ProjectControl.class , com.google.gerrit.server.ssh.args4j.ProjectControlHandler.class ) ; }

Target:
private void configureCmdLineParser ( ) { factory ( CmdLineParser.Factory.class ) ; registerOptionHandler ( Account.Id.class , com.google.gerrit.server.ssh.args4j.AccountIdHandler.class ) ; registerOptionHandler ( AccountGroup.Id.class , com.google.gerrit.server.ssh.args4j.AccountGroupIdHandler.class ) ; registerOptionHandler ( PatchSet.Id.class , com.google.gerrit.server.ssh.args4j.PatchSetIdHandler.class ) ; registerOptionHandler ( com.google.gerrit.server.project.ProjectControl.class , com.google.gerrit.server.ssh.args4j.ProjectControlHandler.class ) ; }
Source:
public void patchScript ( final com.google.gerrit.client.reviewdb.Patch.Key patchKey , final com.google.gerrit.client.reviewdb.PatchSet.Id psa , final com.google.gerrit.client.reviewdb.PatchSet.Id psb , final com.google.gerrit.client.data.PatchScriptSettings s , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.data.PatchScript > callback ) { if ( psb == null ) { callback.onFailure ( new com.google.gerrit.client.rpc.NoSuchEntityException ( ) ) ; return ; } run ( callback , new com.google.gerrit.server.patch.PatchScriptAction ( server , patchKey , psa , psb , s ) ) ; }

Target:
public void patchScript ( final com.google.gerrit.client.reviewdb.Patch.Key patchKey , final com.google.gerrit.client.reviewdb.PatchSet.Id psa , final com.google.gerrit.client.reviewdb.PatchSet.Id psb , final com.google.gerrit.client.data.PatchScriptSettings s , final com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.data.PatchScript > callback ) { if ( psb == null ) { callback.onFailure ( new com.google.gerrit.client.rpc.NoSuchEntityException ( ) ) ; return ; } run ( callback , new com.google.gerrit.server.patch.PatchScriptAction ( server , registry , patchKey , psa , psb , s ) ) ; }
Source:
static int getMinOwnerVoteLevel ( com.google.gerrit.server.query.change.ChangeData changeData ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Project.NameKey project = changeData.change ( ) . getProject ( ) ; try { return ( ( com.googlesource.gerrit.plugins.findowners.Config.config ) == null ) || ( project == null ) ? com.googlesource.gerrit.plugins.findowners.Config.minOwnerVoteLevel : com.googlesource.gerrit.plugins.findowners.Config.config.getFromProjectConfigWithInheritance ( project , com.googlesource.gerrit.plugins.findowners.Config.PLUGIN_NAME ) . getInt ( com.googlesource.gerrit.plugins.findowners.Config.MIN_OWNER_VOTE_LEVEL , com.googlesource.gerrit.plugins.findowners.Config.minOwnerVoteLevel ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { com.googlesource.gerrit.plugins.findowners.Config.log.error ( ( ( ( "Cannot find project " + project ) + " for " ) + ( com.googlesource.gerrit.plugins.findowners.Config.getChangeId ( changeData ) ) ) , e ) ; return com.googlesource.gerrit.plugins.findowners.Config.minOwnerVoteLevel ; } }

Target:
static int getMinOwnerVoteLevel ( com.google.gerrit.server.project.ProjectState projectState , com.google.gerrit.server.query.change.ChangeData c ) throws com.google.gwtorm.server.OrmException { if ( projectState == null ) { com.googlesource.gerrit.plugins.findowners.Config.log.error ( ( "Null projectState for change " + ( com.googlesource.gerrit.plugins.findowners.Config.getChangeId ( c ) ) ) ) ; return com.googlesource.gerrit.plugins.findowners.Config.minOwnerVoteLevel ; } else if ( ( com.googlesource.gerrit.plugins.findowners.Config.config ) == null ) { return com.googlesource.gerrit.plugins.findowners.Config.minOwnerVoteLevel ; } else { return com.googlesource.gerrit.plugins.findowners.Config.config.getFromProjectConfigWithInheritance ( projectState , com.googlesource.gerrit.plugins.findowners.Config.PLUGIN_NAME ) . getInt ( com.googlesource.gerrit.plugins.findowners.Config.MIN_OWNER_VOTE_LEVEL , com.googlesource.gerrit.plugins.findowners.Config.minOwnerVoteLevel ) ; } }
Source:
public int run ( ) throws java.lang.Exception { mustHaveValidSite ( ) ; dbInjector = createDbInjector ( ) ; manager.add ( dbInjector ) ; manager.start ( ) ; com.google.gerrit.pgm.util.RuntimeShutdown.add ( new java.lang.Runnable ( ) { public void run ( ) { try { java.lang.System.in.close ( ) ; } catch ( java.io.IOException e ) { } manager.stop ( ) ; } } ) ; shellFactory ( ) . create ( java.lang.System.in , java.lang.System.out ) . run ( ) ; return 0 ; }

Target:
public int run ( ) throws java.lang.Exception { mustHaveValidSite ( ) ; dbInjector = createDbInjector ( com.google.gerrit.pgm.util.DataSourceProvider.Context.SINGLE_USER ) ; manager.add ( dbInjector ) ; manager.start ( ) ; com.google.gerrit.pgm.util.RuntimeShutdown.add ( new java.lang.Runnable ( ) { public void run ( ) { try { java.lang.System.in.close ( ) ; } catch ( java.io.IOException e ) { } manager.stop ( ) ; } } ) ; shellFactory ( ) . create ( java.lang.System.in , java.lang.System.out ) . run ( ) ; return 0 ; }
Source:
public void createdOnIsPopulatedForGroupsCreatedBeforeAudit ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.AccountGroup.Id groupId = createGroup ( "Ancient group for schema migration" ) ; setCreatedOnToVeryOldTimestamp ( groupId ) ; removeAuditEntriesFor ( groupId ) ; schema151.migrateData ( db , new com.google.gerrit.testing.TestUpdateUI ( ) ) ; java.sql.Timestamp createdOn = getCreatedOn ( groupId ) ; com.google.common.truth.Truth.assertThat ( createdOn ) . isEqualTo ( com.google.gerrit.reviewdb.client.AccountGroup.auditCreationInstantTs ( ) ) ; }

Target:
public void createdOnIsPopulatedForGroupsCreatedBeforeAudit ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.AccountGroup.Id groupId = createGroupInReviewDb ( "Ancient group for schema migration" ) ; setCreatedOnToVeryOldTimestamp ( groupId ) ; removeAuditEntriesFor ( groupId ) ; schema151.migrateData ( db , new com.google.gerrit.testing.TestUpdateUI ( ) ) ; java.sql.Timestamp createdOn = getCreatedOn ( groupId ) ; com.google.common.truth.Truth.assertThat ( createdOn ) . isEqualTo ( com.google.gerrit.reviewdb.client.AccountGroup.auditCreationInstantTs ( ) ) ; }
Source:
protected void populate ( final int row , final com.google.gerrit.client.projects.ProjectInfo k ) { table.setText ( row , com.google.gerrit.client.ui.ProjectsTable.C_STATE , k.state ( ) . toString ( ) ) ; table.setText ( row , com.google.gerrit.client.ui.ProjectsTable.C_NAME , k.name ( ) ) ; table.setText ( row , com.google.gerrit.client.ui.ProjectsTable.C_DESCRIPTION , k.description ( ) ) ; setRowItem ( row , k ) ; }

Target:
protected void populate ( final int row , final com.google.gerrit.client.projects.ProjectInfo k ) { populateState ( row , k ) ; table.setText ( row , com.google.gerrit.client.ui.ProjectsTable.C_NAME , k.name ( ) ) ; table.setText ( row , com.google.gerrit.client.ui.ProjectsTable.C_DESCRIPTION , k.description ( ) ) ; setRowItem ( row , k ) ; }
Source:
public com.google.gerrit.server.ContactStore get ( ) { try { return new com.google.gerrit.server.EncryptedContactStore ( config , sitePath , schema ) ; } catch ( final com.google.gerrit.client.rpc.ContactInformationStoreException initError ) { return new com.google.gerrit.server.ContactStore ( ) { @ java.lang.Override public boolean isEnabled ( ) { return false ; } @ java.lang.Override public void store ( com.google.gerrit.client.reviewdb.Account account , com.google.gerrit.client.reviewdb.ContactInformation info ) throws com.google.gerrit.client.rpc.ContactInformationStoreException { throw initError ; } } ; } }

Target:
private com.google.gerrit.server.ContactStore noContact ( final com.google.gerrit.client.rpc.ContactInformationStoreException initError ) { return new com.google.gerrit.server.ContactStore ( ) { @ java.lang.Override public boolean isEnabled ( ) { return false ; } @ java.lang.Override public void store ( com.google.gerrit.client.reviewdb.Account account , com.google.gerrit.client.reviewdb.ContactInformation info ) throws com.google.gerrit.client.rpc.ContactInformationStoreException { throw initError ; } } ; }
Source:
private boolean isAnyCommitOfPullRequestToBeImported ( com.google.gerrit.reviewdb.server.ReviewDb db , org.eclipse.jgit.lib.Repository gitRepo , org.kohsuke.github.GHPullRequest ghPullRequest ) throws java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException { boolean pullRequestToImport = false ; try { for ( org.kohsuke.github.GHPullRequestCommitDetail pullRequestCommit : ghPullRequest.listCommits ( ) ) { pullRequestToImport |= qp.query ( changeQuery.commit ( pullRequestCommit.getSha ( ) ) ) . entities ( ) . isEmpty ( ) ; } return pullRequestToImport ; } catch ( com.google.gwtorm.server.OrmException | com.google.gerrit.server.query.QueryParseException e ) { com.googlesource.gerrit.plugins.github.wizard.PullRequestListController.LOG.error ( ( "Unable to query Gerrit changes for pull-request " + ( ghPullRequest.getNumber ( ) ) ) , e ) ; return false ; } }

Target:
private boolean isAnyCommitOfPullRequestToBeImported ( com.google.gerrit.reviewdb.server.ReviewDb db , org.eclipse.jgit.lib.Repository gitRepo , org.kohsuke.github.GHPullRequest ghPullRequest ) throws java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException { boolean pullRequestToImport = false ; try { for ( org.kohsuke.github.GHPullRequestCommitDetail pullRequestCommit : ghPullRequest.listCommits ( ) ) { pullRequestToImport |= qp.query ( changeQuery.commit ( pullRequestCommit.getSha ( ) ) ) . entities ( ) . isEmpty ( ) ; } return pullRequestToImport ; } catch ( com.google.gwtorm.server.OrmException | com.google.gerrit.index.query.QueryParseException e ) { com.googlesource.gerrit.plugins.github.wizard.PullRequestListController.LOG.error ( ( "Unable to query Gerrit changes for pull-request " + ( ghPullRequest.getNumber ( ) ) ) , e ) ; return false ; } }
Source:
private com.google.inject.Injector createSysInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( cfgInjector.getInstance ( com.google.gerrit.server.config.GerritGlobalModule.class ) ) ; modules.add ( new com.google.gerrit.server.cache.EhcachePoolImpl.Module ( ) ) ; modules.add ( new com.google.gerrit.server.config.CanonicalWebUrlModule ( ) { @ java.lang.Override protected java.lang.Class < ? extends com.google.inject.Provider < java.lang.String > > provider ( ) { return com.google.gerrit.httpd.HttpCanonicalWebUrlProvider.class ; } } ) ; modules.add ( new com.google.gerrit.server.config.MasterNodeStartup ( ) ) ; return cfgInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createSysInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( cfgInjector.getInstance ( com.google.gerrit.server.config.GerritGlobalModule.class ) ) ; modules.add ( new com.google.gerrit.ehcache.EhcachePoolImpl.Module ( ) ) ; modules.add ( new com.google.gerrit.server.config.CanonicalWebUrlModule ( ) { @ java.lang.Override protected java.lang.Class < ? extends com.google.inject.Provider < java.lang.String > > provider ( ) { return com.google.gerrit.httpd.HttpCanonicalWebUrlProvider.class ; } } ) ; modules.add ( new com.google.gerrit.server.config.MasterNodeStartup ( ) ) ; return cfgInjector.createChildInjector ( modules ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { setExternalGroup ( key ) ; }

Target:
private java.lang.String getTabToken ( final java.lang.String token , final java.lang.String tab ) { if ( token.startsWith ( "/admin/groups/uuid-" ) ) { return com.google.gerrit.client.Dispatcher.toGroup ( groupDetail.group.getGroupUUID ( ) , tab ) ; } else { return com.google.gerrit.client.Dispatcher.toGroup ( groupDetail.group.getId ( ) , tab ) ; } }
Source:
public void onSuccess ( java.util.List < com.google.gerrit.common.data.GroupReference > result ) { addRule.setEnabled ( true ) ; if ( ( result.size ( ) ) == 1 ) { addGroup ( result.get ( 0 ) ) ; } else { groupToAdd.setFocus ( true ) ; } }

Target:
public void onSuccess ( java.util.List < com.google.gerrit.common.data.GroupReference > result ) { addRule.setEnabled ( true ) ; if ( ( result.size ( ) ) == 1 ) { addGroup ( result.get ( 0 ) ) ; } else { groupToAdd.setFocus ( true ) ; new com.google.gerrit.client.ErrorDialog ( Gerrit.M.noSuchGroupMessage ( ref.getName ( ) ) ) . center ( ) ; } }
Source:
public final void copyTo ( com.google.gerrit.extensions.client.EditPreferencesInfo p ) { p.tabSize = tabSize ( ) ; p.lineLength = lineLength ( ) ; p.cursorBlinkRate = cursorBlinkRate ( ) ; p.hideTopMenu = hideTopMenu ( ) ; p.showTabs = showTabs ( ) ; p.showWhitespaceErrors = showWhitespaceErrors ( ) ; p.syntaxHighlighting = syntaxHighlighting ( ) ; p.hideLineNumbers = hideLineNumbers ( ) ; p.matchBrackets = matchBrackets ( ) ; p.theme = theme ( ) ; p.keyMapType = keyMapType ( ) ; }

Target:
public final void copyTo ( com.google.gerrit.extensions.client.EditPreferencesInfo p ) { p.tabSize = tabSize ( ) ; p.lineLength = lineLength ( ) ; p.cursorBlinkRate = cursorBlinkRate ( ) ; p.hideTopMenu = hideTopMenu ( ) ; p.showTabs = showTabs ( ) ; p.showWhitespaceErrors = showWhitespaceErrors ( ) ; p.syntaxHighlighting = syntaxHighlighting ( ) ; p.hideLineNumbers = hideLineNumbers ( ) ; p.matchBrackets = matchBrackets ( ) ; p.autoCloseBrackets = autoCloseBrackets ( ) ; p.theme = theme ( ) ; p.keyMapType = keyMapType ( ) ; }
Source:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { doAddNew ( ) ; }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { final com.google.gerrit.common.data.GroupOptions groupOptions = new com.google.gerrit.common.data.GroupOptions ( visibleToAllCheckBox.getValue ( ) , emailOnlyAuthors.getValue ( ) ) ; Util.GROUP_SVC.changeGroupOptions ( groupId , groupOptions , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { saveGroupOptions.setEnabled ( false ) ; } } ) ; }
Source:
public com.google.gerrit.testutil.InMemoryDatabase create ( ) throws com.google.gwtorm.client.OrmException { if ( ! ( created ) ) { created = true ; final com.google.gerrit.reviewdb.ReviewDb c = open ( ) ; try { new com.google.gerrit.server.schema.SchemaCreator ( new java.io.File ( "." ) , schemaVersion ) . create ( c ) ; } finally { c.close ( ) ; } } return this ; }

Target:
public com.google.gerrit.testutil.InMemoryDatabase create ( ) throws com.google.gwtorm.client.OrmException { if ( ! ( created ) ) { created = true ; final com.google.gerrit.reviewdb.ReviewDb c = open ( ) ; try { try { new com.google.gerrit.server.schema.SchemaCreator ( new java.io.File ( "." ) , schemaVersion , null , new org.eclipse.jgit.lib.PersonIdent ( "name" , "email@site" ) ) . create ( c ) ; } catch ( java.io.IOException e ) { throw new com.google.gwtorm.client.OrmException ( "Cannot create in-memory database" , e ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException e ) { throw new com.google.gwtorm.client.OrmException ( "Cannot create in-memory database" , e ) ; } } finally { c.close ( ) ; } } return this ; }
Source:
public com.googlesource.gerrit.plugins.its.phabricator.conduit.results.ConduitPing conduitPing ( ) throws com.googlesource.gerrit.plugins.its.phabricator.conduit.ConduitException { com.google.gson.JsonElement callResult = conduitConnection.call ( "conduit.ping" ) ; com.google.gson.JsonObject callResultWrapper = new com.google.gson.JsonObject ( ) ; callResultWrapper.add ( "hostname" , callResult ) ; com.googlesource.gerrit.plugins.its.phabricator.conduit.results.ConduitPing result = gson.fromJson ( callResultWrapper , com.googlesource.gerrit.plugins.its.phabricator.conduit.results.ConduitPing.class ) ; return result ; }

Target:
public com.googlesource.gerrit.plugins.its.phabricator.conduit.results.ManiphestInfo maniphestInfo ( int taskId ) throws com.googlesource.gerrit.plugins.its.phabricator.conduit.ConduitException { java.util.Map < java.lang.String , java.lang.Object > params = new java.util.HashMap < > ( ) ; params.put ( "task_id" , taskId ) ; com.google.gson.JsonElement callResult = conduitConnection.call ( "maniphest.info" , params , token ) ; com.googlesource.gerrit.plugins.its.phabricator.conduit.results.ManiphestInfo result = gson.fromJson ( callResult , com.googlesource.gerrit.plugins.its.phabricator.conduit.results.ManiphestInfo.class ) ; return result ; }
Source:
public java.lang.String toString ( ) { return com.google.common.base.MoreObjects.toStringHelper ( this ) . add ( "changeId" , changeId ) . add ( "commit" , com.google.gerrit.server.change.GetRelated.ChangeAndCommit.toString ( commit ) ) . add ( "_changeNumber" , _changeNumber ) . add ( "_revisionNumber" , _revisionNumber ) . add ( "_currentRevisionNumber" , _currentRevisionNumber ) . add ( "status" , status ) . toString ( ) ; }

Target:
public java.lang.String toString ( ) { return com.google.common.base.MoreObjects.toStringHelper ( this ) . add ( "project" , project ) . add ( "changeId" , changeId ) . add ( "commit" , com.google.gerrit.server.change.GetRelated.ChangeAndCommit.toString ( commit ) ) . add ( "_changeNumber" , _changeNumber ) . add ( "_revisionNumber" , _revisionNumber ) . add ( "_currentRevisionNumber" , _currentRevisionNumber ) . add ( "status" , status ) . toString ( ) ; }
Source:
public static com.google.gerrit.common.data.PermissionRule allow ( com.google.gerrit.server.git.ProjectConfig project , java.lang.String capabilityName , com.google.gerrit.reviewdb.client.AccountGroup.UUID group ) { com.google.gerrit.common.data.PermissionRule rule = com.google.gerrit.server.project.Util.newRule ( project , group ) ; project.getAccessSection ( AccessSection.GLOBAL_CAPABILITIES , true ) . getPermission ( capabilityName , true ) . add ( rule ) ; return rule ; }

Target:
public static com.google.gerrit.common.data.PermissionRule allow ( com.google.gerrit.server.git.ProjectConfig project , java.lang.String capabilityName , com.google.gerrit.reviewdb.client.AccountGroup.UUID group ) { com.google.gerrit.common.data.PermissionRule rule = com.google.gerrit.server.project.Util.newRule ( project , group ) ; project.getAccessSection ( AccessSection.GLOBAL_CAPABILITIES , true ) . getPermission ( capabilityName , true ) . add ( rule ) ; if ( com.google.gerrit.common.data.GlobalCapability.hasRange ( capabilityName ) ) { com.google.gerrit.common.data.PermissionRange.WithDefaults range = com.google.gerrit.common.data.GlobalCapability.getRange ( capabilityName ) ; if ( range != null ) { rule.setRange ( range.getDefaultMin ( ) , range.getDefaultMax ( ) ) ; } } return rule ; }
Source:
public boolean contains ( com.google.gerrit.reviewdb.client.AccountGroup.UUID id ) { if ( id == null ) { return false ; } java.lang.Boolean b = memberOf.get ( id ) ; if ( b != null ) { return b ; } memberOf.put ( id , false ) ; if ( search ( includeCache.membersOf ( id ) ) ) { memberOf.put ( id , true ) ; return true ; } return false ; }

Target:
private boolean search ( java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > ids ) { return user.getEffectiveGroups ( ) . containsAnyOf ( ids ) ; }
Source:
void onReply ( com.google.gwt.event.dom.client.ClickEvent e ) { if ( ( replyBox ) == null ) { com.google.gerrit.client.diff.DraftBox box = getDiffView ( ) . addReply ( getOriginal ( ) , "" , false ) ; registerReplyBox ( box ) ; } else { openReplyBox ( ) ; } }

Target:
void doReply ( ) { if ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { com.google.gerrit.client.Gerrit.doSignIn ( parent.getToken ( ) ) ; } else if ( ( replyBox ) == null ) { com.google.gerrit.client.diff.DraftBox box = addReplyBox ( ) ; if ( ! ( getCommentInfo ( ) . has_line ( ) ) ) { parent.addFileCommentBox ( box , comment.side ( ) ) ; } } else { openReplyBox ( ) ; } }
Source:
public void testDoPostBadRequest ( ) throws java.lang.Exception { org.easymock.EasyMock.expect ( req.getReader ( ) ) . andThrow ( new java.io.IOException ( ) ) ; replayAll ( ) ; syncEventsRestApiServlet.doPost ( req , rsp ) ; verifyAll ( ) ; }

Target:
public void testDoPostErrorWhileSendingErrorMessage ( ) throws java.lang.Exception { org.mockito.Mockito.doThrow ( new java.io.IOException ( com.ericsson.gerrit.plugins.syncevents.SyncEventsRestApiServletTest.ERR_MSG ) ) . when ( req ) . getReader ( ) ; org.mockito.Mockito.doThrow ( new java.io.IOException ( "someOtherError" ) ) . when ( rsp ) . sendError ( javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST , com.ericsson.gerrit.plugins.syncevents.SyncEventsRestApiServletTest.ERR_MSG ) ; syncEventsRestApiServlet.doPost ( req , rsp ) ; }
Source:
protected < T > void doInvoke ( final java.lang.String methodName , final java.lang.String reqData , final com.google.gwtjsonrpc.client.impl.ResultDeserializer < T > ser , final com.google.gwt.user.client.rpc.AsyncCallback < T > cb ) throws com.google.gwt.user.client.rpc.InvocationException { if ( ( url ) == null ) { throw new com.google.gwtjsonrpc.client.impl.NoServiceEntryPointSpecifiedException ( ) ; } newJsonCall ( this , methodName , reqData , ser , cb ) . send ( ) ; }

Target:
protected < T > void doInvoke ( final java.lang.String methodName , final java.lang.String reqData , final com.google.gwtjsonrpc.client.impl.ResultDeserializer < T > ser , final com.google.gwtjsonrpc.common.AsyncCallback < T > cb ) throws com.google.gwt.user.client.rpc.InvocationException { if ( ( url ) == null ) { throw new com.google.gwtjsonrpc.client.impl.NoServiceEntryPointSpecifiedException ( ) ; } newJsonCall ( this , methodName , reqData , ser , cb ) . send ( ) ; }
Source:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { doAddNew ( ) ; }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { final com.google.gerrit.common.data.GroupOptions groupOptions = new com.google.gerrit.common.data.GroupOptions ( visibleToAllCheckBox.getValue ( ) ) ; Util.GROUP_SVC.changeGroupOptions ( groupId , groupOptions , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { saveGroupOptions.setEnabled ( false ) ; } } ) ; }
Source:
public com.google.gerrit.reviewdb.client.PatchLineComment apply ( com.google.gerrit.server.notedb.RevisionNoteData.Comment c ) { com.google.gerrit.reviewdb.client.PatchLineComment plc = c.export ( ) ; plc.setStatus ( status ) ; return plc ; }

Target:
com.google.common.collect.ImmutableList < com.google.gerrit.reviewdb.client.PatchLineComment > exportComments ( com.google.gerrit.reviewdb.client.Change.Id changeId , com.google.gerrit.reviewdb.client.PatchLineComment.Status status ) { return com.google.common.collect.ImmutableList.copyOf ( comments.stream ( ) . map ( ( c ) -> c.export ( changeId , status ) ) . collect ( java.util.stream.Collectors.toList ( ) ) ) ; }
Source:
com.google.gerrit.server.git.strategy.SubmitStrategy.Arguments create ( com.google.gerrit.extensions.client.SubmitType submitType , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.server.git.MergeOp.CommitStatus commitStatus , com.google.gerrit.server.git.CodeReviewCommit.CodeReviewRevWalk rw , com.google.gerrit.server.IdentifiedUser caller , com.google.gerrit.server.git.MergeTip mergeTip , org.eclipse.jgit.lib.ObjectInserter inserter , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevFlag canMergeFlag , com.google.gerrit.reviewdb.server.ReviewDb db , java.util.Set < org.eclipse.jgit.revwalk.RevCommit > alreadyAccepted , com.google.gerrit.server.util.RequestId submissionId , com.google.gerrit.extensions.api.changes.NotifyHandling notifyHandling , com.google.common.collect.Multimap < com.google.gerrit.extensions.api.changes.RecipientType , com.google.gerrit.reviewdb.client.Account.Id > accountsToNotify , com.google.gerrit.server.git.SubmoduleOp submoduleOp , boolean dryrun ) ;

Target:
com.google.gerrit.server.git.strategy.SubmitStrategy.Arguments create ( com.google.gerrit.extensions.client.SubmitType submitType , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.server.git.MergeOp.CommitStatus commitStatus , com.google.gerrit.server.git.CodeReviewCommit.CodeReviewRevWalk rw , com.google.gerrit.server.IdentifiedUser caller , com.google.gerrit.server.git.MergeTip mergeTip , org.eclipse.jgit.lib.ObjectInserter inserter , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevFlag canMergeFlag , com.google.gerrit.reviewdb.server.ReviewDb db , java.util.Set < org.eclipse.jgit.revwalk.RevCommit > alreadyAccepted , java.util.Set < com.google.gerrit.server.git.CodeReviewCommit > incoming , com.google.gerrit.server.util.RequestId submissionId , com.google.gerrit.extensions.api.changes.NotifyHandling notifyHandling , com.google.common.collect.ListMultimap < com.google.gerrit.extensions.api.changes.RecipientType , com.google.gerrit.reviewdb.client.Account.Id > accountsToNotify , com.google.gerrit.server.git.SubmoduleOp submoduleOp , boolean dryrun ) ;
Source:
private com.google.gerrit.server.project.ProjectControl open ( com.google.gerrit.reviewdb.client.Project.NameKey projectName ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { try { return projectControlFactory.validateFor ( projectName , ( ( ProjectControl.OWNER ) | ( ProjectControl.VISIBLE ) ) , self.get ( ) ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( projectName.get ( ) ) ; } }

Target:
private com.google.gerrit.server.project.ProjectControl createProjectControl ( com.google.gerrit.reviewdb.client.Project.NameKey projectName ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { try { return projectControlFactory.controlFor ( projectName , self.get ( ) ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( projectName.get ( ) ) ; } }
Source:
public void setRevertOfPersistsValue ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change changeToRevert = newChange ( ) ; com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( project , changeOwner.getAccountId ( ) ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.setChangeId ( c.getKey ( ) . get ( ) ) ; update.setRevertOf ( changeToRevert.getId ( ) . get ( ) ) ; update.commit ( ) ; com.google.common.truth.Truth.assertThat ( newNotes ( c ) . getRevertOf ( ) ) . isEqualTo ( changeToRevert.getId ( ) ) ; }

Target:
public void setRevertOfPersistsValue ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change changeToRevert = newChange ( ) ; com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testing.TestChanges.newChange ( project , changeOwner.getAccountId ( ) ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.setChangeId ( c.getKey ( ) . get ( ) ) ; update.setRevertOf ( changeToRevert.getId ( ) . get ( ) ) ; update.commit ( ) ; com.google.common.truth.Truth.assertThat ( newNotes ( c ) . getRevertOf ( ) ) . isEqualTo ( changeToRevert.getId ( ) ) ; }
Source:
public boolean siteHasUsernames ( ) { if ( ( ( ( getAuthType ( ) ) == ( com.google.gerrit.reviewdb.client.AuthType.CUSTOM_EXTENSION ) ) && ( ( getHttpPasswordUrl ( ) ) != null ) ) && ( ! ( canEdit ( FieldName.USER_NAME ) ) ) ) { return false ; } return true ; }

Target:
public boolean siteHasUsernames ( ) { if ( ( ( ( authType ) == ( com.google.gerrit.reviewdb.client.AuthType.CUSTOM_EXTENSION ) ) && ( ( getHttpPasswordUrl ( ) ) != null ) ) && ( ! ( editableAccountFields.contains ( FieldName.USER_NAME ) ) ) ) { return false ; } return true ; }
Source:
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:jAuThOr" , change1 ) ; assertQuery ( "author:ExAmPlE" , change1 ) ; assertQuery ( "author:jcommitter@example.com" ) ; assertQuery ( "author:somewhere.com" ) ; assertQuery ( "author:jcommitter" ) ; assertQuery ( "author:Committer" ) ; }

Target:
public void byOwnerIn ( ) 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 ( newChangeForUser ( repo , userId ) ) ; com.google.gerrit.reviewdb.client.Account.Id user2 = accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "anotheruser" ) ) . getAccountId ( ) ; com.google.gerrit.reviewdb.client.Change change2 = insert ( newChangeForUser ( repo , user2 ) ) ; assertQuery ( "ownerin:Administrators" , change1 ) ; assertQuery ( "ownerin:\"Registered Users\"" , change2 , change1 ) ; }
Source:
private void offer ( final com.google.gerrit.common.ChangeHookRunner.ChangeEvent event ) { synchronized ( taskLock ) { if ( ! ( queue.offer ( event ) ) ) { dropped = true ; } if ( ( ( task ) == null ) && ( ! ( done ) ) ) { task = pool.submit ( writer ) ; } } }

Target:
private void offer ( final com.google.gerrit.server.events.ChangeEvent event ) { synchronized ( taskLock ) { if ( ! ( queue.offer ( event ) ) ) { dropped = true ; } if ( ( ( task ) == null ) && ( ! ( done ) ) ) { task = pool.submit ( writer ) ; } } }
Source:
public void createNewChangeSignedOffByFooter ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( isAllowDrafts ( ) ) . isTrue ( ) ; setSignedOffByFooter ( ) ; com.google.gerrit.extensions.common.ChangeInfo info = assertCreateSucceeds ( newChangeInput ( ChangeStatus.NEW ) ) ; java.lang.String message = info.revisions.get ( info.currentRevision ) . commit.message ; com.google.common.truth.Truth.assertThat ( message.contains ( java.lang.String.format ( "%s Adminitrstaor %s" , org.eclipse.jgit.lib.Constants.SIGNED_OFF_BY_TAG , admin.getIdent ( ) . getEmailAddress ( ) ) ) ) ; }

Target:
public void createNewChangeSignedOffByFooter ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( isAllowDrafts ( ) ) . isTrue ( ) ; setSignedOffByFooter ( ) ; com.google.gerrit.extensions.common.ChangeInfo info = assertCreateSucceeds ( newChangeInput ( ChangeStatus.NEW ) ) ; java.lang.String message = info.revisions.get ( info.currentRevision ) . commit.message ; com.google.common.truth.Truth.assertThat ( message ) . contains ( java.lang.String.format ( "%sAdministrator <%s>" , org.eclipse.jgit.lib.Constants.SIGNED_OFF_BY_TAG , admin.getIdent ( ) . getEmailAddress ( ) ) ) ; }
Source:
private static com.google.gerrit.server.config.ScheduleConfig config ( java.lang.String startTime , java.lang.String interval ) throws org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.lib.Config rc = com.google.gerrit.server.config.ScheduleConfigTest.readConfig ( java.text.MessageFormat.format ( "[section \"subsection\"]\nstartTime = {0}\ninterval = {1}\n" , startTime , interval ) ) ; return new com.google.gerrit.server.config.ScheduleConfig ( rc , "section" , "subsection" , com.google.gerrit.server.config.ScheduleConfigTest.NOW ) ; }

Target:
private static org.eclipse.jgit.lib.Config config ( java.lang.String startTime , java.lang.String interval ) throws org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.lib.Config rc = new org.eclipse.jgit.lib.Config ( ) ; rc.setString ( "section" , "subsection" , "startTime" , startTime ) ; rc.setString ( "section" , "subsection" , "interval" , interval ) ; return rc ; }
Source:
public void testToSafeHtml ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; b.append ( 1 ) ; final com.google.gwtexpui.safehtml.client.SafeHtml h = b.toSafeHtml ( ) ; org.junit.Assert.assertNotNull ( h ) ; org.junit.Assert.assertNotSame ( h , b ) ; org.junit.Assert.assertFalse ( ( h instanceof com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ) ) ; org.junit.Assert.assertEquals ( "1" , h.asString ( ) ) ; }

Target:
public void testToSafeHtml ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; b.append ( 1 ) ; final com.google.gwtexpui.safehtml.client.SafeHtml h = b.toSafeHtml ( ) ; com.google.common.truth.Truth.assertThat ( h ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( h ) . isNotSameAs ( b ) ; com.google.common.truth.Truth.assertThat ( h ) . isNotInstanceOf ( com.google.gwtexpui.safehtml.client.SafeHtmlBuilder.class ) ; com.google.common.truth.Truth.assertThat ( h.asString ( ) ) . isEqualTo ( "1" ) ; }
Source:
public void revisionActionsOneChangePerTopicUnapproved ( ) throws java.lang.Exception { java.lang.String changeId = createChangeWithTopic ( ) . getChangeId ( ) ; java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > actions = getActions ( changeId ) ; com.google.common.truth.Truth.assertThat ( actions ) . hasSize ( 3 ) ; com.google.common.truth.Truth.assertThat ( actions ) . containsKey ( "cherrypick" ) ; com.google.common.truth.Truth.assertThat ( actions ) . containsKey ( "rebase" ) ; com.google.common.truth.Truth.assertThat ( actions ) . containsKey ( "description" ) ; }

Target:
public void revisionActionsAnonymousETagCherryPickStrategy ( ) throws java.lang.Exception { java.lang.String parent = createChange ( ) . getChangeId ( ) ; java.lang.String change = createChange ( ) . getChangeId ( ) ; approve ( change ) ; setApiUserAnonymous ( ) ; java.lang.String etag1 = getETag ( change ) ; setApiUser ( admin ) ; approve ( parent ) ; setApiUserAnonymous ( ) ; java.lang.String etag2 = getETag ( change ) ; com.google.common.truth.Truth.assertThat ( etag2 ) . isEqualTo ( etag1 ) ; }
Source:
public void listBranchesSomeHidden ( ) throws com.google.gwtorm.server.OrmException , com.jcraft.jsch.JSchException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException , org.eclipse.jgit.errors.ConfigInvalidException { blockRead ( project , "refs/heads/dev" ) ; com.google.gerrit.acceptance.RestSession session = new com.google.gerrit.acceptance.RestSession ( server , accounts.create ( "user" , "user@example.com" , "User" ) ) ; pushTo ( "refs/heads/master" ) ; java.lang.String masterCommit = git.getRepository ( ) . getRef ( "master" ) . getTarget ( ) . getObjectId ( ) . getName ( ) ; pushTo ( "refs/heads/dev" ) ; com.google.gerrit.acceptance.RestResponse r = session.get ( ( ( "/projects/" + ( project.get ( ) ) ) + "/branches" ) ) ; java.util.List < com.google.gerrit.acceptance.rest.project.BranchInfo > result = new com.google.gson.Gson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.acceptance.rest.project.BranchInfo > > ( ) { } . getType ( ) ) ; java.util.List < com.google.gerrit.acceptance.rest.project.BranchInfo > expected = com.google.common.collect.Lists.asList ( new com.google.gerrit.acceptance.rest.project.BranchInfo ( "HEAD" , "master" , false ) , new com.google.gerrit.acceptance.rest.project.BranchInfo [ ] { new com.google.gerrit.acceptance.rest.project.BranchInfo ( "refs/heads/master" , masterCommit , false ) } ) ; com.google.gerrit.acceptance.rest.project.BranchAssert.assertBranches ( expected , result ) ; }

Target:
public void listBranchesSomeHidden ( ) throws com.google.gwtorm.server.OrmException , com.jcraft.jsch.JSchException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException , org.eclipse.jgit.errors.ConfigInvalidException { blockRead ( project , "refs/heads/dev" ) ; com.google.gerrit.acceptance.RestSession session = new com.google.gerrit.acceptance.RestSession ( server , accounts.create ( "user" , "user@example.com" , "User" ) ) ; pushTo ( "refs/heads/master" ) ; java.lang.String masterCommit = git.getRepository ( ) . getRef ( "master" ) . getTarget ( ) . getObjectId ( ) . getName ( ) ; pushTo ( "refs/heads/dev" ) ; com.google.gerrit.acceptance.RestResponse r = session.get ( ( ( "/projects/" + ( project.get ( ) ) ) + "/branches" ) ) ; java.util.List < com.google.gerrit.server.project.ListBranches.BranchInfo > expected = com.google.common.collect.Lists.asList ( new com.google.gerrit.server.project.ListBranches.BranchInfo ( "HEAD" , "master" , false ) , new com.google.gerrit.server.project.ListBranches.BranchInfo [ ] { new com.google.gerrit.server.project.ListBranches.BranchInfo ( "refs/heads/master" , masterCommit , false ) } ) ; com.google.gerrit.acceptance.rest.project.BranchAssert.assertBranches ( expected , com.google.gerrit.acceptance.rest.project.ListBranchesIT.toBranchInfoList ( r ) ) ; }