auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testDoPostBadRequest ( ) throws java.lang.Exception { org.easymock.EasyMock.expect ( req.getReader ( ) ) . andThrow ( new java.io.IOException ( ) ) ; replayAll ( ) ; syncEventsRestApiServlet.doPost ( req , rsp ) ; verifyAll ( ) ; }

Target:
public void testDoPostBadRequest ( ) throws java.lang.Exception { org.mockito.Mockito.doThrow ( new java.io.IOException ( com.ericsson.gerrit.plugins.syncevents.SyncEventsRestApiServletTest.ERR_MSG ) ) . when ( req ) . getReader ( ) ; syncEventsRestApiServlet.doPost ( req , rsp ) ; org.mockito.Mockito.verify ( rsp ) . sendError ( javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST , com.ericsson.gerrit.plugins.syncevents.SyncEventsRestApiServletTest.ERR_MSG ) ; }
Source:
public void listNonEmptyGroupIncludes ( ) throws java.lang.Exception { java.lang.String gx = group ( "gx" ) ; java.lang.String gy = group ( "gy" ) ; java.lang.String gz = group ( "gz" ) ; gApi.groups ( ) . id ( gx ) . addGroups ( gy ) ; gApi.groups ( ) . id ( gx ) . addGroups ( gz ) ; assertIncludes ( gApi.groups ( ) . id ( gx ) . includedGroups ( ) , gy , gz ) ; }

Target:
private java.lang.String createGroup ( java.lang.String name ) throws java.lang.Exception { return createGroup ( name , "Administrators" ) ; }
Source:
public void changeAssigneeToSelfOnReviewableChangeInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; assign ( sc , sc.owner , assignee ) ; sender.clear ( ) ; assign ( sc , sc.owner , sc.owner ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . notTo ( sc.owner , sc.reviewer , sc.ccer , sc.starrer , assignee ) . to ( sc.reviewerByEmail ) . cc ( sc.ccerByEmail ) ; }

Target:
public void changeAssigneeToSelfOnReviewableChangeInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; assign ( sc , sc.owner , sc.assignee ) ; sender.clear ( ) ; assign ( sc , sc.owner , sc.owner ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . notTo ( sc.owner , sc.reviewer , sc.ccer , sc.starrer , sc.assignee ) . to ( sc.reviewerByEmail ) . cc ( sc.ccerByEmail ) ; }
Source:
public void setUpInjector ( ) throws java.lang.Exception { com.google.inject.Injector injector = createInjector ( ) ; injector.injectMembers ( this ) ; lifecycle = new com.google.gerrit.lifecycle.LifecycleManager ( ) ; lifecycle.add ( injector ) ; lifecycle.start ( ) ; db = schemaFactory.open ( ) ; schemaCreator.create ( db ) ; userId = accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "user" ) ) . getAccountId ( ) ; com.google.gerrit.reviewdb.client.Account userAccount = db.accounts ( ) . get ( userId ) ; userAccount.setPreferredEmail ( "user@example.com" ) ; db.accounts ( ) . update ( com.google.common.collect.ImmutableList.of ( userAccount ) ) ; user = userFactory.create ( userId ) ; requestContext.setContext ( new com.google.gerrit.server.util.RequestContext ( ) { @ java.lang.Override public com.google.gerrit.server.CurrentUser getCurrentUser ( ) { return user ; } @ java.lang.Override public com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > getReviewDbProvider ( ) { return com.google.inject.util.Providers.of ( db ) ; } } ) ; }

Target:
private com.google.gerrit.server.util.RequestContext newRequestContext ( com.google.gerrit.reviewdb.client.Account.Id requestUserId ) { final com.google.gerrit.server.CurrentUser requestUser = userFactory.create ( requestUserId ) ; return new com.google.gerrit.server.util.RequestContext ( ) { @ java.lang.Override public com.google.gerrit.server.CurrentUser getCurrentUser ( ) { return requestUser ; } @ java.lang.Override public com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > getReviewDbProvider ( ) { return com.google.inject.util.Providers.of ( db ) ; } } ; }
Source:
private void verifyOne ( com.google.gerrit.reviewdb.client.PatchSet patchSet ) throws com.googlesource.gerrit.plugins.verifystatus.commands.UnloggedFailure { com.googlesource.gerrit.plugins.verifystatus.common.VerifyInput verify = new com.googlesource.gerrit.plugins.verifystatus.common.VerifyInput ( ) ; verify.verifications = jobResult ; try { applyVerification ( patchSet , verify ) ; } catch ( com.google.gerrit.extensions.restapi.RestApiException | com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw com.google.gerrit.sshd.commands.PatchSetParser.error ( e.getMessage ( ) ) ; } }

Target:
private void verifyOne ( com.google.gerrit.reviewdb.client.PatchSet patchSet ) throws com.googlesource.gerrit.plugins.verifystatus.UnloggedFailure { com.googlesource.gerrit.plugins.verifystatus.common.VerifyInput verify = new com.googlesource.gerrit.plugins.verifystatus.common.VerifyInput ( ) ; verify.verifications = jobResult ; try { applyVerification ( patchSet , verify ) ; } catch ( com.google.gerrit.extensions.restapi.RestApiException | com.google.gwtorm.server.OrmException | java.io.IOException e ) { throw com.google.gerrit.sshd.commands.PatchSetParser.error ( e.getMessage ( ) ) ; } }
Source:
protected com.google.gwtorm.nosql.IndexFunction < T > getQueryIndex ( java.lang.String indexName ) throws com.google.gwtorm.client.OrmException { for ( com.google.gwtorm.nosql.IndexFunction < T > f : getQueryIndexes ( ) ) { if ( indexName.equals ( f.getName ( ) ) ) { return f ; } } if ( indexName.equals ( getKeyIndex ( ) . getName ( ) ) ) { return getKeyIndex ( ) ; } throw new com.google.gwtorm.client.OrmException ( ( "No index named " + indexName ) ) ; }

Target:
protected abstract com.google.gwtorm.client.ResultSet < T > scanPrimaryKey ( byte [ ] fromKey , byte [ ] toKey , int limit ) throws com.google.gwtorm.client.OrmException ;
Source:
public void testDeleteOneExisting ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { stubExecuteBatchOK ( com.google.gwtorm.jdbc.TestJdbcAccess.DELETE , 1 ) ; createClassUnderTest ( ) . delete ( com.google.gwtorm.jdbc.TestJdbcAccess.ONE_ROW ) ; }

Target:
public void testDeleteOneNotExisting ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement delete = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.DELETE , 0 ) ; com.google.gwtorm.jdbc.JdbcAccess < com.google.gwtorm.jdbc.TestJdbcAccess.Data , com.google.gwtorm.jdbc.TestJdbcAccess.Data.DataKey > classUnderTest = createClassUnderTest ( ) ; try { classUnderTest.delete ( oneRow ) ; org.junit.Assert.fail ( "missing OrmConcurrencyException" ) ; } catch ( com.google.gwtorm.server.OrmConcurrencyException e ) { } com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( delete ) ; }
Source:
public void onPostReceive ( org.eclipse.jgit.transport.ReceivePack rp , java.util.Collection < org.eclipse.jgit.transport.ReceiveCommand > commands ) { com.google.gerrit.reviewdb.client.Project.NameKey project = projectNameResolver.projectName ( rp.getRepository ( ) ) ; try { cache.get ( project ) . getAndAdd ( rp.getPackSize ( ) ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.googlesource.gerrit.plugins.quota.MaxRepositorySizeQuota.log.warn ( ( "Couldn't process onPostReceive for " + ( project.get ( ) ) ) , e ) ; } }

Target:
public void onPostReceive ( org.eclipse.jgit.transport.ReceivePack rp , java.util.Collection < org.eclipse.jgit.transport.ReceiveCommand > commands ) { com.google.gerrit.reviewdb.client.Project.NameKey project = projectNameResolver.projectName ( rp.getRepository ( ) ) ; if ( needPack ( commands ) ) { try { cache.get ( project ) . getAndAdd ( rp.getPackSize ( ) ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.googlesource.gerrit.plugins.quota.MaxRepositorySizeQuota.log.warn ( ( "Couldn't process onPostReceive for " + ( project.get ( ) ) ) , e ) ; } } }
Source:
private void loadMyEmails ( ) throws com.google.gerrit.server.ssh.Failure { try { for ( final com.google.gerrit.client.reviewdb.AccountExternalId id : db.accountExternalIds ( ) . byAccount ( userAccount.getId ( ) ) ) { if ( ( ( id.getEmailAddress ( ) ) != null ) && ( ( id.getEmailAddress ( ) . length ( ) ) > 0 ) ) { myEmails.add ( id.getEmailAddress ( ) ) ; } } } catch ( com.google.gwtorm.client.OrmException e ) { throw new com.google.gerrit.server.ssh.Failure ( 1 , "fatal: database error" , e ) ; } }

Target:
private void addEmail ( final java.lang.String email ) { if ( ( email != null ) && ( ( email.length ( ) ) > 0 ) ) { myEmails.add ( email ) ; } }
Source:
public void invalidKey ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key3 = com.google.gerrit.gpg.testutil.TestKey.key3 ( ) ; org.eclipse.jgit.transport.PushCertificate cert = newSignedCert ( validNonce ( ) , key3 ) ; assertProblems ( cert , ( ( "Invalid public key (" + ( com.google.gerrit.gpg.PublicKeyStore.keyToString ( key3.getPublicKey ( ) ) ) ) + "):\n Key is expired" ) ) ; }

Target:
public void invalidKey ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key3 = com.google.gerrit.gpg.testutil.TestKey.key3 ( ) ; org.eclipse.jgit.transport.PushCertificate cert = newSignedCert ( validNonce ( ) , key3 ) ; assertProblems ( cert , ( ( "Invalid public key " + ( com.google.gerrit.gpg.PublicKeyStore.keyToString ( key3.getPublicKey ( ) ) ) ) + ":\n Key is expired" ) ) ; }
Source:
public void pushWithoutChangeId ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit c = com.google.gerrit.acceptance.git.AbstractPushForReview.createCommit ( testRepo , "Message without Change-Id" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.acceptance.GitUtil.getChangeId ( testRepo , c ) . isPresent ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "missing Change-Id in commit message footer" ) ; com.google.gerrit.server.git.ProjectConfig config = projectCache.checkedGet ( project ) . getConfig ( ) ; config.getProject ( ) . setRequireChangeID ( InheritableBoolean.FALSE ) ; saveProjectConfig ( project , config ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewOk ( testRepo ) ; }

Target:
private void testPushWithoutChangeId ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit c = com.google.gerrit.acceptance.git.AbstractPushForReview.createCommit ( testRepo , "Message without Change-Id" ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.acceptance.GitUtil.getChangeId ( testRepo , c ) . isPresent ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewRejected ( testRepo , "missing Change-Id in commit message footer" ) ; com.google.gerrit.server.git.ProjectConfig config = projectCache.checkedGet ( project ) . getConfig ( ) ; config.getProject ( ) . setRequireChangeID ( InheritableBoolean.FALSE ) ; saveProjectConfig ( project , config ) ; com.google.gerrit.acceptance.git.AbstractPushForReview.pushForReviewOk ( testRepo ) ; }
Source:
private Project.NameKey getProjectName ( final java.lang.String prefix , final java.lang.String fileName ) { final java.lang.String projectName ; if ( fileName.endsWith ( Constants.DOT_GIT_EXT ) ) { int newLen = ( fileName.length ( ) ) - ( Constants.DOT_GIT_EXT.length ( ) ) ; projectName = prefix + ( fileName.substring ( 0 , newLen ) ) ; } else { projectName = prefix + fileName ; } return new com.google.gerrit.reviewdb.client.Project.NameKey ( projectName ) ; }

Target:
private Project.NameKey getProjectName ( java.nio.file.Path p ) { java.lang.String projectName = basePath.relativize ( p ) . toString ( ) ; if ( ( java.io.File.separatorChar ) != '/' ) { projectName = projectName.replace ( java.io.File.separatorChar , '/' ) ; } if ( projectName.endsWith ( Constants.DOT_GIT_EXT ) ) { int newLen = ( projectName.length ( ) ) - ( Constants.DOT_GIT_EXT.length ( ) ) ; projectName = projectName.substring ( 0 , newLen ) ; } return new com.google.gerrit.reviewdb.client.Project.NameKey ( projectName ) ; }
Source:
public void testGetAddressAccess ( ) throws java.lang.Exception { final com.google.gwtorm.data.PhoneBookDb schema = open ( ) ; assertNotNull ( schema.addresses ( ) ) ; }

Target:
public void testGetAddressAccess ( ) throws java.lang.Exception { final com.google.gwtorm.data.PhoneBookDb schema = open ( ) ; org.junit.Assert.assertNotNull ( schema.addresses ( ) ) ; org.junit.Assert.assertEquals ( "addresses" , schema.addresses ( ) . getRelationName ( ) ) ; org.junit.Assert.assertEquals ( 2 , schema.addresses ( ) . getRelationID ( ) ) ; }
Source:
public void unblockRangeForChangeOwner ( ) { com.google.gerrit.server.project.testing.Util.allow ( local , ( ( com.google.gerrit.common.data.Permission.LABEL ) + "Code-Review" ) , ( - 2 ) , ( + 2 ) , com.google.gerrit.server.group.SystemGroupBackend.CHANGE_OWNER , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.testing.Util.DEVS ) ; com.google.gerrit.common.data.PermissionRange range = u.controlForRef ( "refs/heads/master" ) . getRange ( ( ( com.google.gerrit.common.data.Permission.LABEL ) + "Code-Review" ) , true ) ; assertCanVote ( ( - 2 ) , range ) ; assertCanVote ( 2 , range ) ; }

Target:
public void unblockRangeForChangeOwner ( ) { com.google.gerrit.server.project.testing.Util.allow ( local , ( ( com.google.gerrit.common.data.Permission.LABEL ) + "Code-Review" ) , ( - 2 ) , ( + 2 ) , com.google.gerrit.server.group.SystemGroupBackend.CHANGE_OWNER , "refs/heads/*" ) ; com.google.gerrit.server.permissions.ProjectControl u = user ( local , com.google.gerrit.server.project.testing.Util.DEVS ) ; com.google.gerrit.common.data.PermissionRange range = u.controlForRef ( "refs/heads/master" ) . getRange ( ( ( com.google.gerrit.common.data.Permission.LABEL ) + "Code-Review" ) , true ) ; assertCanVote ( ( - 2 ) , range ) ; assertCanVote ( 2 , range ) ; }
Source:
private static void appendCallbackParameter ( final javax.servlet.http.HttpServletRequest req , final java.lang.StringBuffer url ) { url.append ( com.google.gerrit.server.LoginServlet.CALLBACK_PARMETER ) ; url.append ( "=" ) ; url.append ( org.mortbay.util.UrlEncoded.encodeString ( req.getParameter ( com.google.gerrit.server.LoginServlet.CALLBACK_PARMETER ) ) ) ; }

Target:
private void redirectChooseProvider ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { final java.lang.StringBuilder url = new java.lang.StringBuilder ( req.getRequestURL ( ) ) ; com.google.gerrit.server.LoginServlet.append ( url , com.google.gerrit.server.LoginServlet.CALLBACK_PARMETER , req.getParameter ( com.google.gerrit.server.LoginServlet.CALLBACK_PARMETER ) ) ; com.google.gerrit.server.LoginServlet.append ( url , RelyingParty.DEFAULT_PARAMETER , GoogleAccountDiscovery.GOOGLE_ACCOUNT ) ; rsp.sendRedirect ( url.toString ( ) ) ; }
Source:
public void createProjectWithGitSuffix ( ) throws java.lang.Exception { java.lang.String name = name ( "foo" ) ; com.google.common.truth.Truth.assertThat ( name ) . isEqualTo ( gApi.projects ( ) . create ( ( name + ".git" ) ) . get ( ) . name ) ; }

Target:
public void createProjectWithGitSuffix ( ) throws java.lang.Exception { java.lang.String name = name ( "foo" ) ; com.google.common.truth.Truth.assertThat ( name ) . isEqualTo ( gApi.projects ( ) . create ( ( name + ".git" ) ) . get ( ) . name ) ; org.eclipse.jgit.revwalk.RevCommit head = getRemoteHead ( name , "refs/meta/config" ) ; eventRecorder.assertRefUpdatedEvents ( name , "refs/meta/config" , null , head ) ; eventRecorder.assertRefUpdatedEvents ( name , "refs/heads/master" , new java.lang.String [ ] { } ) ; }
Source:
public static com.google.gerrit.extensions.common.SshKeyInfo newSshKeyInfo ( com.google.gerrit.reviewdb.client.AccountSshKey sshKey ) { com.google.gerrit.extensions.common.SshKeyInfo info = new com.google.gerrit.extensions.common.SshKeyInfo ( ) ; info.seq = sshKey.getKey ( ) . get ( ) ; info.sshPublicKey = sshKey.getSshPublicKey ( ) ; info.encodedKey = sshKey.getEncodedKey ( ) ; info.algorithm = sshKey.getAlgorithm ( ) ; info.comment = com.google.common.base.Strings.emptyToNull ( sshKey.getComment ( ) ) ; info.valid = sshKey.isValid ( ) ; return info ; }

Target:
public static com.google.gerrit.extensions.common.SshKeyInfo newSshKeyInfo ( com.google.gerrit.server.account.AccountSshKey sshKey ) { com.google.gerrit.extensions.common.SshKeyInfo info = new com.google.gerrit.extensions.common.SshKeyInfo ( ) ; info.seq = sshKey.getKey ( ) . get ( ) ; info.sshPublicKey = sshKey.getSshPublicKey ( ) ; info.encodedKey = sshKey.getEncodedKey ( ) ; info.algorithm = sshKey.getAlgorithm ( ) ; info.comment = com.google.common.base.Strings.emptyToNull ( sshKey.getComment ( ) ) ; info.valid = sshKey.isValid ( ) ; return info ; }
Source:
public void rescheduleOnRecoverableException ( ) throws java.io.IOException { org.mockito.Mockito.when ( session.post ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.WEBHOOK_URL , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.HEADERS , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.BODY ) ) . thenThrow ( java.io.IOException.class ) ; task.run ( ) ; org.mockito.Mockito.verify ( executor , org.mockito.Mockito.times ( 1 ) ) . schedule ( task , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.RETRY_INTERVAL , java.util.concurrent.TimeUnit.MILLISECONDS ) ; }

Target:
public void rescheduleOnError ( ) throws java.io.IOException { org.mockito.Mockito.when ( session.post ( org.mockito.ArgumentMatchers.eq ( remote ) , org.mockito.ArgumentMatchers.eq ( content ) ) ) . thenReturn ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.ERR_RESULT ) ; task.run ( ) ; org.mockito.Mockito.verify ( executor , org.mockito.Mockito.times ( 1 ) ) . schedule ( task , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.RETRY_INTERVAL , java.util.concurrent.TimeUnit.MILLISECONDS ) ; }
Source:
private com.google.gerrit.server.notedb.ChangeUpdate newUpdate ( com.google.gerrit.reviewdb.client.Change c , final com.google.gerrit.server.IdentifiedUser user ) throws java.lang.Exception { return injector.createChildInjector ( new com.google.gerrit.server.config.FactoryModule ( ) { @ java.lang.Override public void configure ( ) { factory ( ChangeUpdate.Factory.class ) ; bind ( com.google.gerrit.server.IdentifiedUser.class ) . toInstance ( user ) ; } } ) . getInstance ( ChangeUpdate.Factory.class ) . create ( stubChangeControl ( c , user ) , com.google.gerrit.server.util.TimeUtil.nowTs ( ) , com.google.gerrit.server.notedb.ChangeNotesTest.LABEL_TYPES ) ; }

Target:
private com.google.gerrit.server.notedb.ChangeUpdate newUpdate ( com.google.gerrit.reviewdb.client.Change c , final com.google.gerrit.server.IdentifiedUser user ) throws java.lang.Exception { return injector.createChildInjector ( new com.google.gerrit.server.config.FactoryModule ( ) { @ java.lang.Override public void configure ( ) { factory ( ChangeUpdate.Factory.class ) ; bind ( com.google.gerrit.server.IdentifiedUser.class ) . toInstance ( user ) ; } } ) . getInstance ( ChangeUpdate.Factory.class ) . create ( stubChangeControl ( c , user ) , com.google.gerrit.server.util.TimeUtil.nowTs ( ) , com.google.common.collect.Ordering.< java.lang.String > natural ( ) ) ; }
Source:
public static com.google.gerrit.extensions.client.EditPreferencesInfo defaults ( ) { com.google.gerrit.extensions.client.EditPreferencesInfo i = new com.google.gerrit.extensions.client.EditPreferencesInfo ( ) ; i.tabSize = 8 ; i.lineLength = 100 ; i.cursorBlinkRate = 0 ; i.hideTopMenu = false ; i.showTabs = true ; i.showWhitespaceErrors = false ; i.syntaxHighlighting = true ; i.hideLineNumbers = false ; i.theme = com.google.gerrit.extensions.client.Theme.DEFAULT ; i.keyMapType = KeyMapType.DEFAULT ; return i ; }

Target:
public static com.google.gerrit.extensions.client.EditPreferencesInfo defaults ( ) { com.google.gerrit.extensions.client.EditPreferencesInfo i = new com.google.gerrit.extensions.client.EditPreferencesInfo ( ) ; i.tabSize = 8 ; i.lineLength = 100 ; i.cursorBlinkRate = 0 ; i.hideTopMenu = false ; i.showTabs = true ; i.showWhitespaceErrors = false ; i.syntaxHighlighting = true ; i.hideLineNumbers = false ; i.matchBrackets = true ; i.theme = Theme.DEFAULT ; i.keyMapType = KeyMapType.DEFAULT ; return i ; }
Source:
protected void configureServlets ( ) { rpc ( com.google.gerrit.server.openid.OpenIdServiceImpl.class ) ; }

Target:
protected void configure ( ) { final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < java.lang.String , java.util.List > > type = new com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < java.lang.String , java.util.List > > ( ) { } ; core ( type , "openid" ) . timeToIdle ( 5 , java.util.concurrent.TimeUnit.MINUTES ) . timeToLive ( 5 , java.util.concurrent.TimeUnit.MINUTES ) ; }
Source:
private static java.util.Map < java.lang.String , com.google.gerrit.extensions.common.RevisionInfo > toRevisionInfoMap ( com.google.gerrit.acceptance.RestResponse r ) throws java.io.IOException { java.util.Map < java.lang.String , com.google.gerrit.extensions.common.RevisionInfo > result = newGson ( ) . fromJson ( r.getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.Map < java.lang.String , com.google.gerrit.extensions.common.RevisionInfo > > ( ) { } . getType ( ) ) ; return result ; }

Target:
private com.google.gerrit.extensions.common.EditInfo toEditInfo ( boolean files ) throws java.io.IOException { com.google.gerrit.acceptance.RestResponse r = session.get ( ( files ? urlGetFiles ( ) : urlEdit ( ) ) ) ; org.junit.Assert.assertEquals ( org.apache.http.HttpStatus.SC_OK , r.getStatusCode ( ) ) ; return newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.EditInfo.class ) ; }
Source:
private static java.util.List < java.lang.reflect.Method > getConfigs ( java.lang.Class < ? > clazz ) { java.util.List < java.lang.reflect.Method > result = com.google.common.collect.Lists.newArrayListWithExpectedSize ( 3 ) ; for ( java.lang.reflect.Method m : clazz.getMethods ( ) ) { com.google.gerrit.testutil.ConfigSuite.Config ann = m.getAnnotation ( com.google.gerrit.testutil.ConfigSuite.Config.class ) ; if ( ann != null ) { com.google.common.base.Preconditions.checkArgument ( ( ! ( m.getName ( ) . equals ( com.google.gerrit.testutil.ConfigSuite.DEFAULT ) ) ) , "%s cannot be named %s" , ann , com.google.gerrit.testutil.ConfigSuite.DEFAULT ) ; result.add ( m ) ; } } return result ; }

Target:
private static java.util.List < java.lang.reflect.Method > getConfigs ( java.lang.Class < ? > clazz ) { java.util.List < java.lang.reflect.Method > result = com.google.common.collect.Lists.newArrayListWithExpectedSize ( 3 ) ; for ( java.lang.reflect.Method m : clazz.getMethods ( ) ) { com.google.gerrit.testing.ConfigSuite.Config ann = m.getAnnotation ( com.google.gerrit.testing.ConfigSuite.Config.class ) ; if ( ann != null ) { com.google.common.base.Preconditions.checkArgument ( ( ! ( m.getName ( ) . equals ( com.google.gerrit.testing.ConfigSuite.DEFAULT ) ) ) , "%s cannot be named %s" , ann , com.google.gerrit.testing.ConfigSuite.DEFAULT ) ; result.add ( m ) ; } } return result ; }
Source:
public com.googlesource.gerrit.plugins.imagare.GetConfig.ConfigInfo apply ( com.google.gerrit.server.config.ConfigResource resource ) { com.googlesource.gerrit.plugins.imagare.GetConfig.ConfigInfo info = new com.googlesource.gerrit.plugins.imagare.GetConfig.ConfigInfo ( ) ; info.defaultProject = com.google.common.base.Objects.firstNonNull ( cfg.getString ( "defaultProject" ) , "All-Projects" ) ; info.linkDecoration = cfg.getEnum ( "linkDecoration" , LinkDecoration.NONE ) ; if ( LinkDecoration.NONE.equals ( info.linkDecoration ) ) { info.linkDecoration = null ; } info.stage = cfg.getBoolean ( "stage" , false ) ; if ( ! ( info.stage ) ) { info.stage = null ; } return info ; }

Target:
public com.googlesource.gerrit.plugins.imagare.GetConfig.ConfigInfo apply ( com.google.gerrit.server.config.ConfigResource resource ) { com.googlesource.gerrit.plugins.imagare.GetConfig.ConfigInfo info = new com.googlesource.gerrit.plugins.imagare.GetConfig.ConfigInfo ( ) ; info.defaultProject = com.google.common.base.MoreObjects.firstNonNull ( cfg.getString ( "defaultProject" ) , "All-Projects" ) ; info.linkDecoration = cfg.getEnum ( "linkDecoration" , LinkDecoration.NONE ) ; if ( LinkDecoration.NONE.equals ( info.linkDecoration ) ) { info.linkDecoration = null ; } info.stage = cfg.getBoolean ( "stage" , false ) ; if ( ! ( info.stage ) ) { info.stage = null ; } return info ; }
Source:
public java.nio.file.FileVisitResult preVisitDirectory ( java.nio.file.Path dir , java.nio.file.attribute.BasicFileAttributes attrs ) throws java.io.IOException { java.lang.String fName = dir.getFileName ( ) . toString ( ) ; if ( fName.matches ( ".*\\.\\d{13}.deleted" ) ) { com.googlesource.gerrit.plugins.deleteproject.fs.DeleteTrashFolders.log.warn ( "Will delete this folder: {}" , dir ) ; recursiveDelete ( dir ) ; return java.nio.file.FileVisitResult.SKIP_SUBTREE ; } else if ( org.eclipse.jgit.lib.RepositoryCache.FileKey.isGitRepository ( dir.toFile ( ) , FS.DETECTED ) ) { return java.nio.file.FileVisitResult.SKIP_SUBTREE ; } return super . preVisitDirectory ( dir , attrs ) ; }

Target:
public java.nio.file.FileVisitResult preVisitDirectory ( java.nio.file.Path dir , java.nio.file.attribute.BasicFileAttributes attrs ) throws java.io.IOException { java.lang.String fName = dir.getFileName ( ) . toString ( ) ; if ( com.googlesource.gerrit.plugins.deleteproject.fs.DeleteTrashFolders.isTrashFolderName ( fName ) ) { com.googlesource.gerrit.plugins.deleteproject.fs.DeleteTrashFolders.log.warn ( "Will delete this folder: {}" , dir ) ; recursiveDelete ( dir ) ; return java.nio.file.FileVisitResult.SKIP_SUBTREE ; } else if ( org.eclipse.jgit.lib.RepositoryCache.FileKey.isGitRepository ( dir.toFile ( ) , FS.DETECTED ) ) { return java.nio.file.FileVisitResult.SKIP_SUBTREE ; } return super . preVisitDirectory ( dir , attrs ) ; }
Source:
private void updateRemoteExternalId ( com.google.gerrit.server.account.AuthResult arsp , java.lang.String remoteAuthToken ) throws com.google.gerrit.server.account.AccountException , com.google.gwtorm.server.OrmException , java.io.IOException { com.google.gerrit.reviewdb.client.AccountExternalId remoteAuthExtId = new com.google.gerrit.reviewdb.client.AccountExternalId ( arsp.getAccountId ( ) , new com.google.gerrit.reviewdb.client.AccountExternalId.Key ( com.google.gerrit.reviewdb.client.AccountExternalId.SCHEME_EXTERNAL , remoteAuthToken ) ) ; accountManager.updateLink ( arsp.getAccountId ( ) , new com.google.gerrit.server.account.AuthRequest ( remoteAuthExtId.getExternalId ( ) ) ) ; }

Target:
private void updateRemoteExternalId ( com.google.gerrit.server.account.AuthResult arsp , java.lang.String remoteAuthToken ) throws com.google.gerrit.server.account.AccountException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { accountManager.updateLink ( arsp.getAccountId ( ) , new com.google.gerrit.server.account.AuthRequest ( ExternalId.Key.create ( com.google.gerrit.server.account.ExternalId.SCHEME_EXTERNAL , remoteAuthToken ) ) ) ; }
Source:
public java.lang.Iterable < com.google.gerrit.server.WebLinks.Link > getPatchSetLinks ( java.lang.String project , java.lang.String commit ) { java.util.List < com.google.gerrit.server.WebLinks.Link > links = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.extensions.webui.PatchSetWebLink webLink : patchSetLinks ) { links.add ( new com.google.gerrit.server.WebLinks.Link ( webLink.getLinkName ( ) , webLink.getPatchSetUrl ( project , commit ) ) ) ; } return links ; }

Target:
public java.lang.Iterable < com.google.gerrit.extensions.common.WebLinkInfo > getPatchSetLinks ( java.lang.String project , java.lang.String commit ) { java.util.List < com.google.gerrit.extensions.common.WebLinkInfo > links = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.extensions.webui.PatchSetWebLink webLink : patchSetLinks ) { links.add ( new com.google.gerrit.extensions.common.WebLinkInfo ( webLink.getLinkName ( ) , webLink.getImageUrl ( ) , webLink.getPatchSetUrl ( project , commit ) ) ) ; } return links ; }
Source:
public com.google.gwtjsonrpc.common.VoidResult run ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { if ( ! ( diffPref.getAccountId ( ) . equals ( getAccountId ( ) ) ) ) { throw new java.lang.IllegalArgumentException ( ( ( ( ( "diffPref.getAccountId() " + ( diffPref.getAccountId ( ) ) ) + " doesn't match" ) + " the accountId of the signed in user " ) + ( getAccountId ( ) ) ) ) ; } db.accountDiffPreferences ( ) . upsert ( java.util.Collections.singleton ( diffPref ) ) ; return com.google.gwtjsonrpc.common.VoidResult.INSTANCE ; }

Target:
public com.google.gwtjsonrpc.common.VoidResult run ( final com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gerrit.httpd.rpc.account.Failure , com.google.gwtorm.server.OrmException { final com.google.gerrit.reviewdb.client.Account a = db.accounts ( ) . get ( getAccountId ( ) ) ; if ( a == null ) { throw new com.google.gerrit.httpd.rpc.account.Failure ( new com.google.gerrit.common.errors.NoSuchEntityException ( ) ) ; } a.setGeneralPreferences ( pref ) ; db.accounts ( ) . update ( java.util.Collections.singleton ( a ) ) ; accountCache.evict ( a.getId ( ) ) ; return com.google.gwtjsonrpc.common.VoidResult.INSTANCE ; }
Source:
public void start ( ) { if ( ! ( com.googlesource.gerrit.plugins.deleteproject.DeleteLog.started ) ) { org.apache.log4j.Logger deleteLogger = org.apache.log4j.LogManager.getLogger ( com.googlesource.gerrit.plugins.deleteproject.DeleteLog.DELETE_LOG_NAME ) ; deleteLogger.removeAllAppenders ( ) ; deleteLogger.addAppender ( systemLog.createAsyncAppender ( deleteLogger.getName ( ) , new com.googlesource.gerrit.plugins.deleteproject.DeleteLogLayout ( ) ) ) ; deleteLogger.setAdditivity ( false ) ; com.googlesource.gerrit.plugins.deleteproject.DeleteLog.started = true ; } }

Target:
public void start ( ) { if ( ! ( started ) ) { org.apache.log4j.Logger deleteLogger = org.apache.log4j.LogManager.getLogger ( com.googlesource.gerrit.plugins.deleteproject.DeleteLog.DELETE_LOG_NAME ) ; deleteLogger.removeAllAppenders ( ) ; deleteLogger.addAppender ( systemLog.createAsyncAppender ( deleteLogger.getName ( ) , new com.googlesource.gerrit.plugins.deleteproject.DeleteLogLayout ( ) ) ) ; deleteLogger.setAdditivity ( false ) ; started = true ; } }
Source:
public int hashCode ( ) { refreshObjectIds ( ) ; int h = 0 ; if ( ( oldId ) != null ) { h = ( h * 31 ) + ( oldId.hashCode ( ) ) ; } h = ( h * 31 ) + ( newId.hashCode ( ) ) ; h = ( h * 31 ) + ( getWhitespace ( ) . name ( ) . hashCode ( ) ) ; return h ; }

Target:
public int hashCode ( ) { int h = 0 ; if ( ( oldIdName ) != null ) { h = ( h * 31 ) + ( getOldId ( ) . hashCode ( ) ) ; } h = ( h * 31 ) + ( getNewId ( ) . hashCode ( ) ) ; h = ( h * 31 ) + ( whitespaceCode ) ; return h ; }
Source:
private com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.common.data.ChangeDetail > createCommentedCallback ( final com.google.gwt.user.client.ui.Button b , final boolean redirect ) { return new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.common.data.ChangeDetail > ( ) { public void onSuccess ( com.google.gerrit.common.data.ChangeDetail result ) { if ( redirect ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( result.getChange ( ) . getId ( ) ) ) ; } else { changeScreen.update ( result ) ; } } public void onFailure ( java.lang.Throwable caught ) { b.setEnabled ( true ) ; } } ; }

Target:
private void openWindow ( java.lang.String token ) { java.lang.String url = ( ( Window.Location.getPath ( ) ) + "#" ) + token ; com.google.gwt.user.client.Window.open ( url , "_blank" , null ) ; }
Source:
public void createdOnIsPopulatedForGroupsCreatedBeforeAudit ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.AccountGroup.Id groupId = createGroup ( "Ancient group for schema migration" ) ; setCreatedOnToVeryOldTimestamp ( groupId ) ; removeAuditEntriesFor ( groupId ) ; schema151.migrateData ( db , new com.google.gerrit.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 ( ) ) ; }

Target:
public void createdOnIsPopulatedForGroupsCreatedAfterAudit ( ) throws java.lang.Exception { java.sql.Timestamp testStartTime = com.google.gerrit.common.TimeUtil.nowTs ( ) ; com.google.gerrit.reviewdb.client.AccountGroup.Id groupId = createGroup ( "Group for schema migration" ) ; setCreatedOnToVeryOldTimestamp ( groupId ) ; schema151.migrateData ( db , new com.google.gerrit.testing.TestUpdateUI ( ) ) ; java.sql.Timestamp createdOn = getCreatedOn ( groupId ) ; com.google.common.truth.Truth.assertThat ( createdOn ) . isAtLeast ( testStartTime ) ; }
Source:
public void run ( ) { if ( ( cm.hasActiveLine ( ) ) && ( ( toLeft && ( cm == ( cmB ) ) ) || ( ( ! toLeft ) && ( cm == ( cmA ) ) ) ) ) { net.codemirror.lib.CodeMirror other = otherCm ( cm ) ; other.setCursor ( net.codemirror.lib.LineCharacter.create ( mapper.lineOnOther ( getSideFromCm ( cm ) , cm.getLineNumber ( cm.getActiveLine ( ) ) ) . getLine ( ) ) ) ; other.focus ( ) ; } }

Target:
public void run ( ) { if ( cmSrc.hasActiveLine ( ) ) { cmDst.setCursor ( net.codemirror.lib.LineCharacter.create ( mapper.lineOnOther ( sideSrc , cmSrc.getLineNumber ( cmSrc.getActiveLine ( ) ) ) . getLine ( ) ) ) ; } cmDst.focus ( ) ; }
Source:
private com.google.gerrit.common.data.PermissionRange label ( java.lang.String permission ) { if ( ( labels ) == null ) { labels = com.google.gwt.thirdparty.guava.common.collect.Maps.newHashMapWithExpectedSize ( 4 ) ; } com.google.gerrit.common.data.PermissionRange r = labels.get ( permission ) ; if ( r == null ) { r = getRange ( permission ) ; labels.put ( permission , r ) ; } return r ; }

Target:
private com.google.gerrit.common.data.PermissionRange label ( java.lang.String permission ) { if ( ( labels ) == null ) { labels = com.google.common.collect.Maps.newHashMapWithExpectedSize ( 4 ) ; } com.google.gerrit.common.data.PermissionRange r = labels.get ( permission ) ; if ( r == null ) { r = getRange ( permission ) ; labels.put ( permission , r ) ; } return r ; }
Source:
public boolean isOwner ( ) { if ( getCurrentUser ( ) . isIdentifiedUser ( ) ) { final com.google.gerrit.server.IdentifiedUser i = ( ( com.google.gerrit.server.IdentifiedUser ) ( getCurrentUser ( ) ) ) ; return i.getAccountId ( ) . equals ( getChange ( ) . getOwner ( ) ) ; } return false ; }

Target:
public boolean isOwner ( ) { if ( getUser ( ) . isIdentifiedUser ( ) ) { final com.google.gerrit.server.IdentifiedUser i = ( ( com.google.gerrit.server.IdentifiedUser ) ( getUser ( ) ) ) ; return i.getAccountId ( ) . equals ( getChange ( ) . getOwner ( ) ) ; } return false ; }
Source:
private java.util.Set < com.google.gerrit.reviewdb.RefRight > resolveOwnerGroups ( final com.google.gerrit.reviewdb.RefRight refRight ) { final java.util.Set < com.google.gerrit.reviewdb.RefRight > resolvedRefRights = new java.util.HashSet < com.google.gerrit.reviewdb.RefRight > ( ) ; if ( AccountGroup.PROJECT_OWNERS.equals ( refRight.getAccountGroupUUID ( ) ) ) { for ( final com.google.gerrit.reviewdb.AccountGroup.UUID ownerGroup : getProjectState ( ) . getOwners ( ) ) { if ( ! ( AccountGroup.PROJECT_OWNERS.equals ( ownerGroup ) ) ) { resolvedRefRights.add ( new com.google.gerrit.reviewdb.RefRight ( refRight , ownerGroup ) ) ; } } } else { resolvedRefRights.add ( refRight ) ; } return resolvedRefRights ; }

Target:
boolean canPerform ( java.lang.String permissionName ) { return ! ( access ( permissionName ) . isEmpty ( ) ) ; }
Source:
public void submitWithFastForward ( ) throws com.jcraft.jsch.JSchException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { org.eclipse.jgit.api.Git git = createProject ( ) ; org.eclipse.jgit.revwalk.RevCommit oldHead = getRemoteHead ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result change = createChange ( git ) ; submit ( change.getChangeId ( ) ) ; org.eclipse.jgit.revwalk.RevCommit head = getRemoteHead ( ) ; org.junit.Assert.assertEquals ( change.getCommitId ( ) , head.getId ( ) ) ; org.junit.Assert.assertEquals ( oldHead , head.getParent ( 0 ) ) ; }

Target:
public void submitWithFastForward ( ) throws java.lang.Exception { org.eclipse.jgit.api.Git git = createProject ( ) ; org.eclipse.jgit.revwalk.RevCommit oldHead = getRemoteHead ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result change = createChange ( git ) ; submit ( change.getChangeId ( ) ) ; org.eclipse.jgit.revwalk.RevCommit head = getRemoteHead ( ) ; org.junit.Assert.assertEquals ( change.getCommitId ( ) , head.getId ( ) ) ; org.junit.Assert.assertEquals ( oldHead , head.getParent ( 0 ) ) ; assertSubmitter ( change.getChangeId ( ) , 1 ) ; }
Source:
public void update ( final java.lang.Iterable < T > instances ) throws com.google.gwtorm.server.OrmException { try { if ( schema.getDialect ( ) . canDetermineTotalBatchUpdateCount ( ) ) { updateAsBatch ( instances ) ; } else { updateIndividually ( instances ) ; } } catch ( java.sql.SQLException e ) { throw convertError ( "update" , e ) ; } }

Target:
public void update ( final java.lang.Iterable < T > instances ) throws com.google.gwtorm.server.OrmException { try { if ( schema.getDialect ( ) . canDetermineTotalBatchUpdateCount ( ) ) { updateAsBatch ( instances ) ; } else { updateIndividually ( instances ) ; } } catch ( java.sql.SQLException e ) { throwOrDefer ( convertError ( "update" , e ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throwOrDefer ( e ) ; } }
Source:
private void send ( final java.util.List < org.eclipse.jgit.transport.RemoteRefUpdate > cmds , final org.eclipse.jgit.transport.RefSpec spec ) throws java.io.IOException { final java.lang.String src = spec.getSource ( ) ; final java.lang.String dst = spec.getDestination ( ) ; final boolean force = spec.isForceUpdate ( ) ; cmds.add ( new org.eclipse.jgit.transport.RemoteRefUpdate ( db , src , dst , force , null , null ) ) ; }

Target:
private void send ( final java.util.List < org.eclipse.jgit.transport.RemoteRefUpdate > cmds , final org.eclipse.jgit.transport.RefSpec spec , final org.eclipse.jgit.lib.Ref src ) throws java.io.IOException { final java.lang.String dst = spec.getDestination ( ) ; final boolean force = spec.isForceUpdate ( ) ; cmds.add ( new org.eclipse.jgit.transport.RemoteRefUpdate ( db , src , dst , force , null , null ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { sessionOwner = new com.google.gerrit.acceptance.RestSession ( server , user ) ; com.google.gerrit.acceptance.SshSession sshSession = new com.google.gerrit.acceptance.SshSession ( server , user ) ; com.google.gerrit.acceptance.GitUtil.initSsh ( user ) ; sshSession.open ( ) ; setRepo ( com.google.gerrit.acceptance.GitUtil.cloneProject ( project , sshSession ) ) ; sshSession.close ( ) ; user2 = accounts.user2 ( ) ; sessionDev = new com.google.gerrit.acceptance.RestSession ( server , user2 ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { sessionOwner = new com.google.gerrit.acceptance.RestSession ( server , user ) ; com.google.gerrit.acceptance.SshSession sshSession = new com.google.gerrit.acceptance.SshSession ( server , user ) ; com.google.gerrit.acceptance.GitUtil.initSsh ( user ) ; sshSession.open ( ) ; testRepo = com.google.gerrit.acceptance.GitUtil.cloneProject ( project , sshSession ) ; sshSession.close ( ) ; user2 = accounts.user2 ( ) ; sessionDev = new com.google.gerrit.acceptance.RestSession ( server , user2 ) ; }
Source:
public void unblockForceEditTopicName ( ) { com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.Util.DEVS ) ; com.google.common.truth.Truth.assertThat ( u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) . named ( "u can edit topic name" ) . isTrue ( ) ; }

Target:
public void unblockInLocalForceEditTopicName_Fails ( ) { com.google.gerrit.server.project.testing.Util.block ( parent , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , 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.EDIT_TOPIC_NAME , com.google.gerrit.server.project.testing.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS ) ; com.google.common.truth.Truth.assertThat ( u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) . named ( "u can't edit topic name" ) . isFalse ( ) ; }
Source:
public void destroy ( ) { synchronized ( this ) { if ( ( cmd ) != null ) { final com.google.gerrit.sshd.SshScope.Context old = sshScope.set ( ctx ) ; try { cmd.destroy ( ) ; log ( BaseCommand.STATUS_CANCEL ) ; } finally { ctx = null ; cmd = null ; sshScope.set ( old ) ; } } } }

Target:
private void onDestroy ( ) { synchronized ( this ) { if ( ( cmd ) != null ) { final com.google.gerrit.sshd.SshScope.Context old = sshScope.set ( ctx ) ; try { cmd.destroy ( ) ; log ( BaseCommand.STATUS_CANCEL ) ; } finally { ctx = null ; cmd = null ; sshScope.set ( old ) ; } } } }
Source:
private static com.google.inject.Injector createTestInjector ( com.google.gerrit.pgm.Daemon daemon ) throws java.lang.Exception { com.google.inject.Injector sysInjector = com.google.gerrit.acceptance.GerritServer.get ( daemon , "sysInjector" ) ; com.google.inject.Module module = new com.google.gerrit.server.config.FactoryModule ( ) { @ java.lang.Override protected void configure ( ) { bind ( com.google.gerrit.acceptance.AccountCreator.class ) ; factory ( PushOneCommit.Factory.class ) ; install ( com.google.gerrit.acceptance.InProcessProtocol.module ( ) ) ; install ( new com.google.gerrit.server.ssh.NoSshModule ( ) ) ; install ( new com.google.gerrit.server.git.AsyncReceiveCommits.Module ( ) ) ; } } ; return sysInjector.createChildInjector ( module ) ; }

Target:
private static com.google.inject.Injector createTestInjector ( com.google.gerrit.pgm.Daemon daemon ) throws java.lang.Exception { com.google.inject.Injector sysInjector = com.google.gerrit.acceptance.GerritServer.get ( daemon , "sysInjector" ) ; com.google.inject.Module module = new com.google.gerrit.extensions.config.FactoryModule ( ) { @ java.lang.Override protected void configure ( ) { bind ( com.google.gerrit.acceptance.AccountCreator.class ) ; factory ( PushOneCommit.Factory.class ) ; install ( com.google.gerrit.acceptance.InProcessProtocol.module ( ) ) ; install ( new com.google.gerrit.server.ssh.NoSshModule ( ) ) ; install ( new com.google.gerrit.server.git.AsyncReceiveCommits.Module ( ) ) ; } } ; return sysInjector.createChildInjector ( module ) ; }
Source:
void onDiscard ( com.google.gwt.event.dom.client.ClickEvent e ) { if ( isNew ) { removeUI ( ) ; } else { com.google.gerrit.client.changes.CommentApi.deleteDraft ( getPatchSetId ( ) , getOriginal ( ) . id ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwt.core.client.JavaScriptObject > ( ) { @ java.lang.Override public void onSuccess ( com.google.gwt.core.client.JavaScriptObject result ) { removeUI ( ) ; } } ) ; } }

Target:
void onDiscard ( com.google.gwt.event.dom.client.ClickEvent e ) { if ( isNew ) { removeUI ( ) ; } else { setEdit ( false ) ; com.google.gerrit.client.changes.CommentApi.deleteDraft ( getPatchSetId ( ) , getOriginal ( ) . id ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwt.core.client.JavaScriptObject > ( ) { @ java.lang.Override public void onSuccess ( com.google.gwt.core.client.JavaScriptObject result ) { removeUI ( ) ; } } ) ; } }
Source:
private com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.common.data.ChangeDetail > createCommentedCallback ( final com.google.gwt.user.client.ui.Button b ) { return new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.common.data.ChangeDetail > ( ) { public void onSuccess ( com.google.gerrit.common.data.ChangeDetail result ) { changeScreen.update ( result ) ; } public void onFailure ( java.lang.Throwable caught ) { b.setEnabled ( true ) ; } } ; }

Target:
private com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.common.data.ChangeDetail > createCommentedCallback ( final com.google.gwt.user.client.ui.Button b , final boolean redirect ) { return new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.common.data.ChangeDetail > ( ) { public void onSuccess ( com.google.gerrit.common.data.ChangeDetail result ) { if ( redirect ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( result.getChange ( ) . getId ( ) ) ) ; } else { changeScreen.update ( result ) ; } } public void onFailure ( java.lang.Throwable caught ) { b.setEnabled ( true ) ; } } ; }
Source:
public static void restore ( int id , java.lang.String msg , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.ChangeInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.MessageInput input = com.google.gerrit.client.changes.ChangeApi.MessageInput.create ( ) ; input.message ( com.google.gerrit.client.changes.ChangeApi.emptyToNull ( msg ) ) ; com.google.gerrit.client.changes.ChangeApi.call ( id , "restore" ) . post ( input , cb ) ; }

Target:
public static void deleteAssignee ( @ com.google.gerrit.common.Nullable java.lang.String project , int id , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.AccountInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.change ( project , id ) . view ( "assignee" ) . delete ( cb ) ; }
Source:
public void changeIsIndexed ( ) throws java.lang.Exception { setupPostMocks ( com.ericsson.gerrit.plugins.syncindex.SyncIndexRestApiServletTest.CHANGE_EXISTS ) ; syncIndexRestApiServlet.doPost ( req , rsp ) ; org.mockito.Mockito.verify ( indexer , org.mockito.Mockito.times ( 1 ) ) . index ( db , change ) ; org.mockito.Mockito.verify ( rsp ) . setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; }

Target:
public void changeIsIndexed ( ) throws java.lang.Exception { setupPostMocks ( com.ericsson.gerrit.plugins.multimaster.SyncIndexRestApiServletTest.CHANGE_EXISTS ) ; syncIndexRestApiServlet.doPost ( req , rsp ) ; org.mockito.Mockito.verify ( indexer , org.mockito.Mockito.times ( 1 ) ) . index ( db , change ) ; org.mockito.Mockito.verify ( rsp ) . setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; }
Source:
protected void onOpenRow ( int row ) { if ( ( 1 <= row ) && ( row <= ( list.length ( ) ) ) ) { com.google.gerrit.client.Gerrit.display ( url ( list.get ( ( row - 1 ) ) ) ) ; } }

Target:
protected void onOpenRow ( int row ) { if ( ( 1 <= row ) && ( row <= ( list.length ( ) ) ) ) { com.google.gerrit.client.info.FileInfo info = list.get ( ( row - 1 ) ) ; if ( canOpen ( info.path ( ) ) ) { com.google.gerrit.client.Gerrit.display ( url ( info ) ) ; } } }