auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public java.sql.Timestamp apply ( com.google.gerrit.reviewdb.client.ChangeMessage input ) { return input.getWrittenOn ( ) ; }

Target:
public com.google.common.collect.ImmutableListMultimap < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchSetApproval > getApprovals ( ) { if ( ( approvals ) == null ) { com.google.common.collect.ImmutableListMultimap.Builder < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchSetApproval > b = com.google.common.collect.ImmutableListMultimap.builder ( ) ; for ( java.util.Map.Entry < com.google.gerrit.reviewdb.client.PatchSet.Id , com.google.gerrit.reviewdb.client.PatchSetApproval > e : state.approvals ( ) ) { b.put ( e.getKey ( ) , new com.google.gerrit.reviewdb.client.PatchSetApproval ( e.getValue ( ) ) ) ; } approvals = b.build ( ) ; } return approvals ; }
Source:
public void onPluginLoad ( ) { com.google.gerrit.plugin.client.Plugin.get ( ) . panel ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER_RIGHT_OF_BUTTONS , new com.google.gerrit.plugin.client.extension.Panel.EntryPoint ( ) { @ java.lang.Override public void onLoad ( com.google.gerrit.plugin.client.extension.Panel panel ) { com.google.gwt.user.client.ui.Button b = new com.googlesource.gerrit.plugins.examples.wuichangescreenheaderrightofbuttons.client.HighlightButton ( "Library-Compliance+1" ) ; b.addClickHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { com.google.gwt.user.client.Window.alert ( "TODO" ) ; } } ) ; panel.setWidget ( b ) ; } } ) ; }

Target:
public void onPluginLoad ( ) { com.google.gerrit.plugin.client.Plugin.get ( ) . panel ( GerritUiExtensionPoint.CHANGE_SCREEN_HEADER_RIGHT_OF_BUTTONS , new com.google.gerrit.plugin.client.extension.Panel.EntryPoint ( ) { @ java.lang.Override public void onLoad ( com.google.gerrit.plugin.client.extension.Panel panel ) { com.google.gwt.user.client.ui.Button b = new com.googlesource.gerrit.plugins.examples.wuichangescreenheaderrightofbuttons.client.HighlightButton ( "Library-Compliance+1" ) ; b.addClickHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { com.google.gwt.user.client.Window.alert ( "TODO" ) ; } } ) ; panel.setWidget ( b ) ; } } , "library_compliance" ) ; }
Source:
public void testDummyChangeEvent ( ) { com.googlesource.gerrit.plugins.hooks.util.PropertyExtractor propertyExtractor = injector.getInstance ( com.googlesource.gerrit.plugins.hooks.util.PropertyExtractor.class ) ; com.googlesource.gerrit.plugins.hooks.workflow.Property property1 = createMock ( com.googlesource.gerrit.plugins.hooks.workflow.Property.class ) ; org.easymock.EasyMock.expect ( propertyFactory.create ( "event" , ( "com.googlesource.gerrit.plugins." + "hooks.util.PropertyExtractorTest$DummyChangeEvent" ) ) ) . andReturn ( property1 ) ; replayMocks ( ) ; java.util.Set < java.util.Set < com.googlesource.gerrit.plugins.hooks.workflow.Property > > actual = propertyExtractor.extractFrom ( new com.googlesource.gerrit.plugins.hooks.util.PropertyExtractorTest.DummyChangeEvent ( ) ) ; java.util.Set < java.util.Set < com.googlesource.gerrit.plugins.hooks.workflow.Property > > expected = com.google.common.collect.Sets.newHashSet ( ) ; assertEquals ( "Properties do not match" , expected , actual ) ; }

Target:
public void testDummyChangeEvent ( ) { com.googlesource.gerrit.plugins.hooks.util.PropertyExtractor propertyExtractor = injector.getInstance ( com.googlesource.gerrit.plugins.hooks.util.PropertyExtractor.class ) ; com.googlesource.gerrit.plugins.hooks.workflow.Property property1 = createMock ( com.googlesource.gerrit.plugins.hooks.workflow.Property.class ) ; org.easymock.EasyMock.expect ( propertyFactory.create ( "event" , ( "com.googlesource.gerrit.plugins." + "hooks.util.PropertyExtractorTest$DummyEvent" ) ) ) . andReturn ( property1 ) ; replayMocks ( ) ; java.util.Set < java.util.Set < com.googlesource.gerrit.plugins.hooks.workflow.Property > > actual = propertyExtractor.extractFrom ( new com.googlesource.gerrit.plugins.hooks.util.PropertyExtractorTest.DummyEvent ( ) ) ; java.util.Set < java.util.Set < com.googlesource.gerrit.plugins.hooks.workflow.Property > > expected = com.google.common.collect.Sets.newHashSet ( ) ; assertEquals ( "Properties do not match" , expected , actual ) ; }
Source:
protected void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; idA = org.eclipse.jgit.lib.ObjectId.fromString ( "df84c2f4f7ce7e0b25cdeac84b8870bcff319885" ) ; name = new com.google.gerrit.reviewdb.Project.NameKey ( "test" ) ; realDb = createBareRepository ( ) ; mockDb = org.easymock.classextension.EasyMock.createStrictMock ( org.eclipse.jgit.lib.Repository.class ) ; pc = org.easymock.classextension.EasyMock.createStrictMock ( com.google.gerrit.server.project.ProjectControl.class ) ; pcf = org.easymock.classextension.EasyMock.createStrictMock ( ProjectControl.Factory.class ) ; grm = org.easymock.classextension.EasyMock.createStrictMock ( com.google.gerrit.server.git.GitRepositoryManager.class ) ; refMocks = new java.util.ArrayList < com.google.gerrit.server.project.RefControl > ( ) ; }

Target:
protected void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; idA = org.eclipse.jgit.lib.ObjectId.fromString ( "df84c2f4f7ce7e0b25cdeac84b8870bcff319885" ) ; name = new com.google.gerrit.reviewdb.Project.NameKey ( "test" ) ; realDb = createBareRepository ( ) ; mockDb = org.easymock.EasyMock.createStrictMock ( org.eclipse.jgit.lib.Repository.class ) ; pc = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.server.project.ProjectControl.class ) ; pcf = org.easymock.EasyMock.createStrictMock ( ProjectControl.Factory.class ) ; grm = org.easymock.EasyMock.createStrictMock ( com.google.gerrit.server.git.GitRepositoryManager.class ) ; refMocks = new java.util.ArrayList < com.google.gerrit.server.project.RefControl > ( ) ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.pgm.util.ConsoleUI.class ) . toInstance ( ui ) ; bind ( java.io.File.class ) . annotatedWith ( com.google.gerrit.server.config.SitePath.class ) . toInstance ( sitePath ) ; }

Target:
protected void configure ( ) { bind ( com.google.gerrit.pgm.util.ConsoleUI.class ) . toInstance ( ui ) ; bind ( java.io.File.class ) . annotatedWith ( com.google.gerrit.server.config.SitePath.class ) . toInstance ( sitePath ) ; java.util.List < java.lang.String > plugins = com.google.gwt.thirdparty.guava.common.base.Objects.firstNonNull ( installPlugins , com.google.common.collect.Lists.< java.lang.String > newArrayList ( ) ) ; bind ( new com.google.inject.TypeLiteral < java.util.List < java.lang.String > > ( ) { } ) . annotatedWith ( com.google.gerrit.pgm.init.InstallPlugins.class ) . toInstance ( plugins ) ; }
Source:
private static boolean wouldPushRef ( final org.spearce.jgit.transport.RemoteConfig cfg , final java.lang.String ref ) { for ( final org.spearce.jgit.transport.RefSpec s : cfg.getPushRefSpecs ( ) ) { if ( s.matchSource ( ref ) ) { return true ; } } return false ; }

Target:
private static synchronized void scheduleImp ( final com.google.gerrit.client.reviewdb.Project.NameKey project , final java.lang.String ref , final com.google.gerrit.git.PushQueue.ReplicationConfig config , final org.spearce.jgit.transport.URIish uri ) { com.google.gerrit.git.PushOp e = com.google.gerrit.git.PushQueue.pending.get ( uri ) ; if ( e == null ) { e = new com.google.gerrit.git.PushOp ( project.get ( ) , config.remote , uri ) ; com.google.gerrit.git.WorkQueue.schedule ( e , config.delay , java.util.concurrent.TimeUnit.SECONDS ) ; com.google.gerrit.git.PushQueue.pending.put ( uri , e ) ; } e.addRef ( ref ) ; }
Source:
public void publishDraftChange ( ) throws java.lang.Exception { java.lang.String changeId = createDraftChange ( ) ; java.lang.String triplet = "p~master~" + changeId ; com.google.gerrit.extensions.common.ChangeInfo c = get ( triplet ) ; org.junit.Assert.assertEquals ( triplet , c.id ) ; org.junit.Assert.assertEquals ( ChangeStatus.DRAFT , c.status ) ; com.google.gerrit.acceptance.RestResponse r = publishChange ( changeId ) ; org.junit.Assert.assertEquals ( 204 , r.getStatusCode ( ) ) ; c = get ( triplet ) ; org.junit.Assert.assertEquals ( ChangeStatus.NEW , c.status ) ; }

Target:
public void publishDraftChange ( ) throws java.lang.Exception { java.lang.String changeId = createDraftChange ( ) ; java.lang.String triplet = "p~master~" + changeId ; com.google.gerrit.extensions.common.ChangeInfo c = get ( triplet ) ; com.google.common.truth.Truth.assertThat ( c.id ) . isEqualTo ( triplet ) ; com.google.common.truth.Truth.assertThat ( c.status ) . isEqualTo ( ChangeStatus.DRAFT ) ; com.google.gerrit.acceptance.RestResponse r = publishChange ( changeId ) ; com.google.common.truth.Truth.assertThat ( r.getStatusCode ( ) ) . isEqualTo ( HttpStatus.SC_NO_CONTENT ) ; c = get ( triplet ) ; com.google.common.truth.Truth.assertThat ( c.status ) . isEqualTo ( ChangeStatus.NEW ) ; }
Source:
void flush ( ) throws java.io.IOException { com.google.common.base.Preconditions.checkState ( ( ( finalIns ) != null ) ) ; for ( com.google.gerrit.server.git.InsertedObject obj : tempIns.getInsertedObjects ( ) ) { finalIns.insert ( obj.type ( ) , obj.data ( ) . toByteArray ( ) ) ; } finalIns.flush ( ) ; tempIns.clear ( ) ; }

Target:
void flushToFinalInserter ( ) throws java.io.IOException { com.google.common.base.Preconditions.checkState ( ( ( finalIns ) != null ) ) ; for ( com.google.gerrit.server.git.InsertedObject obj : tempIns.getInsertedObjects ( ) ) { finalIns.insert ( obj.type ( ) , obj.data ( ) . toByteArray ( ) ) ; } }
Source:
public void testIsEnabledRefNoParentNoBranchDisabled ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { } ; setupIsEnabled ( "false" , null , branches ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey projectNK = new com.google.gerrit.reviewdb.client.Project.NameKey ( "testProject" ) ; assertFalse ( itsConfig.isEnabled ( projectNK , "refs/heads/testBranch" ) ) ; }

Target:
public void BROKEN_testIsEnabledRefNoParentNoBranchDisabled ( ) { java.lang.String [ ] branches = new java.lang.String [ ] { } ; setupIsEnabled ( "false" , null , branches ) ; com.googlesource.gerrit.plugins.its.base.its.ItsConfig itsConfig = createItsConfig ( ) ; replayMocks ( ) ; com.google.gerrit.reviewdb.client.Project.NameKey projectNK = new com.google.gerrit.reviewdb.client.Project.NameKey ( "testProject" ) ; assertFalse ( itsConfig.isEnabled ( projectNK , "refs/heads/testBranch" ) ) ; }
Source:
public void addGroupMember ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.reviewdb.client.AccountGroup.NameKey groupName , com.google.gerrit.reviewdb.client.Account.Id accountId ) throws com.google.gwtorm.server.OrmException , java.io.IOException { java.util.Optional < com.google.gerrit.reviewdb.client.AccountGroup > foundGroup = groups.get ( db , groupName ) ; if ( ! ( foundGroup.isPresent ( ) ) ) { return ; } com.google.gerrit.reviewdb.client.AccountGroup group = foundGroup.get ( ) ; addGroupMembers ( db , group , com.google.common.collect.ImmutableSet.of ( accountId ) ) ; }

Target:
private void setCommitterIdent ( @ com.google.gerrit.common.Nullable com.google.gerrit.server.IdentifiedUser currentUser ) { if ( currentUser != null ) { committerIdent = com.google.gerrit.server.group.GroupsUpdate.createPersonIdent ( serverIdent , currentUser ) ; } else { committerIdent = serverIdent ; } }
Source:
public void unignore ( com.google.gerrit.reviewdb.client.Account.Id accountId , com.google.gerrit.reviewdb.client.Project.NameKey project , com.google.gerrit.reviewdb.client.Change.Id changeId ) throws com.google.gwtorm.server.OrmException { star ( accountId , project , changeId , com.google.common.collect.ImmutableSet.of ( ) , com.google.common.collect.ImmutableSet.of ( com.google.gerrit.server.StarredChangesUtil.IGNORE_LABEL ) ) ; }

Target:
public void unignore ( com.google.gerrit.server.change.ChangeResource rsrc ) throws com.google.gwtorm.server.OrmException { star ( rsrc.getUser ( ) . asIdentifiedUser ( ) . getAccountId ( ) , rsrc.getProject ( ) , rsrc.getChange ( ) . getId ( ) , com.google.common.collect.ImmutableSet.of ( ) , com.google.common.collect.ImmutableSet.of ( com.google.gerrit.server.StarredChangesUtil.IGNORE_LABEL ) ) ; }
Source:
public void resetToDefaults ( ) { maximumPageSize = com.google.gerrit.reviewdb.client.AccountGeneralPreferences.DEFAULT_PAGESIZE ; showSiteHeader = true ; useFlashClipboard = true ; copySelfOnEmail = false ; reversePatchSetOrder = false ; showUserInReview = false ; downloadUrl = null ; downloadCommand = null ; dateFormat = null ; timeFormat = null ; relativeDateInChangeTable = false ; diffView = null ; }

Target:
public void resetToDefaults ( ) { maximumPageSize = com.google.gerrit.reviewdb.client.AccountGeneralPreferences.DEFAULT_PAGESIZE ; showSiteHeader = true ; useFlashClipboard = true ; copySelfOnEmail = false ; reversePatchSetOrder = false ; showUserInReview = false ; downloadUrl = null ; downloadCommand = null ; dateFormat = null ; timeFormat = null ; relativeDateInChangeTable = false ; commentVisibilityStrategy = null ; diffView = null ; }
Source:
private static java.lang.String getHostName ( java.lang.String canonicalWebUrl ) { try { return new java.net.URI ( canonicalWebUrl ) . getHost ( ) ; } catch ( java.net.URISyntaxException e ) { return null ; } }

Target:
private static java.lang.String getHostName ( java.lang.String canonicalWebUrl ) { if ( canonicalWebUrl == null ) { com.google.gerrit.server.account.GetOAuthToken.log.error ( "No canonicalWebUrl defined in gerrit.config, OAuth may not work properly" ) ; return null ; } try { return new java.net.URI ( canonicalWebUrl ) . getHost ( ) ; } catch ( java.net.URISyntaxException e ) { com.google.gerrit.server.account.GetOAuthToken.log.error ( ( ( "Invalid canonicalWebUrl '" + canonicalWebUrl ) + "'" ) , e ) ; return null ; } }
Source:
public void validatePreMerge ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.server.git.CodeReviewCommit commit , com.google.gerrit.server.project.ProjectState destProject , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId , com.google.gerrit.server.IdentifiedUser caller ) throws com.google.gerrit.server.git.validators.MergeValidationException { java.util.List < com.google.gerrit.server.git.validators.MergeValidationListener > validators = com.google.common.collect.Lists.newLinkedList ( ) ; validators.add ( new com.google.gerrit.server.git.validators.MergeValidators.PluginMergeValidationListener ( mergeValidationListeners ) ) ; validators.add ( projectConfigValidatorFactory.create ( ) ) ; for ( com.google.gerrit.server.git.validators.MergeValidationListener validator : validators ) { validator.onPreMerge ( repo , commit , destProject , destBranch , patchSetId , caller ) ; } }

Target:
public void validatePreMerge ( org.eclipse.jgit.lib.Repository repo , com.google.gerrit.server.git.CodeReviewCommit commit , com.google.gerrit.server.project.ProjectState destProject , com.google.gerrit.reviewdb.client.Branch.NameKey destBranch , com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId , com.google.gerrit.server.IdentifiedUser caller ) throws com.google.gerrit.server.git.validators.MergeValidationException { java.util.List < com.google.gerrit.server.git.validators.MergeValidationListener > validators = new java.util.LinkedList < > ( ) ; validators.add ( new com.google.gerrit.server.git.validators.MergeValidators.PluginMergeValidationListener ( mergeValidationListeners ) ) ; validators.add ( projectConfigValidatorFactory.create ( ) ) ; for ( com.google.gerrit.server.git.validators.MergeValidationListener validator : validators ) { validator.onPreMerge ( repo , commit , destProject , destBranch , patchSetId , caller ) ; } }
Source:
protected void setMessageText ( java.lang.String message ) { if ( message == null ) { message = "" ; } else { message = message.trim ( ) ; } messageSummary.setText ( com.google.gerrit.client.ui.CommentPanel.summarize ( message ) ) ; com.google.gwtexpui.safehtml.client.SafeHtml.set ( messageText , new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) . append ( message ) . wikify ( ) . replaceAll ( com.google.gerrit.client.Gerrit.getConfig ( ) . getCommentLinks ( ) ) ) ; }

Target:
protected void setMessageText ( java.lang.String message ) { if ( message == null ) { message = "" ; } else { message = message.trim ( ) ; } messageSummary.setText ( com.google.gerrit.client.ui.CommentPanel.summarize ( message ) ) ; com.google.gwtexpui.safehtml.client.SafeHtml buf = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) . append ( message ) . wikify ( ) ; buf = com.google.gerrit.client.ui.CommentLinkProcessor.apply ( buf ) ; com.google.gwtexpui.safehtml.client.SafeHtml.set ( messageText , buf ) ; }
Source:
private org.eclipse.jgit.lib.ObjectId createNoteContent ( com.google.gerrit.reviewdb.client.PatchSet ps ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.googlesource.gerrit.plugins.reviewnotes.HeaderFormatter fmt = new com.googlesource.gerrit.plugins.reviewnotes.HeaderFormatter ( gerritServerIdent.getTimeZone ( ) , anonymousCowardName ) ; if ( ps != null ) { try { createCodeReviewNote ( ps , fmt ) ; return getInserter ( ) . insert ( Constants.OBJ_BLOB , fmt.toString ( ) . getBytes ( "UTF-8" ) ) ; } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { throw new java.io.IOException ( e ) ; } } return null ; }

Target:
private org.eclipse.jgit.lib.ObjectId createNoteContent ( com.google.gerrit.server.notedb.ChangeNotes notes , com.google.gerrit.reviewdb.client.PatchSet ps ) throws com.google.gwtorm.server.OrmException , java.io.IOException { com.googlesource.gerrit.plugins.reviewnotes.HeaderFormatter fmt = new com.googlesource.gerrit.plugins.reviewnotes.HeaderFormatter ( gerritServerIdent.getTimeZone ( ) , anonymousCowardName ) ; if ( ps != null ) { try { createCodeReviewNote ( notes , ps , fmt ) ; return getInserter ( ) . insert ( Constants.OBJ_BLOB , fmt.toString ( ) . getBytes ( "UTF-8" ) ) ; } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { throw new java.io.IOException ( e ) ; } } return null ; }
Source:
private int compare ( int index , org.eclipse.jgit.diff.Edit edit ) { if ( index < ( side.getBegin ( edit ) ) ) { return - 1 ; } else if ( index < ( side.getEnd ( edit ) ) ) { return 0 ; } else { return 1 ; } }

Target:
private int compare ( int index , com.google.gerrit.prettify.common.BaseEdit edit ) { if ( index < ( side.getBegin ( edit ) ) ) { return - 1 ; } else if ( index < ( side.getEnd ( edit ) ) ) { return 0 ; } else { return 1 ; } }
Source:
private void writeObject ( java.io.ObjectOutputStream out ) throws java.io.IOException { org.eclipse.jgit.lib.ObjectIdSerializer.write ( out , oldId ) ; out.writeInt ( ( ( parentNum ) == null ? 0 : parentNum ) ) ; org.eclipse.jgit.lib.ObjectIdSerializer.write ( out , newId ) ; java.lang.Character c = PatchListKey.WHITESPACE_TYPES.get ( whitespace ) ; if ( c == null ) { throw new java.io.IOException ( ( "Invalid whitespace type: " + ( whitespace ) ) ) ; } out.writeChar ( c ) ; }

Target:
private void writeObject ( java.io.ObjectOutputStream out ) throws java.io.IOException { org.eclipse.jgit.lib.ObjectIdSerialization.writeCanBeNull ( out , oldId ) ; out.writeInt ( ( ( parentNum ) == null ? 0 : parentNum ) ) ; org.eclipse.jgit.lib.ObjectIdSerialization.writeNotNull ( out , newId ) ; java.lang.Character c = PatchListKey.WHITESPACE_TYPES.get ( whitespace ) ; if ( c == null ) { throw new java.io.IOException ( ( "Invalid whitespace type: " + ( whitespace ) ) ) ; } out.writeChar ( c ) ; }
Source:
public void noChangeMessage ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.putReviewer ( changeOwner.getAccount ( ) . getId ( ) , com.google.gerrit.server.notedb.ReviewerState.REVIEWER ) ; update.commit ( ) ; org.eclipse.jgit.revwalk.RevWalk walk = new org.eclipse.jgit.revwalk.RevWalk ( repo ) ; try { org.eclipse.jgit.revwalk.RevCommit commit = walk.parseCommit ( update.getRevision ( ) ) ; walk.parseBody ( commit ) ; org.junit.Assert.assertEquals ( ( "Update patch set 1\n" + ( ( "\n" + "Patch-set: 1\n" ) + "Reviewer: Change Owner <1@gerrit>\n" ) ) , commit.getFullMessage ( ) ) ; } finally { walk.release ( ) ; } }

Target:
public void changeMessageWithMultipleParagraphs ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = newChange ( ) ; com.google.gerrit.server.notedb.ChangeUpdate update = newUpdate ( c , changeOwner ) ; update.setChangeMessage ( ( "Testing paragraph 1\n" + ( ( ( "\n" + "Testing paragraph 2\n" ) + "\n" ) + "Testing paragraph 3" ) ) ) ; update.commit ( ) ; assertBodyEquals ( ( "Update patch set 1\n" + ( ( ( ( ( ( ( "\n" + "Testing paragraph 1\n" ) + "\n" ) + "Testing paragraph 2\n" ) + "\n" ) + "Testing paragraph 3\n" ) + "\n" ) + "Patch-set: 1\n" ) ) , update.getRevision ( ) ) ; }
Source:
public void onSignOut ( ) { final int max = table.getRowCount ( ) ; for ( int row = 0 ; row < max ; row ++ ) { if ( ( getRowItem ( row ) ) != null ) { table.clearCell ( row , com.google.gerrit.client.changes.ChangeTable.C_STAR ) ; } } }

Target:
public void onFailure ( final java.lang.Throwable caught ) { super . onFailure ( caught ) ; c.setStarred ( prior ) ; setStar ( row , c ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { executorMock = createStrictMock ( WorkQueue.Executor.class ) ; com.google.gerrit.server.git.WorkQueue workQueueMock = createNiceMock ( com.google.gerrit.server.git.WorkQueue.class ) ; org.easymock.EasyMock.expect ( workQueueMock.createQueue ( 4 , "Sync stream events [SyncEvents plugin]" ) ) . andReturn ( executorMock ) ; com.ericsson.gerrit.plugins.syncevents.Configuration configMock = createStrictMock ( com.ericsson.gerrit.plugins.syncevents.Configuration.class ) ; org.easymock.EasyMock.expect ( configMock.getThreadPoolSize ( ) ) . andReturn ( 4 ) ; replayAll ( ) ; syncEventsExecutorProvider = new com.ericsson.gerrit.plugins.syncevents.SyncEventExecutorProvider ( workQueueMock , "SyncEvents" , configMock ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { com.google.gerrit.server.git.WorkQueue workQueueMock = org.mockito.Mockito.mock ( com.google.gerrit.server.git.WorkQueue.class ) ; org.mockito.Mockito.when ( workQueueMock.createQueue ( 4 , "Sync stream events [SyncEvents plugin]" ) ) . thenReturn ( executorMock ) ; com.ericsson.gerrit.plugins.syncevents.Configuration configMock = org.mockito.Mockito.mock ( com.ericsson.gerrit.plugins.syncevents.Configuration.class ) ; org.mockito.Mockito.when ( configMock.getThreadPoolSize ( ) ) . thenReturn ( 4 ) ; syncEventsExecutorProvider = new com.ericsson.gerrit.plugins.syncevents.SyncEventExecutorProvider ( workQueueMock , "SyncEvents" , configMock ) ; }
Source:
private java.io.InputStream openStream ( com.google.gerrit.server.plugins.InstallPlugin.Input input ) throws com.google.gerrit.extensions.restapi.BadRequestException , java.io.IOException { if ( ( input.raw ) != null ) { return input.raw.getInputStream ( ) ; } try { return new java.net.URL ( input.url ) . openStream ( ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( e.getMessage ( ) ) ; } }

Target:
private java.io.InputStream openStream ( com.google.gerrit.extensions.common.InstallPluginInfo input ) throws com.google.gerrit.extensions.restapi.BadRequestException , java.io.IOException { if ( ( input.raw ) != null ) { return input.raw.getInputStream ( ) ; } try { return new java.net.URL ( input.url ) . openStream ( ) ; } catch ( java.io.IOException e ) { throw new com.google.gerrit.extensions.restapi.BadRequestException ( e.getMessage ( ) ) ; } }
Source:
private void populateTableHeader ( final com.google.gerrit.common.data.PatchScript script , final com.google.gerrit.common.data.PatchSetDetail detail ) { prepareHeaderWidgets ( script , detail ) ; table.setWidget ( com.google.gerrit.client.patches.R_HEAD , com.google.gerrit.client.patches.SideBySideTable.A , psListOfHeaderA ) ; table.setWidget ( com.google.gerrit.client.patches.R_HEAD , com.google.gerrit.client.patches.SideBySideTable.B , psListOfHeaderB ) ; if ( psListOfHeaderA.isFile ) { table.setWidget ( com.google.gerrit.client.patches.R_HEAD , ( ( com.google.gerrit.client.patches.SideBySideTable.A ) - 1 ) , iconA ) ; } if ( psListOfHeaderB.isFile ) { table.setWidget ( com.google.gerrit.client.patches.R_HEAD , ( ( com.google.gerrit.client.patches.SideBySideTable.B ) + 1 ) , iconB ) ; } }

Target:
private void populateTableHeader ( final com.google.gerrit.common.data.PatchScript script , final com.google.gerrit.common.data.PatchSetDetail detail ) { initHeaders ( script , detail ) ; table.setWidget ( com.google.gerrit.client.patches.R_HEAD , com.google.gerrit.client.patches.SideBySideTable.A , headerSideA ) ; table.setWidget ( com.google.gerrit.client.patches.R_HEAD , com.google.gerrit.client.patches.SideBySideTable.B , headerSideB ) ; if ( headerSideA.isFile ( ) ) { table.setWidget ( com.google.gerrit.client.patches.R_HEAD , ( ( com.google.gerrit.client.patches.SideBySideTable.A ) - 1 ) , iconA ) ; } if ( headerSideB.isFile ( ) ) { table.setWidget ( com.google.gerrit.client.patches.R_HEAD , ( ( com.google.gerrit.client.patches.SideBySideTable.B ) + 1 ) , iconB ) ; } }
Source:
private boolean canRead ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.CurrentUser user , com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gerrit.server.permissions.PermissionBackendException { return permissionBackend.user ( user ) . change ( cd ) . database ( db ) . test ( ChangePermission.READ ) ; }

Target:
private boolean canRead ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.CurrentUser user , com.google.gerrit.server.query.change.ChangeData cd ) throws com.google.gerrit.server.permissions.PermissionBackendException , java.io.IOException { com.google.gerrit.server.project.ProjectState projectState = projectCache.checkedGet ( cd.project ( ) ) ; return ( ( projectState != null ) && ( projectState.statePermitsRead ( ) ) ) && ( permissionBackend.user ( user ) . change ( cd ) . database ( db ) . test ( ChangePermission.READ ) ) ; }
Source:
private com.google.inject.Injector createWebInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebModule.class ) ) ; return sysInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createWebInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( sshInjector.getInstance ( com.google.inject.Module.class ) ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebModule.class ) ) ; return sysInjector.createChildInjector ( modules ) ; }
Source:
private static void dispatchHistoryHooks ( final java.lang.String historyToken ) { if ( ( com.google.gerrit.client.Gerrit.signInAnchor ) != null ) { com.google.gerrit.client.Gerrit.signInAnchor.setHref ( com.google.gerrit.client.Gerrit.loginRedirect ( historyToken ) ) ; } if ( ( com.google.gerrit.client.Gerrit.historyHooks ) != null ) { final java.lang.String url = ( ( com.google.gwt.user.client.Window.Location.getPath ( ) ) + "#" ) + historyToken ; for ( final com.google.gwt.core.client.JavaScriptObject hook : com.google.gerrit.client.Gerrit.historyHooks ) { com.google.gerrit.client.Gerrit.callHistoryHook ( hook , url ) ; } } }

Target:
private static void dispatchHistoryHooks ( java.lang.String token ) { if ( ( com.google.gerrit.client.Gerrit.signInAnchor ) != null ) { com.google.gerrit.client.Gerrit.signInAnchor.setHref ( com.google.gerrit.client.Gerrit.loginRedirect ( token ) ) ; } com.google.gerrit.client.api.ApiGlue.fireEvent ( "history" , token ) ; }
Source:
protected void resetHtml ( final java.lang.String body ) { for ( final java.util.Iterator < com.google.gwt.user.client.ui.Widget > i = table.iterator ( ) ; i.hasNext ( ) ; ) { i.next ( ) ; i.remove ( ) ; } com.google.gerrit.client.ui.FancyFlexTable.impl.resetHtml ( table , body ) ; }

Target:
protected void resetHtml ( final com.google.gwtexpui.safehtml.client.SafeHtml body ) { for ( final java.util.Iterator < com.google.gwt.user.client.ui.Widget > i = table.iterator ( ) ; i.hasNext ( ) ; ) { i.next ( ) ; i.remove ( ) ; } com.google.gerrit.client.ui.FancyFlexTable.impl.resetHtml ( table , body ) ; }
Source:
public void show ( ) { if ( ( recenter ) == null ) { recenter = new com.google.gwt.user.client.WindowResizeListener ( ) { public void onWindowResized ( final int width , final int height ) { onResize ( width , height ) ; } } ; com.google.gwt.user.client.Window.addWindowResizeListener ( recenter ) ; } super . show ( ) ; }

Target:
public void show ( ) { if ( ( recenter ) == null ) { recenter = com.google.gwt.user.client.Window.addResizeHandler ( new com.google.gwt.event.logical.shared.ResizeHandler ( ) { @ java.lang.Override public void onResize ( final com.google.gwt.event.logical.shared.ResizeEvent event ) { final int w = event.getWidth ( ) ; final int h = event.getHeight ( ) ; com.google.gwtexpui.user.client.AutoCenterDialogBox.this . onResize ( w , h ) ; } } ) ; } super . show ( ) ; }
Source:
public java.util.List < com.google.gerrit.reviewdb.client.PatchSetApproval > addReviewers ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.common.data.LabelTypes labelTypes , com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet ps , com.google.gerrit.reviewdb.client.PatchSetInfo info , java.lang.Iterable < com.google.gerrit.reviewdb.client.Account.Id > wantReviewers , java.util.Collection < com.google.gerrit.reviewdb.client.Account.Id > existingReviewers ) throws com.google.gwtorm.server.OrmException { return addReviewers ( db , labelTypes , change , ps.getId ( ) , ps.isDraft ( ) , info.getAuthor ( ) . getAccount ( ) , info.getCommitter ( ) . getAccount ( ) , wantReviewers , existingReviewers ) ; }

Target:
public java.util.List < com.google.gerrit.reviewdb.client.PatchSetApproval > addReviewers ( com.google.gerrit.reviewdb.server.ReviewDb db , com.google.gerrit.server.notedb.ChangeUpdate update , com.google.gerrit.common.data.LabelTypes labelTypes , com.google.gerrit.reviewdb.client.Change change , com.google.gerrit.reviewdb.client.PatchSet ps , com.google.gerrit.reviewdb.client.PatchSetInfo info , java.lang.Iterable < com.google.gerrit.reviewdb.client.Account.Id > wantReviewers , java.util.Collection < com.google.gerrit.reviewdb.client.Account.Id > existingReviewers ) throws com.google.gwtorm.server.OrmException { return addReviewers ( db , update , labelTypes , change , ps.getId ( ) , ps.isDraft ( ) , info.getAuthor ( ) . getAccount ( ) , info.getCommitter ( ) . getAccount ( ) , wantReviewers , existingReviewers ) ; }
Source:
static com.google.gerrit.acceptance.GerritServer.Description forTestMethod ( com.google.gerrit.acceptance.Description testDesc , java.lang.String configName ) { return new com.google.gerrit.acceptance.AutoValue_GerritServer_Description ( configName , ( ( testDesc.getAnnotation ( com.google.gerrit.acceptance.UseLocalDisk.class ) ) == null ) , ( ( ( testDesc.getAnnotation ( com.google.gerrit.acceptance.NoHttpd.class ) ) == null ) && ( ( testDesc.getTestClass ( ) . getAnnotation ( com.google.gerrit.acceptance.NoHttpd.class ) ) == null ) ) , testDesc.getAnnotation ( com.google.gerrit.acceptance.GerritConfig.class ) , testDesc.getAnnotation ( com.google.gerrit.acceptance.GerritConfigs.class ) ) ; }

Target:
static com.google.gerrit.acceptance.GerritServer.Description forTestMethod ( com.google.gerrit.acceptance.Description testDesc , java.lang.String configName ) { return new com.google.gerrit.acceptance.AutoValue_GerritServer_Description ( configName , ( ( testDesc.getAnnotation ( com.google.gerrit.acceptance.UseLocalDisk.class ) ) == null ) , ( ( ( testDesc.getAnnotation ( com.google.gerrit.acceptance.NoHttpd.class ) ) == null ) && ( ! ( com.google.gerrit.acceptance.GerritServer.Description.hasNoHttpd ( testDesc.getTestClass ( ) ) ) ) ) , testDesc.getAnnotation ( com.google.gerrit.acceptance.GerritConfig.class ) , testDesc.getAnnotation ( com.google.gerrit.acceptance.GerritConfigs.class ) ) ; }
Source:
public < V > com.google.gerrit.metrics.CallbackMetric < V > newCallbackMetric ( java.lang.String name , java.lang.Class < V > valueClass , com.google.gerrit.metrics.Description desc ) { checkNotDefined ( name ) ; descriptions.put ( name , desc.getAnnotations ( ) ) ; return new com.google.gerrit.metrics.dropwizard.DropWizardMetricMaker.CallbackMetricImpl < V > ( name , valueClass ) ; }

Target:
private synchronized void define ( java.lang.String name , com.google.gerrit.metrics.Description desc ) { if ( descriptions.containsKey ( name ) ) { throw new java.lang.IllegalStateException ( java.lang.String.format ( "metric %s already defined" , name ) ) ; } descriptions.put ( name , desc.getAnnotations ( ) ) ; }
Source:
protected void service ( javax.servlet.http.HttpServletRequest req , javax.servlet.http.HttpServletResponse res ) throws java.io.IOException , javax.servlet.ServletException { if ( ( filter.get ( ) ) == null ) { com.google.gwtexpui.server.CacheHeaders.setNotCacheable ( res ) ; res.sendError ( javax.servlet.http.HttpServletResponse.SC_NOT_IMPLEMENTED ) ; return ; } filter.get ( ) . doFilter ( req , res , chain ) ; }

Target:
private void responseLfsNotConfigured ( javax.servlet.http.HttpServletResponse res ) throws java.io.IOException { com.google.gwtexpui.server.CacheHeaders.setNotCacheable ( res ) ; res.setContentType ( com.google.gerrit.httpd.plugins.LfsPluginServlet.CONTENTTYPE_VND_GIT_LFS_JSON ) ; res.setStatus ( javax.servlet.http.HttpServletResponse.SC_NOT_IMPLEMENTED ) ; java.io.Writer w = new java.io.BufferedWriter ( new java.io.OutputStreamWriter ( res.getOutputStream ( ) , java.nio.charset.StandardCharsets.UTF_8 ) ) ; w.write ( com.google.gerrit.httpd.plugins.LfsPluginServlet.MESSAGE_LFS_NOT_CONFIGURED ) ; w.flush ( ) ; }
Source:
public void run ( ) { try { for ( com.google.gerrit.reviewdb.client.Project.NameKey nameKey : projectCache.all ( ) ) { replication.scheduleFullSync ( nameKey , urlMatch , state ) ; } } catch ( java.lang.Exception e ) { com.googlesource.gerrit.plugins.replication.PushAll.wrappedLog.error ( "Cannot enumerate known projects" , e , state ) ; } state.markAllPushTasksScheduled ( ) ; }

Target:
public void run ( ) { try { for ( com.google.gerrit.reviewdb.client.Project.NameKey nameKey : projectCache.all ( ) ) { replication.scheduleFullSync ( nameKey , urlMatch , state ) ; } } catch ( java.lang.Exception e ) { com.googlesource.gerrit.plugins.replication.PushAll.stateLog.error ( "Cannot enumerate known projects" , e , state ) ; } state.markAllPushTasksScheduled ( ) ; }
Source:
private static boolean acceptsPutInput ( java.lang.Class < java.lang.Object > type ) { for ( java.lang.reflect.Field f : type.getDeclaredFields ( ) ) { if ( ( f.getType ( ) ) == ( com.google.gerrit.extensions.restapi.PutInput.class ) ) { return true ; } } return false ; }

Target:
private static boolean acceptsPutInput ( java.lang.reflect.Type type ) { if ( type instanceof java.lang.Class ) { for ( java.lang.reflect.Field f : ( ( java.lang.Class ) ( type ) ) . getDeclaredFields ( ) ) { if ( ( f.getType ( ) ) == ( com.google.gerrit.extensions.restapi.PutInput.class ) ) { return true ; } } } return false ; }
Source:
void clearLine ( com.google.gerrit.client.diff.DisplaySide side , int cmLinePlusOne , com.google.gerrit.client.diff.CommentGroup group ) { java.util.SortedMap < java.lang.Integer , com.google.gerrit.client.diff.UnifiedCommentGroup > map = map ( side ) ; if ( ( map.get ( cmLinePlusOne ) ) == group ) { map.remove ( cmLinePlusOne ) ; } }

Target:
void clearLine ( com.google.gerrit.client.diff.DisplaySide side , int line , com.google.gerrit.client.diff.CommentGroup group ) { super . clearLine ( side , line , group ) ; if ( ( mergedMap.get ( line ) ) == group ) { mergedMap.remove ( line ) ; if ( duplicates.containsKey ( line ) ) { mergedMap.put ( line , duplicates.remove ( line ) ) ; } } }
Source:
public void onPreReceive ( final org.spearce.jgit.transport.ReceivePack arg0 , final java.util.Collection < org.spearce.jgit.transport.ReceiveCommand > commands ) { parseCommands ( db , commands ) ; if ( ( newChange ) != null ) { newChange.setResult ( ReceiveCommand.Result.OK ) ; } for ( java.util.Map.Entry < com.google.gerrit.client.reviewdb.Change.Id , org.spearce.jgit.transport.ReceiveCommand > e : addByChange.entrySet ( ) ) { e.getValue ( ) . setResult ( ReceiveCommand.Result.OK ) ; } }

Target:
public void onPreReceive ( final org.spearce.jgit.transport.ReceivePack arg0 , final java.util.Collection < org.spearce.jgit.transport.ReceiveCommand > commands ) { parseCommands ( commands ) ; createNewChanges ( rp ) ; appendPatchSets ( rp.getRevWalk ( ) ) ; }
Source:
public java.util.List < java.lang.String > getReviewerNames ( ) { if ( reviewers.isEmpty ( ) ) { return null ; } java.util.List < java.lang.String > names = new java.util.ArrayList < > ( ) ; for ( com.google.gerrit.reviewdb.client.Account.Id id : reviewers ) { names.add ( getNameFor ( id ) ) ; } return names ; }

Target:
public java.util.List < java.lang.String > getReviewerNames ( ) { if ( ( reviewers.isEmpty ( ) ) && ( reviewersByEmail.isEmpty ( ) ) ) { return null ; } java.util.List < java.lang.String > names = new java.util.ArrayList < > ( ) ; for ( com.google.gerrit.reviewdb.client.Account.Id id : reviewers ) { names.add ( getNameFor ( id ) ) ; } for ( com.google.gerrit.server.mail.Address a : reviewersByEmail ) { names.add ( a.toString ( ) ) ; } return names ; }
Source:
public void testBulletList1 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.html ( "A\n\n* line 1\n* 2nd line" ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; org.junit.Assert.assertNotSame ( o , n ) ; org.junit.Assert.assertEquals ( ( ( ( ( "<p>A</p>" + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.BEGIN_LIST ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "line 1" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "2nd line" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.END_LIST ) ) , n.asString ( ) ) ; }

Target:
public void testBulletList1 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.html ( "A\n\n* line 1\n* 2nd line" ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; com.google.common.truth.Truth.assertThat ( o ) . isNotSameAs ( n ) ; com.google.common.truth.Truth.assertThat ( n.asString ( ) ) . isEqualTo ( ( ( ( ( "<p>A</p>" + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.BEGIN_LIST ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "line 1" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.item ( "2nd line" ) ) ) + ( com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.END_LIST ) ) ) ; }
Source:
public void patchSetObjectAndRefMissing ( ) throws java.lang.Exception { java.lang.String rev = "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = insertMissingPatchSet ( ctl , rev ) ; ctl = reload ( ctl ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Ref missing: " + ( ps.getId ( ) . toRefName ( ) ) ) ) , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( "Object missing: patch set 2: deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) ) ; }

Target:
public void patchSetObjectAndRefMissingWithFix ( ) throws java.lang.Exception { java.lang.String rev = "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ; com.google.gerrit.server.notedb.ChangeNotes notes = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = insertMissingPatchSet ( notes , rev ) ; notes = reload ( notes ) ; java.lang.String refName = ps.getId ( ) . toRefName ( ) ; assertProblems ( notes , new com.google.gerrit.extensions.api.changes.FixInput ( ) , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Ref missing: " + refName ) ) , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Object missing: patch set 2: " + rev ) ) ) ; }
Source:
public void testChangeEventShouldStayInQueueWhenExecutionFailed ( ) { asyncListener = new com.googlesource.gerrit.plugins.hooks.rtc.filters.ChangeListenerAsyncDecorator < com.google.gerrit.common.ChangeListener > ( listener , immediateExecutor ) ; doThrow ( new java.lang.IllegalArgumentException ( ) ) . when ( listener ) . onChangeEvent ( org.mockito.Matchers.any ( com.google.gerrit.server.events.ChangeEvent.class ) ) ; asyncListener.onChangeEvent ( event ) ; verify ( listener ) . onChangeEvent ( event ) ; org.junit.Assert.assertFalse ( asyncListener.getQueue ( ) . isEmpty ( ) ) ; }

Target:
public void testChangeEventShouldStayInQueueWhenExecutionFailed ( ) { asyncListener = new com.googlesource.gerrit.plugins.hooks.rtc.filters.ChangeListenerAsyncDecorator ( listener , immediateExecutor ) ; org.mockito.Mockito.doThrow ( new java.lang.IllegalArgumentException ( ) ) . when ( listener ) . onEvent ( org.mockito.Matchers.any ( com.google.gerrit.server.events.ChangeEvent.class ) ) ; asyncListener.onEvent ( event ) ; org.mockito.Mockito.verify ( listener ) . onEvent ( event ) ; org.junit.Assert.assertFalse ( asyncListener.getQueue ( ) . isEmpty ( ) ) ; }
Source:
public void markReady ( ) throws java.io.IOException { org.eclipse.jgit.storage.file.FileBasedConfig cfg = new org.eclipse.jgit.storage.file.FileBasedConfig ( com.google.gerrit.solr.IndexVersionCheck.solrIndexConfig ( sitePaths ) , org.eclipse.jgit.util.FS.detect ( ) ) ; for ( java.util.Map.Entry < java.lang.String , java.lang.Integer > e : com.google.gerrit.solr.IndexVersionCheck.SCHEMA_VERSIONS.entrySet ( ) ) { cfg.setInt ( "index" , e.getKey ( ) , "schemaVersion" , e.getValue ( ) ) ; } cfg.save ( ) ; }

Target:
public void markReady ( boolean ready ) throws java.io.IOException { org.eclipse.jgit.storage.file.FileBasedConfig cfg = new org.eclipse.jgit.storage.file.FileBasedConfig ( com.google.gerrit.solr.IndexVersionCheck.solrIndexConfig ( sitePaths ) , org.eclipse.jgit.util.FS.detect ( ) ) ; for ( java.util.Map.Entry < java.lang.String , java.lang.Integer > e : com.google.gerrit.solr.IndexVersionCheck.SCHEMA_VERSIONS.entrySet ( ) ) { cfg.setInt ( "index" , e.getKey ( ) , "schemaVersion" , ( ready ? e.getValue ( ) : - 1 ) ) ; } cfg.save ( ) ; }
Source:
private com.google.inject.Injector createSshInjector ( final com.google.inject.Injector sysInjector ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( new com.google.gerrit.sshd.SshModule ( ) ) ; if ( slave ) { modules.add ( new com.google.gerrit.sshd.commands.SlaveCommandModule ( ) ) ; } else { modules.add ( new com.google.gerrit.sshd.commands.MasterCommandModule ( ) ) ; } return sysInjector.createChildInjector ( modules ) ; }

Target:
private com.google.inject.Injector createSshInjector ( final com.google.inject.Injector sysInjector ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; modules.add ( new com.google.gerrit.sshd.SshModule ( ) ) ; if ( slave ) { modules.add ( new com.google.gerrit.sshd.commands.SlaveCommandModule ( ) ) ; } else { modules.add ( new com.google.gerrit.sshd.commands.MasterCommandModule ( ) ) ; modules.add ( new com.google.gerrit.server.config.MasterNodeStartup ( ) ) ; } return sysInjector.createChildInjector ( modules ) ; }
Source:
public void run ( ) throws java.lang.Exception { parseCommandLine ( ) ; factory.create ( in , out ) . run ( ) ; }

Target:
public void run ( ) throws java.lang.Exception { parseCommandLine ( ) ; final com.google.gerrit.sshd.commands.QueryShell shell = factory.create ( in , out ) ; shell.setOutputFormat ( format ) ; if ( ( query ) != null ) { shell.execute ( query ) ; } else { shell.run ( ) ; } }
Source:
private java.lang.String getLine ( com.google.gerrit.server.patch.PatchFile fileInfo , short side , int lineNbr ) { if ( ( side != 0 ) && ( side != 1 ) ) { throw new java.lang.IllegalArgumentException ( ( "side should be 0 or 1, was " + side ) ) ; } try { return fileInfo.getLine ( side , lineNbr ) ; } catch ( java.io.IOException exc ) { return "" ; } catch ( java.lang.IndexOutOfBoundsException exc ) { return "" ; } catch ( com.google.gerrit.common.errors.NoSuchEntityException exc ) { throw new java.lang.AssertionError ( exc ) ; } }

Target:
private java.lang.String getLine ( com.google.gerrit.server.patch.PatchFile fileInfo , short side , int lineNbr ) { try { return fileInfo.getLine ( side , lineNbr ) ; } catch ( java.io.IOException err ) { com.google.gerrit.server.mail.CommentSender.log.warn ( java.lang.String.format ( "Failed to read file on side %d" , side ) , err ) ; return "" ; } catch ( java.lang.IndexOutOfBoundsException err ) { com.google.gerrit.server.mail.CommentSender.log.warn ( java.lang.String.format ( "Failed to get line number of file on side %d" , side ) , err ) ; return "" ; } catch ( com.google.gerrit.common.errors.NoSuchEntityException err ) { com.google.gerrit.server.mail.CommentSender.log.warn ( java.lang.String.format ( "Side %d of file didn't exist" , side ) , err ) ; return "" ; } }
Source:
public java.lang.String getGerritPluginName ( java.nio.file.Path srcPath ) { java.lang.String fileName = srcPath.getFileName ( ) . toString ( ) ; if ( com.google.gerrit.server.plugins.PluginLoader.isJsPlugin ( fileName ) ) { return fileName.substring ( 0 , ( ( fileName.length ( ) ) - 3 ) ) ; } if ( serverPluginFactory.handles ( srcPath ) ) { return serverPluginFactory.getPluginName ( srcPath ) ; } return null ; }

Target:
public java.lang.String getGerritPluginName ( java.nio.file.Path srcPath ) { java.lang.String fileName = srcPath.getFileName ( ) . toString ( ) ; if ( com.google.gerrit.server.plugins.PluginLoader.isUiPlugin ( fileName ) ) { return fileName.substring ( 0 , fileName.lastIndexOf ( '.' ) ) ; } if ( serverPluginFactory.handles ( srcPath ) ) { return serverPluginFactory.getPluginName ( srcPath ) ; } return null ; }
Source:
public static java.lang.String name ( com.google.gerrit.client.account.AccountInfo ai ) { if ( ( ( ai.name ( ) ) != null ) && ( ! ( ai.name ( ) . trim ( ) . isEmpty ( ) ) ) ) { return ai.name ( ) ; } java.lang.String email = ai.email ( ) ; if ( email != null ) { int at = email.indexOf ( '@' ) ; return 0 < at ? email.substring ( 0 , at ) : email ; } return com.google.gerrit.client.FormatUtil.nameEmail ( ai ) ; }

Target:
public static java.lang.String name ( com.google.gerrit.client.info.AccountInfo ai ) { if ( ( ( ai.name ( ) ) != null ) && ( ! ( ai.name ( ) . trim ( ) . isEmpty ( ) ) ) ) { return ai.name ( ) ; } java.lang.String email = ai.email ( ) ; if ( email != null ) { int at = email.indexOf ( '@' ) ; return 0 < at ? email.substring ( 0 , at ) : email ; } return com.google.gerrit.client.FormatUtil.nameEmail ( ai ) ; }
Source:
private void createGroup ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure , com.google.gwtorm.client.OrmException { final com.google.gerrit.server.account.PerformCreateGroup performCreateGroup = performCreateGroupFactory.create ( ) ; try { performCreateGroup.createGroup ( groupName , groupDescription , ownerGroupId , initialMembers.toArray ( new com.google.gerrit.reviewdb.Account.Id [ initialMembers.size ( ) ] ) ) ; } catch ( com.google.gerrit.common.errors.NameAlreadyUsedException e ) { throw die ( e ) ; } }

Target:
private void createGroup ( ) throws com.google.gerrit.sshd.commands.UnloggedFailure , com.google.gwtorm.client.OrmException { final com.google.gerrit.server.account.PerformCreateGroup performCreateGroup = performCreateGroupFactory.create ( ) ; try { performCreateGroup.createGroup ( groupName , groupDescription , visibleToAll , ownerGroupId , initialMembers , initialGroups ) ; } catch ( com.google.gerrit.common.errors.NameAlreadyUsedException e ) { throw die ( e ) ; } }