auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private java.util.List < com.google.gerrit.server.change.SuggestReviewers.SuggestedReviewerInfo > suggestReviewers ( java.lang.String changeId , java.lang.String query , int n ) throws java.io.IOException { return newGson ( ) . fromJson ( adminSession.get ( ( ( ( ( ( "/changes/" + changeId ) + "/suggest_reviewers?q=" ) + query ) + "&n=" ) + n ) ) . getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.server.change.SuggestReviewers.SuggestedReviewerInfo > > ( ) { } . getType ( ) ) ; }

Target:
private java.util.List < com.google.gerrit.server.change.SuggestReviewers.SuggestedReviewerInfo > suggestReviewers ( com.google.gerrit.acceptance.RestSession session , java.lang.String changeId , java.lang.String query , int n ) throws java.io.IOException { return newGson ( ) . fromJson ( session.get ( ( ( ( ( ( "/changes/" + changeId ) + "/suggest_reviewers?q=" ) + query ) + "&n=" ) + n ) ) . getReader ( ) , new com.google.gson.reflect.TypeToken < java.util.List < com.google.gerrit.server.change.SuggestReviewers.SuggestedReviewerInfo > > ( ) { } . getType ( ) ) ; }
Source:
private void updatePublishedComment ( com.google.gerrit.reviewdb.client.PatchLineComment c ) throws com.google.gwtorm.server.OrmException { verifyComment ( c ) ; if ( ( notes ) == null ) { notes = getChangeNotes ( ) . load ( ) ; } 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 ) ; } }

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:
protected void configure ( ) { factory ( AbandonChange.Factory.class ) ; factory ( RestoreChange.Factory.class ) ; factory ( RevertChange.Factory.class ) ; factory ( ChangeDetailFactory.Factory.class ) ; factory ( IncludedInDetailFactory.Factory.class ) ; factory ( PatchSetDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; factory ( SubmitAction.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( AbandonChange.Factory.class ) ; factory ( RestoreChange.Factory.class ) ; factory ( RevertChange.Factory.class ) ; factory ( ChangeDetailFactory.Factory.class ) ; factory ( IncludedInDetailFactory.Factory.class ) ; factory ( PatchSetDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; factory ( SubmitAction.Factory.class ) ; factory ( PublishAction.Factory.class ) ; }
Source:
public void newPatchSetByOtherOnReviewableChangeOwnerSelfCcInReviewDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master" , other , EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . notTo ( sc.reviewerByEmail , sc.ccerByEmail ) . to ( sc.owner , sc.reviewer , sc.ccer , other ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }

Target:
public void newPatchSetByOtherOnReviewableChangeOwnerSelfCcInReviewDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; pushTo ( sc , "refs/for/master" , other , EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . to ( sc.owner , sc.reviewer , sc.ccer , other ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) . noOneElse ( ) ; }
Source:
private java.lang.String amendChange ( org.eclipse.jgit.api.Git git , org.eclipse.jgit.lib.PersonIdent ident , java.lang.String changeId ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , ident , PushOneCommit.SUBJECT , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME2 , new java.lang.String ( com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_NEW2 ) , changeId ) ; return push.to ( git , "refs/for/master" ) . getChangeId ( ) ; }

Target:
private java.lang.String amendChange ( org.eclipse.jgit.api.Git git , org.eclipse.jgit.lib.PersonIdent ident , java.lang.String changeId ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , ident , PushOneCommit.SUBJECT , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME2 , new java.lang.String ( com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_NEW2 , java.nio.charset.StandardCharsets.UTF_8 ) , changeId ) ; return push.to ( git , "refs/for/master" ) . getChangeId ( ) ; }
Source:
private com.google.gerrit.lucene.LuceneChangeIndex.QuerySource intQuery ( com.google.gerrit.server.index.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > p ) throws com.google.gerrit.server.query.QueryParseException { int value ; try { value = java.lang.Integer.valueOf ( p.getValue ( ) ) ; } catch ( java.lang.IllegalArgumentException e ) { throw new com.google.gerrit.server.query.QueryParseException ( ( "not an integer: " + ( p.getValue ( ) ) ) ) ; } return new com.google.gerrit.lucene.LuceneChangeIndex.QuerySource ( new org.apache.lucene.search.TermQuery ( intTerm ( p.getOperator ( ) , value ) ) ) ; }

Target:
private org.apache.lucene.search.Query intQuery ( com.google.gerrit.server.index.IndexPredicate < com.google.gerrit.server.query.change.ChangeData > p ) throws com.google.gerrit.server.query.QueryParseException { int value ; try { value = java.lang.Integer.valueOf ( p.getValue ( ) ) ; } catch ( java.lang.IllegalArgumentException e ) { throw new com.google.gerrit.server.query.QueryParseException ( ( "not an integer: " + ( p.getValue ( ) ) ) ) ; } return new org.apache.lucene.search.TermQuery ( intTerm ( p.getOperator ( ) , value ) ) ; }
Source:
public void testGc ( ) throws java.lang.Exception { java.lang.String response = sshSession.exec ( ( ( ( ( "gerrit gc \"" + ( project.get ( ) ) ) + "\" \"" ) + ( project2.get ( ) ) ) + "\"" ) ) ; org.junit.Assert.assertFalse ( sshSession.getError ( ) , sshSession.hasError ( ) ) ; assertNoError ( response ) ; gcAssert.assertHasPackFile ( project , project2 ) ; gcAssert.assertHasNoPackFile ( allProjects , project3 ) ; }

Target:
public void testGc ( ) throws java.lang.Exception { java.lang.String response = sshSession.exec ( ( ( ( ( "gerrit gc \"" + ( project.get ( ) ) ) + "\" \"" ) + ( project2.get ( ) ) ) + "\"" ) ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( sshSession.getError ( ) ) . that ( sshSession.hasError ( ) ) . isFalse ( ) ; assertNoError ( response ) ; gcAssert.assertHasPackFile ( project , project2 ) ; gcAssert.assertHasNoPackFile ( allProjects , project3 ) ; }
Source:
public java.util.Set < com.google.gerrit.reviewdb.client.SubmoduleSubscription > parseAllSections ( ) { java.util.Set < com.google.gerrit.reviewdb.client.SubmoduleSubscription > parsedSubscriptions = com.google.common.collect.Sets.newHashSet ( ) ; for ( final java.lang.String id : bbc.getSubsections ( "submodule" ) ) { final com.google.gerrit.reviewdb.client.SubmoduleSubscription subscription = parse ( id ) ; if ( subscription != null ) { parsedSubscriptions.add ( subscription ) ; } } return parsedSubscriptions ; }

Target:
public java.util.Set < com.google.gerrit.reviewdb.client.SubmoduleSubscription > parseAllSections ( ) { java.util.Set < com.google.gerrit.reviewdb.client.SubmoduleSubscription > parsedSubscriptions = new java.util.HashSet < > ( ) ; for ( final java.lang.String id : bbc.getSubsections ( "submodule" ) ) { final com.google.gerrit.reviewdb.client.SubmoduleSubscription subscription = parse ( id ) ; if ( subscription != null ) { parsedSubscriptions.add ( subscription ) ; } } return parsedSubscriptions ; }
Source:
public void defaultGroupsCreated_ssh ( ) throws com.jcraft.jsch.JSchException , java.io.IOException { com.google.gerrit.acceptance.SshSession session = new com.google.gerrit.acceptance.SshSession ( server , admin ) ; java.lang.String result = session.exec ( "gerrit ls-groups" ) ; org.junit.Assert.assertTrue ( result.contains ( "Administrators" ) ) ; org.junit.Assert.assertTrue ( result.contains ( "Non-Interactive Users" ) ) ; session.close ( ) ; }

Target:
public void defaultGroupsCreated_ssh ( ) throws com.jcraft.jsch.JSchException , java.io.IOException { com.google.gerrit.acceptance.SshSession session = new com.google.gerrit.acceptance.SshSession ( server , admin ) ; java.lang.String result = session.exec ( "gerrit ls-groups" ) ; org.junit.Assert.assertFalse ( session.getError ( ) , session.hasError ( ) ) ; org.junit.Assert.assertTrue ( result.contains ( "Administrators" ) ) ; org.junit.Assert.assertTrue ( result.contains ( "Non-Interactive Users" ) ) ; session.close ( ) ; }
Source:
public void delete ( com.google.gerrit.server.edit.ChangeEdit edit ) throws java.io.IOException { com.google.gerrit.reviewdb.client.Change change = edit.getChange ( ) ; org.eclipse.jgit.lib.Repository repo = gitManager.openRepository ( change.getProject ( ) ) ; try { com.google.gerrit.server.edit.ChangeEditUtil.deleteRef ( repo , edit ) ; } finally { repo.close ( ) ; } }

Target:
public void delete ( com.google.gerrit.server.edit.ChangeEdit edit ) throws java.io.IOException { com.google.gerrit.reviewdb.client.Change change = edit.getChange ( ) ; org.eclipse.jgit.lib.Repository repo = gitManager.openRepository ( change.getProject ( ) ) ; try { com.google.gerrit.server.edit.ChangeEditUtil.deleteRef ( repo , edit ) ; } finally { repo.close ( ) ; } indexer.index ( db.get ( ) , change ) ; }
Source:
private static boolean acceptsPutInput ( java.lang.reflect.Type type ) { if ( type instanceof java.lang.Class ) { for ( java.lang.reflect.Field f : ( ( java.lang.Class ) ( type ) ) . getDeclaredFields ( ) ) { if ( ( f.getType ( ) ) == ( com.google.gerrit.extensions.restapi.PutInput.class ) ) { return true ; } } } return false ; }

Target:
private static boolean acceptsRawInput ( java.lang.reflect.Type type ) { if ( type instanceof java.lang.Class ) { for ( java.lang.reflect.Field f : ( ( java.lang.Class ) ( type ) ) . getDeclaredFields ( ) ) { if ( ( f.getType ( ) ) == ( com.google.gerrit.extensions.restapi.RawInput.class ) ) { return true ; } } } return false ; }
Source:
private boolean addSuggestion ( java.util.Map < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.extensions.common.AccountInfo > map , com.google.gerrit.reviewdb.client.Account.Id id ) { if ( ( ! ( map.containsKey ( id ) ) ) && ( accountControl.canSee ( id ) ) ) { map.put ( id , accountLoader.get ( id ) ) ; return true ; } return false ; }

Target:
private boolean addSuggestion ( java.util.Map < com.google.gerrit.reviewdb.client.Account.Id , com.google.gerrit.extensions.common.AccountInfo > map , com.google.gerrit.reviewdb.client.Account a ) { if ( ! ( a.isActive ( ) ) ) { return false ; } com.google.gerrit.reviewdb.client.Account.Id id = a.getId ( ) ; if ( ( ! ( map.containsKey ( id ) ) ) && ( accountControl.canSee ( id ) ) ) { map.put ( id , accountLoader.get ( id ) ) ; return true ; } return false ; }
Source:
private void onTextBoxBase ( final com.google.gwt.user.client.ui.TextBoxBase tb ) { com.google.gwt.user.client.DeferredCommand.add ( new com.google.gwt.user.client.Command ( ) { @ java.lang.Override public void execute ( ) { java.lang.String orig = strings.get ( tb ) ; if ( orig == null ) { orig = "" ; } if ( ! ( orig.equals ( tb.getText ( ) ) ) ) { widget.setEnabled ( true ) ; } } } ) ; }

Target:
private void onTextBoxBase ( final com.google.gwt.user.client.ui.TextBoxBase tb ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { java.lang.String orig = strings.get ( tb ) ; if ( orig == null ) { orig = "" ; } if ( ! ( orig.equals ( tb.getText ( ) ) ) ) { widget.setEnabled ( true ) ; } } } ) ; }
Source:
public void testMIXED_NoPreferredEmailUser ( ) { setFrom ( "MIXED" ) ; final java.lang.String name = "A U. Thor" ; final com.google.gerrit.reviewdb.client.Account.Id user = user ( name , null ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( user ) ; assertNotNull ( r ) ; assertEquals ( ( name + " (Code Review)" ) , r.name ) ; assertEquals ( ident.getEmailAddress ( ) , r.email ) ; org.easymock.EasyMock.verify ( accountCache ) ; }

Target:
public void testMIXED_NullUser ( ) { setFrom ( "MIXED" ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( null ) ; org.junit.Assert.assertNotNull ( r ) ; org.junit.Assert.assertEquals ( ident.getName ( ) , r.name ) ; org.junit.Assert.assertEquals ( ident.getEmailAddress ( ) , r.email ) ; org.easymock.EasyMock.verify ( accountCache ) ; }
Source:
public com.googlesource.gerrit.plugins.serviceuser.GetMessages.MessagesInfo apply ( com.google.gerrit.server.config.ConfigResource rsrc ) { com.googlesource.gerrit.plugins.serviceuser.GetMessages.MessagesInfo info = new com.googlesource.gerrit.plugins.serviceuser.GetMessages.MessagesInfo ( ) ; info.info = com.google.common.base.Strings.emptyToNull ( cfg.getString ( "infoMessage" ) ) ; info.onSuccess = com.google.common.base.Strings.emptyToNull ( cfg.getString ( "onSuccessMessage" ) ) ; return info ; }

Target:
public com.googlesource.gerrit.plugins.serviceuser.GetConfig.ConfigInfo apply ( com.google.gerrit.server.config.ConfigResource rsrc ) { com.googlesource.gerrit.plugins.serviceuser.GetConfig.ConfigInfo info = new com.googlesource.gerrit.plugins.serviceuser.GetConfig.ConfigInfo ( ) ; info.info = com.google.common.base.Strings.emptyToNull ( cfg.getString ( "infoMessage" ) ) ; info.onSuccess = com.google.common.base.Strings.emptyToNull ( cfg.getString ( "onSuccessMessage" ) ) ; info.allowEmail = cfg.getBoolean ( "allowEmail" , false ) ; if ( ! ( info.allowEmail ) ) { info.allowEmail = null ; } return info ; }
Source:
private void error ( final java.sql.SQLException err ) { println ( ( "ERROR: " + ( err.getMessage ( ) ) ) ) ; }

Target:
private void error ( final java.sql.SQLException err ) { switch ( outputFormat ) { case JSON : { final com.google.gson.JsonObject obj = new com.google.gson.JsonObject ( ) ; obj.addProperty ( "type" , "error" ) ; obj.addProperty ( "message" , err.getMessage ( ) ) ; println ( obj.toString ( ) ) ; break ; } case PRETTY : default : println ( ( "ERROR: " + ( err.getMessage ( ) ) ) ) ; break ; } }
Source:
public void getDetail ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = adminRestSession.get ( ( ( "/accounts/" + ( admin.username ) ) + "/detail/" ) ) ; com.google.gerrit.server.account.GetDetail.AccountDetailInfo info = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.server.account.GetDetail.AccountDetailInfo.class ) ; com.google.gerrit.acceptance.rest.account.AccountAssert.assertAccountInfo ( admin , info ) ; com.google.gerrit.reviewdb.client.Account account = accountCache.get ( admin.getId ( ) ) . getAccount ( ) ; com.google.common.truth.Truth.assertThat ( info.registeredOn ) . isEqualTo ( account.getRegisteredOn ( ) ) ; }

Target:
public void getDetail ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = adminRestSession.get ( ( ( "/accounts/" + ( admin.username ) ) + "/detail/" ) ) ; com.google.gerrit.server.restapi.account.GetDetail.AccountDetailInfo info = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.server.restapi.account.GetDetail.AccountDetailInfo.class ) ; com.google.gerrit.acceptance.rest.account.AccountAssert.assertAccountInfo ( admin , info ) ; com.google.gerrit.reviewdb.client.Account account = accountCache.get ( admin.getId ( ) ) . getAccount ( ) ; com.google.common.truth.Truth.assertThat ( info.registeredOn ) . isEqualTo ( account.getRegisteredOn ( ) ) ; }
Source:
protected void onUnload ( ) { if ( ( regNavigation ) != null ) { regNavigation.removeHandler ( ) ; regNavigation = null ; } super . onUnload ( ) ; }

Target:
protected void onUnload ( ) { if ( ( regNavigation ) != null ) { regNavigation.removeHandler ( ) ; regNavigation = null ; } if ( ( regAction ) != null ) { regAction.removeHandler ( ) ; regAction = null ; } super . onUnload ( ) ; }
Source:
private void setRulesPl ( java.lang.String rule ) throws java.lang.Exception { try ( com.google.gerrit.server.git.MetaDataUpdate md = metaDataUpdateFactory.create ( project ) ) { com.google.gerrit.acceptance.api.change.SubmitTypeRuleIT.RulesPl r = new com.google.gerrit.acceptance.api.change.SubmitTypeRuleIT.RulesPl ( ) ; r.load ( md ) ; r.rule = rule ; r.commit ( md ) ; } }

Target:
private void setRulesPl ( java.lang.String rule ) throws java.lang.Exception { try ( com.google.gerrit.server.git.meta.MetaDataUpdate md = metaDataUpdateFactory.create ( project ) ) { com.google.gerrit.acceptance.api.change.SubmitTypeRuleIT.RulesPl r = new com.google.gerrit.acceptance.api.change.SubmitTypeRuleIT.RulesPl ( ) ; r.load ( md ) ; r.rule = rule ; r.commit ( md ) ; } }
Source:
private static java.lang.String addInvalidKey ( java.util.List < java.util.Optional < com.google.gerrit.reviewdb.client.AccountSshKey > > keys , java.lang.String pub ) { com.google.gerrit.reviewdb.client.AccountSshKey.Id keyId = new com.google.gerrit.reviewdb.client.AccountSshKey.Id ( new com.google.gerrit.reviewdb.client.Account.Id ( 1 ) , ( ( keys.size ( ) ) + 1 ) ) ; com.google.gerrit.reviewdb.client.AccountSshKey key = new com.google.gerrit.reviewdb.client.AccountSshKey ( keyId , pub ) ; key.setInvalid ( ) ; keys.add ( java.util.Optional.of ( key ) ) ; return ( ( AuthorizedKeys.INVALID_KEY_COMMENT_PREFIX ) + ( key.getSshPublicKey ( ) ) ) + "\n" ; }

Target:
private static java.lang.String addKey ( java.util.List < java.util.Optional < com.google.gerrit.server.account.AccountSshKey > > keys , java.lang.String pub ) { com.google.gerrit.server.account.AccountSshKey.Id keyId = new com.google.gerrit.server.account.AccountSshKey.Id ( new com.google.gerrit.reviewdb.client.Account.Id ( 1 ) , ( ( keys.size ( ) ) + 1 ) ) ; com.google.gerrit.server.account.AccountSshKey key = new com.google.gerrit.server.account.AccountSshKey ( keyId , pub ) ; keys.add ( java.util.Optional.of ( key ) ) ; return ( key.getSshPublicKey ( ) ) + "\n" ; }
Source:
public void setup ( ) { user = org.easymock.EasyMock.createNiceMock ( com.google.gerrit.server.IdentifiedUser.class ) ; org.easymock.EasyMock.replay ( user ) ; backends = new com.google.gerrit.extensions.registration.DynamicSet ( ) ; backends.add ( new com.google.gerrit.server.group.SystemGroupBackend ( ) ) ; backend = new com.google.gerrit.server.account.UniversalGroupBackend ( backends ) ; }

Target:
public void setup ( ) { user = org.easymock.EasyMock.createNiceMock ( com.google.gerrit.server.IdentifiedUser.class ) ; org.easymock.EasyMock.replay ( user ) ; backends = new com.google.gerrit.extensions.registration.DynamicSet ( ) ; backends.add ( new com.google.gerrit.server.group.SystemGroupBackend ( new org.eclipse.jgit.lib.Config ( ) ) ) ; backend = new com.google.gerrit.server.account.UniversalGroupBackend ( backends ) ; }
Source:
javax.servlet.http.HttpServlet getPolyGerritUiIndexServlet ( @ com.google.gerrit.server.config.CanonicalWebUrl java.lang.String canonicalUrl , @ com.google.gerrit.server.config.GerritServerConfig org.eclipse.jgit.lib.Config cfg ) throws java.net.URISyntaxException { java.lang.String cdnPath = cfg.getString ( "gerrit" , null , "cdnPath" ) ; return new com.google.gerrit.httpd.raw.IndexServlet ( canonicalUrl , cdnPath ) ; }

Target:
javax.servlet.http.HttpServlet getPolyGerritUiIndexServlet ( @ com.google.gerrit.server.config.CanonicalWebUrl java.lang.String canonicalUrl , @ com.google.gerrit.server.config.GerritServerConfig org.eclipse.jgit.lib.Config cfg ) throws java.net.URISyntaxException { java.lang.String cdnPath = cfg.getString ( "gerrit" , null , "cdnPath" ) ; java.lang.String faviconPath = cfg.getString ( "gerrit" , null , "faviconPath" ) ; return new com.google.gerrit.httpd.raw.IndexServlet ( canonicalUrl , cdnPath , faviconPath ) ; }
Source:
public java.util.Set < java.lang.String > getEmailAddresses ( ) { if ( ( emailAddresses ) == null ) { emailAddresses = state ( ) . getEmailAddresses ( ) ; } return emailAddresses ; }

Target:
public java.util.Set < com.google.gerrit.reviewdb.AccountGroup.Id > getEffectiveGroups ( ) { if ( ( effectiveGroups ) == null ) { if ( authConfig.isIdentityTrustable ( getAccountState ( ) . getExternalIds ( ) ) ) { effectiveGroups = realm.groups ( getAccountState ( ) ) ; } else { effectiveGroups = authConfig.getRegisteredGroups ( ) ; } } return effectiveGroups ; }
Source:
private void createErrorBox ( ) { errorLine = new com.google.gwt.user.client.ui.FlowPanel ( ) ; errorLine.setVisible ( false ) ; errorMsg = new com.google.gwt.user.client.ui.InlineLabel ( OpenIdUtil.C.notSupported ( ) ) ; errorLine.setStyleName ( "gerrit-OpenID-errorline" ) ; errorLine.add ( errorMsg ) ; formBody.add ( errorLine ) ; }

Target:
private void onDiscoveryFailure ( ) { showError ( OpenIdUtil.C.notSupported ( ) ) ; enable ( true ) ; providerId.selectAll ( ) ; providerId.setFocus ( true ) ; }
Source:
private void limitThreads ( ) { org.eclipse.jgit.lib.Config cfg = dbInjector.getInstance ( com.google.inject.Key.get ( org.eclipse.jgit.lib.Config.class , com.google.gerrit.server.config.GerritServerConfig.class ) ) ; boolean usePool = cfg.getBoolean ( "database" , "connectionpool" , dbInjector.getInstance ( com.google.gerrit.server.schema.DataSourceType.class ) . usePool ( ) ) ; int poolLimit = cfg.getInt ( "database" , "poollimit" , DataSourceProvider.DEFAULT_POOL_LIMIT ) ; if ( usePool && ( ( threads ) > poolLimit ) ) { com.google.gerrit.pgm.Reindex.log.warn ( ( ( "Limiting reindexing to " + poolLimit ) + " threads due to database.poolLimit" ) ) ; threads = poolLimit ; } }

Target:
private com.google.inject.Injector createSysInjector ( ) { java.util.List < com.google.inject.Module > modules = com.google.common.collect.Lists.newArrayList ( ) ; com.google.inject.Module changeIndexModule ; switch ( com.google.gerrit.server.index.IndexModule.getIndexType ( dbInjector ) ) { case LUCENE : changeIndexModule = new com.google.gerrit.lucene.LuceneIndexModule ( version , threads , outputBase ) ; break ; default : throw new java.lang.IllegalStateException ( "unsupported index.type" ) ; } modules.add ( changeIndexModule ) ; modules.add ( com.google.gerrit.server.git.ScanningChangeCacheImpl.module ( ) ) ; modules.add ( dbInjector.getInstance ( com.google.gerrit.pgm.util.BatchProgramModule.class ) ) ; return dbInjector.createChildInjector ( modules ) ; }
Source:
private static java.util.List < org.eclipse.jgit.transport.RemoteConfig > allRemotes ( org.eclipse.jgit.storage.file.FileBasedConfig cfg ) throws org.eclipse.jgit.errors.ConfigInvalidException { java.util.Set < java.lang.String > names = cfg.getSubsections ( "remote" ) ; java.util.List < org.eclipse.jgit.transport.RemoteConfig > result = com.google.common.collect.Lists.newArrayListWithCapacity ( names.size ( ) ) ; for ( java.lang.String name : names ) { try { result.add ( new org.eclipse.jgit.transport.RemoteConfig ( cfg , name ) ) ; } catch ( java.net.URISyntaxException e ) { throw new org.eclipse.jgit.errors.ConfigInvalidException ( java.lang.String.format ( "remote %s has invalid URL in %s" , name , cfg.getFile ( ) ) ) ; } } return result ; }

Target:
void startup ( com.google.gerrit.server.git.WorkQueue workQueue ) ;
Source:
public void handle ( java.lang.String target , org.eclipse.jetty.server.Request baseRequest , javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException { org.eclipse.jetty.server.AbstractHttpConnection conn = org.eclipse.jetty.server.AbstractHttpConnection.getCurrentConnection ( ) ; conn.getRequest ( ) . setHandled ( true ) ; try { com.google.gerrit.pgm.http.jetty.HiddenErrorHandler.log ( req ) ; } finally { reply ( conn , res ) ; } }

Target:
public void handle ( java.lang.String target , org.eclipse.jetty.server.Request baseRequest , javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException { org.eclipse.jetty.server.HttpConnection conn = org.eclipse.jetty.server.HttpConnection.getCurrentConnection ( ) ; baseRequest.setHandled ( true ) ; try { com.google.gerrit.pgm.http.jetty.HiddenErrorHandler.log ( req ) ; } finally { reply ( conn , res ) ; } }
Source:
public void testBlockPushDrafts ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/for/refs/*" ) ; com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/drafts/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local ) ; org.junit.Assert.assertTrue ( "can upload refs/heads/master" , u.controlForRef ( "refs/heads/master" ) . canUpload ( ) ) ; org.junit.Assert.assertTrue ( "push is blocked to refs/drafts/master" , u.controlForRef ( "refs/drafts/refs/heads/master" ) . isBlocked ( com.google.gerrit.common.data.Permission.PUSH ) ) ; }

Target:
public void testBlockPushDrafts ( ) { com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/for/refs/*" ) ; com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/drafts/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local ) ; assertCanUpload ( "refs/heads/master" , u ) ; assertBlocked ( com.google.gerrit.common.data.Permission.PUSH , "refs/drafts/refs/heads/master" , u ) ; }
Source:
protected void configure ( ) { com.google.gerrit.extensions.registration.DynamicMap.mapOf ( binder ( ) , com.google.gerrit.server.change.ChangeResource.CHANGE_KIND ) ; com.google.gerrit.extensions.registration.DynamicMap.mapOf ( binder ( ) , com.google.gerrit.server.change.ReviewerResource.REVIEWER_KIND ) ; get ( com.google.gerrit.server.change.ChangeResource.CHANGE_KIND ) . to ( com.google.gerrit.server.change.GetChange.class ) ; post ( com.google.gerrit.server.change.ChangeResource.CHANGE_KIND , "abandon" ) . to ( com.google.gerrit.server.change.Abandon.class ) ; child ( com.google.gerrit.server.change.ChangeResource.CHANGE_KIND , "reviewers" ) . to ( com.google.gerrit.server.change.Reviewers.class ) ; get ( com.google.gerrit.server.change.ReviewerResource.REVIEWER_KIND ) . to ( com.google.gerrit.server.change.GetReviewer.class ) ; }

Target:
protected void configure ( ) { factory ( EmailReviewComments.Factory.class ) ; }
Source:
void updateRenderEntireFile ( ) { cmA.setOption ( "viewportMargin" , ( prefs.renderEntireFile ( ) ? java.lang.Double.POSITIVE_INFINITY : 10 ) ) ; cmB.setOption ( "viewportMargin" , ( prefs.renderEntireFile ( ) ? java.lang.Double.POSITIVE_INFINITY : 10 ) ) ; }

Target:
void updateRenderEntireFile ( ) { cmA.removeKeyMap ( com.google.gerrit.client.diff.SideBySide2.RENDER_ENTIRE_FILE_KEYMAP ) ; cmB.removeKeyMap ( com.google.gerrit.client.diff.SideBySide2.RENDER_ENTIRE_FILE_KEYMAP ) ; if ( prefs.renderEntireFile ( ) ) { cmA.addKeyMap ( com.google.gerrit.client.diff.SideBySide2.RENDER_ENTIRE_FILE_KEYMAP ) ; cmB.addKeyMap ( com.google.gerrit.client.diff.SideBySide2.RENDER_ENTIRE_FILE_KEYMAP ) ; } cmA.setOption ( "viewportMargin" , ( prefs.renderEntireFile ( ) ? java.lang.Double.POSITIVE_INFINITY : 10 ) ) ; cmB.setOption ( "viewportMargin" , ( prefs.renderEntireFile ( ) ? java.lang.Double.POSITIVE_INFINITY : 10 ) ) ; }
Source:
private com.google.gerrit.reviewdb.client.Change insertChange ( ) 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 ) ) ; return c ; }

Target:
private com.google.gerrit.reviewdb.client.PatchSet insertPatchSet ( com.google.gerrit.reviewdb.client.Change c ) throws java.lang.Exception { db.changes ( ) . upsert ( java.util.Collections.singleton ( c ) ) ; org.eclipse.jgit.revwalk.RevCommit commit = testRepo.branch ( c.currentPatchSetId ( ) . toRefName ( ) ) . commit ( ) . parent ( tip ) . create ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.testutil.TestChanges.newPatchSet ( c.currentPatchSetId ( ) , commit , adminId ) ; updatePatchSetRef ( ps ) ; db.patchSets ( ) . insert ( java.util.Collections.singleton ( ps ) ) ; return ps ; }
Source:
void removeDraft ( com.google.gerrit.client.diff.DraftBox box , com.google.gerrit.common.changes.Side side , int line ) { net.codemirror.lib.CodeMirror.LineHandle handle = getCmFromSide ( side ) . getLineHandle ( line ) ; lineActiveBoxMap.remove ( handle ) ; if ( lineLastPublishedBoxMap.containsKey ( handle ) ) { lineActiveBoxMap.put ( handle , lineLastPublishedBoxMap.get ( handle ) ) ; } }

Target:
void removeDraft ( com.google.gerrit.client.diff.DraftBox box , int line ) { net.codemirror.lib.CodeMirror.LineHandle handle = getCmFromSide ( box.getSide ( ) ) . getLineHandle ( line ) ; lineActiveBoxMap.remove ( handle ) ; if ( lineLastPublishedBoxMap.containsKey ( handle ) ) { lineActiveBoxMap.put ( handle , lineLastPublishedBoxMap.get ( handle ) ) ; } }
Source:
private void assertSubmitApproval ( com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.reviewdb.client.PatchSetApproval > approvals = db.patchSetApprovals ( ) . byPatchSet ( patchSetId ) . toList ( ) ; org.junit.Assert.assertEquals ( 1 , approvals.size ( ) ) ; com.google.gerrit.reviewdb.client.PatchSetApproval a = approvals.get ( 0 ) ; org.junit.Assert.assertEquals ( PatchSetApproval.LabelId.SUBMIT.get ( ) , a.getLabel ( ) ) ; org.junit.Assert.assertEquals ( 1 , a.getValue ( ) ) ; org.junit.Assert.assertEquals ( admin.id , a.getAccountId ( ) ) ; }

Target:
private void assertSubmitApproval ( com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSetApproval a = approvalsUtil.getSubmitter ( db , patchSetId ) ; org.junit.Assert.assertTrue ( a.isSubmit ( ) ) ; org.junit.Assert.assertEquals ( 1 , a.getValue ( ) ) ; org.junit.Assert.assertEquals ( admin.id , a.getAccountId ( ) ) ; }
Source:
protected void configure ( ) { cache ( com.google.gerrit.server.project.ProjectCacheImpl.CACHE_NAME , java.lang.String.class , com.google.gerrit.server.project.ProjectState.class ) . loader ( com.google.gerrit.server.project.ProjectCacheImpl.Loader.class ) ; cache ( com.google.gerrit.server.project.ProjectCacheImpl.CACHE_LIST , com.google.gerrit.server.project.ProjectCacheImpl.ListKey.class , new com.google.inject.TypeLiteral < java.util.SortedSet < com.google.gerrit.reviewdb.client.Project.NameKey > > ( ) { } ) . maximumWeight ( 1 ) . loader ( com.google.gerrit.server.project.ProjectCacheImpl.Lister.class ) ; bind ( com.google.gerrit.server.project.ProjectCacheImpl.class ) ; bind ( com.google.gerrit.server.project.ProjectCache.class ) . to ( com.google.gerrit.server.project.ProjectCacheImpl.class ) ; }

Target:
protected void configure ( ) { cache ( com.google.gerrit.server.project.ProjectCacheImpl.CACHE_NAME , java.lang.String.class , com.google.gerrit.server.project.ProjectState.class ) . loader ( com.google.gerrit.server.project.ProjectCacheImpl.Loader.class ) ; cache ( com.google.gerrit.server.project.ProjectCacheImpl.CACHE_LIST , com.google.gerrit.server.project.ProjectCacheImpl.ListKey.class , new com.google.inject.TypeLiteral < java.util.SortedSet < com.google.gerrit.reviewdb.client.Project.NameKey > > ( ) { } ) . maximumWeight ( 1 ) . loader ( com.google.gerrit.server.project.ProjectCacheImpl.Lister.class ) ; bind ( com.google.gerrit.server.project.ProjectCacheImpl.class ) ; bind ( com.google.gerrit.server.project.ProjectCache.class ) . to ( com.google.gerrit.server.project.ProjectCacheImpl.class ) ; bind ( com.google.gerrit.extensions.events.LifecycleListener.class ) . annotatedWith ( com.google.inject.internal.UniqueAnnotations.create ( ) ) . to ( com.google.gerrit.server.project.ProjectCacheWarmer.class ) ; }
Source:
public void deleteBranchesForbidden ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.DeleteBranchesInput input = new com.google.gerrit.extensions.api.projects.DeleteBranchesInput ( ) ; input.branches = com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ; setApiUser ( user ) ; try { project ( ) . deleteBranches ( input ) ; org.junit.Assert.fail ( "Expected ResourceConflictException" ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceConflictException e ) { com.google.common.truth.Truth.assertThat ( e ) . hasMessage ( errorMessageForBranches ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ) ; } setApiUser ( admin ) ; assertBranches ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ; }

Target:
public void deleteBranchesForbidden ( ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.DeleteBranchesInput input = new com.google.gerrit.extensions.api.projects.DeleteBranchesInput ( ) ; input.branches = com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ; setApiUser ( user ) ; try { project ( ) . deleteBranches ( input ) ; org.junit.Assert.fail ( "Expected ResourceConflictException" ) ; } catch ( com.google.gerrit.extensions.restapi.ResourceConflictException e ) { com.google.common.truth.Truth.assertThat ( e ) . hasMessageThat ( ) . isEqualTo ( errorMessageForBranches ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ) ; } setApiUser ( admin ) ; assertBranches ( com.google.gerrit.acceptance.rest.project.DeleteBranchesIT.BRANCHES ) ; }
Source:
protected java.io.PrintWriter startRenderText ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException { res.setContentType ( com.google.gitiles.FormatType.TEXT.getMimeType ( ) ) ; res.setCharacterEncoding ( "UTF-8" ) ; res.setHeader ( com.google.common.net.HttpHeaders.CONTENT_DISPOSITION , "attachment" ) ; setCacheHeaders ( req , res ) ; return res.getWriter ( ) ; }

Target:
protected java.io.PrintWriter startRenderText ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException { setApiHeaders ( req , res , com.google.gitiles.FormatType.TEXT ) ; return res.getWriter ( ) ; }
Source:
public static void createGroup ( java.lang.String groupName , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.groups.GroupInfo > cb ) { com.google.gerrit.client.groups.GroupApi.GroupInput in = com.google.gerrit.client.groups.GroupApi.GroupInput.create ( ) ; in.name ( groupName ) ; new com.google.gerrit.client.rpc.RestApi ( "/groups/" ) . data ( in ) . post ( cb ) ; }

Target:
public static void createGroup ( java.lang.String groupName , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.groups.GroupInfo > cb ) { com.google.gwt.core.client.JavaScriptObject in = com.google.gwt.core.client.JavaScriptObject.createObject ( ) ; java.lang.String n = com.google.gwt.http.client.URL.encodePathSegment ( groupName ) ; new com.google.gerrit.client.rpc.RestApi ( ( "/groups/" + n ) ) . ifNoneMatch ( ) . data ( in ) . put ( cb ) ; }
Source:
public com.google.gerrit.server.project.ChangeControl controlFor ( com.google.gerrit.reviewdb.client.Change.Id changeId , com.google.gerrit.server.CurrentUser user ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change change = db.get ( ) . changes ( ) . get ( changeId ) ; if ( change == null ) { throw new com.google.gerrit.server.project.NoSuchChangeException ( changeId ) ; } return controlFor ( change , user ) ; }

Target:
public com.google.gerrit.server.project.ChangeControl controlFor ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Change.Id changeId , com.google.gerrit.server.CurrentUser user ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException { return controlFor ( notesFactory.create ( db.get ( ) , project , changeId ) , user ) ; }
Source:
public static void rename ( int id , java.lang.String path , java.lang.String newPath , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > cb ) { com.google.gerrit.client.changes.ChangeEditApi.Input in = com.google.gerrit.client.changes.ChangeEditApi.Input.create ( ) ; in.old_path ( path ) ; in.new_path ( newPath ) ; com.google.gerrit.client.changes.ChangeApi.edit ( id ) . post ( in , cb ) ; }

Target:
public static void rename ( int id , java.lang.String path , java.lang.String newPath , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > cb ) { com.google.gerrit.client.changes.ChangeEditApi.Input in = com.google.gerrit.client.changes.ChangeEditApi.Input.create ( ) ; in.oldPath ( path ) ; in.newPath ( newPath ) ; com.google.gerrit.client.changes.ChangeApi.edit ( id ) . post ( in , cb ) ; }
Source:
public void remove ( com.google.gerrit.common.data.AccessSection section ) { if ( section != null ) { accessSections.remove ( section.getName ( ) ) ; } }

Target:
public void remove ( com.google.gerrit.common.data.AccessSection section ) { if ( section != null ) { com.google.gerrit.common.data.AccessSection a = accessSections.get ( section.getName ( ) ) ; if ( sectionsWithUnknownPermissions.contains ( a ) ) { accessSections.remove ( a ) ; } else { a.setPermissions ( new java.util.ArrayList < com.google.gerrit.common.data.Permission > ( ) ) ; } } }
Source:
public void run ( ) throws java.lang.Exception { parseCommandLine ( impl ) ; if ( ( ( impl.getUser ( ) ) != null ) && ( ! ( impl.getProjects ( ) . isEmpty ( ) ) ) ) { throw new com.google.gerrit.sshd.commands.UnloggedFailure ( 1 , "fatal: --user and --project options are not compatible." ) ; } impl.display ( out ) ; }

Target:
public void run ( ) throws java.lang.Exception { parseCommandLine ( impl ) ; if ( ( ( impl.getUser ( ) ) != null ) && ( ! ( impl.getProjects ( ) . isEmpty ( ) ) ) ) { throw new com.google.gerrit.sshd.commands.UnloggedFailure ( 1 , "fatal: --user and --project options are not compatible." ) ; } final java.io.PrintWriter stdout = toPrintWriter ( out ) ; try { impl.display ( stdout ) ; } finally { stdout.flush ( ) ; } }
Source:
public void suggestReviewersNoResult1 ( ) throws java.io.IOException , java.lang.Exception , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createChange ( admin ) ; java.util.List < com.google.gerrit.server.change.SuggestReviewers.SuggestedReviewerInfo > reviewers = suggestReviewers ( changeId , "u" , 6 ) ; org.junit.Assert.assertEquals ( reviewers.size ( ) , 0 ) ; }

Target:
public void suggestReviewersChange ( ) throws java.io.IOException , java.lang.Exception , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; java.util.List < com.google.gerrit.server.change.SuggestReviewers.SuggestedReviewerInfo > reviewers = suggestReviewers ( changeId , "u" , 6 ) ; org.junit.Assert.assertEquals ( reviewers.size ( ) , 6 ) ; reviewers = suggestReviewers ( changeId , "u" , 5 ) ; org.junit.Assert.assertEquals ( reviewers.size ( ) , 5 ) ; reviewers = suggestReviewers ( changeId , "users3" , 10 ) ; org.junit.Assert.assertEquals ( reviewers.size ( ) , 1 ) ; }
Source:
private static int getInt ( org.eclipse.jgit.lib.Config cfg , java.lang.String section , java.lang.String name , int defaultValue ) { try { return cfg.getInt ( section , name , defaultValue ) ; } catch ( java.lang.IllegalArgumentException e ) { com.ericsson.gerrit.plugins.highavailability.Configuration.log.error ( java.lang.String.format ( "invalid value for %s; using default value %d" , name , defaultValue ) ) ; com.ericsson.gerrit.plugins.highavailability.Configuration.log.debug ( ( "Failed to retrieve integer value: " + ( e.getMessage ( ) ) ) , e ) ; return defaultValue ; } }

Target:
private static int getInt ( org.eclipse.jgit.lib.Config cfg , java.lang.String section , java.lang.String name , int defaultValue ) { try { return cfg.getInt ( section , name , defaultValue ) ; } catch ( java.lang.IllegalArgumentException e ) { com.ericsson.gerrit.plugins.highavailability.Configuration.log.error ( "invalid value for {}; using default value {}" , name , defaultValue ) ; com.ericsson.gerrit.plugins.highavailability.Configuration.log.debug ( "Failed to retrieve integer value: {}" , e.getMessage ( ) , e ) ; return defaultValue ; } }
Source:
public void start ( final org.apache.sshd.server.Environment env ) throws java.io.IOException { startThread ( new com.google.gerrit.sshd.commands.CommandRunnable ( ) { @ java.lang.Override public void run ( ) throws java.lang.Exception { parseCommandLine ( ) ; try { performRenameGroupFactory.create ( ) . renameGroup ( groupName , newGroupName ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw die ( e ) ; } catch ( com.google.gerrit.common.errors.NameAlreadyUsedException e ) { throw die ( e ) ; } catch ( com.google.gerrit.common.errors.NoSuchGroupException e ) { throw die ( e ) ; } } } ) ; }

Target:
protected void run ( ) throws com.google.gerrit.sshd.commands.Failure { try { performRenameGroupFactory.create ( ) . renameGroup ( groupName , newGroupName ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw die ( e ) ; } catch ( com.google.gerrit.common.errors.NameAlreadyUsedException e ) { throw die ( e ) ; } catch ( com.google.gerrit.common.errors.NoSuchGroupException e ) { throw die ( e ) ; } }
Source:
private static org.eclipse.jgit.lib.RefUpdate createRefUpdate ( final org.eclipse.jgit.lib.Repository repo , final org.eclipse.jgit.lib.ObjectId newObjectId , final org.eclipse.jgit.lib.ObjectId expectedOldObjectId ) throws java.io.IOException { org.eclipse.jgit.lib.RefUpdate refUpdate = repo.updateRef ( com.google.gerrit.server.git.GitRepositoryManager.REF_REJECT_COMMITS ) ; refUpdate.setNewObjectId ( newObjectId ) ; if ( expectedOldObjectId == null ) { refUpdate.setExpectedOldObjectId ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) ) ; } else { refUpdate.setExpectedOldObjectId ( expectedOldObjectId ) ; } return refUpdate ; }

Target:
private org.eclipse.jgit.lib.PersonIdent createPersonIdent ( ) { java.util.Date now = new java.util.Date ( ) ; java.util.TimeZone tz = gerritIdent.getTimeZone ( ) ; return currentUser.get ( ) . newCommitterIdent ( now , tz ) ; }
Source:
private com.google.gwt.user.client.ui.Widget createShowFullFiles ( ) { final com.google.gwt.user.client.ui.CheckBox cb = new com.google.gwt.user.client.ui.CheckBox ( PatchUtil.C.showFullFiles ( ) ) ; cb.addClickHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent arg0 ) { if ( cb.getValue ( ) ) { scriptSettings.setContext ( com.google.gerrit.client.reviewdb.AccountGeneralPreferences.WHOLE_FILE_CONTEXT ) ; } else { initContextLines ( ) ; } refresh ( false ) ; } } ) ; return cb ; }

Target:
private com.google.gwt.user.client.ui.Widget createShowFullFiles ( ) { final com.google.gwt.user.client.ui.CheckBox cb = new com.google.gwt.user.client.ui.CheckBox ( PatchUtil.C.showFullFiles ( ) ) ; cb.addValueChangeHandler ( new com.google.gwt.event.logical.shared.ValueChangeHandler < java.lang.Boolean > ( ) { @ java.lang.Override public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > event ) { if ( event.getValue ( ) ) { scriptSettings.setContext ( com.google.gerrit.client.reviewdb.AccountGeneralPreferences.WHOLE_FILE_CONTEXT ) ; } else { initContextLines ( ) ; } refresh ( false ) ; } } ) ; return cb ; }
Source:
public void testDashList2 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.html ( "A\n\n- line 1\n- 2nd line\n\nB" ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; org.junit.Assert.assertNotSame ( o , n ) ; org.junit.Assert.assertEquals ( ( ( ( ( ( "<p>A</p>" + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.BEGIN_LIST ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "line 1" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "2nd line" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.END_LIST ) ) + "<p>B</p>" ) , n.asString ( ) ) ; }

Target:
public void testDashList2 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.html ( "A\n\n- line 1\n- 2nd line\n\nB" ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; com.google.common.truth.Truth.assertThat ( o ) . isNotSameAs ( n ) ; com.google.common.truth.Truth.assertThat ( n.asString ( ) ) . isEqualTo ( ( ( ( ( ( "<p>A</p>" + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.BEGIN_LIST ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "line 1" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "2nd line" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.END_LIST ) ) + "<p>B</p>" ) ) ; }
Source:
private void initApprovals ( final com.google.gerrit.common.data.PatchSetPublishDetail r , final com.google.gwt.user.client.ui.Panel body ) { com.google.gerrit.common.data.ApprovalTypes types = com.google.gerrit.client.Gerrit.getConfig ( ) . getApprovalTypes ( ) ; for ( com.google.gerrit.common.data.PermissionRange range : r.getLabels ( ) ) { com.google.gerrit.common.data.ApprovalType type = types.byLabel ( range.getLabel ( ) ) ; if ( type != null ) { initApprovalType ( r , body , type , range ) ; } else { } } }

Target:
private void initApprovals ( final com.google.gerrit.common.data.PatchSetPublishDetail r , final com.google.gwt.user.client.ui.Panel body ) { for ( java.lang.String labelName : change.labels ( ) ) { initLabel ( r , labelName , body ) ; } }
Source:
public void newPatchSetOnWipChangeSettingReadyInReviewDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%ready" , sc.owner ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . notTo ( sc.owner ) . to ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; assertThat ( sender ) . notSent ( ) ; }

Target:
public void newPatchSetByOtherOnReviewableChangeNotifyOwnerReviewersInReviewDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; pushTo ( sc , "refs/for/master%notify=OWNER_REVIEWERS" , other ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . to ( sc.reviewer , sc.ccer ) . noOneElse ( ) ; }