auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static java.lang.StringBuilder buildRefsDraftCommentsPrefix ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { java.lang.StringBuilder r = new java.lang.StringBuilder ( ) ; r.append ( com.google.gerrit.reviewdb.client.RefNames.REFS_DRAFT_COMMENTS ) ; int n = ( accountId.get ( ) ) % 100 ; if ( n < 10 ) { r.append ( '0' ) ; } r.append ( n ) ; r.append ( '/' ) ; r.append ( accountId.get ( ) ) ; r.append ( '-' ) ; return r ; }

Target:
public static java.lang.String refsDraftCommentsPrefix ( com.google.gerrit.reviewdb.client.Account.Id accountId ) { return com.google.gerrit.reviewdb.client.RefNames.buildRefsPrefix ( com.google.gerrit.reviewdb.client.RefNames.REFS_DRAFT_COMMENTS , accountId ) . toString ( ) ; }
Source:
public Account.Id createEntry ( final java.lang.String username ) throws java.lang.Exception { final com.google.gerrit.reviewdb.ReviewDb db = schema.open ( ) ; try { final com.google.gerrit.reviewdb.AccountExternalId.Key key = new com.google.gerrit.reviewdb.AccountExternalId.Key ( com.google.gerrit.reviewdb.AccountExternalId.SCHEME_USERNAME , username ) ; final com.google.gerrit.reviewdb.AccountExternalId id = db.accountExternalIds ( ) . get ( key ) ; return id != null ? id.getAccountId ( ) : null ; } finally { db.close ( ) ; } }

Target:
public Account.Id createEntry ( final com.google.gerrit.reviewdb.Account.Username username ) throws java.lang.Exception { final com.google.gerrit.reviewdb.ReviewDb db = schema.open ( ) ; try { final com.google.gerrit.reviewdb.AccountExternalId.Key key = new com.google.gerrit.reviewdb.AccountExternalId.Key ( com.google.gerrit.reviewdb.AccountExternalId.SCHEME_USERNAME , username.get ( ) ) ; final com.google.gerrit.reviewdb.AccountExternalId id = db.accountExternalIds ( ) . get ( key ) ; return id != null ? id.getAccountId ( ) : null ; } finally { db.close ( ) ; } }
Source:
public void testFindAfterInsertGap ( ) { com.google.gerrit.client.diff.LineMapper mapper = new com.google.gerrit.client.diff.LineMapper ( ) ; mapper.appendInsert ( 10 ) ; org.junit.Assert.assertEquals ( new com.google.gerrit.client.diff.LineMapper.LineOnOtherInfo ( 0 , true ) , mapper.lineOnOther ( Side.REVISION , 10 ) ) ; org.junit.Assert.assertEquals ( new com.google.gerrit.client.diff.LineMapper.LineOnOtherInfo ( 10 , true ) , mapper.lineOnOther ( Side.PARENT , 0 ) ) ; }

Target:
public void testFindAfterInsertGap ( ) { com.google.gerrit.client.diff.LineMapper mapper = new com.google.gerrit.client.diff.LineMapper ( ) ; mapper.appendInsert ( 10 ) ; org.junit.Assert.assertEquals ( new com.google.gerrit.client.diff.LineMapper.LineOnOtherInfo ( 0 , true ) , mapper.lineOnOther ( DisplaySide.B , 10 ) ) ; org.junit.Assert.assertEquals ( new com.google.gerrit.client.diff.LineMapper.LineOnOtherInfo ( 10 , true ) , mapper.lineOnOther ( DisplaySide.A , 0 ) ) ; }
Source:
public java.util.Collection < com.google.gerrit.reviewdb.AccountGroup > createEntry ( final com.google.gerrit.reviewdb.AccountGroup.ExternalNameKey key ) throws java.lang.Exception { return lookup ( key ) ; }

Target:
public java.util.Collection < com.google.gerrit.reviewdb.AccountGroup > createEntry ( final com.google.gerrit.reviewdb.AccountGroup.ExternalNameKey key ) throws java.lang.Exception { final com.google.gerrit.reviewdb.ReviewDb db = schema.open ( ) ; try { return db.accountGroups ( ) . byExternalName ( key ) . toList ( ) ; } finally { db.close ( ) ; } }
Source:
protected boolean shouldClose ( org.eclipse.jgit.lib.Repository repo ) { return true ; }

Target:
public void onPreReceive ( org.eclipse.jgit.transport.ReceivePack rp , java.util.Collection < org.eclipse.jgit.transport.ReceiveCommand > commands ) { org.eclipse.jgit.transport.PushCertificate cert = rp.getPushCertificate ( ) ; if ( cert == null ) { return ; } com.google.gerrit.gpg.CheckResult result = checkerFactory.create ( user.get ( ) ) . check ( cert ) ; if ( ! ( com.google.gerrit.gpg.SignedPushPreReceiveHook.isAllowed ( result , commands ) ) ) { for ( java.lang.String problem : result.getProblems ( ) ) { rp.sendMessage ( problem ) ; } com.google.gerrit.gpg.SignedPushPreReceiveHook.reject ( commands , "invalid push cert" ) ; } }
Source:
public void stop ( ) { manager.stop ( ) ; }

Target:
public void stop ( ) { if ( ( runId ) != null ) { try { java.nio.file.Files.delete ( runFile ) ; } catch ( java.io.IOException err ) { com.google.gerrit.pgm.Daemon.log.warn ( ( "failed to delete " + ( runFile ) ) , err ) ; } } manager.stop ( ) ; }
Source:
public void display ( final com.google.gerrit.client.reviewdb.PatchSet.Id id , final java.util.List < com.google.gerrit.client.reviewdb.Patch > list ) { psid = id ; final com.google.gerrit.client.changes.PatchTable.DisplayCommand cmd = new com.google.gerrit.client.changes.PatchTable.DisplayCommand ( list ) ; if ( cmd.execute ( ) ) { cmd.initMeter ( ) ; com.google.gwt.user.client.DeferredCommand.addCommand ( cmd ) ; } }

Target:
public void display ( final com.google.gerrit.client.reviewdb.PatchSet.Id id , final java.util.List < com.google.gerrit.client.reviewdb.Patch > list ) { psid = id ; final com.google.gerrit.client.changes.PatchTable.DisplayCommand cmd = new com.google.gerrit.client.changes.PatchTable.DisplayCommand ( list ) ; if ( cmd.execute ( ) ) { cmd.initMeter ( ) ; com.google.gwt.user.client.DeferredCommand.addCommand ( cmd ) ; } else { cmd.showTable ( ) ; } }
Source:
public void parent ( java.lang.String parent ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.extensions.common.ParentInput input = new com.google.gerrit.extensions.common.ParentInput ( ) ; input.parent = parent ; setParent.apply ( checkExists ( ) , input ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot set parent" , e ) ; } }

Target:
public void parent ( java.lang.String parent ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.extensions.api.projects.ParentInput input = new com.google.gerrit.extensions.api.projects.ParentInput ( ) ; input.parent = parent ; setParent.apply ( checkExists ( ) , input ) ; } catch ( java.lang.Exception e ) { throw com.google.gerrit.server.api.ApiUtil.asRestApiException ( "Cannot set parent" , e ) ; } }
Source:
void addHashtag ( java.lang.String token ) throws org.kohsuke.args4j.CmdLineException { if ( ! ( notesMigration.enabled ( ) ) ) { throw clp.reject ( "cannot add hashtags; noteDb is disabled" ) ; } java.lang.String hashtag = com.google.gerrit.server.change.HashtagsUtil.cleanupHashtag ( token ) ; if ( ! ( hashtag.isEmpty ( ) ) ) { hashtags.add ( hashtag ) ; } }

Target:
void addHashtag ( java.lang.String token ) throws org.kohsuke.args4j.CmdLineException { if ( ! ( notesMigration.readChanges ( ) ) ) { throw clp.reject ( "cannot add hashtags; noteDb is disabled" ) ; } java.lang.String hashtag = com.google.gerrit.server.change.HashtagsUtil.cleanupHashtag ( token ) ; if ( ! ( hashtag.isEmpty ( ) ) ) { hashtags.add ( hashtag ) ; } }
Source:
void applyDraft ( com.google.gerrit.server.notedb.ChangeDraftUpdate draftUpdate ) throws com.google.gwtorm.server.OrmException { if ( ( c.revId ) == null ) { com.google.gerrit.server.CommentsUtil.setCommentRevId ( c , cache , change , ps ) ; } draftUpdate.putComment ( c ) ; }

Target:
void applyDraft ( com.google.gerrit.server.notedb.ChangeDraftUpdate draftUpdate ) { if ( ( c.revId ) == null ) { try { com.google.gerrit.server.CommentsUtil.setCommentRevId ( c , cache , change , ps ) ; } catch ( com.google.gerrit.server.patch.PatchListNotAvailableException e ) { com.google.gerrit.server.notedb.rebuild.DraftCommentEvent.log.warn ( "Unable to determine parent commit of patch set ({}); omitting draft inline comment" , ps.getId ( ) , ps.getRevision ( ) , c ) ; return ; } } draftUpdate.putComment ( c ) ; }
Source:
void apply ( com.google.gerrit.server.notedb.ChangeUpdate update ) throws com.google.gwtorm.server.OrmException { checkUpdate ( update ) ; if ( ( c.revId ) == null ) { com.google.gerrit.server.CommentsUtil.setCommentRevId ( c , cache , change , ps ) ; } update.putComment ( PatchLineComment.Status.PUBLISHED , c ) ; }

Target:
void apply ( com.google.gerrit.server.notedb.ChangeUpdate update ) { checkUpdate ( update ) ; if ( ( c.revId ) == null ) { try { com.google.gerrit.server.CommentsUtil.setCommentRevId ( c , cache , change , ps ) ; } catch ( com.google.gerrit.server.patch.PatchListNotAvailableException e ) { com.google.gerrit.server.notedb.rebuild.CommentEvent.log.warn ( "Unable to determine parent commit of patch set ({}); omitting inline comment" , ps.getId ( ) , ps.getRevision ( ) , c ) ; return ; } } update.putComment ( PatchLineComment.Status.PUBLISHED , c ) ; }
Source:
protected void configure ( ) { bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.extensions.annotations.PluginName.class ) . toInstance ( "ItsTestName" ) ; serverConfig = createMock ( org.eclipse.jgit.lib.Config.class ) ; bind ( org.eclipse.jgit.lib.Config.class ) . annotatedWith ( com.google.gerrit.server.config.GerritServerConfig.class ) . toInstance ( serverConfig ) ; issueExtractor = createMock ( com.googlesource.gerrit.plugins.hooks.util.IssueExtractor.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.util.IssueExtractor.class ) . toInstance ( issueExtractor ) ; itsFacade = createMock ( com.googlesource.gerrit.plugins.hooks.its.ItsFacade.class ) ; bind ( com.googlesource.gerrit.plugins.hooks.its.ItsFacade.class ) . toInstance ( itsFacade ) ; }

Target:
public boolean isEnabled ( java.lang.String project ) { return true ; }
Source:
protected void onLoad ( ) { super . onLoad ( ) ; Util.PROJECT_SVC.projectDetail ( getProjectKey ( ) , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.common.data.ProjectDetail > ( this ) { public void preDisplay ( final com.google.gerrit.common.data.ProjectDetail result ) { enableForm ( result.canModifyAgreements , result.canModifyDescription , result.canModifyMergeType , result.canModifyState ) ; saveProject.setVisible ( ( ( ( ( result.canModifyAgreements ) || ( result.canModifyDescription ) ) || ( result.canModifyMergeType ) ) || ( result.canModifyState ) ) ) ; display ( result ) ; } } ) ; }

Target:
protected void onLoad ( ) { super . onLoad ( ) ; Util.PROJECT_SVC.projectDetail ( getProjectKey ( ) , new com.google.gerrit.client.rpc.ScreenLoadCallback < com.google.gerrit.common.data.ProjectDetail > ( this ) { public void preDisplay ( final com.google.gerrit.common.data.ProjectDetail result ) { enableForm ( result.canModifyAgreements , result.canModifyDescription , result.canModifyMergeType , result.canModifyState ) ; saveProject.setVisible ( ( ( ( ( result.canModifyAgreements ) || ( result.canModifyDescription ) ) || ( result.canModifyMergeType ) ) || ( result.canModifyState ) ) ) ; display ( result ) ; } } ) ; savedPanel = INFO ; }
Source:
public java.util.Optional < java.lang.String > permissionName ( ) { switch ( forUser ) { case SELF : return java.util.Optional.of ( com.google.gerrit.common.data.Permission.forLabel ( name ) ) ; case ON_BEHALF_OF : return java.util.Optional.of ( com.google.gerrit.common.data.Permission.forLabelAs ( name ) ) ; } return java.util.Optional.empty ( ) ; }

Target:
public java.lang.String permissionName ( ) { if ( ( forUser ) == ( com.google.gerrit.server.permissions.LabelPermission.ForUser.ON_BEHALF_OF ) ) { return com.google.gerrit.common.data.Permission.forLabelAs ( name ) ; } return com.google.gerrit.common.data.Permission.forLabel ( name ) ; }
Source:
private void stopRemovedPlugins ( java.util.List < java.io.File > jars ) { java.util.Set < java.lang.String > unload = com.google.common.collect.Sets.newHashSet ( running.keySet ( ) ) ; for ( java.io.File jar : jars ) { if ( ! ( jar.getName ( ) . endsWith ( ".disabled" ) ) ) { unload.remove ( com.google.gerrit.server.plugins.PluginLoader.nameOf ( jar ) ) ; } } for ( java.lang.String name : unload ) { com.google.gerrit.server.plugins.PluginLoader.log.info ( java.lang.String.format ( "Unloading plugin %s" , name ) ) ; running.remove ( name ) . stop ( ) ; } }

Target:
private void stopRemovedPlugins ( java.util.List < java.io.File > jars ) { java.util.Set < java.lang.String > unload = com.google.common.collect.Sets.newHashSet ( running.keySet ( ) ) ; for ( java.io.File jar : jars ) { if ( ! ( jar.getName ( ) . endsWith ( ".disabled" ) ) ) { unload.remove ( com.google.gerrit.server.plugins.PluginLoader.nameOf ( jar ) ) ; } } for ( java.lang.String name : unload ) { unloadPlugin ( running.get ( name ) ) ; } }
Source:
private synchronized void runHook ( com.google.gerrit.reviewdb.client.Project.NameKey project , java.io.File hook , java.util.List < java.lang.String > args ) { if ( ( project != null ) && ( hook.exists ( ) ) ) { hookQueue.execute ( new com.google.gerrit.common.ChangeHookRunner.AsyncHookTask ( project , hook , args ) ) ; } }

Target:
private synchronized void runHook ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.common.base.Optional < java.nio.file.Path > hook , java.util.List < java.lang.String > args ) { if ( ( project != null ) && ( hook.isPresent ( ) ) ) { hookQueue.execute ( new com.google.gerrit.common.ChangeHookRunner.AsyncHookTask ( project , hook.get ( ) , args ) ) ; } }
Source:
public void display ( final java.util.List < com.google.gerrit.reviewdb.AccountGroup > result ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( final com.google.gerrit.reviewdb.AccountGroup k : result ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , k ) ; } }

Target:
public void display ( final java.util.List < com.google.gerrit.common.data.GroupDetail > result ) { while ( 1 < ( table.getRowCount ( ) ) ) table.removeRow ( ( ( table.getRowCount ( ) ) - 1 ) ) ; for ( com.google.gerrit.common.data.GroupDetail detail : result ) { final int row = table.getRowCount ( ) ; table.insertRow ( row ) ; applyDataRowStyle ( row ) ; populate ( row , detail ) ; } }
Source:
private void insertMessage ( com.google.gerrit.reviewdb.server.ReviewDb db ) throws com.google.gwtorm.server.OrmException { if ( ( changeMessage ) != null ) { db.changeMessages ( ) . insert ( java.util.Collections.singleton ( changeMessage ) ) ; } }

Target:
private void commitMessageNotForChange ( com.google.gerrit.reviewdb.client.Change updatedChange ) throws com.google.gerrit.server.project.NoSuchChangeException , com.google.gwtorm.server.OrmException , java.io.IOException { if ( ( changeMessage ) != null ) { com.google.gerrit.reviewdb.client.Change otherChange = db.changes ( ) . get ( changeMessage.getPatchSetId ( ) . getParentKey ( ) ) ; com.google.gerrit.server.project.ChangeControl otherControl = ctlFactory.controlFor ( otherChange , user ) ; com.google.gerrit.server.notedb.ChangeUpdate updateForOtherChange = updateFactory.create ( otherControl , updatedChange.getLastUpdatedOn ( ) ) ; cmUtil.addChangeMessage ( db , updateForOtherChange , changeMessage ) ; updateForOtherChange.commit ( ) ; } }
Source:
protected void configure ( ) { bind ( org.eclipse.jgit.lib.Config.class ) . annotatedWith ( com.google.gerrit.server.config.GerritServerConfig.class ) . toInstance ( new org.eclipse.jgit.lib.Config ( ) ) ; factory ( CapabilityControl.Factory.class ) ; bind ( com.google.gerrit.server.project.ProjectCache.class ) . toInstance ( projectCache ) ; }

Target:
protected void configure ( ) { bind ( org.eclipse.jgit.lib.Config.class ) . annotatedWith ( com.google.gerrit.server.config.GerritServerConfig.class ) . toInstance ( new org.eclipse.jgit.lib.Config ( ) ) ; bind ( com.google.gerrit.server.git.GitRepositoryManager.class ) . toInstance ( repoManager ) ; bind ( com.google.gerrit.server.patch.PatchListCache.class ) . toProvider ( com.google.inject.util.Providers.< com.google.gerrit.server.patch.PatchListCache > of ( null ) ) ; factory ( CapabilityControl.Factory.class ) ; factory ( ChangeControl.AssistedFactory.class ) ; factory ( ChangeData.Factory.class ) ; bind ( com.google.gerrit.server.project.ProjectCache.class ) . toInstance ( projectCache ) ; }
Source:
public java.lang.String getLines ( final int begin , final int end ) { if ( begin == end ) { return "" ; } final int s = getLineStart ( begin ) ; int e = getLineEnd ( ( end - 1 ) ) ; if ( ( content [ ( e - 1 ) ] ) == '\n' ) { e -- ; } return decode ( s , e ) ; }

Target:
public java.lang.String getLines ( final int begin , final int end , boolean dropLF ) { if ( begin == end ) { return "" ; } final int s = getLineStart ( begin ) ; int e = getLineEnd ( ( end - 1 ) ) ; if ( dropLF && ( ( content [ ( e - 1 ) ] ) == '\n' ) ) { e -- ; } return decode ( s , e ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { if ( ( replyAction ) != null ) { input.message ( replyAction.getMessage ( ) ) ; } com.google.gerrit.client.changes.ChangeApi.revision ( changeId.get ( ) , revision ) . view ( "review" ) . post ( input , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.changes.ReviewInput > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ReviewInput result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId ) ) ; } } ) ; }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { if ( ( ( replyAction ) != null ) && ( replyAction.isVisible ( ) ) ) { replyAction.quickApprove ( input ) ; } else { com.google.gerrit.client.changes.ChangeApi.revision ( changeId.get ( ) , revision ) . view ( "review" ) . post ( input , new com.google.gerrit.client.rpc.GerritCallback < com.google.gerrit.client.changes.ReviewInput > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.changes.ReviewInput result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId ) ) ; } } ) ; } }
Source:
public static com.google.gerrit.reviewdb.client.Change newChange ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.server.IdentifiedUser user , int id ) { com.google.gerrit.reviewdb.client.Change.Id changeId = new com.google.gerrit.reviewdb.client.Change.Id ( id ) ; com.google.gerrit.reviewdb.client.Change c = new com.google.gerrit.reviewdb.client.Change ( new com.google.gerrit.reviewdb.client.Change.Key ( "Iabcd1234abcd1234abcd1234abcd1234abcd1234" ) , changeId , user.getAccount ( ) . getId ( ) , new com.google.gerrit.reviewdb.client.Branch.NameKey ( project , "master" ) , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; com.google.gerrit.testutil.TestChanges.incrementPatchSet ( c ) ; return c ; }

Target:
public static com.google.gerrit.reviewdb.client.Change newChange ( com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Account.Id userId , int id ) { com.google.gerrit.reviewdb.client.Change.Id changeId = new com.google.gerrit.reviewdb.client.Change.Id ( id ) ; com.google.gerrit.reviewdb.client.Change c = new com.google.gerrit.reviewdb.client.Change ( new com.google.gerrit.reviewdb.client.Change.Key ( "Iabcd1234abcd1234abcd1234abcd1234abcd1234" ) , changeId , userId , new com.google.gerrit.reviewdb.client.Branch.NameKey ( project , "master" ) , com.google.gerrit.common.TimeUtil.nowTs ( ) ) ; com.google.gerrit.testutil.TestChanges.incrementPatchSet ( c ) ; return c ; }
Source:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > scanDraftComments ( 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 : db.get ( ) . patchComments ( ) . draftByPatchSetAuthor ( rsrc.getPatchSet ( ) . getId ( ) , rsrc.getAccountId ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }

Target:
private java.util.Map < java.lang.String , com.google.gerrit.reviewdb.client.PatchLineComment > scanDraftComments ( 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.draftByPatchSetAuthor ( db.get ( ) , rsrc.getPatchSet ( ) . getId ( ) , rsrc.getAccountId ( ) , rsrc.getNotes ( ) ) ) { drafts.put ( c.getKey ( ) . get ( ) , c ) ; } return drafts ; }
Source:
public void testIsEnabledDraftPublishedEvent ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.DraftPublishedEvent event = new com.google.gerrit.server.events.DraftPublishedEvent ( ) ; event.change = new com.google.gerrit.server.data.ChangeAttribute ( ) ; event.change.project = "testProject" ; event.change.branch = "testBranch" ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( event ) ) ; }

Target:
public void testIsEnabledChangeMergedEvent ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { } ; setupIsEnabled ( "true" , null , branches ) ; com.google.gerrit.server.events.ChangeMergedEvent event = new com.google.gerrit.server.events.ChangeMergedEvent ( ) ; com.google.gerrit.server.data.ChangeAttribute changeAttribute = new com.google.gerrit.server.data.ChangeAttribute ( ) ; changeAttribute.project = "testProject" ; changeAttribute.branch = "testBranch" ; event.change = com.google.common.base.Suppliers.ofInstance ( changeAttribute ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; assertTrue ( itsConfig.isEnabled ( event ) ) ; }
Source:
public void initPopup ( final java.lang.String popupText , final java.lang.String currentPageLink ) { createWidgets ( popupText , currentPageLink ) ; final com.google.gwt.user.client.ui.FlowPanel pfp = new com.google.gwt.user.client.ui.FlowPanel ( ) ; sp = new com.google.gwt.user.client.ui.ScrollPanel ( projectsTab ) ; sp.setSize ( "100%" , "100%" ) ; pfp.add ( sp ) ; pfp.add ( close ) ; popup.setWidget ( pfp ) ; popup.setHeight ( "100%" ) ; popupPosition = getPositionCallback ( ) ; }

Target:
public void initPopup ( final java.lang.String popupText , final java.lang.String currentPageLink ) { createWidgets ( popupText , currentPageLink ) ; final com.google.gwt.user.client.ui.FlowPanel pfp = new com.google.gwt.user.client.ui.FlowPanel ( ) ; pfp.add ( filterPanel ) ; sp = new com.google.gwt.user.client.ui.ScrollPanel ( projectsTab ) ; sp.setSize ( "100%" , "100%" ) ; pfp.add ( sp ) ; pfp.add ( close ) ; popup.setWidget ( pfp ) ; popup.setHeight ( "100%" ) ; popupPosition = getPositionCallback ( ) ; }
Source:
public void stop ( ) { try { eventsDb.close ( ) ; } catch ( java.sql.SQLException e ) { throw new java.lang.RuntimeException ( "Cannot close datasource " , e ) ; } try { localEventsDb.close ( ) ; } catch ( java.sql.SQLException e ) { throw new java.lang.RuntimeException ( "Cannot close datasource " , e ) ; } }

Target:
public void stop ( ) { try { eventsDb.close ( ) ; } catch ( java.sql.SQLException e ) { com.ericsson.gerrit.plugins.eventslog.SQLStore.log.warn ( "Cannot close datasource " , e ) ; } try { localEventsDb.close ( ) ; } catch ( java.sql.SQLException e ) { com.ericsson.gerrit.plugins.eventslog.SQLStore.log.warn ( "Cannot close datasource " , e ) ; } }
Source:
private java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > groupsOf ( com.google.gerrit.reviewdb.client.Account.Id account ) { return new java.util.HashSet ( com.google.common.collect.Sets.filter ( userFactory.create ( account ) . getEffectiveGroups ( ) . getKnownGroups ( ) , new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.AccountGroup.UUID > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.AccountGroup.UUID in ) { return ! ( com.google.gerrit.server.group.SystemGroupBackend.isSystemGroup ( in ) ) ; } } ) ) ; }

Target:
private java.util.Set < com.google.gerrit.reviewdb.client.AccountGroup.UUID > groupsOf ( com.google.gerrit.server.IdentifiedUser user ) { return new java.util.HashSet ( com.google.common.collect.Sets.filter ( user.getEffectiveGroups ( ) . getKnownGroups ( ) , new com.google.common.base.Predicate < com.google.gerrit.reviewdb.client.AccountGroup.UUID > ( ) { @ java.lang.Override public boolean apply ( com.google.gerrit.reviewdb.client.AccountGroup.UUID in ) { return ! ( com.google.gerrit.server.group.SystemGroupBackend.isSystemGroup ( in ) ) ; } } ) ) ; }
Source:
private java.lang.String parseBranch ( org.eclipse.jgit.revwalk.RevCommit commit ) throws org.eclipse.jgit.errors.ConfigInvalidException { java.util.List < java.lang.String > branchLines = commit.getFooterLines ( com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_BRANCH ) ; if ( branchLines.isEmpty ( ) ) { return null ; } else if ( ( branchLines.size ( ) ) > 1 ) { throw expectedOneFooter ( com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_BRANCH , branchLines ) ; } return com.google.gerrit.reviewdb.client.RefNames.fullName ( branchLines.get ( 0 ) ) ; }

Target:
private java.lang.String parseTopic ( org.eclipse.jgit.revwalk.RevCommit commit ) throws org.eclipse.jgit.errors.ConfigInvalidException { return parseOneFooter ( commit , com.google.gerrit.server.notedb.ChangeNoteUtil.FOOTER_TOPIC ) ; }
Source:
public void testWithSubmodule ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit c = makeCommitWithSubmodule ( ) ; java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m = com.googlesource.gerrit.plugins.uploadvalidator.SubmoduleValidator.performValidation ( repo , c ) ; com.google.common.truth.Truth.assertThat ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessages ( m ) ) . containsExactlyElementsIn ( com.google.common.collect.ImmutableSet.of ( "ERROR: submodules are not allowed: modules/library" ) ) ; }

Target:
public void testWithSubmodule ( ) throws java.lang.Exception { org.eclipse.jgit.revwalk.RevCommit c = makeCommitWithSubmodule ( ) ; java.util.List < com.google.gerrit.server.git.validators.CommitValidationMessage > m = com.googlesource.gerrit.plugins.uploadvalidator.SubmoduleValidator.performValidation ( repo , c ) ; com.google.common.truth.Truth.assertThat ( com.googlesource.gerrit.plugins.uploadvalidator.TestUtils.transformMessages ( m ) ) . containsExactly ( "ERROR: submodules are not allowed: modules/library" ) ; }
Source:
private static com.google.gerrit.extensions.restapi.BinaryResult base64 ( com.google.gerrit.extensions.restapi.BinaryResult bin ) throws java.io.IOException { int max = 4 * ( com.google.common.math.IntMath.divide ( ( ( int ) ( bin.getContentLength ( ) ) ) , 3 , java.math.RoundingMode.CEILING ) ) ; org.eclipse.jgit.util.TemporaryBuffer.Heap buf = com.google.gerrit.httpd.restapi.RestApiServlet.heap ( max ) ; java.io.OutputStream encoded = com.google.common.io.BaseEncoding.base64 ( ) . encodingStream ( new java.io.OutputStreamWriter ( buf , com.google.common.base.Charsets.ISO_8859_1 ) ) ; bin.writeTo ( encoded ) ; encoded.close ( ) ; return com.google.gerrit.httpd.restapi.RestApiServlet.asBinaryResult ( buf ) ; }

Target:
private static com.google.gerrit.extensions.restapi.BinaryResult base64 ( com.google.gerrit.extensions.restapi.BinaryResult bin ) throws java.io.IOException { int max = 4 * ( com.google.common.math.IntMath.divide ( ( ( int ) ( bin.getContentLength ( ) ) ) , 3 , java.math.RoundingMode.CEILING ) ) ; org.eclipse.jgit.util.TemporaryBuffer.Heap buf = com.google.gerrit.httpd.restapi.RestApiServlet.heap ( max ) ; java.io.OutputStream encoded = com.google.common.io.BaseEncoding.base64 ( ) . encodingStream ( new java.io.OutputStreamWriter ( buf , java.nio.charset.StandardCharsets.ISO_8859_1 ) ) ; bin.writeTo ( encoded ) ; encoded.close ( ) ; return com.google.gerrit.httpd.restapi.RestApiServlet.asBinaryResult ( buf ) ; }
Source:
public static com.google.gerrit.common.data.PermissionRule blockLabel ( com.google.gerrit.server.git.ProjectConfig project , java.lang.String labelName , int min , int max , com.google.gerrit.reviewdb.client.AccountGroup.UUID group , java.lang.String ref ) { com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.project.testing.Util.grant ( project , ( ( com.google.gerrit.common.data.Permission.LABEL ) + labelName ) , com.google.gerrit.server.project.testing.Util.newRule ( project , group ) , ref ) ; r.setBlock ( ) ; r.setRange ( min , max ) ; return r ; }

Target:
public static com.google.gerrit.common.data.PermissionRule blockLabel ( com.google.gerrit.server.project.ProjectConfig project , java.lang.String labelName , int min , int max , com.google.gerrit.reviewdb.client.AccountGroup.UUID group , java.lang.String ref ) { com.google.gerrit.common.data.PermissionRule r = com.google.gerrit.server.project.testing.Util.grant ( project , ( ( com.google.gerrit.common.data.Permission.LABEL ) + labelName ) , com.google.gerrit.server.project.testing.Util.newRule ( project , group ) , ref ) ; r.setBlock ( ) ; r.setRange ( min , max ) ; return r ; }
Source:
java.lang.String wikify ( java.lang.String s ) { s = s.replaceAll ( "(^|\n)([ \t][^\n]*)" , "$1<span class=\"gerrit-preformat\">$2</span><br />" ) ; s = s.replaceAll ( "\n\n" , "<p>\n" ) ; return s ; }

Target:
public static java.lang.String wikify ( java.lang.String in ) { in = com.google.gerrit.client.ui.DomUtil.escape ( in ) ; in = com.google.gerrit.client.ui.DomUtil.linkify ( in ) ; in = in.replaceAll ( "(^|\n)([ \t][^\n]*)" , "$1<span class=\"gerrit-preformat\">$2</span><br />" ) ; in = in.replaceAll ( "\n\n" , "<p>\n" ) ; return in ; }
Source:
protected void run ( ) throws com.googlesource.gerrit.plugins.verifystatus.commands.Failure { try { checkPermission ( ) ; final com.googlesource.gerrit.plugins.verifystatus.commands.VerifyStatusQueryShell shell = factory.create ( in , out ) ; shell.setOutputFormat ( format ) ; if ( ( query ) != null ) { shell.execute ( query ) ; } else { shell.run ( ) ; } } catch ( com.google.gerrit.common.errors.PermissionDeniedException err ) { throw new com.googlesource.gerrit.plugins.verifystatus.commands.UnloggedFailure ( ( "fatal: " + ( err.getMessage ( ) ) ) ) ; } }

Target:
protected void run ( ) throws com.googlesource.gerrit.plugins.verifystatus.UnloggedFailure { try { checkPermission ( ) ; } catch ( com.google.gerrit.common.errors.PermissionDeniedException err ) { throw new com.googlesource.gerrit.plugins.verifystatus.UnloggedFailure ( ( "fatal: " + ( err.getMessage ( ) ) ) ) ; } final com.googlesource.gerrit.plugins.verifystatus.VerifyStatusQueryShell shell = factory.create ( in , out ) ; shell.setOutputFormat ( format ) ; if ( ( query ) != null ) { shell.execute ( query ) ; } else { shell.run ( ) ; } }
Source:
public void upsertTwoBothExisting ( ) throws com.google.gwtorm.client.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.UPDATE , 1 , 1 ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.INSERT ) ; classUnderTest.upsert ( twoRows ) ; assertCorrectUpdating ( update , 1 , 2 ) ; com.google.gwtorm.jdbc.AbstractTestJdbcAccess.assertNotUsed ( insert ) ; }

Target:
public void upsertTwoBothExisting ( ) throws com.google.gwtorm.server.OrmException , java.sql.SQLException { java.sql.PreparedStatement update = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.UPDATE , 1 , 1 ) ; java.sql.PreparedStatement insert = stubStatementWithUpdateCounts ( com.google.gwtorm.jdbc.AbstractTestJdbcAccess.INSERT ) ; classUnderTest.upsert ( twoRows ) ; assertCorrectAttempting ( update , 1 , 2 ) ; com.google.gwtorm.jdbc.AbstractTestJdbcAccess.assertNotUsed ( insert ) ; }
Source:
private static void addExtensionLink ( final com.google.gerrit.client.ui.LinkMenuBar m , final com.google.gerrit.client.extensions.TopMenuItem item ) { final com.google.gwt.user.client.ui.Anchor atag = com.google.gerrit.client.Gerrit.anchor ( item.getName ( ) , item.getUrl ( ) ) ; atag.setTarget ( item.getTarget ( ) ) ; m.add ( atag ) ; }

Target:
private static void addExtensionLink ( final com.google.gerrit.client.ui.LinkMenuBar m , final com.google.gerrit.client.extensions.TopMenuItem item ) { final com.google.gwt.user.client.ui.Anchor atag = com.google.gerrit.client.Gerrit.anchor ( item.getName ( ) , item.getUrl ( ) ) ; atag.setTarget ( item.getTarget ( ) ) ; if ( ( item.getId ( ) ) != null ) { atag.getElement ( ) . setAttribute ( "id" , item.getId ( ) ) ; } m.add ( atag ) ; }
Source:
private void throwUnauthorizedOp ( java.lang.String op , com.google.gerrit.server.project.ProjectState state , com.google.gerrit.server.CurrentUser user ) throws org.eclipse.jgit.lfs.errors.LfsUnauthorized { java.lang.String project = state.getProject ( ) . getName ( ) ; java.lang.String userName = ( com.google.common.base.Strings.isNullOrEmpty ( user.getUserName ( ) ) ) ? "anonymous" : user.getUserName ( ) ; com.googlesource.gerrit.plugins.lfs.locks.LfsLocksAction.log.debug ( java.lang.String.format ( "operation %s unauthorized for user %s on project %s" , op , userName , project ) ) ; throw new org.eclipse.jgit.lfs.errors.LfsUnauthorized ( op , project ) ; }

Target:
private void throwUnauthorizedOp ( java.lang.String op , com.google.gerrit.server.project.ProjectState state , com.google.gerrit.server.CurrentUser user ) throws org.eclipse.jgit.lfs.errors.LfsUnauthorized { java.lang.String project = state.getProject ( ) . getName ( ) ; java.lang.String userName = user.getUserName ( ) . orElse ( "anonymous" ) ; com.googlesource.gerrit.plugins.lfs.locks.LfsLocksAction.log.debug ( java.lang.String.format ( "operation %s unauthorized for user %s on project %s" , op , userName , project ) ) ; throw new org.eclipse.jgit.lfs.errors.LfsUnauthorized ( op , project ) ; }
Source:
public boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Account.Id account ) throws com.google.gwtorm.server.OrmException { return true ; }

Target:
private com.google.gerrit.server.ReviewersUtil.VisibilityControl getVisibility ( com.google.gerrit.server.change.ChangeResource rsrc ) { com.google.gerrit.server.permissions.PermissionBackend.ForRef perm = permissionBackend.user ( self ) . ref ( rsrc.getChange ( ) . getDest ( ) ) ; return new com.google.gerrit.server.ReviewersUtil.VisibilityControl ( ) { @ java.lang.Override public boolean isVisibleTo ( com.google.gerrit.reviewdb.client.Account.Id account ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.server.IdentifiedUser who = identifiedUserFactory.create ( account ) ; return perm.user ( who ) . testOrFalse ( RefPermission.READ ) ; } } ; }
Source:
public void mergeByOtherCcingSelfNotifyOwner ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS , com.google.gerrit.server.account.WatchConfig.NotifyType.SUBMITTED_CHANGES ) ; setEmailStrategy ( other , EmailStrategy.CC_ON_OWN_COMMENTS ) ; merge ( sc.changeId , other , com.google.gerrit.extensions.api.changes.NotifyHandling.OWNER ) ; assertThat ( sender ) . sent ( "merged" , sc ) . to ( sc.owner ) . notTo ( sc.reviewer , sc.ccer , sc.starrer , other ) . notTo ( sc.reviewerByEmail , sc.ccerByEmail ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS , com.google.gerrit.server.account.WatchConfig.NotifyType.SUBMITTED_CHANGES ) ; }

Target:
public void mergeByOtherCcingSelfNotifyOwner ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageChange ( ) ; setEmailStrategy ( other , EmailStrategy.CC_ON_OWN_COMMENTS ) ; merge ( sc.changeId , other , com.google.gerrit.extensions.api.changes.NotifyHandling.OWNER ) ; assertThat ( sender ) . sent ( "merged" , sc ) . to ( sc.owner ) . noOneElse ( ) ; }
Source:
public java.lang.Object apply ( com.google.gerrit.server.change.RevisionResource resource ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gerrit.server.patch.PatchListNotAvailableException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet basePatchSet = null ; if ( ( base ) != null ) { com.google.gerrit.server.change.RevisionResource baseResource = revisions.get ( ) . parse ( resource.getChangeResource ( ) , com.google.gerrit.extensions.restapi.IdString.fromDecoded ( base ) ) ; basePatchSet = baseResource.getPatchSet ( ) ; } return fileInfoJson.toFileInfoMap ( resource.getChange ( ) , resource.getPatchSet ( ) , basePatchSet ) ; }

Target:
public java.lang.Object apply ( com.google.gerrit.server.change.RevisionResource resource ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gerrit.server.patch.PatchListNotAvailableException , com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.PatchSet basePatchSet = null ; if ( ( base ) != null ) { com.google.gerrit.server.change.RevisionResource baseResource = revisions.get ( ) . parse ( resource.getChangeResource ( ) , com.google.gerrit.extensions.restapi.IdString.fromDecoded ( base ) ) ; basePatchSet = baseResource.getPatchSet ( ) ; } return com.google.gerrit.extensions.restapi.Response.ok ( fileInfoJson.toFileInfoMap ( resource.getChange ( ) , resource.getPatchSet ( ) , basePatchSet ) ) . caching ( com.google.gerrit.extensions.restapi.CacheControl.PRIVATE ( 7 , java.util.concurrent.TimeUnit.DAYS ) ) ; }
Source:
private void appendLineNumber ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m , final int idx , boolean isForSideA ) { m.openTd ( ) ; m.setStyleName ( Gerrit.RESOURCES.css ( ) . lineNumber ( ) ) ; if ( isForSideA ) { m.addStyleName ( Gerrit.RESOURCES.css ( ) . rightBorder ( ) ) ; } m.append ( com.google.gwtexpui.safehtml.client.SafeHtml.asis ( ( ( "<a href=\"javascript:void(0)\">" + ( idx + 1 ) ) + "</a>" ) ) ) ; m.closeTd ( ) ; }

Target:
private void openTableHeaderLine ( final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder m ) { m.openTr ( ) ; m.openTd ( ) ; m.setStyleName ( Gerrit.RESOURCES.css ( ) . iconCell ( ) ) ; m.addStyleName ( Gerrit.RESOURCES.css ( ) . fileColumnHeader ( ) ) ; m.closeTd ( ) ; }
Source:
public void start ( ) { new java.lang.Thread ( ( ) -> { for ( java.nio.file.Path folder : repoFolders ) { if ( java.nio.file.Files.notExists ( folder ) ) { com.googlesource.gerrit.plugins.deleteproject.fs.DeleteTrashFolders.log.debug ( "Base path does not exist" , folder ) ; continue ; } try { java.nio.file.Files.walkFileTree ( folder , new com.googlesource.gerrit.plugins.deleteproject.fs.DeleteTrashFolders.TrashFolderRemover ( ) ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.deleteproject.fs.DeleteTrashFolders.log.warn ( "Exception while trying to delete trash folders" , e ) ; } } } , "DeleteTrashFolders" ) . start ( ) ; }

Target:
public void start ( ) { new java.lang.Thread ( ( ) -> { for ( java.nio.file.Path folder : repoFolders ) { if ( ! ( folder.toFile ( ) . exists ( ) ) ) { com.googlesource.gerrit.plugins.deleteproject.fs.DeleteTrashFolders.log.debug ( "Base path does not exist" , folder ) ; continue ; } try { java.nio.file.Files.walkFileTree ( folder , new com.googlesource.gerrit.plugins.deleteproject.fs.DeleteTrashFolders.TrashFolderRemover ( ) ) ; } catch ( java.io.IOException e ) { com.googlesource.gerrit.plugins.deleteproject.fs.DeleteTrashFolders.log.warn ( "Exception while trying to delete trash folders" , e ) ; } } } , "DeleteTrashFolders" ) . start ( ) ; }
Source:
public void run ( ) { cmA.setOption ( "mode" , ( b ? getContentType ( diff.meta_a ( ) ) : null ) ) ; cmB.setOption ( "mode" , ( b ? getContentType ( diff.meta_b ( ) ) : null ) ) ; }

Target:
public void onResize ( com.google.gwt.event.logical.shared.ResizeEvent event ) { resizeCodeMirror ( ) ; }
Source:
public org.eclipse.jgit.transport.UploadPack create ( javax.servlet.http.HttpServletRequest req , org.eclipse.jgit.lib.Repository repo ) throws org.eclipse.jgit.transport.resolver.ServiceNotAuthorizedException , org.eclipse.jgit.transport.resolver.ServiceNotEnabledException { com.google.gerrit.server.project.ProjectControl pc = com.google.gerrit.httpd.ProjectServlet.getProjectControl ( req ) ; if ( ! ( pc.canRunUploadPack ( ) ) ) { throw new org.eclipse.jgit.transport.resolver.ServiceNotAuthorizedException ( ) ; } org.eclipse.jgit.transport.UploadPack up = new org.eclipse.jgit.transport.UploadPack ( repo ) ; up.setPackConfig ( packConfig ) ; if ( ! ( pc.allRefsAreVisible ( ) ) ) { up.setRefFilter ( new com.google.gerrit.server.git.VisibleRefFilter ( repo , pc , db.get ( ) , true ) ) ; } return up ; }

Target:
public org.eclipse.jgit.transport.UploadPack create ( javax.servlet.http.HttpServletRequest req , org.eclipse.jgit.lib.Repository repo ) throws org.eclipse.jgit.transport.resolver.ServiceNotAuthorizedException , org.eclipse.jgit.transport.resolver.ServiceNotEnabledException { com.google.gerrit.server.project.ProjectControl pc = com.google.gerrit.httpd.ProjectServlet.getProjectControl ( req ) ; if ( ! ( pc.canRunUploadPack ( ) ) ) { throw new org.eclipse.jgit.transport.resolver.ServiceNotAuthorizedException ( ) ; } org.eclipse.jgit.transport.UploadPack up = new org.eclipse.jgit.transport.UploadPack ( repo ) ; up.setPackConfig ( packConfig ) ; if ( ! ( pc.allRefsAreVisible ( ) ) ) { up.setRefFilter ( new com.google.gerrit.server.git.VisibleRefFilter ( tagCache , repo , pc , db.get ( ) , true ) ) ; } return up ; }
Source:
public void remove ( ) { for ( java.lang.String name : names ) { descriptions.remove ( name ) ; registry.remove ( name ) ; } }

Target:
public < F1 , V > com.google.gerrit.metrics.CallbackMetric1 < F1 , V > newCallbackMetric ( java.lang.String name , java.lang.Class < V > valueClass , com.google.gerrit.metrics.Description desc , com.google.gerrit.metrics.Field < F1 > field1 ) { com.google.gerrit.metrics.dropwizard.CallbackMetricImpl1 < F1 , V > m = new com.google.gerrit.metrics.dropwizard.CallbackMetricImpl1 ( this , registry , name , valueClass , desc , field1 ) ; define ( name , desc ) ; bucketed.put ( name , m ) ; return m.create ( ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo.MergeableInfo result ) { if ( canSubmit ) { actions.setSubmitEnabled ( result.mergeable ( ) ) ; if ( status == ( Change.Status.NEW ) ) { statusText.setInnerText ( ( result.mergeable ( ) ? Util.C.readyToSubmit ( ) : Util.C.mergeConflict ( ) ) ) ; } } setVisible ( notMergeable , ( ! ( result.mergeable ( ) ) ) ) ; renderSubmitType ( result.submit_type ( ) ) ; }

Target:
public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo.MergeableInfo result ) { if ( canSubmit ) { actions.setSubmitEnabled ( result.mergeable ( ) ) ; if ( status == ( com.google.gerrit.reviewdb.client.Change.Status.NEW ) ) { statusText.setInnerText ( ( result.mergeable ( ) ? Util.C.readyToSubmit ( ) : Util.C.mergeConflict ( ) ) ) ; } } setVisible ( notMergeable , ( ! ( result.mergeable ( ) ) ) ) ; renderSubmitType ( result.submit_type ( ) ) ; }
Source:
public void onLoad ( ) { super . onLoad ( ) ; Util.ACCOUNT_SEC.mySshKeys ( new com.google.gerrit.client.rpc.GerritCallback < java.util.List < com.google.gerrit.client.reviewdb.AccountSshKey > > ( ) { public void onSuccess ( final java.util.List < com.google.gerrit.client.reviewdb.AccountSshKey > result ) { keys.display ( result ) ; keys.finishDisplay ( true ) ; if ( result.isEmpty ( ) ) { showAddKeyBlock ( true ) ; } } } ) ; }

Target:
public void onSuccess ( final java.util.List < com.google.gerrit.client.data.SshHostKey > result ) { for ( final com.google.gerrit.client.data.SshHostKey keyInfo : result ) { serverKeys.add ( new com.google.gerrit.client.account.SshHostKeyPanel ( keyInfo ) ) ; } }
Source:
protected void configure ( ) { factory ( AlterTopicHandler.Factory.class ) ; factory ( RestoreChangeHandler.Factory.class ) ; factory ( RevertChange.Factory.class ) ; factory ( RebaseChangeHandler.Factory.class ) ; factory ( ChangeDetailFactory.Factory.class ) ; factory ( IncludedInDetailFactory.Factory.class ) ; factory ( PatchSetDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; factory ( SubmitAction.Factory.class ) ; factory ( PublishAction.Factory.class ) ; factory ( DeleteDraftChange.Factory.class ) ; }

Target:
protected void configure ( ) { factory ( EditCommitMessageHandler.Factory.class ) ; factory ( RebaseChangeHandler.Factory.class ) ; factory ( ChangeDetailFactory.Factory.class ) ; factory ( IncludedInDetailFactory.Factory.class ) ; factory ( PatchSetDetailFactory.Factory.class ) ; factory ( PatchSetPublishDetailFactory.Factory.class ) ; factory ( SubmitAction.Factory.class ) ; factory ( PublishAction.Factory.class ) ; factory ( DeleteDraftChange.Factory.class ) ; }
Source:
public void rescheduleOnError ( ) throws java.io.IOException { org.mockito.Mockito.when ( session.post ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.WEBHOOK_URL , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.HEADERS , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.BODY ) ) . thenReturn ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.ERR_RESULT ) ; task.run ( ) ; org.mockito.Mockito.verify ( executor , org.mockito.Mockito.times ( 1 ) ) . schedule ( task , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.RETRY_INTERVAL , java.util.concurrent.TimeUnit.MILLISECONDS ) ; }

Target:
public void rescheduleOnError ( ) throws java.io.IOException { org.mockito.Mockito.when ( session.post ( org.mockito.ArgumentMatchers.eq ( remote ) , org.mockito.ArgumentMatchers.eq ( content ) ) ) . thenReturn ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.ERR_RESULT ) ; task.run ( ) ; org.mockito.Mockito.verify ( executor , org.mockito.Mockito.times ( 1 ) ) . schedule ( task , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.RETRY_INTERVAL , java.util.concurrent.TimeUnit.MILLISECONDS ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.httpd.GerritUiOptions.class ) . toInstance ( new com.google.gerrit.httpd.GerritUiOptions ( headless ) ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.httpd.GerritOptions.class ) . toInstance ( new com.google.gerrit.httpd.GerritOptions ( headless , slave ) ) ; if ( test ) { bind ( java.lang.String.class ) . annotatedWith ( com.google.gerrit.server.securestore.SecureStoreClassName.class ) . toInstance ( com.google.gerrit.server.securestore.DefaultSecureStore.class . getName ( ) ) ; bind ( com.google.gerrit.server.securestore.SecureStore.class ) . toProvider ( com.google.gerrit.server.securestore.SecureStoreProvider.class ) ; } }
Source:
private PushOneCommit.Result createChange ( org.eclipse.jgit.api.Git git , boolean conflicting ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.git.GitUtil.checkout ( git , "origin/master" ) ; java.lang.String file = ( conflicting ) ? "test.txt" : ( "test-" + ( count ) ) + ".txt" ; com.google.gerrit.acceptance.git.PushOneCommit push = new com.google.gerrit.acceptance.git.PushOneCommit ( db , admin.getIdent ( ) , ( "Change " + ( count ) ) , file , ( "content " + ( count ) ) ) ; ( count ) ++ ; return push.to ( git , "refs/for/master" ) ; }

Target:
private PushOneCommit.Result createChange ( org.eclipse.jgit.api.Git git , boolean conflicting ) throws java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.GitUtil.checkout ( git , "origin/master" ) ; java.lang.String file = ( conflicting ) ? "test.txt" : ( "test-" + ( count ) ) + ".txt" ; com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , ( "Change " + ( count ) ) , file , ( "content " + ( count ) ) ) ; ( count ) ++ ; return push.to ( git , "refs/for/master" ) ; }