auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void rejectOnNonPublicChange ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.enabled ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = createDraftChange ( ) ; exception.expect ( com.google.gerrit.extensions.restapi.BadRequestException.class ) ; exception.expectMessage ( "change is not publicly visible" ) ; gApi.changes ( ) . id ( r.getChangeId ( ) ) . addReviewer ( "Foo Bar <foo.bar@gerritcodereview.com>" ) ; }

Target:
public void rejectOnNonPublicChange ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = createDraftChange ( ) ; exception.expect ( com.google.gerrit.extensions.restapi.BadRequestException.class ) ; exception.expectMessage ( "change is not publicly visible" ) ; gApi.changes ( ) . id ( r.getChangeId ( ) ) . addReviewer ( "Foo Bar <foo.bar@gerritcodereview.com>" ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.server.RequestCleanup.class ) . in ( com.google.inject.servlet.RequestScoped.class ) ; bind ( com.google.gerrit.client.reviewdb.ReviewDb.class ) . toProvider ( com.google.gerrit.server.config.RequestScopedReviewDbProvider.class ) ; bind ( IdentifiedUser.RequestFactory.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( ChangeControl.Factory.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( ProjectControl.Factory.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.server.RequestCleanup.class ) . in ( com.google.inject.servlet.RequestScoped.class ) ; bind ( com.google.gerrit.client.reviewdb.ReviewDb.class ) . toProvider ( com.google.gerrit.server.config.RequestScopedReviewDbProvider.class ) ; bind ( IdentifiedUser.RequestFactory.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( ChangeControl.Factory.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( GroupControl.Factory.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; bind ( ProjectControl.Factory.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; }
Source:
private com.google.gerrit.reviewdb.client.ChangeMessage message ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx , com.google.gerrit.reviewdb.client.PatchSet.Id psId , java.lang.String body ) { com.google.common.base.Preconditions.checkNotNull ( psId ) ; java.lang.String uuid ; try { uuid = com.google.gerrit.server.ChangeUtil.messageUUID ( ctx.getDb ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { return null ; } com.google.gerrit.reviewdb.client.ChangeMessage m = new com.google.gerrit.reviewdb.client.ChangeMessage ( new com.google.gerrit.reviewdb.client.ChangeMessage.Key ( psId.getParentKey ( ) , uuid ) , null , ctx.getWhen ( ) , psId ) ; m.setMessage ( body ) ; return m ; }

Target:
private com.google.gerrit.reviewdb.client.ChangeMessage message ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx , com.google.gerrit.reviewdb.client.PatchSet.Id psId , java.lang.String body ) { com.google.common.base.Preconditions.checkNotNull ( psId ) ; java.lang.String uuid ; try { uuid = com.google.gerrit.server.ChangeUtil.messageUUID ( ctx.getDb ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { return null ; } com.google.gerrit.reviewdb.client.ChangeMessage m = new com.google.gerrit.reviewdb.client.ChangeMessage ( new com.google.gerrit.reviewdb.client.ChangeMessage.Key ( psId.getParentKey ( ) , uuid ) , ctx.getUser ( ) . getAccountId ( ) , ctx.getWhen ( ) , psId ) ; m.setMessage ( body ) ; return m ; }
Source:
protected void configure ( ) { install ( new com.google.gerrit.server.index.IndexModule ( 1 ) ) ; bind ( com.google.gerrit.server.index.IndexConfig.class ) . toInstance ( com.google.gerrit.server.index.IndexConfig.createDefault ( ) ) ; bind ( com.google.gerrit.server.index.Index.class ) . toInstance ( new com.google.gerrit.server.index.change.DummyChangeIndex ( ) ) ; bind ( AccountIndex.Factory.class ) . toInstance ( new com.google.gerrit.server.index.DummyIndexModule.DummyAccountIndexFactory ( ) ) ; bind ( ChangeIndex.Factory.class ) . toInstance ( new com.google.gerrit.server.index.DummyIndexModule.DummyChangeIndexFactory ( ) ) ; }

Target:
protected void configure ( ) { install ( new com.google.gerrit.server.index.IndexModule ( 1 ) ) ; bind ( com.google.gerrit.server.index.IndexConfig.class ) . toInstance ( com.google.gerrit.server.index.IndexConfig.createDefault ( ) ) ; bind ( com.google.gerrit.server.index.Index.class ) . toInstance ( new com.google.gerrit.server.index.change.DummyChangeIndex ( ) ) ; bind ( AccountIndex.Factory.class ) . toInstance ( new com.google.gerrit.server.index.DummyIndexModule.DummyAccountIndexFactory ( ) ) ; bind ( ChangeIndex.Factory.class ) . toInstance ( new com.google.gerrit.server.index.DummyIndexModule.DummyChangeIndexFactory ( ) ) ; bind ( GroupIndex.Factory.class ) . toInstance ( new com.google.gerrit.server.index.DummyIndexModule.DummyGroupIndexFactory ( ) ) ; }
Source:
private boolean isEditModeEnabled ( com.google.gerrit.client.changes.ChangeInfo info , com.google.gerrit.client.changes.ChangeInfo.RevisionInfo rev ) { if ( rev.is_edit ( ) ) { return true ; } if ( ( edit ) == null ) { return revision.equals ( info.current_revision ( ) ) ; } return ( rev._number ( ) ) == ( com.google.gerrit.client.changes.ChangeInfo.RevisionInfo.findEditParent ( info.revisions ( ) . values ( ) ) ) ; }

Target:
private boolean isEditModeEnabled ( com.google.gerrit.client.info.ChangeInfo info , com.google.gerrit.client.info.ChangeInfo.RevisionInfo rev ) { if ( rev.isEdit ( ) ) { return true ; } if ( ( edit ) == null ) { return revision.equals ( info.currentRevision ( ) ) ; } return ( rev._number ( ) ) == ( com.google.gerrit.client.info.ChangeInfo.RevisionInfo.findEditParent ( info.revisions ( ) . values ( ) ) ) ; }
Source:
private com.google.gerrit.server.account.AccountState makeUser ( final java.lang.String name , final java.lang.String email ) { final com.google.gerrit.reviewdb.client.Account.Id userId = new com.google.gerrit.reviewdb.client.Account.Id ( 42 ) ; final com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( userId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; account.setFullName ( name ) ; account.setPreferredEmail ( email ) ; return new com.google.gerrit.server.account.AccountState ( account , java.util.Collections.< com.google.gerrit.reviewdb.client.AccountGroup.UUID > emptySet ( ) , java.util.Collections.< com.google.gerrit.reviewdb.client.AccountExternalId > emptySet ( ) , java.util.Collections.< com.google.gerrit.reviewdb.client.AccountProjectWatch > emptySet ( ) ) ; }

Target:
private com.google.gerrit.server.account.AccountState makeUser ( final java.lang.String name , final java.lang.String email ) { final com.google.gerrit.reviewdb.client.Account.Id userId = new com.google.gerrit.reviewdb.client.Account.Id ( 42 ) ; final com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( userId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; account.setFullName ( name ) ; account.setPreferredEmail ( email ) ; return new com.google.gerrit.server.account.AccountState ( account , java.util.Collections.< com.google.gerrit.reviewdb.client.AccountGroup.UUID > emptySet ( ) , java.util.Collections.< com.google.gerrit.reviewdb.client.AccountExternalId > emptySet ( ) , new java.util.HashMap < com.google.gerrit.server.account.WatchConfig.ProjectWatchKey , java.util.Set < com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType > > ( ) ) ; }
Source:
public org.eclipse.jgit.transport.UploadPack create ( javax.servlet.http.HttpServletRequest req , org.eclipse.jgit.lib.Repository repo ) { org.eclipse.jgit.transport.UploadPack up = new org.eclipse.jgit.transport.UploadPack ( repo ) ; up.setPackConfig ( config.getPackConfig ( ) ) ; up.setTimeout ( config.getTimeout ( ) ) ; return up ; }

Target:
public org.eclipse.jgit.transport.UploadPack create ( javax.servlet.http.HttpServletRequest req , org.eclipse.jgit.lib.Repository repo ) { org.eclipse.jgit.transport.UploadPack up = new org.eclipse.jgit.transport.UploadPack ( repo ) ; up.setPackConfig ( config.getPackConfig ( ) ) ; up.setTimeout ( config.getTimeout ( ) ) ; up.setPreUploadHook ( org.eclipse.jgit.transport.PreUploadHookChain.newChain ( com.google.common.collect.Lists.newArrayList ( preUploadHooks ) ) ) ; return up ; }
Source:
protected org.apache.http.impl.client.DefaultHttpClient getClient ( ) { if ( ( client ) == null ) { java.net.URI uri = java.net.URI.create ( url ) ; client = new org.apache.http.impl.client.DefaultHttpClient ( ) ; client.getCredentialsProvider ( ) . setCredentials ( new org.apache.http.auth.AuthScope ( uri.getHost ( ) , uri.getPort ( ) ) , new org.apache.http.auth.UsernamePasswordCredentials ( account.username , account.httpPassword ) ) ; } return client ; }

Target:
protected org.apache.http.client.HttpClient getClient ( ) { if ( ( client ) == null ) { java.net.URI uri = java.net.URI.create ( url ) ; org.apache.http.impl.client.BasicCredentialsProvider creds = new org.apache.http.impl.client.BasicCredentialsProvider ( ) ; creds.setCredentials ( new org.apache.http.auth.AuthScope ( uri.getHost ( ) , uri.getPort ( ) ) , new org.apache.http.auth.UsernamePasswordCredentials ( account.username , account.httpPassword ) ) ; client = org.apache.http.impl.client.HttpClientBuilder.create ( ) . setDefaultCredentialsProvider ( creds ) . setMaxConnPerRoute ( 10 ) . setMaxConnTotal ( 1024 ) . build ( ) ; } return client ; }
Source:
public void process ( java.lang.String pluginName , java.io.InputStream in ) throws java.io.IOException { java.io.File tmpPlugin = com.google.gerrit.server.plugins.PluginLoader.storeInTemp ( pluginName , in , site ) ; java.lang.String pluginVersion = com.google.gerrit.pgm.init.InitPlugins.getVersion ( tmpPlugin ) ; if ( deleteTempPluginFile ) { tmpPlugin.delete ( ) ; } result.add ( new com.google.gerrit.pgm.init.InitPlugins.PluginData ( pluginName , pluginVersion , tmpPlugin ) ) ; }

Target:
public void process ( java.lang.String pluginName , java.io.InputStream in ) throws java.io.IOException { java.io.File tmpPlugin = com.google.gerrit.server.plugins.JarPluginProvider.storeInTemp ( pluginName , in , site ) ; java.lang.String pluginVersion = com.google.gerrit.pgm.init.InitPlugins.getVersion ( tmpPlugin ) ; if ( deleteTempPluginFile ) { tmpPlugin.delete ( ) ; } result.add ( new com.google.gerrit.common.PluginData ( pluginName , pluginVersion , tmpPlugin ) ) ; }
Source:
public java.lang.String getHtmlMessage ( ) { if ( com.google.common.base.Strings.isNullOrEmpty ( id ) ) { return null ; } if ( com.google.common.base.Strings.isNullOrEmpty ( expiresAt ) ) { com.googlesource.gerrit.plugins.messageoftheday.MessageOfTheDayImpl.log.warn ( "expiresAt not defined, not message will be shown" ) ; return null ; } if ( ( com.googlesource.gerrit.plugins.messageoftheday.MessageOfTheDayImpl.today ( ) . compareTo ( expiresAt ) ) > 0 ) { return null ; } return msg ; }

Target:
public java.lang.String getHtmlMessage ( ) { if ( com.google.common.base.Strings.isNullOrEmpty ( id ) ) { return null ; } if ( com.google.common.base.Strings.isNullOrEmpty ( expiresAt ) ) { com.googlesource.gerrit.plugins.messageoftheday.MessageOfTheDayImpl.log.warn ( "expiresAt not defined, no message will be shown" ) ; return null ; } if ( ( com.googlesource.gerrit.plugins.messageoftheday.MessageOfTheDayImpl.today ( ) . compareTo ( expiresAt ) ) > 0 ) { return null ; } return msg ; }
Source:
public void testCannotUploadToAnyRef ( ) { inherited.add ( grant ( com.google.gerrit.reviewdb.ApprovalCategory.READ , registered , "refs/*" , 1 , 1 ) ) ; local.add ( grant ( com.google.gerrit.reviewdb.ApprovalCategory.READ , devs , "refs/heads/*" , 1 , 2 ) ) ; com.google.gerrit.server.project.ProjectControl u = user ( ) ; assertFalse ( "cannot upload" , u.canUploadToAtLeastOneRef ( ) ) ; assertFalse ( "cannot upload refs/heads/master" , u.controlForRef ( "refs/heads/master" ) . canUpload ( ) ) ; }

Target:
public void testCannotUploadToAnyRef ( ) { inherited.add ( grant ( com.google.gerrit.reviewdb.ApprovalCategory.READ , registered , "refs/*" , 1 , 1 ) ) ; local.add ( grant ( com.google.gerrit.reviewdb.ApprovalCategory.READ , devs , "refs/heads/*" , 1 , 2 ) ) ; com.google.gerrit.server.project.ProjectControl u = user ( ) ; assertFalse ( "cannot upload" , u.canPushToAtLeastOneRef ( ) ) ; assertFalse ( "cannot upload refs/heads/master" , u.controlForRef ( "refs/heads/master" ) . canUpload ( ) ) ; }
Source:
private void parseReviewer ( com.google.gerrit.server.notedb.ReviewerStateInternal state , java.lang.String line ) throws org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.lib.PersonIdent ident = org.eclipse.jgit.util.RawParseUtils.parsePersonIdent ( line ) ; if ( ident == null ) { throw invalidFooter ( state.getFooterKey ( ) , line ) ; } com.google.gerrit.reviewdb.client.Account.Id accountId = parseIdent ( ident ) ; if ( ! ( reviewers.containsKey ( accountId ) ) ) { reviewers.put ( accountId , state ) ; } }

Target:
private void parseReviewer ( com.google.gerrit.server.notedb.ReviewerStateInternal state , java.lang.String line ) throws org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.lib.PersonIdent ident = org.eclipse.jgit.util.RawParseUtils.parsePersonIdent ( line ) ; if ( ident == null ) { throw invalidFooter ( state.getFooterKey ( ) , line ) ; } com.google.gerrit.reviewdb.client.Account.Id accountId = noteUtil.parseIdent ( ident , id ) ; if ( ! ( reviewers.containsKey ( accountId ) ) ) { reviewers.put ( accountId , state ) ; } }
Source:
private com.google.inject.Injector createSysInjector ( final com.google.gerrit.pgm.BaseInit.SiteInit init ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( new com.google.inject.AbstractModule ( ) { @ java.lang.Override protected void configure ( ) { bind ( com.google.gerrit.pgm.util.ConsoleUI.class ) . toInstance ( init.ui ) ; bind ( com.google.gerrit.pgm.init.InitFlags.class ) . toInstance ( init.flags ) ; } } ) ; return createDbInjector ( com.google.gerrit.server.schema.DataSourceProvider.Context.SINGLE_USER ) . createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createSysInjector ( final com.google.gerrit.pgm.BaseInit.SiteInit init ) { if ( ( sysInjector ) == null ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( new com.google.inject.AbstractModule ( ) { @ java.lang.Override protected void configure ( ) { bind ( com.google.gerrit.pgm.util.ConsoleUI.class ) . toInstance ( init.ui ) ; bind ( com.google.gerrit.pgm.init.InitFlags.class ) . toInstance ( init.flags ) ; } } ) ; sysInjector = createDbInjector ( com.google.gerrit.server.schema.DataSourceProvider.Context.SINGLE_USER ) . createChildInjector ( modules ) ; } return sysInjector ; }
Source:
public void mergeReview ( com.google.gerrit.extensions.common.ChangeInfo info ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { final com.google.gerrit.extensions.api.changes.SubmitInput input = new com.google.gerrit.extensions.api.changes.SubmitInput ( ) ; input.waitForMerge = true ; final com.google.gerrit.server.change.RevisionResource r = getRevisionResource ( info.project , info._number ) ; submitter.apply ( r , input ) ; }

Target:
public void mergeReview ( java.lang.String project , int changeNumber ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { final com.google.gerrit.extensions.api.changes.SubmitInput input = new com.google.gerrit.extensions.api.changes.SubmitInput ( ) ; input.waitForMerge = true ; final com.google.gerrit.server.change.RevisionResource r = getRevisionResource ( project , changeNumber ) ; submitter.apply ( r , input ) ; }
Source:
public void listTagsOfNonVisibleBranch ( ) throws java.lang.Exception { grant ( Permission.SUBMIT , project , "refs/for/refs/heads/master" ) ; grant ( Permission.SUBMIT , project , "refs/for/refs/heads/hidden" ) ; grant ( Permission.CREATE , project , "refs/tags/*" ) ; grant ( Permission.PUSH , project , "refs/tags/*" ) ; com.google.gerrit.acceptance.PushOneCommit.Tag tag1 = new com.google.gerrit.acceptance.PushOneCommit.Tag ( "v1.0" ) ; com.google.gerrit.acceptance.PushOneCommit push1 = pushFactory.create ( db , admin.getIdent ( ) , testRepo ) ; push1.setTag ( tag1 ) ; com.google.gerrit.acceptance.PushOneCommit.Result r1 = push1.to ( "refs/for/master%submit" ) ; r1.assertOkStatus ( ) ; pushTo ( "refs/heads/hidden" ) ; com.google.gerrit.acceptance.PushOneCommit.Tag tag2 = new com.google.gerrit.acceptance.PushOneCommit.Tag ( "v2.0" ) ; com.google.gerrit.acceptance.PushOneCommit push2 = pushFactory.create ( db , admin.getIdent ( ) , testRepo ) ; push2.setTag ( tag2 ) ; com.google.gerrit.acceptance.PushOneCommit.Result r2 = push2.to ( "refs/for/hidden%submit" ) ; r2.assertOkStatus ( ) ; java.util.List < com.google.gerrit.extensions.common.TagInfo > result = com.google.gerrit.acceptance.rest.project.TagsIT.toTagInfoList ( adminSession.get ( ( ( "/projects/" + ( project.get ( ) ) ) + "/tags" ) ) ) ; com.google.common.truth.Truth.assertThat ( result ) . hasSize ( 2 ) ; com.google.common.truth.Truth.assertThat ( result.get ( 0 ) . ref ) . isEqualTo ( ( "refs/tags/" + ( tag1.name ) ) ) ; com.google.common.truth.Truth.assertThat ( result.get ( 0 ) . revision ) . isEqualTo ( r1.getCommitId ( ) . getName ( ) ) ; com.google.common.truth.Truth.assertThat ( result.get ( 1 ) . ref ) . isEqualTo ( ( "refs/tags/" + ( tag2.name ) ) ) ; com.google.common.truth.Truth.assertThat ( result.get ( 1 ) . revision ) . isEqualTo ( r2.getCommitId ( ) . getName ( ) ) ; blockRead ( project , "refs/heads/hidden" ) ; result = com.google.gerrit.acceptance.rest.project.TagsIT.toTagInfoList ( adminSession.get ( ( ( "/projects/" + ( project.get ( ) ) ) + "/tags" ) ) ) ; com.google.common.truth.Truth.assertThat ( result ) . hasSize ( 1 ) ; com.google.common.truth.Truth.assertThat ( result.get ( 0 ) . ref ) . isEqualTo ( ( "refs/tags/" + ( tag1.name ) ) ) ; com.google.common.truth.Truth.assertThat ( result.get ( 0 ) . revision ) . isEqualTo ( r1.getCommitId ( ) . getName ( ) ) ; }

Target:
public void listTagsOfNonVisibleProjectWithApi ( ) throws java.lang.Exception { blockRead ( project , "refs/*" ) ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; gApi.projects ( ) . name ( project.get ( ) ) . tags ( ) ; exception.expect ( com.google.gerrit.extensions.restapi.ResourceNotFoundException.class ) ; gApi.projects ( ) . name ( project.get ( ) ) . tag ( "tag" ) . get ( ) ; }
Source:
private void doGeneratePassword ( ) { if ( ( id ) != null ) { enableUI ( false ) ; Util.ACCOUNT_SEC.generatePassword ( id.getKey ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.reviewdb.client.AccountExternalId > ( ) { public void onSuccess ( final com.google.gerrit.reviewdb.client.AccountExternalId result ) { display ( result ) ; } @ java.lang.Override public void onFailure ( final java.lang.Throwable caught ) { enableUI ( true ) ; } } ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.rpc.NativeString newPassword ) { id.setPassword ( newPassword.asString ( ) ) ; display ( id ) ; }
Source:
public static com.google.gerrit.server.notedb.AbstractChangeNotes.LoadHandle create ( com.google.gerrit.server.notedb.ChangeNotesCommit.ChangeNotesRevWalk walk , org.eclipse.jgit.lib.ObjectId id ) { return new com.google.gerrit.server.notedb.AutoValue_AbstractChangeNotes_LoadHandle ( com.google.common.base.Preconditions.checkNotNull ( walk ) , ( id != null ? id.copy ( ) : null ) ) ; }

Target:
public static com.google.gerrit.server.notedb.AbstractChangeNotes.LoadHandle create ( com.google.gerrit.server.notedb.ChangeNotesCommit.ChangeNotesRevWalk walk , org.eclipse.jgit.lib.ObjectId id ) { if ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) . equals ( id ) ) { id = null ; } else if ( id != null ) { id = id.copy ( ) ; } return new com.google.gerrit.server.notedb.AutoValue_AbstractChangeNotes_LoadHandle ( com.google.common.base.Preconditions.checkNotNull ( walk ) , id ) ; }
Source:
public final int parseArguments ( final org.kohsuke.args4j.spi.Parameters params ) throws org.kohsuke.args4j.CmdLineException { final java.lang.String n = params.getParameter ( 0 ) ; final com.google.gerrit.reviewdb.AccountGroup group = groupCache.lookup ( n ) ; if ( group == null ) { throw new org.kohsuke.args4j.CmdLineException ( owner , ( ( "Group \"" + n ) + "\" does not exist" ) ) ; } setter.addValue ( group.getId ( ) ) ; return 1 ; }

Target:
public final int parseArguments ( final org.kohsuke.args4j.spi.Parameters params ) throws org.kohsuke.args4j.CmdLineException { final java.lang.String n = params.getParameter ( 0 ) ; final com.google.gerrit.reviewdb.AccountGroup group = groupCache.get ( new com.google.gerrit.reviewdb.AccountGroup.NameKey ( n ) ) ; if ( group == null ) { throw new org.kohsuke.args4j.CmdLineException ( owner , ( ( "Group \"" + n ) + "\" does not exist" ) ) ; } setter.addValue ( group.getId ( ) ) ; return 1 ; }
Source:
net.sf.ehcache.Element get ( final java.lang.String token ) { if ( ( token != null ) && ( ! ( "" . equals ( token ) ) ) ) { try { return self.get ( new com.google.gerrit.server.http.WebSessionManager.Key ( token ) ) ; } catch ( java.lang.IllegalStateException e ) { return null ; } catch ( net.sf.ehcache.CacheException e ) { return null ; } } else { return null ; } }

Target:
com.google.gerrit.server.http.WebSessionManager.Val get ( final com.google.gerrit.server.http.WebSessionManager.Key key ) { return self.get ( key ) ; }
Source:
private java.util.List < com.google.gerrit.server.project.ChangeControl > changeFromNotesFactory ( java.lang.String id , final com.google.gerrit.server.CurrentUser currentUser ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.server.notedb.ChangeNotes > changes = changeNotesFactory.create ( db , java.util.Arrays.asList ( Change.Id.parse ( id ) ) ) ; return com.google.common.collect.FluentIterable.from ( changes ) . transform ( new com.google.common.base.Function < com.google.gerrit.server.notedb.ChangeNotes , com.google.gerrit.server.project.ChangeControl > ( ) { @ java.lang.Override public com.google.gerrit.server.project.ChangeControl apply ( com.google.gerrit.server.notedb.ChangeNotes changeNote ) { return controlForChange ( changeNote , currentUser ) ; } } ) . filter ( com.google.common.base.Predicates.notNull ( ) ) . toList ( ) ; }

Target:
private java.util.List < com.google.gerrit.server.project.ChangeControl > changeFromNotesFactory ( java.lang.String id , final com.google.gerrit.server.CurrentUser currentUser ) throws com.google.gerrit.sshd.BaseCommand.UnloggedFailure , com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.server.notedb.ChangeNotes > changes = changeNotesFactory.create ( db , parseId ( id ) ) ; return com.google.common.collect.FluentIterable.from ( changes ) . transform ( new com.google.common.base.Function < com.google.gerrit.server.notedb.ChangeNotes , com.google.gerrit.server.project.ChangeControl > ( ) { @ java.lang.Override public com.google.gerrit.server.project.ChangeControl apply ( com.google.gerrit.server.notedb.ChangeNotes changeNote ) { return controlForChange ( changeNote , currentUser ) ; } } ) . filter ( com.google.common.base.Predicates.notNull ( ) ) . toList ( ) ; }
Source:
public void keyRevokedByExpiredKeyAfterExpirationIsNotRevoked ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey k = add ( com.google.gerrit.gpg.testutil.TestKeys.keyRevokedByExpiredKeyAfterExpiration ( ) ) ; add ( com.google.gerrit.gpg.testutil.TestKeys.expiredKey ( ) ) ; save ( ) ; com.google.gerrit.gpg.PublicKeyChecker checker = new com.google.gerrit.gpg.PublicKeyChecker ( ) . setStore ( store ) ; assertProblems ( checker , k ) ; }

Target:
public void keyRevokedByExpiredKeyAfterExpirationIsNotRevoked ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey k = add ( com.google.gerrit.gpg.testutil.TestKeys.keyRevokedByExpiredKeyAfterExpiration ( ) ) ; add ( com.google.gerrit.gpg.testutil.TestKeys.expiredKey ( ) ) ; save ( ) ; com.google.gerrit.gpg.PublicKeyChecker checker = new com.google.gerrit.gpg.PublicKeyChecker ( ) . setStore ( store ) ; assertNoProblems ( checker , k ) ; }
Source:
public com.google.gerrit.reviewdb.AccountDiffPreference getAccountDiffPreference ( ) { com.google.gerrit.reviewdb.AccountDiffPreference diffPref ; try { diffPref = dbProvider.get ( ) . accountDiffPreferences ( ) . get ( getAccountId ( ) ) ; if ( diffPref == null ) { diffPref = com.google.gerrit.reviewdb.AccountDiffPreference.createDefault ( getAccountId ( ) ) ; } } catch ( com.google.gwtorm.client.OrmException e ) { com.google.gerrit.server.IdentifiedUser.log.warn ( "Cannot query account diff preferences" , e ) ; diffPref = com.google.gerrit.reviewdb.AccountDiffPreference.createDefault ( getAccountId ( ) ) ; } return diffPref ; }

Target:
public com.google.gerrit.reviewdb.AccountDiffPreference getAccountDiffPreference ( ) { com.google.gerrit.reviewdb.AccountDiffPreference diffPref = accountDiffPreferencesCache.get ( getAccountId ( ) ) ; if ( diffPref == null ) { diffPref = com.google.gerrit.reviewdb.AccountDiffPreference.createDefault ( getAccountId ( ) ) ; } return diffPref ; }
Source:
void setRangeHighlight ( boolean highlight ) { if ( ( fromTo ) != null ) { if ( highlight && ( ( rangeHighlightMarker ) == null ) ) { rangeHighlightMarker = group.getCm ( ) . markText ( fromTo.getFrom ( ) , fromTo.getTo ( ) , net.codemirror.lib.Configuration.create ( ) . set ( "className" , DiffTable.style.rangeHighlight ( ) ) ) ; } else if ( ( ! highlight ) && ( ( rangeHighlightMarker ) != null ) ) { rangeHighlightMarker.clear ( ) ; rangeHighlightMarker = null ; } } }

Target:
void setRangeHighlight ( boolean highlight ) { if ( ( fromTo ) != null ) { if ( highlight && ( ( rangeHighlightMarker ) == null ) ) { rangeHighlightMarker = group.getCm ( ) . markText ( fromTo.from ( ) , fromTo.to ( ) , net.codemirror.lib.Configuration.create ( ) . set ( "className" , DiffTable.style.rangeHighlight ( ) ) ) ; } else if ( ( ! highlight ) && ( ( rangeHighlightMarker ) != null ) ) { rangeHighlightMarker.clear ( ) ; rangeHighlightMarker = null ; } } }
Source:
public void updateRepo ( com.google.gerrit.server.git.BatchUpdate.RepoContext ctx ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , java.io.IOException { validate ( ctx ) ; if ( ! ( updateRef ) ) { return ; } ctx.addRefUpdate ( new org.eclipse.jgit.transport.ReceiveCommand ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) , commit , patchSet.getRefName ( ) ) ) ; }

Target:
public void updateRepo ( com.google.gerrit.server.git.BatchUpdate.RepoContext ctx ) throws com.google.gerrit.extensions.restapi.ResourceConflictException , java.io.IOException { validate ( ctx ) ; if ( ! ( updateRef ) ) { return ; } ctx.addRefUpdate ( new org.eclipse.jgit.transport.ReceiveCommand ( org.eclipse.jgit.lib.ObjectId.zeroId ( ) , commit , psId.toRefName ( ) ) ) ; }
Source:
public com.google.gerrit.server.data.AccountAttribute asAccountAttribute ( com.google.gerrit.reviewdb.client.Account account ) { if ( account == null ) { return null ; } com.google.gerrit.server.data.AccountAttribute who = new com.google.gerrit.server.data.AccountAttribute ( ) ; who.name = account.getFullName ( ) ; who.email = account.getPreferredEmail ( ) ; who.username = account.getUserName ( ) ; return who ; }

Target:
public com.google.gerrit.server.data.AccountAttribute asAccountAttribute ( com.google.gerrit.server.account.AccountState accountState ) { if ( accountState == null ) { return null ; } com.google.gerrit.server.data.AccountAttribute who = new com.google.gerrit.server.data.AccountAttribute ( ) ; who.name = accountState.getAccount ( ) . getFullName ( ) ; who.email = accountState.getAccount ( ) . getPreferredEmail ( ) ; who.username = accountState.getUserName ( ) ; return who ; }
Source:
private com.google.gerrit.server.account.AccountState missing ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( accountId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; account.setActive ( false ) ; return new com.google.gerrit.server.account.AccountState ( allUsersName , account , java.util.Collections.emptySet ( ) , new java.util.HashMap < > ( ) , com.google.gerrit.extensions.client.GeneralPreferencesInfo.defaults ( ) ) ; }

Target:
private com.google.gerrit.server.account.AccountState missing ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( accountId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; account.setActive ( false ) ; return new com.google.gerrit.server.account.AccountState ( allUsersName , account , com.google.common.collect.ImmutableSet.of ( ) , com.google.common.collect.ImmutableMap.of ( ) , com.google.gerrit.extensions.client.GeneralPreferencesInfo.defaults ( ) ) ; }
Source:
private void printNode ( final com.google.gerrit.sshd.commands.TreeFormatter.TreeNode node , final int level , final boolean isLast ) { printIndention ( level ) ; stdout.print ( ( isLast ? com.google.gerrit.sshd.commands.TreeFormatter.LAST_NODE_PREFIX : com.google.gerrit.sshd.commands.TreeFormatter.NODE_PREFIX ) ) ; if ( node.isVisible ( ) ) { stdout.print ( node.getDisplayName ( ) ) ; } else { stdout.print ( com.google.gerrit.sshd.commands.TreeFormatter.NOT_VISIBLE_NODE ) ; } stdout.print ( "\n" ) ; }

Target:
private void printNode ( final com.google.gerrit.server.util.TreeFormatter.TreeNode node , final int level , final boolean isLast ) { printIndention ( level ) ; stdout.print ( ( isLast ? com.google.gerrit.server.util.TreeFormatter.LAST_NODE_PREFIX : com.google.gerrit.server.util.TreeFormatter.NODE_PREFIX ) ) ; if ( node.isVisible ( ) ) { stdout.print ( node.getDisplayName ( ) ) ; } else { stdout.print ( com.google.gerrit.server.util.TreeFormatter.NOT_VISIBLE_NODE ) ; } stdout.print ( "\n" ) ; }
Source:
void scheduleFullSync ( final com.google.gerrit.reviewdb.client.Project.NameKey project , final java.lang.String urlMatch , com.googlesource.gerrit.plugins.replication.ReplicationState state ) { if ( ! ( running ) ) { stateLog.warn ( "Replication plugin did not finish startup before event" , state ) ; return ; } for ( com.googlesource.gerrit.plugins.replication.Destination cfg : config.getDestinations ( FilterType.ALL ) ) { if ( cfg.wouldPushProject ( project ) ) { for ( org.eclipse.jgit.transport.URIish uri : cfg.getURIs ( project , urlMatch ) ) { cfg.schedule ( project , PushOne.ALL_REFS , uri , state ) ; } } } }

Target:
void scheduleFullSync ( com.google.gerrit.reviewdb.client.Project.NameKey project , java.lang.String urlMatch , com.googlesource.gerrit.plugins.replication.ReplicationState state , boolean now ) { if ( ! ( running ) ) { stateLog.warn ( "Replication plugin did not finish startup before event" , state ) ; return ; } for ( com.googlesource.gerrit.plugins.replication.Destination cfg : config.getDestinations ( FilterType.ALL ) ) { if ( cfg.wouldPushProject ( project ) ) { for ( org.eclipse.jgit.transport.URIish uri : cfg.getURIs ( project , urlMatch ) ) { cfg.schedule ( project , PushOne.ALL_REFS , uri , state , now ) ; } } } }
Source:
private com.google.gerrit.reviewdb.client.Change loadChangeFromDb ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.reviewdb.server.ReviewDbUtil.unwrapDb ( db ) . changes ( ) . get ( changeId ) ; com.google.common.base.Preconditions.checkNotNull ( change , "change %s not found in ReviewDb" , changeId ) ; com.google.common.base.Preconditions.checkArgument ( change.getProject ( ) . equals ( project ) , ( "passed project %s when creating ChangeNotes for %s, but actual" + " project is %s" ) , project , changeId , change.getProject ( ) ) ; return change ; }

Target:
private com.google.gerrit.reviewdb.client.Change loadChangeFromDb ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.reviewdb.server.ReviewDbUtil.unwrapDb ( db ) . changes ( ) . get ( changeId ) ; com.google.common.base.Preconditions.checkArgument ( ( project != null ) , "project is required" ) ; com.google.common.base.Preconditions.checkNotNull ( change , "change %s not found in ReviewDb" , changeId ) ; com.google.common.base.Preconditions.checkArgument ( change.getProject ( ) . equals ( project ) , ( "passed project %s when creating ChangeNotes for %s, but actual" + " project is %s" ) , project , changeId , change.getProject ( ) ) ; return change ; }
Source:
protected void mustHaveValidSite ( ) throws com.google.gerrit.common.Die { if ( ! ( java.nio.file.Files.exists ( sitePath.resolve ( "etc" ) . resolve ( "gerrit.config" ) ) ) ) { throw die ( ( ( ( "not a Gerrit site: '" + ( getSitePath ( ) ) ) + "\'\n" ) + "Perhaps you need to run init first?" ) ) ; } }

Target:
protected void mustHaveValidSite ( ) throws com.google.gerrit.common.Die { if ( ! ( java.nio.file.Files.exists ( sitePath.resolve ( "etc" ) . resolve ( "gerrit.config" ) ) ) ) { throw die ( ( ( "not a Gerrit site: '" + ( getSitePath ( ) ) ) + "\'\nPerhaps you need to run init first?" ) ) ; } }
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.getCurrentConnection ( ) . getRequest ( ) . setHandled ( true ) ; try { com.google.gerrit.pgm.http.jetty.HiddenErrorHandler.log ( req ) ; } finally { replyGenericError ( 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.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 ) ; } }
Source:
private void applyAllSuccess ( ) { if ( ( ( ! ( failed ) ) && ( finalAdded ) ) && ( remaining.isEmpty ( ) ) ) { for ( com.google.gerrit.client.rpc.CallbackGroup.CallbackImpl < ? > cb : callbacks ) { cb.applySuccess ( ) ; } callbacks.clear ( ) ; } }

Target:
private void apply ( ) { if ( ( finalAdded ) && ( remaining.isEmpty ( ) ) ) { if ( failed ) { for ( com.google.gerrit.client.rpc.CallbackGroup.CallbackGlue cb : callbacks ) { cb.applyFailed ( ) ; } } else { for ( com.google.gerrit.client.rpc.CallbackGroup.CallbackGlue cb : callbacks ) { cb.applySuccess ( ) ; } } callbacks.clear ( ) ; } }
Source:
public java.lang.String getDisplayString ( ) { return branch.ref ( ) ; }

Target:
public java.lang.String getDisplayString ( ) { final java.lang.String refsHeads = "refs/heads/" ; if ( branch.ref ( ) . startsWith ( refsHeads ) ) { return branch.ref ( ) . substring ( refsHeads.length ( ) ) ; } return branch.ref ( ) ; }
Source:
public void go ( ) { if ( ( com.google.gerrit.client.Gerrit.patchScreen ) != null ) { com.google.gerrit.client.Gerrit.patchScreen.setTopView ( tv ) ; } com.google.gwt.dom.client.AnchorElement.as ( getElement ( ) ) . blur ( ) ; }

Target:
public void onResponseReceived ( com.google.gwt.http.client.Request req , com.google.gwt.http.client.Response resp ) { switch ( resp.getStatusCode ( ) ) { case com.google.gwt.http.client.Response.SC_OK : case com.google.gwt.http.client.Response.SC_MOVED_PERMANENTLY : case com.google.gwt.http.client.Response.SC_MOVED_TEMPORARILY : cb.onSuccess ( com.google.gerrit.client.documentation.DocInfo.create ( ) ) ; break ; default : cb.onSuccess ( null ) ; break ; } }
Source:
private boolean canAbandon ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { return ( ( ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) || ( getRefControl ( ) . canAbandon ( ) ) ) && ( ! ( isPatchSetLocked ( db ) ) ) ; }

Target:
private boolean canAbandon ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { return ( ( ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getUser ( ) . getCapabilities ( ) . isAdmin_DoNotUse ( ) ) ) || ( getRefControl ( ) . canAbandon ( ) ) ) && ( ! ( isPatchSetLocked ( db ) ) ) ; }
Source:
public boolean value ( ) { return ( a.value ( ) ) && ( b.value ( ) ) ; }

Target:
public boolean value ( ) { if ( ( com.google.gerrit.extensions.conditions.BooleanCondition.evaluatesTriviallyToExpectedValue ( a , false ) ) || ( com.google.gerrit.extensions.conditions.BooleanCondition.evaluatesTriviallyToExpectedValue ( b , false ) ) ) { return false ; } return ( a.value ( ) ) && ( b.value ( ) ) ; }
Source:
private com.google.gerrit.server.account.AccountState toAccountState ( com.google.gson.JsonElement element ) { com.google.gerrit.reviewdb.client.Account.Id id = new com.google.gerrit.reviewdb.client.Account.Id ( element.getAsJsonObject ( ) . get ( com.google.gerrit.server.index.account.AccountField.ID.getName ( ) ) . getAsInt ( ) ) ; return accountCache.get ( id ) ; }

Target:
private com.google.gerrit.server.account.AccountState toAccountState ( com.google.gson.JsonElement json ) { com.google.gson.JsonElement source = json.getAsJsonObject ( ) . get ( "_source" ) ; if ( source == null ) { source = json.getAsJsonObject ( ) . get ( "fields" ) ; } com.google.gerrit.reviewdb.client.Account.Id id = new com.google.gerrit.reviewdb.client.Account.Id ( source.getAsJsonObject ( ) . get ( com.google.gerrit.server.index.account.AccountField.ID.getName ( ) ) . getAsInt ( ) ) ; return accountCache.get ( id ) ; }
Source:
public com.google.gwtorm.client.OrmException convertError ( final java.lang.String op , final java.lang.String entity , final java.sql.SQLException err ) { switch ( getSQLStateInt ( err ) ) { case 23001 : return new com.google.gwtorm.client.OrmDuplicateKeyException ( entity , err ) ; case 23000 : default : return super . convertError ( op , entity , err ) ; } }

Target:
public com.google.gwtorm.server.OrmException convertError ( final java.lang.String op , final java.lang.String entity , final java.sql.SQLException err ) { switch ( getSQLStateInt ( err ) ) { case 23001 : return new com.google.gwtorm.server.OrmDuplicateKeyException ( entity , err ) ; case 23000 : default : return super . convertError ( op , entity , err ) ; } }
Source:
private void writeObject ( java.io.ObjectOutputStream output ) throws java.io.IOException { com.google.gerrit.server.ioutil.BasicSerialization.writeVarInt32 ( output , paths.length ) ; try ( java.util.zip.DeflaterOutputStream out = new java.util.zip.DeflaterOutputStream ( output ) ) { for ( java.lang.String p : paths ) { com.google.gerrit.server.ioutil.BasicSerialization.writeString ( out , p ) ; } } }

Target:
private void writeObject ( java.io.ObjectOutputStream output ) throws java.io.IOException { com.google.gerrit.server.ioutil.BasicSerialization.writeVarInt32 ( output , insertions ) ; com.google.gerrit.server.ioutil.BasicSerialization.writeVarInt32 ( output , deletions ) ; com.google.gerrit.server.ioutil.BasicSerialization.writeVarInt32 ( output , paths.length ) ; try ( java.util.zip.DeflaterOutputStream out = new java.util.zip.DeflaterOutputStream ( output ) ) { for ( java.lang.String p : paths ) { com.google.gerrit.server.ioutil.BasicSerialization.writeString ( out , p ) ; } } }
Source:
java.lang.Runnable maybePrevVimSearch ( final net.codemirror.lib.CodeMirror cm ) { return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { if ( cm.vim ( ) . hasSearchHighlight ( ) ) { cm.vim ( ) . handleKey ( "n" ) ; } else { getCommentManager ( ) . commentNav ( cm , Direction.NEXT ) . run ( ) ; } } } ; }

Target:
private java.lang.Runnable maybePrevVimSearch ( final net.codemirror.lib.CodeMirror cm ) { return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { if ( cm.vim ( ) . hasSearchHighlight ( ) ) { cm.vim ( ) . handleKey ( "N" ) ; } else { getCommentManager ( ) . commentNav ( cm , Direction.NEXT ) . run ( ) ; } } } ; }
Source:
public void onTopicEdited ( com.google.gerrit.extensions.events.TopicEditedListener.Event ev ) { try { com.google.gerrit.reviewdb.client.Change change = getChange ( ev.getChange ( ) ) ; com.google.gerrit.server.events.TopicChangedEvent event = new com.google.gerrit.server.events.TopicChangedEvent ( change ) ; event.change = changeAttributeSupplier ( change ) ; event.changer = accountAttributeSupplier ( ev.getWho ( ) ) ; event.oldTopic = ev.getOldTopic ( ) ; dispatcher.get ( ) . postEvent ( change , event ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.events.StreamEventsApiListener.log.error ( "Failed to dispatch event" , e ) ; } }

Target:
public void onTopicEdited ( com.google.gerrit.extensions.events.TopicEditedListener.Event ev ) { try { com.google.gerrit.reviewdb.client.Change change = getChange ( ev.getChange ( ) ) ; com.google.gerrit.server.events.TopicChangedEvent event = new com.google.gerrit.server.events.TopicChangedEvent ( change ) ; event.change = changeAttributeSupplier ( change ) ; event.changer = accountAttributeSupplier ( ev.getWho ( ) ) ; event.oldTopic = ev.getOldTopic ( ) ; dispatcher.get ( ) . postEvent ( change , event ) ; } catch ( com.google.gwtorm.server.OrmException | com.google.gerrit.server.permissions.PermissionBackendException e ) { com.google.gerrit.server.events.StreamEventsApiListener.log.error ( "Failed to dispatch event" , e ) ; } }
Source:
private void initMacs ( final org.eclipse.jgit.lib.Config cfg ) { setMacFactories ( com.google.gerrit.sshd.SshDaemon.filter ( cfg , "mac" , new org.apache.sshd.common.mac.HMACMD5.Factory ( ) , new org.apache.sshd.common.mac.HMACSHA1.Factory ( ) , new org.apache.sshd.common.mac.HMACMD596.Factory ( ) , new org.apache.sshd.common.mac.HMACSHA196.Factory ( ) ) ) ; }

Target:
private void initMacs ( final org.eclipse.jgit.lib.Config cfg ) { setMacFactories ( com.google.gerrit.sshd.SshDaemon.filter ( cfg , "mac" , new org.apache.sshd.common.mac.HMACMD5.Factory ( ) , new org.apache.sshd.common.mac.HMACSHA1.Factory ( ) , new org.apache.sshd.common.mac.HMACMD596.Factory ( ) , new org.apache.sshd.common.mac.HMACSHA196.Factory ( ) , new org.apache.sshd.common.mac.HMACSHA256.Factory ( ) , new org.apache.sshd.common.mac.HMACSHA512.Factory ( ) ) ) ; }
Source:
public void addRemoveMember ( ) throws java.lang.Exception { com.google.gerrit.acceptance.TestAccount u = accounts.create ( "user" , "user@example.com" , "Full Name" ) ; com.google.gerrit.acceptance.RestResponse r = PUT ( "/groups/Administrators/members/user" ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_CREATED , r.getStatusCode ( ) ) ; com.google.gerrit.server.account.AccountInfo ai = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.server.account.AccountInfo.class ) ; com.google.gerrit.acceptance.rest.account.AccountAssert.assertAccountInfo ( u , ai ) ; assertMembers ( "Administrators" , admin , u ) ; r.consume ( ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_NO_CONTENT , DELETE ( "/groups/Administrators/members/user" ) ) ; assertMembers ( "Administrators" , admin ) ; }

Target:
public void addRemoveMember ( ) throws java.lang.Exception { com.google.gerrit.acceptance.RestResponse r = PUT ( "/groups/Administrators/members/user" ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_CREATED , r.getStatusCode ( ) ) ; com.google.gerrit.server.account.AccountInfo ai = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.server.account.AccountInfo.class ) ; com.google.gerrit.acceptance.rest.account.AccountAssert.assertAccountInfo ( user , ai ) ; assertMembers ( "Administrators" , admin , user ) ; r.consume ( ) ; org.junit.Assert.assertEquals ( HttpStatus.SC_NO_CONTENT , DELETE ( "/groups/Administrators/members/user" ) ) ; assertMembers ( "Administrators" , admin ) ; }
Source:
private void verifyProjectVisible ( final java.lang.String type , final java.util.Set < com.google.gerrit.client.reviewdb.Account.Id > who ) throws com.google.gerrit.server.ssh.commands.UnloggedFailure { for ( final com.google.gerrit.client.reviewdb.Account.Id id : who ) { final com.google.gerrit.server.IdentifiedUser user = identifiedUserFactory.create ( id ) ; if ( ! ( projectState.controlFor ( user ) . isVisible ( ) ) ) { throw new com.google.gerrit.server.ssh.commands.UnloggedFailure ( 1 , ( ( ( type + " " ) + ( user.getAccount ( ) . getFullName ( ) ) ) + " cannot access the project" ) ) ; } } }

Target:
private void verifyProjectVisible ( final java.lang.String type , final java.util.Set < com.google.gerrit.client.reviewdb.Account.Id > who ) throws com.google.gerrit.server.ssh.commands.UnloggedFailure { for ( final com.google.gerrit.client.reviewdb.Account.Id id : who ) { final com.google.gerrit.server.IdentifiedUser user = identifiedUserFactory.create ( id ) ; if ( ! ( projectControl.forUser ( user ) . isVisible ( ) ) ) { throw new com.google.gerrit.server.ssh.commands.UnloggedFailure ( 1 , ( ( ( type + " " ) + ( user.getAccount ( ) . getFullName ( ) ) ) + " cannot access the project" ) ) ; } } }
Source:
public Account.Id lookup ( final java.lang.String accountName ) { if ( emailExpander.canExpand ( accountName ) ) { final java.util.Set < com.google.gerrit.reviewdb.Account.Id > c = byEmail.get ( emailExpander.expand ( accountName ) ) ; if ( 1 == ( c.size ( ) ) ) { return c.iterator ( ) . next ( ) ; } } return null ; }

Target:
public Account.Id lookup ( final java.lang.String accountName ) { if ( emailExpander.canExpand ( accountName ) ) { final java.util.Set < com.google.gerrit.reviewdb.Account.Id > c = byEmail.get ( emailExpander.expand ( accountName ) ) . getIds ( ) ; if ( 1 == ( c.size ( ) ) ) { return c.iterator ( ) . next ( ) ; } } return null ; }
Source:
public void receive ( org.jgroups.Message msg ) { synchronized ( this ) { if ( ( peerAddress ) != null ) { return ; } peerAddress = msg.getSrc ( ) ; java.lang.String url = ( ( java.lang.String ) ( msg.getObject ( ) ) ) ; peerInfo = com.google.common.base.Optional.of ( new com.ericsson.gerrit.plugins.highavailability.peers.PeerInfo ( url ) ) ; com.ericsson.gerrit.plugins.highavailability.peers.jgroups.JGroupsPeerInfoProvider.log.info ( "receive(): Set new peerInfo: {}" , url ) ; } }

Target:
public void receive ( org.jgroups.Message msg ) { synchronized ( this ) { if ( ( peerAddress ) != null ) { return ; } peerAddress = msg.getSrc ( ) ; java.lang.String url = ( ( java.lang.String ) ( msg.getObject ( ) ) ) ; peerInfo = java.util.Optional.of ( new com.ericsson.gerrit.plugins.highavailability.peers.PeerInfo ( url ) ) ; com.ericsson.gerrit.plugins.highavailability.peers.jgroups.JGroupsPeerInfoProvider.log.info ( "receive(): Set new peerInfo: {}" , url ) ; } }