auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public int getIssuePatternGroupIndex ( ) { java.util.regex.Pattern pattern = getIssuePattern ( ) ; int groupCount = pattern.matcher ( "" ) . groupCount ( ) ; int index = gerritConfig.getInt ( pluginName , "commentlinkGroupIndex" , 1 ) ; if ( ( index < 0 ) || ( index > groupCount ) ) { index = ( groupCount == 0 ) ? 0 : 1 ; } return index ; }

Target:
private com.google.gerrit.server.config.PluginConfig getCurrentPluginConfig ( ) { com.google.gerrit.reviewdb.client.Project.NameKey projectName = com.googlesource.gerrit.plugins.its.base.its.ItsConfig.currentProjectName.get ( ) ; if ( projectName != null ) { try { return pluginCfgFactory.getFromProjectConfigWithInheritance ( projectName , pluginName ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { com.googlesource.gerrit.plugins.its.base.its.ItsConfig.log.error ( ( ( ( "Cannot access " + projectName ) + " configuration for plugin " ) + ( pluginName ) ) , e ) ; } } return new com.google.gerrit.server.config.PluginConfig ( pluginName , new org.eclipse.jgit.lib.Config ( ) ) ; }
Source:
public com.dyuproject.openid.OpenIdUser discover ( final java.lang.String claimedId , final com.dyuproject.openid.OpenIdContext context ) throws java.lang.Exception { if ( com.google.gerrit.server.GoogleAccountDiscovery.GOOGLE_ACCOUNT.equals ( claimedId ) ) { final java.util.Map < java.lang.String , java.lang.String > m = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; m.put ( "ci" , claimedId ) ; m.put ( "os" , "https://www.google.com/accounts/o8/ud" ) ; final com.dyuproject.openid.OpenIdUser u = new com.dyuproject.openid.OpenIdUser ( ) ; u.fromJSON ( m ) ; return u ; } return base.discover ( claimedId , context ) ; }

Target:
public com.dyuproject.openid.OpenIdUser discover ( final java.lang.String claimedId , final com.dyuproject.openid.OpenIdContext context ) throws java.lang.Exception { if ( ( com.google.gerrit.server.GoogleAccountDiscovery.GOOGLE_ACCOUNT.equals ( claimedId ) ) || ( claimedId.startsWith ( ( ( com.google.gerrit.server.GoogleAccountDiscovery.GOOGLE_ACCOUNT ) + "?" ) ) ) ) { final java.util.Map < java.lang.String , java.lang.String > m = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; m.put ( "ci" , claimedId ) ; m.put ( "os" , "https://www.google.com/accounts/o8/ud" ) ; final com.dyuproject.openid.OpenIdUser u = new com.dyuproject.openid.OpenIdUser ( ) ; u.fromJSON ( m ) ; return u ; } return base.discover ( claimedId , context ) ; }
Source:
public void generateResultSetGet ( final com.google.gwtorm.jdbc.gen.CodeGenSupport cgs ) { cgs.fieldSetBegin ( ) ; cgs.pushSqlHandle ( ) ; cgs.pushColumnIndex ( ) ; cgs.invokeResultSetGet ( getJavaSqlTypeAlias ( ) ) ; cgs.push ( 0 ) ; cgs.mv.visitMethodInsn ( Opcodes.INVOKEVIRTUAL , org.objectweb.asm.Type.getInternalName ( java.lang.String.class ) , "charAt" , org.objectweb.asm.Type.getMethodDescriptor ( Type.CHAR_TYPE , new org.objectweb.asm.Type [ ] { org.objectweb.asm.Type.INT_TYPE } ) ) ; cgs.fieldSetEnd ( ) ; }

Target:
public void generateResultSetGet ( final com.google.gwtorm.server.CodeGenSupport cgs ) { cgs.fieldSetBegin ( ) ; cgs.pushSqlHandle ( ) ; cgs.pushColumnIndex ( ) ; cgs.invokeResultSetGet ( getJavaSqlTypeAlias ( ) ) ; cgs.push ( 0 ) ; cgs.mv.visitMethodInsn ( Opcodes.INVOKEVIRTUAL , org.objectweb.asm.Type.getInternalName ( java.lang.String.class ) , "charAt" , org.objectweb.asm.Type.getMethodDescriptor ( Type.CHAR_TYPE , new org.objectweb.asm.Type [ ] { org.objectweb.asm.Type.INT_TYPE } ) ) ; cgs.fieldSetEnd ( ) ; }
Source:
private com.google.gerrit.server.notedb.NoteDbUpdateManager.OpenRepo openRepo ( com.google.gerrit.reviewdb.client.Project.NameKey p ) throws java.io.IOException { org.eclipse.jgit.lib.Repository repo = repoManager.openMetadataRepository ( p ) ; org.eclipse.jgit.lib.ObjectInserter ins = repo.newObjectInserter ( ) ; return new com.google.gerrit.server.notedb.NoteDbUpdateManager.OpenRepo ( repo , new org.eclipse.jgit.revwalk.RevWalk ( ins.newReader ( ) ) , ins , new com.google.gerrit.server.git.ChainedReceiveCommands ( ) , true ) ; }

Target:
private com.google.gerrit.server.notedb.NoteDbUpdateManager.OpenRepo openRepo ( com.google.gerrit.reviewdb.client.Project.NameKey p , boolean meta ) throws java.io.IOException { org.eclipse.jgit.lib.Repository repo = ( meta ) ? repoManager.openMetadataRepository ( p ) : repoManager.openRepository ( p ) ; org.eclipse.jgit.lib.ObjectInserter ins = repo.newObjectInserter ( ) ; return new com.google.gerrit.server.notedb.NoteDbUpdateManager.OpenRepo ( repo , new org.eclipse.jgit.revwalk.RevWalk ( ins.newReader ( ) ) , ins , new com.google.gerrit.server.git.ChainedReceiveCommands ( ) , true ) ; }
Source:
private void upsertPublishedComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) { verifyComment ( c ) ; if ( ( c.getSide ( ) ) == 0 ) { commentsForBase.add ( c ) ; } else { commentsForPs.add ( c ) ; } }

Target:
private void upsertPublishedComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) throws com.google.gwtorm.server.OrmException { verifyComment ( c ) ; if ( ( notes ) == null ) { notes = getChangeNotes ( ) . load ( ) ; } if ( migration.readComments ( ) ) { com.google.common.base.Preconditions.checkArgument ( ( ! ( notes.containsCommentPublished ( c ) ) ) , "Cannot update a comment that has already been published and saved" ) ; } if ( ( c.getSide ( ) ) == 0 ) { commentsForBase.add ( c ) ; } else { commentsForPs.add ( c ) ; } }
Source:
public void commit ( ) throws com.google.gwtorm.server.OrmException { try { if ( ! ( conn.getAutoCommit ( ) ) ) { conn.commit ( ) ; } } catch ( java.sql.SQLException err ) { throw new com.google.gwtorm.server.OrmException ( "Cannot commit transaction" , err ) ; } finally { try { conn.setAutoCommit ( true ) ; } catch ( java.sql.SQLException err ) { throw new com.google.gwtorm.server.OrmException ( "Cannot set auto commit mode" , err ) ; } } }

Target:
boolean isInTransaction ( ) throws java.sql.SQLException { return ! ( conn.getAutoCommit ( ) ) ; }
Source:
private boolean canRead ( com.google.gerrit.server.notedb.ChangeNotes notes ) throws com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException { try { permissionBackend.user ( user ) . change ( notes ) . database ( db ) . check ( ChangePermission.READ ) ; } catch ( com.google.gerrit.extensions.restapi.AuthException e ) { return false ; } com.google.gerrit.server.project.ProjectState projectState = projectCache.checkedGet ( notes.getProjectName ( ) ) ; if ( projectState == null ) { return false ; } return projectState.statePermitsRead ( ) ; }

Target:
private boolean canRead ( com.google.gerrit.server.notedb.ChangeNotes notes ) throws com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException { try { permissionBackend.currentUser ( ) . change ( notes ) . database ( db ) . check ( ChangePermission.READ ) ; } catch ( com.google.gerrit.extensions.restapi.AuthException e ) { return false ; } com.google.gerrit.server.project.ProjectState projectState = projectCache.checkedGet ( notes.getProjectName ( ) ) ; if ( projectState == null ) { return false ; } return projectState.statePermitsRead ( ) ; }
Source:
static void call ( final com.google.gerrit.reviewdb.client.Change.Id id , java.lang.String revision ) { com.google.gerrit.client.changes.ChangeApi.rebase ( id.get ( ) , revision , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.changes.ChangeInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( id ) ) ; } } ) ; }

Target:
public void onSend ( ) { com.google.gerrit.client.changes.ChangeApi.rebase ( id.get ( ) , revision , getBase ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.changes.ChangeInfo > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo result ) { sent = true ; hide ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( id ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { enableButtons ( true ) ; super . onFailure ( caught ) ; } } ) ; }
Source:
public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { final com.google.gerrit.reviewdb.AccountGroupInclude k = getRowItem ( row ) ; if ( ( k != null ) && ( keys.contains ( k.getKey ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } }

Target:
protected AccountGroup.Id getGroupId ( ) { return groupDetail.group.getId ( ) ; }
Source:
public static org.eclipse.jgit.transport.PushResult pushHead ( org.eclipse.jgit.api.Git git , java.lang.String ref , boolean pushTags , boolean force ) throws org.eclipse.jgit.api.errors.GitAPIException { org.eclipse.jgit.api.PushCommand pushCmd = git.push ( ) ; pushCmd.setForce ( force ) ; pushCmd.setRefSpecs ( new org.eclipse.jgit.transport.RefSpec ( ( "HEAD:" + ref ) ) ) ; if ( pushTags ) { pushCmd.setPushTags ( ) ; } java.lang.Iterable < org.eclipse.jgit.transport.PushResult > r = pushCmd.call ( ) ; return com.google.common.collect.Iterables.getOnlyElement ( r ) ; }

Target:
public static org.eclipse.jgit.transport.PushResult pushHead ( org.eclipse.jgit.junit.TestRepository < ? > testRepo , java.lang.String ref , boolean pushTags , boolean force ) throws org.eclipse.jgit.api.errors.GitAPIException { org.eclipse.jgit.api.PushCommand pushCmd = testRepo.git ( ) . push ( ) ; pushCmd.setForce ( force ) ; pushCmd.setRefSpecs ( new org.eclipse.jgit.transport.RefSpec ( ( "HEAD:" + ref ) ) ) ; if ( pushTags ) { pushCmd.setPushTags ( ) ; } java.lang.Iterable < org.eclipse.jgit.transport.PushResult > r = pushCmd.call ( ) ; return com.google.common.collect.Iterables.getOnlyElement ( r ) ; }
Source:
private void parseUpdate ( final org.eclipse.jgit.transport.ReceiveCommand cmd ) { com.google.gerrit.server.project.RefControl ctl = projectControl.controlForRef ( cmd.getRefName ( ) ) ; if ( ctl.canUpdate ( ) ) { validateNewCommits ( ctl , cmd ) ; } else { com.google.gerrit.server.git.ReceiveCommits.reject ( cmd ) ; } }

Target:
private void parseUpdate ( final org.eclipse.jgit.transport.ReceiveCommand cmd ) { com.google.gerrit.server.project.RefControl ctl = projectControl.controlForRef ( cmd.getRefName ( ) ) ; if ( ctl.canUpdate ( ) ) { if ( ( com.google.gerrit.server.git.ReceiveCommits.isHead ( cmd ) ) && ( ! ( isCommit ( cmd ) ) ) ) { return ; } validateNewCommits ( ctl , cmd ) ; } else { com.google.gerrit.server.git.ReceiveCommits.reject ( cmd , "can not update the reference as a fast forward" ) ; } }
Source:
public synchronized void onStartPlugin ( com.google.gerrit.server.plugins.Plugin plugin ) { if ( ( pending ) != null ) { pending.add ( plugin ) ; } else { com.google.inject.servlet.GuiceFilter filter = load ( plugin ) ; if ( filter != null ) { plugins.put ( plugin.getName ( ) , filter ) ; } } }

Target:
private void install ( com.google.gerrit.server.plugins.Plugin plugin ) { com.google.inject.servlet.GuiceFilter filter = load ( plugin ) ; final java.lang.String name = plugin.getName ( ) ; final com.google.gerrit.httpd.plugins.HttpPluginServlet.PluginHolder holder = new com.google.gerrit.httpd.plugins.HttpPluginServlet.PluginHolder ( plugin , filter ) ; plugin.add ( new com.google.gerrit.server.plugins.RegistrationHandle ( ) { @ java.lang.Override public void remove ( ) { plugins.remove ( name , holder ) ; } } ) ; plugins.put ( name , holder ) ; }
Source:
private static java.lang.String getTitle ( com.google.gerrit.client.account.AccountInfo ai , java.lang.String votableCategories ) { java.lang.String title = ( ( ai.email ( ) ) != null ) ? ai.email ( ) : "" ; if ( ! ( votableCategories.isEmpty ( ) ) ) { if ( ! ( title.isEmpty ( ) ) ) { title += " " ; } title += votableCategories ; } return title ; }

Target:
private static java.lang.String getTitle ( com.google.gerrit.client.info.AccountInfo ai , java.lang.String votableCategories ) { java.lang.String title = ( ( ai.email ( ) ) != null ) ? ai.email ( ) : "" ; if ( ! ( votableCategories.isEmpty ( ) ) ) { if ( ! ( title.isEmpty ( ) ) ) { title += " " ; } title += votableCategories ; } return title ; }
Source:
public com.google.gerrit.reviewdb.client.Change update ( com.google.gerrit.reviewdb.client.Change c ) { c.setStatus ( Change.Status.MERGED ) ; if ( ! ( merged.equals ( c.currentPatchSetId ( ) ) ) ) { try { c.setCurrentPatchSet ( patchSetInfoFactory.get ( db , merged ) ) ; } catch ( com.google.gerrit.server.patch.PatchSetInfoNotAvailableException e1 ) { logError ( ( "Cannot read merged patch set " + merged ) , e1 ) ; } } com.google.gerrit.server.ChangeUtil.updated ( c ) ; return c ; }

Target:
public java.lang.Void call ( ) throws java.lang.Exception { sendMergedEmail ( change , submitter ) ; return null ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { java.util.List < java.lang.String > previousValue = getValues ( ( row - 1 ) ) ; java.util.List < java.lang.String > value = getValues ( row ) ; populate ( ( row - 1 ) , value , false ) ; populate ( row , previousValue , ( row == ( ( table.getRowCount ( ) ) - 1 ) ) ) ; widget.setEnabled ( true ) ; }

Target:
void moveUp ( int row ) { swap ( ( row - 1 ) , row ) ; }
Source:
private java.lang.String group ( java.lang.String name , java.lang.String ownerGroup ) throws java.io.IOException { name = name ( name ) ; com.google.gerrit.server.group.CreateGroup.Input in = new com.google.gerrit.server.group.CreateGroup.Input ( ) ; in.ownerId = ownerGroup ; adminSession.put ( ( "/groups/" + name ) , in ) . consume ( ) ; return name ; }

Target:
private java.lang.String group ( java.lang.String name , java.lang.String ownerGroup ) throws java.io.IOException { name = name ( name ) ; com.google.gerrit.extensions.api.groups.GroupInput in = new com.google.gerrit.extensions.api.groups.GroupInput ( ) ; in.ownerId = ownerGroup ; adminSession.put ( ( "/groups/" + name ) , in ) . consume ( ) ; return name ; }
Source:
public com.google.gerrit.server.project.SubmitRuleEvaluator setOptions ( com.google.gerrit.server.project.SubmitRuleOptions opts ) { checkNotStarted ( ) ; if ( opts != null ) { optsBuilder = com.google.gerrit.server.project.SubmitRuleOptions.builder ( ) . fastEvalLabels ( opts.fastEvalLabels ( ) ) . allowDraft ( opts.allowDraft ( ) ) . allowClosed ( opts.allowClosed ( ) ) . skipFilters ( opts.skipFilters ( ) ) . rule ( opts.rule ( ) ) ; } else { optsBuilder = com.google.gerrit.server.project.SubmitRuleOptions.defaults ( ) ; } return this ; }

Target:
public com.google.gerrit.server.project.SubmitRuleEvaluator setOptions ( com.google.gerrit.server.project.SubmitRuleOptions opts ) { checkNotStarted ( ) ; if ( opts != null ) { optsBuilder = opts.toBuilder ( ) ; } else { optsBuilder = com.google.gerrit.server.project.SubmitRuleOptions.defaults ( ) ; } return this ; }
Source:
public static int findApproval ( com.googlecode.prolog_cafe.lang.Prolog engine , int minVoteLevel ) { try { com.google.gerrit.server.account.AccountCache accountCache = StoredValues.ACCOUNT_CACHE.get ( engine ) ; com.google.gerrit.server.account.Accounts accounts = StoredValues.ACCOUNTS.get ( engine ) ; com.google.gerrit.server.query.change.ChangeData changeData = StoredValues.CHANGE_DATA.get ( engine ) ; org.eclipse.jgit.lib.Repository repository = StoredValues.REPOSITORY.get ( engine ) ; return new com.googlesource.gerrit.plugins.findowners.Checker ( repository , changeData , minVoteLevel ) . findApproval ( accountCache , accounts ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.googlesource.gerrit.plugins.findowners.Checker.log.error ( "Exception" , e ) ; return 0 ; } }

Target:
public static int findApproval ( com.googlecode.prolog_cafe.lang.Prolog engine , int minVoteLevel ) { try { com.google.gerrit.server.account.AccountCache accountCache = StoredValues.ACCOUNT_CACHE.get ( engine ) ; com.google.gerrit.server.account.Emails emails = StoredValues.EMAILS.get ( engine ) ; com.google.gerrit.server.query.change.ChangeData changeData = StoredValues.CHANGE_DATA.get ( engine ) ; org.eclipse.jgit.lib.Repository repository = StoredValues.REPOSITORY.get ( engine ) ; return new com.googlesource.gerrit.plugins.findowners.Checker ( repository , changeData , minVoteLevel ) . findApproval ( accountCache , emails ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.googlesource.gerrit.plugins.findowners.Checker.log.error ( "Exception" , e ) ; return 0 ; } }
Source:
public com.google.gerrit.httpd.resources.Resource get ( com.googlesource.gerrit.plugins.xdocs.formatter.Formatters.FormatterProvider formatter , com.google.gerrit.reviewdb.client.Project.NameKey project , java.lang.String file , org.eclipse.jgit.lib.ObjectId revId ) { com.google.gerrit.server.project.ProjectState p = projectCache.get ( project ) ; org.eclipse.jgit.lib.ObjectId metaConfigRevId = ( p != null ) ? p.getConfig ( ) . getRevision ( ) : null ; return cache.getUnchecked ( new com.googlesource.gerrit.plugins.xdocs.XDocResourceKey ( formatter.getName ( ) , project , file , revId , metaConfigRevId ) . asString ( ) ) ; }

Target:
public com.google.gerrit.httpd.resources.Resource get ( com.googlesource.gerrit.plugins.xdocs.formatter.Formatters.FormatterProvider formatter , com.google.gerrit.reviewdb.client.Project.NameKey project , java.lang.String file , org.eclipse.jgit.lib.ObjectId revId ) { com.google.gerrit.server.project.ProjectState p = projectCache.get ( project ) ; org.eclipse.jgit.lib.ObjectId metaConfigRevId = ( ( p != null ) && ( ( p.getConfig ( ) . getRevision ( ) ) != null ) ) ? p.getConfig ( ) . getRevision ( ) : org.eclipse.jgit.lib.ObjectId.zeroId ( ) ; return cache.getUnchecked ( new com.googlesource.gerrit.plugins.xdocs.XDocResourceKey ( formatter.getName ( ) , project , file , revId , metaConfigRevId ) . asString ( ) ) ; }
Source:
public void testUpsertTwoUpdateCountsAreNull ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.UPDATE , null ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.INSERT , 1 , 1 ) ; classUnderTest.upsert ( twoRows ) ; assertCorrectUpdating ( update , 1 , 2 ) ; assertCorrectUpdating ( insert , 1 , 2 ) ; }

Target:
public void testUpsertTwoUpdateCountsAreNull ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.UPDATE , null ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.INSERT , 1 , 1 ) ; classUnderTest.upsert ( twoRows ) ; assertCorrectAttempting ( update , 1 , 2 ) ; assertCorrectUpdating ( insert , 1 , 2 ) ; }
Source:
public org.eclipse.jgit.lib.ObjectId commit ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.notedb.NoteDbUpdateManager updateManager = updateManagerFactory.create ( getProjectName ( ) ) ; updateManager.add ( this ) ; com.google.gerrit.server.notedb.NoteDbChangeState.applyDelta ( getChange ( ) , updateManager.stage ( ) ) ; updateManager.execute ( ) ; return getResult ( ) ; }

Target:
public org.eclipse.jgit.lib.ObjectId commit ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.notedb.NoteDbUpdateManager updateManager = updateManagerFactory.create ( getProjectName ( ) ) ; updateManager.add ( this ) ; updateManager.stageAndApplyDelta ( getChange ( ) ) ; updateManager.execute ( ) ; return getResult ( ) ; }
Source:
com.google.common.util.concurrent.ListeningExecutorService getInteractiveIndexExecutor ( @ com.google.gerrit.server.config.GerritServerConfig org.eclipse.jgit.lib.Config config , com.google.gerrit.server.git.WorkQueue workQueue ) { if ( ( interactiveExecutor ) != null ) { return interactiveExecutor ; } int threads = this . threads ; if ( threads <= 0 ) { threads = config.getInt ( "index" , null , "threads" , 0 ) ; } if ( threads <= 0 ) { return com.google.common.util.concurrent.MoreExecutors.newDirectExecutorService ( ) ; } return com.google.common.util.concurrent.MoreExecutors.listeningDecorator ( workQueue.createQueue ( threads , "Index-Interactive" ) ) ; }

Target:
com.google.common.util.concurrent.ListeningExecutorService getInteractiveIndexExecutor ( @ com.google.gerrit.server.config.GerritServerConfig org.eclipse.jgit.lib.Config config , com.google.gerrit.server.git.WorkQueue workQueue ) { if ( ( interactiveExecutor ) != null ) { return interactiveExecutor ; } int threads = this . threads ; if ( threads <= 0 ) { threads = config.getInt ( "index" , null , "threads" , 0 ) ; } if ( threads <= 0 ) { threads = ( ( java.lang.Runtime.getRuntime ( ) . availableProcessors ( ) ) / 2 ) + 1 ; } return com.google.common.util.concurrent.MoreExecutors.listeningDecorator ( workQueue.createQueue ( threads , "Index-Interactive" ) ) ; }
Source:
public void testPushForMaster ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.git.PushForReviewIT.PushOneCommit push = new com.google.gerrit.acceptance.git.PushForReviewIT.PushOneCommit ( ) ; java.lang.String ref = "refs/for/master" ; org.eclipse.jgit.transport.PushResult r = push.to ( ref ) ; com.google.gerrit.acceptance.git.PushForReviewIT.assertOkStatus ( r , ref ) ; assertChange ( push.changeId , Change.Status.NEW , com.google.gerrit.acceptance.git.PushForReviewIT.PushOneCommit.SUBJECT , null ) ; }

Target:
public void testPushForMaster ( ) throws com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.git.PushOneCommit.Result r = pushTo ( "refs/for/master" ) ; r.assertOkStatus ( ) ; r.assertChange ( Change.Status.NEW , null ) ; }
Source:
public void testHostIndex ( ) throws java.lang.Exception { com.google.gitiles.GitilesView view = getView ( "/" ) ; assertEquals ( Type.HOST_INDEX , view.getType ( ) ) ; assertEquals ( "test-host" , view.getHostName ( ) ) ; assertNull ( view.getRepositoryName ( ) ) ; assertEquals ( Revision.NULL , view.getRevision ( ) ) ; assertEquals ( Revision.NULL , view.getOldRevision ( ) ) ; assertNull ( view.getTreePath ( ) ) ; }

Target:
public void testHostIndex ( ) throws java.lang.Exception { com.google.gitiles.GitilesView view = getView ( "/" ) ; assertEquals ( Type.HOST_INDEX , view.getType ( ) ) ; assertEquals ( "test-host" , view.getHostName ( ) ) ; assertNull ( view.getRepositoryName ( ) ) ; assertEquals ( Revision.NULL , view.getRevision ( ) ) ; assertEquals ( Revision.NULL , view.getOldRevision ( ) ) ; assertNull ( view.getPathPart ( ) ) ; }
Source:
public void includeRemoveGroup ( ) throws java.lang.Exception { java.lang.String p = group ( "parent" ) ; java.lang.String g = group ( "newGroup" ) ; gApi.groups ( ) . id ( p ) . addGroups ( g ) ; assertIncludes ( p , g ) ; gApi.groups ( ) . id ( p ) . removeGroups ( g ) ; assertNoIncludes ( p ) ; }

Target:
public void includeRemoveGroup ( ) throws java.lang.Exception { java.lang.String p = createGroup ( "parent" ) ; java.lang.String g = createGroup ( "newGroup" ) ; gApi.groups ( ) . id ( p ) . addGroups ( g ) ; assertIncludes ( p , g ) ; gApi.groups ( ) . id ( p ) . removeGroups ( g ) ; assertNoIncludes ( p ) ; }
Source:
private void initProviderJce ( ) { setKeyExchangeFactories ( NamedFactory.Utils.setUpTransformedFactories ( true , java.util.Collections.unmodifiableList ( java.util.Arrays.asList ( BuiltinDHFactories.dhg1 ) ) , ServerBuilder.DH2KEX ) ) ; setKeyExchangeFactories ( org.apache.sshd.server.ServerBuilder.setUpDefaultKeyExchanges ( true ) ) ; setRandomFactory ( new org.apache.sshd.common.random.SingletonRandomFactory ( org.apache.sshd.common.random.JceRandomFactory.INSTANCE ) ) ; }

Target:
private void initKeyExchanges ( org.eclipse.jgit.lib.Config cfg ) { java.util.List < org.apache.sshd.common.NamedFactory < org.apache.sshd.common.kex.KeyExchange > > a = org.apache.sshd.server.ServerBuilder.setUpDefaultKeyExchanges ( true ) ; setKeyExchangeFactories ( com.google.gerrit.sshd.SshDaemon.filter ( cfg , "kex" , ( ( org.apache.sshd.common.NamedFactory < org.apache.sshd.common.kex.KeyExchange > [ ] ) ( a.toArray ( new org.apache.sshd.common.NamedFactory [ a.size ( ) ] ) ) ) ) ) ; }
Source:
public static void display ( final java.lang.String token ) { if ( ( ( com.google.gerrit.client.Gerrit.body.getView ( ) ) == null ) || ( ! ( com.google.gerrit.client.Gerrit.body.getView ( ) . displayToken ( token ) ) ) ) { com.google.gerrit.client.Gerrit.dispatcher.display ( token ) ; } }

Target:
public static void display ( final java.lang.String token ) { if ( ( ( com.google.gerrit.client.Gerrit.body.getView ( ) ) == null ) || ( ! ( com.google.gerrit.client.Gerrit.body.getView ( ) . displayToken ( token ) ) ) ) { com.google.gerrit.client.Gerrit.dispatcher.display ( token ) ; com.google.gerrit.client.Gerrit.updateUiLink ( token ) ; } }
Source:
private com.google.inject.AbstractModule createIndexModule ( ) { if ( slave ) { return new com.google.gerrit.server.index.DummyIndexModule ( ) ; } com.google.gerrit.server.index.IndexModule.IndexType indexType = com.google.gerrit.server.index.IndexModule.getIndexType ( cfgInjector ) ; 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 void initIndexType ( ) { indexType = com.google.gerrit.server.index.IndexModule.getIndexType ( cfgInjector ) ; switch ( indexType ) { case LUCENE : break ; default : throw new java.lang.IllegalStateException ( ( "unsupported index.type = " + ( indexType ) ) ) ; } }
Source:
public void testBadResponseRetryThenGiveUp ( ) throws java.lang.Exception { com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.wireMockRule.givenThat ( com.github.tomakehurst.wiremock.client.WireMock.post ( com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ENDPOINT ) ) . willReturn ( com.github.tomakehurst.wiremock.client.WireMock.aResponse ( ) . withStatus ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ERROR ) . withBody ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ERROR_MESSAGE ) ) ) ; com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult result = httpSession.post ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ENDPOINT ) ; com.google.common.truth.Truth.assertThat ( result.isSuccessful ( ) ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( result.getMessage ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ERROR_MESSAGE ) ; }

Target:
public void testBadResponseRetryThenGiveUp ( ) throws java.lang.Exception { wireMockRule.givenThat ( com.github.tomakehurst.wiremock.client.WireMock.post ( com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ENDPOINT ) ) . willReturn ( com.github.tomakehurst.wiremock.client.WireMock.aResponse ( ) . withStatus ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ERROR ) . withBody ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ERROR_MESSAGE ) ) ) ; com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpResponseHandler.HttpResult result = httpSession.post ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ENDPOINT ) ; com.google.common.truth.Truth.assertThat ( result.isSuccessful ( ) ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( result.getMessage ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.HttpSessionTest.ERROR_MESSAGE ) ; }
Source:
public synchronized void add ( java.lang.String event ) throws java.io.IOException { long next = ( getHead ( ) ) + 1 ; java.nio.file.Path epath = paths.event ( next ) ; com.googlesource.gerrit.plugins.events.fsstore.Fs.createDirectories ( epath.getParent ( ) ) ; java.nio.file.Files.write ( epath , ( event + "\n" ) . getBytes ( ) ) ; stores.head.spinIncrement ( com.googlesource.gerrit.plugins.events.fsstore.FsStore.MAX_INCREMENT_SPINS ) ; }

Target:
protected java.nio.file.Path getEventDestination ( java.lang.Long n ) { java.nio.file.Path event = paths.events.path ( n ) ; try { com.googlesource.gerrit.plugins.events.fsstore.Fs.createDirectories ( event.getParent ( ) ) ; } catch ( java.io.IOException e ) { } return event ; }
Source:
public T decode ( byte [ ] data , int offset , int length ) { try { return decode ( com.google.protobuf.CodedInputStream.newInstance ( data , offset , length ) ) ; } catch ( java.io.IOException err ) { throw new java.lang.RuntimeException ( "Cannot decode message" , err ) ; } }

Target:
public void mergeFrom ( byte [ ] data , int offset , int length , T obj ) { try { mergeFrom ( com.google.protobuf.CodedInputStream.newInstance ( data , offset , length ) , obj ) ; } catch ( java.io.IOException err ) { throw new java.lang.RuntimeException ( "Cannot decode message" , err ) ; } }
Source:
public java.util.List < com.google.gerrit.server.change.ReviewerJson.ReviewerInfo > format ( java.util.Collection < com.google.gerrit.server.change.ReviewerResource > rsrcs ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.server.change.ReviewerJson.ReviewerInfo > infos = com.google.common.collect.Lists.newArrayListWithCapacity ( rsrcs.size ( ) ) ; com.google.gerrit.server.account.AccountInfo.Loader loader = accountLoaderFactory.create ( true ) ; for ( com.google.gerrit.server.change.ReviewerResource rsrc : rsrcs ) { com.google.gerrit.server.change.ReviewerJson.ReviewerInfo info = format ( rsrc , null ) ; loader.put ( info ) ; infos.add ( info ) ; } loader.fill ( ) ; return infos ; }

Target:
public com.google.gerrit.server.change.ReviewerJson.ReviewerInfo format ( com.google.gerrit.server.change.ReviewerJson.ReviewerInfo out , com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.server.notedb.ChangeNotes changeNotes ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet.Id psId = ctl.getChange ( ) . currentPatchSetId ( ) ; return format ( out , ctl , approvalsUtil.byPatchSetUser ( db.get ( ) , changeNotes , psId , out._id ) ) ; }
Source:
private void removeUI ( ) { if ( ( replyToBox ) != null ) { replyToBox.unregisterReplyBox ( ) ; } parent.removeDraft ( this , comment.side ( ) , ( ( comment.line ( ) ) - 1 ) ) ; removeFromParent ( ) ; getSelfWidget ( ) . clear ( ) ; com.google.gerrit.client.diff.PaddingManager manager = getPaddingManager ( ) ; manager.remove ( this ) ; manager.resizePaddingWidget ( ) ; cm.focus ( ) ; }

Target:
public void execute ( ) { resizePaddingWidget ( ) ; }
Source:
protected void populate ( final int row , final com.google.gerrit.reviewdb.client.Project k ) { table.setWidget ( row , 1 , new com.google.gerrit.client.ui.Hyperlink ( k.getName ( ) , link ( k ) ) ) ; table.setText ( row , 2 , k.getDescription ( ) ) ; setRowItem ( row , k ) ; }

Target:
protected void onOpenRow ( final int row ) { com.google.gwt.user.client.History.newItem ( link ( getRowItem ( row ) ) ) ; }
Source:
private java.util.List < com.google.gerrit.server.query.change.ChangeData > getForOpenChange ( com.google.gerrit.reviewdb.client.Change c , com.google.gerrit.server.CurrentUser user ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.server.git.ChangeSet cs = mergeSuperSet.completeChangeSet ( dbProvider.get ( ) , c , user ) ; if ( cs.furtherHiddenChanges ( ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "change would be submitted with a change that you cannot see" ) ; } return cs.changes ( ) . asList ( ) ; }

Target:
public java.lang.Object apply ( com.google.gerrit.server.change.ChangeResource resource ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.extensions.api.changes.SubmittedTogetherInfo info = apply ( resource , options ) ; if ( options.isEmpty ( ) ) { if ( ( info.nonVisibleChanges ) != 0 ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "change would be submitted with a change that you cannot see" ) ; } return info.changes ; } return info ; }
Source:
protected void configure ( ) { factory ( AddBranch.Factory.class ) ; factory ( AddRefRight.Factory.class ) ; factory ( ChangeProjectSettings.Factory.class ) ; factory ( DeleteBranches.Factory.class ) ; factory ( DeleteRefRights.Factory.class ) ; factory ( ListBranches.Factory.class ) ; factory ( OwnedProjects.Factory.class ) ; factory ( ProjectDetailFactory.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( AddBranch.Factory.class ) ; factory ( AddRefRight.Factory.class ) ; factory ( ChangeProjectSettings.Factory.class ) ; factory ( DeleteBranches.Factory.class ) ; factory ( DeleteRefRights.Factory.class ) ; factory ( ListBranches.Factory.class ) ; factory ( VisibleProjects.Factory.class ) ; factory ( ProjectDetailFactory.Factory.class ) ; }
Source:
public static java.nio.file.Path storeInTemp ( java.lang.String pluginName , java.io.InputStream in , com.google.gerrit.server.config.SitePaths sitePaths ) throws java.io.IOException { if ( ! ( java.nio.file.Files.exists ( sitePaths.tmp_dir ) ) ) { java.nio.file.Files.createDirectories ( sitePaths.tmp_dir ) ; } return com.google.gerrit.server.plugins.PluginLoader.asTemp ( in , com.google.gerrit.server.plugins.JarPluginProvider.tempNameFor ( pluginName ) , ".jar" , sitePaths.tmp_dir ) ; }

Target:
public static java.nio.file.Path storeInTemp ( java.lang.String pluginName , java.io.InputStream in , com.google.gerrit.server.config.SitePaths sitePaths ) throws java.io.IOException { if ( ! ( java.nio.file.Files.exists ( sitePaths.tmp_dir ) ) ) { java.nio.file.Files.createDirectories ( sitePaths.tmp_dir ) ; } return com.google.gerrit.server.plugins.PluginUtil.asTemp ( in , com.google.gerrit.server.plugins.JarPluginProvider.tempNameFor ( pluginName ) , ".jar" , sitePaths.tmp_dir ) ; }
Source:
public void testAppend_char ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; org.junit.Assert.assertSame ( b , b.append ( 'a' ) ) ; org.junit.Assert.assertSame ( b , b.append ( 'b' ) ) ; org.junit.Assert.assertEquals ( "ab" , b.asString ( ) ) ; }

Target:
public void testAppend_char ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; com.google.common.truth.Truth.assertThat ( b ) . isSameAs ( b.append ( 'a' ) ) ; com.google.common.truth.Truth.assertThat ( b ) . isSameAs ( b.append ( 'b' ) ) ; com.google.common.truth.Truth.assertThat ( "ab" ) ; }
Source:
private net.codemirror.lib.Configuration getConfig ( ) { return net.codemirror.lib.Configuration.create ( ) . set ( "readOnly" , false ) . set ( "cursorBlinkRate" , 0 ) . set ( "cursorHeight" , 0.85 ) . set ( "lineNumbers" , true ) . set ( "tabSize" , 4 ) . set ( "lineWrapping" , false ) . set ( "styleSelectedText" , true ) . set ( "showTrailingSpace" , true ) . set ( "keyMap" , "default" ) ; }

Target:
private net.codemirror.lib.Configuration getConfig ( ) { return net.codemirror.lib.Configuration.create ( ) . set ( "readOnly" , false ) . set ( "cursorBlinkRate" , 0 ) . set ( "cursorHeight" , 0.85 ) . set ( "lineNumbers" , true ) . set ( "tabSize" , 4 ) . set ( "lineWrapping" , false ) . set ( "styleSelectedText" , true ) . set ( "showTrailingSpace" , true ) . set ( "keyMap" , "default" ) . set ( "mode" , net.codemirror.lib.ModeInjector.getContentType ( type ) ) ; }
Source:
public void deleteVoteFromReviewableChangeWithSelfCc ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; selfCc ( ) ; deleteVote ( sc , voter ) ; assertThat ( sender ) . sent ( "deleteVote" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer , voter ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void deleteVoteFromReviewableChangeWithSelfCc ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; selfCc ( ) ; deleteVote ( sc , voter ) ; assertThat ( sender ) . sent ( "deleteVote" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer , voter ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) . noOneElse ( ) ; }
Source:
public boolean isOwner ( ) { if ( ( owner ) == null ) { if ( canPerform ( Permission.OWNER ) ) { owner = true ; } else if ( getRefName ( ) . equals ( AccessSection.ALL.substring ( 0 , ( ( AccessSection.ALL.length ( ) ) - 1 ) ) ) ) { owner = getCurrentUser ( ) . isAdministrator ( ) ; } else { owner = getProjectControl ( ) . isOwner ( ) ; } } return owner ; }

Target:
public boolean isOwner ( ) { if ( ( owner ) == null ) { if ( canPerform ( Permission.OWNER ) ) { owner = true ; } else if ( getRefName ( ) . equals ( AccessSection.ALL.substring ( 0 , ( ( AccessSection.ALL.length ( ) ) - 1 ) ) ) ) { owner = getCurrentUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ; } else { owner = getProjectControl ( ) . isOwner ( ) ; } } return owner ; }
Source:
public void onLoad ( ) { if ( ( tabs ) == null ) { initUI ( ) ; } super . onLoad ( ) ; tabs.selectTab ( tabTokens.indexOf ( initialTabToken ) ) ; Util.PROJECT_SVC.projectDetail ( projectId , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.admin.ProjectDetail > ( ) { public void onSuccess ( final com.google.gerrit.client.admin.ProjectDetail result ) { display ( result ) ; } } ) ; }

Target:
public void onLoad ( ) { if ( ( tabs ) == null ) { initUI ( ) ; } super . onLoad ( ) ; tabs.selectTab ( tabTokens.indexOf ( initialTabToken ) ) ; Util.PROJECT_SVC.projectDetail ( projectId , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.admin.ProjectDetail > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gerrit.client.admin.ProjectDetail result ) { display ( result ) ; } } ) ; }
Source:
public void run ( ) { com.google.gerrit.pgm.Daemon.log.info ( "caught shutdown, cleaning up" ) ; if ( ( runId ) != null ) { runFile.delete ( ) ; } manager.stop ( ) ; }

Target:
public void stop ( ) { if ( ( runId ) != null ) { try { java.nio.file.Files.delete ( runFile ) ; } catch ( java.io.IOException err ) { com.google.gerrit.pgm.Daemon.log.warn ( ( "failed to delete " + ( runFile ) ) , err ) ; } } manager.stop ( ) ; }
Source:
public com.google.gerrit.testutil.TestNotesMigration setFrom ( com.google.gerrit.server.notedb.NotesMigration other ) { setWriteChanges ( other.rawWriteChangesSetting ( ) ) ; setReadChanges ( other.readChanges ( ) ) ; setChangePrimaryStorage ( other.changePrimaryStorage ( ) ) ; setDisableChangeReviewDb ( other.disableChangeReviewDb ( ) ) ; return this ; }

Target:
public com.google.gerrit.testutil.TestNotesMigration setFrom ( com.google.gerrit.server.notedb.NotesMigration other ) { setWriteChanges ( other.rawWriteChangesSetting ( ) ) ; setReadChanges ( other.readChanges ( ) ) ; setChangePrimaryStorage ( other.changePrimaryStorage ( ) ) ; setDisableChangeReviewDb ( other.disableChangeReviewDb ( ) ) ; setFuseUpdates ( other.fuseUpdates ( ) ) ; return this ; }
Source:
private boolean shouldSkip ( java.nio.file.Path p ) throws java.io.IOException { java.nio.file.Path resolved = master.site_path.resolve ( p ) ; for ( java.nio.file.Path skip : toSkip ) { if ( ( java.nio.file.Files.exists ( skip ) ) && ( java.nio.file.Files.isSameFile ( resolved , skip ) ) ) { return true ; } } return false ; }

Target:
private boolean shouldSkip ( java.nio.file.Path p ) throws java.io.IOException { java.nio.file.Path resolved = master.site_path.resolve ( p ) ; for ( java.nio.file.Path skip : toSkip ) { if ( ( skip.toFile ( ) . exists ( ) ) && ( java.nio.file.Files.isSameFile ( resolved , skip ) ) ) { return true ; } } return false ; }
Source:
private boolean canForceUpdate ( ) { if ( ! ( canWrite ( ) ) ) { return false ; } if ( canPushWithForce ( ) ) { return true ; } switch ( getUser ( ) . getAccessPath ( ) ) { case GIT : return false ; case JSON_RPC : case REST_API : case SSH_COMMAND : case UNKNOWN : case WEB_BROWSER : default : return ( getUser ( ) . getCapabilities ( ) . isAdmin_DoNotUse ( ) ) || ( ( isOwner ( ) ) && ( ! ( isForceBlocked ( Permission.PUSH ) ) ) ) ; } }

Target:
private boolean canForceUpdate ( ) { if ( ! ( isProjectStatePermittingWrite ( ) ) ) { return false ; } if ( canPushWithForce ( ) ) { return true ; } switch ( getUser ( ) . getAccessPath ( ) ) { case GIT : return false ; case JSON_RPC : case REST_API : case SSH_COMMAND : case UNKNOWN : case WEB_BROWSER : default : return ( getUser ( ) . getCapabilities ( ) . isAdmin_DoNotUse ( ) ) || ( ( isOwner ( ) ) && ( ! ( isForceBlocked ( Permission.PUSH ) ) ) ) ; } }
Source:
public void onFailure ( java.lang.Throwable caught ) { com.google.gerrit.client.changes.StarredChanges.rollback ( req ) ; if ( ( com.google.gerrit.client.changes.StarredChanges.next ) != null ) { com.google.gerrit.client.changes.StarredChanges.rollback ( com.google.gerrit.client.changes.StarredChanges.next ) ; com.google.gerrit.client.changes.StarredChanges.next = null ; } com.google.gerrit.client.changes.StarredChanges.busy = false ; super . onFailure ( caught ) ; }

Target:
public void onFailure ( java.lang.Throwable caught ) { if ( ( ! starred ) && ( com.google.gerrit.client.rpc.RestApi.isStatus ( caught , 404 ) ) ) { onSuccess ( null ) ; return ; } com.google.gerrit.client.changes.StarredChanges.fireChangeStarEvent ( id , ( ! starred ) ) ; for ( java.util.Map.Entry < com.google.gerrit.reviewdb.client.Change.Id , java.lang.Boolean > e : com.google.gerrit.client.changes.StarredChanges.pending.entrySet ( ) ) { com.google.gerrit.client.changes.StarredChanges.fireChangeStarEvent ( e.getKey ( ) , ( ! ( e.getValue ( ) ) ) ) ; } com.google.gerrit.client.changes.StarredChanges.pending.clear ( ) ; com.google.gerrit.client.changes.StarredChanges.busy = false ; }
Source:
public void updateComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) throws com.google.gwtorm.server.OrmException { verifyComment ( c ) ; com.google.common.base.Preconditions.checkArgument ( ( ( c.getStatus ( ) ) == ( com.google.gerrit.reviewdb.client.PatchLineComment.Status.DRAFT ) ) , "Cannot update a published comment into a ChangeDraftUpdate" ) ; if ( migration.readChanges ( ) ) { com.google.common.base.Preconditions.checkArgument ( draftNotes.load ( ) . containsComment ( c ) , "Cannot update this comment because it didn't exist previously" ) ; } upsertComments.add ( c ) ; }

Target:
public void updateComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) throws com.google.gwtorm.server.OrmException { verifyComment ( c ) ; com.google.common.base.Preconditions.checkArgument ( ( ( c.getStatus ( ) ) == ( PatchLineComment.Status.DRAFT ) ) , "Cannot update a published comment into a ChangeDraftUpdate" ) ; if ( migration.readChanges ( ) ) { com.google.common.base.Preconditions.checkArgument ( draftNotes.load ( ) . containsComment ( c ) , "Cannot update this comment because it didn't exist previously" ) ; } upsertComments.add ( c ) ; }
Source:
public void run ( ) { if ( cm.isScrollSetByOther ( ) ) { return ; } other.scrollToY ( cm.getScrollInfo ( ) . getTop ( ) ) ; other.setScrollSetByOther ( true ) ; com.google.gwt.core.client.Scheduler.get ( ) . scheduleFixedDelay ( new com.google.gwt.core.client.Scheduler.RepeatingCommand ( ) { @ java.lang.Override public boolean execute ( ) { other.setScrollSetByOther ( false ) ; return false ; } } , 0 ) ; }

Target:
public void run ( ) { net.codemirror.lib.CodeMirror.Viewport fromTo = cm.getViewport ( ) ; int size = ( ( fromTo.getTo ( ) ) - ( fromTo.getFrom ( ) ) ) + 1 ; if ( ( cm.getOldViewportSize ( ) ) == size ) { return ; } cm.setOldViewportSize ( size ) ; diffTable.sidePanel.adjustGutters ( cmB ) ; }
Source:
public void patchSetObjectMissing ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( project , userId ) ; db.changes ( ) . insert ( java.util.Collections.singleton ( c ) ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.testutil.TestChanges.newPatchSet ( c.currentPatchSetId ( ) , org.eclipse.jgit.lib.ObjectId.fromString ( "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) , userId ) ; db.patchSets ( ) . insert ( java.util.Collections.singleton ( ps ) ) ; assertProblems ( c , "Object missing: patch set 1: deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) ; }

Target:
public void patchSetObjectMissing ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.testutil.TestChanges.newPatchSet ( c.currentPatchSetId ( ) , org.eclipse.jgit.lib.ObjectId.fromString ( "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) , userId ) ; db.patchSets ( ) . insert ( java.util.Collections.singleton ( ps ) ) ; assertProblems ( c , "Object missing: patch set 1: deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) ; }
Source:
public void fire ( com.google.gerrit.reviewdb.client.Account account , java.lang.String agreementName ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.AgreementSignup.Event event = new com.google.gerrit.server.extensions.events.AgreementSignup.Event ( util.accountInfo ( account ) , agreementName ) ; for ( com.google.gerrit.extensions.events.AgreementSignupListener l : listeners ) { try { l.onAgreementSignup ( event ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.extensions.events.AgreementSignup.log.warn ( "Error in event listener" , e ) ; } } }

Target:
public void fire ( com.google.gerrit.reviewdb.client.Account account , java.lang.String agreementName ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.AgreementSignup.Event event = new com.google.gerrit.server.extensions.events.AgreementSignup.Event ( util.accountInfo ( account ) , agreementName ) ; for ( com.google.gerrit.extensions.events.AgreementSignupListener l : listeners ) { try { l.onAgreementSignup ( event ) ; } catch ( java.lang.Exception e ) { util.logEventListenerError ( com.google.gerrit.server.extensions.events.AgreementSignup.log , e ) ; } } }
Source:
public void deleteBranchByProjectOwnerForcePushBlocked_Forbidden ( ) throws java.lang.Exception { grantOwner ( ) ; blockForcePush ( ) ; com.google.gerrit.acceptance.RestResponse r = userSession.delete ( ( ( ( "/projects/" + ( project.get ( ) ) ) + "/branches/" ) + ( branch.getShortName ( ) ) ) ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_FORBIDDEN ) ; r.consume ( ) ; }

Target:
public void deleteBranchByProjectOwner ( ) throws java.lang.Exception { grantOwner ( ) ; setApiUser ( user ) ; assertDeleteSucceeds ( ) ; }
Source:
protected boolean isVisibleTo ( final com.google.gerrit.reviewdb.Account.Id to ) { return ( ( ( projectState ) == null ) || ( ( change ) == null ) ) || ( projectState.controlFor ( args.identifiedUserFactory.create ( to ) ) . controlFor ( change ) . isVisible ( ) ) ; }

Target:
protected boolean isVisibleTo ( final com.google.gerrit.reviewdb.Account.Id to ) throws com.google.gwtorm.client.OrmException { return ( ( ( projectState ) == null ) || ( ( change ) == null ) ) || ( projectState.controlFor ( args.identifiedUserFactory.create ( to ) ) . controlFor ( change ) . isVisible ( args.db.get ( ) ) ) ; }