auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void deleteVoteFromReviewableChangeByAdmin ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; setApiUser ( admin ) ; deleteVote ( sc , voter ) ; assertThat ( sender ) . sent ( "deleteVote" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer , voter ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void deleteVoteFromReviewableChangeByAdmin ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; setApiUser ( admin ) ; deleteVote ( sc , voter ) ; assertThat ( sender ) . sent ( "deleteVote" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer , voter ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) . noOneElse ( ) ; }
Source:
static com.google.gitiles.ArchiveFormat getDefault ( org.eclipse.jgit.lib.Config cfg ) { return com.google.gitiles.ArchiveFormat.byExtension ( cfg ) . values ( ) . iterator ( ) . next ( ) ; }

Target:
static com.google.gitiles.ArchiveFormat getDefault ( org.eclipse.jgit.lib.Config cfg ) { for ( java.lang.String allowed : cfg.getStringList ( "archive" , null , "format" ) ) { com.google.common.base.Optional < com.google.gitiles.ArchiveFormat > result = com.google.common.base.Enums.getIfPresent ( com.google.gitiles.ArchiveFormat.class , allowed.toUpperCase ( ) ) ; if ( result.isPresent ( ) ) { return result.get ( ) ; } } return com.google.gitiles.ArchiveFormat.TGZ ; }
Source:
private boolean canEditTopicName ( ) { if ( getChange ( ) . getStatus ( ) . isOpen ( ) ) { return ( ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getUser ( ) . getCapabilities ( ) . isAdmin_DoNotUse ( ) ) ) || ( getRefControl ( ) . canEditTopicName ( ) ) ; } return getRefControl ( ) . canForceEditTopicName ( ) ; }

Target:
private boolean canEditTopicName ( ) { if ( getChange ( ) . getStatus ( ) . isOpen ( ) ) { return ( ( ( ( isOwner ( ) ) || ( getRefControl ( ) . isOwner ( ) ) ) || ( getProjectControl ( ) . isOwner ( ) ) ) || ( getRefControl ( ) . canEditTopicName ( ) ) ) || ( getProjectControl ( ) . isAdmin ( ) ) ; } return getRefControl ( ) . canForceEditTopicName ( ) ; }
Source:
public java.lang.Iterable < com.google.gerrit.extensions.common.WebLinkInfo > getProjectLinks ( java.lang.String project ) { java.util.List < com.google.gerrit.extensions.common.WebLinkInfo > links = com.google.common.collect.Lists.newArrayList ( ) ; for ( com.google.gerrit.extensions.webui.ProjectWebLink webLink : projectLinks ) { links.add ( new com.google.gerrit.extensions.common.WebLinkInfo ( webLink.getLinkName ( ) , webLink.getImageUrl ( ) , webLink.getProjectUrl ( project ) , webLink.getTarget ( ) ) ) ; } return links ; }

Target:
public com.google.common.collect.FluentIterable < com.google.gerrit.extensions.common.WebLinkInfo > getProjectLinks ( final java.lang.String project ) { return filterLinks ( projectLinks , new com.google.common.base.Function < com.google.gerrit.extensions.webui.WebLink , com.google.gerrit.extensions.common.WebLinkInfo > ( ) { @ java.lang.Override public com.google.gerrit.extensions.common.WebLinkInfo apply ( com.google.gerrit.extensions.webui.WebLink webLink ) { return ( ( com.google.gerrit.extensions.webui.ProjectWebLink ) ( webLink ) ) . getProjectWeblink ( project ) ; } } ) ; }
Source:
public com.google.gerrit.extensions.registration.ReloadableRegistrationHandle < T > put ( java.lang.String pluginName , com.google.inject.Key < T > key , T item ) { java.lang.String exportName = ( ( com.google.gerrit.extensions.annotations.Export ) ( key.getAnnotation ( ) ) ) . value ( ) ; com.google.gerrit.extensions.registration.NamePair np = new com.google.gerrit.extensions.registration.NamePair ( pluginName , exportName ) ; items.put ( np , item ) ; return new ReloadableHandle ( np , key , item ) ; }

Target:
public com.google.gerrit.extensions.registration.ReloadableRegistrationHandle < T > put ( java.lang.String pluginName , com.google.inject.Key < T > key , com.google.inject.Provider < T > item ) { java.lang.String exportName = ( ( com.google.gerrit.extensions.annotations.Export ) ( key.getAnnotation ( ) ) ) . value ( ) ; com.google.gerrit.extensions.registration.NamePair np = new com.google.gerrit.extensions.registration.NamePair ( pluginName , exportName ) ; items.put ( np , item ) ; return new ReloadableHandle ( np , key , item ) ; }
Source:
private static org.eclipse.jgit.lib.ObjectId commit ( final org.eclipse.jgit.notes.NoteMap noteMap , final org.eclipse.jgit.lib.ObjectInserter inserter , final org.eclipse.jgit.lib.PersonIdent personIdent , final org.eclipse.jgit.lib.ObjectId baseCommit , final com.google.gerrit.server.git.BanCommitResult result , final java.lang.String reason ) throws java.io.IOException { final java.lang.String commitMsg = com.google.gerrit.server.git.BanCommit.buildCommitMessage ( result.getNewlyBannedCommits ( ) , reason ) ; if ( baseCommit != null ) { return com.google.gerrit.server.git.BanCommit.createCommit ( noteMap , inserter , personIdent , commitMsg , baseCommit ) ; } else { return com.google.gerrit.server.git.BanCommit.createCommit ( noteMap , inserter , personIdent , commitMsg ) ; } }

Target:
private org.eclipse.jgit.lib.ObjectId createNoteContent ( java.lang.String reason , org.eclipse.jgit.lib.ObjectInserter inserter ) throws java.io.IOException , java.io.UnsupportedEncodingException { java.lang.String noteContent = ( reason != null ) ? reason : "" ; if ( ( ( noteContent.length ( ) ) > 0 ) && ( ! ( noteContent.endsWith ( "\n" ) ) ) ) { noteContent = noteContent + "\n" ; } return inserter.insert ( Constants.OBJ_BLOB , noteContent.getBytes ( "UTF-8" ) ) ; }
Source:
public void evilRefName ( ) throws java.lang.Exception { setUpSimpleRefs ( ) ; java.lang.String evilRefName = "refs/evil/<script>window.close();</script>/&foo" ; org.junit.Assert.assertTrue ( org.eclipse.jgit.lib.Repository.isValidRefName ( evilRefName ) ) ; repo.branch ( evilRefName ) . commit ( ) . create ( ) ; com.google.gitiles.FakeHttpServletResponse res = buildText ( "/repo/+refs/evil" ) ; org.junit.Assert.assertEquals ( ( ( id ( evilRefName ) ) + " refs/evil/&lt;script&gt;window.close();&lt;/script&gt;/&amp;foo\n" ) , res.getActualBodyString ( ) ) ; }

Target:
public void evilRefName ( ) throws java.lang.Exception { setUpSimpleRefs ( ) ; java.lang.String evilRefName = "refs/evil/<script>window.close();</script>/&foo" ; com.google.common.truth.Truth.assertThat ( org.eclipse.jgit.lib.Repository.isValidRefName ( evilRefName ) ) . isTrue ( ) ; repo.branch ( evilRefName ) . commit ( ) . create ( ) ; com.google.gitiles.FakeHttpServletResponse res = buildText ( "/repo/+refs/evil" ) ; com.google.common.truth.Truth.assertThat ( res.getActualBodyString ( ) ) . isEqualTo ( ( ( id ( evilRefName ) ) + " refs/evil/&lt;script&gt;window.close();&lt;/script&gt;/&amp;foo\n" ) ) ; }
Source:
public void testParseQuoteLeadSpace ( ) { java.lang.String comment = " > Quote text" ; java.util.List < com.google.gerrit.server.mail.send.CommentFormatter.Block > result = com.google.gerrit.server.mail.send.CommentFormatter.parse ( comment ) ; com.google.common.truth.Truth.assertThat ( result ) . hasSize ( 1 ) ; assertBlock ( result , 0 , BlockType.QUOTE , "Quote text" ) ; }

Target:
public void testParseQuote ( ) { java.lang.String comment = "> Quote text" ; java.util.List < com.google.gerrit.server.mail.send.CommentFormatter.Block > result = com.google.gerrit.server.mail.send.CommentFormatter.parse ( comment ) ; com.google.common.truth.Truth.assertThat ( result ) . hasSize ( 1 ) ; assertQuoteBlock ( result , 0 , 1 ) ; assertBlock ( result.get ( 0 ) . quotedBlocks , 0 , BlockType.PARAGRAPH , "Quote text" ) ; }
Source:
void set ( com.google.gerrit.client.info.ChangeInfo info ) { canEdit = ( info.hasActions ( ) ) && ( info.actions ( ) . containsKey ( "hashtags" ) ) ; this . changeId = info.legacyId ( ) ; display ( info ) ; addHashtagIcon.setVisible ( canEdit ) ; }

Target:
void set ( com.google.gerrit.client.info.ChangeInfo info , java.lang.String revision ) { psId = new com.google.gerrit.reviewdb.client.PatchSet.Id ( info.legacyId ( ) , info.revisions ( ) . get ( revision ) . _number ( ) ) ; canEdit = ( info.hasActions ( ) ) && ( info.actions ( ) . containsKey ( "hashtags" ) ) ; this . changeId = info.legacyId ( ) ; display ( info ) ; addHashtagIcon.setVisible ( canEdit ) ; }
Source:
public void onResize ( com.google.gwt.event.logical.shared.ResizeEvent event ) { int h = ( com.google.gerrit.client.Gerrit.getHeaderFooterHeight ( ) ) + ( reviewed.getOffsetHeight ( ) ) ; if ( ( cmA ) != null ) { cmA.setHeight ( ( ( event.getHeight ( ) ) - h ) ) ; cmA.refresh ( ) ; } if ( ( cmB ) != null ) { cmB.setHeight ( ( ( event.getHeight ( ) ) - h ) ) ; cmB.refresh ( ) ; } resizeBoxPaddings ( ) ; }

Target:
public void onDialogVisible ( com.google.gwtexpui.user.client.DialogVisibleEvent event ) { diffTable.getElement ( ) . getStyle ( ) . setVisibility ( ( event.isVisible ( ) ? Style.Visibility.HIDDEN : Style.Visibility.VISIBLE ) ) ; }
Source:
public void run ( ) { try { final com.google.gerrit.server.mail.MergedSender cm = mergedSenderFactory.create ( result.change ) ; cm.setFrom ( currentUser.getAccountId ( ) ) ; cm.setPatchSet ( result.newPatchSet , result.info ) ; cm.send ( ) ; } catch ( java.lang.Exception e ) { final com.google.gerrit.reviewdb.client.PatchSet.Id psi = result.newPatchSet.getId ( ) ; com.google.gerrit.server.git.ReceiveCommits.log.error ( ( "Cannot send email for submitted patch set " + psi ) , e ) ; } }

Target:
public void run ( ) { try { final com.google.gerrit.server.mail.MergedSender cm = mergedSenderFactory.create ( result.changeCtl ) ; cm.setFrom ( currentUser.getAccountId ( ) ) ; cm.setPatchSet ( result.newPatchSet , result.info ) ; cm.send ( ) ; } catch ( java.lang.Exception e ) { final com.google.gerrit.reviewdb.client.PatchSet.Id psi = result.newPatchSet.getId ( ) ; com.google.gerrit.server.git.ReceiveCommits.log.error ( ( "Cannot send email for submitted patch set " + psi ) , e ) ; } }
Source:
public com.google.gerrit.server.notedb.ChangeNotes createForNew ( com.google.gerrit.reviewdb.client.Change change ) throws com.google.gwtorm.server.OrmException { return new com.google.gerrit.server.notedb.ChangeNotes ( repoManager , migration , allUsers , change.getProject ( ) , change ) . load ( ) ; }

Target:
public com.google.gerrit.server.notedb.ChangeNotes create ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change change = com.google.gerrit.server.notedb.ChangeNotes.Factory.unwrap ( db ) . changes ( ) . get ( changeId ) ; com.google.common.base.Preconditions.checkArgument ( change.getProject ( ) . equals ( project ) , ( "passed project %s when creating ChangeNotes for %s, but actual" + " project is %s" ) , project , changeId , change.getProject ( ) ) ; return new com.google.gerrit.server.notedb.ChangeNotes ( repoManager , migration , allUsers , changeNoteUtil , commentsUtil , project , change ) . load ( ) ; }
Source:
void setLineLength ( int columns ) { columnMarginA.getStyle ( ) . setMarginLeft ( ( columns * ( cmA.defaultCharWidth ( ) ) ) , Unit.PX ) ; columnMarginB.getStyle ( ) . setMarginLeft ( ( columns * ( cmB.defaultCharWidth ( ) ) ) , Unit.PX ) ; }

Target:
void setLineLength ( int columns ) { double w = columns * ( getCharWidthPx ( ) ) ; columnMarginA.getStyle ( ) . setMarginLeft ( w , Style.Unit.PX ) ; columnMarginB.getStyle ( ) . setMarginLeft ( w , Style.Unit.PX ) ; }
Source:
public void testSubscriptionToDifferentBranches ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < ? > superRepo = createProjectWithPush ( "super-project" ) ; org.eclipse.jgit.junit.TestRepository < ? > subRepo = createProjectWithPush ( "subscribed-to-project" ) ; allowSubmoduleSubscription ( "subscribed-to-project" , "refs/heads/foo" , "super-project" , "refs/heads/master" ) ; createSubmoduleSubscription ( superRepo , "master" , "subscribed-to-project" , "foo" ) ; org.eclipse.jgit.lib.ObjectId subFoo = pushChangeTo ( subRepo , "foo" ) ; pushChangeTo ( subRepo , "master" ) ; expectToHaveSubmoduleState ( superRepo , "master" , "subscribed-to-project" , subFoo ) ; }

Target:
public void testSubscriptionToDifferentBranches ( ) throws java.lang.Exception { org.eclipse.jgit.junit.TestRepository < ? > superRepo = createProjectWithPush ( "super-project" ) ; org.eclipse.jgit.junit.TestRepository < ? > subRepo = createProjectWithPush ( "subscribed-to-project" ) ; allowMatchingSubmoduleSubscription ( "subscribed-to-project" , "refs/heads/foo" , "super-project" , "refs/heads/master" ) ; createSubmoduleSubscription ( superRepo , "master" , "subscribed-to-project" , "foo" ) ; org.eclipse.jgit.lib.ObjectId subFoo = pushChangeTo ( subRepo , "foo" ) ; pushChangeTo ( subRepo , "master" ) ; expectToHaveSubmoduleState ( superRepo , "master" , "subscribed-to-project" , subFoo ) ; }
Source:
public boolean apply ( com.google.gerrit.server.project.ListBranches.BranchInfo in ) { return in.ref.toLowerCase ( java.util.Locale.US ) . contains ( matchSubstring.toLowerCase ( java.util.Locale.US ) ) ; }

Target:
public boolean apply ( com.google.gerrit.server.project.ListBranches.BranchInfo in ) { if ( ! ( in.ref.startsWith ( Constants.R_HEADS ) ) ) { return in.ref.toLowerCase ( java.util.Locale.US ) . contains ( matchSubstring.toLowerCase ( java.util.Locale.US ) ) ; } else { return in.ref.substring ( Constants.R_HEADS.length ( ) ) . toLowerCase ( java.util.Locale.US ) . contains ( matchSubstring.toLowerCase ( java.util.Locale.US ) ) ; } }
Source:
protected void configureServlets ( ) { serveRegex ( "^/Documentation/(.+)$" ) . with ( com.google.inject.Key.get ( javax.servlet.http.HttpServlet.class , com.google.inject.name.Names.named ( com.google.gerrit.httpd.raw.StaticModule.DOC_SERVLET ) ) ) ; serve ( "/static/*" ) . with ( com.google.gerrit.httpd.raw.SiteStaticDirectoryServlet.class ) ; serveGwtUi ( ) ; install ( new com.google.gerrit.server.cache.CacheModule ( ) { @ java.lang.Override protected void configure ( ) { cache ( com.google.gerrit.httpd.raw.StaticModule.CACHE , java.nio.file.Path.class , com.google.gerrit.httpd.raw.ResourceServlet.Resource.class ) . maximumWeight ( ( 1 << 20 ) ) . weigher ( ResourceServlet.Weigher.class ) ; } } ) ; }

Target:
private static com.google.inject.Key < javax.servlet.http.HttpServlet > named ( java.lang.String name ) { return com.google.inject.Key.get ( javax.servlet.http.HttpServlet.class , com.google.inject.name.Names.named ( name ) ) ; }
Source:
public void finishDisplay ( ) { if ( ( saveId ) != null ) { movePointerTo ( com.google.gerrit.client.ui.NavigationTable.savedPositions.get ( saveId ) ) ; } if ( ( currentRow ) < 0 ) { onDown ( ) ; } }

Target:
public void finishDisplay ( ) { if ( ( currentRow ) >= ( table.getRowCount ( ) ) ) { currentRow = - 1 ; } if ( ( saveId ) != null ) { movePointerTo ( com.google.gerrit.client.ui.NavigationTable.savedPositions.get ( saveId ) ) ; } if ( ( currentRow ) < 0 ) { onDown ( ) ; } }
Source:
net.sf.ehcache.config.Configuration toConfiguration ( ) { configureDiskStore ( ) ; configureDefaultCache ( ) ; switch ( authConfig.getLoginType ( ) ) { case OPENID : mgr.addCache ( ttl ( named ( "openid" ) , 5 ) ) ; break ; } mgr.addCache ( disk ( named ( "diff" ) ) ) ; mgr.addCache ( named ( "sshkeys" ) ) ; mgr.addCache ( named ( "accounts_byemail" ) ) ; return mgr ; }

Target:
net.sf.ehcache.config.Configuration toConfiguration ( ) { configureDiskStore ( ) ; configureDefaultCache ( ) ; switch ( authConfig.getLoginType ( ) ) { case OPENID : mgr.addCache ( ttl ( named ( "openid" ) , 5 ) ) ; break ; } mgr.addCache ( named ( "accounts_byemail" ) ) ; mgr.addCache ( disk ( named ( "diff" ) ) ) ; mgr.addCache ( named ( "projects" ) ) ; mgr.addCache ( named ( "sshkeys" ) ) ; return mgr ; }
Source:
private com.google.gerrit.reviewdb.client.PatchSet addPatchSet ( com.google.gerrit.server.query.change.ChangeData cd , org.eclipse.jgit.lib.ObjectId id ) throws java.lang.Exception { com.google.gerrit.testutil.TestChanges.incrementPatchSet ( cd.change ( ) ) ; com.google.gerrit.reviewdb.client.PatchSet ps = new com.google.gerrit.reviewdb.client.PatchSet ( cd.change ( ) . currentPatchSetId ( ) ) ; ps.setRevision ( new com.google.gerrit.reviewdb.client.RevId ( id.name ( ) ) ) ; java.util.List < com.google.gerrit.reviewdb.client.PatchSet > patchSets = new java.util.ArrayList ( cd.patchSets ( ) ) ; patchSets.add ( ps ) ; cd.setPatchSets ( patchSets ) ; return ps ; }

Target:
private com.google.gerrit.reviewdb.client.PatchSet addPatchSet ( com.google.gerrit.server.query.change.ChangeData cd , org.eclipse.jgit.lib.ObjectId id ) throws java.lang.Exception { com.google.gerrit.testing.TestChanges.incrementPatchSet ( cd.change ( ) ) ; com.google.gerrit.reviewdb.client.PatchSet ps = new com.google.gerrit.reviewdb.client.PatchSet ( cd.change ( ) . currentPatchSetId ( ) ) ; ps.setRevision ( new com.google.gerrit.reviewdb.client.RevId ( id.name ( ) ) ) ; java.util.List < com.google.gerrit.reviewdb.client.PatchSet > patchSets = new java.util.ArrayList ( cd.patchSets ( ) ) ; patchSets.add ( ps ) ; cd.setPatchSets ( patchSets ) ; return ps ; }
Source:
private Account.Id createAccountIfUserCanBeAuthenticated ( final java.lang.String username ) throws org.kohsuke.args4j.CmdLineException { try { final com.google.gerrit.server.account.AuthRequest areq = com.google.gerrit.server.account.AuthRequest.forUser ( username ) ; final com.google.gerrit.server.account.AuthResult arsp = accountManager.authenticate ( areq ) ; return arsp.getAccountId ( ) ; } catch ( com.google.gerrit.server.account.AccountException e ) { throw new org.kohsuke.args4j.CmdLineException ( owner , ( ( "Unable to authenticate user \"" + username ) + "\"" ) , e ) ; } }

Target:
private Account.Id createAccountByLdap ( java.lang.String user ) throws org.kohsuke.args4j.CmdLineException { if ( ! ( user.matches ( Account.USER_NAME_PATTERN ) ) ) { throw new org.kohsuke.args4j.CmdLineException ( owner , ( ( "user \"" + user ) + "\" not found" ) ) ; } try { com.google.gerrit.server.account.AuthRequest req = com.google.gerrit.server.account.AuthRequest.forUser ( user ) ; req.setSkipAuthentication ( true ) ; return accountManager.authenticate ( req ) . getAccountId ( ) ; } catch ( com.google.gerrit.server.account.AccountException e ) { throw new org.kohsuke.args4j.CmdLineException ( owner , ( ( "user \"" + user ) + "\" not found" ) ) ; } }
Source:
net.codemirror.lib.CodeMirror getCmB ( ) { return cmB ; }

Target:
void updateRenderEntireFile ( ) { cmA.removeKeyMap ( com.google.gerrit.client.diff.SideBySide2.RENDER_ENTIRE_FILE_KEYMAP ) ; cmB.removeKeyMap ( com.google.gerrit.client.diff.SideBySide2.RENDER_ENTIRE_FILE_KEYMAP ) ; if ( prefs.renderEntireFile ( ) ) { cmA.addKeyMap ( com.google.gerrit.client.diff.SideBySide2.RENDER_ENTIRE_FILE_KEYMAP ) ; cmB.addKeyMap ( com.google.gerrit.client.diff.SideBySide2.RENDER_ENTIRE_FILE_KEYMAP ) ; } cmA.setOption ( "viewportMargin" , ( prefs.renderEntireFile ( ) ? java.lang.Double.POSITIVE_INFINITY : 10 ) ) ; cmB.setOption ( "viewportMargin" , ( prefs.renderEntireFile ( ) ? java.lang.Double.POSITIVE_INFINITY : 10 ) ) ; }
Source:
public java.util.List < com.google.gerrit.server.update.BatchUpdate > batchUpdates ( com.google.gerrit.server.update.BatchUpdate.Factory batchUpdateFactory , java.util.Collection < com.google.gerrit.reviewdb.client.Project.NameKey > projects ) throws com.google.gerrit.server.project.NoSuchProjectException , java.io.IOException { java.util.List < com.google.gerrit.server.update.BatchUpdate > updates = new java.util.ArrayList ( projects.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.Project.NameKey project : projects ) ; }

Target:
public java.util.List < com.google.gerrit.server.update.BatchUpdate > batchUpdates ( com.google.gerrit.server.update.BatchUpdate.Factory batchUpdateFactory , java.util.Collection < com.google.gerrit.reviewdb.client.Project.NameKey > projects ) throws com.google.gerrit.server.project.NoSuchProjectException , java.io.IOException { java.util.List < com.google.gerrit.server.update.BatchUpdate > updates = new java.util.ArrayList ( projects.size ( ) ) ; for ( com.google.gerrit.reviewdb.client.Project.NameKey project : projects ) { updates.add ( getRepo ( project ) . getUpdate ( batchUpdateFactory ) . setRefLogMessage ( "merged" ) ) ; } return updates ; }
Source:
public com.googlecode.prolog_cafe.lang.Operation jtry0 ( com.googlecode.prolog_cafe.lang.Operation p , com.googlecode.prolog_cafe.lang.Operation next ) { return finishjtry ( p , next , com.googlecode.prolog_cafe.lang.ChoicePointFrame.S0 ( cont ) ) ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation jtry ( com.googlecode.prolog_cafe.lang.Operation p , com.googlecode.prolog_cafe.lang.Operation next , com.googlecode.prolog_cafe.lang.ChoicePointFrame entry ) { entry.cont = cont ; entry.b0 = B0 ; entry.bp = next ; entry.tr = trail.top ( ) ; entry.timeStamp = ++ ( CPFTimeStamp ) ; stack.push ( entry ) ; return p ; }
Source:
public void children ( ) { final com.google.gerrit.server.query.TestPredicate a = f ( "author" , "alice" ) ; final com.google.gerrit.server.query.TestPredicate b = f ( "author" , "bob" ) ; final com.google.gerrit.server.query.Predicate < java.lang.String > n = com.google.gerrit.server.query.Predicate.or ( a , b ) ; org.junit.Assert.assertEquals ( 2 , n.getChildCount ( ) ) ; org.junit.Assert.assertSame ( a , n.getChild ( 0 ) ) ; org.junit.Assert.assertSame ( b , n.getChild ( 1 ) ) ; }

Target:
public void children ( ) { final com.google.gerrit.index.query.TestPredicate a = f ( "author" , "alice" ) ; final com.google.gerrit.index.query.TestPredicate b = f ( "author" , "bob" ) ; final com.google.gerrit.index.query.Predicate < java.lang.String > n = com.google.gerrit.index.query.Predicate.or ( a , b ) ; org.junit.Assert.assertEquals ( 2 , n.getChildCount ( ) ) ; org.junit.Assert.assertSame ( a , n.getChild ( 0 ) ) ; org.junit.Assert.assertSame ( b , n.getChild ( 1 ) ) ; }
Source:
private java.lang.String threadName ( ) { final org.apache.sshd.server.session.ServerSession session = com.google.gerrit.sshd.SshScopes.getContext ( ) . session ; final java.lang.String who = session.getUsername ( ) ; final com.google.gerrit.reviewdb.Account.Id id = session.getAttribute ( SshUtil.CURRENT_ACCOUNT ) ; return ( ( ( ( "SSH " + ( getFullCommandLine ( ) ) ) + " / " ) + who ) + " " ) + id ; }

Target:
protected synchronized void startThread ( final com.google.gerrit.sshd.BaseCommand.CommandRunnable thunk ) { final java.util.List < org.apache.sshd.server.Command > active = com.google.gerrit.sshd.SshScopes.getContext ( ) . session.getAttribute ( SshUtil.ACTIVE ) ; synchronized ( active ) { active.add ( this ) ; } final com.google.gerrit.sshd.BaseCommand.TaskThunk tt = new com.google.gerrit.sshd.BaseCommand.TaskThunk ( thunk ) ; if ( isAdminCommand ( ) ) { new java.lang.Thread ( tt , tt.toString ( ) ) . start ( ) ; } else { task = executor.submit ( tt ) ; } }
Source:
public static com.google.gerrit.server.index.IndexConfig.Builder fromConfig ( org.eclipse.jgit.lib.Config cfg ) { com.google.gerrit.server.index.IndexConfig.Builder b = com.google.gerrit.server.index.IndexConfig.builder ( ) ; com.google.gerrit.server.index.IndexConfig.setIfPresent ( cfg , "maxLimit" , b :: maxLimit ) ; com.google.gerrit.server.index.IndexConfig.setIfPresent ( cfg , "maxPages" , b :: maxPages ) ; com.google.gerrit.server.index.IndexConfig.setIfPresent ( cfg , "maxTerms" , b :: maxTerms ) ; return b ; }

Target:
public static com.google.gerrit.index.IndexConfig.Builder fromConfig ( org.eclipse.jgit.lib.Config cfg ) { com.google.gerrit.index.IndexConfig.Builder b = com.google.gerrit.index.IndexConfig.builder ( ) ; com.google.gerrit.index.IndexConfig.setIfPresent ( cfg , "maxLimit" , b :: maxLimit ) ; com.google.gerrit.index.IndexConfig.setIfPresent ( cfg , "maxPages" , b :: maxPages ) ; com.google.gerrit.index.IndexConfig.setIfPresent ( cfg , "maxTerms" , b :: maxTerms ) ; return b ; }
Source:
public void onChangeAbandoned ( com.google.gerrit.extensions.events.ChangeAbandonedListener.Event event ) { com.google.gerrit.extensions.common.ChangeInfo change = event.getChange ( ) ; java.lang.String revision = event.getRevision ( ) . commit.commit ; com.googlesource.gerrit.plugins.automerger.DownstreamCreator.log.debug ( "Detected revision abandoned on {}." , revision , change.project ) ; try { abandonDownstream ( change , revision ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException e ) { com.googlesource.gerrit.plugins.automerger.DownstreamCreator.log.error ( "Automerger plugin failed onChangeAbandoned for {}" , change.id , e ) ; } }

Target:
public void onChangeAbandoned ( com.google.gerrit.extensions.events.ChangeAbandonedListener.Event event ) { try ( com.google.gerrit.server.util.ManualRequestContext ctx = oneOffRequestContext.openAs ( config.getContextUserId ( ) ) ) { com.google.gerrit.extensions.common.ChangeInfo change = event.getChange ( ) ; java.lang.String revision = event.getRevision ( ) . commit.commit ; com.googlesource.gerrit.plugins.automerger.DownstreamCreator.log.debug ( "Detected revision abandoned on {}." , revision , change.project ) ; abandonDownstream ( change , revision ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException | com.google.gwtorm.server.OrmException e ) { com.googlesource.gerrit.plugins.automerger.DownstreamCreator.log.error ( "Automerger plugin failed onChangeAbandoned for {}" , event.getChange ( ) . id , e ) ; } }
Source:
public void customConflictMessageWithRevisionSubstitutionTest ( ) throws java.lang.Exception { com.googlesource.gerrit.plugins.automerger.FailedMergeException fme = new com.googlesource.gerrit.plugins.automerger.FailedMergeException ( failedMergeBranches , currentRevision , hostName , "${branch} ${revision}" , topic ) ; java.lang.String branch1String = "branch1 " + ( currentRevision ) ; java.lang.String branch2String = "branch2 " + ( currentRevision ) ; java.lang.String branch3String = "branch3 " + ( currentRevision ) ; com.google.common.truth.Truth.assertThat ( fme.getDisplayString ( ) . split ( "\\n" ) ) . asList ( ) . containsExactly ( branch1String , branch2String , branch3String ) ; }

Target:
public void customConflictMessageWithRevisionSubstitutionTest ( ) 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} ${revision}" , topic ) ; java.lang.String branch1String = "branch1 " + ( currentRevision ) ; java.lang.String branch2String = "branch2 " + ( currentRevision ) ; java.lang.String branch3String = "branch3 " + ( currentRevision ) ; com.google.common.truth.Truth.assertThat ( fme.getDisplayString ( ) . split ( "\\n" ) ) . asList ( ) . containsExactly ( branch1String , branch2String , branch3String ) ; }
Source:
public void onShowView ( ) { super . onShowView ( ) ; if ( ( cmA ) != null ) { cmA.refresh ( ) ; } if ( ( cmB ) != null ) { cmB.refresh ( ) ; } com.google.gwt.user.client.Window.enableScrolling ( false ) ; for ( com.google.gerrit.client.diff.CommentBox box : initialBoxes ) { box.resizePaddingWidget ( ) ; } }

Target:
public void onShowView ( ) { super . onShowView ( ) ; if ( ( cmA ) != null ) { cmA.refresh ( ) ; } if ( ( cmB ) != null ) { cmB.refresh ( ) ; } com.google.gwt.user.client.Window.enableScrolling ( false ) ; for ( com.google.gerrit.client.diff.CommentBox box : initialBoxes ) { box.resizePaddingWidget ( ) ; } ( ( cmB ) != null ? cmB : cmA ) . focus ( ) ; }
Source:
boolean findOwnersInVotes ( com.googlesource.gerrit.plugins.findowners.Util.StringSet owners , com.googlesource.gerrit.plugins.findowners.Util.String2Integer votes ) { boolean foundVeto = false ; boolean foundApproval = false ; for ( java.lang.String owner : owners ) { if ( votes.containsKey ( owner ) ) { int v = votes.get ( owner ) ; foundApproval |= v >= ( minVoteLevel ) ; foundVeto |= v < 0 ; } else if ( owner.equals ( "*" ) ) { foundApproval = true ; } } return foundApproval && ( ! foundVeto ) ; }

Target:
boolean findOwnersInVotes ( java.util.Set < java.lang.String > owners , java.util.Map < java.lang.String , java.lang.Integer > votes ) { boolean foundVeto = false ; boolean foundApproval = false ; for ( java.lang.String owner : owners ) { if ( votes.containsKey ( owner ) ) { int v = votes.get ( owner ) ; foundApproval |= v >= ( minVoteLevel ) ; foundVeto |= v < 0 ; } else if ( owner.equals ( "*" ) ) { foundApproval = true ; } } return foundApproval && ( ! foundVeto ) ; }
Source:
private void assertCreateFails ( java.lang.Class < ? extends com.google.gerrit.extensions.restapi.RestApiException > errType , java.lang.String errMsg ) throws java.lang.Exception { exception.expect ( errType ) ; if ( errMsg != null ) { exception.expectMessage ( errMsg ) ; } branch ( ) . create ( new com.google.gerrit.extensions.api.projects.BranchInput ( ) ) ; }

Target:
private void assertCreateFails ( com.google.gerrit.reviewdb.client.Branch.NameKey branch , java.lang.Class < ? extends com.google.gerrit.extensions.restapi.RestApiException > errType , java.lang.String errMsg ) throws java.lang.Exception { assertCreateFails ( branch , null , errType , errMsg ) ; }
Source:
public boolean updateGroupNames ( com.google.gerrit.server.account.GroupCache groupCache ) { boolean dirty = false ; for ( com.google.gerrit.common.data.GroupReference ref : groupsByUUID.values ( ) ) { com.google.gerrit.reviewdb.client.AccountGroup g = groupCache.get ( ref.getUUID ( ) ) ; if ( ( g != null ) && ( ! ( g.getName ( ) . equals ( ref.getName ( ) ) ) ) ) { dirty = true ; ref.setName ( g.getName ( ) ) ; } } return dirty ; }

Target:
public boolean updateGroupNames ( com.google.gerrit.server.account.GroupBackend groupBackend ) { boolean dirty = false ; for ( com.google.gerrit.common.data.GroupReference ref : groupsByUUID.values ( ) ) { com.google.gerrit.common.data.GroupDescription.Basic g = groupBackend.get ( ref.getUUID ( ) ) ; if ( ( g != null ) && ( ! ( g.getName ( ) . equals ( ref.getName ( ) ) ) ) ) { dirty = true ; ref.setName ( g.getName ( ) ) ; } } return dirty ; }
Source:
private java.lang.String getTaskName ( ) { java.lang.StringBuilder m = new java.lang.StringBuilder ( ) ; m.append ( getTaskDescription ( ) ) ; if ( user.isIdentifiedUser ( ) ) { com.google.gerrit.server.IdentifiedUser u = user.asIdentifiedUser ( ) ; m.append ( " (" ) . append ( u.getAccount ( ) . getUserName ( ) ) . append ( ")" ) ; } return m.toString ( ) ; }

Target:
private java.lang.String getTaskName ( ) { java.lang.StringBuilder m = new java.lang.StringBuilder ( ) ; m.append ( getTaskDescription ( ) ) ; if ( user.isIdentifiedUser ( ) ) { com.google.gerrit.server.IdentifiedUser u = user.asIdentifiedUser ( ) ; m.append ( " (" ) . append ( u.state ( ) . getUserName ( ) ) . append ( ")" ) ; } return m.toString ( ) ; }
Source:
public com.google.gerrit.server.project.ChangeControl changeControl ( com.google.gerrit.server.CurrentUser user ) throws com.google.gwtorm.server.OrmException { if ( ( changeControl ) != null ) { throw new java.lang.IllegalStateException ( ( "user already specified: " + ( changeControl.getUser ( ) ) ) ) ; } try { if ( ( change ) != null ) { changeControl = changeControlFactory.controlFor ( db , change , user ) ; } else { changeControl = changeControlFactory.controlFor ( db , project , legacyId , user ) ; } } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { throw new com.google.gwtorm.server.OrmException ( e ) ; } return changeControl ; }

Target:
public Project.NameKey project ( ) throws com.google.gwtorm.server.OrmException { if ( ( project ) == null ) { com.google.common.base.Preconditions.checkState ( ( ! ( notesMigration.readChanges ( ) ) ) , ( "should not have created " + " ChangeData without a project when notedb is enabled" ) ) ; project = change ( ) . getProject ( ) ; } return project ; }
Source:
java.lang.Runnable maybeNextVimSearch ( final net.codemirror.lib.CodeMirror cm ) { return new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { if ( cm.vim ( ) . hasSearchHighlight ( ) ) { cm.vim ( ) . handleKey ( "n" ) ; } else { getChunkManager ( ) . diffChunkNav ( cm , Direction.NEXT ) . run ( ) ; } } } ; }

Target:
void setContext ( final int context ) { operation ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { skipManager.removeAll ( ) ; skipManager.render ( context , diff ) ; updateRenderEntireFile ( ) ; } } ) ; }
Source:
public void testRejectJavaScript_FormAction ( ) { final java.lang.String href = "javascript:window.close();" ; try { new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) . openElement ( "form" ) . setAttribute ( "action" , href ) ; org.junit.Assert.fail ( "accepted javascript in form action" ) ; } catch ( java.lang.RuntimeException e ) { org.junit.Assert.assertEquals ( ( "javascript unsafe in href: " + href ) , e.getMessage ( ) ) ; } }

Target:
public void testRejectJavaScript_FormAction ( ) { final java.lang.String href = "javascript:window.close();" ; exception.expect ( java.lang.RuntimeException.class ) ; exception.expectMessage ( ( "javascript unsafe in href: " + href ) ) ; new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) . openElement ( "form" ) . setAttribute ( "action" , href ) ; }
Source:
public com.google.common.collect.ListMultimap < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchSetApproval > approvals ( ) throws com.google.gwtorm.server.OrmException { if ( ( allApprovals ) == null ) { allApprovals = approvalsUtil.byChange ( db , notes ( ) ) ; } return allApprovals ; }

Target:
public com.google.common.collect.ListMultimap < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchSetApproval > approvals ( ) throws com.google.gwtorm.server.OrmException { if ( ( allApprovals ) == null ) { if ( ! ( lazyLoad ) ) { return com.google.common.collect.ImmutableListMultimap.of ( ) ; } allApprovals = approvalsUtil.byChange ( db , notes ( ) ) ; } return allApprovals ; }
Source:
public com.google.gerrit.server.patch.IntraLineDiff getIntraLineDiff ( org.eclipse.jgit.lib.ObjectId aId , com.google.gerrit.server.patch.Text aText , org.eclipse.jgit.lib.ObjectId bId , com.google.gerrit.server.patch.Text bText , java.util.List < org.eclipse.jgit.diff.Edit > edits ) { if ( computeIntraline ) { com.google.gerrit.server.patch.IntraLineDiffKey key = new com.google.gerrit.server.patch.IntraLineDiffKey ( aId , aText , bId , bText , edits ) ; return intraCache.get ( key ) ; } else { return null ; } }

Target:
public com.google.gerrit.server.patch.IntraLineDiff getIntraLineDiff ( com.google.gerrit.server.patch.IntraLineDiffKey key ) { if ( computeIntraline ) { com.google.gerrit.server.patch.IntraLineDiff d = intraCache.get ( key ) ; if ( d == null ) { d = new com.google.gerrit.server.patch.IntraLineDiff ( IntraLineDiff.Status.ERROR ) ; } return d ; } else { return new com.google.gerrit.server.patch.IntraLineDiff ( IntraLineDiff.Status.DISABLED ) ; } }
Source:
public void throwSQLExceptionIfNotOnline ( ) throws java.lang.Exception { setUpClientMock ( ) ; org.mockito.Mockito.doThrow ( new java.sql.SQLException ( new java.net.ConnectException ( ) ) ) . when ( eventsDb ) . createDBIfNotCreated ( ) ; org.mockito.Mockito.doThrow ( new java.sql.SQLException ( ) ) . when ( eventsDb ) . queryOne ( ) ; }

Target:
public void throwSQLExceptionIfNotOnline ( ) throws java.lang.Exception { setUpClientMock ( ) ; org.mockito.Mockito.doThrow ( new java.sql.SQLException ( new java.net.ConnectException ( ) ) ) . when ( eventsDb ) . createDBIfNotCreated ( ) ; org.mockito.Mockito.doThrow ( new java.sql.SQLException ( ) ) . when ( eventsDb ) . queryOne ( ) ; store = new com.ericsson.gerrit.plugins.eventslog.sql.SQLStore ( userProviderMock , cfgMock , eventsDb , localEventsDb , poolMock , permissionBackendMock ) ; store.start ( ) ; store.storeEvent ( mockEvent ) ; store.queryChangeEvents ( com.ericsson.gerrit.plugins.eventslog.sql.SQLStoreTest.GENERIC_QUERY ) ; }
Source:
public int hashCode ( ) { int h = 0 ; if ( ( oldId ) != null ) { h = ( h * 31 ) + ( oldId.hashCode ( ) ) ; } h = ( h * 31 ) + ( newId.hashCode ( ) ) ; h = ( h * 31 ) + ( whitespace.name ( ) . hashCode ( ) ) ; return h ; }

Target:
public static com.google.gerrit.server.patch.PatchListKey againstDefaultBase ( org.eclipse.jgit.lib.AnyObjectId newId , com.google.gerrit.extensions.client.DiffPreferencesInfo.Whitespace ws ) { return new com.google.gerrit.server.patch.PatchListKey ( null , newId , ws ) ; }
Source:
public java.util.Set < com.google.gerrit.client.reviewdb.AccountGroup.Id > getGroups ( final com.google.gerrit.client.reviewdb.Account.Id id ) { java.util.Set < com.google.gerrit.client.reviewdb.AccountGroup.Id > g = groupCache.get ( id ) ; if ( g == null ) { g = com.google.gerrit.client.rpc.Common.getGroupCache ( ) . getGroups ( id ) ; groupCache.put ( id , g ) ; } return g ; }

Target:
public java.util.Set < com.google.gerrit.client.reviewdb.AccountGroup.Id > getGroups ( final com.google.gerrit.client.reviewdb.Account.Id id ) { java.util.Set < com.google.gerrit.client.reviewdb.AccountGroup.Id > g = groupCache.get ( id ) ; if ( g == null ) { g = com.google.gerrit.client.rpc.Common.getGroupCache ( ) . getEffectiveGroups ( id ) ; groupCache.put ( id , g ) ; } return g ; }
Source:
public void basicTextFormattingWorks ( ) throws java.io.IOException { java.lang.String raw = "*italic* **bold** `monospace`" ; java.lang.String formatted = ( ( com.googlesource.gerrit.plugins.xdocs.formatter.MarkdownFormatterTest.PROLOG ) + "<em>italic</em> <strong>bold</strong> <code>monospace</code>" ) + ( com.googlesource.gerrit.plugins.xdocs.formatter.MarkdownFormatterTest.EPILOG ) ; org.junit.Assert.assertEquals ( formatted , formatter.format ( null , null , null , null , cfg , raw ) ) ; }

Target:
public void basicTextFormattingWorks ( ) throws java.io.IOException { java.lang.String raw = "*italic* **bold** `monospace`" ; java.lang.String formatted = ( ( com.googlesource.gerrit.plugins.xdocs.formatter.MarkdownFormatterTest.PROLOG ) + "<p><em>italic</em> <strong>bold</strong> <code>monospace</code></p>" ) + ( com.googlesource.gerrit.plugins.xdocs.formatter.MarkdownFormatterTest.EPILOG ) ; org.junit.Assert.assertEquals ( formatted , formatter.format ( null , null , null , null , cfg , raw ) ) ; }
Source:
protected void ccAllApprovals ( ) { try { for ( com.google.gerrit.reviewdb.client.Account.Id id : getReviewers ( ) . values ( ) ) { add ( RecipientType.CC , id ) ; } } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.ChangeEmail.log.warn ( "Cannot CC users that reviewed updated change" , err ) ; } }

Target:
protected void ccExistingReviewers ( ) { try { for ( com.google.gerrit.reviewdb.client.Account.Id id : changeData.reviewers ( ) . get ( ReviewerState.REVIEWER ) ) { add ( RecipientType.CC , id ) ; } } catch ( com.google.gwtorm.server.OrmException err ) { com.google.gerrit.server.mail.ChangeEmail.log.warn ( "Cannot CC users that commented on updated change" , err ) ; } }
Source:
private java.util.Map < java.lang.String , java.lang.Integer > getSingleSchemaVersions ( ) { java.util.Map < java.lang.String , java.lang.Integer > singleVersions = new java.util.HashMap < > ( ) ; java.lang.String schemaName = ChangeSchemaDefinitions.INSTANCE.getName ( ) ; int version = cfg.getInt ( "index" , "lucene" , ( schemaName + "TestVersion" ) , ( - 1 ) ) ; if ( version > 0 ) { singleVersions.put ( schemaName , version ) ; } return singleVersions ; }

Target:
private java.util.Map < java.lang.String , java.lang.Integer > getSingleSchemaVersions ( ) { java.util.Map < java.lang.String , java.lang.Integer > singleVersions = new java.util.HashMap < > ( ) ; putSchemaVersion ( singleVersions , AccountSchemaDefinitions.INSTANCE ) ; putSchemaVersion ( singleVersions , ChangeSchemaDefinitions.INSTANCE ) ; putSchemaVersion ( singleVersions , GroupSchemaDefinitions.INSTANCE ) ; return singleVersions ; }
Source:
public void setParams ( com.google.common.collect.Multimap < java.lang.String , java.lang.String > params ) { this . hasQuery2 = params.containsKey ( "query2" ) ; }

Target:
public void setParams ( com.google.common.collect.Multimap < java.lang.String , java.lang.String > params ) throws com.google.gerrit.extensions.restapi.BadRequestException { if ( ( params.containsKey ( "query" ) ) && ( params.containsKey ( "query2" ) ) ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( "\"query\" and \"query2\" options are mutually exclusive" ) ; } this . hasQuery2 = params.containsKey ( "query2" ) ; }
Source:
static java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > performValidation ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevCommit c ) throws java.io.IOException { final java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > messages = new java.util.LinkedList < > ( ) ; com.googlesource.gerrit.plugins.uploadvalidator.CommitUtils.visitChangedEntries ( repo , c , new com.googlesource.gerrit.plugins.uploadvalidator.TreeWalkVisitor ( ) { @ java.lang.Override public void onVisit ( org.eclipse.jgit.treewalk.TreeWalk tw ) { if ( com.googlesource.gerrit.plugins.uploadvalidator.SubmoduleValidator.isSubmodule ( tw ) ) { com.googlesource.gerrit.plugins.uploadvalidator.SubmoduleValidator.addValidationMessage ( messages , tw ) ; } } } ) ; return messages ; }

Target:
static java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > performValidation ( org.eclipse.jgit.lib.Repository repo , org.eclipse.jgit.revwalk.RevCommit c , org.eclipse.jgit.revwalk.RevWalk revWalk ) throws java.io.IOException { final java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > messages = new java.util.LinkedList < > ( ) ; com.googlesource.gerrit.plugins.uploadvalidator.CommitUtils.visitChangedEntries ( repo , c , revWalk , new com.googlesource.gerrit.plugins.uploadvalidator.TreeWalkVisitor ( ) { @ java.lang.Override public void onVisit ( org.eclipse.jgit.treewalk.TreeWalk tw ) { if ( com.googlesource.gerrit.plugins.uploadvalidator.SubmoduleValidator.isSubmodule ( tw ) ) { com.googlesource.gerrit.plugins.uploadvalidator.SubmoduleValidator.addValidationMessage ( messages , tw ) ; } } } ) ; return messages ; }
Source:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.RevisionInfo revision , com.google.gerrit.extensions.common.AccountInfo merger , java.lang.String newRevisionId ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.ChangeMerged.Event e = new com.google.gerrit.server.extensions.events.ChangeMerged.Event ( change , revision , merger , newRevisionId ) ; for ( com.google.gerrit.extensions.events.ChangeMergedListener l : listeners ) { l.onChangeMerged ( e ) ; } }

Target:
public void fire ( com.google.gerrit.extensions.common.ChangeInfo change , com.google.gerrit.extensions.common.RevisionInfo revision , com.google.gerrit.extensions.common.AccountInfo merger , java.lang.String newRevisionId ) { if ( ! ( listeners.iterator ( ) . hasNext ( ) ) ) { return ; } com.google.gerrit.server.extensions.events.ChangeMerged.Event event = new com.google.gerrit.server.extensions.events.ChangeMerged.Event ( change , revision , merger , newRevisionId ) ; for ( com.google.gerrit.extensions.events.ChangeMergedListener l : listeners ) { try { l.onChangeMerged ( event ) ; } catch ( java.lang.Exception e ) { com.google.gerrit.server.extensions.events.ChangeMerged.log.warn ( "Error in event listener" , e ) ; } } }
Source:
public com.google.gerrit.server.plugins.ServerPlugin get ( java.lang.String name , java.io.File srcFile , com.google.gerrit.server.PluginUser pluginUser , org.eclipse.jgit.internal.storage.file.FileSnapshot snapshot , java.lang.String pluginCanonicalWebUrl , java.io.File pluginDataDir ) throws com.google.gerrit.server.plugins.InvalidPluginException { com.googlesource.gerrit.plugins.scripting.scala.ScalaPluginScriptEngine scriptEngine = scriptEngineProvider.get ( ) ; return new com.google.gerrit.server.plugins.ServerPlugin ( name , pluginCanonicalWebUrl , pluginUser , srcFile , snapshot , new com.googlesource.gerrit.plugins.scripting.scala.ScalaPluginScanner ( name , srcFile , scriptEngine ) , pluginDataDir , scriptEngine.getClassLoader ( ) ) ; }

Target:
public com.google.gerrit.server.plugins.ServerPlugin get ( java.io.File srcFile , com.google.gerrit.server.PluginUser pluginUser , org.eclipse.jgit.internal.storage.file.FileSnapshot snapshot , java.lang.String pluginCanonicalWebUrl , java.io.File pluginDataDir ) 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 , pluginCanonicalWebUrl , pluginUser , srcFile , snapshot , new com.googlesource.gerrit.plugins.scripting.scala.ScalaPluginScanner ( name , srcFile , scriptEngine ) , pluginDataDir , scriptEngine.getClassLoader ( ) ) ; }
Source:
public void onKeyPress ( com.google.gwt.event.dom.client.KeyPressEvent e ) { e.stopPropagation ( ) ; if ( ( ( ( e.getCharCode ( ) ) == '\n' ) || ( ( e.getCharCode ( ) ) == ( com.google.gwt.event.dom.client.KeyCodes.KEY_ENTER ) ) ) && ( e.isControlKeyDown ( ) ) ) { e.preventDefault ( ) ; if ( post.isEnabled ( ) ) { onPost ( null ) ; } } }

Target:
public void onKeyDown ( com.google.gwt.event.dom.client.KeyDownEvent e ) { e.stopPropagation ( ) ; if ( ( ( ( e.getNativeKeyCode ( ) ) == ( com.google.gwt.event.dom.client.KeyCodes.KEY_ENTER ) ) || ( ( e.getNativeKeyCode ( ) ) == ( com.google.gwt.event.dom.client.KeyCodes.KEY_MAC_ENTER ) ) ) && ( ( e.isControlKeyDown ( ) ) || ( e.isMetaKeyDown ( ) ) ) ) { e.preventDefault ( ) ; if ( post.isEnabled ( ) ) { onPost ( null ) ; } } }
Source:
public void registerKeys ( ) { super . registerKeys ( ) ; contentTable.setRegisterKeys ( contentTable.isVisible ( ) ) ; regNavigation = com.google.gwtexpui.globalkey.client.GlobalKey.add ( this , keysNavigation ) ; }

Target:
public void registerKeys ( ) { super . registerKeys ( ) ; contentTable.setRegisterKeys ( contentTable.isVisible ( ) ) ; if ( ( regNavigation ) != null ) { regNavigation.removeHandler ( ) ; regNavigation = null ; } regNavigation = com.google.gwtexpui.globalkey.client.GlobalKey.add ( this , keysNavigation ) ; }
Source:
private void update ( com.google.gerrit.common.data.PatchScriptSettings s ) { if ( ( ( lastScript ) != null ) && ( canReuse ( s , lastScript ) ) ) { lastScript.setSettings ( s ) ; RpcStatus.INSTANCE.onRpcStart ( null ) ; settingsPanel.setEnabled ( false ) ; com.google.gwt.user.client.DeferredCommand.addCommand ( new com.google.gwt.user.client.Command ( ) { @ java.lang.Override public void execute ( ) { try { onResult ( lastScript , false ) ; } finally { RpcStatus.INSTANCE.onRpcComplete ( null ) ; } } } ) ; } else { refresh ( false ) ; } }

Target:
private void update ( com.google.gerrit.reviewdb.AccountDiffPreference dp ) { if ( ( ( lastScript ) != null ) && ( canReuse ( dp , lastScript ) ) ) { lastScript.setDiffPrefs ( dp ) ; RpcStatus.INSTANCE.onRpcStart ( null ) ; settingsPanel.setEnabled ( false ) ; com.google.gwt.user.client.DeferredCommand.addCommand ( new com.google.gwt.user.client.Command ( ) { @ java.lang.Override public void execute ( ) { try { onResult ( lastScript , false ) ; } finally { RpcStatus.INSTANCE.onRpcComplete ( null ) ; } } } ) ; } else { refresh ( false ) ; } }