auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void mkdir ( final java.io.File path ) { if ( ( ! ( path.isDirectory ( ) ) ) && ( ! ( path.mkdir ( ) ) ) ) { throw com.google.gerrit.pgm.init.api.InitUtil.die ( ( "Cannot make directory " + path ) ) ; } }

Target:
public static void mkdir ( java.nio.file.Path path ) { if ( java.nio.file.Files.isDirectory ( path ) ) { return ; } try { java.nio.file.Files.createDirectory ( path ) ; } catch ( java.io.IOException e ) { throw com.google.gerrit.pgm.init.api.InitUtil.die ( ( "Cannot make directory " + path ) , e ) ; } }
Source:
private boolean contains ( java.util.List < org.eclipse.jgit.revwalk.FooterLine > footers , org.eclipse.jgit.revwalk.FooterKey key , java.lang.String val ) { for ( final org.eclipse.jgit.revwalk.FooterLine line : footers ) { if ( ( line.matches ( key ) ) && ( val.equals ( line.getValue ( ) ) ) ) { return true ; } } return false ; }

Target:
private static < K , T > java.util.List < T > getList ( final K key , final java.util.Map < K , java.util.List < T > > map ) { java.util.List < T > list = map.get ( key ) ; if ( list == null ) { list = new java.util.ArrayList < T > ( ) ; map.put ( key , list ) ; } return list ; }
Source:
public void replace ( com.google.gerrit.reviewdb.client.AccountGroup group ) throws java.io.IOException { try { replace ( com.google.gerrit.lucene.LuceneGroupIndex.idTerm ( group ) , toDocument ( group ) ) . get ( ) ; } catch ( java.util.concurrent.ExecutionException | java.lang.InterruptedException e ) { throw new java.io.IOException ( e ) ; } }

Target:
public void replace ( com.google.gerrit.server.group.InternalGroup group ) throws java.io.IOException { try { replace ( com.google.gerrit.lucene.LuceneGroupIndex.idTerm ( group ) , toDocument ( group ) ) . get ( ) ; } catch ( java.util.concurrent.ExecutionException | java.lang.InterruptedException e ) { throw new java.io.IOException ( e ) ; } }
Source:
private void addSubgroups ( com.google.gerrit.server.group.GroupResource rsrc ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.group.AddSubgroups.Input input = AddSubgroups.Input.fromGroups ( initialGroups.stream ( ) . map ( com.google.gerrit.reviewdb.client.AccountGroup.UUID :: get ) . collect ( java.util.stream.Collectors.toList ( ) ) ) ; addSubgroups.apply ( rsrc , input ) ; }

Target:
private void addSubgroups ( com.google.gerrit.server.group.GroupResource rsrc ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gwtorm.server.OrmException , java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { com.google.gerrit.server.restapi.group.AddSubgroups.Input input = AddSubgroups.Input.fromGroups ( initialGroups.stream ( ) . map ( com.google.gerrit.reviewdb.client.AccountGroup.UUID :: get ) . collect ( java.util.stream.Collectors.toList ( ) ) ) ; addSubgroups.apply ( rsrc , input ) ; }
Source:
private void setEdit ( boolean edit ) { if ( edit ) { removeStyleName ( draftStyle.view ( ) ) ; addStyleName ( draftStyle.edit ( ) ) ; } else { removeStyleName ( draftStyle.edit ( ) ) ; addStyleName ( draftStyle.view ( ) ) ; } }

Target:
void setEdit ( boolean edit ) { if ( edit ) { removeStyleName ( draftStyle.view ( ) ) ; addStyleName ( draftStyle.edit ( ) ) ; editArea.setText ( contentPanelMessage.getText ( ) ) ; editArea.setFocus ( true ) ; } else { removeStyleName ( draftStyle.edit ( ) ) ; addStyleName ( draftStyle.view ( ) ) ; } resizePaddingWidget ( ) ; }
Source:
public void queryChangesNoOptions ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.common.ChangeInfo result = com.google.common.collect.Iterables.getOnlyElement ( query ( r.getChangeId ( ) ) ) ; org.junit.Assert.assertNull ( result.labels ) ; org.junit.Assert.assertNull ( result.messages ) ; org.junit.Assert.assertNull ( result.revisions ) ; org.junit.Assert.assertNull ( result.actions ) ; }

Target:
public void queryChangesNoOptions ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.common.ChangeInfo result = com.google.common.collect.Iterables.getOnlyElement ( query ( r.getChangeId ( ) ) ) ; com.google.common.truth.Truth.assertThat ( result.labels ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( result.messages ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( result.revisions ) . isNull ( ) ; com.google.common.truth.Truth.assertThat ( result.actions ) . isNull ( ) ; }
Source:
public final native void setMessage ( java.lang.String value ) ;

Target:
public static void revert ( int id , java.lang.String msg , com.google.gwtjsonrpc.common.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.Input input = com.google.gerrit.client.changes.ChangeApi.Input.create ( ) ; input.message ( com.google.gerrit.client.changes.ChangeApi.emptyToNull ( msg ) ) ; com.google.gerrit.client.changes.ChangeApi.api ( id , "revert" ) . data ( input ) . post ( cb ) ; }
Source:
private com.google.inject.Key < javax.servlet.http.HttpServlet > registerScreen ( ) { return key ( new javax.servlet.http.HttpServlet ( ) { private static final long serialVersionUID = 1L ; @ java.lang.Override protected void doGet ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { com.google.gerrit.httpd.UrlModule.toGerrit ( ( "/register" + ( req.getPathInfo ( ) ) ) , req , rsp ) ; } } ) ; }

Target:
private com.google.inject.Key < javax.servlet.http.HttpServlet > registerScreen ( final java.lang.Boolean slash ) { return key ( new javax.servlet.http.HttpServlet ( ) { private static final long serialVersionUID = 1L ; @ java.lang.Override protected void doGet ( final javax.servlet.http.HttpServletRequest req , final javax.servlet.http.HttpServletResponse rsp ) throws java.io.IOException { java.lang.String path = java.lang.String.format ( "/register%s" , ( slash ? req.getPathInfo ( ) : "" ) ) ; com.google.gerrit.httpd.UrlModule.toGerrit ( path , req , rsp ) ; } } ) ; }
Source:
private static com.google.gwt.user.client.ui.FlowPanel createAdminMenu ( ) { final com.google.gwt.user.client.ui.FlowPanel m = com.google.gerrit.client.Gerrit.createMenuList ( ) ; m.add ( new com.google.gwt.user.client.ui.Hyperlink ( com.google.gerrit.client.Gerrit.C.menuPeople ( ) , Link.ADMIN_PEOPLE ) ) ; m.add ( new com.google.gwt.user.client.ui.Hyperlink ( com.google.gerrit.client.Gerrit.C.menuGroups ( ) , Link.ADMIN_GROUPS ) ) ; m.add ( new com.google.gwt.user.client.ui.Hyperlink ( com.google.gerrit.client.Gerrit.C.menuProjects ( ) , Link.ADMIN_PROJECTS ) ) ; return m ; }

Target:
private static void addLink ( final com.google.gwt.user.client.ui.MenuBar m , final java.lang.String text , final java.lang.String historyToken ) { m.addItem ( new com.google.gerrit.client.ui.LinkMenuItem ( text , historyToken ) ) ; }
Source:
public void testFindAfterCommon ( ) { com.google.gerrit.client.diff.LineMapper mapper = new com.google.gerrit.client.diff.LineMapper ( ) ; mapper.appendCommon ( 10 ) ; org.junit.Assert.assertEquals ( 10 , mapper.lineOnOther ( Side.PARENT , 10 ) ) ; }

Target:
public void testFindAfterCommon ( ) { com.google.gerrit.client.diff.LineMapper mapper = new com.google.gerrit.client.diff.LineMapper ( ) ; mapper.appendCommon ( 10 ) ; org.junit.Assert.assertEquals ( new com.google.gerrit.client.diff.LineMapper.LineOnOtherInfo ( 10 , true ) , mapper.lineOnOther ( Side.PARENT , 10 ) ) ; org.junit.Assert.assertEquals ( new com.google.gerrit.client.diff.LineMapper.LineOnOtherInfo ( 10 , true ) , mapper.lineOnOther ( Side.REVISION , 10 ) ) ; }
Source:
public com.google.gerrit.reviewdb.client.Change reloadChange ( ) throws com.google.gwtorm.server.OrmException { change = db.changes ( ) . get ( legacyId ) ; return change ; }

Target:
public com.google.gerrit.reviewdb.client.Change reloadChange ( ) throws com.google.gwtorm.server.OrmException { notes = notesFactory.create ( db , project , legacyId ) ; change = notes.getChange ( ) ; if ( ( change ) == null ) { throw new com.google.gwtorm.server.OrmException ( ( "Unable to load change " + ( legacyId ) ) ) ; } return change ; }
Source:
public java.lang.String toBranch ( final com.google.gerrit.reviewdb.Branch.NameKey branch ) { com.google.gerrit.common.data.ParamertizedString pattern = new com.google.gerrit.common.data.ParamertizedString ( type.getBranch ( ) ) ; final java.util.Map < java.lang.String , java.lang.String > p = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; p.put ( "project" , com.google.gwt.http.client.URL.encodeComponent ( branch.getParentKey ( ) . get ( ) ) ) ; p.put ( "branch" , com.google.gwt.http.client.URL.encodeComponent ( branch.get ( ) ) ) ; return ( baseUrl ) + ( pattern.replace ( p ) ) ; }

Target:
public java.lang.String toBranch ( final com.google.gerrit.reviewdb.Branch.NameKey branch ) { com.google.gerrit.common.data.ParamertizedString pattern = new com.google.gerrit.common.data.ParamertizedString ( type.getBranch ( ) ) ; final java.util.Map < java.lang.String , java.lang.String > p = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; p.put ( "project" , com.google.gwt.http.client.URL.encodeQueryString ( branch.getParentKey ( ) . get ( ) ) ) ; p.put ( "branch" , com.google.gwt.http.client.URL.encodeQueryString ( branch.get ( ) ) ) ; return ( baseUrl ) + ( pattern.replace ( p ) ) ; }
Source:
public com.google.gerrit.extensions.common.RevisionInfo getRevisionInfo ( com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet in ) throws com.google.gerrit.server.GpgException , com.google.gerrit.server.patch.PatchListNotAvailableException , com.google.gwtorm.server.OrmException , java.io.IOException { accountLoader = accountLoaderFactory.create ( has ( com.google.gerrit.extensions.client.ListChangesOption.DETAILED_ACCOUNTS ) ) ; com.google.gerrit.extensions.common.RevisionInfo rev = toRevisionInfo ( ctl , in ) ; accountLoader.fill ( ) ; return rev ; }

Target:
public com.google.gerrit.extensions.common.RevisionInfo getRevisionInfo ( com.google.gerrit.server.project.ChangeControl ctl , com.google.gerrit.reviewdb.client.PatchSet in ) throws com.google.gerrit.server.GpgException , com.google.gerrit.server.patch.PatchListNotAvailableException , com.google.gwtorm.server.OrmException , java.io.IOException { accountLoader = accountLoaderFactory.create ( has ( com.google.gerrit.extensions.client.ListChangesOption.DETAILED_ACCOUNTS ) ) ; try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( ctl.getProject ( ) . getNameKey ( ) ) ) { com.google.gerrit.extensions.common.RevisionInfo rev = toRevisionInfo ( ctl , in , repo ) ; accountLoader.fill ( ) ; return rev ; } }
Source:
javax.naming.directory.DirContext authenticate ( java.lang.String dn , java.lang.String password ) throws com.google.gerrit.server.account.AccountException { final java.util.Properties env = createContextProperties ( ) ; env.put ( javax.naming.Context.SECURITY_AUTHENTICATION , "simple" ) ; env.put ( javax.naming.Context.SECURITY_PRINCIPAL , dn ) ; env.put ( javax.naming.Context.SECURITY_CREDENTIALS , password ) ; env.put ( javax.naming.Context.REFERRAL , referral ) ; try { return new javax.naming.directory.InitialDirContext ( env ) ; } catch ( javax.naming.NamingException e ) { throw new com.google.gerrit.server.account.AccountException ( "Incorrect username or password" , e ) ; } }

Target:
javax.naming.directory.DirContext authenticate ( java.lang.String dn , java.lang.String password ) throws com.google.gerrit.server.account.AccountException { final java.util.Properties env = createContextProperties ( ) ; env.put ( javax.naming.Context.SECURITY_AUTHENTICATION , "simple" ) ; env.put ( javax.naming.Context.SECURITY_PRINCIPAL , dn ) ; env.put ( javax.naming.Context.SECURITY_CREDENTIALS , password ) ; env.put ( javax.naming.Context.REFERRAL , referral ) ; try { return new javax.naming.directory.InitialDirContext ( env ) ; } catch ( javax.naming.NamingException e ) { throw new com.google.gerrit.server.account.AuthenticationFailedException ( "Incorrect username or password" , e ) ; } }
Source:
public static int findApproval ( com.googlecode.prolog_cafe.lang.Prolog engine , int minVoteLevel ) { return new com.googlesource.gerrit.plugins.findowners.Checker ( new com.googlesource.gerrit.plugins.findowners.Server ( engine ) , minVoteLevel ) . findApproval ( ) ; }

Target:
public static int findApproval ( com.googlecode.prolog_cafe.lang.Prolog engine , int minVoteLevel ) { try { com.google.gerrit.server.query.change.ChangeData changeData = StoredValues.CHANGE_DATA.get ( engine ) ; org.eclipse.jgit.lib.Repository repository = StoredValues.REPOSITORY.get ( engine ) ; return new com.googlesource.gerrit.plugins.findowners.Checker ( repository , changeData , minVoteLevel ) . findApproval ( ) ; } catch ( com.google.gwtorm.server.OrmException e ) { com.googlesource.gerrit.plugins.findowners.Checker.log.error ( "Exception" , e ) ; return 0 ; } }
Source:
public static synchronized java.io.File createTempDirectory ( ) throws java.io.IOException { java.io.File tmp = java.io.File.createTempFile ( "gerrit_test_" , "" ) ; if ( ( ! ( tmp.delete ( ) ) ) || ( ! ( tmp.mkdir ( ) ) ) ) { throw new java.io.IOException ( ( "Cannot create " + ( tmp.getPath ( ) ) ) ) ; } com.google.gerrit.acceptance.TempFileUtil.allDirsCreated.add ( tmp ) ; return tmp ; }

Target:
public static synchronized java.io.File createTempDirectory ( ) throws java.io.IOException { java.io.File tmp = java.io.File.createTempFile ( "gerrit_test_" , "" ) . getCanonicalFile ( ) ; if ( ( ! ( tmp.delete ( ) ) ) || ( ! ( tmp.mkdir ( ) ) ) ) { throw new java.io.IOException ( ( "Cannot create " + ( tmp.getPath ( ) ) ) ) ; } com.google.gerrit.acceptance.TempFileUtil.allDirsCreated.add ( tmp ) ; return tmp ; }
Source:
public void testCreateChildProject ( ) throws java.io.IOException { final java.lang.String parentName = "parent" ; com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( "/projects/" + parentName ) ) ; r.consume ( ) ; final java.lang.String childName = "child" ; com.google.gerrit.server.project.CreateProject.Input in = new com.google.gerrit.server.project.CreateProject.Input ( ) ; in.parent = parentName ; r = adminSession.put ( ( "/projects/" + childName ) , in ) ; com.google.gerrit.reviewdb.client.Project project = projectCache.get ( new com.google.gerrit.reviewdb.client.Project.NameKey ( childName ) ) . getProject ( ) ; org.junit.Assert.assertEquals ( in.parent , project.getParentName ( ) ) ; }

Target:
public void testCreateChildProject ( ) throws java.io.IOException { final java.lang.String parentName = "parent" ; com.google.gerrit.acceptance.RestResponse r = adminSession.put ( ( "/projects/" + parentName ) ) ; r.consume ( ) ; final java.lang.String childName = "child" ; com.google.gerrit.extensions.api.projects.ProjectInput in = new com.google.gerrit.extensions.api.projects.ProjectInput ( ) ; in.parent = parentName ; r = adminSession.put ( ( "/projects/" + childName ) , in ) ; com.google.gerrit.reviewdb.client.Project project = projectCache.get ( new com.google.gerrit.reviewdb.client.Project.NameKey ( childName ) ) . getProject ( ) ; org.junit.Assert.assertEquals ( in.parent , project.getParentName ( ) ) ; }
Source:
public void testUnblockMoreSpecificRef_Fails ( ) { grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/master" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertFalse ( "u can't push" , u.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }

Target:
public void testUnblockMoreSpecificRef_Fails ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/master" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertFalse ( "u can't push" , u.controlForRef ( "refs/heads/master" ) . canUpdate ( ) ) ; }
Source:
private static java.lang.String addKey ( java.util.List < com.google.common.base.Optional < com.google.gerrit.reviewdb.client.AccountSshKey > > keys , java.lang.String pub ) { com.google.gerrit.reviewdb.client.AccountSshKey.Id keyId = new com.google.gerrit.reviewdb.client.AccountSshKey.Id ( new com.google.gerrit.reviewdb.client.Account.Id ( 1 ) , ( ( keys.size ( ) ) + 1 ) ) ; com.google.gerrit.reviewdb.client.AccountSshKey key = new com.google.gerrit.reviewdb.client.AccountSshKey ( keyId , pub ) ; keys.add ( com.google.common.base.Optional.of ( key ) ) ; return ( key.getSshPublicKey ( ) ) + "\n" ; }

Target:
private static java.lang.String addKey ( java.util.List < java.util.Optional < com.google.gerrit.reviewdb.client.AccountSshKey > > keys , java.lang.String pub ) { com.google.gerrit.reviewdb.client.AccountSshKey.Id keyId = new com.google.gerrit.reviewdb.client.AccountSshKey.Id ( new com.google.gerrit.reviewdb.client.Account.Id ( 1 ) , ( ( keys.size ( ) ) + 1 ) ) ; com.google.gerrit.reviewdb.client.AccountSshKey key = new com.google.gerrit.reviewdb.client.AccountSshKey ( keyId , pub ) ; keys.add ( java.util.Optional.of ( key ) ) ; return ( key.getSshPublicKey ( ) ) + "\n" ; }
Source:
private void listen ( com.google.gerrit.server.plugins.PluginContentScanner.ExtensionMetaData def ) throws com.google.gerrit.server.plugins.InvalidPluginException { java.lang.Class < ? > clazz ; try { clazz = java.lang.Class.forName ( def.className , false , classLoader ) ; } catch ( java.lang.ClassNotFoundException err ) { throw new com.google.gerrit.server.plugins.InvalidPluginException ( java.lang.String.format ( "Cannot load %s with @Listen" , def.className ) , err ) ; } com.google.gerrit.extensions.annotations.Listen listen = clazz.getAnnotation ( com.google.gerrit.extensions.annotations.Listen.class ) ; if ( listen != null ) { listen ( clazz , clazz ) ; } else { PluginLoader.log.warn ( java.lang.String.format ( "In plugin %s asm incorrectly parsed %s with @Listen" , pluginName , clazz.getName ( ) ) ) ; } }

Target:
private void listen ( com.google.gerrit.server.plugins.PluginContentScanner.ExtensionMetaData def ) throws com.google.gerrit.server.plugins.InvalidPluginException { java.lang.Class < ? > clazz ; try { clazz = java.lang.Class.forName ( def.className , false , classLoader ) ; } catch ( java.lang.ClassNotFoundException err ) { throw new com.google.gerrit.server.plugins.InvalidPluginException ( java.lang.String.format ( "Cannot load %s with @Listen" , def.className ) , err ) ; } com.google.gerrit.extensions.annotations.Listen listen = clazz.getAnnotation ( com.google.gerrit.extensions.annotations.Listen.class ) ; if ( listen != null ) { listen ( clazz , clazz ) ; } else { com.google.gerrit.server.plugins.AutoRegisterModules.log.warn ( java.lang.String.format ( "In plugin %s asm incorrectly parsed %s with @Listen" , pluginName , clazz.getName ( ) ) ) ; } }
Source:
public void destroy ( ) { synchronized ( this ) { if ( ( cmd ) != null ) { final com.google.gerrit.sshd.SshScopes.Context old = SshScopes.current.get ( ) ; try { SshScopes.current.set ( ctx ) ; cmd.destroy ( ) ; } finally { ctx = null ; cmd = null ; SshScopes.current.set ( old ) ; } } } }

Target:
public void destroy ( ) { synchronized ( this ) { if ( ( cmd ) != null ) { final com.google.gerrit.sshd.SshScopes.Context old = SshScopes.current.get ( ) ; try { SshScopes.current.set ( ctx ) ; cmd.destroy ( ) ; log ( BaseCommand.STATUS_CANCEL ) ; } finally { ctx = null ; cmd = null ; SshScopes.current.set ( old ) ; } } } }
Source:
public void customConflictMessageWithHostNameTest ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.automerger.FailedMergeException fme = new com.googlesource.gerrit.plugins.automerger.FailedMergeException ( failedMergeBranches , currentRevision , hostName , "${hostname}: ${conflict}" , topic ) ; java.lang.String branch1String = ( hostName ) + ": branch1 merge conflict" ; java.lang.String branch2String = ( hostName ) + ": branch2 merge conflict" ; java.lang.String branch3String = ( hostName ) + ": branch3 merge conflict" ; com.google.common.truth.Truth.assertThat ( fme.getDisplayString ( ) . split ( "\\n" ) ) . asList ( ) . containsExactly ( branch1String , branch2String , branch3String ) ; }

Target:
public void customConflictMessageWithConflictSubstitutionTest ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.automerger.FailedMergeException fme = new com.googlesource.gerrit.plugins.automerger.FailedMergeException ( failedMergeBranches , currentRevision , hostName , projectName , changeNumber , patchsetNumber , "${branch}: ${conflict}" , topic ) ; java.lang.String branch1String = "branch1: branch1 merge conflict" ; java.lang.String branch2String = "branch2: branch2 merge conflict" ; java.lang.String branch3String = "branch3: branch3 merge conflict" ; com.google.common.truth.Truth.assertThat ( fme.getDisplayString ( ) . split ( "\\n" ) ) . asList ( ) . containsExactly ( branch1String , branch2String , branch3String ) ; }
Source:
public java.lang.Runnable getRunnable ( ) { return runnable ; }

Target:
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 ; } }
Source:
void clearDiffGutters ( ) { for ( java.util.Iterator < com.google.gerrit.client.diff.SidePanel.GutterWrapper > i = gutters.iterator ( ) ; i.hasNext ( ) ; ) { com.google.gerrit.client.diff.SidePanel.GutterWrapper wrapper = i.next ( ) ; switch ( wrapper.type ) { case INSERT : case DELETE : case EDIT : wrapper.gutter.removeFromParent ( ) ; i.remove ( ) ; } } }

Target:
void clearDiffGutters ( ) { for ( java.util.Iterator < com.google.gerrit.client.diff.OverviewBar.GutterWrapper > i = gutters.iterator ( ) ; i.hasNext ( ) ; ) { com.google.gerrit.client.diff.OverviewBar.GutterWrapper wrapper = i.next ( ) ; switch ( wrapper.type ) { case INSERT : case DELETE : case EDIT : wrapper.gutter.removeFromParent ( ) ; i.remove ( ) ; } } }
Source:
public void currentPatchSetMissing ( ) throws java.lang.Exception { assumeNoteDbDisabled ( ) ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( ) ; db.patchSets ( ) . deleteKeys ( java.util.Collections.singleton ( ctl.getChange ( ) . currentPatchSetId ( ) ) ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( "Current patch set 1 not found" ) ) ; }

Target:
public void currentPatchSetMissing ( ) throws java.lang.Exception { assumeNoteDbDisabled ( ) ; com.google.gerrit.server.notedb.ChangeNotes notes = insertChange ( ) ; db.patchSets ( ) . deleteKeys ( java.util.Collections.singleton ( notes.getChange ( ) . currentPatchSetId ( ) ) ) ; assertProblems ( notes , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( "Current patch set 1 not found" ) ) ; }
Source:
com.google.common.util.concurrent.ListeningExecutorService getIndexExecutor ( @ com.google.gerrit.server.config.GerritServerConfig org.eclipse.jgit.lib.Config config , com.google.gerrit.server.git.WorkQueue workQueue ) { int threads = this . threads ; if ( threads <= 0 ) { threads = config.getInt ( "index" , null , "threads" , 0 ) ; } if ( threads <= 0 ) { return com.google.common.util.concurrent.MoreExecutors.newDirectExecutorService ( ) ; } return com.google.common.util.concurrent.MoreExecutors.listeningDecorator ( workQueue.createQueue ( threads , "index" ) ) ; }

Target:
com.google.common.util.concurrent.ListeningExecutorService getBatchIndexExecutor ( @ com.google.gerrit.server.index.IndexExecutor ( value = com.google.gerrit.server.git.QueueProvider.QueueType.INTERACTIVE ) com.google.common.util.concurrent.ListeningExecutorService interactive , @ com.google.gerrit.server.config.GerritServerConfig org.eclipse.jgit.lib.Config config , com.google.gerrit.server.git.WorkQueue workQueue ) { if ( ( batchExecutor ) != null ) { return batchExecutor ; } int threads = config.getInt ( "index" , null , "batchThreads" , 0 ) ; if ( threads <= 0 ) { return interactive ; } return com.google.common.util.concurrent.MoreExecutors.listeningDecorator ( workQueue.createQueue ( threads , "Index-Batch" ) ) ; }
Source:
protected void configureServlets ( ) { rpc ( com.google.gerrit.server.rpc.AccountServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.AccountSecurityImpl.class ) ; rpc ( com.google.gerrit.server.rpc.GroupAdminServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.ChangeDetailServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.ChangeListServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.ChangeManageServiceImpl.class ) ; rpc ( com.google.gerrit.server.patch.PatchDetailServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.ProjectAdminServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.SuggestServiceImpl.class ) ; rpc ( com.google.gerrit.server.rpc.SystemInfoServiceImpl.class ) ; }

Target:
protected void configure ( ) { factory ( ChangeDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; }
Source:
public void byPathRegex ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.InMemoryRepository > repo = createProject ( "repo" ) ; org.eclipse.jgit.revwalk.RevCommit commit = repo.parseBody ( repo.commit ( ) . message ( "one" ) . add ( "dir/file1" , "contents1" ) . add ( "dir/file2" , "contents2" ) . create ( ) ) ; com.google.gerrit.reviewdb.client.Change change = newChange ( repo , commit , null , null , null ) . insert ( ) ; com.google.common.truth.Truth.assertThat ( query ( "path:.*file.*" ) ) . isEmpty ( ) ; assertResultEquals ( change , queryOne ( "path:^dir.file.*" ) ) ; }

Target:
public void byPathRegex ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.InMemoryRepository > repo = createProject ( "repo" ) ; org.eclipse.jgit.revwalk.RevCommit commit = repo.parseBody ( repo.commit ( ) . message ( "one" ) . add ( "dir/file1" , "contents1" ) . add ( "dir/file2" , "contents2" ) . create ( ) ) ; com.google.gerrit.reviewdb.client.Change change = newChange ( repo , commit , null , null , null ) . insert ( ) ; assertQuery ( "path:.*file.*" ) ; assertQuery ( "path:^dir.file.*" , change ) ; }
Source:
public static java.lang.String name ( com.google.gerrit.client.info.AccountInfo ai ) { if ( ( ( ai.name ( ) ) != null ) && ( ! ( ai.name ( ) . trim ( ) . isEmpty ( ) ) ) ) { return ai.name ( ) ; } java.lang.String email = ai.email ( ) ; if ( email != null ) { int at = email.indexOf ( '@' ) ; return 0 < at ? email.substring ( 0 , at ) : email ; } return com.google.gerrit.client.FormatUtil.nameEmail ( ai ) ; }

Target:
public static java.lang.String name ( com.google.gerrit.client.info.AccountInfo info ) { return com.google.gerrit.client.FormatUtil.createAccountFormatter ( ) . name ( info ) ; }
Source:
public boolean equals ( java.lang.Object other ) { if ( other instanceof com.google.gwtorm.data.TestPerson ) { com.google.gwtorm.data.TestPerson p = ( ( com.google.gwtorm.data.TestPerson ) ( other ) ) ; return ( ( name.equals ( p.name ) ) && ( ( age ) == ( p.age ) ) ) && ( ( registered ) == ( p.registered ) ) ; } return false ; }

Target:
public boolean equals ( java.lang.Object other ) { if ( other instanceof com.google.gwtorm.data.Person ) { com.google.gwtorm.data.Person p = ( ( com.google.gwtorm.data.Person ) ( other ) ) ; return ( ( name.equals ( p.name ) ) && ( ( age ) == ( p.age ) ) ) && ( ( registered ) == ( p.registered ) ) ; } return false ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { save.setEnabled ( false ) ; com.google.gerrit.client.projects.ProjectApi.setHead ( getProjectKey ( ) , input.getValue ( ) . trim ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.rpc.NativeString > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.rpc.NativeString result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toProjectTags ( getProjectKey ( ) ) ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { super . onFailure ( caught ) ; save.setEnabled ( true ) ; } } ) ; }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { doAddNewTag ( ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; schemaFactory = org.easymock.EasyMock.createStrictMock ( com.google.gwtorm.server.SchemaFactory.class ) ; schema = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.reviewdb.server.ReviewDb.class ) ; subscriptions = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.reviewdb.server.SubmoduleSubscriptionAccess.class ) ; urlProvider = org.easymock.EasyMock.createStrictMock ( com.google.inject.Provider.class ) ; repoManager = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.server.git.GitRepositoryManager.class ) ; gitRefUpdated = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.server.extensions.events.GitReferenceUpdated.class ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; schemaFactory = org.easymock.EasyMock.createStrictMock ( com.google.gwtorm.server.SchemaFactory.class ) ; schema = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.reviewdb.server.ReviewDb.class ) ; subscriptions = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.reviewdb.server.SubmoduleSubscriptionAccess.class ) ; urlProvider = org.easymock.EasyMock.createStrictMock ( com.google.inject.Provider.class ) ; repoManager = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.server.git.GitRepositoryManager.class ) ; gitRefUpdated = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.server.extensions.events.GitReferenceUpdated.class ) ; notesFactory = new com.google.gerrit.server.notedb.ChangeNotes.Factory ( repoManager ) ; }
Source:
public void testVerifyAgainstMissingToken ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( auth.verifyAgainstToken ( "" , "o" , org.eclipse.jgit.lfs.lib.LongObjectId.zeroId ( ) ) ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( auth.verifyAgainstToken ( null , "o" , org.eclipse.jgit.lfs.lib.LongObjectId.zeroId ( ) ) ) . isFalse ( ) ; }

Target:
public void testVerifyAgainstDifferentObjectId ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.lfs.fs.LfsFsRequestAuthorizer.AuthInfo info = auth.generateAuthInfo ( "o" , org.eclipse.jgit.lfs.lib.LongObjectId.zeroId ( ) , 1 ) ; com.google.common.truth.Truth.assertThat ( auth.verifyAuthInfo ( info.authToken , "o" , org.eclipse.jgit.lfs.lib.LongObjectId.fromString ( ( "123456789012345678901234567890" + ( "123456789012345678901234567890" + "1234" ) ) ) ) ) . isFalse ( ) ; }
Source:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.googlecode.prolog_cafe.lang.Term a1 = engine.r1 ; java.util.regex.Matcher matcher = ( ( java.util.regex.Matcher ) ( ( ( com.googlecode.prolog_cafe.lang.JavaObjectTerm ) ( a1 ) ) . object ( ) ) ) ; if ( ! ( matcher.find ( ) ) ) { return engine.fail ( ) ; } return engine.jtry ( com.googlecode.prolog_cafe.builtin.PRED_regex_match_3.regex_check , com.googlecode.prolog_cafe.builtin.PRED_regex_match_3.regex_next , new com.googlecode.prolog_cafe.lang.ChoicePointFrame.S2 ( engine ) ) ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) { com.googlecode.prolog_cafe.lang.Term a1 = engine.r1 ; java.util.regex.Matcher matcher = ( ( java.util.regex.Matcher ) ( ( ( com.googlecode.prolog_cafe.lang.JavaObjectTerm ) ( a1 ) ) . object ( ) ) ) ; if ( ! ( matcher.find ( ) ) ) { return engine.fail ( ) ; } return engine.jtry2 ( com.googlecode.prolog_cafe.builtin.PRED_regex_match_3.regex_check , com.googlecode.prolog_cafe.builtin.PRED_regex_match_3.regex_next ) ; }
Source:
public com.google.gerrit.server.plugins.ServerPlugin get ( java.io.File srcFile , org.eclipse.jgit.internal.storage.file.FileSnapshot snapshot , com.googlesource.gerrit.plugins.scripting.scala.PluginDescription description ) throws com.google.gerrit.server.plugins.InvalidPluginException { com.googlesource.gerrit.plugins.scripting.scala.ScalaPluginScriptEngine scriptEngine = scriptEngineProvider.get ( ) ; java.lang.String name = getPluginName ( srcFile ) ; return new com.google.gerrit.server.plugins.ServerPlugin ( name , description.canonicalUrl , description.user , srcFile , snapshot , new com.googlesource.gerrit.plugins.scripting.scala.ScalaPluginScanner ( name , srcFile , scriptEngine ) , description.dataDir , scriptEngine.getClassLoader ( ) ) ; }

Target:
public com.google.gerrit.server.plugins.ServerPlugin get ( java.nio.file.Path srcFile , org.eclipse.jgit.internal.storage.file.FileSnapshot snapshot , com.googlesource.gerrit.plugins.scripting.scala.PluginDescription description ) throws com.google.gerrit.server.plugins.InvalidPluginException { com.googlesource.gerrit.plugins.scripting.scala.ScalaPluginScriptEngine scriptEngine = scriptEngineProvider.get ( ) ; java.lang.String name = getPluginName ( srcFile ) ; return new com.google.gerrit.server.plugins.ServerPlugin ( name , description.canonicalUrl , description.user , srcFile , snapshot , new com.googlesource.gerrit.plugins.scripting.scala.ScalaPluginScanner ( name , srcFile , scriptEngine ) , description.dataDir , scriptEngine.getClassLoader ( ) ) ; }
Source:
public void nameEscaperEscapesSpacesWithPercentInsteadOfPlus ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( com.google.gitiles.GitilesUrls.NAME_ESCAPER.apply ( "foo+bar" ) ) . isEqualTo ( "foo+bar" ) ; com.google.common.truth.Truth.assertThat ( com.google.gitiles.GitilesUrls.NAME_ESCAPER.apply ( "foo bar" ) ) . isEqualTo ( "foo%20bar" ) ; com.google.common.truth.Truth.assertThat ( com.google.gitiles.GitilesUrls.NAME_ESCAPER.apply ( "foo%20bar" ) ) . isEqualTo ( "foo%2520bar" ) ; }

Target:
public void nameEscaperEscapesSpacesWithPercentInsteadOfPlus ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( com.google.gitiles.GitilesUrls.escapeName ( "foo+bar" ) ) . isEqualTo ( "foo+bar" ) ; com.google.common.truth.Truth.assertThat ( com.google.gitiles.GitilesUrls.escapeName ( "foo bar" ) ) . isEqualTo ( "foo%20bar" ) ; com.google.common.truth.Truth.assertThat ( com.google.gitiles.GitilesUrls.escapeName ( "foo%20bar" ) ) . isEqualTo ( "foo%2520bar" ) ; }
Source:
public void testDoPostErrorWhileSendingErrorMessage ( ) throws java.lang.Exception { org.mockito.Mockito.doThrow ( new java.io.IOException ( com.ericsson.gerrit.plugins.syncevents.SyncEventsRestApiServletTest.ERR_MSG ) ) . when ( req ) . getReader ( ) ; org.mockito.Mockito.doThrow ( new java.io.IOException ( "someOtherError" ) ) . when ( rsp ) . sendError ( javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST , com.ericsson.gerrit.plugins.syncevents.SyncEventsRestApiServletTest.ERR_MSG ) ; syncEventsRestApiServlet.doPost ( req , rsp ) ; }

Target:
public void testDoPostErrorWhileSendingErrorMessage ( ) throws java.lang.Exception { org.mockito.Mockito.doThrow ( new java.io.IOException ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.EventRestApiServletTest.ERR_MSG ) ) . when ( req ) . getReader ( ) ; org.mockito.Mockito.doThrow ( new java.io.IOException ( "someOtherError" ) ) . when ( rsp ) . sendError ( javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST , com.ericsson.gerrit.plugins.highavailability.forwarder.rest.EventRestApiServletTest.ERR_MSG ) ; eventRestApiServlet.doPost ( req , rsp ) ; }
Source:
public void setTopView ( com.google.gerrit.client.patches.PatchScreen.TopView tv ) { topView = tv ; topPanel.clear ( ) ; switch ( tv ) { case COMMIT : topPanel.add ( commitMessageBlock ) ; break ; case PREFERENCES : topPanel.add ( settingsPanel ) ; break ; case PATCH_SETS : topPanel.add ( historyTable ) ; break ; case FILES : topPanel.add ( fileList ) ; break ; } }

Target:
public void setTopView ( com.google.gerrit.client.patches.PatchScreen.TopView tv ) { topView = tv ; topPanel.clear ( ) ; switch ( tv ) { case COMMIT : topPanel.add ( commitMessageBlock ) ; break ; case PREFERENCES : topPanel.add ( settingsPanel ) ; break ; case PATCH_SETS : topPanel.add ( historyTable ) ; break ; case FILES : topPanel.add ( fileList ) ; break ; case MAIN : break ; } }
Source:
public void onSuccess ( com.google.gerrit.client.info.ChangeInfo result ) { display ( result ) ; }

Target:
public void onFailure ( java.lang.Throwable err ) { if ( isSigninFailure ( err ) ) { new com.google.gerrit.client.NotSignedInDialog ( ) . center ( ) ; } else { com.google.gwt.user.client.ui.UIObject.setVisible ( error , true ) ; error.setInnerText ( ( err instanceof com.google.gwt.user.client.rpc.StatusCodeException ? ( ( com.google.gwt.user.client.rpc.StatusCodeException ) ( err ) ) . getEncodedResponse ( ) : err.getMessage ( ) ) ) ; } }
Source:
private static com.google.gerrit.server.account.AccountState missing ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( accountId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; account.setActive ( false ) ; java.util.Collection < com.google.gerrit.reviewdb.client.AccountExternalId > ids = java.util.Collections.emptySet ( ) ; java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > anon = com.google.common.collect.ImmutableSet.of ( ) ; return new com.google.gerrit.server.account.AccountState ( account , anon , ids ) ; }

Target:
private static com.google.gerrit.server.account.AccountState missing ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { com.google.gerrit.reviewdb.client.Account account = new com.google.gerrit.reviewdb.client.Account ( accountId , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; account.setActive ( false ) ; java.util.Collection < com.google.gerrit.reviewdb.client.AccountExternalId > ids = java.util.Collections.emptySet ( ) ; java.util.Collection < com.google.gerrit.reviewdb.client.AccountProjectWatch > projectWatches = java.util.Collections.emptySet ( ) ; java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > anon = com.google.common.collect.ImmutableSet.of ( ) ; return new com.google.gerrit.server.account.AccountState ( account , anon , ids , projectWatches ) ; }
Source:
private static void diffChanges ( java.util.List < java.lang.String > diffs , com.google.gerrit.server.notedb.ChangeBundle bundleA , com.google.gerrit.server.notedb.ChangeBundle bundleB ) { com.google.gerrit.reviewdb.client.Change a = bundleA.change ; com.google.gerrit.reviewdb.client.Change b = bundleB.change ; java.lang.String desc = ( a.getId ( ) . equals ( b.getId ( ) ) ) ? com.google.gerrit.server.notedb.ChangeBundle.describe ( a.getId ( ) ) : "Changes" ; com.google.gerrit.server.notedb.ChangeBundle.diffColumns ( diffs , com.google.gerrit.reviewdb.client.Change.class , desc , bundleA , a , bundleB , b ) ; }

Target:
private static void diffChanges ( java.util.List < java.lang.String > diffs , com.google.gerrit.server.notedb.ChangeBundle bundleA , com.google.gerrit.server.notedb.ChangeBundle bundleB ) { com.google.gerrit.reviewdb.client.Change a = bundleA.change ; com.google.gerrit.reviewdb.client.Change b = bundleB.change ; java.lang.String desc = ( a.getId ( ) . equals ( b.getId ( ) ) ) ? com.google.gerrit.server.notedb.ChangeBundle.describe ( a.getId ( ) ) : "Changes" ; com.google.gerrit.server.notedb.ChangeBundle.diffColumnsExcluding ( diffs , com.google.gerrit.reviewdb.client.Change.class , desc , bundleA , a , bundleB , b , "rowVersion" , "noteDbState" ) ; }
Source:
private com.google.gerrit.reviewdb.AccountGroup lookup ( final com.google.gerrit.reviewdb.AccountGroup.ExternalNameKey externalName ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.reviewdb.ReviewDb db = schema.open ( ) ; try { return db.accountGroups ( ) . get ( externalName ) ; } finally { db.close ( ) ; } }

Target:
private java.util.Collection < com.google.gerrit.reviewdb.AccountGroup > lookup ( final com.google.gerrit.reviewdb.AccountGroup.ExternalNameKey name ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.reviewdb.ReviewDb db = schema.open ( ) ; try { return db.accountGroups ( ) . byExternalName ( name ) . toList ( ) ; } finally { db.close ( ) ; } }
Source:
private java.util.List < com.google.gerrit.server.git.CodeReviewCommit > sort ( java.util.Collection < com.google.gerrit.server.git.CodeReviewCommit > toSort ) throws com.google.gerrit.server.git.MergeException { try { java.util.List < com.google.gerrit.server.git.CodeReviewCommit > result = new com.google.gerrit.server.git.RebaseSorter ( args.rw , args.alreadyAccepted , args.canMergeFlag ) . sort ( toSort ) ; java.util.Collections.sort ( result , CodeReviewCommit.ORDER ) ; return result ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.git.MergeException ( "Commit sorting failed" , e ) ; } }

Target:
private java.util.List < com.google.gerrit.server.git.CodeReviewCommit > sort ( java.util.Collection < com.google.gerrit.server.git.CodeReviewCommit > toSort ) throws com.google.gerrit.server.git.IntegrationException { try { java.util.List < com.google.gerrit.server.git.CodeReviewCommit > result = new com.google.gerrit.server.git.RebaseSorter ( args.rw , args.alreadyAccepted , args.canMergeFlag ) . sort ( toSort ) ; java.util.Collections.sort ( result , CodeReviewCommit.ORDER ) ; return result ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.server.git.IntegrationException ( "Commit sorting failed" , e ) ; } }
Source:
public org.eclipse.jgit.lib.Repository openMetadataRepository ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { com.google.common.base.Preconditions.checkState ( ( ( noteDbPath ) != null ) , "notedb disabled" ) ; try { return openRepository ( noteDbPath , name ) ; } catch ( org.eclipse.jgit.errors.RepositoryNotFoundException e ) { return createRepository ( noteDbPath , name ) ; } }

Target:
public org.eclipse.jgit.lib.Repository openMetadataRepository ( com.google.gerrit.reviewdb.client.Project.NameKey name ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { com.google.common.base.Preconditions.checkState ( notesMigration.readChanges ( ) , "notedb disabled" ) ; try { return openRepository ( noteDbPath , name ) ; } catch ( org.eclipse.jgit.errors.RepositoryNotFoundException e ) { return createRepository ( noteDbPath , name ) ; } }
Source:
private void mergeImpl ( ) throws com.google.gerrit.git.MergeException { openRepository ( ) ; openBranch ( ) ; listPendingSubmits ( ) ; validateChangeList ( ) ; reduceToMinimalMerge ( ) ; mergeTopics ( ) ; markCleanMerges ( ) ; updateBranch ( ) ; updateChangeStatus ( ) ; }

Target:
private void mergeImpl ( ) throws com.google.gerrit.git.MergeException { openRepository ( ) ; openBranch ( ) ; listPendingSubmits ( ) ; validateChangeList ( ) ; mergeTip = branchTip ; switch ( destProject.getSubmitType ( ) ) { case CHERRY_PICK : cherryPickChanges ( ) ; break ; case FAST_FORWARD_ONLY : case MERGE_ALWAYS : case MERGE_IF_NECESSARY : default : reduceToMinimalMerge ( ) ; mergeTopics ( ) ; markCleanMerges ( ) ; break ; } updateBranch ( ) ; updateChangeStatus ( ) ; }
Source:
private void assertCreateFails ( java.lang.Class < ? extends com.google.gerrit.extensions.restapi.RestApiException > errType ) throws java.lang.Exception { assertCreateFails ( errType , null ) ; }

Target:
private void assertCreateSucceeds ( com.google.gerrit.reviewdb.client.Branch.NameKey branch ) throws java.lang.Exception { com.google.gerrit.extensions.api.projects.BranchInfo created = branch ( branch ) . create ( new com.google.gerrit.extensions.api.projects.BranchInput ( ) ) . get ( ) ; com.google.common.truth.Truth.assertThat ( created.ref ) . isEqualTo ( ( ( org.eclipse.jgit.lib.Constants.R_HEADS ) + ( branch.getShortName ( ) ) ) ) ; }
Source:
private java.util.Collection < com.google.gerrit.reviewdb.AccountExternalId > old ( ) throws com.google.gwtorm.client.OrmException { final java.util.Collection < com.google.gerrit.reviewdb.AccountExternalId > r = new java.util.ArrayList < com.google.gerrit.reviewdb.AccountExternalId > ( 1 ) ; for ( com.google.gerrit.reviewdb.AccountExternalId i : db.accountExternalIds ( ) . byAccount ( user.getAccountId ( ) ) ) { if ( i.isScheme ( com.google.gerrit.reviewdb.AccountExternalId.SCHEME_USERNAME ) ) { r.add ( i ) ; } } return r ; }

Target:
private java.util.Collection < com.google.gerrit.reviewdb.AccountExternalId > old ( ) { final java.util.Collection < com.google.gerrit.reviewdb.AccountExternalId > r = new java.util.ArrayList < com.google.gerrit.reviewdb.AccountExternalId > ( 1 ) ; for ( com.google.gerrit.reviewdb.AccountExternalId i : accountExternalIdCache.byAccount ( user.getAccountId ( ) ) ) { if ( i.isScheme ( com.google.gerrit.reviewdb.AccountExternalId.SCHEME_USERNAME ) ) { r.add ( i ) ; } } return r ; }
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.SUBLIME.name ( ) . toLowerCase ( ) , KeyMapType.SUBLIME.name ( ) ) ; keyMap.addItem ( KeyMapType.VIM.name ( ) . toLowerCase ( ) , KeyMapType.VIM.name ( ) ) ; }

Target:
private void initKeyMapType ( ) { for ( com.google.gerrit.extensions.client.KeyMapType t : com.google.gerrit.extensions.client.KeyMapType.values ( ) ) { keyMap.addItem ( t.name ( ) . toLowerCase ( ) , t.name ( ) ) ; } }
Source:
public void abandonWipChangeInNoteDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; abandon ( sc.changeId , sc.owner ) ; assertThat ( sender ) . notSent ( ) ; }

Target:
public void abandonReviewableWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableWipChange ( ) ; abandon ( sc.changeId , sc.owner ) ; assertThat ( sender ) . sent ( "abandon" , sc ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) . noOneElse ( ) ; }
Source:
private < V , K > com.google.gerrit.server.cache.h2.H2CacheImpl.SqlStore < K , V > newSqlStore ( java.lang.String name , com.google.inject.TypeLiteral < K > keyType , long maxSize ) { java.io.File db = new java.io.File ( cacheDir , name ) . getAbsoluteFile ( ) ; java.lang.String url = "jdbc:h2:" + ( db.toURI ( ) . toString ( ) ) ; return new com.google.gerrit.server.cache.h2.H2CacheImpl.SqlStore ( url , keyType , maxSize ) ; }

Target:
private < V , K > com.google.gerrit.server.cache.h2.H2CacheImpl.SqlStore < K , V > newSqlStore ( java.lang.String name , com.google.inject.TypeLiteral < K > keyType , long maxSize , java.lang.Long expireAfterWrite ) { java.io.File db = new java.io.File ( cacheDir , name ) . getAbsoluteFile ( ) ; java.lang.String url = "jdbc:h2:" + ( db.toURI ( ) . toString ( ) ) ; return new com.google.gerrit.server.cache.h2.H2CacheImpl.SqlStore ( url , keyType , maxSize , ( expireAfterWrite == null ? 0 : expireAfterWrite.longValue ( ) ) ) ; }