auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testIsEnabledEventMultiBranchRegExp ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/foo.*" , "^refs/heads/test.*" } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.PatchSetCreatedEvent event = new com.google.gerrit.server.events.PatchSetCreatedEvent ( ) ; event.change = new com.google.gerrit.server.data.ChangeAttribute ( ) ; event.change.project = "testProject" ; event.change.branch = "testBranch" ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( event ) ) ; }

Target:
public void testIsEnabledEventSingleBranchNonMatchingRegExp ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/foo.*" } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.PatchSetCreatedEvent event = new com.google.gerrit.server.events.PatchSetCreatedEvent ( ) ; com.google.gerrit.server.data.ChangeAttribute changeAttribute = new com.google.gerrit.server.data.ChangeAttribute ( ) ; changeAttribute.project = "testProject" ; changeAttribute.branch = "testBranch" ; event.change = com.google.common.base.Suppliers.ofInstance ( changeAttribute ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertFalse ( itsConfig.isEnabled ( event ) ) ; }
Source:
private java.util.Map < java.lang.Integer , com.google.gerrit.pgm.backup.BackupAccess < ? , ? > > index ( com.google.gerrit.reviewdb.ReviewDb dst ) { java.util.Map < java.lang.Integer , com.google.gerrit.pgm.backup.BackupAccess < ? , ? > > relations = new java.util.HashMap < java.lang.Integer , com.google.gerrit.pgm.backup.BackupAccess < ? , ? > > ( ) ; for ( com.google.gwtorm.client.Access < ? , ? > a : dst.allRelations ( ) ) { relations.put ( a.getRelationID ( ) , ( ( com.google.gerrit.pgm.backup.BackupAccess ) ( a ) ) ) ; } return relations ; }

Target:
private java.util.Map < java.lang.Integer , com.google.gerrit.server.schema.backup.BackupAccess < ? , ? > > index ( com.google.gerrit.reviewdb.ReviewDb dst ) { java.util.Map < java.lang.Integer , com.google.gerrit.server.schema.backup.BackupAccess < ? , ? > > relations = new java.util.HashMap < java.lang.Integer , com.google.gerrit.server.schema.backup.BackupAccess < ? , ? > > ( ) ; for ( com.google.gwtorm.client.Access < ? , ? > a : dst.allRelations ( ) ) { relations.put ( a.getRelationID ( ) , ( ( com.google.gerrit.server.schema.backup.BackupAccess ) ( a ) ) ) ; } return relations ; }
Source:
public void onFailure ( java.lang.Throwable caught ) { loadSubmitType ( status , canSubmit ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.rpc.NativeString result ) { if ( com.google.gerrit.client.Gerrit.getConfig ( ) . testChangeMerge ( ) ) { if ( canSubmit ) { actions.setSubmitEnabled ( changeInfo.mergeable ( ) ) ; if ( status == ( com.google.gerrit.reviewdb.client.Change.Status.NEW ) ) { statusText.setInnerText ( ( changeInfo.mergeable ( ) ? Util.C.readyToSubmit ( ) : Util.C.mergeConflict ( ) ) ) ; } } setVisible ( notMergeable , ( ! ( changeInfo.mergeable ( ) ) ) ) ; } renderSubmitType ( result.asString ( ) ) ; }
Source:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > changeDrafts ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByChangeAuthor ( ctx.getDb ( ) , ctx.getNotes ( ) , user.getAccountId ( ) ) ) { c.setTag ( in.tag ) ; drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }

Target:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > changeDrafts ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = new java.util.HashMap < > ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByChangeAuthor ( ctx.getDb ( ) , ctx.getNotes ( ) , user.getAccountId ( ) ) ) { c.setTag ( in.tag ) ; drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }
Source:
private static void recursiveDelete ( java.io.File path ) { java.io.File [ ] entries = path.listFiles ( ) ; if ( entries != null ) { for ( java.io.File e : entries ) { com.google.gerrit.pgm.init.BaseInit.recursiveDelete ( e ) ; } } if ( ( ! ( path.delete ( ) ) ) && ( path.exists ( ) ) ) { java.lang.System.err.println ( ( "warn: Cannot remove " + path ) ) ; } }

Target:
public java.nio.file.FileVisitResult postVisitDirectory ( java.nio.file.Path dir , java.io.IOException err ) { try { java.nio.file.Files.delete ( dir ) ; } catch ( java.io.IOException e ) { java.lang.System.err.println ( ( msg + dir ) ) ; } return java.nio.file.FileVisitResult.CONTINUE ; }
Source:
private java.util.List < com.google.gerrit.server.query.Predicate < T > > children ( org.antlr.runtime.tree.Tree r ) throws com.google.gerrit.index.query.QueryParseException , java.lang.IllegalArgumentException { java.util.List < com.google.gerrit.server.query.Predicate < T > > p = new java.util.ArrayList ( r.getChildCount ( ) ) ; for ( int i = 0 ; i < ( r.getChildCount ( ) ) ; i ++ ) { p.add ( toPredicate ( r.getChild ( i ) ) ) ; } return p ; }

Target:
private java.util.List < com.google.gerrit.index.query.Predicate < T > > children ( org.antlr.runtime.tree.Tree r ) throws com.google.gerrit.index.query.QueryParseException , java.lang.IllegalArgumentException { java.util.List < com.google.gerrit.index.query.Predicate < T > > p = new java.util.ArrayList ( r.getChildCount ( ) ) ; for ( int i = 0 ; i < ( r.getChildCount ( ) ) ; i ++ ) { p.add ( toPredicate ( r.getChild ( i ) ) ) ; } return p ; }
Source:
void display ( final java.util.List < com.google.gerrit.reviewdb.AccountSshKey > result ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.reviewdb.AccountSshKey k : result ) { addOneKey ( k ) ; } }

Target:
void display ( final java.util.List < com.google.gerrit.reviewdb.AccountSshKey > result ) { if ( result.isEmpty ( ) ) { setKeyTableVisible ( false ) ; showAddKeyBlock ( true ) ; } else { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.reviewdb.AccountSshKey k : result ) { addOneKey ( k ) ; } setKeyTableVisible ( true ) ; deleteKey.setEnabled ( false ) ; } }
Source:
com.google.gerrit.client.changes.CommentInfo createReply ( com.google.gerrit.client.changes.CommentInfo replyTo ) { if ( ( ! ( replyTo.has_line ( ) ) ) && ( ( replyTo.range ( ) ) == null ) ) { return com.google.gerrit.client.changes.CommentInfo.createFile ( path , replyTo.side ( ) , replyTo.id ( ) , null ) ; } else { return com.google.gerrit.client.changes.CommentInfo.createRange ( path , replyTo.side ( ) , replyTo.line ( ) , replyTo.id ( ) , null , replyTo.range ( ) ) ; } }

Target:
void setThemeStyles ( boolean d ) { if ( d ) { diffTable.addStyleName ( DiffTable.style.dark ( ) ) ; } else { diffTable.removeStyleName ( DiffTable.style.dark ( ) ) ; } }
Source:
public void setFrom ( final com.google.gerrit.reviewdb.client.Account.Id id ) { super . setFrom ( id ) ; final com.google.gerrit.server.IdentifiedUser user = args.identifiedUserFactory.create ( id ) ; final java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > gids = user.getEffectiveGroups ( ) ; for ( final com.google.gerrit.reviewdb.client.AccountGroup.UUID gid : gids ) { com.google.gerrit.reviewdb.client.AccountGroup group = args.groupCache.get ( gid ) ; if ( ( group != null ) && ( group.isEmailOnlyAuthors ( ) ) ) { emailOnlyAuthors = true ; break ; } } }

Target:
public void setFrom ( final com.google.gerrit.reviewdb.client.Account.Id id ) { super . setFrom ( id ) ; final com.google.gerrit.server.IdentifiedUser user = args.identifiedUserFactory.create ( id ) ; final java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > gids = user.getEffectiveGroups ( ) . getKnownGroups ( ) ; for ( final com.google.gerrit.reviewdb.client.AccountGroup.UUID gid : gids ) { com.google.gerrit.reviewdb.client.AccountGroup group = args.groupCache.get ( gid ) ; if ( ( group != null ) && ( group.isEmailOnlyAuthors ( ) ) ) { emailOnlyAuthors = true ; break ; } } }
Source:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < > ( ) ; modules.add ( sysInjector.getInstance ( com.google.gerrit.sshd.SshModule.class ) ) ; modules.add ( new com.google.gerrit.sshd.SshHostKeyModule ( ) ) ; modules.add ( new com.google.gerrit.sshd.commands.DefaultCommandModule ( false , sysInjector.getInstance ( com.google.gerrit.server.config.DownloadConfig.class ) ) ) ; if ( ( indexType ) == ( com.google.gerrit.server.index.IndexModule.IndexType.LUCENE ) ) { modules.add ( new com.google.gerrit.sshd.commands.IndexCommandsModule ( ) ) ; } return sysInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createSshInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < > ( ) ; modules.add ( sysInjector.getInstance ( com.google.gerrit.sshd.SshModule.class ) ) ; modules.add ( new com.google.gerrit.sshd.SshHostKeyModule ( ) ) ; modules.add ( new com.google.gerrit.sshd.commands.DefaultCommandModule ( false , sysInjector.getInstance ( com.google.gerrit.server.config.DownloadConfig.class ) , sysInjector.getInstance ( com.google.inject.Module.class ) ) ) ; if ( ( indexType ) == ( com.google.gerrit.server.index.IndexModule.IndexType.LUCENE ) ) { modules.add ( new com.google.gerrit.sshd.commands.IndexCommandsModule ( ) ) ; } return sysInjector.createChildInjector ( modules ) ; }
Source:
private com.google.gerrit.server.query.change.ChangeData changeData ( ) { if ( ( cd ) == null ) { com.google.gerrit.reviewdb.server.ReviewDb reviewDb = db ( ) ; com.google.common.base.Preconditions.checkState ( ( reviewDb != null ) , "need ReviewDb" ) ; cd = changeDataFactory.create ( reviewDb , this ) ; } return cd ; }

Target:
private com.google.gerrit.server.query.change.ChangeData changeData ( ) { if ( ( cd ) == null ) { com.google.gerrit.reviewdb.server.ReviewDb reviewDb = db ( ) ; com.google.common.base.Preconditions.checkState ( ( reviewDb != null ) , "need ReviewDb" ) ; cd = changeDataFactory.create ( reviewDb , getNotes ( ) ) ; } return cd ; }
Source:
private void addIncludedGroups ( com.google.gerrit.server.group.GroupResource rsrc ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.group.AddIncludedGroups.Input input = AddIncludedGroups.Input.fromGroups ( com.google.common.collect.FluentIterable.from ( initialGroups ) . transform ( new com.google.common.base.Function < com.google.gerrit.reviewdb.client.AccountGroup.UUID , java.lang.String > ( ) { @ java.lang.Override public java.lang.String apply ( com.google.gerrit.reviewdb.client.AccountGroup.UUID id ) { return id.get ( ) ; } } ) . toList ( ) ) ; addIncludedGroups.apply ( rsrc , input ) ; }

Target:
private void addIncludedGroups ( com.google.gerrit.server.group.GroupResource rsrc ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.group.AddIncludedGroups.Input input = AddIncludedGroups.Input.fromGroups ( initialGroups.stream ( ) . map ( com.google.gerrit.reviewdb.client.AccountGroup.UUID :: get ) . collect ( java.util.stream.Collectors.toList ( ) ) ) ; addIncludedGroups.apply ( rsrc , input ) ; }
Source:
private void refresh ( ) { com.google.gerrit.client.groups.GroupMap.match ( subname , new com.google.gerrit.client.ui.IgnoreOutdatedFilterResultsCallbackWrapper < com.google.gerrit.client.groups.GroupMap > ( this , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.groups.GroupMap > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gerrit.client.groups.GroupMap result ) { groups.display ( result , subname ) ; groups.finishDisplay ( ) ; } } ) ) ; }

Target:
private void refresh ( ) { setToken ( ( ( ( subname ) == null ) || ( "" . equals ( subname ) ) ? com.google.gerrit.common.PageLinks.ADMIN_GROUPS : ( ( com.google.gerrit.common.PageLinks.ADMIN_GROUPS ) + "?filter=" ) + ( com.google.gwt.http.client.URL.encodeQueryString ( subname ) ) ) ) ; com.google.gerrit.client.groups.GroupMap.match ( subname , new com.google.gerrit.client.ui.IgnoreOutdatedFilterResultsCallbackWrapper < com.google.gerrit.client.groups.GroupMap > ( this , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.groups.GroupMap > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gerrit.client.groups.GroupMap result ) { groups.display ( result , subname ) ; groups.finishDisplay ( ) ; } } ) ) ; }
Source:
private static void deleteLocally ( org.eclipse.jgit.transport.URIish uri ) { try { com.googlesource.gerrit.plugins.replication.ReplicationQueue.recursivelyDelete ( new java.io.File ( uri.getPath ( ) ) ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.error ( java.lang.String.format ( "Error deleting local repository %s:\n" , uri.getPath ( ) ) , e ) ; } }

Target:
private static void deleteLocally ( org.eclipse.jgit.transport.URIish uri ) { try { com.googlesource.gerrit.plugins.replication.ReplicationQueue.recursivelyDelete ( new java.io.File ( uri.getPath ( ) ) ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.error ( "Error deleting local repository {}:\n" , uri.getPath ( ) , e ) ; } }
Source:
public com.google.gerrit.reviewdb.client.PatchLineComment apply ( com.google.gerrit.server.notedb.RevisionNoteData.Comment c ) { com.google.gerrit.reviewdb.client.PatchLineComment plc = c.export ( ) ; plc.setStatus ( status ) ; return plc ; }

Target:
com.google.gerrit.reviewdb.client.PatchLineComment export ( com.google.gerrit.reviewdb.client.PatchLineComment.Status status ) { com.google.gerrit.reviewdb.client.PatchLineComment plc = new com.google.gerrit.reviewdb.client.PatchLineComment ( key.export ( ) , lineNbr , author.export ( ) , parentUuid , writtenOn ) ; plc.setSide ( side ) ; plc.setMessage ( message ) ; if ( ( range ) != null ) { plc.setRange ( range.export ( ) ) ; } plc.setTag ( tag ) ; plc.setRevId ( new com.google.gerrit.reviewdb.client.RevId ( revId ) ) ; plc.setStatus ( status ) ; return plc ; }
Source:
public void createEmptyEditRest ( ) throws java.lang.Exception { adminSession.post ( urlEdit ( ) ) . assertNoContent ( ) ; com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editUtil.byChange ( change ) ; com.google.gerrit.acceptance.edit.ChangeEditIT.assertByteArray ( fileUtil.getContent ( projectCache.get ( edit.get ( ) . getChange ( ) . getProject ( ) ) , org.eclipse.jgit.lib.ObjectId.fromString ( edit.get ( ) . getRevision ( ) . get ( ) ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME ) , com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_OLD ) ; }

Target:
public void createEmptyEditRest ( ) throws java.lang.Exception { adminRestSession.post ( urlEdit ( ) ) . assertNoContent ( ) ; com.google.common.base.Optional < com.google.gerrit.server.edit.ChangeEdit > edit = editUtil.byChange ( change ) ; com.google.gerrit.acceptance.edit.ChangeEditIT.assertByteArray ( fileUtil.getContent ( projectCache.get ( edit.get ( ) . getChange ( ) . getProject ( ) ) , org.eclipse.jgit.lib.ObjectId.fromString ( edit.get ( ) . getRevision ( ) . get ( ) ) , com.google.gerrit.acceptance.edit.ChangeEditIT.FILE_NAME ) , com.google.gerrit.acceptance.edit.ChangeEditIT.CONTENT_OLD ) ; }
Source:
public void onSuccess ( com.googlesource.gerrit.plugins.serviceuser.client.CreateServiceUserScreen.MessagesInfo info ) { onSuccessMessage = info.getOnSuccessMessage ( ) ; java.lang.String infoMessage = info.getInfoMessage ( ) ; if ( ( infoMessage != null ) && ( ! ( "" . equals ( infoMessage ) ) ) ) { insert ( new com.google.gwt.user.client.ui.HTML ( infoMessage ) , 0 ) ; } }

Target:
public void onSuccess ( com.googlesource.gerrit.plugins.serviceuser.client.MessagesInfo info ) { onSuccessMessage = info.getOnSuccessMessage ( ) ; java.lang.String infoMessage = info.getInfoMessage ( ) ; if ( ( infoMessage != null ) && ( ! ( "" . equals ( infoMessage ) ) ) ) { insert ( new com.google.gwt.user.client.ui.HTML ( infoMessage ) , 0 ) ; } }
Source:
public void indexerThrowsNoSuchChangeExceptionTryingToPostChange ( ) throws java.lang.Exception { org.mockito.Mockito.doThrow ( new com.google.gerrit.server.project.NoSuchChangeException ( id ) ) . when ( schemaFactory ) . open ( ) ; indexRestApiServlet.doPost ( req , rsp ) ; org.mockito.Mockito.verify ( rsp ) . setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; }

Target:
public void indexerThrowsNoSuchChangeExceptionTryingToPostChange ( ) throws java.lang.Exception { org.mockito.Mockito.doThrow ( new com.google.gerrit.server.project.NoSuchChangeException ( id ) ) . when ( schemaFactory ) . open ( ) ; indexRestApiServlet.doPost ( req , rsp ) ; org.mockito.Mockito.verify ( indexer , org.mockito.Mockito.times ( 1 ) ) . delete ( id ) ; org.mockito.Mockito.verify ( rsp ) . setStatus ( javax.servlet.http.HttpServletResponse.SC_NO_CONTENT ) ; }
Source:
protected < K extends java.io.Serializable , V extends java.io.Serializable > com.google.gerrit.server.cache.UnnamedCacheBinding < K , V > disk ( final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < K , V > > type ) { return disk ( com.google.inject.Key.get ( type ) , type ) ; }

Target:
protected < K extends java.io.Serializable , V extends java.io.Serializable > com.google.gerrit.server.cache.NamedCacheBinding < K , V > disk ( final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < K , V > > type , final java.lang.String name ) { return disk ( com.google.inject.Key.get ( type , com.google.inject.name.Names.named ( name ) ) , type ) . name ( name ) ; }
Source:
void onCancel ( com.google.gwt.event.dom.client.ClickEvent e ) { e.stopPropagation ( ) ; if ( ( ( comment.id ( ) ) == null ) && ( ( editArea.getValue ( ) . length ( ) ) == 0 ) ) { removeUI ( ) ; } else { setEdit ( false ) ; cm.focus ( ) ; } }

Target:
void onCancel ( com.google.gwt.event.dom.client.ClickEvent e ) { e.stopPropagation ( ) ; if ( ( isNew ( ) ) && ( ! ( isDirty ( ) ) ) ) { removeUI ( ) ; } else { setEdit ( false ) ; cm.focus ( ) ; } }
Source:
protected void configure ( ) { sitePath = randomTargetFile ( ) ; assertFalse ( ( ( "sitePath already (" + ( sitePath ) ) + ") already exists" ) , sitePath.exists ( ) ) ; cleanupSitePath = true ; bind ( java.io.File.class ) . annotatedWith ( com.google.gerrit.server.config.SitePath.class ) . toInstance ( sitePath ) ; its = createMock ( com.googlesource.gerrit.plugins.hooks.its.ItsFacade.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.its.ItsFacade.class ) . toInstance ( its ) ; velocityRuntime = createMock ( org.apache.velocity.runtime.RuntimeInstance.class ) ; bind ( org.apache.velocity.runtime.RuntimeInstance.class ) . toInstance ( velocityRuntime ) ; }

Target:
protected void configure ( ) { sitePath = randomTargetPath ( ) ; assertFalse ( ( ( "sitePath already (" + ( sitePath ) ) + ") already exists" ) , java.nio.file.Files.exists ( sitePath ) ) ; cleanupSitePath = true ; bind ( java.nio.file.Path.class ) . annotatedWith ( com.google.gerrit.server.config.SitePath.class ) . toInstance ( sitePath ) ; its = createMock ( com.googlesource.gerrit.plugins.hooks.its.ItsFacade.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.its.ItsFacade.class ) . toInstance ( its ) ; velocityRuntime = createMock ( org.apache.velocity.runtime.RuntimeInstance.class ) ; bind ( org.apache.velocity.runtime.RuntimeInstance.class ) . toInstance ( velocityRuntime ) ; }
Source:
public com.google.gerrit.extensions.registration.DynamicItem < T > . ReloadableHandle replace ( com.google.inject.Key < T > newKey , com.google.inject.Provider < T > newItem ) { com.google.gerrit.extensions.registration.DynamicItem.NamedProvider < T > n = new com.google.gerrit.extensions.registration.DynamicItem.NamedProvider < T > ( newItem , item.pluginName ) ; if ( ref.compareAndSet ( item , n ) ) { return new ReloadableHandle ( newKey , n ) ; } return null ; }

Target:
public com.google.gerrit.extensions.registration.DynamicItem < T > . ReloadableHandle replace ( com.google.inject.Key < T > newKey , com.google.inject.Provider < T > newItem ) { com.google.gerrit.extensions.registration.DynamicItem.NamedProvider < T > n = new com.google.gerrit.extensions.registration.DynamicItem.NamedProvider < T > ( newItem , item.pluginName ) ; if ( ref.compareAndSet ( item , n ) ) { return new ReloadableHandle ( newKey , n , defaultItem ) ; } return null ; }
Source:
public void eventTypesNotSpecifiedAllEventsPosted ( ) { config.setString ( com.googlesource.gerrit.plugins.webhooks.EventHandlerTest.REMOTE , com.googlesource.gerrit.plugins.webhooks.EventHandlerTest.FOO , com.googlesource.gerrit.plugins.webhooks.EventHandlerTest.URL , com.googlesource.gerrit.plugins.webhooks.EventHandlerTest.FOO_URL ) ; eventHandler.onEvent ( com.googlesource.gerrit.plugins.webhooks.EventHandlerTest.PROJECT_CREATED ) ; eventHandler.onEvent ( com.googlesource.gerrit.plugins.webhooks.EventHandlerTest.REF_UPDATED ) ; org.mockito.Mockito.verify ( postTask , org.mockito.Mockito.times ( 2 ) ) . schedule ( ) ; }

Target:
public void remoteUrlUndefinedTaskNotScheduled ( ) { org.mockito.Mockito.when ( config.getSubsections ( org.mockito.ArgumentMatchers.eq ( com.googlesource.gerrit.plugins.webhooks.EventHandlerTest.REMOTE ) ) ) . thenReturn ( com.google.common.collect.ImmutableSet.of ( com.googlesource.gerrit.plugins.webhooks.EventHandlerTest.FOO ) ) ; eventHandler.onEvent ( projectCreated ) ; org.mockito.Mockito.verifyZeroInteractions ( taskFactory ) ; org.mockito.Mockito.verifyZeroInteractions ( postTask ) ; }
Source:
public void noMessages ( ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createChange ( ) ; com.google.gerrit.acceptance.rest.change.ChangeInfo c = getChangeWithMessages ( changeId ) ; org.junit.Assert.assertNotNull ( c.messages ) ; org.junit.Assert.assertTrue ( c.messages.isEmpty ( ) ) ; }

Target:
public void defaultMessage ( ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { java.lang.String changeId = createChange ( ) ; com.google.gerrit.acceptance.rest.change.ChangeInfo c = getChangeWithMessages ( changeId ) ; org.junit.Assert.assertNotNull ( c.messages ) ; org.junit.Assert.assertEquals ( 1 , c.messages.size ( ) ) ; org.junit.Assert.assertEquals ( "Uploaded patch set 1." , c.messages.get ( 0 ) . message ) ; }
Source:
public static void detail ( int id , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.ChangeInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.detail ( id ) . get ( cb ) ; }

Target:
public static void revert ( @ com.google.gerrit.common.Nullable java.lang.String project , int id , java.lang.String msg , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.info.ChangeInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.MessageInput input = com.google.gerrit.client.changes.ChangeApi.MessageInput.create ( ) ; input.message ( com.google.gerrit.client.changes.ChangeApi.emptyToNull ( msg ) ) ; com.google.gerrit.client.changes.ChangeApi.call ( project , id , "revert" ) . post ( input , cb ) ; }
Source:
public void testItsAssociationPolicyMandatoryWCommentLink ( ) { com.googlesource.gerrit.plugins.hooks.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "ItsTestName" , null , "commentlink" ) ) . andReturn ( "foo" ) . atLeastOnce ( ) ; org.easymock.EasyMock.expect ( serverConfig.getEnum ( "commentlink" , "foo" , "association" , ItsAssociationPolicy.OPTIONAL ) ) . andReturn ( ItsAssociationPolicy.MANDATORY ) . atLeastOnce ( ) ; replayMocks ( ) ; assertEquals ( "Expected and generated associated policy do not match" , ItsAssociationPolicy.MANDATORY , itsConfig.getItsAssociationPolicy ( ) ) ; }

Target:
public void testGetItsAssociationPolicyMandatoryWCommentLink ( ) { com.googlesource.gerrit.plugins.hooks.its.ItsConfig itsConfig = createItsConfig ( ) ; org.easymock.EasyMock.expect ( serverConfig.getString ( "ItsTestName" , null , "commentlink" ) ) . andReturn ( "foo" ) . atLeastOnce ( ) ; org.easymock.EasyMock.expect ( serverConfig.getEnum ( "commentlink" , "foo" , "association" , ItsAssociationPolicy.OPTIONAL ) ) . andReturn ( ItsAssociationPolicy.MANDATORY ) . atLeastOnce ( ) ; replayMocks ( ) ; assertEquals ( "Expected and generated associated policy do not match" , ItsAssociationPolicy.MANDATORY , itsConfig.getItsAssociationPolicy ( ) ) ; }
Source:
private void installCommand ( final com.google.gerrit.reviewdb.client.Project.NameKey p , java.lang.String name , final java.lang.String command ) { com.googlesource.gerrit.plugins.download.command.project.ProjectDownloadCommand dc = projectDownloadCommands.get ( name ) ; if ( dc != null ) { dc.add ( p , command ) ; } else { dc = new com.googlesource.gerrit.plugins.download.command.project.ProjectDownloadCommand ( p , command ) ; projectDownloadCommands.put ( name , dc ) ; registrationHandles.put ( name , map ( ) . put ( pluginName , name.replaceAll ( "-" , " " ) , provider ( dc ) ) ) ; } }

Target:
private void installCommand ( final com.google.gerrit.reviewdb.client.Project.NameKey p , java.lang.String name , final java.lang.String command ) { com.googlesource.gerrit.plugins.download.command.project.ProjectDownloadCommand dc = projectDownloadCommands.get ( name ) ; if ( dc != null ) { dc.add ( p , command ) ; } else { dc = new com.googlesource.gerrit.plugins.download.command.project.ProjectDownloadCommand ( projectCache , p , command ) ; projectDownloadCommands.put ( name , dc ) ; registrationHandles.put ( name , map ( ) . put ( pluginName , name.replaceAll ( "-" , " " ) , provider ( dc ) ) ) ; } }
Source:
public boolean isVisible ( com.google.gerrit.reviewdb.server.ReviewDb db , @ com.google.gerrit.common.Nullable com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { if ( ( ( getChange ( ) . getStatus ( ) ) == ( Change.Status.DRAFT ) ) && ( ! ( isDraftVisible ( db , cd ) ) ) ) { return false ; } return isRefVisible ( ) ; }

Target:
public boolean isVisible ( com.google.gerrit.reviewdb.server.ReviewDb db , @ com.google.gerrit.common.Nullable com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gwtorm.server.OrmException { if ( ( getChange ( ) . isPrivate ( ) ) && ( ! ( isPrivateVisible ( db , cd ) ) ) ) { return false ; } if ( ( ( getChange ( ) . getStatus ( ) ) == ( Change.Status.DRAFT ) ) && ( ! ( isDraftVisible ( db , cd ) ) ) ) { return false ; } return getRefControl ( ) . isVisible ( ) ; }
Source:
public com.google.common.collect.ImmutableList < com.google.gerrit.reviewdb.client.PatchSet > byChange ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeNotes notes ) throws com.google.gwtorm.server.OrmException { return ChangeUtil.PS_ID_ORDER.immutableSortedCopy ( db.patchSets ( ) . byChange ( notes.getChangeId ( ) ) ) ; }

Target:
public com.google.common.collect.ImmutableCollection < com.google.gerrit.reviewdb.client.PatchSet > byChange ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeNotes notes ) throws com.google.gwtorm.server.OrmException { if ( ! ( migration.readChanges ( ) ) ) { return ChangeUtil.PS_ID_ORDER.immutableSortedCopy ( db.patchSets ( ) . byChange ( notes.getChangeId ( ) ) ) ; } return notes.load ( ) . getPatchSets ( ) . values ( ) ; }
Source:
public void testAddSingleHashtag ( ) throws java.lang.Exception { java.lang.String changeId = createChange ( ) . getChangeId ( ) ; java.util.List < java.lang.String > expected = java.util.Arrays.asList ( "tag2" ) ; assertResult ( POST ( changeId , "tag2" , null ) , expected ) ; assertResult ( GET ( changeId ) , expected ) ; expected = java.util.Arrays.asList ( "tag1" , "tag2" ) ; assertResult ( POST ( changeId , "tag1" , null ) , expected ) ; assertResult ( GET ( changeId ) , expected ) ; }

Target:
public void testAddMultipleHashtags ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; addHashtags ( r , "tag3" , "tag1" ) ; assertThatGet ( r ) . containsExactly ( "tag1" , "tag3" ) . inOrder ( ) ; addHashtags ( r , "tag2" , "tag4" ) ; assertThatGet ( r ) . containsExactly ( "tag1" , "tag2" , "tag3" , "tag4" ) . inOrder ( ) ; }
Source:
public void create_NotExisting ( ) throws java.io.IOException { final java.nio.file.Path root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( root ) ; org.junit.Assert.assertTrue ( site.isNew ) ; org.junit.Assert.assertEquals ( root , site.site_path ) ; org.junit.Assert.assertEquals ( root.resolve ( "etc" ) , site.etc_dir ) ; }

Target:
public void create_NotExisting ( ) throws java.io.IOException { final java.nio.file.Path root = com.google.gerrit.server.config.SitePathsTest.random ( ) ; final com.google.gerrit.server.config.SitePaths site = new com.google.gerrit.server.config.SitePaths ( root ) ; com.google.common.truth.Truth.assertThat ( site.isNew ) . isTrue ( ) ; com.google.gerrit.extensions.common.PathSubject.assertThat ( site.site_path ) . isEqualTo ( root ) ; com.google.gerrit.extensions.common.PathSubject.assertThat ( site.etc_dir ) . isEqualTo ( root.resolve ( "etc" ) ) ; }
Source:
private java.util.Collection < com.google.gerrit.extensions.common.AccountInfo > suggestAccounts ( com.google.gerrit.server.change.SuggestReviewers suggestReviewers , com.google.gerrit.server.ReviewersUtil.VisibilityControl visibilityControl ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.index.account.AccountIndex searchIndex = indexes.getSearchIndex ( ) ; if ( searchIndex != null ) { return suggestAccountsFromIndex ( suggestReviewers , visibilityControl ) ; } return suggestAccountsFromDb ( suggestReviewers , visibilityControl ) ; }

Target:
private java.util.Collection < com.google.gerrit.extensions.common.AccountInfo > suggestAccounts ( com.google.gerrit.server.change.SuggestReviewers suggestReviewers , com.google.gerrit.server.ReviewersUtil.VisibilityControl visibilityControl ) throws com.google.gwtorm.server.OrmException { try ( com.google.gerrit.metrics.Timer0.Context ctx = metrics.queryAccountsLatency.start ( ) ) { com.google.gerrit.server.index.account.AccountIndex searchIndex = indexes.getSearchIndex ( ) ; if ( searchIndex != null ) { return suggestAccountsFromIndex ( suggestReviewers , visibilityControl ) ; } com.google.gerrit.server.ReviewersUtil.log.warn ( "Account index not available; suggesting reviewers from DB" ) ; return suggestAccountsFromDb ( suggestReviewers , visibilityControl ) ; } }
Source:
public void filterOutAllResults ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; int user2 = accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "anotheruser" ) ) . getAccountId ( ) . get ( ) ; for ( int i = 0 ; i < 5 ; i ++ ) { insert ( newChange ( repo , null , null , user2 , null ) ) ; } assertQuery ( "status:new ownerin:Administrators" ) ; assertQuery ( "status:new ownerin:Administrators limit:2" ) ; }

Target:
public void filterOutAllResults ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < com.google.gerrit.testutil.InMemoryRepositoryManager.Repo > repo = createProject ( "repo" ) ; com.google.gerrit.reviewdb.client.Account.Id user2 = accountManager.authenticate ( com.google.gerrit.server.account.AuthRequest.forUser ( "anotheruser" ) ) . getAccountId ( ) ; for ( int i = 0 ; i < 5 ; i ++ ) { insert ( newChangeForUser ( repo , user2 ) ) ; } assertQuery ( "status:new ownerin:Administrators" ) ; assertQuery ( "status:new ownerin:Administrators limit:2" ) ; }
Source:
private void executeUpdateRepo ( ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException { try { com.google.gerrit.server.git.BatchUpdate.RepoContext ctx = new com.google.gerrit.server.git.BatchUpdate.RepoContext ( ) ; for ( com.google.gerrit.server.git.BatchUpdate.Op op : ops.values ( ) ) { op.updateRepo ( ctx ) ; } } catch ( java.lang.Exception e ) { com.google.common.base.Throwables.propagateIfPossible ( e , com.google.gerrit.extensions.restapi.RestApiException.class ) ; throw new com.google.gerrit.server.git.UpdateException ( e ) ; } }

Target:
private void executeUpdateRepo ( ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException { try { com.google.gerrit.server.git.BatchUpdate.RepoContext ctx = new com.google.gerrit.server.git.BatchUpdate.RepoContext ( ) ; for ( com.google.gerrit.server.git.BatchUpdate.Op op : ops.values ( ) ) { op.updateRepo ( ctx ) ; } if ( ( inserter ) != null ) { inserter.flush ( ) ; } } catch ( java.lang.Exception e ) { com.google.common.base.Throwables.propagateIfPossible ( e , com.google.gerrit.extensions.restapi.RestApiException.class ) ; throw new com.google.gerrit.server.git.UpdateException ( e ) ; } }
Source:
protected void onLoad ( ) { enableForm ( false ) ; super . onLoad ( ) ; Util.PROJECT_SVC.projectDetail ( projectName , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.common.data.ProjectDetail > ( ) { public void onSuccess ( final com.google.gerrit.common.data.ProjectDetail result ) { enableForm ( true ) ; display ( result ) ; } } ) ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; Util.PROJECT_SVC.projectDetail ( getProjectKey ( ) , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.common.data.ProjectDetail > ( this ) { public void preDisplay ( final com.google.gerrit.common.data.ProjectDetail result ) { enableForm ( true ) ; display ( result ) ; } } ) ; }
Source:
public com.google.gerrit.server.IdentifiedUser get ( ) { final com.google.gerrit.server.ssh.SshScopes.Context ctx = com.google.gerrit.server.ssh.SshScopes.getContext ( ) ; final com.google.gerrit.client.reviewdb.Account.Id id = ctx.session.getAttribute ( SshUtil.CURRENT_ACCOUNT ) ; if ( id == null ) { throw new com.google.inject.ProvisionException ( "User not yet authenticated" ) ; } return factory.create ( id ) ; }

Target:
public com.google.gerrit.server.IdentifiedUser get ( ) { final com.google.gerrit.server.ssh.SshScopes.Context ctx = com.google.gerrit.server.ssh.SshScopes.getContext ( ) ; final com.google.gerrit.client.reviewdb.Account.Id id = ctx.session.getAttribute ( SshUtil.CURRENT_ACCOUNT ) ; if ( id == null ) { throw new com.google.inject.ProvisionException ( "User not yet authenticated" ) ; } return factory.create ( AccessPath.SSH , id ) ; }
Source:
public java.lang.Iterable < com.google.gerrit.prettify.common.EditList.Hunk > getHunks ( ) { int ctx = diffPrefs.getContext ( ) ; if ( ctx == ( com.google.gerrit.reviewdb.client.AccountDiffPreference.WHOLE_FILE_CONTEXT ) ) { ctx = java.lang.Math.max ( a.size ( ) , b.size ( ) ) ; } return new com.google.gerrit.prettify.common.EditList ( edits , ctx , a.size ( ) , b.size ( ) ) . getHunks ( ) ; }

Target:
public java.lang.Iterable < com.google.gerrit.prettify.common.EditList.Hunk > getHunks ( ) { int ctx = diffPrefs.context ; if ( ctx == ( com.google.gerrit.extensions.client.DiffPreferencesInfo.WHOLE_FILE_CONTEXT ) ) { ctx = java.lang.Math.max ( a.size ( ) , b.size ( ) ) ; } return new com.google.gerrit.prettify.common.EditList ( edits , ctx , a.size ( ) , b.size ( ) ) . getHunks ( ) ; }
Source:
public int compare ( java.lang.String left , java.lang.String right ) { java.lang.Integer lp = positions.get ( left ) ; java.lang.Integer rp = positions.get ( right ) ; if ( lp == rp ) { return 0 ; } else if ( lp == null ) { return - 1 ; } else if ( rp == null ) { return 1 ; } else { return lp - rp ; } }

Target:
private int position ( java.lang.String name ) { java.lang.Integer p = positions.get ( name ) ; return p != null ? p : positions.size ( ) ; }
Source:
public void onSuccess ( com.google.gerrit.reviewdb.client.Account result ) { doEnterAgreement ( ) ; }

Target:
private void doSign ( ) { submit.setEnabled ( false ) ; if ( ( ( current ) == null ) || ( ! ( Util.C.newAgreementIAGREE ( ) . equalsIgnoreCase ( yesIAgreeBox.getText ( ) ) ) ) ) { yesIAgreeBox.setText ( "" ) ; yesIAgreeBox.setFocus ( true ) ; return ; } doEnterAgreement ( ) ; }
Source:
private void runImpl ( ) throws java.io.IOException { org.eclipse.jgit.transport.Transport tn = org.eclipse.jgit.transport.Transport.open ( git , uri ) ; org.eclipse.jgit.transport.PushResult res ; try { res = pushVia ( tn ) ; } finally { try { tn.close ( ) ; } catch ( java.lang.Throwable e2 ) { com.googlesource.gerrit.plugins.replication.PushOne.repLog.warn ( ( "Unexpected error while closing " + ( uri ) ) , e2 ) ; } } updateStates ( res.getRemoteUpdates ( ) ) ; }

Target:
private void runImpl ( ) throws java.io.IOException { org.eclipse.jgit.transport.Transport tn = org.eclipse.jgit.transport.Transport.open ( git , uri ) ; org.eclipse.jgit.transport.PushResult res ; try { res = pushVia ( tn ) ; updateHead ( ) ; } finally { try { tn.close ( ) ; } catch ( java.lang.Throwable e2 ) { com.googlesource.gerrit.plugins.replication.PushOne.repLog.warn ( ( "Unexpected error while closing " + ( uri ) ) , e2 ) ; } } updateStates ( res.getRemoteUpdates ( ) ) ; }
Source:
public java.util.SortedSet < com.google.gerrit.reviewdb.Project.NameKey > list ( ) { java.util.SortedSet < com.google.gerrit.reviewdb.Project.NameKey > names = new java.util.TreeSet < com.google.gerrit.reviewdb.Project.NameKey > ( ) ; scanProjects ( basePath , "" , names ) ; return java.util.Collections.unmodifiableSortedSet ( names ) ; }

Target:
private void onCreateProject ( final com.google.gerrit.reviewdb.Project.NameKey newProjectName ) { namesUpdateLock.lock ( ) ; try { java.util.SortedSet < com.google.gerrit.reviewdb.Project.NameKey > n = new java.util.TreeSet < com.google.gerrit.reviewdb.Project.NameKey > ( names ) ; n.add ( newProjectName ) ; names = java.util.Collections.unmodifiableSortedSet ( n ) ; } finally { namesUpdateLock.unlock ( ) ; } }
Source:
private void printTree ( final com.google.gerrit.sshd.commands.TreeNode node , final int level , final boolean isLast ) { printNode ( node , level , isLast ) ; final java.util.SortedSet < ? extends com.google.gerrit.sshd.commands.TreeNode > childNodes = node.getChildren ( ) ; int i = 0 ; final int size = childNodes.size ( ) ; for ( final com.google.gerrit.sshd.commands.TreeNode childNode : childNodes ) { final boolean isLastChild = ( ++ i ) == size ; printTree ( childNode , ( level + 1 ) , isLastChild ) ; } }

Target:
private void printTree ( final com.google.gerrit.sshd.commands.TreeFormatter.TreeNode node , final int level , final boolean isLast ) { printNode ( node , level , isLast ) ; final java.util.SortedSet < ? extends com.google.gerrit.sshd.commands.TreeFormatter.TreeNode > childNodes = node.getChildren ( ) ; int i = 0 ; final int size = childNodes.size ( ) ; for ( final com.google.gerrit.sshd.commands.TreeFormatter.TreeNode childNode : childNodes ) { final boolean isLastChild = ( ++ i ) == size ; printTree ( childNode , ( level + 1 ) , isLastChild ) ; } }
Source:
private com.google.gerrit.server.project.ChangeControl incrementPatchSet ( com.google.gerrit.server.project.ChangeControl ctl , org.eclipse.jgit.revwalk.RevCommit commit ) throws java.lang.Exception { com.google.gerrit.server.change.PatchSetInserter ins ; try ( com.google.gerrit.server.git.BatchUpdate bu = newUpdate ( ctl.getChange ( ) . getOwner ( ) ) ) { ins = patchSetInserterFactory.create ( ctl , nextPatchSetId ( ctl ) , commit ) . setValidatePolicy ( CommitValidators.Policy.NONE ) . setFireRevisionCreated ( false ) . setSendMail ( false ) ; bu.addOp ( ctl.getId ( ) , ins ) . execute ( ) ; } return reload ( ctl ) ; }

Target:
private com.google.gerrit.server.project.ChangeControl incrementPatchSet ( com.google.gerrit.server.project.ChangeControl ctl , org.eclipse.jgit.revwalk.RevCommit commit ) throws java.lang.Exception { com.google.gerrit.server.change.PatchSetInserter ins ; try ( com.google.gerrit.server.git.BatchUpdate bu = newUpdate ( ctl.getChange ( ) . getOwner ( ) ) ) { ins = patchSetInserterFactory.create ( ctl , nextPatchSetId ( ctl ) , commit ) . setValidatePolicy ( CommitValidators.Policy.NONE ) . setFireRevisionCreated ( false ) . setNotify ( NotifyHandling.NONE ) ; bu.addOp ( ctl.getId ( ) , ins ) . execute ( ) ; } return reload ( ctl ) ; }
Source:
public static void next ( java.lang.String query , int start , int limit , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeList > callback ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeList.newQuery ( query ) ; if ( limit > 0 ) { call.addParameter ( "n" , limit ) ; } com.google.gerrit.client.changes.ChangeList.addOptions ( call , com.google.gerrit.client.changes.ChangeList.OPTIONS ) ; if ( start != 0 ) { call.addParameter ( "S" , start ) ; } call.get ( callback ) ; }

Target:
public static void next ( java.lang.String query , int start , int limit , java.util.Set < com.google.gerrit.extensions.client.ListChangesOption > options , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeList > callback ) { com.google.gerrit.client.rpc.RestApi call = com.google.gerrit.client.changes.ChangeList.newQuery ( query ) ; if ( limit > 0 ) { call.addParameter ( "n" , limit ) ; } com.google.gerrit.client.changes.ChangeList.addOptions ( call , options ) ; if ( start != 0 ) { call.addParameter ( "S" , start ) ; } call.get ( callback ) ; }
Source:
private boolean matchCriteria ( com.google.gerrit.server.config.PluginConfig config , java.lang.String criteria , java.lang.String value , boolean allowRegex ) { boolean match = true ; for ( java.lang.String s : config.getStringList ( criteria ) ) { if ( ( allowRegex && ( com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig.match ( value , s ) ) ) || ( ( ! allowRegex ) && ( s.equals ( value ) ) ) ) { return true ; } match = false ; } return match ; }

Target:
private boolean matchCriteria ( com.google.gerrit.server.config.PluginConfig config , java.lang.String criteria , java.lang.String value , boolean allowRegex , boolean refMatcher ) { boolean match = true ; for ( java.lang.String s : config.getStringList ( criteria ) ) { if ( ( allowRegex && ( com.googlesource.gerrit.plugins.uploadvalidator.ValidatorConfig.match ( value , s , refMatcher ) ) ) || ( ( ! allowRegex ) && ( s.equals ( value ) ) ) ) { return true ; } match = false ; } return match ; }
Source:
public java.lang.String create ( ) { java.lang.String summaryLine = ( originalGroup.isPresent ( ) ) ? "Update group" : "Create group" ; java.util.StringJoiner footerJoiner = new java.util.StringJoiner ( "\n" , "\n\n" , "" ) ; footerJoiner.setEmptyValue ( "" ) ; getFooterForRename ( ) . ifPresent ( footerJoiner :: add ) ; getFootersForMemberModifications ( ) . forEach ( footerJoiner :: add ) ; getFootersForSubgroupModifications ( ) . forEach ( footerJoiner :: add ) ; java.lang.String footer = footerJoiner.toString ( ) ; return summaryLine + footer ; }

Target:
public java.lang.String create ( ) { java.lang.String summaryLine = ( originalGroup.isPresent ( ) ) ? "Update group" : "Create group" ; java.util.StringJoiner footerJoiner = new java.util.StringJoiner ( "\n" , "\n\n" , "" ) ; footerJoiner.setEmptyValue ( "" ) ; com.google.common.collect.Streams.concat ( com.google.common.collect.Streams.stream ( getFooterForRename ( ) ) , getFootersForMemberModifications ( ) , getFootersForSubgroupModifications ( ) ) . sorted ( ) . forEach ( footerJoiner :: add ) ; java.lang.String footer = footerJoiner.toString ( ) ; return summaryLine + footer ; }
Source:
void display ( java.util.List < com.google.gerrit.client.account.AgreementInfo > result ) { while ( 1 < ( table.getRowCount ( ) ) ) { table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; } for ( com.google.gerrit.client.account.AgreementInfo info : result ) { addOne ( info ) ; } }

Target:
void display ( java.util.List < com.google.gerrit.client.info.AgreementInfo > result ) { while ( 1 < ( table.getRowCount ( ) ) ) { table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; } for ( com.google.gerrit.client.info.AgreementInfo info : result ) { addOne ( info ) ; } }
Source:
public void testQuote1 ( ) { java.lang.String comment = "> I\'m happy\n > with quotes!\n\nSee above." ; java.util.List < com.google.gerrit.server.mail.send.CommentFormatter.Block > result = com.google.gerrit.server.mail.send.CommentFormatter.parse ( comment ) ; com.google.common.truth.Truth.assertThat ( result ) . hasSize ( 2 ) ; assertBlock ( result , 0 , BlockType.QUOTE , "I\'m happy\nwith quotes!" ) ; assertBlock ( result , 1 , BlockType.PARAGRAPH , "See above." ) ; }

Target:
public void testQuote1 ( ) { java.lang.String comment = "> I\'m happy\n > with quotes!\n\nSee above." ; java.util.List < com.google.gerrit.server.mail.send.CommentFormatter.Block > result = com.google.gerrit.server.mail.send.CommentFormatter.parse ( comment ) ; com.google.common.truth.Truth.assertThat ( result ) . hasSize ( 2 ) ; assertQuoteBlock ( result , 0 , 1 ) ; assertBlock ( result.get ( 0 ) . quotedBlocks , 0 , BlockType.PARAGRAPH , "I\'m happy\nwith quotes!" ) ; assertBlock ( result , 1 , BlockType.PARAGRAPH , "See above." ) ; }
Source:
public com.googlecode.prolog_cafe.builtin.Operation exec ( com.googlecode.prolog_cafe.builtin.Prolog engine ) { engine.setB0 ( ) ; com.googlecode.prolog_cafe.builtin.Term a1 ; a1 = arg1 ; a1 = a1.dereference ( ) ; if ( ! ( a1.unify ( new com.googlecode.prolog_cafe.builtin.JavaObjectTerm ( engine ) , engine.trail ) ) ) return engine.fail ( ) ; return cont ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) { engine.setB0 ( ) ; com.googlecode.prolog_cafe.lang.Term a1 ; a1 = arg1 ; a1 = a1.dereference ( ) ; if ( ! ( a1.unify ( new com.googlecode.prolog_cafe.lang.JavaObjectTerm ( engine ) , engine.trail ) ) ) return engine.fail ( ) ; return cont ; }
Source:
public void testUpsertTwoNotExistingZeroLengthArray ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.UPDATE ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.TestJdbcAccess.INSERT , 1 , 1 ) ; createClassUnderTest ( ) . upsert ( twoRows ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( update ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertUsedBatchingOnly ( insert ) ; com.google.gwtorm.jdbc.TestJdbcAccess.assertExpectedIdsUsed ( insert , 1 , 2 ) ; }

Target:
public void testUpsertTwoNotExistingZeroLengthArray ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.UPDATE ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.INSERT , 1 , 1 ) ; classUnderTest.upsert ( twoRows ) ; assertCorrectUpdating ( update , 1 , 2 ) ; assertCorrectUpdating ( insert , 1 , 2 ) ; }