auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void defaultActions ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChangeWithTopic ( ) ; r.assertOkStatus ( ) ; java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > actions = getActions ( r.getChangeId ( ) ) ; com.google.common.truth.Truth.assertThat ( actions ) . hasSize ( 3 ) ; com.google.common.truth.Truth.assertThat ( actions.keySet ( ) ) . containsExactly ( "cherrypick" , "rebase" , "description" ) ; }

Target:
public void defaultActions ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createANewChangeWithTopic ( ) ; r.assertOkStatus ( ) ; java.util.Map < java.lang.String , com.google.gerrit.extensions.common.ActionInfo > actions = getActions ( r.getChangeId ( ) ) ; com.google.common.truth.Truth.assertThat ( actions ) . hasSize ( 3 ) ; com.google.common.truth.Truth.assertThat ( actions.keySet ( ) ) . containsExactly ( "cherrypick" , "rebase" , "description" ) ; }
Source:
void setContext ( final int context ) { operation ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { getSkipManager ( ) . removeAll ( ) ; getSkipManager ( ) . render ( context , diff ) ; updateRenderEntireFile ( ) ; } } ) ; }

Target:
void setShowLineNumbers ( boolean b ) { if ( b ) { getDiffTable ( ) . addStyleName ( Resources.I.diffTableStyle ( ) . showLineNumbers ( ) ) ; } else { getDiffTable ( ) . removeStyleName ( Resources.I.diffTableStyle ( ) . showLineNumbers ( ) ) ; } }
Source:
protected void configure ( ) { bind ( java.io.File.class ) . annotatedWith ( com.google.gerrit.server.config.SitePath.class ) . toInstance ( sitePath ) ; bind ( DataSourceProvider.Context.class ) . toInstance ( DataSourceProvider.Context.MULTI_USER ) ; bind ( com.google.inject.Key.get ( javax.sql.DataSource.class , com.google.inject.name.Names.named ( "ReviewDb" ) ) ) . toProvider ( com.google.gerrit.server.schema.DataSourceProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; listener ( ) . to ( com.google.gerrit.server.schema.DataSourceProvider.class ) ; }

Target:
protected void configure ( ) { bind ( com.google.inject.Key.get ( javax.sql.DataSource.class , com.google.inject.name.Names.named ( "ReviewDb" ) ) ) . toProvider ( com.google.gerrit.httpd.ReviewDbDataSourceProvider.class ) . in ( com.google.inject.Scopes.SINGLETON ) ; listener ( ) . to ( com.google.gerrit.httpd.ReviewDbDataSourceProvider.class ) ; }
Source:
java.lang.StringBuilder refPrefixBuilder ( ) { java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( com.google.gerrit.reviewdb.client.RefNames.REFS_CHANGES ) ; int m = ( id ) % 100 ; if ( m < 10 ) { r.append ( '0' ) ; } r.append ( m ) ; r.append ( '/' ) ; r.append ( id ) ; r.append ( '/' ) ; return r ; }

Target:
java.lang.StringBuilder refPrefixBuilder ( ) { java.lang.StringBuilder r = new java.lang.StringBuilder ( 32 ) . append ( com.google.gerrit.reviewdb.client.RefNames.REFS_CHANGES ) ; int m = ( id ) % 100 ; if ( m < 10 ) { r.append ( '0' ) ; } return r.append ( m ) . append ( '/' ) . append ( id ) . append ( '/' ) ; }
Source:
public java.util.List < com.google.gerrit.reviewdb.client.Patch > toPatchList ( com.google.gerrit.reviewdb.client.PatchSet.Id setId ) { final java.util.ArrayList < com.google.gerrit.reviewdb.client.Patch > r = new java.util.ArrayList ( patches.length ) ; for ( com.google.gerrit.server.patch.PatchListEntry e : patches ) { r.add ( e.toPatch ( setId ) ) ; } return r ; }

Target:
public java.util.List < com.google.gerrit.reviewdb.client.Patch > toPatchList ( com.google.gerrit.reviewdb.client.PatchSet.Id setId ) { final java.util.ArrayList < com.google.gerrit.reviewdb.client.Patch > r = new java.util.ArrayList ( patches.length ) ; for ( com.google.gerrit.server.diff.PatchListEntry e : patches ) { r.add ( e.toPatch ( setId ) ) ; } return r ; }
Source:
private void fireHook ( ) throws com.google.gwtorm.client.OrmException { final java.util.Map < com.google.gerrit.reviewdb.ApprovalCategory.Id , com.google.gerrit.reviewdb.ApprovalCategoryValue.Id > changed = new java.util.HashMap < com.google.gerrit.reviewdb.ApprovalCategory.Id , com.google.gerrit.reviewdb.ApprovalCategoryValue.Id > ( ) ; for ( com.google.gerrit.reviewdb.ApprovalCategoryValue.Id v : approvals ) { changed.put ( v.getParentKey ( ) , v ) ; } hooks.doCommentAddedHook ( change , user.getAccount ( ) , patchSet , messageText , changed , db ) ; }

Target:
private void fireHook ( ) throws com.google.gwtorm.server.OrmException { final java.util.Map < com.google.gerrit.reviewdb.client.ApprovalCategory.Id , com.google.gerrit.reviewdb.client.ApprovalCategoryValue.Id > changed = new java.util.HashMap < com.google.gerrit.reviewdb.client.ApprovalCategory.Id , com.google.gerrit.reviewdb.client.ApprovalCategoryValue.Id > ( ) ; for ( com.google.gerrit.reviewdb.client.ApprovalCategoryValue.Id v : approvals ) { changed.put ( v.getParentKey ( ) , v ) ; } hooks.doCommentAddedHook ( change , user.getAccount ( ) , patchSet , messageText , changed , db ) ; }
Source:
public void badRequest ( ) throws java.io.IOException , javax.servlet.ServletException { org.easymock.EasyMock.expect ( request.getPathInfo ( ) ) . andReturn ( "/someCache" ) ; java.lang.String errorMessage = "someError" ; org.easymock.EasyMock.expect ( request.getReader ( ) ) . andThrow ( new java.io.IOException ( errorMessage ) ) ; response.sendError ( javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST , errorMessage ) ; org.easymock.EasyMock.expectLastCall ( ) . once ( ) ; replayAll ( ) ; servlet.doPost ( request , response ) ; verifyAll ( ) ; }

Target:
public void badRequest ( ) throws java.lang.Exception { org.mockito.Mockito.when ( request.getPathInfo ( ) ) . thenReturn ( "/someCache" ) ; java.lang.String errorMessage = "someError" ; org.mockito.Mockito.doThrow ( new java.io.IOException ( errorMessage ) ) . when ( request ) . getReader ( ) ; servlet.doPost ( request , response ) ; org.mockito.Mockito.verify ( response ) . sendError ( javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST , errorMessage ) ; }
Source:
public com.google.gerrit.common.data.AccountInfoCache create ( ) { final java.util.List < com.google.gerrit.common.data.AccountInfo > r = new java.util.ArrayList < com.google.gerrit.common.data.AccountInfo > ( out.size ( ) ) ; for ( final com.google.gerrit.reviewdb.Account a : out.values ( ) ) { r.add ( new com.google.gerrit.common.data.AccountInfo ( a ) ) ; } return new com.google.gerrit.common.data.AccountInfoCache ( r ) ; }

Target:
public com.google.gerrit.common.data.AccountInfoCache create ( ) { fetchWants ( ) ; final java.util.List < com.google.gerrit.common.data.AccountInfo > r = new java.util.ArrayList < com.google.gerrit.common.data.AccountInfo > ( out.size ( ) ) ; for ( final com.google.gerrit.reviewdb.Account a : out.values ( ) ) { r.add ( new com.google.gerrit.common.data.AccountInfo ( a ) ) ; } return new com.google.gerrit.common.data.AccountInfoCache ( r ) ; }
Source:
public static void scheduleUpdate ( final com.google.gerrit.client.reviewdb.Project.NameKey project , final java.lang.String ref ) { for ( final com.google.gerrit.git.PushQueue.ReplicationConfig cfg : com.google.gerrit.git.PushQueue.allConfigs ( ) ) { if ( cfg.wouldPushRef ( ref ) ) { for ( final org.spearce.jgit.transport.URIish uri : cfg.getURIs ( project , null ) ) { com.google.gerrit.git.PushQueue.scheduleImp ( project , ref , cfg , uri ) ; } } } }

Target:
public static void scheduleUpdate ( final com.google.gerrit.client.reviewdb.Project.NameKey project , final java.lang.String ref ) { for ( final com.google.gerrit.git.PushQueue.ReplicationConfig cfg : com.google.gerrit.git.PushQueue.allConfigs ( ) ) { if ( cfg.wouldPushRef ( ref ) ) { for ( final org.spearce.jgit.transport.URIish uri : cfg.getURIs ( project , null ) ) { cfg.schedule ( project , ref , uri ) ; } } } }
Source:
private void loadMyEmails ( ) throws com.google.gerrit.server.ssh.commands.Failure { addEmail ( userAccount.getPreferredEmail ( ) ) ; try { for ( final com.google.gerrit.client.reviewdb.AccountExternalId id : db.accountExternalIds ( ) . byAccount ( userAccount.getId ( ) ) ) { addEmail ( id.getEmailAddress ( ) ) ; } } catch ( com.google.gwtorm.client.OrmException e ) { throw new com.google.gerrit.server.ssh.commands.Failure ( 1 , "fatal: database error" , e ) ; } }

Target:
private void loadMyEmails ( ) throws com.google.gerrit.server.ssh.commands.Failure { addEmail ( currentUser.getAccount ( ) . getPreferredEmail ( ) ) ; try { for ( final com.google.gerrit.client.reviewdb.AccountExternalId id : db.accountExternalIds ( ) . byAccount ( currentUser.getAccountId ( ) ) ) { addEmail ( id.getEmailAddress ( ) ) ; } } catch ( com.google.gwtorm.client.OrmException e ) { throw new com.google.gerrit.server.ssh.commands.Failure ( 1 , "fatal: database error" , e ) ; } }
Source:
private java.lang.String replaceInUrl ( java.lang.String url , java.lang.String replacement ) { if ( ( ( replacement == null ) || ( url == null ) ) || ( ( url.contains ( com.googlesource.gerrit.plugins.avatars.external.ExternalUrlAvatarProvider.USER_PLACEHOLDER ) ) == false ) ) { return url ; } return url.replace ( com.googlesource.gerrit.plugins.avatars.external.ExternalUrlAvatarProvider.USER_PLACEHOLDER , com.google.gerrit.extensions.restapi.Url.encode ( replacement ) ) ; }

Target:
private java.lang.String replaceInUrl ( java.lang.String placeholder , java.lang.String url , java.lang.String replacement ) { if ( ! ( url.contains ( placeholder ) ) ) { return url ; } return url.replace ( placeholder , com.google.gerrit.extensions.restapi.Url.encode ( replacement ) ) ; }
Source:
public void onSuccess ( java.util.List < com.google.gerrit.common.data.GroupReference > result ) { addRule.setEnabled ( true ) ; if ( ( result.size ( ) ) == 1 ) { addGroup ( result.get ( 0 ) ) ; } else { groupToAdd.setFocus ( true ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.groups.GroupMap result ) { addRule.setEnabled ( true ) ; if ( ( result.values ( ) . length ( ) ) == 1 ) { addGroup ( new com.google.gerrit.common.data.GroupReference ( result.values ( ) . get ( 0 ) . getGroupUUID ( ) , result.values ( ) . get ( 0 ) . name ( ) ) ) ; } else { groupToAdd.setFocus ( true ) ; } }
Source:
private java.lang.String duration ( double ns ) { if ( ns < 0.5 ) { return "" ; } java.lang.String suffix = "ns" ; if ( ns >= 1000.0 ) { ns /= 1000.0 ; suffix = "us" ; } if ( ns >= 1000.0 ) { ns /= 1000.0 ; suffix = "ms" ; } if ( ns >= 1000.0 ) { ns /= 1000.0 ; suffix = "s " ; } return java.lang.String.format ( "%4.1f%s" , ns , suffix ) ; }

Target:
private static java.lang.String nullToEmpty ( java.lang.Long l ) { return l != null ? java.lang.String.valueOf ( l ) : "" ; }
Source:
private com.google.gerrit.extensions.common.GroupInfo createGroup ( java.lang.String name ) throws java.io.IOException { name = name ( name ) ; com.google.gerrit.server.group.CreateGroup.Input in = new com.google.gerrit.server.group.CreateGroup.Input ( ) ; in.ownerId = "Administrators" ; com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( "/groups/" + name ) , in ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_CREATED ) ; return parseGroup ( r ) ; }

Target:
private com.google.gerrit.extensions.common.GroupInfo createGroup ( java.lang.String name ) throws java.io.IOException { name = name ( name ) ; com.google.gerrit.extensions.api.groups.GroupInput in = new com.google.gerrit.extensions.api.groups.GroupInput ( ) ; in.ownerId = "Administrators" ; com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( "/groups/" + name ) , in ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_CREATED ) ; return parseGroup ( r ) ; }
Source:
protected void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; final java.util.Date when = author.getWhen ( ) ; final java.util.TimeZone tz = author.getTimeZone ( ) ; author = new org.eclipse.jgit.lib.PersonIdent ( "J. Author" , "ja@example.com" ) ; author = new org.eclipse.jgit.lib.PersonIdent ( author , when , tz ) ; committer = new org.eclipse.jgit.lib.PersonIdent ( "J. Committer" , "jc@example.com" ) ; committer = new org.eclipse.jgit.lib.PersonIdent ( committer , when , tz ) ; }

Target:
protected void setUp ( ) throws java.lang.Exception { if ( com.google.gerrit.server.util.HostPlatform.isWin32 ( ) ) { throw new com.google.gerrit.sshd.scproot.hooks.CommitMsgHookTest.SkipTestOnThisPlatform ( ) ; } super . setUp ( ) ; final java.util.Date when = author.getWhen ( ) ; final java.util.TimeZone tz = author.getTimeZone ( ) ; author = new org.eclipse.jgit.lib.PersonIdent ( "J. Author" , "ja@example.com" ) ; author = new org.eclipse.jgit.lib.PersonIdent ( author , when , tz ) ; committer = new org.eclipse.jgit.lib.PersonIdent ( "J. Committer" , "jc@example.com" ) ; committer = new org.eclipse.jgit.lib.PersonIdent ( committer , when , tz ) ; }
Source:
public void newPatchSetByOtherOnReviewableChangeOwnerSelfCcNotifyOwnerReviewersInReviewDb ( ) 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%notify=OWNER_REVIEWERS" , other , EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . notTo ( sc.starrer , other ) . notTo ( sc.reviewerByEmail , sc.ccerByEmail ) . to ( sc.owner , sc.reviewer , sc.ccer ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }

Target:
public void newPatchSetOnWipChangeNotifyAllInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; pushTo ( sc , "refs/for/master%wip,notify=ALL" , sc.owner ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . to ( sc.reviewer ) . cc ( sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) . noOneElse ( ) ; }
Source:
public void start ( final org.apache.sshd.server.Environment env ) { final com.google.gerrit.sshd.SshScope.Context ctx = new com.google.gerrit.sshd.SshScope.Context ( newSession ( ) , context.getCommandLine ( ) ) ; final com.google.gerrit.sshd.SshScope.Context old = com.google.gerrit.sshd.SshScope.set ( ctx ) ; try { startThread ( new com.google.gerrit.sshd.CommandRunnable ( ) { @ java.lang.Override public void run ( ) throws java.lang.Exception { parseCommandLine ( ) ; com.google.gerrit.sshd.AbstractGitCommand.this . service ( ) ; } } ) ; } finally { com.google.gerrit.sshd.SshScope.set ( old ) ; } }

Target:
public void start ( final org.apache.sshd.server.Environment env ) { com.google.gerrit.sshd.SshScope.Context ctx = context.subContext ( newSession ( ) , context.getCommandLine ( ) ) ; final com.google.gerrit.sshd.SshScope.Context old = com.google.gerrit.sshd.SshScope.set ( ctx ) ; try { startThread ( new com.google.gerrit.sshd.CommandRunnable ( ) { @ java.lang.Override public void run ( ) throws java.lang.Exception { parseCommandLine ( ) ; com.google.gerrit.sshd.AbstractGitCommand.this . service ( ) ; } } ) ; } finally { com.google.gerrit.sshd.SshScope.set ( old ) ; } }
Source:
private java.lang.Iterable < com.google.gerrit.server.query.change.ChangeData > byCommitsOnBranchNotMergedFromIndex ( com.google.gerrit.reviewdb.client.Branch.NameKey branch , java.util.List < java.lang.String > hashes ) throws com.google.gwtorm.server.OrmException { return query ( com.google.gerrit.server.query.Predicate.and ( com.google.gerrit.server.query.change.InternalChangeQuery.ref ( branch ) , com.google.gerrit.server.query.change.InternalChangeQuery.project ( branch.getParentKey ( ) ) , com.google.gerrit.server.query.Predicate.not ( com.google.gerrit.server.query.change.InternalChangeQuery.status ( Change.Status.MERGED ) ) , com.google.gerrit.server.query.Predicate.or ( com.google.gerrit.server.query.change.InternalChangeQuery.commits ( hashes ) ) ) ) ; }

Target:
private java.lang.Iterable < com.google.gerrit.server.query.change.ChangeData > byCommitsOnBranchNotMergedFromIndex ( com.google.gerrit.reviewdb.client.Branch.NameKey branch , java.util.Collection < java.lang.String > hashes ) throws com.google.gwtorm.server.OrmException { return query ( com.google.gerrit.server.query.Predicate.and ( com.google.gerrit.server.query.change.InternalChangeQuery.ref ( branch ) , com.google.gerrit.server.query.change.InternalChangeQuery.project ( branch.getParentKey ( ) ) , com.google.gerrit.server.query.Predicate.not ( com.google.gerrit.server.query.change.InternalChangeQuery.status ( Change.Status.MERGED ) ) , com.google.gerrit.server.query.Predicate.or ( com.google.gerrit.server.query.change.InternalChangeQuery.commits ( hashes ) ) ) ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { if ( ! ( isEdit ( ) ) ) { setOpen ( ( ! ( isOpen ( ) ) ) ) ; } }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { if ( ! ( isEdit ( ) ) ) { if ( ( autoClosed ) && ( ! ( isOpen ( ) ) ) ) { setOpen ( true ) ; setEdit ( true ) ; } else { setOpen ( ( ! ( isOpen ( ) ) ) ) ; } } }
Source:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { final com.google.gwt.user.client.ui.Widget sender = ( ( com.google.gwt.user.client.ui.Widget ) ( event.getSource ( ) ) ) ; if ( sender == ( edit ) ) { edit ( ) ; } else if ( sender == ( save ) ) { onSave ( ) ; } else if ( sender == ( cancel ) ) { render ( ) ; } else if ( sender == ( discard ) ) { onDiscard ( ) ; } }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { final com.google.gwt.user.client.ui.Widget sender = ( ( com.google.gwt.user.client.ui.Widget ) ( event.getSource ( ) ) ) ; if ( sender == ( edit ) ) { edit ( ) ; } else if ( sender == ( save ) ) { onSave ( com.google.gerrit.client.patches.CommentEditorPanel.NULL_CALLBACK ) ; } else if ( sender == ( cancel ) ) { render ( ) ; } else if ( sender == ( discard ) ) { onDiscard ( ) ; } }
Source:
public void delete ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { org.apache.lucene.index.Term id = idTerm ( cd ) ; if ( readOnly ) { return ; } if ( cd.getChange ( ) . getStatus ( ) . isOpen ( ) ) { openIndex.delete ( id ) ; } else { closedIndex.delete ( id ) ; } }

Target:
public com.google.common.util.concurrent.ListenableFuture < java.lang.Void > delete ( com.google.gerrit.server.query.change.ChangeData cd ) throws java.io.IOException { org.apache.lucene.index.Term id = idTerm ( cd ) ; if ( readOnly ) { return com.google.common.util.concurrent.Futures.immediateFuture ( null ) ; } return com.google.gerrit.lucene.LuceneChangeIndex.allOf ( openIndex.delete ( id ) , closedIndex.delete ( id ) ) ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; Util.ACCOUNT_SEC.myExternalIds ( new com.google.gerrit.client.rpc.ScreenLoadCallback < java.util.List < com.google.gerrit.reviewdb.client.AccountExternalId > > ( this ) { @ java.lang.Override public void preDisplay ( final java.util.List < com.google.gerrit.reviewdb.client.AccountExternalId > result ) { identites.display ( result ) ; } } ) ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; com.google.gerrit.client.account.AccountApi.getExternalIds ( new com.google.gerrit.client.rpc.GerritCallback < com.google.gwt.core.client.JsArray < com.google.gerrit.client.account.ExternalIdInfo > > ( ) { @ java.lang.Override public void onSuccess ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.account.ExternalIdInfo > results ) { identites.display ( results ) ; display ( ) ; } } ) ; }
Source:
public void parseSingleValue ( ) throws java.lang.Exception { java.lang.String in = "a.b=c" ; java.util.Map < java.lang.String , java.util.Map < java.lang.String , com.google.gerrit.extensions.api.projects.ProjectInput.ConfigValue > > r = cmd.parsePluginConfigValues ( java.util.Collections.singletonList ( in ) ) ; com.google.gerrit.extensions.api.projects.ProjectInput.ConfigValue configValue = r.get ( "a" ) . get ( "b" ) ; org.junit.Assert.assertEquals ( "c" , configValue.value ) ; org.junit.Assert.assertNull ( configValue.values ) ; }

Target:
public void parseSingleValue ( ) throws java.lang.Exception { java.lang.String in = "a.b=c" ; java.util.Map < java.lang.String , java.util.Map < java.lang.String , com.google.gerrit.extensions.api.projects.ProjectInput.ConfigValue > > r = cmd.parsePluginConfigValues ( java.util.Collections.singletonList ( in ) ) ; com.google.gerrit.extensions.api.projects.ProjectInput.ConfigValue configValue = r.get ( "a" ) . get ( "b" ) ; com.google.common.truth.Truth.assertThat ( configValue.value ) . isEqualTo ( "c" ) ; com.google.common.truth.Truth.assertThat ( configValue.values ) . isNull ( ) ; }
Source:
public void testGetJGroupsMyUrlFromListenUrlWhenWildcardConfigured ( ) throws java.lang.Exception { org.mockito.Mockito.when ( configMock.getEnum ( com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , null , com.ericsson.gerrit.plugins.highavailability.Configuration.STRATEGY_KEY , com.ericsson.gerrit.plugins.highavailability.Configuration.DEFAULT_PEER_INFO_STRATEGY ) ) . thenReturn ( Configuration.PeerInfoStrategy.JGROUPS ) ; initializeConfiguration ( ) ; org.mockito.Mockito.when ( serverConfigMock.getStringList ( "httpd" , null , "listenUrl" ) ) . thenReturn ( new java.lang.String [ ] { "https://*" } ) ; exception.expect ( com.ericsson.gerrit.plugins.highavailability.ProvisionException.class ) ; exception.expectMessage ( "when configured with wildcard" ) ; getMyUrlProvider ( ) ; }

Target:
public void testGetJGroupsMyUrlFromListenUrlWhenWildcardConfigured ( ) throws java.lang.Exception { org.mockito.Mockito.when ( configMock.getEnum ( com.ericsson.gerrit.plugins.highavailability.Configuration.PEER_INFO_SECTION , null , com.ericsson.gerrit.plugins.highavailability.Configuration.STRATEGY_KEY , com.ericsson.gerrit.plugins.highavailability.Configuration.DEFAULT_PEER_INFO_STRATEGY ) ) . thenReturn ( Configuration.PeerInfoStrategy.JGROUPS ) ; initializeConfiguration ( ) ; org.mockito.Mockito.when ( serverConfigMock.getStringList ( "httpd" , null , "listenUrl" ) ) . thenReturn ( new java.lang.String [ ] { "https://*" } ) ; exception.expect ( com.google.inject.ProvisionException.class ) ; exception.expectMessage ( "when configured with wildcard" ) ; getMyUrlProvider ( ) ; }
Source:
private boolean isMember ( com.google.gerrit.reviewdb.client.AccountGroup parent , com.google.gerrit.common.data.GroupDescription.Basic member ) throws com.google.gwtorm.server.OrmException { return ( dbProvider.get ( ) . accountGroupIncludesByUuid ( ) . get ( new com.google.gerrit.reviewdb.client.AccountGroupIncludeByUuid.Key ( parent.getId ( ) , member.getGroupUUID ( ) ) ) ) != null ; }

Target:
private boolean isMember ( com.google.gerrit.reviewdb.client.AccountGroup parent , com.google.gerrit.common.data.GroupDescription.Basic member ) throws com.google.gwtorm.server.OrmException { return ( dbProvider.get ( ) . accountGroupById ( ) . get ( new com.google.gerrit.reviewdb.client.AccountGroupById.Key ( parent.getId ( ) , member.getGroupUUID ( ) ) ) ) != null ; }
Source:
protected void run ( ) { if ( ( ( names ) != null ) && ( ! ( names.isEmpty ( ) ) ) ) { loader.disablePlugins ( com.google.common.collect.Sets.newHashSet ( names ) ) ; } }

Target:
protected void run ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure { if ( ! ( loader.isRemoteAdminEnabled ( ) ) ) { throw die ( "remote plugin administration is disabled" ) ; } if ( ( ( names ) != null ) && ( ! ( names.isEmpty ( ) ) ) ) { loader.disablePlugins ( com.google.common.collect.Sets.newHashSet ( names ) ) ; } }
Source:
public void byHashtagWithoutNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.enabled ( ) ) . isFalse ( ) ; setUpHashtagChanges ( ) ; assertQuery ( "hashtag:foo" ) ; assertQuery ( "hashtag:bar" ) ; assertQuery ( "hashtag:\" bar \"" ) ; assertQuery ( "hashtag:\"a tag\"" ) ; assertQuery ( "hashtag:\" a tag \"" ) ; assertQuery ( "hashtag:#foo" ) ; assertQuery ( "hashtag:\"# #foo\"" ) ; }

Target:
public void byHashtagWithoutNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; setUpHashtagChanges ( ) ; assertQuery ( "hashtag:foo" ) ; assertQuery ( "hashtag:bar" ) ; assertQuery ( "hashtag:\" bar \"" ) ; assertQuery ( "hashtag:\"a tag\"" ) ; assertQuery ( "hashtag:\" a tag \"" ) ; assertQuery ( "hashtag:#foo" ) ; assertQuery ( "hashtag:\"# #foo\"" ) ; }
Source:
public com.google.gerrit.server.git.gpg.PublicKeyStore get ( ) { final org.eclipse.jgit.lib.Repository repo ; try { repo = repoManager.openRepository ( allUsers ) ; } catch ( java.io.IOException e ) { throw new com.google.inject.ProvisionException ( ( "Cannot open " + ( allUsers ) ) , e ) ; } return new com.google.gerrit.server.git.gpg.PublicKeyStore ( repo ) { @ java.lang.Override public void close ( ) { try { super . close ( ) ; } finally { repo.close ( ) ; } } } ; }

Target:
public com.google.gerrit.gpg.PublicKeyStore get ( ) { final org.eclipse.jgit.lib.Repository repo ; try { repo = repoManager.openRepository ( allUsers ) ; } catch ( java.io.IOException e ) { throw new com.google.inject.ProvisionException ( ( "Cannot open " + ( allUsers ) ) , e ) ; } return new com.google.gerrit.gpg.PublicKeyStore ( repo ) { @ java.lang.Override public void close ( ) { try { super . close ( ) ; } finally { repo.close ( ) ; } } } ; }
Source:
protected com.google.gerrit.common.data.ProjectAccess updateProjectConfig ( com.google.gerrit.server.git.ProjectConfig config ) { }

Target:
protected com.google.gerrit.common.data.ProjectAccess updateProjectConfig ( com.google.gerrit.server.git.ProjectConfig config , com.google.gerrit.server.git.MetaDataUpdate md , boolean parentProjectUpdate ) throws com.google.gerrit.server.project.NoSuchProjectException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { org.eclipse.jgit.revwalk.RevCommit commit = config.commit ( md ) ; hooks.doRefUpdatedHook ( new com.google.gerrit.reviewdb.client.Branch.NameKey ( config.getProject ( ) . getNameKey ( ) , com.google.gerrit.reviewdb.client.RefNames.REFS_CONFIG ) , base , commit.getId ( ) , user.getAccount ( ) ) ; projectCache.evict ( config.getProject ( ) ) ; return projectAccessFactory.create ( projectName ) . call ( ) ; }
Source:
public void onSuccess ( final com.google.gerrit.common.data.ProjectDetail result ) { display ( result ) ; }

Target:
public void onSuccess ( com.google.gerrit.reviewdb.client.Change.Id changeId ) { enable ( true ) ; commitMessage.setText ( "" ) ; error.clear ( ) ; if ( changeId != null ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId ) ) ; } else { displayReadOnly ( access ) ; } }
Source:
private com.google.gerrit.server.git.strategy.SubmitStrategy createStrategy ( com.google.gerrit.server.git.MergeOp.OpenRepo or , com.google.gerrit.server.git.MergeTip mergeTip , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.extensions.client.SubmitType submitType , com.google.gerrit.server.git.CodeReviewCommit branchTip ) throws com.google.gerrit.server.git.IntegrationException { return submitStrategyFactory.create ( submitType , db , or.repo , or.rw , or.ins , or.canMergeFlag , getAlreadyAccepted ( or , branchTip ) , destBranch , caller , mergeTip , commits , submissionId ) ; }

Target:
private com.google.gerrit.server.git.strategy.SubmitStrategy createStrategy ( com.google.gerrit.server.git.MergeOp.OpenRepo or , com.google.gerrit.server.git.MergeTip mergeTip , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.extensions.client.SubmitType submitType , com.google.gerrit.server.git.CodeReviewCommit branchTip ) throws com.google.gerrit.server.git.IntegrationException { return submitStrategyFactory.create ( submitType , db , or.repo , or.rw , or.ins , or.canMergeFlag , getAlreadyAccepted ( or , branchTip ) , destBranch , caller , mergeTip , commits , submissionId , submitInput.notify ) ; }
Source:
private static com.google.gerrit.reviewdb.client.AccountPatchReview getExisting ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.change.FileResource resource ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.AccountPatchReview.Key key = new com.google.gerrit.reviewdb.client.AccountPatchReview.Key ( resource.getPatchKey ( ) , resource.getAccountId ( ) ) ; return db.accountPatchReviews ( ) . get ( key ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < ? > apply ( com.google.gerrit.server.change.FileResource resource , com.google.gerrit.server.change.Reviewed.Input input ) throws com.google.gwtorm.server.OrmException { accountPatchReviewStore.get ( ) . clearReviewed ( resource.getPatchKey ( ) . getParentKey ( ) , resource.getAccountId ( ) , resource.getPatchKey ( ) . getFileName ( ) ) ; return com.google.gerrit.extensions.restapi.Response.none ( ) ; }
Source:
public boolean isOAuthFinalForOthers ( javax.servlet.http.HttpServletRequest request ) { java.lang.String targetUrl = getTargetUrl ( request ) ; if ( targetUrl.equals ( request.getRequestURI ( ) ) ) { return false ; } return ( ( com.google.common.base.Strings.emptyToNull ( request.getParameter ( "code" ) ) ) != null ) && ( ! ( wasInitiatedByMe ( request ) ) ) ; }

Target:
public static boolean isOAuthFinalForOthers ( javax.servlet.http.HttpServletRequest request ) { java.lang.String targetUrl = com.googlesource.gerrit.plugins.github.oauth.OAuthProtocol.getTargetUrl ( request ) ; if ( targetUrl.equals ( request.getRequestURI ( ) ) ) { return false ; } return ( com.google.common.base.Strings.emptyToNull ( request.getParameter ( "code" ) ) ) != null ; }
Source:
public void onSuccess ( java.lang.Void result ) { java.lang.String b = ( ( base ) != null ) ? java.lang.String.valueOf ( base.get ( ) ) : null ; java.lang.String rev = java.lang.String.valueOf ( revision.get ( ) ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId , b , rev ) , new com.google.gerrit.client.change.ChangeScreen2 ( changeId , b , rev , openReplyBox ) ) ; }

Target:
public void onSuccess ( java.lang.Void result ) { goUpToChange ( openReplyBox ) ; }
Source:
private static java.lang.String format ( final java.net.SocketAddress remote ) { if ( remote instanceof java.net.InetSocketAddress ) { final java.net.InetSocketAddress sa = ( ( java.net.InetSocketAddress ) ( remote ) ) ; final java.net.InetAddress in = sa.getAddress ( ) ; if ( in != null ) { return in.getHostAddress ( ) ; } final java.lang.String hostName = sa.getHostName ( ) ; if ( hostName != null ) { return hostName ; } } return remote.toString ( ) ; }

Target:
private static java.lang.String id ( final int id ) { return com.google.gerrit.server.util.IdGenerator.format ( id ) ; }
Source:
public void uploadPackSubsetOfBranchesVisibleIncludingHead ( ) throws java.lang.Exception { allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/master" ) ; deny ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/branch" ) ; setApiUser ( user ) ; assertUploadPackRefs ( "HEAD" , ( ( r1 ) + "1" ) , ( ( r1 ) + "meta" ) , "refs/heads/master" , "refs/tags/master-tag" ) ; }

Target:
public void uploadPackSubsetOfBranchesVisibleNotIncludingHead ( ) throws java.lang.Exception { deny ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/master" ) ; allow ( Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/heads/branch" ) ; setApiUser ( user ) ; assertUploadPackRefs ( ( ( r2 ) + "1" ) , ( ( r2 ) + "meta" ) , ( ( r4 ) + "1" ) , ( ( r4 ) + "meta" ) , "refs/heads/branch" , "refs/tags/branch-tag" , "refs/tags/master-tag" ) ; }
Source:
private void parseApproval ( com.google.gerrit.reviewdb.client.PatchSet.Id psId , com.google.gerrit.reviewdb.client.Account.Id accountId , org.eclipse.jgit.revwalk.RevCommit commit , java.lang.String line ) throws org.eclipse.jgit.errors.ConfigInvalidException { if ( line.startsWith ( "-" ) ) { parseRemoveApproval ( psId , accountId , line ) ; } else { parseAddApproval ( psId , accountId , commit , line ) ; } }

Target:
private void parseApproval ( com.google.gerrit.reviewdb.client.PatchSet.Id psId , com.google.gerrit.reviewdb.client.Account.Id accountId , java.sql.Timestamp ts , java.lang.String line ) throws org.eclipse.jgit.errors.ConfigInvalidException { if ( line.startsWith ( "-" ) ) { parseRemoveApproval ( psId , accountId , line ) ; } else { parseAddApproval ( psId , accountId , ts , line ) ; } }
Source:
private void parseAssignee ( com.google.gerrit.server.notedb.ChangeNotesCommit commit ) throws org.eclipse.jgit.errors.ConfigInvalidException { if ( ( assignee ) != null ) { return ; } java.lang.String assigneeValue = parseOneFooter ( commit , com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_ASSIGNEE ) ; if ( assigneeValue != null ) { org.eclipse.jgit.lib.PersonIdent ident = org.eclipse.jgit.util.RawParseUtils.parsePersonIdent ( assigneeValue ) ; assignee = noteUtil.parseIdent ( ident , id ) ; } }

Target:
private void parseAssignee ( com.google.gerrit.server.notedb.ChangeNotesCommit commit ) throws org.eclipse.jgit.errors.ConfigInvalidException { if ( ( assignee ) != null ) { return ; } java.lang.String assigneeValue = parseOneFooter ( commit , com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_ASSIGNEE ) ; if ( assigneeValue == null ) { } else if ( assigneeValue.equals ( "" ) ) { assignee = com.google.common.base.Optional.absent ( ) ; } else { org.eclipse.jgit.lib.PersonIdent ident = org.eclipse.jgit.util.RawParseUtils.parsePersonIdent ( assigneeValue ) ; assignee = com.google.common.base.Optional.fromNullable ( noteUtil.parseIdent ( ident , id ) ) ; } }
Source:
private void enable ( final boolean on ) { showSiteHeader.setEnabled ( on ) ; useFlashClipboard.setEnabled ( on ) ; copySelfOnEmails.setEnabled ( on ) ; reversePatchSetOrder.setEnabled ( on ) ; showUsernameInReviewCategory.setEnabled ( on ) ; maximumPageSize.setEnabled ( on ) ; dateFormat.setEnabled ( on ) ; timeFormat.setEnabled ( on ) ; relativeDateInChangeTable.setEnabled ( on ) ; }

Target:
private void enable ( final boolean on ) { showSiteHeader.setEnabled ( on ) ; useFlashClipboard.setEnabled ( on ) ; copySelfOnEmails.setEnabled ( on ) ; reversePatchSetOrder.setEnabled ( on ) ; showUsernameInReviewCategory.setEnabled ( on ) ; maximumPageSize.setEnabled ( on ) ; dateFormat.setEnabled ( on ) ; timeFormat.setEnabled ( on ) ; relativeDateInChangeTable.setEnabled ( on ) ; commentVisibilityStrategy.setEnabled ( on ) ; }
Source:
public void unblockInParentBlockInLocal ( ) { com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.allow ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl d = user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertCannotUpdate ( "refs/heads/master" , d ) ; }

Target:
public void unblockInLocal_Fails ( ) { com.google.gerrit.server.project.testing.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , fixers , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl f = user ( local , fixers ) ; assertCannotUpdate ( "refs/heads/master" , f ) ; }
Source:
private com.googlesource.gerrit.plugins.its.jira.JiraClient client ( ) throws java.net.MalformedURLException { if ( ( client ) == null ) { log.debug ( "Connecting to jira at {}" , getUrl ( ) ) ; client = new com.googlesource.gerrit.plugins.its.jira.JiraClient ( getUrl ( ) , getUsername ( ) , getPassword ( ) ) ; log.debug ( "Authenticating as User {}" , getUsername ( ) ) ; } return client ; }

Target:
private com.googlesource.gerrit.plugins.its.jira.JiraClient client ( ) throws java.net.MalformedURLException { if ( ( client ) == null ) { log.debug ( "Connecting to jira at {}" , jiraConfig.getJiraUrl ( ) ) ; client = new com.googlesource.gerrit.plugins.its.jira.JiraClient ( jiraConfig.getJiraUrl ( ) , jiraConfig.getUsername ( ) , jiraConfig.getPassword ( ) ) ; log.debug ( "Authenticating as User {}" , jiraConfig.getUsername ( ) ) ; } return client ; }
Source:
private boolean submittable ( com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { java.util.List < com.google.gerrit.common.data.SubmitRecord > records = new com.google.gerrit.server.project.SubmitRuleEvaluator ( cd ) . setFastEvalLabels ( true ) . evaluate ( ) ; for ( com.google.gerrit.common.data.SubmitRecord sr : records ) { if ( ( sr.status ) == ( SubmitRecord.Status.OK ) ) { return true ; } } return false ; }

Target:
private boolean submittable ( com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { return com.google.gerrit.common.data.SubmitRecord.findOkRecord ( cd.submitRecords ( com.google.gerrit.server.change.ChangeJson.SUBMIT_RULE_OPTIONS_STRICT ) ) . isPresent ( ) ; }
Source:
public org.eclipse.jgit.lib.Repository openRepository ( java.lang.String name ) throws org.eclipse.jgit.errors.RepositoryNotFoundException { if ( isUnreasonableName ( name ) ) { throw new org.eclipse.jgit.errors.RepositoryNotFoundException ( ( "Invalid name: " + name ) ) ; } try { final org.eclipse.jgit.lib.RepositoryCache.FileKey loc = org.eclipse.jgit.lib.RepositoryCache.FileKey.lenient ( new java.io.File ( basePath , name ) ) ; return org.eclipse.jgit.lib.RepositoryCache.open ( loc ) ; } catch ( java.io.IOException e1 ) { final org.eclipse.jgit.errors.RepositoryNotFoundException e2 ; e2 = new org.eclipse.jgit.errors.RepositoryNotFoundException ( ( "Cannot open repository " + name ) ) ; e2.initCause ( e1 ) ; throw e2 ; } }

Target:
public org.eclipse.jgit.lib.Repository openRepository ( java.lang.String name ) throws org.eclipse.jgit.errors.RepositoryNotFoundException { if ( isUnreasonableName ( name ) ) { throw new org.eclipse.jgit.errors.RepositoryNotFoundException ( ( "Invalid name: " + name ) ) ; } try { final org.eclipse.jgit.lib.RepositoryCache.FileKey loc = org.eclipse.jgit.lib.RepositoryCache.FileKey.lenient ( new java.io.File ( basePath , name ) , FS.DETECTED ) ; return org.eclipse.jgit.lib.RepositoryCache.open ( loc ) ; } catch ( java.io.IOException e1 ) { final org.eclipse.jgit.errors.RepositoryNotFoundException e2 ; e2 = new org.eclipse.jgit.errors.RepositoryNotFoundException ( ( "Cannot open repository " + name ) ) ; e2.initCause ( e1 ) ; throw e2 ; } }
Source:
public com.google.gerrit.extensions.restapi.BinaryResult apply ( com.google.gerrit.server.change.ChangeResource rsrc ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editUtil.byChange ( rsrc.getChange ( ) ) ; if ( edit.isPresent ( ) ) { return com.google.gerrit.extensions.restapi.BinaryResult.create ( edit.get ( ) . getEditCommit ( ) . getFullMessage ( ) ) . base64 ( ) ; } throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; }

Target:
public com.google.gerrit.extensions.restapi.BinaryResult apply ( com.google.gerrit.server.change.ChangeResource rsrc ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.io.IOException { com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editUtil.byChange ( rsrc.getChange ( ) ) ; if ( edit.isPresent ( ) ) { java.lang.String msg = edit.get ( ) . getEditCommit ( ) . getFullMessage ( ) ; return com.google.gerrit.extensions.restapi.BinaryResult.create ( msg ) . setContentType ( FileContentUtil.TEXT_X_GERRIT_COMMIT_MESSAGE ) . base64 ( ) ; } throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ) ; }
Source:
private java.io.Writer newWriter ( javax.servlet.http.HttpServletResponse res ) throws java.io.IOException { return com.google.gitiles.BaseServlet.newWriter ( res.getOutputStream ( ) , res ) ; }

Target:
private java.io.Writer newWriter ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException { java.io.OutputStream out ; if ( com.google.gitiles.BaseServlet.acceptsGzipEncoding ( req ) ) { res.setHeader ( com.google.common.net.HttpHeaders.CONTENT_ENCODING , "gzip" ) ; out = new java.util.zip.GZIPOutputStream ( res.getOutputStream ( ) ) ; } else { out = res.getOutputStream ( ) ; } return com.google.gitiles.BaseServlet.newWriter ( out , res ) ; }
Source:
public void noConflictingChanges ( ) throws com.jcraft.jsch.JSchException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { org.eclipse.jgit.api.Git git = createProject ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result change = createChange ( git , true ) ; createChange ( git , false ) ; java.util.Set < java.lang.String > changes = queryConflictingChanges ( change ) ; org.junit.Assert.assertEquals ( 0 , changes.size ( ) ) ; }

Target:
public void conflictingChanges ( ) throws com.jcraft.jsch.JSchException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit.Result change = createChange ( git , true ) ; com.google.gerrit.acceptance.PushOneCommit.Result conflictingChange1 = createChange ( git , true ) ; com.google.gerrit.acceptance.PushOneCommit.Result conflictingChange2 = createChange ( git , true ) ; createChange ( git , false ) ; java.util.Set < java.lang.String > changes = queryConflictingChanges ( change ) ; assertChanges ( changes , conflictingChange1 , conflictingChange2 ) ; }
Source:
private void checkAccessAnnotations ( java.lang.Class < ? extends java.lang.Object > clazz ) throws com.google.gerrit.extensions.restapi.AuthException { com.google.gerrit.extensions.annotations.RequiresCapability rc = clazz.getAnnotation ( com.google.gerrit.extensions.annotations.RequiresCapability.class ) ; if ( rc != null ) { com.google.gerrit.server.CurrentUser user = globals.currentUser.get ( ) ; com.google.gerrit.server.account.CapabilityControl ctl = user.getCapabilities ( ) ; if ( ( ! ( ctl.canPerform ( rc.value ( ) ) ) ) && ( ! ( ctl.canAdministrateServer ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( java.lang.String.format ( "Capability %s is required to access this resource" , rc.value ( ) ) ) ; } } }

Target:
private static boolean isStateChange ( javax.servlet.http.HttpServletRequest req ) { return ! ( com.google.gerrit.httpd.restapi.RestApiServlet.isGetOrHead ( req ) ) ; }
Source:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( sysInjector.getInstance ( com.google.gerrit.sshd.SshModule.class ) ) ; if ( ! ( test ) ) { modules.add ( new com.google.gerrit.sshd.SshHostKeyModule ( ) ) ; } if ( slave ) { modules.add ( new com.google.gerrit.sshd.commands.SlaveCommandModule ( ) ) ; } else { modules.add ( new com.google.gerrit.sshd.commands.MasterCommandModule ( ) ) ; } return sysInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( sysInjector.getInstance ( com.google.gerrit.sshd.SshModule.class ) ) ; if ( ! ( test ) ) { modules.add ( new com.google.gerrit.sshd.SshHostKeyModule ( ) ) ; } modules.add ( new com.google.gerrit.sshd.commands.DefaultCommandModule ( slave ) ) ; return sysInjector.createChildInjector ( modules ) ; }
Source:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.exceptions.PrologException { engine.cont = cont ; engine.setB0 ( ) ; com.vmware.gerrit.owners.common.PathOwners owners = OwnersStoredValues.PATH_OWNERS.get ( engine ) ; engine.r1 = arg1 ; engine.r2 = new com.googlecode.prolog_cafe.lang.JavaObjectTerm ( owners.getMatches ( ) . values ( ) . iterator ( ) ) ; return engine.jtry2 ( gerrit_owners.PRED_matcher_path_1.OWNER_PATH_CHECK , gerrit_owners.PRED_matcher_path_1.OWNER_PATH_NEXT ) ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.exceptions.PrologException { engine.cont = cont ; engine.setB0 ( ) ; com.vmware.gerrit.owners.common.PathOwners owners = OwnersStoredValues.PATH_OWNERS.get ( engine ) ; engine.r1 = arg1 ; engine.r2 = new com.googlecode.prolog_cafe.lang.JavaObjectTerm ( owners.getFileOwners ( ) . keySet ( ) . iterator ( ) ) ; return engine.jtry2 ( gerrit_owners.PRED_matcher_path_1.OWNER_PATH_CHECK , gerrit_owners.PRED_matcher_path_1.OWNER_PATH_NEXT ) ; }
Source:
protected void configureCommands ( ) { command ( "delete" ) . to ( com.google.gerrit.plugins.DeleteCommand.class ) ; }

Target:
protected void configureCommands ( ) { int schemaVersion = com.google.gerrit.server.schema.SchemaVersion.guessVersion ( SchemaVersion.C ) ; java.lang.Class < ? extends com.google.gerrit.plugins.database.DatabaseDeleteHandler > databaseDeleteHandlerClass = null ; switch ( schemaVersion ) { case 73 : databaseDeleteHandlerClass = com.google.gerrit.plugins.database.Schema73DatabaseDeleteHandler.class ; break ; default : throw new java.lang.RuntimeException ( ( ( ( "This version of the delete-project plugin is not " + "compatible with your current schema version (Version: " ) + schemaVersion ) + "). Please update the plugin." ) ) ; } assert databaseDeleteHandlerClass != null : "No database handler set" ; bind ( com.google.gerrit.plugins.database.DatabaseDeleteHandler.class ) . to ( databaseDeleteHandlerClass ) ; command ( "delete" ) . to ( com.google.gerrit.plugins.DeleteCommand.class ) ; }
Source:
public java.lang.Iterable < com.google.gerrit.reviewdb.client.AccountGroup > all ( ) { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { return java.util.Collections.unmodifiableList ( db.accountGroups ( ) . all ( ) . toList ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.account.GroupCacheImpl.log.warn ( "Cannot list internal groups" , e ) ; return java.util.Collections.emptyList ( ) ; } }

Target:
public com.google.common.collect.ImmutableList < com.google.gerrit.reviewdb.client.AccountGroup > all ( ) { try ( com.google.gerrit.reviewdb.server.ReviewDb db = schema.open ( ) ) { return com.google.common.collect.ImmutableList.copyOf ( db.accountGroups ( ) . all ( ) ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.google.gerrit.server.account.GroupCacheImpl.log.warn ( "Cannot list internal groups" , e ) ; return com.google.common.collect.ImmutableList.of ( ) ; } }