auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean equals ( java.lang.Object other ) { if ( other instanceof com.googlesource.gerrit.plugins.xdocs.XDocResourceKey ) { com.googlesource.gerrit.plugins.xdocs.XDocResourceKey rk = ( ( com.googlesource.gerrit.plugins.xdocs.XDocResourceKey ) ( other ) ) ; return ( ( ( formatter.equals ( rk.formatter ) ) && ( project.equals ( rk.project ) ) ) && ( resource.equals ( rk.resource ) ) ) && ( revId.equals ( rk.revId ) ) ; } return false ; }

Target:
public boolean equals ( java.lang.Object other ) { if ( other instanceof com.googlesource.gerrit.plugins.xdocs.XDocResourceKey ) { com.googlesource.gerrit.plugins.xdocs.XDocResourceKey rk = ( ( com.googlesource.gerrit.plugins.xdocs.XDocResourceKey ) ( other ) ) ; return ( ( ( ( java.util.Objects.equals ( formatter , rk.formatter ) ) && ( java.util.Objects.equals ( project , rk.project ) ) ) && ( java.util.Objects.equals ( resource , rk.resource ) ) ) && ( java.util.Objects.equals ( revId , rk.revId ) ) ) && ( java.util.Objects.equals ( metaConfigRevId , rk.metaConfigRevId ) ) ; } return false ; }
Source:
public void onSuccess ( final com.google.gwtjsonrpc.client.VoidResult result ) { for ( int row = 1 ; row < ( table.getRowCount ( ) ) ; ) { final com.google.gerrit.reviewdb.AccountSshKey k = getRowItem ( row ) ; if ( ( k != null ) && ( ids.contains ( k.getKey ( ) ) ) ) { table.removeRow ( row ) ; } else { row ++ ; } } if ( ( table.getRowCount ( ) ) == 1 ) { showAddKeyBlock ( true ) ; } }

Target:
public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Boolean > event ) { updateDeleteButton ( ) ; }
Source:
private java.nio.file.Path polyGerritBasePath ( ) { com.google.gerrit.httpd.raw.StaticModule.Paths p = getPaths ( ) ; boolean forceDev = options.forcePolyGerritDev ( ) ; if ( forceDev ) { com.google.common.base.Preconditions.checkArgument ( ( ( p.buckOut ) != null ) , "no buck-out directory found for PolyGerrit developer mode" ) ; } return forceDev || ( ( p.warFs ) == null ) ? p.buckOut.getParent ( ) . resolve ( "polygerrit-ui" ) . resolve ( "app" ) : p.warFs.getPath ( "/polygerrit_ui" ) ; }

Target:
private boolean isDev ( ) { return ( options.forcePolyGerritDev ( ) ) || ( ( getPaths ( ) . warFs ) == null ) ; }
Source:
private void parseApproval ( com.google.gerrit.reviewdb.client.PatchSet.Id psId , com.google.gerrit.reviewdb.client.Account.Id accountId , java.sql.Timestamp ts , java.lang.String line ) throws org.eclipse.jgit.errors.ConfigInvalidException { if ( line.startsWith ( "-" ) ) { parseRemoveApproval ( psId , accountId , line ) ; } else { parseAddApproval ( psId , accountId , ts , line ) ; } }

Target:
private void parseApproval ( com.google.gerrit.reviewdb.client.PatchSet.Id psId , com.google.gerrit.reviewdb.client.Account.Id accountId , java.sql.Timestamp ts , java.lang.String line ) throws org.eclipse.jgit.errors.ConfigInvalidException { if ( accountId == null ) { throw parseException ( "patch set %s requires an identified user as uploader" , psId.get ( ) ) ; } if ( line.startsWith ( "-" ) ) { parseRemoveApproval ( psId , accountId , line ) ; } else { parseAddApproval ( psId , accountId , ts , line ) ; } }
Source:
private static int getTimeUnit ( org.eclipse.jgit.transport.RemoteConfig rc , org.eclipse.jgit.lib.Config cfg , java.lang.String name , int defValue , java.util.concurrent.TimeUnit unit ) { return ( ( int ) ( com.google.gerrit.server.config.ConfigUtil.getTimeUnit ( cfg , "remote" , rc.getName ( ) , name , defValue , unit ) ) ) ; }

Target:
public void start ( com.google.gerrit.server.git.WorkQueue workQueue ) { java.lang.String poolName = "ReplicateTo-" + ( config.getRemoteConfig ( ) . getName ( ) ) ; pool = workQueue.createQueue ( config.getPoolThreads ( ) , poolName ) ; }
Source:
public void testDoPostBadRequest ( ) throws java.lang.Exception { org.mockito.Mockito.doThrow ( new java.io.IOException ( com.ericsson.gerrit.plugins.syncevents.SyncEventsRestApiServletTest.ERR_MSG ) ) . when ( req ) . getReader ( ) ; syncEventsRestApiServlet.doPost ( req , rsp ) ; org.mockito.Mockito.verify ( rsp ) . sendError ( javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST , com.ericsson.gerrit.plugins.syncevents.SyncEventsRestApiServletTest.ERR_MSG ) ; }

Target:
public void testDoPostBadRequest ( ) throws java.lang.Exception { org.mockito.Mockito.doThrow ( new java.io.IOException ( com.ericsson.gerrit.plugins.highavailability.forwarder.rest.EventRestApiServletTest.ERR_MSG ) ) . when ( req ) . getReader ( ) ; eventRestApiServlet.doPost ( req , rsp ) ; org.mockito.Mockito.verify ( rsp ) . sendError ( javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST , com.ericsson.gerrit.plugins.highavailability.forwarder.rest.EventRestApiServletTest.ERR_MSG ) ; }
Source:
public int compare ( final com.google.gerrit.reviewdb.client.AccountGroupIncludeByUuid o1 , final com.google.gerrit.reviewdb.client.AccountGroupIncludeByUuid o2 ) { com.google.gerrit.common.data.GroupDescription.Basic a = gic.get ( o1.getIncludeUUID ( ) ) ; com.google.gerrit.common.data.GroupDescription.Basic b = gic.get ( o2.getIncludeUUID ( ) ) ; return n ( a ) . compareTo ( n ( b ) ) ; }

Target:
public int compare ( final com.google.gerrit.reviewdb.client.AccountGroupById o1 , final com.google.gerrit.reviewdb.client.AccountGroupById o2 ) { com.google.gerrit.common.data.GroupDescription.Basic a = gic.get ( o1.getIncludeUUID ( ) ) ; com.google.gerrit.common.data.GroupDescription.Basic b = gic.get ( o2.getIncludeUUID ( ) ) ; return n ( a ) . compareTo ( n ( b ) ) ; }
Source:
public com.google.gerrit.server.ContactStore get ( ) { try { return new com.google.gerrit.server.EncryptedContactStore ( config , sitePath , schema ) ; } catch ( final com.google.gerrit.client.rpc.ContactInformationStoreException initError ) { return new com.google.gerrit.server.ContactStore ( ) { @ java.lang.Override public boolean isEnabled ( ) { return false ; } @ java.lang.Override public void store ( com.google.gerrit.client.reviewdb.Account account , com.google.gerrit.client.reviewdb.ContactInformation info ) throws com.google.gerrit.client.rpc.ContactInformationStoreException { throw initError ; } } ; } }

Target:
public com.google.gerrit.server.ContactStore get ( ) { try { return new com.google.gerrit.server.EncryptedContactStore ( config , sitePath , schema ) ; } catch ( java.lang.NoClassDefFoundError notInstalled ) { return noContact ( new com.google.gerrit.client.rpc.ContactInformationStoreException ( new java.lang.ClassNotFoundException ( "BouncyCastle PGP not installed" , notInstalled ) ) ) ; } catch ( final com.google.gerrit.client.rpc.ContactInformationStoreException initError ) { return noContact ( initError ) ; } }
Source:
void set ( com.google.gerrit.client.info.ChangeInfo info ) { this . changeId = info.legacyId ( ) ; this . canEdit = ( info.hasActions ( ) ) && ( info.actions ( ) . containsKey ( "assignee" ) ) ; setAssignee ( info.assignee ( ) ) ; editAssigneeIcon.setVisible ( canEdit ) ; if ( ! ( canEdit ) ) { show.setTitle ( null ) ; } }

Target:
void set ( com.google.gerrit.client.info.ChangeInfo info ) { this . changeId = info.legacyId ( ) ; this . canEdit = ( info.hasActions ( ) ) && ( info.actions ( ) . containsKey ( "assignee" ) ) ; assigneeSuggestOracle.setChange ( info ) ; setAssignee ( info.assignee ( ) ) ; editAssigneeIcon.setVisible ( canEdit ) ; if ( ! ( canEdit ) ) { show.setTitle ( null ) ; } }
Source:
private void stateEdit ( final boolean inEdit ) { renderedPanel.setVisible ( ( ! inEdit ) ) ; edit.setVisible ( ( ! inEdit ) ) ; text.setVisible ( inEdit ) ; save.setVisible ( inEdit ) ; cancel.setVisible ( ( inEdit && ( ! ( isNew ( ) ) ) ) ) ; discard.setVisible ( inEdit ) ; }

Target:
private void stateEdit ( final boolean inEdit ) { expandTimer.cancel ( ) ; renderedPanel.setVisible ( ( ! inEdit ) ) ; edit.setVisible ( ( ! inEdit ) ) ; text.setVisible ( inEdit ) ; save.setVisible ( inEdit ) ; cancel.setVisible ( ( inEdit && ( ! ( isNew ( ) ) ) ) ) ; discard.setVisible ( inEdit ) ; }
Source:
public void assertChange ( com.google.gerrit.reviewdb.client.Change.Status expectedStatus , java.lang.String expectedTopic , com.google.gerrit.acceptance.TestAccount ... expectedReviewers ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c = getChange ( ) . change ( ) ; com.google.common.truth.Truth.assertThat ( c.getSubject ( ) ) . isEqualTo ( resSubj ) ; com.google.common.truth.Truth.assertThat ( c.getStatus ( ) ) . isEqualTo ( expectedStatus ) ; com.google.common.truth.Truth.assertThat ( com.google.common.base.Strings.emptyToNull ( c.getTopic ( ) ) ) . isEqualTo ( expectedTopic ) ; assertReviewers ( c , expectedReviewers ) ; }

Target:
public void assertChange ( com.google.gerrit.reviewdb.client.Change.Status expectedStatus , java.lang.String expectedTopic , com.google.gerrit.acceptance.TestAccount ... expectedReviewers ) throws com.google.gwtorm.server.OrmException { assertChange ( expectedStatus , expectedTopic , java.util.Arrays.asList ( expectedReviewers ) , com.google.common.collect.ImmutableList.of ( ) ) ; }
Source:
public static org.eclipse.jgit.lib.Config allEnabledConfig ( ) { org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; for ( com.google.gerrit.server.notedb.NotesMigration.Table t : com.google.gerrit.server.notedb.NotesMigration.Table.values ( ) ) { cfg.setBoolean ( com.google.gerrit.server.notedb.NotesMigration.NOTEDB , t.key ( ) , com.google.gerrit.server.notedb.NotesMigration.WRITE , true ) ; cfg.setBoolean ( com.google.gerrit.server.notedb.NotesMigration.NOTEDB , t.key ( ) , com.google.gerrit.server.notedb.NotesMigration.READ , true ) ; } return cfg ; }

Target:
public static org.eclipse.jgit.lib.Config allEnabledConfig ( ) { org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; com.google.gerrit.server.notedb.NotesMigration.setAllEnabledConfig ( cfg ) ; return cfg ; }
Source:
public void run ( ) { try { future.get ( ) ; } catch ( java.lang.InterruptedException e ) { com.google.gerrit.pgm.Reindex.log.error ( ( "Failed to index change " + ( change.getId ( ) ) ) , e ) ; ok.set ( false ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.pgm.Reindex.log.error ( ( "Failed to index change " + ( change.getId ( ) ) ) , e ) ; ok.set ( false ) ; } finally { sem.release ( ) ; } }

Target:
public void run ( ) { try { future.get ( ) ; done.update ( 1 ) ; } catch ( java.lang.InterruptedException e ) { fail ( change , e ) ; } catch ( java.util.concurrent.ExecutionException e ) { fail ( change , e ) ; } catch ( java.lang.RuntimeException e ) { failAndThrow ( change , e ) ; } catch ( java.lang.Error e ) { failAndThrow ( change , e ) ; } finally { sem.release ( ) ; } }
Source:
protected com.google.gerrit.server.IdentifiedUser user ( com.google.gerrit.acceptance.TestAccount testAccount ) { return identifiedUserFactory.create ( com.google.inject.util.Providers.of ( db ) , testAccount.getId ( ) ) ; }

Target:
protected PushOneCommit.Result createChange ( org.eclipse.jgit.junit.TestRepository < ? > repo , java.lang.String branch , java.lang.String subject , java.lang.String fileName , java.lang.String content , java.lang.String topic ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit push = pushFactory.create ( db , admin.getIdent ( ) , repo , subject , fileName , content ) ; return push.to ( ( ( ( "refs/for/" + branch ) + "/" ) + ( name ( topic ) ) ) ) ; }
Source:
public void setEnabled ( final boolean on ) { for ( com.google.gwt.user.client.ui.Widget w : ( ( com.google.gwt.user.client.ui.HasWidgets ) ( getWidget ( ) ) ) ) { if ( w instanceof com.google.gwt.user.client.ui.FocusWidget ) { ( ( com.google.gwt.user.client.ui.FocusWidget ) ( w ) ) . setEnabled ( on ) ; } } }

Target:
public void setEnabled ( final boolean on ) { for ( com.google.gwt.user.client.ui.Widget w : ( ( com.google.gwt.user.client.ui.HasWidgets ) ( getWidget ( ) ) ) ) { if ( w instanceof com.google.gwt.user.client.ui.FocusWidget ) { ( ( com.google.gwt.user.client.ui.FocusWidget ) ( w ) ) . setEnabled ( on ) ; } } toggleEnabledStatus ( on ) ; }
Source:
public java.lang.String toString ( ) { final java.lang.String val = getValue ( ) ; if ( com.google.gerrit.server.query.QueryParser.isSingleWord ( val ) ) { return ( ( getOperator ( ) ) + ":" ) + val ; } return ( ( ( getOperator ( ) ) + ":\"" ) + val ) + "\"" ; }

Target:
public java.lang.String toString ( ) { final java.lang.String val = getValue ( ) ; if ( com.google.gerrit.index.query.QueryParser.isSingleWord ( val ) ) { return ( ( getOperator ( ) ) + ":" ) + val ; } return ( ( ( getOperator ( ) ) + ":\"" ) + val ) + "\"" ; }
Source:
public void validNewChange ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = insertChange ( ) ; insertPatchSet ( c ) ; incrementPatchSet ( c ) ; insertPatchSet ( c ) ; assertProblems ( c ) ; }

Target:
public void invalidRevision ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.enabled ( ) ) . isFalse ( ) ; com.google.gerrit.server.project.ChangeControl ctl = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = com.google.gerrit.testutil.TestChanges.newPatchSet ( ctl.getChange ( ) . currentPatchSetId ( ) , "fooooooooooooooooooooooooooooooooooooooo" , adminId ) ; db.patchSets ( ) . update ( java.util.Collections.singleton ( ps ) ) ; assertProblems ( ctl , null , com.google.gerrit.acceptance.server.change.ConsistencyCheckerIT.problem ( ( "Invalid revision on patch set 1:" + " fooooooooooooooooooooooooooooooooooooooo" ) ) ) ; }
Source:
public void normalize ( final com.google.gerrit.client.reviewdb.Project.NameKey projectName , final java.util.Collection < com.google.gerrit.client.reviewdb.ChangeApproval > approvals , final com.google.gwtorm.client.Transaction txn ) throws com.google.gwtorm.client.OrmException { final com.google.gerrit.client.reviewdb.Project project = db.projects ( ) . get ( projectName ) ; final com.google.gerrit.client.reviewdb.Project.Id projectId = ( project != null ) ? project.getId ( ) : null ; normalize ( projectId , approvals , txn ) ; }

Target:
public void normalize ( final com.google.gerrit.client.data.ProjectCache.Entry project , final java.util.Collection < com.google.gerrit.client.reviewdb.ChangeApproval > approvals , final com.google.gwtorm.client.Transaction txn ) throws com.google.gwtorm.client.OrmException { final java.util.Map < com.google.gerrit.client.reviewdb.ApprovalCategory.Id , java.util.Collection < com.google.gerrit.client.reviewdb.ProjectRight > > rights ; rights = loadRights ( project ) ; for ( final com.google.gerrit.client.reviewdb.ChangeApproval a : approvals ) { if ( normalize ( rights , a ) ) { db.changeApprovals ( ) . update ( java.util.Collections.singleton ( a ) , txn ) ; } } }
Source:
public com.google.gerrit.extensions.common.ChangeInfo format ( com.google.gerrit.reviewdb.client.Change.Id id ) throws com.google.gwtorm.server.OrmException { return format ( changeDataFactory.create ( db.get ( ) , id ) ) ; }

Target:
public com.google.gerrit.extensions.common.ChangeInfo format ( com.google.gerrit.reviewdb.client.Change.Id id ) throws com.google.gwtorm.server.OrmException { com.google.gerrit.reviewdb.client.Change c ; try { c = db.get ( ) . changes ( ) . get ( id ) ; } catch ( com.google.gwtorm.server.OrmException e ) { if ( ! ( has ( com.google.gerrit.extensions.common.ListChangesOption.CHECK ) ) ) { throw e ; } return checkOnly ( changeDataFactory.create ( db.get ( ) , id ) ) ; } return format ( changeDataFactory.create ( db.get ( ) , c ) ) ; }
Source:
public void testDoPostErrorWhileSendingErrorMessage ( ) throws java.lang.Exception { org.easymock.EasyMock.expect ( req.getReader ( ) ) . andThrow ( new java.io.IOException ( "someError" ) ) ; rsp.sendError ( javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST , "someError" ) ; org.easymock.EasyMock.expectLastCall ( ) . andThrow ( new java.io.IOException ( "someOtherError" ) ) ; replayAll ( ) ; syncEventsRestApiServlet.doPost ( req , rsp ) ; verifyAll ( ) ; }

Target:
public void testDoPostDispatcherFailure ( ) throws java.lang.Exception { java.lang.String event = "{\"project\":\"gerrit/test-sync-index\",\"ref\":" + ( "\"refs/changes/76/669676/2\",\"nodesCount\":1,\"type\":" + "\"ref-replication-done\",\"eventCreatedOn\":1451415011}" ) ; org.mockito.Mockito.when ( req.getReader ( ) ) . thenReturn ( new java.io.BufferedReader ( new java.io.StringReader ( event ) ) ) ; org.mockito.Mockito.doThrow ( new com.google.gwtorm.server.OrmException ( com.ericsson.gerrit.plugins.syncevents.SyncEventsRestApiServletTest.ERR_MSG ) ) . when ( dispatcher ) . postEvent ( org.mockito.ArgumentMatchers.any ( com.ericsson.gerrit.plugins.syncevents.SyncEventsRestApiServletTest.RefReplicationDoneEvent.class ) ) ; syncEventsRestApiServlet.doPost ( req , rsp ) ; org.mockito.Mockito.verify ( rsp ) . sendError ( javax.servlet.http.HttpServletResponse.SC_NOT_FOUND , "Change not found\n" ) ; }
Source:
public static com.google.gerrit.common.data.GroupReference findBestSuggestion ( com.google.gerrit.server.account.GroupBackend groupBackend , java.lang.String name ) { java.util.Collection < com.google.gerrit.common.data.GroupReference > refs = groupBackend.suggest ( name ) ; if ( ( refs.size ( ) ) == 1 ) { return com.google.common.collect.Iterables.getOnlyElement ( refs ) ; } for ( com.google.gerrit.common.data.GroupReference ref : refs ) { if ( com.google.gerrit.server.account.GroupBackends.isExactSuggestion ( ref , name ) ) { return ref ; } } return null ; }

Target:
public static com.google.gerrit.common.data.GroupReference findBestSuggestion ( com.google.gerrit.server.account.GroupBackend groupBackend , java.lang.String name , @ javax.annotation.Nullable com.google.gerrit.server.project.ProjectControl project ) { java.util.Collection < com.google.gerrit.common.data.GroupReference > refs = groupBackend.suggest ( name , project ) ; if ( ( refs.size ( ) ) == 1 ) { return com.google.common.collect.Iterables.getOnlyElement ( refs ) ; } for ( com.google.gerrit.common.data.GroupReference ref : refs ) { if ( com.google.gerrit.server.account.GroupBackends.isExactSuggestion ( ref , name ) ) { return ref ; } } return null ; }
Source:
public void run ( ) { if ( cm.hasVimSearchHighlight ( ) ) { net.codemirror.lib.CodeMirror.handleVimKey ( cm , "n" ) ; } else { diffChunkNav ( cm , com.google.gerrit.client.diff.SideBySide2.Direction.NEXT ) . run ( ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.diff.DiffInfo diffInfo ) { if ( ( id == ( reloadVersionId ) ) && ( isAttached ( ) ) ) { diff = diffInfo ; operation ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { clearSkipBars ( ) ; clearMarkers ( ) ; diffTable.sidePanel.clearDiffGutters ( ) ; setShowIntraline ( prefs.intralineDifference ( ) ) ; render ( diff ) ; renderSkips ( prefs.context ( ) ) ; } } ) ; } }
Source:
public void parseReviewer ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Patch-Set: 1\n" ) + "Reviewer: Change Owner <1@gerrit>\n" ) + "CC: Other Account <2@gerrit>\n" ) + "Subject: This is a test change\n" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( "\n" + "Patch-Set: 1\n" ) + "Reviewer: 1@gerrit\n" ) ) ) ; }

Target:
public void parseSubmissionId ( ) throws java.lang.Exception { assertParseSucceeds ( ( "Update change\n" + ( ( ( ( ( "\n" + "Branch: refs/heads/master\n" ) + "Change-id: I577fb248e474018276351785930358ec0450e9f7\n" ) + "Patch-Set: 1\n" ) + "Subject: This is a test change\n" ) + "Submission-id: 1-1453387607626-96fabc25" ) ) ) ; assertParseFails ( ( "Update change\n" + ( ( ( "\n" + "Patch-Set: 1\n" ) + "Submission-id: 1-1453387607626-96fabc25\n" ) + "Submission-id: 1-1453387901516-5d1e2450" ) ) ) ; }
Source:
private void populateReviewAction ( ) { final com.google.gwt.user.client.ui.Button b = new com.google.gwt.user.client.ui.Button ( Util.C.buttonReview ( ) ) ; b.addClickHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { com.google.gerrit.client.Gerrit.display ( ( "change,publish," + ( patchSet.getId ( ) . toString ( ) ) ) , new com.google.gerrit.client.changes.PublishCommentScreen ( patchSet.getId ( ) ) ) ; } } ) ; actionsPanel.add ( b ) ; }

Target:
private void populateReviewAction ( ) { final com.google.gwt.user.client.ui.Button b = new com.google.gwt.user.client.ui.Button ( Util.C.buttonReview ( ) ) ; b.addClickHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.client.Dispatcher.toPublish ( patchSet.getId ( ) ) ) ; } } ) ; actionsPanel.add ( b ) ; }
Source:
void onSave ( com.google.gwt.event.dom.client.ClickEvent e ) { com.google.gerrit.client.changes.ChangeApi.message ( changeId.get ( ) , revision , message.getText ( ) . trim ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwt.core.client.JavaScriptObject > ( ) { @ java.lang.Override public void onSuccess ( com.google.gwt.core.client.JavaScriptObject msg ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId ) ) ; hide ( ) ; } } ) ; }

Target:
void onSave ( com.google.gwt.event.dom.client.ClickEvent e ) { save.setEnabled ( false ) ; com.google.gerrit.client.changes.ChangeApi.message ( changeId.get ( ) , revision , message.getText ( ) . trim ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwt.core.client.JavaScriptObject > ( ) { @ java.lang.Override public void onSuccess ( com.google.gwt.core.client.JavaScriptObject msg ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId ) ) ; hide ( ) ; } } ) ; }
Source:
public void queryChangesReviewer ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.api.changes.Changes.QueryRequest q = gApi.changes ( ) . query ( "owner:self" ) ; org.junit.Assert.assertEquals ( r.getChangeId ( ) , com.google.common.collect.Iterables.getOnlyElement ( q.get ( ) ) . changeId ) ; setAccountContext ( user ) ; org.junit.Assert.assertTrue ( q.get ( ) . isEmpty ( ) ) ; }

Target:
public void queryChangesOwnerWithDifferentUsers ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; org.junit.Assert.assertEquals ( r.getChangeId ( ) , com.google.common.collect.Iterables.getOnlyElement ( query ( "owner:self" ) ) . changeId ) ; setApiUser ( user ) ; org.junit.Assert.assertTrue ( query ( "owner:self" ) . isEmpty ( ) ) ; }
Source:
public final com.google.gerrit.client.changes.ChangeInfo.ApprovalInfo for_user ( int user ) { com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.ChangeInfo.ApprovalInfo > all = all ( ) ; for ( int i = 0 ; ( all != null ) && ( i < ( all.length ( ) ) ) ; i ++ ) { if ( ( all.get ( i ) . _accountId ( ) ) == user ) { return all.get ( i ) ; } } return null ; }

Target:
public final com.google.gerrit.client.changes.ChangeInfo.ApprovalInfo forUser ( int user ) { com.google.gwt.core.client.JsArray < com.google.gerrit.client.changes.ChangeInfo.ApprovalInfo > all = all ( ) ; for ( int i = 0 ; ( all != null ) && ( i < ( all.length ( ) ) ) ; i ++ ) { if ( ( all.get ( i ) . _accountId ( ) ) == user ) { return all.get ( i ) ; } } return null ; }
Source:
private void validateReviewer ( java.lang.String reviewer ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.reviewdb.client.Account account = accountResolver.find ( reviewer ) ; if ( account == null ) { try { groupsCollection.get ( ) . parse ( reviewer ) ; } catch ( com.google.gerrit.extensions.restapi.UnprocessableEntityException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ( ( "Account or group " + reviewer ) + " not found" ) ) ; } } } catch ( com.google.gwtorm.server.OrmException e ) { com.googlesource.gerrit.plugins.reviewers.PutReviewers.log.error ( ( "Failed to resolve account " + reviewer ) ) ; } }

Target:
private void validateReviewer ( java.lang.String reviewer ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.reviewdb.client.Account account = accountResolver.find ( reviewDbProvider.get ( ) , reviewer ) ; if ( account == null ) { try { groupsCollection.get ( ) . parse ( reviewer ) ; } catch ( com.google.gerrit.extensions.restapi.UnprocessableEntityException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( ( ( "Account or group " + reviewer ) + " not found" ) ) ; } } } catch ( com.google.gwtorm.server.OrmException e ) { com.googlesource.gerrit.plugins.reviewers.PutReviewers.log.error ( ( "Failed to resolve account " + reviewer ) ) ; } }
Source:
public static com.google.gerrit.client.diff.CommentRange create ( net.codemirror.lib.TextMarker.FromTo fromTo ) { if ( fromTo == null ) { return null ; } net.codemirror.lib.LineCharacter from = fromTo.getFrom ( ) ; net.codemirror.lib.LineCharacter to = fromTo.getTo ( ) ; return com.google.gerrit.client.diff.CommentRange.create ( ( ( from.getLine ( ) ) + 1 ) , from.getCh ( ) , ( ( to.getLine ( ) ) + 1 ) , to.getCh ( ) ) ; }

Target:
public static com.google.gerrit.client.diff.CommentRange create ( net.codemirror.lib.TextMarker.FromTo fromTo ) { if ( fromTo == null ) { return null ; } net.codemirror.lib.Pos from = fromTo.from ( ) ; net.codemirror.lib.Pos to = fromTo.to ( ) ; return com.google.gerrit.client.diff.CommentRange.create ( ( ( from.line ( ) ) + 1 ) , from.ch ( ) , ( ( to.line ( ) ) + 1 ) , to.ch ( ) ) ; }
Source:
public java.lang.String getPluginName ( java.io.File srcFile ) { java.lang.String srcFileName = srcFile.getName ( ) ; int endPos = srcFileName.lastIndexOf ( '-' ) ; if ( endPos == ( - 1 ) ) { endPos = srcFileName.lastIndexOf ( '.' ) ; } return srcFileName.substring ( 0 , endPos ) ; }

Target:
public java.lang.String getPluginName ( java.nio.file.Path srcFile ) { java.lang.String srcFileName = srcFile.getFileName ( ) . toString ( ) ; int endPos = srcFileName.lastIndexOf ( '-' ) ; if ( endPos == ( - 1 ) ) { endPos = srcFileName.lastIndexOf ( '.' ) ; } return srcFileName.substring ( 0 , endPos ) ; }
Source:
private void assertSubmitApproval ( com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.PatchSetApproval a = getSubmitter ( patchSetId ) ; com.google.common.truth.Truth.assertThat ( a.isSubmit ( ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( a.getValue ( ) ) . isEqualTo ( ( ( short ) ( 1 ) ) ) ; com.google.common.truth.Truth.assertThat ( a.getAccountId ( ) ) . isEqualTo ( admin.id ) ; }

Target:
private void assertSubmitApproval ( com.google.gerrit.reviewdb.client.PatchSet.Id patchSetId ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.PatchSetApproval a = getSubmitter ( patchSetId ) ; com.google.common.truth.Truth.assertThat ( a.isLegacySubmit ( ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( a.getValue ( ) ) . isEqualTo ( ( ( short ) ( 1 ) ) ) ; com.google.common.truth.Truth.assertThat ( a.getAccountId ( ) ) . isEqualTo ( admin.id ) ; }
Source:
public void run ( ) { java.lang.String b = ( ( base ) != null ) ? java.lang.String.valueOf ( base.get ( ) ) : null ; java.lang.String rev = java.lang.String.valueOf ( revision.get ( ) ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId , rev ) , new com.google.gerrit.client.change.ChangeScreen2 ( changeId , b , rev , openReplyBox ) ) ; }

Target:
private void goUpToChange ( boolean openReplyBox ) { java.lang.String b = ( ( base ) != null ) ? java.lang.String.valueOf ( base.get ( ) ) : null ; java.lang.String rev = java.lang.String.valueOf ( revision.get ( ) ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( changeId , rev ) , new com.google.gerrit.client.change.ChangeScreen2 ( changeId , b , rev , openReplyBox ) ) ; }
Source:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.lang.PrologException { engine.setB0 ( ) ; com.googlecode.prolog_cafe.lang.Term a1 = arg1.dereference ( ) ; com.google.gerrit.reviewdb.client.Change change = StoredValues.CHANGE_DATA.get ( engine ) . getChange ( ) ; com.google.gerrit.reviewdb.client.Account.Id ownerId = change.getOwner ( ) ; if ( ! ( a1.unify ( new com.googlecode.prolog_cafe.lang.StructureTerm ( gerrit.PRED_change_owner_1.user , new com.googlecode.prolog_cafe.lang.IntegerTerm ( ownerId.get ( ) ) ) , engine.trail ) ) ) { return engine.fail ( ) ; } return cont ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.lang.PrologException { engine.setB0 ( ) ; com.googlecode.prolog_cafe.lang.Term a1 = arg1.dereference ( ) ; com.google.gerrit.reviewdb.client.Account.Id ownerId = com.google.gerrit.rules.StoredValues.getChange ( engine ) . getOwner ( ) ; if ( ! ( a1.unify ( new com.googlecode.prolog_cafe.lang.StructureTerm ( gerrit.PRED_change_owner_1.user , new com.googlecode.prolog_cafe.lang.IntegerTerm ( ownerId.get ( ) ) ) , engine.trail ) ) ) { return engine.fail ( ) ; } return cont ; }
Source:
public void onKeyPress ( final com.google.gwt.event.dom.client.KeyPressEvent event ) { final com.google.gerrit.client.reviewdb.Change.Id ck = patchKey.getParentKey ( ) . getParentKey ( ) ; com.google.gerrit.client.Gerrit.display ( com.google.gerrit.client.Link.toChange ( ck ) , new com.google.gerrit.client.changes.ChangeScreen ( ck ) ) ; }

Target:
protected void createReplyEditor ( final com.google.gerrit.client.patches.LineCommentPanel currentPanel ) { final int row = rowOf ( currentPanel.getElement ( ) ) ; if ( row >= 0 ) { final int column = columnOf ( currentPanel.getElement ( ) ) ; final com.google.gerrit.client.reviewdb.PatchLineComment c = currentPanel.comment ; final com.google.gerrit.client.reviewdb.PatchLineComment.Key k = c.getKey ( ) ; createCommentEditor ( row , column , c.getLine ( ) , c.getSide ( ) , k.get ( ) ) ; } }
Source:
public void testGcAll ( ) throws java.lang.Exception { java.lang.String response = sshSession.exec ( "gerrit gc --all" ) ; org.junit.Assert.assertFalse ( sshSession.getError ( ) , sshSession.hasError ( ) ) ; assertNoError ( response ) ; gcAssert.assertHasPackFile ( allProjects , project , project2 , project3 ) ; }

Target:
public void testGcAll ( ) throws java.lang.Exception { java.lang.String response = sshSession.exec ( "gerrit gc --all" ) ; com.google.common.truth.Truth.assert_ ( ) . withFailureMessage ( sshSession.getError ( ) ) . that ( sshSession.hasError ( ) ) . isFalse ( ) ; assertNoError ( response ) ; gcAssert.assertHasPackFile ( allProjects , project , project2 , project3 ) ; }
Source:
public void abandonReviewableWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableWipChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; abandon ( sc.changeId , sc.owner ) ; assertThat ( sender ) . sent ( "abandon" , sc ) . notTo ( sc.owner ) . cc ( sc.reviewer , sc.ccer ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ABANDONED_CHANGES ) ; }

Target:
public void abandonWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; abandon ( sc.changeId , sc.owner ) ; assertThat ( sender ) . notSent ( ) ; }
Source:
HEAD ( ) { }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { new com.google.gerrit.plugin.client.rpc.RestApi ( "config" ) . id ( "server" ) . view ( com.google.gerrit.plugin.client.Plugin.get ( ) . getPluginName ( ) , "serviceusers" ) . id ( serviceUser ) . view ( "password.http" ) . delete ( new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.plugin.client.rpc.NoContent > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.plugin.client.rpc.NoContent noContent ) { label.setText ( "" ) ; label.setVisible ( false ) ; delete.setVisible ( false ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.account.EmailInfo result ) { box.hide ( ) ; if ( ( com.google.gerrit.client.Gerrit.getConfig ( ) . getAuthType ( ) ) == ( com.google.gerrit.reviewdb.client.AuthType.DEVELOPMENT_BECOME_ANY_ACCOUNT ) ) { currentEmail = addr ; if ( ( emailPick.getItemCount ( ) ) == 0 ) { final com.google.gerrit.reviewdb.client.Account me = com.google.gerrit.client.Gerrit.getUserAccount ( ) ; me.setPreferredEmail ( addr ) ; onSaveSuccess ( me ) ; } else { save.setEnabled ( true ) ; } updateEmailList ( ) ; } }

Target:
public void onSuccess ( com.google.gerrit.client.account.EmailInfo result ) { box.hide ( ) ; if ( com.google.gerrit.client.Gerrit.info ( ) . auth ( ) . isDev ( ) ) { currentEmail = addr ; if ( ( emailPick.getItemCount ( ) ) == 0 ) { final com.google.gerrit.reviewdb.client.Account me = com.google.gerrit.client.Gerrit.getUserAccount ( ) ; me.setPreferredEmail ( addr ) ; onSaveSuccess ( me ) ; } else { save.setEnabled ( true ) ; } updateEmailList ( ) ; } }
Source:
public static void rebase ( int id , java.lang.String commit , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > cb ) { com.google.gwt.core.client.JavaScriptObject in = com.google.gwt.core.client.JavaScriptObject.createObject ( ) ; com.google.gerrit.client.changes.ChangeApi.call ( id , commit , "rebase" ) . post ( in , cb ) ; }

Target:
public static void rebase ( int id , java.lang.String commit , java.lang.String base , com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.changes.ChangeInfo > cb ) { com.google.gerrit.client.changes.ChangeApi.RebaseInput rebaseInput = com.google.gerrit.client.changes.ChangeApi.RebaseInput.create ( ) ; rebaseInput.setBase ( base ) ; com.google.gerrit.client.changes.ChangeApi.call ( id , commit , "rebase" ) . post ( rebaseInput , cb ) ; }
Source:
protected void deny ( java.lang.String permission , com.google.gerrit.reviewdb.client.AccountGroup.UUID id , java.lang.String ref ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.server.project.Util.deny ( cfg , permission , id , ref ) ; saveProjectConfig ( project , cfg ) ; }

Target:
protected com.google.gerrit.common.data.PermissionRule block ( java.lang.String permission , com.google.gerrit.reviewdb.client.AccountGroup.UUID id , java.lang.String ref , com.google.gerrit.reviewdb.client.Project.NameKey project ) throws java.lang.Exception { com.google.gerrit.server.git.ProjectConfig cfg = projectCache.checkedGet ( project ) . getConfig ( ) ; com.google.gerrit.common.data.PermissionRule rule = com.google.gerrit.server.project.Util.block ( cfg , permission , id , ref ) ; saveProjectConfig ( project , cfg ) ; return rule ; }
Source:
protected void configure ( ) { bind ( com.google.gerrit.server.config.SitePaths.class ) . toInstance ( site ) ; factory ( ChangeData.Factory.class ) ; }

Target:
public void run ( ) throws java.io.IOException { ui.header ( "Index" ) ; com.google.gerrit.server.index.IndexModule.IndexType type = index.select ( "Type" , "type" , IndexType.LUCENE ) ; if ( ( site.isNew ) && ( type == ( com.google.gerrit.server.index.IndexModule.IndexType.LUCENE ) ) ) { com.google.gerrit.lucene.LuceneChangeIndex.setReady ( site , com.google.gerrit.server.index.ChangeSchemas.getLatest ( ) . getVersion ( ) , true ) ; } else { final java.lang.String message = java.lang.String.format ( ( "\nThe index must be %sbuilt before starting Gerrit:\n" + " java -jar gerrit.war reindex -d site_path\n" ) , ( site.isNew ? "" : "re" ) ) ; ui.message ( message ) ; initFlags.autoStart = false ; } }
Source:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.lang.PrologException { engine.setB0 ( ) ; com.googlecode.prolog_cafe.lang.Term a1 = arg1.dereference ( ) ; com.google.gerrit.reviewdb.client.Change change = StoredValues.CHANGE_DATA.get ( engine ) . getChange ( ) ; com.google.gerrit.reviewdb.client.Branch.NameKey name = change.getDest ( ) ; if ( ! ( a1.unify ( com.googlecode.prolog_cafe.lang.SymbolTerm.create ( name.get ( ) ) , engine.trail ) ) ) { return engine.fail ( ) ; } return cont ; }

Target:
public com.googlecode.prolog_cafe.lang.Operation exec ( com.googlecode.prolog_cafe.lang.Prolog engine ) throws com.googlecode.prolog_cafe.lang.PrologException { engine.setB0 ( ) ; com.googlecode.prolog_cafe.lang.Term a1 = arg1.dereference ( ) ; com.google.gerrit.reviewdb.client.Branch.NameKey name = com.google.gerrit.rules.StoredValues.getChange ( engine ) . getDest ( ) ; if ( ! ( a1.unify ( com.googlecode.prolog_cafe.lang.SymbolTerm.create ( name.get ( ) ) , engine.trail ) ) ) { return engine.fail ( ) ; } return cont ; }
Source:
private void printNode ( final com.google.gerrit.sshd.commands.TreeNode node , final int level , final boolean isLast ) { printIndention ( level ) ; stdout.print ( ( isLast ? com.google.gerrit.sshd.commands.TreeFormatter.LAST_NODE_PREFIX : com.google.gerrit.sshd.commands.TreeFormatter.NODE_PREFIX ) ) ; if ( node.isVisible ( ) ) { stdout.print ( node.getDisplayName ( ) ) ; } else { stdout.print ( com.google.gerrit.sshd.commands.TreeFormatter.NOT_VISIBLE_NODE ) ; } stdout.println ( ) ; }

Target:
private void printNode ( final com.google.gerrit.sshd.commands.TreeNode node , final int level , final boolean isLast ) { printIndention ( level ) ; stdout.print ( ( isLast ? com.google.gerrit.sshd.commands.TreeFormatter.LAST_NODE_PREFIX : com.google.gerrit.sshd.commands.TreeFormatter.NODE_PREFIX ) ) ; if ( node.isVisible ( ) ) { stdout.print ( node.getDisplayName ( ) ) ; } else { stdout.print ( com.google.gerrit.sshd.commands.TreeFormatter.NOT_VISIBLE_NODE ) ; } stdout.print ( "\n" ) ; }
Source:
public void testStop ( ) throws java.lang.Exception { syncEventsExecutorProvider.start ( ) ; com.google.common.truth.Truth.assertThat ( syncEventsExecutorProvider.get ( ) ) . isEqualTo ( executorMock ) ; syncEventsExecutorProvider.stop ( ) ; org.mockito.Mockito.verify ( executorMock ) . shutdown ( ) ; org.mockito.Mockito.verify ( executorMock ) . unregisterWorkQueue ( ) ; com.google.common.truth.Truth.assertThat ( syncEventsExecutorProvider.get ( ) ) . isNull ( ) ; }

Target:
public void testStop ( ) throws java.lang.Exception { eventsExecutorProvider.start ( ) ; com.google.common.truth.Truth.assertThat ( eventsExecutorProvider.get ( ) ) . isEqualTo ( executorMock ) ; eventsExecutorProvider.stop ( ) ; org.mockito.Mockito.verify ( executorMock ) . shutdown ( ) ; org.mockito.Mockito.verify ( executorMock ) . unregisterWorkQueue ( ) ; com.google.common.truth.Truth.assertThat ( eventsExecutorProvider.get ( ) ) . isNull ( ) ; }
Source:
public void run ( ) { try { future.get ( ) ; } catch ( java.lang.InterruptedException e ) { com.google.gerrit.pgm.Reindex.log.error ( ( "Failed to index change " + ( change.getId ( ) ) ) , e ) ; ok.set ( false ) ; } catch ( java.util.concurrent.ExecutionException e ) { com.google.gerrit.pgm.Reindex.log.error ( ( "Failed to index change " + ( change.getId ( ) ) ) , e ) ; ok.set ( false ) ; } finally { sem.release ( ) ; } }

Target:
private void fail ( com.google.gerrit.reviewdb.client.Change change , java.lang.Throwable t ) { com.google.gerrit.pgm.Reindex.log.error ( ( "Failed to index change " + ( change.getId ( ) ) ) , t ) ; ok.set ( false ) ; failed.update ( 1 ) ; }
Source:
private com.google.inject.Injector createWebInjector ( ) { final java.util.List < com.google.inject.Module > modules = new java.util.ArrayList < com.google.inject.Module > ( ) ; if ( sshd ) { modules.add ( sshInjector.getInstance ( com.google.inject.Module.class ) ) ; } 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 > ( ) ; if ( sshd ) { modules.add ( sshInjector.getInstance ( com.google.inject.Module.class ) ) ; } modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebModule.class ) ) ; modules.add ( sshInjector.getInstance ( com.google.gerrit.httpd.WebSshGlueModule.class ) ) ; return sysInjector.createChildInjector ( modules ) ; }
Source:
public com.google.gerrit.server.change.ChangeResource parse ( com.google.gerrit.reviewdb.client.Change.Id id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { return parse ( TopLevelResource.INSTANCE , com.google.gerrit.extensions.restapi.IdString.fromUrl ( java.lang.Integer.toString ( id.get ( ) ) ) ) ; }

Target:
public com.google.gerrit.server.change.ChangeResource parse ( com.google.gerrit.reviewdb.client.Change.Id id ) throws com.google.gerrit.extensions.restapi.ResourceNotFoundException , com.google.gwtorm.server.OrmException { try { com.google.gerrit.server.project.ChangeControl ctl = changeControlFactory.controlFor ( id , user.get ( ) ) ; if ( ! ( ctl.isVisible ( db.get ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( com.google.gerrit.server.change.ChangesCollection.toIdString ( id ) ) ; } return new com.google.gerrit.server.change.ChangeResource ( ctl ) ; } catch ( com.google.gerrit.server.project.NoSuchChangeException e ) { throw new com.google.gerrit.extensions.restapi.ResourceNotFoundException ( com.google.gerrit.server.change.ChangesCollection.toIdString ( id ) ) ; } }
Source:
public void initConfig ( com.google.gerrit.pgm.init.api.Section databaseSection ) { final java.lang.String defPort = "(mysql default)" ; databaseSection.string ( "Server hostname" , "hostname" , "localhost" ) ; databaseSection.string ( "Server port" , "port" , defPort , true ) ; databaseSection.string ( "Database name" , "database" , "reviewdb" ) ; databaseSection.string ( "Database username" , "username" , com.google.gerrit.pgm.init.InitUtil.username ( ) ) ; databaseSection.password ( "username" , "password" ) ; }

Target:
public void initConfig ( com.google.gerrit.pgm.init.api.Section databaseSection ) { final java.lang.String defPort = "(mysql default)" ; databaseSection.string ( "Server hostname" , "hostname" , "localhost" ) ; databaseSection.string ( "Server port" , "port" , defPort , true ) ; databaseSection.string ( "Database name" , "database" , "reviewdb" ) ; databaseSection.string ( "Database username" , "username" , com.google.gerrit.pgm.init.api.InitUtil.username ( ) ) ; databaseSection.password ( "username" , "password" ) ; }
Source:
private void limitThreads ( ) { org.eclipse.jgit.lib.Config cfg = dbInjector.getInstance ( com.google.inject.Key.get ( org.eclipse.jgit.lib.Config.class , com.google.gerrit.server.config.GerritServerConfig.class ) ) ; boolean usePool = cfg.getBoolean ( "database" , "connectionpool" , dbInjector.getInstance ( com.google.gerrit.server.schema.DataSourceType.class ) . usePool ( ) ) ; int poolLimit = cfg.getInt ( "database" , "poollimit" , DataSourceProvider.DEFAULT_POOL_LIMIT ) ; if ( usePool && ( ( threads ) > poolLimit ) ) { com.google.gerrit.pgm.Reindex.log.warn ( ( ( "Limiting reindexing to " + poolLimit ) + " threads due to database.poolLimit" ) ) ; threads = poolLimit ; } }

Target:
private boolean list ( ) { for ( com.google.gerrit.server.index.IndexDefinition < ? , ? , ? > def : indexDefs ) { java.lang.System.out.format ( "%s\n" , def.getName ( ) ) ; } return true ; }
Source:
boolean deleteFromIndex ( int changeId ) { try { com.ericsson.gerrit.plugins.syncindex.IndexResponseHandler.IndexResult result = httpSession.delete ( buildEndpoint ( changeId ) ) ; if ( result.isSuccessful ( ) ) { return true ; } com.ericsson.gerrit.plugins.syncindex.RestSession.log.error ( "Unable to delete from index change {}. Cause: {}" , changeId , result.getMessage ( ) ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.syncindex.RestSession.log.error ( ( "Error trying to delete from index change " + changeId ) , e ) ; } return false ; }

Target:
boolean deleteFromIndex ( int changeId ) { try { com.ericsson.gerrit.plugins.highavailability.IndexResponseHandler.IndexResult result = httpSession.delete ( buildEndpoint ( changeId ) ) ; if ( result.isSuccessful ( ) ) { return true ; } com.ericsson.gerrit.plugins.highavailability.RestSession.log.error ( "Unable to delete from index change {}. Cause: {}" , changeId , result.getMessage ( ) ) ; } catch ( java.io.IOException e ) { com.ericsson.gerrit.plugins.highavailability.RestSession.log.error ( ( "Error trying to delete from index change " + changeId ) , e ) ; } return false ; }
Source:
public void noRescheduleOnNonRecoverableException ( ) throws java.io.IOException { org.mockito.Mockito.when ( session.post ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.WEBHOOK_URL , com.googlesource.gerrit.plugins.webhooks.PostTaskTest.BODY ) ) . thenThrow ( javax.net.ssl.SSLException.class ) ; task.run ( ) ; org.mockito.Mockito.verifyZeroInteractions ( executor ) ; }

Target:
public void rescheduleOnRecoverableException ( ) throws java.io.IOException { org.mockito.Mockito.when ( session.post ( org.mockito.ArgumentMatchers.eq ( com.googlesource.gerrit.plugins.webhooks.PostTaskTest.WEBHOOK_URL ) , org.mockito.ArgumentMatchers.eq ( content ) ) ) . thenThrow ( java.io.IOException.class ) ; 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:
public void reviewNumber ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; gApi.changes ( ) . id ( r.getChangeId ( ) ) . revision ( 1 ) . review ( com.google.gerrit.acceptance.api.revision.RevisionIT.approve ( ) ) ; r = updateChange ( r , "new content" ) ; gApi.changes ( ) . id ( r.getChangeId ( ) ) . revision ( 2 ) . review ( com.google.gerrit.acceptance.api.revision.RevisionIT.approve ( ) ) ; }

Target:
public void reviewNumber ( ) throws com.google.gerrit.extensions.restapi.RestApiException , java.io.IOException , org.eclipse.jgit.api.errors.GitAPIException { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; gApi.changes ( ) . id ( r.getChangeId ( ) ) . revision ( 1 ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.approve ( ) ) ; r = updateChange ( r , "new content" ) ; gApi.changes ( ) . id ( r.getChangeId ( ) ) . revision ( 2 ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.approve ( ) ) ; }
Source:
public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo.IncludedInInfo r ) { branches.setInnerSafeHtml ( formatList ( r.branches ( ) ) ) ; tags.setInnerSafeHtml ( formatList ( r.tags ( ) ) ) ; loaded = true ; }

Target:
public void onSuccess ( com.google.gerrit.client.changes.ChangeInfo.IncludedInInfo r ) { branches.setInnerSafeHtml ( formatList ( r.branches ( ) ) ) ; tags.setInnerSafeHtml ( formatList ( r.tags ( ) ) ) ; for ( java.lang.String n : r.externalNames ( ) ) { com.google.gwt.core.client.JsArrayString external = r.external ( n ) ; if ( ( external.length ( ) ) > 0 ) { appendRow ( n , external ) ; } } loaded = true ; }
Source:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { showAddKeyBlock ( false ) ; }

Target:
public void onSuccess ( final com.google.gerrit.reviewdb.AccountSshKey result ) { addNew.setEnabled ( true ) ; addTxt.setText ( "" ) ; keys.addOneKey ( result ) ; if ( ! ( keys.isVisible ( ) ) ) { showAddKeyBlock ( false ) ; setKeyTableVisible ( true ) ; keys.updateDeleteButton ( ) ; } }
Source:
public java.lang.String getEncodedKey ( ) { final java.lang.String s = getSshPublicKey ( ) ; if ( ( s == null ) || ( ( s.length ( ) ) == 0 ) ) { return null ; } final java.lang.String [ ] parts = s.split ( " " ) ; if ( ( parts.length ) < 2 ) { return null ; } return parts [ 1 ] ; }

Target:
public java.lang.String getAlgorithm ( ) { return getPublicKeyPart ( 0 , "none" ) ; }