auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static PermissionRange.WithDefaults getRange ( java.lang.String varName ) { if ( com.google.gerrit.common.data.GlobalCapability.QUERY_LIMIT.equalsIgnoreCase ( varName ) ) { return new com.google.gerrit.common.data.PermissionRange.WithDefaults ( varName , 0 , java.lang.Integer.MAX_VALUE , 0 , com.google.gerrit.common.data.GlobalCapability.DEFAULT_MAX_QUERY_LIMIT ) ; } if ( com.google.gerrit.common.data.GlobalCapability.BATCH_CHANGES_LIMIT.equalsIgnoreCase ( varName ) ) { return new com.google.gerrit.common.data.PermissionRange.WithDefaults ( varName , 0 , java.lang.Integer.MAX_VALUE , 0 , com.google.gerrit.common.data.GlobalCapability.DEFAULT_MAX_BATCH_CHANGES ) ; } return null ; }

Target:
public static PermissionRange.WithDefaults getRange ( java.lang.String varName ) { if ( com.google.gerrit.common.data.GlobalCapability.QUERY_LIMIT.equalsIgnoreCase ( varName ) ) { return new com.google.gerrit.common.data.PermissionRange.WithDefaults ( varName , 0 , java.lang.Integer.MAX_VALUE , 0 , com.google.gerrit.common.data.GlobalCapability.DEFAULT_MAX_QUERY_LIMIT ) ; } if ( com.google.gerrit.common.data.GlobalCapability.BATCH_CHANGES_LIMIT.equalsIgnoreCase ( varName ) ) { return new com.google.gerrit.common.data.PermissionRange.WithDefaults ( varName , 0 , java.lang.Integer.MAX_VALUE , 0 , com.google.gerrit.common.data.GlobalCapability.DEFAULT_MAX_BATCH_CHANGES_LIMIT ) ; } return null ; }
Source:
private static java.lang.String getVersion ( final java.io.File plugin ) throws java.io.IOException { final java.util.jar.JarFile jarFile = new java.util.jar.JarFile ( plugin ) ; try { final java.util.jar.Manifest manifest = jarFile.getManifest ( ) ; final java.util.jar.Attributes main = manifest.getMainAttributes ( ) ; return main.getValue ( java.util.jar.Attributes.Name.IMPLEMENTATION_VERSION ) ; } finally { jarFile.close ( ) ; } }

Target:
private static java.lang.String getVersion ( java.nio.file.Path plugin ) throws java.io.IOException { java.util.jar.JarFile jarFile = new java.util.jar.JarFile ( plugin.toFile ( ) ) ; try { java.util.jar.Manifest manifest = jarFile.getManifest ( ) ; java.util.jar.Attributes main = manifest.getMainAttributes ( ) ; return main.getValue ( java.util.jar.Attributes.Name.IMPLEMENTATION_VERSION ) ; } finally { jarFile.close ( ) ; } }
Source:
public static java.lang.Iterable < com.google.gerrit.server.plugins.JarScanner.ExtensionMetaData > scan ( java.io.File file , java.lang.String pluginName , java.lang.Class < ? extends java.lang.annotation.Annotation > annotation ) throws com.google.gerrit.server.plugins.InvalidPluginException , java.io.IOException { java.util.Map < java.lang.Class < ? extends java.lang.annotation.Annotation > , java.lang.Iterable < com.google.gerrit.server.plugins.JarScanner.ExtensionMetaData > > result = com.google.gerrit.server.plugins.JarScanner.scan ( new java.util.jar.JarFile ( file ) , pluginName , java.util.Arrays.< java.lang.Class < ? extends java.lang.annotation.Annotation > > asList ( annotation ) ) ; return result.get ( annotation ) ; }

Target:
private java.util.Map < java.lang.Object , java.lang.String > attributesOf ( java.util.jar.JarEntry jarEntry ) throws java.io.IOException { java.util.jar.Attributes attributes = jarEntry.getAttributes ( ) ; if ( attributes == null ) { return java.util.Collections.emptyMap ( ) ; } return com.google.common.collect.Maps.transformEntries ( attributes , new com.google.common.collect.Maps.EntryTransformer < java.lang.Object , java.lang.Object , java.lang.String > ( ) { @ java.lang.Override public java.lang.String transformEntry ( java.lang.Object key , java.lang.Object value ) { return ( ( java.lang.String ) ( value ) ) ; } } ) ; }
Source:
public void unblockOtherPermissionWithMoreSpecificRefAndExclusiveFlag_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/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/master" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.SUBMIT , com.google.gerrit.server.project.Util.DEVS , "refs/heads/master" , true ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertCannotUpdate ( "refs/heads/master" , u ) ; }

Target:
public void unblockOtherPermissionWithMoreSpecificRefAndExclusiveFlag_Fails ( ) { com.google.gerrit.server.project.testing.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.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.testing.Util.DEVS , "refs/heads/master" ) ; com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.SUBMIT , com.google.gerrit.server.project.testing.Util.DEVS , "refs/heads/master" , true ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.testing.Util.DEVS ) ; assertCannotUpdate ( "refs/heads/master" , u ) ; }
Source:
public com.google.gerrit.server.index.QueryOptions convertForBackend ( ) { int backendLimit = config ( ) . maxLimit ( ) ; int limit = com.google.common.primitives.Ints.saturatedCast ( ( ( ( long ) ( limit ( ) ) ) + ( start ( ) ) ) ) ; limit = java.lang.Math.min ( limit , backendLimit ) ; return com.google.gerrit.server.index.QueryOptions.create ( config ( ) , 0 , limit , fields ( ) ) ; }

Target:
public com.google.gerrit.index.QueryOptions convertForBackend ( ) { int backendLimit = config ( ) . maxLimit ( ) ; int limit = com.google.common.primitives.Ints.saturatedCast ( ( ( ( long ) ( limit ( ) ) ) + ( start ( ) ) ) ) ; limit = java.lang.Math.min ( limit , backendLimit ) ; return com.google.gerrit.index.QueryOptions.create ( config ( ) , 0 , limit , fields ( ) ) ; }
Source:
void showTable ( ) { myBody.clear ( ) ; myBody.add ( table ) ; table.finishDisplay ( ) ; }

Target:
void showTable ( ) { this . myBody.clear ( ) ; this . myBody.add ( table ) ; this . myTable = table ; table.finishDisplay ( ) ; if ( ( this . onLoadCommand ) != null ) { this . onLoadCommand.execute ( ) ; this . onLoadCommand = null ; } }
Source:
public com.google.gerrit.extensions.api.changes.ChangeApi cherryPick ( com.google.gerrit.extensions.api.changes.CherryPickInput input ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return changes.id ( cherryPickCommit.apply ( commitResource , input ) . _number ) ; } catch ( com.google.gwtorm.server.OrmException | java.io.IOException | com.google.gerrit.server.update.UpdateException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot cherry pick" , e ) ; } }

Target:
public com.google.gerrit.extensions.api.changes.ChangeApi cherryPick ( com.google.gerrit.extensions.api.changes.CherryPickInput input ) throws com.google.gerrit.extensions.restapi.RestApiException { try { return changes.id ( cherryPickCommit.apply ( commitResource , input ) . _number ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot cherry pick" , e ) ; } }
Source:
private java.util.List < com.google.gerrit.extensions.api.projects.TagInfo > listTags ( com.google.gerrit.server.api.projects.ListRefsRequest < com.google.gerrit.extensions.api.projects.TagInfo > request ) throws com.google.gerrit.extensions.restapi.RestApiException { listTags.setLimit ( request.getLimit ( ) ) ; listTags.setStart ( request.getStart ( ) ) ; listTags.setMatchSubstring ( request.getSubstring ( ) ) ; listTags.setMatchRegex ( request.getRegex ( ) ) ; try { return listTags.apply ( checkExists ( ) ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot list tags" , e ) ; } }

Target:
public com.google.gerrit.extensions.api.projects.DashboardApi defaultDashboard ( ) throws com.google.gerrit.extensions.restapi.RestApiException { return dashboard ( com.google.gerrit.server.project.DashboardsCollection.DEFAULT_DASHBOARD_NAME ) ; }
Source:
private com.google.gerrit.server.change.ReviewerJson.PostResult putAccount ( com.google.gerrit.server.change.ReviewerResource rsrc ) throws com.google.gwtorm.server.OrmException { }

Target:
private com.google.gerrit.server.change.ReviewerJson.PostResult putAccount ( com.google.gerrit.server.change.ReviewerResource rsrc ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.Account member = rsrc.getUser ( ) . getAccount ( ) ; com.google.gerrit.server.project.ChangeControl control = rsrc.getControl ( ) ; com.google.gerrit.server.change.ReviewerJson.PostResult result = new com.google.gerrit.server.change.ReviewerJson.PostResult ( ) ; if ( isValidReviewer ( member , control ) ) { addReviewers ( rsrc , result , com.google.common.collect.ImmutableMap.of ( member.getId ( ) , control ) ) ; } return result ; }
Source:
public void testGetJGroupsChannel ( ) throws java.lang.Exception { org.mockito.Mockito.when ( configMock.getEnum ( com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , null , com.ericsson.gerrit.plugins.highavailability.Configuration.STRATEGY_KEY , com.ericsson.gerrit.plugins.highavailability.Configuration.DEFAULT_PEER_INFO_STRATEGY ) ) . thenReturn ( Configuration.PeerInfoStrategy.JGROUPS ) ; initializeConfiguration ( ) ; com.google.common.truth.Truth.assertThat ( configuration.peerInfoJGroups ( ) . clusterName ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.highavailability.Configuration.DEFAULT_CLUSTER_NAME ) ; org.mockito.Mockito.when ( configMock.getString ( com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , com.ericsson.gerrit.plugins.highavailability.Configuration.JGROUPS_SUBSECTION , com.ericsson.gerrit.plugins.highavailability.Configuration.CLUSTER_NAME_KEY ) ) . thenReturn ( "foo" ) ; initializeConfiguration ( ) ; com.google.common.truth.Truth.assertThat ( configuration.peerInfoJGroups ( ) . clusterName ( ) ) . isEqualTo ( "foo" ) ; }

Target:
public void testGetJGroupsChannel ( ) throws java.lang.Exception { org.mockito.Mockito.when ( configMock.getEnum ( com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , null , com.ericsson.gerrit.plugins.highavailability.Configuration.STRATEGY_KEY , com.ericsson.gerrit.plugins.highavailability.Configuration.DEFAULT_PEER_INFO_STRATEGY ) ) . thenReturn ( Configuration.PeerInfoStrategy.JGROUPS ) ; initializeConfiguration ( ) ; com.google.common.truth.Truth.assertThat ( configuration.jgroups ( ) . clusterName ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.highavailability.Configuration.DEFAULT_CLUSTER_NAME ) ; org.mockito.Mockito.when ( configMock.getString ( com.ericsson.gerrit.plugins.highavailability.Configuration.JGROUPS_SECTION , null , com.ericsson.gerrit.plugins.highavailability.Configuration.CLUSTER_NAME_KEY ) ) . thenReturn ( "foo" ) ; initializeConfiguration ( ) ; com.google.common.truth.Truth.assertThat ( configuration.jgroups ( ) . clusterName ( ) ) . isEqualTo ( "foo" ) ; }
Source:
private com.google.gerrit.server.git.MergeOpRepoManager.OpenRepo getRepo ( com.google.gerrit.reviewdb.client.Project.NameKey project ) throws java.io.IOException { if ( ( orm ) == null ) { orm = repoManagerProvider.get ( ) ; } try { com.google.gerrit.server.git.MergeOpRepoManager.OpenRepo or = orm.openRepo ( project ) ; com.google.common.base.Preconditions.checkState ( or.rw.hasRevSort ( RevSort.TOPO ) ) ; return or ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { throw new java.io.IOException ( e ) ; } }

Target:
private com.google.gerrit.server.git.MergeOpRepoManager.OpenRepo getRepo ( com.google.gerrit.reviewdb.client.Project.NameKey project ) throws java.io.IOException { if ( ( orm ) == null ) { orm = repoManagerProvider.get ( ) ; closeOrm = true ; } try { com.google.gerrit.server.git.MergeOpRepoManager.OpenRepo or = orm.openRepo ( project ) ; com.google.common.base.Preconditions.checkState ( or.rw.hasRevSort ( RevSort.TOPO ) ) ; return or ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { throw new java.io.IOException ( e ) ; } }
Source:
private void setSubmitType ( com.google.gerrit.extensions.client.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.client.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 updateProjectInput ( com.google.gerrit.extensions.api.projects.ProjectInput in ) { in.submitType = getSubmitType ( ) ; if ( ( in.useContentMerge ) == ( com.google.gerrit.extensions.client.InheritableBoolean.INHERIT ) ) { in.useContentMerge = com.google.gerrit.extensions.client.InheritableBoolean.FALSE ; } }
Source:
public com.google.gerrit.extensions.restapi.RestView < com.google.gerrit.extensions.restapi.TopLevelResource > list ( ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceNotFoundException { final com.google.gerrit.server.CurrentUser user = self.get ( ) ; if ( user instanceof com.google.gerrit.server.AnonymousUser ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Authentication required" ) ; } else if ( ! ( user.isIdentifiedUser ( ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } return list.get ( ) ; }

Target:
public com.google.gerrit.extensions.restapi.RestView < com.google.gerrit.extensions.restapi.TopLevelResource > list ( ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceNotFoundException { final com.google.gerrit.server.CurrentUser user = self.get ( ) ; if ( user instanceof com.google.gerrit.server.AnonymousUser ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "Authentication required" ) ; } else if ( ! ( user.isIdentifiedUser ( ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; } if ( hasQuery2 ) { return queryGroups.get ( ) ; } return list.get ( ) ; }
Source:
public static synchronized void setClockStep ( long clockStep , java.util.concurrent.TimeUnit clockStepUnit ) { com.google.common.base.Preconditions.checkState ( ( ( com.google.gerrit.testutil.TestTimeUtil.clockMs ) != null ) , "call resetWithClockStep first" ) ; com.google.gerrit.testutil.TestTimeUtil.clockStepMs = java.util.concurrent.TimeUnit.MILLISECONDS.convert ( clockStep , clockStepUnit ) ; org.joda.time.DateTimeUtils.setCurrentMillisProvider ( new org.joda.time.DateTimeUtils.MillisProvider ( ) { @ java.lang.Override public long getMillis ( ) { return com.google.gerrit.testutil.TestTimeUtil.clockMs.getAndAdd ( com.google.gerrit.testutil.TestTimeUtil.clockStepMs ) ; } } ) ; }

Target:
public static synchronized void setClockStep ( long clockStep , java.util.concurrent.TimeUnit clockStepUnit ) { com.google.common.base.Preconditions.checkState ( ( ( com.google.gerrit.testutil.TestTimeUtil.clockMs ) != null ) , "call resetWithClockStep first" ) ; com.google.gerrit.testutil.TestTimeUtil.clockStepMs = java.util.concurrent.TimeUnit.MILLISECONDS.convert ( clockStep , clockStepUnit ) ; com.google.gerrit.common.TimeUtil.setCurrentMillisSupplier ( ( ) -> com.google.gerrit.testutil.TestTimeUtil.clockMs.getAndAdd ( com.google.gerrit.testutil.TestTimeUtil.clockStepMs ) ) ; }
Source:
public int run ( ) throws java.lang.Exception { mustHaveValidSite ( ) ; dbInjector = createDbInjector ( com.google.gerrit.pgm.util.DataSourceProvider.Context.SINGLE_USER ) ; manager.add ( dbInjector ) ; manager.start ( ) ; com.google.gerrit.pgm.util.RuntimeShutdown.add ( new java.lang.Runnable ( ) { public void run ( ) { try { java.lang.System.in.close ( ) ; } catch ( java.io.IOException e ) { } manager.stop ( ) ; } } ) ; shellFactory ( ) . create ( java.lang.System.in , java.lang.System.out ) . run ( ) ; return 0 ; }

Target:
public int run ( ) throws java.lang.Exception { mustHaveValidSite ( ) ; dbInjector = createDbInjector ( com.google.gerrit.server.schema.DataSourceProvider.Context.SINGLE_USER ) ; manager.add ( dbInjector ) ; manager.start ( ) ; com.google.gerrit.pgm.util.RuntimeShutdown.add ( new java.lang.Runnable ( ) { public void run ( ) { try { java.lang.System.in.close ( ) ; } catch ( java.io.IOException e ) { } manager.stop ( ) ; } } ) ; shellFactory ( ) . create ( java.lang.System.in , java.lang.System.out ) . run ( ) ; return 0 ; }
Source:
static void deleteSessionCookie ( ) { com.google.gerrit.client.Gerrit.myAccount = com.google.gerrit.client.info.AccountInfo.create ( 0 , null , null , null ) ; com.google.gerrit.client.Gerrit.myAccountDiffPref = null ; com.google.gerrit.client.Gerrit.myPrefs = com.google.gerrit.client.info.AccountPreferencesInfo.createDefault ( ) ; com.google.gerrit.client.Gerrit.urlAliasMatcher.clearUserAliases ( ) ; com.google.gerrit.client.Gerrit.xGerritAuth = null ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; com.google.gwt.user.client.Cookies.removeCookie ( "GerritAccount" ) ; }

Target:
static void deleteSessionCookie ( ) { com.google.gerrit.client.Gerrit.myAccount = com.google.gerrit.client.info.AccountInfo.create ( 0 , null , null , null ) ; com.google.gerrit.client.Gerrit.myAccountDiffPref = null ; com.google.gerrit.client.Gerrit.editPrefs = null ; com.google.gerrit.client.Gerrit.myPrefs = com.google.gerrit.client.info.GeneralPreferences.createDefault ( ) ; com.google.gerrit.client.Gerrit.urlAliasMatcher.clearUserAliases ( ) ; com.google.gerrit.client.Gerrit.xGerritAuth = null ; com.google.gerrit.client.Gerrit.refreshMenuBar ( ) ; com.google.gwt.user.client.Cookies.removeCookie ( "GerritAccount" ) ; }
Source:
public void testCannotUploadToAnyRef ( ) { grant ( parent , com.google.gerrit.reviewdb.ApprovalCategory.READ , registered , "refs/*" , 1 ) ; grant ( local , com.google.gerrit.reviewdb.ApprovalCategory.READ , devs , "refs/heads/*" , 1 , 2 ) ; com.google.gerrit.server.project.ProjectControl u = user ( ) ; assertFalse ( "cannot upload" , u.canPushToAtLeastOneRef ( ) ) ; assertFalse ( "cannot upload refs/heads/master" , u.controlForRef ( "refs/heads/master" ) . canUpload ( ) ) ; }

Target:
public void testCannotUploadToAnyRef ( ) { grant ( parent , com.google.gerrit.common.data.Permission.READ , registered , "refs/*" ) ; grant ( local , com.google.gerrit.common.data.Permission.READ , devs , "refs/heads/*" ) ; grant ( local , com.google.gerrit.common.data.Permission.PUSH , devs , "refs/for/refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( ) ; assertFalse ( "cannot upload" , u.canPushToAtLeastOneRef ( ) ) ; assertFalse ( "cannot upload refs/heads/master" , u.controlForRef ( "refs/heads/master" ) . canUpload ( ) ) ; }
Source:
private static < T > T readContentFromJson ( com.google.gerrit.acceptance.RestResponse r , java.lang.Class < T > clazz ) throws java.lang.Exception { r.assertOK ( ) ; com.google.gson.stream.JsonReader jsonReader = new com.google.gson.stream.JsonReader ( r.getReader ( ) ) ; jsonReader.setLenient ( true ) ; return newGson ( ) . fromJson ( jsonReader , clazz ) ; }

Target:
private static < T > T readContentFromJson ( com.google.gerrit.acceptance.RestResponse r , int expectedStatus , java.lang.Class < T > clazz ) throws java.lang.Exception { r.assertStatus ( expectedStatus ) ; com.google.gson.stream.JsonReader jsonReader = new com.google.gson.stream.JsonReader ( r.getReader ( ) ) ; jsonReader.setLenient ( true ) ; return newGson ( ) . fromJson ( jsonReader , clazz ) ; }
Source:
private boolean isLive ( final java.io.File entry ) { final java.lang.String name = entry.getName ( ) ; return ( ( ( name.endsWith ( "_log" ) ) || ( name.endsWith ( ".log" ) ) ) || ( name.endsWith ( ".run" ) ) ) || ( name.endsWith ( ".pid" ) ) ; }

Target:
private boolean isLive ( java.nio.file.Path entry ) { java.lang.String name = entry.getFileName ( ) . toString ( ) ; return ( ( ( name.endsWith ( "_log" ) ) || ( name.endsWith ( ".log" ) ) ) || ( name.endsWith ( ".run" ) ) ) || ( name.endsWith ( ".pid" ) ) ; }
Source:
public void updateRepo ( com.google.gerrit.server.git.BatchUpdate.RepoContext ctx ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , java.io.IOException { validate ( ctx ) ; if ( ! ( updateRef ) ) { return ; } ctx.addRefUpdate ( new org.eclipse.jgit.transport.ReceiveCommand ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) , commit , psId.toRefName ( ) ) ) ; }

Target:
public void updateRepo ( com.google.gerrit.server.git.BatchUpdate.RepoContext ctx ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , java.io.IOException { validate ( ctx ) ; if ( ! ( updateRef ) ) { return ; } if ( ( updateRefCommand ) == null ) { ctx.addRefUpdate ( new org.eclipse.jgit.transport.ReceiveCommand ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) , commit , psId.toRefName ( ) ) ) ; } else { ctx.addRefUpdate ( updateRefCommand ) ; } }
Source:
public void setParentForAllProjects_Conflict ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( ( "/projects/" + ( allProjects.get ( ) ) ) + "/parent" ) , newParentInput ( project.get ( ) ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_CONFLICT ) ; r.consume ( ) ; }

Target:
public void setParentForAllProjects_Conflict ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( ( "/projects/" + ( allProjects.get ( ) ) ) + "/parent" ) , newParentInput ( project.get ( ) ) ) ; r.assertConflict ( ) ; r.consume ( ) ; }
Source:
private boolean isVisible ( final com.google.gerrit.reviewdb.client.Project.NameKey project , com.googlesource.gerrit.plugins.replication.ReplicationState ... states ) { HEAD ( 398143 ) ; }

Target:
private boolean isVisible ( final com.google.gerrit.reviewdb.client.Project.NameKey project , com.googlesource.gerrit.plugins.replication.ReplicationState ... states ) { try { return threadScoper.scope ( new java.util.concurrent.Callable < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean call ( ) throws com.google.gerrit.server.project.NoSuchProjectException { return controlFor ( project ) . isVisible ( ) ; } } ) . call ( ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException err ) { com.googlesource.gerrit.plugins.replication.Destination.stateLog.error ( java.lang.String.format ( "source project %s not available" , project ) , err , states ) ; } catch ( java.lang.Exception e ) { throw com.google.common.base.Throwables.propagate ( e ) ; } return false ; }
Source:
private synchronized void runHook ( org.eclipse.jgit.lib.Repository repo , java.io.File hook , java.util.List < java.lang.String > args ) { if ( repo != null ) { if ( hook.exists ( ) ) { hookQueue.execute ( new com.google.gerrit.common.ChangeHookRunner.HookTask ( repo , hook , args ) ) ; } else { repo.close ( ) ; } } }

Target:
private synchronized void runHook ( java.io.File hook , java.util.List < java.lang.String > args ) { if ( hook.exists ( ) ) { hookQueue.execute ( new com.google.gerrit.common.ChangeHookRunner.AsyncHookTask ( null , hook , args ) ) ; } }
Source:
void onChangeRevision ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ChangeEvent e ) { int idx = diffBase.getSelectedIndex ( ) ; if ( 0 <= idx ) { java.lang.String n = diffBase.getValue ( idx ) ; loadConfigInfo ( changeInfo , ( ! ( n.isEmpty ( ) ) ? n : null ) ) ; } }

Target:
private void refreshFileTable ( ) { int idx = diffBase.getSelectedIndex ( ) ; if ( 0 <= idx ) { java.lang.String n = diffBase.getValue ( idx ) ; loadConfigInfo ( changeInfo , ( ! ( n.isEmpty ( ) ) ? n : null ) ) ; } }
Source:
public void onSuccess ( com.google.gerrit.client.info.AccountInfo result ) { onCloseForm ( ) ; assigneeLink.setText ( "" ) ; }

Target:
private void setAssignee ( com.google.gerrit.client.info.AccountInfo assignee ) { currentAssignee = assignee ; assigneeLink.setText ( ( assignee != null ? assignee.name ( ) : null ) ) ; assigneeLink.setTargetHistoryToken ( ( assignee != null ? com.google.gerrit.common.PageLinks.toAssigneeQuery ( ( ( assignee.name ( ) ) != null ? assignee.name ( ) : ( assignee.email ( ) ) != null ? assignee.email ( ) : java.lang.String.valueOf ( assignee._accountId ( ) ) ) ) : "" ) ) ; }
Source:
public static void query ( com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.ChangeList > > callback , java.util.EnumSet < com.google.gerrit.extensions.client.ListChangesOption > options , java.lang.String ... queries ) { assert ( queries.length ) >= 2 ; com.google.gerrit.client.rpc.RestApi call = new com.google.gerrit.client.rpc.RestApi ( com.google.gerrit.client.changes.ChangeList.URI ) ; for ( java.lang.String q : queries ) { call.addParameterRaw ( "q" , com.google.gwtorm.client.KeyUtil.encode ( q ) ) ; } com.google.gerrit.client.changes.ChangeList.OPTIONS.addAll ( options ) ; com.google.gerrit.client.changes.ChangeList.addOptions ( call , com.google.gerrit.client.changes.ChangeList.OPTIONS ) ; call.get ( callback ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.changes.ChangeList result ) { com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.ChangeList > wrapped = com.google.gwt.core.client.JsArray.createArray ( 1 ) . cast ( ) ; wrapped.set ( 0 , result ) ; callback.onSuccess ( wrapped ) ; }
Source:
private void setNotesMigration ( boolean writeChanges , boolean readChanges ) { notesMigration.setWriteChanges ( writeChanges ) ; notesMigration.setReadChanges ( readChanges ) ; db = atrScope.reopenDb ( ) . getReviewDbProvider ( ) . get ( ) ; }

Target:
private void setNotesMigration ( boolean writeChanges , boolean readChanges ) throws java.lang.Exception { notesMigration.setWriteChanges ( writeChanges ) ; notesMigration.setReadChanges ( readChanges ) ; db = atrScope.reopenDb ( ) . getReviewDbProvider ( ) . get ( ) ; if ( notesMigration.readChangeSequence ( ) ) { seq.getChangeIdRepoSequence ( ) . set ( db.nextChangeId ( ) ) ; } else { while ( ( db.nextChangeId ( ) ) < ( seq.getChangeIdRepoSequence ( ) . next ( ) ) ) { } } }
Source:
public void onClick ( com.google.gwt.user.client.ui.Widget sender ) { b.setEnabled ( false ) ; Util.MANAGE_SVC.patchSetAction ( max.getId ( ) , patchSet.getId ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { public void onSuccess ( com.google.gwtjsonrpc.client.VoidResult result ) { actionsPanel.remove ( b ) ; fireOnSuggestRefresh ( ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { b.setEnabled ( true ) ; super . onFailure ( caught ) ; } } ) ; }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { b.setEnabled ( false ) ; Util.MANAGE_SVC.patchSetAction ( max.getId ( ) , patchSet.getId ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { public void onSuccess ( com.google.gwtjsonrpc.client.VoidResult result ) { actionsPanel.remove ( b ) ; fireOnSuggestRefresh ( ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { b.setEnabled ( true ) ; super . onFailure ( caught ) ; } } ) ; }
Source:
public void run ( ) { cache.start ( ) ; }

Target:
public void start ( ) { if ( ( executor ) != null ) { for ( final com.google.gerrit.server.cache.h2.H2CacheImpl < ? , ? > cache : caches ) { executor.execute ( cache :: start ) ; cleanup.schedule ( ( ) -> cache.prune ( cleanup ) , 30 , java.util.concurrent.TimeUnit.SECONDS ) ; } } }
Source:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > changeDrafts ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByChangeAuthor ( ctx.getDb ( ) , ctx.getNotes ( ) , user.getAccountId ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }

Target:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > changeDrafts ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByChangeAuthor ( ctx.getDb ( ) , ctx.getNotes ( ) , user.getAccountId ( ) ) ) { c.setTag ( in.tag ) ; drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }
Source:
public void run ( ) { net.codemirror.lib.CodeMirror.LineHandle handle = cm.getActiveLine ( ) ; int line = cm.getLineNumber ( handle ) ; com.google.gerrit.client.diff.CommentBox box = lineActiveBoxMap.get ( handle ) ; if ( box == null ) { lineActiveBoxMap.put ( handle , addNewDraft ( cm , line ) ) ; } else if ( box instanceof com.google.gerrit.client.diff.DraftBox ) { ( ( com.google.gerrit.client.diff.DraftBox ) ( box ) ) . setEdit ( true ) ; } else { ( ( com.google.gerrit.client.diff.PublishedBox ) ( box ) ) . doReply ( ) ; } }

Target:
public void run ( ) { com.google.gerrit.client.Gerrit.doSignIn ( getToken ( ) ) ; }
Source:
private void loadCommit ( final com.google.gerrit.client.changes.ChangeInfo.RevisionInfo rev , com.google.gerrit.client.rpc.CallbackGroup group ) { if ( rev.isEdit ( ) ) { return ; } com.google.gerrit.client.changes.ChangeApi.commitWithLinks ( changeId.get ( ) , rev.name ( ) , group.add ( new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo.CommitInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo.CommitInfo info ) { rev.setCommit ( info ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ) ; }

Target:
private void loadCommit ( final com.google.gerrit.client.info.ChangeInfo.RevisionInfo rev , com.google.gerrit.client.rpc.CallbackGroup group ) { if ( rev.isEdit ( ) ) { return ; } com.google.gerrit.client.changes.ChangeApi.commitWithLinks ( changeId.get ( ) , rev.name ( ) , group.add ( new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.ChangeInfo.CommitInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.info.ChangeInfo.CommitInfo info ) { rev.setCommit ( info ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ) ; }
Source:
private boolean add ( com.google.gerrit.server.mail.send.ProjectWatch.Watchers matching , com.google.gerrit.reviewdb.client.Account.Id accountId , com.google.gerrit.server.account.WatchConfig.ProjectWatchKey key , java.util.Set < com.google.gerrit.server.account.WatchConfig.NotifyType > watchedTypes , com.google.gerrit.server.account.WatchConfig.NotifyType type ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.IdentifiedUser user = args.identifiedUserFactory.create ( accountId ) ; try { if ( filterMatch ( user , key.filter ( ) ) ) { if ( watchedTypes.contains ( type ) ) { matching.bcc.accounts.add ( accountId ) ; } return true ; } } catch ( com.google.gerrit.index.query.QueryParseException e ) { } return false ; }

Target:
private boolean add ( com.google.gerrit.server.mail.send.ProjectWatch.Watchers matching , com.google.gerrit.reviewdb.client.Account.Id accountId , com.google.gerrit.server.account.ProjectWatches.ProjectWatchKey key , java.util.Set < com.google.gerrit.server.account.ProjectWatches.NotifyType > watchedTypes , com.google.gerrit.server.account.ProjectWatches.NotifyType type ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.IdentifiedUser user = args.identifiedUserFactory.create ( accountId ) ; try { if ( filterMatch ( user , key.filter ( ) ) ) { if ( watchedTypes.contains ( type ) ) { matching.bcc.accounts.add ( accountId ) ; } return true ; } } catch ( com.google.gerrit.index.query.QueryParseException e ) { } return false ; }
Source:
private com.google.gerrit.server.git.BatchUpdate.ChangeContext newChangeContext ( 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 = db.changes ( ) . get ( id ) ; } com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx = new com.google.gerrit.server.git.BatchUpdate.ChangeContext ( changeControlFactory.controlFor ( c , user ) , new com.google.gerrit.server.git.BatchUpdateReviewDb ( db ) ) ; if ( notesMigration.readChanges ( ) ) { ctx.getNotes ( ) . load ( ) ; } return ctx ; }

Target:
private com.google.gerrit.server.git.BatchUpdate.ChangeContext newChangeContext ( 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 = db.changes ( ) . get ( id ) ; } com.google.gerrit.server.notedb.ChangeNotes notes = changeNotesFactory.createForNew ( c ) ; com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx = new com.google.gerrit.server.git.BatchUpdate.ChangeContext ( changeControlFactory.controlFor ( notes , user ) , new com.google.gerrit.server.git.BatchUpdateReviewDb ( db ) ) ; if ( notesMigration.readChanges ( ) ) { ctx.getNotes ( ) . load ( ) ; } return ctx ; }
Source:
private java.lang.String getScopesKeyFromCookie ( javax.servlet.http.HttpServletRequest request ) { for ( javax.servlet.http.Cookie cookie : request.getCookies ( ) ) { if ( cookie.getName ( ) . equalsIgnoreCase ( "scope" ) ) { return cookie.getValue ( ) ; } } return null ; }

Target:
private java.lang.String getScopesKeyFromCookie ( javax.servlet.http.HttpServletRequest request ) { javax.servlet.http.Cookie [ ] cookies = request.getCookies ( ) ; if ( cookies == null ) { return null ; } for ( javax.servlet.http.Cookie cookie : cookies ) { if ( cookie.getName ( ) . equalsIgnoreCase ( "scope" ) ) { return cookie.getValue ( ) ; } } return null ; }
Source:
private org.eclipse.jgit.lib.ObjectId resolve ( java.lang.String name ) throws java.io.IOException { try { return repo.resolve ( name ) ; } catch ( org.eclipse.jgit.errors.RevisionSyntaxException e ) { return null ; } }

Target:
private org.eclipse.jgit.revwalk.RevObject resolve ( java.lang.String name , org.eclipse.jgit.revwalk.RevWalk walk ) throws java.io.IOException { try { org.eclipse.jgit.lib.ObjectId id = repo.resolve ( name ) ; return id != null ? walk.parseAny ( id ) : null ; } catch ( org.eclipse.jgit.errors.RevisionSyntaxException e ) { return null ; } catch ( org.eclipse.jgit.errors.MissingObjectException e ) { return null ; } }
Source:
public int run ( ) throws java.lang.Exception { final com.google.inject.Injector injector = com.google.inject.Guice.createInjector ( new com.google.gerrit.server.GerritServerModule ( ) ) ; injector.injectMembers ( this ) ; injector.getInstance ( com.google.gerrit.server.GerritServer.class ) ; schema.open ( ) . close ( ) ; java.lang.System.out.println ( "Gerrit2 schema initialized" ) ; return 0 ; }

Target:
public int run ( ) throws java.lang.Exception { final com.google.inject.Injector injector = com.google.inject.Guice.createInjector ( new com.google.gerrit.server.config.GerritServerModule ( ) ) ; injector.injectMembers ( this ) ; injector.getInstance ( com.google.gerrit.server.GerritServer.class ) ; schema.open ( ) . close ( ) ; java.lang.System.out.println ( "Gerrit2 schema initialized" ) ; return 0 ; }
Source:
com.google.gerrit.client.changes.CommentInfo createReply ( com.google.gerrit.client.changes.CommentInfo replyTo ) { if ( ( ! ( replyTo.has_line ( ) ) ) && ( ( replyTo.range ( ) ) == null ) ) { return com.google.gerrit.client.changes.CommentInfo.createFile ( path , replyTo.side ( ) , replyTo.id ( ) , null ) ; } else { return com.google.gerrit.client.changes.CommentInfo.createRange ( path , replyTo.side ( ) , replyTo.line ( ) , replyTo.id ( ) , null , replyTo.range ( ) ) ; } }

Target:
void clearLine ( com.google.gerrit.client.diff.DisplaySide side , int line ) { map ( side ) . remove ( line ) ; }
Source:
public void uploadPackSubsetOfBranchesVisibleNotIncludingHead ( ) throws java.lang.Exception { deny ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/master" ) ; allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/branch" ) ; setApiUser ( user ) ; assertUploadPackRefs ( ( ( r2 ) + "1" ) , ( ( r2 ) + "meta" ) , "refs/heads/branch" , "refs/tags/branch-tag" , "refs/tags/master-tag" ) ; }

Target:
public void uploadPackSubsetOfBranchesVisibleIncludingHead ( ) throws java.lang.Exception { allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/master" ) ; deny ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/branch" ) ; setApiUser ( user ) ; assertUploadPackRefs ( "HEAD" , ( ( r1 ) + "1" ) , ( ( r1 ) + "meta" ) , ( ( r3 ) + "1" ) , ( ( r3 ) + "meta" ) , "refs/heads/master" , "refs/tags/master-tag" ) ; }
Source:
public void onSuccess ( final com.google.gerrit.client.VoidResult result ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { final com.google.gerrit.reviewdb.client.AccountGroupIncludeByUuid k = getRowItem ( row ) ; if ( ( k != null ) && ( keys.contains ( k.getKey ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } }

Target:
public void onSuccess ( final com.google.gerrit.client.VoidResult result ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { final com.google.gerrit.client.groups.GroupInfo i = getRowItem ( row ) ; if ( ( i != null ) && ( ids.contains ( i.getGroupUUID ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } }
Source:
public void delete ( final java.lang.Iterable < T > instances ) throws com.google.gwtorm.server.OrmException { try { if ( schema.getDialect ( ) . canDetermineTotalBatchUpdateCount ( ) ) { deleteAsBatch ( instances ) ; } else { deleteIndividually ( instances ) ; } } catch ( java.sql.SQLException e ) { throw convertError ( "delete" , e ) ; } }

Target:
public void delete ( final java.lang.Iterable < T > instances ) throws com.google.gwtorm.server.OrmException { try { if ( schema.getDialect ( ) . canDetermineTotalBatchUpdateCount ( ) ) { deleteAsBatch ( instances ) ; } else { deleteIndividually ( instances ) ; } } catch ( java.sql.SQLException e ) { throwOrDefer ( convertError ( "delete" , e ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throwOrDefer ( e ) ; } }
Source:
protected void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; db = new com.google.gerrit.testutil.InMemoryDatabase ( ) ; }

Target:
private com.google.gerrit.common.data.LabelTypes getLabelTypes ( ) throws java.lang.Exception { db.create ( ) ; com.google.gerrit.server.git.ProjectConfig c = new com.google.gerrit.server.git.ProjectConfig ( allProjects ) ; org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( allProjects ) ; try { c.load ( repo ) ; return new com.google.gerrit.common.data.LabelTypes ( com.google.common.collect.ImmutableList.copyOf ( c.getLabelSections ( ) . values ( ) ) ) ; } finally { repo.close ( ) ; } }
Source:
private void onCallback ( final com.google.gerrit.client.reviewdb.Account result ) { if ( result != null ) { com.google.gerrit.client.Gerrit.postSignIn ( result ) ; hide ( ) ; final com.google.gwt.user.client.rpc.AsyncCallback < ? > ac = appCallback ; if ( ac != null ) { com.google.gwt.user.client.DeferredCommand.addCommand ( new com.google.gwt.user.client.Command ( ) { public void execute ( ) { ac.onSuccess ( null ) ; } } ) ; } } else { hide ( ) ; } }

Target:
private void onCallback ( final com.google.gerrit.client.account.SignInResult result ) { final com.google.gerrit.client.account.SignInResult.Status rc = result.getStatus ( ) ; if ( rc == ( com.google.gerrit.client.account.SignInResult.Status.CANCEL ) ) { hide ( ) ; } else if ( rc == ( com.google.gerrit.client.account.SignInResult.Status.SUCCESS ) ) { onSuccess ( result ) ; } else { com.google.gwt.core.client.GWT.log ( ( "Unexpected SignInResult.Status " + rc ) , null ) ; } }
Source:
public void onSuccess ( com.googlesource.gerrit.plugins.serviceuser.client.CreateServiceUserForm.MessagesInfo info ) { onSuccessMessage = info.getOnSuccessMessage ( ) ; }

Target:
public void onSuccess ( com.googlesource.gerrit.plugins.serviceuser.client.CreateServiceUserForm.MessagesInfo info ) { onSuccessMessage = info.getOnSuccessMessage ( ) ; java.lang.String infoMessage = info.getInfoMessage ( ) ; if ( ( infoMessage != null ) && ( ! ( "" . equals ( infoMessage ) ) ) ) { p.insert ( new com.google.gwt.user.client.ui.HTML ( onSuccessMessage ) , 0 ) ; } }
Source:
public com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > getReviewDbProvider ( ) { return com.google.inject.util.Providers.of ( db ) ; }

Target:
public void createdOnIsPopulatedForGroupsCreatedBeforeAudit ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.AccountGroup.Id groupId = createGroup ( "Ancient group for schema migration" ) ; setCreatedOnToVeryOldTimestamp ( groupId ) ; removeAuditEntriesFor ( groupId ) ; schema151.migrateData ( db , new com.google.gerrit.testutil.TestUpdateUI ( ) ) ; com.google.gerrit.reviewdb.client.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; com.google.common.truth.Truth.assertThat ( group.getCreatedOn ( ) ) . isEqualTo ( com.google.gerrit.reviewdb.client.AccountGroup.auditCreationInstantTs ( ) ) ; }
Source:
public void run ( ) { try { com.google.gerrit.git.PushQueue.pushImpl ( newOp ) ; } catch ( java.lang.RuntimeException e ) { com.google.gerrit.git.PushQueue.log.error ( "Unexpected error during replication" , e ) ; } catch ( java.lang.Error e ) { com.google.gerrit.git.PushQueue.log.error ( "Unexpected error during replication" , e ) ; } }

Target:
private static synchronized void scheduleImp ( final com.google.gerrit.client.reviewdb.Project.NameKey project , final java.lang.String ref , final org.spearce.jgit.transport.RemoteConfig srcConf , final org.spearce.jgit.transport.URIish uri ) { com.google.gerrit.git.PushOp e = com.google.gerrit.git.PushQueue.pending.get ( uri ) ; if ( e == null ) { e = new com.google.gerrit.git.PushOp ( project.get ( ) , srcConf , uri ) ; com.google.gerrit.git.WorkQueue.schedule ( e , com.google.gerrit.git.PushQueue.startDelay , java.util.concurrent.TimeUnit.SECONDS ) ; com.google.gerrit.git.PushQueue.pending.put ( uri , e ) ; } e.addRef ( ref ) ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; Util.ACCOUNT_SVC.myAccount ( new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.reviewdb.Account > ( ) { public void onSuccess ( final com.google.gerrit.reviewdb.Account result ) { display ( result.getGeneralPreferences ( ) ) ; enable ( true ) ; } } ) ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; Util.ACCOUNT_SVC.myAccount ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.reviewdb.Account > ( this ) { public void preDisplay ( final com.google.gerrit.reviewdb.Account result ) { display ( result.getGeneralPreferences ( ) ) ; } } ) ; }
Source:
private static java.lang.String url ( com.google.gerrit.reviewdb.client.PatchSet.Id ps , com.google.gerrit.client.changes.CommentInfo info ) { return com.google.gerrit.client.Dispatcher.toSideBySide ( null , ps , info.path ( ) , ( ( info.side ( ) ) == ( com.google.gerrit.extensions.common.Side.PARENT ) ? com.google.gerrit.client.diff.DisplaySide.A : com.google.gerrit.client.diff.DisplaySide.B ) , info.line ( ) ) ; }

Target:
private static java.lang.String url ( com.google.gerrit.reviewdb.client.PatchSet.Id ps , com.google.gerrit.client.changes.CommentInfo info ) { return com.google.gerrit.client.Dispatcher.toSideBySide ( null , ps , info.path ( ) , ( ( info.side ( ) ) == ( com.google.gerrit.extensions.client.Side.PARENT ) ? com.google.gerrit.client.diff.DisplaySide.A : com.google.gerrit.client.diff.DisplaySide.B ) , info.line ( ) ) ; }
Source:
public java.util.Set < com.google.gerrit.reviewdb.AccountGroup.Id > getEffectiveGroups ( ) { if ( ( effectiveGroups ) == null ) { if ( authConfig.isIdentityTrustable ( state ( ) . getExternalIds ( ) ) ) { effectiveGroups = realm.groups ( state ( ) ) ; } else { effectiveGroups = authConfig.getRegisteredGroups ( ) ; } } return effectiveGroups ; }

Target:
public java.util.Set < com.google.gerrit.reviewdb.AccountGroup.Id > getEffectiveGroups ( ) { if ( ( effectiveGroups ) == null ) { if ( authConfig.isIdentityTrustable ( getAccountState ( ) . getExternalIds ( ) ) ) { effectiveGroups = realm.groups ( getAccountState ( ) ) ; } else { effectiveGroups = authConfig.getRegisteredGroups ( ) ; } } return effectiveGroups ; }
Source:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.reviewdb.client.Account.Id accountId : object.reviewers ( ) . values ( ) ) { com.google.gerrit.server.IdentifiedUser reviewer = userFactory.create ( accountId ) ; if ( reviewer.getEffectiveGroups ( ) . contains ( uuid ) ) { return true ; } } return false ; }

Target:
public boolean match ( final com.google.gerrit.server.query.change.ChangeData object ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.reviewdb.client.Account.Id accountId : object.reviewers ( ) . all ( ) ) { com.google.gerrit.server.IdentifiedUser reviewer = userFactory.create ( accountId ) ; if ( reviewer.getEffectiveGroups ( ) . contains ( uuid ) ) { return true ; } } return false ; }
Source:
public com.google.gerrit.extensions.common.RevisionInfo getRevisionInfo ( com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet in ) throws com.google.gerrit.server.GpgException , com.google.gerrit.server.patch.PatchListNotAvailableException , com.google.gwtorm.server.OrmException , java.io.IOException { accountLoader = accountLoaderFactory.create ( has ( com.google.gerrit.extensions.client.ListChangesOption.DETAILED_ACCOUNTS ) ) ; try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( ctl.getProject ( ) . getNameKey ( ) ) ) { com.google.gerrit.extensions.common.RevisionInfo rev = toRevisionInfo ( ctl , changeDataFactory.create ( db.get ( ) , ctl ) , in , repo , true ) ; accountLoader.fill ( ) ; return rev ; } }

Target:
public com.google.gerrit.extensions.common.RevisionInfo getRevisionInfo ( com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet in ) throws com.google.gerrit.server.GpgException , com.google.gerrit.server.patch.PatchListNotAvailableException , com.google.gwtorm.server.OrmException , java.io.IOException { accountLoader = accountLoaderFactory.create ( has ( com.google.gerrit.extensions.client.ListChangesOption.DETAILED_ACCOUNTS ) ) ; try ( org.eclipse.jgit.lib.Repository repo = openRepoIfNecessary ( ctl ) ) { com.google.gerrit.extensions.common.RevisionInfo rev = toRevisionInfo ( ctl , changeDataFactory.create ( db.get ( ) , ctl ) , in , repo , true ) ; accountLoader.fill ( ) ; return rev ; } }