auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void shutdown ( ) { for ( final com.google.gerrit.server.git.WorkQueue.Executor p : queues ) { p.shutdown ( ) ; boolean isTerminated ; do { try { isTerminated = p.awaitTermination ( 10 , java.util.concurrent.TimeUnit.SECONDS ) ; } catch ( java.lang.InterruptedException ie ) { isTerminated = false ; } } while ( ! isTerminated ) ; } queues.clear ( ) ; }

Target:
private void stop ( ) { for ( final com.google.gerrit.server.git.WorkQueue.Executor p : queues ) { p.shutdown ( ) ; boolean isTerminated ; do { try { isTerminated = p.awaitTermination ( 10 , java.util.concurrent.TimeUnit.SECONDS ) ; } catch ( java.lang.InterruptedException ie ) { isTerminated = false ; } } while ( ! isTerminated ) ; } queues.clear ( ) ; }
Source:
public com.googlecode.prolog_cafe.lang.NumberTerm intDivide ( com.googlecode.prolog_cafe.lang.NumberTerm t ) { if ( t.isDouble ( ) ) throw new com.googlecode.prolog_cafe.exceptions.IllegalTypeException ( "integer" , t ) ; if ( ( t.intValue ( ) ) == 0 ) throw new com.googlecode.prolog_cafe.exceptions.EvaluationException ( "zero_divisor" ) ; return new com.googlecode.prolog_cafe.lang.IntegerTerm ( ( ( int ) ( ( this . val ) / ( t.intValue ( ) ) ) ) ) ; }

Target:
public com.googlecode.prolog_cafe.lang.NumberTerm intDivide ( com.googlecode.prolog_cafe.lang.NumberTerm t ) { if ( t instanceof com.googlecode.prolog_cafe.lang.DoubleTerm ) throw new com.googlecode.prolog_cafe.exceptions.IllegalTypeException ( "integer" , t ) ; if ( ( t.intValue ( ) ) == 0 ) throw new com.googlecode.prolog_cafe.exceptions.EvaluationException ( "zero_divisor" ) ; return new com.googlecode.prolog_cafe.lang.IntegerTerm ( ( ( int ) ( ( this . val ) / ( t.intValue ( ) ) ) ) ) ; }
Source:
protected boolean onSave ( org.eclipse.jgit.lib.CommitBuilder commit ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( isEmpty ( ) ) { return false ; } commit.setAuthor ( newIdent ( getUser ( ) . getAccount ( ) , when ) ) ; commit.setCommitter ( new org.eclipse.jgit.lib.PersonIdent ( serverIdent , when ) ) ; java.lang.StringBuilder msg = new java.lang.StringBuilder ( ) ; msg.append ( "Comment on patch set " ) . append ( psId.get ( ) ) ; commit.setMessage ( msg.toString ( ) ) ; return true ; }

Target:
protected boolean onSave ( org.eclipse.jgit.lib.CommitBuilder commit ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException { if ( isEmpty ( ) ) { return false ; } commit.setAuthor ( newIdent ( getUser ( ) . getAccount ( ) , when ) ) ; commit.setCommitter ( new org.eclipse.jgit.lib.PersonIdent ( serverIdent , when ) ) ; commit.setMessage ( java.lang.String.format ( "Comment on patch set %d" , psId.get ( ) ) ) ; return true ; }
Source:
public com.google.gerrit.server.git.MetaDataUpdate create ( com.google.gerrit.reviewdb.client.Project.NameKey name , org.eclipse.jgit.lib.BatchRefUpdate batch ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { com.google.gerrit.server.git.MetaDataUpdate md = factory.create ( name , mgr.openRepository ( name ) , batch ) ; md.getCommitBuilder ( ) . setAuthor ( serverIdent ) ; md.getCommitBuilder ( ) . setCommitter ( serverIdent ) ; return md ; }

Target:
public com.google.gerrit.server.git.MetaDataUpdate create ( com.google.gerrit.reviewdb.client.Project.NameKey name , org.eclipse.jgit.lib.BatchRefUpdate batch ) throws java.io.IOException , org.eclipse.jgit.errors.RepositoryNotFoundException { org.eclipse.jgit.lib.Repository repo = mgr.openRepository ( name ) ; com.google.gerrit.server.git.MetaDataUpdate md = factory.create ( name , repo , batch ) ; md.setCloseRepository ( true ) ; md.getCommitBuilder ( ) . setAuthor ( serverIdent ) ; md.getCommitBuilder ( ) . setCommitter ( serverIdent ) ; return md ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { if ( Hyperlink.impl.handleAsClick ( ( ( com.google.gwt.user.client.Event ) ( event.getNativeEvent ( ) ) ) ) ) { event.stopPropagation ( ) ; event.preventDefault ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toProject ( info.project_name_key ( ) ) ) ; } }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { if ( Hyperlink.impl.handleAsClick ( ( ( com.google.gwt.user.client.Event ) ( event.getNativeEvent ( ) ) ) ) ) { event.stopPropagation ( ) ; event.preventDefault ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toProject ( info.projectNameKey ( ) ) ) ; } }
Source:
private org.eclipse.jgit.lib.ObjectId writeTree ( org.eclipse.jgit.revwalk.RevTree srcTree , org.eclipse.jgit.lib.CommitBuilder commit ) throws java.io.IOException , org.eclipse.jgit.errors.ConfigInvalidException , org.eclipse.jgit.errors.IncorrectObjectTypeException , org.eclipse.jgit.errors.MissingObjectException , org.eclipse.jgit.errors.UnmergedPathException { try { newTree = readTree ( srcTree ) ; onSave ( commit ) ; return newTree.writeTree ( inserter ) ; } finally { newTree = null ; } }

Target:
public void write ( com.google.gerrit.server.git.VersionedMetaData config , org.eclipse.jgit.lib.CommitBuilder commit ) throws java.io.IOException { doSave ( config , commit ) ; final org.eclipse.jgit.lib.ObjectId res = newTree.writeTree ( inserter ) ; if ( res.equals ( srcTree ) ) { return ; } commit.setTreeId ( res ) ; if ( ( src ) != null ) { commit.addParentId ( src ) ; } src = inserter.insert ( commit ) ; srcTree = res ; }
Source:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > changeDrafts ( com.google.gerrit.server.change.RevisionResource rsrc ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByChangeAuthor ( db.get ( ) , rsrc.getNotes ( ) , rsrc.getAccountId ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }

Target:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > changeDrafts ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > drafts = com.google.common.collect.Maps.newHashMap ( ) ; for ( com.google.gerrit.reviewdb.client.PatchLineComment c : plcUtil.draftByChangeAuthor ( ctx.getDb ( ) , ctx.getNotes ( ) , user.getAccountId ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }
Source:
public void setUp ( ) throws java.lang.Exception { site = new com.google.gerrit.server.config.SitePaths ( com.google.gerrit.testutil.TempFileUtil.createTempDirectory ( ) . toPath ( ) ) ; site.resolve ( "git" ) . toFile ( ) . mkdir ( ) ; cfg = new org.eclipse.jgit.lib.Config ( ) ; cfg.setString ( "gerrit" , null , "basePath" , "git" ) ; repoManager = new com.google.gerrit.server.git.LocalDiskRepositoryManager ( site , cfg , createNiceMock ( com.google.gerrit.server.notedb.NotesMigration.class ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { site = new com.google.gerrit.server.config.SitePaths ( com.google.gerrit.testutil.TempFileUtil.createTempDirectory ( ) . toPath ( ) ) ; site.resolve ( "git" ) . toFile ( ) . mkdir ( ) ; cfg = new org.eclipse.jgit.lib.Config ( ) ; cfg.setString ( "gerrit" , null , "basePath" , "git" ) ; repoManager = new com.google.gerrit.server.git.LocalDiskRepositoryManager ( site , cfg , createNiceMock ( com.google.gerrit.server.notedb.NotesMigration.class ) ) ; repoManager.start ( ) ; }
Source:
private org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.InMemoryRepository > createProject ( java.lang.String name ) throws java.lang.Exception { com.google.gerrit.server.project.CreateProject create = projectFactory.create ( name ) ; create.apply ( TopLevelResource.INSTANCE , new com.google.gerrit.server.project.CreateProject.Input ( ) ) ; return new org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.InMemoryRepository > ( repoManager.openRepository ( new com.google.gerrit.reviewdb.client.Project.NameKey ( name ) ) ) ; }

Target:
protected org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.InMemoryRepository > createProject ( java.lang.String name ) throws java.lang.Exception { com.google.gerrit.server.project.CreateProject create = projectFactory.create ( name ) ; create.apply ( com.google.gerrit.server.query.change.AbstractQueryChangesTest.TLR , new com.google.gerrit.server.project.CreateProject.Input ( ) ) ; return new org.eclipse.jgit.junit.TestRepository < org.eclipse.jgit.internal.storage.dfs.InMemoryRepository > ( repoManager.openRepository ( new com.google.gerrit.reviewdb.client.Project.NameKey ( name ) ) ) ; }
Source:
private static void param ( java.lang.StringBuilder html , java.lang.String name , java.lang.String value ) { html.append ( "<param" ) ; com.google.gerrit.client.ui.CopyableText.attribute ( html , "name" , name ) ; com.google.gerrit.client.ui.CopyableText.attribute ( html , "value" , value ) ; html.append ( "/>" ) ; }

Target:
public java.lang.String getText ( ) { return text ; }
Source:
private java.util.Map < java.lang.String , java.lang.Object > buildNavbar ( com.google.gitiles.doc.MarkdownConfig cfg , com.google.gitiles.doc.MarkdownToHtml.Builder fmt , com.google.gitiles.doc.DocServlet.MarkdownFile navFile ) { com.google.gitiles.doc.Navbar navbar = new com.google.gitiles.doc.Navbar ( ) ; if ( navFile != null ) { navbar.setFormatter ( fmt.setFilePath ( navFile.path ) . build ( ) ) ; navbar.setMarkdown ( cfg , navFile.consumeContent ( ) ) ; } return navbar.toSoyData ( ) ; }

Target:
private static com.google.gitiles.doc.Navbar createNavbar ( com.google.gitiles.doc.MarkdownConfig cfg , com.google.gitiles.doc.MarkdownToHtml.Builder fmt , @ javax.annotation.Nullable com.google.gitiles.doc.DocServlet.MarkdownFile navFile ) { com.google.gitiles.doc.Navbar navbar = new com.google.gitiles.doc.Navbar ( ) . setConfig ( cfg ) ; if ( navFile != null ) { navbar.setFormatter ( fmt.setFilePath ( navFile.path ) . build ( ) ) . setMarkdown ( navFile.consumeContent ( ) ) ; } return navbar ; }
Source:
private static java.lang.String encodeDashboardId ( java.lang.String dashboardId ) { int c = dashboardId.indexOf ( ":" ) ; if ( 0 <= c ) { final java.lang.String ref = com.google.gwt.http.client.URL.encodeQueryString ( dashboardId.substring ( 0 , c ) ) ; final java.lang.String path = com.google.gwt.http.client.URL.encodeQueryString ( dashboardId.substring ( ( c + 1 ) ) ) ; return ( ref + ":" ) + path ; } else { return com.google.gwt.http.client.URL.encodeQueryString ( dashboardId ) ; } }

Target:
private static java.lang.String encodeDashboardId ( java.lang.String id ) { int c = id.indexOf ( ':' ) ; if ( 0 <= c ) { java.lang.String ref = com.google.gwt.http.client.URL.encodeQueryString ( id.substring ( 0 , c ) ) ; java.lang.String path = com.google.gwt.http.client.URL.encodeQueryString ( id.substring ( ( c + 1 ) ) ) ; return ( ref + ':' ) + path ; } return com.google.gwt.http.client.URL.encodeQueryString ( id ) ; }
Source:
private com.google.gerrit.server.plugins.ServerPlugin loadServerPlugin ( java.io.File scriptFile , org.eclipse.jgit.internal.storage.file.FileSnapshot snapshot ) throws com.google.gerrit.server.plugins.InvalidPluginException { java.lang.String name = serverPluginFactory.getPluginName ( scriptFile ) ; return serverPluginFactory.get ( scriptFile , snapshot , new com.google.gerrit.server.plugins.ServerPluginProvider.PluginDescription ( pluginUserFactory.create ( name ) , getPluginCanonicalWebUrl ( name ) , getPluginDataDir ( name ) ) ) ; }

Target:
private com.google.gerrit.server.plugins.ServerPlugin loadServerPlugin ( java.nio.file.Path scriptFile , org.eclipse.jgit.internal.storage.file.FileSnapshot snapshot ) throws com.google.gerrit.server.plugins.InvalidPluginException { java.lang.String name = serverPluginFactory.getPluginName ( scriptFile ) ; return serverPluginFactory.get ( scriptFile , snapshot , new com.google.gerrit.server.plugins.ServerPluginProvider.PluginDescription ( pluginUserFactory.create ( name ) , getPluginCanonicalWebUrl ( name ) , getPluginDataDir ( name ) ) ) ; }
Source:
public void customConflictMessageTest ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.automerger.FailedMergeException fme = new com.googlesource.gerrit.plugins.automerger.FailedMergeException ( failedMergeBranches , currentRevision , hostName , "asdf" , topic ) ; com.google.common.truth.Truth.assertThat ( fme.getDisplayString ( ) . split ( "\\n" ) ) . asList ( ) . containsExactly ( "asdf" , "asdf" , "asdf" ) ; }

Target:
public void conflictMessageTest ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.automerger.FailedMergeException fme = new com.googlesource.gerrit.plugins.automerger.FailedMergeException ( failedMergeBranches , currentRevision , hostName , projectName , changeNumber , patchsetNumber , "Merge conflict found on ${branch}" , topic ) ; java.lang.String branch1String = "Merge conflict found on branch1" ; java.lang.String branch2String = "Merge conflict found on branch2" ; java.lang.String branch3String = "Merge conflict found on branch3" ; com.google.common.truth.Truth.assertThat ( fme.getDisplayString ( ) . split ( "\\n" ) ) . asList ( ) . containsExactly ( branch1String , branch2String , branch3String ) ; }
Source:
public void testUnblockForceEditTopicName ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.ANONYMOUS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertTrue ( "u can edit topic name" , u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) ; }

Target:
public void testUnblockForceEditTopicName ( ) { com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) . setBlock ( ) ; com.google.gerrit.server.project.Util.grant ( local , com.google.gerrit.common.data.Permission.EDIT_TOPIC_NAME , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertTrue ( "u can edit topic name" , u.controlForRef ( "refs/heads/master" ) . canForceEditTopicName ( ) ) ; }
Source:
private void columnReviewed ( com.google.gwtexpui.safehtml.client.SafeHtmlBuilder sb , com.google.gerrit.client.diff.FileInfo info ) { sb.openTd ( ) . setStyleName ( com.google.gerrit.client.change.FileTable.R.css ( ) . reviewed ( ) ) ; if ( hasUser ) { sb.openElement ( "input" ) . setAttribute ( "type" , "checkbox" ) . setAttribute ( "onclick" , ( ( ( ( com.google.gerrit.client.change.FileTable.REVIEWED ) + "(event," ) + ( info._row ( ) ) ) + ")" ) ) . closeSelf ( ) ; } sb.closeTd ( ) ; }

Target:
private void columnReviewed ( com.google.gwtexpui.safehtml.client.SafeHtmlBuilder sb , com.google.gerrit.client.diff.FileInfo info ) { sb.openTd ( ) . setStyleName ( com.google.gerrit.client.change.FileTable.R.css ( ) . reviewed ( ) ) ; if ( hasUser ) { sb.openElement ( "input" ) . setAttribute ( "title" , Resources.C.reviewedFileTitle ( ) ) . setAttribute ( "type" , "checkbox" ) . setAttribute ( "onclick" , ( ( ( ( com.google.gerrit.client.change.FileTable.REVIEWED ) + "(event," ) + ( info._row ( ) ) ) + ")" ) ) . closeSelf ( ) ; } sb.closeTd ( ) ; }
Source:
protected com.google.gerrit.server.IdentifiedUser user ( com.google.gerrit.acceptance.TestAccount testAccount ) { return identifiedUserFactory.create ( com.google.inject.util.Providers.of ( db ) , testAccount.getId ( ) ) ; }

Target:
protected com.google.gerrit.server.change.ChangeResource parseChangeResource ( java.lang.String changeId ) throws java.lang.Exception { java.util.List < com.google.gerrit.server.project.ChangeControl > ctls = changeFinder.find ( changeId , atrScope.get ( ) . getUser ( ) ) ; com.google.common.truth.Truth.assertThat ( ctls ) . hasSize ( 1 ) ; return changeResourceFactory.create ( ctls.get ( 0 ) ) ; }
Source:
protected com.google.gerrit.prettify.common.SparseHtmlFile getSparseHtmlFileA ( com.google.gerrit.common.data.PatchScript s ) { com.google.gerrit.reviewdb.client.AccountDiffPreference dp = new com.google.gerrit.reviewdb.client.AccountDiffPreference ( s.getDiffPrefs ( ) ) ; dp.setShowWhitespaceErrors ( false ) ; com.google.gerrit.prettify.common.PrettyFormatter f = ClientSideFormatter.FACTORY.get ( ) ; f.setDiffPrefs ( dp ) ; f.setFileName ( s.getA ( ) . getPath ( ) ) ; f.setEditFilter ( PrettyFormatter.A ) ; f.setEditList ( s.getEdits ( ) ) ; f.format ( s.getA ( ) ) ; return f ; }

Target:
protected com.google.gerrit.prettify.client.SparseHtmlFile getSparseHtmlFileA ( com.google.gerrit.common.data.PatchScript s ) { com.google.gerrit.reviewdb.client.AccountDiffPreference dp = new com.google.gerrit.reviewdb.client.AccountDiffPreference ( s.getDiffPrefs ( ) ) ; dp.setShowWhitespaceErrors ( false ) ; com.google.gerrit.prettify.client.PrettyFormatter f = ClientSideFormatter.FACTORY.get ( ) ; f.setDiffPrefs ( dp ) ; f.setFileName ( s.getA ( ) . getPath ( ) ) ; f.setEditFilter ( PrettyFormatter.A ) ; f.setEditList ( s.getEdits ( ) ) ; f.format ( s.getA ( ) ) ; return f ; }
Source:
public void keyExpiringInFuture ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey k = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithExpiration ( ) ; com.google.gerrit.gpg.PublicKeyChecker checker = new com.google.gerrit.gpg.PublicKeyChecker ( ) . setStore ( store ) ; assertProblems ( checker , k ) ; checker.setEffectiveTime ( com.google.gerrit.gpg.PublicKeyCheckerTest.parseDate ( "2015-07-10 12:00:00 -0400" ) ) ; assertProblems ( checker , k ) ; checker.setEffectiveTime ( com.google.gerrit.gpg.PublicKeyCheckerTest.parseDate ( "2075-07-10 12:00:00 -0400" ) ) ; assertProblems ( checker , k , "Key is expired" ) ; }

Target:
public void keyExpiringInFuture ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey k = com.google.gerrit.gpg.testutil.TestKeys.validKeyWithExpiration ( ) ; com.google.gerrit.gpg.PublicKeyChecker checker = new com.google.gerrit.gpg.PublicKeyChecker ( ) . setStore ( store ) ; assertNoProblems ( checker , k ) ; checker.setEffectiveTime ( com.google.gerrit.gpg.PublicKeyCheckerTest.parseDate ( "2015-07-10 12:00:00 -0400" ) ) ; assertNoProblems ( checker , k ) ; checker.setEffectiveTime ( com.google.gerrit.gpg.PublicKeyCheckerTest.parseDate ( "2075-07-10 12:00:00 -0400" ) ) ; assertProblems ( checker , k , "Key is expired" ) ; }
Source:
public void patchSetRefMissing ( ) throws java.lang.Exception { com.google.gerrit.server.notedb.ChangeNotes notes = insertChange ( ) ; testRepo.update ( "refs/other/foo" , org.eclipse.jgit.lib.ObjectId.fromString ( psUtil.current ( db , notes ) . getRevision ( ) . get ( ) ) ) ; java.lang.String refName = notes.getChange ( ) . currentPatchSetId ( ) . toRefName ( ) ; deleteRef ( refName ) ; assertProblems ( notes , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Ref missing: " + refName ) ) ) ; }

Target:
public void patchSetRefMissing ( ) throws java.lang.Exception { com.google.gerrit.server.notedb.ChangeNotes notes = insertChange ( ) ; serverSideTestRepo.update ( "refs/other/foo" , org.eclipse.jgit.lib.ObjectId.fromString ( psUtil.current ( db , notes ) . getRevision ( ) . get ( ) ) ) ; java.lang.String refName = notes.getChange ( ) . currentPatchSetId ( ) . toRefName ( ) ; deleteRef ( refName ) ; assertProblems ( notes , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Ref missing: " + refName ) ) ) ; }
Source:
public void resetToDefaults ( ) { maximumPageSize = com.google.gerrit.reviewdb.client.AccountGeneralPreferences.DEFAULT_PAGESIZE ; showSiteHeader = true ; useFlashClipboard = true ; copySelfOnEmail = false ; reviewCategoryStrategy = null ; downloadUrl = null ; downloadCommand = null ; dateFormat = null ; timeFormat = null ; relativeDateInChangeTable = false ; diffView = null ; sizeBarInChangeTable = true ; legacycidInChangeTable = false ; }

Target:
public void resetToDefaults ( ) { maximumPageSize = com.google.gerrit.reviewdb.client.AccountGeneralPreferences.DEFAULT_PAGESIZE ; showSiteHeader = true ; useFlashClipboard = true ; copySelfOnEmail = false ; reviewCategoryStrategy = null ; downloadUrl = null ; downloadCommand = null ; dateFormat = null ; timeFormat = null ; relativeDateInChangeTable = false ; diffView = null ; sizeBarInChangeTable = true ; legacycidInChangeTable = false ; muteCommonPathPrefixes = true ; }
Source:
public static java.lang.String refsEditPrefix ( com.google.gerrit.reviewdb.client.Account.Id accountId , com.google.gerrit.reviewdb.client.Change.Id changeId ) { return new java.lang.StringBuilder ( com.google.gerrit.reviewdb.client.RefNames.refsUsers ( accountId ) ) . append ( "/edit-" ) . append ( changeId.get ( ) ) . append ( "/" ) . toString ( ) ; }

Target:
public static java.lang.String refsEditPrefix ( com.google.gerrit.reviewdb.client.Account.Id accountId , com.google.gerrit.reviewdb.client.Change.Id changeId ) { return new java.lang.StringBuilder ( com.google.gerrit.reviewdb.client.RefNames.refsUsers ( accountId ) ) . append ( '/' ) . append ( com.google.gerrit.reviewdb.client.RefNames.EDIT_PREFIX ) . append ( changeId.get ( ) ) . append ( '/' ) . toString ( ) ; }
Source:
public void unblockForce ( ) { com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.project.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; r.setForce ( true ) ; com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/heads/*" ) . setForce ( true ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertCanForceUpdate ( "refs/heads/master" , u ) ; }

Target:
public void unblockForceWithAllowNoForce_NotPossible ( ) { com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.project.testing.Util.block ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/heads/*" ) ; r.setForce ( true ) ; com.google.gerrit.server.project.testing.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.testing.Util.DEVS , "refs/heads/*" ) ; com.google.gerrit.server.project.ProjectControl u = user ( local , com.google.gerrit.server.project.testing.Util.DEVS ) ; assertCannotForceUpdate ( "refs/heads/master" , u ) ; }
Source:
protected void add ( final com.google.gerrit.server.mail.RecipientType rt , final java.util.Collection < com.google.gerrit.reviewdb.Account.Id > list ) { for ( final com.google.gerrit.reviewdb.Account.Id id : list ) { add ( rt , id ) ; } }

Target:
protected void setupVelocityContext ( ) { super . setupVelocityContext ( ) ; velocityContext.put ( "change" , change ) ; velocityContext.put ( "branch" , change.getDest ( ) ) ; velocityContext.put ( "projectName" , projectName ) ; velocityContext.put ( "patchSet" , patchSet ) ; velocityContext.put ( "patchSetInfo" , patchSetInfo ) ; }
Source:
public WorkQueue.Executor createEmailReviewCommentsExecutor ( @ com.google.gerrit.server.config.GerritServerConfig org.eclipse.jgit.lib.Config config , com.google.gerrit.server.git.WorkQueue queues ) { int poolSize = config.getInt ( "sendemail" , null , "threadPoolSize" , 1 ) ; return queues.createQueue ( poolSize , "EmailReviewComments" ) ; }

Target:
public java.util.concurrent.ExecutorService createEmailReviewCommentsExecutor ( @ com.google.gerrit.server.config.GerritServerConfig org.eclipse.jgit.lib.Config config , com.google.gerrit.server.git.WorkQueue queues ) { int poolSize = config.getInt ( "sendemail" , null , "threadPoolSize" , 1 ) ; if ( poolSize == 0 ) { return com.google.common.util.concurrent.MoreExecutors.newDirectExecutorService ( ) ; } return queues.createQueue ( poolSize , "EmailReviewComments" ) ; }
Source:
public void testIsEnabledRefNoParentMatchingBranchDisabled ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/test.*" } ; setupIsEnabled ( "false" , null , branches ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertFalse ( itsConfig.isEnabled ( "testProject" , "refs/heads/testBranch" ) ) ; }

Target:
public void testIsEnabledRefNoParentMatchingBranchMiddleEnforced ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { "^refs/heads/foo.*" , "^refs/heads/test.*" , "^refs/heads/baz.*" } ; setupIsEnabled ( "enforced" , null , branches ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey projectNK = new com.google.gerrit.reviewdb.client.Project.NameKey ( "testProject" ) ; assertTrue ( itsConfig.isEnabled ( projectNK , "refs/heads/testBranch" ) ) ; }
Source:
private static java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > getRefs ( org.eclipse.jgit.lib.RefDatabase refdb , java.lang.String path ) throws java.io.IOException { path = com.google.gitiles.GitilesView.maybeTrimLeadingAndTrailingSlash ( path ) ; if ( path.isEmpty ( ) ) { return refdb.getRefs ( RefDatabase.ALL ) ; } path = ( org.eclipse.jgit.lib.Constants.R_REFS ) + path ; org.eclipse.jgit.lib.Ref singleRef = refdb.getRef ( path ) ; if ( singleRef != null ) { return com.google.common.collect.ImmutableMap.of ( singleRef.getName ( ) , singleRef ) ; } return refdb.getRefs ( ( path + '/' ) ) ; }

Target:
private static java.util.Map < java.lang.String , org.eclipse.jgit.lib.Ref > getRefs ( org.eclipse.jgit.lib.RefDatabase refdb , java.lang.String path ) throws java.io.IOException { path = com.google.gitiles.GitilesView.maybeTrimLeadingAndTrailingSlash ( path ) ; if ( path.isEmpty ( ) ) { return refdb.getRefs ( RefDatabase.ALL ) ; } path = ( org.eclipse.jgit.lib.Constants.R_REFS ) + path ; org.eclipse.jgit.lib.Ref singleRef = refdb.exactRef ( path ) ; if ( singleRef != null ) { return com.google.common.collect.ImmutableMap.of ( singleRef.getName ( ) , singleRef ) ; } return refdb.getRefs ( ( path + '/' ) ) ; }
Source:
public java.util.Collection < com.google.gerrit.reviewdb.client.PatchSet > visiblePatches ( ) throws com.google.gwtorm.server.OrmException { return com.google.common.collect.FluentIterable.from ( patches ( ) ) . filter ( new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSet > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.PatchSet input ) { try { return changeControl ( ) . isPatchVisible ( input , db ) ; } catch ( com.google.gwtorm.server.OrmException e ) { return false ; } } } ) . toList ( ) ; }

Target:
public java.util.Collection < com.google.gerrit.reviewdb.client.PatchSet > visiblePatchSets ( ) throws com.google.gwtorm.server.OrmException { return com.google.common.collect.FluentIterable.from ( patchSets ( ) ) . filter ( new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.PatchSet > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.PatchSet input ) { try { return changeControl ( ) . isPatchVisible ( input , db ) ; } catch ( com.google.gwtorm.server.OrmException e ) { return false ; } } } ) . toList ( ) ; }
Source:
public AccountResource.StarredChange parse ( com.google.gerrit.server.account.AccountResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.IdentifiedUser user = parent.getUser ( ) ; try { user.asyncStarredChanges ( ) ; com.google.gerrit.server.change.ChangeResource change = changes.parse ( TopLevelResource.INSTANCE , id ) ; if ( user.getStarredChanges ( ) . contains ( change.getId ( ) ) ) { return new com.google.gerrit.server.account.AccountResource.StarredChange ( user , change ) ; } throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; } finally { user.abortStarredChanges ( ) ; } }

Target:
public AccountResource.StarredChange parse ( com.google.gerrit.server.account.AccountResource parent , com.google.gerrit.extensions.restapi.IdString id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.IdentifiedUser user = parent.getUser ( ) ; com.google.gerrit.server.change.ChangeResource change = changes.parse ( TopLevelResource.INSTANCE , id ) ; if ( starredChangesUtil.getLabels ( user.getAccountId ( ) , change.getId ( ) ) . contains ( StarredChangesUtil.DEFAULT_LABEL ) ) { return new com.google.gerrit.server.account.AccountResource.StarredChange ( user , change ) ; } throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( id ) ; }
Source:
public boolean canEditHashtags ( ) { return ( ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getCurrentUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) || ( getRefControl ( ) . canEditHashtags ( ) ) ; }

Target:
public boolean canEditHashtags ( ) { return ( ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getUser ( ) . getCapabilities ( ) . canAdministrateServer ( ) ) ) || ( getRefControl ( ) . canEditHashtags ( ) ) ; }
Source:
public void testBadResponseRetryThenGiveUp ( ) throws java.lang.Exception { com.ericsson.gerrit.plugins.syncindex.HttpSessionTest.wireMockRule.givenThat ( com.github.tomakehurst.wiremock.client.WireMock.post ( com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo ( com.ericsson.gerrit.plugins.syncindex.HttpSessionTest.ENDPOINT ) ) . willReturn ( com.github.tomakehurst.wiremock.client.WireMock.aResponse ( ) . withStatus ( com.ericsson.gerrit.plugins.syncindex.HttpSessionTest.ERROR ) . withBody ( com.ericsson.gerrit.plugins.syncindex.HttpSessionTest.ERROR_MESSAGE ) ) ) ; com.ericsson.gerrit.plugins.syncindex.IndexResponseHandler.IndexResult result = httpSession.post ( com.ericsson.gerrit.plugins.syncindex.HttpSessionTest.ENDPOINT ) ; com.google.common.truth.Truth.assertThat ( result.isSuccessful ( ) ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( result.getMessage ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.syncindex.HttpSessionTest.ERROR_MESSAGE ) ; }

Target:
public void testBadResponseRetryThenGiveUp ( ) throws java.lang.Exception { com.ericsson.gerrit.plugins.multimaster.HttpSessionTest.wireMockRule.givenThat ( com.github.tomakehurst.wiremock.client.WireMock.post ( com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo ( com.ericsson.gerrit.plugins.multimaster.HttpSessionTest.ENDPOINT ) ) . willReturn ( com.github.tomakehurst.wiremock.client.WireMock.aResponse ( ) . withStatus ( com.ericsson.gerrit.plugins.multimaster.HttpSessionTest.ERROR ) . withBody ( com.ericsson.gerrit.plugins.multimaster.HttpSessionTest.ERROR_MESSAGE ) ) ) ; com.ericsson.gerrit.plugins.multimaster.IndexResponseHandler.IndexResult result = httpSession.post ( com.ericsson.gerrit.plugins.multimaster.HttpSessionTest.ENDPOINT ) ; com.google.common.truth.Truth.assertThat ( result.isSuccessful ( ) ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( result.getMessage ( ) ) . isEqualTo ( com.ericsson.gerrit.plugins.multimaster.HttpSessionTest.ERROR_MESSAGE ) ; }
Source:
private com.google.gerrit.server.project.ProjectState newProjectState ( com.google.gerrit.server.git.ProjectConfig local ) { com.google.gerrit.rules.PrologEnvironment.Factory envFactory = null ; com.google.gerrit.server.git.GitRepositoryManager gitMgr = null ; com.google.gerrit.server.project.ProjectControl.AssistedFactory projectControlFactory = null ; com.google.gerrit.rules.RulesCache rulesCache = null ; com.google.gerrit.server.config.SitePaths sitePaths = null ; java.util.List < com.google.gerrit.server.project.CommentLinkInfo > commentLinks = null ; all.put ( local.getProject ( ) . getNameKey ( ) , new com.google.gerrit.server.project.ProjectState ( sitePaths , projectCache , allProjectsName , projectControlFactory , envFactory , gitMgr , rulesCache , commentLinks , local ) ) ; return all.get ( local.getProject ( ) . getNameKey ( ) ) ; }

Target:
public static void doNotInherit ( com.google.gerrit.server.git.ProjectConfig project , java.lang.String permissionName , java.lang.String ref ) { project.getAccessSection ( ref , true ) . getPermission ( permissionName , true ) . setExclusiveGroup ( true ) ; }
Source:
private void assertChangeUpToDate ( boolean expected , com.google.gerrit.reviewdb.client.Change.Id id ) throws java.lang.Exception { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ) { com.google.gerrit.reviewdb.client.Change c = unwrapDb ( ) . changes ( ) . get ( id ) ; com.google.common.truth.Truth.assertThat ( c ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( c.getNoteDbState ( ) ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.notedb.NoteDbChangeState.parse ( c ) . isChangeUpToDate ( repo ) ) . isEqualTo ( expected ) ; } }

Target:
private void assertChangeUpToDate ( boolean expected , com.google.gerrit.reviewdb.client.Change.Id id ) throws java.lang.Exception { try ( org.eclipse.jgit.lib.Repository repo = repoManager.openRepository ( project ) ) { com.google.gerrit.reviewdb.client.Change c = unwrapDb ( ) . changes ( ) . get ( id ) ; com.google.common.truth.Truth.assertThat ( c ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( c.getNoteDbState ( ) ) . isNotNull ( ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.server.notedb.NoteDbChangeState.parse ( c ) . isChangeUpToDate ( new com.google.gerrit.server.git.RepoRefCache ( repo ) ) ) . isEqualTo ( expected ) ; } }
Source:
private java.util.List < com.google.gerrit.common.data.SubmitRecord > invalidResult ( com.googlecode.prolog_cafe.lang.Term rule , com.googlecode.prolog_cafe.lang.Term record , java.lang.String reason ) { return ruleError ( java.lang.String.format ( ( "Submit rule %s for change %s of %s output " + "invalid result: %s%s" ) , rule , cd.getId ( ) , getProjectName ( ) , record , ( reason == null ? "" : ". Reason: " + reason ) ) ) ; }

Target:
private java.util.List < com.google.gerrit.common.data.SubmitRecord > invalidResult ( com.googlecode.prolog_cafe.lang.Term rule , com.googlecode.prolog_cafe.lang.Term record , java.lang.String reason ) { return ruleError ( java.lang.String.format ( "Submit rule %s for change %s of %s output invalid result: %s%s" , rule , cd.getId ( ) , getProjectName ( ) , record , ( reason == null ? "" : ". Reason: " + reason ) ) ) ; }
Source:
public void missingKey ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key2 = com.google.gerrit.gpg.testutil.TestKey.key2 ( ) ; org.eclipse.jgit.transport.PushCertificate cert = newSignedCert ( validNonce ( ) , key2 ) ; assertProblems ( cert , ( "No public keys found for Key ID " + ( com.google.gerrit.gpg.PublicKeyStore.keyIdToString ( key2.getKeyId ( ) ) ) ) ) ; }

Target:
public void missingKey ( ) throws java.lang.Exception { com.google.gerrit.gpg.testutil.TestKey key2 = com.google.gerrit.gpg.testutil.TestKey.key2 ( ) ; org.eclipse.jgit.transport.PushCertificate cert = newSignedCert ( validNonce ( ) , key2 ) ; assertProblems ( cert , ( "No public keys found for key ID " + ( com.google.gerrit.gpg.PublicKeyStore.keyIdToString ( key2.getKeyId ( ) ) ) ) ) ; }
Source:
public static void errorOnlyConsole ( ) { org.apache.log4j.LogManager.resetConfiguration ( ) ; final org.apache.log4j.PatternLayout layout = new org.apache.log4j.PatternLayout ( ) ; layout.setConversionPattern ( "%-5p %c %x: %m%n" ) ; final org.apache.log4j.ConsoleAppender dst = new org.apache.log4j.ConsoleAppender ( ) ; dst.setLayout ( layout ) ; dst.setTarget ( "System.err" ) ; dst.setThreshold ( org.apache.log4j.Level.ERROR ) ; final org.apache.log4j.Logger root = org.apache.log4j.LogManager.getRootLogger ( ) ; root.removeAllAppenders ( ) ; root.addAppender ( dst ) ; }

Target:
public static void errorOnlyConsole ( ) { org.apache.log4j.LogManager.resetConfiguration ( ) ; final org.apache.log4j.PatternLayout layout = new org.apache.log4j.PatternLayout ( ) ; layout.setConversionPattern ( "%-5p %c %x: %m%n" ) ; final org.apache.log4j.ConsoleAppender dst = new org.apache.log4j.ConsoleAppender ( ) ; dst.setLayout ( layout ) ; dst.setTarget ( "System.err" ) ; dst.setThreshold ( org.apache.log4j.Level.ERROR ) ; dst.activateOptions ( ) ; final org.apache.log4j.Logger root = org.apache.log4j.LogManager.getRootLogger ( ) ; root.removeAllAppenders ( ) ; root.addAppender ( dst ) ; }
Source:
public void validate ( com.google.gerrit.reviewdb.client.Project.NameKey project , org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.lib.ObjectReader objectReader , java.util.Map < java.lang.String , org.eclipse.jgit.transport.ReceiveCommand > commands ) throws com.google.gerrit.server.git.IntegrationException { try { for ( com.google.gerrit.server.git.validators.OnSubmitValidationListener listener : this . listeners ) { listener.preBranchUpdate ( new com.google.gerrit.server.git.validators.OnSubmitValidationListener.Arguments ( project , repo , objectReader , commands ) ) ; } } catch ( com.google.gerrit.server.validators.ValidationException e ) { throw new com.google.gerrit.server.git.IntegrationException ( e.getMessage ( ) ) ; } }

Target:
public void validate ( com.google.gerrit.reviewdb.client.Project.NameKey project , org.eclipse.jgit.lib.ObjectReader objectReader , com.google.gerrit.server.update.ChainedReceiveCommands commands ) throws com.google.gerrit.server.git.IntegrationException { try ( org.eclipse.jgit.revwalk.RevWalk rw = new org.eclipse.jgit.revwalk.RevWalk ( objectReader ) ) { com.google.gerrit.server.git.validators.OnSubmitValidationListener.Arguments args = new com.google.gerrit.server.git.validators.OnSubmitValidationListener.Arguments ( project , rw , commands ) ; for ( com.google.gerrit.server.git.validators.OnSubmitValidationListener listener : listeners ) { listener.preBranchUpdate ( args ) ; } } catch ( com.google.gerrit.server.validators.ValidationException e ) { throw new com.google.gerrit.server.git.IntegrationException ( e.getMessage ( ) ) ; } }
Source:
public void run ( ) { resizePaddingOnOtherSide ( side , instance.getLineNumber ( handle ) ) ; }

Target:
public void run ( ) { skipManager.removeAll ( ) ; chunkManager.reset ( ) ; diffTable.sidePanel.clearDiffGutters ( ) ; setShowIntraline ( prefs.intralineDifference ( ) ) ; render ( diff ) ; skipManager.render ( prefs.context ( ) , diff ) ; }
Source:
private void fireEvent ( com.google.gerrit.reviewdb.Branch.NameKey branchName , final com.google.gerrit.server.events.ChangeEvent event ) { for ( com.google.gerrit.common.ChangeHookRunner.ChangeListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( branchName , holder.user ) ) { holder.listener.onChangeEvent ( event ) ; } } }

Target:
private void fireEvent ( final com.google.gerrit.reviewdb.Change change , final com.google.gerrit.server.events.ChangeEvent event , final com.google.gerrit.reviewdb.ReviewDb db ) throws com.google.gwtorm.client.OrmException { for ( com.google.gerrit.common.ChangeHookRunner.ChangeListenerHolder holder : listeners.values ( ) ) { if ( isVisibleTo ( change , holder.user , db ) ) { holder.listener.onChangeEvent ( event ) ; } } }
Source:
private static java.lang.String checkId ( java.lang.String id ) { if ( ( id == null ) || ( ( id.length ( ) ) > 4 ) ) { throw new java.lang.IllegalArgumentException ( ( ( "Illegal label ID \"" + id ) + "\"" ) ) ; } return id ; }

Target:
private static java.lang.String checkId ( java.lang.String id ) { if ( "SUBM" . equals ( id ) ) { throw new java.lang.IllegalArgumentException ( ( ( "Reserved label ID \"" + id ) + "\"" ) ) ; } if ( ( id != null ) && ( ( id.length ( ) ) > 4 ) ) { throw new java.lang.IllegalArgumentException ( ( ( "Illegal label ID \"" + id ) + "\"" ) ) ; } return id ; }
Source:
public boolean accept ( java.nio.file.Path entry ) throws java.io.IOException { return ( entry.getFileName ( ) . toString ( ) . endsWith ( ".jar" ) ) && ( java.nio.file.Files.isRegularFile ( entry ) ) ; }

Target:
public boolean accept ( java.nio.file.Path entry ) throws java.io.IOException { java.lang.String name = entry.getFileName ( ) . toString ( ) ; return ( ( ( name.endsWith ( ".jar" ) ) && ( ! ( name.startsWith ( ".last_" ) ) ) ) && ( ! ( name.startsWith ( ".next_" ) ) ) ) && ( java.nio.file.Files.isRegularFile ( entry ) ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.changes.ChangeList result ) { com.google.gwt.core.client.JsArray < com.google.gerrit.client.change.RelatedChanges.ChangeAndCommit > changes = convertChangeList ( result ) ; if ( ( changes.length ( ) ) > 0 ) { getTab ( ) . setTitle ( Resources.M.conflictingChanges ( changes.length ( ) ) ) ; getTab ( ) . setChanges ( info.project ( ) , revision , changes ) ; } }

Target:
public void onSuccess ( T result ) { com.google.gwt.core.client.JsArray < com.google.gerrit.client.change.RelatedChanges.ChangeAndCommit > changes = convert ( result ) ; if ( ( changes.length ( ) ) > 0 ) { setTabTitle ( tabInfo , tabInfo.getTitle ( changes.length ( ) ) ) ; getTab ( tabInfo ) . setChanges ( project , revision , changes ) ; } onDone ( ( ( changes.length ( ) ) > 0 ) ) ; }
Source:
private boolean canRebase ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { return ( ( ( ( isOwner ( ) ) || ( refControl.canSubmit ( isOwner ( ) ) ) ) || ( refControl.canRebase ( ) ) ) && ( refControl.asForRef ( ) . testOrFalse ( RefPermission.CREATE_CHANGE ) ) ) && ( ! ( isPatchSetLocked ( db ) ) ) ; }

Target:
private boolean canRebase ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { return ( ( ( ( ( isOwner ( ) ) || ( refControl.canSubmit ( isOwner ( ) ) ) ) || ( refControl.canRebase ( ) ) ) && ( refControl.asForRef ( ) . testOrFalse ( RefPermission.CREATE_CHANGE ) ) ) && ( getProjectControl ( ) . getProjectState ( ) . statePermitsWrite ( ) ) ) && ( ! ( isPatchSetLocked ( db ) ) ) ; }
Source:
public void testBlockRule_ParentBlocksChild ( ) { com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/tags/*" ) ; com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/tags/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; org.junit.Assert.assertFalse ( "u can't update tag" , u.controlForRef ( "refs/tags/V10" ) . canUpdate ( ) ) ; }

Target:
public void testBlockRule_ParentBlocksChild ( ) { com.google.gerrit.server.project.Util.allow ( local , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.project.Util.DEVS , "refs/tags/*" ) ; com.google.gerrit.server.project.Util.block ( parent , com.google.gerrit.common.data.Permission.PUSH , com.google.gerrit.server.group.SystemGroupBackend.ANONYMOUS_USERS , "refs/tags/*" ) ; com.google.gerrit.server.project.ProjectControl u = util.user ( local , com.google.gerrit.server.project.Util.DEVS ) ; assertCannotUpdate ( "refs/tags/V10" , u ) ; }
Source:
private boolean includedInOne ( final java.util.Collection < org.eclipse.jgit.lib.Ref > refs ) throws java.io.IOException { parseCommits ( refs ) ; java.util.List < org.eclipse.jgit.revwalk.RevCommit > before = new java.util.LinkedList < > ( ) ; java.util.List < org.eclipse.jgit.revwalk.RevCommit > after = new java.util.LinkedList < > ( ) ; partition ( before , after ) ; return ( ! ( includedIn ( after , 1 ) . isEmpty ( ) ) ) || ( ! ( includedIn ( before , 1 ) . isEmpty ( ) ) ) ; }

Target:
private boolean includedInOne ( final java.util.Collection < org.eclipse.jgit.lib.Ref > refs ) throws java.io.IOException { parseCommits ( refs ) ; java.util.List < org.eclipse.jgit.revwalk.RevCommit > before = new java.util.LinkedList < > ( ) ; java.util.List < org.eclipse.jgit.revwalk.RevCommit > after = new java.util.LinkedList < > ( ) ; partition ( before , after ) ; rw.reset ( ) ; return ( ! ( includedIn ( after , 1 ) . isEmpty ( ) ) ) || ( ! ( includedIn ( before , 1 ) . isEmpty ( ) ) ) ; }
Source:
public com.google.gerrit.server.mail.Address from ( final com.google.gerrit.reviewdb.client.Account.Id fromId ) { if ( fromId != null ) { final com.google.gerrit.reviewdb.client.Account a = accountCache.get ( fromId ) . getAccount ( ) ; if ( ( a.getPreferredEmail ( ) ) != null ) { return new com.google.gerrit.server.mail.Address ( a.getFullName ( ) , a.getPreferredEmail ( ) ) ; } } return srvAddr ; }

Target:
public com.google.gerrit.server.mail.Address from ( final com.google.gerrit.reviewdb.client.Account.Id fromId ) { if ( fromId != null ) { com.google.gerrit.reviewdb.client.Account a = accountCache.get ( fromId ) . getAccount ( ) ; java.lang.String userEmail = a.getPreferredEmail ( ) ; return new com.google.gerrit.server.mail.Address ( a.getFullName ( ) , ( userEmail != null ? userEmail : srvAddr.getEmail ( ) ) ) ; } return srvAddr ; }
Source:
private void saveChange ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) throws com.google.gwtorm.server.OrmException { change = ctx.getChange ( ) ; wasDraftChange = ( change.getStatus ( ) ) == ( Change.Status.DRAFT ) ; if ( wasDraftChange ) { change.setStatus ( Change.Status.NEW ) ; com.google.gerrit.server.ChangeUtil.updated ( change ) ; ctx.getDb ( ) . changes ( ) . update ( java.util.Collections.singleton ( change ) ) ; } }

Target:
private void saveChange ( com.google.gerrit.server.git.BatchUpdate.ChangeContext ctx ) { change = ctx.getChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = ctx.getUpdate ( psId ) ; wasDraftChange = ( change.getStatus ( ) ) == ( Change.Status.DRAFT ) ; if ( wasDraftChange ) { change.setStatus ( Change.Status.NEW ) ; update.setStatus ( change.getStatus ( ) ) ; } }
Source:
public void delete ( java.lang.Iterable < T > instances ) throws com.google.gwtorm.client.OrmException { for ( T oldObj : instances ) { db.delete ( dataRowKey ( com.google.gwtorm.nosql.generic.GenericAccess.primaryKey ( oldObj ) ) ) ; pruneOldIndexes ( oldObj , null ) ; } }

Target:
public void delete ( java.lang.Iterable < T > instances ) throws com.google.gwtorm.client.OrmException { for ( T oldObj : instances ) { db.delete ( dataRowKey ( com.google.gwtorm.nosql.generic.GenericAccess.primaryKey ( oldObj ) ) ) ; pruneOldIndexes ( oldObj , null ) ; } maybeFlush ( ) ; }
Source:
public java.util.Map < java.lang.String , com.google.gerrit.server.restapi.config.ListCapabilities.CapabilityInfo > apply ( com.google.gerrit.server.config.ConfigResource resource ) throws java.lang.IllegalAccessException , java.lang.NoSuchFieldException { return com.google.common.collect.ImmutableMap.< java.lang.String , com.google.gerrit.server.restapi.config.ListCapabilities.CapabilityInfo > builder ( ) . putAll ( collectCoreCapabilities ( ) ) . putAll ( collectPluginCapabilities ( ) ) . build ( ) ; }

Target:
public java.util.Map < java.lang.String , com.google.gerrit.server.restapi.config.ListCapabilities.CapabilityInfo > apply ( com.google.gerrit.server.config.ConfigResource resource ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , java.lang.IllegalAccessException , java.lang.NoSuchFieldException { permissionBackend.checkUsesDefaultCapabilities ( ) ; return com.google.common.collect.ImmutableMap.< java.lang.String , com.google.gerrit.server.restapi.config.ListCapabilities.CapabilityInfo > builder ( ) . putAll ( collectCoreCapabilities ( ) ) . putAll ( collectPluginCapabilities ( ) ) . build ( ) ; }