auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void assertProblems ( com.google.gerrit.gpg.PublicKeyChecker checker , com.google.gerrit.gpg.testutil.TestKey k , java.lang.String ... expected ) { com.google.gerrit.gpg.CheckResult result = checker.check ( k.getPublicKey ( ) ) ; org.junit.Assert.assertEquals ( java.util.Arrays.asList ( expected ) , result.getProblems ( ) ) ; }

Target:
private void assertProblems ( com.google.gerrit.gpg.PublicKeyChecker checker , com.google.gerrit.gpg.testutil.TestKey k , java.lang.String ... expected ) { com.google.gerrit.gpg.CheckResult result = checker.setStore ( store ) . check ( k.getPublicKey ( ) ) ; org.junit.Assert.assertEquals ( java.util.Arrays.asList ( expected ) , result.getProblems ( ) ) ; }
Source:
public void onLoad ( ) { if ( ( groups ) == null ) { initUI ( ) ; } Util.GROUP_SVC.ownedGroups ( new com.google.gerrit.client.rpc.GerritCallback < java.util.List < com.google.gerrit.client.reviewdb.AccountGroup > > ( ) { public void onSuccess ( final java.util.List < com.google.gerrit.client.reviewdb.AccountGroup > result ) { if ( isAttached ( ) ) { groups.display ( result ) ; groups.finishDisplay ( true ) ; } } } ) ; }

Target:
public void onLoad ( ) { if ( ( groups ) == null ) { initUI ( ) ; } Util.GROUP_SVC.ownedGroups ( new com.google.gerrit.client.rpc.ScreenLoadCallback < java.util.List < com.google.gerrit.client.reviewdb.AccountGroup > > ( this ) { @ java.lang.Override protected void preDisplay ( final java.util.List < com.google.gerrit.client.reviewdb.AccountGroup > result ) { groups.display ( result ) ; groups.finishDisplay ( true ) ; } } ) ; }
Source:
private boolean canPushWithForce ( ) { if ( ( GitRepositoryManager.REF_CONFIG.equals ( refName ) ) && ( ! ( getProjectControl ( ) . isOwner ( ) ) ) ) { return false ; } for ( com.google.gerrit.common.data.PermissionRule rule : access ( Permission.PUSH ) ) { if ( rule.getForce ( ) ) { return true ; } } return false ; }

Target:
public boolean canUpdate ( ) { if ( ( GitRepositoryManager.REF_CONFIG.equals ( refName ) ) && ( ! ( projectControl.isOwner ( ) ) ) ) { return false ; } return canPerform ( Permission.PUSH ) ; }
Source:
protected void doDelete ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException , javax.servlet.ServletException { process ( req , rsp , com.ericsson.gerrit.plugins.highavailability.forwarder.rest.AbstractIndexRestApiServlet.Operation.DELETE ) ; }

Target:
protected void doDelete ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException , javax.servlet.ServletException { if ( ! ( allowDelete ) ) { sendError ( rsp , javax.servlet.http.HttpServletResponse.SC_METHOD_NOT_ALLOWED , java.lang.String.format ( "cannot delete %s from index" , type ) ) ; } else { process ( req , rsp , com.ericsson.gerrit.plugins.highavailability.forwarder.rest.AbstractIndexRestApiServlet.Operation.DELETE ) ; } }
Source:
protected void configure ( ) { final com.google.gerrit.sshd.CommandName gerrit = com.google.gerrit.sshd.Commands.named ( "gerrit" ) ; command ( gerrit , "approve" ) . to ( com.google.gerrit.sshd.commands.ErrorSlaveMode.class ) ; command ( gerrit , "create-project" ) . to ( com.google.gerrit.sshd.commands.ErrorSlaveMode.class ) ; command ( gerrit , "gsql" ) . to ( com.google.gerrit.sshd.commands.ErrorSlaveMode.class ) ; command ( gerrit , "receive-pack" ) . to ( com.google.gerrit.sshd.commands.ErrorSlaveMode.class ) ; command ( gerrit , "replicate" ) . to ( com.google.gerrit.sshd.commands.ErrorSlaveMode.class ) ; }

Target:
protected void configure ( ) { final com.google.gerrit.sshd.CommandName gerrit = com.google.gerrit.sshd.Commands.named ( "gerrit" ) ; command ( gerrit , "approve" ) . to ( com.google.gerrit.sshd.commands.ErrorSlaveMode.class ) ; command ( gerrit , "create-account" ) . to ( com.google.gerrit.sshd.commands.ErrorSlaveMode.class ) ; command ( gerrit , "create-project" ) . to ( com.google.gerrit.sshd.commands.ErrorSlaveMode.class ) ; command ( gerrit , "gsql" ) . to ( com.google.gerrit.sshd.commands.ErrorSlaveMode.class ) ; command ( gerrit , "receive-pack" ) . to ( com.google.gerrit.sshd.commands.ErrorSlaveMode.class ) ; command ( gerrit , "replicate" ) . to ( com.google.gerrit.sshd.commands.ErrorSlaveMode.class ) ; }
Source:
public boolean canPushToAtLeastOneRef ( ) { return ( ( canPerformOnAnyRef ( ApprovalCategory.READ , ( ( short ) ( 2 ) ) ) ) || ( canPerformOnAnyRef ( ApprovalCategory.PUSH_HEAD , ( ( short ) ( 1 ) ) ) ) ) || ( canPerformOnAnyRef ( ApprovalCategory.PUSH_TAG , ( ( short ) ( 1 ) ) ) ) ; }

Target:
public boolean canPushToAtLeastOneRef ( ) { return ( canPerformOnAnyRef ( Permission.PUSH ) ) || ( canPerformOnAnyRef ( Permission.PUSH_TAG ) ) ; }
Source:
public boolean match ( T object ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.server.query.Predicate < T > c : children ) { com.google.common.base.Preconditions.checkState ( c.isMatchable ( ) , "match invoked, but child predicate %s doesn't implement %s" , c , com.google.gerrit.server.query.Matchable.class . getName ( ) ) ; if ( ! ( c.asMatchable ( ) . match ( object ) ) ) { return false ; } } return true ; }

Target:
public boolean match ( T object ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.index.query.Predicate < T > c : children ) { com.google.common.base.Preconditions.checkState ( c.isMatchable ( ) , "match invoked, but child predicate %s doesn't implement %s" , c , com.google.gerrit.index.query.Matchable.class . getName ( ) ) ; if ( ! ( c.asMatchable ( ) . match ( object ) ) ) { return false ; } } return true ; }
Source:
public boolean canUpdate ( ) { if ( ( GitRepositoryManager.REF_CONFIG.equals ( refName ) ) && ( ! ( projectControl.isOwner ( ) ) ) ) { if ( ! ( ( projectControl.getProjectState ( ) . isAllProjects ( ) ) && ( getCurrentUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) ) { return false ; } } return ( canPerform ( Permission.PUSH ) ) && ( canWrite ( ) ) ; }

Target:
public boolean canUpdate ( ) { if ( ( RefNames.REFS_CONFIG.equals ( refName ) ) && ( ! ( projectControl.isOwner ( ) ) ) ) { if ( ! ( ( projectControl.getProjectState ( ) . isAllProjects ( ) ) && ( getCurrentUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) ) { return false ; } } return ( canPerform ( Permission.PUSH ) ) && ( canWrite ( ) ) ; }
Source:
protected void preInvoke ( final com.google.gerrit.server.http.GerritCall call ) { super . preInvoke ( call ) ; if ( call.isComplete ( ) ) { return ; } if ( ( call.getMethod ( ) . getAnnotation ( com.google.gerrit.client.rpc.SignInRequired.class ) ) != null ) { if ( ! ( call.requireXsrfValid ( ) ) ) { return ; } if ( ( call.getAccountId ( ) ) == null ) { call.onFailure ( new com.google.gerrit.client.rpc.NotSignedInException ( ) ) ; return ; } } }

Target:
protected void preInvoke ( final com.google.gerrit.server.http.GerritJsonServlet.GerritCall call ) { super . preInvoke ( call ) ; if ( call.isComplete ( ) ) { return ; } if ( ( call.getMethod ( ) . getAnnotation ( com.google.gerrit.client.rpc.SignInRequired.class ) ) != null ) { if ( ( ! ( call.requireXsrfValid ( ) ) ) || ( ! ( session.get ( ) . isSignedIn ( ) ) ) ) { call.onFailure ( new com.google.gerrit.client.rpc.NotSignedInException ( ) ) ; return ; } } }
Source:
public void funnel ( K from , com.google.common.hash.PrimitiveSink into ) { try { java.io.ObjectOutputStream ser = new java.io.ObjectOutputStream ( new com.google.gerrit.server.cache.h2.H2CacheImpl.SinkOutputStream ( into ) ) ; try { ser.writeObject ( from ) ; ser.flush ( ) ; } finally { ser.close ( ) ; } } catch ( java.io.IOException err ) { throw new java.lang.RuntimeException ( "Cannot hash as Serializable" , err ) ; } }

Target:
com.google.common.hash.Funnel < K > funnel ( ) { return new com.google.common.hash.Funnel < K > ( ) { private static final long serialVersionUID = 1L ; @ java.lang.Override public void funnel ( K from , com.google.common.hash.PrimitiveSink into ) { try ( java.io.ObjectOutputStream ser = new java.io.ObjectOutputStream ( new com.google.gerrit.server.cache.h2.H2CacheImpl.SinkOutputStream ( into ) ) ) { ser.writeObject ( from ) ; ser.flush ( ) ; } catch ( java.io.IOException err ) { throw new java.lang.RuntimeException ( "Cannot hash as Serializable" , err ) ; } } } ; }
Source:
public static com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > getLatestRelease ( ) { com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > latest = null ; for ( com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > schema : com.google.gerrit.server.index.ChangeSchemas.ALL.values ( ) ) { if ( schema.isRelease ( ) ) { latest = schema ; } } com.google.common.base.Preconditions.checkState ( ( latest != null ) , "No released schema versions found" ) ; return latest ; }

Target:
private static com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > developer ( com.google.gerrit.server.index.FieldDef < com.google.gerrit.server.query.change.ChangeData , ? > ... fields ) { return new com.google.gerrit.server.index.Schema < com.google.gerrit.server.query.change.ChangeData > ( false , java.util.Arrays.asList ( fields ) ) ; }
Source:
public java.nio.file.FileVisitResult visitFile ( java.nio.file.Path path , java.nio.file.attribute.BasicFileAttributes attrs ) throws java.io.IOException { com.google.common.base.Optional < com.google.gerrit.server.plugins.PluginEntry > resource = resourceOf ( relativePathOf ( path ) ) ; if ( resource.isPresent ( ) ) { resourcesList.add ( resource.get ( ) ) ; } return java.nio.file.FileVisitResult.CONTINUE ; }

Target:
public java.nio.file.FileVisitResult visitFile ( java.nio.file.Path path , java.nio.file.attribute.BasicFileAttributes attrs ) throws java.io.IOException { java.util.Optional < com.google.gerrit.server.plugins.PluginEntry > resource = resourceOf ( relativePathOf ( path ) ) ; if ( resource.isPresent ( ) ) { resourcesList.add ( resource.get ( ) ) ; } return java.nio.file.FileVisitResult.CONTINUE ; }
Source:
private void initKeyMapType ( ) { keyMap.addItem ( KeyMapType.DEFAULT.name ( ) . toLowerCase ( ) , KeyMapType.DEFAULT.name ( ) ) ; keyMap.addItem ( KeyMapType.EMACS.name ( ) . toLowerCase ( ) , KeyMapType.EMACS.name ( ) ) ; keyMap.addItem ( KeyMapType.VIM.name ( ) . toLowerCase ( ) , KeyMapType.VIM.name ( ) ) ; }

Target:
private void initKeyMapType ( ) { keyMap.addItem ( KeyMapType.DEFAULT.name ( ) . toLowerCase ( ) , KeyMapType.DEFAULT.name ( ) ) ; keyMap.addItem ( KeyMapType.EMACS.name ( ) . toLowerCase ( ) , KeyMapType.EMACS.name ( ) ) ; keyMap.addItem ( KeyMapType.SUBLIME.name ( ) . toLowerCase ( ) , KeyMapType.SUBLIME.name ( ) ) ; keyMap.addItem ( KeyMapType.VIM.name ( ) . toLowerCase ( ) , KeyMapType.VIM.name ( ) ) ; }
Source:
public void run ( ) { try { synchronized ( list ) { list.add ( this ) ; } runImp ( ) ; } finally { synchronized ( list ) { list.remove ( this ) ; } } }

Target:
public void run ( ) { com.google.gerrit.server.ssh.SshScopes.invoke ( session , cmd , new java.lang.Runnable ( ) { public void run ( ) { try { synchronized ( list ) { list.add ( cmd ) ; } runImp ( ) ; } finally { synchronized ( list ) { list.remove ( cmd ) ; } } } } ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { java.util.List < java.lang.String > previousValue = getValues ( ( row - 1 ) ) ; java.util.List < java.lang.String > value = getValues ( row ) ; populate ( ( row - 1 ) , value , false ) ; populate ( row , previousValue , ( row == ( ( table.getRowCount ( ) ) - 1 ) ) ) ; widget.setEnabled ( true ) ; }

Target:
void swap ( int row1 , int row2 ) { java.util.List < java.lang.String > value = getRowItem ( row1 ) ; java.util.List < java.lang.String > nextValue = getRowItem ( row2 ) ; populate ( row1 , nextValue , false ) ; populate ( row2 , value , ( row2 == ( ( table.getRowCount ( ) ) - 1 ) ) ) ; widget.setEnabled ( true ) ; }
Source:
public void testMIXED_NoPreferredEmailUser ( ) { setFrom ( "MIXED" ) ; final java.lang.String name = "A U. Thor" ; final com.google.gerrit.reviewdb.client.Account.Id user = user ( name , null ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( user ) ; org.junit.Assert.assertNotNull ( r ) ; org.junit.Assert.assertEquals ( ( name + " (Code Review)" ) , r.name ) ; org.junit.Assert.assertEquals ( ident.getEmailAddress ( ) , r.email ) ; org.easymock.EasyMock.verify ( accountCache ) ; }

Target:
public void testMIXED_NoFullNameUser ( ) { setFrom ( "MIXED" ) ; final java.lang.String email = "a.u.thor@test.example.com" ; final com.google.gerrit.reviewdb.client.Account.Id user = user ( null , email ) ; org.easymock.EasyMock.replay ( accountCache ) ; final com.google.gerrit.server.mail.Address r = create ( ) . from ( user ) ; com.google.common.truth.Truth.assertThat ( r ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( r.name ) . isEqualTo ( "Anonymous Coward (Code Review)" ) ; com.google.common.truth.Truth.assertThat ( r.email ) . isEqualTo ( ident.getEmailAddress ( ) ) ; org.easymock.EasyMock.verify ( accountCache ) ; }
Source:
private com.google.gerrit.server.git.MergeOpRepoManager.OpenRepo openRepo ( com.google.gerrit.reviewdb.client.Project.NameKey project ) throws com.google.gerrit.server.git.IntegrationException { try { return orm.getRepo ( project ) ; } catch ( org.eclipse.jgit.errors.RepositoryNotFoundException noProject ) { logWarn ( ( ( ( "Project " + ( project.get ( ) ) ) + " no longer exists, " ) + "abandoning open changes." ) ) ; abandonAllOpenChangeForDeletedProject ( project ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.git.IntegrationException ( ( "Error opening project " + project ) , e ) ; } return null ; }

Target:
private com.google.gerrit.server.git.MergeOpRepoManager.OpenRepo openRepo ( com.google.gerrit.reviewdb.client.Project.NameKey project ) throws com.google.gerrit.server.git.IntegrationException { try { return orm.getRepo ( project ) ; } catch ( com.google.gerrit.server.project.NoSuchProjectException e ) { logWarn ( ( ( "Project " + project ) + " no longer exists, abandoning open changes." ) ) ; abandonAllOpenChangeForDeletedProject ( project ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.git.IntegrationException ( ( "Error opening project " + project ) , e ) ; } return null ; }
Source:
public void onlyDeleteNewlyCreatedMatchingRefs ( ) throws java.lang.Exception { org.eclipse.jgit.lib.Ref matchingRef ; org.eclipse.jgit.lib.Ref anotherMatchingRef ; org.eclipse.jgit.lib.Ref nonMatchingRef ; try ( com.google.gerrit.acceptance.ProjectResetter resetProject = builder ( ) . reset ( project , "refs/match/*" , "refs/another-match/*" ) . build ( ) ) { matchingRef = createRef ( "refs/match/test" ) ; anotherMatchingRef = createRef ( "refs/another-match/test" ) ; nonMatchingRef = createRef ( "refs/no-match/test" ) ; } assertDeletedRef ( matchingRef ) ; assertDeletedRef ( anotherMatchingRef ) ; assertRef ( nonMatchingRef ) ; }

Target:
public void onlyDeleteNewlyCreatedMatchingRefs ( ) throws java.lang.Exception { org.eclipse.jgit.lib.Ref matchingRef ; org.eclipse.jgit.lib.Ref anotherMatchingRef ; org.eclipse.jgit.lib.Ref nonMatchingRef ; try ( com.google.gerrit.acceptance.ProjectResetter resetProject = builder ( ) . build ( new com.google.gerrit.acceptance.ProjectResetter.Config ( ) . reset ( project , "refs/match/*" , "refs/another-match/*" ) ) ) { matchingRef = createRef ( "refs/match/test" ) ; anotherMatchingRef = createRef ( "refs/another-match/test" ) ; nonMatchingRef = createRef ( "refs/no-match/test" ) ; } assertDeletedRef ( matchingRef ) ; assertDeletedRef ( anotherMatchingRef ) ; assertRef ( nonMatchingRef ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { java.util.List < java.lang.String > previousValue = getValues ( ( row - 1 ) ) ; java.util.List < java.lang.String > value = getValues ( row ) ; populate ( ( row - 1 ) , value , false ) ; populate ( row , previousValue , ( row == ( ( table.getRowCount ( ) ) - 1 ) ) ) ; widget.setEnabled ( true ) ; }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { moveUp ( row ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { executorMock = org.mockito.Mockito.mock ( WorkQueue.Executor.class ) ; com.google.gerrit.server.git.WorkQueue workQueueMock = org.mockito.Mockito.mock ( com.google.gerrit.server.git.WorkQueue.class ) ; org.mockito.Mockito.when ( workQueueMock.createQueue ( 4 , "Forward-index-event" ) ) . thenReturn ( executorMock ) ; com.ericsson.gerrit.plugins.multimaster.Configuration configMock = org.mockito.Mockito.mock ( com.ericsson.gerrit.plugins.multimaster.Configuration.class ) ; org.mockito.Mockito.when ( configMock.getThreadPoolSize ( ) ) . thenReturn ( 4 ) ; indexExecutorProvider = new com.ericsson.gerrit.plugins.multimaster.index.IndexExecutorProvider ( workQueueMock , configMock ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { executorMock = org.mockito.Mockito.mock ( WorkQueue.Executor.class ) ; com.google.gerrit.server.git.WorkQueue workQueueMock = org.mockito.Mockito.mock ( com.google.gerrit.server.git.WorkQueue.class ) ; org.mockito.Mockito.when ( workQueueMock.createQueue ( 4 , "Forward-index-event" ) ) . thenReturn ( executorMock ) ; com.ericsson.gerrit.plugins.multimaster.Configuration configMock = org.mockito.Mockito.mock ( com.ericsson.gerrit.plugins.multimaster.Configuration.class ) ; org.mockito.Mockito.when ( configMock.getIndexThreadPoolSize ( ) ) . thenReturn ( 4 ) ; indexExecutorProvider = new com.ericsson.gerrit.plugins.multimaster.index.IndexExecutorProvider ( workQueueMock , configMock ) ; }
Source:
void render ( javax.servlet.http.HttpServletResponse res , java.lang.String templateName , java.util.Map < java.lang.String , ? > soyData ) throws java.io.IOException { res.setContentType ( "text/html" ) ; res.setCharacterEncoding ( "UTF-8" ) ; byte [ ] data = newRenderer ( templateName ) . setData ( soyData ) . render ( ) . getBytes ( com.google.common.base.Charsets.UTF_8 ) ; res.setContentLength ( data.length ) ; res.getOutputStream ( ) . write ( data ) ; }

Target:
void render ( javax.servlet.http.HttpServletResponse res , java.lang.String templateName , java.util.Map < java.lang.String , ? > soyData ) throws java.io.IOException { res.setContentType ( "text/html" ) ; res.setCharacterEncoding ( "UTF-8" ) ; byte [ ] data = newRenderer ( templateName ) . setData ( soyData ) . render ( ) . getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ; res.setContentLength ( data.length ) ; res.getOutputStream ( ) . write ( data ) ; }
Source:
private PatchSet.Id parsePatchSetId ( org.eclipse.jgit.revwalk.RevCommit commit ) throws org.eclipse.jgit.errors.ConfigInvalidException { java.util.List < java.lang.String > psIdLines = commit.getFooterLines ( com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_PATCH_SET ) ; if ( ( psIdLines.size ( ) ) != 1 ) { throw expectedOneFooter ( com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_PATCH_SET , psIdLines ) ; } java.lang.Integer psId = com.google.common.primitives.Ints.tryParse ( psIdLines.get ( 0 ) ) ; if ( psId == null ) { throw invalidFooter ( com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_PATCH_SET , psIdLines.get ( 0 ) ) ; } return new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , psId ) ; }

Target:
private PatchSet.Id parsePatchSetId ( org.eclipse.jgit.revwalk.RevCommit commit ) throws org.eclipse.jgit.errors.ConfigInvalidException { java.lang.String psIdLine = parseExactlyOneFooter ( commit , com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_PATCH_SET ) ; int s = psIdLine.indexOf ( ' ' ) ; java.lang.String psIdStr = ( s < 0 ) ? psIdLine : psIdLine.substring ( 0 , s ) ; java.lang.Integer psId = com.google.common.primitives.Ints.tryParse ( psIdStr ) ; if ( psId == null ) { throw invalidFooter ( com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_PATCH_SET , psIdStr ) ; } return new com.google.gerrit.reviewdb.client.PatchSet.Id ( changeId , psId ) ; }
Source:
public boolean cancel ( boolean mayInterruptIfRunning ) { if ( task.cancel ( mayInterruptIfRunning ) ) { if ( ( ( runnable ) instanceof com.google.gerrit.server.git.WorkQueue.CancelableRunnable ) && ( running.compareAndSet ( false , true ) ) ) { ( ( com.google.gerrit.server.git.WorkQueue.CancelableRunnable ) ( runnable ) ) . cancel ( ) ; } executor.remove ( this ) ; executor.purge ( ) ; return true ; } else { return false ; } }

Target:
public boolean cancel ( boolean mayInterruptIfRunning ) { if ( task.cancel ( mayInterruptIfRunning ) ) { if ( ( runnable ) instanceof com.google.gerrit.server.git.WorkQueue.CancelableRunnable ) { if ( running.compareAndSet ( false , true ) ) { ( ( com.google.gerrit.server.git.WorkQueue.CancelableRunnable ) ( runnable ) ) . cancel ( ) ; } else if ( ( runnable ) instanceof com.google.gerrit.server.git.WorkQueue.CanceledWhileRunning ) { ( ( com.google.gerrit.server.git.WorkQueue.CanceledWhileRunning ) ( runnable ) ) . setCanceledWhileRunning ( ) ; } } executor.remove ( this ) ; executor.purge ( ) ; return true ; } return false ; }
Source:
public void testInheritRead_OverrideWithDeny ( ) { com.google.gerrit.server.project.Util.grant ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) . setDeny ( ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local ) ; org.junit.Assert.assertFalse ( "can't read" , u.isVisible ( ) ) ; }

Target:
public void testInheritRead_OverrideWithDeny ( ) { com.google.gerrit.server.project.Util.allow ( util.getParentConfig ( ) , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.Util.deny ( local , com.google.gerrit.common.data.Permission.READ , com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS , "refs/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local ) ; org.junit.Assert.assertFalse ( "can't read" , u.isVisible ( ) ) ; }
Source:
public static com.google.gson.GsonBuilder defaultGsonBuilder ( ) { final com.google.gson.GsonBuilder gb = new com.google.gson.GsonBuilder ( ) ; gb.registerTypeAdapter ( java.util.Map.class , new com.google.gwtjsonrpc.server.MapDeserializer ( ) ) ; gb.registerTypeAdapter ( java.sql.Date.class , new com.google.gwtjsonrpc.server.SqlDateDeserializer ( ) ) ; gb.registerTypeAdapter ( java.sql.Timestamp.class , new com.google.gwtjsonrpc.server.SqlTimestampDeserializer ( ) ) ; return gb ; }

Target:
public java.util.Set < java.lang.Object > createInstance ( final java.lang.reflect.Type arg0 ) { return new java.util.HashSet < java.lang.Object > ( ) ; }
Source:
private static void gerrit ( org.spearce.jgit.lib.RepositoryConfig config , java.sql.ResultSet rs ) throws java.sql.SQLException { com.google.gerrit.pgm.ConvertSystemConfig.copy ( config , "gerrit" , "canonicalweburl" , rs , "canonical_url" ) ; com.google.gerrit.pgm.ConvertSystemConfig.copy ( config , "gerrit" , "canonicalgiturl" , rs , "git_daemon_url" ) ; }

Target:
private static void gerrit ( org.spearce.jgit.lib.RepositoryConfig config , java.sql.ResultSet rs ) throws java.sql.SQLException { com.google.gerrit.pgm.ConvertSystemConfig.copy ( config , "gerrit" , "basepath" , rs , "git_base_path" ) ; com.google.gerrit.pgm.ConvertSystemConfig.copy ( config , "gerrit" , "canonicalweburl" , rs , "canonical_url" ) ; com.google.gerrit.pgm.ConvertSystemConfig.copy ( config , "gerrit" , "canonicalgiturl" , rs , "git_daemon_url" ) ; }
Source:
public void invalidRevision ( ) throws java.lang.Exception { assumeNoteDbDisabled ( ) ; com.google.gerrit.server.notedb.ChangeNotes notes = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.testutil.TestChanges.newPatchSet ( notes.getChange ( ) . currentPatchSetId ( ) , "fooooooooooooooooooooooooooooooooooooooo" , adminId ) ; db.patchSets ( ) . update ( java.util.Collections.singleton ( ps ) ) ; assertProblems ( notes , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( "Invalid revision on patch set 1: fooooooooooooooooooooooooooooooooooooooo" ) ) ; }

Target:
public void invalidRevision ( ) throws java.lang.Exception { assumeNoteDbDisabled ( ) ; com.google.gerrit.server.notedb.ChangeNotes notes = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.testing.TestChanges.newPatchSet ( notes.getChange ( ) . currentPatchSetId ( ) , "fooooooooooooooooooooooooooooooooooooooo" , adminId ) ; db.patchSets ( ) . update ( java.util.Collections.singleton ( ps ) ) ; assertProblems ( notes , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( "Invalid revision on patch set 1: fooooooooooooooooooooooooooooooooooooooo" ) ) ; }
Source:
public void dryRunMerge ( ) throws java.lang.Exception { changeInTwoBranches ( "a.txt" , "b.txt" ) ; com.google.gerrit.acceptance.RestResponse r = adminRestSession.get ( ( ( "/projects/" + ( project.get ( ) ) ) + "/branches/master/mergeable?source=branchA" ) ) ; com.google.gerrit.extensions.common.MergeableInfo m = newGson ( ) . fromJson ( r.getReader ( ) , com.google.gerrit.extensions.common.MergeableInfo.class ) ; com.google.common.truth.Truth.assertThat ( m.mergeable ) . isTrue ( ) ; }

Target:
public void invalidStrategy ( ) throws java.lang.Exception { changeInTwoBranches ( "branchA" , "a.txt" , "branchB" , "b.txt" ) ; com.google.gerrit.extensions.common.ChangeInput in = newMergeChangeInput ( "branchA" , "branchB" , "octopus" ) ; assertCreateFails ( in , com.google.gerrit.extensions.restapi.BadRequestException.class , "invalid merge strategy: octopus" ) ; }
Source:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.api.projects.DashboardInfo > apply ( com.google.gerrit.server.project.ProjectResource resource , com.google.gerrit.server.project.SetDashboard.Input input ) throws com.google.gerrit.extensions.restapi.AuthException , com.google.gerrit.extensions.restapi.BadRequestException , com.google.gerrit.extensions.restapi.ResourceConflictException , com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException { com.google.gerrit.server.project.SetDefaultDashboard set = setDefault.get ( ) ; set.inherited = inherited ; return set.apply ( com.google.gerrit.server.project.DashboardResource.projectDefault ( resource.getControl ( ) ) , input ) ; }

Target:
public com.google.gerrit.extensions.restapi.Response < com.google.gerrit.extensions.api.projects.DashboardInfo > apply ( com.google.gerrit.server.project.ProjectResource resource , com.google.gerrit.extensions.common.SetDashboardInput input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException { com.google.gerrit.server.project.SetDefaultDashboard set = setDefault.get ( ) ; set.inherited = inherited ; return set.apply ( com.google.gerrit.server.project.DashboardResource.projectDefault ( resource.getControl ( ) ) , input ) ; }
Source:
public void repositoryIndex ( ) throws java.lang.Exception { com.google.gitiles.GitilesView view = getView ( "/repo" ) ; org.junit.Assert.assertEquals ( Type.REPOSITORY_INDEX , view.getType ( ) ) ; org.junit.Assert.assertEquals ( "repo" , view.getRepositoryName ( ) ) ; org.junit.Assert.assertEquals ( Revision.NULL , view.getRevision ( ) ) ; org.junit.Assert.assertEquals ( Revision.NULL , view.getOldRevision ( ) ) ; org.junit.Assert.assertNull ( view.getPathPart ( ) ) ; }

Target:
public void repositoryIndex ( ) throws java.lang.Exception { com.google.gitiles.GitilesView view = getView ( "/repo" ) ; com.google.common.truth.Truth.assertThat ( view.getType ( ) ) . isEqualTo ( Type.REPOSITORY_INDEX ) ; com.google.common.truth.Truth.assertThat ( view.getRepositoryName ( ) ) . isEqualTo ( "repo" ) ; com.google.common.truth.Truth.assertThat ( view.getRevision ( ) ) . isEqualTo ( Revision.NULL ) ; com.google.common.truth.Truth.assertThat ( view.getOldRevision ( ) ) . isEqualTo ( Revision.NULL ) ; com.google.common.truth.Truth.assertThat ( view.getPathPart ( ) ) . isNull ( ) ; }
Source:
public com.google.gerrit.reviewdb.client.PatchSet get ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { return db.patchSets ( ) . get ( psId ) ; }

Target:
public com.google.gerrit.reviewdb.client.PatchSet get ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.reviewdb.client.PatchSet.Id psId ) throws com.google.gwtorm.server.OrmException { if ( ! ( migration.readChanges ( ) ) ) { return db.patchSets ( ) . get ( psId ) ; } return notes.load ( ) . getPatchSets ( ) . get ( psId ) ; }
Source:
org.eclipse.jgit.lib.Config getConfig ( com.google.gerrit.server.config.SitePaths site ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { java.io.File cfgFile = new java.io.File ( site.etc_dir , "gitiles.config" ) ; org.eclipse.jgit.storage.file.FileBasedConfig cfg = new org.eclipse.jgit.storage.file.FileBasedConfig ( cfgFile , org.eclipse.jgit.util.FS.DETECTED ) ; if ( cfg.getFile ( ) . exists ( ) ) { cfg.load ( ) ; } else { com.googlesource.gerrit.plugins.gitiles.HttpModule.log.info ( ( ( "No " + ( cfgFile.getAbsolutePath ( ) ) ) + "; assuming defaults" ) ) ; } return cfg ; }

Target:
org.eclipse.jgit.lib.Config getConfig ( com.google.gerrit.server.config.SitePaths site ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { java.io.File cfgFile = site.etc_dir.resolve ( "gitiles.config" ) . toFile ( ) ; org.eclipse.jgit.storage.file.FileBasedConfig cfg = new org.eclipse.jgit.storage.file.FileBasedConfig ( cfgFile , org.eclipse.jgit.util.FS.DETECTED ) ; if ( cfg.getFile ( ) . exists ( ) ) { cfg.load ( ) ; } else { com.googlesource.gerrit.plugins.gitiles.HttpModule.log.info ( ( ( "No " + ( cfgFile.getAbsolutePath ( ) ) ) + "; assuming defaults" ) ) ; } return cfg ; }
Source:
private void createProject ( org.eclipse.jgit.transport.URIish replicateURI , java.lang.String head ) { if ( ! ( replicateURI.isRemote ( ) ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.createLocally ( replicateURI , head ) ; com.googlesource.gerrit.plugins.replication.ReplicationQueue.log.info ( ( "Created local repository: " + replicateURI ) ) ; } else if ( com.googlesource.gerrit.plugins.replication.ReplicationQueue.isSSH ( replicateURI ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.createRemoteSsh ( replicateURI , head ) ; com.googlesource.gerrit.plugins.replication.ReplicationQueue.log.info ( ( "Created remote repository: " + replicateURI ) ) ; } else { com.googlesource.gerrit.plugins.replication.ReplicationQueue.log.warn ( java.lang.String.format ( ( "Cannot create new project on remote site %s." + ( " Only local paths and SSH URLs are supported" + " for remote repository creation" ) ) , replicateURI ) ) ; } }

Target:
private void createProject ( org.eclipse.jgit.transport.URIish replicateURI , java.lang.String head ) { if ( ! ( replicateURI.isRemote ( ) ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.createLocally ( replicateURI , head ) ; com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.info ( ( "Created local repository: " + replicateURI ) ) ; } else if ( com.googlesource.gerrit.plugins.replication.ReplicationQueue.isSSH ( replicateURI ) ) { com.googlesource.gerrit.plugins.replication.ReplicationQueue.createRemoteSsh ( replicateURI , head ) ; com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.info ( ( "Created remote repository: " + replicateURI ) ) ; } else { com.googlesource.gerrit.plugins.replication.ReplicationQueue.repLog.warn ( java.lang.String.format ( ( "Cannot create new project on remote site %s." + ( " Only local paths and SSH URLs are supported" + " for remote repository creation" ) ) , replicateURI ) ) ; } }
Source:
public void testTokenOnTime ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestToken token = new com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestToken ( 1 ) ; com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestTokenVerifier verifier = new com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestTokenVerifier ( token ) ; com.google.common.truth.Truth.assertThat ( verifier.verify ( ) ) . isTrue ( ) ; }

Target:
public void testTokenExpired ( ) throws java.lang.Exception { java.time.Instant when = java.time.Instant.now ( ) ; com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestToken token = new com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestToken ( when , 1L ) ; com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestTokenVerifier verifier = new com.googlesource.gerrit.plugins.lfs.LfsAuthTokenTest.TestTokenVerifier ( token ) ; com.google.common.truth.Truth.assertThat ( verifier.onTime ( when.plusMillis ( 1001 ) ) ) . isFalse ( ) ; }
Source:
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 ) ; }

Target:
private < K , V > com.google.gerrit.server.cache.UnnamedCacheBinding < K , V > disk ( final com.google.inject.Key < com.google.gerrit.server.cache.Cache < K , V > > key , final com.google.inject.TypeLiteral < com.google.gerrit.server.cache.Cache < K , V > > type ) { final boolean disk = true ; final com.google.gerrit.server.cache.CacheProvider < K , V > b = new com.google.gerrit.server.cache.CacheProvider < K , V > ( disk , this , type ) ; bind ( key ) . toProvider ( b ) . in ( Scopes.SINGLETON ) ; return b ; }
Source:
public void run ( ) { try { threadScoper.scope ( new java.util.concurrent.Callable < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void call ( ) { runPushOperation ( ) ; return null ; } } ) . call ( ) ; } catch ( java.lang.Exception e ) { throw com.google.common.base.Throwables.propagate ( e ) ; } }

Target:
public void run ( ) { try { threadScoper.scope ( new java.util.concurrent.Callable < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void call ( ) { runPushOperation ( ) ; return null ; } } ) . call ( ) ; } catch ( java.lang.Exception e ) { throw com.google.common.base.Throwables.propagate ( e ) ; } finally { statesCleanUp ( ) ; } }
Source:
public java.util.Set < com.google.gerrit.reviewdb.AccountGroup.Id > getEffectiveGroups ( ) { if ( ( effectiveGroups ) == null ) { if ( authConfig.isIdentityTrustable ( state ( ) . getExternalIds ( ) ) ) { effectiveGroups = realm.groups ( state ( ) ) ; } else { effectiveGroups = authConfig.getRegisteredGroups ( ) ; } } return effectiveGroups ; }

Target:
public java.util.Set < com.google.gerrit.reviewdb.AccountGroup.Id > getEffectiveGroups ( ) { if ( ( effectiveGroups ) == null ) { java.util.Set < com.google.gerrit.reviewdb.AccountGroup.Id > seedGroups ; if ( authConfig.isIdentityTrustable ( state ( ) . getExternalIds ( ) ) ) { seedGroups = realm.groups ( state ( ) ) ; } else { seedGroups = authConfig.getRegisteredGroups ( ) ; } effectiveGroups = getIncludedGroups ( seedGroups ) ; } return effectiveGroups ; }
Source:
private com.google.gerrit.server.change.ChangeJson.ChangeInfo format ( com.google.gerrit.server.query.change.ChangeData cd , com.google.common.base.Optional < com.google.gerrit.reviewdb.client.PatchSet.Id > limitToPsId ) throws com.google.gwtorm.server.OrmException { accountLoader = accountLoaderFactory.create ( has ( com.google.gerrit.extensions.common.ListChangesOption.DETAILED_ACCOUNTS ) ) ; if ( has ( com.google.gerrit.extensions.common.ListChangesOption.REVIEWED ) ) { ensureReviewedLoaded ( java.util.Collections.singleton ( cd ) ) ; } com.google.gerrit.server.change.ChangeJson.ChangeInfo res = toChangeInfo ( cd , limitToPsId ) ; accountLoader.fill ( ) ; return res ; }

Target:
private com.google.gerrit.server.change.ChangeJson.ChangeInfo format ( com.google.gerrit.server.query.change.ChangeData cd , com.google.common.base.Optional < com.google.gerrit.reviewdb.client.PatchSet.Id > limitToPsId ) throws com.google.gwtorm.server.OrmException { accountLoader = accountLoaderFactory.create ( has ( com.google.gerrit.extensions.common.ListChangesOption.DETAILED_ACCOUNTS ) ) ; java.util.Set < com.google.gerrit.reviewdb.client.Change.Id > reviewed = com.google.common.collect.Sets.newHashSet ( ) ; if ( has ( com.google.gerrit.extensions.common.ListChangesOption.REVIEWED ) ) { reviewed = loadReviewed ( java.util.Collections.singleton ( cd ) ) ; } com.google.gerrit.server.change.ChangeJson.ChangeInfo res = toChangeInfo ( cd , reviewed , limitToPsId ) ; accountLoader.fill ( ) ; return res ; }
Source:
private static org.eclipse.jgit.diff.Edit readEdit ( final java.io.InputStream in ) throws java.io.IOException { final int beginA = com.google.gerrit.server.ioutil.BasicSerialization.readVarInt32 ( in ) ; final int endA = com.google.gerrit.server.ioutil.BasicSerialization.readVarInt32 ( in ) ; final int beginB = com.google.gerrit.server.ioutil.BasicSerialization.readVarInt32 ( in ) ; final int endB = com.google.gerrit.server.ioutil.BasicSerialization.readVarInt32 ( in ) ; return new org.eclipse.jgit.diff.Edit ( beginA , endA , beginB , endB ) ; }

Target:
private static com.google.gerrit.prettify.common.BaseEdit readEdit ( final java.io.InputStream in ) throws java.io.IOException { final int beginA = com.google.gerrit.server.ioutil.BasicSerialization.readVarInt32 ( in ) ; final int endA = com.google.gerrit.server.ioutil.BasicSerialization.readVarInt32 ( in ) ; final int beginB = com.google.gerrit.server.ioutil.BasicSerialization.readVarInt32 ( in ) ; final int endB = com.google.gerrit.server.ioutil.BasicSerialization.readVarInt32 ( in ) ; return new com.google.gerrit.prettify.common.BaseEdit ( beginA , endA , beginB , endB ) ; }
Source:
private com.google.gerrit.server.project.ProjectState newProjectState ( ) { com.google.gerrit.server.project.ProjectCache projectCache = null ; com.google.gerrit.reviewdb.Project.NameKey wildProject = null ; com.google.gerrit.server.project.ProjectControl.AssistedFactory projectControlFactory = null ; com.google.gerrit.server.project.ProjectState ps = new com.google.gerrit.server.project.ProjectState ( anonymousUser , projectCache , wildProject , projectControlFactory , new com.google.gerrit.reviewdb.Project ( parent ) , localRights ) ; ps.setInheritedRights ( inheritedRights ) ; return ps ; }

Target:
private com.google.gerrit.server.project.ProjectState newProjectState ( ) { com.google.gerrit.server.project.ProjectCache projectCache = null ; com.google.gerrit.reviewdb.Project.NameKey wildProject = new com.google.gerrit.reviewdb.Project.NameKey ( "-- All Projects --" ) ; com.google.gerrit.server.project.ProjectControl.AssistedFactory projectControlFactory = null ; com.google.gerrit.server.project.ProjectState ps = new com.google.gerrit.server.project.ProjectState ( anonymousUser , projectCache , wildProject , projectControlFactory , new com.google.gerrit.reviewdb.Project ( parent ) , localRights ) ; ps.setInheritedRights ( inheritedRights ) ; return ps ; }
Source:
public void listFilterWhitelistFiltersNotListedUser ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo changeInfo = createChangeAndReplyByEmail ( ) ; java.util.Collection < com.google.gerrit.extensions.common.ChangeMessageInfo > messages = gApi.changes ( ) . id ( changeInfo.id ) . get ( ) . messages ; com.google.common.truth.Truth.assertThat ( messages ) . hasSize ( 2 ) ; }

Target:
public void listFilterWhitelistFiltersNotListedUser ( ) throws java.lang.Exception { com.google.gerrit.extensions.common.ChangeInfo changeInfo = createChangeAndReplyByEmail ( ) ; java.util.Collection < com.google.gerrit.extensions.common.ChangeMessageInfo > messages = gApi.changes ( ) . id ( changeInfo.id ) . get ( ) . messages ; com.google.common.truth.Truth.assertThat ( messages ) . hasSize ( 2 ) ; com.google.common.truth.Truth.assertThat ( sender.getMessages ( ) ) . isEmpty ( ) ; }
Source:
protected void migrateData ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.schema.UpdateUI ui ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { com.google.gwtorm.jdbc.JdbcSchema schema = ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) ; com.google.gwtorm.schema.sql.SqlDialect dialect = schema.getDialect ( ) ; try ( com.google.gwtorm.server.StatementExecutor e = newExecutor ( db ) ) { dialect.dropIndex ( e , "account_external_ids" , "account_external_ids_byEmail" ) ; e.execute ( ( "CREATE INDEX account_external_ids_byEmail" + ( " ON account_external_ids" + " (email_address)" ) ) ) ; } }

Target:
protected void migrateData ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.schema.UpdateUI ui ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { com.google.gwtorm.jdbc.JdbcSchema schema = ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) ; com.google.gwtorm.schema.sql.SqlDialect dialect = schema.getDialect ( ) ; try ( com.google.gwtorm.server.StatementExecutor e = newExecutor ( db ) ) { try { dialect.dropIndex ( e , "account_external_ids" , "account_external_ids_byEmail" ) ; } catch ( com.google.gwtorm.server.OrmException ex ) { } e.execute ( ( "CREATE INDEX account_external_ids_byEmail" + ( " ON account_external_ids" + " (email_address)" ) ) ) ; } }
Source:
protected void configureServlets ( ) { serve ( "/say-hello/*" ) . with ( com.googlesource.gerrit.plugins.cookbook.HelloWorldServlet.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.webui.WebUiPlugin.class ) . toInstance ( new com.google.gerrit.extensions.webui.JavaScriptPlugin ( "hello-project.js" ) ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.webui.WebUiPlugin.class ) . toInstance ( new com.google.gerrit.extensions.webui.JavaScriptPlugin ( "hello-revision.js" ) ) ; }

Target:
protected void configureServlets ( ) { serve ( "/say-hello/*" ) . with ( com.googlesource.gerrit.plugins.cookbook.HelloWorldServlet.class ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.webui.WebUiPlugin.class ) . toInstance ( new com.google.gerrit.extensions.webui.JavaScriptPlugin ( "hello-project.js" ) ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.webui.WebUiPlugin.class ) . toInstance ( new com.google.gerrit.extensions.webui.JavaScriptPlugin ( "hello-revision.js" ) ) ; com.google.gerrit.extensions.registration.DynamicSet.bind ( binder ( ) , com.google.gerrit.extensions.webui.WebUiPlugin.class ) . toInstance ( new com.google.gerrit.extensions.webui.GwtPlugin ( "cookbook" ) ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.info.AccountInfo result ) { onCloseForm ( ) ; assigneeLink.setText ( "" ) ; }

Target:
private void setAssignee ( com.google.gerrit.client.info.AccountInfo assignee ) { currentAssignee = assignee ; assigneeLink.setText ( ( assignee != null ? getName ( assignee ) : null ) ) ; assigneeLink.setTargetHistoryToken ( ( assignee != null ? com.google.gerrit.common.PageLinks.toAssigneeQuery ( ( ( assignee.name ( ) ) != null ? assignee.name ( ) : ( assignee.email ( ) ) != null ? assignee.email ( ) : java.lang.String.valueOf ( assignee._accountId ( ) ) ) ) : "" ) ) ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; com.google.gerrit.client.projects.ProjectMap.all ( new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.client.projects.ProjectMap > ( this ) { @ java.lang.Override protected void preDisplay ( final com.google.gerrit.client.projects.ProjectMap result ) { projects.display ( result ) ; projects.finishDisplay ( ) ; } } ) ; }

Target:
protected void preDisplay ( final com.google.gerrit.client.projects.ProjectMap result ) { if ( ( ( subname ) == null ) || ( "" . equals ( subname ) ) ) { display ( result ) ; } }
Source:
public void listOneIncludeMember ( ) throws java.lang.Exception { java.lang.String gx = group ( "gx" ) ; java.lang.String gy = group ( "gy" ) ; gApi.groups ( ) . id ( gx ) . addGroups ( gy ) ; assertIncludes ( gApi.groups ( ) . id ( gx ) . includedGroups ( ) , gy ) ; }

Target:
public void listOneIncludeMember ( ) throws java.lang.Exception { java.lang.String gx = createGroup ( "gx" ) ; java.lang.String gy = createGroup ( "gy" ) ; gApi.groups ( ) . id ( gx ) . addGroups ( gy ) ; assertIncludes ( gApi.groups ( ) . id ( gx ) . includedGroups ( ) , gy ) ; }
Source:
private com.google.gerrit.server.plugins.ServerPluginProvider providerOf ( java.io.File srcFile ) { java.util.List < com.google.gerrit.server.plugins.ServerPluginProvider > providers = providersForHandlingPlugin ( srcFile ) ; switch ( providers.size ( ) ) { case 1 : return providers.get ( 0 ) ; case 0 : throw new java.lang.IllegalArgumentException ( ( "No ServerPluginProvider found/loaded to handle plugin file " + ( srcFile.getAbsolutePath ( ) ) ) ) ; default : throw new com.google.gerrit.server.plugins.MultipleProvidersForPluginException ( srcFile , providers ) ; } }

Target:
private com.google.gerrit.server.plugins.ServerPluginProvider providerOf ( java.nio.file.Path srcPath ) { java.util.List < com.google.gerrit.server.plugins.ServerPluginProvider > providers = providersForHandlingPlugin ( srcPath ) ; switch ( providers.size ( ) ) { case 1 : return providers.get ( 0 ) ; case 0 : throw new java.lang.IllegalArgumentException ( ( "No ServerPluginProvider found/loaded to handle plugin file " + ( srcPath.toAbsolutePath ( ) ) ) ) ; default : throw new com.google.gerrit.server.plugins.MultipleProvidersForPluginException ( srcPath , providers ) ; } }
Source:
private boolean canPushWithForce ( ) { if ( ( ! ( canWrite ( ) ) ) || ( ( GitRepositoryManager.REF_CONFIG.equals ( refName ) ) && ( ! ( projectControl.isOwner ( ) ) ) ) ) { return false ; } boolean result = false ; for ( com.google.gerrit.common.data.PermissionRule rule : access ( Permission.PUSH ) ) { if ( rule.isBlock ( ) ) { return false ; } if ( rule.getForce ( ) ) { result = true ; } } return result ; }

Target:
private boolean canPushWithForce ( ) { if ( ( ! ( canWrite ( ) ) ) || ( ( GitRepositoryManager.REF_CONFIG.equals ( refName ) ) && ( ! ( projectControl.isOwner ( ) ) ) ) ) { return false ; } return canForcePerform ( Permission.PUSH ) ; }
Source:
private com.google.gerrit.acceptance.RestResponse getWithHeader ( java.lang.String endPoint , org.apache.http.Header header ) throws java.io.IOException { org.apache.http.client.methods.HttpGet get = new org.apache.http.client.methods.HttpGet ( ( ( ( url ) + "/a" ) + endPoint ) ) ; if ( header != null ) { get.addHeader ( header ) ; } return new com.google.gerrit.acceptance.RestResponse ( getClient ( ) . execute ( get ) ) ; }

Target:
private com.google.gerrit.acceptance.RestResponse getWithHeader ( java.lang.String endPoint , org.apache.http.Header header ) throws java.io.IOException { org.apache.http.client.fluent.Request get = org.apache.http.client.fluent.Request.Get ( ( ( ( url ) + "/a" ) + endPoint ) ) ; if ( header != null ) { get.addHeader ( header ) ; } return execute ( get ) ; }
Source:
void addOption ( com.google.gerrit.extensions.api.changes.SubmittedTogetherOption o ) { options.add ( o ) ; }

Target:
void addOption ( java.lang.String option ) { for ( com.google.gerrit.extensions.client.ListChangesOption o : com.google.gerrit.extensions.client.ListChangesOption.values ( ) ) { if ( o.name ( ) . equalsIgnoreCase ( option ) ) { jsonOpt.add ( o ) ; return ; } } for ( com.google.gerrit.extensions.api.changes.SubmittedTogetherOption o : com.google.gerrit.extensions.api.changes.SubmittedTogetherOption.values ( ) ) { if ( o.name ( ) . equalsIgnoreCase ( option ) ) { options.add ( o ) ; return ; } } throw new java.lang.IllegalArgumentException ( ( "option not recognized: " + option ) ) ; }