auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private com.google.gerrit.extensions.client.GeneralPreferencesInfo parse ( @ com.google.gerrit.common.Nullable com.google.gerrit.extensions.client.GeneralPreferencesInfo input ) { try { return com.google.gerrit.server.account.PreferencesConfig.parse ( cfg , defaultCfg , input ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException e ) { validationErrorSink.error ( new com.google.gerrit.server.git.ValidationError ( com.google.gerrit.server.account.PreferencesConfig.PREFERENCES_CONFIG , java.lang.String.format ( "Invalid general preferences for account %d: %s" , accountId.get ( ) , e.getMessage ( ) ) ) ) ; return new com.google.gerrit.extensions.client.GeneralPreferencesInfo ( ) ; } }

Target:
private com.google.gerrit.extensions.client.GeneralPreferencesInfo parseGeneralPreferences ( @ com.google.gerrit.common.Nullable com.google.gerrit.extensions.client.GeneralPreferencesInfo input ) { try { return com.google.gerrit.server.account.PreferencesConfig.parseGeneralPreferences ( cfg , defaultCfg , input ) ; } catch ( org.eclipse.jgit.errors.ConfigInvalidException e ) { validationErrorSink.error ( new com.google.gerrit.server.git.ValidationError ( com.google.gerrit.server.account.PreferencesConfig.PREFERENCES_CONFIG , java.lang.String.format ( "Invalid general preferences for account %d: %s" , accountId.get ( ) , e.getMessage ( ) ) ) ) ; return new com.google.gerrit.extensions.client.GeneralPreferencesInfo ( ) ; } }
Source:
void adjustGutters ( net.codemirror.lib.CodeMirror cmB ) { this . cmB = cmB ; com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { for ( com.google.gerrit.client.diff.SidePanel.GutterWrapper info : gutters ) { adjustGutter ( info ) ; } } } ) ; }

Target:
void adjustGutters ( net.codemirror.lib.CodeMirror cmB ) { this . cmB = cmB ; com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { for ( com.google.gerrit.client.diff.OverviewBar.GutterWrapper info : gutters ) { adjustGutter ( info ) ; } } } ) ; }
Source:
protected void onCellSingleClick ( int row , int column ) { super . onCellSingleClick ( row , column ) ; if ( ( column == 1 ) || ( column == 2 ) ) { if ( ! ( "" . equals ( table.getText ( row , column ) ) ) ) { onCellDoubleClick ( row , column ) ; } } }

Target:
protected void onCellSingleClick ( com.google.gwt.user.client.Event event , int row , int column ) { super . onCellSingleClick ( event , row , column ) ; if ( ( column == 1 ) || ( column == 2 ) ) { if ( ! ( "" . equals ( table.getText ( row , column ) ) ) ) { onCellDoubleClick ( row , column ) ; } } }
Source:
public void testAppend_CharSequence ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; assertSame ( b , b.append ( ( ( java.lang.CharSequence ) ( null ) ) ) ) ; assertEquals ( "" , b.asString ( ) ) ; assertSame ( b , b.append ( ( ( java.lang.CharSequence ) ( "foo" ) ) ) ) ; assertSame ( b , b.append ( ( ( java.lang.CharSequence ) ( "bar" ) ) ) ) ; assertEquals ( "foobar" , b.asString ( ) ) ; }

Target:
public void testAppend_SafeHtml ( ) { final com.google.gwtexpui.safehtml.client.SafeHtmlBuilder b = new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) ; org.junit.Assert.assertSame ( b , b.append ( ( ( com.google.gwtexpui.safehtml.client.SafeHtml ) ( null ) ) ) ) ; org.junit.Assert.assertEquals ( "" , b.asString ( ) ) ; org.junit.Assert.assertSame ( b , b.append ( new com.google.gwtexpui.safehtml.client.SafeHtmlString ( "foo" ) ) ) ; org.junit.Assert.assertSame ( b , b.append ( new com.google.gwtexpui.safehtml.client.SafeHtmlBuilder ( ) . append ( "bar" ) ) ) ; org.junit.Assert.assertEquals ( "foobar" , b.asString ( ) ) ; }
Source:
private static java.lang.String url ( com.google.gerrit.reviewdb.client.PatchSet.Id ps , com.google.gerrit.client.changes.CommentInfo info ) { com.google.gerrit.reviewdb.client.Change.Id c = ps.getParentKey ( ) ; return new java.lang.StringBuilder ( ) . append ( "/c/" ) . append ( c.get ( ) ) . append ( '/' ) . append ( ps.get ( ) ) . append ( '/' ) . append ( com.google.gwtorm.client.KeyUtil.encode ( info.path ( ) ) ) . append ( ",cm" ) . toString ( ) ; }

Target:
private static java.lang.String url ( com.google.gerrit.reviewdb.client.PatchSet.Id ps , com.google.gerrit.client.changes.CommentInfo info ) { return com.google.gerrit.client.Dispatcher.toSideBySide ( null , ps , info.path ( ) ) ; }
Source:
public void restoreReviewableChangeByAdminCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageAbandonedReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; restore ( sc.changeId , admin , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "restore" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer , admin ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) ; }

Target:
public void restoreReviewableChangeByAdminCcingSelf ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageAbandonedReviewableChange ( ) ; restore ( sc.changeId , admin , com.google.gerrit.extensions.client.GeneralPreferencesInfo.EmailStrategy.CC_ON_OWN_COMMENTS ) ; assertThat ( sender ) . sent ( "restore" , sc ) . to ( sc.owner ) . cc ( sc.reviewer , sc.ccer , admin ) . cc ( sc.reviewerByEmail , sc.ccerByEmail ) . bcc ( sc.starrer ) . bcc ( com.google.gerrit.server.account.WatchConfig.NotifyType.ALL_COMMENTS ) . noOneElse ( ) ; }
Source:
static org.eclipse.jgit.lib.Config parse ( com.google.gerrit.acceptance.GerritConfigs annotation ) { if ( annotation == null ) { return null ; } org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( ) ; for ( com.google.gerrit.acceptance.GerritConfig c : annotation.value ( ) ) { com.google.gerrit.acceptance.ConfigAnnotationParser.parse ( cfg , c ) ; } return cfg ; }

Target:
static org.eclipse.jgit.lib.Config parse ( org.eclipse.jgit.lib.Config base , com.google.gerrit.acceptance.GerritConfigs annotation ) { if ( annotation == null ) { return null ; } org.eclipse.jgit.lib.Config cfg = new org.eclipse.jgit.lib.Config ( base ) ; for ( com.google.gerrit.acceptance.GerritConfig c : annotation.value ( ) ) { com.google.gerrit.acceptance.ConfigAnnotationParser.parseAnnotation ( cfg , c ) ; } return cfg ; }
Source:
public boolean equals ( java.lang.Object o ) { if ( o instanceof com.google.gitiles.blame.BlameCacheImpl.Key ) { com.google.gitiles.blame.BlameCacheImpl.Key k = ( ( com.google.gitiles.blame.BlameCacheImpl.Key ) ( o ) ) ; return ( com.google.common.base.Objects.equal ( commitId , k.commitId ) ) && ( com.google.common.base.Objects.equal ( path , k.path ) ) ; } return false ; }

Target:
public boolean equals ( java.lang.Object o ) { if ( o instanceof com.google.gitiles.blame.BlameCacheImpl.Key ) { com.google.gitiles.blame.BlameCacheImpl.Key k = ( ( com.google.gitiles.blame.BlameCacheImpl.Key ) ( o ) ) ; return ( java.util.Objects.equals ( commitId , k.commitId ) ) && ( java.util.Objects.equals ( path , k.path ) ) ; } return false ; }
Source:
void resizeCodeMirror ( ) { int rest = ( ( ( com.google.gerrit.client.Gerrit.getHeaderFooterHeight ( ) ) + ( header.getOffsetHeight ( ) ) ) + ( diffTable.getHeaderHeight ( ) ) ) + 10 ; int h = ( com.google.gwt.user.client.Window.getClientHeight ( ) ) - rest ; cmA.setHeight ( h ) ; cmB.setHeight ( h ) ; cmA.refresh ( ) ; cmB.refresh ( ) ; diffTable.sidePanel.adjustGutters ( cmB ) ; }

Target:
void resizeCodeMirror ( ) { int rest = ( ( ( com.google.gerrit.client.Gerrit.getHeaderFooterHeight ( ) ) + ( header.getOffsetHeight ( ) ) ) + ( diffTable.getHeaderHeight ( ) ) ) + 5 ; int h = ( com.google.gwt.user.client.Window.getClientHeight ( ) ) - rest ; cmA.setHeight ( h ) ; cmB.setHeight ( h ) ; cmA.refresh ( ) ; cmB.refresh ( ) ; diffTable.sidePanel.adjustGutters ( cmB ) ; }
Source:
public com.google.gerrit.extensions.common.ChangeInfo apply ( com.google.gerrit.server.change.ChangeResource req , com.google.gerrit.extensions.api.changes.AbandonInput input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.project.ChangeControl control = req.getControl ( ) ; if ( ! ( control.canAbandon ( dbProvider.get ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "abandon not permitted" ) ; } com.google.gerrit.reviewdb.client.Change change = abandon ( control , input.message ) ; return json.create ( ChangeJson.NO_OPTIONS ) . format ( change ) ; }

Target:
public com.google.gerrit.extensions.common.ChangeInfo apply ( com.google.gerrit.server.change.ChangeResource req , com.google.gerrit.extensions.api.changes.AbandonInput input ) throws com.google.gerrit.extensions.restapi.RestApiException , com.google.gerrit.server.git.UpdateException , com.google.gwtorm.server.OrmException { com.google.gerrit.server.project.ChangeControl control = req.getControl ( ) ; if ( ! ( control.canAbandon ( dbProvider.get ( ) ) ) ) { throw new com.google.gerrit.extensions.restapi.AuthException ( "abandon not permitted" ) ; } com.google.gerrit.reviewdb.client.Change change = abandon ( control , input.message , input.notify ) ; return json.create ( ChangeJson.NO_OPTIONS ) . format ( change ) ; }
Source:
public UiAction.Description getDescription ( com.google.gerrit.server.project.ProjectResource rsrc ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Delete..." ) . setTitle ( ( isAllProjects ( rsrc ) ? java.lang.String.format ( "No deletion of %s project" , allProjectsName ) : java.lang.String.format ( "Delete project %s" , rsrc.getName ( ) ) ) ) . setEnabled ( ( ! ( isAllProjects ( rsrc ) ) ) ) ; }

Target:
public UiAction.Description getDescription ( com.google.gerrit.server.project.ProjectResource rsrc ) { return new com.google.gerrit.extensions.webui.UiAction.Description ( ) . setLabel ( "Delete..." ) . setTitle ( ( isAllProjects ( rsrc ) ? java.lang.String.format ( "No deletion of %s project" , allProjectsName ) : java.lang.String.format ( "Delete project %s" , rsrc.getName ( ) ) ) ) . setEnabled ( ( ! ( isAllProjects ( rsrc ) ) ) ) . setVisible ( canDelete ( rsrc ) ) ; }
Source:
public void onSuccess ( com.google.gwt.core.client.JavaScriptObject result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChange ( id ) ) ; }

Target:
public void onClick ( final com.google.gwt.event.dom.client.ClickEvent event ) { b.setEnabled ( false ) ; final com.google.gerrit.reviewdb.client.Change.Id id = patchSet.getId ( ) . getParentKey ( ) ; com.google.gerrit.client.changes.ChangeApi.publish ( id.get ( ) , patchSet.getRevision ( ) . get ( ) , com.google.gerrit.client.change.DraftActions.cs ( id ) ) ; }
Source:
private void populateCommentAction ( ) { final com.google.gwt.user.client.ui.Button b = new com.google.gwt.user.client.ui.Button ( Util.C.buttonPublishCommentsBegin ( ) ) ; b.addClickListener ( new com.google.gwt.user.client.ui.ClickListener ( ) { public void onClick ( com.google.gwt.user.client.ui.Widget sender ) { 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 populateCommentAction ( ) { final com.google.gwt.user.client.ui.Button b = new com.google.gwt.user.client.ui.Button ( Util.C.buttonPublishCommentsBegin ( ) ) ; 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 ) ; }
Source:
void stop ( ) { if ( ( manager ) != null ) { manager.stop ( ) ; manager = null ; sysInjector = null ; sshInjector = null ; httpInjector = null ; } }

Target:
void stop ( com.google.gerrit.server.plugins.PluginGuiceEnvironment env ) { if ( ( manager ) != null ) { com.google.gerrit.server.util.RequestContext oldContext = env.enter ( this ) ; try { manager.stop ( ) ; } finally { env.exit ( oldContext ) ; } manager = null ; sysInjector = null ; sshInjector = null ; httpInjector = null ; } }
Source:
public void createdOnIsPopulatedForGroupsCreatedAfterAudit ( ) throws java.lang.Exception { java.sql.Timestamp testStartTime = com.google.gerrit.common.TimeUtil.nowTs ( ) ; com.google.gerrit.reviewdb.client.AccountGroup.Id groupId = createGroup ( "Group for schema migration" ) ; setCreatedOnToVeryOldTimestamp ( groupId ) ; schema151.migrateData ( db , new com.google.gerrit.testutil.TestUpdateUI ( ) ) ; com.google.gerrit.reviewdb.client.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; com.google.common.truth.Truth.assertThat ( group.getCreatedOn ( ) ) . isAtLeast ( testStartTime ) ; }

Target:
public void createdOnIsPopulatedForGroupsCreatedBeforeAudit ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.AccountGroup.Id groupId = createGroup ( "Ancient group for schema migration" ) ; setCreatedOnToVeryOldTimestamp ( groupId ) ; removeAuditEntriesFor ( groupId ) ; schema151.migrateData ( db , new com.google.gerrit.testing.TestUpdateUI ( ) ) ; java.sql.Timestamp createdOn = getCreatedOn ( groupId ) ; com.google.common.truth.Truth.assertThat ( createdOn ) . isEqualTo ( com.google.gerrit.reviewdb.client.AccountGroup.auditCreationInstantTs ( ) ) ; }
Source:
void onSave ( com.google.gwt.event.dom.client.ClickEvent e ) { com.google.gerrit.client.changes.ChangeFileApi.putContent ( id , file.getText ( ) , content.getText ( ) , new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gerrit.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gerrit.client.VoidResult result ) { com.google.gerrit.client.Gerrit.display ( com.google.gerrit.common.PageLinks.toChangeInEditMode ( id.getParentKey ( ) ) ) ; hide ( ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { } } ) ; }

Target:
void onSave ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ClickEvent e ) { if ( Patch.COMMIT_MSG.equals ( file.getText ( ) ) ) { com.google.gerrit.client.changes.ChangeFileApi.putMessage ( id , content.getText ( ) , cb ) ; } else { com.google.gerrit.client.changes.ChangeFileApi.putContent ( id , file.getText ( ) , content.getText ( ) , cb ) ; } }
Source:
public void onSuccess ( final com.google.gerrit.common.data.HostPageData result ) { com.google.gerrit.client.Gerrit.myConfig = result.config ; com.google.gerrit.client.Gerrit.myTheme = result.theme ; if ( ( result.account ) != null ) { com.google.gerrit.client.Gerrit.myAccount = result.account ; } if ( ( result.accountDiffPref ) != null ) { com.google.gerrit.client.Gerrit.myAccountDiffPref = result.accountDiffPref ; } onModuleLoad2 ( ) ; }

Target:
public void onSuccess ( final com.google.gerrit.common.data.HostPageData result ) { com.google.gerrit.client.Gerrit.myConfig = result.config ; com.google.gerrit.client.Gerrit.myTheme = result.theme ; if ( ( result.account ) != null ) { com.google.gerrit.client.Gerrit.myAccount = result.account ; com.google.gerrit.client.Gerrit.xsrfToken = result.xsrfToken ; } if ( ( result.accountDiffPref ) != null ) { com.google.gerrit.client.Gerrit.myAccountDiffPref = result.accountDiffPref ; com.google.gerrit.client.Gerrit.applyUserPreferences ( ) ; } onModuleLoad2 ( ) ; }
Source:
protected void configureServlets ( ) { serve ( "/plugins/*" ) . with ( com.google.gerrit.httpd.plugins.HttpPluginServlet.class ) ; bind ( com.google.gerrit.server.plugins.StartPluginListener.class ) . annotatedWith ( com.google.inject.internal.UniqueAnnotations.create ( ) ) . to ( com.google.gerrit.httpd.plugins.HttpPluginServlet.class ) ; }

Target:
protected void configureServlets ( ) { bind ( com.google.gerrit.httpd.plugins.HttpPluginServlet.class ) ; serve ( "/plugins/*" ) . with ( com.google.gerrit.httpd.plugins.HttpPluginServlet.class ) ; bind ( com.google.gerrit.server.plugins.StartPluginListener.class ) . annotatedWith ( com.google.inject.internal.UniqueAnnotations.create ( ) ) . to ( com.google.gerrit.httpd.plugins.HttpPluginServlet.class ) ; bind ( com.google.gerrit.server.plugins.ReloadPluginListener.class ) . annotatedWith ( com.google.inject.internal.UniqueAnnotations.create ( ) ) . to ( com.google.gerrit.httpd.plugins.HttpPluginServlet.class ) ; }
Source:
public void testBulletList3 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.html ( "* line 1\n* 2nd line\n\nB" ) ; final com.google.gwtexpui.safehtml.client.SafeHtml n = o.wikify ( ) ; org.junit.Assert.assertNotSame ( o , n ) ; org.junit.Assert.assertEquals ( ( ( ( ( ( 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 ) ) + "<p>B</p>" ) , n.asString ( ) ) ; }

Target:
public void testBulletList3 ( ) { final com.google.gwtexpui.safehtml.client.SafeHtml o = com.google.gwtexpui.safehtml.client.SafeHtml_WikifyListTest.html ( "* line 1\n* 2nd line\n\nB" ) ; 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 ( ( ( ( ( ( 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 ) ) + "<p>B</p>" ) ) ; }
Source:
public void rejectMalformedEmail ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; exception.expect ( com.google.gerrit.extensions.restapi.UnprocessableEntityException.class ) ; exception.expectMessage ( "email invalid" ) ; gApi.changes ( ) . id ( r.getChangeId ( ) ) . addReviewer ( "Foo Bar <foo.bar@" ) ; }

Target:
public void rejectMalformedEmail ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isTrue ( ) ; com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; com.google.gerrit.extensions.api.changes.AddReviewerResult result = gApi.changes ( ) . id ( r.getChangeId ( ) ) . addReviewer ( "Foo Bar <foo.bar@" ) ; com.google.common.truth.Truth.assertThat ( result.error ) . isEqualTo ( "Foo Bar <foo.bar@ is not a valid user identifier" ) ; com.google.common.truth.Truth.assertThat ( result.reviewers ) . isNull ( ) ; }
Source:
private com.google.gerrit.reviewdb.client.Change newChange ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( project , changeOwner.getAccountId ( ) ) ; com.google.gerrit.server.notedb.ChangeUpdate u = newUpdate ( c , changeOwner ) ; u.setBranch ( c.getDest ( ) . get ( ) ) ; u.commit ( ) ; return c ; }

Target:
private com.google.gerrit.reviewdb.client.Change newChange ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( project , changeOwner.getAccountId ( ) ) ; com.google.gerrit.server.notedb.ChangeUpdate u = newUpdate ( c , changeOwner ) ; u.setChangeId ( c.getKey ( ) . get ( ) ) ; u.setBranch ( c.getDest ( ) . get ( ) ) ; u.commit ( ) ; return c ; }
Source:
public PerThreadRequestScope.Scoper provideScoper ( final com.google.gerrit.server.git.PerThreadRequestScope.Propagator propagator ) { final com.google.gerrit.server.util.RequestContext requestContext = new com.google.gerrit.server.util.RequestContext ( ) { @ java.lang.Override public com.google.gerrit.server.CurrentUser getCurrentUser ( ) { throw new com.google.inject.OutOfScopeException ( "No user on merge thread" ) ; } } ; return new com.google.gerrit.server.git.PerThreadRequestScope.Scoper ( ) { @ java.lang.Override public < T > java.util.concurrent.Callable < T > scope ( java.util.concurrent.Callable < T > callable ) { return propagator.scope ( requestContext , callable ) ; } } ; }

Target:
public com.google.inject.Provider < com.google.gerrit.reviewdb.server.ReviewDb > getReviewDbProvider ( ) { return dbProvider.get ( ) ; }
Source:
public void noCopyMaxScoreOnRework ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; revision ( r ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.approve ( ) ) ; assertApproval ( r , 2 ) ; r = ammendChange ( r.getChangeId ( ) ) ; assertApproval ( r , 0 ) ; }

Target:
public void noCopyMaxScoreOnRework ( ) throws java.lang.Exception { com.google.gerrit.acceptance.PushOneCommit.Result r = createChange ( ) ; revision ( r ) . review ( com.google.gerrit.extensions.api.changes.ReviewInput.approve ( ) ) ; assertApproval ( r , 2 ) ; r = amendChange ( r.getChangeId ( ) ) ; assertApproval ( r , 0 ) ; }
Source:
private void persistDiffPreferences ( ) { setEnabled ( false ) ; Util.ACCOUNT_SVC.changeDiffPreferences ( getValue ( ) , new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gwtjsonrpc.client.VoidResult result ) { com.google.gerrit.client.Gerrit.setAccountDiffPreference ( getValue ( ) ) ; setEnabled ( true ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { setEnabled ( true ) ; } } ) ; }

Target:
private void persistDiffPreferences ( ) { setEnabled ( false ) ; listenablePrefs.save ( new com.google.gerrit.client.rpc.GerritCallback < com.google.gwtjsonrpc.client.VoidResult > ( ) { @ java.lang.Override public void onSuccess ( com.google.gwtjsonrpc.client.VoidResult result ) { setEnabled ( true ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { setEnabled ( true ) ; } } ) ; }
Source:
public void setAssigneeOnReviewableWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableWipChange ( ) ; assign ( sc , sc.owner , assignee ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . notTo ( sc.owner , sc.reviewer , sc.ccer , sc.starrer ) . to ( sc.reviewerByEmail ) . cc ( sc.ccerByEmail ) . to ( assignee ) ; }

Target:
public void setAssigneeOnWipChange ( ) throws java.lang.Exception { com.google.gerrit.acceptance.server.mail.StagedChange sc = stageWipChange ( ) ; assign ( sc , sc.owner , sc.assignee ) ; assertThat ( sender ) . sent ( "setassignee" , sc ) . notTo ( sc.owner , sc.reviewer , sc.ccer , sc.starrer ) . to ( sc.reviewerByEmail ) . cc ( sc.ccerByEmail ) . to ( sc.assignee ) ; }
Source:
public void missingRepo ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( new com.google.gerrit.reviewdb.client.Project.NameKey ( "otherproject" ) , userId ) ; db.changes ( ) . insert ( java.util.Collections.singleton ( c ) ) ; insertMissingPatchSet ( c , "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) ; assertProblems ( c , "Destination repository not found: otherproject" ) ; }

Target:
public void missingRepo ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = com.google.gerrit.testutil.TestChanges.newChange ( new com.google.gerrit.reviewdb.client.Project.NameKey ( "otherproject" ) , adminId ) ; db.changes ( ) . insert ( java.util.Collections.singleton ( c ) ) ; insertMissingPatchSet ( c , "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef" ) ; assertProblems ( c , "Destination repository not found: otherproject" ) ; }
Source:
protected void onInitUI ( ) { super . onInitUI ( ) ; saveProject = new com.google.gwt.user.client.ui.Button ( Util.C.buttonSaveChanges ( ) ) ; saveProject.addClickHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { doSave ( ) ; } } ) ; initDescription ( ) ; initSubmitType ( ) ; initAgreements ( ) ; add ( saveProject ) ; }

Target:
protected void onInitUI ( ) { super . onInitUI ( ) ; saveProject = new com.google.gwt.user.client.ui.Button ( Util.C.buttonSaveChanges ( ) ) ; saveProject.addClickHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { doSave ( ) ; } } ) ; initDescription ( ) ; initProjectOptions ( ) ; initAgreements ( ) ; add ( saveProject ) ; }
Source:
public void isRefsUsers ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( com.google.gerrit.reviewdb.client.RefNames.isRefsUsers ( "refs/users/23/1011123" ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.reviewdb.client.RefNames.isRefsUsers ( "refs/users/default" ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.reviewdb.client.RefNames.isRefsUsers ( "refs/users/23/1011123/edit-67473/42" ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.reviewdb.client.RefNames.isRefsUsers ( "refs/heads/master" ) ) . isFalse ( ) ; }

Target:
public void isRefsUsers ( ) throws java.lang.Exception { com.google.common.truth.Truth.assertThat ( com.google.gerrit.reviewdb.client.RefNames.isRefsUsers ( "refs/users/23/1011123" ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.reviewdb.client.RefNames.isRefsUsers ( "refs/users/default" ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.reviewdb.client.RefNames.isRefsUsers ( "refs/users/23/1011123/edit-67473/42" ) ) . isTrue ( ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.reviewdb.client.RefNames.isRefsUsers ( "refs/heads/master" ) ) . isFalse ( ) ; com.google.common.truth.Truth.assertThat ( com.google.gerrit.reviewdb.client.RefNames.isRefsUsers ( ( "refs/groups/" + ( com.google.gerrit.reviewdb.client.RefNamesTest.TEST_SHARDED_GROUP_UUID ) ) ) ) . isFalse ( ) ; }
Source:
public void cleanUp ( ) throws java.lang.Exception { try ( org.eclipse.jgit.lib.Repository git = repoManager.openRepository ( allUsers ) ) { if ( ( git.exactRef ( RefNames.REFS_USERS_DEFAULT ) ) != null ) { org.eclipse.jgit.lib.RefUpdate u = git.updateRef ( RefNames.REFS_USERS_DEFAULT ) ; u.setForceUpdate ( true ) ; com.google.common.truth.Truth.assertThat ( u.delete ( ) ) . isEqualTo ( RefUpdate.Result.FORCED ) ; } } accountCache.evictAll ( ) ; }

Target:
public void cleanUp ( ) throws java.lang.Exception { try ( org.eclipse.jgit.lib.Repository git = repoManager.openRepository ( allUsers ) ) { if ( ( git.exactRef ( RefNames.REFS_USERS_DEFAULT ) ) != null ) { org.eclipse.jgit.lib.RefUpdate u = git.updateRef ( RefNames.REFS_USERS_DEFAULT ) ; u.setForceUpdate ( true ) ; com.google.common.truth.Truth.assertThat ( u.delete ( ) ) . isEqualTo ( RefUpdate.Result.FORCED ) ; } } accountCache.evictAllNoReindex ( ) ; }
Source:
public void createdOnIsPopulatedForGroupsCreatedBeforeAudit ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.AccountGroup.Id groupId = createGroup ( "Ancient group for schema migration" ) ; setCreatedOnToVeryOldTimestamp ( groupId ) ; removeAuditEntriesFor ( groupId ) ; schema151.migrateData ( db , new com.google.gerrit.testutil.TestUpdateUI ( ) ) ; com.google.gerrit.reviewdb.client.AccountGroup group = db.accountGroups ( ) . get ( groupId ) ; com.google.common.truth.Truth.assertThat ( group.getCreatedOn ( ) ) . isEqualTo ( com.google.gerrit.reviewdb.client.AccountGroup.auditCreationInstantTs ( ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { testEnv.getInjector ( ) . injectMembers ( this ) ; db = testEnv.getDb ( ) ; com.google.common.truth.TruthJUnit.assume ( ) . that ( ( ( db ) instanceof com.google.gwtorm.jdbc.JdbcSchema ) ) . isTrue ( ) ; connection = ( ( com.google.gwtorm.jdbc.JdbcSchema ) ( db ) ) . getConnection ( ) ; createdOnRetrieval = connection.prepareStatement ( "SELECT created_on FROM account_groups WHERE group_id = ?" ) ; createdOnUpdate = connection.prepareStatement ( "UPDATE account_groups SET created_on = ? WHERE group_id = ?" ) ; auditEntryDeletion = connection.prepareStatement ( "DELETE FROM account_group_members_audit WHERE group_id = ?" ) ; }
Source:
void display ( java.util.List < java.util.List < java.lang.String > > values ) { for ( int row = 2 ; row < ( table.getRowCount ( ) ) ; row ++ ) { table.removeRow ( ( row -- ) ) ; } int row = 2 ; for ( java.util.List < java.lang.String > v : values ) { populate ( row , v , ( row == ( ( values.size ( ) ) + 1 ) ) ) ; row ++ ; } }

Target:
void display ( java.util.List < java.util.List < java.lang.String > > values ) { for ( int row = 2 ; row < ( table.getRowCount ( ) ) ; row ++ ) { table.removeRow ( ( row -- ) ) ; } int row = 2 ; for ( java.util.List < java.lang.String > v : values ) { populate ( row , v ) ; row ++ ; } updateNavigationLinks ( ) ; }
Source:
private void registerCmEvents ( final net.codemirror.lib.CodeMirror cm ) { cm.on ( "beforeSelectionChange" , onSelectionChange ( cm ) ) ; cm.on ( "cursorActivity" , updateActiveLine ( cm ) ) ; cm.on ( "gutterClick" , onGutterClick ( cm ) ) ; cm.on ( "focus" , updateActiveLine ( cm ) ) ; }

Target:
public void run ( ) { net.codemirror.lib.CodeMirror.handleVimKey ( cm , "<C-u>" ) ; }
Source:
public void invalidInputs ( ) { java.util.List < com.google.gerrit.extensions.api.config.AccessCheckInput > inputs = com.google.common.collect.ImmutableList.of ( new com.google.gerrit.extensions.api.config.AccessCheckInput ( ) , new com.google.gerrit.extensions.api.config.AccessCheckInput ( user.email , null , null ) , new com.google.gerrit.extensions.api.config.AccessCheckInput ( null , normalProject.toString ( ) , null ) , new com.google.gerrit.extensions.api.config.AccessCheckInput ( "doesnotexist@invalid.com" , normalProject.toString ( ) , null ) ) ; for ( com.google.gerrit.extensions.api.config.AccessCheckInput input : inputs ) { try { gApi.config ( ) . server ( ) . checkAccess ( input ) ; org.junit.Assert.fail ( java.lang.String.format ( "want RestApiException for %s" , newGson ( ) . toJson ( input ) ) ) ; } catch ( com.google.gerrit.extensions.restapi.RestApiException e ) { } } }

Target:
public void emptyInput ( ) throws java.lang.Exception { exception.expect ( com.google.gerrit.extensions.restapi.BadRequestException.class ) ; exception.expectMessage ( "input requires 'account'" ) ; gApi.projects ( ) . name ( normalProject.get ( ) ) . checkAccess ( new com.google.gerrit.extensions.api.config.AccessCheckInput ( ) ) ; }
Source:
private java.util.List < com.google.gerrit.extensions.common.AccountInfo > query ( com.google.gerrit.server.api.accounts.QueryRequest r ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.account.QueryAccounts myQueryAccounts = queryAccountsProvider.get ( ) ; myQueryAccounts.setQuery ( r.getQuery ( ) ) ; myQueryAccounts.setLimit ( r.getLimit ( ) ) ; return myQueryAccounts.apply ( TopLevelResource.INSTANCE ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve suggested accounts" , e ) ; } }

Target:
private java.util.List < com.google.gerrit.extensions.common.AccountInfo > query ( com.google.gerrit.server.api.accounts.QueryRequest r ) throws com.google.gerrit.extensions.restapi.RestApiException { try { com.google.gerrit.server.account.QueryAccounts myQueryAccounts = queryAccountsProvider.get ( ) ; myQueryAccounts.setQuery ( r.getQuery ( ) ) ; myQueryAccounts.setLimit ( r.getLimit ( ) ) ; myQueryAccounts.setStart ( r.getStart ( ) ) ; return myQueryAccounts.apply ( TopLevelResource.INSTANCE ) ; } catch ( com.google.gwtorm.server.OrmException e ) { throw new com.google.gerrit.extensions.restapi.RestApiException ( "Cannot retrieve suggested accounts" , e ) ; } }
Source:
public static boolean isPermission ( java.lang.String varName ) { java.lang.String lc = varName.toLowerCase ( ) ; if ( lc.startsWith ( com.google.gerrit.common.data.Permission.LABEL ) ) { return ( com.google.gerrit.common.data.Permission.LABEL.length ( ) ) < ( lc.length ( ) ) ; } return com.google.gerrit.common.data.Permission.NAMES_LC.contains ( lc ) ; }

Target:
public static boolean isPermission ( java.lang.String varName ) { return ( ( com.google.gerrit.common.data.Permission.isLabel ( varName ) ) || ( com.google.gerrit.common.data.Permission.isLabelAs ( varName ) ) ) || ( com.google.gerrit.common.data.Permission.NAMES_LC.contains ( varName.toLowerCase ( ) ) ) ; }
Source:
public void patchSetRefMissing ( ) throws java.lang.Exception { com.google.gerrit.reviewdb.client.Change c = insertChange ( ) ; com.google.gerrit.reviewdb.client.PatchSet ps = insertPatchSet ( c ) ; java.lang.String refName = ps.getId ( ) . toRefName ( ) ; testRepo.update ( "refs/other/foo" , org.eclipse.jgit.lib.ObjectId.fromString ( ps.getRevision ( ) . get ( ) ) ) ; deleteRef ( refName ) ; assertProblems ( c , ( "Ref missing: " + refName ) ) ; }

Target:
public void patchSetObjectAndRefMissingWithFix ( ) 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 ) ; java.lang.String refName = ps.getId ( ) . toRefName ( ) ; assertProblems ( ctl , 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 static synchronized void stopSshd ( ) { if ( ( com.google.gerrit.server.ssh.GerritSshDaemon.sshd ) != null ) { try { com.google.gerrit.server.ssh.GerritSshDaemon.sshd.stop ( ) ; com.google.gerrit.server.ssh.GerritSshDaemon.log.info ( ( "Stopped Gerrit SSHD on 0.0.0.0:" + ( com.google.gerrit.server.ssh.GerritSshDaemon.sshd.getPort ( ) ) ) ) ; } finally { com.google.gerrit.server.ssh.GerritSshDaemon.sshd = null ; } } }

Target:
public static synchronized void stopSshd ( ) { if ( ( com.google.gerrit.server.ssh.GerritSshDaemon.sshd ) != null ) { try { com.google.gerrit.server.ssh.GerritSshDaemon.sshd.stop ( ) ; com.google.gerrit.server.ssh.GerritSshDaemon.log.info ( ( "Stopped Gerrit SSHD on 0.0.0.0:" + ( com.google.gerrit.server.ssh.GerritSshDaemon.sshd.getPort ( ) ) ) ) ; } finally { com.google.gerrit.server.ssh.GerritSshDaemon.sshd = null ; com.google.gerrit.server.ssh.GerritSshDaemon.hostKeys = java.util.Collections.emptyList ( ) ; } } }
Source:
java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > toFileInfoMap ( com.google.gerrit.reviewdb.client.Change change , org.eclipse.jgit.lib.ObjectId objectId , @ com.google.gerrit.common.Nullable com.google.gerrit.reviewdb.client.PatchSet base ) throws com.google.gerrit.server.patch.PatchListNotAvailableException { org.eclipse.jgit.lib.ObjectId a = ( base == null ) ? null : org.eclipse.jgit.lib.ObjectId.fromString ( base.getRevision ( ) . get ( ) ) ; return toFileInfoMap ( change , com.google.gerrit.server.patch.PatchListKey.againstCommit ( a , objectId , Whitespace.IGNORE_NONE ) ) ; }

Target:
java.util.Map < java.lang.String , com.google.gerrit.extensions.common.FileInfo > toFileInfoMap ( com.google.gerrit.reviewdb.client.Change change , org.eclipse.jgit.lib.ObjectId objectId , @ com.google.gerrit.common.Nullable com.google.gerrit.reviewdb.client.PatchSet base ) throws com.google.gerrit.server.diff.PatchListNotAvailableException { org.eclipse.jgit.lib.ObjectId a = ( base == null ) ? null : org.eclipse.jgit.lib.ObjectId.fromString ( base.getRevision ( ) . get ( ) ) ; return toFileInfoMap ( change , com.google.gerrit.server.diff.PatchListKey.againstCommit ( a , objectId , Whitespace.IGNORE_NONE ) ) ; }
Source:
private final void deleteFromPatchSets ( final com.google.gwtorm.server.ResultSet < com.google.gerrit.reviewdb.client.PatchSet > patchSets ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.reviewdb.client.PatchSet patchSet : patchSets ) { db.accountPatchReviews ( ) . delete ( db.accountPatchReviews ( ) . byPatchSet ( patchSet.getId ( ) ) ) ; db.patchSets ( ) . delete ( java.util.Collections.singleton ( patchSet ) ) ; } }

Target:
private final void deleteFromPatchSets ( final com.google.gwtorm.server.ResultSet < com.google.gerrit.reviewdb.client.PatchSet > patchSets ) throws com.google.gwtorm.server.OrmException { for ( com.google.gerrit.reviewdb.client.PatchSet patchSet : patchSets ) { accountPatchReviewStore.get ( ) . clearReviewed ( patchSet.getId ( ) ) ; db.patchSets ( ) . delete ( java.util.Collections.singleton ( patchSet ) ) ; } }
Source:
private synchronized void runHook ( com.google.gerrit.reviewdb.client.Project.NameKey project , java.io.File hook , java.util.List < java.lang.String > args ) { if ( ( project != null ) && ( hook.exists ( ) ) ) { hookQueue.execute ( new com.google.gerrit.common.ChangeHookRunner.AsyncHookTask ( project , hook , args ) ) ; } }

Target:
private synchronized void runHook ( com.google.common.base.Optional < java.nio.file.Path > hook , java.util.List < java.lang.String > args ) { if ( hook.isPresent ( ) ) { hookQueue.execute ( new com.google.gerrit.common.ChangeHookRunner.AsyncHookTask ( null , hook.get ( ) , args ) ) ; } }
Source:
public void display ( com.google.gerrit.common.data.PatchSetDetail detail ) { this . detail = detail ; this . patchList = detail.getPatches ( ) ; myTable = null ; final com.google.gerrit.client.changes.PatchTable.DisplayCommand cmd = new com.google.gerrit.client.changes.PatchTable.DisplayCommand ( patchList ) ; if ( cmd.execute ( ) ) { cmd.initMeter ( ) ; com.google.gwt.user.client.DeferredCommand.addCommand ( cmd ) ; } else { cmd.showTable ( ) ; } }

Target:
public void display ( com.google.gerrit.common.data.PatchSetDetail detail ) { this . detail = detail ; this . patchList = detail.getPatches ( ) ; myTable = null ; final com.google.gerrit.client.changes.PatchTable.DisplayCommand cmd = new com.google.gerrit.client.changes.PatchTable.DisplayCommand ( patchList ) ; if ( cmd.execute ( ) ) { cmd.initMeter ( ) ; com.google.gwt.core.client.Scheduler.get ( ) . scheduleIncremental ( cmd ) ; } else { cmd.showTable ( ) ; } }
Source:
private java.util.List < org.kohsuke.github.GHRepository > getRepositories ( com.googlesource.gerrit.plugins.github.oauth.GitHubLogin hubLogin , java.lang.String organisation ) throws java.io.IOException { if ( organisation.equals ( hubLogin.getMyself ( ) . getLogin ( ) ) ) { return hubLogin.getMyself ( ) . listRepositories ( ) . asList ( ) ; } else { org.kohsuke.github.GHOrganization ghOrganisation = hubLogin.getMyself ( ) . getOrganizations ( ) . byLogin ( organisation ) ; return ghOrganisation.listRepositories ( ) . asList ( ) ; } }

Target:
private java.util.List < org.kohsuke.github.GHRepository > getRepositories ( com.googlesource.gerrit.plugins.github.oauth.GitHubLogin hubLogin , java.lang.String organisation ) throws java.io.IOException { if ( organisation.equals ( hubLogin.getMyself ( ) . getLogin ( ) ) ) { return hubLogin.getMyself ( ) . listRepositories ( com.googlesource.gerrit.plugins.github.wizard.RepositoriesListController.PAGE_SIZE ) . asList ( ) ; } else { org.kohsuke.github.GHOrganization ghOrganisation = hubLogin.getMyself ( ) . getOrganizations ( ) . byLogin ( organisation ) ; return ghOrganisation.listRepositories ( com.googlesource.gerrit.plugins.github.wizard.RepositoriesListController.PAGE_SIZE ) . asList ( ) ; } }
Source:
public void onSuccess ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.change.ReviewerSuggestOracle.SuggestReviewerInfo > result ) { java.util.List < com.google.gerrit.client.change.ReviewerSuggestOracle.RestReviewerSuggestion > r = new java.util.ArrayList ( result.length ( ) ) ; for ( com.google.gerrit.client.change.ReviewerSuggestOracle.SuggestReviewerInfo reviewer : com.google.gerrit.client.rpc.Natives.asList ( result ) ) { r.add ( new com.google.gerrit.client.change.ReviewerSuggestOracle.RestReviewerSuggestion ( reviewer ) ) ; } cb.onSuggestionsReady ( req , new com.google.gerrit.client.change.Response ( r ) ) ; }

Target:
public void onSuccess ( com.google.gwt.core.client.JsArray < com.google.gerrit.client.change.ReviewerSuggestOracle.SuggestReviewerInfo > result ) { java.util.List < com.google.gerrit.client.change.ReviewerSuggestOracle.RestReviewerSuggestion > r = new java.util.ArrayList ( result.length ( ) ) ; for ( com.google.gerrit.client.change.ReviewerSuggestOracle.SuggestReviewerInfo reviewer : com.google.gerrit.client.rpc.Natives.asList ( result ) ) { r.add ( new com.google.gerrit.client.change.ReviewerSuggestOracle.RestReviewerSuggestion ( reviewer , req.getQuery ( ) ) ) ; } cb.onSuggestionsReady ( req , new com.google.gerrit.client.change.Response ( r ) ) ; }
Source:
private static org.bouncycastle.openpgp.PGPPublicKeyRingCollection readPubRing ( final java.io.File pub ) { try ( java.io.InputStream fin = new java.io.FileInputStream ( pub ) ; java.io.InputStream in = org.bouncycastle.openpgp.PGPUtil.getDecoderStream ( fin ) ) { return new org.bouncycastle.openpgp.PGPPublicKeyRingCollection ( in ) ; } catch ( java.io.IOException | org.bouncycastle.openpgp.PGPException e ) { throw new com.google.inject.ProvisionException ( ( "Cannot read " + pub ) , e ) ; } }

Target:
private static org.bouncycastle.openpgp.PGPPublicKeyRingCollection readPubRing ( java.nio.file.Path pub ) { try ( java.io.InputStream fin = java.nio.file.Files.newInputStream ( pub ) ; java.io.InputStream in = org.bouncycastle.openpgp.PGPUtil.getDecoderStream ( fin ) ) { return new org.bouncycastle.openpgp.PGPPublicKeyRingCollection ( in ) ; } catch ( java.io.IOException | org.bouncycastle.openpgp.PGPException e ) { throw new com.google.inject.ProvisionException ( ( "Cannot read " + pub ) , e ) ; } }
Source:
com.google.gerrit.reviewdb.Patch toPatch ( final com.google.gerrit.reviewdb.PatchSet.Id setId ) { final com.google.gerrit.reviewdb.Patch p = new com.google.gerrit.reviewdb.Patch ( new com.google.gerrit.reviewdb.Patch.Key ( setId , getNewName ( ) ) ) ; p.setChangeType ( getChangeType ( ) ) ; p.setPatchType ( getPatchType ( ) ) ; p.setSourceFileName ( getOldName ( ) ) ; return p ; }

Target:
com.google.gerrit.reviewdb.Patch toPatch ( final com.google.gerrit.reviewdb.PatchSet.Id setId ) { final com.google.gerrit.reviewdb.Patch p = new com.google.gerrit.reviewdb.Patch ( new com.google.gerrit.reviewdb.Patch.Key ( setId , getNewName ( ) ) ) ; p.setChangeType ( getChangeType ( ) ) ; p.setPatchType ( getPatchType ( ) ) ; p.setSourceFileName ( getOldName ( ) ) ; p.setInsertions ( insertions ) ; p.setDeletions ( deletions ) ; return p ; }
Source:
public void newPatchSetByOtherOnReviewableChangeNotifyOwnerReviewersInReviewDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; pushTo ( sc , "refs/for/master%notify=OWNER_REVIEWERS" , other ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . to ( sc.reviewer , sc.ccer ) . notTo ( sc.starrer , other ) . notTo ( sc.owner ) . notTo ( sc.reviewerByEmail , sc.ccerByEmail ) . notTo ( com.google.gerrit.server.account.WatchConfig.NotifyType.NEW_PATCHSETS ) ; }

Target:
public void newPatchSetByOtherOnReviewableChangeNotifyOwnerReviewersInReviewDb ( ) throws java.lang.Exception { com.google.common.truth.TruthJUnit.assume ( ) . that ( notesMigration.readChanges ( ) ) . isFalse ( ) ; com.google.gerrit.acceptance.server.mail.StagedChange sc = stageReviewableChange ( ) ; pushTo ( sc , "refs/for/master%notify=OWNER_REVIEWERS" , other ) ; assertThat ( sender ) . sent ( "newpatchset" , sc ) . to ( sc.reviewer , sc.ccer ) . noOneElse ( ) ; }
Source:
public void insert ( byte [ ] key , final byte [ ] newData ) throws com.google.gwtorm.client.OrmDuplicateKeyException , com.google.gwtorm.client.OrmException { try { atomicUpdate ( key , new com.google.gwtorm.client.AtomicUpdate < byte [ ] > ( ) { @ java.lang.Override public byte [ ] update ( byte [ ] oldData ) { if ( oldData != null ) { throw new com.google.gwtorm.nosql.generic.GenericSchema.KeyExists ( ) ; } return newData ; } } ) ; } catch ( com.google.gwtorm.nosql.generic.GenericSchema.KeyExists err ) { throw new com.google.gwtorm.client.OrmDuplicateKeyException ( "Duplicate key" ) ; } }

Target:
public void insert ( byte [ ] key , final byte [ ] newData ) throws com.google.gwtorm.server.OrmDuplicateKeyException , com.google.gwtorm.server.OrmException { try { atomicUpdate ( key , new com.google.gwtorm.server.AtomicUpdate < byte [ ] > ( ) { @ java.lang.Override public byte [ ] update ( byte [ ] oldData ) { if ( oldData != null ) { throw new com.google.gwtorm.nosql.generic.GenericSchema.KeyExists ( ) ; } return newData ; } } ) ; } catch ( com.google.gwtorm.nosql.generic.GenericSchema.KeyExists err ) { throw new com.google.gwtorm.server.OrmDuplicateKeyException ( "Duplicate key" ) ; } }
Source:
private void assertProblems ( com.google.gerrit.server.project.ChangeControl ctl , @ com.google.gerrit.common.Nullable com.google.gerrit.extensions.api.changes.FixInput fix , com.google.gerrit.extensions.common.ProblemInfo first , com.google.gerrit.extensions.common.ProblemInfo ... rest ) { java.util.List < com.google.gerrit.extensions.common.ProblemInfo > expected = new java.util.ArrayList ( ( 1 + ( rest.length ) ) ) ; expected.add ( first ) ; expected.addAll ( java.util.Arrays.asList ( rest ) ) ; com.google.common.truth.Truth.assertThat ( checker.check ( ctl , fix ) . problems ( ) ) . containsExactlyElementsIn ( expected ) . inOrder ( ) ; }

Target:
private void assertProblems ( com.google.gerrit.server.notedb.ChangeNotes notes , @ com.google.gerrit.common.Nullable com.google.gerrit.extensions.api.changes.FixInput fix , com.google.gerrit.extensions.common.ProblemInfo first , com.google.gerrit.extensions.common.ProblemInfo ... rest ) throws java.lang.Exception { java.util.List < com.google.gerrit.extensions.common.ProblemInfo > expected = new java.util.ArrayList ( ( 1 + ( rest.length ) ) ) ; expected.add ( first ) ; expected.addAll ( java.util.Arrays.asList ( rest ) ) ; com.google.common.truth.Truth.assertThat ( checker.check ( controlForNotes ( notes ) , fix ) . problems ( ) ) . containsExactlyElementsIn ( expected ) . inOrder ( ) ; }
Source:
void onEditMode ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ClickEvent e ) { fileTableMode = FileTable.Mode.EDIT ; refreshFileTable ( ) ; editMode.setVisible ( false ) ; addFile.setVisible ( true ) ; deleteFile.setVisible ( true ) ; reviewMode.setVisible ( true ) ; }

Target:
void onEditMode ( @ java.lang.SuppressWarnings ( value = "unused" ) com.google.gwt.event.dom.client.ClickEvent e ) { fileTableMode = FileTable.Mode.EDIT ; refreshFileTable ( ) ; editMode.setVisible ( false ) ; addFile.setVisible ( true ) ; deleteFile.setVisible ( true ) ; renameFile.setVisible ( true ) ; reviewMode.setVisible ( true ) ; }