auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public com.google.gerrit.server.git.ChangeSet completeChangeSet ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change change ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { com.google.gerrit.server.query.change.ChangeData cd = changeDataFactory.create ( db , change.getProject ( ) , change.getId ( ) ) ; if ( com.google.gerrit.server.change.Submit.wholeTopicEnabled ( cfg ) ) { return completeChangeSetIncludingTopics ( db , new com.google.gerrit.server.git.ChangeSet ( cd ) ) ; } else { return completeChangeSetWithoutTopic ( db , new com.google.gerrit.server.git.ChangeSet ( cd ) ) ; } }

Target:
public com.google.gerrit.server.git.ChangeSet completeChangeSet ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.server.CurrentUser user ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException { com.google.gerrit.server.query.change.ChangeData cd = changeDataFactory.create ( db , change.getProject ( ) , change.getId ( ) ) ; cd.changeControl ( user ) ; if ( com.google.gerrit.server.change.Submit.wholeTopicEnabled ( cfg ) ) { return completeChangeSetIncludingTopics ( db , new com.google.gerrit.server.git.ChangeSet ( cd ) , user ) ; } else { return completeChangeSetWithoutTopic ( db , new com.google.gerrit.server.git.ChangeSet ( cd ) , user ) ; } }
Source:
public void testUnblockLargerScope_Fails ( ) { com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/master" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't push" , u.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }

Target:
public void testUnblockLargerScope_Fails ( ) { com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/master" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertCannotUpdate ( "refs/heads/master" , u ) ; }
Source:
public void testUnblockRangeForNotChangeOwner ( ) { com.google.gerrit.server.project.Util.grant ( local , ( ( com.google.gerrit.common.data.Permission.LABEL ) + "Code-Review" ) , ( - 2 ) , ( + 2 ) , com.google.gerrit.server.group.SystemGroupBackend.CHANGE_OWNER , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; com.google.gerrit.common.data.PermissionRange range = u.controlForRef ( "refs/heads/master" ) . getRange ( ( ( com.google.gerrit.common.data.Permission.LABEL ) + "Code-Review" ) ) ; org.junit.Assert.assertFalse ( "u can vote -2" , range.contains ( ( - 2 ) ) ) ; org.junit.Assert.assertFalse ( "u can vote +2" , range.contains ( 2 ) ) ; }

Target:
public void testUnblockNoForce ( ) { com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertTrue ( "u can push" , u.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }
Source:
public void linkifyAmpersand ( ) throws java.lang.Exception { com.google.gitiles.Linkifier l = new com.google.gitiles.Linkifier ( TestGitilesUrls.URLS ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( com.google.common.collect.ImmutableMap.of ( "text" , "http://my/url?a&b" , "url" , "http://my/url?a&b" ) ) , l.linkify ( com.google.gitiles.LinkifierTest.REQ , "http://my/url?a&b" ) ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( com.google.common.collect.ImmutableMap.of ( "text" , "http://weird/htmlified/?url" , "url" , "http://weird/htmlified/?url" ) , com.google.common.collect.ImmutableMap.of ( "text" , "&lt;p&rt;" ) ) , l.linkify ( com.google.gitiles.LinkifierTest.REQ , "http://weird/htmlified/?url&lt;p&rt;" ) ) ; }

Target:
public void linkifyMessageCommentLinks ( ) throws java.lang.Exception { org.eclipse.jgit.lib.Config config = new org.eclipse.jgit.lib.Config ( ) ; config.setString ( "commentlink" , "buglink" , "match" , "(bug\\s+#?)(\\d+)" ) ; config.setString ( "commentlink" , "buglink" , "link" , "http://bugs/$2" ) ; config.setString ( "commentlink" , "featurelink" , "match" , "(Feature:\\s+)(\\d+)" ) ; config.setString ( "commentlink" , "featurelink" , "link" , "http://features/$2" ) ; com.google.gitiles.Linkifier l = new com.google.gitiles.Linkifier ( TestGitilesUrls.URLS , config ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableList.of ( com.google.common.collect.ImmutableMap.of ( "text" , "There is a new " ) , com.google.common.collect.ImmutableMap.of ( "text" , "Feature: 103" , "url" , "http://features/103" ) , com.google.common.collect.ImmutableMap.of ( "text" , ", which is similar to the reported " ) , com.google.common.collect.ImmutableMap.of ( "text" , "bug 100" , "url" , "http://bugs/100" ) ) , l.linkify ( com.google.gitiles.LinkifierTest.REQ , "There is a new Feature: 103, which is similar to the reported bug 100" ) ) ; }
Source:
public void index ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { for ( com.google.gerrit.server.index.Index < ? , com.google.gerrit.server.query.change.ChangeData > i : getWriteIndexes ( ) ) { i.replace ( cd ) ; } fireChangeIndexedEvent ( cd.getId ( ) . get ( ) ) ; com.google.gerrit.server.index.change.ChangeIndexer.reindexAfterIndexUpdate ( cd ) ; }

Target:
public void index ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { for ( com.google.gerrit.server.index.Index < ? , com.google.gerrit.server.query.change.ChangeData > i : getWriteIndexes ( ) ) { i.replace ( cd ) ; } fireChangeIndexedEvent ( cd.getId ( ) . get ( ) ) ; com.google.gerrit.server.index.change.ChangeIndexer.autoReindexIfStale ( cd ) ; }
Source:
private static org.eclipse.jgit.lib.BaseRepositoryBuilder < ? , ? > builder ( org.eclipse.jgit.lib.Repository r ) { com.google.common.base.Preconditions.checkNotNull ( r ) ; return new org.eclipse.jgit.lib.BaseRepositoryBuilder ( ) . setFS ( r.getFS ( ) ) . setGitDir ( r.getDirectory ( ) ) . setWorkTree ( r.getWorkTree ( ) ) . setIndexFile ( r.getIndexFile ( ) ) ; }

Target:
private static org.eclipse.jgit.lib.BaseRepositoryBuilder < ? , ? > builder ( org.eclipse.jgit.lib.Repository r ) { com.google.common.base.Preconditions.checkNotNull ( r ) ; org.eclipse.jgit.lib.BaseRepositoryBuilder < ? , ? > builder = new org.eclipse.jgit.lib.BaseRepositoryBuilder ( ) . setFS ( r.getFS ( ) ) . setGitDir ( r.getDirectory ( ) ) ; if ( ! ( r.isBare ( ) ) ) { builder.setWorkTree ( r.getWorkTree ( ) ) . setIndexFile ( r.getIndexFile ( ) ) ; } return builder ; }
Source:
public void testNotAuthorized ( ) throws java.lang.Exception { java.lang.String expected = "unauthorized" ; com.ericsson.gerrit.plugins.syncindex.HttpSessionTest.wireMockRule.givenThat ( com.github.tomakehurst.wiremock.client.WireMock.post ( com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo ( com.ericsson.gerrit.plugins.syncindex.HttpSessionTest.ENDPOINT ) ) . willReturn ( com.github.tomakehurst.wiremock.client.WireMock.aResponse ( ) . withStatus ( com.ericsson.gerrit.plugins.syncindex.HttpSessionTest.UNAUTHORIZED ) . withBody ( expected ) ) ) ; com.ericsson.gerrit.plugins.syncindex.IndexResponseHandler.IndexResult result = httpSession.post ( com.ericsson.gerrit.plugins.syncindex.HttpSessionTest.ENDPOINT ) ; com.google.common.truth.Truth.assertThat ( result.isSuccessful ( ) ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( result.getMessage ( ) ) . isEqualTo ( expected ) ; }

Target:
public void testNotAuthorized ( ) throws java.lang.Exception { java.lang.String expected = "unauthorized" ; com.ericsson.gerrit.plugins.highavailability.HttpSessionTest.wireMockRule.givenThat ( com.github.tomakehurst.wiremock.client.WireMock.post ( com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo ( com.ericsson.gerrit.plugins.highavailability.HttpSessionTest.ENDPOINT ) ) . willReturn ( com.github.tomakehurst.wiremock.client.WireMock.aResponse ( ) . withStatus ( com.ericsson.gerrit.plugins.highavailability.HttpSessionTest.UNAUTHORIZED ) . withBody ( expected ) ) ) ; com.ericsson.gerrit.plugins.highavailability.IndexResponseHandler.IndexResult result = httpSession.post ( com.ericsson.gerrit.plugins.highavailability.HttpSessionTest.ENDPOINT ) ; com.google.common.truth.Truth.assertThat ( result.isSuccessful ( ) ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( result.getMessage ( ) ) . isEqualTo ( expected ) ; }
Source:
private boolean isDraftPatchSet ( com.google.gerrit.reviewdb.client.PatchSet.Id id , com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet ps = db.patchSets ( ) . get ( id ) ; if ( ps == null ) { throw new com.google.gwtorm.server.OrmException ( ( ( "Patch set " + id ) + " not found" ) ) ; } return ps.isDraft ( ) ; }

Target:
public java.util.List < com.google.gerrit.common.data.SubmitRecord > canSubmit ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.PatchSet patchSet ) { return canSubmit ( db , patchSet , null ) ; }
Source:
public void onFailure ( final java.lang.Throwable caught ) { text.setReadOnly ( false ) ; save.setEnabled ( true ) ; cancel.setEnabled ( true ) ; discard.setEnabled ( true ) ; super . onFailure ( caught ) ; }

Target:
public void onFailure ( final java.lang.Throwable caught ) { text.setReadOnly ( false ) ; save.setEnabled ( true ) ; cancel.setEnabled ( true ) ; discard.setEnabled ( true ) ; super . onFailure ( caught ) ; onSave.onFailure ( caught ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { final com.google.gerrit.reviewdb.client.PatchSet.Id id = ( ( idActive ) == null ) ? other.idActive : idActive ; com.google.gerrit.client.changes.ChangeFileApi.getContent ( id , path , new com.google.gerrit.client.rpc.GerritCallback < java.lang.String > ( ) { @ java.lang.Override public void onSuccess ( java.lang.String result ) { com.google.gerrit.client.change.EditFileAction edit = new com.google.gerrit.client.change.EditFileAction ( id , result , path , style.replyBox ( ) , null , icon ) ; edit.onEdit ( ) ; } } ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.VoidResult result ) { }
Source:
protected void configure ( ) { bind ( new com.google.inject.TypeLiteral < com.google.gerrit.extensions.registration.DynamicSet < com.google.gerrit.server.cache.CacheRemovalListener > > ( ) { } ) . toInstance ( com.google.gerrit.extensions.registration.DynamicSet.< com.google.gerrit.server.cache.CacheRemovalListener > emptySet ( ) ) ; install ( new com.google.gerrit.server.cache.h2.DefaultCacheFactory.Module ( ) ) ; }

Target:
protected void configure ( ) { bind ( new com.google.inject.TypeLiteral < com.google.gerrit.extensions.registration.DynamicSet < com.google.gerrit.server.cache.CacheRemovalListener > > ( ) { } ) . toInstance ( com.google.gerrit.extensions.registration.DynamicSet.< com.google.gerrit.server.cache.CacheRemovalListener > emptySet ( ) ) ; install ( new com.google.gerrit.server.cache.h2.DefaultCacheFactory.Module ( ) ) ; factory ( ChangeData.Factory.class ) ; }
Source:
public final void check ( com.google.gerrit.server.schema.UpdateUI ui , com.google.gerrit.reviewdb.CurrentSchemaVersion curr , com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { if ( ( curr.versionNbr ) == ( versionNbr ) ) { } else { upgradeFrom ( ui , curr , db ) ; } }

Target:
public final void check ( com.google.gerrit.server.schema.UpdateUI ui , com.google.gerrit.reviewdb.CurrentSchemaVersion curr , com.google.gerrit.reviewdb.ReviewDb db , boolean toTargetVersion ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { if ( ( curr.versionNbr ) == ( versionNbr ) ) { } else { upgradeFrom ( ui , curr , db , toTargetVersion ) ; } }
Source:
void appendApproval ( com.google.gerrit.common.data.LabelType label , short value , com.google.gerrit.reviewdb.client.Account.Id accountId , @ com.google.gerrit.common.Nullable 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" ) ; }

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 boolean canDelete ( ) { switch ( getCurrentUser ( ) . getAccessPath ( ) ) { case WEB_UI : return ( isOwner ( ) ) || ( canPushWithForce ( ) ) ; case GIT : return canPushWithForce ( ) ; default : return false ; } }

Target:
public boolean canDelete ( ) { if ( GitRepositoryManager.REF_CONFIG.equals ( refName ) ) { return false ; } switch ( getCurrentUser ( ) . getAccessPath ( ) ) { case WEB_UI : return ( isOwner ( ) ) || ( canPushWithForce ( ) ) ; case GIT : return canPushWithForce ( ) ; default : return false ; } }
Source:
public void configure ( ) { install ( dbInjector.getInstance ( com.google.gerrit.pgm.util.BatchProgramModule.class ) ) ; install ( com.google.gerrit.server.git.SearchingChangeCacheImpl.module ( ) ) ; install ( new com.google.gerrit.server.notedb.NoteDbModule ( ) ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.GitReferenceUpdatedListener.class ) . to ( com.google.gerrit.server.index.ReindexAfterUpdate.class ) ; install ( new com.google.gerrit.server.index.DummyIndexModule ( ) ) ; }

Target:
public void configure ( ) { install ( dbInjector.getInstance ( com.google.gerrit.pgm.util.BatchProgramModule.class ) ) ; install ( com.google.gerrit.server.git.SearchingChangeCacheImpl.module ( ) ) ; install ( new com.google.gerrit.server.notedb.NoteDbModule ( ) ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.events.GitReferenceUpdatedListener.class ) . to ( com.google.gerrit.server.index.change.ReindexAfterUpdate.class ) ; install ( new com.google.gerrit.server.index.DummyIndexModule ( ) ) ; }
Source:
private void performSimpleActionChainable ( final com.j2bugzilla.base.Bug bug , final java.lang.String actionName , final java.lang.String actionValue ) throws com.googlesource.gerrit.plugins.hooks.its.InvalidTransitionException , com.j2bugzilla.base.BugzillaException { if ( "status" . equals ( actionName ) ) { assertLegalValue ( Fields.STATUS , actionValue ) ; bug.setStatus ( actionValue ) ; } else if ( "resolution" . equals ( actionName ) ) { assertLegalValue ( Fields.RESOLUTION , actionValue ) ; bug.setResolution ( actionValue ) ; } else { throw new com.googlesource.gerrit.plugins.hooks.its.InvalidTransitionException ( ( ( "Simple action " + actionName ) + " is not known" ) ) ; } }

Target:
private void performSimpleActionChainable ( final com.j2bugzilla.base.Bug bug , final java.lang.String actionName , final java.lang.String actionValue ) throws com.googlesource.gerrit.plugins.its.base.its.InvalidTransitionException , com.j2bugzilla.base.BugzillaException { if ( "status" . equals ( actionName ) ) { assertLegalValue ( Fields.STATUS , actionValue ) ; bug.setStatus ( actionValue ) ; } else if ( "resolution" . equals ( actionName ) ) { assertLegalValue ( Fields.RESOLUTION , actionValue ) ; bug.setResolution ( actionValue ) ; } else { throw new com.googlesource.gerrit.plugins.its.base.its.InvalidTransitionException ( ( ( "Simple action " + actionName ) + " is not known" ) ) ; } }
Source:
private java.util.List < com.google.gerrit.server.query.change.ChangeData > getForOpenChange ( com.google.gerrit.reviewdb.client.Change c , com.google.gerrit.server.CurrentUser user ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.git.ChangeSet cs = mergeSuperSet.completeChangeSet ( dbProvider.get ( ) , c , user ) ; return cs.changes ( ) . asList ( ) ; }

Target:
private java.util.List < com.google.gerrit.server.query.change.ChangeData > getForOpenChange ( com.google.gerrit.reviewdb.client.Change c , com.google.gerrit.server.CurrentUser user ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.git.ChangeSet cs = mergeSuperSet.completeChangeSet ( dbProvider.get ( ) , c , user ) ; if ( cs.furtherHiddenChanges ( ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "change would be submitted with a change that you cannot see" ) ; } return cs.changes ( ) . asList ( ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.diff.FileInfo > m ) { files.setRevisions ( ( base != null ? new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , base._number ( ) ) : null ) , new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , rev._number ( ) ) ) ; files.setValue ( m , myLastReply , comments.get ( 0 ) , drafts.get ( 0 ) , fileTableMode ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.diff.FileInfo > m ) { files.set ( ( base != null ? new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , base._number ( ) ) : null ) , new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , rev._number ( ) ) , style , editMessage , reply ) ; files.setValue ( m , myLastReply , comments.get ( 0 ) , drafts.get ( 0 ) , fileTableMode ) ; }
Source:
public com.googlecode.prolog_cafe.builtin.Operation exec ( com.googlecode.prolog_cafe.builtin.Prolog engine ) { engine.setB0 ( ) ; com.googlecode.prolog_cafe.builtin.Term a1 ; com.googlecode.prolog_cafe.builtin.Predicate code ; a1 = arg1.dereference ( ) ; if ( ! ( a1 instanceof com.googlecode.prolog_cafe.builtin.ClosureTerm ) ) return engine.fail ( ) ; code = ( ( com.googlecode.prolog_cafe.builtin.ClosureTerm ) ( a1 ) ) . getCode ( ) ; code.cont = this . cont ; return code ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) { engine.setB0 ( ) ; com.googlecode.prolog_cafe.lang.Term a1 ; com.googlecode.prolog_cafe.lang.Predicate code ; a1 = arg1.dereference ( ) ; if ( ! ( a1 instanceof com.googlecode.prolog_cafe.lang.ClosureTerm ) ) return engine.fail ( ) ; code = ( ( com.googlecode.prolog_cafe.lang.ClosureTerm ) ( a1 ) ) . getCode ( ) ; code.cont = this . cont ; return code ; }
Source:
public void doAction ( com.google.gerrit.server.IdentifiedUser user , com.googlesource.gerrit.plugins.github.oauth.GitHubLogin hubLogin , javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse resp , com.googlesource.gerrit.plugins.github.wizard.ControllerErrors errors ) throws java.io.IOException , javax.servlet.ServletException { setAccountIdentity ( user , req ) ; setAccoutPublicKeys ( user , hubLogin , req ) ; }

Target:
public void doAction ( com.google.gerrit.server.IdentifiedUser user , com.googlesource.gerrit.plugins.github.oauth.GitHubLogin hubLogin , javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse resp , com.googlesource.gerrit.plugins.github.wizard.ControllerErrors errors ) throws java.io.IOException , javax.servlet.ServletException { try { setAccountIdentity ( user , req ) ; setAccoutPublicKeys ( user , hubLogin , req ) ; com.googlesource.gerrit.plugins.github.wizard.AccountController.log.info ( ( ( "Created account '" + ( user.getUserName ( ) ) ) + "'" ) ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.github.wizard.AccountController.log.error ( ( ( "Account '" + ( user.getUserName ( ) ) ) + "' creation failed" ) , e ) ; throw e ; } }
Source:
private static java.util.Properties loadBuckProperties ( java.nio.file.Path gen ) throws java.io.IOException { java.util.Properties properties = new java.util.Properties ( ) ; java.nio.file.Path p = gen.resolve ( java.nio.file.Paths.get ( "tools/buck/buck.properties" ) ) ; try ( java.io.InputStream in = java.nio.file.Files.newInputStream ( p ) ) { properties.load ( in ) ; } catch ( java.nio.file.NoSuchFileException e ) { } return properties ; }

Target:
private static java.util.Properties loadBuckProperties ( java.nio.file.Path propPath ) throws java.io.IOException { java.util.Properties properties = new java.util.Properties ( ) ; try ( java.io.InputStream in = java.nio.file.Files.newInputStream ( propPath ) ) { properties.load ( in ) ; } catch ( java.nio.file.NoSuchFileException e ) { } return properties ; }
Source:
public void submit ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; gApi.changes ( ) . id ( ( "p~master~" + ( r.getChangeId ( ) ) ) ) . current ( ) . review ( com.google.gerrit.acceptance.api.revision.RevisionIT.approve ( ) ) ; gApi.changes ( ) . id ( ( "p~master~" + ( r.getChangeId ( ) ) ) ) . current ( ) . submit ( ) ; }

Target:
public void submit ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; gApi.changes ( ) . id ( ( "p~master~" + ( r.getChangeId ( ) ) ) ) . current ( ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.approve ( ) ) ; gApi.changes ( ) . id ( ( "p~master~" + ( r.getChangeId ( ) ) ) ) . current ( ) . submit ( ) ; }
Source:
private com.google.gerrit.server.git.BatchUpdate.ChangeContext newChangeContext ( com.google.gerrit.reviewdb.server.ReviewDb db , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevWalk rw , com.google.gerrit.reviewdb.client.Change.Id id ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChanges.get ( id ) ; if ( c == null ) { c = com.google.gerrit.server.git.BatchUpdate.unwrap ( db ) . changes ( ) . get ( id ) ; } com.google.gerrit.server.notedb.ChangeNotes notes = changeNotesFactory.createForBatchUpdate ( c ) ; com.google.gerrit.server.project.ChangeControl ctl = changeControlFactory.controlFor ( notes , user ) ; return new com.google.gerrit.server.git.BatchUpdate.ChangeContext ( ctl , new com.google.gerrit.server.git.BatchUpdateReviewDb ( db ) , repo , rw ) ; }

Target:
private com.google.gerrit.server.git.BatchUpdate.ChangeContext newChangeContext ( com.google.gerrit.reviewdb.server.ReviewDb db , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevWalk rw , com.google.gerrit.reviewdb.client.Change.Id id ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChanges.get ( id ) ; if ( c == null ) { c = com.google.gerrit.reviewdb.server.ReviewDbUtil.unwrapDb ( db ) . changes ( ) . get ( id ) ; } com.google.gerrit.server.notedb.ChangeNotes notes = changeNotesFactory.createForBatchUpdate ( c ) ; com.google.gerrit.server.project.ChangeControl ctl = changeControlFactory.controlFor ( notes , user ) ; return new com.google.gerrit.server.git.BatchUpdate.ChangeContext ( ctl , new com.google.gerrit.server.git.BatchUpdateReviewDb ( db ) , repo , rw ) ; }
Source:
public java.util.SortedSet < com.google.gerrit.reviewdb.client.Project.NameKey > list ( ) { java.util.SortedSet < com.google.gerrit.reviewdb.client.Project.NameKey > names = new java.util.TreeSet < com.google.gerrit.reviewdb.client.Project.NameKey > ( ) ; scanProjects ( basePath , "" , names ) ; return java.util.Collections.unmodifiableSortedSet ( names ) ; }

Target:
public java.util.SortedSet < com.google.gerrit.reviewdb.client.Project.NameKey > list ( ) { namesUpdateLock.lock ( ) ; try { java.util.SortedSet < com.google.gerrit.reviewdb.client.Project.NameKey > n = new java.util.TreeSet < com.google.gerrit.reviewdb.client.Project.NameKey > ( ) ; scanProjects ( basePath , "" , n ) ; names = java.util.Collections.unmodifiableSortedSet ( n ) ; return n ; } finally { namesUpdateLock.unlock ( ) ; } }
Source:
private void updateChange ( java.lang.String changeId , com.google.gerrit.extensions.client.ChangeKind kind ) throws java.lang.Exception { switch ( kind ) { case com.google.gerrit.extensions.client.ChangeKind.NO_CODE_CHANGE : noCodeChange ( changeId ) ; return ; case com.google.gerrit.extensions.client.ChangeKind.REWORK : rework ( changeId ) ; return ; case com.google.gerrit.extensions.client.ChangeKind.TRIVIAL_REBASE : trivialRebase ( changeId ) ; return ; case NO_CHANGE : case MERGE_FIRST_PARENT_UPDATE : default : org.junit.Assert.fail ( ( "unexpexted change kind: " + kind ) ) ; } }

Target:
private void updateChange ( java.lang.String changeId , com.google.gerrit.extensions.client.ChangeKind changeKind ) throws java.lang.Exception { switch ( changeKind ) { case com.google.gerrit.extensions.client.ChangeKind.NO_CODE_CHANGE : noCodeChange ( changeId ) ; return ; case com.google.gerrit.extensions.client.ChangeKind.REWORK : rework ( changeId ) ; return ; case com.google.gerrit.extensions.client.ChangeKind.TRIVIAL_REBASE : trivialRebase ( changeId ) ; return ; case com.google.gerrit.extensions.client.ChangeKind.MERGE_FIRST_PARENT_UPDATE : updateFirstParent ( changeId ) ; return ; case NO_CHANGE : default : org.junit.Assert.fail ( ( "unexpected change kind: " + changeKind ) ) ; } }
Source:
private void verifyPost ( ) throws java.io.IOException , javax.servlet.ServletException { syncIndexRestApiServlet.doPost ( req , rsp ) ; verifyAll ( ) ; }

Target:
public void changeToIndexDoNotExist ( ) throws java.lang.Exception { setupPostMocks ( com.ericsson.gerrit.plugins.syncindex.SyncIndexRestApiServletTest.CHANGE_DOES_NOT_EXIST ) ; syncIndexRestApiServlet.doPost ( req , rsp ) ; org.mockito.Mockito.verify ( indexer , org.mockito.Mockito.times ( 1 ) ) . delete ( id ) ; org.mockito.Mockito.verify ( rsp ) . setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; }
Source:
private void doSave ( ) { com.googlesource.gerrit.plugins.imagare.client.ConfigInfo in = com.googlesource.gerrit.plugins.imagare.client.ConfigInfo.create ( ) ; in.setDefaultProject ( projectBox.getValue ( ) ) ; in.setLinkDecoration ( linkDecorationBox.getValue ( linkDecorationBox.getSelectedIndex ( ) ) ) ; restApi.put ( in , new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwt.core.client.JavaScriptObject > ( ) { @ java.lang.Override public void onSuccess ( com.google.gwt.core.client.JavaScriptObject result ) { saveButton.setEnabled ( false ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ; }

Target:
private void doSave ( ) { com.googlesource.gerrit.plugins.imagare.client.ConfigInfo in = com.googlesource.gerrit.plugins.imagare.client.ConfigInfo.create ( ) ; in.setDefaultProject ( projectBox.getValue ( ) ) ; in.setLinkDecoration ( linkDecorationBox.getValue ( linkDecorationBox.getSelectedIndex ( ) ) ) ; in.setStage ( stageBox.getValue ( ) ) ; restApi.put ( in , new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwt.core.client.JavaScriptObject > ( ) { @ java.lang.Override public void onSuccess ( com.google.gwt.core.client.JavaScriptObject result ) { saveButton.setEnabled ( false ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ; }
Source:
protected void populateProjects ( ) { Util.PROJECT_SVC.visibleProjects ( new com.google.gerrit.client.rpc.ScreenLoadCallback < java.util.List < com.google.gerrit.reviewdb.Project > > ( this ) { @ java.lang.Override protected void preDisplay ( final java.util.List < com.google.gerrit.reviewdb.Project > result ) { projectsTab.display ( result ) ; if ( firstPopupLoad ) { firstPopupLoad = false ; displayPopup ( ) ; } } } ) ; }

Target:
protected void displayPopup ( ) { popingUp = true ; if ( firstPopupLoad ) { populateProjects ( ) ; } else { popup.setPopupPositionAndShow ( popupPosition ) ; com.google.gwtexpui.globalkey.client.GlobalKey.dialog ( popup ) ; com.google.gwtexpui.globalkey.client.GlobalKey.addApplication ( popup , new com.google.gwtexpui.globalkey.client.HidePopupPanelCommand ( 0 , com.google.gwt.event.dom.client.KeyCodes.KEY_ESCAPE , popup ) ) ; projectsTab.setRegisterKeys ( true ) ; projectsTab.finishDisplay ( ) ; if ( ( regWindowResize ) == null ) { regWindowResize = com.google.gwt.user.client.Window.addResizeHandler ( this ) ; } popingUp = false ; } }
Source:
public void onSuccess ( com.google.gerrit.client.rpc.NativeMap < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > > result ) { com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > in = result.get ( path ) ; if ( in != null ) { if ( toDrafts ) { if ( side == ( com.google.gerrit.client.diff.SideBySide2.DisplaySide.A ) ) { draftsBase = in ; } else { draftsRevision = in ; } } else { if ( side == ( com.google.gerrit.client.diff.SideBySide2.DisplaySide.A ) ) { publishedBase = in ; } else { publishedRevision = in ; } } } }

Target:
public void onSuccess ( com.google.gerrit.client.rpc.NativeMap < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > > result ) { com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.CommentInfo > in = result.get ( path ) ; if ( in != null ) { if ( toDrafts ) { if ( side == ( DisplaySide.A ) ) { draftsBase = in ; } else { draftsRevision = in ; } } else { if ( side == ( DisplaySide.A ) ) { publishedBase = in ; } else { publishedRevision = in ; } } } }
Source:
private java.util.List < com.google.gerrit.server.git.CodeReviewCommit > sort ( java.util.Collection < com.google.gerrit.server.git.CodeReviewCommit > toSort ) throws com.google.gerrit.server.git.IntegrationException { try { return new com.google.gerrit.server.git.RebaseSorter ( args.rw , args.alreadyAccepted , args.canMergeFlag , args.internalChangeQuery ) . sort ( toSort ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.git.IntegrationException ( "Commit sorting failed" , e ) ; } }

Target:
private java.util.List < com.google.gerrit.server.git.CodeReviewCommit > sort ( java.util.Collection < com.google.gerrit.server.git.CodeReviewCommit > toSort , org.eclipse.jgit.revwalk.RevCommit initialTip ) throws com.google.gerrit.server.git.IntegrationException { try { return new com.google.gerrit.server.git.RebaseSorter ( args.rw , initialTip , args.alreadyAccepted , args.canMergeFlag ) . sort ( toSort ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.git.IntegrationException ( "Commit sorting failed" , e ) ; } }
Source:
public boolean match ( com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.reviewdb.client.ChangeMessage m : cd.messages ( ) ) { if ( java.util.Objects.equals ( m.getAuthor ( ) , id ) ) { return true ; } } for ( com.google.gerrit.reviewdb.client.PatchLineComment c : cd.publishedComments ( ) ) { if ( java.util.Objects.equals ( c.getAuthor ( ) , id ) ) { return true ; } } return false ; }

Target:
public boolean match ( com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.reviewdb.client.ChangeMessage m : cd.messages ( ) ) { if ( java.util.Objects.equals ( m.getAuthor ( ) , id ) ) { return true ; } } for ( com.google.gerrit.reviewdb.client.Comment c : cd.publishedComments ( ) ) { if ( java.util.Objects.equals ( c.author.getId ( ) , id ) ) { return true ; } } return false ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; com.google.gerrit.client.dashboards.DashboardMap.allOnProject ( getProjectKey ( ) , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.dashboards.DashboardMap > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gerrit.client.dashboards.DashboardMap result ) { dashes.display ( result ) ; } } ) ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; com.google.gerrit.client.dashboards.DashboardList.all ( getProjectKey ( ) , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.rpc.NativeList < com.google.gerrit.client.dashboards.DashboardList > > ( this ) { @ java.lang.Override protected void preDisplay ( com.google.gerrit.client.rpc.NativeList < com.google.gerrit.client.dashboards.DashboardList > result ) { dashes.display ( result ) ; } } ) ; }
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 onReply ( com.google.gwt.event.dom.client.ClickEvent e ) { if ( ! ( com.google.gerrit.client.Gerrit.isSignedIn ( ) ) ) { com.google.gerrit.client.Gerrit.doSignIn ( getDiffView ( ) . getToken ( ) ) ; } else if ( ( replyBox ) == null ) { com.google.gerrit.client.diff.DraftBox box = getDiffView ( ) . addReply ( getOriginal ( ) , "" , false ) ; registerReplyBox ( box ) ; } else { openReplyBox ( ) ; } }
Source:
private com.google.gerrit.common.data.SubmitTypeRecord typeError ( java.lang.String err ) { if ( logErrors ) { com.google.gerrit.server.project.SubmitRuleEvaluator.log.error ( err ) ; return com.google.gerrit.server.project.SubmitRuleEvaluator.defaultTypeError ( ) ; } else { return com.google.gerrit.server.project.SubmitRuleEvaluator.createTypeError ( err ) ; } }

Target:
private java.util.List < com.google.gerrit.common.data.SubmitRecord > ruleError ( java.lang.String err , java.lang.Exception e ) { if ( logErrors ) { if ( e == null ) { com.google.gerrit.server.project.SubmitRuleEvaluator.log.error ( err ) ; } else { com.google.gerrit.server.project.SubmitRuleEvaluator.log.error ( err , e ) ; } return com.google.gerrit.server.project.SubmitRuleEvaluator.defaultRuleError ( ) ; } else { return com.google.gerrit.server.project.SubmitRuleEvaluator.createRuleError ( err ) ; } }
Source:
private synchronized void unloadPlugin ( com.google.gerrit.server.plugins.Plugin plugin ) { java.lang.String name = plugin.getName ( ) ; com.google.gerrit.server.plugins.PluginLoader.log.info ( java.lang.String.format ( "Unloading plugin %s" , name ) ) ; plugin.stop ( ) ; running.remove ( name ) ; disabled.remove ( name ) ; toCleanup.add ( plugin ) ; }

Target:
private synchronized void unloadPlugin ( com.google.gerrit.server.plugins.Plugin plugin ) { java.lang.String name = plugin.getName ( ) ; com.google.gerrit.server.plugins.PluginLoader.log.info ( java.lang.String.format ( "Unloading plugin %s" , name ) ) ; plugin.stop ( env ) ; running.remove ( name ) ; disabled.remove ( name ) ; toCleanup.add ( plugin ) ; }
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.group.SystemGroupBackend.ANONYMOUS_USERS , "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 ) ; org.junit.Assert.assertTrue ( "u can edit topic name" , u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) ; }

Target:
public void testUnblockInLocalForceEditTopicName_Fails ( ) { com.google.gerrit.server.project.Util.block ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( 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.group.SystemGroupBackend.REGISTERED_USERS ) ; org.junit.Assert.assertFalse ( "u can't edit topic name" , u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) ; }
Source:
public void customConflictMessageMultilineTest ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.automerger.FailedMergeException fme = new com.googlesource.gerrit.plugins.automerger.FailedMergeException ( failedMergeBranches , currentRevision , hostName , "${branch}a\nb\nc\nd" , topic ) ; com.google.common.truth.Truth.assertThat ( fme.getDisplayString ( ) . split ( "\\n" ) ) . asList ( ) . containsExactly ( "branch1a" , "b" , "c" , "d" , "branch2a" , "b" , "c" , "d" , "branch3a" , "b" , "c" , "d" ) ; }

Target:
public void customConflictMessageWithProjectNameTest ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.automerger.FailedMergeException fme = new com.googlesource.gerrit.plugins.automerger.FailedMergeException ( failedMergeBranches , currentRevision , hostName , projectName , changeNumber , patchsetNumber , "${project}: ${conflict}" , topic ) ; java.lang.String branch1String = ( projectName ) + ": branch1 merge conflict" ; java.lang.String branch2String = ( projectName ) + ": branch2 merge conflict" ; java.lang.String branch3String = ( projectName ) + ": branch3 merge conflict" ; com.google.common.truth.Truth.assertThat ( fme.getDisplayString ( ) . split ( "\\n" ) ) . asList ( ) . containsExactly ( branch1String , branch2String , branch3String ) ; }
Source:
private com.google.gerrit.server.project.ChangeControl controlFor ( com.google.gerrit.server.notedb.ChangeNotes notes ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException { try { return changeControlFactory.controlFor ( notes , user.get ( ) ) ; } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( java.lang.String.format ( "Change %s not found" , notes.getChangeId ( ) ) ) ; } }

Target:
public com.google.gerrit.server.change.ChangeResource parse ( com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.server.CurrentUser user ) { return changeResourceFactory.create ( notes , user ) ; }
Source:
private java.io.File getSiteFromReviewDb ( java.sql.Connection conn ) { try { java.sql.ResultSet rs = conn.createStatement ( ) . executeQuery ( "select site_path from system_config" ) ; if ( rs.next ( ) ) { return new java.io.File ( rs.getString ( 1 ) ) ; } return null ; } catch ( java.sql.SQLException e ) { return null ; } }

Target:
private java.io.File getSiteFromReviewDb ( java.sql.Connection conn ) { try { java.sql.Statement stmt = conn.createStatement ( ) ; try { java.sql.ResultSet rs = stmt.executeQuery ( "SELECT site_path FROM system_config" ) ; if ( rs.next ( ) ) { return new java.io.File ( rs.getString ( 1 ) ) ; } } finally { stmt.close ( ) ; } return null ; } catch ( java.sql.SQLException e ) { return null ; } }
Source:
public void onSuccess ( com.google.gerrit.client.projects.BranchInfo result ) { addBranch.setEnabled ( true ) ; nameTxtBox.setText ( "" ) ; irevTxtBox.setText ( "" ) ; Util.PROJECT_SVC.listBranches ( getProjectKey ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.common.data.ListBranchesResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.common.data.ListBranchesResult result ) { display ( result.getBranches ( ) ) ; } } ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.projects.BranchInfo branch ) { addBranch.setEnabled ( true ) ; nameTxtBox.setText ( "" ) ; irevTxtBox.setText ( "" ) ; refreshBranches ( ) ; }
Source:
protected byte [ ] indexRowKey ( com.google.gwtorm.nosql.IndexFunction < T > idx , T obj ) { com.google.gwtorm.nosql.IndexKeyBuilder b = new com.google.gwtorm.nosql.IndexKeyBuilder ( ) ; b.add ( com.google.gwtorm.nosql.generic.GenericAccess.getRelationName ( ) ) ; b.add ( '.' ) ; b.add ( idx.getName ( ) ) ; b.delimiter ( ) ; idx.encode ( b , obj ) ; b.delimiter ( ) ; com.google.gwtorm.nosql.generic.GenericAccess.getKeyIndex ( ) . encode ( b , obj ) ; return b.toByteArray ( ) ; }

Target:
protected byte [ ] indexRowKey ( com.google.gwtorm.nosql.IndexFunction < T > idx , T obj ) { com.google.gwtorm.nosql.IndexKeyBuilder b = new com.google.gwtorm.nosql.IndexKeyBuilder ( ) ; b.add ( com.google.gwtorm.nosql.generic.GenericAccess.getRelationName ( ) ) ; b.add ( '.' ) ; b.add ( idx.getName ( ) ) ; b.delimiter ( ) ; idx.encode ( b , obj ) ; b.delimiter ( ) ; encodePrimaryKey ( b , com.google.gwtorm.nosql.generic.GenericAccess.primaryKey ( obj ) ) ; return b.toByteArray ( ) ; }
Source:
public void testIsSuccessful ( ) throws java.lang.Exception { org.apache.http.HttpResponse response = setupMocks ( com.ericsson.gerrit.plugins.syncindex.IndexResponseHandlerTest.OK , com.ericsson.gerrit.plugins.syncindex.IndexResponseHandlerTest.EMPTY_ENTITY ) ; com.ericsson.gerrit.plugins.syncindex.IndexResponseHandler.IndexResult result = handler.handleResponse ( response ) ; com.google.common.truth.Truth.assertThat ( result.isSuccessful ( ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( result.getMessage ( ) ) . isEmpty ( ) ; }

Target:
public void testIsSuccessful ( ) throws java.lang.Exception { org.apache.http.HttpResponse response = setupMocks ( com.ericsson.gerrit.plugins.highavailability.IndexResponseHandlerTest.OK , com.ericsson.gerrit.plugins.highavailability.IndexResponseHandlerTest.EMPTY_ENTITY ) ; com.ericsson.gerrit.plugins.highavailability.IndexResponseHandler.IndexResult result = handler.handleResponse ( response ) ; com.google.common.truth.Truth.assertThat ( result.isSuccessful ( ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( result.getMessage ( ) ) . isEmpty ( ) ; }
Source:
public java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > files ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return ( ( java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > ) ( listFiles.get ( ) . apply ( revision ) . value ( ) ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve files" , e ) ; } }

Target:
public java.util.Map < java.lang.String , java.util.List < com.google.gerrit.extensions.common.CommentInfo > > drafts ( ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return listDrafts.apply ( revision ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve drafts" , e ) ; } }
Source:
boolean wouldPushProject ( final com.google.gerrit.reviewdb.client.Project.NameKey project ) { if ( ! ( isVisible ( project ) ) ) { return false ; } java.lang.String [ ] projects = config.getProjects ( ) ; if ( ( projects.length ) < 1 ) { return true ; } return new com.googlesource.gerrit.plugins.replication.ReplicationFilter ( java.util.Arrays.asList ( projects ) ) . matches ( project ) ; }

Target:
private void addRef ( com.googlesource.gerrit.plugins.replication.PushOne e , java.lang.String ref ) { e.addRef ( ref ) ; postReplicationScheduledEvent ( e , ref ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { com.google.gerrit.reviewdb.client.Project.NameKey project = result.project_name_key ( ) ; com.google.gerrit.client.projects.ConfigInfoCache.get ( project , configCallback ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { com.google.gerrit.reviewdb.client.Project.NameKey project = result.project_name_key ( ) ; com.google.gerrit.client.projects.ConfigInfoCache.get ( project , group.addFinal ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.projects.ConfigInfoCache.Entry > ( this ) { @ java.lang.Override protected void preDisplay ( com.google.gerrit.client.projects.ConfigInfoCache.Entry result ) { commentLinkProcessor = result.getCommentLinkProcessor ( ) ; setTheme ( result.getTheme ( ) ) ; com.google.gerrit.client.diff.DiffInfo diffInfo = diff ; diff = null ; display ( diffInfo ) ; } } ) ) ; }
Source:
public void onLoad ( ) { if ( ( info ) == null ) { initUI ( ) ; } super . onLoad ( ) ; display ( com.google.gerrit.client.Gerrit.getUserAccount ( ) ) ; tabs.selectTab ( tabTokens.indexOf ( initialTabToken ) ) ; Util.ACCOUNT_SVC.myAccount ( new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.reviewdb.Account > ( ) { public void onSuccess ( final com.google.gerrit.client.reviewdb.Account result ) { if ( isAttached ( ) ) { display ( result ) ; } } } ) ; }

Target:
public void onLoad ( ) { if ( ( info ) == null ) { initUI ( ) ; } super . onLoad ( ) ; display ( com.google.gerrit.client.Gerrit.getUserAccount ( ) ) ; tabs.selectTab ( tabTokens.indexOf ( initialTabToken ) ) ; Util.ACCOUNT_SVC.myAccount ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.reviewdb.Account > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gerrit.client.reviewdb.Account result ) { display ( result ) ; } } ) ; }
Source:
private void assertProblems ( org.bouncycastle.openpgp.PGPPublicKey k , java.lang.String ... expected ) throws java.lang.Exception { if ( ( expected.length ) == 0 ) { throw new java.lang.IllegalArgumentException ( "Use assertNoProblems" ) ; } com.google.gerrit.gpg.CheckResult result = new com.google.gerrit.gpg.PublicKeyChecker ( ) . setStore ( store ) . check ( k ) ; org.junit.Assert.assertEquals ( java.util.Arrays.asList ( expected ) , result.getProblems ( ) ) ; }

Target:
private void assertProblems ( org.bouncycastle.openpgp.PGPPublicKey k , java.lang.String first , java.lang.String ... rest ) { com.google.gerrit.gpg.CheckResult result = new com.google.gerrit.gpg.PublicKeyChecker ( ) . setStore ( store ) . check ( k ) ; org.junit.Assert.assertEquals ( com.google.gerrit.gpg.PublicKeyCheckerTest.list ( first , rest ) , result.getProblems ( ) ) ; }
Source:
public void rescheduleOnError ( ) throws java.io.IOException { org.mockito.Mockito.when ( session.post ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.WEBHOOK_URL , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.BODY ) ) . thenReturn ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.ERR_RESULT ) ; task.run ( ) ; org.mockito.Mockito.verify ( executor , org.mockito.Mockito.times ( 1 ) ) . schedule ( task , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.RETRY_INTERVAL , java.util.concurrent.TimeUnit.MILLISECONDS ) ; }

Target:
public void noRescheduleOnSuccess ( ) throws java.io.IOException { org.mockito.Mockito.when ( session.post ( org.mockito.ArgumentMatchers.eq ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.WEBHOOK_URL ) , org.mockito.ArgumentMatchers.eq ( content ) ) ) . thenReturn ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.OK_RESULT ) ; task.run ( ) ; org.mockito.Mockito.verifyZeroInteractions ( executor ) ; }