auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void initChangeAction ( com.google.gerrit.client.changes.ChangeInfo info ) { if ( ( info.status ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.DRAFT ) ) { com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.actions.ActionInfo > actions = ( info.has_actions ( ) ) ? info.actions ( ) : com.google.gerrit.client.rpc.NativeMap.< com.google.gerrit.client.actions.ActionInfo > create ( ) ; actions.copyKeysIntoChildren ( "id" ) ; if ( actions.containsKey ( "/" ) ) { deleteChange.setVisible ( true ) ; deleteChange.setTitle ( actions.get ( "/" ) . title ( ) ) ; } } }

Target:
private void initChangeAction ( com.google.gerrit.client.changes.ChangeInfo info ) { if ( ( info.status ( ) ) == ( com.google.gerrit.reviewdb.client.Change.Status.DRAFT ) ) { com.google.gerrit.client.rpc.NativeMap < com.google.gerrit.client.actions.ActionInfo > actions = ( info.hasActions ( ) ) ? info.actions ( ) : com.google.gerrit.client.rpc.NativeMap.< com.google.gerrit.client.actions.ActionInfo > create ( ) ; actions.copyKeysIntoChildren ( "id" ) ; if ( actions.containsKey ( "/" ) ) { deleteChange.setVisible ( true ) ; deleteChange.setTitle ( actions.get ( "/" ) . title ( ) ) ; } } }
Source:
private com.google.gerrit.acceptance.AcceptanceTestRequestScope.Context newRequestContext ( com.google.gerrit.acceptance.TestAccount account ) { return atrScope.newContext ( reviewDbProvider , new com.google.gerrit.acceptance.SshSession ( server , account ) , identifiedUserFactory.create ( com.google.inject.util.Providers.of ( db ) , account.getId ( ) ) ) ; }

Target:
protected PushOneCommit.Result createChange ( java.lang.String subject , java.lang.String fileName , java.lang.String content ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , testRepo , subject , fileName , content ) ; return push.to ( "refs/for/master" ) ; }
Source:
public void unsupportedIndexOperator ( ) throws java.lang.Exception { com.google.gerrit.server.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "status:merged file:a" ) ; com.google.common.truth.Truth.assertThat ( rewrite ( in ) ) . isEqualTo ( query ( in ) ) ; indexes.setSearchIndex ( new com.google.gerrit.server.index.change.FakeChangeIndex ( FakeChangeIndex.V1 ) ) ; exception.expect ( com.google.gerrit.index.query.QueryParseException.class ) ; exception.expectMessage ( "Unsupported index predicate: file:a" ) ; rewrite ( in ) ; }

Target:
public void unsupportedIndexOperator ( ) throws java.lang.Exception { com.google.gerrit.index.query.Predicate < com.google.gerrit.server.query.change.ChangeData > in = parse ( "status:merged file:a" ) ; com.google.common.truth.Truth.assertThat ( rewrite ( in ) ) . isEqualTo ( query ( in ) ) ; indexes.setSearchIndex ( new com.google.gerrit.server.index.change.FakeChangeIndex ( FakeChangeIndex.V1 ) ) ; exception.expect ( com.google.gerrit.index.query.QueryParseException.class ) ; exception.expectMessage ( "Unsupported index predicate: file:a" ) ; rewrite ( in ) ; }
Source:
public void testInsertNothing ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { setup ( ) ; createClassUnderTest ( ) . insert ( com.google.gwtorm.jdbc.TestJdbcAccess.NO_DATA ) ; }

Target:
public static java.util.Collection < java.lang.Object [ ] > data ( ) { return java.util.Arrays.asList ( new java.lang.Object [ ] [ ] { new java.lang.Object [ ] { com.google.gwtorm.jdbc.TestJdbcAccess.LIST_PROVIDER } , new java.lang.Object [ ] { com.google.gwtorm.jdbc.TestJdbcAccess.UNMODIFIABLE_LIST_PROVIDER } , new java.lang.Object [ ] { com.google.gwtorm.jdbc.TestJdbcAccess.LIST_RESULT_SET_PROVIDER } } ) ; }
Source:
public static java.util.Set < java.lang.String > accountFields ( com.google.gerrit.index.QueryOptions opts ) { java.util.Set < java.lang.String > fs = opts.fields ( ) ; return fs.contains ( AccountField.ID.getName ( ) ) ? fs : com.google.common.collect.Sets.union ( fs , com.google.common.collect.ImmutableSet.of ( AccountField.ID.getName ( ) ) ) ; }

Target:
public static java.util.Set < java.lang.String > accountFields ( com.google.gerrit.index.QueryOptions opts ) { return com.google.gerrit.server.index.IndexUtils.accountFields ( opts.fields ( ) ) ; }
Source:
private void updateVote ( com.google.gerrit.extensions.common.ChangeInfo change , java.lang.String label , short vote ) throws com.google.gerrit.extensions.restapi.RestApiException { com.googlesource.gerrit.plugins.automerger.DownstreamCreator.log.debug ( "Giving for label to {}" , vote , label , change.id ) ; com.google.gerrit.extensions.api.changes.ReviewInput reviewInput = new com.google.gerrit.extensions.api.changes.ReviewInput ( ) ; java.util.Map < java.lang.String , java.lang.Short > labels = new java.util.HashMap < java.lang.String , java.lang.Short > ( ) ; labels.put ( label , vote ) ; reviewInput.labels = labels ; gApi.changes ( ) . id ( change.id ) . revision ( change.currentRevision ) . review ( reviewInput ) ; }

Target:
private void updateVote ( com.google.gerrit.extensions.common.ChangeInfo change , java.lang.String label , short vote ) throws com.google.gerrit.extensions.restapi.RestApiException { com.googlesource.gerrit.plugins.automerger.DownstreamCreator.log.debug ( "Giving for label to {}" , vote , label , change.id ) ; com.google.gerrit.extensions.api.changes.ReviewInput reviewInput = new com.google.gerrit.extensions.api.changes.ReviewInput ( ) ; java.util.Map < java.lang.String , java.lang.Short > labels = new java.util.HashMap < java.lang.String , java.lang.Short > ( ) ; labels.put ( label , vote ) ; reviewInput.labels = labels ; reviewInput.notify = com.google.gerrit.extensions.api.changes.NotifyHandling.NONE ; gApi.changes ( ) . id ( change.id ) . revision ( change.currentRevision ) . review ( reviewInput ) ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; com.google.gerrit.client.diff.DiffApi.diff ( revision , path ) . base ( base ) . wholeFile ( ) . ignoreWhitespace ( DiffApi.IgnoreWhitespace.NONE ) . get ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.diff.DiffInfo > ( this ) { @ java.lang.Override protected void preDisplay ( com.google.gerrit.client.diff.DiffInfo diff ) { display ( diff ) ; } } ) ; }

Target:
public void onSuccess ( java.lang.Void result ) { }
Source:
private boolean canUpdate ( ) { if ( ( RefNames.REFS_CONFIG.equals ( refName ) ) && ( ! ( projectControl.isOwner ( ) ) ) ) { if ( ! ( ( projectControl.getProjectState ( ) . isAllProjects ( ) ) && ( getUser ( ) . getCapabilities ( ) . isAdmin_DoNotUse ( ) ) ) ) { return false ; } } return ( canPerform ( Permission.PUSH ) ) && ( canWrite ( ) ) ; }

Target:
private boolean canUpdate ( ) { if ( ( RefNames.REFS_CONFIG.equals ( refName ) ) && ( ! ( projectControl.isOwner ( ) ) ) ) { if ( ! ( ( projectControl.getProjectState ( ) . isAllProjects ( ) ) && ( getUser ( ) . getCapabilities ( ) . isAdmin_DoNotUse ( ) ) ) ) { return false ; } } return ( canPerform ( Permission.PUSH ) ) && ( isProjectStatePermittingWrite ( ) ) ; }
Source:
public void testFindAfterCommon ( ) { com.google.gerrit.client.diff.LineMapper mapper = new com.google.gerrit.client.diff.LineMapper ( ) ; mapper.appendCommon ( 10 ) ; org.junit.Assert.assertEquals ( 10 , mapper.lineOnOther ( Side.PARENT , 10 ) ) ; }

Target:
public void testFindAfterDeleteGap ( ) { com.google.gerrit.client.diff.LineMapper mapper = new com.google.gerrit.client.diff.LineMapper ( ) ; mapper.appendDelete ( 10 ) ; org.junit.Assert.assertEquals ( new com.google.gerrit.client.diff.LineMapper.LineOnOtherInfo ( 0 , true ) , mapper.lineOnOther ( Side.PARENT , 10 ) ) ; org.junit.Assert.assertEquals ( new com.google.gerrit.client.diff.LineMapper.LineOnOtherInfo ( 10 , true ) , mapper.lineOnOther ( Side.REVISION , 0 ) ) ; }
Source:
public void listTagsOfNonExistingProjectWithApi ( ) throws java.lang.Exception { exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; gApi.projects ( ) . name ( "does-not-exist" ) . tags ( ) ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; gApi.projects ( ) . name ( "does-not-exist" ) . tag ( "tag" ) . get ( ) ; }

Target:
public void getTagOfNonExistingProjectWithApi ( ) throws java.lang.Exception { exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; gApi.projects ( ) . name ( "does-not-exist" ) . tag ( "tag" ) . get ( ) ; }
Source:
com.googlesource.gerrit.plugins.gitiles.FilteredRepository create ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws com.google.gerrit.server.project.NoSuchProjectException , java.io.IOException { com.google.gerrit.server.project.ProjectControl ctl = projectControlFactory.controlFor ( name , userProvider.get ( ) ) ; if ( ! ( ctl.isVisible ( ) ) ) { throw new com.google.gerrit.server.project.NoSuchProjectException ( name ) ; } org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( name ) ; return new com.googlesource.gerrit.plugins.gitiles.FilteredRepository ( ctl , repo , new com.google.gerrit.server.git.VisibleRefFilter ( tagCache , changeNotesFactory , changeCache , repo , ctl , db.get ( ) , true ) ) ; }

Target:
com.googlesource.gerrit.plugins.gitiles.FilteredRepository create ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws com.google.gerrit.server.project.NoSuchProjectException , java.io.IOException { com.google.gerrit.server.project.ProjectControl ctl = projectControlFactory.controlFor ( name , userProvider.get ( ) ) ; if ( ctl.isHidden ( ) ) { throw new com.google.gerrit.server.project.NoSuchProjectException ( name ) ; } org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( name ) ; return new com.googlesource.gerrit.plugins.gitiles.FilteredRepository ( ctl , repo , new com.google.gerrit.server.git.VisibleRefFilter ( tagCache , changeNotesFactory , changeCache , repo , ctl , db.get ( ) , true ) ) ; }
Source:
public void onClick ( com.google.gwt.user.client.ui.Widget sender ) { final java.lang.String txt = descTxt.getText ( ) . trim ( ) ; Util.PROJECT_SVC.changeProjectDescription ( projectId , txt , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { saveDesc.setEnabled ( false ) ; } } ) ; }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { final java.lang.String txt = descTxt.getText ( ) . trim ( ) ; Util.PROJECT_SVC.changeProjectDescription ( projectId , txt , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { saveDesc.setEnabled ( false ) ; } } ) ; }
Source:
private com.google.gerrit.client.ui.InlineHyperlink createLink ( java.lang.String label , com.google.gerrit.reviewdb.client.PatchSet.Id id ) { assert ( other ) != null ; if ( sideA ) { assert ( other.idActive ) != null ; } com.google.gerrit.reviewdb.client.PatchSet.Id diffBase = ( sideA ) ? id : other.idActive ; com.google.gerrit.reviewdb.client.PatchSet.Id revision = ( sideA ) ? other.idActive : id ; return new com.google.gerrit.client.ui.InlineHyperlink ( label , ( ( parent ) instanceof com.google.gerrit.client.diff.SideBySide ? com.google.gerrit.client.Dispatcher.toSideBySide ( diffBase , revision , path ) : com.google.gerrit.client.Dispatcher.toUnified ( diffBase , revision , path ) ) ) ; }

Target:
private com.google.gerrit.client.ui.InlineHyperlink createLink ( java.lang.String label , com.google.gerrit.reviewdb.client.PatchSet.Id id ) { assert ( other ) != null ; if ( sideA ) { assert ( other.idActive ) != null ; } com.google.gerrit.reviewdb.client.PatchSet.Id diffBase = ( sideA ) ? id : other.idActive ; com.google.gerrit.reviewdb.client.PatchSet.Id revision = ( sideA ) ? other.idActive : id ; return new com.google.gerrit.client.ui.InlineHyperlink ( label , ( ( parent.diffScreenType ) == ( com.google.gerrit.extensions.client.GeneralPreferencesInfo.DiffView.SIDE_BY_SIDE ) ? com.google.gerrit.client.Dispatcher.toSideBySide ( diffBase , revision , path ) : com.google.gerrit.client.Dispatcher.toUnified ( diffBase , revision , path ) ) ) ; }
Source:
private org.eclipse.jetty.util.resource.Resource getBaseResource ( ) throws java.io.IOException { if ( ( baseResource ) == null ) { try { baseResource = unpackWar ( com.google.gerrit.launcher.GerritLauncher.getDistributionArchive ( ) ) ; } catch ( java.io.FileNotFoundException err ) { if ( ( err.getMessage ( ) ) == ( com.google.gerrit.launcher.GerritLauncher.NOT_ARCHIVED ) ) { baseResource = useDeveloperBuild ( ) ; } else { throw err ; } } } return baseResource ; }

Target:
private org.eclipse.jetty.util.resource.Resource getBaseResource ( org.eclipse.jetty.servlet.ServletContextHandler app ) throws java.io.IOException { if ( ( baseResource ) == null ) { try { baseResource = com.google.gerrit.pgm.http.jetty.JettyServer.unpackWar ( com.google.gerrit.launcher.GerritLauncher.getDistributionArchive ( ) ) ; } catch ( java.io.FileNotFoundException err ) { if ( ( err.getMessage ( ) ) == ( com.google.gerrit.launcher.GerritLauncher.NOT_ARCHIVED ) ) { baseResource = useDeveloperBuild ( app ) ; } else { throw err ; } } } return baseResource ; }
Source:
private com.google.inject.AbstractModule createIndexModule ( ) { if ( slave ) { return new com.google.gerrit.server.index.DummyIndexModule ( ) ; } switch ( indexType ) { case LUCENE : return ( luceneModule ) != null ? luceneModule : new com.google.gerrit.lucene.LuceneIndexModule ( ) ; default : throw new java.lang.IllegalStateException ( ( "unsupported index.type = " + ( indexType ) ) ) ; } }

Target:
private com.google.inject.AbstractModule createIndexModule ( ) { if ( slave ) { return new com.google.gerrit.server.index.DummyIndexModule ( ) ; } switch ( indexType ) { case LUCENE : return ( luceneModule ) != null ? luceneModule : com.google.gerrit.lucene.LuceneIndexModule.latestVersionWithOnlineUpgrade ( ) ; default : throw new java.lang.IllegalStateException ( ( "unsupported index.type = " + ( indexType ) ) ) ; } }
Source:
private void verifyComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) { com.google.common.base.Preconditions.checkArgument ( ( ( c.getRevId ( ) ) != null ) , "RevId required for comment: %s" , c ) ; com.google.common.base.Preconditions.checkArgument ( c.getAuthor ( ) . equals ( getAccountId ( ) ) , ( "The author for the following comment does not match the author of" + " this ChangeDraftUpdate (%s): %s" ) , getAccountId ( ) , c ) ; }

Target:
private void verifyComment ( com.google.gerrit.reviewdb.client.Comment c ) { com.google.common.base.Preconditions.checkArgument ( ( ( c.revId ) != null ) , "RevId required for comment: %s" , c ) ; com.google.common.base.Preconditions.checkArgument ( c.author.getId ( ) . equals ( getAccountId ( ) ) , ( "The author for the following comment does not match the author of" + " this ChangeDraftUpdate (%s): %s" ) , getAccountId ( ) , c ) ; }
Source:
public com.google.gerrit.server.account.AccountResource parse ( com.google.gerrit.extensions.restapi.TopLevelResource root , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.IdentifiedUser user = parseId ( id.get ( ) ) ; if ( user == null ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } else if ( ! ( accountControlFactory.get ( ) . canSee ( user.getAccount ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } return new com.google.gerrit.server.account.AccountResource ( user ) ; }

Target:
public com.google.gerrit.server.account.AccountResource parse ( com.google.gerrit.extensions.restapi.TopLevelResource root , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.IdentifiedUser user = parseId ( id.get ( ) ) ; if ( ( user == null ) || ( ! ( accountControlFactory.get ( ) . canSee ( user.getAccount ( ) ) ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( java.lang.String.format ( "Account '%s' is not found or ambiguous" , id ) ) ; } return new com.google.gerrit.server.account.AccountResource ( user ) ; }
Source:
public void testSubscriptionDeepRelative ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < ? > superRepo = createProjectWithPush ( "super-project" ) ; org.eclipse.jgit.junit.TestRepository < ? > subRepo = createProjectWithPush ( "nested/subscribed-to-project" ) ; allowSubmoduleSubscription ( "nested/subscribed-to-project" , "refs/heads/master" , "super-project" , null ) ; pushChangeTo ( subRepo , "master" ) ; createRelativeSubmoduleSubscription ( superRepo , "master" , "../" , "nested/subscribed-to-project" , "master" ) ; org.eclipse.jgit.lib.ObjectId subHEAD = pushChangeTo ( subRepo , "master" ) ; expectToHaveSubmoduleState ( superRepo , "master" , "nested/subscribed-to-project" , subHEAD ) ; }

Target:
public void testSubscriptionDeepRelative ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < ? > superRepo = createProjectWithPush ( "super-project" ) ; org.eclipse.jgit.junit.TestRepository < ? > subRepo = createProjectWithPush ( "nested/subscribed-to-project" ) ; allowMatchingSubmoduleSubscription ( "nested/subscribed-to-project" , "refs/heads/master" , "super-project" , null ) ; pushChangeTo ( subRepo , "master" ) ; createRelativeSubmoduleSubscription ( superRepo , "master" , "../" , "nested/subscribed-to-project" , "master" ) ; org.eclipse.jgit.lib.ObjectId subHEAD = pushChangeTo ( subRepo , "master" ) ; expectToHaveSubmoduleState ( superRepo , "master" , "nested/subscribed-to-project" , subHEAD ) ; }
Source:
public void flushWebSessionsCache_Forbidden ( ) throws java.lang.Exception { allowGlobalCapabilities ( com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , GlobalCapability.VIEW_CACHES , GlobalCapability.FLUSH_CACHES ) ; try { com.google.gerrit.acceptance.RestResponse r = userSession.post ( "/config/server/caches/accounts/flush" ) ; r.assertOK ( ) ; r.consume ( ) ; userSession.post ( "/config/server/caches/web_sessions/flush" ) . assertForbidden ( ) ; } finally { removeGlobalCapabilities ( com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , GlobalCapability.VIEW_CACHES , GlobalCapability.FLUSH_CACHES ) ; } }

Target:
public void flushWebSessionsCache_Forbidden ( ) throws java.lang.Exception { allowGlobalCapabilities ( com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , GlobalCapability.VIEW_CACHES , GlobalCapability.FLUSH_CACHES ) ; try { com.google.gerrit.acceptance.RestResponse r = userRestSession.post ( "/config/server/caches/accounts/flush" ) ; r.assertOK ( ) ; r.consume ( ) ; userRestSession.post ( "/config/server/caches/web_sessions/flush" ) . assertForbidden ( ) ; } finally { removeGlobalCapabilities ( com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , GlobalCapability.VIEW_CACHES , GlobalCapability.FLUSH_CACHES ) ; } }
Source:
public boolean equals ( final java.lang.Object obj ) { if ( ! ( obj instanceof com.google.gerrit.common.data.Permission ) ) { return false ; } final com.google.gerrit.common.data.Permission other = ( ( com.google.gerrit.common.data.Permission ) ( obj ) ) ; if ( ( ! ( name.equals ( other.name ) ) ) || ( ( exclusiveGroup ) != ( other.exclusiveGroup ) ) ) { return false ; } return new java.util.HashSet < com.google.gerrit.common.data.PermissionRule > ( rules ) . equals ( new java.util.HashSet < com.google.gerrit.common.data.PermissionRule > ( other.rules ) ) ; }

Target:
public boolean equals ( final java.lang.Object obj ) { if ( ! ( obj instanceof com.google.gerrit.common.data.Permission ) ) { return false ; } final com.google.gerrit.common.data.Permission other = ( ( com.google.gerrit.common.data.Permission ) ( obj ) ) ; if ( ( ! ( name.equals ( other.name ) ) ) || ( ( exclusiveGroup ) != ( other.exclusiveGroup ) ) ) { return false ; } return new java.util.HashSet < com.google.gerrit.common.data.PermissionRule > ( getRules ( ) ) . equals ( new java.util.HashSet < com.google.gerrit.common.data.PermissionRule > ( other.getRules ( ) ) ) ; }
Source:
public java.util.Set < java.lang.String > getEmailAddresses ( com.google.gerrit.server.IdentifiedUser user ) { java.util.Collection < com.google.gerrit.reviewdb.client.AccountExternalId > ids = user.state ( ) . getExternalIds ( ) ; java.util.Set < java.lang.String > emails = com.google.common.collect.Sets.newHashSetWithExpectedSize ( ids.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.AccountExternalId ext : ids ) { if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( ext.getEmailAddress ( ) ) ) ) { emails.add ( ext.getEmailAddress ( ) ) ; } } return emails ; }

Target:
public java.util.Set < java.lang.String > getEmailAddresses ( com.google.gerrit.server.IdentifiedUser user ) { java.util.Collection < com.google.gerrit.server.account.ExternalId > ids = user.state ( ) . getExternalIds ( ) ; java.util.Set < java.lang.String > emails = com.google.common.collect.Sets.newHashSetWithExpectedSize ( ids.size ( ) ) ; for ( com.google.gerrit.server.account.ExternalId ext : ids ) { if ( ! ( com.google.common.base.Strings.isNullOrEmpty ( ext.email ( ) ) ) ) { emails.add ( ext.email ( ) ) ; } } return emails ; }
Source:
public com.google.gwtjsonrpc.client.VoidResult run ( final com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gerrit.httpd.rpc.account.Failure , com.google.gwtorm.client.OrmException { final com.google.gerrit.reviewdb.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; assertAmGroupOwner ( db , group ) ; group.setDescription ( description ) ; db.accountGroups ( ) . update ( java.util.Collections.singleton ( group ) ) ; groupCache.evict ( group ) ; return com.google.gwtjsonrpc.client.VoidResult.INSTANCE ; }

Target:
public com.google.gwtjsonrpc.client.VoidResult run ( final com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gerrit.httpd.rpc.account.Failure , com.google.gwtorm.client.OrmException { final com.google.gerrit.reviewdb.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; assertAmGroupOwner ( db , group ) ; group.setVisibleToAll ( groupOptions.isVisibleToAll ( ) ) ; group.setEmailOnlyAuthors ( groupOptions.isEmailOnlyAuthors ( ) ) ; db.accountGroups ( ) . update ( java.util.Collections.singleton ( group ) ) ; groupCache.evict ( group ) ; return com.google.gwtjsonrpc.client.VoidResult.INSTANCE ; }
Source:
private synchronized void unloadPlugin ( com.google.gerrit.server.plugins.Plugin plugin ) { persistentCacheFactory.onStop ( 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 ) ; env.onStopPlugin ( plugin ) ; running.remove ( name ) ; disabled.remove ( name ) ; toCleanup.add ( plugin ) ; }

Target:
private synchronized void unloadPlugin ( com.google.gerrit.server.plugins.Plugin plugin ) { persistentCacheFactory.onStop ( plugin ) ; java.lang.String name = plugin.getName ( ) ; com.google.gerrit.server.plugins.PluginLoader.log.info ( java.lang.String.format ( "Unloading plugin %s, version %s" , name , plugin.getVersion ( ) ) ) ; plugin.stop ( env ) ; env.onStopPlugin ( plugin ) ; running.remove ( name ) ; disabled.remove ( name ) ; toCleanup.add ( plugin ) ; }
Source:
protected java.util.Set < com.google.gerrit.client.reviewdb.AccountGroup.Id > getProjectOwners ( ) { final com.google.gerrit.client.data.ProjectCache.Entry r ; r = com.google.gerrit.client.rpc.Common.getProjectCache ( ) . get ( change.getDest ( ) . getParentKey ( ) ) ; return r != null ? r.getOwners ( ) : java.util.Collections.< com.google.gerrit.client.reviewdb.AccountGroup.Id > emptySet ( ) ; }

Target:
protected java.util.Set < com.google.gerrit.client.reviewdb.AccountGroup.Id > getProjectOwners ( ) { final com.google.gerrit.server.project.ProjectState r ; r = projectCache.get ( change.getDest ( ) . getParentKey ( ) ) ; return r != null ? r.getOwners ( ) : java.util.Collections.< com.google.gerrit.client.reviewdb.AccountGroup.Id > emptySet ( ) ; }
Source:
public void onSuccess ( final com.google.gerrit.client.projects.ProjectMap result ) { if ( ( ( mySubname == null ) && ( ( subname ) == null ) ) || ( ( mySubname != null ) && ( mySubname.equals ( subname ) ) ) ) { display ( result ) ; } }

Target:
public java.lang.String getCurrentFilter ( ) { return subname ; }
Source:
public void tearDown ( ) { if ( ( lifecycle ) != null ) { lifecycle.stop ( ) ; } if ( ( db ) != null ) { db.close ( ) ; } com.google.gerrit.testutil.InMemoryDatabase.drop ( schemaFactory ) ; }

Target:
public void tearDown ( ) { if ( ( lifecycle ) != null ) { lifecycle.stop ( ) ; } requestContext.setContext ( null ) ; if ( ( db ) != null ) { db.close ( ) ; } com.google.gerrit.testutil.InMemoryDatabase.drop ( schemaFactory ) ; }
Source:
void onLogin ( ) { final org.apache.sshd.server.session.ServerSession s = session.get ( ) ; final java.net.SocketAddress addr = s.getIoSession ( ) . getRemoteAddress ( ) ; async.append ( log ( ( "LOGIN FROM " + ( com.google.gerrit.sshd.SshLog.format ( addr ) ) ) ) ) ; }

Target:
void onLogin ( ) { async.append ( log ( ( "LOGIN FROM " + ( session.get ( ) . getRemoteAddressAsString ( ) ) ) ) ) ; }
Source:
public com.google.common.collect.ImmutableSetMultimap < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.reviewdb.client.AccountExternalId > load ( com.google.gerrit.server.account.ExternalIdCacheImpl.AllKey key ) throws java.lang.Exception { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { com.google.common.collect.Multimap < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.reviewdb.client.AccountExternalId > extIdsByAccount = com.google.common.collect.MultimapBuilder.hashKeys ( ) . arrayListValues ( ) . build ( ) ; for ( com.google.gerrit.reviewdb.client.AccountExternalId extId : db.accountExternalIds ( ) . all ( ) ) { extIdsByAccount.put ( extId.getAccountId ( ) , extId ) ; } return com.google.common.collect.ImmutableSetMultimap.copyOf ( extIdsByAccount ) ; } }

Target:
public com.google.common.collect.ImmutableSetMultimap < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.reviewdb.client.AccountExternalId > load ( com.google.gerrit.server.account.ExternalIdCacheImpl.AllKey key ) throws java.lang.Exception { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { com.google.common.collect.ListMultimap < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.reviewdb.client.AccountExternalId > extIdsByAccount = com.google.common.collect.MultimapBuilder.hashKeys ( ) . arrayListValues ( ) . build ( ) ; for ( com.google.gerrit.reviewdb.client.AccountExternalId extId : db.accountExternalIds ( ) . all ( ) ) { extIdsByAccount.put ( extId.getAccountId ( ) , extId ) ; } return com.google.common.collect.ImmutableSetMultimap.copyOf ( extIdsByAccount ) ; } }
Source:
public void postRun ( ) throws java.lang.Exception { }

Target:
private boolean isEmptySite ( ) { try ( java.nio.file.DirectoryStream < java.nio.file.Path > files = java.nio.file.Files.newDirectoryStream ( site.resolve ( gerrit.get ( "basePath" ) ) ) ) { return com.google.common.collect.Iterables.isEmpty ( files ) ; } catch ( java.io.IOException e ) { return true ; } }
Source:
protected void doPost ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse resp ) throws java.io.IOException { try { com.google.gwtjsonrpc.server.JsonServlet.perThreadRequest.set ( req ) ; com.google.gwtjsonrpc.server.JsonServlet.perThreadResponse.set ( resp ) ; doService ( req , resp ) ; } finally { com.google.gwtjsonrpc.server.JsonServlet.perThreadRequest.set ( null ) ; com.google.gwtjsonrpc.server.JsonServlet.perThreadResponse.set ( null ) ; } }

Target:
protected void doPost ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse resp ) throws java.io.IOException { try { final com.google.gwtjsonrpc.server.ActiveCall c = createActiveCall ( req , resp ) ; com.google.gwtjsonrpc.server.JsonServlet.perThreadCall.set ( c ) ; doService ( c ) ; } finally { com.google.gwtjsonrpc.server.JsonServlet.perThreadCall.set ( null ) ; } }
Source:
public void setNotify ( final com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType type , final boolean v ) { switch ( type ) { case NEW_CHANGES : notifyNewChanges = v ; break ; case ALL_COMMENTS : notifyAllComments = v ; break ; case SUBMITTED_CHANGES : notifySubmittedChanges = v ; break ; } }

Target:
public void setNotify ( final com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType type , final boolean v ) { switch ( type ) { case NEW_CHANGES : notifyNewChanges = v ; break ; case ALL_COMMENTS : notifyAllComments = v ; break ; case SUBMITTED_CHANGES : notifySubmittedChanges = v ; break ; case ALL : notifyNewChanges = v ; notifyAllComments = v ; notifySubmittedChanges = v ; break ; } }
Source:
public java.nio.file.FileVisitResult visitFile ( java.nio.file.Path file , java.nio.file.attribute.BasicFileAttributes attrs ) throws java.io.IOException { java.nio.file.Path f = source.relativize ( file ) ; if ( java.nio.file.Files.isRegularFile ( file ) ) { java.nio.file.Files.copy ( file , target.resolve ( f ) ) ; } return java.nio.file.FileVisitResult.CONTINUE ; }

Target:
public java.nio.file.FileVisitResult visitFile ( java.nio.file.Path file , java.nio.file.attribute.BasicFileAttributes attrs ) throws java.io.IOException { java.nio.file.Path f = source.relativize ( file ) ; if ( file.toFile ( ) . isFile ( ) ) { java.nio.file.Files.copy ( file , target.resolve ( f ) ) ; } return java.nio.file.FileVisitResult.CONTINUE ; }
Source:
public void gcWithoutCapability_Error ( ) throws java.lang.Exception { userSshSession.exec ( "gerrit gc --all" ) ; com.google.common.truth.Truth.assertThat ( userSshSession.hasError ( ) ) . isTrue ( ) ; java.lang.String error = userSshSession.getError ( ) ; com.google.common.truth.Truth.assertThat ( error ) . isNotNull ( ) ; assertError ( ( "One of the following capabilities is required to access this" + " resource: [runGC, maintainServer]" ) , error ) ; }

Target:
public void gcWithoutCapability_Error ( ) throws java.lang.Exception { userSshSession.exec ( "gerrit gc --all" ) ; com.google.common.truth.Truth.assertThat ( userSshSession.hasError ( ) ) . isTrue ( ) ; java.lang.String error = userSshSession.getError ( ) ; com.google.common.truth.Truth.assertThat ( error ) . isNotNull ( ) ; assertError ( "maintain server not permitted" , error ) ; }
Source:
private synchronized com.google.gerrit.testutil.InMemoryRepositoryManager.Repo get ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws org.eclipse.jgit.errors.RepositoryNotFoundException { com.google.gerrit.testutil.InMemoryRepositoryManager.Repo repo = repos.get ( com.google.gerrit.testutil.InMemoryRepositoryManager.normalize ( name ) ) ; if ( repo != null ) { return repo ; } throw new org.eclipse.jgit.errors.RepositoryNotFoundException ( name.get ( ) ) ; }

Target:
private synchronized com.google.gerrit.testutil.InMemoryRepositoryManager.Repo get ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws org.eclipse.jgit.errors.RepositoryNotFoundException { com.google.gerrit.testutil.InMemoryRepositoryManager.Repo repo = repos.get ( com.google.gerrit.testutil.InMemoryRepositoryManager.normalize ( name ) ) ; if ( repo != null ) { repo.incrementOpen ( ) ; return repo ; } throw new org.eclipse.jgit.errors.RepositoryNotFoundException ( name.get ( ) ) ; }
Source:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.account.AccountResource.Email rsrc , com.google.gerrit.server.account.DeleteEmail.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { if ( ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) && ( ! ( self.get ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "not allowed to delete email address" ) ; } return apply ( rsrc.getUser ( ) , rsrc.getEmail ( ) ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.account.AccountResource.Email rsrc , com.google.gerrit.server.account.DeleteEmail.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.MethodNotAllowedException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { if ( ( ( self.get ( ) ) != ( rsrc.getUser ( ) ) ) && ( ! ( self.get ( ) . getCapabilities ( ) . canModifyAccount ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "not allowed to delete email address" ) ; } return apply ( rsrc.getUser ( ) , rsrc.getEmail ( ) ) ; }
Source:
private void createProject ( org.eclipse.jgit.transport.URIish replicateURI , java.lang.String head ) { if ( ! ( replicateURI.isRemote ( ) ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.createLocally ( replicateURI , head ) ; } else if ( com.googlesource.gerrit.plugins.replication.ReplicationQueue.isSSH ( replicateURI ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.createRemoteSsh ( replicateURI , head ) ; } else { com.googlesource.gerrit.plugins.replication.ReplicationQueue.log.warn ( java.lang.String.format ( ( "Cannot create new project on remote site %s." + ( " Only local paths and SSH URLs are supported" + " for remote repository creation" ) ) , replicateURI ) ) ; } }

Target:
private void createProject ( org.eclipse.jgit.transport.URIish replicateURI , java.lang.String head ) { if ( ! ( replicateURI.isRemote ( ) ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.createLocally ( replicateURI , head ) ; com.googlesource.gerrit.plugins.replication.ReplicationQueue.log.info ( ( "Created local repository: " + replicateURI ) ) ; } else if ( com.googlesource.gerrit.plugins.replication.ReplicationQueue.isSSH ( replicateURI ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.createRemoteSsh ( replicateURI , head ) ; com.googlesource.gerrit.plugins.replication.ReplicationQueue.log.info ( ( "Created remote repository: " + replicateURI ) ) ; } else { com.googlesource.gerrit.plugins.replication.ReplicationQueue.log.warn ( java.lang.String.format ( ( "Cannot create new project on remote site %s." + ( " Only local paths and SSH URLs are supported" + " for remote repository creation" ) ) , replicateURI ) ) ; } }
Source:
protected void run ( java.lang.String [ ] args ) throws com.google.gerrit.server.ssh.Failure { final com.google.gerrit.client.data.GroupCache gc = getGerritServer ( ) . getGroupCache ( ) ; if ( gc.isAdministrator ( getAccountId ( ) ) ) { gc.flush ( ) ; } else { throw new com.google.gerrit.server.ssh.Failure ( 1 , "fatal: Not a Gerrit administrator" ) ; } }

Target:
protected void run ( java.lang.String [ ] args ) throws com.google.gerrit.server.ssh.Failure { final com.google.gerrit.client.data.GroupCache gc = com.google.gerrit.client.rpc.Common.getGroupCache ( ) ; if ( gc.isAdministrator ( getAccountId ( ) ) ) { gc.flush ( ) ; } else { throw new com.google.gerrit.server.ssh.Failure ( 1 , "fatal: Not a Gerrit administrator" ) ; } }
Source:
public void currentRevision ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo c = get ( changeId , com.google.gerrit.extensions.common.ListChangesOption.CURRENT_REVISION ) ; org.junit.Assert.assertEquals ( commitId ( 2 ) , c.currentRevision ) ; org.junit.Assert.assertEquals ( com.google.common.collect.ImmutableSet.of ( commitId ( 2 ) ) , c.revisions.keySet ( ) ) ; org.junit.Assert.assertEquals ( 3 , c.revisions.get ( commitId ( 2 ) ) . _number ) ; }

Target:
public void currentRevision ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo c = get ( changeId , com.google.gerrit.extensions.common.ListChangesOption.CURRENT_REVISION ) ; com.google.common.truth.Truth.assertThat ( c.currentRevision ) . isEqualTo ( commitId ( 2 ) ) ; com.google.common.truth.Truth.assertThat ( ( ( java.lang.Iterable < ? > ) ( c.revisions.keySet ( ) ) ) ) . containsAllIn ( com.google.common.collect.ImmutableSet.of ( commitId ( 2 ) ) ) ; com.google.common.truth.Truth.assertThat ( c.revisions.get ( commitId ( 2 ) ) . _number ) . isEqualTo ( 3 ) ; }
Source:
protected static java.util.List < java.lang.Integer > query ( com.google.gerrit.extensions.api.changes.Changes.QueryRequest query ) throws java.lang.Exception { return com.google.common.collect.FluentIterable.from ( query.get ( ) ) . transform ( new com.google.common.base.Function < com.google.gerrit.extensions.common.ChangeInfo , java.lang.Integer > ( ) { @ java.lang.Override public java.lang.Integer apply ( com.google.gerrit.extensions.common.ChangeInfo in ) { return in._number ; } } ) . toList ( ) ; }

Target:
protected static java.lang.Iterable < java.lang.Integer > ids ( java.lang.Iterable < com.google.gerrit.extensions.common.ChangeInfo > changes ) { return com.google.common.collect.FluentIterable.from ( changes ) . transform ( new com.google.common.base.Function < com.google.gerrit.extensions.common.ChangeInfo , java.lang.Integer > ( ) { @ java.lang.Override public java.lang.Integer apply ( com.google.gerrit.extensions.common.ChangeInfo in ) { return in._number ; } } ) ; }
Source:
public com.google.gitiles.GitilesView.Builder setTreePath ( java.lang.String path ) { switch ( type ) { case PATH : case DIFF : this . path = com.google.gitiles.GitilesView.maybeTrimLeadingAndTrailingSlash ( com.google.common.base.Preconditions.checkNotNull ( path ) ) ; return this ; case LOG : this . path = ( path != null ) ? com.google.gitiles.GitilesView.maybeTrimLeadingAndTrailingSlash ( path ) : null ; return this ; default : throw new java.lang.IllegalStateException ( java.lang.String.format ( "cannot set path on %s view" , type ) ) ; } }

Target:
public com.google.gitiles.GitilesView.Builder setTreePath ( java.lang.String path ) { switch ( type ) { case PATH : case DIFF : this . path = com.google.gitiles.GitilesView.maybeTrimLeadingAndTrailingSlash ( com.google.common.base.Preconditions.checkNotNull ( path ) ) ; return this ; case REFS : case LOG : this . path = ( path != null ) ? com.google.gitiles.GitilesView.maybeTrimLeadingAndTrailingSlash ( path ) : null ; return this ; default : throw new java.lang.IllegalStateException ( java.lang.String.format ( "cannot set path on %s view" , type ) ) ; } }
Source:
public static < T , P extends com.google.gerrit.server.query.Predicate < T > > P find ( com.google.gerrit.server.query.Predicate < T > p , java.lang.Class < P > clazz ) { if ( clazz.isAssignableFrom ( p.getClass ( ) ) ) { return ( ( P ) ( p ) ) ; } for ( com.google.gerrit.server.query.Predicate < T > c : p.getChildren ( ) ) { P r = com.google.gerrit.server.query.QueryBuilder.find ( c , clazz ) ; if ( r != null ) { return r ; } } return null ; }

Target:
public static < T , P extends com.google.gerrit.index.query.Predicate < T > > P find ( com.google.gerrit.index.query.Predicate < T > p , java.lang.Class < P > clazz ) { if ( clazz.isAssignableFrom ( p.getClass ( ) ) ) { return ( ( P ) ( p ) ) ; } for ( com.google.gerrit.index.query.Predicate < T > c : p.getChildren ( ) ) { P r = com.google.gerrit.index.query.QueryBuilder.find ( c , clazz ) ; if ( r != null ) { return r ; } } return null ; }
Source:
public static void applyUserPreferences ( ) { if ( ( com.google.gerrit.client.Gerrit.myAccount ) != null ) { final com.google.gerrit.reviewdb.client.AccountGeneralPreferences p = com.google.gerrit.client.Gerrit.myAccount.getGeneralPreferences ( ) ; com.google.gwtexpui.clippy.client.CopyableLabel.setFlashEnabled ( p.isUseFlashClipboard ( ) ) ; if ( ( com.google.gerrit.client.Gerrit.siteHeader ) != null ) { com.google.gerrit.client.Gerrit.siteHeader.setVisible ( p.isShowSiteHeader ( ) ) ; } if ( ( com.google.gerrit.client.Gerrit.siteFooter ) != null ) { com.google.gerrit.client.Gerrit.siteFooter.setVisible ( p.isShowSiteHeader ( ) ) ; } com.google.gerrit.client.FormatUtil.setPreferences ( com.google.gerrit.client.Gerrit.myAccount.getGeneralPreferences ( ) ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.account.EditPreferences prefs ) { com.google.gerrit.extensions.client.EditPreferencesInfo prefsInfo = new com.google.gerrit.extensions.client.EditPreferencesInfo ( ) ; prefs.copyTo ( prefsInfo ) ; com.google.gerrit.client.Gerrit.editPrefs = prefsInfo ; }
Source:
public void testBlockRule_ParentBlocksChildEvenIfAlreadyBlockedInChild ( ) { com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/tags/*" ) ; com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/tags/*" ) ; com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/tags/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't update tag" , u.controlForRef ( "refs/tags/V10" ) . canUpdate ( ) ) ; }

Target:
public void testBlockRule_ParentBlocksChildEvenIfAlreadyBlockedInChild ( ) { com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/tags/*" ) ; com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/tags/*" ) ; com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/tags/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertCannotUpdate ( "refs/tags/V10" , u ) ; }
Source:
public static void getContentOrMessage ( com.google.gerrit.reviewdb.client.PatchSet.Id id , java.lang.String path , com.google.gwt.user.client.rpc.AsyncCallback < java.lang.String > cb ) { com.google.gerrit.client.rpc.RestApi api = ( ( Patch.COMMIT_MSG.equals ( path ) ) && ( ( id.get ( ) ) == 0 ) ) ? com.google.gerrit.client.changes.ChangeFileApi.messageEdit ( id ) : com.google.gerrit.client.changes.ChangeFileApi.contentEditOrPs ( id , path ) ; api.get ( com.google.gerrit.client.changes.ChangeFileApi.wrapper ( cb ) ) ; }

Target:
public static void getContentOrMessage ( com.google.gerrit.reviewdb.client.PatchSet.Id id , java.lang.String path , com.google.gerrit.client.rpc.HttpCallback < com.google.gerrit.client.rpc.NativeString > cb ) { com.google.gerrit.client.rpc.RestApi api = ( ( Patch.COMMIT_MSG.equals ( path ) ) && ( ( id.get ( ) ) == 0 ) ) ? com.google.gerrit.client.changes.ChangeFileApi.messageEdit ( id ) : com.google.gerrit.client.changes.ChangeFileApi.contentEditOrPs ( id , path ) ; api.get ( cb ) ; }
Source:
private com.google.gerrit.server.project.ChangeControl incrementPatchSet ( com.google.gerrit.server.project.ChangeControl ctl , org.eclipse.jgit.revwalk.RevCommit commit ) throws java.lang.Exception { com.google.gerrit.server.change.PatchSetInserter ins ; try ( com.google.gerrit.server.update.BatchUpdate bu = newUpdate ( ctl.getChange ( ) . getOwner ( ) ) ) { ins = patchSetInserterFactory.create ( ctl , nextPatchSetId ( ctl ) , commit ) . setValidate ( false ) . setFireRevisionCreated ( false ) . setNotify ( NotifyHandling.NONE ) ; bu.addOp ( ctl.getId ( ) , ins ) . execute ( ) ; } return reload ( ctl ) ; }

Target:
private com.google.gerrit.server.project.ChangeControl incrementPatchSet ( com.google.gerrit.server.project.ChangeControl ctl , org.eclipse.jgit.revwalk.RevCommit commit ) throws java.lang.Exception { com.google.gerrit.server.change.PatchSetInserter ins ; try ( com.google.gerrit.server.update.BatchUpdate bu = newUpdate ( ctl.getChange ( ) . getOwner ( ) ) ) { ins = patchSetInserterFactory.create ( ctl.getNotes ( ) , nextPatchSetId ( ctl ) , commit ) . setValidate ( false ) . setFireRevisionCreated ( false ) . setNotify ( NotifyHandling.NONE ) ; bu.addOp ( ctl.getId ( ) , ins ) . execute ( ) ; } return reload ( ctl ) ; }
Source:
public Change.Id cherryPick ( com.google.gerrit.server.update.BatchUpdate.Factory batchUpdateFactory , com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet patch , com.google.gerrit.extensions.api.changes.CherryPickInput input , com.google.gerrit.server.project.RefControl refControl ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.IntegrationException , com.google.gerrit.server.project.InvalidChangeOperationException , com.google.gerrit.server.update.UpdateException , com.google.gwtorm.server.OrmException , java.io.IOException { return cherryPick ( batchUpdateFactory , change.getId ( ) , patch.getId ( ) , change.getDest ( ) , change.getTopic ( ) , change.getProject ( ) , org.eclipse.jgit.lib.ObjectId.fromString ( patch.getRevision ( ) . get ( ) ) , input , refControl ) ; }

Target:
public Change.Id cherryPick ( com.google.gerrit.server.update.BatchUpdate.Factory batchUpdateFactory , com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet patch , com.google.gerrit.extensions.api.changes.CherryPickInput input , com.google.gerrit.server.project.RefControl refControl ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.IntegrationException , com.google.gerrit.server.project.InvalidChangeOperationException , com.google.gerrit.server.update.UpdateException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { return cherryPick ( batchUpdateFactory , change , patch.getId ( ) , change.getProject ( ) , org.eclipse.jgit.lib.ObjectId.fromString ( patch.getRevision ( ) . get ( ) ) , input , refControl ) ; }
Source:
private void setSubmitType ( com.google.gerrit.extensions.common.SubmitType submitType ) throws java.io.IOException { com.google.gerrit.server.project.PutConfig.Input in = new com.google.gerrit.server.project.PutConfig.Input ( ) ; in.submitType = submitType ; in.useContentMerge = com.google.gerrit.extensions.common.InheritableBoolean.FALSE ; com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( ( "/projects/" + ( project.get ( ) ) ) + "/config" ) , in ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; r.consume ( ) ; }

Target:
protected void setUseContentMerge ( ) throws java.io.IOException { com.google.gerrit.server.project.PutConfig.Input in = new com.google.gerrit.server.project.PutConfig.Input ( ) ; in.useContentMerge = com.google.gerrit.extensions.client.InheritableBoolean.TRUE ; com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( ( "/projects/" + ( project.get ( ) ) ) + "/config" ) , in ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_OK ) ; r.consume ( ) ; }